Scripts/Ulduar: cleanup Assembly of Iron

This commit is contained in:
joschiwald
2012-11-30 21:37:46 +01:00
parent ddb6c95042
commit 32c4e30599
4 changed files with 246 additions and 289 deletions

View File

@@ -0,0 +1,44 @@
DELETE FROM `script_texts` WHERE `entry` BETWEEN -1603047 AND -1603020;
DELETE FROM `creature_text` WHERE `entry` IN (32867,32927,32857);
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES
(32867,0,0,'You will not defeat the Assembly of Iron so easily, invaders!',14,0,100,0,0,15674,'Steelbreaker - Aggro'),
(32867,1,0,'So fragile and weak!',14,0,100,0,0,15675,'Steelbreaker - Slay 1'),
(32867,1,1,'Flesh... such a hindrance.',14,0,100,0,0,15676,'Steelbreaker - Slay 2'),
(32867,2,0,'You seek the secrets of Ulduar? Then take them!',14,0,100,0,0,15677,'Steelbreaker - Power'),
(32867,3,0,'My death only serves to hasten your demise.',14,0,100,0,0,15678,'Steelbreaker - Death'),
(32867,4,0,'Impossible...',14,0,100,0,0,15679,'Steelbreaker - Encounter defeated'),
(32867,5,0,'This meeting of the Assembly of Iron is adjourned!',14,0,100,0,0,15680,'Steelbreaker - Berserk'),
(32927,0,0,'Nothing short of total decimation will suffice.',14,0,100,0,0,15657,'Runemaster Molgeim - Aggro'),
(32927,1,0,'The world suffers yet another insignificant loss.',14,0,100,0,0,15658,'Runemaster Molgeim - Slay 1'),
(32927,1,1,'Death is the price of your arrogance.',14,0,100,0,0,15659,'Runemaster Molgeim - Slay 2'),
(32927,2,0,'Decipher this!',14,0,100,0,0,15660,'Runemaster Molgeim - Rune of Death'),
(32927,3,0,'Face the lightning surge!',14,0,100,0,0,15661,'Runemaster Molgeim - Rune of Summon'),
(32927,4,0,'The legacy of storms shall not be undone.',14,0,100,0,0,15662,'Runemaster Molgeim - Death'),
(32927,5,0,'What have you gained from my defeat? You are no less doomed, mortals!',14,0,100,0,0,15663,'Runemaster Molgeim - Encounter defeated'),
(32927,6,0,'This meeting of the Assembly of Iron is adjourned!',14,0,100,0,0,15664,'Runemaster Molgeim - Berserk'),
(32857,0,0,'Whether the world''s greatest gnats or the world''s greatest heroes, you''re still only mortal!',14,0,100,0,0,15684,'Brundir - Aggro'),
(32857,1,0,'A merciful kill!',14,0,100,0,0,15685,'Brundir Slay 1'),
(32857,1,1,'HAH!',14,0,100,0,0,15686,'Brundir - Slay 2'),
(32857,2,0,'Stand still and stare into the light!',14,0,100,0,0,15687,'Brundir - Special'),
(32857,3,0,'Let the storm clouds rise and rain down death from above!',14,0,100,0,0,15688,'Brundir - Flight'),
(32857,4,0,'The power of the storm lives on...',14,0,100,0,0,15689,'Brundir - Death'),
(32857,5,0,'You rush headlong into the maw of madness!',14,0,100,0,0,15690,'Brundir - Encounter defeated'),
(32857,6,0,'This meeting of the Assembly of Iron is adjourned!',14,0,100,0,0,15691,'Brundir - Berserk'),
(32857,7,0,'%s begins to Overload!',41,0,100,0,0,0,'Brundir - Overload');
UPDATE `creature_template` SET `flags_extra`=128, `ScriptName`='' WHERE `entry`=33705; -- Rune of Power
UPDATE `creature_template` SET `flags_extra`=128, `ScriptName`='' WHERE `entry`=33051; -- Rune of Summoning
UPDATE `creature_template` SET `ScriptName`='' WHERE `entry`=32958; -- Lightning Elemental
DELETE FROM `creature_template_addon` WHERE `entry` IN (33051,32958,33689,33705);
INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
(33051,0,0,0,0,0,'62019'), -- Rune of Summoning
(32958,0,0,0,0,0,'62052'), -- Lightning Elemental
(33689,0,0,0,0,0,'62052'), -- Lightning Elemental
(33705,0,0,0,0,0,'61974'); -- Rune of Power
DELETE FROM `spell_script_names` WHERE `spell_id`=62019; -- Rune of Summoning
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(62019 ,'spell_assembly_rune_of_summoning');

