Scripts/Spells: Bloodlust/Heroism handling changed, it is now possible to use these spells even if caster is under Sated/Exhaustion debuff
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_sha_bloodlust';
|
||||||
|
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_sha_heroism';
|
||||||
|
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
|
||||||
|
(2825,'spell_sha_bloodlust'),
|
||||||
|
(32182,'spell_sha_heroism');
|
||||||
|
|
||||||
@@ -2955,12 +2955,6 @@ void SpellMgr::LoadDbcDataCorrections()
|
|||||||
// because of bug in dbc
|
// because of bug in dbc
|
||||||
spellInfo->procChance = 0;
|
spellInfo->procChance = 0;
|
||||||
break;
|
break;
|
||||||
case 32182: // Heroism
|
|
||||||
spellInfo->excludeCasterAuraSpell = 57723; // Exhaustion
|
|
||||||
break;
|
|
||||||
case 2825: // Bloodlust
|
|
||||||
spellInfo->excludeCasterAuraSpell = 57724; // Sated
|
|
||||||
break;
|
|
||||||
case 20335: // Heart of the Crusader
|
case 20335: // Heart of the Crusader
|
||||||
case 20336:
|
case 20336:
|
||||||
case 20337:
|
case 20337:
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ enum ShamanSpells
|
|||||||
SHAMAN_SPELL_MANA_TIDE_TOTEM = 39609,
|
SHAMAN_SPELL_MANA_TIDE_TOTEM = 39609,
|
||||||
SHAMAN_SPELL_FIRE_NOVA_R1 = 1535,
|
SHAMAN_SPELL_FIRE_NOVA_R1 = 1535,
|
||||||
SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1 = 8349,
|
SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1 = 8349,
|
||||||
|
SHAMAN_SPELL_SATED = 57724,
|
||||||
|
SHAMAN_SPELL_EXHAUSTION = 57723,
|
||||||
|
|
||||||
//For Earthen Power
|
//For Earthen Power
|
||||||
SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM = 6474, //Spell casted by totem
|
SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM = 6474, //Spell casted by totem
|
||||||
@@ -39,193 +41,277 @@ enum ShamanSpells
|
|||||||
// 51474 - Astral shift
|
// 51474 - Astral shift
|
||||||
class spell_sha_astral_shift : public SpellScriptLoader
|
class spell_sha_astral_shift : public SpellScriptLoader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
spell_sha_astral_shift() : SpellScriptLoader("spell_sha_astral_shift") { }
|
spell_sha_astral_shift() : SpellScriptLoader("spell_sha_astral_shift") { }
|
||||||
|
|
||||||
class spell_sha_astral_shift_AuraScript : public AuraScript
|
class spell_sha_astral_shift_AuraScript : public AuraScript
|
||||||
{
|
|
||||||
PrepareAuraScript(spell_sha_astral_shift_AuraScript);
|
|
||||||
|
|
||||||
uint32 absorbPct;
|
|
||||||
|
|
||||||
bool Load()
|
|
||||||
{
|
{
|
||||||
absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster());
|
PrepareAuraScript(spell_sha_astral_shift_AuraScript);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
|
uint32 absorbPct;
|
||||||
|
|
||||||
|
bool Load()
|
||||||
|
{
|
||||||
|
absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
|
||||||
|
{
|
||||||
|
// Set absorbtion amount to unlimited
|
||||||
|
amount = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
|
||||||
|
{
|
||||||
|
// reduces all damage taken while stun, fear or silence
|
||||||
|
if (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_FLEEING | UNIT_FLAG_SILENCED) || (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN)))
|
||||||
|
absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Register()
|
||||||
|
{
|
||||||
|
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sha_astral_shift_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
|
||||||
|
OnEffectAbsorb += AuraEffectAbsorbFn(spell_sha_astral_shift_AuraScript::Absorb, EFFECT_0);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
AuraScript* GetAuraScript() const
|
||||||
{
|
{
|
||||||
// Set absorbtion amount to unlimited
|
return new spell_sha_astral_shift_AuraScript();
|
||||||
amount = -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
|
|
||||||
{
|
|
||||||
// reduces all damage taken while stun, fear or silence
|
|
||||||
if (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_FLEEING | UNIT_FLAG_SILENCED) || (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN)))
|
|
||||||
absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register()
|
|
||||||
{
|
|
||||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sha_astral_shift_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
|
|
||||||
OnEffectAbsorb += AuraEffectAbsorbFn(spell_sha_astral_shift_AuraScript::Absorb, EFFECT_0);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
AuraScript* GetAuraScript() const
|
|
||||||
{
|
|
||||||
return new spell_sha_astral_shift_AuraScript();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 1535 Fire Nova
|
// 1535 Fire Nova
|
||||||
class spell_sha_fire_nova : public SpellScriptLoader
|
class spell_sha_fire_nova : public SpellScriptLoader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
spell_sha_fire_nova() : SpellScriptLoader("spell_sha_fire_nova") { }
|
spell_sha_fire_nova() : SpellScriptLoader("spell_sha_fire_nova") { }
|
||||||
|
|
||||||
class spell_sha_fire_nova_SpellScript : public SpellScript
|
class spell_sha_fire_nova_SpellScript : public SpellScript
|
||||||
{
|
|
||||||
PrepareSpellScript(spell_sha_fire_nova_SpellScript)
|
|
||||||
bool Validate(SpellInfo const* spellEntry)
|
|
||||||
{
|
{
|
||||||
if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_FIRE_NOVA_R1))
|
PrepareSpellScript(spell_sha_fire_nova_SpellScript);
|
||||||
return false;
|
|
||||||
if (sSpellMgr->GetFirstSpellInChain(SHAMAN_SPELL_FIRE_NOVA_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
uint8 rank = sSpellMgr->GetSpellRank(spellEntry->Id);
|
bool Validate(SpellInfo const* spellEntry)
|
||||||
if (!sSpellMgr->GetSpellWithRank(SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, rank, true))
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
SpellCastResult CheckFireTotem()
|
|
||||||
{
|
|
||||||
// fire totem
|
|
||||||
if (!GetCaster()->m_SummonSlot[1])
|
|
||||||
{
|
{
|
||||||
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_HAVE_FIRE_TOTEM);
|
if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_FIRE_NOVA_R1))
|
||||||
return SPELL_FAILED_CUSTOM_ERROR;
|
return false;
|
||||||
|
if (sSpellMgr->GetFirstSpellInChain(SHAMAN_SPELL_FIRE_NOVA_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
uint8 rank = sSpellMgr->GetSpellRank(spellEntry->Id);
|
||||||
|
if (!sSpellMgr->GetSpellWithRank(SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, rank, true))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return SPELL_CAST_OK;
|
SpellCastResult CheckFireTotem()
|
||||||
}
|
|
||||||
|
|
||||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
|
||||||
{
|
|
||||||
Unit* caster = GetCaster();
|
|
||||||
uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
|
|
||||||
if (uint32 spellId = sSpellMgr->GetSpellWithRank(SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, rank))
|
|
||||||
{
|
{
|
||||||
Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[1]);
|
// fire totem
|
||||||
if (totem && totem->isTotem())
|
if (!GetCaster()->m_SummonSlot[1])
|
||||||
totem->CastSpell(totem, spellId, true);
|
{
|
||||||
|
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_HAVE_FIRE_TOTEM);
|
||||||
|
return SPELL_FAILED_CUSTOM_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
return SPELL_CAST_OK;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void Register()
|
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||||
|
{
|
||||||
|
Unit* caster = GetCaster();
|
||||||
|
uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
|
||||||
|
if (uint32 spellId = sSpellMgr->GetSpellWithRank(SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, rank))
|
||||||
|
{
|
||||||
|
Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[1]);
|
||||||
|
if (totem && totem->isTotem())
|
||||||
|
totem->CastSpell(totem, spellId, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Register()
|
||||||
|
{
|
||||||
|
OnCheckCast += SpellCheckCastFn(spell_sha_fire_nova_SpellScript::CheckFireTotem);
|
||||||
|
OnEffectHitTarget += SpellEffectFn(spell_sha_fire_nova_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
SpellScript* GetSpellScript() const
|
||||||
{
|
{
|
||||||
OnCheckCast += SpellCheckCastFn(spell_sha_fire_nova_SpellScript::CheckFireTotem);
|
return new spell_sha_fire_nova_SpellScript();
|
||||||
OnEffectHitTarget += SpellEffectFn(spell_sha_fire_nova_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
SpellScript* GetSpellScript() const
|
|
||||||
{
|
|
||||||
return new spell_sha_fire_nova_SpellScript();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 39610 Mana Tide Totem
|
// 39610 Mana Tide Totem
|
||||||
class spell_sha_mana_tide_totem : public SpellScriptLoader
|
class spell_sha_mana_tide_totem : public SpellScriptLoader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
spell_sha_mana_tide_totem() : SpellScriptLoader("spell_sha_mana_tide_totem") { }
|
spell_sha_mana_tide_totem() : SpellScriptLoader("spell_sha_mana_tide_totem") { }
|
||||||
|
|
||||||
class spell_sha_mana_tide_totem_SpellScript : public SpellScript
|
class spell_sha_mana_tide_totem_SpellScript : public SpellScript
|
||||||
{
|
|
||||||
PrepareSpellScript(spell_sha_mana_tide_totem_SpellScript)
|
|
||||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
|
||||||
{
|
{
|
||||||
if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_GLYPH_OF_MANA_TIDE))
|
PrepareSpellScript(spell_sha_mana_tide_totem_SpellScript);
|
||||||
return false;
|
|
||||||
if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_MANA_TIDE_TOTEM))
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||||
{
|
|
||||||
Unit* caster = GetCaster();
|
|
||||||
if (Unit* unitTarget = GetHitUnit())
|
|
||||||
{
|
{
|
||||||
if (unitTarget->getPowerType() == POWER_MANA)
|
if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_GLYPH_OF_MANA_TIDE))
|
||||||
|
return false;
|
||||||
|
if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_MANA_TIDE_TOTEM))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||||
|
{
|
||||||
|
Unit* caster = GetCaster();
|
||||||
|
if (Unit* unitTarget = GetHitUnit())
|
||||||
{
|
{
|
||||||
int32 effValue = GetEffectValue();
|
if (unitTarget->getPowerType() == POWER_MANA)
|
||||||
// Glyph of Mana Tide
|
{
|
||||||
if (Unit* owner = caster->GetOwner())
|
int32 effValue = GetEffectValue();
|
||||||
if (AuraEffect* dummy = owner->GetAuraEffect(SHAMAN_SPELL_GLYPH_OF_MANA_TIDE, 0))
|
// Glyph of Mana Tide
|
||||||
effValue += dummy->GetAmount();
|
if (Unit* owner = caster->GetOwner())
|
||||||
// Regenerate 6% of Total Mana Every 3 secs
|
if (AuraEffect* dummy = owner->GetAuraEffect(SHAMAN_SPELL_GLYPH_OF_MANA_TIDE, 0))
|
||||||
int32 effBasePoints0 = int32(CalculatePctN(unitTarget->GetMaxPower(POWER_MANA), effValue));
|
effValue += dummy->GetAmount();
|
||||||
caster->CastCustomSpell(unitTarget, SHAMAN_SPELL_MANA_TIDE_TOTEM, &effBasePoints0, NULL, NULL, true, NULL, NULL, GetOriginalCaster()->GetGUID());
|
// Regenerate 6% of Total Mana Every 3 secs
|
||||||
|
int32 effBasePoints0 = int32(CalculatePctN(unitTarget->GetMaxPower(POWER_MANA), effValue));
|
||||||
|
caster->CastCustomSpell(unitTarget, SHAMAN_SPELL_MANA_TIDE_TOTEM, &effBasePoints0, NULL, NULL, true, NULL, NULL, GetOriginalCaster()->GetGUID());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void Register()
|
void Register()
|
||||||
|
{
|
||||||
|
OnEffectHitTarget += SpellEffectFn(spell_sha_mana_tide_totem_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
SpellScript* GetSpellScript() const
|
||||||
{
|
{
|
||||||
OnEffectHitTarget += SpellEffectFn(spell_sha_mana_tide_totem_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
return new spell_sha_mana_tide_totem_SpellScript();
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
SpellScript* GetSpellScript() const
|
|
||||||
{
|
|
||||||
return new spell_sha_mana_tide_totem_SpellScript();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 6474 - Earthbind Totem - Fix Talent:Earthen Power
|
// 6474 - Earthbind Totem - Fix Talent:Earthen Power
|
||||||
class spell_sha_earthbind_totem : public SpellScriptLoader
|
class spell_sha_earthbind_totem : public SpellScriptLoader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
spell_sha_earthbind_totem() : SpellScriptLoader("spell_sha_earthbind_totem") { }
|
spell_sha_earthbind_totem() : SpellScriptLoader("spell_sha_earthbind_totem") { }
|
||||||
|
|
||||||
class spell_sha_earthbind_totem_AuraScript : public AuraScript
|
class spell_sha_earthbind_totem_AuraScript : public AuraScript
|
||||||
{
|
|
||||||
PrepareAuraScript(spell_sha_earthbind_totem_AuraScript);
|
|
||||||
|
|
||||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
|
||||||
{
|
{
|
||||||
if (!sSpellMgr->GetSpellInfo(SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM))
|
PrepareAuraScript(spell_sha_earthbind_totem_AuraScript);
|
||||||
return false;
|
|
||||||
if (!sSpellMgr->GetSpellInfo(SHAMAN_TOTEM_SPELL_EARTHEN_POWER))
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||||
|
{
|
||||||
|
if (!sSpellMgr->GetSpellInfo(SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM))
|
||||||
|
return false;
|
||||||
|
if (!sSpellMgr->GetSpellInfo(SHAMAN_TOTEM_SPELL_EARTHEN_POWER))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||||
|
{
|
||||||
|
Unit* target = GetTarget();
|
||||||
|
if (Unit* caster = aurEff->GetBase()->GetCaster())
|
||||||
|
if (AuraEffect* aur = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 2289, 0))
|
||||||
|
if (roll_chance_i(aur->GetBaseAmount()))
|
||||||
|
target->CastSpell(target, SHAMAN_TOTEM_SPELL_EARTHEN_POWER, true, NULL, aurEff);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Register()
|
||||||
|
{
|
||||||
|
OnEffectPeriodic += AuraEffectPeriodicFn(spell_sha_earthbind_totem_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
AuraScript* GetAuraScript() const
|
||||||
{
|
{
|
||||||
Unit* target = GetTarget();
|
return new spell_sha_earthbind_totem_AuraScript();
|
||||||
if (Unit* caster = aurEff->GetBase()->GetCaster())
|
|
||||||
if (AuraEffect* aur = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 2289, 0))
|
|
||||||
if (roll_chance_i(aur->GetBaseAmount()))
|
|
||||||
target->CastSpell(target, SHAMAN_TOTEM_SPELL_EARTHEN_POWER, true, NULL, aurEff);
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void Register()
|
class spell_sha_bloodlust : public SpellScriptLoader
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
spell_sha_bloodlust() : SpellScriptLoader("spell_sha_bloodlust") { }
|
||||||
|
|
||||||
|
class spell_sha_bloodlust_SpellScript : public SpellScript
|
||||||
{
|
{
|
||||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_sha_earthbind_totem_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
PrepareSpellScript(spell_sha_bloodlust_SpellScript);
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
AuraScript* GetAuraScript() const
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||||
{
|
{
|
||||||
return new spell_sha_earthbind_totem_AuraScript();
|
if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_SATED))
|
||||||
}
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RemoveInvalidTargets(std::list<Unit*>& targets)
|
||||||
|
{
|
||||||
|
targets.remove_if(Trinity::UnitAuraCheck(true, SHAMAN_SPELL_SATED));
|
||||||
|
}
|
||||||
|
|
||||||
|
void ApplyDebuff()
|
||||||
|
{
|
||||||
|
GetHitUnit()->CastSpell(GetHitUnit(), SHAMAN_SPELL_SATED, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Register()
|
||||||
|
{
|
||||||
|
OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
|
||||||
|
OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID);
|
||||||
|
OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID);
|
||||||
|
AfterHit += SpellHitFn(spell_sha_bloodlust_SpellScript::ApplyDebuff);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
SpellScript* GetSpellScript() const
|
||||||
|
{
|
||||||
|
return new spell_sha_bloodlust_SpellScript();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class spell_sha_heroism : public SpellScriptLoader
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
spell_sha_heroism() : SpellScriptLoader("spell_sha_heroism") { }
|
||||||
|
|
||||||
|
class spell_sha_heroism_SpellScript : public SpellScript
|
||||||
|
{
|
||||||
|
PrepareSpellScript(spell_sha_heroism_SpellScript);
|
||||||
|
|
||||||
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||||
|
{
|
||||||
|
if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_EXHAUSTION))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RemoveInvalidTargets(std::list<Unit*>& targets)
|
||||||
|
{
|
||||||
|
targets.remove_if(Trinity::UnitAuraCheck(true, SHAMAN_SPELL_EXHAUSTION));
|
||||||
|
}
|
||||||
|
|
||||||
|
void ApplyDebuff()
|
||||||
|
{
|
||||||
|
GetHitUnit()->CastSpell(GetHitUnit(), SHAMAN_SPELL_EXHAUSTION, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Register()
|
||||||
|
{
|
||||||
|
OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
|
||||||
|
OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID);
|
||||||
|
OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID);
|
||||||
|
AfterHit += SpellHitFn(spell_sha_heroism_SpellScript::ApplyDebuff);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
SpellScript* GetSpellScript() const
|
||||||
|
{
|
||||||
|
return new spell_sha_heroism_SpellScript();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void AddSC_shaman_spell_scripts()
|
void AddSC_shaman_spell_scripts()
|
||||||
@@ -234,4 +320,6 @@ 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_bloodlust();
|
||||||
|
new spell_sha_heroism();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user