someveryoldbottles.lua 996 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/someveryoldbottles.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.05.23 09:05:01
  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) == 4 then
  14. SpawnSet(NPC, "display_hand_icon", 1)
  15. SpawnSet(NPC, "show_command_icon", 1)
  16. AddPrimaryEntityCommand(Spawn, NPC, "Grab the bottle", 3, "", "", 100, "")
  17. end
  18. end
  19. function casted_on(NPC, Spawn, SpellName)
  20. if SpellName == 'Grab the bottle' then
  21. if GetQuestStep(Spawn, TheWheelOfVaniki) == 4 then
  22. SetStepComplete(Spawn, TheWheelOfVaniki, 4)
  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