oren22a
01-02-09, 07:26 PM
hi this is my first thread i have a simple question for u guys...
i saw this code for example:
(its not my code it just for example..)
function Leviathan_Morph1(pUnit,Event)
if pUnit:GetHealthPct() <= 75 then
print "Group through stage 1"
pUnit:RemoveEvents()
pUnit:SetModel(18945)
pUnit:SendChatMessage(12, 0, "You think you are a match for me? Pfft, what about if I do.... THIS?")
pUnit:SetScale(0.3)
pUnit:CastSpell(25431)
pUnit:RegisterEvent("Leviathan_Talk", 15000, 0)
pUnit:RegisterEvent("Leviathan_SpellFirecone", 18000, 0)
pUnit:RegisterEvent("Leviathan_SpellFireball", 15000, 0)
pUnit:RegisterEvent("Leviathan_SpellFireRain", 8000, 0)
pUnit:RegisterEvent("Leviathan_SpellSteal", 20000, 0)
pUnit:RegisterEvent("Leviathan_Morph2", 1000, 0)
end
end
--Morph two, Ahune The Frost Lord display ID, IceFrostPhase enabled, 50 to 25 percent--
function Leviathan_Morph2(pUnit,Event)
if pUnit:GetHealthPct() <= 50 then
print "Group through stage 2"
pUnit:RemoveEvents()
pUnit:SetModel(23344)
pUnit:SendChatMessage(12, 0, "Hah, you think that you may triumph over me, but you are only halfway through this igneous shell of steel!")
pUnit:SetScale(0.3)
pUnit:CastSpell(7301)
pUnit:RegisterEvent("Leviathan_Talk", 15000, 0)
pUnit:RegisterEvent("Leviathan_SpellFrostbolt", 11000, 0)
pUnit:RegisterEvent("Leviathan_SpellBreath", 20000, 0)
pUnit:RegisterEvent("Leviathan_SpellClaw", 8000, 0)
pUnit:RegisterEvent("Leviathan_SpellCone", 15000, 0)
pUnit:RegisterEvent("Leviathan_SpellPlague", 17000, 0)
pUnit:RegisterEvent("Leviathan_Morph3", 1000, 0)
and i have a little question about the "pUnit:GetHealthPct() " command:
at the end of morph1 it "throws" to morph2 which first thing checks for bosses hp...
1. what will happen if boss hp is still over 50% while morph2 is triggered?
it will melee endless? or loop itself and cast again the same spells?
2. is triggering the function as: function Leviathan_Morph2(pUnit,Event)
will "inject" the function to the memory and once the boss hp will go under 50% it will auto trigger the rest of the function? or i need to re-trigger it again somehow in a period of time?
:0
im sorry i know its noobish q, but i just have to know lol :)
thank in advance to all helpers.. :)
i saw this code for example:
(its not my code it just for example..)
function Leviathan_Morph1(pUnit,Event)
if pUnit:GetHealthPct() <= 75 then
print "Group through stage 1"
pUnit:RemoveEvents()
pUnit:SetModel(18945)
pUnit:SendChatMessage(12, 0, "You think you are a match for me? Pfft, what about if I do.... THIS?")
pUnit:SetScale(0.3)
pUnit:CastSpell(25431)
pUnit:RegisterEvent("Leviathan_Talk", 15000, 0)
pUnit:RegisterEvent("Leviathan_SpellFirecone", 18000, 0)
pUnit:RegisterEvent("Leviathan_SpellFireball", 15000, 0)
pUnit:RegisterEvent("Leviathan_SpellFireRain", 8000, 0)
pUnit:RegisterEvent("Leviathan_SpellSteal", 20000, 0)
pUnit:RegisterEvent("Leviathan_Morph2", 1000, 0)
end
end
--Morph two, Ahune The Frost Lord display ID, IceFrostPhase enabled, 50 to 25 percent--
function Leviathan_Morph2(pUnit,Event)
if pUnit:GetHealthPct() <= 50 then
print "Group through stage 2"
pUnit:RemoveEvents()
pUnit:SetModel(23344)
pUnit:SendChatMessage(12, 0, "Hah, you think that you may triumph over me, but you are only halfway through this igneous shell of steel!")
pUnit:SetScale(0.3)
pUnit:CastSpell(7301)
pUnit:RegisterEvent("Leviathan_Talk", 15000, 0)
pUnit:RegisterEvent("Leviathan_SpellFrostbolt", 11000, 0)
pUnit:RegisterEvent("Leviathan_SpellBreath", 20000, 0)
pUnit:RegisterEvent("Leviathan_SpellClaw", 8000, 0)
pUnit:RegisterEvent("Leviathan_SpellCone", 15000, 0)
pUnit:RegisterEvent("Leviathan_SpellPlague", 17000, 0)
pUnit:RegisterEvent("Leviathan_Morph3", 1000, 0)
and i have a little question about the "pUnit:GetHealthPct() " command:
at the end of morph1 it "throws" to morph2 which first thing checks for bosses hp...
1. what will happen if boss hp is still over 50% while morph2 is triggered?
it will melee endless? or loop itself and cast again the same spells?
2. is triggering the function as: function Leviathan_Morph2(pUnit,Event)
will "inject" the function to the memory and once the boss hp will go under 50% it will auto trigger the rest of the function? or i need to re-trigger it again somehow in a period of time?
:0
im sorry i know its noobish q, but i just have to know lol :)
thank in advance to all helpers.. :)