heres a boss i made:
Code:function CastSpell_onHealth(pUnit,Event) pUnit:SetScale(3) i = math.random() if i < 0.25 then print "Zul'Katrn: Tank Curse" --Prints this in your Ascent Console local plr = pUnit:GetClosestPlayer() pUnit:CastSpellOnTarget(18159,plr) pUnit:ClearThreatList() else m = math.random() if m < 0.5 then print "Zul'Katrn: Shadowbolt Volley" --Prints this in your Ascent Console b = math.random() if b > 0.5 then pUnit:SendChatMessage(12,0,"Puny ones, you cannot defeat me!") pUnit:PlaySoundToSet(11369) else pUnit:SendChatMessage(12,0,"Even all your forces combined cannot defeat me!") pUnit:PlaySoundToSet(11362) end pUnit:FullCastSpell(27646) pUnit:ClearThreatList() else print "Zul'Katrn: Spawn dual Bosses" --Prints this in your Ascent Console x = pUnit:GetX() y = pUnit:GetY() z = pUnit:GetZ() o = pUnit:GetO() x = x + 8 y = y + 8 pUnit:SpawnCreature(24766,x,y,z,o,168,12500) pUnit:ClearThreatList() end end end function boss_Repeat(pUnit) pUnit:RegisterEvent("CastSpell_onHealth",4000,1) pUnit:RegisterEvent("CastSpell_onHealth",11500,0) end RegisterUnitEvent(24766,1,"boss_Repeat") function Yell_onDeath(pUnit,Event) print "Zul'Katrn: Boss Dead!!!" --Prints this in your Ascent Console x = pUnit:GetX() y = pUnit:GetY() z = pUnit:GetZ() o = pUnit:GetO() x = x + 3 pUnit:PlaySoundToSet(11387) pUnit:SendChatMessage(12,0,"Impossible, how did you defeat me!!!") pUnit:SetScale(1) pUnit:SpawnCreature(24767,x,y,z,o,35,25000) end RegisterUnitEvent(24766,4,"Yell_onDeath") function Spirit_onSpawn(pUnit,Event) print "Zul'Katrn: Spirit Talking/Vendor Spawning." --Prints this in your Ascent Console x = pUnit:GetX() y = pUnit:GetY() z = pUnit:GetZ() o = pUnit:GetO() x = x + 1 pUnit:SendChatMessage(11,0,"You have freed my spirit and let me rest in peace, for this I thank you friend. Take Zul'Katrn's treasure, but be quick about it, he will disappear soon. But now I must go, farewell.") end RegisterUnitEvent(24767,6,"Spirit_onSpawn")
and heres one where i was fooling around testing a while loop:
Code:function luaGuy(pUnit,Event) num = 0 while num < 5 do pUnit:SendChatMessage(11,0,"Spammmmm!!!") num = num + 1 end end RegisterUnitEvent(24773,7,"luaGuy") function suicide(unit) unit:SendChatMessage(11,0,"Welcome to the suicide booth.") unit:LearnSpell(5) end RegisterUnitEvent(24774,7,"suicide")









Reply With Quote

