9
3

aCommonerPanicked_(3).lua 961 B

123456789101112131415161718192021222324252627282930313233343536
  1. --[[
  2. Script Name : SpawnScripts/Darklight/aCommonerPanicked_(3).lua
  3. Script Purpose : Panicked commoners before completing quest, "Reclaiming the Sablevein Tear"
  4. Script Author : Cynnar
  5. Script Date : 10/15/2015
  6. Script Notes : a commoner (spawn_id 340142) (spawn_location_id 584437, 584438)
  7. Script Notes : Location is in Hate's Envy
  8. --]]
  9. local SealingTheRift = 122
  10. local ReclaimingTheSableveinTear = 124
  11. function spawn(NPC, Player)
  12. AddSpawnAccess(NPC, NPC)
  13. SetPlayerProximityFunction(NPC, 990, "QuestCheck", "QuestCheck")
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function QuestCheck(NPC, Player)
  19. if HasCompletedQuest(Player, SealingTheRift) then
  20. if not HasCompletedQuest(Player, ReclaimingTheSableveinTear) then
  21. AddSpawnAccess(NPC, Player)
  22. AddTimer(NPC, 2000, "kickrubble")
  23. else
  24. RemoveSpawnAccess(NPC, Player)
  25. end
  26. end
  27. end
  28. function kickrubble(NPC)
  29. PlayFlavor(NPC, "", "", "kick", 0, 0)
  30. AddTimer(NPC, 2000, "kickrubble")
  31. end