View File

@@ -18,7 +18,7 @@
/* ScriptData
SDName: Assembly of Iron encounter
SD%Complete: 60%
SDComment: Runes need DB support, chain lightning won't cast, supercharge won't cast (target error?) - it worked before during debugging.
SDComment: chain lightning won't cast, supercharge don't work (auras don't stack from different casters)
SDCategory: Ulduar - Ulduar
EndScriptData */
@@ -45,12 +45,9 @@ enum AssemblySpells
SPELL_SHIELD_OF_RUNES = 62274,
SPELL_SHIELD_OF_RUNES_BUFF = 62277,
SPELL_SUMMON_RUNE_OF_POWER = 63513,
SPELL_RUNE_OF_POWER = 61974,
SPELL_RUNE_OF_DEATH = 62269,
SPELL_RUNE_OF_SUMMONING = 62273, // This is the spell that summons the rune
SPELL_RUNE_OF_SUMMONING_VIS = 62019, // Visual
SPELL_RUNE_OF_SUMMONING_SUMMON = 62020, // Spell that summons
SPELL_LIGHTNING_ELEMENTAL_PASSIVE = 62052,
// Stormcaller Brundir
SPELL_CHAIN_LIGHTNING = 61879,
@@ -59,7 +56,7 @@ enum AssemblySpells
SPELL_LIGHTNING_TENDRILS_10M = 61887,
SPELL_LIGHTNING_TENDRILS_25M = 63486,
SPELL_LIGHTNING_TENDRILS_VISUAL = 61883,
SPELL_STORMSHIELD = 64187,
SPELL_STORMSHIELD = 64187
};
enum AssemblyEvents
@@ -88,115 +85,50 @@ enum AssemblyEvents
EVENT_ENDFLIGHT = 15,
EVENT_GROUND = 16,
EVENT_LAND = 17,
EVENT_MOVE_POSITION = 18,
EVENT_MOVE_POSITION = 18
};
enum AssemblyActions
{
ACTION_STEELBREAKER = 0,
ACTION_MOLGEIM = 1,
ACTION_BRUNDIR = 2,
ACTION_ADD_CHARGE = 3,
ACTION_SUPERCHARGE = 1,
ACTION_ADD_CHARGE = 2
};
enum AssemblyYells
{
SAY_STEELBREAKER_AGGRO = -1603020,
SAY_STEELBREAKER_SLAY_1 = -1603021,
SAY_STEELBREAKER_SLAY_2 = -1603022,
SAY_STEELBREAKER_POWER = -1603023,
SAY_STEELBREAKER_DEATH_1 = -1603024,
SAY_STEELBREAKER_DEATH_2 = -1603025,
SAY_STEELBREAKER_BERSERK = -1603026,
SAY_STEELBREAKER_AGGRO = 0,
SAY_STEELBREAKER_SLAY = 1,
SAY_STEELBREAKER_POWER = 2,
SAY_STEELBREAKER_DEATH = 3,
SAY_STEELBREAKER_ENCOUNTER_DEFEATED = 4,
SAY_STEELBREAKER_BERSERK = 5,
SAY_MOLGEIM_AGGRO = -1603030,
SAY_MOLGEIM_SLAY_1 = -1603031,
SAY_MOLGEIM_SLAY_2 = -1603032,
SAY_MOLGEIM_RUNE_DEATH = -1603033,
SAY_MOLGEIM_SUMMON = -1603034,
SAY_MOLGEIM_DEATH_1 = -1603035,
SAY_MOLGEIM_DEATH_2 = -1603036,
SAY_MOLGEIM_BERSERK = -1603037,
SAY_MOLGEIM_AGGRO = 0,
SAY_MOLGEIM_SLAY = 1,
SAY_MOLGEIM_RUNE_DEATH = 2,
SAY_MOLGEIM_SUMMON = 3,
SAY_MOLGEIM_DEATH = 4,
SAY_MOLGEIM_ENCOUNTER_DEFEATED = 5,
SAY_MOLGEIM_BERSERK = 6,
SAY_BRUNDIR_AGGRO = -1603040,
SAY_BRUNDIR_SLAY_1 = -1603041,
SAY_BRUNDIR_SLAY_2 = -1603042,
SAY_BRUNDIR_SPECIAL = -1603043,
SAY_BRUNDIR_FLIGHT = -1603044,
SAY_BRUNDIR_DEATH_1 = -1603045,
SAY_BRUNDIR_DEATH_2 = -1603046,
SAY_BRUNDIR_BERSERK = -1603047,
SAY_BRUNDIR_AGGRO = 0,
SAY_BRUNDIR_SLAY = 1,
SAY_BRUNDIR_SPECIAL = 2,
SAY_BRUNDIR_FLIGHT = 3,
SAY_BRUNDIR_DEATH = 4,
SAY_BRUNDIR_ENCOUNTER_DEFEATED = 5,
SAY_BRUNDIR_BERSERK = 6,
EMOTE_BRUNDIR_OVERLOAD = 7
};
enum AssemblyNPCs
{
NPC_WORLD_TRIGGER = 22515,
NPC_WORLD_TRIGGER = 22515
};
#define EMOTE_OVERLOAD "Stormcaller Brundir begins to Overload!" // Move it to DB
#define FLOOR_Z 427.28f
#define FINAL_FLIGHT_Z 435.0f
bool IsEncounterComplete(InstanceScript* instance, Creature* me)
{
if (!instance || !me)
return false;
for (uint8 i = 0; i < 3; ++i)
{
uint64 guid = instance->GetData64(BOSS_STEELBREAKER + i);
if (!guid)
return false;
if (Creature* boss = ObjectAccessor::GetCreature(*me, guid))
{
if (boss->isAlive())
return false;
}
else
return false;
}
return true;
}
void RespawnEncounter(InstanceScript* instance, Creature* me)
{
for (uint8 i = 0; i < 3; ++i)
{
uint64 guid = instance->GetData64(BOSS_STEELBREAKER + i);
if (!guid)
continue;
if (Creature* boss = ObjectAccessor::GetCreature(*me, guid))
{
if (!boss->isAlive())
{
boss->Respawn();
boss->GetMotionMaster()->MoveTargetedHome();
}
}
}
}
void StartEncounter(InstanceScript* instance, Creature* me, Unit* /*target*/)
{
if (instance->GetBossState(BOSS_ASSEMBLY_OF_IRON) == IN_PROGRESS)
return; // Prevent recursive calls
instance->SetBossState(BOSS_ASSEMBLY_OF_IRON, IN_PROGRESS);
for (uint8 i = 0; i < 3; ++i)
{
uint64 guid = instance->GetData64(BOSS_STEELBREAKER + i);
if (!guid)
continue;
if (Creature* boss = ObjectAccessor::GetCreature(*me, guid))
boss->SetInCombatWithZone();
}
}
class boss_steelbreaker : public CreatureScript
{
public:
@@ -206,10 +138,8 @@ class boss_steelbreaker : public CreatureScript
{
boss_steelbreakerAI(Creature* creature) : BossAI(creature, BOSS_ASSEMBLY_OF_IRON)
{
instance = me->GetInstanceScript();
}
InstanceScript* instance;
uint32 phase;
void Reset()
@@ -217,14 +147,12 @@ class boss_steelbreaker : public CreatureScript
_Reset();
phase = 0;
me->RemoveAllAuras();
RespawnEncounter(instance, me);
}
void EnterCombat(Unit* who)
{
StartEncounter(instance, me, who);
DoScriptText(SAY_STEELBREAKER_AGGRO, me);
DoZoneInCombat();
_EnterCombat();
Talk(SAY_STEELBREAKER_AGGRO);
DoCast(me, SPELL_HIGH_VOLTAGE);
events.SetPhase(++phase);
events.ScheduleEvent(EVENT_BERSERK, 900000);
@@ -235,8 +163,8 @@ class boss_steelbreaker : public CreatureScript
{
switch (action)
{
case ACTION_STEELBREAKER:
me->SetHealth(me->GetMaxHealth());
case ACTION_SUPERCHARGE:
me->SetFullHealth();
me->AddAura(SPELL_SUPERCHARGE, me);
events.SetPhase(++phase);
events.RescheduleEvent(EVENT_FUSION_PUNCH, 15000);
@@ -253,29 +181,33 @@ class boss_steelbreaker : public CreatureScript
void JustDied(Unit* /*killer*/)
{
DoScriptText(RAND(SAY_STEELBREAKER_DEATH_1, SAY_STEELBREAKER_DEATH_2), me);
if (IsEncounterComplete(instance, me))
_JustDied();
if (instance->GetBossState(BOSS_ASSEMBLY_OF_IRON) == DONE)
{
instance->SetBossState(BOSS_ASSEMBLY_OF_IRON, DONE);
instance->SetBossState(BOSS_STEELBREAKER, DONE);
instance->SetBossState(BOSS_MOLGEIM, DONE);
instance->SetBossState(BOSS_BRUNDIR, DONE);
// todo: kill credit
Talk(SAY_STEELBREAKER_ENCOUNTER_DEFEATED);
}
else
{
me->SetLootRecipient(NULL);
Talk(SAY_STEELBREAKER_DEATH);
//DoCastAOE(SPELL_SUPERCHARGE, true);
if (Creature* Brundir = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_BRUNDIR)))
if (Brundir->isAlive())
Brundir->AI()->DoAction(ACTION_BRUNDIR);
if (Creature* Brundir = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_BRUNDIR)))
if (Brundir->isAlive())
Brundir->AI()->DoAction(ACTION_SUPERCHARGE);
if (Creature* Molgeim = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_MOLGEIM)))
if (Molgeim->isAlive())
Molgeim->AI()->DoAction(ACTION_MOLGEIM);
if (Creature* Molgeim = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_MOLGEIM)))
if (Molgeim->isAlive())
Molgeim->AI()->DoAction(ACTION_SUPERCHARGE);
}
}
void KilledUnit(Unit* /*who*/)
void KilledUnit(Unit* who)
{
DoScriptText(RAND(SAY_STEELBREAKER_SLAY_1, SAY_STEELBREAKER_SLAY_2), me);
if (who->GetTypeId() == TYPEID_PLAYER)
Talk(SAY_STEELBREAKER_SLAY);
if (phase == 3)
DoCast(me, SPELL_ELECTRICAL_CHARGE);
@@ -296,7 +228,7 @@ class boss_steelbreaker : public CreatureScript
switch (eventId)
{
case EVENT_BERSERK:
DoScriptText(SAY_STEELBREAKER_BERSERK, me);
Talk(SAY_STEELBREAKER_BERSERK);
DoCast(SPELL_BERSERK);
events.CancelEvent(EVENT_BERSERK);
break;
@@ -311,7 +243,7 @@ class boss_steelbreaker : public CreatureScript
events.ScheduleEvent(EVENT_STATIC_DISRUPTION, urand(20000, 40000));
break;
case EVENT_OVERWHELMING_POWER:
DoScriptText(SAY_STEELBREAKER_POWER, me);
Talk(SAY_STEELBREAKER_POWER);
DoCastVictim(SPELL_OVERWHELMING_POWER);
events.ScheduleEvent(EVENT_OVERWHELMING_POWER, RAID_MODE(60000, 35000));
break;
@@ -337,10 +269,8 @@ class boss_runemaster_molgeim : public CreatureScript
{
boss_runemaster_molgeimAI(Creature* creature) : BossAI(creature, BOSS_ASSEMBLY_OF_IRON)
{
instance = me->GetInstanceScript();
}
InstanceScript* instance;
uint32 phase;
void Reset()
@@ -348,14 +278,12 @@ class boss_runemaster_molgeim : public CreatureScript
_Reset();
phase = 0;
me->RemoveAllAuras();
RespawnEncounter(instance, me);
}
void EnterCombat(Unit* who)
{
StartEncounter(instance, me, who);
DoScriptText(SAY_MOLGEIM_AGGRO, me);
DoZoneInCombat();
_EnterCombat();
Talk(SAY_MOLGEIM_AGGRO);
events.SetPhase(++phase);
events.ScheduleEvent(EVENT_BERSERK, 900000);
events.ScheduleEvent(EVENT_SHIELD_OF_RUNES, 30000);
@@ -366,8 +294,8 @@ class boss_runemaster_molgeim : public CreatureScript
{
switch (action)
{
case ACTION_MOLGEIM:
me->SetHealth(me->GetMaxHealth());
case ACTION_SUPERCHARGE:
me->SetFullHealth();
me->AddAura(SPELL_SUPERCHARGE, me);
events.SetPhase(++phase);
events.RescheduleEvent(EVENT_SHIELD_OF_RUNES, 27000);
@@ -382,29 +310,33 @@ class boss_runemaster_molgeim : public CreatureScript
void JustDied(Unit* /*killer*/)
{
DoScriptText(RAND(SAY_MOLGEIM_DEATH_1, SAY_MOLGEIM_DEATH_2), me);
if (IsEncounterComplete(instance, me))
_JustDied();
if (instance->GetBossState(BOSS_ASSEMBLY_OF_IRON) == DONE)
{
instance->SetBossState(BOSS_ASSEMBLY_OF_IRON, DONE);
instance->SetBossState(BOSS_STEELBREAKER, DONE);
instance->SetBossState(BOSS_MOLGEIM, DONE);
instance->SetBossState(BOSS_BRUNDIR, DONE);
// todo: kill credit
Talk(SAY_MOLGEIM_ENCOUNTER_DEFEATED);
}
else
{
me->SetLootRecipient(NULL);
Talk(SAY_MOLGEIM_DEATH);
//DoCastAOE(SPELL_SUPERCHARGE, true);
if (Creature* Brundir = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_BRUNDIR)))
if (Brundir->isAlive())
Brundir->AI()->DoAction(ACTION_BRUNDIR);
if (Creature* Brundir = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_BRUNDIR)))
if (Brundir->isAlive())
Brundir->AI()->DoAction(ACTION_SUPERCHARGE);
if (Creature* Steelbreaker = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_STEELBREAKER)))
if (Steelbreaker->isAlive())
Steelbreaker->AI()->DoAction(ACTION_STEELBREAKER);
if (Creature* Steelbreaker = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_STEELBREAKER)))
if (Steelbreaker->isAlive())
Steelbreaker->AI()->DoAction(ACTION_SUPERCHARGE);
}
}
void KilledUnit(Unit* /*who*/)
void KilledUnit(Unit* who)
{
DoScriptText(RAND(SAY_MOLGEIM_SLAY_1, SAY_MOLGEIM_SLAY_2), me);
if (who->GetTypeId() == TYPEID_PLAYER)
Talk(SAY_MOLGEIM_SLAY);
}
void UpdateAI(uint32 const diff)
@@ -422,28 +354,27 @@ class boss_runemaster_molgeim : public CreatureScript
switch (eventId)
{
case EVENT_BERSERK:
DoScriptText(SAY_MOLGEIM_BERSERK, me);
Talk(SAY_MOLGEIM_BERSERK);
DoCast(SPELL_BERSERK);
events.CancelEvent(EVENT_BERSERK);
break;
case EVENT_RUNE_OF_POWER:
{
Unit* target = NULL;
Unit* target = me;
switch (urand(0, 2))
{
case 0:
target = me;
break;
case 1:
if (Creature* Steelbreaker = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_STEELBREAKER)))
if (Creature* Steelbreaker = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_STEELBREAKER)))
if (Steelbreaker->isAlive())
target = Steelbreaker;
break;
case 2:
if (Creature* Brundir = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_STEELBREAKER)))
if (Creature* Brundir = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_STEELBREAKER)))
if (Brundir->isAlive())
target = Brundir;
break;
default:
break;
}
DoCast(target, SPELL_SUMMON_RUNE_OF_POWER);
events.ScheduleEvent(EVENT_RUNE_OF_POWER, 60000);
@@ -454,13 +385,13 @@ class boss_runemaster_molgeim : public CreatureScript
events.ScheduleEvent(EVENT_SHIELD_OF_RUNES, urand(27000, 34000));
break;
case EVENT_RUNE_OF_DEATH:
DoScriptText(SAY_MOLGEIM_RUNE_DEATH, me);
Talk(SAY_MOLGEIM_RUNE_DEATH);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_RUNE_OF_DEATH);
events.ScheduleEvent(EVENT_RUNE_OF_DEATH, urand(30000, 40000));
break;
case EVENT_RUNE_OF_SUMMONING:
DoScriptText(SAY_MOLGEIM_SUMMON, me);
Talk(SAY_MOLGEIM_SUMMON);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_RUNE_OF_SUMMONING);
events.ScheduleEvent(EVENT_RUNE_OF_SUMMONING, urand(30000, 45000));
@@ -478,93 +409,6 @@ class boss_runemaster_molgeim : public CreatureScript
}
};
class mob_rune_of_power : public CreatureScript
{
public:
mob_rune_of_power() : CreatureScript("mob_rune_of_power") { }
struct mob_rune_of_powerAI : public ScriptedAI
{
mob_rune_of_powerAI(Creature* creature) : ScriptedAI(creature)
{
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->setFaction(16); // Same faction as bosses
DoCast(SPELL_RUNE_OF_POWER);
me->DespawnOrUnsummon(60000);
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new mob_rune_of_powerAI(creature);
}
};
class mob_lightning_elemental : public CreatureScript
{
public:
mob_lightning_elemental() : CreatureScript("mob_lightning_elemental") { }
struct mob_lightning_elementalAI : public ScriptedAI
{
mob_lightning_elementalAI(Creature* creature) : ScriptedAI(creature)
{
me->SetInCombatWithZone();
me->AddAura(SPELL_LIGHTNING_ELEMENTAL_PASSIVE, me);
}
// Nothing to do here, just let the creature chase players and procflags == 2 on the applied aura will trigger explosion
};
CreatureAI* GetAI(Creature* creature) const
{
return new mob_lightning_elementalAI(creature);
}
};
class mob_rune_of_summoning : public CreatureScript
{
public:
mob_rune_of_summoning() : CreatureScript("mob_rune_of_summoning") { }
struct mob_rune_of_summoningAI : public ScriptedAI
{
mob_rune_of_summoningAI(Creature* creature) : ScriptedAI(creature)
{
me->AddAura(SPELL_RUNE_OF_SUMMONING_VIS, me);
summonCount = 0;
summonTimer = 2000;
}
uint32 summonCount;
uint32 summonTimer;
void UpdateAI(uint32 const diff)
{
if (summonTimer <= diff)
SummonLightningElemental();
else
summonTimer -= diff;
}
void SummonLightningElemental()
{
me->CastSpell(me, SPELL_RUNE_OF_SUMMONING_SUMMON, false);
if (++summonCount == 10) // TODO: Find out if this amount is right
me->DespawnOrUnsummon();
else
summonTimer = 2000; // TODO: Find out of timer is right
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new mob_rune_of_summoningAI(creature);
}
};
class boss_stormcaller_brundir : public CreatureScript
{
public:
@@ -574,10 +418,8 @@ class boss_stormcaller_brundir : public CreatureScript
{
boss_stormcaller_brundirAI(Creature* creature) : BossAI(creature, BOSS_ASSEMBLY_OF_IRON)
{
instance = me->GetInstanceScript();
}
InstanceScript* instance;
uint32 phase;
void Reset()
@@ -588,14 +430,12 @@ class boss_stormcaller_brundir : public CreatureScript
me->SetDisableGravity(false);
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, false); // Should be interruptable unless overridden by spell (Overload)
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_STUN, false); // Reset immumity, Brundir should be stunnable by default
RespawnEncounter(instance, me);
}
void EnterCombat(Unit* who)
{
StartEncounter(instance, me, who);
DoScriptText(SAY_BRUNDIR_AGGRO, me);
DoZoneInCombat();
_EnterCombat();
Talk(SAY_BRUNDIR_AGGRO);
events.SetPhase(++phase);
events.ScheduleEvent(EVENT_MOVE_POSITION, 1000);
events.ScheduleEvent(EVENT_BERSERK, 900000);
@@ -607,8 +447,8 @@ class boss_stormcaller_brundir : public CreatureScript
{
switch (action)
{
case ACTION_BRUNDIR:
me->SetHealth(me->GetMaxHealth());
case ACTION_SUPERCHARGE:
me->SetFullHealth();
me->AddAura(SPELL_SUPERCHARGE, me);
events.SetPhase(++phase);
events.RescheduleEvent(EVENT_CHAIN_LIGHTNING, urand(7000, 12000));
@@ -619,7 +459,7 @@ class boss_stormcaller_brundir : public CreatureScript
{
DoCast(me, SPELL_STORMSHIELD);
events.RescheduleEvent(EVENT_LIGHTNING_TENDRILS, urand(50000, 60000));
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_STUN, true); // Apply immumity to stuns
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_STUN, true); // Apply immumity to stuns
}
break;
@@ -628,33 +468,37 @@ class boss_stormcaller_brundir : public CreatureScript
void JustDied(Unit* /*killer*/)
{
DoScriptText(RAND(SAY_BRUNDIR_DEATH_1, SAY_BRUNDIR_DEATH_2), me);
if (IsEncounterComplete(instance, me))
_JustDied();
if (instance->GetBossState(BOSS_ASSEMBLY_OF_IRON) == DONE)
{
instance->SetBossState(BOSS_ASSEMBLY_OF_IRON, DONE);
instance->SetBossState(BOSS_STEELBREAKER, DONE);
instance->SetBossState(BOSS_MOLGEIM, DONE);
instance->SetBossState(BOSS_BRUNDIR, DONE);
// todo: kill credit
Talk(SAY_BRUNDIR_ENCOUNTER_DEFEATED);
}
else
{
me->SetLootRecipient(NULL);
Talk(SAY_BRUNDIR_DEATH);
//DoCastAOE(SPELL_SUPERCHARGE, true);
if (Creature* Molgeim = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_MOLGEIM)))
if (Molgeim->isAlive())
Molgeim->AI()->DoAction(ACTION_MOLGEIM);
if (Creature* Molgeim = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_MOLGEIM)))
if (Molgeim->isAlive())
Molgeim->AI()->DoAction(ACTION_SUPERCHARGE);
if (Creature* Steelbreaker = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_STEELBREAKER)))
if (Steelbreaker->isAlive())
Steelbreaker->AI()->DoAction(ACTION_STEELBREAKER);
if (Creature* Steelbreaker = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_STEELBREAKER)))
if (Steelbreaker->isAlive())
Steelbreaker->AI()->DoAction(ACTION_SUPERCHARGE);
}
// Prevent to have Brundir somewhere in the air when he die in Air phase
if (me->GetPositionZ() > FLOOR_Z)
me->GetMotionMaster()->MoveFall();
}
void KilledUnit(Unit* /*who*/)
void KilledUnit(Unit* who)
{
DoScriptText(RAND(SAY_BRUNDIR_SLAY_1, SAY_BRUNDIR_SLAY_2), me);
if (who->GetTypeId() == TYPEID_PLAYER)
Talk(SAY_BRUNDIR_SLAY);
}
void UpdateAI(uint32 const diff)
@@ -672,7 +516,7 @@ class boss_stormcaller_brundir : public CreatureScript
switch (eventId)
{
case EVENT_BERSERK:
DoScriptText(SAY_BRUNDIR_BERSERK, me);
Talk(SAY_BRUNDIR_BERSERK);
DoCast(SPELL_BERSERK);
events.CancelEvent(EVENT_BERSERK);
break;
@@ -682,8 +526,8 @@ class boss_stormcaller_brundir : public CreatureScript
events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, urand(7000, 10000));
break;
case EVENT_OVERLOAD:
me->MonsterTextEmote(EMOTE_OVERLOAD, 0, true);
DoScriptText(SAY_BRUNDIR_SPECIAL, me);
Talk(EMOTE_BRUNDIR_OVERLOAD);
Talk(SAY_BRUNDIR_SPECIAL);
DoCast(SPELL_OVERLOAD);
events.ScheduleEvent(EVENT_OVERLOAD, urand(60000, 120000));
break;
@@ -692,7 +536,7 @@ class boss_stormcaller_brundir : public CreatureScript
events.ScheduleEvent(EVENT_LIGHTNING_WHIRL, urand(15000, 20000));
break;
case EVENT_LIGHTNING_TENDRILS:
DoScriptText(SAY_BRUNDIR_FLIGHT, me);
Talk(SAY_BRUNDIR_FLIGHT);
DoCast(RAID_MODE(SPELL_LIGHTNING_TENDRILS_10M, SPELL_LIGHTNING_TENDRILS_25M));
DoCast(SPELL_LIGHTNING_TENDRILS_VISUAL);
me->AttackStop();
@@ -798,7 +642,7 @@ class spell_assembly_meltdown : public SpellScriptLoader
void HandleInstaKill(SpellEffIndex /*effIndex*/)
{
if (InstanceScript* instance = GetCaster()->GetInstanceScript())
if (Creature* Steelbreaker = ObjectAccessor::GetCreature(*GetCaster(), instance->GetData64(BOSS_STEELBREAKER)))
if (Creature* Steelbreaker = ObjectAccessor::GetCreature(*GetCaster(), instance->GetData64(DATA_STEELBREAKER)))
Steelbreaker->AI()->DoAction(ACTION_ADD_CHARGE);
}
@@ -814,14 +658,53 @@ class spell_assembly_meltdown : public SpellScriptLoader
}
};
class spell_assembly_rune_of_summoning : public SpellScriptLoader
{
public:
spell_assembly_rune_of_summoning() : SpellScriptLoader("spell_assembly_rune_of_summoning") { }
class spell_assembly_rune_of_summoning_AuraScript : public AuraScript
{
PrepareAuraScript(spell_assembly_rune_of_summoning_AuraScript);
bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_RUNE_OF_SUMMONING_SUMMON))
return false;
return true;
}
void HandlePeriodic(AuraEffect const* aurEff)
{
PreventDefaultAction();
GetTarget()->CastSpell(GetTarget(), SPELL_RUNE_OF_SUMMONING_SUMMON, true, NULL, aurEff, GetTarget()->isSummon() ? GetTarget()->ToTempSummon()->GetSummonerGUID() : 0);
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (TempSummon* summ = GetTarget()->ToTempSummon())
summ->DespawnOrUnsummon(1);
}
void Register()
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_assembly_rune_of_summoning_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
OnEffectRemove += AuraEffectRemoveFn(spell_assembly_rune_of_summoning_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const
{
return new spell_assembly_rune_of_summoning_AuraScript();
}
};
void AddSC_boss_assembly_of_iron()
{
new boss_steelbreaker();
new boss_runemaster_molgeim();
new boss_stormcaller_brundir();
new mob_lightning_elemental();
new mob_rune_of_summoning();
new mob_rune_of_power();
new spell_shield_of_runes();
new spell_assembly_meltdown();
new spell_assembly_rune_of_summoning();
}

