PDA

View Full Version : How To LUA script


lilnate22
11-30-2007, 11:07 AM
since the cumquats and retards.com loves to steal my work and not give credit, i decided to do the same....enjoy



-== How to make a Npc Cast a spell ==-



Ok first here is a Template to use for it \/

Everything in red u need to change
How to use template look below
Code:

function NpcName_Event (pUnit, Event)
pUnit:CastSpell (Spell ID)
end
RegisterUnitEvent (Npc Spawn ID, 4, "NpcName_Event")

Step 1 : All the things in red is the things u need to put in your self

Step 2 : Open a note Pad or Txt Document and Copy and Paste that Template into it and then start modifying it with Steps below

Step 3 : function NpcName_Event (pUnit, Event) = The Name of your Npc

Step 4 : function NpcName_Event (pUnit, Event) = The event, meaning like the name of the spell Etc

Step 5 : pUnit:CastSpell (Spell ID) = The Id of the Spell that you wont your Npc To cast

Step 6 : RegisterUnitEvent (Npc Spawn ID, 4, "NpcName_Event") = The Spawn ID of your Npc that you wont to cast the Spell

Step 7 : RegisterUnitEvent (Npc Spawn ID, 4, "NpcName_Event") = The same ass "Step 3" and "Step 4"

And now Naming it

Naming it is the hard part well kinda not really. Now when your done Modifying it go to File > Save as > and put it as all Files and call it like (If you are doing it for a mob called Slayer i would call it Slayer.lua) So like in "Step 3" The Name of your Npc just name it That and put a .lua at the end of it so it will be like " Slayer.lua "

Saving It : save it to your Desktop or some were u know were it is

Step 10 : Now were u Have to put it u must put it in your Server's Ascent scripts Folder i am using Ac web so it would be in the folder \/

C:\AC Web Ultimate Repack\Ascent\scripts

If u don't have a scripts folder make 1 and just put that Notepad in that Folder and then in your Ascent cmd box type
reloadscripts or in game type .reloadscripts or restart your server

And then your Done

-== Make a npc Talk when in Enter Combat Etc ==-


Ok first here is a Template to use for it \/

Everything in red u need to change
How to use template look below

Code:

function NpcName_Event (pUnit, Event)
pUnit:SendChatMessage (Type, Language, "What you wont your Npc to say")
end
RegisterUnitEvent (Npc Spawn ID, When, "Name_Event")

Step 1 : All the things in red is the things u need to put in your self

Step 2 : Open a note Pad or Txt Document and Copy and Paste that Template into it and then start modifying it with Steps below

Step 3 : function NpcName_Event (pUnit, Event) = the Name of the Npc that you wont to talk on the Event

Step 4 : function NpcName_Event (pUnit, Event) = the event of when the Npc will say what you wont it to say (Like Entercombat, Leavecombat, die, Etc)

Step 5 : pUnit:SendChatMessage (Type, Language, "What you wont your Npc to say") = the Type of text \/

Code:

-1 = ADDON
0 = SAY
1 = PARTY
2 = RAID
3 = GUILD
4 = OFFICER
5 = YELL
6 = WHISPER
7 = WHISPER_INFORM
8 = EMOTE
9 = TEXT_EMOTE
10 = SYSTEM
11 = MONSTER_SAY
12 = MONSTER_YELL
13 = MONSTER_WHISPER
14 = CHANNEL
16 = CHANNEL_JOIN
17 = CHANNEL_LEAVE
18 = CHANNEL_LIST
19 = CHANNEL_NOTICE
20 = CHANNEL_NOTICE_USER
21 = AFK
22 = DND
23 = COMBAT_LOG
24 = IGNORED
25 = SKILL
32 = LOOT
83 = BATTLEGROUND_EVENT
87 = RAIDLEADER
88 = RAIDWARNING

Step 6 : pUnit:SendChatMessage (Type, Language, "What you wont your Npc to say") = the Type of Language \/

Code:

