anoldvial.lua 985 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/anoldvial.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.05.24 05:05:24
  5. Script Purpose :
  6. :
  7. --]]
  8. local TheWheelOfVaniki = 5230
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 5, "InRange")
  11. end
  12. function InRange(NPC, Spawn)
  13. if GetQuestStep(Spawn, TheWheelOfVaniki) == 6 then
  14. SpawnSet(NPC, "display_hand_icon", 1)
  15. SpawnSet(NPC, "show_command_icon", 1)
  16. AddPrimaryEntityCommand(Spawn, NPC, "Grab the vial", 3, "", "", 100, "")
  17. end
  18. end
  19. function casted_on(NPC, Spawn, SpellName)
  20. if SpellName == 'Grab the vial' then
  21. if GetQuestStep(Spawn, TheWheelOfVaniki) == 6 then
  22. SetStepComplete(Spawn, TheWheelOfVaniki, 6)
  23. end
  24. AddTimer(NPC, 150, "remove_access", 1)
  25. end
  26. end
  27. function remove_access(NPC, Spawn)
  28. SpawnSet(NPC, "display_hand_icon", 0)
  29. SpawnSet(NPC, "show_command_icon", 0)
  30. end
  31. function respawn(NPC)
  32. spawn(NPC)
  33. end