View File

@@ -34,6 +34,14 @@ static DoorData const doorData[] =
{0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE },
};
MinionData const minionData[] =
{
{ NPC_STEELBREAKER, BOSS_ASSEMBLY_OF_IRON },
{ NPC_MOLGEIM, BOSS_ASSEMBLY_OF_IRON },
{ NPC_BRUNDIR, BOSS_ASSEMBLY_OF_IRON },
{ 0, 0, }
};
class instance_ulduar : public InstanceMapScript
{
public:
@@ -43,8 +51,6 @@ class instance_ulduar : public InstanceMapScript
{
instance_ulduar_InstanceMapScript(InstanceMap* map) : InstanceScript(map) { }
std::string m_strInstData;
// Creatures
uint64 LeviathanGUID;
uint64 IgnisGUID;
@@ -99,6 +105,7 @@ class instance_ulduar : public InstanceMapScript
{
SetBossNumber(MAX_ENCOUNTER);
LoadDoorData(doorData);
LoadMinionData(minionData);
IgnisGUID = 0;
RazorscaleGUID = 0;
RazorscaleController = 0;
@@ -202,18 +209,24 @@ class instance_ulduar : public InstanceMapScript
case NPC_XT_TOY_PILE:
for (uint8 i = 0; i < 4; ++i)
if (!XTToyPileGUIDs[i])
{
XTToyPileGUIDs[i] = creature->GetGUID();
break;
}
break;
// Assembly of Iron
case NPC_STEELBREAKER:
AssemblyGUIDs[0] = creature->GetGUID();
AddMinion(creature, true);
break;
case NPC_MOLGEIM:
AssemblyGUIDs[1] = creature->GetGUID();
AddMinion(creature, true);
break;
case NPC_BRUNDIR:
AssemblyGUIDs[2] = creature->GetGUID();
AddMinion(creature, true);
break;
// Freya's Keeper
@@ -314,10 +327,25 @@ class instance_ulduar : public InstanceMapScript
{
switch (creature->GetEntry())
{
case NPC_XT_TOY_PILE:
for (uint8 i = 0; i < 4; ++i)
if (XTToyPileGUIDs[i] == creature->GetGUID())
{
XTToyPileGUIDs[i] = 0;
break;
}
break;
case NPC_STEELBREAKER:
case NPC_MOLGEIM:
case NPC_BRUNDIR:
AddMinion(creature, false);
break;
case NPC_BRANN_BRONZBEARD_ALG:
if (BrannBronzebeardAlgGUID == creature->GetGUID())
BrannBronzebeardAlgGUID = 0;
break;
default:
break;
}
}
@@ -707,11 +735,11 @@ class instance_ulduar : public InstanceMapScript
return RazorHarpoonGUIDs[3];
// Assembly of Iron
case BOSS_STEELBREAKER:
case DATA_STEELBREAKER:
return AssemblyGUIDs[0];
case BOSS_MOLGEIM:
case DATA_MOLGEIM:
return AssemblyGUIDs[1];
case BOSS_BRUNDIR:
case DATA_BRUNDIR:
return AssemblyGUIDs[2];
// Freya's Keepers

View File

@@ -25,28 +25,25 @@ extern Position const AlgalonLandPos;
enum UlduarBosses
{
MAX_ENCOUNTER = 20,
MAX_ENCOUNTER = 17,
BOSS_LEVIATHAN = 0,
BOSS_IGNIS = 1,
BOSS_RAZORSCALE = 2,
BOSS_XT002 = 3,
BOSS_ASSEMBLY_OF_IRON = 4,
BOSS_STEELBREAKER = 5,
BOSS_MOLGEIM = 6,
BOSS_BRUNDIR = 7,
BOSS_KOLOGARN = 8,
BOSS_AURIAYA = 9,
BOSS_MIMIRON = 10,
BOSS_HODIR = 11,
BOSS_THORIM = 12,
BOSS_FREYA = 13,
BOSS_BRIGHTLEAF = 14,
BOSS_IRONBRANCH = 15,
BOSS_STONEBARK = 16,
BOSS_VEZAX = 17,
BOSS_YOGGSARON = 18,
BOSS_ALGALON = 19,
BOSS_KOLOGARN = 5,
BOSS_AURIAYA = 6,
BOSS_MIMIRON = 7,
BOSS_HODIR = 8,
BOSS_THORIM = 9,
BOSS_FREYA = 10,
BOSS_BRIGHTLEAF = 11,
BOSS_IRONBRANCH = 12,
BOSS_STONEBARK = 13,
BOSS_VEZAX = 14,
BOSS_YOGGSARON = 15,
BOSS_ALGALON = 16,
};
enum UlduarNPCs
@@ -207,6 +204,11 @@ enum UlduarData
DATA_TOY_PILE_2,
DATA_TOY_PILE_3,
// Assembly of Iron
DATA_STEELBREAKER,
DATA_MOLGEIM,
DATA_BRUNDIR,
// Hodir
DATA_HODIR_RARE_CACHE,