Core/Spells: Removed outdated shaman spell scripts

This commit is contained in:
Shauren
2016-11-05 23:29:42 +01:00
parent 5b84293188
commit 56a7e86a28
2 changed files with 19 additions and 529 deletions
@@ -0,0 +1,7 @@
-- deleted spells
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_sha_chain_heal','spell_sha_fulmination','spell_sha_glyph_of_healing_wave','spell_sha_healing_stream_totem','spell_sha_lava_lash','spell_sha_lava_lash_spread_flame_shock','spell_sha_nature_guardian','spell_sha_thunderstorm');
-- new spell ids
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_sha_earth_shield','spell_sha_flametongue');
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(204288,'spell_sha_earth_shield'),
(194084,'spell_sha_flametongue');
+12 -529
View File
@@ -34,51 +34,29 @@ enum ShamanSpells
{
SPELL_SHAMAN_ANCESTRAL_GUIDANCE = 108281,
SPELL_SHAMAN_ANCESTRAL_GUIDANCE_HEAL = 114911,
SPELL_SHAMAN_EARTH_SHIELD_HEAL = 379,
SPELL_SHAMAN_EARTH_SHOCK = 8042,
SPELL_SHAMAN_EARTH_SHIELD_HEAL = 204290,
SPELL_SHAMAN_EARTHEN_RAGE_PASSIVE = 170374,
SPELL_SHAMAN_EARTHEN_RAGE_PERIODIC = 170377,
SPELL_SHAMAN_EARTHEN_RAGE_DAMAGE = 170379,
SPELL_SHAMAN_ELEMENTAL_BLAST_CRIT = 118522,
SPELL_SHAMAN_ELEMENTAL_BLAST_HASTE = 173183,
SPELL_SHAMAN_ELEMENTAL_BLAST_MASTERY = 173184,
SPELL_SHAMAN_ELEMENTAL_BLAST_MULTISTRIKE = 173185,
SPELL_SHAMAN_ELEMENTAL_BLAST_AGILITY = 173186,
SPELL_SHAMAN_ELEMENTAL_BLAST_SPIRIT = 173187,
SPELL_SHAMAN_ELEMENTAL_MASTERY = 16166,
SPELL_SHAMAN_EXHAUSTION = 57723,
SPELL_SHAMAN_FIRE_NOVA_TRIGGERED = 8349,
SPELL_SHAMAN_FLAME_SHOCK = 8050,
SPELL_SHAMAN_FLAME_SHOCK_MAELSTROM = 188389,
SPELL_SHAMAN_FLAMETONGUE_ATTACK = 10444,
SPELL_SHAMAN_FULMINATION = 88767,
SPELL_SHAMAN_FULMINATION_UI_INDICATOR = 95774,
SPELL_SHAMAN_GLYPH_OF_HEALING_STREAM_TOTEM = 55456,
SPELL_SHAMAN_GLYPH_OF_HEALING_STREAM_TOTEM_TRIGGERED = 119523,
SPELL_SHAMAN_GLYPH_OF_HEALING_WAVE = 55533,
SPELL_SHAMAN_GLYPH_OF_LAVA_LASH = 55444,
SPELL_SHAMAN_GLYPH_OF_THUNDERSTORM = 62132,
SPELL_SHAMAN_HEALING_STREAM_DUMMY = 98856,
SPELL_SHAMAN_HIGH_TIDE = 157154,
SPELL_SHAMAN_IMPROVED_LIGHTNING_SHIELD = 157774,
SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD = 23552,
SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD_DAMAGE = 27635,
SPELL_SHAMAN_ITEM_MANA_SURGE = 23571,
SPELL_SHAMAN_ITEM_T18_ELEMENTAL_2P_BONUS = 185880,
SPELL_SHAMAN_ITEM_T18_ELEMENTAL_4P_BONUS = 185881,
SPELL_SHAMAN_ITEM_T18_GATHERING_VORTEX = 189078,
SPELL_SHAMAN_ITEM_T18_LIGHTNING_VORTEX = 189063,
SPELL_SHAMAN_LAVA_BURST = 51505,
SPELL_SHAMAN_LAVA_LASH_SPREAD_FLAME_SHOCK = 105792,
SPELL_SHAMAN_LAVA_SURGE = 77762,
SPELL_SHAMAN_LIGHTNING_SHIELD = 324,
SPELL_SHAMAN_NATURE_GUARDIAN = 31616,
SPELL_SHAMAN_PATH_OF_FLAMES_SPREAD = 210621,
SPELL_SHAMAN_PATH_OF_FLAMES_TALENT = 201909,
SPELL_SHAMAN_RIPTIDE = 61295,
SPELL_SHAMAN_RUSHING_STREAMS = 147074,
SPELL_SHAMAN_SATED = 57724,
SPELL_SHAMAN_TOTEM_HEALING_STREAM_HEAL = 52042,
SPELL_SHAMAN_TIDAL_WAVES = 53390,
SPELL_SHAMAN_WINDFURY_ATTACK = 25504
};
@@ -216,77 +194,7 @@ class spell_sha_bloodlust : public SpellScriptLoader
}
};
// 1064 - Chain Heal
class spell_sha_chain_heal : public SpellScriptLoader
{
public:
spell_sha_chain_heal() : SpellScriptLoader("spell_sha_chain_heal") { }
class spell_sha_chain_heal_SpellScript : public SpellScript
{
PrepareSpellScript(spell_sha_chain_heal_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_HIGH_TIDE))
return false;
return true;
}
void CatchInitialTarget(WorldObject*& target)
{
_primaryTarget = target;
}
void SelectAdditionalTargets(std::list<WorldObject*>& targets)
{
Unit* caster = GetCaster();
AuraEffect const* highTide = caster->GetAuraEffect(SPELL_SHAMAN_HIGH_TIDE, EFFECT_1);
if (!highTide)
return;
static float const range = 25.0f;
SpellImplicitTargetInfo targetInfo(TARGET_UNIT_TARGET_CHAINHEAL_ALLY);
ConditionContainer* conditions = GetSpellInfo()->GetEffect(EFFECT_0)->ImplicitTargetConditions;
uint32 containerTypeMask = GetSpell()->GetSearcherTypeMask(targetInfo.GetObjectType(), conditions);
if (!containerTypeMask)
return;
std::list<WorldObject*> chainTargets;
Trinity::WorldObjectSpellAreaTargetCheck check(range, _primaryTarget, caster, caster, GetSpellInfo(), targetInfo.GetCheckType(), conditions);
Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellAreaTargetCheck> searcher(caster, chainTargets, check, containerTypeMask);
caster->GetMap()->VisitAll(_primaryTarget->GetPositionX(), _primaryTarget->GetPositionY(), range, searcher);
chainTargets.remove_if(Trinity::UnitAuraCheck(false, SPELL_SHAMAN_RIPTIDE, caster->GetGUID()));
if (chainTargets.empty())
return;
chainTargets.sort();
targets.sort();
std::list<WorldObject*> extraTargets;
std::set_difference(chainTargets.begin(), chainTargets.end(), targets.begin(), targets.end(), std::back_inserter(extraTargets));
Trinity::Containers::RandomResizeList(extraTargets, uint32(highTide->GetAmount()));
targets.splice(targets.end(), extraTargets);
}
WorldObject* _primaryTarget = nullptr;
void Register() override
{
OnObjectTargetSelect += SpellObjectTargetSelectFn(spell_sha_chain_heal_SpellScript::CatchInitialTarget, EFFECT_0, TARGET_UNIT_TARGET_CHAINHEAL_ALLY);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_chain_heal_SpellScript::SelectAdditionalTargets, EFFECT_0, TARGET_UNIT_TARGET_CHAINHEAL_ALLY);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_sha_chain_heal_SpellScript();
}
};
// 974 - Earth Shield
// 204288 - Earth Shield
class spell_sha_earth_shield : public SpellScriptLoader
{
public:
@@ -303,28 +211,10 @@ class spell_sha_earth_shield : public SpellScriptLoader
return true;
}
void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool & /*canBeRecalculated*/)
bool CheckProc(ProcEventInfo& eventInfo)
{
if (Unit* caster = GetCaster())
{
amount = caster->SpellHealingBonusDone(GetUnitOwner(), GetSpellInfo(), amount, HEAL, aurEff->GetSpellEffectInfo());
amount = GetUnitOwner()->SpellHealingBonusTaken(caster, GetSpellInfo(), amount, HEAL, aurEff->GetSpellEffectInfo());
//! WORKAROUND
// If target is affected by healing reduction, modifier is guaranteed to be negative
// value (e.g. -50). To revert the effect, multiply amount with reciprocal of relative value:
// (100 / ((-1) * modifier)) * 100 = (-1) * 100 * 100 / modifier = -10000 / modifier
if (int32 modifier = GetUnitOwner()->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT))
ApplyPct(amount, -10000.0f / float(modifier));
}
}
bool CheckProc(ProcEventInfo& /*eventInfo*/)
{
//! HACK due to currenct proc system implementation
if (Player* player = GetTarget()->ToPlayer())
if (player->GetSpellHistory()->HasCooldown(SPELL_SHAMAN_EARTH_SHIELD_HEAL))
return false;
if (!eventInfo.GetDamageInfo() || !HasEffect(EFFECT_1) || eventInfo.GetDamageInfo()->GetDamage() < GetTarget()->CountPctFromMaxHealth(GetEffect(EFFECT_1)->GetAmount()))
return false;
return true;
}
@@ -332,18 +222,13 @@ class spell_sha_earth_shield : public SpellScriptLoader
{
PreventDefaultAction();
GetTarget()->CastCustomSpell(SPELL_SHAMAN_EARTH_SHIELD_HEAL, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, NULL, aurEff, GetCasterGUID());
/// @hack: due to currenct proc system implementation
if (Player* player = GetTarget()->ToPlayer())
player->GetSpellHistory()->AddCooldown(SPELL_SHAMAN_EARTH_SHIELD_HEAL, 0, std::chrono::seconds(3));
GetTarget()->CastSpell(GetTarget(), SPELL_SHAMAN_EARTH_SHIELD_HEAL, true, nullptr, aurEff, GetCasterGUID());
}
void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sha_earth_shield_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_DUMMY);
DoCheckProc += AuraCheckProcFn(spell_sha_earth_shield_AuraScript::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_sha_earth_shield_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
OnEffectProc += AuraEffectProcFn(spell_sha_earth_shield_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_DUMMY);
}
};
@@ -449,12 +334,6 @@ public:
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ELEMENTAL_BLAST_MASTERY))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ELEMENTAL_BLAST_MULTISTRIKE))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ELEMENTAL_BLAST_AGILITY))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ELEMENTAL_BLAST_SPIRIT))
return false;
return true;
}
@@ -466,15 +345,9 @@ public:
void TriggerBuff()
{
Player* caster = GetCaster()->ToPlayer();
uint32 spellId;
if (caster->GetUInt32Value(PLAYER_FIELD_CURRENT_SPEC_ID) == TALENT_SPEC_SHAMAN_ENHANCEMENT)
spellId = RAND(SPELL_SHAMAN_ELEMENTAL_BLAST_CRIT, SPELL_SHAMAN_ELEMENTAL_BLAST_HASTE, SPELL_SHAMAN_ELEMENTAL_BLAST_MASTERY, SPELL_SHAMAN_ELEMENTAL_BLAST_MULTISTRIKE, SPELL_SHAMAN_ELEMENTAL_BLAST_AGILITY);
else
spellId = RAND(SPELL_SHAMAN_ELEMENTAL_BLAST_CRIT, SPELL_SHAMAN_ELEMENTAL_BLAST_HASTE, SPELL_SHAMAN_ELEMENTAL_BLAST_MASTERY, SPELL_SHAMAN_ELEMENTAL_BLAST_MULTISTRIKE);
uint32 spellId = RAND(SPELL_SHAMAN_ELEMENTAL_BLAST_CRIT, SPELL_SHAMAN_ELEMENTAL_BLAST_HASTE, SPELL_SHAMAN_ELEMENTAL_BLAST_MASTERY);
caster->CastSpell(caster, spellId, TRIGGERED_FULL_MASK);
if (caster->GetUInt32Value(PLAYER_FIELD_CURRENT_SPEC_ID) == TALENT_SPEC_SHAMAN_RESTORATION)
caster->CastSpell(caster, SPELL_SHAMAN_ELEMENTAL_BLAST_SPIRIT, TRIGGERED_FULL_MASK);
}
void Register() override
@@ -518,7 +391,7 @@ class spell_sha_fire_nova : public SpellScriptLoader
}
};
// 10400 - Flametongue
// 194084 - Flametongue
class spell_sha_flametongue : public SpellScriptLoader
{
public:
@@ -540,7 +413,7 @@ public:
PreventDefaultAction();
Unit* attacker = eventInfo.GetActor();
int32 damage = int32(attacker->GetTotalAttackPowerValue(BASE_ATTACK) * 0.075f / 2600 * attacker->GetAttackTime(BASE_ATTACK));
int32 damage = int32(attacker->GetTotalAttackPowerValue(BASE_ATTACK) * 0.125f / 2600 * attacker->GetAttackTime(BASE_ATTACK));
attacker->CastCustomSpell(SPELL_SHAMAN_FLAMETONGUE_ATTACK, SPELLVALUE_BASE_POINT0, damage, eventInfo.GetActionTarget(), TRIGGERED_FULL_MASK, nullptr, aurEff);
}
@@ -556,198 +429,6 @@ public:
}
};
// 88766 - Fulmination
class spell_sha_fulmination : public SpellScriptLoader
{
public:
spell_sha_fulmination() : SpellScriptLoader("spell_sha_fulmination") { }
class spell_sha_fulmination_AuraScript : public AuraScript
{
PrepareAuraScript(spell_sha_fulmination_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_FULMINATION))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_FULMINATION_UI_INDICATOR))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_IMPROVED_LIGHTNING_SHIELD))
return false;
SpellInfo const* lightningShield = sSpellMgr->GetSpellInfo(SPELL_SHAMAN_LIGHTNING_SHIELD);
if (!lightningShield || !lightningShield->GetEffect(EFFECT_0) || !sSpellMgr->GetSpellInfo(lightningShield->GetEffect(EFFECT_0)->TriggerSpell))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ITEM_T18_ELEMENTAL_2P_BONUS))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ITEM_T18_ELEMENTAL_4P_BONUS))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ITEM_T18_LIGHTNING_VORTEX))
return false;
return true;
}
bool CheckProc(ProcEventInfo& eventInfo)
{
// Lava Burst cannot add lightning shield stacks without Improved Lightning Shield
if ((eventInfo.GetSpellInfo()->SpellFamilyFlags[1] & 0x00001000) && !eventInfo.GetActor()->HasAura(SPELL_SHAMAN_IMPROVED_LIGHTNING_SHIELD))
return false;
return eventInfo.GetActor()->HasAura(SPELL_SHAMAN_LIGHTNING_SHIELD);
}
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
Unit* caster = eventInfo.GetActor();
Unit* target = eventInfo.GetActionTarget();
if (Aura* aura = caster->GetAura(SPELL_SHAMAN_LIGHTNING_SHIELD))
{
// Earth Shock releases the charges
if (eventInfo.GetSpellInfo()->SpellFamilyFlags[0] & 0x00100000)
{
uint32 stacks = aura->GetCharges();
if (stacks > 1)
{
SpellInfo const* triggerSpell = sSpellMgr->AssertSpellInfo(aura->GetSpellEffectInfo(EFFECT_0)->TriggerSpell);
SpellEffectInfo const* triggerEffect = triggerSpell->GetEffect(EFFECT_0);
uint32 damage;
damage = caster->SpellDamageBonusDone(target, triggerSpell, uint32(triggerEffect->CalcValue(caster)), SPELL_DIRECT_DAMAGE, triggerEffect, stacks - 1);
damage = target->SpellDamageBonusTaken(caster, triggerSpell, damage, SPELL_DIRECT_DAMAGE, triggerEffect, stacks - 1);
caster->CastCustomSpell(SPELL_SHAMAN_FULMINATION, SPELLVALUE_BASE_POINT0, int32(damage), target, TRIGGERED_FULL_MASK);
caster->RemoveAurasDueToSpell(SPELL_SHAMAN_FULMINATION_UI_INDICATOR);
if (AuraEffect const* t18_4p = caster->GetAuraEffect(SPELL_SHAMAN_ITEM_T18_ELEMENTAL_4P_BONUS, EFFECT_0))
{
if (Aura* gatheringVortex = caster->GetAura(SPELL_SHAMAN_ITEM_T18_GATHERING_VORTEX))
{
if (gatheringVortex->GetStackAmount() + stacks >= uint32(t18_4p->GetAmount()))
caster->CastSpell(caster, SPELL_SHAMAN_ITEM_T18_LIGHTNING_VORTEX, TRIGGERED_FULL_MASK);
if (uint8 newStacks = uint8((gatheringVortex->GetStackAmount() + stacks) % t18_4p->GetAmount()))
gatheringVortex->SetStackAmount(newStacks);
else
gatheringVortex->Remove();
}
else
caster->CastCustomSpell(SPELL_SHAMAN_ITEM_T18_GATHERING_VORTEX, SPELLVALUE_AURA_STACK, stacks, caster, TRIGGERED_FULL_MASK);
}
if (AuraEffect const* t18_2p = caster->GetAuraEffect(SPELL_SHAMAN_ITEM_T18_ELEMENTAL_2P_BONUS, EFFECT_0))
{
if (roll_chance_i(t18_2p->GetAmount()))
{
caster->GetSpellHistory()->ResetCooldown(SPELL_SHAMAN_EARTH_SHOCK, true);
return;
}
}
aura->SetCharges(1);
aura->SetUsingCharges(false);
}
}
else
{
aura->SetCharges(std::min<uint8>(aura->GetCharges() + 1, uint8(aurEff->GetAmount())));
aura->SetUsingCharges(false);
aura->RefreshDuration();
if (aura->GetCharges() == aurEff->GetAmount())
caster->CastSpell(caster, SPELL_SHAMAN_FULMINATION_UI_INDICATOR, TRIGGERED_FULL_MASK);
}
}
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_sha_fulmination_AuraScript::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_sha_fulmination_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_sha_fulmination_AuraScript();
}
};
// 55440 - Glyph of Healing Wave
class spell_sha_glyph_of_healing_wave : public SpellScriptLoader
{
public:
spell_sha_glyph_of_healing_wave() : SpellScriptLoader("spell_sha_glyph_of_healing_wave") { }
class spell_sha_glyph_of_healing_wave_AuraScript : public AuraScript
{
PrepareAuraScript(spell_sha_glyph_of_healing_wave_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_GLYPH_OF_HEALING_WAVE))
return false;
return true;
}
bool CheckProc(ProcEventInfo& eventInfo)
{
// Not proc from self heals
return GetTarget() != eventInfo.GetProcTarget();
}
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
int32 heal = CalculatePct(int32(eventInfo.GetHealInfo()->GetHeal()), aurEff->GetAmount());
GetTarget()->CastCustomSpell(SPELL_SHAMAN_GLYPH_OF_HEALING_WAVE, SPELLVALUE_BASE_POINT0, heal, (Unit*)NULL, true, NULL, aurEff);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_sha_glyph_of_healing_wave_AuraScript::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_sha_glyph_of_healing_wave_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_sha_glyph_of_healing_wave_AuraScript();
}
};
// 5394 - Healing Stream Totem
class spell_sha_healing_stream_totem : public SpellScriptLoader
{
public:
spell_sha_healing_stream_totem() : SpellScriptLoader("spell_sha_healing_stream_totem") { }
class spell_sha_healing_stream_totem_AuraScript : public AuraScript
{
PrepareAuraScript(spell_sha_healing_stream_totem_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return sSpellMgr->GetSpellInfo(SPELL_SHAMAN_TOTEM_HEALING_STREAM_HEAL) != nullptr;
}
void HandleDummy(AuraEffect const* aurEff)
{
if (Creature* waterTotem = GetTarget()->GetMap()->GetCreature(GetTarget()->m_SummonSlot[3]))
waterTotem->CastSpell((Unit*)nullptr, SPELL_SHAMAN_TOTEM_HEALING_STREAM_HEAL, TRIGGERED_FULL_MASK, nullptr, aurEff, GetTarget()->GetGUID());
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_sha_healing_stream_totem_AuraScript::HandleDummy, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_sha_healing_stream_totem_AuraScript();
}
};
// 52042 - Healing Stream Totem
class spell_sha_healing_stream_totem_heal : public SpellScriptLoader
{
@@ -758,46 +439,22 @@ class spell_sha_healing_stream_totem_heal : public SpellScriptLoader
{
PrepareSpellScript(spell_sha_healing_stream_totem_heal_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_RUSHING_STREAMS) ||
!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_GLYPH_OF_HEALING_STREAM_TOTEM) ||
!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_GLYPH_OF_HEALING_STREAM_TOTEM_TRIGGERED) ||
!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_HEALING_STREAM_DUMMY))
return false;
return true;
}
void SelectTargets(std::list<WorldObject*>& targets)
{
uint32 targetLimit = 1;
if (GetOriginalCaster()->HasAura(SPELL_SHAMAN_RUSHING_STREAMS))
targetLimit = 2;
targets.remove_if([](WorldObject* target)
{
return !target->ToUnit() || target->ToUnit()->IsFullHealth();
});
Trinity::Containers::RandomResizeList(targets, targetLimit);
Trinity::Containers::RandomResizeList(targets, 1);
if (targets.empty())
targets.push_back(GetOriginalCaster());
}
void HandleEffect(SpellEffIndex /*effIndex*/)
{
if (GetOriginalCaster()->HasAura(SPELL_SHAMAN_GLYPH_OF_HEALING_STREAM_TOTEM))
GetCaster()->CastSpell(GetHitUnit(), SPELL_SHAMAN_GLYPH_OF_HEALING_STREAM_TOTEM_TRIGGERED, TRIGGERED_FULL_MASK);
GetCaster()->CastSpell(GetHitUnit(), SPELL_SHAMAN_HEALING_STREAM_DUMMY, TRIGGERED_FULL_MASK);
}
void Register()
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_healing_stream_totem_heal_SpellScript::SelectTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY);
OnEffectHitTarget += SpellEffectFn(spell_sha_healing_stream_totem_heal_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_HEAL);
}
};
@@ -1070,89 +727,6 @@ public:
}
};
// 60103 - Lava Lash
class spell_sha_lava_lash : public SpellScriptLoader
{
public:
spell_sha_lava_lash() : SpellScriptLoader("spell_sha_lava_lash") { }
class spell_sha_lava_lash_SpellScript : public SpellScript
{
PrepareSpellScript(spell_sha_lava_lash_SpellScript);
bool Load() override
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (GetCaster()->HasAura(SPELL_SHAMAN_GLYPH_OF_LAVA_LASH))
return;
GetCaster()->CastCustomSpell(SPELL_SHAMAN_LAVA_LASH_SPREAD_FLAME_SHOCK, SPELLVALUE_MAX_TARGETS, GetEffectValue(), GetHitUnit(), TRIGGERED_FULL_MASK);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_sha_lava_lash_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_WEAPON_PERCENT_DAMAGE);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_sha_lava_lash_SpellScript();
}
};
// 105792 - Lava Lash
class spell_sha_lava_lash_spread_flame_shock : public SpellScriptLoader
{
public:
spell_sha_lava_lash_spread_flame_shock() : SpellScriptLoader("spell_sha_lava_lash_spread_flame_shock") { }
class spell_sha_lava_lash_spread_flame_shock_SpellScript : public SpellScript
{
PrepareSpellScript(spell_sha_lava_lash_spread_flame_shock_SpellScript);
bool Load() override
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_SHAMAN_FLAME_SHOCK, GetCaster()->GetGUID()));
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Unit* mainTarget = GetExplTargetUnit())
{
if (Aura* flameShock = mainTarget->GetAura(SPELL_SHAMAN_FLAME_SHOCK, GetCaster()->GetGUID()))
{
if (Aura* newAura = GetCaster()->AddAura(SPELL_SHAMAN_FLAME_SHOCK, GetHitUnit()))
{
newAura->SetDuration(flameShock->GetDuration());
newAura->SetMaxDuration(flameShock->GetDuration());
}
}
}
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_lava_lash_spread_flame_shock_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_sha_lava_lash_spread_flame_shock_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_sha_lava_lash_spread_flame_shock_SpellScript();
}
};
// 77756 - Lava Surge
class spell_sha_lava_surge : public SpellScriptLoader
{
@@ -1254,60 +828,6 @@ public:
}
};
// 30884 - Nature's Guardian
class spell_sha_nature_guardian : public SpellScriptLoader
{
public:
spell_sha_nature_guardian() : SpellScriptLoader("spell_sha_nature_guardian") { }
class spell_sha_nature_guardian_AuraScript : public AuraScript
{
PrepareAuraScript(spell_sha_nature_guardian_AuraScript);
bool Validate(SpellInfo const* spellInfo) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_NATURE_GUARDIAN))
return false;
if (!spellInfo->GetEffect(EFFECT_1))
return false;
return true;
}
bool CheckProc(ProcEventInfo& eventInfo)
{
//! HACK due to currenct proc system implementation
if (GetTarget()->GetSpellHistory()->HasCooldown(GetSpellInfo()->Id))
return false;
return GetTarget()->HealthBelowPctDamaged(30, eventInfo.GetDamageInfo()->GetDamage());
}
void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
int32 basePoints0 = GetTarget()->CountPctFromMaxHealth(aurEff->GetAmount());
GetTarget()->CastCustomSpell(GetTarget(), SPELL_SHAMAN_NATURE_GUARDIAN, &basePoints0, NULL, NULL, true);
if (eventInfo.GetProcTarget() && eventInfo.GetProcTarget()->IsAlive())
eventInfo.GetProcTarget()->getThreatManager().modifyThreatPercent(GetTarget(), -10);
GetTarget()->GetSpellHistory()->AddCooldown(GetSpellInfo()->Id, 0, std::chrono::seconds(aurEff->GetSpellInfo()->GetEffect(EFFECT_1)->CalcValue()));
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_sha_nature_guardian_AuraScript::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_sha_nature_guardian_AuraScript::OnProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_sha_nature_guardian_AuraScript();
}
};
// 210621 - Path of Flames Spread
class spell_sha_path_of_flames_spread : public SpellScriptLoader
{
@@ -1362,35 +882,6 @@ public:
}
};
// 51490 - Thunderstorm
class spell_sha_thunderstorm : public SpellScriptLoader
{
public:
spell_sha_thunderstorm() : SpellScriptLoader("spell_sha_thunderstorm") { }
class spell_sha_thunderstorm_SpellScript : public SpellScript
{
PrepareSpellScript(spell_sha_thunderstorm_SpellScript);
void HandleKnockBack(SpellEffIndex effIndex)
{
// Glyph of Thunderstorm
if (GetCaster()->HasAura(SPELL_SHAMAN_GLYPH_OF_THUNDERSTORM))
PreventHitDefaultEffect(effIndex);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_sha_thunderstorm_SpellScript::HandleKnockBack, EFFECT_1, SPELL_EFFECT_KNOCK_BACK);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_sha_thunderstorm_SpellScript();
}
};
// 51564 - Tidal Waves
class spell_sha_tidal_waves : public SpellScriptLoader
{
@@ -1450,7 +941,7 @@ public:
{
PreventDefaultAction();
for (uint32 i = 0; i < 3; ++i)
for (uint32 i = 0; i < 2; ++i)
eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_SHAMAN_WINDFURY_ATTACK, true, nullptr, aurEff);
}
@@ -1471,16 +962,12 @@ void AddSC_shaman_spell_scripts()
new spell_sha_ancestral_guidance();
new spell_sha_ancestral_guidance_heal();
new spell_sha_bloodlust();
new spell_sha_chain_heal();
new spell_sha_earth_shield();
new spell_sha_earthen_rage_passive();
new spell_sha_earthen_rage_proc_aura();
new spell_sha_elemental_blast();
new spell_sha_fire_nova();
new spell_sha_flametongue();
new spell_sha_fulmination();
new spell_sha_glyph_of_healing_wave();
new spell_sha_healing_stream_totem();
new spell_sha_healing_stream_totem_heal();
new spell_sha_heroism();
new spell_sha_item_lightning_shield();
@@ -1489,14 +976,10 @@ void AddSC_shaman_spell_scripts()
new spell_sha_item_t10_elemental_2p_bonus();
new spell_sha_item_t18_elemental_4p_bonus();
new spell_sha_lava_burst();
new spell_sha_lava_lash();
new spell_sha_lava_lash_spread_flame_shock();
new spell_sha_lava_surge();
new spell_sha_lava_surge_proc();
new spell_sha_lightning_shield();
new spell_sha_nature_guardian();
new spell_sha_path_of_flames_spread();
new spell_sha_thunderstorm();
new spell_sha_tidal_waves();
new spell_sha_windfury();
}