PDA

View Full Version : [ICC] Rotface



P1raten
05-02-10, 05:01 AM
All credits goes to me.

This script is made for the boss called RotFace.


-- >>Defines<<

-- <<NPC's>>

local Littleooze = nil
local Bigooze = nil
local Rotface = nil

-- <<Spells>>

local Oozeflood
local Radiatingooze
local Slimespray
local Mutatedinfection
local Unstableooze

-- <<Bools>>

local heroicmode = false
local merged = false
local merges = 0
local Heroic = {}

-- >>Functions<<

function Rotface_OnCombat(pUnit, Event)
Rotface = pUnit
if (heroicmode == false) then
pUnit:RegisterEvent("ChooseMode", 500, 1)
else
pUnit:RegisterEvent("TheFightStarts", 600, 1)
end
end

function ChooseMode(pUnit, Event)
if (Heroic[id].RaidType == 1 ) then -- non heroic 10man
Oozeflood = 69789
Slimespray = 69508
Mutatedinfection = 69674
Radiatingooze = 69760
Unstableooze = 69839
elseif (Heroic[id].RaidType == 2) then -- non heroic 25man
Oozeflood = 71215
Slimespray = 69508
Mutatedinfection = 73022
Radiatingooze = 71212
Unstableooze = 73029
elseif (Heroic[id].RaidType == 3) then -- heroic 10man
Oozeflood = 71215
Slimespray = 69508
Mutatedinfection = 71224
Radiatingooze = 73026
Unstableooze = 73029
elseif (Heroic[id].RaidType == 4) then -- heroic 25man
Oozeflood = 71215
Slimespray = 69508
Mutatedinfection = 73023
Radiatingooze = 73072
Unstableooze = 73030
end
heroicmode = true
return Rotface_OnCombat
end

function TheFightStarts(pUnit, Event)
pUnit:RegisterEvent("Ooze_Flood", 8000, 1)
pUnit:RegisterEvent("SlimeSpray", 20000, 1)
pUnit:RegisterEvent("Mutated_Infection", 3000, 1)
end

function Ooze_Flood(pUnit, Event)
local ranx = math.random(6, 16)
local rany = math.random(6, 16)
local flood = flood + 1
if (flood == 1) then
pUnit:CastSpellAoF(ranx, rany, z, Oozeflood)
end
if (flood == 2) then
local x = ranx + 25
local y = rany + 25
pUnit:CastSpellAoF(x, y, z, Oozeflood)
end
if (flood == 3) then
local x = ranx - 25
local y = rany + 25
pUnit:CastSpellAoF(x, y, z, Oozeflood)
end
if (flood == 4) then
local x = ranx + 25
local y = rany - 25
pUnit:CastSpellAoF(x, y, z, Oozeflood)
end
if (flood == 5) then
local x = ranx - 25
local y = rany - 25
pUnit:CastSpellAoF(x, y, z, Oozeflood)
flood = 0
end
return TheFightStarts
end

function SlimeSpray(pUnit, Event)
pUnit:SendChatMessage(41, 0, "Rotface begins to cast Slime Spray!")
pUnit:FullCastSpellOnTarget(Slimespray, pUnit:GetRandomPlayer(0))
return TheFightStarts
end

function Mutated_Infection(pUnit, Event)
local playr = pUnit:GetRandomPlayer(0)
pUnit:FullCastSpellOnTarget(Mutatedinfection, playr)
pUnit:RegisterEvent("LittleOoze", 15000, 1)
end

function LittleOoze(pUnit, Event)
local playr = pUnit:GetRandomPlayer(0)
local x = playr:GetX()
local y = playr:GetY()
local z = playr:GetZ()
pUnit:SpawnCreature(36897, x, y, z, 21, 0)
end

function LittleOoze_OnCombat(pUnit, Event)
pUnit = Littleooze
local npc = pUnit:GetCreatureNearestCoords(x, y, z, 36897)
if (merged == false) then
if (npc == nil) then
if Littleooze:GetDistance(npc) < 5 then
npc:FullCastSpell(69889)
end
end
end
pUnit:RegisterEvent("Sticky_Ooze", 7000, 0)
pUnit:RegisterEvent("Radiating_Ooze", 11000, 0)
end

function Sticky_Ooze(pUnit, Event)
pUnit:FullCastSpellOnTarget(69774, pUnit:GetRandomPlayer(0))
end

function Radiating_Ooze(pUnit, Event)
pUnit:FullCastSpell(69750)
end

function BigOoze_OnCombat(pUnit, Event)
local npc = pUnit:GetCreatureNearestCoords(x, y, z, 36897)
if npc == nil then
else
if pUnit:GetDistance(npc) < 5 then
merges = merges + 1
npc:Despawn(1, 0)
pUnit:FullCastSpell(69558)
end
if (merges > 4) then
pUnit:RegisterEvent("BigOoze_ExpoMode", 1000, 0)
end
end
end