0 = UNIVERSAL
1 = ORCISH
2 = DARNASSIAN
3 = TAURAHE
6 = DWARVISH
7 = COMMON
8 = DEMONIC
9 = TITAN
10 = THELASSIAN
11 = DRACONIC
12 = KALIMAG
13 = GNOMISH
14 = TROLL
33 = GUTTERSPEAK
35 = DRAENEI

Step 7 : pUnit:SendChatMessage (Type, Language, "What you wont your Npc to say") = The words that you wont your Npc to say when it enter combat Leaves combat Dies Etc

Step 8 : RegisterUnitEvent (Npc Spawn ID, When, "Name_Event") = The Spawn id of the Npc that you wont these words to come otu of

Step 9 : RegisterUnitEvent (Npc Spawn ID, When, "Name_Event") = When the Npc will say this Text \/
Code:


1 = Enter Combat
2 = Leave Combat
3 = Killed Target
4 = Died
5 = AI Tick
6 = Spawn
7 = Gossip Talk
8 = Reach Waypoint
9 = On Leave Limbo
10 = Player Enters Range

Step 10 : RegisterUnitEvent (Npc Spawn ID, When, "Name_Event") = The name of the Npc like in "Step 3"

Step 11 : RegisterUnitEvent (Npc Spawn ID, When, "Name_Event") = the Event of the Npc when it talks, it must be the same as "Step 4"


And now Naming it

Naming it is the hard part well kinda not really. Now when your done Modifying it go to File > Save as > and put it as all Files and call it like (If you are doing it for a mob called Slayer i would call it Slayer.lua) So like in "Step 3" The Name of your Npc just name it That and put a .lua at the end of it so it will be like " Slayer.lua "

Saving It : save it to your Desktop or some were u know were it is

Step 12 : Now were u Have to put it u must put it in your Server's Ascent scripts Folder i am using Ac web so it would be in the folder \/

C:\AC Web Ultimate Repack\Ascent\scripts

If u don't have a scripts folder make 1 and just put that Notepad in that Folder and then in your Ascent cmd box type
reloadscripts or in game type .reloadscripts or restart your server

And then your Done


-==Make a npc change size when every==--



Ok first here is a Template to use for it \/

Everything in red u need to change
How to use template look below

Code:

function WhenScale(pUnit, Event)
pUnit:SetScale(Size);
end
RegisterUnitEvent(Npc Spawn ID,When,"WhenScale")

Step 1 : All the things in red is the things u need to put in your self

Step 2 : Open a note Pad or Txt Document and Copy and Paste that Template into it and then start modifying it with Steps below

