SoulWailerquesthammer.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. --[[
  2. Script Name : SpawnScripts/WailingCaves/SoulWailerquesthammer.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.07.14 10:07:06
  5. Script Purpose :
  6. :
  7. --]]
  8. local SoulWailer = 5318
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange", Spawn)
  11. end
  12. function InRange(NPC, Spawn)
  13. if HasQuest(Spawn, SoulWailer) then
  14. if GetQuestStep(Spawn, SoulWailer) == 2 then
  15. SetAccessToEntityCommand(Spawn,NPC,"Use Hammer", 1)
  16. SpawnSet(NPC, "show_command_icon", 1)
  17. SpawnSet(NPC, "display_hand_icon", 1)
  18. elseif QuestStepIsComplete(Spawn, SoulWailer, 2) then
  19. SetAccessToEntityCommand(Spawn,NPC,"Use Hammer", 0)
  20. SpawnSet(NPC, "show_command_icon", 0)
  21. SpawnSet(NPC, "display_hand_icon", 0)
  22. end
  23. elseif not HasQuest(Spawn, SoulWailer) then
  24. SetAccessToEntityCommand(Spawn,NPC,"Use Hammer", 0)
  25. SpawnSet(NPC, "show_command_icon", 0)
  26. SpawnSet(NPC, "display_hand_icon", 0)
  27. end
  28. end
  29. function casted_on(NPC, Spawn, SpellName)
  30. if SpellName == 'Use Hammer' then
  31. if GetQuestStep(Spawn, SoulWailer) == 2 then
  32. SetStepComplete(Spawn, SoulWailer, 2)
  33. end
  34. SetAccessToEntityCommand(Spawn,NPC,"Use Hammer", 0)
  35. SpawnSet(NPC, "show_command_icon", 0)
  36. SpawnSet(NPC, "display_hand_icon", 0)
  37. end
  38. end
  39. function respawn(NPC)
  40. spawn(NPC)
  41. end