9
3

aChest.lua 869 B

1234567891011121314151617181920212223242526
  1. --[[
  2. Script Name : SpawnScripts/Rogue_IrontoeInn/aChest.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.12.03 03:12:08
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. SetRequiredQuest(NPC,5786,1,0,0,1)
  10. end
  11. function casted_on(NPC, Spawn, SpellName)
  12. if SpellName == 'Search Chest' and not IsInCombat(Spawn) and GetDistance(NPC,Spawn) <= 6 then
  13. SetStepComplete(Spawn,5786,1)
  14. SendMessage(Spawn,"You quickly grab the written orders from the chest.")
  15. elseif SpellName == 'Search Chest' and not IsInCombat(Spawn) and GetDistance(NPC,Spawn) > 6 then
  16. SendMessage(Spawn,"You are too far from the chest to get a clear look.")
  17. elseif SpellName == 'Search Chest' and IsInCombat(Spawn) then
  18. SendMessage(Spawn,"You have been caught!")
  19. end
  20. end
  21. function respawn(NPC)
  22. spawn(NPC)
  23. end