Code:
-- --
-- Functions --
-- --
function Horek_Aggro(Antza,Event)
Antza:SendChatMessage(14, 0, "Finally you are here! Well Done! But this is your end!")
Antza:PlaySoundToSet(11247)
Antza:RegisterEvent("Horek_Timer", 120000, 1)
Antza:RegisterEvent("Horek_Phase1", 1000, 0)
end
function Horek_LeaveCombat(Antza,Event)
Antza:RemoveEvents()
end
function Horek_KilledTarget(Antza,Event)
end
function Horek_Death(Antza,Event)
Antza:RemoveEvents()
Antza:SendChatMessage(14, 0, "This.. Cannot.. Be...!!!")
Antza:PlaySoundToSet(10992)
end
function Horek_Timer(Antza,Event)
Antza:SendChatMessage(14, 0, "You're too late! HAHAHAHAHAHA!")
Antza:PlaySoundToSet(8818)
Antza:CastSpell(47008)
end
function Horek_Bomb(Antza,Event)
Antza:SetCombatCapable(1)
Antza:ReturnToSpawnPoint()
Antza:RegisterEvent("Horek_BombSay", 1000, 1)
Antza:RegisterEvent("Horek_Bomb1", 6000, 1)
end
function Horek_BombSay(Antza,Event)
Choice=math.random(1, 3)
if Choice==1 then
Antza:SendChatMessage(14, 0, "Ha! This may hurt a little!")
Antza:PlaySoundToSet(10332)
end
if Choice==2 then
Antza:SendChatMessage(14, 0, "I'm gonna enjoy this..!")
Antza:PlaySoundToSet(10333)
end
if Choice==3 then
Antza:SendChatMessage(14, 0, "Say farewell!")
Antza:PlaySoundToSet(10334)
end
end
function Horek_Bomb1(Antza,Event)
x = Antza:GetSpawnX();
y = Antza:GetSpawnY();
z = Antza:GetSpawnZ();
o = Antza:GetSpawnO();
Antza:SpawnCreature(44069, x-16, y-16, z, o, 14, 15000) -- Bombs
Antza:SpawnCreature(44069, x-16, y+16, z, o, 14, 15000)
Antza:SpawnCreature(44069, x+16, y-16, z, o, 14, 15000)
Antza:SpawnCreature(44069, x+16, y+16, z, o, 14, 15000)
Antza:SpawnCreature(856675, x-56, y-56, z, o, 35, 20000) -- Crystals
Antza:SpawnCreature(856675, x+56, y+56, z, o, 35, 20000)
Antza:SpawnCreature(856675, x+53, y-56, z, o, 35, 20000)
Antza:SpawnCreature(856675, x-56, y+56, z, o, 35, 20000)
Antza:SpawnCreature(856675, x, y, z, o, 35, 20000)
Antza:SpawnGameObject(183036, x-56, y-56, z, o, 20000) -- Platform for Crystals
Antza:SpawnGameObject(183036, x+56, y+56, z, o, 20000)
Antza:SpawnGameObject(183036, x+53, y-56, z, o, 20000)
Antza:SpawnGameObject(183036, x-56, y+56, z, o, 20000)
Antza:SpawnGameObject(183036, x, y, z, o, 20000)
Antza:SetCombatCapable(0)
end
-- --
-- Phases --
-- --
function Horek_Phase1(Antza,Event)
if Antza:GetHealthPct() < 90 then
Antza:RemoveEvents()
Antza:SendChatMessage(14, 0, "Cry for mercy! Your meaningless lives will soon be forfeit!")
Antza:PlaySoundToSet(11015)
Antza:RegisterEvent("Horek_Timer", 120000, 1)
Antza:RegisterEvent("Horek_Bomb", 5000, 1)
Antza:RegisterEvent("Horek_Phase2", 1000, 0)
end
end
function Horek_Phase2(Antza,Event)
if Antza:GetHealthPct() < 80 then
Antza:RemoveEvents()
Antza:SendChatMessage(14, 0, "Your death will be a painful one.")
Antza:PlaySoundToSet(11016)
Antza:RegisterEvent("Horek_Timer", 120000, 1)
Antza:RegisterEvent("Horek_Bomb", 5000, 1)
Antza:RegisterEvent("Horek_Phase3", 1000, 0)
end
end
function Horek_Phase3(Antza,Event)
if Antza:GetHealthPct() < 70 then
Antza:RemoveEvents()
Antza:SendChatMessage(14, 0, "Flesh.. is.. weak!!")
Antza:PlaySoundToSet(14154)
Antza:RegisterEvent("Horek_Timer", 120000, 1)
Antza:RegisterEvent("Horek_Bomb", 5000, 1)
Antza:RegisterEvent("Horek_Phase4", 1000, 0)
end
end
function Horek_Phase4(Antza,Event)
if Antza:GetHealthPct() < 60 then
Antza:RemoveEvents()
Antza:SendChatMessage(14, 0, "You cannot hide from fate!")
Antza:PlaySoundToSet(14163)
Antza:RegisterEvent("Horek_Timer", 120000, 1)
Antza:RegisterEvent("Horek_Bomb", 5000, 1)
Antza:RegisterEvent("Horek_Phase5", 1000, 0)
end
end
function Horek_Phase5(Antza,Event)
if Antza:GetHealthPct() < 50 then
Antza:RemoveEvents()
Antza:SendChatMessage(14, 0, "You are nothing!")
Antza:PlaySoundToSet(11053)
Antza:RegisterEvent("Horek_Timer", 120000, 1)
Antza:RegisterEvent("Horek_Bomb", 5000, 1)
Antza:RegisterEvent("Horek_Phase6", 1000, 0)
end
end
function Horek_Phase6(Antza,Event)
if Antza:GetHealthPct() < 40 then
Antza:RemoveEvents()
Antza:SendChatMessage(14, 0, "Miserable nuisance!")
Antza:PlaySoundToSet(11054)
Antza:RegisterEvent("Horek_Timer", 120000, 1)
Antza:RegisterEvent("Horek_Bomb", 5000, 1)
Antza:RegisterEvent("Horek_Phase7", 1000, 0)
end
end
function Horek_Phase7(Antza,Event)
if Antza:GetHealthPct() < 30 then
Antza:RemoveEvents()
Antza:SendChatMessage(14, 0, "Your flesh cannot hold out for long!")
Antza:PlaySoundToSet(14165)
Antza:RegisterEvent("Horek_Timer", 120000, 1)
Antza:RegisterEvent("Horek_Bomb", 5000, 1)
Antza:RegisterEvent("Horek_Phase8", 1000, 0)
end
end
function Horek_Phase8(Antza,Event)
if Antza:GetHealthPct() < 20 then
Antza:RemoveEvents()
Antza:SendChatMessage(14, 0, "GRAAAAAH! Behold the fury of iron and steel!!")
Antza:PlaySoundToSet(14152)
Antza:RegisterEvent("Horek_Timer", 120000, 1)
Antza:RegisterEvent("Horek_Bomb", 5000, 1)
Antza:RegisterEvent("Horek_Phase9", 1000, 0)
end
end
function Horek_Phase9(Antza,Event)
if Antza:GetHealthPct() < 10 then
Antza:RemoveEvents()
Antza:SendChatMessage(14, 0, "All my work.. undone!!")
Antza:PlaySoundToSet(13964)
Antza:RegisterEvent("Horek_Bomb", 5000, 1)
Antza:RegisterEvent("Horek_Timer", 60000, 1)
end
end
-- --
-- Bomb --
-- --
function Bomb_Death(Antza,Event)
Antza:RemoveEvents()
Antza:Despawn(500, 0)
end
function Death_Bomb(Antza,Event)
Antza:SetCombatCapable(1)
Antza:RegisterEvent("Death_Lightning", 1000, 1)
Antza:RegisterEvent("Death_Bomb1", 5000, 1)
end
function Death_Lightning(Antza,Event)
Antza:FullCastSpell(39990)
Antza:FullCastSpell(44688)
end
function Death_Bomb1(Antza,Event)
Antza:RegisterEvent("Death_Matter", 1000, 5)
Antza:RegisterEvent("Death_Explode", 9000, 1)
end
function Death_Matter(Antza,Event)
Antza:FullCastSpell(59868)
end
function Death_Explode(Antza,Event)
Antza:FullCastSpell(45657)
end
-- --
-- Crystal Gossip --
-- --
function Crystal_OnGossipTalk(Antza, Event, Player)
Antza:GossipCreateMenu(300, Player , 0)
Antza:GossipMenuAddItem(0, "<Use the power of the Crystal to protect yourself!>", 0, 0)
Antza:GossipSendMenu(Player)
end
function Crystal_OnGossipSelect(Antza, Event, Player, Id, Intid, Code)
if (Intid == 0) then
local Target = Antza:GetClosestPlayer()
Antza:FullCastSpellOnTarget(39622, Target)
Antza:Despawn(100, 0)
Player:GossipComplete()
end
end
-- --
-- Registers --
-- --
RegisterUnitEvent(44070, 1, "Horek_Aggro")
RegisterUnitEvent(44070, 2, "Horek_LeaveCombat")
RegisterUnitEvent(44070, 3, "Horek_KilledTarget")
RegisterUnitEvent(44070, 4, "Horek_Death")
RegisterUnitEvent(44069, 4, "Bomb_Death")
RegisterUnitEvent(44069, 18, "Death_Bomb")
RegisterUnitGossipEvent(856675, 1, "Crystal_OnGossipTalk")
RegisterUnitGossipEvent(856675, 2, "Crystal_OnGossipSelect")
It doesn't have any locals as at the time I made it I didn't know that much about locals but now I do.
Code:
insert into `creature_names` (`entry`, `name`, `subname`, `info_str`, `Flags1`, `type`, `family`, `rank`, `unk4`, `spelldataid`, `male_displayid`, `female_displayid`, `male_displayid2`, `female_displayid2`, `unknown_float1`, `unknown_float2`, `civilian`, `leader`)
values ('44070', "Horeknaon", "Leader of the Gnomeregan", '', '0', '7', '0', '3', '0', '0', '27648', '0', '0', '0', '1', '1', '0', '0');
insert into `creature_proto` (`entry`, `minlevel`, `maxlevel`, `faction`, `minhealth`, `maxhealth`, `mana`, `scale`, `npcflags`, `attacktime`, `attacktype`, `mindamage`, `maxdamage`, `can_ranged`, `rangedattacktime`, `rangedmindamage`, `rangedmaxdamage`, `respawntime`, `armor`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `combat_reach`, `bounding_radius`, `auras`, `boss`, `money`, `invisibility_type`, `death_state`, `walk_speed`, `run_speed`, `fly_speed`, `extra_a9_flags`, `spell1`, `spell2`, `spell3`, `spell4`, `spell_flags`, `modImmunities`)
values ('44070', '90', '92', '14', '4000000', '4250000', '14000', '2.1', '0', '1500', '0', '8000', '12000', '0', '0', '0', '0', '0', '14000', '0', '0', '0', '0', '0', '0', '0', '0', "0", '1', '520000000', '0', '0', '3.30', '12.00', '14.00', '0', '0', '0', '0', '0', '0', '0');
insert into `creature_names` (`entry`, `name`, `subname`, `info_str`, `Flags1`, `type`, `family`, `rank`, `unk4`, `spelldataid`, `male_displayid`, `female_displayid`, `male_displayid2`, `female_displayid2`, `unknown_float1`, `unknown_float2`, `civilian`, `leader`)
values ('44069', "Massive Bomb of Death", "Creation of the Titans", '', '0', '9', '0', '3', '0', '0', '271', '0', '0', '0', '1', '1', '0', '0');
insert into `creature_proto` (`entry`, `minlevel`, `maxlevel`, `faction`, `minhealth`, `maxhealth`, `mana`, `scale`, `npcflags`, `attacktime`, `attacktype`, `mindamage`, `maxdamage`, `can_ranged`, `rangedattacktime`, `rangedmindamage`, `rangedmaxdamage`, `respawntime`, `armor`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `combat_reach`, `bounding_radius`, `auras`, `boss`, `money`, `invisibility_type`, `death_state`, `walk_speed`, `run_speed`, `fly_speed`, `extra_a9_flags`, `spell1`, `spell2`, `spell3`, `spell4`, `spell_flags`, `modImmunities`)
values ('44069', '90', '90', '14', '72000', '74000', '1', '5', '0', '3000', '0', '1', '1', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', "0", '1', '0', '0', '0', '2.50', '8.00', '14.00', '0', '0', '0', '0', '0', '0', '0');
insert into `creature_names` (`entry`, `name`, `subname`, `info_str`, `Flags1`, `type`, `family`, `rank`, `unk4`, `spelldataid`, `male_displayid`, `female_displayid`, `male_displayid2`, `female_displayid2`, `unknown_float1`, `unknown_float2`, `civilian`, `leader`)
values ('856675', "Power Crystal", "", '', '0', '10', '0', '2', '0', '0', '17856', '0', '0', '0', '1', '1', '1', '0');
insert into `creature_proto` (`entry`, `minlevel`, `maxlevel`, `faction`, `minhealth`, `maxhealth`, `mana`, `scale`, `npcflags`, `attacktime`, `attacktype`, `mindamage`, `maxdamage`, `can_ranged`, `rangedattacktime`, `rangedmindamage`, `rangedmaxdamage`, `respawntime`, `armor`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `combat_reach`, `bounding_radius`, `auras`, `boss`, `money`, `invisibility_type`, `death_state`, `walk_speed`, `run_speed`, `fly_speed`, `extra_a9_flags`, `spell1`, `spell2`, `spell3`, `spell4`, `spell_flags`, `modImmunities`)
values ('856675', '90', '90', '35', '70000', '120000', '45000', '5', '1', '3000', '0', '1', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', "0", '0', '0', '0', '0', '2.50', '8.00', '14.00', '0', '0', '0', '0', '0', '0', '0');
EDIT the red parts to fit your server