awellspringcubleash.lua 943 B

12345678910111213141516171819202122
  1. --[[
  2. Script Name : ItemScripts/awellspringcubleash.lua
  3. Script Purpose : Leash used in quest "To Draw Upon Wellsprings"
  4. Script Author : Cynnar
  5. Script Date : 1/4/2016
  6. Script Notes : a Wellspring Cub Leash (Item ID = 45117) To Draw Upon Wellsprings (quest ID = 156)
  7. --]]
  8. local DrawUponWellsprings = 155
  9. function used(Item, Player)
  10. target = GetTarget(Player)
  11. if GetName(target) == 'a wellspring cub' and GetTempVariable(Player, "cub") == nil then
  12. if not IsInCombat(target) then
  13. CastEntityCommand(Player, target, 1278, "Leash")
  14. end
  15. elseif GetName(target) == 'a wellspring cub' and GetTempVariable(Player, "cub") ~= nil then
  16. SendMessage(Player, "You need to bring your currently leashed wellspring cub back to Calnozz before leashing another.", "yellow")
  17. elseif GetName(target) ~= "a wellspring cub" then
  18. SendMessage(Player, "You can only use this on a wellspring cub.", "yellow")
  19. end
  20. end