mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 02:04:52 +01:00
Scripts/Quest: Update 'Jormuttar is Soo Fat...' (#27838)
(cherry picked from commit b7de329941)
This commit is contained in:
@@ -1451,6 +1451,60 @@ class spell_read_pronouncement : public AuraScript
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## Quest 13011: Jormuttar is Soo Fat...
|
||||
######*/
|
||||
|
||||
enum JormuttarIsSooFat
|
||||
{
|
||||
SPELL_CREATE_BEAR_FLANK = 56566,
|
||||
SPELL_BEAR_FLANK_FAIL = 56569,
|
||||
TEXT_CARVE_FAIL = 30986
|
||||
};
|
||||
|
||||
// 56565 - Bear Flank Master
|
||||
class spell_bear_flank_master : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_bear_flank_master);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_CREATE_BEAR_FLANK, SPELL_BEAR_FLANK_FAIL });
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
GetHitUnit()->CastSpell(GetHitUnit(), roll_chance_i(20) ? SPELL_CREATE_BEAR_FLANK : SPELL_BEAR_FLANK_FAIL);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_bear_flank_master::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
// 56569 - Bear Flank Fail
|
||||
class spell_bear_flank_fail : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_bear_flank_fail);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return sBroadcastTextStore.HasRecord(TEXT_CARVE_FAIL);
|
||||
}
|
||||
|
||||
void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Player* target = GetTarget()->ToPlayer())
|
||||
target->Unit::Whisper(TEXT_CARVE_FAIL, target, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_bear_flank_fail::AfterApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_storm_peaks()
|
||||
{
|
||||
new npc_roxi_ramrocket();
|
||||
@@ -1476,4 +1530,6 @@ void AddSC_storm_peaks()
|
||||
new spell_player_mount_wyrm();
|
||||
RegisterSpellScript(spell_q12823_remove_collapsing_cave_aura);
|
||||
RegisterSpellScript(spell_read_pronouncement);
|
||||
RegisterSpellScript(spell_bear_flank_master);
|
||||
RegisterSpellScript(spell_bear_flank_fail);
|
||||
}
|
||||
|
||||
@@ -1305,52 +1305,6 @@ class spell_q12847_summon_soul_moveto_bunny : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
enum BearFlankMaster
|
||||
{
|
||||
SPELL_CREATE_BEAR_FLANK = 56566,
|
||||
SPELL_BEAR_FLANK_FAIL = 56569
|
||||
};
|
||||
|
||||
// 56565 - Bear Flank Master
|
||||
class spell_q13011_bear_flank_master : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q13011_bear_flank_master);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_CREATE_BEAR_FLANK,
|
||||
SPELL_BEAR_FLANK_FAIL
|
||||
});
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Player* player = GetHitPlayer())
|
||||
{
|
||||
if (roll_chance_i(50))
|
||||
{
|
||||
Creature* creature = GetCaster()->ToCreature();
|
||||
player->CastSpell(creature, SPELL_BEAR_FLANK_FAIL);
|
||||
creature->AI()->Talk(0, player);
|
||||
}
|
||||
else
|
||||
player->CastSpell(player, SPELL_CREATE_BEAR_FLANK);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_q13011_bear_flank_master::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
// 57385 - Argent Cannon
|
||||
// 57412 - Reckoning Bomb
|
||||
class spell_q13086_cannons_target : public SpellScript
|
||||
@@ -2391,7 +2345,6 @@ void AddSC_quest_spell_scripts()
|
||||
RegisterSpellScript(spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy);
|
||||
RegisterSpellScript(spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon);
|
||||
RegisterSpellScript(spell_q12847_summon_soul_moveto_bunny);
|
||||
RegisterSpellScript(spell_q13011_bear_flank_master);
|
||||
RegisterSpellScript(spell_q13086_cannons_target);
|
||||
RegisterSpellScript(spell_q13264_q13276_q13288_q13289_burst_at_the_seams_59576);
|
||||
RegisterSpellScript(spell_q13264_q13276_q13288_q13289_burst_at_the_seams_59579);
|
||||
|
||||
Reference in New Issue
Block a user