Merge pull request #6304 from Vincent-Michael/shaman
Core/Spells: Fix Earthen Power Closes #4795
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
DELETE FROM `spell_script_names` WHERE `spell_id`=59566;
|
||||||
|
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
|
||||||
|
(59566,'spell_sha_earthen_power');
|
||||||
@@ -215,13 +215,12 @@ class spell_sha_earthbind_totem : public SpellScriptLoader
|
|||||||
|
|
||||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||||
{
|
{
|
||||||
if (Unit* target = GetTarget())
|
if (!GetCaster())
|
||||||
if (Unit* caster = aurEff->GetBase()->GetCaster())
|
return;
|
||||||
if (TempSummon* summon = caster->ToTempSummon())
|
if (Player* owner = GetCaster()->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||||
if (Unit* owner = summon->GetOwner())
|
|
||||||
if (AuraEffect* aur = owner->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 2289, 0))
|
if (AuraEffect* aur = owner->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 2289, 0))
|
||||||
if (roll_chance_i(aur->GetBaseAmount()) && target->HasAuraWithMechanic(1 << MECHANIC_SNARE))
|
if (roll_chance_i(aur->GetBaseAmount()))
|
||||||
caster->CastSpell(caster, SHAMAN_TOTEM_SPELL_EARTHEN_POWER, true, NULL, aurEff);
|
GetTarget()->CastSpell((Unit*)NULL, SHAMAN_TOTEM_SPELL_EARTHEN_POWER, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Apply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
void Apply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||||
@@ -252,6 +251,46 @@ class spell_sha_earthbind_totem : public SpellScriptLoader
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class EarthenPowerTargetSelector
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
EarthenPowerTargetSelector() { }
|
||||||
|
|
||||||
|
bool operator() (Unit* target)
|
||||||
|
{
|
||||||
|
if (!target->HasAuraWithMechanic(1 << MECHANIC_SNARE))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class spell_sha_earthen_power : public SpellScriptLoader
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
spell_sha_earthen_power() : SpellScriptLoader("spell_sha_earthen_power") { }
|
||||||
|
|
||||||
|
class spell_sha_earthen_power_SpellScript : public SpellScript
|
||||||
|
{
|
||||||
|
PrepareSpellScript(spell_sha_earthen_power_SpellScript);
|
||||||
|
|
||||||
|
void FilterTargets(std::list<Unit*>& unitList)
|
||||||
|
{
|
||||||
|
unitList.remove_if(EarthenPowerTargetSelector());
|
||||||
|
}
|
||||||
|
|
||||||
|
void Register()
|
||||||
|
{
|
||||||
|
OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_earthen_power_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
SpellScript* GetSpellScript() const
|
||||||
|
{
|
||||||
|
return new spell_sha_earthen_power_SpellScript();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class spell_sha_bloodlust : public SpellScriptLoader
|
class spell_sha_bloodlust : public SpellScriptLoader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -617,6 +656,7 @@ void AddSC_shaman_spell_scripts()
|
|||||||
new spell_sha_fire_nova();
|
new spell_sha_fire_nova();
|
||||||
new spell_sha_mana_tide_totem();
|
new spell_sha_mana_tide_totem();
|
||||||
new spell_sha_earthbind_totem();
|
new spell_sha_earthbind_totem();
|
||||||
|
new spell_sha_earthen_power();
|
||||||
new spell_sha_bloodlust();
|
new spell_sha_bloodlust();
|
||||||
new spell_sha_heroism();
|
new spell_sha_heroism();
|
||||||
new spell_sha_ancestral_awakening_proc();
|
new spell_sha_ancestral_awakening_proc();
|
||||||
|
|||||||
Reference in New Issue
Block a user