pouchofstunsporepowder.lua 1.2 KB

12345678910111213141516171819202122232425262728
  1. --[[
  2. Script Name : ItemScripts/pouchofstunsporepowder.lua
  3. Script Purpose : clickable used in quest "Dust to Dust"
  4. Script Author : fearfx
  5. Script Date : 21 Jan 2017
  6. Script Notes : Pouch of Stunspore Powder (Item ID = 47613) used in Dust to Dust (quest ID = 158)
  7. Temp spell in here until Stunspore Paralysis is added to DB
  8. --]]
  9. local DustToDust = 158
  10. function used(Item, Player)
  11. local target = GetTarget(Player)
  12. local zone = GetZone(Player)
  13. if GetZoneID(zone) == 34 and GetRace(target) == 9 and GetTempVariable(target, "stunned") == nil and GetDistance(target, Player, 0) < 6 then
  14. CastSpell(target, 270086, 1, Player)
  15. AddStepProgress(Player, 158, 1, 1)
  16. SetTempVariable(target, "stunned", "1")
  17. elseif GetRace(target) ~= 9 then
  18. SendMessage(Player, "This item may only be used on a skeleton.", "yellow")
  19. elseif GetTempVariable(target, "stunned") ~= nil then
  20. SendMessage(Player, "This item can only be used once per target.", "yellow")
  21. elseif GetDistance(target, Player, 0) > 6 then
  22. SendMessage(Player, "Move closer to your target.", "yellow")
  23. else
  24. Say(Player, "Error... Please report to Dev team.")
  25. end
  26. end