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

Fix stampeding roar and prowl on catform remove #1054

Merged
merged 4 commits into from
Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}

Expand Down
47 changes: 46 additions & 1 deletion src/server/scripts/Spells/spell_druid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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();
Expand Down