9
3

adeadsoldier.lua 910 B

123456789101112131415161718192021222324252627282930313233343536
  1. --[[
  2. Script Name : SpawnScripts/QueensColony/adeadsoldier.lua
  3. Script Purpose : a dead soldier
  4. Script Author : Scatman
  5. Script Date : 2009.06.13
  6. Script Notes :
  7. --]]
  8. local DefiledSoldier = 2530024
  9. local APresenceOfEvil = 131
  10. function spawn(NPC)
  11. SetPlayerProximityFunction(NPC, 10, "InRange", "OutOfRange")
  12. end
  13. function hailed(NPC, Spawn)
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function InRange(NPC, Spawn)
  19. if HasQuest(Spawn, APresenceOfEvil) and GetQuestStep(Spawn, APresenceOfEvil) == 4 and not (GetTempVariable(NPC, "APresenceOfEvil_Activated") == "True") then
  20. SetStepComplete(Spawn, APresenceOfEvil, 4)
  21. SetTempVariable(NPC, "APresenceOfEvil_Activated", "True")
  22. local defiled = SpawnMob(GetZone(NPC), DefiledSoldier, 0, GetX(NPC), GetY(NPC), GetZ(NPC), GetHeading(NPC))
  23. if defiled ~= nil then
  24. Attack(NPC, Spawn)
  25. end
  26. Despawn(NPC, 2000)
  27. end
  28. end
  29. function OutOfRange(NPC, Spawn)
  30. end