Skip to content

Commit

Permalink
Molten Core - Garr
Browse files Browse the repository at this point in the history
- update existing timers
- add Massive Eruption
  • Loading branch information
Tobschinski authored and cala committed Apr 20, 2017
1 parent ef7f7b8 commit 623a244
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 38 deletions.
3 changes: 2 additions & 1 deletion sql/scriptdev2/scriptdev2.sql
Expand Up @@ -3467,7 +3467,8 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen
(-1409021,'I go now to summon the lord whose house this is. Should you seek an audience with him, your paltry lives will surely be forfeit! Nevertheless, seek out his lair, if you dare!',0,1,0,0,'majordomo SAY_DEFEAT_3'),
(-1409022,'My flame! Please don\'t take away my flame... ',8042,1,0,0,'ragnaros SAY_ARRIVAL4_MAJ'),
(-1409023,'Very well, $n.',0,0,0,0,'majordomo SAY_SUMMON_0'),
(-1409024,'Impudent whelps! You\'ve rushed headlong to your own deaths! See now, the master stirs!',0,1,0,0,'majordomo SAY_SUMMON_1');
(-1409024,'Impudent whelps! You\'ve rushed headlong to your own deaths! See now, the master stirs!',0,1,0,0,'majordomo SAY_SUMMON_1'),
(-1409025,'%s forces one of his Firesworn minions to erupt!',0,2,0,0,'Garr EMOTE_MASSIVE_ERUPTION');

-- -1 429 000 DIRE MAUL
INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
Expand Down
81 changes: 44 additions & 37 deletions src/scriptdev2/scripts/eastern_kingdoms/molten_core/boss_garr.cpp
Expand Up @@ -16,8 +16,8 @@

/* ScriptData
SDName: Boss_Garr
SD%Complete: 80
SDComment: Firesworn erruption needs to be revisited
SD%Complete: 95
SDComment: 'Summon Player' missing
SDCategory: Molten Core
EndScriptData */

Expand All @@ -26,17 +26,20 @@ EndScriptData */

enum
{
EMOTE_MASSIVE_ERUPTION = -1409025,

// Garr spells
SPELL_ANTIMAGICPULSE = 19492,
SPELL_MAGMASHACKLES = 19496,
SPELL_ENRAGE = 19516,
SPELL_SUMMON_PLAYER = 20477,
SPELL_ERUPTION_TRIGGER = 20482,
SPELL_SEPARATION_ANXIETY = 23487, // Aura cast on himself by Garr, if adds move out of range, they will cast spell 23492 on themselves

// Add spells
SPELL_THRASH = 8876,
SPELL_IMMOLATE = 15733,
// Firesworn spells
SPELL_ERUPTION = 19497,
SPELL_MASSIVE_ERUPTION = 20483, // TODO possible on death
SPELL_ENRAGE_TRIGGER = 19515,
SPELL_MASSIVE_ERUPTION = 20483,
};

struct boss_garrAI : public ScriptedAI
Expand All @@ -51,17 +54,20 @@ struct boss_garrAI : public ScriptedAI

uint32 m_uiAntiMagicPulseTimer;
uint32 m_uiMagmaShacklesTimer;
uint32 m_uiMassiveEruptionTimer;

void Reset() override
{
m_uiAntiMagicPulseTimer = 25000;
m_uiMagmaShacklesTimer = 15000;
m_uiAntiMagicPulseTimer = urand(10 * IN_MILLISECONDS, 15 * IN_MILLISECONDS);
m_uiMagmaShacklesTimer = urand(5 * IN_MILLISECONDS, 10 * IN_MILLISECONDS);
m_uiMassiveEruptionTimer = 6 * MINUTE * IN_MILLISECONDS;
}

void Aggro(Unit* /*pWho*/) override
{
if (m_pInstance)
m_pInstance->SetData(TYPE_GARR, IN_PROGRESS);

// Garr has a 100 yard aura to keep track of the distance of each of his adds, they will enrage if moved out of it
DoCastSpellIfCan(m_creature, SPELL_SEPARATION_ANXIETY, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT);
}
Expand All @@ -78,6 +84,12 @@ struct boss_garrAI : public ScriptedAI
m_pInstance->SetData(TYPE_GARR, FAIL);
}