function BigOoze_ExpoMode(pUnit, Event)
pUnit:Root()
pUnit:FullCastSpell(Unstableooze)
pUnit:FullCastSpell(5)
end

-- >>Registering Events<<

RegisterUnitEvent(36627, 1, "Rotface_OnCombat")
RegisterUnitEvent(36897, 1, "LittleOoze_OnCombat")
RegisterUnitEvent(36899, 1, "BigOoze_OnCombat")

Vix
05-02-10, 06:40 PM
Very nice script

P1raten
06-02-10, 07:21 AM
Thank you.

DiegoLotzy
06-02-10, 03:43 PM
Can you do scripts for all bosses in icc?

P1raten
08-02-10, 02:20 AM
Can you do scripts for all bosses in icc?
I can. I'll see if i have the time. :)

Kevlan85
08-02-10, 10:21 AM
I can. I'll see if i have the time. :)

Omg that would be awesome!

And btw, have you tested the script?
Because I'm getting errors when the server is loading the scripts

Dimman
08-02-10, 10:24 AM
Omg that would be awesome!

And btw, have you tested the script?
Because I'm getting errors when the server is loading the scripts
Post your errors if you need assist :) ;)

Kevlan85
08-02-10, 12:09 PM
Okay here it is: scripts\Rotface.lua:33: unexpected symbol near ')'

It's the row with pUnit:RegisterEvent("TheFightStarts", 600, )

kjanko
08-02-10, 02:02 PM
pUnit:RegisterEvent("TheFightStarts", 600, 1)

This.

Kevlan85
08-02-10, 02:29 PM
Now I'm getting: scripts\Rotface.lua:131: 'end' expected (to close 'function' at line 120 near 'else'

P1raten
09-02-10, 02:45 AM
Now I'm getting: scripts\Rotface.lua:131: 'end' expected (to close 'function' at line 120 near 'else'
Sorry for the typos. Fixed the one quoted. Will check for others now.

kjanko
09-02-10, 02:46 AM
-- >>Defines<<

-- <<NPC's>>

local Littleooze = nil
local Bigooze = nil
local Rotface = nil

-- <<Spells>>

local Oozeflood = nil
local Radiatingooze = nil
local Slimespray = nil
local Mutatedinfection = nil
local Unstableooze = nil

-- <<Bools>>

local heroicmode = false
local merged = false
local merges = 0

local

-- >>Functions<<

function Rotface_OnCombat(pUnit, Event)
Rotface = pUnit
if (heroicmode == false) then
pUnit:RegisterEvent("ChooseMode", 500, 1)
else
end
pUnit:RegisterEvent("TheFightStarts", 600, 1)
end

function ChooseMode(pUnit, Event)
if (Heroic[id].RaidType == 1 ) then -- non heroic 10man
Oozeflood = 69789
Slimespray = 69508
Mutatedinfection = 69674
Radiatingooze = 69760
Unstableooze = 69839
elseif (Heroic[id].RaidType == 2) then -- non heroic 25man
Oozeflood = 71215
Slimespray = 69508
Mutatedinfection = 73022
Radiatingooze = 71212
Unstableooze = 73029
elseif (Heroic[id].RaidType == 3) then -- heroic 10man
Oozeflood = 71215
Slimespray = 69508
Mutatedinfection = 71224
Radiatingooze = 73026
Unstableooze = 73029
elseif (Heroic[id].RaidType == 4) then -- heroic 25man
Oozeflood = 71215
Slimespray = 69508
Mutatedinfection = 73023
Radiatingooze = 73072
Unstableooze = 73030
end
end

function TheFightStarts(pUnit, Event)
pUnit:RegisterEvent("Ooze_Flood", 8000, 1)
pUnit:RegisterEvent("SlimeSpray", 20000, 1)
pUnit:RegisterEvent("Mutated_Infection", 3000, 1)
end

function Ooze_Flood(pUnit, Event)
local ranx = math.random(6, 16)
local rany = math.random(6, 16)
local flood = flood + 1
if (flood == 1) then
pUnit:CastSpellAoF(ranx, rany, z, Oozeflood)
end
if (flood == 2) then
local x = ranx + 25
local y = rany + 25
pUnit:CastSpellAoF(x, y, z, Oozeflood)
end
if (flood == 3) then
local x = ranx - 25
local y = rany + 25
pUnit:CastSpellAoF(x, y, z, Oozeflood)
end
if (flood == 4) then
local x = ranx + 25
local y = rany - 25
pUnit:CastSpellAoF(x, y, z, Oozeflood)
end
if (flood == 5) then
local x = ranx - 25
local y = rany - 25
pUnit:CastSpellAoF(x, y, z, Oozeflood)
flood = 0
end
return TheFightStarts
end

