Got a couple questions I need answered =)
Got me a boss going. I need to know how to make a npc spawn when he dies.
Then get the npc to say a couple things and not repeat himself. Anyway to do this?
Thanks
Got a couple questions I need answered =)
Got me a boss going. I need to know how to make a npc spawn when he dies.
Then get the npc to say a couple things and not repeat himself. Anyway to do this?
Thanks
+rep people who help you
is this what you are looking for?Code:function Test_OnDied(pUnit, Event) pUnit:RemoveEvents() pUnit:SpawnCreature(entryID, x, y, z, o, faction, duration) -- spawns the npc on death pUnit:SendChatMessage(14, 0, "What_HE_SAYS_HERE") end
Sort of.. I kinda know how to do this.. What I need is to make a npc say 1 or 2 things only once when he spawns and not repeat himself. Anyone know how to do this?
+rep people who help you
Anybody?
?
+rep people who help you
is this for a boss script? because there is no lua command to make an npc say something whenever they are spawned. however you could make him say something whenever he enters combat after being spawned. but this is the closest you will get with lua I believe.
you might be able to do what your asking with c++ though. I do not know enough c++ right now to help you though. sorry!
example in lua:
like this:
or like this:Code:function NPCNAME_OnEnterCombat(pUnit, Event) pUnit:SendChatMessage(14, 0, "Dialogue here") pUnit:RegisterEvent("NPCNAME_1", 1000, 0) end RegisterUnitEvent(13371337, 2, "NPCNAME_OnEnterCombat")
cannot remember if it is OnEnterCombat or OnCombat.Code:function NPCNAME_OnCombat(pUnit, Event) pUnit:SendChatMessage(14, 0, "Dialogue here") pUnit:RegisterEvent("NPCNAME_1", 1000, 0) end RegisterUnitEvent(13371337, 2, "NPCNAME_OnCombat")
I believe it is OnCombat though!
Last edited by y2kss66; 04-17-2009 at 07:11 AM.
there is a Lua command to make a boss say something whenever they are spawned.. its
Code:function Boss_OnSpawn(Unit,Event) Unit:RegisterEvent("Talk", 30000, 0) -- 30000 = 30 seconds function Talk(Unit,Event) local choice = math.random(1,5) if (choice == 1) then Unit:SendChatMessage(14, 0, "Text goes here")
What I need is how to make a boss spawn a npc ONCE when the boss dies. Then make the spawned npc say multiple things and not to repeat himself. I'm sure there is a way to do this.. I just don't know how. Anybody?
+rep people who help you
Try this.Code:function SpawnedNPC_OnSpawn(Unit,Event) Unit:RegisterEvent("NPCTalk1",2000, 1) Unit:RegisterEvent("NPCTalk2",5000, 1) Unit:RegisterEvent("NPCTalk3",8000, 1) Unit:RegisterEvent("NPCTalk4",11000, 1) Unit:RegisterEvent("NPCTalk5",14000, 1) Unit:RegisterEvent("NPCTalk6",17000, 1) end function NPCTalk1(Unit, Event) Unit:SendChatMessage(12, 0, "Your Text here 1") end function NPCTalk2(Unit, Event) Unit:SendChatMessage(12, 0, "Your Text here 2") end function NPCTalk3(Unit, Event) Unit:SendChatMessage(12, 0, "Your Text here 3") end function NPCTalk4(Unit, Event) Unit:SendChatMessage(12, 0, "Your Text here 4") end function NPCTalk5(Unit, Event) Unit:SendChatMessage(12, 0, "Your Text here 5") end function NPCTalk6(Unit, Event) Unit:SendChatMessage(12, 0, "Your Text here 6") end RegisterUnitEvent(YOUR SPAWNED NPCID, 18, "SpawnedNPC_OnSpawn")
Edit: did you managed it that the Boss spawns the npc when the Boss die?
Edit2: Maybe you can post your complete script, then we can add things like this^^
Last edited by Kaidos; 04-17-2009 at 06:21 PM.
Its a Malygos script. Its Moffman's script. Everything in red is what I added.Code:function Malygos_OnSpawn(Unit,Event) Unit:RegisterEvent("Talk", 30000, 0) -- 30000 = 30 seconds end function Malygos_OnCombat(pUnit, Event) pUnit:RegisterEvent("Malygos_Phase1", 100, 0) end function Malygos_OnLeaveCombat(pUnit, Event) pUnit:RemoveEvents() end function Malygos_OnKillTarget(pUnit, Event) pUnit:PlaySoundToSet(14521) pUnit:SendChatMessage(14, 0, "Heheheheh.. How very.. naive..") end function Malygos_OnDeath(pUnit, Event) pUnit:PlaySoundToSet(14540) pUnit:SendChatMessage(14, 0, "Unthinkable! The mortals will destroy.. e-everything.. my sister.. what have you..") pUnit:RemoveEvents() end RegisterUnitEvent(28859, 18, "Malygos_OnSpawn") RegisterUnitEvent(28859, 1, "Malygos_OnCombat") RegisterUnitEvent(28859, 2, "Malygos_OnLeaveCombat") RegisterUnitEvent(28859, 3, "Malygos_OnKillTarget") RegisterUnitEvent(28859, 4, "Malygos_OnDeath") function Talk(Unit,Event) local choice = math.random(1,5) if (choice == 1) then Unit:PlaySoundToSet(14512) Unit:SendChatMessage(14, 0, "Lesser beings, intruding here! A shame that your excess courage does not compensate for your stupidity!") elseif (choice == 2) then Unit:PlaySoundToSet(14513) Unit:SendChatMessage(14, 0, "None but the blue dragonflight are welcome here! Perhaps this is the work of Alexstrasza? Well then, she has sent you to your deaths.") elseif (choice == 3) then Unit:PlaySoundToSet(14514) Unit:SendChatMessage(14, 0, "What could you hope to accomplish, to storm brassily into my domain? To employ MAGIC? Against ME?") elseif (choice == 4) then Unit:PlaySoundToSet(14515) Unit:SendChatMessage(14, 0, "I am without limits here...the rules of your cherished reality do not apply...In this realm, I am in control...") elseif (choice == 5) then pUnit:PlaySoundToSet(14516); Unit:SendChatMessage(14, 0, "I give you one chance. Pledge loyalty to me, and perhaps I won't slaughter you for your insolence!") end end function Malygos_Surge_Of_Power(pUnit, Event) pUnit:FullCastSpell(56505) pUnit:PlaySoundToSet(14524); pUnit:SendChatMessage(14, 0, "I will teach you ignorant children just how little you know about magic!") end function Malygos_Arcane_Storm(pUnit, Event) pUnit:FullCastSpell(57459) end function Malygos_Arcane_Breath(pUnit, Event) pUnit:FullCastSpell(56272) pUnit:PlaySoundToSet(14518); pUnit:SendChatMessage(14, 0, "You will not succeed while I draw breath!") end function Malygos_Frenzy(pUnit, Event) pUnit:CastSpell(28131) pUnit:PlaySoundToSet(14533); pUnit:SendChatMessage(14, 0, "I am UNSTOPPABLE!") end function Malygos_Phase1(pUnit, Event) if pUnit:GetHealthPct() <= 100 then pUnit:RemoveEvents() pUnit:RegisterEvent("Malygos_Arcane_Breath", 6000, 0) pUnit:RegisterEvent("Malygos_Phase2", 100, 0) pUnit:SendChatMessage(14, 0, "My patience has reached its limit, I WILL BE RID OF YOU! ") pUnit:PlaySoundToSet(14517); end end function Malygos_Phase2(pUnit, Event) if pUnit:GetHealthPct() <= 50 then pUnit:RemoveEvents() pUnit:RegisterEvent("Malygos_Surge_Of_Power", 15000, 0) pUnit:RegisterEvent("Malygos_Arcane_Storm", 12000, 0) pUnit:RegisterEvent("Malygos_Phase3", 100, 0) pUnit:SendChatMessage(14, 0, "Few have experienced the pain I will now inflict on you! ") pUnit:PlaySoundToSet(14523); end end function Malygos_Phase3(pUnit, Event) if pUnit:GetHealthPct() <= 30 then pUnit:RemoveEvents() pUnit:RegisterEvent("Malygos_Frenzy", 120000, 0) pUnit:RegisterEvent("Malygos_EndPhase2", 100, 0) pUnit:SendChatMessage(14, 0, "Now your benefactors make their appearance...But they are too late. The powers contained here are powerful enough to destroy the world ten times over! What do you think they will do to you?") pUnit:PlaySoundToSet(14530); end end function Malygos_EndPhase2(pUnit, Event) if pUnit:GetHealthPct() <= 31 then pUnit:RemoveEvents() pUnit:SendChatMessage(14, 0, "ENOUGH! If you intend to reclaim Azeroth's magic, then you shall have it...") pUnit:PlaySoundToSet(14529); end end
Im thinking about redoing the whole thing though..
but.. anyways.. im sure you need to make a separate script for the spawned npc which shouldn't be hard.. but what i need is how to make that spawned npc say a few things when Malygos dies then doesn't repeat himself. I Didn't try the script you gave me yet but..
I still need help on spawning the npc after the boss dies.. maybe add a 10 second timer.. right when the boss dies it triggers. anyone know what to do?
Last edited by Moaradin; 04-18-2009 at 05:31 AM.
+rep people who help you
Ok i see...
Code:-----------------[[ Malygos ]]----------------- function Malygos_OnSpawn(Unit,Event) Unit:RegisterEvent("Talk", 30000, 0) -- 30000 = 30 seconds end function Malygos_OnCombat(pUnit, Event) pUnit:RegisterEvent("Malygos_Phase1", 100, 0) end function Malygos_OnLeaveCombat(pUnit, Event) pUnit:RemoveEvents() end function Malygos_OnKillTarget(pUnit, Event) pUnit:PlaySoundToSet(14521) pUnit:SendChatMessage(14, 0, "Heheheheh.. How very.. naive..") end function Malygos_OnDeath(pUnit, Event) pUnit:RegisterEvent("Malygos_Spawning", 5000, 1) -- added pUnit:PlaySoundToSet(14540) pUnit:SendChatMessage(14, 0, "Unthinkable! The mortals will destroy.. e-everything.. my sister.. what have you..") pUnit:RemoveEvents() end function Malygos_Spawning(pUnit, Event) -- function added pUnit:SpawnCreature(Your spawned npcID, x, y, z, o, faction, Duration) end --[ Duration means the npc will despawn after a time, set to " 0 " then the npc stays there forever ]-- RegisterUnitEvent(28859, 18, "Malygos_OnSpawn") RegisterUnitEvent(28859, 1, "Malygos_OnCombat") RegisterUnitEvent(28859, 2, "Malygos_OnLeaveCombat") RegisterUnitEvent(28859, 3, "Malygos_OnKillTarget") RegisterUnitEvent(28859, 4, "Malygos_OnDeath") function Talk(Unit,Event) local choice = math.random(1,5) if (choice == 1) then Unit:PlaySoundToSet(14512) Unit:SendChatMessage(14, 0, "Lesser beings, intruding here! A shame that your excess courage does not compensate for your stupidity!") elseif (choice == 2) then Unit:PlaySoundToSet(14513) Unit:SendChatMessage(14, 0, "None but the blue dragonflight are welcome here! Perhaps this is the work of Alexstrasza? Well then, she has sent you to your deaths.") elseif (choice == 3) then Unit:PlaySoundToSet(14514) Unit:SendChatMessage(14, 0, "What could you hope to accomplish, to storm brassily into my domain? To employ MAGIC? Against ME?") elseif (choice == 4) then Unit:PlaySoundToSet(14515) Unit:SendChatMessage(14, 0, "I am without limits here...the rules of your cherished reality do not apply...In this realm, I am in control...") elseif (choice == 5) then pUnit:PlaySoundToSet(14516); Unit:SendChatMessage(14, 0, "I give you one chance. Pledge loyalty to me, and perhaps I won't slaughter you for your insolence!") end end function Malygos_Surge_Of_Power(pUnit, Event) pUnit:FullCastSpell(56505) pUnit:PlaySoundToSet(14524); pUnit:SendChatMessage(14, 0, "I will teach you ignorant children just how little you know about magic!") end function Malygos_Arcane_Storm(pUnit, Event) pUnit:FullCastSpell(57459) end function Malygos_Arcane_Breath(pUnit, Event) pUnit:FullCastSpell(56272) pUnit:PlaySoundToSet(14518); pUnit:SendChatMessage(14, 0, "You will not succeed while I draw breath!") end function Malygos_Frenzy(pUnit, Event) pUnit:CastSpell(28131) pUnit:PlaySoundToSet(14533); pUnit:SendChatMessage(14, 0, "I am UNSTOPPABLE!") end function Malygos_Phase1(pUnit, Event) if pUnit:GetHealthPct() <= 100 then pUnit:RemoveEvents() pUnit:RegisterEvent("Malygos_Arcane_Breath", 6000, 0) pUnit:RegisterEvent("Malygos_Phase2", 100, 0) pUnit:SendChatMessage(14, 0, "My patience has reached its limit, I WILL BE RID OF YOU! ") pUnit:PlaySoundToSet(14517); end end function Malygos_Phase2(pUnit, Event) if pUnit:GetHealthPct() <= 50 then pUnit:RemoveEvents() pUnit:RegisterEvent("Malygos_Surge_Of_Power", 15000, 0) pUnit:RegisterEvent("Malygos_Arcane_Storm", 12000, 0) pUnit:RegisterEvent("Malygos_Phase3", 100, 0) pUnit:SendChatMessage(14, 0, "Few have experienced the pain I will now inflict on you! ") pUnit:PlaySoundToSet(14523); end end function Malygos_Phase3(pUnit, Event) if pUnit:GetHealthPct() <= 30 then pUnit:RemoveEvents() pUnit:RegisterEvent("Malygos_Frenzy", 120000, 0) pUnit:RegisterEvent("Malygos_EndPhase2", 100, 0) pUnit:SendChatMessage(14, 0, "Now your benefactors make their appearance...But they are too late. The powers contained here are powerful enough to destroy the world ten times over! What do you think they will do to you?") pUnit:PlaySoundToSet(14530); end end function Malygos_EndPhase2(pUnit, Event) if pUnit:GetHealthPct() <= 31 then pUnit:RemoveEvents() pUnit:SendChatMessage(14, 0, "ENOUGH! If you intend to reclaim Azeroth's magic, then you shall have it...") pUnit:PlaySoundToSet(14529); end end -----------------[[ Spawned Npc ]]----------------- --[[ This is the script for your Spawned npc ]]-- function SpawnedNPC_OnSpawn(Unit,Event) Unit:RegisterEvent("NPCTalk1",2000, 1) Unit:RegisterEvent("NPCTalk2",5000, 1) Unit:RegisterEvent("NPCTalk3",8000, 1) Unit:RegisterEvent("NPCTalk4",11000, 1) Unit:RegisterEvent("NPCTalk5",14000, 1) Unit:RegisterEvent("NPCTalk6",17000, 1) end function NPCTalk1(Unit, Event) Unit:SendChatMessage(12, 0, "Your Text here 1") end function NPCTalk2(Unit, Event) Unit:SendChatMessage(12, 0, "Your Text here 2") end function NPCTalk3(Unit, Event) Unit:SendChatMessage(12, 0, "Your Text here 3") end function NPCTalk4(Unit, Event) Unit:SendChatMessage(12, 0, "Your Text here 4") end function NPCTalk5(Unit, Event) Unit:SendChatMessage(12, 0, "Your Text here 5") end function NPCTalk6(Unit, Event) Unit:SendChatMessage(12, 0, "Your Text here 6") end RegisterUnitEvent(Your spawned npcID, 18, "SpawnedNPC_OnSpawn")
I marked the things i added...
You could try this script.
This include the scripts for Malygos and the Npc you want to spawn.
Now edit these things:
You must add the coordinates and the npc ID from your npc you will spawn after the death of Malygos.Code:function Malygos_Spawning(pUnit, Event) -- function added pUnit:SpawnCreature(Your spawned npcID, x, y, z, o, faction, Duration) end
Add your Spawned npc ID here too.
Code:RegisterUnitEvent(Your spawned npcID, 18, "SpawnedNPC_OnSpawn")
You can add the Texts for your spawned npc yourself here:
Just include your Text in the " ".Code:function NPCTalk1(Unit, Event) Unit:SendChatMessage(12, 0, "Your Text here 1") end function NPCTalk2(Unit, Event) Unit:SendChatMessage(12, 0, "Your Text here 2") end function NPCTalk3(Unit, Event) Unit:SendChatMessage(12, 0, "Your Text here 3") end function NPCTalk4(Unit, Event) Unit:SendChatMessage(12, 0, "Your Text here 4") end function NPCTalk5(Unit, Event) Unit:SendChatMessage(12, 0, "Your Text here 5") end function NPCTalk6(Unit, Event) Unit:SendChatMessage(12, 0, "Your Text here 6") end
On Spawn he talk every 3 seconds a different text.
Thanks.. but all this really helps is makes my Malygos script and Alexstrasza into one script.. but.. the npc is not spawning 10 seconds after the boss dies (how I have it set up)
when I manually spawn the npc.. the script works.. but when Malygos dies.. the npc does not spawn. Here is the full script
Any more suggestions?Code:-----------------[[ Malygos ]]----------------- function Malygos_OnSpawn(Unit,Event) Unit:RegisterEvent("Talk", 30000, 0) -- 30000 = 30 seconds end function Malygos_OnCombat(pUnit, Event) pUnit:RegisterEvent("Malygos_Phase1", 100, 0) end function Malygos_OnLeaveCombat(pUnit, Event) pUnit:RemoveEvents() end function Malygos_OnKillTarget(pUnit, Event) pUnit:PlaySoundToSet(14521) pUnit:SendChatMessage(14, 0, "Heheheheh.. How very.. naive..") end function Malygos_OnDeath(pUnit, Event) pUnit:RegisterEvent("Malygos_Spawning", 10000, 1) -- added pUnit:PlaySoundToSet(14540) pUnit:SendChatMessage(14, 0, "Unthinkable! The mortals will destroy.. e-everything.. my sister.. what have you..") end function Malygos_Spawning(pUnit, Event) -- function added pUnit:SpawnCreature(32295, x, y, z, o, 35, 100000) end --[ Duration means the npc will despawn after a time, set to " 0 " then the npc stays there forever ]-- RegisterUnitEvent(28859, 18, "Malygos_OnSpawn") RegisterUnitEvent(28859, 1, "Malygos_OnCombat") RegisterUnitEvent(28859, 2, "Malygos_OnLeaveCombat") RegisterUnitEvent(28859, 3, "Malygos_OnKillTarget") RegisterUnitEvent(28859, 4, "Malygos_OnDeath") function Talk(Unit,Event) local choice = math.random(1,5) if (choice == 1) then Unit:PlaySoundToSet(14512) Unit:SendChatMessage(14, 0, "Lesser beings, intruding here! A shame that your excess courage does not compensate for your stupidity!") elseif (choice == 2) then Unit:PlaySoundToSet(14513) Unit:SendChatMessage(14, 0, "None but the blue dragonflight are welcome here! Perhaps this is the work of Alexstrasza? Well then, she has sent you to your deaths.") elseif (choice == 3) then Unit:PlaySoundToSet(14514) Unit:SendChatMessage(14, 0, "What could you hope to accomplish, to storm brassily into my domain? To employ MAGIC? Against ME?") elseif (choice == 4) then Unit:PlaySoundToSet(14515) Unit:SendChatMessage(14, 0, "I am without limits here...the rules of your cherished reality do not apply...In this realm, I am in control...") elseif (choice == 5) then pUnit:PlaySoundToSet(14516); Unit:SendChatMessage(14, 0, "I give you one chance. Pledge loyalty to me, and perhaps I won't slaughter you for your insolence!") end end function Malygos_Surge_Of_Power(pUnit, Event) pUnit:FullCastSpell(56505) pUnit:PlaySoundToSet(14524); pUnit:SendChatMessage(14, 0, "I will teach you ignorant children just how little you know about magic!") end function Malygos_Arcane_Storm(pUnit, Event) pUnit:FullCastSpell(57459) end function Malygos_Arcane_Breath(pUnit, Event) pUnit:FullCastSpell(56272) pUnit:PlaySoundToSet(14518); pUnit:SendChatMessage(14, 0, "You will not succeed while I draw breath!") end function Malygos_Frenzy(pUnit, Event) pUnit:CastSpell(28131) pUnit:PlaySoundToSet(14533); pUnit:SendChatMessage(14, 0, "I am UNSTOPPABLE!") end function Malygos_Phase1(pUnit, Event) if pUnit:GetHealthPct() <= 100 then pUnit:RemoveEvents() pUnit:RegisterEvent("Malygos_Arcane_Breath", 6000, 0) pUnit:RegisterEvent("Malygos_Phase2", 100, 0) pUnit:SendChatMessage(14, 0, "My patience has reached its limit, I WILL BE RID OF YOU! ") pUnit:PlaySoundToSet(14517); end end function Malygos_Phase2(pUnit, Event) if pUnit:GetHealthPct() <= 50 then pUnit:RemoveEvents() pUnit:RegisterEvent("Malygos_Surge_Of_Power", 15000, 0) pUnit:RegisterEvent("Malygos_Arcane_Storm", 12000, 0) pUnit:RegisterEvent("Malygos_Phase3", 100, 0) pUnit:SendChatMessage(14, 0, "Few have experienced the pain I will now inflict on you! ") pUnit:PlaySoundToSet(14523); end end function Malygos_Phase3(pUnit, Event) if pUnit:GetHealthPct() <= 30 then pUnit:RemoveEvents() pUnit:RegisterEvent("Malygos_Frenzy", 120000, 0) pUnit:RegisterEvent("Malygos_EndPhase2", 100, 0) pUnit:SendChatMessage(14, 0, "Now your benefactors make their appearance...But they are too late. The powers contained here are powerful enough to destroy the world ten times over! What do you think they will do to you?") pUnit:PlaySoundToSet(14530); end end function Malygos_EndPhase2(pUnit, Event) if pUnit:GetHealthPct() <= 31 then pUnit:RemoveEvents() pUnit:SendChatMessage(14, 0, "ENOUGH! If you intend to reclaim Azeroth's magic, then you shall have it...") pUnit:PlaySoundToSet(14529); end end -----------------[[ Spawned Npc ]]----------------- --[[ This is the script for your Spawned npc ]]-- function SpawnedNPC_OnSpawn(Unit,Event) Unit:RegisterEvent("NPCTalk1",7000, 1) Unit:RegisterEvent("NPCTalk2",12000, 1) Unit:RegisterEvent("NPCTalk3",25000, 1) Unit:RegisterEvent("NPCTalk4",50000, 1) end function NPCTalk1(Unit, Event) Unit:PlaySoundToSet(14406); Unit:SendChatMessage(12, 0, "I did what I had to, brother.. You gave me no alternative.") end function NPCTalk2(Unit, Event) Unit:PlaySoundToSet(14407); Unit:SendChatMessage(12, 0, "And so ends the Nexus War.") end function NPCTalk3(Unit, Event) Unit:PlaySoundToSet(14408); Unit:SendChatMessage(12, 0, "This resolution pains me deeply, but the destruction, the monumental loss of life had to end. Regardless of Malygos' recent transgressions, I will mourn his loss. He was once a guardian, a protector. This day, one of the world's mightiest has fallen.") end function NPCTalk4(Unit, Event) Unit:PlaySoundToSet(14409); Unit:SendChatMessage(12, 0, "The red dragonflight will take on the burden of mending the devastation wrought on Azeroth. Return home to your people and rest. Tomorrow will bring you new challenges, and you must be ready to face them. Life.. goes on.") end RegisterUnitEvent(32295, 18, "SpawnedNPC_OnSpawn")
+rep people who help you
This is good
btw.:
did you change this? i mean the x,y,z,o coordinate of Alexstrasza's position?
Code:pUnit:SpawnCreature(32295, x, y, z, o, 35, 100000)
If you do that and it didnt work, we can try to do 2 things:
1. Instant Spawn Alexstrasza after Malygos died.
2. If 1. not work, Instant Spawn Alexstrasza, when Malygos is under 2% or 1%... at the moment i cant find a 3.1 arcEmu server, so you must test it^^
This is the script to Instant spawn Alexstrasza after Death of Malygos:
Code:-----------------[[ Malygos ]]----------------- function Malygos_OnSpawn(Unit,Event) Unit:RegisterEvent("Talk", 30000, 0) -- 30000 = 30 seconds end function Malygos_OnCombat(pUnit, Event) pUnit:RegisterEvent("Malygos_Phase1", 100, 0) end function Malygos_OnLeaveCombat(pUnit, Event) pUnit:RemoveEvents() end function Malygos_OnKillTarget(pUnit, Event) pUnit:PlaySoundToSet(14521) pUnit:SendChatMessage(14, 0, "Heheheheh.. How very.. naive..") end function Malygos_OnDeath(pUnit, Event) pUnit:SpawnCreature(32295, x, y, z, o, 35, 100000) --Instantspawn at death pUnit:PlaySoundToSet(14540) pUnit:SendChatMessage(14, 0, "Unthinkable! The mortals will destroy.. e-everything.. my sister.. what have you..") --pUnit:RegisterEvent("Malygos_Spawning", 10000, 1) end --function Malygos_Spawning(pUnit, Event) -- function added --pUnit:SpawnCreature(32295, x, y, z, o, 35, 100000) --end --[ Duration means the npc will despawn after a time, set to " 0 " then the npc stays there forever ]-- RegisterUnitEvent(28859, 18, "Malygos_OnSpawn") RegisterUnitEvent(28859, 1, "Malygos_OnCombat") RegisterUnitEvent(28859, 2, "Malygos_OnLeaveCombat") RegisterUnitEvent(28859, 3, "Malygos_OnKillTarget") RegisterUnitEvent(28859, 4, "Malygos_OnDeath") function Talk(Unit,Event) local choice = math.random(1,5) if (choice == 1) then Unit:PlaySoundToSet(14512) Unit:SendChatMessage(14, 0, "Lesser beings, intruding here! A shame that your excess courage does not compensate for your stupidity!") elseif (choice == 2) then Unit:PlaySoundToSet(14513) Unit:SendChatMessage(14, 0, "None but the blue dragonflight are welcome here! Perhaps this is the work of Alexstrasza? Well then, she has sent you to your deaths.") elseif (choice == 3) then Unit:PlaySoundToSet(14514) Unit:SendChatMessage(14, 0, "What could you hope to accomplish, to storm brassily into my domain? To employ MAGIC? Against ME?") elseif (choice == 4) then Unit:PlaySoundToSet(14515) Unit:SendChatMessage(14, 0, "I am without limits here...the rules of your cherished reality do not apply...In this realm, I am in control...") elseif (choice == 5) then pUnit:PlaySoundToSet(14516); Unit:SendChatMessage(14, 0, "I give you one chance. Pledge loyalty to me, and perhaps I won't slaughter you for your insolence!") end end function Malygos_Surge_Of_Power(pUnit, Event) pUnit:FullCastSpell(56505) pUnit:PlaySoundToSet(14524); pUnit:SendChatMessage(14, 0, "I will teach you ignorant children just how little you know about magic!") end function Malygos_Arcane_Storm(pUnit, Event) pUnit:FullCastSpell(57459) end function Malygos_Arcane_Breath(pUnit, Event) pUnit:FullCastSpell(56272) pUnit:PlaySoundToSet(14518); pUnit:SendChatMessage(14, 0, "You will not succeed while I draw breath!") end function Malygos_Frenzy(pUnit, Event) pUnit:CastSpell(28131) pUnit:PlaySoundToSet(14533); pUnit:SendChatMessage(14, 0, "I am UNSTOPPABLE!") end function Malygos_Phase1(pUnit, Event) if pUnit:GetHealthPct() <= 100 then pUnit:RemoveEvents() pUnit:RegisterEvent("Malygos_Arcane_Breath", 6000, 0) pUnit:RegisterEvent("Malygos_Phase2", 100, 0) pUnit:SendChatMessage(14, 0, "My patience has reached its limit, I WILL BE RID OF YOU! ") pUnit:PlaySoundToSet(14517); end end function Malygos_Phase2(pUnit, Event) if pUnit:GetHealthPct() <= 50 then pUnit:RemoveEvents() pUnit:RegisterEvent("Malygos_Surge_Of_Power", 15000, 0) pUnit:RegisterEvent("Malygos_Arcane_Storm", 12000, 0) pUnit:RegisterEvent("Malygos_Phase3", 100, 0) pUnit:SendChatMessage(14, 0, "Few have experienced the pain I will now inflict on you! ") pUnit:PlaySoundToSet(14523); end end function Malygos_Phase3(pUnit, Event) if pUnit:GetHealthPct() <= 30 then pUnit:RemoveEvents() pUnit:RegisterEvent("Malygos_Frenzy", 120000, 0) pUnit:RegisterEvent("Malygos_EndPhase2", 100, 0) pUnit:SendChatMessage(14, 0, "Now your benefactors make their appearance...But they are too late. The powers contained here are powerful enough to destroy the world ten times over! What do you think they will do to you?") pUnit:PlaySoundToSet(14530); end end function Malygos_EndPhase2(pUnit, Event) if pUnit:GetHealthPct() <= 31 then pUnit:RemoveEvents() pUnit:SendChatMessage(14, 0, "ENOUGH! If you intend to reclaim Azeroth's magic, then you shall have it...") pUnit:PlaySoundToSet(14529); end end -----------------[[ Spawned Npc ]]----------------- --[[ This is the script for your Spawned npc ]]-- function SpawnedNPC_OnSpawn(Unit,Event) Unit:RegisterEvent("NPCTalk1",7000, 1) Unit:RegisterEvent("NPCTalk2",12000, 1) Unit:RegisterEvent("NPCTalk3",25000, 1) Unit:RegisterEvent("NPCTalk4",50000, 1) end function NPCTalk1(Unit, Event) Unit:PlaySoundToSet(14406); Unit:SendChatMessage(12, 0, "I did what I had to, brother.. You gave me no alternative.") end function NPCTalk2(Unit, Event) Unit:PlaySoundToSet(14407); Unit:SendChatMessage(12, 0, "And so ends the Nexus War.") end function NPCTalk3(Unit, Event) Unit:PlaySoundToSet(14408); Unit:SendChatMessage(12, 0, "This resolution pains me deeply, but the destruction, the monumental loss of life had to end. Regardless of Malygos' recent transgressions, I will mourn his loss. He was once a guardian, a protector. This day, one of the world's mightiest has fallen.") end function NPCTalk4(Unit, Event) Unit:PlaySoundToSet(14409); Unit:SendChatMessage(12, 0, "The red dragonflight will take on the burden of mending the devastation wrought on Azeroth. Return home to your people and rest. Tomorrow will bring you new challenges, and you must be ready to face them. Life.. goes on.") end RegisterUnitEvent(32295, 18, "SpawnedNPC_OnSpawn")
This is the script for spawning Alexstrasza when Malygos get under 1%:
(If this didnt work, change the if pUnit:GetHealth() <= 1 to if pUnit:GetHealth() <= 2)
Code:-----------------[[ Malygos ]]----------------- function Malygos_OnSpawn(Unit,Event) Unit:RegisterEvent("Talk", 30000, 0) -- 30000 = 30 seconds end function Malygos_OnCombat(pUnit, Event) pUnit:RegisterEvent("Malygos_Phase1", 100, 0) end function Malygos_OnLeaveCombat(pUnit, Event) pUnit:RemoveEvents() end function Malygos_OnKillTarget(pUnit, Event) pUnit:PlaySoundToSet(14521) pUnit:SendChatMessage(14, 0, "Heheheheh.. How very.. naive..") end function Malygos_OnDeath(pUnit, Event) pUnit:PlaySoundToSet(14540) pUnit:SendChatMessage(14, 0, "Unthinkable! The mortals will destroy.. e-everything.. my sister.. what have you..") end --[ Duration means the npc will despawn after a time, set to " 0 " then the npc stays there forever ]-- RegisterUnitEvent(28859, 18, "Malygos_OnSpawn") RegisterUnitEvent(28859, 1, "Malygos_OnCombat") RegisterUnitEvent(28859, 2, "Malygos_OnLeaveCombat") RegisterUnitEvent(28859, 3, "Malygos_OnKillTarget") RegisterUnitEvent(28859, 4, "Malygos_OnDeath") function Talk(Unit,Event) local choice = math.random(1,5) if (choice == 1) then Unit:PlaySoundToSet(14512) Unit:SendChatMessage(14, 0, "Lesser beings, intruding here! A shame that your excess courage does not compensate for your stupidity!") elseif (choice == 2) then Unit:PlaySoundToSet(14513) Unit:SendChatMessage(14, 0, "None but the blue dragonflight are welcome here! Perhaps this is the work of Alexstrasza? Well then, she has sent you to your deaths.") elseif (choice == 3) then Unit:PlaySoundToSet(14514) Unit:SendChatMessage(14, 0, "What could you hope to accomplish, to storm brassily into my domain? To employ MAGIC? Against ME?") elseif (choice == 4) then Unit:PlaySoundToSet(14515) Unit:SendChatMessage(14, 0, "I am without limits here...the rules of your cherished reality do not apply...In this realm, I am in control...") elseif (choice == 5) then pUnit:PlaySoundToSet(14516); Unit:SendChatMessage(14, 0, "I give you one chance. Pledge loyalty to me, and perhaps I won't slaughter you for your insolence!") end end function Malygos_Surge_Of_Power(pUnit, Event) pUnit:FullCastSpell(56505) pUnit:PlaySoundToSet(14524); pUnit:SendChatMessage(14, 0, "I will teach you ignorant children just how little you know about magic!") end function Malygos_Arcane_Storm(pUnit, Event) pUnit:FullCastSpell(57459) end function Malygos_Arcane_Breath(pUnit, Event) pUnit:FullCastSpell(56272) pUnit:PlaySoundToSet(14518); pUnit:SendChatMessage(14, 0, "You will not succeed while I draw breath!") end function Malygos_Frenzy(pUnit, Event) pUnit:CastSpell(28131) pUnit:PlaySoundToSet(14533); pUnit:SendChatMessage(14, 0, "I am UNSTOPPABLE!") end function Malygos_Phase1(pUnit, Event) if pUnit:GetHealthPct() <= 100 then pUnit:RemoveEvents() pUnit:RegisterEvent("Malygos_Arcane_Breath", 6000, 0) pUnit:RegisterEvent("Malygos_Phase2", 100, 0) pUnit:SendChatMessage(14, 0, "My patience has reached its limit, I WILL BE RID OF YOU! ") pUnit:PlaySoundToSet(14517); end end function Malygos_Phase2(pUnit, Event) if pUnit:GetHealthPct() <= 50 then pUnit:RemoveEvents() pUnit:RegisterEvent("Malygos_Surge_Of_Power", 15000, 0) pUnit:RegisterEvent("Malygos_Arcane_Storm", 12000, 0) pUnit:RegisterEvent("Malygos_Phase3", 100, 0) pUnit:SendChatMessage(14, 0, "Few have experienced the pain I will now inflict on you! ") pUnit:PlaySoundToSet(14523); end end function Malygos_Phase3(pUnit, Event) if pUnit:GetHealthPct() <= 30 then pUnit:RemoveEvents() pUnit:RegisterEvent("Malygos_Frenzy", 120000, 0) pUnit:RegisterEvent("Malygos_EndPhase2", 100, 0) pUnit:SendChatMessage(14, 0, "Now your benefactors make their appearance...But they are too late. The powers contained here are powerful enough to destroy the world ten times over! What do you think they will do to you?") pUnit:PlaySoundToSet(14530); end end function Malygos_EndPhase2(pUnit, Event) if pUnit:GetHealthPct() <= 31 then pUnit:RemoveEvents() pUnit:SendChatMessage(14, 0, "ENOUGH! If you intend to reclaim Azeroth's magic, then you shall have it...") pUnit:PlaySoundToSet(14529); pUnit:RegisterEvent("Malygos_Alexstrasza", 100, 0) end end function Malygos_Alexstrasza(pUnit, Event) if pUnit:GetHealthPct() <= 1 then pUnit:RemoveEvents() pUnit:SpawnCreature(32295, x, y, z, o, 35, 100000) --add coordinates! :D end end -----------------[[ Spawned Npc ]]----------------- --[[ This is the script for your Spawned npc ]]-- function SpawnedNPC_OnSpawn(Unit,Event) Unit:RegisterEvent("NPCTalk1",7000, 1) Unit:RegisterEvent("NPCTalk2",12000, 1) Unit:RegisterEvent("NPCTalk3",25000, 1) Unit:RegisterEvent("NPCTalk4",50000, 1) end function NPCTalk1(Unit, Event) Unit:PlaySoundToSet(14406); Unit:SendChatMessage(12, 0, "I did what I had to, brother.. You gave me no alternative.") end function NPCTalk2(Unit, Event) Unit:PlaySoundToSet(14407); Unit:SendChatMessage(12, 0, "And so ends the Nexus War.") end function NPCTalk3(Unit, Event) Unit:PlaySoundToSet(14408); Unit:SendChatMessage(12, 0, "This resolution pains me deeply, but the destruction, the monumental loss of life had to end. Regardless of Malygos' recent transgressions, I will mourn his loss. He was once a guardian, a protector. This day, one of the world's mightiest has fallen.") end function NPCTalk4(Unit, Event) Unit:PlaySoundToSet(14409); Unit:SendChatMessage(12, 0, "The red dragonflight will take on the burden of mending the devastation wrought on Azeroth. Return home to your people and rest. Tomorrow will bring you new challenges, and you must be ready to face them. Life.. goes on.") end RegisterUnitEvent(32295, 18, "SpawnedNPC_OnSpawn")
Thanks a bunch man! Im using the first one =)
+Repx2
got one more problem which is probably a DB problem..
Alexstrasza looks like shes just standing in the air with no fl ying emotion! :O
+rep people who help you