void SpellHit(Unit* /*pCaster*/, const SpellEntry* pSpell) override
{
if (pSpell->Id == SPELL_ENRAGE_TRIGGER)
DoCastSpellIfCan(m_creature, SPELL_ENRAGE, CAST_TRIGGERED);
}

void UpdateAI(const uint32 uiDiff) override
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
Expand All @@ -87,7 +99,7 @@ struct boss_garrAI : public ScriptedAI
if (m_uiAntiMagicPulseTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_ANTIMAGICPULSE) == CAST_OK)
m_uiAntiMagicPulseTimer = urand(10000, 15000);
m_uiAntiMagicPulseTimer = urand(15 * IN_MILLISECONDS, 20 * IN_MILLISECONDS);
}
else
m_uiAntiMagicPulseTimer -= uiDiff;
Expand All @@ -96,57 +108,52 @@ struct boss_garrAI : public ScriptedAI
if (m_uiMagmaShacklesTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_MAGMASHACKLES) == CAST_OK)
m_uiMagmaShacklesTimer = urand(8000, 12000);
m_uiMagmaShacklesTimer = urand(10 * IN_MILLISECONDS, 15 * IN_MILLISECONDS);
}
else
m_uiMagmaShacklesTimer -= uiDiff;

// MassiveEruption_Timer
if (m_uiMassiveEruptionTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_ERUPTION_TRIGGER) == CAST_OK)
{
DoScriptText(EMOTE_MASSIVE_ERUPTION, m_creature);
m_uiMassiveEruptionTimer = 20 * IN_MILLISECONDS;
}
}
else
m_uiMassiveEruptionTimer -= uiDiff;

DoMeleeAttackIfReady();
}
};

struct mob_fireswornAI : public ScriptedAI
{
mob_fireswornAI(Creature* pCreature) : ScriptedAI(pCreature)
{
m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData();
Reset();

DoCastSpellIfCan(m_creature, SPELL_THRASH, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT);
DoCastSpellIfCan(m_creature, SPELL_IMMOLATE, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT);
}

ScriptedInstance* m_pInstance;
mob_fireswornAI(Creature* pCreature) : ScriptedAI(pCreature) {}

void Reset() override {}

void JustDied(Unit* /*pKiller*/) override
void JustDied(Unit* pKiller) override
{
if (m_pInstance)
{
if (Creature* pGarr = m_pInstance->GetSingleCreatureFromStorage(NPC_GARR))
pGarr->CastSpell(pGarr, SPELL_ENRAGE, TRIGGERED_OLD_TRIGGERED, NULL, NULL, m_creature->GetObjectGuid());
}
if (m_creature != pKiller)
DoCastSpellIfCan(m_creature, SPELL_ERUPTION);

DoCastSpellIfCan(m_creature, SPELL_ENRAGE_TRIGGER, CAST_TRIGGERED);
}
void JustReachedHome() override

void SpellHit(Unit* /*pCaster*/, const SpellEntry* pSpell) override
{
DoCastSpellIfCan(m_creature, SPELL_THRASH, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT);
DoCastSpellIfCan(m_creature, SPELL_IMMOLATE, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT);
if (pSpell->Id == SPELL_ERUPTION_TRIGGER)
DoCastSpellIfCan(m_creature, SPELL_MASSIVE_ERUPTION);
}

void UpdateAI(const uint32 uiDiff) override
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;

// Cast Erruption and let them die
if (m_creature->GetHealthPercent() <= 10.0f)
{
DoCastSpellIfCan(m_creature->getVictim(), SPELL_ERUPTION);
m_creature->SetDeathState(JUST_DIED);
m_creature->RemoveCorpse();
}

DoMeleeAttackIfReady();
}
};
Expand Down

0 comments on commit 623a244

Please sign in to comment.