mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 13:16:23 +00:00
fix(Core/SpellMgr): Add cooldown to some vehicle spells (#4300)
* fix(Core/SpellMgr): Add cooldown to some spells * author and spellscript Co-Authored-By: Wyrserth <43747507+Wyrserth@users.noreply.github.com>
This commit is contained in:
@@ -6766,10 +6766,58 @@ void SpellMgr::LoadDbcDataCorrections()
|
||||
spellInfo->EffectBasePoints[0] = 1; // corrects seat id (points - 1 = seatId)
|
||||
});
|
||||
|
||||
// The Iron Colossus
|
||||
ApplySpellFix({ 56513, 56524 }, [](SpellEntry* spellInfo)
|
||||
// Jormungar Strike
|
||||
ApplySpellFix({ 56513 }, [](SpellEntry* spellInfo)
|
||||
{
|
||||
spellInfo->RecoveryTime = (spellInfo->Id == 56524 ? 6000 : 2000);
|
||||
spellInfo->RecoveryTime = 2000;
|
||||
});
|
||||
|
||||
ApplySpellFix({
|
||||
37851, // Tag Greater Felfire Diemetradon
|
||||
37918 // Arcano-pince
|
||||
}, [](SpellEntry* spellInfo)
|
||||
{
|
||||
spellInfo->RecoveryTime = 3000;
|
||||
});
|
||||
|
||||
ApplySpellFix({
|
||||
54997, // Cast Net (tooltip says 10s but sniffs say 6s)
|
||||
56524 // Acid Breath
|
||||
}, [](SpellEntry* spellInfo)
|
||||
{
|
||||
spellInfo->RecoveryTime = 6000;
|
||||
});
|
||||
|
||||
ApplySpellFix({
|
||||
47911, // EMP
|
||||
48620, // Wing Buffet
|
||||
51752 // Stampy's Stompy-Stomp
|
||||
}, [](SpellEntry* spellInfo)
|
||||
{
|
||||
spellInfo->RecoveryTime = 10000;
|
||||
});
|
||||
|
||||
ApplySpellFix({
|
||||
37727, // Touch of Darkness
|
||||
54996 // Ice Slick (tooltip says 20s but sniffs say 12s)
|
||||
}, [](SpellEntry* spellInfo)
|
||||
{
|
||||
spellInfo->RecoveryTime = 12000;
|
||||
});
|
||||
|
||||
// Signal Helmet to Attack
|
||||
ApplySpellFix({ 51748 }, [](SpellEntry* spellInfo)
|
||||
{
|
||||
spellInfo->RecoveryTime = 15000;
|
||||
});
|
||||
|
||||
ApplySpellFix({
|
||||
51756, // Charge
|
||||
37919, //Arcano-dismantle
|
||||
37917 //Arcano-Cloak
|
||||
}, [](SpellEntry* spellInfo)
|
||||
{
|
||||
spellInfo->RecoveryTime = 20000;
|
||||
});
|
||||
|
||||
// Kaw the Mammoth Destroyer
|
||||
|
||||
@@ -5043,6 +5043,39 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
// Used for some spells cast by vehicles or charmed creatures that do not send a cooldown event on their own
|
||||
class spell_gen_charmed_unit_spell_cooldown : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_charmed_unit_spell_cooldown() : SpellScriptLoader("spell_gen_charmed_unit_spell_cooldown") { }
|
||||
|
||||
class spell_gen_charmed_unit_spell_cooldown_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_charmed_unit_spell_cooldown_SpellScript);
|
||||
|
||||
void HandleCast()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (Player* owner = caster->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
{
|
||||
WorldPacket data;
|
||||
caster->BuildCooldownPacket(data, SPELL_COOLDOWN_FLAG_NONE, GetSpellInfo()->Id, GetSpellInfo()->RecoveryTime);
|
||||
owner->SendDirectMessage(&data);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnCast += SpellCastFn(spell_gen_charmed_unit_spell_cooldown_SpellScript::HandleCast);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_gen_charmed_unit_spell_cooldown_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_generic_spell_scripts()
|
||||
{
|
||||
// ours:
|
||||
@@ -5171,4 +5204,5 @@ void AddSC_generic_spell_scripts()
|
||||
new spell_gen_whisper_gulch_yogg_saron_whisper();
|
||||
new spell_gen_eject_all_passengers();
|
||||
new spell_gen_eject_passenger();
|
||||
new spell_gen_charmed_unit_spell_cooldown();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user