fix(Scripts/MoltenCore): Properly spawn Ragnaros' Sons of Flame (#9642)

This commit is contained in:
Skjalf
2021-12-11 07:56:33 -03:00
committed by GitHub
parent bf199ff1de
commit e2a32bb7fc
2 changed files with 67 additions and 14 deletions

View File

@@ -0,0 +1,19 @@
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1639172292353316400');
DELETE FROM `spell_script_names` WHERE `spell_id` = 21108;
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(21108, 'spell_ragnaros_summon_sons_of_flame');
UPDATE `spell_dbc` SET `Effect_1` = 28, `EffectMiscValueB_1` = 64, `EffectBasePoints_1` = 1 WHERE `ID` IN (21110, 21111, 21112, 21113, 21114, 21115, 21116, 21117);
-- Positions are sniffed, but spell/pos relation can't be confirmed (serverside spells)
DELETE FROM `spell_target_position` WHERE `ID` IN (21110, 21111, 21112, 21113, 21114, 21115, 21116, 21117);
INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`, `VerifiedBuild`) VALUES
(21110, 0, 409, 811.448, -814.058, -233.17667, 0, 0),
(21111, 0, 409, 842.542, -797.822, -233.33968, 0, 0),
(21112, 0, 409, 870.668, -821.862, -232.93767, 2.460026741027832031, 0),
(21113, 0, 409, 874.851, -861.112, -232.33568, 2.460026741027832031, 0),
(21114, 0, 409, 891.442, -789.678, -232.80067, 3.549857854843139648, 0),
(21115, 0, 409, 824.827, -871.046, -232.42067, 1.242526054382324218, 0),
(21116, 0, 409, 868.206, -895.036, -233.09967, 2.010415554046630859, 0),
(21117, 0, 409, 818.517, -898.278, -232.90266, 1.282807230949401855, 0);

View File

@@ -39,7 +39,7 @@ enum Spells
{
SPELL_HAND_OF_RAGNAROS = 19780,
SPELL_WRATH_OF_RAGNAROS = 20566,
SPELL_LAVA_BURST = 21908, // Randomly trigger one of server side spells (21886, 21900 - 21907) which summons Go 178088 (TODO)
SPELL_LAVA_BURST = 21908, // Randomly trigger one of server side spells (21886, 21900 - 21907) which summons Go 178088
SPELL_MAGMA_BLAST = 20565, // Ranged attack
SPELL_SONS_OF_FLAME_DUMMY = 21108, // Server side effect
SPELL_RAGSUBMERGE = 21107, // Stealth aura
@@ -49,7 +49,7 @@ enum Spells
SPELL_ELEMENTAL_FIRE_KILL = 19773, // Spell is used only on Majordomo
SPELL_MIGHT_OF_RAGNAROS = 21154,
SPELL_INTENSE_HEAT = 21155,
SPELL_SUMMON_SONS_FLAME = 21108, // Trigger the eight spells summoning the Son of Flame adds (TODO)
SPELL_SUMMON_SONS_FLAME = 21108, // Trigger the eight spells summoning the Son of Flame adds
SPELL_LAVA_BURST_A = 21886,
SPELL_LAVA_BURST_B = 21900,
@@ -59,7 +59,16 @@ enum Spells
SPELL_LAVA_BURST_F = 21905,
SPELL_LAVA_BURST_G = 21906,
SPELL_LAVA_BURST_H = 21907,
SPELL_LAVA_BURST_TRAP = 21158
SPELL_LAVA_BURST_TRAP = 21158,
SPELL_SUMMON_SON_OF_FLAME_A = 21117,
SPELL_SUMMON_SON_OF_FLAME_B = 21110,
SPELL_SUMMON_SON_OF_FLAME_C = 21111,
SPELL_SUMMON_SON_OF_FLAME_D = 21112,
SPELL_SUMMON_SON_OF_FLAME_E = 21113,
SPELL_SUMMON_SON_OF_FLAME_F = 21114,
SPELL_SUMMON_SON_OF_FLAME_G = 21115,
SPELL_SUMMON_SON_OF_FLAME_H = 21116
};
enum Events
@@ -156,6 +165,10 @@ public:
{
summon->CastSpell((Unit*)nullptr, SPELL_INTENSE_HEAT, true, nullptr, nullptr, me->GetGUID());
}
else if (summon->GetEntry() == NPC_SON_OF_FLAME)
{
DoZoneInCombat(summon);
}
}
void SetGUID(ObjectGuid guid, int32 index) override
@@ -390,16 +403,7 @@ public:
Talk(_hasSubmergedOnce ? SAY_REINFORCEMENTS2 : SAY_REINFORCEMENTS1);
for (uint8 i = 0; i < MAX_SON_OF_FLAME_COUNT; ++i)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
{
if (Creature* summoned = me->SummonCreature(NPC_SON_OF_FLAME, target->GetPosition(), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 900000))
{
summoned->AI()->AttackStart(target);
}
}
}
DoCastAOE(SPELL_SUMMON_SONS_FLAME);
if (!_hasSubmergedOnce)
{
@@ -479,7 +483,7 @@ public:
constexpr std::array<uint32, 8> RagnarosLavaBurstSpells = { SPELL_LAVA_BURST_A, SPELL_LAVA_BURST_B, SPELL_LAVA_BURST_C, SPELL_LAVA_BURST_D, SPELL_LAVA_BURST_E, SPELL_LAVA_BURST_F, SPELL_LAVA_BURST_G, SPELL_LAVA_BURST_H };
// 21908 - Lava Burst Randomizer
// 21908 - Lava Burst Randomizer (server side)
class spell_ragnaros_lava_burst_randomizer : public SpellScript
{
PrepareSpellScript(spell_ragnaros_lava_burst_randomizer);
@@ -508,8 +512,38 @@ class spell_ragnaros_lava_burst_randomizer : public SpellScript
}
};
constexpr std::array<uint32, 8> RagnarosSoFSpells = { SPELL_SUMMON_SON_OF_FLAME_A, SPELL_SUMMON_SON_OF_FLAME_B, SPELL_SUMMON_SON_OF_FLAME_C, SPELL_SUMMON_SON_OF_FLAME_D, SPELL_SUMMON_SON_OF_FLAME_E, SPELL_SUMMON_SON_OF_FLAME_F, SPELL_SUMMON_SON_OF_FLAME_G, SPELL_SUMMON_SON_OF_FLAME_H };
// 21108 - Summon Sons of Flame (server side)
class spell_ragnaros_summon_sons_of_flame : public SpellScript
{
PrepareSpellScript(spell_ragnaros_summon_sons_of_flame);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(RagnarosSoFSpells);
}
void HandleScript()
{
if (Unit* caster = GetCaster())
{
for (uint32 spell : RagnarosSoFSpells)
{
caster->CastSpell(caster, spell, true);
}
}
}
void Register() override
{
AfterCast += SpellCastFn(spell_ragnaros_summon_sons_of_flame::HandleScript);
}
};
void AddSC_boss_ragnaros()
{
new boss_ragnaros();
RegisterSpellScript(spell_ragnaros_lava_burst_randomizer);
RegisterSpellScript(spell_ragnaros_summon_sons_of_flame);
}