9
3

anEnragedspirit2.lua 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. --[[
  2. Script Name : SpawnScripts/TroubledHaunt/anEnragedspirit2.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.11.27 04:11:32
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. require "SpawnScripts/Generic/CombatModule"
  10. function spawn(NPC, Spawn)
  11. combatModule(NPC, Spawn)
  12. -- SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  13. end
  14. function hailed(NPC,Spawn)
  15. FaceTarget(NPC, Spawn)
  16. Dialog.New(NPC, Spawn)
  17. Dialog.AddDialog("Might there be a release from this ... existence?")
  18. Dialog.AddVoiceover("voiceover/english/ghost_halfling_base_1/ft/ghost/ghost_halfling_base_1_1_death_gm_e09a504d.mp3", 2158192373, 320090825)
  19. PlayFlavor(NPC, "", "", "beg", 0,0, Spawn, 0)
  20. Dialog.AddOption("I can't promise freedom, but I give you respect and reverence in your passing.","Thank")
  21. Dialog.Start()
  22. end
  23. function InRange(NPC,Spawn)
  24. AddTimer(NPC,1000,"hailed",1,Spawn)
  25. end
  26. function Thank(NPC,Spawn)
  27. AddTimer(NPC,2500,"Spirit1",1,Spawn)
  28. AddTimer(NPC,6000,"Spirit2",1,Spawn)
  29. AddTimer(NPC,8000,"Absorb",1,Spawn)
  30. PlayFlavor(NPC, "voiceover/english/ghost_halfling_base_1/ft/ghost/ghost_halfling_base_1_1_halfhealth_gm_2816c2df.mp3", "This doesn't compare to never tasting fine food or ale again!", "thanks", 2582503316, 2897386632, Spawn, 0)
  31. end
  32. function Spirit1(NPC,Spwan)
  33. zone= GetZone(NPC)
  34. Ring = GetSpawnByLocationID(zone,133780860)
  35. ApplySpellVisual(Ring, 571)
  36. SpawnSet(NPC,"model_type",273)
  37. SpawnSet(NPC,"visual_state",0)
  38. end
  39. function Spirit2(NPC,Spawn)
  40. if GetDistance(NPC,Spawn)>1 then
  41. zone = GetZone(NPC)
  42. x = GetX(Spawn)
  43. y = GetY(Spawn)
  44. z = GetZ(Spawn)
  45. ApplySpellVisual(NPC,58)
  46. SpiritNPC = GetSpawnByLocationID(zone,133780861)
  47. MoveToLocation(SpiritNPC,x,y,z,4,"Spirit2")
  48. SpiritA = GetSpawnByLocationID(zone,133780862)
  49. SpiritB = GetSpawnByLocationID(zone,133780863)
  50. MoveToLocation(SpiritA,x,y,z,4,"Spirit2")
  51. MoveToLocation(SpiritB,x,y,z,4,"Spirit2")
  52. MoveToLocation(NPC,x,y,z,4,"Spirit2")
  53. else
  54. Absorb(NPC,Spawn)
  55. end
  56. end
  57. function Absorb(NPC,Spawn)
  58. x = GetX(Spawn)
  59. y = GetY(Spawn)
  60. z = GetZ(Spawn)
  61. MoveToLocation(SpiritNPC,x,y,z,4,"Spirit2")
  62. SpiritA = GetSpawnByLocationID(zone,133780862)
  63. SpiritB = GetSpawnByLocationID(zone,133780863)
  64. SpiritNPC = GetSpawnByLocationID(zone,133780861)
  65. Despawn(SpiritNPC)
  66. Despawn(SpiritA)
  67. Despawn(SpiritB)
  68. ApplySpellVisual(Spawn,57)
  69. end
  70. function respawn(NPC)
  71. spawn(NPC)
  72. end