Step 3 : function WhenScale(pUnit, Event) = When the Npc will Change Size (So if it was oncombat, i would put there "OnCombatScale" Etc


Step 4 : pUnit:SetScale(Size); = The Size of your Npc will be
When he gets to the Stage ( Chose from 0.1 - 200, any high might crash Server)

Step 5 : RegisterUnitEvent(Npc Spawn ID,When,"WhenScale") = The Spawn Id of the Npc that you wont to grow

Step 6 : RegisterUnitEvent(Npc Spawn ID,When,"WhenScale") = When they Npc will grow chose one from below \/

Code:


1 = Enter Combat
2 = Leave Combat
3 = Killed Target
4 = Died
5 = AI Tick
6 = Spawn
7 = Gossip Talk
8 = Reach Waypoint
9 = On Leave Limbo
10 = Player Enters Range

Step 7 : RegisterUnitEvent(Npc Spawn ID,When,"WhenScale") = When the Npc will Change Size (So if it was oncombat, i would put there "OnCombatScale" Etc The same ass what you put in "Step 3"



And now Naming it

Naming it is the hard part well kinda not really. Now when your done Modifying it go to File > Save as > and put it as all Files and call it like (If you are doing it for a mob called Slayer i would call it Slayer.lua) So like in "Step 3" The Name of your Npc just name it That and put a .lua at the end of it so it will be like " Slayer.lua "

Saving It : save it to your Desktop or some were u know were it is

Step 8 : Now were u Have to put it u must put it in your Server's Ascent scripts Folder i am using Ac web so it would be in the folder \/

C:\AC Web Ultimate Repack\Ascent\scripts

If u don't have a scripts folder make 1 and just put that Notepad in that Folder and then in your Ascent cmd box type
reloadscripts or in game type .reloadscripts or restart your server

And then your Done

ggace
11-30-2007, 12:19 PM
Should help out a few people. Nice job nate!

Remus
12-01-2007, 05:15 AM
good going break the system, and ty for the nice tut

playboy87
12-01-2007, 06:07 AM
Nice Nate get back at them aholes.

KeizerHalil
12-01-2007, 09:41 AM
Make a freakin movie!

Terrorblade
12-04-2007, 12:23 PM
good work Nate +rep

LanceDH
12-04-2007, 07:31 PM
"All the things in red is the things u need to put in your self"

I think it would be nice for some people if you color the things that should be red

but without colors, its still a nice guide

EDIT: forgot to ask,
function NpcName_Event (pUnit, Event) = The Name of your Npc
my npc is called Elite guard, so what should i type ? Elite Guard or Elite_Guard or something else ?

talonhunter
12-09-2007, 06:34 PM
Only reason people keep stealing your work Nate, is because you actually know what you are doing... not to mention that they don't understand that if they would just ask and give credit, you would help them out usually. I don't have a public server, but once again, thanks for helping the community Nate!

Illidan.
12-13-2007, 08:26 AM
Dude wtf, you stole this from me on MMOwned, im Illidan1 on MMOwned y would you steal this from me man
http://www.mmowned.com/forums/emulator-server-guides/65496-guide-lua-scripting-guide-here-updating.html

playboy87
12-13-2007, 08:57 AM
cause yall steal from nate & others from here looks like & i hear alot , another mmowned noob comes here god save us all.

Illidan.
12-13-2007, 08:23 PM
Wtf, i haven't Steeled anything from here, i only here for Ac-Web Repacks (Go Jargs!)
WTF are you guys on about

Golepa
12-13-2007, 08:31 PM
Obviously lilnate22 hates you guys from mmowned. I totally agree.

CyClone
12-14-2007, 07:00 PM
I got a LUA related question. I'm trying to get Illidan attack a random guy, so i wrote this:

atkunit = pUnit:GetRandomPlayer(7)
msg = string.format("You die, %s", atkunit:GetName())

pUnit:SendChatMessage(12, 0, msg)
pUnit:ClearThreatList()
pUnit:SetTauntedBy(atkunit)

It isnt the full thing, but it do's get to this point and the console error is:

scripts\illidan.lua:24: Attempt to index global 'atkunit' (a nil value)

dragoon478
12-15-2007, 04:09 AM
thank you for this awesome guide (waiting for Admin to come online to add the stuff to the DB so i can debug it.) thx ever so much +rep

KeizerHalil
12-15-2007, 10:12 AM
Download navicate here: http://www.ac-web.org/forum/showthread.php?t=6841
Free and cracked, so full version yay!!!!111

babablksheep
12-15-2007, 08:48 PM
Dude whether you leeched this or not, you are awesome I love your vid tuts, you helped me and a lot of others a lot, keep up the good work :p

Wildcard999
12-15-2007, 10:07 PM
You know what Illidan you obviously think it sucks to have your crap stolen, so now you know how it feels. Whether Nate did or not you have taken more of his crap then anyone has and have posted it like it was yours. Dont give me that crap that you haven't taken Nates things either. He probably did this to piss you off and I dont blame him. About time you learn to give credit to things that people do instead of trying to make yourself look good.

Illidan.
12-15-2007, 10:24 PM
Wildcard, if you look any were, i have reposted NONE of Nate stuff

voodoofury
01-12-2008, 07:02 PM
hey man could you tell me how to do multiple spells or how to make them cast more than once?

doublehex
01-12-2008, 07:04 PM
just make the spells instant casts

Jewel
01-17-2008, 01:18 PM
Any examples so the Noobs will get the idea?

Darhan
01-17-2008, 01:20 PM
function Lukrana_Acid(Unit, event, miscunit, misc)
Unit:FullCastSpell(24839)
end

function Lukrana_Light(Unit, event, miscunit, misc)
Unit:SendChatMessage(11, 0, "Feel the Wrath of the Vortexes!")
Unit:SendChatMessage(12, 0, "Whaaa!")
Unit:FullCastSpell(40088)

end

function Lukrana_Bolts(Unit, event, miscunit, misc)
Unit:SendChatMessage(12, 0, "Time for Some Vortex Bolts!")
Unit:FullCastSpell(38839)
end

function Lukrana_Cloud(Unit, event, miscunit, misc)
Unit:SendChatMessage(12, 0, "Do you guys like stormy clouds? I do!")
Unit:FullCastSpell(44417)
end

function Lukrana_Phase1(Unit, event, miscunit, misc)
if Unit:GetHealthPct() < 90 then
Unit:RemoveEvents()
Unit:SendChatMessage(12, 0, "I will crush you little bugs!")
Unit:RegisterEvent("Lukrana_Acid",15000,0)
Unit:RegisterEvent("Lukrana_Phase2",1000,0)
end
end

function Lukrana_Phase2(Unit, event, miscunit, misc)
if Unit:GetHealthPct() < 60 then
Unit:RemoveEvents()
Unit:SendChatMessage(12, 0, "You make me mad!")
Unit:RegisterEvent("Lukrana_Light",10000,0)
Unit:RegisterEvent("Lukrana_Bolts",20000,0)
Unit:RegisterEvent("Lukrana_Phase3",1000,0)
end
end

function Lukrana_Phase3(Unit, event)
if Unit:GetHealthPct() < 40 then
Unit:RemoveEvents()
Unit:SendChatMessage(12, 0, "Time for some Lightning Clouds!")
Unit:RegisterEvent("Lukrana_Cloud",30000,0)
Unit:RegisterEvent("Lukrana_Light",15000,0)
end
end

function Lukrana_OnCombat(Unit, event)
Unit:SendChatMessage(12, 0, "You guys think that you guys can handle me? Well, bring it!")
Unit:RegisterEvent("Lukrana_Phase1",1000,0)
end

function Lukrana_OnDeath(Unit, event)
Unit:RemoveEvents()
Unit:SendChatMessage(12, 0, "Sorry.....my....Master...")

end

function Lukrana_OnLeaveCombat(Unit, event)
Unit:RemoveEvents()

end



RegisterUnitEvent(194452,1,"Lukrana_OnCombat")
RegisterUnitEvent(194452,2,"Lukrana_OnLeaveCombat")
RegisterUnitEvent(194452,4,"Lukrana_OnDeath")



:P

M3DIC911
01-17-2008, 08:07 PM
i dont know why ppl mind if there guide is stolen, lilnate never said that he wrote it, but yeah Illidan you should type it below your guide (Not to RIP), and Lilnate should have posted that he has ripped :p

uberfun
01-17-2008, 09:15 PM
bump, and +rep

Ariac
01-17-2008, 09:37 PM
In this line here,
RegisterUnitEvent (Npc Spawn ID, 4, "NpcName_Event")

The red is highlighted in the original post, but nothing describes what to do with it. It's a 1 in the template and a 4 in the example. Any clarification on this?

Darhan
01-18-2008, 04:45 AM
It means that if the Npc dies, it will be registered. :D

1 means on combat.
2 means when the NPC leaves combat
3 means On killed target
4 means on Death.

joshy1001
02-19-2008, 09:34 AM
function Noth_Entercombat (pUnit, Event)
pUnit:SendChatMessage (5, 0, "Glory to the master!")
end


RegisterUnitEvent (15954, 1, "Noth_Entercombat")



function Noth_CurseofthePlaguebringer (pUnit, Event)
pUnit:CastSpell (29213)
pUnit:SendChatMessage (12, 0, "Your life is forfeit.")
pUnit:PlaySoundToSet (8846)
end

RegisterUnitEvent (15954, 4, "Noth_CurseofthePlaguebringer")

can enyone tell me what im doing wrong?

evildude170
02-19-2008, 08:45 PM
so we just open notepad and follow the template to script?

xerex
02-21-2008, 06:13 PM
Hei can someone help me with my script please lol i'm trying to make the teleport npc say... hey some and look i can teleport you!

function NpcName_Event (pUnit, Event)
pUnit:SendChatMessage (5, 0, "Come and look i can teleport you!")
end
RegisterUnitEvent (822334, 10, "Name_Event")

Please help me

doublehex
02-21-2008, 06:30 PM
function TeleportNPC_Event (pUnit, Event)
pUnit:SendChatMessage (5, 0, "Come and look i can teleport you!")
end
RegisterUnitEvent (822334, 10, "TeleportNPC_Event")

xerex
02-21-2008, 07:33 PM
Dunno why but it's not working!

evildude170
02-21-2008, 11:18 PM
ok im trying to get illidan to do shadowstep.

function Illidan_Shadowstep (pUnit, Event)
pUnit:CastSpell (36554)
end
RegisterUnitEvent (22917, 4, "Illidan_Shadowstep")


ok so what am i doing wrong?

deathdude
02-21-2008, 11:21 PM
ok im trying to get illidan to do shadowstep.

function Illidan_Shadowstep (pUnit, Event)
pUnit:CastSpell(36554)
end
RegisterUnitEvent (22917, 4, "Illidan_Shadowstep")


ok so what am i doing wrong?

might be wrong but i think theres not supposed to be a space here pUnit:CastSpell (36554)
try and make it look like this
pUnit:CastSpell(36554)

im probably wrong but just try it.

Xander112
02-25-2008, 01:28 PM
Yeh can somebody help me make a lua scriped to make this np called Enrage Giant (87517) Cast "Concussion Blow" (12809) on a player that critical strikes him?

Darhan
02-25-2008, 01:37 PM
not possible, well atleast not the Critical strike ..

Xander112
02-25-2008, 01:50 PM
What about the his target every 30 seconds?

Darhan
02-25-2008, 01:50 PM
Possible

Xander112
02-25-2008, 01:53 PM
Care to tell me? :P

Darhan
02-25-2008, 01:56 PM
BLeh xD Do you have experience with lua?

Xander112
02-25-2008, 01:57 PM
Well im trying to understand it, i will try and you can tell me if its ok

Ok so here is what i made:
funtion Enrage_Giant_Concussion_Blow(Unit, event, miscunit, misc)
if Untit:?? then
Unit:FulCastSpellonTarget(12809,Unit:GetTarget())
Unit:SendChatMessage(11, 0, "Stop right there!...)
end

TegisterUnitEvent(87517,1,"Enrage Giant")

I put red what i was not sure.

Darhan
02-25-2008, 02:01 PM
function mob_OnCombat(unit, Event)
unit:RegisterEvent("mob_Blow",30000, 0)
end

function mob_Blow(unit, Event)
unit:CastSpell(12809)
end


RegisterUnitEvent(entryid, 1, "mob_OnCombat")

It would be something like this.

Xander112
02-25-2008, 02:08 PM
So this would work:

funtion Enrage_Giant_OnCombat(unit, Event)
unit:RegisterEvent("Enrage_Giant_Blow",30000,0)
end

funtion Enrage_Giant_Blow(unit, Event)
unit:CastSpell(12809)
end

RegisterUnitEvent(87517, 1, "Enrage_Giant_OnCombat")

Darhan
02-25-2008, 02:09 PM
funtion EnrageGiant_OnCombat(unit, Event)
unit:RegisterEvent("EnrageGiant_Blow",30000,0)
end

funtion EnrageGiant_Blow(unit, Event)
unit:CastSpell(12809)
end

RegisterUnitEvent(87517, 1, "EnrageGiant_OnCombat")

Xander112
02-25-2008, 02:10 PM
Thanks a lot! +rep

Humanfighter
02-25-2008, 02:54 PM
Omg did you like to type something?
I readed like 10 min to understand it xD

realyo3
07-13-2008, 04:56 PM
sorry but im a script noob never done one so would this work?

function kierans minions_pyroblast (pUnit, pyroblast)
pUnit:CastSpell (33938)
end
RegisterUnitEvent (Npc Spawn ID, 11636, "kierans minions_pyroblast")

Boxi
07-22-2008, 03:49 PM
How do I make the boss repeat like a simple spell for every 15sec? :s

mozdi
07-28-2008, 02:59 AM
I like it i wanna more!!! Lua tut
and i wathed the other lua scripts in the folder
they also can be used to make a new script
now i undesrtand mysql i need to learn lua and combine lua with php
like wow dbor wowhead does....

CoolkidCardell
02-08-2009, 09:49 AM
im just learning to script lua, this was handy

Jonsyyy
03-14-2009, 06:33 PM
Lol I worked now about 16 hours for this stupid script. I don´t know what Im doing wrong so can anybody help me ?
I get no error but he doesn´t get in the phases and doesn´t cast anything
My script:

function Malaan_Timestop(Unit, Event)
Unit:CastSpell(31422)
end
RegisterUnitEvent (752492, 4, "Malaan_Timestop")


function Malaan_Summon(Unit, Event)
local x = Unit:GetX() ;
local y = Unit:GetY() ;
local z = Unit:GetZ() ;
local o = Unit:GetO() ;
Unit:SpawnCreature(14389, 2663,525391, 2019,839844, 99,514107, 6,048354, 14, 120000) ;
end
RegisterUnitEvent (752492, 4, "Malaan_Summon")

function Malaan_Timestop2(Unit, Event)
Unit:CastSpell(31422)
end

function Malaan_Flugphase(Unit, Event)
Unit:SendChatMessage(14, 0, "Wenn ihr gewusst haettet, was Zeit alles mit uns anstellen kann...")
Unit:CastSpell(17131)
Unit:CastSpell(36921)
end
RegisterUnitEvent (752492, 4, "Malaan_Flugphase")

function Malaan_Flugphase2(Unit, Event)
Unit:SendChatMessage(13, 0, "Vorbei, verweht, nie wieder.")
Unit:CastSpell(58829, Unit:GetRandomPlayer(0))
end
RegisterUnitEvent (752492, 4, "Malaan_Flugphase2")

function Malaan_MegaSummon(Unit, Event)
local x = Unit:GetX() ;
local y = Unit:GetY() ;
local z = Unit:GetZ() ;
local o = Unit:GetO() ;
Unit:SpawnCreature(14389, 2663,525391, 2019,839844, 99,514107, 6,048354, 14, 120000) ;
end
RegisterUnitEvent (752492, 4, "Malaan_MegaSummon")

function Malaan_MegaTimestop(Unit, Event)
Unit:CastSpell(31422)
end

function Malaan_Flugphaseb(Unit, Event)
Unit:CastSpell(17131)
Unit:CastSpell(36921)
end
RegisterUnitEvent (752492, 4, "Malaan_MegaTimestop")

function Malaan_Flugphase2b(Unit, Event)
Unit:CastSpell(58829, Unit:GetRandomPlayer(0))
end
RegisterUnitEvent (752492, 4, "Malaan_Flugphase2b")

function Malaan_Phase1(Unit, Event)
Unit:RemoveEvents()
Unit:SendChatMessage(12, 0, "Eure Dummheit hat euch also endlich eingeholt.")
Unit:SendChatMessage(88, 0, "***Malaan´s 1. Phase Beginnt***")
Unit:sendChatMessage(88, 0, " *** Timestop und Summon ***")
Unit:RegisterEvent("Malaan_Timestop", 9000, 0)
Unit:RegisterEvent("Malaan_Summon", 12000, 0)
Unit:RegisterEvent("Malaan_Phase2", 1000, 0)
end
RegisterUnitEvent (752492, 4, "Malaan_Phase1")

function Malaan_Phase2(Unit, Event)
if Unit:GetHealthPct() <= 60 then
Unit:RemoveEvents()
Unit:SendChatMessage(12, 0, "So leicht wird das nicht!")
Unit:SendChatMessage(88, 0, " ***Malaan´s 2. Phase Beginnt***")
Unit:sendChatMessage(88, 0, "***Feuerkegel und Zeitverschiebung***")
Unit:RegisterEvent("Malaan_Flugphase", 1000, 0)
Unit:RegisterEvent("Malaan_Flugphase2", 750, 0)
Unit:RegisterEvent("Malaan_Phase3", 1000, 0)
end
end
RegisterUnitEvent (752492, 4, "Malaan_Phase2")

function Malaan_Phase3(Unit, Event)
if Unit:GetHealthPct() <= 40 then
Unit:RemoveEvents()
Unit:SendChatMessage(12, 0, "Solange ich atme, werdet ihr nicht ob siegen!")
Unit:SendChatMessage(88, 0, "***Malaan´s 3. Phase Beginnt***")
Unit:sendChatMessage(88, 0, "***MegaSummon und Feuerkegel***")
Unit:RegisterEvent("Malaan_MegaSummon", 3000, 0)
Unit:RegisterEvent("Malaan_Flugphase", 1000, 0)
Unit:RegisterEvent("Malaan_Phase4", 1000, 0)
end
end
RegisterUnitEvent (752492, 4, "Malaan_Phase3")

function Malaan_Phase4(Unit, Event)
if Unit:GetHealthPct() <= 30 then
Unit:RemoveEvents()
Unit:SendChatMessage(12, 0, "Meine Geduld ist am Ende! Ich werde mich euer endledigen!")
Unit:SendChatMessage(88, 0, "***Malaan´s Timeout Phase Beginnt ***")
Unit:sendChatMessage(88, 0, " ***Haut alle eure Dots drauf!!!***")
Unit:RegisterEvent("Malaan_Timestop2", 6500, 0)
Unit:RegisterEvent("Malaan_Flugphase2", 3000, 0)
Unit:RegisterEvent("Malaan_Phase5", 1000, 0)
end
end
RegisterUnitEvent (752492, 4, "Malaan_Phase4")

function Malaan_Phase5(Unit, Event)
if Unit:GetHealthPct() <= 20 then
Unit:RemoveEvents()
Unit:SendChatMessage(12, 0, "Mir sind hier keinerlei Grenzen gesetzt. Die Gesetze der von euch so geschaetzten Realitaet gelten hier nicht. In diesem Reich habe ich die Kontrolle...")
Unit:SendChatMessage(88, 0, " ***Malaan´s letzte Phase Beginnt***")
Unit:sendChatMessage(88, 0, "***UltraFeuerkegel und UltraAnsturm***")
Unit:RegisterEvent("Malaan_Flugphaseb", 1000, 0)
Unit:RegisterEvent("Malaan_Flugphase2b", 100, 0)
Unit:RegisterEvent("Malaan_Timestop", 12000, 0)
Unit:RegisterEvent("Malaan_MegaSummon", 6000, 0)
end
end
RegisterUnitEvent (752492, 4, "Malaan_Phase5")

function Malaan_OnCombat(Unit, event)
Unit:RegisterEvent("Malaan_Phase1", 1000 , 0)
end


function Malaan_OnDied(Unit, Event)
Unit:RemoveEvents()
end

function Malaan_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end

RegisterUnitEvent(752492, 1, "Malaan_OnCombat")
RegisterUnitEvent(752492, 2, "Malaan_OnLeaveCombat")
RegisterUnitEvent(752492, 4, "Malaan_OnDied")