aBloodskulltowerguard.lua 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/aBloodskulltowerguard.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.03.01 06:03:42
  5. Script Purpose :
  6. :
  7. --]]
  8. require("SpawnScripts/Generic/BloodskullVoiceOvers")
  9. require "SpawnScripts/Generic/NPCModule"
  10. local BloodskullIntentions = 403
  11. function spawn(NPC, Spawn)
  12. NPCModule(NPC, Spawn)
  13. Bloodskull(NPC)
  14. OrcArmorCommon(NPC)
  15. end
  16. function hailed(NPC, Spawn)
  17. FaceTarget(NPC, Spawn)
  18. end
  19. function respawn(NPC)
  20. spawn(NPC)
  21. end
  22. function aggro(NPC, Spawn)
  23. --local chance = MakeRandomInt(0, 100)
  24. --if chance <= 25 then
  25. generic_aggro(NPC, Spawn)
  26. --end
  27. end
  28. function healthchanged(NPC, Spawn)
  29. local chance = MakeRandomInt(0, 100)
  30. if chance <= 25 then
  31. generic_healthchanged(NPC, Spawn)
  32. end
  33. end
  34. function death(NPC, Spawn)
  35. generic_death(NPC, Spawn)
  36. if GetQuestStep(Spawn, BloodskullIntentions) == 2 then
  37. local chance = math.random(1, 100)
  38. if chance >= 50 then
  39. local zone = GetZone(Spawn)
  40. local X = GetX(NPC)
  41. local Y = GetY(NPC)
  42. local Z = GetZ(NPC)
  43. local BloodskullOrders = SpawnMob(zone, 331126, true, X, Y, Z, 33.71)
  44. if BloodskullOrders ~= nil then
  45. AddSpawnAccess(BloodskullOrders, Spawn)
  46. AddTimer(NPC, 300000, "despawn", 1)
  47. end
  48. end
  49. end
  50. end
  51. function despawn(NPC, Spawn)
  52. local BloodskullOrders = GetSpawn(NPC, 331126)
  53. Despawn(BloodskullOrders)
  54. end