function SlimeSpray(pUnit, Event)
pUnit:SendChatMessage(41, 0, "Rotface begins to cast Slime Spray!")
pUnit:FullCastSpellOnTarget(Slimespray, pUnit:GetRandomPlayer(0))
return TheFightStarts
end

function Mutated_Infection(pUnit, Event)
local playr = pUnit:GetRandomPlayer(0)
pUnit:FullCastSpellOnTarget(Mutatedinfection, playr)
pUnit:RegisterEvent("LittleOoze", 15000, 1)
end

function LittleOoze(pUnit, Event)
local x = playr:GetX()
local y = playr:GetY()
local z = playr:GetZ()
pUnit:SpawnCreature(36897, x, y, z, 21, 0)
end

function LittleOoze_OnCombat(pUnit, Event)
pUnit = Littleooze
if merged == false then
local npc = pUnit:GetCreatureNearestCoords(x, y, z, 36897)
if npc == nil then
else
if Littleooze:GetDistance(npc) < 5 then
npc:FullCastSpell(69889)
end
end
else
pUnit:RegisterEvent("Sticky_Ooze", 7000, 0)
pUnit:RegisterEvent("Radiating_Ooze", 11000, 0)
end
end
end
end

function Sticky_Ooze(pUnit, Event)
pUnit:FullCastSpellOnTarget(69774, pUnit:GetRandomPlayer(0))
end

function Radiating_Ooze(pUnit, Event)
pUnit:FullCastSpell(69750)
end

function BigOoze_OnCombat(pUnit, Event)
local npc = pUnit:GetCreatureNearestCoords(x, y, z, 36897)
if npc == nil then
else
if pUnit:GetDistance(npc) < 5 then
merges = merges + 1
npc:Despawn(1, 0)
pUnit:FullCastSpell(69558)
end
if merges => 4 then
pUnit:RegisterEvent("BigOoze_ExpoMode", 1000, 0)
end
end
end

function BigOoze_ExpoMode(pUnit, Event)
pUnit:Root()
pUnit:FullCastSpell(Unstableooze)
pUnit:FullCastSpell(5)
end

-- >>Registering Events<<

RegisterUnitEvent(36627, 1, "Rotface_OnCombat")
RegisterUnitEvent(36897, 1, "LittleOoze_OnCombat")
RegisterUnitEvent(36899, 1, "BigOoze_OnCombat")

P1raten
09-02-10, 02:48 AM
-- >>Defines<<

-- <<NPC's>>

local Littleooze = nil
local Bigooze = nil
local Rotface = nil

-- <<Spells>>

local Oozeflood = nil
local Radiatingooze = nil
local Slimespray = nil
local Mutatedinfection = nil
local Unstableooze = nil

-- <<Bools>>

local heroicmode = false
local merged = false
local merges = 0

local

-- >>Functions<<

function Rotface_OnCombat(pUnit, Event)
Rotface = pUnit
if (heroicmode == false) then
pUnit:RegisterEvent("ChooseMode", 500, 1)
else
end
pUnit:RegisterEvent("TheFightStarts", 600, 1)
end

function ChooseMode(pUnit, Event)
if (Heroic[id].RaidType == 1 ) then -- non heroic 10man
Oozeflood = 69789
Slimespray = 69508
Mutatedinfection = 69674
Radiatingooze = 69760
Unstableooze = 69839
elseif (Heroic[id].RaidType == 2) then -- non heroic 25man
Oozeflood = 71215
Slimespray = 69508
Mutatedinfection = 73022
Radiatingooze = 71212
Unstableooze = 73029
elseif (Heroic[id].RaidType == 3) then -- heroic 10man
Oozeflood = 71215
Slimespray = 69508
Mutatedinfection = 71224
Radiatingooze = 73026
Unstableooze = 73029
elseif (Heroic[id].RaidType == 4) then -- heroic 25man
Oozeflood = 71215
Slimespray = 69508
Mutatedinfection = 73023
Radiatingooze = 73072
Unstableooze = 73030
end
end

function TheFightStarts(pUnit, Event)
pUnit:RegisterEvent("Ooze_Flood", 8000, 1)
pUnit:RegisterEvent("SlimeSpray", 20000, 1)
pUnit:RegisterEvent("Mutated_Infection", 3000, 1)
end

