qstunseenhandbarrel2.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --[[
  2. Script Name : SpawnScripts/Nektulos/qstunseenhandbarrel1.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.06.19 07:06:48
  5. Script Purpose :
  6. :
  7. --]]
  8. local ProveYourself = 5256
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange")
  11. end
  12. function InRange(NPC, Spawn)
  13. if GetQuestStep(Spawn, ProveYourself) == 1 then
  14. AddPrimaryEntityCommand(Spawn, NPC, "Leave the supplies", 3, "Leave the supplies", "", 100)
  15. SpawnSet(NPC, "show_command_icon", 1)
  16. SpawnSet(NPC, "display_hand_icon", 1)
  17. end
  18. end
  19. function casted_on(NPC, Spawn, SpellName)
  20. if SpellName == 'Leave the supplies' then
  21. if not QuestStepIsComplete(Spawn, ProveYourself, 1) then
  22. zone = GetZone(Spawn)
  23. SpawnByLocationID(zone, 100434)
  24. SetStepComplete(Spawn, ProveYourself, 1)
  25. SetAccessToEntityCommand(Spawn,NPC,"Leave the supplies", 0)
  26. SpawnSet(NPC, "show_command_icon", 0)
  27. SpawnSet(NPC, "display_hand_icon", 0)
  28. end
  29. end
  30. end
  31. function hailed(NPC, Spawn)
  32. FaceTarget(NPC, Spawn)
  33. end
  34. function respawn(NPC)
  35. spawn(NPC)
  36. end