aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_druid.cpp57
1 files changed, 46 insertions, 11 deletions
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index 9fdde889bdc..f2e581b99b7 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -57,6 +57,7 @@ enum DruidSpells
SPELL_DRUID_EXHILARATE = 28742,
SPELL_DRUID_FERAL_CHARGE_BEAR = 16979,
SPELL_DRUID_FERAL_CHARGE_CAT = 49376,
+ SPELL_DRUID_FORM_AQUATIC_PASSIVE = 276012,
SPELL_DRUID_FORM_AQUATIC = 1066,
SPELL_DRUID_FORM_FLIGHT = 33943,
SPELL_DRUID_FORM_STAG = 165961,
@@ -79,6 +80,7 @@ enum DruidSpells
SPELL_DRUID_LIVING_SEED_PROC = 48504,
SPELL_DRUID_MANGLE = 33917,
SPELL_DRUID_MOONFIRE_DAMAGE = 164812,
+ SPELL_DRUID_PROWL = 5215,
SPELL_DRUID_REJUVENATION_T10_PROC = 70691,
SPELL_DRUID_RESTORATION_T10_2P_BONUS = 70658,
SPELL_DRUID_SAVAGE_ROAR = 62071,
@@ -217,7 +219,7 @@ class spell_dru_bristling_fur : public AuraScript
if (DamageInfo* damageInfo = eventInfo.GetDamageInfo())
{
Unit* target = GetTarget();
- uint32 rage = 100.0f * (float)damageInfo->GetDamage() / (float)target->GetMaxHealth();
+ uint32 rage = target->GetMaxPower(POWER_RAGE) * (float)damageInfo->GetDamage() / (float)target->GetMaxHealth();
if (rage > 0)
target->CastCustomSpell(SPELL_DRUID_BRISTLING_FUR_GAIN_RAGE, SPELLVALUE_BASE_POINT0, rage, target, TRIGGERED_FULL_MASK);
}
@@ -229,6 +231,27 @@ class spell_dru_bristling_fur : public AuraScript
}
};
+// 768 - CatForm - SPELL_DRUID_CAT_FORM
+class spell_dru_cat_form : public AuraScript
+{
+ PrepareAuraScript(spell_dru_cat_form);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_DRUID_PROWL });
+ }
+
+ void HandleAfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ GetTarget()->RemoveOwnedAura(SPELL_DRUID_PROWL);
+ }
+
+ void Register() override
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_dru_cat_form::HandleAfterRemove, EFFECT_0, SPELL_AURA_MOD_SHAPESHIFT, AURA_EFFECT_HANDLE_REAL);
+ }
+};
+
// 1850 - Dash
class spell_dru_dash : public SpellScriptLoader
{
@@ -1743,7 +1766,7 @@ public:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_DRUID_FORM_STAG, SPELL_DRUID_FORM_AQUATIC, SPELL_DRUID_FORM_FLIGHT, SPELL_DRUID_FORM_SWIFT_FLIGHT });
+ return ValidateSpellInfo({ SPELL_DRUID_FORM_STAG, SPELL_DRUID_FORM_AQUATIC_PASSIVE, SPELL_DRUID_FORM_AQUATIC, SPELL_DRUID_FORM_FLIGHT, SPELL_DRUID_FORM_SWIFT_FLIGHT });
}
bool Load() override
@@ -1799,13 +1822,13 @@ public:
static uint32 GetFormSpellId(Player const* player, Difficulty difficulty, bool requiresOutdoor)
{
// Check what form is appropriate
- if (player->IsInWater()) // Aquatic form
+ if (player->HasSpell(SPELL_DRUID_FORM_AQUATIC_PASSIVE) && player->IsInWater()) // Aquatic form
return SPELL_DRUID_FORM_AQUATIC;
if (!player->IsInCombat() && player->GetSkillValue(SKILL_RIDING) >= 225 && CheckLocationForForm(player, difficulty, requiresOutdoor, SPELL_DRUID_FORM_FLIGHT) == SPELL_CAST_OK) // Flight form
return player->GetSkillValue(SKILL_RIDING) >= 300 ? SPELL_DRUID_FORM_SWIFT_FLIGHT : SPELL_DRUID_FORM_FLIGHT;
- if (CheckLocationForForm(player, difficulty, requiresOutdoor, SPELL_DRUID_FORM_STAG) == SPELL_CAST_OK) // Stag form
+ if (!player->IsInWater() && CheckLocationForForm(player, difficulty, requiresOutdoor, SPELL_DRUID_FORM_STAG) == SPELL_CAST_OK) // Stag form
return SPELL_DRUID_FORM_STAG;
return 0;
@@ -1833,16 +1856,20 @@ public:
{
PrepareSpellScript(spell_dru_travel_form_dummy_SpellScript);
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_DRUID_FORM_AQUATIC_PASSIVE, SPELL_DRUID_FORM_AQUATIC, SPELL_DRUID_FORM_STAG });
+ }
+
SpellCastResult CheckCast()
{
Player* player = GetCaster()->ToPlayer();
if (!player)
return SPELL_FAILED_CUSTOM_ERROR;
- if (player->GetSkillValue(SKILL_RIDING) < 75)
- return SPELL_FAILED_APPRENTICE_RIDING_REQUIREMENT;
+ uint32 spellId = (player->HasSpell(SPELL_DRUID_FORM_AQUATIC_PASSIVE) && player->IsInWater()) ? SPELL_DRUID_FORM_AQUATIC : SPELL_DRUID_FORM_STAG;
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(player->IsInWater() ? SPELL_DRUID_FORM_AQUATIC : SPELL_DRUID_FORM_STAG, GetCastDifficulty());
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId, GetCastDifficulty());
return spellInfo->CheckLocation(player->GetMapId(), player->GetZoneId(), player->GetAreaId(), player);
}
@@ -1904,9 +1931,16 @@ public:
};
// 252216 - Tiger Dash
-class spell_dru_tiger_dash : public AuraScript
+class spell_dru_tiger_dash : public spell_dru_base_transformer
+{
+protected:
+ bool ToCatForm() const override { return true; }
+};
+
+// 252216 - Tiger Dash (Aura)
+class spell_dru_tiger_dash_aura : public AuraScript
{
- PrepareAuraScript(spell_dru_tiger_dash);
+ PrepareAuraScript(spell_dru_tiger_dash_aura);
void HandlePeriodic(AuraEffect const* aurEff)
{
@@ -1919,7 +1953,7 @@ class spell_dru_tiger_dash : public AuraScript
void Register() override
{
- OnEffectPeriodic += AuraEffectPeriodicFn(spell_dru_tiger_dash::HandlePeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_dru_tiger_dash_aura::HandlePeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
}
};
@@ -2021,6 +2055,7 @@ void AddSC_druid_spell_scripts()
RegisterSpellScript(spell_dru_berserk);
RegisterAuraScript(spell_dru_brambles);
RegisterAuraScript(spell_dru_bristling_fur);
+ RegisterAuraScript(spell_dru_cat_form);
new spell_dru_dash();
RegisterAuraScript(spell_dru_earthwarden);
RegisterAuraScript(spell_dru_eclipse_aura);
@@ -2061,6 +2096,6 @@ void AddSC_druid_spell_scripts()
RegisterAuraScript(spell_dru_thrash_aura);
new spell_dru_travel_form();
new spell_dru_travel_form_dummy();
- RegisterAuraScript(spell_dru_tiger_dash);
+ RegisterSpellAndAuraScriptPair(spell_dru_tiger_dash, spell_dru_tiger_dash_aura);
new spell_dru_wild_growth();
}