function Ooze_Flood(pUnit, Event)
local ranx = math.random(6, 16)
local rany = math.random(6, 16)
local flood = flood + 1
if (flood == 1) then
pUnit:CastSpellAoF(ranx, rany, z, Oozeflood)
end
if (flood == 2) then
local x = ranx + 25
local y = rany + 25
pUnit:CastSpellAoF(x, y, z, Oozeflood)
end
if (flood == 3) then
local x = ranx - 25
local y = rany + 25
pUnit:CastSpellAoF(x, y, z, Oozeflood)
end
if (flood == 4) then
local x = ranx + 25
local y = rany - 25
pUnit:CastSpellAoF(x, y, z, Oozeflood)
end
if (flood == 5) then
local x = ranx - 25
local y = rany - 25
pUnit:CastSpellAoF(x, y, z, Oozeflood)
flood = 0
end
return TheFightStarts
end

function SlimeSpray(pUnit, Event)
pUnit:SendChatMessage(41, 0, "Rotface begins to cast Slime Spray!")
pUnit:FullCastSpellOnTarget(Slimespray, pUnit:GetRandomPlayer(0))
return TheFightStarts
end

function Mutated_Infection(pUnit, Event)
local playr = pUnit:GetRandomPlayer(0)
pUnit:FullCastSpellOnTarget(Mutatedinfection, playr)
pUnit:RegisterEvent("LittleOoze", 15000, 1)
end

function LittleOoze(pUnit, Event)
local x = playr:GetX()
local y = playr:GetY()
local z = playr:GetZ()
pUnit:SpawnCreature(36897, x, y, z, 21, 0)
end

function LittleOoze_OnCombat(pUnit, Event)
pUnit = Littleooze
if merged == false then
local npc = pUnit:GetCreatureNearestCoords(x, y, z, 36897)
if npc == nil then
else
if Littleooze:GetDistance(npc) < 5 then
npc:FullCastSpell(69889)
end
end
else
pUnit:RegisterEvent("Sticky_Ooze", 7000, 0)
pUnit:RegisterEvent("Radiating_Ooze", 11000, 0)
end
end
end
end

function Sticky_Ooze(pUnit, Event)
pUnit:FullCastSpellOnTarget(69774, pUnit:GetRandomPlayer(0))
end

function Radiating_Ooze(pUnit, Event)
pUnit:FullCastSpell(69750)
end

function BigOoze_OnCombat(pUnit, Event)
local npc = pUnit:GetCreatureNearestCoords(x, y, z, 36897)
if npc == nil then
else
if pUnit:GetDistance(npc) < 5 then
merges = merges + 1
npc:Despawn(1, 0)
pUnit:FullCastSpell(69558)
end
if merges => 4 then
pUnit:RegisterEvent("BigOoze_ExpoMode", 1000, 0)
end
end
end

function BigOoze_ExpoMode(pUnit, Event)
pUnit:Root()
pUnit:FullCastSpell(Unstableooze)
pUnit:FullCastSpell(5)
end

-- >>Registering Events<<

RegisterUnitEvent(36627, 1, "Rotface_OnCombat")
RegisterUnitEvent(36897, 1, "LittleOoze_OnCombat")
RegisterUnitEvent(36899, 1, "BigOoze_OnCombat")
I already fixed it. No need to correct anything that has already been corrected. ;)

EDIT: Fixed all the errors i could find at a quick look.

Kevlan85
09-02-10, 09:47 AM
Now I'm getting: scripts\Rotface.lua:135: '(eof)' expected near 'end'

P1raten
09-02-10, 10:20 AM
Update: I fixed all errors.

Kevlan85
09-02-10, 10:58 AM
The script is loading fine now, Thanks :)

EDIT: Now I'm, getting ingame errors, yay :(

scripts\Rotface.lua:35: attempt to index global 'Heroic' (a nil value)

And nothing is happening when you fight him (errors fault?)

P1raten
09-02-10, 01:08 PM
The script is loading fine now, Thanks :)

EDIT: Now I'm, getting ingame errors, yay :(

scripts\Rotface.lua:35: attempt to index global 'Heroic' (a nil value)

And nothing is happening when you fight him (errors fault?)
I suck. I forgot to add the most important variable. However, it's added now. :)

Kevlan85
09-02-10, 01:47 PM
And now I'm getting this: scripts\Rotface.lua:36: attempt to index field '?' (a nil value)

P1raten
09-02-10, 03:07 PM
Updated.. Again. :D

Kevlan85
09-02-10, 04:55 PM
Now I'm getting: scripts\Rotface.lua:35: attempt to index global 'Heroic' (a nil value)
... again!

P1raten
10-02-10, 12:47 PM
Now I'm getting: scripts\Rotface.lua:35: attempt to index global 'Heroic' (a nil value)
... again!
Sorry, by updating my script i accidently removed an old update.

Updated again. :)

Kevlan85
11-02-10, 11:51 AM
And now I'm getting this, AGAIN: scripts\Rotface.lua:36: attempt to index field '?' (a nil value)