2010-07-24 22:41:42 +02:00
|
|
|
/*
|
2016-01-01 00:34:25 +01:00
|
|
|
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
2010-07-24 22:41:42 +02:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
|
* option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
|
* more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Scripts for spells with SPELLFAMILY_DRUID and SPELLFAMILY_GENERIC spells used by druid players.
|
|
|
|
|
* Ordered alphabetically using scriptname.
|
|
|
|
|
* Scriptnames of files in this file should be prefixed with "spell_dru_".
|
|
|
|
|
*/
|
|
|
|
|
|
2012-11-17 05:18:37 +01:00
|
|
|
#include "Player.h"
|
2012-02-19 16:57:07 +01:00
|
|
|
#include "ScriptMgr.h"
|
|
|
|
|
#include "SpellScript.h"
|
2010-08-18 00:20:23 +06:00
|
|
|
#include "SpellAuraEffects.h"
|
2015-02-17 01:01:44 +01:00
|
|
|
#include "SpellHistory.h"
|
2012-10-03 09:01:59 +02:00
|
|
|
#include "Containers.h"
|
2010-07-24 22:41:42 +02:00
|
|
|
|
2010-08-18 00:20:23 +06:00
|
|
|
enum DruidSpells
|
|
|
|
|
{
|
2013-01-14 20:28:32 +01:00
|
|
|
SPELL_DRUID_WRATH = 5176,
|
|
|
|
|
SPELL_DRUID_STARFIRE = 2912,
|
|
|
|
|
SPELL_DRUID_STARSURGE = 78674,
|
|
|
|
|
SPELL_DRUID_ECLIPSE_GENERAL_ENERGIZE = 89265,
|
|
|
|
|
SPELL_DRUID_STARSURGE_ENERGIZE = 86605,
|
|
|
|
|
SPELL_DRUID_LUNAR_ECLIPSE_MARKER = 67484, // Will make the yellow arrow on eclipse bar point to the blue side (lunar)
|
|
|
|
|
SPELL_DRUID_SOLAR_ECLIPSE_MARKER = 67483, // Will make the yellow arrow on eclipse bar point to the yellow side (solar)
|
|
|
|
|
SPELL_DRUID_SOLAR_ECLIPSE = 48517,
|
|
|
|
|
SPELL_DRUID_LUNAR_ECLIPSE = 48518,
|
2013-07-26 22:13:11 +02:00
|
|
|
SPELL_DRUID_FERAL_CHARGE_BEAR = 16979,
|
|
|
|
|
SPELL_DRUID_FERAL_CHARGE_CAT = 49376,
|
2013-07-21 15:28:03 +02:00
|
|
|
SPELL_DRUID_GLYPH_OF_INNERVATE = 54833,
|
2013-07-22 19:46:21 +02:00
|
|
|
SPELL_DRUID_GLYPH_OF_STARFIRE = 54846,
|
2013-01-20 04:30:17 +01:00
|
|
|
SPELL_DRUID_GLYPH_OF_TYPHOON = 62135,
|
|
|
|
|
SPELL_DRUID_IDOL_OF_FERAL_SHADOWS = 34241,
|
|
|
|
|
SPELL_DRUID_IDOL_OF_WORSHIP = 60774,
|
2013-01-12 02:16:30 +01:00
|
|
|
SPELL_DRUID_INCREASED_MOONFIRE_DURATION = 38414,
|
2013-07-26 22:13:11 +02:00
|
|
|
SPELL_DRUID_ITEM_T8_BALANCE_RELIC = 64950,
|
2013-01-12 02:16:30 +01:00
|
|
|
SPELL_DRUID_LIFEBLOOM_ENERGIZE = 64372,
|
|
|
|
|
SPELL_DRUID_LIFEBLOOM_FINAL_HEAL = 33778,
|
2013-01-22 00:20:16 +01:00
|
|
|
SPELL_DRUID_LIVING_SEED_HEAL = 48503,
|
|
|
|
|
SPELL_DRUID_LIVING_SEED_PROC = 48504,
|
2013-08-01 22:02:14 +02:00
|
|
|
SPELL_DRUID_NATURES_GRACE = 16880,
|
|
|
|
|
SPELL_DRUID_NATURES_GRACE_TRIGGER = 16886,
|
2013-01-12 02:16:30 +01:00
|
|
|
SPELL_DRUID_SURVIVAL_INSTINCTS = 50322,
|
|
|
|
|
SPELL_DRUID_SAVAGE_ROAR = 62071,
|
2013-07-26 22:13:11 +02:00
|
|
|
SPELL_DRUID_STAMPEDE_BAER_RANK_1 = 81016,
|
|
|
|
|
SPELL_DRUID_STAMPEDE_CAT_RANK_1 = 81021,
|
2016-01-03 21:19:43 +01:00
|
|
|
SPELL_DRUID_STAMPEDE_CAT_STATE = 109881
|
2013-01-14 20:28:32 +01:00
|
|
|
};
|
|
|
|
|
|
2013-08-01 22:02:14 +02:00
|
|
|
// 1850 - Dash
|
|
|
|
|
class spell_dru_dash : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_dru_dash() : SpellScriptLoader("spell_dru_dash") { }
|
|
|
|
|
|
|
|
|
|
class spell_dru_dash_AuraScript : public AuraScript
|
|
|
|
|
{
|
|
|
|
|
PrepareAuraScript(spell_dru_dash_AuraScript);
|
|
|
|
|
|
|
|
|
|
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
|
|
|
|
{
|
|
|
|
|
// do not set speed if not in cat form
|
|
|
|
|
if (GetUnitOwner()->GetShapeshiftForm() != FORM_CAT)
|
|
|
|
|
amount = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
void Register() override
|
2013-08-01 22:02:14 +02:00
|
|
|
{
|
|
|
|
|
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_dash_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_INCREASE_SPEED);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
AuraScript* GetAuraScript() const override
|
2013-08-01 22:02:14 +02:00
|
|
|
{
|
|
|
|
|
return new spell_dru_dash_AuraScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 48517 - Eclipse (Solar)
|
|
|
|
|
// 48518 - Eclipse (Lunar)
|
|
|
|
|
class spell_dru_eclipse : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_dru_eclipse(char const* scriptName) : SpellScriptLoader(scriptName) { }
|
|
|
|
|
|
|
|
|
|
class spell_dru_eclipse_AuraScript : public AuraScript
|
|
|
|
|
{
|
|
|
|
|
PrepareAuraScript(spell_dru_eclipse_AuraScript);
|
|
|
|
|
|
2014-04-29 20:14:42 +02:00
|
|
|
bool Validate(SpellInfo const* /*spellInfo*/) override
|
2013-08-01 22:02:14 +02:00
|
|
|
{
|
|
|
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_NATURES_GRACE) ||
|
|
|
|
|
!sSpellMgr->GetSpellInfo(SPELL_DRUID_NATURES_GRACE_TRIGGER))
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-29 20:14:42 +02:00
|
|
|
bool Load() override
|
2013-08-01 22:02:14 +02:00
|
|
|
{
|
|
|
|
|
return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
|
|
|
|
{
|
|
|
|
|
Unit* caster = GetCaster();
|
|
|
|
|
if (!caster)
|
|
|
|
|
return;
|
|
|
|
|
|
2015-02-17 01:01:44 +01:00
|
|
|
if (caster->GetAuraOfRankedSpell(SPELL_DRUID_NATURES_GRACE))
|
|
|
|
|
caster->GetSpellHistory()->ResetCooldown(SPELL_DRUID_NATURES_GRACE_TRIGGER, true);
|
2013-08-01 22:02:14 +02:00
|
|
|
}
|
|
|
|
|
|
2014-04-29 20:14:42 +02:00
|
|
|
void Register() override
|
2013-08-01 22:02:14 +02:00
|
|
|
{
|
|
|
|
|
OnEffectApply += AuraEffectApplyFn(spell_dru_eclipse_AuraScript::ApplyEffect, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 20:14:42 +02:00
|
|
|
AuraScript* GetAuraScript() const override
|
2013-08-01 22:02:14 +02:00
|
|
|
{
|
|
|
|
|
return new spell_dru_eclipse_AuraScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2013-01-14 20:28:32 +01:00
|
|
|
// 2912, 5176, 78674 - Starfire, Wrath, and Starsurge
|
|
|
|
|
class spell_dru_eclipse_energize : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_dru_eclipse_energize() : SpellScriptLoader("spell_dru_eclipse_energize") { }
|
|
|
|
|
|
|
|
|
|
class spell_dru_eclipse_energize_SpellScript : public SpellScript
|
|
|
|
|
{
|
|
|
|
|
PrepareSpellScript(spell_dru_eclipse_energize_SpellScript);
|
|
|
|
|
|
2014-04-29 20:14:42 +02:00
|
|
|
bool Load() override
|
2013-01-14 20:28:32 +01:00
|
|
|
{
|
|
|
|
|
if (GetCaster()->GetTypeId() != TYPEID_PLAYER)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (GetCaster()->ToPlayer()->getClass() != CLASS_DRUID)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2014-12-29 01:00:16 +01:00
|
|
|
void HandleEnergize(SpellEffIndex /*effIndex*/)
|
2013-01-14 20:28:32 +01:00
|
|
|
{
|
|
|
|
|
Player* caster = GetCaster()->ToPlayer();
|
|
|
|
|
|
|
|
|
|
// No boomy, no deal.
|
2015-01-30 23:58:16 +01:00
|
|
|
if (caster->GetSpecId(caster->GetActiveTalentGroup()) != TALENT_SPEC_DRUID_BALANCE)
|
2013-01-14 20:28:32 +01:00
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
switch (GetSpellInfo()->Id)
|
|
|
|
|
{
|
|
|
|
|
case SPELL_DRUID_WRATH:
|
|
|
|
|
{
|
2014-12-07 01:24:00 +01:00
|
|
|
int32 energizeAmount = -GetEffectValue(); // -13
|
2013-01-14 20:28:32 +01:00
|
|
|
// If we are set to fill the lunar side or we've just logged in with 0 power..
|
|
|
|
|
if ((!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER))
|
|
|
|
|
|| caster->GetPower(POWER_ECLIPSE) == 0)
|
|
|
|
|
{
|
|
|
|
|
caster->CastCustomSpell(caster, SPELL_DRUID_ECLIPSE_GENERAL_ENERGIZE, &energizeAmount, 0, 0, true);
|
|
|
|
|
// If the energize was due to 0 power, cast the eclipse marker aura
|
|
|
|
|
if (!caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER))
|
|
|
|
|
caster->CastSpell(caster, SPELL_DRUID_LUNAR_ECLIPSE_MARKER, true);
|
|
|
|
|
}
|
|
|
|
|
// The energizing effect brought us out of the solar eclipse, remove the aura
|
|
|
|
|
if (caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) <= 0)
|
|
|
|
|
caster->RemoveAurasDueToSpell(SPELL_DRUID_SOLAR_ECLIPSE);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case SPELL_DRUID_STARFIRE:
|
|
|
|
|
{
|
2014-12-07 01:24:00 +01:00
|
|
|
int32 energizeAmount = GetEffectValue(); // 20
|
2013-01-14 20:28:32 +01:00
|
|
|
// If we are set to fill the solar side or we've just logged in with 0 power..
|
|
|
|
|
if ((!caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER))
|
|
|
|
|
|| caster->GetPower(POWER_ECLIPSE) == 0)
|
|
|
|
|
{
|
|
|
|
|
caster->CastCustomSpell(caster, SPELL_DRUID_ECLIPSE_GENERAL_ENERGIZE, &energizeAmount, 0, 0, true);
|
|
|
|
|
// If the energize was due to 0 power, cast the eclipse marker aura
|
|
|
|
|
if (!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER))
|
|
|
|
|
caster->CastSpell(caster, SPELL_DRUID_SOLAR_ECLIPSE_MARKER, true);
|
|
|
|
|
}
|
|
|
|
|
// The energizing effect brought us out of the lunar eclipse, remove the aura
|
|
|
|
|
if (caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) >= 0)
|
|
|
|
|
caster->RemoveAura(SPELL_DRUID_LUNAR_ECLIPSE);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case SPELL_DRUID_STARSURGE:
|
|
|
|
|
{
|
|
|
|
|
// If we are set to fill the solar side or we've just logged in with 0 power (confirmed with sniffs)
|
|
|
|
|
if ((!caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER))
|
|
|
|
|
|| caster->GetPower(POWER_ECLIPSE) == 0)
|
|
|
|
|
{
|
2014-12-07 01:24:00 +01:00
|
|
|
int32 energizeAmount = GetEffectValue(); // 15
|
2013-01-14 20:28:32 +01:00
|
|
|
caster->CastCustomSpell(caster, SPELL_DRUID_STARSURGE_ENERGIZE, &energizeAmount, 0, 0, true);
|
|
|
|
|
|
|
|
|
|
// If the energize was due to 0 power, cast the eclipse marker aura
|
|
|
|
|
if (!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER))
|
|
|
|
|
caster->CastSpell(caster, SPELL_DRUID_SOLAR_ECLIPSE_MARKER, true);
|
|
|
|
|
}
|
|
|
|
|
else if (!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER))
|
|
|
|
|
{
|
2014-12-07 01:24:00 +01:00
|
|
|
int32 energizeAmount = -GetEffectValue(); // -15
|
2013-01-14 20:28:32 +01:00
|
|
|
caster->CastCustomSpell(caster, SPELL_DRUID_STARSURGE_ENERGIZE, &energizeAmount, 0, 0, true);
|
|
|
|
|
}
|
|
|
|
|
// The energizing effect brought us out of the lunar eclipse, remove the aura
|
|
|
|
|
if (caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) >= 0)
|
|
|
|
|
caster->RemoveAura(SPELL_DRUID_LUNAR_ECLIPSE);
|
|
|
|
|
// The energizing effect brought us out of the solar eclipse, remove the aura
|
|
|
|
|
else if (caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) <= 0)
|
|
|
|
|
caster->RemoveAura(SPELL_DRUID_SOLAR_ECLIPSE);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-29 20:14:42 +02:00
|
|
|
void Register() override
|
2013-01-14 20:28:32 +01:00
|
|
|
{
|
|
|
|
|
OnEffectHitTarget += SpellEffectFn(spell_dru_eclipse_energize_SpellScript::HandleEnergize, EFFECT_1, SPELL_EFFECT_DUMMY);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 20:14:42 +02:00
|
|
|
SpellScript* GetSpellScript() const override
|
2013-01-14 20:28:32 +01:00
|
|
|
{
|
|
|
|
|
return new spell_dru_eclipse_energize_SpellScript;
|
|
|
|
|
}
|
2012-09-17 18:17:23 +02:00
|
|
|
};
|
|
|
|
|
|
2013-07-21 15:28:03 +02:00
|
|
|
// 54832 - Glyph of Innervate
|
|
|
|
|
class spell_dru_glyph_of_innervate : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_dru_glyph_of_innervate() : SpellScriptLoader("spell_dru_glyph_of_innervate") { }
|
|
|
|
|
|
|
|
|
|
class spell_dru_glyph_of_innervate_AuraScript : public AuraScript
|
|
|
|
|
{
|
|
|
|
|
PrepareAuraScript(spell_dru_glyph_of_innervate_AuraScript);
|
|
|
|
|
|
2014-04-29 20:14:42 +02:00
|
|
|
bool Validate(SpellInfo const* /*spellInfo*/) override
|
2013-07-21 15:28:03 +02:00
|
|
|
{
|
|
|
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_GLYPH_OF_INNERVATE))
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CheckProc(ProcEventInfo& eventInfo)
|
|
|
|
|
{
|
|
|
|
|
// Not proc from self Innervate
|
|
|
|
|
return GetTarget() != eventInfo.GetProcTarget();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
|
|
|
|
{
|
|
|
|
|
PreventDefaultAction();
|
|
|
|
|
GetTarget()->CastSpell(GetTarget(), SPELL_DRUID_GLYPH_OF_INNERVATE, true, NULL, aurEff);
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-29 20:14:42 +02:00
|
|
|
void Register() override
|
2013-07-21 15:28:03 +02:00
|
|
|
{
|
|
|
|
|
DoCheckProc += AuraCheckProcFn(spell_dru_glyph_of_innervate_AuraScript::CheckProc);
|
|
|
|
|
OnEffectProc += AuraEffectProcFn(spell_dru_glyph_of_innervate_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 20:14:42 +02:00
|
|
|
AuraScript* GetAuraScript() const override
|
2013-07-21 15:28:03 +02:00
|
|
|
{
|
|
|
|
|
return new spell_dru_glyph_of_innervate_AuraScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2013-01-12 02:16:30 +01:00
|
|
|
// 54846 - Glyph of Starfire
|
2010-08-24 00:10:49 +02:00
|
|
|
class spell_dru_glyph_of_starfire : public SpellScriptLoader
|
2010-07-24 22:41:42 +02:00
|
|
|
{
|
2011-01-31 14:51:42 +01:00
|
|
|
public:
|
|
|
|
|
spell_dru_glyph_of_starfire() : SpellScriptLoader("spell_dru_glyph_of_starfire") { }
|
2010-08-18 00:20:23 +06:00
|
|
|
|
2011-01-31 14:51:42 +01:00
|
|
|
class spell_dru_glyph_of_starfire_SpellScript : public SpellScript
|
2010-08-18 00:20:23 +06:00
|
|
|
{
|
2011-01-31 14:51:42 +01:00
|
|
|
PrepareSpellScript(spell_dru_glyph_of_starfire_SpellScript);
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
bool Validate(SpellInfo const* /*spellInfo*/) override
|
2011-01-31 14:51:42 +01:00
|
|
|
{
|
2013-07-22 19:46:21 +02:00
|
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_INCREASED_MOONFIRE_DURATION))
|
2011-01-31 14:51:42 +01:00
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
|
|
|
|
{
|
|
|
|
|
Unit* caster = GetCaster();
|
|
|
|
|
if (Unit* unitTarget = GetHitUnit())
|
2015-04-27 00:33:27 +02:00
|
|
|
if (AuraEffect const* aurEff = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, flag128(0x2, 0, 0), caster->GetGUID()))
|
2010-08-18 00:20:23 +06:00
|
|
|
{
|
2011-01-31 14:51:42 +01:00
|
|
|
Aura* aura = aurEff->GetBase();
|
|
|
|
|
|
|
|
|
|
uint32 countMin = aura->GetMaxDuration();
|
2011-07-26 23:09:28 +02:00
|
|
|
uint32 countMax = aura->GetSpellInfo()->GetMaxDuration() + 9000;
|
2013-01-12 02:16:30 +01:00
|
|
|
if (caster->HasAura(SPELL_DRUID_INCREASED_MOONFIRE_DURATION))
|
2011-01-31 14:51:42 +01:00
|
|
|
countMax += 3000;
|
|
|
|
|
|
|
|
|
|
if (countMin < countMax)
|
|
|
|
|
{
|
|
|
|
|
aura->SetDuration(uint32(aura->GetDuration() + 3000));
|
|
|
|
|
aura->SetMaxDuration(countMin + 3000);
|
|
|
|
|
}
|
2010-08-18 00:20:23 +06:00
|
|
|
}
|
2011-01-31 14:51:42 +01:00
|
|
|
}
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
void Register() override
|
2011-01-31 14:51:42 +01:00
|
|
|
{
|
2011-09-25 13:29:17 +02:00
|
|
|
OnEffectHitTarget += SpellEffectFn(spell_dru_glyph_of_starfire_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
2011-01-31 14:51:42 +01:00
|
|
|
}
|
|
|
|
|
};
|
2010-08-18 00:20:23 +06:00
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
SpellScript* GetSpellScript() const override
|
2010-08-18 00:20:23 +06:00
|
|
|
{
|
2011-01-31 14:51:42 +01:00
|
|
|
return new spell_dru_glyph_of_starfire_SpellScript();
|
2010-08-18 00:20:23 +06:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2013-07-22 19:46:21 +02:00
|
|
|
// 54845 - Glyph of Starfire
|
|
|
|
|
class spell_dru_glyph_of_starfire_proc : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_dru_glyph_of_starfire_proc() : SpellScriptLoader("spell_dru_glyph_of_starfire_proc") { }
|
|
|
|
|
|
|
|
|
|
class spell_dru_glyph_of_starfire_proc_AuraScript : public AuraScript
|
|
|
|
|
{
|
|
|
|
|
PrepareAuraScript(spell_dru_glyph_of_starfire_proc_AuraScript);
|
|
|
|
|
|
2014-04-29 20:14:42 +02:00
|
|
|
bool Validate(SpellInfo const* /*spellInfo*/) override
|
2013-07-22 19:46:21 +02:00
|
|
|
{
|
|
|
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_GLYPH_OF_STARFIRE))
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
|
|
|
|
{
|
|
|
|
|
PreventDefaultAction();
|
|
|
|
|
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_DRUID_GLYPH_OF_STARFIRE, true, NULL, aurEff);
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-29 20:14:42 +02:00
|
|
|
void Register() override
|
2013-07-22 19:46:21 +02:00
|
|
|
{
|
|
|
|
|
OnEffectProc += AuraEffectProcFn(spell_dru_glyph_of_starfire_proc_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 20:14:42 +02:00
|
|
|
AuraScript* GetAuraScript() const override
|
2013-07-22 19:46:21 +02:00
|
|
|
{
|
|
|
|
|
return new spell_dru_glyph_of_starfire_proc_AuraScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2013-01-20 04:30:17 +01:00
|
|
|
// 34246 - Idol of the Emerald Queen
|
|
|
|
|
// 60779 - Idol of Lush Moss
|
|
|
|
|
class spell_dru_idol_lifebloom : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_dru_idol_lifebloom() : SpellScriptLoader("spell_dru_idol_lifebloom") { }
|
|
|
|
|
|
|
|
|
|
class spell_dru_idol_lifebloom_AuraScript : public AuraScript
|
|
|
|
|
{
|
|
|
|
|
PrepareAuraScript(spell_dru_idol_lifebloom_AuraScript);
|
|
|
|
|
|
|
|
|
|
void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod)
|
|
|
|
|
{
|
|
|
|
|
if (!spellMod)
|
|
|
|
|
{
|
|
|
|
|
spellMod = new SpellModifier(GetAura());
|
|
|
|
|
spellMod->op = SPELLMOD_DOT;
|
|
|
|
|
spellMod->type = SPELLMOD_FLAT;
|
|
|
|
|
spellMod->spellId = GetId();
|
2014-11-24 18:57:49 +01:00
|
|
|
spellMod->mask = GetSpellInfo()->GetEffect(aurEff->GetEffIndex())->SpellClassMask;
|
2013-01-20 04:30:17 +01:00
|
|
|
}
|
|
|
|
|
spellMod->value = aurEff->GetAmount() / 7;
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
void Register() override
|
2013-01-20 04:30:17 +01:00
|
|
|
{
|
|
|
|
|
DoEffectCalcSpellMod += AuraEffectCalcSpellModFn(spell_dru_idol_lifebloom_AuraScript::HandleEffectCalcSpellMod, EFFECT_0, SPELL_AURA_DUMMY);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
AuraScript* GetAuraScript() const override
|
2013-01-20 04:30:17 +01:00
|
|
|
{
|
|
|
|
|
return new spell_dru_idol_lifebloom_AuraScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 29166 - Innervate
|
|
|
|
|
class spell_dru_innervate : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_dru_innervate() : SpellScriptLoader("spell_dru_innervate") { }
|
|
|
|
|
|
|
|
|
|
class spell_dru_innervate_AuraScript : public AuraScript
|
|
|
|
|
{
|
|
|
|
|
PrepareAuraScript(spell_dru_innervate_AuraScript);
|
|
|
|
|
|
|
|
|
|
void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
|
|
|
|
|
{
|
2014-09-20 19:15:37 +02:00
|
|
|
if (Unit* caster = GetCaster())
|
|
|
|
|
amount = int32(CalculatePct(caster->GetCreatePowers(POWER_MANA), amount) / aurEff->GetTotalTicks());
|
|
|
|
|
else
|
|
|
|
|
amount = 0;
|
2013-01-20 04:30:17 +01:00
|
|
|
}
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
void Register() override
|
2013-01-20 04:30:17 +01:00
|
|
|
{
|
|
|
|
|
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_innervate_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_ENERGIZE);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
AuraScript* GetAuraScript() const override
|
2013-01-20 04:30:17 +01:00
|
|
|
{
|
|
|
|
|
return new spell_dru_innervate_AuraScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2013-07-25 15:34:36 +02:00
|
|
|
// 5570 - Insect Swarm
|
2012-09-17 18:17:23 +02:00
|
|
|
class spell_dru_insect_swarm : public SpellScriptLoader
|
2010-12-27 20:14:54 +01:00
|
|
|
{
|
2011-01-31 14:51:42 +01:00
|
|
|
public:
|
2012-09-17 18:17:23 +02:00
|
|
|
spell_dru_insect_swarm() : SpellScriptLoader("spell_dru_insect_swarm") { }
|
2010-12-30 02:03:46 +01:00
|
|
|
|
2012-09-17 18:17:23 +02:00
|
|
|
class spell_dru_insect_swarm_AuraScript : public AuraScript
|
2010-12-30 02:03:46 +01:00
|
|
|
{
|
2012-09-17 18:17:23 +02:00
|
|
|
PrepareAuraScript(spell_dru_insect_swarm_AuraScript);
|
2011-01-31 14:51:42 +01:00
|
|
|
|
2012-09-17 18:17:23 +02:00
|
|
|
void CalculateAmount(AuraEffect const* aurEff, int32 & amount, bool & /*canBeRecalculated*/)
|
2011-01-31 14:51:42 +01:00
|
|
|
{
|
2012-09-17 18:17:23 +02:00
|
|
|
if (Unit* caster = GetCaster())
|
|
|
|
|
if (AuraEffect const* relicAurEff = caster->GetAuraEffect(SPELL_DRUID_ITEM_T8_BALANCE_RELIC, EFFECT_0))
|
|
|
|
|
amount += relicAurEff->GetAmount() / aurEff->GetTotalTicks();
|
2011-01-31 14:51:42 +01:00
|
|
|
}
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
void Register() override
|
2011-01-31 14:51:42 +01:00
|
|
|
{
|
2012-09-17 18:17:23 +02:00
|
|
|
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_insect_swarm_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
2011-01-31 14:51:42 +01:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
AuraScript* GetAuraScript() const override
|
2010-12-27 20:14:54 +01:00
|
|
|
{
|
2012-09-17 18:17:23 +02:00
|
|
|
return new spell_dru_insect_swarm_AuraScript();
|
2010-12-27 20:14:54 +01:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2013-07-25 15:34:36 +02:00
|
|
|
// 33763 - Lifebloom
|
2012-05-28 04:07:51 +02:00
|
|
|
class spell_dru_lifebloom : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_dru_lifebloom() : SpellScriptLoader("spell_dru_lifebloom") { }
|
|
|
|
|
|
|
|
|
|
class spell_dru_lifebloom_AuraScript : public AuraScript
|
|
|
|
|
{
|
|
|
|
|
PrepareAuraScript(spell_dru_lifebloom_AuraScript);
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
bool Validate(SpellInfo const* /*spell*/) override
|
2012-05-28 04:07:51 +02:00
|
|
|
{
|
2013-01-12 02:16:30 +01:00
|
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_LIFEBLOOM_FINAL_HEAL))
|
2012-05-28 04:07:51 +02:00
|
|
|
return false;
|
2013-01-12 02:16:30 +01:00
|
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_LIFEBLOOM_ENERGIZE))
|
2012-05-28 04:07:51 +02:00
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
|
|
|
|
{
|
2012-06-15 14:07:10 -04:00
|
|
|
// Final heal only on duration end
|
|
|
|
|
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
|
2012-05-28 04:07:51 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// final heal
|
|
|
|
|
int32 stack = GetStackAmount();
|
|
|
|
|
int32 healAmount = aurEff->GetAmount();
|
2012-06-14 17:07:05 -04:00
|
|
|
if (Unit* caster = GetCaster())
|
2012-05-28 04:07:51 +02:00
|
|
|
{
|
2014-12-19 23:52:29 +01:00
|
|
|
healAmount = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), healAmount, HEAL, aurEff->GetSpellEffectInfo(), stack);
|
|
|
|
|
healAmount = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, aurEff->GetSpellEffectInfo(), stack);
|
2012-05-28 04:07:51 +02:00
|
|
|
|
2013-01-12 02:16:30 +01:00
|
|
|
GetTarget()->CastCustomSpell(GetTarget(), SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
|
2012-06-15 14:07:10 -04:00
|
|
|
|
2012-06-14 17:07:05 -04:00
|
|
|
// restore mana
|
2015-03-08 13:31:57 +01:00
|
|
|
std::vector<SpellInfo::CostData> costs = GetSpellInfo()->CalcPowerCost(caster, GetSpellInfo()->GetSchoolMask());
|
|
|
|
|
auto m = std::find_if(costs.begin(), costs.end(), [](SpellInfo::CostData const& cost) { return cost.Power == POWER_MANA; });
|
|
|
|
|
if (m != costs.end())
|
|
|
|
|
{
|
|
|
|
|
int32 returnMana = m->Amount * stack / 2;
|
|
|
|
|
caster->CastCustomSpell(caster, SPELL_DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
|
|
|
|
|
}
|
2012-06-15 14:07:10 -04:00
|
|
|
return;
|
2012-05-28 04:07:51 +02:00
|
|
|
}
|
2012-06-15 14:07:10 -04:00
|
|
|
|
2013-01-12 02:16:30 +01:00
|
|
|
GetTarget()->CastCustomSpell(GetTarget(), SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
|
2012-05-28 04:07:51 +02:00
|
|
|
}
|
|
|
|
|
|
2012-06-15 14:07:10 -04:00
|
|
|
void HandleDispel(DispelInfo* dispelInfo)
|
|
|
|
|
{
|
|
|
|
|
if (Unit* target = GetUnitOwner())
|
|
|
|
|
{
|
|
|
|
|
if (AuraEffect const* aurEff = GetEffect(EFFECT_1))
|
|
|
|
|
{
|
|
|
|
|
// final heal
|
|
|
|
|
int32 healAmount = aurEff->GetAmount();
|
|
|
|
|
if (Unit* caster = GetCaster())
|
|
|
|
|
{
|
2014-12-19 23:52:29 +01:00
|
|
|
healAmount = caster->SpellHealingBonusDone(target, GetSpellInfo(), healAmount, HEAL, aurEff->GetSpellEffectInfo(), dispelInfo->GetRemovedCharges());
|
|
|
|
|
healAmount = target->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, aurEff->GetSpellEffectInfo(), dispelInfo->GetRemovedCharges());
|
2013-01-12 02:16:30 +01:00
|
|
|
target->CastCustomSpell(target, SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());
|
2012-06-15 14:07:10 -04:00
|
|
|
|
|
|
|
|
// restore mana
|
2015-03-08 13:31:57 +01:00
|
|
|
std::vector<SpellInfo::CostData> costs = GetSpellInfo()->CalcPowerCost(caster, GetSpellInfo()->GetSchoolMask());
|
|
|
|
|
auto m = std::find_if(costs.begin(), costs.end(), [](SpellInfo::CostData const& cost) { return cost.Power == POWER_MANA; });
|
|
|
|
|
if (m != costs.end())
|
|
|
|
|
{
|
|
|
|
|
int32 returnMana = m->Amount * dispelInfo->GetRemovedCharges() / 2;
|
|
|
|
|
caster->CastCustomSpell(caster, SPELL_DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, NULL, GetCasterGUID());
|
|
|
|
|
}
|
2012-06-15 14:07:10 -04:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-12 02:16:30 +01:00
|
|
|
target->CastCustomSpell(target, SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());
|
2012-06-15 14:07:10 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
void Register() override
|
2012-05-28 04:07:51 +02:00
|
|
|
{
|
|
|
|
|
AfterEffectRemove += AuraEffectRemoveFn(spell_dru_lifebloom_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
2012-06-15 14:07:10 -04:00
|
|
|
AfterDispel += AuraDispelFn(spell_dru_lifebloom_AuraScript::HandleDispel);
|
2012-05-28 04:07:51 +02:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
AuraScript* GetAuraScript() const override
|
2012-05-28 04:07:51 +02:00
|
|
|
{
|
|
|
|
|
return new spell_dru_lifebloom_AuraScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2013-01-22 00:20:16 +01:00
|
|
|
// -48496 - Living Seed
|
|
|
|
|
class spell_dru_living_seed : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_dru_living_seed() : SpellScriptLoader("spell_dru_living_seed") { }
|
|
|
|
|
|
|
|
|
|
class spell_dru_living_seed_AuraScript : public AuraScript
|
|
|
|
|
{
|
|
|
|
|
PrepareAuraScript(spell_dru_living_seed_AuraScript);
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
bool Validate(SpellInfo const* /*spellInfo*/) override
|
2013-01-22 00:20:16 +01:00
|
|
|
{
|
|
|
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_LIVING_SEED_PROC))
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
|
|
|
|
{
|
|
|
|
|
PreventDefaultAction();
|
|
|
|
|
int32 amount = CalculatePct(eventInfo.GetHealInfo()->GetHeal(), aurEff->GetAmount());
|
|
|
|
|
GetTarget()->CastCustomSpell(SPELL_DRUID_LIVING_SEED_PROC, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true, NULL, aurEff);
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
void Register() override
|
2013-01-22 00:20:16 +01:00
|
|
|
{
|
|
|
|
|
OnEffectProc += AuraEffectProcFn(spell_dru_living_seed_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
AuraScript* GetAuraScript() const override
|
2013-01-22 00:20:16 +01:00
|
|
|
{
|
|
|
|
|
return new spell_dru_living_seed_AuraScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 48504 - Living Seed (Proc)
|
|
|
|
|
class spell_dru_living_seed_proc : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_dru_living_seed_proc() : SpellScriptLoader("spell_dru_living_seed_proc") { }
|
|
|
|
|
|
|
|
|
|
class spell_dru_living_seed_proc_AuraScript : public AuraScript
|
|
|
|
|
{
|
|
|
|
|
PrepareAuraScript(spell_dru_living_seed_proc_AuraScript);
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
bool Validate(SpellInfo const* /*spellInfo*/) override
|
2013-01-22 00:20:16 +01:00
|
|
|
{
|
|
|
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_LIVING_SEED_HEAL))
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
|
|
|
|
{
|
|
|
|
|
PreventDefaultAction();
|
|
|
|
|
GetTarget()->CastCustomSpell(SPELL_DRUID_LIVING_SEED_HEAL, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, NULL, aurEff);
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
void Register() override
|
2013-01-22 00:20:16 +01:00
|
|
|
{
|
|
|
|
|
OnEffectProc += AuraEffectProcFn(spell_dru_living_seed_proc_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
AuraScript* GetAuraScript() const override
|
2013-01-22 00:20:16 +01:00
|
|
|
{
|
|
|
|
|
return new spell_dru_living_seed_proc_AuraScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2013-01-12 02:16:30 +01:00
|
|
|
// -16972 - Predatory Strikes
|
2012-06-03 02:35:00 +02:00
|
|
|
class spell_dru_predatory_strikes : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_dru_predatory_strikes() : SpellScriptLoader("spell_dru_predatory_strikes") { }
|
|
|
|
|
|
|
|
|
|
class spell_dru_predatory_strikes_AuraScript : public AuraScript
|
|
|
|
|
{
|
|
|
|
|
PrepareAuraScript(spell_dru_predatory_strikes_AuraScript);
|
|
|
|
|
|
|
|
|
|
void UpdateAmount(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
|
|
|
|
{
|
|
|
|
|
if (Player* target = GetTarget()->ToPlayer())
|
|
|
|
|
target->UpdateAttackPowerAndDamage();
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
void Register() override
|
2012-06-03 02:35:00 +02:00
|
|
|
{
|
|
|
|
|
AfterEffectApply += AuraEffectApplyFn(spell_dru_predatory_strikes_AuraScript::UpdateAmount, EFFECT_ALL, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
|
|
|
|
|
AfterEffectRemove += AuraEffectRemoveFn(spell_dru_predatory_strikes_AuraScript::UpdateAmount, EFFECT_ALL, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
AuraScript* GetAuraScript() const override
|
2012-06-03 02:35:00 +02:00
|
|
|
{
|
|
|
|
|
return new spell_dru_predatory_strikes_AuraScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2013-07-25 14:14:30 +02:00
|
|
|
// 1079 - Rip
|
2013-01-20 04:30:17 +01:00
|
|
|
class spell_dru_rip : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_dru_rip() : SpellScriptLoader("spell_dru_rip") { }
|
|
|
|
|
|
|
|
|
|
class spell_dru_rip_AuraScript : public AuraScript
|
|
|
|
|
{
|
|
|
|
|
PrepareAuraScript(spell_dru_rip_AuraScript);
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
bool Load() override
|
2013-01-20 04:30:17 +01:00
|
|
|
{
|
|
|
|
|
Unit* caster = GetCaster();
|
|
|
|
|
return caster && caster->GetTypeId() == TYPEID_PLAYER;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
|
|
|
|
|
{
|
|
|
|
|
canBeRecalculated = false;
|
|
|
|
|
|
|
|
|
|
if (Unit* caster = GetCaster())
|
|
|
|
|
{
|
|
|
|
|
// 0.01 * $AP * cp
|
|
|
|
|
uint8 cp = caster->ToPlayer()->GetComboPoints();
|
|
|
|
|
|
|
|
|
|
// Idol of Feral Shadows. Can't be handled as SpellMod due its dependency from CPs
|
2014-07-11 21:50:49 +02:00
|
|
|
if (AuraEffect const* auraEffIdolOfFeralShadows = caster->GetAuraEffect(SPELL_DRUID_IDOL_OF_FERAL_SHADOWS, EFFECT_0))
|
|
|
|
|
amount += cp * auraEffIdolOfFeralShadows->GetAmount();
|
2013-01-20 04:30:17 +01:00
|
|
|
// Idol of Worship. Can't be handled as SpellMod due its dependency from CPs
|
2014-07-11 21:50:49 +02:00
|
|
|
else if (AuraEffect const* auraEffIdolOfWorship = caster->GetAuraEffect(SPELL_DRUID_IDOL_OF_WORSHIP, EFFECT_0))
|
|
|
|
|
amount += cp * auraEffIdolOfWorship->GetAmount();
|
2013-01-20 04:30:17 +01:00
|
|
|
|
|
|
|
|
amount += int32(CalculatePct(caster->GetTotalAttackPowerValue(BASE_ATTACK), cp));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
void Register() override
|
2013-01-20 04:30:17 +01:00
|
|
|
{
|
|
|
|
|
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_rip_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
AuraScript* GetAuraScript() const override
|
2013-01-20 04:30:17 +01:00
|
|
|
{
|
|
|
|
|
return new spell_dru_rip_AuraScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2010-12-27 20:14:54 +01:00
|
|
|
// 62606 - Savage Defense
|
|
|
|
|
class spell_dru_savage_defense : public SpellScriptLoader
|
|
|
|
|
{
|
2011-01-31 14:51:42 +01:00
|
|
|
public:
|
|
|
|
|
spell_dru_savage_defense() : SpellScriptLoader("spell_dru_savage_defense") { }
|
2010-12-27 20:14:54 +01:00
|
|
|
|
2011-01-31 14:51:42 +01:00
|
|
|
class spell_dru_savage_defense_AuraScript : public AuraScript
|
2010-12-30 02:03:46 +01:00
|
|
|
{
|
2011-01-31 14:51:42 +01:00
|
|
|
PrepareAuraScript(spell_dru_savage_defense_AuraScript);
|
|
|
|
|
|
2014-09-25 21:10:00 +02:00
|
|
|
public:
|
|
|
|
|
spell_dru_savage_defense_AuraScript()
|
|
|
|
|
{
|
|
|
|
|
absorbPct = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
2011-01-31 14:51:42 +01:00
|
|
|
uint32 absorbPct;
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
bool Load() override
|
2011-01-31 14:51:42 +01:00
|
|
|
{
|
2014-11-24 18:57:49 +01:00
|
|
|
absorbPct = GetSpellInfo()->GetEffect(EFFECT_0)->CalcValue(GetCaster());
|
2011-01-31 14:51:42 +01:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2011-06-11 22:35:29 +02:00
|
|
|
void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
|
2011-01-31 14:51:42 +01:00
|
|
|
{
|
|
|
|
|
// Set absorbtion amount to unlimited
|
|
|
|
|
amount = -1;
|
|
|
|
|
}
|
|
|
|
|
|
2011-09-15 14:08:17 +02:00
|
|
|
void Absorb(AuraEffect* aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount)
|
2011-01-31 14:51:42 +01:00
|
|
|
{
|
2012-10-02 12:17:42 +02:00
|
|
|
absorbAmount = uint32(CalculatePct(GetTarget()->GetTotalAttackPowerValue(BASE_ATTACK), absorbPct));
|
2011-01-31 14:51:42 +01:00
|
|
|
aurEff->SetAmount(0);
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
void Register() override
|
2011-01-31 14:51:42 +01:00
|
|
|
{
|
|
|
|
|
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_savage_defense_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
|
|
|
|
|
OnEffectAbsorb += AuraEffectAbsorbFn(spell_dru_savage_defense_AuraScript::Absorb, EFFECT_0);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
AuraScript* GetAuraScript() const override
|
2010-12-27 20:14:54 +01:00
|
|
|
{
|
2011-01-31 14:51:42 +01:00
|
|
|
return new spell_dru_savage_defense_AuraScript();
|
2010-12-27 20:14:54 +01:00
|
|
|
}
|
2011-01-31 14:51:42 +01:00
|
|
|
};
|
2010-12-27 20:14:54 +01:00
|
|
|
|
2013-01-12 02:16:30 +01:00
|
|
|
// 52610 - Savage Roar
|
2012-06-03 02:35:00 +02:00
|
|
|
class spell_dru_savage_roar : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_dru_savage_roar() : SpellScriptLoader("spell_dru_savage_roar") { }
|
|
|
|
|
|
|
|
|
|
class spell_dru_savage_roar_SpellScript : public SpellScript
|
|
|
|
|
{
|
|
|
|
|
PrepareSpellScript(spell_dru_savage_roar_SpellScript);
|
|
|
|
|
|
|
|
|
|
SpellCastResult CheckCast()
|
|
|
|
|
{
|
|
|
|
|
Unit* caster = GetCaster();
|
|
|
|
|
if (caster->GetShapeshiftForm() != FORM_CAT)
|
|
|
|
|
return SPELL_FAILED_ONLY_SHAPESHIFT;
|
|
|
|
|
|
|
|
|
|
return SPELL_CAST_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
void Register() override
|
2012-06-03 02:35:00 +02:00
|
|
|
{
|
|
|
|
|
OnCheckCast += SpellCheckCastFn(spell_dru_savage_roar_SpellScript::CheckCast);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class spell_dru_savage_roar_AuraScript : public AuraScript
|
|
|
|
|
{
|
|
|
|
|
PrepareAuraScript(spell_dru_savage_roar_AuraScript);
|
|
|
|
|
|
2014-04-29 20:14:42 +02:00
|
|
|
bool Validate(SpellInfo const* /*spellInfo*/) override
|
2012-06-03 02:35:00 +02:00
|
|
|
{
|
2013-01-12 02:16:30 +01:00
|
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_SAVAGE_ROAR))
|
2012-06-03 02:35:00 +02:00
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
|
|
|
|
{
|
|
|
|
|
Unit* target = GetTarget();
|
2013-01-12 02:16:30 +01:00
|
|
|
target->CastSpell(target, SPELL_DRUID_SAVAGE_ROAR, true, NULL, aurEff, GetCasterGUID());
|
2012-06-03 02:35:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
|
|
|
|
{
|
2013-01-12 02:16:30 +01:00
|
|
|
GetTarget()->RemoveAurasDueToSpell(SPELL_DRUID_SAVAGE_ROAR);
|
2012-06-03 02:35:00 +02:00
|
|
|
}
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
void Register() override
|
2012-06-03 02:35:00 +02:00
|
|
|
{
|
2012-06-08 22:25:33 +02:00
|
|
|
AfterEffectApply += AuraEffectApplyFn(spell_dru_savage_roar_AuraScript::AfterApply, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
|
|
|
|
AfterEffectRemove += AuraEffectRemoveFn(spell_dru_savage_roar_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
2012-06-03 02:35:00 +02:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
SpellScript* GetSpellScript() const override
|
2012-06-03 02:35:00 +02:00
|
|
|
{
|
|
|
|
|
return new spell_dru_savage_roar_SpellScript();
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
AuraScript* GetAuraScript() const override
|
2012-06-03 02:35:00 +02:00
|
|
|
{
|
|
|
|
|
return new spell_dru_savage_roar_AuraScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2013-07-25 15:05:16 +02:00
|
|
|
// 50286 - Starfall (Dummy)
|
2012-09-17 18:17:23 +02:00
|
|
|
class spell_dru_starfall_dummy : public SpellScriptLoader
|
2011-10-06 18:20:57 +02:00
|
|
|
{
|
|
|
|
|
public:
|
2012-09-17 18:17:23 +02:00
|
|
|
spell_dru_starfall_dummy() : SpellScriptLoader("spell_dru_starfall_dummy") { }
|
2011-10-06 18:20:57 +02:00
|
|
|
|
2012-09-17 18:17:23 +02:00
|
|
|
class spell_dru_starfall_dummy_SpellScript : public SpellScript
|
2011-10-06 18:20:57 +02:00
|
|
|
{
|
2012-09-17 18:17:23 +02:00
|
|
|
PrepareSpellScript(spell_dru_starfall_dummy_SpellScript);
|
2011-10-06 18:20:57 +02:00
|
|
|
|
2012-09-17 18:17:23 +02:00
|
|
|
void FilterTargets(std::list<WorldObject*>& targets)
|
2011-10-06 18:20:57 +02:00
|
|
|
{
|
2012-09-17 18:17:23 +02:00
|
|
|
Trinity::Containers::RandomResizeList(targets, 2);
|
2012-02-18 12:12:49 +01:00
|
|
|
}
|
2011-10-06 18:20:57 +02:00
|
|
|
|
2012-09-17 18:17:23 +02:00
|
|
|
void HandleDummy(SpellEffIndex /*effIndex*/)
|
2012-02-18 12:12:49 +01:00
|
|
|
{
|
2012-09-17 18:17:23 +02:00
|
|
|
Unit* caster = GetCaster();
|
|
|
|
|
// Shapeshifting into an animal form or mounting cancels the effect
|
|
|
|
|
if (caster->GetCreatureType() == CREATURE_TYPE_BEAST || caster->IsMounted())
|
|
|
|
|
{
|
|
|
|
|
if (SpellInfo const* spellInfo = GetTriggeringSpell())
|
|
|
|
|
caster->RemoveAurasDueToSpell(spellInfo->Id);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2012-02-18 12:12:49 +01:00
|
|
|
|
2012-05-28 04:07:51 +02:00
|
|
|
// Any effect which causes you to lose control of your character will supress the starfall effect.
|
2012-02-18 12:12:49 +01:00
|
|
|
if (caster->HasUnitState(UNIT_STATE_CONTROLLED))
|
|
|
|
|
return;
|
|
|
|
|
|
2012-05-28 04:07:51 +02:00
|
|
|
caster->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true);
|
2012-02-18 12:12:49 +01:00
|
|
|
}
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
void Register() override
|
2012-02-18 12:12:49 +01:00
|
|
|
{
|
2012-06-29 21:53:35 +02:00
|
|
|
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dru_starfall_dummy_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
2012-02-18 12:12:49 +01:00
|
|
|
OnEffectHitTarget += SpellEffectFn(spell_dru_starfall_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
SpellScript* GetSpellScript() const override
|
2012-02-18 12:12:49 +01:00
|
|
|
{
|
|
|
|
|
return new spell_dru_starfall_dummy_SpellScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2013-07-26 22:13:11 +02:00
|
|
|
// -78892 - Stampede
|
|
|
|
|
class spell_dru_stampede : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_dru_stampede() : SpellScriptLoader("spell_dru_stampede") { }
|
|
|
|
|
|
|
|
|
|
class spell_dru_stampede_AuraScript : public AuraScript
|
|
|
|
|
{
|
|
|
|
|
PrepareAuraScript(spell_dru_stampede_AuraScript);
|
|
|
|
|
|
2014-04-29 20:14:42 +02:00
|
|
|
bool Validate(SpellInfo const* /*spellInfo*/) override
|
2013-07-26 22:13:11 +02:00
|
|
|
{
|
|
|
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_STAMPEDE_BAER_RANK_1) ||
|
|
|
|
|
!sSpellMgr->GetSpellInfo(SPELL_DRUID_STAMPEDE_CAT_RANK_1) ||
|
|
|
|
|
!sSpellMgr->GetSpellInfo(SPELL_DRUID_STAMPEDE_CAT_STATE) ||
|
|
|
|
|
!sSpellMgr->GetSpellInfo(SPELL_DRUID_FERAL_CHARGE_CAT) ||
|
|
|
|
|
!sSpellMgr->GetSpellInfo(SPELL_DRUID_FERAL_CHARGE_BEAR))
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HandleEffectCatProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
|
|
|
|
{
|
|
|
|
|
PreventDefaultAction();
|
|
|
|
|
if (GetTarget()->GetShapeshiftForm() != FORM_CAT || eventInfo.GetDamageInfo()->GetSpellInfo()->Id != SPELL_DRUID_FERAL_CHARGE_CAT)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
GetTarget()->CastSpell(GetTarget(), sSpellMgr->GetSpellWithRank(SPELL_DRUID_STAMPEDE_CAT_RANK_1, GetSpellInfo()->GetRank()), true, NULL, aurEff);
|
|
|
|
|
GetTarget()->CastSpell(GetTarget(), SPELL_DRUID_STAMPEDE_CAT_STATE, true, NULL, aurEff);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HandleEffectBearProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
|
|
|
|
{
|
|
|
|
|
PreventDefaultAction();
|
|
|
|
|
if (GetTarget()->GetShapeshiftForm() != FORM_BEAR || eventInfo.GetDamageInfo()->GetSpellInfo()->Id != SPELL_DRUID_FERAL_CHARGE_BEAR)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
GetTarget()->CastSpell(GetTarget(), sSpellMgr->GetSpellWithRank(SPELL_DRUID_STAMPEDE_BAER_RANK_1, GetSpellInfo()->GetRank()), true, NULL, aurEff);
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-29 20:14:42 +02:00
|
|
|
void Register() override
|
2013-07-26 22:13:11 +02:00
|
|
|
{
|
|
|
|
|
OnEffectProc += AuraEffectProcFn(spell_dru_stampede_AuraScript::HandleEffectCatProc, EFFECT_0, SPELL_AURA_DUMMY);
|
|
|
|
|
OnEffectProc += AuraEffectProcFn(spell_dru_stampede_AuraScript::HandleEffectBearProc, EFFECT_1, SPELL_AURA_DUMMY);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 20:14:42 +02:00
|
|
|
AuraScript* GetAuraScript() const override
|
2013-07-26 22:13:11 +02:00
|
|
|
{
|
|
|
|
|
return new spell_dru_stampede_AuraScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2013-01-12 02:16:30 +01:00
|
|
|
// 61336 - Survival Instincts
|
2012-06-03 02:35:00 +02:00
|
|
|
class spell_dru_survival_instincts : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_dru_survival_instincts() : SpellScriptLoader("spell_dru_survival_instincts") { }
|
|
|
|
|
|
|
|
|
|
class spell_dru_survival_instincts_SpellScript : public SpellScript
|
|
|
|
|
{
|
|
|
|
|
PrepareSpellScript(spell_dru_survival_instincts_SpellScript);
|
|
|
|
|
|
|
|
|
|
SpellCastResult CheckCast()
|
|
|
|
|
{
|
|
|
|
|
Unit* caster = GetCaster();
|
|
|
|
|
if (!caster->IsInFeralForm())
|
|
|
|
|
return SPELL_FAILED_ONLY_SHAPESHIFT;
|
|
|
|
|
|
|
|
|
|
return SPELL_CAST_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
void Register() override
|
2012-06-03 02:35:00 +02:00
|
|
|
{
|
|
|
|
|
OnCheckCast += SpellCheckCastFn(spell_dru_survival_instincts_SpellScript::CheckCast);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class spell_dru_survival_instincts_AuraScript : public AuraScript
|
|
|
|
|
{
|
|
|
|
|
PrepareAuraScript(spell_dru_survival_instincts_AuraScript);
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
bool Validate(SpellInfo const* /*spell*/) override
|
2012-06-03 02:35:00 +02:00
|
|
|
{
|
2013-01-12 02:16:30 +01:00
|
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_SURVIVAL_INSTINCTS))
|
2012-06-03 02:35:00 +02:00
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
|
|
|
|
{
|
|
|
|
|
Unit* target = GetTarget();
|
|
|
|
|
int32 bp0 = target->CountPctFromMaxHealth(aurEff->GetAmount());
|
2013-01-12 02:16:30 +01:00
|
|
|
target->CastCustomSpell(target, SPELL_DRUID_SURVIVAL_INSTINCTS, &bp0, NULL, NULL, true);
|
2012-06-03 02:35:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
|
|
|
|
{
|
2013-01-12 02:16:30 +01:00
|
|
|
GetTarget()->RemoveAurasDueToSpell(SPELL_DRUID_SURVIVAL_INSTINCTS);
|
2012-06-03 02:35:00 +02:00
|
|
|
}
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
void Register() override
|
2012-06-03 02:35:00 +02:00
|
|
|
{
|
|
|
|
|
AfterEffectApply += AuraEffectApplyFn(spell_dru_survival_instincts_AuraScript::AfterApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
|
|
|
|
|
AfterEffectRemove += AuraEffectRemoveFn(spell_dru_survival_instincts_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
SpellScript* GetSpellScript() const override
|
2012-06-03 02:35:00 +02:00
|
|
|
{
|
|
|
|
|
return new spell_dru_survival_instincts_SpellScript();
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
AuraScript* GetAuraScript() const override
|
2012-06-03 02:35:00 +02:00
|
|
|
{
|
|
|
|
|
return new spell_dru_survival_instincts_AuraScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2012-09-17 18:17:23 +02:00
|
|
|
// 40121 - Swift Flight Form (Passive)
|
|
|
|
|
class spell_dru_swift_flight_passive : public SpellScriptLoader
|
2012-07-13 18:42:28 +03:00
|
|
|
{
|
|
|
|
|
public:
|
2012-09-17 18:17:23 +02:00
|
|
|
spell_dru_swift_flight_passive() : SpellScriptLoader("spell_dru_swift_flight_passive") { }
|
2012-07-13 18:42:28 +03:00
|
|
|
|
2012-09-17 18:17:23 +02:00
|
|
|
class spell_dru_swift_flight_passive_AuraScript : public AuraScript
|
2012-07-13 18:42:28 +03:00
|
|
|
{
|
2012-09-17 18:17:23 +02:00
|
|
|
PrepareAuraScript(spell_dru_swift_flight_passive_AuraScript);
|
2012-07-13 18:42:28 +03:00
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
bool Load() override
|
2012-07-13 18:42:28 +03:00
|
|
|
{
|
2012-09-17 18:17:23 +02:00
|
|
|
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
|
|
|
|
}
|
2012-06-03 02:35:00 +02:00
|
|
|
|
2012-09-17 18:17:23 +02:00
|
|
|
void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
|
|
|
|
|
{
|
|
|
|
|
if (Player* caster = GetCaster()->ToPlayer())
|
2012-09-17 23:49:13 +01:00
|
|
|
if (caster->GetSkillValue(SKILL_RIDING) >= 375)
|
2012-09-17 18:17:23 +02:00
|
|
|
amount = 310;
|
2012-07-13 18:42:28 +03:00
|
|
|
}
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
void Register() override
|
2012-07-13 18:42:28 +03:00
|
|
|
{
|
2012-09-17 18:17:23 +02:00
|
|
|
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_swift_flight_passive_AuraScript::CalculateAmount, EFFECT_1, SPELL_AURA_MOD_INCREASE_VEHICLE_FLIGHT_SPEED);
|
2012-07-13 18:42:28 +03:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
AuraScript* GetAuraScript() const override
|
2012-07-13 18:42:28 +03:00
|
|
|
{
|
2012-09-17 18:17:23 +02:00
|
|
|
return new spell_dru_swift_flight_passive_AuraScript();
|
2012-07-13 18:42:28 +03:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2013-07-25 14:14:30 +02:00
|
|
|
// 61391 - Typhoon
|
2013-01-20 04:30:17 +01:00
|
|
|
class spell_dru_typhoon : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_dru_typhoon() : SpellScriptLoader("spell_dru_typhoon") { }
|
|
|
|
|
|
|
|
|
|
class spell_dru_typhoon_SpellScript : public SpellScript
|
|
|
|
|
{
|
|
|
|
|
PrepareSpellScript(spell_dru_typhoon_SpellScript);
|
|
|
|
|
|
|
|
|
|
void HandleKnockBack(SpellEffIndex effIndex)
|
|
|
|
|
{
|
|
|
|
|
// Glyph of Typhoon
|
|
|
|
|
if (GetCaster()->HasAura(SPELL_DRUID_GLYPH_OF_TYPHOON))
|
|
|
|
|
PreventHitDefaultEffect(effIndex);
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
void Register() override
|
2013-01-20 04:30:17 +01:00
|
|
|
{
|
|
|
|
|
OnEffectHitTarget += SpellEffectFn(spell_dru_typhoon_SpellScript::HandleKnockBack, EFFECT_0, SPELL_EFFECT_KNOCK_BACK);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
SpellScript* GetSpellScript() const override
|
2013-01-20 04:30:17 +01:00
|
|
|
{
|
|
|
|
|
return new spell_dru_typhoon_SpellScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2013-01-12 02:16:30 +01:00
|
|
|
// 70691 - Item T10 Restoration 4P Bonus
|
2012-09-17 18:17:23 +02:00
|
|
|
class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader
|
2012-07-13 18:42:28 +03:00
|
|
|
{
|
|
|
|
|
public:
|
2012-09-17 18:17:23 +02:00
|
|
|
spell_dru_t10_restoration_4p_bonus() : SpellScriptLoader("spell_dru_t10_restoration_4p_bonus") { }
|
2012-07-13 18:42:28 +03:00
|
|
|
|
2012-09-17 18:17:23 +02:00
|
|
|
class spell_dru_t10_restoration_4p_bonus_SpellScript : public SpellScript
|
2012-08-16 19:55:01 +01:00
|
|
|
{
|
2012-09-17 18:17:23 +02:00
|
|
|
PrepareSpellScript(spell_dru_t10_restoration_4p_bonus_SpellScript);
|
2012-08-16 19:55:01 +01:00
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
bool Load() override
|
2012-07-13 18:42:28 +03:00
|
|
|
{
|
2012-09-17 18:17:23 +02:00
|
|
|
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
|
|
|
|
}
|
2012-08-16 19:55:01 +01:00
|
|
|
|
2012-09-17 18:17:23 +02:00
|
|
|
void FilterTargets(std::list<WorldObject*>& targets)
|
2012-08-16 19:55:01 +01:00
|
|
|
{
|
2012-09-17 18:17:23 +02:00
|
|
|
if (!GetCaster()->ToPlayer()->GetGroup())
|
2012-08-16 19:55:01 +01:00
|
|
|
{
|
2012-09-17 18:17:23 +02:00
|
|
|
targets.clear();
|
|
|
|
|
targets.push_back(GetCaster());
|
2012-08-16 19:55:01 +01:00
|
|
|
}
|
2012-09-17 18:17:23 +02:00
|
|
|
else
|
2012-08-16 19:55:01 +01:00
|
|
|
{
|
2012-09-17 18:17:23 +02:00
|
|
|
targets.remove(GetExplTargetUnit());
|
|
|
|
|
std::list<Unit*> tempTargets;
|
|
|
|
|
for (std::list<WorldObject*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
|
|
|
|
|
if ((*itr)->GetTypeId() == TYPEID_PLAYER && GetCaster()->IsInRaidWith((*itr)->ToUnit()))
|
|
|
|
|
tempTargets.push_back((*itr)->ToUnit());
|
2012-08-16 19:55:01 +01:00
|
|
|
|
2012-09-17 18:17:23 +02:00
|
|
|
if (tempTargets.empty())
|
2012-08-16 19:55:01 +01:00
|
|
|
{
|
2012-09-17 18:17:23 +02:00
|
|
|
targets.clear();
|
|
|
|
|
FinishCast(SPELL_FAILED_DONT_REPORT);
|
|
|
|
|
return;
|
2012-08-16 19:55:01 +01:00
|
|
|
}
|
2012-09-17 18:17:23 +02:00
|
|
|
|
|
|
|
|
Unit* target = Trinity::Containers::SelectRandomContainerElement(tempTargets);
|
|
|
|
|
targets.clear();
|
|
|
|
|
targets.push_back(target);
|
2012-08-16 19:55:01 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
void Register() override
|
2012-07-13 18:42:28 +03:00
|
|
|
{
|
2012-09-17 18:17:23 +02:00
|
|
|
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dru_t10_restoration_4p_bonus_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY);
|
2012-07-13 18:42:28 +03:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
SpellScript* GetSpellScript() const override
|
2012-08-16 19:55:01 +01:00
|
|
|
{
|
2012-09-17 18:17:23 +02:00
|
|
|
return new spell_dru_t10_restoration_4p_bonus_SpellScript();
|
2012-08-16 19:55:01 +01:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-01-26 01:02:20 +01:00
|
|
|
class RaidCheck
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit RaidCheck(Unit const* caster) : _caster(caster) { }
|
|
|
|
|
|
|
|
|
|
bool operator()(WorldObject* obj) const
|
|
|
|
|
{
|
|
|
|
|
if (Unit* target = obj->ToUnit())
|
|
|
|
|
return !_caster->IsInRaidWith(target);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Unit const* _caster;
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-21 16:34:52 +02:00
|
|
|
// 48438 - Wild Growth
|
2014-01-26 01:02:20 +01:00
|
|
|
class spell_dru_wild_growth : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_dru_wild_growth() : SpellScriptLoader("spell_dru_wild_growth") { }
|
|
|
|
|
|
|
|
|
|
class spell_dru_wild_growth_SpellScript : public SpellScript
|
|
|
|
|
{
|
|
|
|
|
PrepareSpellScript(spell_dru_wild_growth_SpellScript);
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
bool Validate(SpellInfo const* spellInfo) override
|
2014-01-26 01:02:20 +01:00
|
|
|
{
|
2014-11-24 18:57:49 +01:00
|
|
|
if (spellInfo->GetEffect(EFFECT_2)->IsEffect() || spellInfo->GetEffect(EFFECT_2)->CalcValue() <= 0)
|
2014-01-26 01:02:20 +01:00
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FilterTargets(std::list<WorldObject*>& targets)
|
|
|
|
|
{
|
|
|
|
|
targets.remove_if(RaidCheck(GetCaster()));
|
|
|
|
|
|
2014-11-24 18:57:49 +01:00
|
|
|
uint32 const maxTargets = uint32(GetSpellInfo()->GetEffect(EFFECT_2)->CalcValue(GetCaster()));
|
2014-01-26 01:02:20 +01:00
|
|
|
|
2014-01-26 23:56:53 +01:00
|
|
|
if (targets.size() > maxTargets)
|
2014-01-26 01:02:20 +01:00
|
|
|
{
|
|
|
|
|
targets.sort(Trinity::HealthPctOrderPred());
|
|
|
|
|
targets.resize(maxTargets);
|
|
|
|
|
}
|
2014-01-27 23:01:37 +01:00
|
|
|
|
|
|
|
|
_targets = targets;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SetTargets(std::list<WorldObject*>& targets)
|
|
|
|
|
{
|
|
|
|
|
targets = _targets;
|
2014-01-26 01:02:20 +01:00
|
|
|
}
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
void Register() override
|
2014-01-26 01:02:20 +01:00
|
|
|
{
|
|
|
|
|
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dru_wild_growth_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY);
|
2014-01-27 23:01:37 +01:00
|
|
|
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dru_wild_growth_SpellScript::SetTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ALLY);
|
2014-01-26 01:02:20 +01:00
|
|
|
}
|
2014-01-27 23:01:37 +01:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
std::list<WorldObject*> _targets;
|
2014-01-26 01:02:20 +01:00
|
|
|
};
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
SpellScript* GetSpellScript() const override
|
2014-01-26 01:02:20 +01:00
|
|
|
{
|
|
|
|
|
return new spell_dru_wild_growth_SpellScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2010-08-18 00:20:23 +06:00
|
|
|
void AddSC_druid_spell_scripts()
|
|
|
|
|
{
|
2013-01-20 04:30:17 +01:00
|
|
|
new spell_dru_dash();
|
2013-08-01 22:02:14 +02:00
|
|
|
new spell_dru_eclipse("spell_dru_eclipse_lunar");
|
|
|
|
|
new spell_dru_eclipse("spell_dru_eclipse_solar");
|
2013-01-14 20:28:32 +01:00
|
|
|
new spell_dru_eclipse_energize();
|
2013-07-21 15:28:03 +02:00
|
|
|
new spell_dru_glyph_of_innervate();
|
2010-08-18 00:20:23 +06:00
|
|
|
new spell_dru_glyph_of_starfire();
|
2013-07-22 19:46:21 +02:00
|
|
|
new spell_dru_glyph_of_starfire_proc();
|
2013-01-20 04:30:17 +01:00
|
|
|
new spell_dru_idol_lifebloom();
|
|
|
|
|
new spell_dru_innervate();
|
2012-09-17 18:17:23 +02:00
|
|
|
new spell_dru_insect_swarm();
|
|
|
|
|
new spell_dru_lifebloom();
|
2013-01-22 00:20:16 +01:00
|
|
|
new spell_dru_living_seed();
|
|
|
|
|
new spell_dru_living_seed_proc();
|
2012-09-17 18:17:23 +02:00
|
|
|
new spell_dru_predatory_strikes();
|
2013-01-20 04:30:17 +01:00
|
|
|
new spell_dru_rip();
|
2010-12-27 20:14:54 +01:00
|
|
|
new spell_dru_savage_defense();
|
2012-09-17 18:17:23 +02:00
|
|
|
new spell_dru_savage_roar();
|
2012-02-18 12:12:49 +01:00
|
|
|
new spell_dru_starfall_dummy();
|
2013-07-26 22:13:11 +02:00
|
|
|
new spell_dru_stampede();
|
2012-06-03 02:35:00 +02:00
|
|
|
new spell_dru_survival_instincts();
|
2012-09-17 18:17:23 +02:00
|
|
|
new spell_dru_swift_flight_passive();
|
2013-01-20 04:30:17 +01:00
|
|
|
new spell_dru_typhoon();
|
2012-09-17 18:17:23 +02:00
|
|
|
new spell_dru_t10_restoration_4p_bonus();
|
2014-01-26 01:02:20 +01:00
|
|
|
new spell_dru_wild_growth();
|
2010-08-06 19:46:02 +02:00
|
|
|
}
|