9
3

aguardianstaff.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. --[[
  2. Script Name : SpawnScripts/QueensColony/aguardianstaff.lua
  3. Script Author : Premierio015
  4. Script Date : 2020.05.10 02:05:21
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. SetInvulnerable(NPC)
  10. SetLuaBrain(NPC)
  11. SetBrainTick(NPC, 500)
  12. Think(NPC)
  13. end
  14. function Think(NPC)
  15. local mostHated = GetMostHated(NPC)
  16. if mostHated ~= nil then
  17. --[[ Say(NPC, "Has most hated") --]]
  18. aggro(NPC, mostHated)
  19. end
  20. end
  21. function aggro(NPC, Spawn)
  22. --[[ Say(NPC, "In aggro()") --]]
  23. if GetTempVariable(NPC, "CASTING") ~= "True" then
  24. --[[ Say(NPC, "Casting spell") --]]
  25. SetTempVariable(NPC, "CASTING", "True")
  26. CastSpell(Spawn, 210018, 1, NPC)
  27. AddTimer(NPC, 1610, "FinishedCasting")
  28. end
  29. end
  30. function FinishedCasting(NPC)
  31. SetTempVariable(NPC, "CASTING", "False")
  32. end
  33. function killed(NPC, Spawn)
  34. local zone = GetZone(NPC)
  35. local Oofala = GetSpawnByLocationID(zone, 1584877)
  36. PlayFlavor(Oofala, "voiceover/english/tutorial_revamp/sorcerer_oofala/tutorial_island02_revamp/quest/citizenship_sorcerer_oofala_staffkill_5b312f60.mp3", "Ha! Did you see that?", "chuckle", 3419630960, 667923165)
  37. end
  38. function respawn(NPC)
  39. spawn(NPC)
  40. end