Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Fix stampeding roar and prowl on catform remove (#1054)
Browse files Browse the repository at this point in the history
* fix (Core/Spells) Stampeding roar

- Now triggers bear form appropriately
- Now removes root/snares

* fix (Core/Spells) Remove prowl when leaving catform

* Use GetShapeshiftForm instead of HasAura

* fix (Core/Spells) few druid spells

- Bear Hug now activates bearform
- Might of Ursoc now activates bear form and calculates proper health increase amount
Crypticaz authored and AriDEV committed Aug 3, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent e84e075 commit 2aacb14
Showing 3 changed files with 79 additions and 2 deletions.
2 changes: 2 additions & 0 deletions sql/updates/world/2021_08_02_00_world.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DELETE FROM `spell_script_names` WHERE `spell_id`=106922 AND `ScriptName`='spell_dru_might_of_ursoc';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (106922, 'spell_dru_might_of_ursoc');
32 changes: 31 additions & 1 deletion src/server/game/Spells/Auras/SpellAuras.cpp
Original file line number Diff line number Diff line change
@@ -1245,10 +1245,30 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
case 5215: // Prowl
{
// check for catform
if (!caster->HasAura(768))
if (caster->GetShapeshiftForm() != FORM_CAT)
caster->CastSpell(caster, 768, true);
break;
}
case 106898: // Stampeding Roar
{
// activates bear form
caster->CastSpell(caster, 5487, true);
target->RemoveMovementImpairingAuras();
break;
}
case 77761: // Stampeding roar Bearform
case 77764: // Stampeding roar Catform
{
target->RemoveMovementImpairingAuras();
break;
}
case 102795: // Bear Hug
{
// check for bear form
if (caster->GetShapeshiftForm() != FORM_BEAR)
caster->CastSpell(caster, 5487, true); // activate bear form
break;
}
break;
}
break;
@@ -1458,6 +1478,16 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
if (caster && caster->HasAura(56845))
target->CastSpell(target, 61394, true);
break;
case SPELLFAMILY_DRUID:
switch (m_spellInfo->Id)
{
case 768: // catform
// remove prowl when leaving catform
if (caster->HasAura(5215))
caster->RemoveOwnedAura(5215);
break;
}
break;
}
}

47 changes: 46 additions & 1 deletion src/server/scripts/Spells/spell_druid.cpp
Original file line number Diff line number Diff line change
@@ -56,7 +56,8 @@ enum DruidSpells
SPELL_DRUID_STAMPEDE_BAER_RANK_1 = 81016,
SPELL_DRUID_STAMPEDE_CAT_RANK_1 = 81021,
SPELL_DRUID_STAMPEDE_CAT_STATE = 109881,
SPELL_DRUID_TIGER_S_FURY_ENERGIZE = 51178
SPELL_DRUID_TIGER_S_FURY_ENERGIZE = 51178,
SPELL_DRUID_BEAR_FORM = 5487,
};

// 1850 - Dash
@@ -541,6 +542,49 @@ class spell_dru_living_seed_proc : public SpellScriptLoader
}
};

// 106922 - Might of Ursoc
class spell_dru_might_of_ursoc: public SpellScriptLoader
{
public:
spell_dru_might_of_ursoc() : SpellScriptLoader("spell_dru_might_of_ursoc") { }

class spell_dru_might_of_ursoc_AuraScript : public AuraScript
{
PrepareAuraScript(spell_dru_might_of_ursoc_AuraScript);

bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_BEAR_FORM))
return false;
return true;
}

void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* caster = GetCaster())
{
// cast bear form first
if (caster->GetShapeshiftForm() != FORM_BEAR)
caster->CastSpell(caster, SPELL_DRUID_BEAR_FORM, true); // activate bear form
// then calculate amount
amount = aurEff->GetBase()->GetUnitOwner()->CountPctFromMaxHealth(amount);
}

}

void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_might_of_ursoc_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_INCREASE_HEALTH_2);
}
};

AuraScript* GetAuraScript() const
{
return new spell_dru_might_of_ursoc_AuraScript();
}

};

// -16972 - Predatory Strikes
class spell_dru_predatory_strikes : public SpellScriptLoader
{
@@ -945,6 +989,7 @@ void AddSC_druid_spell_scripts()
new spell_dru_lifebloom();
new spell_dru_living_seed();
new spell_dru_living_seed_proc();
new spell_dru_might_of_ursoc();
new spell_dru_predatory_strikes();
new spell_dru_savage_defense();
new spell_dru_savage_roar();

0 comments on commit 2aacb14

Please sign in to comment.