Core/Spells:

* Implemented aura 328 SPELL_AURA_PROC_ON_POWER_AMOUNT.
* Added eclipse power energize handling.

Closes #7417
This commit is contained in:
Greymane authored and Nay committed 2012-08-16 19:55:01 +01:00
1 parent 43bae31ff8
commit 759e73c78f
9 files changed
+296 -27

No files matched your search

+125
View File
@@ -644,6 +644,130 @@ class spell_dru_insect_swarm : public SpellScriptLoader
}
};
enum EclipseSpells
{
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,
TALENT_TREE_BALANCE = 752,
};
// Wrath, Starfire, 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);
int32 energizeAmount;
bool Load()
{
if (GetCaster()->GetTypeId() != TYPEID_PLAYER)
return false;
if (GetCaster()->ToPlayer()->getClass() != CLASS_DRUID)
return false;
energizeAmount = 0;
return true;
}
void HandleEnergize(SpellEffIndex effIndex)
{
Player* caster = GetCaster()->ToPlayer();
// No boomy, no deal.
if (caster->GetPrimaryTalentTree(caster->GetActiveSpec()) != TALENT_TREE_BALANCE)
return;
switch(GetSpellInfo()->Id)
{
case SPELL_DRUID_WRATH:
{
energizeAmount = -GetSpellInfo()->Effects[effIndex].BasePoints; // -13
// 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:
{
energizeAmount = GetSpellInfo()->Effects[effIndex].BasePoints; // 20
// 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)
{
energizeAmount = GetSpellInfo()->Effects[effIndex].BasePoints; // 15
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))
{
energizeAmount = -GetSpellInfo()->Effects[effIndex].BasePoints; // -15
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;
}
}
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_dru_eclipse_energize_SpellScript::HandleEnergize, EFFECT_1, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_dru_eclipse_energize_SpellScript;
}
};
void AddSC_druid_spell_scripts()
{
new spell_dru_glyph_of_starfire();
@@ -659,4 +783,5 @@ void AddSC_druid_spell_scripts()
new spell_dru_savage_roar();
new spell_dru_survival_instincts();
new spell_dru_insect_swarm();
new spell_dru_eclipse_energize();
}