Core/Spells: Reorder more scripts in some script files and some cosmetic stuff
This commit is contained in:
1 parent
9007ef905f
commit
6f8aa6a782
8 files changed
+442
-459
No files matched your search
@@ -29,6 +29,15 @@
|
||||
|
||||
enum DruidSpells
|
||||
{
|
||||
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,
|
||||
SPELL_DRUID_ENRAGE_MOD_DAMAGE = 51185,
|
||||
SPELL_DRUID_INCREASED_MOONFIRE_DURATION = 38414,
|
||||
SPELL_DRUID_KING_OF_THE_JUNGLE = 48492,
|
||||
@@ -38,7 +47,117 @@ enum DruidSpells
|
||||
SPELL_DRUID_SURVIVAL_INSTINCTS = 50322,
|
||||
SPELL_DRUID_SAVAGE_ROAR = 62071,
|
||||
SPELL_DRUID_TIGER_S_FURY_ENERGIZE = 51178,
|
||||
SPELL_DRUID_ITEM_T8_BALANCE_RELIC = 64950,
|
||||
SPELL_DRUID_ITEM_T8_BALANCE_RELIC = 64950
|
||||
};
|
||||
|
||||
// 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);
|
||||
|
||||
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_DRUID_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;
|
||||
}
|
||||
};
|
||||
|
||||
// -5229 - Enrage
|
||||
@@ -150,129 +269,7 @@ 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,
|
||||
};
|
||||
|
||||
// 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_DRUID_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;
|
||||
}
|
||||
};
|
||||
|
||||
// -33763 - Lifebloom
|
||||
class spell_dru_lifebloom : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -543,7 +540,7 @@ class spell_dru_savage_roar : public SpellScriptLoader
|
||||
{
|
||||
PrepareAuraScript(spell_dru_savage_roar_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_SAVAGE_ROAR))
|
||||
return false;
|
||||
@@ -837,6 +834,7 @@ class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader
|
||||
|
||||
void AddSC_druid_spell_scripts()
|
||||
{
|
||||
new spell_dru_eclipse_energize();
|
||||
new spell_dru_enrage();
|
||||
new spell_dru_glyph_of_starfire();
|
||||
new spell_dru_insect_swarm();
|
||||
@@ -852,5 +850,4 @@ void AddSC_druid_spell_scripts()
|
||||
new spell_dru_swift_flight_passive();
|
||||
new spell_dru_tiger_s_fury();
|
||||
new spell_dru_t10_restoration_4p_bonus();
|
||||
new spell_dru_eclipse_energize();
|
||||
}
|
||||
Reference in new issue
Block a user