Core/Scripts: Start work on cleaning up scripts.
This commit is contained in:
@@ -20,6 +20,7 @@ using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using Game.Spells;
|
||||
using System.Collections.Generic;
|
||||
using Game.Networking.Packets;
|
||||
|
||||
namespace Scripts.Spells.DeathKnight
|
||||
{
|
||||
@@ -45,7 +46,6 @@ namespace Scripts.Spells.DeathKnight
|
||||
public const uint DeathStrikeOffhand = 66188;
|
||||
public const uint FesteringWound = 194310;
|
||||
public const uint Frost = 137006;
|
||||
public const uint FrostFever = 55095;
|
||||
public const uint GlyphOfFoulMenagerie = 58642;
|
||||
public const uint GlyphOfTheGeist = 58640;
|
||||
public const uint GlyphOfTheSkeleton = 146652;
|
||||
@@ -111,6 +111,10 @@ namespace Scripts.Spells.DeathKnight
|
||||
[Script] // 48707 - Anti-Magic Shell
|
||||
class spell_dk_anti_magic_shell : AuraScript
|
||||
{
|
||||
int absorbPct;
|
||||
ulong maxHealth;
|
||||
uint absorbedAmount;
|
||||
|
||||
public spell_dk_anti_magic_shell()
|
||||
{
|
||||
absorbPct = 0;
|
||||
@@ -126,14 +130,14 @@ namespace Scripts.Spells.DeathKnight
|
||||
public override bool Load()
|
||||
{
|
||||
absorbPct = GetSpellInfo().GetEffect(1).CalcValue(GetCaster());
|
||||
maxHealth = (int)GetCaster().GetMaxHealth();
|
||||
maxHealth = GetCaster().GetMaxHealth();
|
||||
absorbedAmount = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect aurEff, ref int amount, ref bool canBeRecalculated)
|
||||
{
|
||||
amount = MathFunctions.CalculatePct(maxHealth, absorbPct);
|
||||
amount = (int)MathFunctions.CalculatePct(maxHealth, absorbPct);
|
||||
}
|
||||
|
||||
void Trigger(AuraEffect aurEff, DamageInfo dmgInfo, ref uint absorbAmount)
|
||||
@@ -163,13 +167,9 @@ namespace Scripts.Spells.DeathKnight
|
||||
AfterEffectAbsorb.Add(new EffectAbsorbHandler(Trigger, 0));
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(HandleEffectRemove, 0, AuraType.SchoolAbsorb, AuraEffectHandleModes.Real));
|
||||
}
|
||||
|
||||
int absorbPct;
|
||||
int maxHealth;
|
||||
uint absorbedAmount;
|
||||
}
|
||||
|
||||
[Script] // 127517 - Army Transform // 6.x, does this belong here or in spell_generic? where do we cast this? sniffs say this is only cast when caster has glyph of foul menagerie.
|
||||
[Script] // 127517 - Army Transform
|
||||
class spell_dk_army_transform : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
@@ -223,7 +223,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 49028 - Dancing Rune Weapon 7.1.5
|
||||
[Script] // 49028 - Dancing Rune Weapon
|
||||
class spell_dk_dancing_rune_weapon : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
@@ -262,10 +262,10 @@ namespace Scripts.Spells.DeathKnight
|
||||
if (damageInfo == null || damageInfo.GetDamage() == 0)
|
||||
return;
|
||||
|
||||
int amount = (int)(damageInfo.GetDamage() / 2);
|
||||
SpellNonMeleeDamage log = new SpellNonMeleeDamage(drw, drw.GetVictim(), spellInfo, new Game.Networking.Packets.SpellCastVisual(spellInfo.GetSpellXSpellVisualId(drw), 0), spellInfo.GetSchoolMask());
|
||||
int amount = (int)damageInfo.GetDamage() / 2;
|
||||
SpellNonMeleeDamage log = new SpellNonMeleeDamage(drw, drw.GetVictim(), spellInfo, new SpellCastVisual(spellInfo.GetSpellXSpellVisualId(drw), 0), spellInfo.GetSchoolMask());
|
||||
log.damage = (uint)amount;
|
||||
drw.DealDamage(drw.GetVictim(), (uint)amount, null, DamageEffectType.Direct, spellInfo.GetSchoolMask(), spellInfo, true);
|
||||
drw.DealDamage(drw.GetVictim(), (uint)amount, null, DamageEffectType.SpellDirect, spellInfo.GetSchoolMask(), spellInfo, true);
|
||||
drw.SendSpellNonMeleeDamageLog(log);
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
}
|
||||
|
||||
[Script] // 43265 - Death and Decay
|
||||
class spell_dk_death_and_decay : SpellScript
|
||||
class spell_dk_death_and_decay_SpellScript : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
@@ -287,7 +287,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
{
|
||||
if (GetCaster().HasAura(SpellIds.TighteningGrasp))
|
||||
{
|
||||
Position pos = GetExplTargetDest();
|
||||
WorldLocation pos = GetExplTargetDest();
|
||||
if (pos != null)
|
||||
GetCaster().CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), SpellIds.TighteningGraspSlow, true);
|
||||
}
|
||||
@@ -298,8 +298,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
OnCast.Add(new CastHandler(HandleDummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
[Script] // 43265 - Death and Decay
|
||||
class spell_dk_death_and_decay_AuraScript : AuraScript
|
||||
{
|
||||
void HandleDummyTick(AuraEffect aurEff)
|
||||
@@ -327,9 +326,8 @@ namespace Scripts.Spells.DeathKnight
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
caster.CastSpell(GetHitUnit(), SpellIds.DeathCoilDamage, true);
|
||||
|
||||
AuraEffect unholyAura = caster.GetAuraEffect(SpellIds.Unholy, 6);
|
||||
if (unholyAura != null) // can be any effect, just here to send SPELL_FAILED_DONT_REPORT on failure
|
||||
if (unholyAura != null) // can be any effect, just here to send SpellFailedDontReport on failure
|
||||
caster.CastSpell(caster, SpellIds.UnholyVigor, true, null, unholyAura);
|
||||
}
|
||||
|
||||
@@ -368,7 +366,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //49576 - Death Grip Initial
|
||||
[Script] // 49576 - Death Grip Initial
|
||||
class spell_dk_death_grip_initial : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
@@ -422,14 +420,13 @@ namespace Scripts.Spells.DeathKnight
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.DeathStrikeHeal, SpellIds.BloodShieldMastery, SpellIds.BloodShieldAbsorb,
|
||||
SpellIds.RecentlyUsedDeathStrike, SpellIds.Frost, SpellIds.DeathStrikeOffhand);
|
||||
return ValidateSpellInfo(SpellIds.DeathStrikeHeal, SpellIds.BloodShieldMastery, SpellIds.BloodShieldAbsorb, SpellIds.RecentlyUsedDeathStrike, SpellIds.Frost, SpellIds.DeathStrikeOffhand);
|
||||
}
|
||||
|
||||
void HandleHeal(uint effIndex)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
//TODO: heal = Math.Min(10% health, 20% of all damage taken in last 5 seconds)
|
||||
//Todo: heal = std::min(10% health, 20% of all damage taken in last 5 seconds)
|
||||
int heal = (int)MathFunctions.CalculatePct(caster.GetMaxHealth(), GetSpellInfo().GetEffect(4).CalcValue());
|
||||
caster.CastCustomSpell(SpellIds.DeathStrikeHeal, SpellValueMod.BasePoint0, heal, caster, true);
|
||||
|
||||
@@ -461,14 +458,14 @@ namespace Scripts.Spells.DeathKnight
|
||||
return ValidateSpellInfo(SpellIds.FesteringWound);
|
||||
}
|
||||
|
||||
void HandleDummy(uint effIndex)
|
||||
void HandleScriptEffect(uint effIndex)
|
||||
{
|
||||
GetCaster().CastCustomSpell(SpellIds.FesteringWound, SpellValueMod.AuraStack, GetEffectValue(), GetHitUnit(), TriggerCastFlags.FullMask);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 2, SpellEffectName.Dummy));
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleScriptEffect, 2, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -544,7 +541,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 121916 - Glyph of the Geist (Unholy) // 6.x, does this belong here or in spell_generic? apply this in creature_template_addon? sniffs say this is always cast on raise dead.
|
||||
[Script] // 121916 - Glyph of the Geist (Unholy)
|
||||
class spell_dk_pet_geist_transform : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
@@ -573,7 +570,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 147157 Glyph of the Skeleton (Unholy) // 6.x, does this belong here or in spell_generic? apply this in creature_template_addon? sniffs say this is always cast on raise dead.
|
||||
[Script] // 147157 Glyph of the Skeleton (Unholy)
|
||||
class spell_dk_pet_skeleton_transform : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
@@ -597,7 +594,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 61257 - Runic Power Back on Snare/Root 7.1.5
|
||||
[Script] // 61257 - Runic Power Back on Snare/Root
|
||||
class spell_dk_pvp_4p_bonus : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
@@ -650,26 +647,6 @@ namespace Scripts.Spells.DeathKnight
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 115994 - Unholy Blight
|
||||
class spell_dk_unholy_blight : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.FrostFever, SpellIds.BloodPlague);
|
||||
}
|
||||
|
||||
void HandleDummy(uint effIndex)
|
||||
{
|
||||
GetCaster().CastSpell(GetHitUnit(), SpellIds.FrostFever, true);
|
||||
GetCaster().CastSpell(GetHitUnit(), SpellIds.BloodPlague, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 55233 - Vampiric Blood
|
||||
class spell_dk_vampiric_blood : AuraScript
|
||||
{
|
||||
@@ -683,4 +660,4 @@ namespace Scripts.Spells.DeathKnight
|
||||
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalculateAmount, 1, AuraType.ModIncreaseHealth2));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ namespace Scripts.Spells.DemonHunter
|
||||
}
|
||||
|
||||
[Script] // 197125 - Chaos Strike
|
||||
class spell_dh_chaos_strike_AuraScript : AuraScript
|
||||
class spell_dh_chaos_strike : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
|
||||
+411
-307
@@ -30,9 +30,10 @@ namespace Scripts.Spells.Druid
|
||||
public const uint BalanceT10Bonus = 70718;
|
||||
public const uint BalanceT10BonusProc = 70721;
|
||||
public const uint BlessingOfTheClaw = 28750;
|
||||
public const uint BlessingOfTheRemulos = 40445;
|
||||
public const uint BlessingOfTheElune = 40446;
|
||||
public const uint BlessingOfTheCenarius = 40452;
|
||||
public const uint BlessingOfRemulos = 40445;
|
||||
public const uint BlessingOfElune = 40446;
|
||||
public const uint BlessingOfCenarius = 40452;
|
||||
public const uint CatForm = 768;
|
||||
public const uint Exhilarate = 28742;
|
||||
public const uint FeralChargeBear = 16979;
|
||||
public const uint FeralChargeCat = 49376;
|
||||
@@ -45,18 +46,23 @@ namespace Scripts.Spells.Druid
|
||||
public const uint FormsTrinketMoonkin = 37343;
|
||||
public const uint FormsTrinketNone = 37344;
|
||||
public const uint FormsTrinketTree = 37342;
|
||||
public const uint GoreProc = 93622;
|
||||
public const uint IdolOfFeralShadows = 34241;
|
||||
public const uint IdolOfWorship = 60774;
|
||||
public const uint IncarnationKingOfTheJungle = 102543;
|
||||
public const uint Infusion = 37238;
|
||||
public const uint Languish = 71023;
|
||||
public const uint LifebloomEnergize = 64372;
|
||||
public const uint LifebloomFinalHeal = 33778;
|
||||
public const uint LivingSeedHeal = 48503;
|
||||
public const uint LivingSeedProc = 48504;
|
||||
public const uint Mangle = 33917;
|
||||
public const uint MoonfireDamage = 164812;
|
||||
public const uint RejuvenationT10Proc = 70691;
|
||||
public const uint RestorationT102PBonus = 70658;
|
||||
public const uint SavageRoar = 62071;
|
||||
public const uint SkullBashCharge = 221514;
|
||||
public const uint SkullBashInterrupt = 93985;
|
||||
public const uint StampedeBearRank1 = 81016;
|
||||
public const uint StampedeCatRank1 = 81021;
|
||||
public const uint StampedeCatState = 109881;
|
||||
@@ -81,6 +87,54 @@ namespace Scripts.Spells.Druid
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 22568 - Ferocious Bite
|
||||
class spell_dru_ferocious_bite : SpellScript
|
||||
{
|
||||
float _damageMultiplier = 0.0f;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.IncarnationKingOfTheJungle)
|
||||
&& Global.SpellMgr.GetSpellInfo(SpellIds.IncarnationKingOfTheJungle, Difficulty.None).GetEffect(1) != null;
|
||||
}
|
||||
|
||||
void HandleHitTargetBurn(uint effIndex)
|
||||
{
|
||||
int newValue = (int)((float)GetEffectValue() * _damageMultiplier);
|
||||
SetEffectValue(newValue);
|
||||
}
|
||||
|
||||
void HandleHitTargetDmg(uint effIndex)
|
||||
{
|
||||
int newValue = (int)((float)GetHitDamage() * (1.0f + _damageMultiplier));
|
||||
SetHitDamage(newValue);
|
||||
}
|
||||
|
||||
void HandleLaunchTarget(uint effIndex)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
|
||||
int maxExtraConsumedPower = GetEffectValue();
|
||||
|
||||
AuraEffect auraEffect = caster.GetAuraEffect(SpellIds.IncarnationKingOfTheJungle, 1);
|
||||
if (auraEffect != null)
|
||||
{
|
||||
float multiplier = 1.0f + (float)auraEffect.GetAmount() / 100.0f;
|
||||
maxExtraConsumedPower = (int)((float)maxExtraConsumedPower * multiplier);
|
||||
SetEffectValue(maxExtraConsumedPower);
|
||||
}
|
||||
|
||||
_damageMultiplier = Math.Min(caster.GetPower(PowerType.Energy), maxExtraConsumedPower) / maxExtraConsumedPower;
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectLaunchTarget .Add(new EffectHandler(HandleLaunchTarget, 1, SpellEffectName.PowerBurn));
|
||||
OnEffectHitTarget .Add(new EffectHandler(HandleHitTargetBurn, 1, SpellEffectName.PowerBurn));
|
||||
OnEffectHitTarget .Add(new EffectHandler(HandleHitTargetDmg, 0, SpellEffectName.SchoolDamage));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 33943 - Flight Form
|
||||
class spell_dru_flight_form : SpellScript
|
||||
{
|
||||
@@ -131,7 +185,7 @@ namespace Scripts.Spells.Druid
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit target = eventInfo.GetActor();
|
||||
uint triggerspell = 0;
|
||||
uint triggerspell;
|
||||
|
||||
switch (target.GetShapeshiftForm())
|
||||
{
|
||||
@@ -165,7 +219,34 @@ namespace Scripts.Spells.Druid
|
||||
}
|
||||
}
|
||||
|
||||
// 34246 - Idol of the Emerald Queen
|
||||
[Script] // 210706 - Gore
|
||||
class spell_dru_gore : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.GoreProc, SpellIds.Mangle);
|
||||
}
|
||||
|
||||
bool CheckEffectProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
return RandomHelper.randChance(aurEff.GetAmount());
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo procInfo)
|
||||
{
|
||||
Unit owner = GetTarget();
|
||||
owner.CastSpell(owner, SpellIds.GoreProc);
|
||||
owner.GetSpellHistory().ResetCooldown(SpellIds.Mangle, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckEffectProc .Add(new CheckEffectProcHandler(CheckEffectProc, 0, AuraType.Dummy));
|
||||
OnEffectProc .Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
// 34246 - Idol of the Emerald Queen
|
||||
[Script] // 60779 - Idol of Lush Moss
|
||||
class spell_dru_idol_lifebloom : AuraScript
|
||||
{
|
||||
@@ -188,8 +269,7 @@ namespace Scripts.Spells.Druid
|
||||
}
|
||||
}
|
||||
|
||||
// 29166 - Innervate
|
||||
[Script]
|
||||
[Script] // 29166 - Innervate
|
||||
class spell_dru_innervate : AuraScript
|
||||
{
|
||||
void CalculateAmount(AuraEffect aurEff, ref int amount, ref bool canBeRecalculated)
|
||||
@@ -207,8 +287,56 @@ namespace Scripts.Spells.Druid
|
||||
}
|
||||
}
|
||||
|
||||
// 33763 - Lifebloom
|
||||
[Script]
|
||||
[Script] // 40442 - Druid Tier 6 Trinket
|
||||
class spell_dru_item_t6_trinket : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.BlessingOfRemulos, SpellIds.BlessingOfElune, SpellIds.BlessingOfCenarius);
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
SpellInfo spellInfo = eventInfo.GetSpellInfo();
|
||||
if (spellInfo == null)
|
||||
return;
|
||||
|
||||
uint spellId;
|
||||
int chance;
|
||||
|
||||
// Starfire
|
||||
if (spellInfo.SpellFamilyFlags[0].HasAnyFlag(0x00000004u))
|
||||
{
|
||||
spellId = SpellIds.BlessingOfRemulos;
|
||||
chance = 25;
|
||||
}
|
||||
// Rejuvenation
|
||||
else if (spellInfo.SpellFamilyFlags[0].HasAnyFlag(0x00000010u))
|
||||
{
|
||||
spellId = SpellIds.BlessingOfElune;
|
||||
chance = 25;
|
||||
}
|
||||
// Mangle (Bear) and Mangle (Cat)
|
||||
else if (spellInfo.SpellFamilyFlags[1].HasAnyFlag(0x00000440u))
|
||||
{
|
||||
spellId = SpellIds.BlessingOfCenarius;
|
||||
chance = 40;
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
if (RandomHelper.randChance(chance))
|
||||
eventInfo.GetActor().CastSpell((Unit)null, spellId, true, null, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc .Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 33763 - Lifebloom
|
||||
class spell_dru_lifebloom : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spell)
|
||||
@@ -234,11 +362,11 @@ namespace Scripts.Spells.Druid
|
||||
GetTarget().CastCustomSpell(GetTarget(), SpellIds.LifebloomFinalHeal, (int)healAmount, 0, 0, true, null, aurEff, GetCasterGUID());
|
||||
|
||||
// restore mana
|
||||
var costs = GetSpellInfo().CalcPowerCost(caster, GetSpellInfo().GetSchoolMask());
|
||||
var m = costs.Find(cost => cost.Power == PowerType.Mana);
|
||||
if (m != null)
|
||||
var spellPowerCostList = GetSpellInfo().CalcPowerCost(caster, GetSpellInfo().GetSchoolMask());
|
||||
var spellPowerCost = spellPowerCostList.Find(cost => cost.Power == PowerType.Mana);
|
||||
if (spellPowerCost != null)
|
||||
{
|
||||
int returnMana = m.Amount * (int)stack / 2;
|
||||
int returnMana = spellPowerCost.Amount * (int)stack / 2;
|
||||
caster.CastCustomSpell(caster, SpellIds.LifebloomEnergize, returnMana, 0, 0, true, null, aurEff, GetCasterGUID());
|
||||
}
|
||||
return;
|
||||
@@ -265,11 +393,11 @@ namespace Scripts.Spells.Druid
|
||||
target.CastCustomSpell(target, SpellIds.LifebloomFinalHeal, (int)healAmount, 0, 0, true, null, null, GetCasterGUID());
|
||||
|
||||
// restore mana
|
||||
var costs = GetSpellInfo().CalcPowerCost(caster, GetSpellInfo().GetSchoolMask());
|
||||
var m = costs.Find(cost => cost.Power == PowerType.Mana);
|
||||
if (m != null)
|
||||
var spellPowerCostList = GetSpellInfo().CalcPowerCost(caster, GetSpellInfo().GetSchoolMask());
|
||||
var spellPowerCost = spellPowerCostList.Find(cost => cost.Power == PowerType.Mana);
|
||||
if (spellPowerCost != null)
|
||||
{
|
||||
int returnMana = m.Amount * dispelInfo.GetRemovedCharges() / 2;
|
||||
int returnMana = spellPowerCost.Amount * dispelInfo.GetRemovedCharges() / 2;
|
||||
caster.CastCustomSpell(caster, SpellIds.LifebloomEnergize, returnMana, 0, 0, true, null, null, GetCasterGUID());
|
||||
}
|
||||
return;
|
||||
@@ -287,8 +415,7 @@ namespace Scripts.Spells.Druid
|
||||
}
|
||||
}
|
||||
|
||||
// 48496 - Living Seed
|
||||
[Script]
|
||||
[Script] // 48496 - Living Seed
|
||||
class spell_dru_living_seed : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
@@ -309,8 +436,7 @@ namespace Scripts.Spells.Druid
|
||||
}
|
||||
}
|
||||
|
||||
// 48504 - Living Seed (Proc)
|
||||
[Script]
|
||||
[Script] // 48504 - Living Seed (Proc)
|
||||
class spell_dru_living_seed_proc : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
@@ -344,8 +470,28 @@ namespace Scripts.Spells.Druid
|
||||
}
|
||||
}
|
||||
|
||||
// 16972 - Predatory Strikes
|
||||
[Script]
|
||||
[Script] // 16864 - Omen of Clarity
|
||||
class spell_dru_omen_of_clarity : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.BalanceT10Bonus, SpellIds.BalanceT10BonusProc);
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
Unit target = GetTarget();
|
||||
if (target.HasAura(SpellIds.BalanceT10Bonus))
|
||||
target.CastSpell((Unit)null, SpellIds.BalanceT10BonusProc, true, null);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc .Add(new EffectProcHandler(HandleProc, 0, AuraType.ProcTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 16972 - Predatory Strikes
|
||||
class spell_dru_predatory_strikes : AuraScript
|
||||
{
|
||||
void UpdateAmount(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
@@ -362,8 +508,28 @@ namespace Scripts.Spells.Druid
|
||||
}
|
||||
}
|
||||
|
||||
// 1079 - Rip
|
||||
[Script]
|
||||
[Script] // 5215 - Prowl
|
||||
class spell_dru_prowl : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.CatForm);
|
||||
}
|
||||
|
||||
void HandleOnCast()
|
||||
{
|
||||
// Change into cat form
|
||||
if (GetCaster().GetShapeshiftForm() != ShapeShiftForm.CatForm)
|
||||
GetCaster().CastSpell(GetCaster(), SpellIds.CatForm);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
BeforeCast .Add(new CastHandler(HandleOnCast));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 1079 - Rip
|
||||
class spell_dru_rip : AuraScript
|
||||
{
|
||||
public override bool Load()
|
||||
@@ -400,29 +566,7 @@ namespace Scripts.Spells.Druid
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 16864 - Omen of Clarity
|
||||
class spell_dru_omen_of_clarity : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.BalanceT10Bonus, SpellIds.BalanceT10BonusProc);
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
Unit target = GetTarget();
|
||||
if (target.HasAura(SpellIds.BalanceT10Bonus))
|
||||
target.CastSpell((Unit)null, SpellIds.BalanceT10BonusProc, true, null);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.ProcTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
// 52610 - Savage Roar
|
||||
[Script]
|
||||
[Script] // 52610 - Savage Roar
|
||||
class spell_dru_savage_roar : SpellScript
|
||||
{
|
||||
SpellCastResult CheckCast()
|
||||
@@ -466,6 +610,26 @@ namespace Scripts.Spells.Druid
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 106839 - Skull Bash
|
||||
class spell_dru_skull_bash : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.SkullBashCharge, SpellIds.SkullBashInterrupt);
|
||||
}
|
||||
|
||||
void HandleDummy(uint effIndex)
|
||||
{
|
||||
GetCaster().CastSpell(GetHitUnit(), SpellIds.SkullBashCharge, true);
|
||||
GetCaster().CastSpell(GetHitUnit(), SpellIds.SkullBashInterrupt, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget .Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 78892 - Stampede
|
||||
class spell_dru_stampede : AuraScript
|
||||
{
|
||||
@@ -500,8 +664,7 @@ namespace Scripts.Spells.Druid
|
||||
}
|
||||
}
|
||||
|
||||
// 50286 - Starfall (Dummy)
|
||||
[Script]
|
||||
[Script] // 50286 - Starfall (Dummy)
|
||||
class spell_dru_starfall_dummy : SpellScript
|
||||
{
|
||||
void FilterTargets(List<WorldObject> targets)
|
||||
@@ -549,8 +712,7 @@ namespace Scripts.Spells.Druid
|
||||
}
|
||||
}
|
||||
|
||||
// 61336 - Survival Instincts
|
||||
[Script]
|
||||
[Script] // 61336 - Survival Instincts
|
||||
class spell_dru_survival_instincts : SpellScript
|
||||
{
|
||||
SpellCastResult CheckCast()
|
||||
@@ -579,24 +741,16 @@ namespace Scripts.Spells.Druid
|
||||
void AfterApply(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
Unit target = GetTarget();
|
||||
int bp0 = (int)target.CountPctFromMaxHealth(aurEff.GetAmount());
|
||||
target.CastCustomSpell(target, SpellIds.SurvivalInstincts, bp0, 0, 0, true);
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
GetTarget().RemoveAurasDueToSpell(SpellIds.SurvivalInstincts);
|
||||
target.CastSpell(target, SpellIds.SurvivalInstincts, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectApply.Add(new EffectApplyHandler(AfterApply, 0, AuraType.Dummy, AuraEffectHandleModes.ChangeAmountMask));
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(AfterRemove, 0, AuraType.Dummy, AuraEffectHandleModes.ChangeAmountMask));
|
||||
}
|
||||
}
|
||||
|
||||
// 40121 - Swift Flight Form (Passive)
|
||||
[Script]
|
||||
[Script] // 40121 - Swift Flight Form (Passive)
|
||||
class spell_dru_swift_flight_passive : AuraScript
|
||||
{
|
||||
public override bool Load()
|
||||
@@ -654,12 +808,12 @@ namespace Scripts.Spells.Druid
|
||||
return;
|
||||
|
||||
Unit caster = eventInfo.GetActor();
|
||||
var costs = spell.GetPowerCost();
|
||||
var m = costs.First(cost => cost.Power == PowerType.Mana);
|
||||
if (m == null)
|
||||
var spellPowerCostList = spell.GetPowerCost();
|
||||
var spellPowerCost = spellPowerCostList.First(cost => cost.Power == PowerType.Mana);
|
||||
if (spellPowerCost == null)
|
||||
return;
|
||||
|
||||
int amount = MathFunctions.CalculatePct(m.Amount, aurEff.GetAmount());
|
||||
int amount = MathFunctions.CalculatePct(spellPowerCost.Amount, aurEff.GetAmount());
|
||||
caster.CastCustomSpell(SpellIds.Exhilarate, SpellValueMod.BasePoint0, amount, null, true, null, aurEff);
|
||||
}
|
||||
|
||||
@@ -669,7 +823,7 @@ namespace Scripts.Spells.Druid
|
||||
}
|
||||
}
|
||||
|
||||
// 37288 - Mana Restore
|
||||
// 37288 - Mana Restore
|
||||
[Script] // 37295 - Mana Restore
|
||||
class spell_dru_t4_2p_bonus : AuraScript
|
||||
{
|
||||
@@ -690,6 +844,194 @@ namespace Scripts.Spells.Druid
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 70723 - Item - Druid T10 Balance 4P Bonus
|
||||
class spell_dru_t10_balance_4p_bonus : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.Languish);
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
DamageInfo damageInfo = eventInfo.GetDamageInfo();
|
||||
if (damageInfo == null || damageInfo.GetDamage() == 0)
|
||||
return;
|
||||
|
||||
Unit caster = eventInfo.GetActor();
|
||||
Unit target = eventInfo.GetProcTarget();
|
||||
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.Languish, GetCastDifficulty());
|
||||
int amount = (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount());
|
||||
amount /= (int)spellInfo.GetMaxTicks();
|
||||
// Add remaining ticks to damage done
|
||||
amount += (int)target.GetRemainingPeriodicAmount(caster.GetGUID(), SpellIds.Languish, AuraType.PeriodicDamage);
|
||||
|
||||
caster.CastCustomSpell(SpellIds.Languish, SpellValueMod.BasePoint0, amount, target, true, null, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc .Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 70691 - Item T10 Restoration 4P Bonus
|
||||
class spell_dru_t10_restoration_4p_bonus : SpellScript
|
||||
{
|
||||
public override bool Load()
|
||||
{
|
||||
return GetCaster().IsTypeId(TypeId.Player);
|
||||
}
|
||||
|
||||
void FilterTargets(List<WorldObject> targets)
|
||||
{
|
||||
if (!GetCaster().ToPlayer().GetGroup())
|
||||
{
|
||||
targets.Clear();
|
||||
targets.Add(GetCaster());
|
||||
}
|
||||
else
|
||||
{
|
||||
targets.Remove(GetExplTargetUnit());
|
||||
List<Unit> tempTargets = new List<Unit>();
|
||||
foreach (var obj in targets)
|
||||
if (obj.IsTypeId(TypeId.Player) && GetCaster().IsInRaidWith(obj.ToUnit()))
|
||||
tempTargets.Add(obj.ToUnit());
|
||||
|
||||
if (tempTargets.Empty())
|
||||
{
|
||||
targets.Clear();
|
||||
FinishCast(SpellCastResult.DontReport);
|
||||
return;
|
||||
}
|
||||
|
||||
Unit target = tempTargets.SelectRandom();
|
||||
targets.Clear();
|
||||
targets.Add(target);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect .Add(new ObjectAreaTargetSelectHandler(FilterTargets, 0, Targets.UnitDestAreaAlly));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 70664 - Druid T10 Restoration 4P Bonus (Rejuvenation)
|
||||
class spell_dru_t10_restoration_4p_bonus_dummy : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.RejuvenationT10Proc);
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo eventInfo)
|
||||
{
|
||||
SpellInfo spellInfo = eventInfo.GetSpellInfo();
|
||||
if (spellInfo == null || spellInfo.Id == SpellIds.RejuvenationT10Proc)
|
||||
return false;
|
||||
|
||||
HealInfo healInfo = eventInfo.GetHealInfo();
|
||||
if (healInfo == null || healInfo.GetHeal() == 0)
|
||||
return false;
|
||||
|
||||
Player caster = eventInfo.GetActor().ToPlayer();
|
||||
if (!caster)
|
||||
return false;
|
||||
|
||||
return caster.GetGroup() || caster != eventInfo.GetProcTarget();
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
int amount = (int)eventInfo.GetHealInfo().GetHeal();
|
||||
eventInfo.GetActor().CastCustomSpell(SpellIds.RejuvenationT10Proc, SpellValueMod.BasePoint0, amount, null, true, null, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc .Add(new CheckProcHandler(CheckProc));
|
||||
OnEffectProc .Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
// 1066 - Aquatic Form
|
||||
// 33943 - Flight Form
|
||||
// 40120 - Swift Flight Form
|
||||
[Script] // 165961 - Stag Form
|
||||
class spell_dru_travel_form_AuraScript : AuraScript
|
||||
{
|
||||
uint triggeredSpellId;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.FormStag, SpellIds.FormAquatic, SpellIds.FormFlight, SpellIds.FormSwiftFlight);
|
||||
}
|
||||
|
||||
public override bool Load()
|
||||
{
|
||||
return GetCaster().GetTypeId() == TypeId.Player;
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
// If it stays 0, it Removes Travel Form dummy in AfterRemove.
|
||||
triggeredSpellId = 0;
|
||||
|
||||
// We should only handle aura interrupts.
|
||||
if (GetTargetApplication().GetRemoveMode() != AuraRemoveMode.Interrupt)
|
||||
return;
|
||||
|
||||
// Check what form is appropriate
|
||||
Player player = GetTarget().ToPlayer();
|
||||
if (player.IsInWater()) // Aquatic form
|
||||
triggeredSpellId = SpellIds.FormAquatic;
|
||||
else if (player.GetSkillValue(SkillType.Riding) >= 225 && CheckLocationForForm(SpellIds.FormFlight) == SpellCastResult.SpellCastOk) // Flight form
|
||||
triggeredSpellId = player.GetSkillValue(SkillType.Riding) >= 300 ? SpellIds.FormSwiftFlight : SpellIds.FormFlight;
|
||||
else if (CheckLocationForForm(SpellIds.FormStag) == SpellCastResult.SpellCastOk) // Stag form
|
||||
triggeredSpellId = SpellIds.FormStag;
|
||||
|
||||
// If chosen form is current aura, just don't Remove it.
|
||||
if (triggeredSpellId == m_scriptSpellId)
|
||||
PreventDefaultAction();
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
if (triggeredSpellId == m_scriptSpellId)
|
||||
return;
|
||||
|
||||
Player player = GetTarget().ToPlayer();
|
||||
|
||||
if (triggeredSpellId != 0) // Apply new form
|
||||
player.AddAura(triggeredSpellId, player);
|
||||
else // If not set, simply Remove Travel Form dummy
|
||||
player.RemoveAura(SpellIds.TravelForm);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectRemove.Add(new EffectApplyHandler(OnRemove, 0, AuraType.ModShapeshift, AuraEffectHandleModes.Real));
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(AfterRemove, 0, AuraType.ModShapeshift, AuraEffectHandleModes.Real));
|
||||
}
|
||||
|
||||
SpellCastResult CheckLocationForForm(uint spellId)
|
||||
{
|
||||
Player player = GetTarget().ToPlayer();
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spellId, GetCastDifficulty());
|
||||
|
||||
if (!player.GetMap().IsOutdoors(player.GetPhaseShift(), player.GetPositionX(), player.GetPositionY(), player.GetPositionZ()))
|
||||
return SpellCastResult.OnlyOutdoors;
|
||||
|
||||
return spellInfo.CheckLocation(player.GetMapId(), player.GetZoneId(), player.GetAreaId(), player);
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 783 - Travel Form (dummy)
|
||||
class spell_dru_travel_form_dummy_SpellScript : SpellScript
|
||||
{
|
||||
@@ -764,247 +1106,11 @@ namespace Scripts.Spells.Druid
|
||||
}
|
||||
}
|
||||
|
||||
// 1066 - Aquatic Form
|
||||
// 33943 - Flight Form
|
||||
// 40120 - Swift Flight Form
|
||||
[Script] // 165961 - Stag Form
|
||||
class spell_dru_travel_form_AuraScript : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.FormStag, SpellIds.FormAquatic, SpellIds.FormFlight, SpellIds.FormSwiftFlight);
|
||||
}
|
||||
|
||||
public override bool Load()
|
||||
{
|
||||
return GetCaster().GetTypeId() == TypeId.Player;
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
// If it stays 0, it Removes Travel Form dummy in AfterRemove.
|
||||
triggeredSpellId = 0;
|
||||
|
||||
// We should only handle aura interrupts.
|
||||
if (GetTargetApplication().GetRemoveMode() != AuraRemoveMode.Interrupt)
|
||||
return;
|
||||
|
||||
// Check what form is appropriate
|
||||
Player player = GetTarget().ToPlayer();
|
||||
if (player.IsInWater()) // Aquatic form
|
||||
triggeredSpellId = SpellIds.FormAquatic;
|
||||
else if (player.GetSkillValue(SkillType.Riding) >= 225 && CheckLocationForForm(SpellIds.FormFlight) == SpellCastResult.SpellCastOk) // Flight form
|
||||
triggeredSpellId = player.GetSkillValue(SkillType.Riding) >= 300 ? SpellIds.FormSwiftFlight : SpellIds.FormFlight;
|
||||
else if (CheckLocationForForm(SpellIds.FormStag) == SpellCastResult.SpellCastOk) // Stag form
|
||||
triggeredSpellId = SpellIds.FormStag;
|
||||
|
||||
// If chosen form is current aura, just don't Remove it.
|
||||
if (triggeredSpellId == m_scriptSpellId)
|
||||
PreventDefaultAction();
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
if (triggeredSpellId == m_scriptSpellId)
|
||||
return;
|
||||
|
||||
Player player = GetTarget().ToPlayer();
|
||||
|
||||
if (triggeredSpellId != 0) // Apply new form
|
||||
player.AddAura(triggeredSpellId, player);
|
||||
else // If not set, simply Remove Travel Form dummy
|
||||
player.RemoveAura(SpellIds.TravelForm);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectRemove.Add(new EffectApplyHandler(OnRemove, 0, AuraType.ModShapeshift, AuraEffectHandleModes.Real));
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(AfterRemove, 0, AuraType.ModShapeshift, AuraEffectHandleModes.Real));
|
||||
}
|
||||
|
||||
SpellCastResult CheckLocationForForm(uint spell_id)
|
||||
{
|
||||
Player player = GetTarget().ToPlayer();
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spell_id, GetCastDifficulty());
|
||||
|
||||
if (!player.GetMap().IsOutdoors(player.GetPhaseShift(), player.GetPositionX(), player.GetPositionY(), player.GetPositionZ()))
|
||||
return SpellCastResult.OnlyOutdoors;
|
||||
|
||||
return spellInfo.CheckLocation(player.GetMapId(), player.GetZoneId(), player.GetAreaId(), player);
|
||||
}
|
||||
|
||||
uint triggeredSpellId;
|
||||
}
|
||||
|
||||
[Script] // 40442 - Druid Tier 6 Trinket
|
||||
class spell_dru_item_t6_trinket : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.BlessingOfTheRemulos, SpellIds.BlessingOfTheElune, SpellIds.BlessingOfTheCenarius);
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
SpellInfo spellInfo = eventInfo.GetSpellInfo();
|
||||
if (spellInfo == null)
|
||||
return;
|
||||
|
||||
uint spellId;
|
||||
int chance;
|
||||
|
||||
// Starfire
|
||||
if (spellInfo.SpellFamilyFlags[0].HasAnyFlag(0x00000004u))
|
||||
{
|
||||
spellId = SpellIds.BlessingOfTheRemulos;
|
||||
chance = 25;
|
||||
}
|
||||
// Rejuvenation
|
||||
else if (spellInfo.SpellFamilyFlags[0].HasAnyFlag(0x00000010u))
|
||||
{
|
||||
spellId = SpellIds.BlessingOfTheElune;
|
||||
chance = 25;
|
||||
}
|
||||
// Mangle (Bear) and Mangle (Cat)
|
||||
else if (spellInfo.SpellFamilyFlags[1].HasAnyFlag(0x00000440u))
|
||||
{
|
||||
spellId = SpellIds.BlessingOfTheCenarius;
|
||||
chance = 40;
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
if (RandomHelper.randChance(chance))
|
||||
eventInfo.GetActor().CastSpell((Unit)null, spellId, true, null, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 70723 - Item - Druid T10 Balance 4P Bonus
|
||||
class spell_dru_t10_balance_4p_bonus : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.Languish);
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
DamageInfo damageInfo = eventInfo.GetDamageInfo();
|
||||
if (damageInfo == null || damageInfo.GetDamage() == 0)
|
||||
return;
|
||||
|
||||
Unit caster = eventInfo.GetActor();
|
||||
Unit target = eventInfo.GetProcTarget();
|
||||
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.Languish, GetCastDifficulty());
|
||||
int amount = (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount());
|
||||
amount /= (int)spellInfo.GetMaxTicks();
|
||||
// Add remaining ticks to damage done
|
||||
amount += (int)target.GetRemainingPeriodicAmount(caster.GetGUID(), SpellIds.Languish, AuraType.PeriodicDamage);
|
||||
|
||||
caster.CastCustomSpell(SpellIds.Languish, SpellValueMod.BasePoint0, amount, target, true, null, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
// 70691 - Item T10 Restoration 4P Bonus
|
||||
[Script]
|
||||
class spell_dru_t10_restoration_4p_bonus : SpellScript
|
||||
{
|
||||
public override bool Load()
|
||||
{
|
||||
return GetCaster().IsTypeId(TypeId.Player);
|
||||
}
|
||||
|
||||
void FilterTargets(List<WorldObject> targets)
|
||||
{
|
||||
if (GetCaster().ToPlayer().GetGroup() == null)
|
||||
{
|
||||
targets.Clear();
|
||||
targets.Add(GetCaster());
|
||||
}
|
||||
else
|
||||
{
|
||||
targets.Remove(GetExplTargetUnit());
|
||||
List<Unit> tempTargets = new List<Unit>();
|
||||
foreach (var obj in targets)
|
||||
if (obj.IsTypeId(TypeId.Player) && GetCaster().IsInRaidWith(obj.ToUnit()))
|
||||
tempTargets.Add(obj.ToUnit());
|
||||
|
||||
if (tempTargets.Empty())
|
||||
{
|
||||
targets.Clear();
|
||||
FinishCast(SpellCastResult.DontReport);
|
||||
return;
|
||||
}
|
||||
|
||||
Unit target = tempTargets.SelectRandom();
|
||||
targets.Clear();
|
||||
targets.Add(target);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(FilterTargets, 0, Targets.UnitDestAreaAlly));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 70664 - Druid T10 Restoration 4P Bonus (Rejuvenation)
|
||||
class spell_dru_t10_restoration_4p_bonus_dummy : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.RejuvenationT10Proc);
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo eventInfo)
|
||||
{
|
||||
SpellInfo spellInfo = eventInfo.GetSpellInfo();
|
||||
if (spellInfo == null || spellInfo.Id == SpellIds.RejuvenationT10Proc)
|
||||
return false;
|
||||
|
||||
HealInfo healInfo = eventInfo.GetHealInfo();
|
||||
if (healInfo == null || healInfo.GetHeal() == 0)
|
||||
return false;
|
||||
|
||||
Player caster = eventInfo.GetActor().ToPlayer();
|
||||
if (!caster)
|
||||
return false;
|
||||
|
||||
return caster.GetGroup() || caster != eventInfo.GetProcTarget();
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
int amount = (int)eventInfo.GetHealInfo().GetHeal();
|
||||
eventInfo.GetActor().CastCustomSpell(SpellIds.RejuvenationT10Proc, SpellValueMod.BasePoint0, amount, null, true, null, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new CheckProcHandler(CheckProc));
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 48438 - Wild Growth
|
||||
class spell_dru_wild_growth : SpellScript
|
||||
{
|
||||
List<WorldObject> _targets;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
SpellEffectInfo effectInfo = spellInfo.GetEffect(2);
|
||||
@@ -1046,8 +1152,6 @@ namespace Scripts.Spells.Druid
|
||||
OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(FilterTargets, 0, Targets.UnitDestAreaAlly));
|
||||
OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(SetTargets, 1, Targets.UnitDestAreaAlly));
|
||||
}
|
||||
|
||||
List<WorldObject> _targets;
|
||||
}
|
||||
|
||||
[Script]
|
||||
|
||||
@@ -150,6 +150,9 @@ namespace Scripts.Spells.Generic
|
||||
|
||||
public const uint MissEffect = 62977;
|
||||
|
||||
//MossCoveredFeet
|
||||
public const uint FallDown = 6869;
|
||||
|
||||
//Netherbloom
|
||||
public const uint NetherBloomPollen1 = 28703;
|
||||
|
||||
@@ -363,6 +366,8 @@ namespace Scripts.Spells.Generic
|
||||
[Script]
|
||||
class spell_gen_absorb0_hitlimit1 : AuraScript
|
||||
{
|
||||
int limit;
|
||||
|
||||
public override bool Load()
|
||||
{
|
||||
// Max absorb stored in 1 dummy effect
|
||||
@@ -379,8 +384,6 @@ namespace Scripts.Spells.Generic
|
||||
{
|
||||
OnEffectAbsorb.Add(new EffectAbsorbHandler(Absorb, 0));
|
||||
}
|
||||
|
||||
int limit;
|
||||
}
|
||||
|
||||
[Script] // 28764 - Adaptive Warding (Frostfire Regalia Set)
|
||||
@@ -415,7 +418,7 @@ namespace Scripts.Spells.Generic
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
uint spellId = 0;
|
||||
uint spellId;
|
||||
switch (SharedConst.GetFirstSchoolInMask(eventInfo.GetSchoolMask()))
|
||||
{
|
||||
case SpellSchools.Fire:
|
||||
@@ -501,7 +504,7 @@ namespace Scripts.Spells.Generic
|
||||
AuraEffect aurEff1 = aurEff.GetBase().GetEffect(1);
|
||||
if (aurEff1 != null)
|
||||
aurEff1.ChangeAmount(aurEff1.GetAmount() + 5);
|
||||
aurEff.SetAmount((int)(100 * aurEff.GetTickNumber()));
|
||||
aurEff.SetAmount(100 * (int)aurEff.GetTickNumber());
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
@@ -550,24 +553,13 @@ namespace Scripts.Spells.Generic
|
||||
{
|
||||
bool CheckAreaTarget(Unit target)
|
||||
{
|
||||
switch (target.GetEntry())
|
||||
return (target.GetEntry()) switch
|
||||
{
|
||||
// alliance
|
||||
case 14762: // Dun Baldar North Marshal
|
||||
case 14763: // Dun Baldar South Marshal
|
||||
case 14764: // Icewing Marshal
|
||||
case 14765: // Stonehearth Marshal
|
||||
case 11948: // Vandar Stormspike
|
||||
// horde
|
||||
case 14772: // East Frostwolf Warmaster
|
||||
case 14776: // Tower Point Warmaster
|
||||
case 14773: // Iceblood Warmaster
|
||||
case 14777: // West Frostwolf Warmaster
|
||||
case 11946: // Drek'thar
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
// Dun Baldar North Marshal
|
||||
14762 or 14763 or 14764 or 14765 or 11948 or 14772 or 14776 or 14773 or 14777 or 11946 => true,
|
||||
_ => false,
|
||||
};
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
@@ -1003,6 +995,8 @@ namespace Scripts.Spells.Generic
|
||||
[Script("spell_gen_50pct_count_pct_from_max_hp", 50)]
|
||||
class spell_gen_count_pct_from_max_hp : SpellScript
|
||||
{
|
||||
int _damagePct;
|
||||
|
||||
public spell_gen_count_pct_from_max_hp(int damagePct)
|
||||
{
|
||||
_damagePct = damagePct;
|
||||
@@ -1020,8 +1014,6 @@ namespace Scripts.Spells.Generic
|
||||
{
|
||||
OnHit.Add(new HitHandler(RecalculateDamage));
|
||||
}
|
||||
|
||||
int _damagePct;
|
||||
}
|
||||
|
||||
[Script] // 63845 - Create Lance
|
||||
@@ -1085,14 +1077,12 @@ namespace Scripts.Spells.Generic
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
switch (spellInfo.Id)
|
||||
return spellInfo.Id switch
|
||||
{
|
||||
case SpellIds.SunreaverTrigger:
|
||||
return ValidateSpellInfo(SpellIds.SunreaverFemale, SpellIds.SunreaverMale);
|
||||
case SpellIds.SilverCovenantTrigger:
|
||||
return ValidateSpellInfo(SpellIds.SilverCovenantFemale, SpellIds.SilverCovenantMale);
|
||||
}
|
||||
return false;
|
||||
SpellIds.SunreaverTrigger => ValidateSpellInfo(SpellIds.SunreaverFemale, SpellIds.SunreaverMale),
|
||||
SpellIds.SilverCovenantTrigger => ValidateSpellInfo(SpellIds.SilverCovenantFemale, SpellIds.SilverCovenantMale),
|
||||
_ => false,
|
||||
};
|
||||
}
|
||||
|
||||
void HandleScript(uint effIndex)
|
||||
@@ -1125,74 +1115,6 @@ namespace Scripts.Spells.Generic
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class spell_gen_defend : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.VisualShield1, SpellIds.VisualShield2, SpellIds.VisualShield3);
|
||||
}
|
||||
|
||||
void RefreshVisualShields(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
if (GetCaster())
|
||||
{
|
||||
Unit target = GetTarget();
|
||||
|
||||
for (byte i = 0; i < GetSpellInfo().StackAmount; ++i)
|
||||
target.RemoveAurasDueToSpell(SpellIds.VisualShield1 + i);
|
||||
|
||||
target.CastSpell(target, SpellIds.VisualShield1 + GetAura().GetStackAmount() - 1, true, null, aurEff);
|
||||
}
|
||||
else
|
||||
GetTarget().RemoveAurasDueToSpell(GetId());
|
||||
}
|
||||
|
||||
void RemoveVisualShields(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
for (byte i = 0; i < GetSpellInfo().StackAmount; ++i)
|
||||
GetTarget().RemoveAurasDueToSpell(SpellIds.VisualShield1 + i);
|
||||
}
|
||||
|
||||
void RemoveDummyFromDriver(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
if (caster)
|
||||
{
|
||||
TempSummon vehicle = caster.ToTempSummon();
|
||||
if (vehicle)
|
||||
{
|
||||
Unit rider = vehicle.GetSummoner();
|
||||
if (rider)
|
||||
rider.RemoveAurasDueToSpell(GetId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
/*SpellInfo spell = Global.SpellMgr.GetSpellInfo(m_scriptSpellId);
|
||||
|
||||
// Defend spells cast by NPCs (add visuals)
|
||||
if (spell.GetEffect(0).ApplyAuraName == AuraType.ModDamagePercentTaken)
|
||||
{
|
||||
AfterEffectApply.Add(new EffectApplyHandler(RefreshVisualShields, 0, AuraType.ModDamagePercentTaken, AuraEffectHandleModes.RealOrReapplyMask));
|
||||
OnEffectRemove.Add(new EffectApplyHandler(RemoveVisualShields, 0, AuraType.ModDamagePercentTaken, AuraEffectHandleModes.ChangeAmountMask));
|
||||
}
|
||||
|
||||
// Remove Defend spell from player when he dismounts
|
||||
if (spell.GetEffect(2).ApplyAuraName == AuraType.ModDamagePercentTaken)
|
||||
OnEffectRemove.Add(new EffectApplyHandler(RemoveDummyFromDriver, 2, AuraType.ModDamagePercentTaken, AuraEffectHandleModes.Real));
|
||||
|
||||
// Defend spells cast by players (add/Remove visuals)
|
||||
if (spell.GetEffect(1).ApplyAuraName == AuraType.Dummy)
|
||||
{
|
||||
AfterEffectApply.Add(new EffectApplyHandler(RefreshVisualShields, 1, AuraType.Dummy, AuraEffectHandleModes.RealOrReapplyMask));
|
||||
OnEffectRemove.Add(new EffectApplyHandler(RemoveVisualShields, 1, AuraType.Dummy, AuraEffectHandleModes.ChangeAmountMask));
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class spell_gen_despawn_self : SpellScript
|
||||
{
|
||||
@@ -1501,6 +1423,8 @@ namespace Scripts.Spells.Generic
|
||||
[Script("spell_faction_champion_dru_lifebloom", SpellIds.FactionChampionsDru)]
|
||||
class spell_gen_lifebloom : AuraScript
|
||||
{
|
||||
readonly uint _spellId;
|
||||
|
||||
public spell_gen_lifebloom(uint spellId)
|
||||
{
|
||||
_spellId = spellId;
|
||||
@@ -1525,8 +1449,6 @@ namespace Scripts.Spells.Generic
|
||||
{
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(AfterRemove, 0, AuraType.PeriodicHeal, AuraEffectHandleModes.Real));
|
||||
}
|
||||
|
||||
uint _spellId;
|
||||
}
|
||||
|
||||
[Script]
|
||||
@@ -1638,6 +1560,27 @@ namespace Scripts.Spells.Generic
|
||||
}
|
||||
}
|
||||
|
||||
// 6870 Moss Covered Feet
|
||||
[Script] // 31399 Moss Covered Feet
|
||||
class spell_gen_moss_covered_feet : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.FallDown);
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
eventInfo.GetActionTarget().CastSpell((Unit)null, SpellIds.FallDown, true, null, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 28702 - Netherbloom
|
||||
class spell_gen_netherbloom : SpellScript
|
||||
{
|
||||
@@ -1724,11 +1667,11 @@ namespace Scripts.Spells.Generic
|
||||
return true;
|
||||
}
|
||||
|
||||
void onProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
void OnProcEffect(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
uint spellId = 0;
|
||||
uint spellId;
|
||||
switch (SharedConst.GetFirstSchoolInMask(eventInfo.GetSchoolMask()))
|
||||
{
|
||||
case SpellSchools.Holy:
|
||||
@@ -1758,7 +1701,7 @@ namespace Scripts.Spells.Generic
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new CheckProcHandler(CheckProc));
|
||||
OnEffectProc.Add(new EffectProcHandler(onProc, 0, AuraType.Dummy));
|
||||
OnEffectProc.Add(new EffectProcHandler(OnProcEffect, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1824,7 +1767,7 @@ namespace Scripts.Spells.Generic
|
||||
}
|
||||
|
||||
// 35201 - Paralytic Poison
|
||||
class spell_gen_paralytic_poison_AuraScript : AuraScript
|
||||
class spell_gen_paralytic_poison : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
@@ -2232,7 +2175,9 @@ namespace Scripts.Spells.Generic
|
||||
|
||||
[Script]
|
||||
class spell_gen_spectator_cheer_trigger : SpellScript
|
||||
{
|
||||
{
|
||||
readonly static Emote[] EmoteArray = { Emote.OneshotCheer, Emote.OneshotExclamation, Emote.OneshotApplaud };
|
||||
|
||||
void HandleDummy(uint effIndex)
|
||||
{
|
||||
GetCaster().HandleEmoteCommand(EmoteArray[RandomHelper.URand(0, 2)]);
|
||||
@@ -2242,8 +2187,6 @@ namespace Scripts.Spells.Generic
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
|
||||
static Emote[] EmoteArray = { Emote.OneshotCheer, Emote.OneshotExclamation, Emote.OneshotApplaud };
|
||||
}
|
||||
|
||||
[Script]
|
||||
@@ -2276,6 +2219,8 @@ namespace Scripts.Spells.Generic
|
||||
[Script("spell_gen_summon_earth_elemental", SpellIds.SummonEarthElemental)]
|
||||
class spell_gen_summon_elemental : AuraScript
|
||||
{
|
||||
readonly uint _spellId;
|
||||
|
||||
public spell_gen_summon_elemental(uint spellId)
|
||||
{
|
||||
_spellId = spellId;
|
||||
@@ -2312,8 +2257,6 @@ namespace Scripts.Spells.Generic
|
||||
AfterEffectApply.Add(new EffectApplyHandler(AfterApply, 1, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(AfterRemove, 1, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
}
|
||||
|
||||
uint _spellId;
|
||||
}
|
||||
|
||||
[Script]
|
||||
@@ -2418,7 +2361,7 @@ namespace Scripts.Spells.Generic
|
||||
}
|
||||
|
||||
[Script]
|
||||
class spell_gen_trigger_exclude_caster_aura_spell_SpellScript : SpellScript
|
||||
class spell_gen_trigger_exclude_caster_aura_spell : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
@@ -2438,7 +2381,7 @@ namespace Scripts.Spells.Generic
|
||||
}
|
||||
|
||||
[Script]
|
||||
class spell_gen_trigger_exclude_target_aura_spell_SpellScript : SpellScript
|
||||
class spell_gen_trigger_exclude_target_aura_spell : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
@@ -2463,6 +2406,8 @@ namespace Scripts.Spells.Generic
|
||||
[Script("spell_wotf_shared_cd", SpellIds.WillOfTheForsakenCooldownTriggerWotf)]
|
||||
class spell_pvp_trinket_wotf_shared_cd : SpellScript
|
||||
{
|
||||
readonly uint _triggered;
|
||||
|
||||
public spell_pvp_trinket_wotf_shared_cd(uint triggered)
|
||||
{
|
||||
_triggered = triggered;
|
||||
@@ -2502,13 +2447,13 @@ namespace Scripts.Spells.Generic
|
||||
{
|
||||
AfterCast.Add(new CastHandler(HandleScript));
|
||||
}
|
||||
|
||||
uint _triggered;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class spell_gen_turkey_marker : AuraScript
|
||||
{
|
||||
readonly List<uint> _applyTimes = new List<uint>();
|
||||
|
||||
void OnApply(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
// store stack apply times, so we can pop them while they expire
|
||||
@@ -2535,13 +2480,14 @@ namespace Scripts.Spells.Generic
|
||||
AfterEffectApply.Add(new EffectApplyHandler(OnApply, 0, AuraType.PeriodicDummy, AuraEffectHandleModes.RealOrReapplyMask));
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(OnPeriodic, 0, AuraType.PeriodicDummy));
|
||||
}
|
||||
|
||||
List<uint> _applyTimes = new List<uint>();
|
||||
}
|
||||
|
||||
[Script]
|
||||
class spell_gen_upper_deck_create_foam_sword : SpellScript
|
||||
{
|
||||
// green pink blue red yellow
|
||||
readonly static uint[] itemId = { 45061, 45176, 45177, 45178, 45179 };
|
||||
|
||||
void HandleScript(uint effIndex)
|
||||
{
|
||||
Player player = GetHitPlayer();
|
||||
@@ -2562,9 +2508,6 @@ namespace Scripts.Spells.Generic
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleScript, 0, SpellEffectName.ScriptEffect));
|
||||
}
|
||||
|
||||
// green pink blue red yellow
|
||||
static uint[] itemId = { 45061, 45176, 45177, 45178, 45179 };
|
||||
}
|
||||
|
||||
// 52723 - Vampiric Touch
|
||||
@@ -2705,6 +2648,34 @@ namespace Scripts.Spells.Generic
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class spell_gen_eject_passenger : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
SpellEffectInfo effect = spellInfo.GetEffect(0);
|
||||
if (effect == null || effect.CalcValue() < 1)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void EjectPassenger(uint effIndex)
|
||||
{
|
||||
Vehicle vehicle = GetHitUnit().GetVehicleKit();
|
||||
if (vehicle != null)
|
||||
{
|
||||
Unit passenger = vehicle.GetPassenger((sbyte)(GetEffectValue() - 1));
|
||||
if (passenger)
|
||||
passenger.ExitVehicle();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(EjectPassenger, 0, SpellEffectName.ScriptEffect));
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class spell_gen_gm_freeze : AuraScript
|
||||
{
|
||||
@@ -2867,15 +2838,12 @@ namespace Scripts.Spells.Generic
|
||||
WeakTrollsBloodElixir = 3219,
|
||||
ElixirOfLionsStrength = 2367,
|
||||
ElixirOfMinorDefense = 673
|
||||
};
|
||||
}
|
||||
|
||||
[Script]
|
||||
class spell_gen_mixology_bonus : AuraScript
|
||||
{
|
||||
public spell_gen_mixology_bonus()
|
||||
{
|
||||
bonus = 0;
|
||||
}
|
||||
int bonus;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
@@ -3065,8 +3033,6 @@ namespace Scripts.Spells.Generic
|
||||
}
|
||||
}
|
||||
|
||||
int bonus;
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalculateAmount, SpellConst.EffectAll, AuraType.Any));
|
||||
|
||||
@@ -326,7 +326,7 @@ namespace Scripts.Spells.Holiday
|
||||
Unit caster = GetCaster();
|
||||
Unit target = GetHitUnit();
|
||||
|
||||
uint spellId = 0;
|
||||
uint spellId;
|
||||
bool female = target.GetGender() == Gender.Female;
|
||||
|
||||
switch (GetSpellInfo().Id)
|
||||
@@ -386,7 +386,7 @@ namespace Scripts.Spells.Holiday
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(HandleTriggerSpell, 2, AuraType.PeriodicTriggerSpell));
|
||||
}
|
||||
|
||||
uint _triggeredSpellId;
|
||||
readonly uint _triggeredSpellId;
|
||||
|
||||
bool _handled;
|
||||
}
|
||||
|
||||
@@ -28,27 +28,15 @@ namespace Scripts.Spells.Hunter
|
||||
struct SpellIds
|
||||
{
|
||||
public const uint AspectCheetahSlow = 186258;
|
||||
public const uint BestialWrath = 19574;
|
||||
public const uint ChimeraShotHeal = 53353;
|
||||
public const uint Exhilaration = 109304;
|
||||
public const uint ExhilarationPet = 128594;
|
||||
public const uint ExhilarationR2 = 231546;
|
||||
public const uint Fire = 82926;
|
||||
public const uint GenericEnergizeFocus = 91954;
|
||||
public const uint ImprovedMendPet = 24406;
|
||||
public const uint LockAndLoad = 56453;
|
||||
public const uint Lonewolf = 155228;
|
||||
public const uint MastersCallTriggered = 62305;
|
||||
public const uint MisdirectionProc = 35079;
|
||||
public const uint PetLastStandTriggered = 53479;
|
||||
public const uint PetHeartOfThePhoenix = 55709;
|
||||
public const uint PetHeartOfThePhoenixTriggered = 54114;
|
||||
public const uint PetHeartOfThePhoenixDebuff = 55711;
|
||||
public const uint PetCarrionFeederTriggered = 54045;
|
||||
public const uint Readiness = 23989;
|
||||
public const uint SerpentSting = 1978;
|
||||
public const uint SniperTrainingR1 = 53302;
|
||||
public const uint SniperTrainingBuffR1 = 64418;
|
||||
public const uint SteadyShotFocus = 77443;
|
||||
public const uint T94PGreatness = 68130;
|
||||
public const uint DraeneiGiftOfTheNaaru = 59543;
|
||||
@@ -75,65 +63,6 @@ namespace Scripts.Spells.Hunter
|
||||
}
|
||||
}
|
||||
|
||||
// 53209 - Chimera Shot
|
||||
[Script]
|
||||
class spell_hun_chimera_shot : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.ChimeraShotHeal, SpellIds.SerpentSting);
|
||||
}
|
||||
|
||||
public override bool Load()
|
||||
{
|
||||
return GetCaster().IsTypeId(TypeId.Player);
|
||||
}
|
||||
|
||||
void HandleScriptEffect(uint effIndex)
|
||||
{
|
||||
GetCaster().CastSpell(GetCaster(), SpellIds.ChimeraShotHeal, true);
|
||||
Aura aur = GetHitUnit().GetAura(SpellIds.SerpentSting, GetCaster().GetGUID());
|
||||
if (aur != null)
|
||||
aur.SetDuration(aur.GetSpellInfo().GetMaxDuration(), true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleScriptEffect, 0, SpellEffectName.ScriptEffect));
|
||||
}
|
||||
}
|
||||
|
||||
// 77767 - Cobra Shot
|
||||
[Script]
|
||||
class spell_hun_cobra_shot : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.GenericEnergizeFocus, SpellIds.SerpentSting);
|
||||
}
|
||||
|
||||
public override bool Load()
|
||||
{
|
||||
return GetCaster().IsTypeId(TypeId.Player);
|
||||
}
|
||||
|
||||
void HandleScriptEffect(uint effIndex)
|
||||
{
|
||||
GetCaster().CastSpell(GetCaster(), SpellIds.GenericEnergizeFocus, true);
|
||||
Aura aur = GetHitUnit().GetAura(SpellIds.SerpentSting, GetCaster().GetGUID());
|
||||
if (aur != null)
|
||||
{
|
||||
int newDuration = aur.GetDuration() + GetEffectValue() * Time.InMilliseconds;
|
||||
aur.SetDuration(Math.Min(newDuration, aur.GetMaxDuration()), true);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleScriptEffect, 1, SpellEffectName.ScriptEffect));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 109304 - Exhilaration
|
||||
class spell_hun_exhilaration : SpellScript
|
||||
{
|
||||
@@ -175,33 +104,6 @@ namespace Scripts.Spells.Hunter
|
||||
}
|
||||
}
|
||||
|
||||
// -19572 - Improved Mend Pet
|
||||
[Script]
|
||||
class spell_hun_improved_mend_pet : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.ImprovedMendPet);
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo eventInfo)
|
||||
{
|
||||
return RandomHelper.randChance(GetEffect(0).GetAmount());
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget().CastSpell(GetTarget(), SpellIds.ImprovedMendPet, true, null, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new CheckProcHandler(CheckProc));
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
// 53478 - Last Stand Pet
|
||||
[Script]
|
||||
class spell_hun_last_stand_pet : SpellScript
|
||||
@@ -375,63 +277,6 @@ namespace Scripts.Spells.Hunter
|
||||
}
|
||||
}
|
||||
|
||||
// 23989 - Readiness
|
||||
[Script]
|
||||
class spell_hun_readiness : SpellScript
|
||||
{
|
||||
public override bool Load()
|
||||
{
|
||||
return GetCaster().IsTypeId(TypeId.Player);
|
||||
}
|
||||
|
||||
void HandleDummy(uint effIndex)
|
||||
{
|
||||
// immediately finishes the cooldown on your other Hunter abilities except Bestial Wrath
|
||||
GetCaster().GetSpellHistory().ResetCooldowns(p =>
|
||||
{
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(p.Key, GetCastDifficulty());
|
||||
|
||||
//! If spellId in cooldown map isn't valid, the above will return a null pointer.
|
||||
if (spellInfo.SpellFamilyName == SpellFamilyNames.Hunter &&
|
||||
spellInfo.Id != SpellIds.Readiness &&
|
||||
spellInfo.Id != SpellIds.BestialWrath &&
|
||||
spellInfo.Id != SpellIds.DraeneiGiftOfTheNaaru &&
|
||||
spellInfo.GetRecoveryTime() > 0)
|
||||
return true;
|
||||
return false;
|
||||
}, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
// 82925 - Ready, Set, Aim...
|
||||
[Script]
|
||||
class spell_hun_ready_set_aim : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.Fire);
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
if (GetStackAmount() == 5)
|
||||
{
|
||||
GetTarget().CastSpell(GetTarget(), SpellIds.Fire, true, null, aurEff);
|
||||
GetTarget().RemoveAura(GetId());
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectApply.Add(new EffectApplyHandler(OnApply, 0, AuraType.Dummy, AuraEffectHandleModes.RealOrReapplyMask));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 53480 - Roar of Sacrifice
|
||||
class spell_hun_roar_of_sacrifice : AuraScript
|
||||
{
|
||||
@@ -491,53 +336,6 @@ namespace Scripts.Spells.Hunter
|
||||
}
|
||||
}
|
||||
|
||||
// -53302 - Sniper Training
|
||||
[Script]
|
||||
class spell_hun_sniper_training : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.SniperTrainingR1, SpellIds.SniperTrainingBuffR1);
|
||||
}
|
||||
|
||||
void HandlePeriodic(AuraEffect aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (aurEff.GetAmount() <= 0)
|
||||
{
|
||||
uint spellId = SpellIds.SniperTrainingBuffR1 + GetId() - SpellIds.SniperTrainingR1;
|
||||
Unit target = GetTarget();
|
||||
target.CastSpell(target, spellId, true, null, aurEff);
|
||||
Player playerTarget = GetUnitOwner().ToPlayer();
|
||||
if (playerTarget)
|
||||
{
|
||||
int baseAmount = aurEff.GetBaseAmount();
|
||||
int amount = playerTarget.CalculateSpellDamage(playerTarget, GetSpellInfo(), aurEff.GetEffIndex(), baseAmount);
|
||||
GetEffect(0).SetAmount(amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HandleUpdatePeriodic(AuraEffect aurEff)
|
||||
{
|
||||
Player playerTarget = GetUnitOwner().ToPlayer();
|
||||
if (playerTarget)
|
||||
{
|
||||
int baseAmount = aurEff.GetBaseAmount();
|
||||
int amount = playerTarget.IsMoving() ?
|
||||
playerTarget.CalculateSpellDamage(playerTarget, GetSpellInfo(), aurEff.GetEffIndex(), baseAmount) :
|
||||
aurEff.GetAmount() - 1;
|
||||
aurEff.SetAmount(amount);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(HandlePeriodic, 0, AuraType.PeriodicTriggerSpell));
|
||||
OnEffectUpdatePeriodic.Add(new EffectUpdatePeriodicHandler(HandleUpdatePeriodic, 0, AuraType.PeriodicTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
// 56641 - Steady Shot
|
||||
[Script]
|
||||
class spell_hun_steady_shot : SpellScript
|
||||
@@ -604,26 +402,6 @@ namespace Scripts.Spells.Hunter
|
||||
}
|
||||
}
|
||||
|
||||
// 53434 - Call of the Wild
|
||||
[Script]
|
||||
class spell_hun_target_only_pet_and_owner : SpellScript
|
||||
{
|
||||
void FilterTargets(List<WorldObject> targets)
|
||||
{
|
||||
targets.Clear();
|
||||
targets.Add(GetCaster());
|
||||
Unit owner = GetCaster().GetOwner();
|
||||
if (owner)
|
||||
targets.Add(owner);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(FilterTargets, 0, Targets.UnitCasterAreaParty));
|
||||
OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(FilterTargets, 1, Targets.UnitCasterAreaParty));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 67151 - Item - Hunter T9 4P Bonus (Steady Shot)
|
||||
class spell_hun_t9_4p_bonus : AuraScript
|
||||
{
|
||||
@@ -653,31 +431,4 @@ namespace Scripts.Spells.Hunter
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.ProcTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
// -56333 - T.N.T.
|
||||
[Script]
|
||||
class spell_hun_tnt : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.LockAndLoad);
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo eventInfo)
|
||||
{
|
||||
return RandomHelper.randChance(GetEffect(0).GetAmount());
|
||||
}
|
||||
|
||||
void HandleEffectProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget().CastSpell(GetTarget(), SpellIds.LockAndLoad, true, null, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new CheckProcHandler(CheckProc));
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleEffectProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -653,7 +653,7 @@ namespace Scripts.Spells.Items
|
||||
uint[][] triggeredSpells =
|
||||
{
|
||||
//CLASS_NONE
|
||||
new uint[] { },
|
||||
Array.Empty<uint>(),
|
||||
//CLASS_WARRIOR
|
||||
new uint[] {SpellIds.Sociopath, SpellIds.Delusional, SpellIds.Kleptomania, SpellIds.Paranoia, SpellIds.Manic, SpellIds.MartyrComplex },
|
||||
//CLASS_PALADIN
|
||||
@@ -673,7 +673,7 @@ namespace Scripts.Spells.Items
|
||||
//CLASS_WARLOCK
|
||||
new uint[] {SpellIds.Megalomania, SpellIds.Paranoia, SpellIds.Manic, SpellIds.Narcissism, SpellIds.MartyrComplex, SpellIds.Dementia },
|
||||
//CLASS_UNK
|
||||
new uint[]{ },
|
||||
Array.Empty<uint>(),
|
||||
//CLASS_DRUID
|
||||
new uint[] {SpellIds.Sociopath, SpellIds.Delusional, SpellIds.Kleptomania, SpellIds.Megalomania, SpellIds.Paranoia, SpellIds.Manic, SpellIds.Narcissism, SpellIds.MartyrComplex, SpellIds.Dementia }
|
||||
};
|
||||
@@ -818,7 +818,7 @@ namespace Scripts.Spells.Items
|
||||
uint[][] triggeredSpells =
|
||||
{
|
||||
//CLASS_NONE
|
||||
new uint[] { },
|
||||
Array.Empty<uint>(),
|
||||
//CLASS_WARRIOR
|
||||
new uint[] {_strengthSpellId, _criticalSpellId, _hasteSpellId },
|
||||
//CLASS_PALADIN
|
||||
@@ -828,17 +828,17 @@ namespace Scripts.Spells.Items
|
||||
//CLASS_ROGUE
|
||||
new uint[] {_agilitySpellId, _hasteSpellId, _apSpellId },
|
||||
//CLASS_PRIEST
|
||||
new uint[] { },
|
||||
Array.Empty<uint>(),
|
||||
//CLASS_DEATH_KNIGHT
|
||||
new uint[] {_strengthSpellId, _criticalSpellId, _hasteSpellId },
|
||||
//CLASS_SHAMAN
|
||||
new uint[] {_agilitySpellId, _hasteSpellId, _apSpellId },
|
||||
//CLASS_MAGE
|
||||
new uint[] { },
|
||||
Array.Empty<uint>(),
|
||||
//CLASS_WARLOCK
|
||||
new uint[] { },
|
||||
Array.Empty<uint>(),
|
||||
//CLASS_UNK
|
||||
new uint[] { },
|
||||
Array.Empty<uint>(),
|
||||
//CLASS_DRUID
|
||||
new uint[] {_strengthSpellId, _agilitySpellId, _hasteSpellId }
|
||||
};
|
||||
@@ -1781,7 +1781,7 @@ namespace Scripts.Spells.Items
|
||||
Unit target = GetHitUnit();
|
||||
if (target)
|
||||
{
|
||||
uint spellId = 0;
|
||||
uint spellId;
|
||||
uint rand = RandomHelper.URand(0, 99);
|
||||
if (rand < 25) // Fireball (25% chance)
|
||||
spellId = SpellIds.Fireball;
|
||||
|
||||
@@ -67,52 +67,6 @@ namespace Scripts.Spells.Paladin
|
||||
public const uint SealOfRighteousness = 25742;
|
||||
}
|
||||
|
||||
// 31821 - Aura Mastery
|
||||
[Script]
|
||||
class spell_pal_aura_mastery : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.AuraMasteryImmune);
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
GetTarget().CastSpell(GetTarget(), SpellIds.AuraMasteryImmune, true);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
GetTarget().RemoveOwnedAura(SpellIds.AuraMasteryImmune, GetCasterGUID());
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectApply.Add(new EffectApplyHandler(HandleEffectApply, 0, AuraType.AddPctModifier, AuraEffectHandleModes.Real));
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(HandleEffectRemove, 0, AuraType.AddPctModifier, AuraEffectHandleModes.Real));
|
||||
}
|
||||
}
|
||||
|
||||
// 64364 - Aura Mastery Immune
|
||||
[Script]
|
||||
class spell_pal_aura_mastery_immune : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.ConcentractionAura);
|
||||
}
|
||||
|
||||
bool CheckAreaTarget(Unit target)
|
||||
{
|
||||
return target.HasAura(SpellIds.ConcentractionAura, GetCasterGUID());
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckAreaTarget.Add(new CheckAreaTargetHandler(CheckAreaTarget));
|
||||
}
|
||||
}
|
||||
|
||||
// 37877 - Blessing of Faith
|
||||
[Script]
|
||||
class spell_pal_blessing_of_faith : SpellScript
|
||||
@@ -127,7 +81,7 @@ namespace Scripts.Spells.Paladin
|
||||
Unit unitTarget = GetHitUnit();
|
||||
if (unitTarget)
|
||||
{
|
||||
uint spell_id = 0;
|
||||
uint spell_id;
|
||||
switch (unitTarget.GetClass())
|
||||
{
|
||||
case Class.Druid:
|
||||
@@ -320,56 +274,6 @@ namespace Scripts.Spells.Paladin
|
||||
}
|
||||
}
|
||||
|
||||
// 33695 - Exorcism and Holy Wrath Damage
|
||||
[Script]
|
||||
class spell_pal_exorcism_and_holy_wrath_damage : AuraScript
|
||||
{
|
||||
void HandleEffectCalcSpellMod(AuraEffect aurEff, ref SpellModifier spellMod)
|
||||
{
|
||||
if (spellMod == null)
|
||||
{
|
||||
spellMod = new SpellModifier(aurEff.GetBase());
|
||||
spellMod.op = SpellModOp.Damage;
|
||||
spellMod.type = SpellModType.Flat;
|
||||
spellMod.spellId = GetId();
|
||||
spellMod.mask[1] = 0x200002;
|
||||
}
|
||||
|
||||
spellMod.value = aurEff.GetAmount();
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoEffectCalcSpellMod.Add(new EffectCalcSpellModHandler(HandleEffectCalcSpellMod, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
// -9799 - Eye for an Eye
|
||||
[Script]
|
||||
class spell_pal_eye_for_an_eye : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.EyeForAnEyeDamage);
|
||||
}
|
||||
|
||||
void HandleEffectProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
DamageInfo damageInfo = eventInfo.GetDamageInfo();
|
||||
if (damageInfo == null || damageInfo.GetDamage() == 0)
|
||||
return;
|
||||
|
||||
int damage = (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount());
|
||||
GetTarget().CastCustomSpell(SpellIds.EyeForAnEyeDamage, SpellValueMod.BasePoint0, damage, eventInfo.GetProcTarget(), true, null, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleEffectProc, 0, m_scriptSpellId == SpellIds.EyeForAnEyeRank1 ? AuraType.Dummy : AuraType.ProcTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
// -75806 - Grand Crusader
|
||||
[Script]
|
||||
class spell_pal_grand_crusader : AuraScript
|
||||
@@ -697,80 +601,6 @@ namespace Scripts.Spells.Paladin
|
||||
}
|
||||
}
|
||||
|
||||
// 31789 - Righteous Defense
|
||||
[Script]
|
||||
class spell_pal_righteous_defense : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.RighteousDefenseTaunt);
|
||||
}
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
if (!caster.IsTypeId(TypeId.Player))
|
||||
return SpellCastResult.DontReport;
|
||||
|
||||
Unit target = GetExplTargetUnit();
|
||||
if (target)
|
||||
{
|
||||
if (!target.IsFriendlyTo(caster) || target.GetAttackers().Empty())
|
||||
return SpellCastResult.BadTargets;
|
||||
}
|
||||
else
|
||||
return SpellCastResult.BadTargets;
|
||||
|
||||
return SpellCastResult.SpellCastOk;
|
||||
}
|
||||
|
||||
void HandleTriggerSpellLaunch(uint effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
}
|
||||
|
||||
void HandleTriggerSpellHit(uint effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
Unit target = GetHitUnit();
|
||||
if (target)
|
||||
GetCaster().CastSpell(target, SpellIds.RighteousDefenseTaunt, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnCheckCast.Add(new CheckCastHandler(CheckCast));
|
||||
//! WORKAROUND
|
||||
//! target select will be executed in hitphase of effect 0
|
||||
//! so we must handle trigger spell also in hit phase (default execution in launch phase)
|
||||
//! see issue #3718
|
||||
OnEffectLaunchTarget.Add(new EffectHandler(HandleTriggerSpellLaunch, 1, SpellEffectName.TriggerSpell));
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleTriggerSpellHit, 1, SpellEffectName.TriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
// 85285 - Sacred Shield
|
||||
[Script]
|
||||
class spell_pal_sacred_shield : SpellScript
|
||||
{
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
if (!caster.IsTypeId(TypeId.Player))
|
||||
return SpellCastResult.DontReport;
|
||||
|
||||
if (!caster.HealthBelowPct(30))
|
||||
return SpellCastResult.CantDoThatRightNow;
|
||||
|
||||
return SpellCastResult.SpellCastOk;
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnCheckCast.Add(new CheckCastHandler(CheckCast));
|
||||
}
|
||||
};
|
||||
|
||||
// 85256 - Templar's Verdict
|
||||
// Updated 4.3.4
|
||||
[Script]
|
||||
@@ -824,38 +654,6 @@ namespace Scripts.Spells.Paladin
|
||||
}
|
||||
}
|
||||
|
||||
// 20154, 21084 - Seal of Righteousness - melee proc dummy (addition ${$MWS*(0.022*$AP+0.044*$SPH)} damage)
|
||||
[Script]
|
||||
class spell_pal_seal_of_righteousness : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.SealOfCommand);
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo eventInfo)
|
||||
{
|
||||
return eventInfo.GetProcTarget();
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
float ap = GetTarget().GetTotalAttackPowerValue(WeaponAttackType.BaseAttack);
|
||||
int holy = GetTarget().SpellBaseDamageBonusDone(SpellSchoolMask.Holy);
|
||||
holy += eventInfo.GetProcTarget().SpellBaseDamageBonusTaken(SpellSchoolMask.Holy);
|
||||
int bp = (int)((ap * 0.022f + 0.044f * holy) * GetTarget().GetBaseAttackTime(WeaponAttackType.BaseAttack) / 1000);
|
||||
GetTarget().CastCustomSpell(SpellIds.SealOfCommand, SpellValueMod.BasePoint0, bp, eventInfo.GetProcTarget(), true, null, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new CheckProcHandler(CheckProc));
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 28789 - Holy Power
|
||||
class spell_pal_t3_6p_bonus : AuraScript
|
||||
{
|
||||
|
||||
+103
-411
@@ -24,57 +24,41 @@ using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Game.Maps;
|
||||
|
||||
namespace Scripts.Spells.Priest
|
||||
{
|
||||
struct SpellIds
|
||||
{
|
||||
public const uint Absolution = 33167;
|
||||
public const uint AngelicFeatherAreatrigger = 158624;
|
||||
public const uint AngelicFeatherAura = 121557;
|
||||
public const uint AngelicFeatherTrigger = 121536;
|
||||
public const uint ArmorOfFaith = 28810;
|
||||
public const uint Atonement = 81749;
|
||||
public const uint AtonementHeal = 81751;
|
||||
public const uint AtonementTriggered = 194384;
|
||||
public const uint BlessedHealing = 70772;
|
||||
public const uint BodyAndSoul = 64129;
|
||||
public const uint BodyAndSoulDispel = 64136;
|
||||
public const uint BodyAndSoulSpeed = 65081;
|
||||
public const uint CureDisease = 528;
|
||||
public const uint DispelMagicFriendly = 97690;
|
||||
public const uint DispelMagicHostile = 97691;
|
||||
public const uint DivineAegis = 47753;
|
||||
public const uint DivineBlessing = 40440;
|
||||
public const uint DivineWrath = 40441;
|
||||
public const uint GlyphOfCircleOfHealing = 55675;
|
||||
public const uint GlyphOfDispelMagic = 55677;
|
||||
public const uint GlyphOfDispelMagicHeal = 56131;
|
||||
public const uint GlyphOfLightwell = 55673;
|
||||
public const uint GlyphOfPrayerOfHealingHeal = 56161;
|
||||
public const uint GlyphOfShadow = 107906;
|
||||
public const uint GuardianSpiritHeal = 48153;
|
||||
public const uint ItemEfficiency = 37595;
|
||||
public const uint LeapOfFaith = 73325;
|
||||
public const uint LeapOfFaithEffect = 92832;
|
||||
public const uint LeapOfFaithEffectTrigger = 92833;
|
||||
public const uint LeapOfFaithTriggered = 92572;
|
||||
public const uint LevitateEffect = 111759;
|
||||
public const uint ManaLeechProc = 34650;
|
||||
public const uint OracularHeal = 26170;
|
||||
public const uint PenanceR1 = 47540;
|
||||
public const uint PenanceR1Damage = 47758;
|
||||
public const uint PenanceR1Heal = 47757;
|
||||
public const uint PrayerOfMendingAura = 41635;
|
||||
public const uint PrayerOfMendingHeal = 33110;
|
||||
public const uint PrayerOfMendingJump = 155793;
|
||||
public const uint RenewedHope = 197469;
|
||||
public const uint RenewedHopeEffect = 197470;
|
||||
public const uint ShadowformVisualWithGlyph = 107904;
|
||||
public const uint ShadowformVisualWithoutGlyph = 107903;
|
||||
public const uint ShieldDisciplineEnergize = 47755;
|
||||
public const uint ShieldDisciplinePassive = 197045;
|
||||
public const uint SpiritOfRedemption = 27827;
|
||||
public const uint StrengthOfSoul = 197535;
|
||||
public const uint StrengthOfSoulEffect = 197548;
|
||||
public const uint T9Healing2p = 67201;
|
||||
public const uint ThePenitentAura = 200347;
|
||||
public const uint VampiricEmbraceHeal = 15290;
|
||||
public const uint VampiricTouchDispel = 64085;
|
||||
@@ -116,6 +100,8 @@ namespace Scripts.Spells.Priest
|
||||
[Script] // 81749 - Atonement
|
||||
public class spell_pri_atonement : AuraScript
|
||||
{
|
||||
List<ObjectGuid> _appliedAtonements = new List<ObjectGuid>();
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.AtonementHeal);
|
||||
@@ -150,8 +136,6 @@ namespace Scripts.Spells.Priest
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
|
||||
List<ObjectGuid> _appliedAtonements = new List<ObjectGuid>();
|
||||
|
||||
public void AddAtonementTarget(ObjectGuid target)
|
||||
{
|
||||
_appliedAtonements.Add(target);
|
||||
@@ -208,160 +192,6 @@ namespace Scripts.Spells.Priest
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 64129 - Body and Soul
|
||||
class spell_pri_body_and_soul : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.CureDisease, SpellIds.BodyAndSoulDispel);
|
||||
}
|
||||
|
||||
void HandleEffectSpeedProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
// Proc only with Power Word: Shield or Leap of Faith
|
||||
if (!(eventInfo.GetDamageInfo().GetSpellInfo().SpellFamilyFlags[0].HasAnyFlag(0x1u) || eventInfo.GetDamageInfo().GetSpellInfo().SpellFamilyFlags[2].HasAnyFlag(0x80000u)))
|
||||
return;
|
||||
|
||||
GetTarget().CastCustomSpell(SpellIds.BodyAndSoulSpeed, SpellValueMod.BasePoint0, aurEff.GetAmount(), eventInfo.GetProcTarget(), true, null, aurEff);
|
||||
}
|
||||
|
||||
void HandleEffectDispelProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
// Proc only with Cure Disease
|
||||
if (eventInfo.GetDamageInfo().GetSpellInfo().Id != SpellIds.CureDisease || eventInfo.GetProcTarget() != GetTarget())
|
||||
return;
|
||||
|
||||
if (RandomHelper.randChance(aurEff.GetAmount()))
|
||||
GetTarget().CastSpell(eventInfo.GetProcTarget(), SpellIds.BodyAndSoulDispel, true, null, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleEffectSpeedProc, 0, AuraType.Dummy));
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleEffectDispelProc, 1, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
// 34861 - Circle of Healing
|
||||
[Script]
|
||||
class spell_pri_circle_of_healing : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.GlyphOfCircleOfHealing);
|
||||
}
|
||||
|
||||
void FilterTargets(List<WorldObject> targets)
|
||||
{
|
||||
targets.RemoveAll(obj =>
|
||||
{
|
||||
Unit target = obj.ToUnit();
|
||||
if (target)
|
||||
return !GetCaster().IsInRaidWith(target);
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
uint maxTargets = (uint)(GetCaster().HasAura(SpellIds.GlyphOfCircleOfHealing) ? 6 : 5); // Glyph of Circle of Healing
|
||||
|
||||
if (targets.Count > maxTargets)
|
||||
{
|
||||
targets.Sort(new HealthPctOrderPred());
|
||||
targets.Resize(maxTargets);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(FilterTargets, 0, Targets.UnitDestAreaAlly));
|
||||
}
|
||||
}
|
||||
|
||||
// 527 - Dispel magic
|
||||
[Script]
|
||||
class spell_pri_dispel_magic : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.Absolution, SpellIds.GlyphOfDispelMagicHeal, SpellIds.GlyphOfDispelMagic);
|
||||
}
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
Unit target = GetExplTargetUnit();
|
||||
|
||||
if (!target || (!caster.HasAura(SpellIds.Absolution) && caster != target && target.IsFriendlyTo(caster)))
|
||||
return SpellCastResult.BadTargets;
|
||||
return SpellCastResult.SpellCastOk;
|
||||
}
|
||||
|
||||
void AfterEffectHit(uint effIndex)
|
||||
{
|
||||
if (GetHitUnit().IsFriendlyTo(GetCaster()))
|
||||
{
|
||||
GetCaster().CastSpell(GetHitUnit(), SpellIds.DispelMagicFriendly, true);
|
||||
AuraEffect aurEff = GetHitUnit().GetAuraEffect(SpellIds.GlyphOfDispelMagic, 0);
|
||||
if (aurEff != null)
|
||||
{
|
||||
int heal = (int)GetHitUnit().CountPctFromMaxHealth(aurEff.GetAmount());
|
||||
GetCaster().CastCustomSpell(SpellIds.GlyphOfDispelMagicHeal, SpellValueMod.BasePoint0, heal, GetHitUnit());
|
||||
}
|
||||
}
|
||||
else
|
||||
GetCaster().CastSpell(GetHitUnit(), SpellIds.DispelMagicHostile, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnCheckCast.Add(new CheckCastHandler(CheckCast));
|
||||
OnEffectHitTarget.Add(new EffectHandler(AfterEffectHit, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
// -47509 - Divine Aegis
|
||||
[Script]
|
||||
class spell_pri_divine_aegis : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.DivineAegis);
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo eventInfo)
|
||||
{
|
||||
return eventInfo.GetProcTarget();
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
HealInfo healInfo = eventInfo.GetHealInfo();
|
||||
if (healInfo == null || healInfo.GetHeal() == 0)
|
||||
return;
|
||||
|
||||
int absorb = (int)MathFunctions.CalculatePct(healInfo.GetHeal(), aurEff.GetAmount());
|
||||
|
||||
// Multiple effects stack, so let's try to find this aura.
|
||||
AuraEffect aegis = eventInfo.GetProcTarget().GetAuraEffect(SpellIds.DivineAegis, 0);
|
||||
if (aegis != null)
|
||||
absorb += aegis.GetAmount();
|
||||
|
||||
absorb = (int)Math.Min(absorb, eventInfo.GetProcTarget().GetLevel() * 125);
|
||||
|
||||
GetTarget().CastCustomSpell(SpellIds.DivineAegis, SpellValueMod.BasePoint0, absorb, eventInfo.GetProcTarget(), true, null, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new CheckProcHandler(CheckProc));
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
// 64844 - Divine Hymn
|
||||
[Script]
|
||||
class spell_pri_divine_hymn : SpellScript
|
||||
@@ -392,57 +222,6 @@ namespace Scripts.Spells.Priest
|
||||
}
|
||||
}
|
||||
|
||||
// 55680 - Glyph of Prayer of Healing
|
||||
[Script]
|
||||
class spell_pri_glyph_of_prayer_of_healing : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.GlyphOfPrayerOfHealingHeal);
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
HealInfo healInfo = eventInfo.GetHealInfo();
|
||||
if (healInfo == null || healInfo.GetHeal() == 0)
|
||||
return;
|
||||
|
||||
SpellInfo triggeredSpellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.GlyphOfPrayerOfHealingHeal, GetCastDifficulty());
|
||||
int heal = (int)(MathFunctions.CalculatePct(healInfo.GetHeal(), aurEff.GetAmount()) / triggeredSpellInfo.GetMaxTicks());
|
||||
GetTarget().CastCustomSpell(SpellIds.GlyphOfPrayerOfHealingHeal, SpellValueMod.BasePoint0, heal, eventInfo.GetProcTarget(), true, null, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 24191 - Improved Power Word Shield
|
||||
class spell_pri_improved_power_word_shield : AuraScript
|
||||
{
|
||||
void HandleEffectCalcSpellMod(AuraEffect aurEff, ref SpellModifier spellMod)
|
||||
{
|
||||
if (spellMod == null)
|
||||
{
|
||||
spellMod = new SpellModifier(GetAura());
|
||||
spellMod.op = (SpellModOp)aurEff.GetMiscValue();
|
||||
spellMod.type = SpellModType.Pct;
|
||||
spellMod.spellId = GetId();
|
||||
spellMod.mask = GetSpellInfo().GetEffect(aurEff.GetEffIndex()).SpellClassMask;
|
||||
}
|
||||
|
||||
spellMod.value = aurEff.GetAmount();
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoEffectCalcSpellMod.Add(new EffectCalcSpellModHandler(HandleEffectCalcSpellMod, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
// 47788 - Guardian Spirit
|
||||
[Script]
|
||||
class spell_pri_guardian_spirit : AuraScript
|
||||
@@ -486,45 +265,6 @@ namespace Scripts.Spells.Priest
|
||||
}
|
||||
}
|
||||
|
||||
// 64904 - Hymn of Hope
|
||||
[Script]
|
||||
class spell_pri_hymn_of_hope : SpellScript
|
||||
{
|
||||
void FilterTargets(List<WorldObject> targets)
|
||||
{
|
||||
targets.RemoveAll(obj =>
|
||||
{
|
||||
Unit target = obj.ToUnit();
|
||||
if (target)
|
||||
return target.GetPowerType() != PowerType.Mana;
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
targets.RemoveAll(obj =>
|
||||
{
|
||||
Unit target = obj.ToUnit();
|
||||
if (target)
|
||||
return !GetCaster().IsInRaidWith(target);
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
uint maxTargets = 3;
|
||||
|
||||
if (targets.Count > maxTargets)
|
||||
{
|
||||
targets.Sort(new PowerPctOrderPred(PowerType.Mana));
|
||||
targets.Resize(maxTargets);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(FilterTargets, SpellConst.EffectAll, Targets.UnitSrcAreaAlly));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 40438 - Priest Tier 6 Trinket
|
||||
class spell_pri_item_t6_trinket : AuraScript
|
||||
{
|
||||
@@ -594,103 +334,6 @@ namespace Scripts.Spells.Priest
|
||||
}
|
||||
}
|
||||
|
||||
// 7001 - Lightwell Renew
|
||||
[Script]
|
||||
class spell_pri_lightwell_renew : AuraScript
|
||||
{
|
||||
void CalculateAmount(AuraEffect aurEff, ref int amount, ref bool canBeRecalculated)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
if (caster)
|
||||
{
|
||||
// Bonus from Glyph of Lightwell
|
||||
AuraEffect modHealing = caster.GetAuraEffect(SpellIds.GlyphOfLightwell, 0);
|
||||
if (modHealing != null)
|
||||
MathFunctions.AddPct(ref amount, modHealing.GetAmount());
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalculateAmount, 0, AuraType.PeriodicHeal));
|
||||
}
|
||||
}
|
||||
|
||||
// 8129 - Mana Burn
|
||||
[Script]
|
||||
class spell_pri_mana_burn : SpellScript
|
||||
{
|
||||
void HandleAfterHit()
|
||||
{
|
||||
Unit unitTarget = GetHitUnit();
|
||||
if (unitTarget)
|
||||
unitTarget.RemoveAurasWithMechanic((1 << (int)Mechanics.Fear) | (1 << (int)Mechanics.Polymorph));
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterHit.Add(new HitHandler(HandleAfterHit));
|
||||
}
|
||||
}
|
||||
|
||||
// 28305 - Mana Leech (Passive) (Priest Pet Aura)
|
||||
[Script]
|
||||
class spell_pri_mana_leech : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.ManaLeechProc);
|
||||
}
|
||||
|
||||
public override bool Load()
|
||||
{
|
||||
_procTarget = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo eventInfo)
|
||||
{
|
||||
_procTarget = GetTarget().GetOwner();
|
||||
return _procTarget;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget().CastSpell(_procTarget, SpellIds.ManaLeechProc, true, null, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new CheckProcHandler(CheckProc));
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
|
||||
Unit _procTarget;
|
||||
}
|
||||
|
||||
// 47948 - Pain and Suffering (Proc)
|
||||
[Script]
|
||||
class spell_pri_pain_and_suffering_proc : SpellScript
|
||||
{
|
||||
void HandleEffectScriptEffect(uint effIndex)
|
||||
{
|
||||
// Refresh Shadow Word: Pain on target
|
||||
Unit unitTarget = GetHitUnit();
|
||||
if (unitTarget)
|
||||
{
|
||||
AuraEffect aur = unitTarget.GetAuraEffect(AuraType.PeriodicDamage, SpellFamilyNames.Priest, new FlagArray128(0x8000, 0, 0), GetCaster().GetGUID());
|
||||
if (aur != null)
|
||||
aur.GetBase().RefreshDuration();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleEffectScriptEffect, 0, SpellEffectName.ScriptEffect));
|
||||
}
|
||||
}
|
||||
|
||||
// 47540 - Penance
|
||||
[Script]
|
||||
class spell_pri_penance : SpellScript
|
||||
@@ -771,28 +414,6 @@ namespace Scripts.Spells.Priest
|
||||
}
|
||||
}
|
||||
|
||||
// -47569 - Phantasm
|
||||
[Script]
|
||||
class spell_pri_phantasm : AuraScript
|
||||
{
|
||||
bool CheckProc(ProcEventInfo eventInfo)
|
||||
{
|
||||
return RandomHelper.randChance(GetEffect(0).GetAmount());
|
||||
}
|
||||
|
||||
void HandleEffectProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget().RemoveMovementImpairingAuras(true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new CheckProcHandler(CheckProc));
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleEffectProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 17 - Power Word: Shield
|
||||
class spell_pri_power_word_shield : AuraScript
|
||||
{
|
||||
@@ -848,53 +469,124 @@ namespace Scripts.Spells.Priest
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 33110 - Prayer of Mending Heal
|
||||
class spell_pri_prayer_of_mending_heal : SpellScript
|
||||
// Base class used by various prayer of mending spells
|
||||
class spell_pri_prayer_of_mending_SpellScriptBase : SpellScript
|
||||
{
|
||||
void HandleHeal(uint effIndex)
|
||||
SpellInfo _spellInfoHeal;
|
||||
SpellEffectInfo _healEffectDummy;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
Unit caster = GetOriginalCaster();
|
||||
if (caster)
|
||||
return ValidateSpellInfo(SpellIds.PrayerOfMendingHeal, SpellIds.PrayerOfMendingAura)
|
||||
&& Global.SpellMgr.GetSpellInfo(SpellIds.PrayerOfMendingHeal, Difficulty.None).GetEffect(0) != null;
|
||||
}
|
||||
|
||||
public override bool Load()
|
||||
{
|
||||
_spellInfoHeal = Global.SpellMgr.GetSpellInfo(SpellIds.PrayerOfMendingHeal, Difficulty.None);
|
||||
_healEffectDummy = _spellInfoHeal.GetEffect(0);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void CastPrayerOfMendingAura(Unit caster, Unit target, byte stack)
|
||||
{
|
||||
uint basePoints = caster.SpellHealingBonusDone(target, _spellInfoHeal, (uint)_healEffectDummy.CalcValue(caster), DamageEffectType.Heal, _healEffectDummy);
|
||||
Dictionary<SpellValueMod, int> values = new Dictionary<SpellValueMod, int>();
|
||||
values.Add(SpellValueMod.AuraStack, stack);
|
||||
values.Add(SpellValueMod.BasePoint0, (int)basePoints);
|
||||
caster.CastCustomSpell(SpellIds.PrayerOfMendingAura, values, target, TriggerCastFlags.FullMask);
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 33076 - Prayer of Mending
|
||||
class spell_pri_prayer_of_mending : spell_pri_prayer_of_mending_SpellScriptBase
|
||||
{
|
||||
void HandleEffectDummy(uint effIndex)
|
||||
{
|
||||
CastPrayerOfMendingAura(GetCaster(), GetHitUnit(), (byte)GetEffectValue());
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHit .Add(new EffectHandler(HandleEffectDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 41635 - Prayer of Mending (Aura) - SPELL_PRIEST_PRAYER_OF_MENDING_AURA
|
||||
class spell_pri_prayer_of_mending_AuraScript : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.PrayerOfMendingHeal, SpellIds.PrayerOfMendingJump);
|
||||
}
|
||||
|
||||
void HandleHeal(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
// Caster: player (priest) that cast the Prayer of Mending
|
||||
// Target: player that currently has Prayer of Mending aura on him
|
||||
Unit target = GetTarget();
|
||||
Unit caster = GetCaster();
|
||||
if (caster != null)
|
||||
{
|
||||
AuraEffect aurEff = caster.GetAuraEffect(SpellIds.T9Healing2p, 0);
|
||||
if (aurEff != null)
|
||||
{
|
||||
int heal = GetHitHeal();
|
||||
MathFunctions.AddPct(ref heal, aurEff.GetAmount());
|
||||
SetHitHeal(heal);
|
||||
}
|
||||
// Cast the spell to heal the owner
|
||||
caster.CastSpell(target, SpellIds.PrayerOfMendingHeal, true, null, aurEff);
|
||||
|
||||
// Only cast jump if stack is higher than 0
|
||||
int stackAmount = GetStackAmount();
|
||||
if (stackAmount > 1)
|
||||
target.CastCustomSpell(SpellIds.PrayerOfMendingJump, SpellValueMod.BasePoint0, stackAmount - 1, target, true, null, aurEff, caster.GetGUID());
|
||||
|
||||
Remove();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleHeal, 0, SpellEffectName.Heal));
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleHeal, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
// 15473 - Shadowform
|
||||
[Script]
|
||||
class spell_pri_shadowform : AuraScript
|
||||
[Script] // 155793 - prayer of mending (Jump) - SPELL_PRIEST_PRAYER_OF_MENDING_JUMP
|
||||
class spell_pri_prayer_of_mending_jump : spell_pri_prayer_of_mending_SpellScriptBase
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
void OnTargetSelect(List<WorldObject> targets)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.ShadowformVisualWithoutGlyph, SpellIds.ShadowformVisualWithGlyph);
|
||||
// Find the best target - prefer players over pets
|
||||
bool foundPlayer = false;
|
||||
foreach (WorldObject worldObject in targets)
|
||||
{
|
||||
if (worldObject.IsPlayer())
|
||||
{
|
||||
foundPlayer = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (foundPlayer)
|
||||
targets.RemoveAll(new ObjectTypeIdCheck(TypeId.Player, false));
|
||||
|
||||
// choose one random target from targets
|
||||
if (targets.Count > 1)
|
||||
{
|
||||
WorldObject selected = targets.SelectRandom();
|
||||
targets.Clear();
|
||||
targets.Add(selected);
|
||||
}
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
void HandleJump(uint effIndex)
|
||||
{
|
||||
GetTarget().CastSpell(GetTarget(), GetTarget().HasAura(SpellIds.GlyphOfShadow) ? SpellIds.ShadowformVisualWithGlyph : SpellIds.ShadowformVisualWithoutGlyph, true);
|
||||
}
|
||||
Unit origCaster = GetOriginalCaster(); // the one that started the prayer of mending chain
|
||||
Unit target = GetHitUnit(); // the target we decided the aura should jump to
|
||||
|
||||
void HandleEffectRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
GetTarget().RemoveAurasDueToSpell(GetTarget().HasAura(SpellIds.GlyphOfShadow) ? SpellIds.ShadowformVisualWithGlyph : SpellIds.ShadowformVisualWithoutGlyph);
|
||||
if (origCaster)
|
||||
CastPrayerOfMendingAura(origCaster, target, (byte)GetEffectValue());
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectApply.Add(new EffectApplyHandler(HandleEffectApply, 0, AuraType.ModShapeshift, AuraEffectHandleModes.RealOrReapplyMask));
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(HandleEffectRemove, 0, AuraType.ModShapeshift, AuraEffectHandleModes.RealOrReapplyMask));
|
||||
OnObjectAreaTargetSelect .Add(new ObjectAreaTargetSelectHandler(OnTargetSelect, 0, Targets.UnitSrcAreaAlly));
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleJump, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -461,7 +461,7 @@ namespace Scripts.Spells.Quest
|
||||
|
||||
void HandleDummy(uint effIndex)
|
||||
{
|
||||
Unit target = GetExplTargetUnit();
|
||||
Unit target = GetHitUnit();
|
||||
if (target)
|
||||
if (target.IsTypeId(TypeId.Unit) && target.HasAura(SpellIds.ForceShieldArcanePurpleX3))
|
||||
// Make sure nobody else is channeling the same target
|
||||
@@ -553,7 +553,7 @@ namespace Scripts.Spells.Quest
|
||||
Creature target = GetHitCreature();
|
||||
if (target)
|
||||
{
|
||||
uint spellId = 0;
|
||||
uint spellId;
|
||||
switch (target.GetEntry())
|
||||
{
|
||||
case CreatureIds.Scavengebot004a8:
|
||||
@@ -841,11 +841,10 @@ namespace Scripts.Spells.Quest
|
||||
void HandleDummy(uint effIndex)
|
||||
{
|
||||
Player caster = GetCaster().ToPlayer();
|
||||
|
||||
Creature target = GetHitCreature();
|
||||
if (target)
|
||||
if (target != null)
|
||||
{
|
||||
if (target && !target.HasAura(SpellIds.Flames))
|
||||
if (!target.HasAura(SpellIds.Flames))
|
||||
{
|
||||
caster.KilledMonsterCredit(CreatureIds.VillagerKillCredit);
|
||||
target.CastSpell(target, SpellIds.Flames, true);
|
||||
@@ -1559,7 +1558,7 @@ namespace Scripts.Spells.Quest
|
||||
|
||||
void HandleDummy(uint effIndex)
|
||||
{
|
||||
uint spellId = 0;
|
||||
uint spellId;
|
||||
|
||||
switch (GetHitCreature().GetEntry())
|
||||
{
|
||||
|
||||
@@ -26,18 +26,11 @@ namespace Scripts.Spells.Rogue
|
||||
public struct SpellIds
|
||||
{
|
||||
public const uint BladeFlurryExtraAttack = 22482;
|
||||
public const uint CheatDeathCooldown = 31231;
|
||||
public const uint GlyphOfPreparation = 56819;
|
||||
public const uint KillingSpree = 51690;
|
||||
public const uint KillingSpreeTeleport = 57840;
|
||||
public const uint KillingSpreeWeaponDmg = 57841;
|
||||
public const uint KillingSpreeDmgBuff = 61851;
|
||||
public const uint PreyOnTheWeak = 58670;
|
||||
public const uint ShivTriggered = 5940;
|
||||
public const uint TricksOfTheTradeDmgBoost = 57933;
|
||||
public const uint TricksOfTheTradeProc = 59628;
|
||||
public const uint SerratedBladesR1 = 14171;
|
||||
public const uint Rupture = 1943;
|
||||
public const uint HonorAmongThievesEnergize = 51699;
|
||||
public const uint T52pSetBonus = 37169;
|
||||
}
|
||||
|
||||
@@ -43,19 +43,16 @@ namespace Scripts.Spells.Shaman
|
||||
public const uint ElementalMastery = 16166;
|
||||
public const uint EnergySurge = 40465;
|
||||
public const uint Exhaustion = 57723;
|
||||
public const uint FireNovaTriggered = 8349;
|
||||
public const uint FlameShock = 8050;
|
||||
public const uint FlameShockMaelstrom = 188389;
|
||||
public const uint FlametongueAttack = 10444;
|
||||
public const uint GatheringStorms = 198299;
|
||||
public const uint GatheringStormsBuff = 198300;
|
||||
public const uint HighTide = 157154;
|
||||
public const uint ItemLightningShield = 23552;
|
||||
public const uint ItemLightningShieldDamage = 27635;
|
||||
public const uint ItemManaSurge = 23571;
|
||||
public const uint LavaBurst = 51505;
|
||||
public const uint LavaBurstBonusDamage = 71824;
|
||||
public const uint LavaLashSpreadFlameShock = 105792;
|
||||
public const uint LavaSurge = 77762;
|
||||
public const uint PathOfFlamesSpread = 210621;
|
||||
public const uint PathOfFlamesTalent = 201909;
|
||||
@@ -300,23 +297,6 @@ namespace Scripts.Spells.Shaman
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 1535 Fire Nova
|
||||
class spell_sha_fire_nova : SpellScript
|
||||
{
|
||||
void HandleDummy(uint effIndex)
|
||||
{
|
||||
Unit target = GetHitUnit();
|
||||
if (target)
|
||||
if (target.HasAura(SpellIds.FlameShock))
|
||||
GetCaster().CastSpell(target, SpellIds.FireNovaTriggered, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 194084 - Flametongue
|
||||
class spell_sha_flametongue : AuraScript
|
||||
{
|
||||
|
||||
@@ -27,43 +27,22 @@ namespace Scripts.Spells.Warlock
|
||||
{
|
||||
struct SpellIds
|
||||
{
|
||||
public const uint BaneOfDoomEffect = 18662;
|
||||
public const uint CreateHealthstone = 23517;
|
||||
public const uint DemonicCircleAllowCast = 62388;
|
||||
public const uint DemonicCircleSummon = 48018;
|
||||
public const uint DemonicCircleTeleport = 48020;
|
||||
public const uint DemonicEmpowermentFelguard = 54508;
|
||||
public const uint DemonicEmpowermentFelhunter = 54509;
|
||||
public const uint DemonicEmpowermentImp = 54444;
|
||||
public const uint DemonicEmpowermentSuccubus = 54435;
|
||||
public const uint DemonicEmpowermentVoidwalker = 54443;
|
||||
public const uint DemonSoulImp = 79459;
|
||||
public const uint DemonSoulFelhunter = 79460;
|
||||
public const uint DemonSoulFelguard = 79452;
|
||||
public const uint DemonSoulSuccubus = 79453;
|
||||
public const uint DemonSoulVoidwalker = 79454;
|
||||
public const uint DevourMagicHeal = 19658;
|
||||
public const uint FelSynergyHeal = 54181;
|
||||
public const uint GlyphOfDemonTraining = 56249;
|
||||
public const uint GlyphOfShadowflame = 63311;
|
||||
public const uint GlyphOfSoulSwap = 56226;
|
||||
public const uint GlyphOfSuccubus = 56250;
|
||||
public const uint HauntHeal = 48210;
|
||||
public const uint Immolate = 348;
|
||||
public const uint ImprovedHealthFunnelBuffR1 = 60955;
|
||||
public const uint ImprovedHealthFunnelBuffR2 = 60956;
|
||||
public const uint ImprovedHealthFunnelR1 = 18703;
|
||||
public const uint ImprovedHealthFunnelR2 = 18704;
|
||||
public const uint ImprovedSoulFirePct = 85383;
|
||||
public const uint ImprovedSoulFireState = 85385;
|
||||
public const uint NetherWard = 91711;
|
||||
public const uint NetherTalent = 91713;
|
||||
public const uint RainOfFire = 5740;
|
||||
public const uint RainOfFireDamage = 42223;
|
||||
public const uint SeedOfCorruptionDamage = 27285;
|
||||
public const uint SeedOfCorruptionGeneric = 32865;
|
||||
public const uint ShadowTrance = 17941;
|
||||
public const uint ShadowWard = 6229;
|
||||
public const uint Soulshatter = 32835;
|
||||
public const uint SoulSwapCdMarker = 94229;
|
||||
public const uint SoulSwapOverride = 86211;
|
||||
@@ -102,27 +81,6 @@ namespace Scripts.Spells.Warlock
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 17962 - Conflagrate - Updated to 4.3.4
|
||||
class spell_warl_conflagrate : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.Immolate);
|
||||
}
|
||||
|
||||
// 6.x dmg formula in tooltip
|
||||
// void HandleHit(uint effIndex)
|
||||
// {
|
||||
// if (AuraEffect aurEff = GetHitUnit().GetAuraEffect(SPELL_WARLOCK_IMMOLATE, 2, GetCaster().GetGUID()))
|
||||
// SetHitDamage(CalculatePct(aurEff.GetAmount(), HasSpellInfo().Effects[1].CalcValue(GetCaster())));
|
||||
// }
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
//OnEffectHitTarget.Add(new EffectHandler(spell_warl_conflagrate_SpellScript::HandleHit, 0, SpellIds._EFFECT_SCHOOL_DAMAGE);
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 77220 - Mastery: Chaotic Energies
|
||||
class spell_warl_chaotic_energies : AuraScript
|
||||
{
|
||||
@@ -173,38 +131,6 @@ namespace Scripts.Spells.Warlock
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 603 - Bane of Doom
|
||||
class spell_warl_bane_of_doom : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.BaneOfDoomEffect);
|
||||
}
|
||||
|
||||
public override bool Load()
|
||||
{
|
||||
return GetCaster() && GetCaster().IsTypeId(TypeId.Player);
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
if (!GetCaster())
|
||||
return;
|
||||
|
||||
AuraRemoveMode removeMode = GetTargetApplication().GetRemoveMode();
|
||||
if (removeMode != AuraRemoveMode.Death || !IsExpired())
|
||||
return;
|
||||
|
||||
if (GetCaster().ToPlayer().IsHonorOrXPTarget(GetTarget()))
|
||||
GetCaster().CastSpell(GetTarget(), SpellIds.BaneOfDoomEffect, true, null, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(OnRemove, 0, AuraType.PeriodicDamage, AuraEffectHandleModes.Real));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 48018 - Demonic Circle: Summon
|
||||
class spell_warl_demonic_circle_summon : AuraScript
|
||||
{
|
||||
@@ -268,103 +194,6 @@ namespace Scripts.Spells.Warlock
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 77801 - Demon Soul - Updated to 4.3.4
|
||||
class spell_warl_demon_soul : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.DemonSoulImp, SpellIds.DemonSoulFelhunter, SpellIds.DemonSoulFelguard, SpellIds.DemonSoulSuccubus, SpellIds.DemonSoulVoidwalker);
|
||||
}
|
||||
|
||||
void OnHitTarget(uint effIndex)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
Creature targetCreature = GetHitCreature();
|
||||
if (targetCreature)
|
||||
{
|
||||
if (targetCreature.IsPet())
|
||||
{
|
||||
CreatureTemplate ci = targetCreature.GetCreatureTemplate();
|
||||
switch (ci.Family)
|
||||
{
|
||||
case CreatureFamily.Succubus:
|
||||
caster.CastSpell(caster, SpellIds.DemonSoulSuccubus);
|
||||
break;
|
||||
case CreatureFamily.Voidwalker:
|
||||
caster.CastSpell(caster, SpellIds.DemonSoulVoidwalker);
|
||||
break;
|
||||
case CreatureFamily.Felguard:
|
||||
caster.CastSpell(caster, SpellIds.DemonSoulFelguard);
|
||||
break;
|
||||
case CreatureFamily.Felhunter:
|
||||
caster.CastSpell(caster, SpellIds.DemonSoulFelhunter);
|
||||
break;
|
||||
case CreatureFamily.Imp:
|
||||
caster.CastSpell(caster, SpellIds.DemonSoulImp);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(OnHitTarget, 0, SpellEffectName.ScriptEffect));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 47193 - Demonic Empowerment
|
||||
class spell_warl_demonic_empowerment : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.DemonicEmpowermentSuccubus, SpellIds.DemonicEmpowermentVoidwalker, SpellIds.DemonicEmpowermentFelguard, SpellIds.DemonicEmpowermentFelhunter, SpellIds.DemonicEmpowermentImp);
|
||||
}
|
||||
|
||||
void HandleScriptEffect(uint effIndex)
|
||||
{
|
||||
Creature targetCreature = GetHitCreature();
|
||||
if (targetCreature)
|
||||
{
|
||||
if (targetCreature.IsPet())
|
||||
{
|
||||
CreatureTemplate ci = targetCreature.GetCreatureTemplate();
|
||||
switch (ci.Family)
|
||||
{
|
||||
case CreatureFamily.Succubus:
|
||||
targetCreature.CastSpell(targetCreature, SpellIds.DemonicEmpowermentSuccubus, true);
|
||||
break;
|
||||
case CreatureFamily.Voidwalker:
|
||||
{
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.DemonicEmpowermentVoidwalker, GetCastDifficulty());
|
||||
int hp = (int)targetCreature.CountPctFromMaxHealth(GetCaster().CalculateSpellDamage(targetCreature, spellInfo, 0));
|
||||
targetCreature.CastCustomSpell(targetCreature, SpellIds.DemonicEmpowermentVoidwalker, hp, 0, 0, true);
|
||||
break;
|
||||
}
|
||||
case CreatureFamily.Felguard:
|
||||
targetCreature.CastSpell(targetCreature, SpellIds.DemonicEmpowermentFelguard, true);
|
||||
break;
|
||||
case CreatureFamily.Felhunter:
|
||||
targetCreature.CastSpell(targetCreature, SpellIds.DemonicEmpowermentFelhunter, true);
|
||||
break;
|
||||
case CreatureFamily.Imp:
|
||||
targetCreature.CastSpell(targetCreature, SpellIds.DemonicEmpowermentImp, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleScriptEffect, 0, SpellEffectName.ScriptEffect));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 67518, 19505 - Devour Magic
|
||||
class spell_warl_devour_magic : SpellScript
|
||||
{
|
||||
@@ -397,86 +226,6 @@ namespace Scripts.Spells.Warlock
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 47422 - Everlasting Affliction
|
||||
class spell_warl_everlasting_affliction : SpellScript
|
||||
{
|
||||
void HandleScriptEffect(uint effIndex)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
Unit target = GetHitUnit();
|
||||
if (target)
|
||||
{
|
||||
// Refresh corruption on target
|
||||
AuraEffect aurEff = target.GetAuraEffect(AuraType.PeriodicDamage, SpellFamilyNames.Warlock, new FlagArray128(0x2, 0, 0), caster.GetGUID());
|
||||
if (aurEff != null)
|
||||
{
|
||||
uint damage = (uint)Math.Max(aurEff.GetAmount(), 0);
|
||||
Global.ScriptMgr.ModifyPeriodicDamageAurasTick(target, caster, ref damage);
|
||||
aurEff.SetDamage((int)(caster.SpellDamageBonusDone(target, aurEff.GetSpellInfo(), damage, DamageEffectType.DOT, GetEffectInfo(effIndex)) * aurEff.GetDonePct()));
|
||||
aurEff.CalculatePeriodic(caster, false, false);
|
||||
aurEff.GetBase().RefreshDuration(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleScriptEffect, 0, SpellEffectName.ScriptEffect));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // -47230 - Fel Synergy
|
||||
class spell_warl_fel_synergy : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.FelSynergyHeal);
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo eventInfo)
|
||||
{
|
||||
DamageInfo damageInfo = eventInfo.GetDamageInfo();
|
||||
if (damageInfo == null || damageInfo.GetDamage() == 0)
|
||||
return false;
|
||||
|
||||
return GetTarget().GetGuardianPet();
|
||||
}
|
||||
|
||||
void onProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
int heal = (int)MathFunctions.CalculatePct(eventInfo.GetDamageInfo().GetDamage(), aurEff.GetAmount());
|
||||
GetTarget().CastCustomSpell(SpellIds.FelSynergyHeal, SpellValueMod.BasePoint0, heal, (Unit)null, true, null, aurEff); // TARGET_UNIT_PET
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new CheckProcHandler(CheckProc));
|
||||
OnEffectProc.Add(new EffectProcHandler(onProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 63310 - Glyph of Shadowflame
|
||||
class spell_warl_glyph_of_shadowflame : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.GlyphOfShadowflame);
|
||||
}
|
||||
|
||||
void onProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget().CastSpell(eventInfo.GetProcTarget(), SpellIds.GlyphOfShadowflame, true, null, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(onProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 48181 - Haunt
|
||||
class spell_warl_haunt : SpellScript
|
||||
{
|
||||
@@ -497,30 +246,6 @@ namespace Scripts.Spells.Warlock
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class spell_warl_haunt_AuraScript : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.HauntHeal);
|
||||
}
|
||||
|
||||
void HandleRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
if (caster)
|
||||
{
|
||||
int amount = aurEff.GetAmount();
|
||||
GetTarget().CastCustomSpell(caster, SpellIds.HauntHeal, amount, 0, 0, true, null, aurEff, GetCasterGUID());
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectRemove.Add(new EffectApplyHandler(HandleRemove, 1, AuraType.Dummy, AuraEffectHandleModes.RealOrReapplyMask));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 755 - Health Funnel
|
||||
class spell_warl_health_funnel : AuraScript
|
||||
{
|
||||
@@ -554,7 +279,7 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
Player modOwner = caster.GetSpellModOwner();
|
||||
if (modOwner)
|
||||
modOwner.ApplySpellMod(GetId(), SpellModOp.Cost, ref damage);
|
||||
modOwner.ApplySpellMod(GetSpellInfo(), SpellModOp.Cost, ref damage);
|
||||
|
||||
SpellNonMeleeDamage damageInfo = new SpellNonMeleeDamage(caster, caster, GetSpellInfo(), GetAura().GetSpellVisual(), GetSpellInfo().SchoolMask, GetAura().GetCastGUID());
|
||||
damageInfo.periodicLog = true;
|
||||
@@ -586,50 +311,6 @@ namespace Scripts.Spells.Warlock
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // -18119 - Improved Soul Fire
|
||||
class spell_warl_improved_soul_fire : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.ImprovedSoulFirePct, SpellIds.ImprovedSoulFireState);
|
||||
}
|
||||
|
||||
void onProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget().CastCustomSpell(SpellIds.ImprovedSoulFirePct, SpellValueMod.BasePoint0, aurEff.GetAmount(), GetTarget(), true, null, aurEff);
|
||||
GetTarget().CastSpell(GetTarget(), SpellIds.ImprovedSoulFireState, true, null, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(onProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
// 687 - Demon Armor
|
||||
[Script] // 28176 - Fel Armor
|
||||
class spell_warl_nether_ward_overrride : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.NetherTalent, SpellIds.NetherWard, SpellIds.ShadowWard);
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect aurEff, ref int amount, ref bool canBeRecalculated)
|
||||
{
|
||||
if (GetUnitOwner().HasAura(SpellIds.NetherTalent))
|
||||
amount = (int)SpellIds.NetherWard;
|
||||
else
|
||||
amount = (int)SpellIds.ShadowWard;
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalculateAmount, 2, AuraType.OverrideActionbarSpells));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 6358 - Seduction (Special Ability)
|
||||
class spell_warl_seduction : SpellScript
|
||||
{
|
||||
@@ -755,49 +436,6 @@ namespace Scripts.Spells.Warlock
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // -7235 - Shadow Ward
|
||||
class spell_warl_shadow_ward : AuraScript
|
||||
{
|
||||
void CalculateAmount(AuraEffect aurEff, ref int amount, ref bool canBeRecalculated)
|
||||
{
|
||||
canBeRecalculated = false;
|
||||
Unit caster = GetCaster();
|
||||
if (caster)
|
||||
{
|
||||
// +80.68% from sp bonus
|
||||
float bonus = 0.8068f;
|
||||
|
||||
bonus *= caster.SpellBaseHealingBonusDone(GetSpellInfo().GetSchoolMask());
|
||||
|
||||
amount += (int)bonus;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalculateAmount, 0, AuraType.SchoolAbsorb));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // -30293 - Soul Leech
|
||||
class spell_warl_soul_leech : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.GenReplenishment);
|
||||
}
|
||||
|
||||
void onProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
GetTarget().CastSpell((Unit)null, SpellIds.GenReplenishment, true, null, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(onProc, 0, AuraType.ProcTriggerSpellWithValue));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 86121 - Soul Swap
|
||||
class spell_warl_soul_swap : SpellScript
|
||||
{
|
||||
|
||||
@@ -46,33 +46,17 @@ namespace Scripts.Spells.Warrior
|
||||
public const uint ImpendingVictory = 202168;
|
||||
public const uint ImpendingVictoryHeal = 202166;
|
||||
public const uint ImprovedHeroicLeap = 157449;
|
||||
public const uint JuggernautCritBonusBuff = 65156;
|
||||
public const uint JuggernautCritBonusTalent = 64976;
|
||||
public const uint LastStandTriggered = 12976;
|
||||
public const uint MortalStrike = 12294;
|
||||
public const uint MortalWounds = 213667;
|
||||
public const uint RallyingCry = 97463;
|
||||
public const uint Rend = 94009;
|
||||
public const uint RetaliationDamage = 22858;
|
||||
public const uint SecoundWindProcRank1 = 29834;
|
||||
public const uint SecoundWindProcRank2 = 29838;
|
||||
public const uint SecoundWindTriggerRank1 = 29841;
|
||||
public const uint SecoundWindTriggerRank2 = 29842;
|
||||
public const uint ShieldSlam = 23922;
|
||||
public const uint Shockwave = 46968;
|
||||
public const uint ShockwaveStun = 132168;
|
||||
public const uint Slam = 50782;
|
||||
public const uint Stoicism = 70845;
|
||||
public const uint StormBoltStun = 132169;
|
||||
public const uint SweepingStrikesExtraAttack1 = 12723;
|
||||
public const uint SweepingStrikesExtraAttack2 = 26654;
|
||||
public const uint Taunt = 355;
|
||||
public const uint TraumaEffect = 215537;
|
||||
public const uint UnrelentingAssaultRank1 = 46859;
|
||||
public const uint UnrelentingAssaultRank2 = 46860;
|
||||
public const uint UnrelentingAssaultTrigger1 = 64849;
|
||||
public const uint UnrelentingAssaultTrigger2 = 64850;
|
||||
public const uint Vengeance = 76691;
|
||||
public const uint Victorious = 32216;
|
||||
public const uint VictoriousRushHeal = 118779;
|
||||
}
|
||||
@@ -192,61 +176,7 @@ namespace Scripts.Spells.Warrior
|
||||
}
|
||||
}
|
||||
|
||||
// Updated 4.3.4
|
||||
[Script]
|
||||
class spell_warr_concussion_blow : SpellScript
|
||||
{
|
||||
void HandleDummy(uint effIndex)
|
||||
{
|
||||
SetHitDamage((int)MathFunctions.CalculatePct(GetCaster().GetTotalAttackPowerValue(WeaponAttackType.BaseAttack), GetEffectValue()));
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 2, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
// Updated 4.3.4
|
||||
[Script] // 5308 - Execute
|
||||
class spell_warr_execute : SpellScript
|
||||
{
|
||||
void HandleEffect(uint effIndex)
|
||||
{
|
||||
/*
|
||||
Unit caster = GetCaster();
|
||||
if (GetHitUnit())
|
||||
{
|
||||
SpellInfo spellInfo = GetSpellInfo();
|
||||
int rageUsed = Math.Min(200 - spellInfo.CalcPowerCost(caster, spellInfo.SchoolMask), caster.GetPower(PowerType.Rage));
|
||||
int newRage = Math.Max(0, caster.GetPower(PowerType.Rage) - rageUsed);
|
||||
|
||||
// Sudden Death rage save
|
||||
AuraEffect aurEff = caster.GetAuraEffect(AuraType.ProcTriggerSpell, SpellFamilyNames.Generic, 1989, 0); // Icon SuddenDeath
|
||||
if (aurEff != null)
|
||||
{
|
||||
int ragesave = aurEff.GetSpellInfo().GetEffect(0).CalcValue() * 10;
|
||||
newRage = Math.Max(newRage, ragesave);
|
||||
}
|
||||
|
||||
caster.SetPower(PowerType.Rage, newRage);
|
||||
|
||||
// Formula taken from the DBC: "${10+$AP*0.437*$m1/100}"
|
||||
int baseDamage = (int)(10 + caster.GetTotalAttackPowerValue(WeaponAttackType.BaseAttack) * 0.437f * GetEffectValue() / 100.0f);
|
||||
// Formula taken from the DBC: "${$ap*0.874*$m1/100-1} = 20 rage"
|
||||
int moreDamage = (int)(rageUsed * (caster.GetTotalAttackPowerValue(WeaponAttackType.BaseAttack) * 0.874f * GetEffectValue() / 100.0f - 1) / 200);
|
||||
SetHitDamage(baseDamage + moreDamage);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleEffect, 0, SpellEffectName.SchoolDamage));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // Heroic leap - 6544
|
||||
[Script] // 6544 Heroic leap
|
||||
class spell_warr_heroic_leap : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
@@ -390,55 +320,8 @@ namespace Scripts.Spells.Warrior
|
||||
}
|
||||
}
|
||||
|
||||
// -84583 Lambs to the Slaughter
|
||||
[Script]
|
||||
class spell_warr_lambs_to_the_slaughter : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.MortalStrike, SpellIds.Rend);
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
Aura aur = eventInfo.GetProcTarget().GetAura(SpellIds.Rend, GetTarget().GetGUID());
|
||||
if (aur != null)
|
||||
aur.SetDuration(aur.GetSpellInfo().GetMaxDuration(), true);
|
||||
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.ProcTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
// Updated 4.3.4
|
||||
// 12975 - Last Stand
|
||||
[Script]
|
||||
class spell_warr_last_stand : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.LastStandTriggered);
|
||||
}
|
||||
|
||||
void HandleDummy(uint effIndex)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
int healthModSpellBasePoints0 = (int)(caster.CountPctFromMaxHealth(GetEffectValue()));
|
||||
caster.CastCustomSpell(caster, SpellIds.LastStandTriggered, healthModSpellBasePoints0, 0, 0, true, null);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
// add dummy effect spell handler to Last Stand
|
||||
OnEffectHit.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 12294 - Mortal Strike 7.1.5
|
||||
class spell_warr_mortal_strike_SpellScript : SpellScript
|
||||
class spell_warr_mortal_strike : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
@@ -458,31 +341,6 @@ namespace Scripts.Spells.Warrior
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 7384 - Overpower
|
||||
class spell_warr_overpower : SpellScript
|
||||
{
|
||||
void HandleEffect(uint effIndex)
|
||||
{
|
||||
uint spellId = 0;
|
||||
if (GetCaster().HasAura(SpellIds.UnrelentingAssaultRank1))
|
||||
spellId = SpellIds.UnrelentingAssaultTrigger1;
|
||||
else if (GetCaster().HasAura(SpellIds.UnrelentingAssaultRank2))
|
||||
spellId = SpellIds.UnrelentingAssaultTrigger2;
|
||||
|
||||
if (spellId == 0)
|
||||
return;
|
||||
|
||||
Player target = GetHitPlayer();
|
||||
if (target)
|
||||
if (target.IsNonMeleeSpellCast(false, false, true)) // UNIT_STATE_CASTING should not be used here, it's present during a tick for instant casts
|
||||
target.CastSpell(target, spellId, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleEffect, 0, SpellEffectName.Any));
|
||||
}
|
||||
}
|
||||
[Script] // 97462 - Rallying Cry
|
||||
class spell_warr_rallying_cry : SpellScript
|
||||
{
|
||||
@@ -509,157 +367,6 @@ namespace Scripts.Spells.Warrior
|
||||
}
|
||||
}
|
||||
|
||||
// 94009 - Rend
|
||||
[Script]
|
||||
class spell_warr_rend : AuraScript
|
||||
{
|
||||
void CalculateAmount(AuraEffect aurEff, ref int amount, ref bool canBeRecalculated)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
if (caster)
|
||||
{
|
||||
canBeRecalculated = false;
|
||||
|
||||
// $0.25 * (($MWB + $mwb) / 2 + $AP / 14 * $MWS) bonus per tick
|
||||
float ap = caster.GetTotalAttackPowerValue(WeaponAttackType.BaseAttack);
|
||||
int mws = (int)caster.GetBaseAttackTime(WeaponAttackType.BaseAttack);
|
||||
float mwbMin = caster.GetWeaponDamageRange(WeaponAttackType.BaseAttack, WeaponDamageRange.MinDamage);
|
||||
float mwbMax = caster.GetWeaponDamageRange(WeaponAttackType.BaseAttack, WeaponDamageRange.MaxDamage);
|
||||
float mwb = ((mwbMin + mwbMax) / 2 + ap * mws / 14000) * 0.25f;
|
||||
amount += (int)(caster.ApplyEffectModifiers(GetSpellInfo(), aurEff.GetEffIndex(), mwb));
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalculateAmount, 0, AuraType.PeriodicDamage));
|
||||
}
|
||||
}
|
||||
|
||||
// 20230 - Retaliation
|
||||
[Script]
|
||||
class spell_warr_retaliation : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.RetaliationDamage);
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo eventInfo)
|
||||
{
|
||||
// check attack comes not from behind and warrior is not stunned
|
||||
return GetTarget().IsInFront(eventInfo.GetProcTarget(), MathFunctions.PI) && !GetTarget().HasUnitState(UnitState.Stunned);
|
||||
}
|
||||
|
||||
void HandleEffectProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget().CastSpell(eventInfo.GetProcTarget(), SpellIds.RetaliationDamage, true, null, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new CheckProcHandler(CheckProc));
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleEffectProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
// 64380, 65941 - Shattering Throw
|
||||
[Script]
|
||||
class spell_warr_shattering_throw : SpellScript
|
||||
{
|
||||
void HandleScript(uint effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
|
||||
// Remove shields, will still display immune to damage part
|
||||
Unit target = GetHitUnit();
|
||||
if (target)
|
||||
target.RemoveAurasWithMechanic(1 << (int)Mechanics.ImmuneShield, AuraRemoveMode.EnemySpell);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleScript, 0, SpellEffectName.ScriptEffect));
|
||||
}
|
||||
}
|
||||
|
||||
// Updated 4.3.4
|
||||
[Script]
|
||||
class spell_warr_slam : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.Slam);
|
||||
}
|
||||
|
||||
void HandleDummy(uint effIndex)
|
||||
{
|
||||
if (GetHitUnit())
|
||||
GetCaster().CastCustomSpell(SpellIds.Slam, SpellValueMod.BasePoint0, GetEffectValue(), GetHitUnit(), TriggerCastFlags.FullMask);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class spell_warr_second_wind_proc : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.SecoundWindProcRank1, SpellIds.SecoundWindProcRank2, SpellIds.SecoundWindTriggerRank1, SpellIds.SecoundWindTriggerRank2);
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo eventInfo)
|
||||
{
|
||||
if (eventInfo.GetProcTarget() == GetTarget())
|
||||
return false;
|
||||
if (eventInfo.GetDamageInfo().GetSpellInfo() == null ||
|
||||
(eventInfo.GetDamageInfo().GetSpellInfo().GetAllEffectsMechanicMask() & ((1 << (int)Mechanics.Root) | (1 << (int)Mechanics.Stun))) == 0)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
uint spellId = 0;
|
||||
|
||||
if (GetSpellInfo().Id == SpellIds.SecoundWindProcRank1)
|
||||
spellId = SpellIds.SecoundWindTriggerRank1;
|
||||
else if (GetSpellInfo().Id == SpellIds.SecoundWindProcRank2)
|
||||
spellId = SpellIds.SecoundWindTriggerRank2;
|
||||
if (spellId == 0)
|
||||
return;
|
||||
|
||||
GetTarget().CastSpell(GetTarget(), spellId, true, null, aurEff);
|
||||
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new CheckProcHandler(CheckProc));
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class spell_warr_second_wind_trigger : AuraScript
|
||||
{
|
||||
void CalculateAmount(AuraEffect aurEff, ref int amount, ref bool canBeRecalculated)
|
||||
{
|
||||
amount = (int)(GetUnitOwner().CountPctFromMaxHealth(amount));
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalculateAmount, 1, AuraType.PeriodicHeal));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 46968 - Shockwave
|
||||
class spell_warr_shockwave : SpellScript
|
||||
{
|
||||
@@ -784,29 +491,6 @@ namespace Scripts.Spells.Warrior
|
||||
Unit _procTarget;
|
||||
}
|
||||
|
||||
// -46951 - Sword and Board
|
||||
[Script]
|
||||
class spell_warr_sword_and_board : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.ShieldSlam);
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
// Remove cooldown on Shield Slam
|
||||
Player player = GetTarget().ToPlayer();
|
||||
if (player)
|
||||
player.GetSpellHistory().ResetCooldown(SpellIds.ShieldSlam, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.ProcTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 215538 - Trauma
|
||||
class spell_warr_trauma : AuraScript
|
||||
{
|
||||
@@ -896,74 +580,4 @@ namespace Scripts.Spells.Warrior
|
||||
AfterCast.Add(new CastHandler(HandleHeal));
|
||||
}
|
||||
}
|
||||
|
||||
// 50720 - Vigilance
|
||||
[Script]
|
||||
class spell_warr_vigilance : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.Vengeance);
|
||||
}
|
||||
|
||||
public override bool Load()
|
||||
{
|
||||
//_procTarget = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*bool CheckProc(ProcEventInfo eventInfo)
|
||||
{
|
||||
_procTarget = GetCaster();
|
||||
return _procTarget && eventInfo.GetDamageInfo() != null;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
int damage = (int)(MathFunctions.CalculatePct(eventInfo.GetDamageInfo().GetDamage(), aurEff.GetSpellInfo().GetEffect(1).CalcValue()));
|
||||
|
||||
GetTarget().CastSpell(_procTarget, SpellIds.VigilanceProc, true, null, aurEff);
|
||||
_procTarget.CastCustomSpell(_procTarget, SpellIds.Vengeance, damage, damage, damage, true, null, aurEff);
|
||||
}*/
|
||||
|
||||
void HandleRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
if (caster)
|
||||
{
|
||||
if (caster.HasAura(SpellIds.Vengeance))
|
||||
caster.RemoveAurasDueToSpell(SpellIds.Vengeance);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
//DoCheckProc.Add(new CheckProcHandler(CheckProc));
|
||||
//OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.ProcTriggerSpell));
|
||||
OnEffectRemove.Add(new EffectApplyHandler(HandleRemove, 0, AuraType.ProcTriggerSpell, AuraEffectHandleModes.Real));
|
||||
}
|
||||
|
||||
//Unit _procTarget;
|
||||
}
|
||||
|
||||
// 50725 Vigilance
|
||||
[Script]
|
||||
class spell_warr_vigilance_trigger : SpellScript
|
||||
{
|
||||
void HandleScript(uint effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
|
||||
// Remove Taunt cooldown
|
||||
Player target = GetHitPlayer();
|
||||
if (target)
|
||||
target.GetSpellHistory().ResetCooldown(SpellIds.Taunt, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleScript, 0, SpellEffectName.ScriptEffect));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user