mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-28 08:06:23 +00:00
fix(Core/Spells): Fixed explosive shot ammo consumption (#21501)
Co-authored-by: pavel_k <pavel_k@mail.com> Co-authored-by: Jelle Meeus <sogladev@gmail.com>
This commit is contained in:
@@ -5405,7 +5405,7 @@ void Spell::TakePower()
|
||||
|
||||
void Spell::TakeAmmo()
|
||||
{
|
||||
if (m_attackType == RANGED_ATTACK && m_caster->IsPlayer())
|
||||
if (m_attackType == RANGED_ATTACK && m_caster->IsPlayer() && !m_spellInfo->HasAttribute(SPELL_ATTR6_DO_NOT_CONSUME_RESOURCES))
|
||||
{
|
||||
Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK);
|
||||
|
||||
|
||||
@@ -1347,6 +1347,27 @@ class spell_hun_target_self_and_pet : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
// -53301 - Explosive Shot
|
||||
class spell_hun_explosive_shot : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_hun_explosive_shot);
|
||||
|
||||
void HandleFinish()
|
||||
{
|
||||
// Handling of explosive shot initial cast without LnL proc
|
||||
if (!GetCaster() || !GetCaster()->IsPlayer())
|
||||
return;
|
||||
|
||||
if (!GetCaster()->HasAura(SPELL_LOCK_AND_LOAD_TRIGGER))
|
||||
GetSpell()->TakeAmmo();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterCast += SpellCastFn(spell_hun_explosive_shot::HandleFinish);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_hunter_spell_scripts()
|
||||
{
|
||||
RegisterSpellScript(spell_hun_check_pet_los);
|
||||
@@ -1378,4 +1399,5 @@ void AddSC_hunter_spell_scripts()
|
||||
RegisterSpellScript(spell_hun_intimidation);
|
||||
RegisterSpellScript(spell_hun_bestial_wrath);
|
||||
RegisterSpellScript(spell_hun_target_self_and_pet);
|
||||
RegisterSpellScript(spell_hun_explosive_shot);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user