Updated all spell scripts.
This commit is contained in:
+127
-113
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Framework.Constants;
|
||||
@@ -8,54 +8,16 @@ using Game.Scripting;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Scripts.Spells.Azerite
|
||||
{
|
||||
struct SpellIds
|
||||
{
|
||||
// Strengthinnumbers
|
||||
public const uint StrengthInNumbersTrait = 271546;
|
||||
public const uint StrengthInNumbersBuff = 271550;
|
||||
|
||||
// Blessedportents
|
||||
public const uint BlessedPortentsTrait = 267889;
|
||||
public const uint BlessedPortentsHeal = 280052;
|
||||
|
||||
// Concentratedmending
|
||||
public const uint ConcentratedMendingTrait = 267882;
|
||||
|
||||
// Bracingchill
|
||||
public const uint BracingChillTrait = 267884;
|
||||
public const uint BracingChill = 272276;
|
||||
public const uint BracingChillHeal = 272428;
|
||||
public const uint BracingChillSearchJumpTarget = 272436;
|
||||
|
||||
// Orbitalprecision
|
||||
public const uint MageFrozenOrb = 84714;
|
||||
|
||||
// Bluroftalons
|
||||
public const uint HunterCoordinatedAssault = 266779;
|
||||
|
||||
// Tradewinds
|
||||
public const uint TradewindsAllyBuff = 281844;
|
||||
|
||||
// Bastion of Might
|
||||
public const uint WarriorIgnorePain = 190456;
|
||||
|
||||
// Echoing Blades
|
||||
public const uint EchoingBladesTrait = 287649;
|
||||
|
||||
// Hour of Reaping
|
||||
|
||||
public const uint DHSoulBarrier = 263648;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class spell_azerite_gen_aura_calc_from_2nd_effect_triggered_spell : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellEffect(spellInfo.Id, 1) && ValidateSpellInfo(spellInfo.GetEffect(1).TriggerSpell);
|
||||
return ValidateSpellEffect((spellInfo.Id, 1)) && ValidateSpellInfo(spellInfo.GetEffect(1).TriggerSpell);
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect aurEff, ref int amount, ref bool canBeRecalculated)
|
||||
@@ -63,18 +25,17 @@ namespace Scripts.Spells.Azerite
|
||||
Unit caster = GetCaster();
|
||||
if (caster != null)
|
||||
{
|
||||
AuraEffect trait = caster.GetAuraEffect(GetEffectInfo(1).TriggerSpell, 0);
|
||||
if (trait != null)
|
||||
{
|
||||
amount = trait.GetAmount();
|
||||
canBeRecalculated = false;
|
||||
}
|
||||
amount = 0;
|
||||
canBeRecalculated = false;
|
||||
foreach (var (_, aurApp) in caster.GetAppliedAuras().Where(pair => pair.Key == GetEffectInfo(1).TriggerSpell))
|
||||
if (aurApp.HasEffect(0))
|
||||
amount += aurApp.GetBase().GetEffect(0).GetAmount();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalculateAmount, 0, AuraType.ModRating));
|
||||
DoEffectCalcAmount.Add(new(CalculateAmount, 0, AuraType.ModRating));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,26 +56,29 @@ namespace Scripts.Spells.Azerite
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckEffectProc.Add(new CheckEffectProcHandler(CheckProc, 0, AuraType.ProcTriggerSpell));
|
||||
DoCheckEffectProc.Add(new(CheckProc, 0, AuraType.ProcTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 271548 - Strength in Numbers
|
||||
class spell_item_strength_in_numbers : SpellScript
|
||||
{
|
||||
const uint SpellStrengthInNumbersTrait = 271546;
|
||||
const uint SpellStrengthInNumbersBuff = 271550;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.StrengthInNumbersTrait, SpellIds.StrengthInNumbersBuff);
|
||||
return ValidateSpellInfo(SpellStrengthInNumbersTrait, SpellStrengthInNumbersBuff);
|
||||
}
|
||||
|
||||
void TriggerHealthBuff()
|
||||
{
|
||||
AuraEffect trait = GetCaster().GetAuraEffect(SpellIds.StrengthInNumbersTrait, 0, GetCaster().GetGUID());
|
||||
AuraEffect trait = GetCaster().GetAuraEffect(SpellStrengthInNumbersTrait, 0, GetCaster().GetGUID());
|
||||
if (trait != null)
|
||||
{
|
||||
long enemies = GetUnitTargetCountForEffect(0);
|
||||
if (enemies != 0)
|
||||
GetCaster().CastSpell(GetCaster(), SpellIds.StrengthInNumbersBuff, new CastSpellExtraArgs(TriggerCastFlags.FullMask)
|
||||
GetCaster().CastSpell(GetCaster(), SpellStrengthInNumbersBuff, new CastSpellExtraArgs(TriggerCastFlags.FullMask)
|
||||
.AddSpellMod(SpellValueMod.BasePoint0, trait.GetAmount())
|
||||
.AddSpellMod(SpellValueMod.AuraStack, (int)enemies));
|
||||
}
|
||||
@@ -122,16 +86,19 @@ namespace Scripts.Spells.Azerite
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterHit.Add(new HitHandler(TriggerHealthBuff));
|
||||
AfterHit.Add(new(TriggerHealthBuff));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 271843 - Blessed Portents
|
||||
class spell_item_blessed_portents : AuraScript
|
||||
{
|
||||
const uint SpellBlessedPortentsTrait = 267889;
|
||||
const uint SpellBlessedPortentsHeal = 280052;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.BlessedPortentsTrait, SpellIds.BlessedPortentsHeal);
|
||||
return ValidateSpellInfo(SpellBlessedPortentsTrait, SpellBlessedPortentsHeal);
|
||||
}
|
||||
|
||||
void CheckProc(AuraEffect aurEff, DamageInfo dmgInfo, ref uint absorbAmount)
|
||||
@@ -141,10 +108,10 @@ namespace Scripts.Spells.Azerite
|
||||
Unit caster = GetCaster();
|
||||
if (caster != null)
|
||||
{
|
||||
AuraEffect trait = caster.GetAuraEffect(SpellIds.BlessedPortentsTrait, 0, caster.GetGUID());
|
||||
AuraEffect trait = caster.GetAuraEffect(SpellBlessedPortentsTrait, 0, caster.GetGUID());
|
||||
if (trait != null)
|
||||
caster.CastSpell(GetTarget(), SpellIds.BlessedPortentsHeal, new CastSpellExtraArgs(TriggerCastFlags.FullMask)
|
||||
.AddSpellMod(SpellValueMod.BasePoint0, trait.GetAmount()));
|
||||
caster.CastSpell(GetTarget(), SpellBlessedPortentsHeal, new CastSpellExtraArgs(TriggerCastFlags.FullMask)
|
||||
.AddSpellMod(SpellValueMod.BasePoint0, trait.GetAmount()));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -153,16 +120,18 @@ namespace Scripts.Spells.Azerite
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectAbsorb.Add(new EffectAbsorbHandler(CheckProc, 0));
|
||||
OnEffectAbsorb.Add(new(CheckProc, 0));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 272260 - Concentrated Mending
|
||||
class spell_item_concentrated_mending : AuraScript
|
||||
{
|
||||
const uint SpellConcentratedMendingTrait = 267882;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.ConcentratedMendingTrait);
|
||||
return ValidateSpellInfo(SpellConcentratedMendingTrait);
|
||||
}
|
||||
|
||||
void RecalculateHealAmount(AuraEffect aurEff)
|
||||
@@ -170,7 +139,7 @@ namespace Scripts.Spells.Azerite
|
||||
Unit caster = GetCaster();
|
||||
if (caster != null)
|
||||
{
|
||||
AuraEffect trait = caster.GetAuraEffect(SpellIds.ConcentratedMendingTrait, 0, caster.GetGUID());
|
||||
AuraEffect trait = caster.GetAuraEffect(SpellConcentratedMendingTrait, 0, caster.GetGUID());
|
||||
if (trait != null)
|
||||
aurEff.ChangeAmount((int)(trait.GetAmount() * aurEff.GetTickNumber()));
|
||||
}
|
||||
@@ -178,16 +147,20 @@ namespace Scripts.Spells.Azerite
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectUpdatePeriodic.Add(new EffectUpdatePeriodicHandler(RecalculateHealAmount, 0, AuraType.PeriodicHeal));
|
||||
OnEffectUpdatePeriodic.Add(new(RecalculateHealAmount, 0, AuraType.PeriodicHeal));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 272276 - Bracing Chill
|
||||
class spell_item_bracing_chill_proc : AuraScript
|
||||
{
|
||||
const uint SpellBracingChillTrait = 267884;
|
||||
const uint SpellBracingChillHeal = 272428;
|
||||
const uint SpellBracingChillSearchJumpTarget = 272436;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.BracingChillTrait, SpellIds.BracingChillHeal, SpellIds.BracingChillSearchJumpTarget);
|
||||
return ValidateSpellInfo(SpellBracingChillTrait, SpellBracingChillHeal, SpellBracingChillSearchJumpTarget);
|
||||
}
|
||||
|
||||
bool CheckHealCaster(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
@@ -198,16 +171,16 @@ namespace Scripts.Spells.Azerite
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo procInfo)
|
||||
{
|
||||
Unit caster = procInfo.GetActor();
|
||||
if (!caster)
|
||||
if (caster == null)
|
||||
return;
|
||||
|
||||
AuraEffect trait = caster.GetAuraEffect(SpellIds.BracingChillTrait, 0, caster.GetGUID());
|
||||
AuraEffect trait = caster.GetAuraEffect(SpellBracingChillTrait, 0, caster.GetGUID());
|
||||
if (trait != null)
|
||||
caster.CastSpell(procInfo.GetProcTarget(), SpellIds.BracingChillHeal,
|
||||
caster.CastSpell(procInfo.GetProcTarget(), SpellBracingChillHeal,
|
||||
new CastSpellExtraArgs(TriggerCastFlags.FullMask).AddSpellMod(SpellValueMod.BasePoint0, trait.GetAmount()));
|
||||
|
||||
if (GetStackAmount() > 1)
|
||||
caster.CastSpell((WorldObject)null, SpellIds.BracingChillSearchJumpTarget,
|
||||
caster.CastSpell(null, SpellBracingChillSearchJumpTarget,
|
||||
new CastSpellExtraArgs(TriggerCastFlags.FullMask).AddSpellMod(SpellValueMod.AuraStack, GetStackAmount() - 1));
|
||||
|
||||
Remove();
|
||||
@@ -215,24 +188,23 @@ namespace Scripts.Spells.Azerite
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckEffectProc.Add(new CheckEffectProcHandler(CheckHealCaster, 0, AuraType.Dummy));
|
||||
AfterEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
DoCheckEffectProc.Add(new(CheckHealCaster, 0, AuraType.Dummy));
|
||||
AfterEffectProc.Add(new(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 272436 - Bracing Chill
|
||||
class spell_item_bracing_chill_search_jump_target : SpellScript
|
||||
{
|
||||
const uint SpellBracingChill = 272276;
|
||||
|
||||
void FilterTarget(List<WorldObject> targets)
|
||||
{
|
||||
if (targets.Empty())
|
||||
return;
|
||||
|
||||
List<WorldObject> copy = new(targets);
|
||||
copy.RandomResize(target =>
|
||||
{
|
||||
return target.IsUnit() && !target.ToUnit().HasAura(SpellIds.BracingChill, GetCaster().GetGUID());
|
||||
}, 1);
|
||||
copy.RandomResize(target => target.IsUnit() && !target.ToUnit().HasAura(SpellBracingChill, GetCaster().GetGUID()), 1);
|
||||
|
||||
if (!copy.Empty())
|
||||
{
|
||||
@@ -248,14 +220,14 @@ namespace Scripts.Spells.Azerite
|
||||
|
||||
void MoveAura(uint effIndex)
|
||||
{
|
||||
GetCaster().CastSpell(GetHitUnit(), SpellIds.BracingChill,
|
||||
GetCaster().CastSpell(GetHitUnit(), SpellBracingChill,
|
||||
new CastSpellExtraArgs(TriggerCastFlags.FullMask).AddSpellMod(SpellValueMod.AuraStack, GetSpellValue().AuraStackAmount));
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(FilterTarget, 0, Targets.UnitDestAreaAlly));
|
||||
OnEffectHitTarget.Add(new EffectHandler(MoveAura, 0, SpellEffectName.Dummy));
|
||||
OnObjectAreaTargetSelect.Add(new(FilterTarget, 0, Targets.UnitDestAreaAlly));
|
||||
OnEffectHitTarget.Add(new(MoveAura, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,45 +241,80 @@ namespace Scripts.Spells.Azerite
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckEffectProc.Add(new CheckEffectProcHandler(CheckHealthPct, 0, AuraType.ProcTriggerSpell));
|
||||
DoCheckEffectProc.Add(new(CheckHealthPct, 0, AuraType.ProcTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 272892 - Wracking Brilliance
|
||||
class spell_item_wracking_brilliance : AuraScript
|
||||
{
|
||||
const uint SpellAgonySoulShardGain = 210067;
|
||||
|
||||
bool _canTrigger = true;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellAgonySoulShardGain);
|
||||
}
|
||||
|
||||
bool CheckProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
SpellInfo spellInfo = eventInfo.GetSpellInfo();
|
||||
if (spellInfo == null)
|
||||
return false;
|
||||
|
||||
if (spellInfo.Id != SpellAgonySoulShardGain)
|
||||
return false;
|
||||
|
||||
_canTrigger = !_canTrigger; // every other soul shard gain
|
||||
return _canTrigger;
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckEffectProc.Add(new(CheckProc, 0, AuraType.ProcTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 275514 - Orbital Precision
|
||||
class spell_item_orbital_precision : AuraScript
|
||||
{
|
||||
const uint SpellMageFrozenOrb = 84714;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.MageFrozenOrb);
|
||||
return ValidateSpellInfo(SpellMageFrozenOrb);
|
||||
}
|
||||
|
||||
bool CheckFrozenOrbActive(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
return eventInfo.GetActor().GetAreaTrigger(SpellIds.MageFrozenOrb) != null;
|
||||
return eventInfo.GetActor().GetAreaTrigger(SpellMageFrozenOrb) != null;
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckEffectProc.Add(new CheckEffectProcHandler(CheckFrozenOrbActive, 0, AuraType.ProcTriggerSpell));
|
||||
DoCheckEffectProc.Add(new(CheckFrozenOrbActive, 0, AuraType.ProcTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 277966 - Blur of Talons
|
||||
class spell_item_blur_of_talons : AuraScript
|
||||
{
|
||||
const uint SpellHunterCoordinatedAssault = 266779;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.HunterCoordinatedAssault);
|
||||
return ValidateSpellInfo(SpellHunterCoordinatedAssault);
|
||||
}
|
||||
|
||||
bool CheckCoordinatedAssaultActive(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
return eventInfo.GetActor().HasAura(SpellIds.HunterCoordinatedAssault, eventInfo.GetActor().GetGUID());
|
||||
return eventInfo.GetActor().HasAura(SpellHunterCoordinatedAssault, eventInfo.GetActor().GetGUID());
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckEffectProc.Add(new CheckEffectProcHandler(CheckCoordinatedAssaultActive, 0, AuraType.ProcTriggerSpell));
|
||||
DoCheckEffectProc.Add(new(CheckCoordinatedAssaultActive, 0, AuraType.ProcTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -321,7 +328,7 @@ namespace Scripts.Spells.Azerite
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckEffectProc.Add(new CheckEffectProcHandler(CheckHealthPct, 0, AuraType.ProcTriggerSpell));
|
||||
DoCheckEffectProc.Add(new(CheckHealthPct, 0, AuraType.ProcTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,57 +342,63 @@ namespace Scripts.Spells.Azerite
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectProc.Add(new EffectProcHandler(HandleProc, 1, AuraType.Dummy));
|
||||
AfterEffectProc.Add(new(HandleProc, 1, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 281843 - Tradewinds
|
||||
class spell_item_tradewinds : AuraScript
|
||||
{
|
||||
const uint SpellTradewindsAllyBuff = 281844;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.TradewindsAllyBuff);
|
||||
return ValidateSpellInfo(SpellTradewindsAllyBuff);
|
||||
}
|
||||
|
||||
void HandleRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
AuraEffect trait = GetTarget().GetAuraEffect(GetEffectInfo(1).TriggerSpell, 1);
|
||||
if (trait != null)
|
||||
GetTarget().CastSpell((WorldObject)null, SpellIds.TradewindsAllyBuff,
|
||||
GetTarget().CastSpell(null, SpellTradewindsAllyBuff,
|
||||
new CastSpellExtraArgs(aurEff).AddSpellMod(SpellValueMod.BasePoint0, trait.GetAmount()));
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(HandleRemove, 0, AuraType.ModRating, AuraEffectHandleModes.Real));
|
||||
AfterEffectRemove.Add(new(HandleRemove, 0, AuraType.ModRating, AuraEffectHandleModes.Real));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 287379 - Bastion of Might
|
||||
class spell_item_bastion_of_might : SpellScript
|
||||
{
|
||||
const uint SpellWarriorIgnorePain = 190456;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.WarriorIgnorePain);
|
||||
return ValidateSpellInfo(SpellWarriorIgnorePain);
|
||||
}
|
||||
|
||||
void TriggerIgnorePain()
|
||||
{
|
||||
GetCaster().CastSpell(GetCaster(), SpellIds.WarriorIgnorePain, GetSpell());
|
||||
GetCaster().CastSpell(GetCaster(), SpellWarriorIgnorePain, GetSpell());
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterHit.Add(new HitHandler(TriggerIgnorePain));
|
||||
AfterHit.Add(new(TriggerIgnorePain));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 287650 - Echoing Blades
|
||||
class spell_item_echoing_blades : AuraScript
|
||||
{
|
||||
ObjectGuid _lastFanOfKnives;
|
||||
|
||||
void PrepareProc(ProcEventInfo eventInfo)
|
||||
{
|
||||
if (eventInfo.GetProcSpell())
|
||||
if (eventInfo.GetProcSpell() != null)
|
||||
{
|
||||
if (eventInfo.GetProcSpell().m_castId != _lastFanOfKnives)
|
||||
GetEffect(0).RecalculateAmount();
|
||||
@@ -406,26 +419,25 @@ namespace Scripts.Spells.Azerite
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoPrepareProc.Add(new AuraProcHandler(PrepareProc));
|
||||
DoCheckEffectProc.Add(new CheckEffectProcHandler(CheckFanOfKnivesCounter, 0, AuraType.ProcTriggerSpell));
|
||||
AfterEffectProc.Add(new EffectProcHandler(ReduceCounter, 0, AuraType.ProcTriggerSpell));
|
||||
DoPrepareProc.Add(new(PrepareProc));
|
||||
DoCheckEffectProc.Add(new(CheckFanOfKnivesCounter, 0, AuraType.ProcTriggerSpell));
|
||||
AfterEffectProc.Add(new(ReduceCounter, 0, AuraType.ProcTriggerSpell));
|
||||
}
|
||||
|
||||
ObjectGuid _lastFanOfKnives;
|
||||
}
|
||||
|
||||
[Script] // 287653 - Echoing Blades
|
||||
class spell_item_echoing_blades_damage : SpellScript
|
||||
{
|
||||
const uint SpellEchoingBladesTrait = 287649;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.EchoingBladesTrait)
|
||||
&& ValidateSpellEffect(SpellIds.EchoingBladesTrait, 2);
|
||||
return ValidateSpellEffect((SpellEchoingBladesTrait, 2));
|
||||
}
|
||||
|
||||
void CalculateDamage(Unit victim, ref int damage, ref int flatMod, ref float pctMod)
|
||||
{
|
||||
AuraEffect trait = GetCaster().GetAuraEffect(SpellIds.EchoingBladesTrait, 2);
|
||||
AuraEffect trait = GetCaster().GetAuraEffect(SpellEchoingBladesTrait, 2);
|
||||
if (trait != null)
|
||||
damage = trait.GetAmount() * 2;
|
||||
}
|
||||
@@ -437,17 +449,19 @@ namespace Scripts.Spells.Azerite
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
CalcDamage.Add(new DamageAndHealingCalcHandler(CalculateDamage));
|
||||
OnCalcCritChance.Add(new OnCalcCritChanceHandler(ForceCritical));
|
||||
CalcDamage.Add(new(CalculateDamage));
|
||||
OnCalcCritChance.Add(new(ForceCritical));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 288882 - Hour of Reaping
|
||||
class spell_item_hour_of_reaping : AuraScript
|
||||
{
|
||||
const uint SpellDhSoulBarrier = 263648;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.DHSoulBarrier);
|
||||
return ValidateSpellInfo(SpellDhSoulBarrier);
|
||||
}
|
||||
|
||||
bool CheckProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
@@ -457,13 +471,13 @@ namespace Scripts.Spells.Azerite
|
||||
|
||||
void TriggerSoulBarrier(AuraEffect aurEff, ProcEventInfo procInfo)
|
||||
{
|
||||
GetTarget().CastSpell(GetTarget(), SpellIds.DHSoulBarrier, new CastSpellExtraArgs(aurEff));
|
||||
GetTarget().CastSpell(GetTarget(), SpellDhSoulBarrier, new CastSpellExtraArgs(aurEff));
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckEffectProc.Add(new CheckEffectProcHandler(CheckProc, 0, AuraType.Dummy));
|
||||
AfterEffectProc.Add(new EffectProcHandler(TriggerSoulBarrier, 0, AuraType.Dummy));
|
||||
DoCheckEffectProc.Add(new(CheckProc, 0, AuraType.Dummy));
|
||||
AfterEffectProc.Add(new(TriggerSoulBarrier, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -482,7 +496,7 @@ namespace Scripts.Spells.Azerite
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckEffectProc.Add(new CheckEffectProcHandler(CheckProc, 0, AuraType.ProcTriggerSpell));
|
||||
DoCheckEffectProc.Add(new(CheckProc, 0, AuraType.ProcTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -495,7 +509,7 @@ namespace Scripts.Spells.Azerite
|
||||
return true;
|
||||
|
||||
Spell procSpell = eventInfo.GetProcSpell();
|
||||
if (!procSpell)
|
||||
if (procSpell == null)
|
||||
return false;
|
||||
|
||||
bool isCrowdControl = procSpell.GetSpellInfo().HasAura(AuraType.ModConfuse)
|
||||
@@ -515,7 +529,7 @@ namespace Scripts.Spells.Azerite
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new CheckProcHandler(CheckProc));
|
||||
DoCheckProc.Add(new(CheckProc));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -547,8 +561,8 @@ namespace Scripts.Spells.Azerite
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectApply.Add(new EffectApplyHandler(SetEquippedFlag, 0, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
OnEffectRemove.Add(new EffectApplyHandler(ClearEquippedFlag, 0, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
OnEffectApply.Add(new(SetEquippedFlag, 0, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
OnEffectRemove.Add(new(ClearEquippedFlag, 0, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -563,13 +577,13 @@ namespace Scripts.Spells.Azerite
|
||||
void CalcAmount(AuraEffect aurEff, ref int amount, ref bool canBeRecalculated)
|
||||
{
|
||||
Player player = GetUnitOwner().ToPlayer();
|
||||
amount = (int)Math.Clamp(10.0f + player.GetRatingBonusValue(CombatRating.Corruption) - player.GetRatingBonusValue(CombatRating.CorruptionResistance), 0.0f, 99.0f);
|
||||
amount = (int)MathFunctions.Clamp(10.0f + player.GetRatingBonusValue(CombatRating.Corruption) - player.GetRatingBonusValue(CombatRating.CorruptionResistance), 0.0f, 99.0f);
|
||||
canBeRecalculated = false;
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalcAmount, 0, AuraType.ModDecreaseSpeed));
|
||||
DoEffectCalcAmount.Add(new(CalcAmount, 0, AuraType.ModDecreaseSpeed));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Framework.Constants;
|
||||
@@ -9,6 +9,7 @@ using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using static Global;
|
||||
|
||||
namespace Scripts.Spells.DeathKnight
|
||||
{
|
||||
@@ -24,13 +25,13 @@ namespace Scripts.Spells.DeathKnight
|
||||
public const uint BloodPlague = 55078;
|
||||
public const uint BloodShieldAbsorb = 77535;
|
||||
public const uint BloodShieldMastery = 77513;
|
||||
public const uint BreathOfSindragosa = 152279;
|
||||
public const uint CorpseExplosionTriggered = 43999;
|
||||
public const uint DeathAndDecayDamage = 52212;
|
||||
public const uint DeathCoilDamage = 47632;
|
||||
public const uint DeathGripDummy = 243912;
|
||||
public const uint DeathGripJump = 49575;
|
||||
public const uint DeathGripTaunt = 51399;
|
||||
public const uint DeathStrikeEnabler = 89832; //Server Side
|
||||
public const uint DeathStrikeHeal = 45470;
|
||||
public const uint DeathStrikeOffhand = 66188;
|
||||
public const uint FesteringWound = 194310;
|
||||
@@ -45,33 +46,20 @@ namespace Scripts.Spells.DeathKnight
|
||||
public const uint NecrosisEffect = 216974;
|
||||
public const uint Obliteration = 281238;
|
||||
public const uint ObliterationRuneEnergize = 281327;
|
||||
public const uint PillarOfFrost = 51271;
|
||||
public const uint RaiseDeadSummon = 52150;
|
||||
public const uint RecentlyUsedDeathStrike = 180612;
|
||||
public const uint RunicPowerEnergize = 49088;
|
||||
public const uint RunicReturn = 61258;
|
||||
public const uint SludgeBelcher = 207313;
|
||||
public const uint SludgeBelcherSummon = 212027;
|
||||
public const uint DeathStrikeEnabler = 89832; // Server Side
|
||||
public const uint TighteningGrasp = 206970;
|
||||
public const uint TighteningGraspSlow = 143375;
|
||||
public const uint Unholy = 137007;
|
||||
public const uint UnholyVigor = 196263;
|
||||
public const uint VolatileShielding = 207188;
|
||||
public const uint VolatileShieldingDamage = 207194;
|
||||
|
||||
public static uint[] ArmyTransforms =
|
||||
{
|
||||
ArmyFleshBeastTransform,
|
||||
ArmyGeistTransform,
|
||||
ArmyNorthrendSkeletonTransform,
|
||||
ArmySkeletonTransform,
|
||||
ArmySpikedGhoulTransform,
|
||||
ArmySuperZombieTransform
|
||||
};
|
||||
}
|
||||
|
||||
struct CreatureIds
|
||||
{
|
||||
public const uint DancingRuneWeapon = 27893;
|
||||
}
|
||||
|
||||
[Script] // 70656 - Advantage (T10 4P Melee Bonus)
|
||||
@@ -80,10 +68,10 @@ namespace Scripts.Spells.DeathKnight
|
||||
bool CheckProc(ProcEventInfo eventInfo)
|
||||
{
|
||||
Unit caster = eventInfo.GetActor();
|
||||
if (caster)
|
||||
if (caster != null)
|
||||
{
|
||||
Player player = caster.ToPlayer();
|
||||
if (!player || caster.GetClass() != Class.Deathknight)
|
||||
if (player == null || caster.GetClass() != Class.Deathknight)
|
||||
return false;
|
||||
|
||||
for (byte i = 0; i < player.GetMaxPower(PowerType.Runes); ++i)
|
||||
@@ -98,7 +86,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new CheckProcHandler(CheckProc));
|
||||
DoCheckProc.Add(new(CheckProc));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +106,8 @@ namespace Scripts.Spells.DeathKnight
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.RunicPowerEnergize, SpellIds.VolatileShielding) && ValidateSpellEffect(spellInfo.Id, 1);
|
||||
return ValidateSpellInfo(SpellIds.RunicPowerEnergize, SpellIds.VolatileShielding)
|
||||
&& ValidateSpellEffect((spellInfo.Id, 1));
|
||||
}
|
||||
|
||||
public override bool Load()
|
||||
@@ -153,21 +142,32 @@ namespace Scripts.Spells.DeathKnight
|
||||
{
|
||||
CastSpellExtraArgs args = new(volatileShielding);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(absorbedAmount, volatileShielding.GetAmount()));
|
||||
GetTarget().CastSpell((Unit)null, SpellIds.VolatileShieldingDamage, args);
|
||||
GetTarget().CastSpell(null, SpellIds.VolatileShieldingDamage, args);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalculateAmount, 0, AuraType.SchoolAbsorb));
|
||||
AfterEffectAbsorb.Add(new EffectAbsorbHandler(Trigger, 0));
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(HandleEffectRemove, 0, AuraType.SchoolAbsorb, AuraEffectHandleModes.Real));
|
||||
DoEffectCalcAmount.Add(new(CalculateAmount, 0, AuraType.SchoolAbsorb));
|
||||
AfterEffectAbsorb.Add(new(Trigger, 0));
|
||||
AfterEffectRemove.Add(new(HandleEffectRemove, 0, AuraType.SchoolAbsorb, AuraEffectHandleModes.Real));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 127517 - Army Transform
|
||||
// 127517 - Army Transform
|
||||
[Script] /// 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.
|
||||
class spell_dk_army_transform : SpellScript
|
||||
{
|
||||
uint[] ArmyTransforms =
|
||||
{
|
||||
SpellIds.ArmyFleshBeastTransform,
|
||||
SpellIds.ArmyGeistTransform,
|
||||
SpellIds. ArmyNorthrendSkeletonTransform,
|
||||
SpellIds.ArmySkeletonTransform,
|
||||
SpellIds.ArmySpikedGhoulTransform,
|
||||
SpellIds. ArmySuperZombieTransform,
|
||||
};
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.GlyphOfFoulMenagerie);
|
||||
@@ -181,7 +181,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit owner = GetCaster().GetOwner();
|
||||
if (owner)
|
||||
if (owner != null)
|
||||
if (owner.HasAura(SpellIds.GlyphOfFoulMenagerie))
|
||||
return SpellCastResult.SpellCastOk;
|
||||
|
||||
@@ -190,13 +190,13 @@ namespace Scripts.Spells.DeathKnight
|
||||
|
||||
void HandleDummy(uint effIndex)
|
||||
{
|
||||
GetCaster().CastSpell(GetCaster(), SpellIds.ArmyTransforms.SelectRandom(), true);
|
||||
GetCaster().CastSpell(GetCaster(), ArmyTransforms.SelectRandom(), true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnCheckCast.Add(new CheckCastHandler(CheckCast));
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
OnCheckCast.Add(new(CheckCast));
|
||||
OnEffectHitTarget.Add(new(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,16 +215,19 @@ namespace Scripts.Spells.DeathKnight
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnHit.Add(new HitHandler(HandleEffect));
|
||||
OnHit.Add(new(HandleEffect));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 49028 - Dancing Rune Weapon
|
||||
// 49028 - Dancing Rune Weapon
|
||||
[Script] /// 7.1.5
|
||||
class spell_dk_dancing_rune_weapon : AuraScript
|
||||
{
|
||||
const uint NpcDkDancingRuneWeapon = 27893;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
if (Global.ObjectMgr.GetCreatureTemplate(CreatureIds.DancingRuneWeapon) == null)
|
||||
if (ObjectMgr.GetCreatureTemplate(NpcDkDancingRuneWeapon) == null)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -234,20 +237,20 @@ namespace Scripts.Spells.DeathKnight
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit caster = GetCaster();
|
||||
if (!caster)
|
||||
if (caster == null)
|
||||
return;
|
||||
|
||||
Unit drw = null;
|
||||
foreach (Unit controlled in caster.m_Controlled)
|
||||
{
|
||||
if (controlled.GetEntry() == CreatureIds.DancingRuneWeapon)
|
||||
if (controlled.GetEntry() == NpcDkDancingRuneWeapon)
|
||||
{
|
||||
drw = controlled;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!drw || !drw.GetVictim())
|
||||
if (drw == null || drw.GetVictim() == null)
|
||||
return;
|
||||
|
||||
SpellInfo spellInfo = eventInfo.GetSpellInfo();
|
||||
@@ -267,12 +270,12 @@ namespace Scripts.Spells.DeathKnight
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 1, AuraType.Dummy));
|
||||
OnEffectProc.Add(new(HandleProc, 1, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 43265 - Death and Decay
|
||||
class spell_dk_death_and_decay_SpellScript : SpellScript
|
||||
class spell_dk_death_and_decay : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
@@ -285,29 +288,29 @@ namespace Scripts.Spells.DeathKnight
|
||||
{
|
||||
WorldLocation pos = GetExplTargetDest();
|
||||
if (pos != null)
|
||||
GetCaster().CastSpell(pos, SpellIds.TighteningGraspSlow, new CastSpellExtraArgs(true));
|
||||
GetCaster().CastSpell(pos, SpellIds.TighteningGraspSlow, true);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnCast.Add(new CastHandler(HandleDummy));
|
||||
OnCast.Add(new(HandleDummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 43265 - Death and Decay
|
||||
[Script] // 43265 - Death and Decay (Aura)
|
||||
class spell_dk_death_and_decay_AuraScript : AuraScript
|
||||
{
|
||||
void HandleDummyTick(AuraEffect aurEff)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
if (caster)
|
||||
caster.CastSpell(GetTarget(), SpellIds.DeathAndDecayDamage, new CastSpellExtraArgs(aurEff));
|
||||
if (caster != null)
|
||||
caster.CastSpell(GetTarget(), SpellIds.DeathAndDecayDamage, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(HandleDummyTick, 2, AuraType.PeriodicDummy));
|
||||
OnEffectPeriodic.Add(new(HandleDummyTick, 2, AuraType.PeriodicDummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,13 +327,13 @@ 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 SpellFailedDontReport on failure
|
||||
caster.CastSpell(caster, SpellIds.UnholyVigor, new CastSpellExtraArgs(unholyAura));
|
||||
if (unholyAura != null) // can be any effect, just here to send SpellCastResult.DontReport on failure
|
||||
caster.CastSpell(caster, SpellIds.UnholyVigor, unholyAura);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
OnEffectHitTarget.Add(new(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -352,14 +355,14 @@ namespace Scripts.Spells.DeathKnight
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
Unit target = GetHitUnit();
|
||||
if (target)
|
||||
if (target != null)
|
||||
target.CastSpell(target, (uint)GetEffectValue(), false);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnCheckCast.Add(new CheckCastHandler(CheckClass));
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleScript, 0, SpellEffectName.ScriptEffect));
|
||||
OnCheckCast.Add(new(CheckClass));
|
||||
OnEffectHitTarget.Add(new(HandleScript, 0, SpellEffectName.ScriptEffect));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -368,7 +371,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.DeathGripDummy, SpellIds.DeathGripJump, SpellIds.Blood, SpellIds.DeathGripTaunt);
|
||||
return ValidateSpellInfo(SpellIds.DeathGripDummy, SpellIds.DeathGripJump, SpellIds.DeathGripTaunt, SpellIds.Blood);
|
||||
}
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
@@ -391,8 +394,8 @@ namespace Scripts.Spells.DeathKnight
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnCheckCast.Add(new CheckCastHandler(CheckCast));
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.ScriptEffect));
|
||||
OnCheckCast.Add(new(CheckCast));
|
||||
OnEffectHitTarget.Add(new(HandleDummy, 0, SpellEffectName.ScriptEffect));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -403,17 +406,17 @@ namespace Scripts.Spells.DeathKnight
|
||||
{
|
||||
return ValidateSpellEffect((spellInfo.Id, 2));
|
||||
}
|
||||
|
||||
|
||||
void HandleCalcAmount(AuraEffect aurEff, ref int amount, ref bool canBeRecalculated)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
if (caster)
|
||||
if (caster != null)
|
||||
amount = (int)caster.CountPctFromMaxHealth(GetEffectInfo(2).CalcValue(caster));
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(HandleCalcAmount, 1, AuraType.SchoolHealAbsorb));
|
||||
DoEffectCalcAmount.Add(new(HandleCalcAmount, 1, AuraType.SchoolHealAbsorb));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -422,8 +425,8 @@ namespace Scripts.Spells.DeathKnight
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.DeathStrikeEnabler, SpellIds.DeathStrikeHeal, SpellIds.BloodShieldMastery, SpellIds.BloodShieldAbsorb, SpellIds.RecentlyUsedDeathStrike, SpellIds.Frost, SpellIds.DeathStrikeOffhand)
|
||||
&& ValidateSpellEffect(spellInfo.Id, 2);
|
||||
return ValidateSpellInfo(SpellIds.DeathStrikeEnabler, SpellIds.DeathStrikeHeal, SpellIds.BloodShieldMastery, SpellIds.BloodShieldAbsorb, SpellIds.Frost, SpellIds.DeathStrikeOffhand)
|
||||
&& ValidateSpellEffect((spellInfo.Id, 2));
|
||||
}
|
||||
|
||||
void HandleDummy(uint effIndex)
|
||||
@@ -457,16 +460,18 @@ namespace Scripts.Spells.DeathKnight
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectLaunch.Add(new EffectHandler(HandleDummy, 1, SpellEffectName.Dummy));
|
||||
AfterCast.Add(new CastHandler(TriggerRecentlyUsedDeathStrike));
|
||||
OnEffectLaunch.Add(new(HandleDummy, 1, SpellEffectName.Dummy));
|
||||
AfterCast.Add(new(TriggerRecentlyUsedDeathStrike));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 89832 - Death Strike Enabler - SPELL_DK_DEATH_STRIKE_ENABLER
|
||||
[Script] // 89832 - Death Strike Enabler - SpellDeathStrikeEnabler
|
||||
class spell_dk_death_strike_enabler : AuraScript
|
||||
{
|
||||
// Amount of seconds we calculate damage over
|
||||
uint[] _damagePerSecond = new uint[5];
|
||||
const byte LastSeconds = 5;
|
||||
|
||||
uint[] _damagePerSecond = new uint[LastSeconds];
|
||||
|
||||
bool CheckProc(ProcEventInfo eventInfo)
|
||||
{
|
||||
@@ -493,13 +498,13 @@ namespace Scripts.Spells.DeathKnight
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new CheckProcHandler(CheckProc));
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.PeriodicDummy));
|
||||
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(HandleCalcAmount, 0, AuraType.PeriodicDummy));
|
||||
OnEffectUpdatePeriodic.Add(new EffectUpdatePeriodicHandler(Update, 0, AuraType.PeriodicDummy));
|
||||
DoCheckProc.Add(new(CheckProc));
|
||||
OnEffectProc.Add(new(HandleProc, 0, AuraType.PeriodicDummy));
|
||||
DoEffectCalcAmount.Add(new(HandleCalcAmount, 0, AuraType.PeriodicDummy));
|
||||
OnEffectUpdatePeriodic.Add(new(Update, 0, AuraType.PeriodicDummy));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Script] // 85948 - Festering Strike
|
||||
class spell_dk_festering_strike : SpellScript
|
||||
{
|
||||
@@ -515,7 +520,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleScriptEffect, 1, SpellEffectName.Dummy));
|
||||
OnEffectHitTarget.Add(new(HandleScriptEffect, 1, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -524,7 +529,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.CorpseExplosionTriggered) && ValidateSpellEffect(spellInfo.Id, 2);
|
||||
return ValidateSpellInfo(SpellIds.CorpseExplosionTriggered) && ValidateSpellEffect((spellInfo.Id, 2));
|
||||
}
|
||||
|
||||
void HandleDamage(uint effIndex)
|
||||
@@ -535,7 +540,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
void Suicide(uint effIndex)
|
||||
{
|
||||
Unit unitTarget = GetHitUnit();
|
||||
if (unitTarget)
|
||||
if (unitTarget != null)
|
||||
{
|
||||
// Corpse Explosion (Suicide)
|
||||
unitTarget.CastSpell(unitTarget, SpellIds.CorpseExplosionTriggered, true);
|
||||
@@ -544,8 +549,8 @@ namespace Scripts.Spells.DeathKnight
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDamage, 0, SpellEffectName.SchoolDamage));
|
||||
OnEffectHitTarget.Add(new EffectHandler(Suicide, 1, SpellEffectName.SchoolDamage));
|
||||
OnEffectHitTarget.Add(new(HandleDamage, 0, SpellEffectName.SchoolDamage));
|
||||
OnEffectHitTarget.Add(new(Suicide, 1, SpellEffectName.SchoolDamage));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -562,7 +567,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
{
|
||||
SpellInfo spellInfo = aurEff.GetSpellInfo();
|
||||
// search our Blood Plague and Frost Fever on target
|
||||
if (spellInfo.SpellFamilyName == SpellFamilyNames.Deathknight && spellInfo.SpellFamilyFlags[2].HasAnyFlag(0x2u) &&
|
||||
if (spellInfo.SpellFamilyName == SpellFamilyNames.Deathknight && (spellInfo.SpellFamilyFlags[2] & 0x2) != 0 &&
|
||||
aurEff.GetCasterGUID() == caster.GetGUID())
|
||||
{
|
||||
int countMin = aurEff.GetBase().GetMaxDuration();
|
||||
@@ -582,7 +587,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleScriptEffect, 0, SpellEffectName.ScriptEffect));
|
||||
OnEffectHitTarget.Add(new(HandleScriptEffect, 0, SpellEffectName.ScriptEffect));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -601,10 +606,10 @@ namespace Scripts.Spells.DeathKnight
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleFrostFever, 0, SpellEffectName.SchoolDamage));
|
||||
OnEffectHitTarget.Add(new(HandleFrostFever, 0, SpellEffectName.SchoolDamage));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Script] // 206940 - Mark of Blood
|
||||
class spell_dk_mark_of_blood : AuraScript
|
||||
{
|
||||
@@ -617,13 +622,13 @@ namespace Scripts.Spells.DeathKnight
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit caster = GetCaster();
|
||||
if (caster)
|
||||
if (caster != null)
|
||||
caster.CastSpell(eventInfo.GetProcTarget(), SpellIds.MarkOfBloodHeal, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
OnEffectProc.Add(new(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -643,7 +648,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
OnEffectProc.Add(new(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -653,27 +658,28 @@ namespace Scripts.Spells.DeathKnight
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.Obliteration, SpellIds.ObliterationRuneEnergize, SpellIds.KillingMachineProc)
|
||||
&& ValidateSpellEffect(SpellIds.Obliteration, 1);
|
||||
&& ValidateSpellEffect((SpellIds.Obliteration, 1));
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
Unit target = GetTarget();
|
||||
target.CastSpell(target, SpellIds.KillingMachineProc, new CastSpellExtraArgs(aurEff));
|
||||
target.CastSpell(target, SpellIds.KillingMachineProc, aurEff);
|
||||
|
||||
AuraEffect oblitaration = target.GetAuraEffect(SpellIds.Obliteration, 1);
|
||||
if (oblitaration != null)
|
||||
if (RandomHelper.randChance(oblitaration.GetAmount()))
|
||||
target.CastSpell(target, SpellIds.ObliterationRuneEnergize, new CastSpellExtraArgs(aurEff));
|
||||
target.CastSpell(target, SpellIds.ObliterationRuneEnergize, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
AfterEffectProc.Add(new(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 121916 - Glyph of the Geist (Unholy)
|
||||
|
||||
// 121916 - Glyph of the Geist (Unholy)
|
||||
[Script] /// 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.
|
||||
class spell_dk_pet_geist_transform : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
@@ -689,7 +695,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit owner = GetCaster().GetOwner();
|
||||
if (owner)
|
||||
if (owner != null)
|
||||
if (owner.HasAura(SpellIds.GlyphOfTheGeist))
|
||||
return SpellCastResult.SpellCastOk;
|
||||
|
||||
@@ -698,11 +704,12 @@ namespace Scripts.Spells.DeathKnight
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnCheckCast.Add(new CheckCastHandler(CheckCast));
|
||||
OnCheckCast.Add(new(CheckCast));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 147157 Glyph of the Skeleton (Unholy)
|
||||
// 147157 Glyph of the Skeleton (Unholy)
|
||||
[Script] /// 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.
|
||||
class spell_dk_pet_skeleton_transform : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
@@ -713,7 +720,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit owner = GetCaster().GetOwner();
|
||||
if (owner)
|
||||
if (owner != null)
|
||||
if (owner.HasAura(SpellIds.GlyphOfTheSkeleton))
|
||||
return SpellCastResult.SpellCastOk;
|
||||
|
||||
@@ -722,11 +729,12 @@ namespace Scripts.Spells.DeathKnight
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnCheckCast.Add(new CheckCastHandler(CheckCast));
|
||||
OnCheckCast.Add(new(CheckCast));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 61257 - Runic Power Back on Snare/Root
|
||||
// 61257 - Runic Power Back on Snare/Root
|
||||
[Script] /// 7.1.5
|
||||
class spell_dk_pvp_4p_bonus : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
@@ -746,13 +754,13 @@ namespace Scripts.Spells.DeathKnight
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
eventInfo.GetActionTarget().CastSpell((Unit)null, SpellIds.RunicReturn, true);
|
||||
eventInfo.GetActionTarget().CastSpell(null, SpellIds.RunicReturn, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new CheckProcHandler(CheckProc));
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
DoCheckProc.Add(new(CheckProc));
|
||||
OnEffectProc.Add(new(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -770,12 +778,12 @@ namespace Scripts.Spells.DeathKnight
|
||||
if (GetCaster().HasAura(SpellIds.SludgeBelcher))
|
||||
spellId = SpellIds.SludgeBelcherSummon;
|
||||
|
||||
GetCaster().CastSpell((Unit)null, spellId, true);
|
||||
GetCaster().CastSpell(null, spellId, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
OnEffectHitTarget.Add(new(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -784,7 +792,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellEffect(spellInfo.Id, 1) && ValidateSpellInfo(SpellIds.FrostScythe);
|
||||
return ValidateSpellEffect((spellInfo.Id, 1)) && ValidateSpellInfo(SpellIds.FrostScythe);
|
||||
}
|
||||
|
||||
bool CheckProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
@@ -798,10 +806,53 @@ namespace Scripts.Spells.DeathKnight
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckEffectProc.Add(new CheckEffectProcHandler(CheckProc, 0, AuraType.ProcTriggerSpell));
|
||||
DoCheckEffectProc.Add(new(CheckProc, 0, AuraType.ProcTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Script] // 242057 - Rune Empowered
|
||||
class spell_dk_t20_2p_rune_empowered : AuraScript
|
||||
{
|
||||
int _runicPowerSpent;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.PillarOfFrost, SpellIds.BreathOfSindragosa);
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo procInfo)
|
||||
{
|
||||
Spell procSpell = procInfo.GetProcSpell();
|
||||
if (procSpell == null)
|
||||
return;
|
||||
|
||||
Aura pillarOfFrost = GetTarget().GetAura(SpellIds.PillarOfFrost);
|
||||
if (pillarOfFrost == null)
|
||||
return;
|
||||
|
||||
_runicPowerSpent += procSpell.GetPowerTypeCostAmount(PowerType.RunicPower).GetValueOrDefault(0);
|
||||
// Breath of Math.Sindragosa special case
|
||||
SpellInfo breathOfSindragosa = SpellMgr.GetSpellInfo(SpellIds.BreathOfSindragosa, Difficulty.None);
|
||||
if (procSpell.IsTriggeredByAura(breathOfSindragosa))
|
||||
{
|
||||
var powerRecord = breathOfSindragosa.PowerCosts.ToList().Find(power => power.PowerType == PowerType.RunicPower && power.PowerPctPerSecond > 0.0f);
|
||||
if (powerRecord != null)
|
||||
_runicPowerSpent += MathFunctions.CalculatePct(GetTarget().GetMaxPower(PowerType.RunicPower), powerRecord.PowerPctPerSecond);
|
||||
}
|
||||
|
||||
if (_runicPowerSpent >= 600)
|
||||
{
|
||||
pillarOfFrost.SetDuration(pillarOfFrost.GetDuration() + 1000);
|
||||
_runicPowerSpent -= 600;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 55233 - Vampiric Blood
|
||||
class spell_dk_vampiric_blood : AuraScript
|
||||
{
|
||||
@@ -812,7 +863,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalculateAmount, 1, AuraType.ModIncreaseHealth2));
|
||||
DoEffectCalcAmount.Add(new(CalculateAmount, 1, AuraType.ModIncreaseHealth2));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,17 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Framework.Constants;
|
||||
using Framework.Dynamic;
|
||||
using Game.AI;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using static Global;
|
||||
|
||||
namespace Scripts.Spells.DemonHunter
|
||||
{
|
||||
@@ -133,6 +137,7 @@ namespace Scripts.Spells.DemonHunter
|
||||
public const uint SoulCleave = 228477;
|
||||
public const uint SoulCleaveDmg = 228478;
|
||||
public const uint SoulFragmentCounter = 203981;
|
||||
public const uint SoulFurnaceDamageBuff = 391172;
|
||||
public const uint SoulRending = 204909;
|
||||
public const uint SpiritBombDamage = 218677;
|
||||
public const uint SpiritBombHeal = 227255;
|
||||
@@ -143,16 +148,6 @@ namespace Scripts.Spells.DemonHunter
|
||||
public const uint VengefulRetreatTrigger = 198793;
|
||||
}
|
||||
|
||||
struct AreaTriggerIds
|
||||
{
|
||||
public const uint ShatteredSoulsHavoc = 8352;
|
||||
public const uint ShatteredSoulsHavocDemon = 11231;
|
||||
public const uint ShatteredSoulsVengeance = 11266;
|
||||
public const uint ShatteredSoulsVengeanceDemon = 10693;
|
||||
public const uint SoulFragmentHavoc = 12929;
|
||||
public const uint SoulFragmentVengeance = 10665;
|
||||
}
|
||||
|
||||
[Script] // 197125 - Chaos Strike
|
||||
class spell_dh_chaos_strike : AuraScript
|
||||
{
|
||||
@@ -172,7 +167,7 @@ namespace Scripts.Spells.DemonHunter
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleEffectProc, 0, AuraType.ProcTriggerSpell));
|
||||
OnEffectProc.Add(new(HandleEffectProc, 0, AuraType.ProcTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,6 +177,7 @@ namespace Scripts.Spells.DemonHunter
|
||||
ObjectGuid _firstTargetGUID;
|
||||
|
||||
public ObjectGuid GetFirstTarget() { return _firstTargetGUID; }
|
||||
|
||||
public void SetFirstTarget(ObjectGuid targetGuid) { _firstTargetGUID = targetGuid; }
|
||||
|
||||
public override void Register() { }
|
||||
@@ -211,9 +207,9 @@ namespace Scripts.Spells.DemonHunter
|
||||
// Prefer the selected target if he is one of the enemies
|
||||
if (targetList.Count > 1 && !selectedTarget.IsEmpty())
|
||||
{
|
||||
var foundObj = targetList.Find(obj => obj.GetGUID() == selectedTarget);
|
||||
if (foundObj != null)
|
||||
firstTargetGUID = foundObj.GetGUID();
|
||||
var obj = targetList.Find(obj => obj.GetGUID() == selectedTarget);
|
||||
if (obj != null)
|
||||
firstTargetGUID = obj.GetGUID();
|
||||
}
|
||||
|
||||
if (firstTargetGUID.IsEmpty())
|
||||
@@ -226,7 +222,7 @@ namespace Scripts.Spells.DemonHunter
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(DecideFirstTarget, 0, Targets.UnitSrcAreaEnemy));
|
||||
OnObjectAreaTargetSelect.Add(new(DecideFirstTarget, 0, Targets.UnitSrcAreaEnemy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,13 +255,10 @@ namespace Scripts.Spells.DemonHunter
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnHit.Add(new HitHandler(HandleHitTarget));
|
||||
OnHit.Add(new(HandleHitTarget));
|
||||
}
|
||||
}
|
||||
|
||||
// 204596 - Sigil of Flame
|
||||
// 207684 - Sigil of Misery
|
||||
// 202137 - Sigil of Silence
|
||||
[Script("areatrigger_dh_sigil_of_silence", SpellIds.SigilOfSilenceAoe)]
|
||||
[Script("areatrigger_dh_sigil_of_misery", SpellIds.SigilOfMiseryAoe)]
|
||||
[Script("areatrigger_dh_sigil_of_flame", SpellIds.SigilOfFlameAoe)]
|
||||
@@ -282,7 +275,7 @@ namespace Scripts.Spells.DemonHunter
|
||||
{
|
||||
Unit caster = at.GetCaster();
|
||||
if (caster != null)
|
||||
caster.CastSpell(at.GetPosition(), _trigger, new CastSpellExtraArgs());
|
||||
caster.CastSpell(at.GetPosition(), _trigger);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -299,14 +292,14 @@ namespace Scripts.Spells.DemonHunter
|
||||
WorldLocation loc = GetExplTargetDest();
|
||||
if (loc != null)
|
||||
{
|
||||
GetCaster().CastSpell(GetHitUnit(), SpellIds.SigilOfChainsSlow, new CastSpellExtraArgs(true));
|
||||
GetHitUnit().CastSpell(loc.GetPosition(), SpellIds.SigilOfChainsGrip, new CastSpellExtraArgs(true));
|
||||
GetCaster().CastSpell(GetHitUnit(), SpellIds.SigilOfChainsSlow, true);
|
||||
GetHitUnit().CastSpell(loc.GetPosition(), SpellIds.SigilOfChainsGrip, true);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleEffectHitTarget, 0, SpellEffectName.Dummy));
|
||||
OnEffectHitTarget.Add(new(HandleEffectHitTarget, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,8 +313,8 @@ namespace Scripts.Spells.DemonHunter
|
||||
Unit caster = at.GetCaster();
|
||||
if (caster != null)
|
||||
{
|
||||
caster.CastSpell(at.GetPosition(), SpellIds.SigilOfChainsVisual, new CastSpellExtraArgs());
|
||||
caster.CastSpell(at.GetPosition(), SpellIds.SigilOfChainsTargetSelect, new CastSpellExtraArgs());
|
||||
caster.CastSpell(at.GetPosition(), SpellIds.SigilOfChainsVisual);
|
||||
caster.CastSpell(at.GetPosition(), SpellIds.SigilOfChainsTargetSelect);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -349,20 +342,20 @@ namespace Scripts.Spells.DemonHunter
|
||||
void HandleCast()
|
||||
{
|
||||
Player caster = GetCaster().ToPlayer();
|
||||
if (!caster)
|
||||
if (caster == null)
|
||||
return;
|
||||
|
||||
caster.CastSpell(caster, SpellIds.GlideKnockback, true);
|
||||
caster.CastSpell(caster, SpellIds.GlideDuration, true);
|
||||
|
||||
caster.GetSpellHistory().StartCooldown(Global.SpellMgr.GetSpellInfo(SpellIds.VengefulRetreatTrigger, GetCastDifficulty()), 0, null, false, TimeSpan.FromMilliseconds(250));
|
||||
caster.GetSpellHistory().StartCooldown(Global.SpellMgr.GetSpellInfo(SpellIds.FelRush, GetCastDifficulty()), 0, null, false, TimeSpan.FromMilliseconds(250));
|
||||
caster.GetSpellHistory().StartCooldown(SpellMgr.GetSpellInfo(SpellIds.VengefulRetreatTrigger, GetCastDifficulty()), 0, null, false, TimeSpan.FromMilliseconds(250));
|
||||
caster.GetSpellHistory().StartCooldown(SpellMgr.GetSpellInfo(SpellIds.FelRush, GetCastDifficulty()), 0, null, false, TimeSpan.FromMilliseconds(250));
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnCheckCast.Add(new CheckCastHandler(CheckCast));
|
||||
BeforeCast.Add(new CastHandler(HandleCast));
|
||||
OnCheckCast.Add(new(CheckCast));
|
||||
BeforeCast.Add(new(HandleCast));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -381,7 +374,7 @@ namespace Scripts.Spells.DemonHunter
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(OnRemove, 0, AuraType.FeatherFall, AuraEffectHandleModes.Real));
|
||||
AfterEffectRemove.Add(new(OnRemove, 0, AuraType.FeatherFall, AuraEffectHandleModes.Real));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -400,7 +393,55 @@ namespace Scripts.Spells.DemonHunter
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(OnRemove, 0, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
AfterEffectRemove.Add(new(OnRemove, 0, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 391166 - Soul Furnace
|
||||
class spell_dh_soul_furnace : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.SoulFurnaceDamageBuff);
|
||||
}
|
||||
|
||||
void CalculateSpellMod(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
if (GetStackAmount() == GetAura().CalcMaxStackAmount())
|
||||
{
|
||||
GetTarget().CastSpell(GetTarget(), SpellIds.SoulFurnaceDamageBuff, true);
|
||||
Remove();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectApply.Add(new(CalculateSpellMod, 0, AuraType.Dummy, AuraEffectHandleModes.RealOrReapplyMask));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 339424 - Soul Furnace
|
||||
class spell_dh_soul_furnace_conduit : AuraScript
|
||||
{
|
||||
void CalculateSpellMod(AuraEffect aurEff, ref SpellModifier spellMod)
|
||||
{
|
||||
if (aurEff.GetAmount() == 10)
|
||||
{
|
||||
if (spellMod == null)
|
||||
{
|
||||
spellMod = new SpellModifierByClassMask(GetAura());
|
||||
spellMod.op = SpellModOp.HealingAndDamage;
|
||||
spellMod.type = SpellModType.Pct;
|
||||
spellMod.spellId = GetId();
|
||||
(spellMod as SpellModifierByClassMask).mask = new FlagArray128(0x80000000);
|
||||
(spellMod as SpellModifierByClassMask).value = GetEffect(1).GetAmount() + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoEffectCalcSpellMod.Add(new(CalculateSpellMod, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
}
|
||||
+633
-219
File diff suppressed because it is too large
Load Diff
@@ -1,12 +1,14 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Framework.Constants;
|
||||
using Framework.Dynamic;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using static Global;
|
||||
|
||||
namespace Scripts.Spells.Evoker
|
||||
{
|
||||
@@ -18,8 +20,11 @@ namespace Scripts.Spells.Evoker
|
||||
public const uint LivingFlame = 361469;
|
||||
public const uint LivingFlameDamage = 361500;
|
||||
public const uint LivingFlameHeal = 361509;
|
||||
public const uint PermeatingChillTalent = 370897;
|
||||
public const uint PyreDamage = 357212;
|
||||
public const uint SoarRacial = 369536;
|
||||
|
||||
public const uint LabelEvokerBlue = 1465;
|
||||
}
|
||||
|
||||
[Script] // 362969 - Azure Strike (blue)
|
||||
@@ -34,7 +39,21 @@ namespace Scripts.Spells.Evoker
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(FilterTargets, 1, Targets.UnitDestAreaEnemy));
|
||||
OnObjectAreaTargetSelect.Add(new(FilterTargets, 1, Targets.UnitDestAreaEnemy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 370455 - Charged Blast
|
||||
class spell_evo_charged_blast : AuraScript
|
||||
{
|
||||
bool CheckProc(ProcEventInfo procInfo)
|
||||
{
|
||||
return procInfo.GetSpellInfo() != null && procInfo.GetSpellInfo().HasLabel(SpellIds.LabelEvokerBlue);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new(CheckProc));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,14 +83,14 @@ namespace Scripts.Spells.Evoker
|
||||
|
||||
caster.CastSpell(caster, SpellIds.GlideKnockback, true);
|
||||
|
||||
caster.GetSpellHistory().StartCooldown(Global.SpellMgr.GetSpellInfo(SpellIds.Hover, GetCastDifficulty()), 0, null, false, TimeSpan.FromMilliseconds(250));
|
||||
caster.GetSpellHistory().StartCooldown(Global.SpellMgr.GetSpellInfo(SpellIds.SoarRacial, GetCastDifficulty()), 0, null, false, TimeSpan.FromMilliseconds(250));
|
||||
caster.GetSpellHistory().StartCooldown(SpellMgr.GetSpellInfo(SpellIds.Hover, GetCastDifficulty()), 0, null, false, TimeSpan.FromMilliseconds(250));
|
||||
caster.GetSpellHistory().StartCooldown(SpellMgr.GetSpellInfo(SpellIds.SoarRacial, GetCastDifficulty()), 0, null, false, TimeSpan.FromMilliseconds(250));
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnCheckCast.Add(new CheckCastHandler(CheckCast));
|
||||
OnCast.Add(new CastHandler(HandleCast));
|
||||
OnCheckCast.Add(new(CheckCast));
|
||||
OnCast.Add(new(HandleCast));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,8 +129,38 @@ namespace Scripts.Spells.Evoker
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleHitTarget, 0, SpellEffectName.Dummy));
|
||||
OnEffectLaunchTarget.Add(new EffectHandler(HandleLaunchTarget, 0, SpellEffectName.Dummy));
|
||||
OnEffectHitTarget.Add(new(HandleHitTarget, 0, SpellEffectName.Dummy));
|
||||
OnEffectLaunchTarget.Add(new(HandleLaunchTarget, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 381773 - Permeating Chill
|
||||
class spell_evo_permeating_chill : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.PermeatingChillTalent);
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo procInfo)
|
||||
{
|
||||
SpellInfo spellInfo = procInfo.GetSpellInfo();
|
||||
if (spellInfo == null)
|
||||
return false;
|
||||
|
||||
if (spellInfo.HasLabel(SpellIds.LabelEvokerBlue))
|
||||
return false;
|
||||
|
||||
if (!procInfo.GetActor().HasAura(SpellIds.PermeatingChillTalent))
|
||||
if (spellInfo.IsAffected(SpellFamilyNames.Evoker, new FlagArray128(0x40, 0, 0, 0))) // disintegrate
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new(CheckProc));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,12 +174,12 @@ namespace Scripts.Spells.Evoker
|
||||
|
||||
void HandleDamage(uint effIndex)
|
||||
{
|
||||
GetCaster().CastSpell(GetHitUnit().GetPosition(), SpellIds.PyreDamage, new CastSpellExtraArgs(true));
|
||||
GetCaster().CastSpell(GetHitUnit().GetPosition(), SpellIds.PyreDamage, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDamage, 0, SpellEffectName.Dummy));
|
||||
OnEffectHitTarget.Add(new(HandleDamage, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1455
-1479
File diff suppressed because it is too large
Load Diff
+239
-69
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Framework.Constants;
|
||||
@@ -6,7 +6,7 @@ using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using static Global;
|
||||
|
||||
namespace Scripts.Spells.Hunter
|
||||
{
|
||||
@@ -21,10 +21,15 @@ namespace Scripts.Spells.Hunter
|
||||
public const uint ExhilarationPet = 128594;
|
||||
public const uint ExhilarationR2 = 231546;
|
||||
public const uint ExplosiveShotDamage = 212680;
|
||||
public const uint Lonewolf = 155228;
|
||||
public const uint LatentPoisonStack = 378015;
|
||||
public const uint LatentPoisonDamage = 378016;
|
||||
public const uint LatentPoisonInjectorsStack = 336903;
|
||||
public const uint LatentPoisonInjectorsDamage = 336904;
|
||||
public const uint LoneWolf = 155228;
|
||||
public const uint MastersCallTriggered = 62305;
|
||||
public const uint Misdirection = 34477;
|
||||
public const uint MisdirectionProc = 35079;
|
||||
public const uint MultiShotFocus = 213363;
|
||||
public const uint PetLastStandTriggered = 53479;
|
||||
public const uint PetHeartOfThePhoenixTriggered = 54114;
|
||||
public const uint PetHeartOfThePhoenixDebuff = 55711;
|
||||
@@ -34,8 +39,9 @@ namespace Scripts.Spells.Hunter
|
||||
public const uint RapidFireEnergize = 263585;
|
||||
public const uint SteadyShotFocus = 77443;
|
||||
public const uint T94PGreatness = 68130;
|
||||
public const uint DraeneiGiftOfTheNaaru = 59543;
|
||||
public const uint T292PMarksmanshipDamage = 394371;
|
||||
public const uint RoarOfSacrificeTriggered = 67481;
|
||||
public const uint DraeneiGiftOfTheNaaru = 59543;
|
||||
}
|
||||
|
||||
[Script] // 131894 - A Murder of Crows
|
||||
@@ -49,6 +55,7 @@ namespace Scripts.Spells.Hunter
|
||||
void HandleDummyTick(AuraEffect aurEff)
|
||||
{
|
||||
Unit target = GetTarget();
|
||||
|
||||
Unit caster = GetCaster();
|
||||
if (caster != null)
|
||||
caster.CastSpell(target, SpellIds.AMurderOfCrowsDamage, true);
|
||||
@@ -71,8 +78,8 @@ namespace Scripts.Spells.Hunter
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(HandleDummyTick, 0, AuraType.PeriodicDummy));
|
||||
OnEffectRemove.Add(new EffectApplyHandler(RemoveEffect, 0, AuraType.PeriodicDummy, AuraEffectHandleModes.Real));
|
||||
OnEffectPeriodic.Add(new(HandleDummyTick, 0, AuraType.PeriodicDummy));
|
||||
OnEffectRemove.Add(new(RemoveEffect, 0, AuraType.PeriodicDummy, AuraEffectHandleModes.Real));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +99,26 @@ namespace Scripts.Spells.Hunter
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(HandleOnRemove, 0, AuraType.ModIncreaseSpeed, AuraEffectHandleModes.Real));
|
||||
AfterEffectRemove.Add(new(HandleOnRemove, 0, AuraType.ModIncreaseSpeed, AuraEffectHandleModes.Real));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 378750 - Cobra Sting
|
||||
class spell_hun_cobra_sting : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellEffect((spellInfo.Id, 1));
|
||||
}
|
||||
|
||||
bool RollProc(AuraEffect aurEff, ProcEventInfo procInfo)
|
||||
{
|
||||
return RandomHelper.randChance(GetEffect(1).GetAmount());
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckEffectProc.Add(new(RollProc, 0, AuraType.ProcTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,18 +127,18 @@ namespace Scripts.Spells.Hunter
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.ExhilarationR2, SpellIds.Lonewolf);
|
||||
return ValidateSpellInfo(SpellIds.ExhilarationR2, SpellIds.LoneWolf);
|
||||
}
|
||||
|
||||
void HandleOnHit()
|
||||
{
|
||||
if (GetCaster().HasAura(SpellIds.ExhilarationR2) && !GetCaster().HasAura(SpellIds.Lonewolf))
|
||||
if (GetCaster().HasAura(SpellIds.ExhilarationR2) && !GetCaster().HasAura(SpellIds.LoneWolf))
|
||||
GetCaster().CastSpell(null, SpellIds.ExhilarationPet, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnHit.Add(new HitHandler(HandleOnHit));
|
||||
OnHit.Add(new(HandleOnHit));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,12 +152,14 @@ namespace Scripts.Spells.Hunter
|
||||
|
||||
void HandlePeriodic(AuraEffect aurEff)
|
||||
{
|
||||
GetCaster()?.CastSpell(GetTarget(), SpellIds.ExplosiveShotDamage, true);
|
||||
Unit caster = GetCaster();
|
||||
if (caster != null)
|
||||
caster.CastSpell(GetTarget(), SpellIds.ExplosiveShotDamage, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(HandlePeriodic, 0, AuraType.PeriodicDummy));
|
||||
OnEffectPeriodic.Add(new(HandlePeriodic, 0, AuraType.PeriodicDummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,12 +180,11 @@ namespace Scripts.Spells.Hunter
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
OnEffectProc.Add(new(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
// 53478 - Last Stand Pet
|
||||
[Script]
|
||||
[Script] // 53478 - Last Stand Pet
|
||||
class spell_hun_last_stand_pet : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
@@ -175,17 +202,109 @@ namespace Scripts.Spells.Hunter
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
OnEffectHitTarget.Add(new(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
// 53271 - Masters Call
|
||||
[Script]
|
||||
[Script] // 378016 - Latent Poison
|
||||
class spell_hun_latent_poison_damage : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.LatentPoisonStack);
|
||||
}
|
||||
|
||||
void CalculateDamage()
|
||||
{
|
||||
Aura stack = GetHitUnit().GetAura(SpellIds.LatentPoisonStack, GetCaster().GetGUID());
|
||||
if (stack != null)
|
||||
{
|
||||
SetHitDamage(GetHitDamage() * stack.GetStackAmount());
|
||||
stack.Remove();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnHit.Add(new(CalculateDamage));
|
||||
}
|
||||
}
|
||||
|
||||
// 19434 - Aimed Shot
|
||||
// 186270 - Raptor Strike
|
||||
// 217200 - Barbed Shot
|
||||
[Script] // 259387 - Mongoose Bite
|
||||
class spell_hun_latent_poison_trigger : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.LatentPoisonStack, SpellIds.LatentPoisonDamage);
|
||||
}
|
||||
|
||||
void TriggerDamage()
|
||||
{
|
||||
if (GetHitUnit().HasAura(SpellIds.LatentPoisonStack, GetCaster().GetGUID()))
|
||||
GetCaster().CastSpell(GetHitUnit(), SpellIds.LatentPoisonDamage, GetSpell());
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterHit.Add(new(TriggerDamage));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 336904 - Latent Poison Injectors
|
||||
class spell_hun_latent_poison_injectors_damage : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.LatentPoisonInjectorsStack);
|
||||
}
|
||||
|
||||
void CalculateDamage()
|
||||
{
|
||||
Aura stack = GetHitUnit().GetAura(SpellIds.LatentPoisonInjectorsStack, GetCaster().GetGUID());
|
||||
if (stack != null)
|
||||
{
|
||||
SetHitDamage(GetHitDamage() * stack.GetStackAmount());
|
||||
stack.Remove();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnHit.Add(new(CalculateDamage));
|
||||
}
|
||||
}
|
||||
|
||||
// 186270 - Raptor Strike
|
||||
[Script] // 259387 - Mongoose Bite
|
||||
class spell_hun_latent_poison_injectors_trigger : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.LatentPoisonInjectorsStack, SpellIds.LatentPoisonInjectorsDamage);
|
||||
}
|
||||
|
||||
void TriggerDamage()
|
||||
{
|
||||
if (GetHitUnit().HasAura(SpellIds.LatentPoisonInjectorsStack, GetCaster().GetGUID()))
|
||||
GetCaster().CastSpell(GetHitUnit(), SpellIds.LatentPoisonInjectorsDamage, GetSpell());
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterHit.Add(new(TriggerDamage));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 53271 - Masters Call
|
||||
class spell_hun_masters_call : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellEffect(spellInfo.Id, 0) && ValidateSpellInfo(SpellIds.MastersCallTriggered, (uint)spellInfo.GetEffect(0).CalcValue());
|
||||
return ValidateSpellEffect((spellInfo.Id, 0))
|
||||
&& ValidateSpellInfo(SpellIds.MastersCallTriggered, (uint)spellInfo.GetEffect(0).CalcValue());
|
||||
}
|
||||
|
||||
public override bool Load()
|
||||
@@ -196,26 +315,28 @@ namespace Scripts.Spells.Hunter
|
||||
SpellCastResult DoCheckCast()
|
||||
{
|
||||
Guardian pet = GetCaster().ToPlayer().GetGuardianPet();
|
||||
if (pet == null || !pet.IsPet() || !pet.IsAlive())
|
||||
Cypher.Assert(pet != null); // checked in Spell.CheckCast
|
||||
|
||||
if (!pet.IsPet() || !pet.IsAlive())
|
||||
return SpellCastResult.NoPet;
|
||||
|
||||
// Do a mini Spell::CheckCasterAuras on the pet, no other way of doing this
|
||||
// Do a mini Spell.CheckCasterAuras on the pet, no other way of doing this
|
||||
SpellCastResult result = SpellCastResult.SpellCastOk;
|
||||
UnitFlags unitflag = (UnitFlags)(uint)pet.m_unitData.Flags;
|
||||
if (!pet.GetCharmerGUID().IsEmpty())
|
||||
result = SpellCastResult.Charmed;
|
||||
else if (unitflag.HasAnyFlag(UnitFlags.Stunned))
|
||||
else if (unitflag.HasFlag(UnitFlags.Stunned))
|
||||
result = SpellCastResult.Stunned;
|
||||
else if (unitflag.HasAnyFlag(UnitFlags.Fleeing))
|
||||
else if (unitflag.HasFlag(UnitFlags.Fleeing))
|
||||
result = SpellCastResult.Fleeing;
|
||||
else if (unitflag.HasAnyFlag(UnitFlags.Confused))
|
||||
else if (unitflag.HasFlag(UnitFlags.Confused))
|
||||
result = SpellCastResult.Confused;
|
||||
|
||||
if (result != SpellCastResult.SpellCastOk)
|
||||
return result;
|
||||
|
||||
Unit target = GetExplTargetUnit();
|
||||
if (!target)
|
||||
if (target == null)
|
||||
return SpellCastResult.BadTargets;
|
||||
|
||||
if (!pet.IsWithinLOSInMap(target))
|
||||
@@ -231,19 +352,19 @@ namespace Scripts.Spells.Hunter
|
||||
|
||||
void HandleScriptEffect(uint effIndex)
|
||||
{
|
||||
GetHitUnit().CastSpell((Unit)null, SpellIds.MastersCallTriggered, true);
|
||||
GetHitUnit().CastSpell(null, SpellIds.MastersCallTriggered, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnCheckCast.Add(new CheckCastHandler(DoCheckCast));
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleScriptEffect, 1, SpellEffectName.ScriptEffect));
|
||||
OnCheckCast.Add(new(DoCheckCast));
|
||||
|
||||
OnEffectHitTarget.Add(new(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
OnEffectHitTarget.Add(new(HandleScriptEffect, 1, SpellEffectName.ScriptEffect));
|
||||
}
|
||||
}
|
||||
|
||||
// 34477 - Misdirection
|
||||
[Script]
|
||||
[Script] // 34477 - Misdirection
|
||||
class spell_hun_misdirection : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
@@ -263,18 +384,17 @@ namespace Scripts.Spells.Hunter
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget().CastSpell(GetTarget(), SpellIds.MisdirectionProc, new CastSpellExtraArgs(aurEff));
|
||||
GetTarget().CastSpell(GetTarget(), SpellIds.MisdirectionProc, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(OnRemove, 1, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 1, AuraType.Dummy));
|
||||
AfterEffectRemove.Add(new(OnRemove, 1, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
OnEffectProc.Add(new(HandleProc, 1, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
// 35079 - Misdirection (Proc)
|
||||
[Script]
|
||||
[Script] // 35079 - Misdirection (Proc)
|
||||
class spell_hun_misdirection_proc : AuraScript
|
||||
{
|
||||
void OnRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
@@ -284,12 +404,37 @@ namespace Scripts.Spells.Hunter
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(OnRemove, 0, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
AfterEffectRemove.Add(new(OnRemove, 0, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
}
|
||||
}
|
||||
|
||||
// 55709 - Pet Heart of the Phoenix
|
||||
[Script]
|
||||
[Script] // 2643 - Multi-Shot
|
||||
class spell_hun_multi_shot : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.MultiShotFocus);
|
||||
}
|
||||
|
||||
public override bool Load()
|
||||
{
|
||||
return GetCaster().IsPlayer();
|
||||
}
|
||||
|
||||
void HandleOnHit()
|
||||
{
|
||||
// We need to check hunter's spec because it doesn't generate focus on other specs than Mm
|
||||
if (GetCaster().ToPlayer().GetPrimarySpecialization() == ChrSpecialization.HunterMarksmanship)
|
||||
GetCaster().CastSpell(GetCaster(), SpellIds.MultiShotFocus, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnHit.Add(new(HandleOnHit));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 55709 - Pet Heart of the Phoenix
|
||||
class spell_hun_pet_heart_of_the_phoenix : SpellScript
|
||||
{
|
||||
public override bool Load()
|
||||
@@ -308,7 +453,7 @@ namespace Scripts.Spells.Hunter
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
Unit owner = caster.GetOwner();
|
||||
if (owner)
|
||||
if (owner != null)
|
||||
{
|
||||
if (!caster.HasAura(SpellIds.PetHeartOfThePhoenixDebuff))
|
||||
{
|
||||
@@ -322,7 +467,7 @@ namespace Scripts.Spells.Hunter
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleScript, 0, SpellEffectName.ScriptEffect));
|
||||
OnEffectHitTarget.Add(new(HandleScript, 0, SpellEffectName.ScriptEffect));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,7 +490,7 @@ namespace Scripts.Spells.Hunter
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterCast.Add(new CastHandler(HandleAfterCast));
|
||||
AfterCast.Add(new(HandleAfterCast));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -366,7 +511,7 @@ namespace Scripts.Spells.Hunter
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(HandlePeriodic, 1, AuraType.PeriodicDummy));
|
||||
OnEffectPeriodic.Add(new(HandlePeriodic, 1, AuraType.PeriodicDummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,10 +530,10 @@ namespace Scripts.Spells.Hunter
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleHit, 0, SpellEffectName.SchoolDamage));
|
||||
OnEffectHitTarget.Add(new(HandleHit, 0, SpellEffectName.SchoolDamage));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Script] // 53480 - Roar of Sacrifice
|
||||
class spell_hun_roar_of_sacrifice : AuraScript
|
||||
{
|
||||
@@ -400,10 +545,10 @@ namespace Scripts.Spells.Hunter
|
||||
bool CheckProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
DamageInfo damageInfo = eventInfo.GetDamageInfo();
|
||||
if (damageInfo == null || !Convert.ToBoolean((int)damageInfo.GetSchoolMask() & aurEff.GetMiscValue()))
|
||||
if (damageInfo == null || (damageInfo.GetSchoolMask() & (SpellSchoolMask)aurEff.GetMiscValue()) == 0)
|
||||
return false;
|
||||
|
||||
if (!GetCaster())
|
||||
if (GetCaster() == null)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -420,24 +565,23 @@ namespace Scripts.Spells.Hunter
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckEffectProc.Add(new CheckEffectProcHandler(CheckProc, 1, AuraType.Dummy));
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 1, AuraType.Dummy));
|
||||
DoCheckEffectProc.Add(new(CheckProc, 1, AuraType.Dummy));
|
||||
OnEffectProc.Add(new(HandleProc, 1, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
// 37506 - Scatter Shot
|
||||
[Script]
|
||||
[Script] // 37506 - Scatter Shot
|
||||
class spell_hun_scatter_shot : SpellScript
|
||||
{
|
||||
public override bool Load()
|
||||
{
|
||||
return GetCaster().IsTypeId(TypeId.Player);
|
||||
return GetCaster().IsPlayer();
|
||||
}
|
||||
|
||||
void HandleDummy(uint effIndex)
|
||||
{
|
||||
Player caster = GetCaster().ToPlayer();
|
||||
// break auto Shot and varhit
|
||||
// break var Shot and autohit
|
||||
caster.InterruptSpell(CurrentSpellTypes.AutoRepeat);
|
||||
caster.AttackStop();
|
||||
caster.SendAttackSwingCancelAttack();
|
||||
@@ -445,12 +589,11 @@ namespace Scripts.Spells.Hunter
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
OnEffectHitTarget.Add(new(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
// 56641 - Steady Shot
|
||||
[Script]
|
||||
[Script] // 56641 - Steady Shot
|
||||
class spell_hun_steady_shot : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
@@ -460,7 +603,7 @@ namespace Scripts.Spells.Hunter
|
||||
|
||||
public override bool Load()
|
||||
{
|
||||
return GetCaster().IsTypeId(TypeId.Player);
|
||||
return GetCaster().IsPlayer();
|
||||
}
|
||||
|
||||
void HandleOnHit()
|
||||
@@ -470,15 +613,14 @@ namespace Scripts.Spells.Hunter
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnHit.Add(new HitHandler(HandleOnHit));
|
||||
OnHit.Add(new(HandleOnHit));
|
||||
}
|
||||
}
|
||||
|
||||
// 1515 - Tame Beast
|
||||
[Script]
|
||||
[Script] // 1515 - Tame Beast
|
||||
class spell_hun_tame_beast : SpellScript
|
||||
{
|
||||
static uint[] CallPetSpellIds = { 883, 83242, 83243, 83244, 83245, };
|
||||
uint[] CallPetSpellIds = { 883, 83242, 83243, 83244, 83245, };
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
@@ -486,16 +628,16 @@ namespace Scripts.Spells.Hunter
|
||||
if (caster == null)
|
||||
return SpellCastResult.DontReport;
|
||||
|
||||
if (!GetExplTargetUnit())
|
||||
if (GetExplTargetUnit() == null)
|
||||
return SpellCastResult.BadImplicitTargets;
|
||||
|
||||
Creature target = GetExplTargetUnit().ToCreature();
|
||||
if (target)
|
||||
if (target != null)
|
||||
{
|
||||
if (target.GetLevelForTarget(caster) > caster.GetLevel())
|
||||
return SpellCastResult.Highlevel;
|
||||
|
||||
// use SMSG_PET_TAME_FAILURE?
|
||||
// use SmsgPetTameFailure?
|
||||
if (!target.GetCreatureTemplate().IsTameable(caster.CanTameExoticPets(), target.GetCreatureDifficulty()))
|
||||
return SpellCastResult.BadTargets;
|
||||
|
||||
@@ -537,7 +679,7 @@ namespace Scripts.Spells.Hunter
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnCheckCast.Add(new CheckCastHandler(CheckCast));
|
||||
OnCheckCast.Add(new(CheckCast));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -551,7 +693,7 @@ namespace Scripts.Spells.Hunter
|
||||
|
||||
bool CheckProc(ProcEventInfo eventInfo)
|
||||
{
|
||||
if (eventInfo.GetActor().IsTypeId(TypeId.Player) && eventInfo.GetActor().ToPlayer().GetPet())
|
||||
if (eventInfo.GetActor().IsPlayer() && eventInfo.GetActor().ToPlayer().GetPet() != null)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -561,13 +703,41 @@ namespace Scripts.Spells.Hunter
|
||||
PreventDefaultAction();
|
||||
Unit caster = eventInfo.GetActor();
|
||||
|
||||
caster.CastSpell(caster.ToPlayer().GetPet(), SpellIds.T94PGreatness, new CastSpellExtraArgs(aurEff));
|
||||
caster.CastSpell(caster.ToPlayer().GetPet(), SpellIds.T94PGreatness, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new CheckProcHandler(CheckProc));
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.ProcTriggerSpell));
|
||||
DoCheckProc.Add(new(CheckProc));
|
||||
OnEffectProc.Add(new(HandleProc, 0, AuraType.ProcTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 394366 - Find The Mark
|
||||
class spell_hun_t29_2p_marksmanship_bonus : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellEffect((SpellIds.T292PMarksmanshipDamage, 0))
|
||||
&& SpellMgr.GetSpellInfo(SpellIds.T292PMarksmanshipDamage, Difficulty.None).GetMaxTicks() != 0;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
Unit caster = eventInfo.GetActor();
|
||||
uint ticks = SpellMgr.GetSpellInfo(SpellIds.T292PMarksmanshipDamage, Difficulty.None).GetMaxTicks();
|
||||
uint damage = MathFunctions.CalculatePct(eventInfo.GetDamageInfo().GetOriginalDamage(), aurEff.GetAmount()) / ticks;
|
||||
|
||||
caster.CastSpell(eventInfo.GetActionTarget(), SpellIds.T292PMarksmanshipDamage, new CastSpellExtraArgs(aurEff)
|
||||
.SetTriggeringSpell(eventInfo.GetProcSpell())
|
||||
.AddSpellMod(SpellValueMod.BasePoint0, (int)damage));
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+347
-174
File diff suppressed because it is too large
Load Diff
+138
-80
@@ -1,17 +1,17 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using static Global;
|
||||
|
||||
namespace Scripts.Spells.Monk
|
||||
{
|
||||
struct SpellIds
|
||||
{
|
||||
public const uint CalmingCoalescence = 388220;
|
||||
public const uint CracklingJadeLightningChannel = 117952;
|
||||
public const uint CracklingJadeLightningChiProc = 123333;
|
||||
public const uint CracklingJadeLightningKnockback = 117962;
|
||||
@@ -21,6 +21,7 @@ namespace Scripts.Spells.Monk
|
||||
public const uint ProvokeSingleTarget = 116189;
|
||||
public const uint ProvokeAoe = 118635;
|
||||
public const uint NoFeatherFall = 79636;
|
||||
public const uint OpenPalmStrikesTalent = 392970;
|
||||
public const uint RollBackward = 109131;
|
||||
public const uint RollForward = 107427;
|
||||
public const uint SoothingMist = 115175;
|
||||
@@ -32,6 +33,27 @@ namespace Scripts.Spells.Monk
|
||||
public const uint SurgingMistHeal = 116995;
|
||||
}
|
||||
|
||||
struct MonkUtility
|
||||
{
|
||||
// Utility for stagger scripts
|
||||
public static Aura FindExistingStaggerEffect(Unit unit)
|
||||
{
|
||||
Aura auraLight = unit.GetAura(SpellIds.StaggerLight);
|
||||
if (auraLight != null)
|
||||
return auraLight;
|
||||
|
||||
Aura auraModerate = unit.GetAura(SpellIds.StaggerModerate);
|
||||
if (auraModerate != null)
|
||||
return auraModerate;
|
||||
|
||||
Aura auraHeavy = unit.GetAura(SpellIds.StaggerHeavy);
|
||||
if (auraHeavy != null)
|
||||
return auraHeavy;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 117952 - Crackling Jade Lightning
|
||||
class spell_monk_crackling_jade_lightning : AuraScript
|
||||
{
|
||||
@@ -43,23 +65,25 @@ namespace Scripts.Spells.Monk
|
||||
void OnTick(AuraEffect aurEff)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
if (caster)
|
||||
if (caster != null)
|
||||
if (caster.HasAura(SpellIds.StanceOfTheSpiritedCrane))
|
||||
caster.CastSpell(caster, SpellIds.CracklingJadeLightningChiProc, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
|
||||
caster.CastSpell(caster, SpellIds.CracklingJadeLightningChiProc, TriggerCastFlags.FullMask);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(OnTick, 0, AuraType.PeriodicDamage));
|
||||
OnEffectPeriodic.Add(new(OnTick, 0, AuraType.PeriodicDamage));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 117959 - Crackling Jade Lightning
|
||||
class spell_monk_crackling_jade_lightning_knockback_proc_aura : AuraScript
|
||||
class spell_monk_crackling_jade_lightning_knockback_proc : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.CracklingJadeLightningKnockback, SpellIds.CracklingJadeLightningKnockbackCd);
|
||||
return ValidateSpellInfo(SpellIds.CracklingJadeLightningKnockback,
|
||||
SpellIds.CracklingJadeLightningKnockbackCd
|
||||
);
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo eventInfo)
|
||||
@@ -71,7 +95,7 @@ namespace Scripts.Spells.Monk
|
||||
return false;
|
||||
|
||||
Spell currentChanneledSpell = GetTarget().GetCurrentSpell(CurrentSpellTypes.Channeled);
|
||||
if (!currentChanneledSpell || currentChanneledSpell.GetSpellInfo().Id != SpellIds.CracklingJadeLightningChannel)
|
||||
if (currentChanneledSpell == null || currentChanneledSpell.GetSpellInfo().Id != SpellIds.CracklingJadeLightningChannel)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -79,14 +103,65 @@ namespace Scripts.Spells.Monk
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
GetTarget().CastSpell(eventInfo.GetActor(), SpellIds.CracklingJadeLightningKnockback, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
|
||||
GetTarget().CastSpell(GetTarget(), SpellIds.CracklingJadeLightningKnockbackCd, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
|
||||
GetTarget().CastSpell(eventInfo.GetActor(), SpellIds.CracklingJadeLightningKnockback, TriggerCastFlags.FullMask);
|
||||
GetTarget().CastSpell(GetTarget(), SpellIds.CracklingJadeLightningKnockbackCd, TriggerCastFlags.FullMask);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new CheckProcHandler(CheckProc));
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
DoCheckProc.Add(new(CheckProc));
|
||||
OnEffectProc.Add(new(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 116849 - Life Cocoon
|
||||
class spell_monk_life_cocoon : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.CalmingCoalescence);
|
||||
}
|
||||
|
||||
void CalculateAbsorb(uint effIndex)
|
||||
{
|
||||
int absorb = (int)GetCaster().CountPctFromMaxHealth(GetEffectValue());
|
||||
Player player = GetCaster().ToPlayer();
|
||||
if (player != null)
|
||||
MathFunctions.AddPct(ref absorb, player.GetRatingBonusValue(CombatRating.VersatilityHealingDone));
|
||||
|
||||
AuraEffect calmingCoalescence = GetCaster().GetAuraEffect(SpellIds.CalmingCoalescence, 0, GetCaster().GetGUID());
|
||||
if (calmingCoalescence != null)
|
||||
{
|
||||
MathFunctions.AddPct(ref absorb, calmingCoalescence.GetAmount());
|
||||
calmingCoalescence.GetBase().Remove();
|
||||
}
|
||||
|
||||
GetSpell().SetSpellValue(SpellValueMod.BasePoint0, absorb);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectLaunch.Add(new(CalculateAbsorb, 2, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 392972 - Open Palm Strikes
|
||||
class spell_monk_open_palm_strikes : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellEffect((SpellIds.OpenPalmStrikesTalent, 1));
|
||||
}
|
||||
|
||||
bool CheckProc(AuraEffect aurEff, ProcEventInfo procInfo)
|
||||
{
|
||||
AuraEffect talent = GetTarget().GetAuraEffect(SpellIds.OpenPalmStrikesTalent, 1);
|
||||
return talent != null && RandomHelper.randChance(talent.GetAmount());
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckEffectProc.Add(new(CheckProc, 0, AuraType.ProcTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +180,7 @@ namespace Scripts.Spells.Monk
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(HandlePeriodic, 0, AuraType.PeriodicDummy));
|
||||
OnEffectPeriodic.Add(new(HandlePeriodic, 0, AuraType.PeriodicDummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,10 +199,10 @@ namespace Scripts.Spells.Monk
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
OnEffectProc.Add(new(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Script] // 115546 - Provoke
|
||||
class spell_monk_provoke : SpellScript
|
||||
{
|
||||
@@ -135,16 +210,18 @@ namespace Scripts.Spells.Monk
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
if (!spellInfo.GetExplicitTargetMask().HasAnyFlag(SpellCastTargetFlags.UnitMask)) // ensure GetExplTargetUnit() will return something meaningful during CheckCast
|
||||
if (!spellInfo.GetExplicitTargetMask().HasFlag(SpellCastTargetFlags.UnitMask)) // ensure GetExplTargetUnit() will return something meaningful during CheckCast
|
||||
return false;
|
||||
return ValidateSpellInfo(SpellIds.ProvokeSingleTarget, SpellIds.ProvokeAoe);
|
||||
return ValidateSpellInfo(SpellIds.ProvokeSingleTarget,
|
||||
SpellIds.ProvokeAoe
|
||||
);
|
||||
}
|
||||
|
||||
SpellCastResult CheckExplicitTarget()
|
||||
{
|
||||
if (GetExplTargetUnit().GetEntry() != BlackOxStatusEntry)
|
||||
{
|
||||
SpellInfo singleTarget = Global.SpellMgr.GetSpellInfo(SpellIds.ProvokeSingleTarget, GetCastDifficulty());
|
||||
SpellInfo singleTarget = SpellMgr.GetSpellInfo(SpellIds.ProvokeSingleTarget, GetCastDifficulty());
|
||||
SpellCastResult singleTargetExplicitResult = singleTarget.CheckExplicitTarget(GetCaster(), GetExplTargetUnit());
|
||||
if (singleTargetExplicitResult != SpellCastResult.SpellCastOk)
|
||||
return singleTargetExplicitResult;
|
||||
@@ -166,8 +243,8 @@ namespace Scripts.Spells.Monk
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnCheckCast.Add(new CheckCastHandler(CheckExplicitTarget));
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
OnCheckCast.Add(new(CheckExplicitTarget));
|
||||
OnEffectHitTarget.Add(new(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,20 +266,20 @@ namespace Scripts.Spells.Monk
|
||||
void HandleDummy(uint effIndex)
|
||||
{
|
||||
GetCaster().CastSpell(GetCaster(), GetCaster().HasUnitMovementFlag(MovementFlag.Backward) ? SpellIds.RollBackward : SpellIds.RollForward,
|
||||
new CastSpellExtraArgs(TriggerCastFlags.IgnoreCastInProgress));
|
||||
TriggerCastFlags.IgnoreCastInProgress);
|
||||
GetCaster().CastSpell(GetCaster(), SpellIds.NoFeatherFall, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnCheckCast.Add(new CheckCastHandler(CheckCast));
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
OnCheckCast.Add(new(CheckCast));
|
||||
OnEffectHitTarget.Add(new(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
// 107427 - Roll
|
||||
[Script] // 109131 - Roll (backward)
|
||||
class spell_monk_roll_aura : AuraScript
|
||||
class spell_monk_roll_AuraScript : AuraScript
|
||||
{
|
||||
void CalcMovementAmount(AuraEffect aurEff, ref int amount, ref bool canBeRecalculated)
|
||||
{
|
||||
@@ -227,17 +304,17 @@ namespace Scripts.Spells.Monk
|
||||
public override void Register()
|
||||
{
|
||||
// Values need manual correction
|
||||
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalcMovementAmount, 0, AuraType.ModSpeedNoControl));
|
||||
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalcMovementAmount, 2, AuraType.ModMinimumSpeed));
|
||||
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalcImmunityAmount, 5, AuraType.MechanicImmunity));
|
||||
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalcImmunityAmount, 6, AuraType.MechanicImmunity));
|
||||
DoEffectCalcAmount.Add(new(CalcMovementAmount, 0, AuraType.ModSpeedNoControl));
|
||||
DoEffectCalcAmount.Add(new(CalcMovementAmount, 2, AuraType.ModMinimumSpeed));
|
||||
DoEffectCalcAmount.Add(new(CalcImmunityAmount, 5, AuraType.MechanicImmunity));
|
||||
DoEffectCalcAmount.Add(new(CalcImmunityAmount, 6, AuraType.MechanicImmunity));
|
||||
|
||||
// This is a special aura that sets backward run speed equal to forward speed
|
||||
AfterEffectApply.Add(new EffectApplyHandler(ChangeRunBackSpeed, 4, AuraType.UseNormalMovementSpeed, AuraEffectHandleModes.Real));
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(RestoreRunBackSpeed, 4, AuraType.UseNormalMovementSpeed, AuraEffectHandleModes.Real));
|
||||
AfterEffectApply.Add(new(ChangeRunBackSpeed, 4, AuraType.UseNormalMovementSpeed, AuraEffectHandleModes.Real));
|
||||
AfterEffectRemove.Add(new(RestoreRunBackSpeed, 4, AuraType.UseNormalMovementSpeed, AuraEffectHandleModes.Real));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Script] // 115069 - Stagger
|
||||
class spell_monk_stagger : AuraScript
|
||||
{
|
||||
@@ -257,19 +334,18 @@ namespace Scripts.Spells.Monk
|
||||
if (effect == null)
|
||||
return;
|
||||
|
||||
Absorb(dmgInfo, effect.GetAmount() / 100.0f);
|
||||
Absorb(dmgInfo, (float)(effect.GetAmount()) / 100.0f);
|
||||
}
|
||||
|
||||
void Absorb(DamageInfo dmgInfo, float multiplier)
|
||||
{
|
||||
// Prevent default action (which would remove the aura)
|
||||
// Prevent default action (which would Remove the aura)
|
||||
PreventDefaultAction();
|
||||
|
||||
// make sure damage doesn't come from stagger damage spell SPELL_MONK_STAGGER_DAMAGE_AURA
|
||||
// make sure damage doesn't come from stagger damage spell SpellIds.StaggerDamageAura
|
||||
SpellInfo dmgSpellInfo = dmgInfo.GetSpellInfo();
|
||||
if (dmgSpellInfo != null)
|
||||
if (dmgSpellInfo.Id == SpellIds.StaggerDamageAura)
|
||||
return;
|
||||
if (dmgSpellInfo != null && dmgSpellInfo.Id == SpellIds.StaggerDamageAura)
|
||||
return;
|
||||
|
||||
AuraEffect effect = GetEffect(0);
|
||||
if (effect == null)
|
||||
@@ -277,14 +353,14 @@ namespace Scripts.Spells.Monk
|
||||
|
||||
Unit target = GetTarget();
|
||||
float agility = target.GetStat(Stats.Agility);
|
||||
float baseAmount = MathFunctions.CalculatePct(agility, effect.GetAmount());
|
||||
float K = Global.DB2Mgr.EvaluateExpectedStat(ExpectedStatType.ArmorConstant, target.GetLevel(), -2, 0, target.GetClass(), 0);
|
||||
float baseAmount = MathFunctions.CalculatePct(agility, (float)(effect.GetAmount()));
|
||||
float K = DB2Mgr.EvaluateExpectedStat(ExpectedStatType.ArmorConstant, target.GetLevel(), -2, 0, target.GetClass(), 0);
|
||||
|
||||
float newAmount = (baseAmount / (baseAmount + K));
|
||||
newAmount *= multiplier;
|
||||
|
||||
// Absorb X percentage of the damage
|
||||
float absorbAmount = dmgInfo.GetDamage() * newAmount;
|
||||
float absorbAmount = (float)(dmgInfo.GetDamage()) * newAmount;
|
||||
if (absorbAmount > 0)
|
||||
{
|
||||
dmgInfo.AbsorbDamage((uint)absorbAmount);
|
||||
@@ -296,14 +372,14 @@ namespace Scripts.Spells.Monk
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectAbsorb.Add(new EffectAbsorbHandler(AbsorbNormal, 1));
|
||||
OnEffectAbsorb.Add(new EffectAbsorbHandler(AbsorbMagic, 2));
|
||||
OnEffectAbsorb.Add(new(AbsorbNormal, 1));
|
||||
OnEffectAbsorb.Add(new(AbsorbMagic, 2));
|
||||
}
|
||||
|
||||
void AddAndRefreshStagger(float amount)
|
||||
{
|
||||
Unit target = GetTarget();
|
||||
Aura auraStagger = FindExistingStaggerEffect(target);
|
||||
Aura auraStagger = MonkUtility.FindExistingStaggerEffect(target);
|
||||
if (auraStagger != null)
|
||||
{
|
||||
AuraEffect effStaggerRemaining = auraStagger.GetEffect(1);
|
||||
@@ -315,7 +391,7 @@ namespace Scripts.Spells.Monk
|
||||
if (spellId == effStaggerRemaining.GetSpellInfo().Id)
|
||||
{
|
||||
auraStagger.RefreshDuration();
|
||||
effStaggerRemaining.ChangeAmount((int)newAmount, false, true /* reapply */);
|
||||
effStaggerRemaining.ChangeAmount((int)newAmount, false, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -330,10 +406,10 @@ namespace Scripts.Spells.Monk
|
||||
|
||||
uint GetStaggerSpellId(Unit unit, float amount)
|
||||
{
|
||||
const float StaggerHeavy = 0.6f;
|
||||
const float StaggerModerate = 0.3f;
|
||||
float StaggerHeavy = 0.6f;
|
||||
float StaggerModerate = 0.3f;
|
||||
|
||||
float staggerPct = amount / unit.GetMaxHealth();
|
||||
float staggerPct = amount / (float)(unit.GetMaxHealth());
|
||||
return (staggerPct >= StaggerHeavy) ? SpellIds.StaggerHeavy :
|
||||
(staggerPct >= StaggerModerate) ? SpellIds.StaggerModerate :
|
||||
SpellIds.StaggerLight;
|
||||
@@ -344,27 +420,10 @@ namespace Scripts.Spells.Monk
|
||||
// We only set the total stagger amount. The amount per tick will be set by the stagger spell script
|
||||
unit.CastSpell(unit, staggerSpellId, new CastSpellExtraArgs(SpellValueMod.BasePoint1, (int)staggerAmount).SetTriggerFlags(TriggerCastFlags.FullMask));
|
||||
}
|
||||
|
||||
public static Aura FindExistingStaggerEffect(Unit unit)
|
||||
{
|
||||
Aura auraLight = unit.GetAura(SpellIds.StaggerLight);
|
||||
if (auraLight != null)
|
||||
return auraLight;
|
||||
|
||||
Aura auraModerate = unit.GetAura(SpellIds.StaggerModerate);
|
||||
if (auraModerate != null)
|
||||
return auraModerate;
|
||||
|
||||
Aura auraHeavy = unit.GetAura(SpellIds.StaggerHeavy);
|
||||
if (auraHeavy != null)
|
||||
return auraHeavy;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 124255 - Stagger - SPELL_MONK_STAGGER_DAMAGE_AURA
|
||||
class spell_monk_stagger_damage_aura : AuraScript
|
||||
[Script] // 124255 - Stagger - SpellIds.StaggerDamageAura
|
||||
class spell_monk_stagger_damage : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
@@ -374,14 +433,14 @@ namespace Scripts.Spells.Monk
|
||||
void OnPeriodicDamage(AuraEffect aurEff)
|
||||
{
|
||||
// Update our light/medium/heavy stagger with the correct stagger amount left
|
||||
Aura auraStagger = spell_monk_stagger.FindExistingStaggerEffect(GetTarget());
|
||||
Aura auraStagger = MonkUtility.FindExistingStaggerEffect(GetTarget());
|
||||
if (auraStagger != null)
|
||||
{
|
||||
AuraEffect auraEff = auraStagger.GetEffect(1);
|
||||
if (auraEff != null)
|
||||
{
|
||||
float total = auraEff.GetAmount();
|
||||
float tickDamage = aurEff.GetAmount();
|
||||
float total = (float)(auraEff.GetAmount());
|
||||
float tickDamage = (float)(aurEff.GetAmount());
|
||||
auraEff.ChangeAmount((int)(total - tickDamage));
|
||||
}
|
||||
}
|
||||
@@ -389,32 +448,31 @@ namespace Scripts.Spells.Monk
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(OnPeriodicDamage, 0, AuraType.PeriodicDamage));
|
||||
OnEffectPeriodic.Add(new(OnPeriodicDamage, 0, AuraType.PeriodicDamage));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 124273, 124274, 124275 - Light/Moderate/Heavy Stagger - SPELL_MONK_STAGGER_LIGHT / SPELL_MONK_STAGGER_MODERATE / SPELL_MONK_STAGGER_HEAVY
|
||||
class spell_monk_stagger_debuff_aura : AuraScript
|
||||
[Script] // 124273, 124274, 124275 - Light/Moderate/Heavy Stagger - SpellIds.StaggerLight / SpellIds.StaggerModerate / SpellIds.StaggerHeavy
|
||||
class spell_monk_stagger_debuff : AuraScript
|
||||
{
|
||||
float _period;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.StaggerDamageAura)
|
||||
&& ValidateSpellEffect(SpellIds.StaggerDamageAura, 0);
|
||||
return ValidateSpellInfo(SpellIds.StaggerDamageAura) && ValidateSpellEffect((SpellIds.StaggerDamageAura, 0));
|
||||
}
|
||||
|
||||
public override bool Load()
|
||||
{
|
||||
_period = (float)Global.SpellMgr.GetSpellInfo(SpellIds.StaggerDamageAura, GetCastDifficulty()).GetEffect(0).ApplyAuraPeriod;
|
||||
_period = (float)(SpellMgr.GetSpellInfo(SpellIds.StaggerDamageAura, GetCastDifficulty()).GetEffect(0).ApplyAuraPeriod);
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnReapply(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
// Calculate damage per tick
|
||||
float total = aurEff.GetAmount();
|
||||
float perTick = total * _period / (float)GetDuration(); // should be same as GetMaxDuration() TODO: verify
|
||||
float total = (float)(aurEff.GetAmount());
|
||||
float perTick = total * _period / (float)(GetDuration()); // should be same as GetMaxDuration() Todo: verify
|
||||
|
||||
// Set amount on effect for tooltip
|
||||
AuraEffect effInfo = GetAura().GetEffect(0);
|
||||
@@ -436,8 +494,8 @@ namespace Scripts.Spells.Monk
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectApply.Add(new EffectApplyHandler(OnReapply, 1, AuraType.Dummy, AuraEffectHandleModes.RealOrReapplyMask));
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(OnRemove, 1, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
AfterEffectApply.Add(new(OnReapply, 1, AuraType.Dummy, AuraEffectHandleModes.RealOrReapplyMask));
|
||||
AfterEffectRemove.Add(new(OnRemove, 1, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
}
|
||||
|
||||
void CastOrChangeTickDamage(float tickDamage)
|
||||
|
||||
+288
-180
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1241
-385
File diff suppressed because it is too large
Load Diff
+920
-885
File diff suppressed because it is too large
Load Diff
+320
-235
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Framework.Constants;
|
||||
@@ -9,18 +9,24 @@ using Game.Scripting;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using static Global;
|
||||
|
||||
namespace Scripts.Spells.Rogue
|
||||
{
|
||||
public struct SpellIds
|
||||
|
||||
struct SpellIds
|
||||
{
|
||||
public const uint AdrenalineRush = 13750;
|
||||
public const uint BetweenTheEyes = 199804;
|
||||
public const uint BlackjackTalent = 379005;
|
||||
public const uint Blackjack = 394119;
|
||||
public const uint BladeFlurry = 13877;
|
||||
public const uint BladeFlurryExtraAttack = 22482;
|
||||
public const uint Broadside = 193356;
|
||||
public const uint BuriedTreasure = 199600;
|
||||
public const uint CheatDeathDummy = 31231;
|
||||
public const uint CheatedDeath = 45181;
|
||||
public const uint CheatingDeath = 45182;
|
||||
public const uint DeathFromAbove = 152150;
|
||||
public const uint GrandMelee = 193358;
|
||||
public const uint GrapplingHook = 195457;
|
||||
@@ -34,6 +40,8 @@ namespace Scripts.Spells.Rogue
|
||||
public const uint MainGauche = 86392;
|
||||
public const uint PremeditationPassive = 343160;
|
||||
public const uint PremeditationAura = 343173;
|
||||
public const uint PreyOnTheWeakTalent = 131511;
|
||||
public const uint PreyOnTheWeak = 255909;
|
||||
public const uint RuthlessPrecision = 193357;
|
||||
public const uint Sanctuary = 98877;
|
||||
public const uint SkullAndCrossbones = 199603;
|
||||
@@ -53,16 +61,27 @@ namespace Scripts.Spells.Rogue
|
||||
public const uint TricksOfTheTrade = 57934;
|
||||
public const uint TricksOfTheTradeProc = 59628;
|
||||
public const uint HonorAmongThievesEnergize = 51699;
|
||||
public const uint T52pSetBonus = 37169;
|
||||
public const uint T52PSetBonus = 37169;
|
||||
public const uint VenomousWounds = 79134;
|
||||
}
|
||||
|
||||
struct Misc
|
||||
{
|
||||
public static int? GetFinishingMoveCPCost(Spell spell)
|
||||
{
|
||||
if (spell == null)
|
||||
return null;
|
||||
|
||||
return spell.GetPowerTypeCostAmount(PowerType.ComboPoints);
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 53 - Backstab
|
||||
class spell_rog_backstab : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellEffect(spellInfo.Id, 3);
|
||||
return ValidateSpellEffect((spellInfo.Id, 3));
|
||||
}
|
||||
|
||||
void HandleHitDamage(uint effIndex)
|
||||
@@ -74,21 +93,46 @@ namespace Scripts.Spells.Rogue
|
||||
Unit caster = GetCaster();
|
||||
if (hitUnit.IsInBack(caster))
|
||||
{
|
||||
float currDamage = (float)GetHitDamage();
|
||||
float newDamage = MathFunctions.AddPct(ref currDamage, (float)GetEffectInfo(3).CalcValue(caster));
|
||||
float currDamage = (float)(GetHitDamage());
|
||||
float newDamage = MathFunctions.AddPct(ref currDamage, (float)(GetEffectInfo(3).CalcValue(caster)));
|
||||
SetHitDamage((int)newDamage);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleHitDamage, 1, SpellEffectName.SchoolDamage));
|
||||
OnEffectHitTarget.Add(new(HandleHitDamage, 1, SpellEffectName.SchoolDamage));
|
||||
}
|
||||
}
|
||||
|
||||
// 379005 - Blackjack
|
||||
[Script] // Called by Sap - 6770 and Blind - 2094
|
||||
class spell_rog_blackjack : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.BlackjackTalent, SpellIds.Blackjack);
|
||||
}
|
||||
|
||||
void EffectRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
if (caster != null)
|
||||
if (caster.HasAura(SpellIds.BlackjackTalent))
|
||||
caster.CastSpell(GetTarget(), SpellIds.Blackjack, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectRemove.Add(new(EffectRemove, 0, AuraType.Any, AuraEffectHandleModes.Real));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 13877, 33735, (check 51211, 65956) - Blade Flurry
|
||||
class spell_rog_blade_flurry_AuraScript : AuraScript
|
||||
class spell_rog_blade_flurry : AuraScript
|
||||
{
|
||||
Unit _procTarget;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.BladeFlurryExtraAttack);
|
||||
@@ -115,19 +159,52 @@ namespace Scripts.Spells.Rogue
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new CheckProcHandler(CheckProc));
|
||||
DoCheckProc.Add(new(CheckProc));
|
||||
if (m_scriptSpellId == SpellIds.BladeFlurry)
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.ModPowerRegenPercent));
|
||||
OnEffectProc.Add(new(HandleProc, 0, AuraType.ModPowerRegenPercent));
|
||||
else
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.ModMeleeHaste));
|
||||
OnEffectProc.Add(new(HandleProc, 0, AuraType.ModMeleeHaste));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 31230 - Cheat Death
|
||||
class spell_rog_cheat_death : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.CheatDeathDummy, SpellIds.CheatedDeath, SpellIds.CheatingDeath)
|
||||
&& ValidateSpellEffect((spellInfo.Id, 1));
|
||||
}
|
||||
|
||||
Unit _procTarget = null;
|
||||
void HandleAbsorb(AuraEffect aurEff, DamageInfo dmgInfo, ref uint absorbAmount)
|
||||
{
|
||||
Unit target = GetTarget();
|
||||
if (target.HasAura(SpellIds.CheatedDeath))
|
||||
{
|
||||
absorbAmount = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
PreventDefaultAction();
|
||||
|
||||
target.CastSpell(target, SpellIds.CheatDeathDummy, TriggerCastFlags.IgnoreCastInProgress | TriggerCastFlags.DontReportCastError);
|
||||
target.CastSpell(target, SpellIds.CheatedDeath, TriggerCastFlags.DontReportCastError);
|
||||
target.CastSpell(target, SpellIds.CheatingDeath, TriggerCastFlags.DontReportCastError);
|
||||
|
||||
target.SetHealth(target.CountPctFromMaxHealth(GetEffectInfo(1).CalcValue(target)));
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectAbsorb.Add(new(HandleAbsorb, 0));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 2818 - Deadly Poison
|
||||
class spell_rog_deadly_poison_SpellScript : SpellScript
|
||||
class spell_rog_deadly_poison : SpellScript
|
||||
{
|
||||
byte _stackAmount;
|
||||
|
||||
public override bool Load()
|
||||
{
|
||||
// at this point CastItem must already be initialized
|
||||
@@ -143,7 +220,7 @@ namespace Scripts.Spells.Rogue
|
||||
if (target != null)
|
||||
{
|
||||
// Deadly Poison
|
||||
AuraEffect aurEff = target.GetAuraEffect(AuraType.PeriodicDummy, SpellFamilyNames.Rogue, new FlagArray128(0x10000, 0x80000, 0), GetCaster().GetGUID());
|
||||
AuraEffect aurEff = target.GetAuraEffect(AuraType.PeriodicDamage, SpellFamilyNames.Rogue, new FlagArray128(0x10000, 0x80000, 0), GetCaster().GetGUID());
|
||||
if (aurEff != null)
|
||||
_stackAmount = aurEff.GetBase().GetStackAmount();
|
||||
}
|
||||
@@ -155,11 +232,13 @@ namespace Scripts.Spells.Rogue
|
||||
return;
|
||||
|
||||
Player player = GetCaster().ToPlayer();
|
||||
|
||||
Unit target = GetHitUnit();
|
||||
if (target != null)
|
||||
{
|
||||
|
||||
Item item = player.GetItemByPos(InventorySlots.Bag0, EquipmentSlot.MainHand);
|
||||
|
||||
if (item == GetCastItem())
|
||||
item = player.GetItemByPos(InventorySlots.Bag0, EquipmentSlot.OffHand);
|
||||
|
||||
@@ -167,9 +246,9 @@ namespace Scripts.Spells.Rogue
|
||||
return;
|
||||
|
||||
// item combat enchantments
|
||||
for (byte slot = 0; slot < (int)EnchantmentSlot.Max; ++slot)
|
||||
for (EnchantmentSlot slot = 0; slot < EnchantmentSlot.Max; ++slot)
|
||||
{
|
||||
var enchant = CliDB.SpellItemEnchantmentStorage.LookupByKey(item.GetEnchantmentId((EnchantmentSlot)slot));
|
||||
SpellItemEnchantmentRecord enchant = CliDB.SpellItemEnchantmentStorage.LookupByKey(item.GetEnchantmentId(slot));
|
||||
if (enchant == null)
|
||||
continue;
|
||||
|
||||
@@ -178,10 +257,10 @@ namespace Scripts.Spells.Rogue
|
||||
if (enchant.Effect[s] != ItemEnchantmentType.CombatSpell)
|
||||
continue;
|
||||
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(enchant.EffectArg[s], Difficulty.None);
|
||||
SpellInfo spellInfo = SpellMgr.GetSpellInfo(enchant.EffectArg[s], Difficulty.None);
|
||||
if (spellInfo == null)
|
||||
{
|
||||
Log.outError(LogFilter.Spells, $"Player::CastItemCombatSpell Enchant {enchant.Id}, player (Name: {player.GetName()}, {player.GetGUID()}) cast unknown spell {enchant.EffectArg[s]}");
|
||||
Log.outError(LogFilter.Spells, $"Player.CastItemCombatSpell Enchant {enchant.Id}, player (Name: {player.GetName()}, {player.GetGUID().ToString()})cast unknown spell {enchant.EffectArg[s]}");
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -204,63 +283,47 @@ namespace Scripts.Spells.Rogue
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
BeforeHit.Add(new BeforeHitHandler(HandleBeforeHit));
|
||||
AfterHit.Add(new HitHandler(HandleAfterHit));
|
||||
BeforeHit.Add(new(HandleBeforeHit));
|
||||
AfterHit.Add(new(HandleAfterHit));
|
||||
}
|
||||
|
||||
byte _stackAmount = 0;
|
||||
}
|
||||
|
||||
[Script] // 32645 - Envenom
|
||||
class spell_rog_envenom : SpellScript
|
||||
{
|
||||
void CalculateDamage(uint effIndex)
|
||||
void CalculateDamage(Unit victim, ref int damage, ref int flatMod, ref float pctMod)
|
||||
{
|
||||
int damagePerCombo = GetHitDamage();
|
||||
AuraEffect t5 = GetCaster().GetAuraEffect(SpellIds.T52pSetBonus, 0);
|
||||
pctMod *= GetSpell().GetPowerTypeCostAmount(PowerType.ComboPoints).GetValueOrDefault(0);
|
||||
|
||||
AuraEffect t5 = GetCaster().GetAuraEffect(SpellIds.T52PSetBonus, 0);
|
||||
if (t5 != null)
|
||||
damagePerCombo += t5.GetAmount();
|
||||
|
||||
int finalDamage = damagePerCombo;
|
||||
var costs = GetSpell().GetPowerCost();
|
||||
var c = costs.Find(cost => cost.Power == PowerType.ComboPoints);
|
||||
if (c != null)
|
||||
finalDamage *= c.Amount;
|
||||
|
||||
SetHitDamage(finalDamage);
|
||||
flatMod += t5.GetAmount();
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(CalculateDamage, 0, SpellEffectName.SchoolDamage));
|
||||
CalcDamage.Add(new(CalculateDamage));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 196819 - Eviscerate
|
||||
class spell_rog_eviscerate : SpellScript
|
||||
{
|
||||
void CalculateDamage(uint effIndex)
|
||||
void CalculateDamage(Unit victim, ref int damage, ref int flatMod, ref float pctMod)
|
||||
{
|
||||
int damagePerCombo = GetHitDamage();
|
||||
AuraEffect t5 = GetCaster().GetAuraEffect(SpellIds.T52pSetBonus, 0);
|
||||
pctMod *= GetSpell().GetPowerTypeCostAmount(PowerType.ComboPoints).GetValueOrDefault(0);
|
||||
|
||||
AuraEffect t5 = GetCaster().GetAuraEffect(SpellIds.T52PSetBonus, 0);
|
||||
if (t5 != null)
|
||||
damagePerCombo += t5.GetAmount();
|
||||
|
||||
int finalDamage = damagePerCombo;
|
||||
var costs = GetSpell().GetPowerCost();
|
||||
var c = costs.Find(cost => cost.Power == PowerType.ComboPoints);
|
||||
if (c != null)
|
||||
finalDamage *= c.Amount;
|
||||
|
||||
SetHitDamage(finalDamage);
|
||||
flatMod += t5.GetAmount();
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(CalculateDamage, 0, SpellEffectName.SchoolDamage));
|
||||
CalcDamage.Add(new(CalculateDamage));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Script] // 193358 - Grand Melee
|
||||
class spell_rog_grand_melee : AuraScript
|
||||
{
|
||||
@@ -272,7 +335,7 @@ namespace Scripts.Spells.Rogue
|
||||
bool HandleCheckProc(ProcEventInfo eventInfo)
|
||||
{
|
||||
Spell procSpell = eventInfo.GetProcSpell();
|
||||
return procSpell && procSpell.HasPowerTypeCost(PowerType.ComboPoints);
|
||||
return procSpell != null && procSpell.HasPowerTypeCost(PowerType.ComboPoints);
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo procInfo)
|
||||
@@ -297,13 +360,13 @@ namespace Scripts.Spells.Rogue
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new CheckProcHandler(HandleCheckProc));
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
DoCheckProc.Add(new(HandleCheckProc));
|
||||
OnEffectProc.Add(new(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
// 198031 - Honor Among Thieves
|
||||
[Script] /// 7.1.5
|
||||
[Script] // 7.1.5
|
||||
class spell_rog_honor_among_thieves : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
@@ -316,17 +379,70 @@ namespace Scripts.Spells.Rogue
|
||||
PreventDefaultAction();
|
||||
|
||||
Unit target = GetTarget();
|
||||
target.CastSpell(target, SpellIds.HonorAmongThievesEnergize, new CastSpellExtraArgs(aurEff));
|
||||
target.CastSpell(target, SpellIds.HonorAmongThievesEnergize, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
OnEffectProc.Add(new(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Script] // 51690 - Killing Spree
|
||||
class spell_rog_killing_spree_SpellScript : SpellScript
|
||||
class spell_rog_killing_spree_AuraScript : AuraScript
|
||||
{
|
||||
List<ObjectGuid> _targets = new();
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.KillingSpreeTeleport,
|
||||
SpellIds.KillingSpreeWeaponDmg,
|
||||
SpellIds.KillingSpreeDmgBuff
|
||||
);
|
||||
}
|
||||
|
||||
void HandleApply(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
GetTarget().CastSpell(GetTarget(), SpellIds.KillingSpreeDmgBuff, true);
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect aurEff)
|
||||
{
|
||||
while (!_targets.Empty())
|
||||
{
|
||||
ObjectGuid guid = _targets.SelectRandom();
|
||||
Unit target = ObjAccessor.GetUnit(GetTarget(), guid);
|
||||
if (target != null)
|
||||
{
|
||||
GetTarget().CastSpell(target, SpellIds.KillingSpreeTeleport, true);
|
||||
GetTarget().CastSpell(target, SpellIds.KillingSpreeWeaponDmg, true);
|
||||
break;
|
||||
}
|
||||
else
|
||||
_targets.Remove(guid);
|
||||
}
|
||||
}
|
||||
|
||||
void HandleRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
GetTarget().RemoveAurasDueToSpell(SpellIds.KillingSpreeDmgBuff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectApply.Add(new(HandleApply, 0, AuraType.PeriodicDummy, AuraEffectHandleModes.Real));
|
||||
OnEffectPeriodic.Add(new(HandleEffectPeriodic, 0, AuraType.PeriodicDummy));
|
||||
AfterEffectRemove.Add(new(HandleRemove, 0, AuraType.PeriodicDummy, AuraEffectHandleModes.Real));
|
||||
}
|
||||
|
||||
public void AddTarget(Unit target)
|
||||
{
|
||||
_targets.Add(target.GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class spell_rog_killing_spree : SpellScript
|
||||
{
|
||||
void FilterTargets(List<WorldObject> targets)
|
||||
{
|
||||
@@ -347,58 +463,22 @@ namespace Scripts.Spells.Rogue
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(FilterTargets, 1, Targets.UnitDestAreaEnemy));
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 1, SpellEffectName.Dummy));
|
||||
OnObjectAreaTargetSelect.Add(new(FilterTargets, 1, Targets.UnitDestAreaEnemy));
|
||||
OnEffectHitTarget.Add(new(HandleDummy, 1, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class spell_rog_killing_spree_AuraScript : AuraScript
|
||||
[Script] // 385627 - Kingsbane
|
||||
class spell_rog_kingsbane : AuraScript
|
||||
{
|
||||
List<ObjectGuid> _targets = new();
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
bool CheckProc(AuraEffect aurEff, ProcEventInfo procInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.KillingSpreeTeleport, SpellIds.KillingSpreeWeaponDmg, SpellIds.KillingSpreeDmgBuff);
|
||||
}
|
||||
|
||||
void HandleApply(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
GetTarget().CastSpell(GetTarget(), SpellIds.KillingSpreeDmgBuff, true);
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect aurEff)
|
||||
{
|
||||
while (!_targets.Empty())
|
||||
{
|
||||
ObjectGuid guid = _targets.SelectRandom();
|
||||
Unit target = Global.ObjAccessor.GetUnit(GetTarget(), guid);
|
||||
if (target != null)
|
||||
{
|
||||
GetTarget().CastSpell(target, SpellIds.KillingSpreeTeleport, true);
|
||||
GetTarget().CastSpell(target, SpellIds.KillingSpreeWeaponDmg, true);
|
||||
break;
|
||||
}
|
||||
else
|
||||
_targets.Remove(guid);
|
||||
}
|
||||
}
|
||||
|
||||
void HandleRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
GetTarget().RemoveAurasDueToSpell(SpellIds.KillingSpreeDmgBuff);
|
||||
return procInfo.GetActionTarget().HasAura(GetId(), GetCasterGUID());
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectApply.Add(new EffectApplyHandler(HandleApply, 0, AuraType.PeriodicDummy, AuraEffectHandleModes.Real));
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(HandleEffectPeriodic, 0, AuraType.PeriodicDummy));
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(HandleRemove, 0, AuraType.PeriodicDummy, AuraEffectHandleModes.Real));
|
||||
}
|
||||
|
||||
public void AddTarget(Unit target)
|
||||
{
|
||||
_targets.Add(target.GetGUID());
|
||||
DoCheckEffectProc.Add(new(CheckProc, 4, AuraType.ProcTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -412,20 +492,20 @@ namespace Scripts.Spells.Rogue
|
||||
|
||||
bool HandleCheckProc(ProcEventInfo eventInfo)
|
||||
{
|
||||
return eventInfo.GetDamageInfo() != null && eventInfo.GetDamageInfo().GetVictim() != null;
|
||||
return eventInfo.GetDamageInfo()?.GetVictim();
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo procInfo)
|
||||
{
|
||||
Unit target = GetTarget();
|
||||
if (target != null)
|
||||
target.CastSpell(procInfo.GetDamageInfo().GetVictim(), SpellIds.MainGauche, new CastSpellExtraArgs(aurEff));
|
||||
target.CastSpell(procInfo.GetDamageInfo().GetVictim(), SpellIds.MainGauche, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new CheckProcHandler(HandleCheckProc));
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
DoCheckProc.Add(new(HandleCheckProc));
|
||||
OnEffectProc.Add(new(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -442,14 +522,37 @@ namespace Scripts.Spells.Rogue
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnCheckCast.Add(new CheckCastHandler(CheckCast));
|
||||
OnCheckCast.Add(new(CheckCast));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 131511 - Prey on the Weak
|
||||
[Script] // Called by Cheap Shot - 1833 and Kidney Shot - 408
|
||||
class spell_rog_prey_on_the_weak : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.PreyOnTheWeakTalent, SpellIds.PreyOnTheWeak);
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
if (caster != null)
|
||||
if (caster.HasAura(SpellIds.PreyOnTheWeakTalent))
|
||||
caster.CastSpell(GetTarget(), SpellIds.PreyOnTheWeak, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectApply.Add(new(OnApply, 0, AuraType.ModStun, AuraEffectHandleModes.Real));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 79096 - Restless Blades
|
||||
class spell_rog_restless_blades : AuraScript
|
||||
{
|
||||
static uint[] Spells = { SpellIds.AdrenalineRush, SpellIds.BetweenTheEyes, SpellIds.Sprint, SpellIds.GrapplingHook, SpellIds.Vanish, SpellIds.KillingSpree, SpellIds.MarkedForDeath, SpellIds.DeathFromAbove };
|
||||
uint[] Spells = { SpellIds.AdrenalineRush, SpellIds.BetweenTheEyes, SpellIds.Sprint, SpellIds.GrapplingHook, SpellIds.Vanish, SpellIds.KillingSpree, SpellIds.MarkedForDeath, SpellIds.DeathFromAbove };
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
@@ -458,10 +561,10 @@ namespace Scripts.Spells.Rogue
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo procInfo)
|
||||
{
|
||||
int? spentCP = procInfo.GetProcSpell()?.GetPowerTypeCostAmount(PowerType.ComboPoints);
|
||||
var spentCP = Misc.GetFinishingMoveCPCost(procInfo.GetProcSpell());
|
||||
if (spentCP.HasValue)
|
||||
{
|
||||
int cdExtra = (int)-((float)(aurEff.GetAmount() * spentCP.Value) * 0.1f);
|
||||
int cdExtra = -(int)((float)(aurEff.GetAmount() * spentCP.Value) * 0.1f);
|
||||
|
||||
SpellHistory history = GetTarget().GetSpellHistory();
|
||||
foreach (uint spellId in Spells)
|
||||
@@ -471,14 +574,14 @@ namespace Scripts.Spells.Rogue
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
OnEffectProc.Add(new(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 315508 - Roll the Bones
|
||||
class spell_rog_roll_the_bones : SpellScript
|
||||
{
|
||||
static uint[] Spells = { SpellIds.SkullAndCrossbones, SpellIds.GrandMelee, SpellIds.RuthlessPrecision, SpellIds.TrueBearing, SpellIds.BuriedTreasure, SpellIds.Broadside };
|
||||
uint[] Spells = { SpellIds.SkullAndCrossbones, SpellIds.GrandMelee, SpellIds.RuthlessPrecision, SpellIds.TrueBearing, SpellIds.BuriedTreasure, SpellIds.Broadside };
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
@@ -498,7 +601,8 @@ namespace Scripts.Spells.Rogue
|
||||
}
|
||||
}
|
||||
|
||||
var possibleBuffs = Spells.Shuffle().ToArray();
|
||||
List<uint> possibleBuffs = new(Spells);
|
||||
possibleBuffs.Shuffle();
|
||||
|
||||
// https://www.icy-veins.com/wow/outlaw-rogue-pve-dps-rotation-cooldowns-abilities
|
||||
// 1 Roll the Bones buff : 100.0 % chance;
|
||||
@@ -522,43 +626,18 @@ namespace Scripts.Spells.Rogue
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.ApplyAura));
|
||||
OnEffectHitTarget.Add(new(HandleDummy, 0, SpellEffectName.ApplyAura));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 1943 - Rupture
|
||||
class spell_rog_rupture_AuraScript : AuraScript
|
||||
class spell_rog_rupture : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.VenomousWounds);
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect aurEff, ref int amount, ref bool canBeRecalculated)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
if (caster != null)
|
||||
{
|
||||
canBeRecalculated = false;
|
||||
|
||||
float[] attackpowerPerCombo =
|
||||
{
|
||||
0.0f,
|
||||
0.015f, // 1 point: ${($m1 + $b1*1 + 0.015 * $AP) * 4} damage over 8 secs
|
||||
0.024f, // 2 points: ${($m1 + $b1*2 + 0.024 * $AP) * 5} damage over 10 secs
|
||||
0.03f, // 3 points: ${($m1 + $b1*3 + 0.03 * $AP) * 6} damage over 12 secs
|
||||
0.03428571f, // 4 points: ${($m1 + $b1*4 + 0.03428571 * $AP) * 7} damage over 14 secs
|
||||
0.0375f // 5 points: ${($m1 + $b1*5 + 0.0375 * $AP) * 8} damage over 16 secs
|
||||
};
|
||||
|
||||
int cp = caster.GetPower(PowerType.ComboPoints);
|
||||
if (cp > 5)
|
||||
cp = 5;
|
||||
|
||||
amount += (int)(caster.GetTotalAttackPowerValue(WeaponAttackType.BaseAttack) * attackpowerPerCombo[cp]);
|
||||
}
|
||||
}
|
||||
|
||||
void OnEffectRemoved(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
if (GetTargetApplication().GetRemoveMode() != AuraRemoveMode.Death)
|
||||
@@ -566,7 +645,7 @@ namespace Scripts.Spells.Rogue
|
||||
|
||||
Aura aura = GetAura();
|
||||
Unit caster = aura.GetCaster();
|
||||
if (!caster)
|
||||
if (caster == null)
|
||||
return;
|
||||
|
||||
Aura auraVenomousWounds = caster.GetAura(SpellIds.VenomousWounds);
|
||||
@@ -574,19 +653,18 @@ namespace Scripts.Spells.Rogue
|
||||
return;
|
||||
|
||||
// Venomous Wounds: if unit dies while being affected by rupture, regain energy based on remaining duration
|
||||
SpellPowerCost cost = GetSpellInfo().CalcPowerCost(PowerType.Energy, false, caster, GetSpellInfo().GetSchoolMask(), null);
|
||||
var cost = GetSpellInfo().CalcPowerCost(PowerType.Energy, false, caster, GetSpellInfo().GetSchoolMask(), null);
|
||||
if (cost == null)
|
||||
return;
|
||||
|
||||
float pct = (float)aura.GetDuration() / (float)aura.GetMaxDuration();
|
||||
int extraAmount = (int)((float)cost.Amount * pct);
|
||||
float pct = (float)(aura.GetDuration()) / (float)(aura.GetMaxDuration());
|
||||
int extraAmount = (int)((float)(cost.Amount) * pct);
|
||||
caster.ModifyPower(PowerType.Energy, extraAmount);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalculateAmount, 0, AuraType.PeriodicDummy));
|
||||
OnEffectRemove.Add(new EffectApplyHandler(OnEffectRemoved, 0, AuraType.PeriodicDummy, AuraEffectHandleModes.Real));
|
||||
OnEffectRemove.Add(new(OnEffectRemoved, 0, AuraType.PeriodicDamage, AuraEffectHandleModes.Real));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -597,30 +675,32 @@ namespace Scripts.Spells.Rogue
|
||||
{
|
||||
Unit target = GetTarget();
|
||||
|
||||
int? cost = procInfo.GetProcSpell()?.GetPowerTypeCostAmount(PowerType.ComboPoints);
|
||||
var cost = Misc.GetFinishingMoveCPCost(procInfo.GetProcSpell());
|
||||
if (cost.HasValue)
|
||||
if (RandomHelper.randChance(aurEff.GetSpellEffectInfo().PointsPerResource * (cost.Value)))
|
||||
if (RandomHelper.randChance(aurEff.GetSpellEffectInfo().PointsPerResource * cost.Value))
|
||||
target.ModifyPower(PowerType.ComboPoints, 1);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
OnEffectProc.Add(new(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 185438 - Shadowstrike
|
||||
class spell_rog_shadowstrike : SpellScript
|
||||
{
|
||||
bool _hasPremeditationAura;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.PremeditationAura, SpellIds.SliceAndDice, SpellIds.PremeditationPassive)
|
||||
&& ValidateSpellEffect(SpellIds.PremeditationPassive, 0);
|
||||
&& ValidateSpellEffect((SpellIds.PremeditationPassive, 0));
|
||||
}
|
||||
|
||||
SpellCastResult HandleCheckCast()
|
||||
{
|
||||
// Because the premeditation aura is removed when we're out of stealth,
|
||||
// Because the premeditation aura is Removed when we're out of stealth,
|
||||
// when we reach HandleEnergize the aura won't be there, even if it was when player launched the spell
|
||||
_hasPremeditationAura = GetCaster().HasAura(SpellIds.PremeditationAura);
|
||||
return SpellCastResult.Success;
|
||||
@@ -643,7 +723,7 @@ namespace Scripts.Spells.Rogue
|
||||
}
|
||||
|
||||
// Grant 10 seconds of slice and dice
|
||||
int duration = Global.SpellMgr.GetSpellInfo(SpellIds.PremeditationPassive, Difficulty.None).GetEffect(0).CalcValue(GetCaster());
|
||||
int duration = SpellMgr.GetSpellInfo(SpellIds.PremeditationPassive, Difficulty.None).GetEffect(0).CalcValue(GetCaster());
|
||||
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.AddSpellMod(SpellValueMod.Duration, duration * Time.InMilliseconds);
|
||||
@@ -653,11 +733,9 @@ namespace Scripts.Spells.Rogue
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnCheckCast.Add(new CheckCastHandler(HandleCheckCast));
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleEnergize, 1, SpellEffectName.Energize));
|
||||
OnCheckCast.Add(new(HandleCheckCast));
|
||||
OnEffectHitTarget.Add(new(HandleEnergize, 1, SpellEffectName.Energize));
|
||||
}
|
||||
|
||||
bool _hasPremeditationAura = false;
|
||||
}
|
||||
|
||||
[Script] // 193315 - Sinister Strike
|
||||
@@ -665,28 +743,28 @@ namespace Scripts.Spells.Rogue
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.T52pSetBonus);
|
||||
return ValidateSpellInfo(SpellIds.T52PSetBonus);
|
||||
}
|
||||
|
||||
void HandleDummy(uint effIndex)
|
||||
{
|
||||
int damagePerCombo = GetHitDamage();
|
||||
AuraEffect t5 = GetCaster().GetAuraEffect(SpellIds.T52pSetBonus, 0);
|
||||
AuraEffect t5 = GetCaster().GetAuraEffect(SpellIds.T52PSetBonus, 0);
|
||||
if (t5 != null)
|
||||
damagePerCombo += t5.GetAmount();
|
||||
|
||||
int finalDamage = damagePerCombo;
|
||||
var costs = GetSpell().GetPowerCost();
|
||||
var c = costs.Find(cost => cost.Power == PowerType.ComboPoints);
|
||||
if (c != null)
|
||||
finalDamage *= c.Amount;
|
||||
List<SpellPowerCost> cost = GetSpell().GetPowerCost();
|
||||
var c = cost.Find(cost => cost.Power == PowerType.ComboPoints);
|
||||
if (c != null)
|
||||
finalDamage *= c.Amount;
|
||||
|
||||
SetHitDamage(finalDamage);
|
||||
}
|
||||
SetHitDamage(finalDamage);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 2, SpellEffectName.Dummy));
|
||||
OnEffectHitTarget.Add(new(HandleDummy, 2, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -695,58 +773,65 @@ namespace Scripts.Spells.Rogue
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.MasterOfSubtletyPassive, SpellIds.MasterOfSubtletyDamagePercent, SpellIds.Sanctuary, SpellIds.ShadowFocus, SpellIds.ShadowFocusEffect, SpellIds.StealthStealthAura, SpellIds.StealthShapeshiftAura);
|
||||
}
|
||||
return ValidateSpellInfo(SpellIds.MasterOfSubtletyPassive,
|
||||
SpellIds.MasterOfSubtletyDamagePercent,
|
||||
SpellIds.Sanctuary,
|
||||
SpellIds.ShadowFocus,
|
||||
SpellIds.ShadowFocusEffect,
|
||||
SpellIds.StealthStealthAura,
|
||||
SpellIds.StealthShapeshiftAura
|
||||
);
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
void HandleEffectApply(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
Unit target = GetTarget();
|
||||
|
||||
// Master of Subtlety
|
||||
if (target.HasAura(SpellIds.MasterOfSubtletyPassive))
|
||||
target.CastSpell(target, SpellIds.MasterOfSubtletyDamagePercent, TriggerCastFlags.FullMask);
|
||||
|
||||
// Shadow Focus
|
||||
if (target.HasAura(SpellIds.ShadowFocus))
|
||||
target.CastSpell(target, SpellIds.ShadowFocusEffect, TriggerCastFlags.FullMask);
|
||||
|
||||
// Premeditation
|
||||
if (target.HasAura(SpellIds.PremeditationPassive))
|
||||
target.CastSpell(target, SpellIds.PremeditationAura, true);
|
||||
|
||||
target.CastSpell(target, SpellIds.Sanctuary, TriggerCastFlags.FullMask);
|
||||
target.CastSpell(target, SpellIds.StealthStealthAura, TriggerCastFlags.FullMask);
|
||||
target.CastSpell(target, SpellIds.StealthShapeshiftAura, TriggerCastFlags.FullMask);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
Unit target = GetTarget();
|
||||
|
||||
// Master of Subtlety
|
||||
AuraEffect masterOfSubtletyPassive = GetTarget().GetAuraEffect(SpellIds.MasterOfSubtletyPassive, 0);
|
||||
if (masterOfSubtletyPassive != null)
|
||||
{
|
||||
Unit target = GetTarget();
|
||||
|
||||
// Master of Subtlety
|
||||
if (target.HasAura(SpellIds.MasterOfSubtletyPassive))
|
||||
target.CastSpell(target, SpellIds.MasterOfSubtletyDamagePercent, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
|
||||
|
||||
// Shadow Focus
|
||||
if (target.HasAura(SpellIds.ShadowFocus))
|
||||
target.CastSpell(target, SpellIds.ShadowFocusEffect, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
|
||||
|
||||
// Premeditation
|
||||
if (target.HasAura(SpellIds.PremeditationPassive))
|
||||
target.CastSpell(target, SpellIds.PremeditationAura, true);
|
||||
|
||||
target.CastSpell(target, SpellIds.Sanctuary, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
|
||||
target.CastSpell(target, SpellIds.StealthStealthAura, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
|
||||
target.CastSpell(target, SpellIds.StealthShapeshiftAura, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
Unit target = GetTarget();
|
||||
|
||||
// Master of Subtlety
|
||||
AuraEffect masterOfSubtletyPassive = GetTarget().GetAuraEffect(SpellIds.MasterOfSubtletyPassive, 0);
|
||||
if (masterOfSubtletyPassive != null)
|
||||
Aura masterOfSubtletyAura = GetTarget().GetAura(SpellIds.MasterOfSubtletyDamagePercent);
|
||||
if (masterOfSubtletyAura != null)
|
||||
{
|
||||
Aura masterOfSubtletyAura = GetTarget().GetAura(SpellIds.MasterOfSubtletyDamagePercent);
|
||||
if (masterOfSubtletyAura != null)
|
||||
{
|
||||
masterOfSubtletyAura.SetMaxDuration(masterOfSubtletyPassive.GetAmount());
|
||||
masterOfSubtletyAura.RefreshDuration();
|
||||
}
|
||||
masterOfSubtletyAura.SetMaxDuration(masterOfSubtletyPassive.GetAmount());
|
||||
masterOfSubtletyAura.RefreshDuration();
|
||||
}
|
||||
|
||||
// Premeditation
|
||||
target.RemoveAura(SpellIds.PremeditationAura);
|
||||
|
||||
target.RemoveAurasDueToSpell(SpellIds.ShadowFocusEffect);
|
||||
target.RemoveAurasDueToSpell(SpellIds.StealthStealthAura);
|
||||
target.RemoveAurasDueToSpell(SpellIds.StealthShapeshiftAura);
|
||||
}
|
||||
|
||||
// Premeditation
|
||||
target.RemoveAura(SpellIds.PremeditationAura);
|
||||
|
||||
target.RemoveAurasDueToSpell(SpellIds.ShadowFocusEffect);
|
||||
target.RemoveAurasDueToSpell(SpellIds.StealthStealthAura);
|
||||
target.RemoveAurasDueToSpell(SpellIds.StealthShapeshiftAura);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectApply.Add(new EffectApplyHandler(HandleEffectApply, 0, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(HandleEffectRemove, 0, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
AfterEffectApply.Add(new(HandleEffectApply, 0, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
AfterEffectRemove.Add(new(HandleEffectRemove, 0, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -766,13 +851,15 @@ namespace Scripts.Spells.Rogue
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleEffectHitTarget, 0, SpellEffectName.ApplyAura));
|
||||
OnEffectHitTarget.Add(new(HandleEffectHitTarget, 0, SpellEffectName.ApplyAura));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 57934 - Tricks of the Trade
|
||||
class spell_rog_tricks_of_the_trade_aura : AuraScript
|
||||
class spell_rog_tricks_of_the_trade_AuraScript : AuraScript
|
||||
{
|
||||
ObjectGuid _redirectTarget;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.TricksOfTheTradeProc);
|
||||
@@ -789,19 +876,17 @@ namespace Scripts.Spells.Rogue
|
||||
PreventDefaultAction();
|
||||
|
||||
Unit rogue = GetTarget();
|
||||
if (Global.ObjAccessor.GetUnit(rogue, _redirectTarget))
|
||||
rogue.CastSpell(rogue, SpellIds.TricksOfTheTradeProc, new CastSpellExtraArgs(aurEff));
|
||||
if (ObjAccessor.GetUnit(rogue, _redirectTarget) != null)
|
||||
rogue.CastSpell(rogue, SpellIds.TricksOfTheTradeProc, aurEff);
|
||||
Remove(AuraRemoveMode.Default);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(OnRemove, 1, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 1, AuraType.Dummy));
|
||||
AfterEffectRemove.Add(new(OnRemove, 1, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
OnEffectProc.Add(new(HandleProc, 1, AuraType.Dummy));
|
||||
}
|
||||
|
||||
ObjectGuid _redirectTarget;
|
||||
|
||||
public void SetRedirectTarget(ObjectGuid guid) { _redirectTarget = guid; }
|
||||
}
|
||||
|
||||
@@ -813,11 +898,11 @@ namespace Scripts.Spells.Rogue
|
||||
Aura aura = GetHitAura();
|
||||
if (aura != null)
|
||||
{
|
||||
spell_rog_tricks_of_the_trade_aura script = aura.GetScript<spell_rog_tricks_of_the_trade_aura>();
|
||||
var script = aura.GetScript<spell_rog_tricks_of_the_trade_AuraScript>();
|
||||
if (script != null)
|
||||
{
|
||||
Unit explTarget = GetExplTargetUnit();
|
||||
if (explTarget != null)
|
||||
if (explTarget)
|
||||
script.SetRedirectTarget(explTarget.GetGUID());
|
||||
else
|
||||
script.SetRedirectTarget(ObjectGuid.Empty);
|
||||
@@ -827,7 +912,7 @@ namespace Scripts.Spells.Rogue
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterHit.Add(new HitHandler(DoAfterHit));
|
||||
AfterHit.Add(new(DoAfterHit));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -841,7 +926,7 @@ namespace Scripts.Spells.Rogue
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(HandleRemove, 0, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
AfterEffectRemove.Add(new(HandleRemove, 0, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -850,12 +935,12 @@ namespace Scripts.Spells.Rogue
|
||||
{
|
||||
bool CheckForStun(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
return eventInfo.GetProcSpell() && eventInfo.GetProcSpell().GetSpellInfo().HasAura(AuraType.ModStun);
|
||||
return eventInfo.GetProcSpell() != null && eventInfo.GetProcSpell().GetSpellInfo().HasAura(AuraType.ModStun);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckEffectProc.Add(new CheckEffectProcHandler(CheckForStun, 0, AuraType.ProcTriggerSpell));
|
||||
DoCheckEffectProc.Add(new(CheckForStun, 0, AuraType.ProcTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -872,7 +957,7 @@ namespace Scripts.Spells.Rogue
|
||||
Unit target = GetTarget();
|
||||
if (!target.HasAuraType(AuraType.ModStun))
|
||||
{
|
||||
target.CastSpell(target, SpellIds.TurnTheTablesBuff, new CastSpellExtraArgs(aurEff));
|
||||
target.CastSpell(target, SpellIds.TurnTheTablesBuff, aurEff);
|
||||
PreventDefaultAction();
|
||||
Remove();
|
||||
}
|
||||
@@ -880,11 +965,11 @@ namespace Scripts.Spells.Rogue
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(CheckForStun, 0, AuraType.PeriodicDummy));
|
||||
OnEffectPeriodic.Add(new(CheckForStun, 0, AuraType.PeriodicDummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 1856 - Vanish - SPELL_ROGUE_VANISH
|
||||
[Script] // 1856 - Vanish - SpellIds.Vanish
|
||||
class spell_rog_vanish : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
@@ -905,18 +990,18 @@ namespace Scripts.Spells.Rogue
|
||||
if (target.HasAura(SpellIds.VanishAura))
|
||||
return;
|
||||
|
||||
target.CastSpell(target, SpellIds.VanishAura, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
|
||||
target.CastSpell(target, SpellIds.StealthShapeshiftAura, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
|
||||
target.CastSpell(target, SpellIds.VanishAura, TriggerCastFlags.FullMask);
|
||||
target.CastSpell(target, SpellIds.StealthShapeshiftAura, TriggerCastFlags.FullMask);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectLaunchTarget.Add(new EffectHandler(OnLaunchTarget, 1, SpellEffectName.TriggerSpell));
|
||||
OnEffectLaunchTarget.Add(new(OnLaunchTarget, 1, SpellEffectName.TriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 11327 - Vanish
|
||||
class spell_rog_vanish_aura : AuraScript
|
||||
class spell_rog_vanish_AuraScript : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
@@ -925,16 +1010,16 @@ namespace Scripts.Spells.Rogue
|
||||
|
||||
void HandleEffectRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
GetTarget().CastSpell(GetTarget(), SpellIds.Stealth, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
|
||||
GetTarget().CastSpell(GetTarget(), SpellIds.Stealth, TriggerCastFlags.FullMask);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(HandleEffectRemove, 0, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
AfterEffectRemove.Add(new(HandleEffectRemove, 0, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 79134 - Venomous Wounds - SPELL_ROGUE_VENOMOUS_WOUNDS
|
||||
[Script] // 79134 - Venomous Wounds - SpellIds.VenomousWounds
|
||||
class spell_rog_venomous_wounds : AuraScript
|
||||
{
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
@@ -945,7 +1030,7 @@ namespace Scripts.Spells.Rogue
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 1, AuraType.Dummy));
|
||||
OnEffectProc.Add(new(HandleProc, 1, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+477
-193
File diff suppressed because it is too large
Load Diff
+139
-121
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Framework.Constants;
|
||||
@@ -6,8 +6,8 @@ using Framework.Dynamic;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using static Global;
|
||||
|
||||
namespace Scripts.Spells.Warlock
|
||||
{
|
||||
@@ -32,7 +32,7 @@ namespace Scripts.Spells.Warlock
|
||||
public const uint SeedOfCorruptionDamage = 27285;
|
||||
public const uint SeedOfCorruptionGeneric = 32865;
|
||||
public const uint ShadowBoltEnergize = 194192;
|
||||
public const uint Soulshatter = 32835;
|
||||
public const uint SoulshatterEffect = 32835;
|
||||
public const uint SoulSwapCdMarker = 94229;
|
||||
public const uint SoulSwapOverride = 86211;
|
||||
public const uint SoulSwapModCost = 92794;
|
||||
@@ -55,13 +55,15 @@ namespace Scripts.Spells.Warlock
|
||||
[Script] // 710 - Banish
|
||||
class spell_warl_banish : SpellScript
|
||||
{
|
||||
public spell_warl_banish() { }
|
||||
|
||||
void HandleBanish(SpellMissInfo missInfo)
|
||||
{
|
||||
if (missInfo != SpellMissInfo.Immune)
|
||||
return;
|
||||
|
||||
Unit target = GetHitUnit();
|
||||
if (target)
|
||||
if (target != null)
|
||||
{
|
||||
// Casting Banish on a banished target will Remove applied aura
|
||||
Aura banishAura = target.GetAura(GetSpellInfo().Id, GetCaster().GetGUID());
|
||||
@@ -72,7 +74,7 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
BeforeHit.Add(new BeforeHitHandler(HandleBanish));
|
||||
BeforeHit.Add(new(HandleBanish));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +89,8 @@ namespace Scripts.Spells.Warlock
|
||||
SpellCastResult CheckApplyAura()
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
if (caster.GetHealthPct() <= GetEffectInfo(1).CalcValue(caster))
|
||||
|
||||
if (caster.GetHealthPct() <= (float)(GetEffectInfo(1).CalcValue(caster)))
|
||||
{
|
||||
SetCustomCastResultMessage(SpellCustomErrors.YouDontHaveEnoughHealth);
|
||||
return SpellCastResult.CustomError;
|
||||
@@ -98,16 +101,16 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnCheckCast.Add(new CheckCastHandler(CheckApplyAura));
|
||||
OnCheckCast.Add(new(CheckApplyAura));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 111400 - Burning Rush
|
||||
class spell_warl_burning_rush_aura : AuraScript
|
||||
class spell_warl_burning_rush_AuraScript : AuraScript
|
||||
{
|
||||
void PeriodicTick(AuraEffect aurEff)
|
||||
{
|
||||
if (GetTarget().GetHealthPct() <= aurEff.GetAmount())
|
||||
if (GetTarget().GetHealthPct() <= (float)(aurEff.GetAmount()))
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Remove();
|
||||
@@ -116,10 +119,10 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(PeriodicTick, 1, AuraType.PeriodicDamagePercent));
|
||||
OnEffectPeriodic.Add(new(PeriodicTick, 1, AuraType.PeriodicDamagePercent));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Script] // 116858 - Chaos Bolt
|
||||
class spell_warl_chaos_bolt : SpellScript
|
||||
{
|
||||
@@ -140,8 +143,8 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.SchoolDamage));
|
||||
OnCalcCritChance.Add(new OnCalcCritChanceHandler(CalcCritChance));
|
||||
OnEffectHitTarget.Add(new(HandleDummy, 0, SpellEffectName.SchoolDamage));
|
||||
OnCalcCritChance.Add(new(CalcCritChance));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,15 +153,15 @@ namespace Scripts.Spells.Warlock
|
||||
{
|
||||
void HandleAbsorb(AuraEffect aurEff, DamageInfo dmgInfo, ref uint absorbAmount)
|
||||
{
|
||||
AuraEffect auraEffect = GetEffect(1);
|
||||
if (auraEffect == null || !GetTargetApplication().HasEffect(1))
|
||||
AuraEffect effect1 = GetEffect(1);
|
||||
if (effect1 == null || !GetTargetApplication().HasEffect(1))
|
||||
{
|
||||
PreventDefaultAction();
|
||||
return;
|
||||
}
|
||||
|
||||
// You take ${$s2/3}% reduced damage
|
||||
float damageReductionPct = (float)auraEffect.GetAmount() / 3;
|
||||
float damageReductionPct = (float)(effect1.GetAmount()) / 3;
|
||||
// plus a random amount of up to ${$s2/3}% additional reduced damage
|
||||
damageReductionPct += RandomHelper.FRand(0.0f, damageReductionPct);
|
||||
|
||||
@@ -167,7 +170,7 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectAbsorb.Add(new EffectAbsorbHandler(HandleAbsorb, 2));
|
||||
OnEffectAbsorb.Add(new(HandleAbsorb, 2));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,7 +184,7 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
public override bool Load()
|
||||
{
|
||||
return GetCaster().IsTypeId(TypeId.Player);
|
||||
return GetCaster().IsPlayer();
|
||||
}
|
||||
|
||||
void HandleScriptEffect(uint effIndex)
|
||||
@@ -191,7 +194,7 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleScriptEffect, 0, SpellEffectName.ScriptEffect));
|
||||
OnEffectHitTarget.Add(new(HandleScriptEffect, 0, SpellEffectName.ScriptEffect));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,17 +221,17 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalculateAmount, 0, AuraType.SchoolAbsorb));
|
||||
DoEffectCalcAmount.Add(new(CalculateAmount, 0, AuraType.SchoolAbsorb));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Script] // 48018 - Demonic Circle: Summon
|
||||
class spell_warl_demonic_circle_summon : AuraScript
|
||||
{
|
||||
void HandleRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
// If effect is Removed by expire Remove the summoned demonic circle too.
|
||||
if (!mode.HasAnyFlag(AuraEffectHandleModes.Reapply))
|
||||
if (!mode.HasFlag(AuraEffectHandleModes.Reapply))
|
||||
GetTarget().RemoveGameObject(GetId(), true);
|
||||
|
||||
GetTarget().RemoveAura(SpellIds.DemonicCircleAllowCast);
|
||||
@@ -237,13 +240,13 @@ namespace Scripts.Spells.Warlock
|
||||
void HandleDummyTick(AuraEffect aurEff)
|
||||
{
|
||||
GameObject circle = GetTarget().GetGameObject(GetId());
|
||||
if (circle)
|
||||
if (circle != null)
|
||||
{
|
||||
// Here we check if player is in demonic circle teleport range, if so add
|
||||
// WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST; allowing him to cast the WARLOCK_DEMONIC_CIRCLE_TELEPORT.
|
||||
// If not in range Remove the WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST.
|
||||
// WarlockDemonicCircleAllowCast; allowing him to cast the WarlockDemonicCircleTeleport.
|
||||
// If not in range Remove the WarlockDemonicCircleAllowCast.
|
||||
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.DemonicCircleTeleport, GetCastDifficulty());
|
||||
SpellInfo spellInfo = SpellMgr.GetSpellInfo(SpellIds.DemonicCircleTeleport, GetCastDifficulty());
|
||||
|
||||
if (GetTarget().IsWithinDist(circle, spellInfo.GetMaxRange(true)))
|
||||
{
|
||||
@@ -257,8 +260,8 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectRemove.Add(new EffectApplyHandler(HandleRemove, 0, AuraType.PeriodicDummy, AuraEffectHandleModes.RealOrReapplyMask));
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(HandleDummyTick, 0, AuraType.PeriodicDummy));
|
||||
OnEffectRemove.Add(new(HandleRemove, 0, AuraType.PeriodicDummy, AuraEffectHandleModes.RealOrReapplyMask));
|
||||
OnEffectPeriodic.Add(new(HandleDummyTick, 0, AuraType.PeriodicDummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,10 +271,10 @@ namespace Scripts.Spells.Warlock
|
||||
void HandleTeleport(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
Player player = GetTarget().ToPlayer();
|
||||
if (player)
|
||||
if (player != null)
|
||||
{
|
||||
GameObject circle = player.GetGameObject(SpellIds.DemonicCircleSummon);
|
||||
if (circle)
|
||||
if (circle != null)
|
||||
{
|
||||
player.NearTeleportTo(circle.GetPositionX(), circle.GetPositionY(), circle.GetPositionZ(), circle.GetOrientation());
|
||||
player.RemoveMovementImpairingAuras(false);
|
||||
@@ -281,7 +284,7 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectApply.Add(new EffectApplyHandler(HandleTeleport, 0, AuraType.MechanicImmunity, AuraEffectHandleModes.Real));
|
||||
OnEffectApply.Add(new(HandleTeleport, 0, AuraType.MechanicImmunity, AuraEffectHandleModes.Real));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,7 +293,8 @@ namespace Scripts.Spells.Warlock
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.GlyphOfDemonTraining, SpellIds.DevourMagicHeal) && ValidateSpellEffect(spellInfo.Id, 1);
|
||||
return ValidateSpellInfo(SpellIds.GlyphOfDemonTraining, SpellIds.DevourMagicHeal)
|
||||
&& ValidateSpellEffect((spellInfo.Id, 1));
|
||||
}
|
||||
|
||||
void OnSuccessfulDispel(uint effIndex)
|
||||
@@ -303,14 +307,13 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
// Glyph of Felhunter
|
||||
Unit owner = caster.GetOwner();
|
||||
if (owner)
|
||||
if (owner.GetAura(SpellIds.GlyphOfDemonTraining) != null)
|
||||
owner.CastSpell(owner, SpellIds.DevourMagicHeal, args);
|
||||
if (owner?.GetAura(SpellIds.GlyphOfDemonTraining) != null)
|
||||
owner.CastSpell(owner, SpellIds.DevourMagicHeal, args);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectSuccessfulDispel.Add(new EffectHandler(OnSuccessfulDispel, 0, SpellEffectName.Dispel));
|
||||
OnEffectSuccessfulDispel.Add(new(OnSuccessfulDispel, 0, SpellEffectName.Dispel));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,7 +337,7 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectRemove.Add(new EffectApplyHandler(HandleRemove, 0, AuraType.PeriodicDamage, AuraEffectHandleModes.Real));
|
||||
AfterEffectRemove.Add(new(HandleRemove, 0, AuraType.PeriodicDamage, AuraEffectHandleModes.Real));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -354,7 +357,7 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterHit.Add(new HitHandler(HandleAfterHit));
|
||||
AfterHit.Add(new(HandleAfterHit));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,7 +367,7 @@ namespace Scripts.Spells.Warlock
|
||||
void ApplyEffect(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
if (!caster)
|
||||
if (caster == null)
|
||||
return;
|
||||
|
||||
Unit target = GetTarget();
|
||||
@@ -384,13 +387,13 @@ namespace Scripts.Spells.Warlock
|
||||
void OnPeriodic(AuraEffect aurEff)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
if (!caster)
|
||||
if (caster == null)
|
||||
return;
|
||||
//! HACK for self damage, is not blizz :/
|
||||
//! Hack for self damage, is not blizz :/
|
||||
uint damage = (uint)caster.CountPctFromMaxHealth(aurEff.GetBaseAmount());
|
||||
|
||||
Player modOwner = caster.GetSpellModOwner();
|
||||
if (modOwner)
|
||||
if (modOwner != null)
|
||||
modOwner.ApplySpellMod(GetSpellInfo(), SpellModOp.PowerCost0, ref damage);
|
||||
|
||||
SpellNonMeleeDamage damageInfo = new(caster, caster, GetSpellInfo(), GetAura().GetSpellVisual(), GetSpellInfo().SchoolMask, GetAura().GetCastId());
|
||||
@@ -402,9 +405,9 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectApply.Add(new EffectApplyHandler(ApplyEffect, 0, AuraType.ObsModHealth, AuraEffectHandleModes.Real));
|
||||
OnEffectRemove.Add(new EffectApplyHandler(RemoveEffect, 0, AuraType.ObsModHealth, AuraEffectHandleModes.Real));
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(OnPeriodic, 0, AuraType.ObsModHealth));
|
||||
OnEffectApply.Add(new(ApplyEffect, 0, AuraType.ObsModHealth, AuraEffectHandleModes.Real));
|
||||
OnEffectRemove.Add(new(RemoveEffect, 0, AuraType.ObsModHealth, AuraEffectHandleModes.Real));
|
||||
OnEffectPeriodic.Add(new(OnPeriodic, 0, AuraType.ObsModHealth));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -419,7 +422,7 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnHit.Add(new HitHandler(HandleOnHit));
|
||||
OnHit.Add(new(HandleOnHit));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -438,7 +441,7 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleOnEffectHit, 0, SpellEffectName.SchoolDamage));
|
||||
OnEffectHitTarget.Add(new(HandleOnEffectHit, 0, SpellEffectName.SchoolDamage));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -458,7 +461,7 @@ namespace Scripts.Spells.Warlock
|
||||
caster.RemoveAurasDueToSpell(SpellIds.IncubusPact);
|
||||
|
||||
Player player = GetCaster().ToPlayer();
|
||||
if (!player)
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
Pet pet = player.GetPet();
|
||||
@@ -471,7 +474,7 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHit.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
OnEffectHit.Add(new(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -482,19 +485,19 @@ namespace Scripts.Spells.Warlock
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SharedConst.PetSummoningDisorientation);
|
||||
return ValidateSpellInfo(SharedConst.SpellPetSummoningDisorientation);
|
||||
}
|
||||
|
||||
// Note: this is a special case in which the warlock's minion pet must also cast Summon Disorientation at the beginning since this is only handled by SPELL_EFFECT_SUMMON_PET in Spell::CheckCast.
|
||||
// Note: this is a special case in which the warlock's minion pet must also cast Summon Disorientation at the beginning Math.Since this is only handled by SpellEffectSummonPet in Spell.CheckCast.
|
||||
public override void OnPrecast()
|
||||
{
|
||||
Player player = GetCaster().ToPlayer();
|
||||
if (!player)
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
Pet pet = player.GetPet();
|
||||
if (pet != null)
|
||||
pet.CastSpell(pet, SharedConst.PetSummoningDisorientation, new CastSpellExtraArgs(TriggerCastFlags.FullMask)
|
||||
pet.CastSpell(pet, SharedConst.SpellPetSummoningDisorientation, new CastSpellExtraArgs(TriggerCastFlags.FullMask)
|
||||
.SetOriginalCaster(pet.GetGUID())
|
||||
.SetTriggeringSpell(GetSpell()));
|
||||
}
|
||||
@@ -514,11 +517,11 @@ namespace Scripts.Spells.Warlock
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
Unit target = GetHitUnit();
|
||||
if (target)
|
||||
if (target != null)
|
||||
{
|
||||
if (caster.GetOwner() && caster.GetOwner().HasAura(SpellIds.GlyphOfSuccubus))
|
||||
if (caster.GetOwner() != null && caster.GetOwner().HasAura(SpellIds.GlyphOfSuccubus))
|
||||
{
|
||||
target.RemoveAurasByType(AuraType.PeriodicDamage, ObjectGuid.Empty, target.GetAura(SpellIds.PriestShadowWordDeath)); // SW:D shall not be Removed.
|
||||
target.RemoveAurasByType(AuraType.PeriodicDamage, ObjectGuid.Empty, target.GetAura(SpellIds.PriestShadowWordDeath)); // Sw:D shall not be Removed.
|
||||
target.RemoveAurasByType(AuraType.PeriodicDamagePercent);
|
||||
target.RemoveAurasByType(AuraType.PeriodicLeech);
|
||||
}
|
||||
@@ -527,7 +530,7 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleScriptEffect, 0, SpellEffectName.ApplyAura));
|
||||
OnEffectHitTarget.Add(new(HandleScriptEffect, 0, SpellEffectName.ApplyAura));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -536,13 +539,13 @@ namespace Scripts.Spells.Warlock
|
||||
{
|
||||
void FilterTargets(List<WorldObject> targets)
|
||||
{
|
||||
if (GetExplTargetUnit())
|
||||
if (GetExplTargetUnit() != null)
|
||||
targets.Remove(GetExplTargetUnit());
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(FilterTargets, 0, Targets.UnitDestAreaEnemy));
|
||||
OnObjectAreaTargetSelect.Add(new(FilterTargets, 0, Targets.UnitDestAreaEnemy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -581,16 +584,16 @@ namespace Scripts.Spells.Warlock
|
||||
Remove();
|
||||
|
||||
Unit caster = GetCaster();
|
||||
if (!caster)
|
||||
if (caster == null)
|
||||
return;
|
||||
|
||||
caster.CastSpell(eventInfo.GetActionTarget(), SpellIds.SeedOfCorruptionDamage, true);
|
||||
caster.CastSpell(eventInfo.GetActionTarget(), SpellIds.SeedOfCorruptionDamage, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalculateBuffer, 2, AuraType.Dummy));
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 2, AuraType.Dummy));
|
||||
DoEffectCalcAmount.Add(new(CalculateBuffer, 2, AuraType.Dummy));
|
||||
OnEffectProc.Add(new(HandleProc, 2, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -615,7 +618,7 @@ namespace Scripts.Spells.Warlock
|
||||
if (damageInfo == null || damageInfo.GetDamage() == 0)
|
||||
return;
|
||||
|
||||
int amount = aurEff.GetAmount() - (int)damageInfo.GetDamage();
|
||||
int amount = (int)(aurEff.GetAmount() - damageInfo.GetDamage());
|
||||
if (amount > 0)
|
||||
{
|
||||
aurEff.SetAmount(amount);
|
||||
@@ -625,15 +628,15 @@ namespace Scripts.Spells.Warlock
|
||||
Remove();
|
||||
|
||||
Unit caster = GetCaster();
|
||||
if (!caster)
|
||||
if (caster == null)
|
||||
return;
|
||||
|
||||
caster.CastSpell(eventInfo.GetActionTarget(), SpellIds.SeedOfCorruptionGeneric, new CastSpellExtraArgs(aurEff));
|
||||
caster.CastSpell(eventInfo.GetActionTarget(), SpellIds.SeedOfCorruptionGeneric, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 1, AuraType.Dummy));
|
||||
OnEffectProc.Add(new(HandleProc, 1, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -652,7 +655,7 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterCast.Add(new CastHandler(HandleAfterCast));
|
||||
AfterCast.Add(new(HandleAfterCast));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -672,22 +675,26 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleHit, 0, SpellEffectName.SchoolDamage));
|
||||
OnEffectHitTarget.Add(new(HandleHit, 0, SpellEffectName.SchoolDamage));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 86211 - Soul Swap - Also acts as a dot container
|
||||
public class spell_warl_soul_swap_override : AuraScript
|
||||
[Script] // 86211 - Soul Swap Override - Also acts as a dot container
|
||||
class spell_warl_soul_swap_override : AuraScript
|
||||
{
|
||||
List<uint> _dotList = new();
|
||||
Unit _swapCaster;
|
||||
|
||||
//! Forced to, pure virtual functions must have a body when linking
|
||||
public override void Register() { }
|
||||
|
||||
public void AddDot(uint id) { _dotList.Add(id); }
|
||||
|
||||
public List<uint> GetDotList() { return _dotList; }
|
||||
|
||||
public Unit GetOriginalSwapSource() { return _swapCaster; }
|
||||
|
||||
public void SetOriginalSwapSource(Unit victim) { _swapCaster = victim; }
|
||||
List<uint> _dotList = new();
|
||||
Unit _swapCaster;
|
||||
}
|
||||
|
||||
[Script] //! Soul Swap Copy Spells - 92795 - Simply copies spell IDs.
|
||||
@@ -697,7 +704,7 @@ namespace Scripts.Spells.Warlock
|
||||
{
|
||||
Unit swapVictim = GetCaster();
|
||||
Unit warlock = GetHitUnit();
|
||||
if (!warlock || !swapVictim)
|
||||
if (warlock == null || swapVictim == null)
|
||||
return;
|
||||
|
||||
var appliedAuras = swapVictim.GetAppliedAuras();
|
||||
@@ -711,12 +718,12 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
FlagArray128 classMask = GetEffectInfo().SpellClassMask;
|
||||
|
||||
foreach (var itr in appliedAuras)
|
||||
foreach (var (id, aurApp) in appliedAuras)
|
||||
{
|
||||
SpellInfo spellProto = itr.Value.GetBase().GetSpellInfo();
|
||||
if (itr.Value.GetBase().GetCaster() == warlock)
|
||||
SpellInfo spellProto = aurApp.GetBase().GetSpellInfo();
|
||||
if (aurApp.GetBase().GetCaster() == warlock)
|
||||
if (spellProto.SpellFamilyName == SpellFamilyNames.Warlock && (spellProto.SpellFamilyFlags & classMask))
|
||||
swapSpellScript.AddDot(itr.Key);
|
||||
swapSpellScript.AddDot(id);
|
||||
}
|
||||
|
||||
swapSpellScript.SetOriginalSwapSource(swapVictim);
|
||||
@@ -724,7 +731,7 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleHit, 0, SpellEffectName.Dummy));
|
||||
OnEffectHitTarget.Add(new(HandleHit, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -749,13 +756,13 @@ namespace Scripts.Spells.Warlock
|
||||
}
|
||||
|
||||
// Soul Swap Exhale can't be cast on the same target than Soul Swap
|
||||
if (swapTarget && currentTarget && swapTarget == currentTarget)
|
||||
if (swapTarget != null && currentTarget != null && swapTarget == currentTarget)
|
||||
return SpellCastResult.BadTargets;
|
||||
|
||||
return SpellCastResult.SpellCastOk;
|
||||
}
|
||||
|
||||
void onEffectHit(uint effIndex)
|
||||
void OnEffectHitTargetTemp(uint effIndex)
|
||||
{
|
||||
GetCaster().CastSpell(GetCaster(), SpellIds.SoulSwapModCost, true);
|
||||
bool hasGlyph = GetCaster().HasAura(SpellIds.GlyphOfSoulSwap);
|
||||
@@ -775,11 +782,11 @@ namespace Scripts.Spells.Warlock
|
||||
if (dotList.Empty())
|
||||
return;
|
||||
|
||||
foreach (var itr in dotList)
|
||||
foreach (var spellId in dotList)
|
||||
{
|
||||
GetCaster().AddAura(itr, GetHitUnit());
|
||||
if (!hasGlyph && swapSource)
|
||||
swapSource.RemoveAurasDueToSpell(itr);
|
||||
GetCaster().AddAura(spellId, GetHitUnit());
|
||||
if (!hasGlyph && swapSource != null)
|
||||
swapSource.RemoveAurasDueToSpell(spellId);
|
||||
}
|
||||
|
||||
// Remove Soul Swap Exhale buff
|
||||
@@ -791,8 +798,8 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnCheckCast.Add(new CheckCastHandler(CheckCast));
|
||||
OnEffectHitTarget.Add(new EffectHandler(onEffectHit, 0, SpellEffectName.SchoolDamage));
|
||||
OnCheckCast.Add(new(CheckCast));
|
||||
OnEffectHitTarget.Add(new(OnEffectHitTargetTemp, 0, SpellEffectName.SchoolDamage));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -801,21 +808,21 @@ namespace Scripts.Spells.Warlock
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.Soulshatter);
|
||||
return ValidateSpellInfo(SpellIds.SoulshatterEffect);
|
||||
}
|
||||
|
||||
void HandleDummy(uint effIndex)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
Unit target = GetHitUnit();
|
||||
if (target)
|
||||
if (target.CanHaveThreatList() && target.GetThreatManager().GetThreat(caster) > 0.0f)
|
||||
caster.CastSpell(target, SpellIds.Soulshatter, true);
|
||||
if (target != null)
|
||||
if (target.GetThreatManager().IsThreatenedBy(caster, true))
|
||||
caster.CastSpell(target, SpellIds.SoulshatterEffect, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
OnEffectHitTarget.Add(new(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -831,13 +838,13 @@ namespace Scripts.Spells.Warlock
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
|
||||
caster.CastSpell((WorldObject)null, SpellIds.SuccubusPact, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
|
||||
caster.CastSpell((WorldObject)null, SpellIds.SummonSuccubus, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
|
||||
caster.CastSpell(null, SpellIds.SuccubusPact, TriggerCastFlags.FullMask);
|
||||
caster.CastSpell(null, SpellIds.SummonSuccubus, TriggerCastFlags.FullMask);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHit.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
OnEffectHit.Add(new(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -853,13 +860,13 @@ namespace Scripts.Spells.Warlock
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
|
||||
caster.CastSpell((WorldObject)null, SpellIds.IncubusPact, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
|
||||
caster.CastSpell((WorldObject)null, SpellIds.SummonIncubus, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
|
||||
caster.CastSpell(null, SpellIds.IncubusPact, TriggerCastFlags.FullMask);
|
||||
caster.CastSpell(null, SpellIds.SummonIncubus, TriggerCastFlags.FullMask);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHit.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
OnEffectHit.Add(new(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -873,42 +880,44 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
void HandleDummy(uint effIndex)
|
||||
{
|
||||
GetCaster().CastSpell((WorldObject)null, RandomHelper.randChance(50) ? SpellIds.SummonSuccubus : SpellIds.SummonIncubus, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
|
||||
GetCaster().CastSpell(null, RandomHelper.randChance(50) ? SpellIds.SummonSuccubus : SpellIds.SummonIncubus, TriggerCastFlags.FullMask);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHit.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
OnEffectHit.Add(new(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script("spell_warl_t4_2p_bonus_shadow", SpellIds.Flameshadow)]// 37377 - Shadowflame
|
||||
[Script("spell_warl_t4_2p_bonus_fire", SpellIds.Shadowflame)]// 39437 - Shadowflame Hellfire and RoF
|
||||
// 37377 - Shadowflame
|
||||
// 39437 - Shadowflame Hellfire and RoF
|
||||
[Script("spell_warl_t4_2p_bonus_shadow", SpellIds.Flameshadow)]
|
||||
[Script("spell_warl_t4_2p_bonus_fire", SpellIds.Shadowflame)]
|
||||
class spell_warl_t4_2p_bonus : AuraScript
|
||||
{
|
||||
public spell_warl_t4_2p_bonus(uint triggerSpell)
|
||||
uint _triggerId;
|
||||
|
||||
public spell_warl_t4_2p_bonus(uint triggerId)
|
||||
{
|
||||
_triggerSpell = triggerSpell;
|
||||
_triggerId = triggerId;
|
||||
}
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(_triggerSpell);
|
||||
return ValidateSpellInfo(_triggerId);
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit caster = eventInfo.GetActor();
|
||||
caster.CastSpell(caster, _triggerSpell, new CastSpellExtraArgs(aurEff));
|
||||
caster.CastSpell(caster, _triggerId, aurEff);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
OnEffectProc.Add(new(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
|
||||
uint _triggerSpell;
|
||||
}
|
||||
|
||||
[Script] // 30108, 34438, 34439, 35183 - Unstable Affliction
|
||||
@@ -922,26 +931,35 @@ namespace Scripts.Spells.Warlock
|
||||
void HandleDispel(DispelInfo dispelInfo)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
if (caster)
|
||||
if (caster != null)
|
||||
{
|
||||
AuraEffect aurEff = GetEffect(1);
|
||||
if (aurEff != null)
|
||||
{
|
||||
// backfire damage and silence
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, aurEff.GetAmount() * 9);
|
||||
caster.CastSpell(dispelInfo.GetDispeller(), SpellIds.UnstableAfflictionDispel, args);
|
||||
Unit target = dispelInfo.GetDispeller().ToUnit();
|
||||
if (target != null)
|
||||
{
|
||||
int bp = aurEff.GetAmount();
|
||||
bp = target.SpellDamageBonusTaken(caster, aurEff.GetSpellInfo(), bp, DamageEffectType.DOT);
|
||||
bp *= 9;
|
||||
|
||||
// backfire damage and silence
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, bp);
|
||||
caster.CastSpell(target, SpellIds.UnstableAfflictionDispel, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterDispel.Add(new AuraDispelHandler(HandleDispel));
|
||||
AfterDispel.Add(new(HandleDispel));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 5740 - Rain of Fire Updated 7.1.5
|
||||
// 5740 - Rain of Fire
|
||||
[Script] /// Updated 7.1.5
|
||||
class spell_warl_rain_of_fire : AuraScript
|
||||
{
|
||||
void HandleDummyTick(AuraEffect aurEff)
|
||||
@@ -951,14 +969,14 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
foreach (AreaTrigger rainOfFireAreaTrigger in rainOfFireAreaTriggers)
|
||||
{
|
||||
var insideTargets = rainOfFireAreaTrigger.GetInsideUnits();
|
||||
List<ObjectGuid> insideTargets = rainOfFireAreaTrigger.GetInsideUnits();
|
||||
targetsInRainOfFire.AddRange(insideTargets);
|
||||
}
|
||||
|
||||
foreach (ObjectGuid insideTargetGuid in targetsInRainOfFire)
|
||||
{
|
||||
Unit insideTarget = Global.ObjAccessor.GetUnit(GetTarget(), insideTargetGuid);
|
||||
if (insideTarget)
|
||||
Unit insideTarget = ObjAccessor.GetUnit(GetTarget(), insideTargetGuid);
|
||||
if (insideTarget != null)
|
||||
if (!GetTarget().IsFriendlyTo(insideTarget))
|
||||
GetTarget().CastSpell(insideTarget, SpellIds.RainOfFireDamage, true);
|
||||
}
|
||||
@@ -966,7 +984,7 @@ namespace Scripts.Spells.Warlock
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(HandleDummyTick, 3, AuraType.PeriodicDummy));
|
||||
OnEffectPeriodic.Add(new(HandleDummyTick, 3, AuraType.PeriodicDummy));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Framework.Constants;
|
||||
@@ -9,6 +9,7 @@ using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using static Global;
|
||||
|
||||
namespace Scripts.Spells.Warrior
|
||||
{
|
||||
@@ -42,21 +43,21 @@ namespace Scripts.Spells.Warrior
|
||||
public const uint RallyingCry = 97463;
|
||||
public const uint ShieldBlockAura = 132404;
|
||||
public const uint ShieldChargeEffect = 385953;
|
||||
public const uint ShieldSlam = 23922;
|
||||
public const uint ShieldSlamMarker = 224324;
|
||||
public const uint Shockwave = 46968;
|
||||
public const uint ShockwaveStun = 132168;
|
||||
public const uint Stoicism = 70845;
|
||||
public const uint StormBoltStun = 132169;
|
||||
public const uint Strategist = 384041;
|
||||
public const uint SweepingStrikesExtraAttack1 = 12723;
|
||||
public const uint SweepingStrikesExtraAttack2 = 26654;
|
||||
public const uint Taunt = 355;
|
||||
public const uint TraumaEffect = 215537;
|
||||
public const uint Victorious = 32216;
|
||||
public const uint VictoriousRushHeal = 118779;
|
||||
}
|
||||
public const uint VictoryRushHeal = 118779;
|
||||
|
||||
struct Misc
|
||||
{
|
||||
public const uint SpellVisualBlazingCharge = 26423;
|
||||
public const uint VisualBlazingCharge = 26423;
|
||||
}
|
||||
|
||||
[Script] // 23881 - Bloodthirst
|
||||
@@ -74,7 +75,7 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHit.Add(new EffectHandler(HandleDummy, 3, SpellEffectName.Dummy));
|
||||
OnEffectHit.Add(new(HandleDummy, 3, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,11 +108,11 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.PeriodicDummy));
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(HandleDummyTick, 0, AuraType.PeriodicDummy));
|
||||
AfterEffectProc.Add(new(HandleProc, 0, AuraType.PeriodicDummy));
|
||||
OnEffectPeriodic.Add(new(HandleDummyTick, 0, AuraType.PeriodicDummy));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Script] // 100 - Charge
|
||||
class spell_warr_charge : SpellScript
|
||||
{
|
||||
@@ -131,7 +132,7 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
OnEffectHitTarget.Add(new(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,18 +144,18 @@ namespace Scripts.Spells.Warrior
|
||||
PreventDefaultAction();
|
||||
if (GetTarget().IsSplineEnabled())
|
||||
{
|
||||
for (uint i = 0; i < 5; ++i)
|
||||
for (int i = 0; i < 5; ++i)
|
||||
{
|
||||
int timeOffset = (int)(6 * i * aurEff.GetPeriod() / 25);
|
||||
Vector4 loc = GetTarget().MoveSpline.ComputePosition(timeOffset);
|
||||
GetTarget().SendPlaySpellVisual(new Position(loc.X, loc.Y, loc.Z), Misc.SpellVisualBlazingCharge, 0, 0, 1.0f, true);
|
||||
GetTarget().SendPlaySpellVisual(new Position(loc.X, loc.Y, loc.Z), SpellIds.VisualBlazingCharge, 0, 0, 1.0f, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(DropFireVisual, 0, AuraType.PeriodicTriggerSpell));
|
||||
OnEffectPeriodic.Add(new(DropFireVisual, 0, AuraType.PeriodicTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,7 +179,7 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectLaunchTarget.Add(new EffectHandler(HandleCharge, 0, SpellEffectName.Charge));
|
||||
OnEffectLaunchTarget.Add(new(HandleCharge, 0, SpellEffectName.Charge));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,7 +192,7 @@ namespace Scripts.Spells.Warrior
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.ColossusSmashAura, SpellIds.InForTheKill, SpellIds.InForTheKillHaste)
|
||||
&& ValidateSpellEffect(SpellIds.InForTheKill, 2);
|
||||
&& ValidateSpellEffect((SpellIds.InForTheKill, 2));
|
||||
}
|
||||
|
||||
void HandleHit()
|
||||
@@ -203,7 +204,7 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
if (caster.HasAura(SpellIds.InForTheKill))
|
||||
{
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.InForTheKill, Difficulty.None);
|
||||
SpellInfo spellInfo = SpellMgr.GetSpellInfo(SpellIds.InForTheKill, Difficulty.None);
|
||||
if (spellInfo != null)
|
||||
{
|
||||
if (target.HealthBelowPct(spellInfo.GetEffect(2).CalcValue(caster)))
|
||||
@@ -215,7 +216,7 @@ namespace Scripts.Spells.Warrior
|
||||
void HandleAfterCast()
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.InForTheKill, Difficulty.None);
|
||||
SpellInfo spellInfo = SpellMgr.GetSpellInfo(SpellIds.InForTheKill, Difficulty.None);
|
||||
if (spellInfo == null)
|
||||
return;
|
||||
|
||||
@@ -228,8 +229,8 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnHit.Add(new HitHandler(HandleHit));
|
||||
AfterCast.Add(new CastHandler(HandleAfterCast));
|
||||
OnHit.Add(new(HandleHit));
|
||||
AfterCast.Add(new(HandleAfterCast));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,20 +246,46 @@ namespace Scripts.Spells.Warrior
|
||||
{
|
||||
int? rageCost = eventInfo.GetProcSpell().GetPowerTypeCostAmount(PowerType.Rage);
|
||||
if (rageCost.HasValue)
|
||||
GetTarget().CastSpell((WorldObject)null, SpellIds.CriticalThinkingEnergize, new CastSpellExtraArgs(TriggerCastFlags.FullMask)
|
||||
GetTarget().CastSpell(null, SpellIds.CriticalThinkingEnergize, new CastSpellExtraArgs(TriggerCastFlags.FullMask)
|
||||
.AddSpellMod(SpellValueMod.BasePoint0, MathFunctions.CalculatePct(rageCost.Value, aurEff.GetAmount())));
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectProc.Add(new EffectProcHandler(HandleProc, 1, AuraType.Dummy));
|
||||
AfterEffectProc.Add(new(HandleProc, 1, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Script] // 236279 - Devastator
|
||||
class spell_warr_devastator : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellEffect((spellInfo.Id, 1)) && ValidateSpellInfo(SpellIds.ShieldSlam, SpellIds.ShieldSlamMarker);
|
||||
}
|
||||
|
||||
void OnProcSpell(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
if (GetTarget().GetSpellHistory().HasCooldown(SpellIds.ShieldSlam))
|
||||
{
|
||||
if (RandomHelper.randChance(GetEffectInfo(1).CalcValue()))
|
||||
{
|
||||
GetTarget().GetSpellHistory().ResetCooldown(SpellIds.ShieldSlam, true);
|
||||
GetTarget().CastSpell(GetTarget(), SpellIds.ShieldSlamMarker, TriggerCastFlags.IgnoreCastInProgress);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new(OnProcSpell, 0, AuraType.ProcTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 383103 - Fueled by Violence
|
||||
class spell_warr_fueled_by_violence : AuraScript
|
||||
{
|
||||
int _nextHealAmount;
|
||||
uint _nextHealAmount = 0;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
@@ -269,7 +296,7 @@ namespace Scripts.Spells.Warrior
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
_nextHealAmount += (int)MathFunctions.CalculatePct(eventInfo.GetDamageInfo().GetDamage(), GetEffectInfo(0).CalcValue(GetTarget()));
|
||||
_nextHealAmount += MathFunctions.CalculatePct(eventInfo.GetDamageInfo().GetDamage(), GetEffectInfo(0).CalcValue(GetTarget()));
|
||||
}
|
||||
|
||||
void HandlePeriodic(AuraEffect aurEff)
|
||||
@@ -279,7 +306,7 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
Unit target = GetTarget();
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, _nextHealAmount);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, (int)_nextHealAmount);
|
||||
|
||||
target.CastSpell(target, SpellIds.FueledByViolenceHeal, args);
|
||||
_nextHealAmount = 0;
|
||||
@@ -287,12 +314,12 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnProc.Add(new AuraProcHandler(HandleProc));
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(HandlePeriodic, 0, AuraType.PeriodicDummy));
|
||||
OnProc.Add(new(HandleProc));
|
||||
OnEffectPeriodic.Add(new(HandlePeriodic, 0, AuraType.PeriodicDummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 6544 Heroic leap
|
||||
|
||||
[Script] // 6544 - Heroic leap
|
||||
class spell_warr_heroic_leap : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
@@ -316,9 +343,9 @@ namespace Scripts.Spells.Warrior
|
||||
generatedPath.SetPathLengthLimit(range);
|
||||
|
||||
bool result = generatedPath.CalculatePath(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ(), false);
|
||||
if (generatedPath.GetPathType().HasAnyFlag(PathType.Short))
|
||||
if (generatedPath.GetPathType().HasFlag(PathType.Short))
|
||||
return SpellCastResult.OutOfRange;
|
||||
else if (!result || generatedPath.GetPathType().HasAnyFlag(PathType.NoPath))
|
||||
else if (!result || generatedPath.GetPathType().HasFlag(PathType.NoPath))
|
||||
return SpellCastResult.NoPath;
|
||||
}
|
||||
else if (dest.GetPositionZ() > GetCaster().GetPositionZ() + 4.0f)
|
||||
@@ -334,13 +361,13 @@ namespace Scripts.Spells.Warrior
|
||||
{
|
||||
WorldLocation dest = GetHitDest();
|
||||
if (dest != null)
|
||||
GetCaster().CastSpell(dest.GetPosition(), SpellIds.HeroicLeapJump, new CastSpellExtraArgs(true));
|
||||
GetCaster().CastSpell(dest, SpellIds.HeroicLeapJump, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnCheckCast.Add(new CheckCastHandler(CheckElevation));
|
||||
OnEffectHit.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
OnCheckCast.Add(new(CheckElevation));
|
||||
OnEffectHit.Add(new(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -349,10 +376,7 @@ namespace Scripts.Spells.Warrior
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.GlyphOfHeroicLeap,
|
||||
SpellIds.GlyphOfHeroicLeapBuff,
|
||||
SpellIds.ImprovedHeroicLeap,
|
||||
SpellIds.Taunt);
|
||||
return ValidateSpellInfo(SpellIds.GlyphOfHeroicLeap, SpellIds.GlyphOfHeroicLeapBuff, SpellIds.ImprovedHeroicLeap, SpellIds.Taunt);
|
||||
}
|
||||
|
||||
void AfterJump(uint effIndex)
|
||||
@@ -365,7 +389,7 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHit.Add(new EffectHandler(AfterJump, 1, SpellEffectName.JumpDest));
|
||||
OnEffectHit.Add(new(AfterJump, 1, SpellEffectName.JumpDest));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -386,12 +410,11 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterCast.Add(new CastHandler(HandleAfterCast));
|
||||
AfterCast.Add(new(HandleAfterCast));
|
||||
}
|
||||
}
|
||||
|
||||
// 5246 - Intimidating Shout
|
||||
[Script]
|
||||
[Script] // 5246 - Intimidating Shout
|
||||
class spell_warr_intimidating_shout : SpellScript
|
||||
{
|
||||
void FilterTargets(List<WorldObject> unitList)
|
||||
@@ -401,18 +424,18 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(FilterTargets, 1, Targets.UnitSrcAreaEnemy));
|
||||
OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(FilterTargets, 2, Targets.UnitSrcAreaEnemy));
|
||||
OnObjectAreaTargetSelect.Add(new(FilterTargets, 1, Targets.UnitSrcAreaEnemy));
|
||||
OnObjectAreaTargetSelect.Add(new(FilterTargets, 2, Targets.UnitSrcAreaEnemy));
|
||||
}
|
||||
}
|
||||
|
||||
// 70844 - Item - Warrior T10 Protection 4P Bonus
|
||||
[Script] // 7.1.5
|
||||
[Script] // 70844 - Item - Warrior T10 Protection 4P Bonus
|
||||
class spell_warr_item_t10_prot_4p_bonus : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.Stoicism) && ValidateSpellEffect(spellInfo.Id, 1);
|
||||
return ValidateSpellInfo(SpellIds.Stoicism)
|
||||
&& ValidateSpellEffect((spellInfo.Id, 1));
|
||||
}
|
||||
|
||||
void HandleProc(ProcEventInfo eventInfo)
|
||||
@@ -423,12 +446,12 @@ namespace Scripts.Spells.Warrior
|
||||
int bp0 = (int)MathFunctions.CalculatePct(target.GetMaxHealth(), GetEffectInfo(1).CalcValue());
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, bp0);
|
||||
target.CastSpell((Unit)null, SpellIds.Stoicism, args);
|
||||
target.CastSpell(null, SpellIds.Stoicism, args);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnProc.Add(new AuraProcHandler(HandleProc));
|
||||
OnProc.Add(new(HandleProc));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -443,13 +466,13 @@ namespace Scripts.Spells.Warrior
|
||||
void HandleDummy(uint effIndex)
|
||||
{
|
||||
Unit target = GetHitUnit();
|
||||
if (target)
|
||||
if (target != null)
|
||||
GetCaster().CastSpell(target, SpellIds.MortalWounds, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
OnEffectHitTarget.Add(new(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -463,7 +486,7 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
public override bool Load()
|
||||
{
|
||||
return GetCaster().IsTypeId(TypeId.Player);
|
||||
return GetCaster().IsPlayer();
|
||||
}
|
||||
|
||||
void HandleScript(uint effIndex)
|
||||
@@ -476,7 +499,7 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleScript, 0, SpellEffectName.Dummy));
|
||||
OnEffectHitTarget.Add(new(HandleScript, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -495,10 +518,10 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleHitTarget, 0, SpellEffectName.Dummy));
|
||||
OnEffectHitTarget.Add(new(HandleHitTarget, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Script] // 385952 - Shield Charge
|
||||
class spell_warr_shield_charge : SpellScript
|
||||
{
|
||||
@@ -514,21 +537,24 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
OnEffectHitTarget.Add(new(HandleDummy, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Script] // 46968 - Shockwave
|
||||
class spell_warr_shockwave : SpellScript
|
||||
{
|
||||
uint _targetCount;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return !ValidateSpellInfo(SpellIds.Shockwave, SpellIds.ShockwaveStun) && ValidateSpellEffect(spellInfo.Id, 3);
|
||||
return !ValidateSpellInfo(SpellIds.Shockwave, SpellIds.ShockwaveStun)
|
||||
&& ValidateSpellEffect((spellInfo.Id, 3));
|
||||
}
|
||||
|
||||
public override bool Load()
|
||||
{
|
||||
return GetCaster().IsTypeId(TypeId.Player);
|
||||
return GetCaster().IsPlayer();
|
||||
}
|
||||
|
||||
void HandleStun(uint effIndex)
|
||||
@@ -546,11 +572,9 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleStun, 0, SpellEffectName.Dummy));
|
||||
AfterCast.Add(new CastHandler(HandleAfterCast));
|
||||
OnEffectHitTarget.Add(new(HandleStun, 0, SpellEffectName.Dummy));
|
||||
AfterCast.Add(new(HandleAfterCast));
|
||||
}
|
||||
|
||||
uint _targetCount;
|
||||
}
|
||||
|
||||
[Script] // 107570 - Storm Bolt
|
||||
@@ -568,12 +592,39 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleOnHit, 1, SpellEffectName.Dummy));
|
||||
OnEffectHitTarget.Add(new(HandleOnHit, 1, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
// 52437 - Sudden Death
|
||||
[Script]
|
||||
[Script] // 384041 - Strategist
|
||||
class spell_warr_strategist : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.ShieldSlam, SpellIds.ShieldSlamMarker)
|
||||
&& ValidateSpellEffect((SpellIds.Strategist, 0));
|
||||
}
|
||||
|
||||
static bool CheckProc(AuraEffect aurEff, ProcEventInfo procEvent)
|
||||
{
|
||||
return RandomHelper.randChance(aurEff.GetAmount());
|
||||
}
|
||||
|
||||
void HandleCooldown(AuraEffect aurEff, ProcEventInfo procEvent)
|
||||
{
|
||||
Unit caster = GetTarget();
|
||||
caster.GetSpellHistory().ResetCooldown(SpellIds.ShieldSlam, true);
|
||||
caster.CastSpell(caster, SpellIds.ShieldSlamMarker, TriggerCastFlags.IgnoreCastInProgress);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckEffectProc.Add(new(CheckProc, 0, AuraType.Dummy));
|
||||
OnEffectProc.Add(new(HandleCooldown, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 52437 - Sudden Death
|
||||
class spell_warr_sudden_death : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
@@ -585,20 +636,21 @@ namespace Scripts.Spells.Warrior
|
||||
{
|
||||
// Remove cooldown on Colossus Smash
|
||||
Player player = GetTarget().ToPlayer();
|
||||
if (player)
|
||||
if (player != null)
|
||||
player.GetSpellHistory().ResetCooldown(SpellIds.ColossusSmash, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectApply.Add(new EffectApplyHandler(HandleApply, 0, AuraType.Dummy, AuraEffectHandleModes.Real)); // correct?
|
||||
AfterEffectApply.Add(new(HandleApply, 0, AuraType.Dummy, AuraEffectHandleModes.Real)); // correct?
|
||||
}
|
||||
}
|
||||
|
||||
// 12328, 18765, 35429 - Sweeping Strikes
|
||||
[Script]
|
||||
[Script] // 12328, 18765, 35429 - Sweeping Strikes
|
||||
class spell_warr_sweeping_strikes : AuraScript
|
||||
{
|
||||
Unit _procTarget;
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.SweepingStrikesExtraAttack1, SpellIds.SweepingStrikesExtraAttack2);
|
||||
@@ -607,7 +659,7 @@ namespace Scripts.Spells.Warrior
|
||||
bool CheckProc(ProcEventInfo eventInfo)
|
||||
{
|
||||
_procTarget = eventInfo.GetActor().SelectNearbyTarget(eventInfo.GetProcTarget());
|
||||
return _procTarget;
|
||||
return _procTarget != null;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
@@ -620,7 +672,7 @@ namespace Scripts.Spells.Warrior
|
||||
if (spellInfo != null && (spellInfo.Id == SpellIds.BladestormPeriodicWhirlwind || (spellInfo.Id == SpellIds.Execute && !_procTarget.HasAuraState(AuraStateType.Wounded20Percent))))
|
||||
{
|
||||
// If triggered by Execute (while target is not under 20% hp) or Bladestorm deals normalized weapon damage
|
||||
GetTarget().CastSpell(_procTarget, SpellIds.SweepingStrikesExtraAttack2, new CastSpellExtraArgs(aurEff));
|
||||
GetTarget().CastSpell(_procTarget, SpellIds.SweepingStrikesExtraAttack2, aurEff);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -633,11 +685,9 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new CheckProcHandler(CheckProc));
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
DoCheckProc.Add(new(CheckProc));
|
||||
OnEffectProc.Add(new(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
|
||||
Unit _procTarget;
|
||||
}
|
||||
|
||||
[Script] // 215538 - Trauma
|
||||
@@ -652,7 +702,7 @@ namespace Scripts.Spells.Warrior
|
||||
{
|
||||
Unit target = eventInfo.GetActionTarget();
|
||||
//Get 25% of damage from the spell casted (Slam & Whirlwind) plus Remaining Damage from Aura
|
||||
int damage = (int)(MathFunctions.CalculatePct(eventInfo.GetDamageInfo().GetDamage(), aurEff.GetAmount()) / Global.SpellMgr.GetSpellInfo(SpellIds.TraumaEffect, GetCastDifficulty()).GetMaxTicks());
|
||||
int damage = (int)(MathFunctions.CalculatePct(eventInfo.GetDamageInfo().GetDamage(), aurEff.GetAmount()) / SpellMgr.GetSpellInfo(SpellIds.TraumaEffect, GetCastDifficulty()).GetMaxTicks());
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, damage);
|
||||
GetCaster().CastSpell(target, SpellIds.TraumaEffect, args);
|
||||
@@ -660,7 +710,7 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy));
|
||||
OnEffectProc.Add(new(HandleProc, 0, AuraType.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -682,7 +732,7 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
DoCheckProc.Add(new CheckProcHandler(CheckProc));
|
||||
DoCheckProc.Add(new(CheckProc));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -696,7 +746,7 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
void HandleOnProc(AuraEffect aurEff, ProcEventInfo procInfo)
|
||||
{
|
||||
if (procInfo.GetActor().GetTypeId() == TypeId.Player && procInfo.GetActor().ToPlayer().GetPrimarySpecialization() == ChrSpecialization.WarriorFury)
|
||||
if (procInfo.GetActor().IsPlayer() && procInfo.GetActor().ToPlayer().GetPrimarySpecialization() == ChrSpecialization.WarriorFury)
|
||||
PreventDefaultAction();
|
||||
|
||||
procInfo.GetActor().GetSpellHistory().ResetCooldown(SpellIds.ImpendingVictory, true);
|
||||
@@ -704,7 +754,7 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectProc.Add(new EffectProcHandler(HandleOnProc, 0, AuraType.ProcTriggerSpell));
|
||||
OnEffectProc.Add(new(HandleOnProc, 0, AuraType.ProcTriggerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -713,20 +763,19 @@ namespace Scripts.Spells.Warrior
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.Victorious, SpellIds.VictoriousRushHeal);
|
||||
return ValidateSpellInfo(SpellIds.Victorious, SpellIds.VictoryRushHeal);
|
||||
}
|
||||
|
||||
void HandleHeal()
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
|
||||
caster.CastSpell(caster, SpellIds.VictoriousRushHeal, true);
|
||||
caster.CastSpell(caster, SpellIds.VictoryRushHeal, true);
|
||||
caster.RemoveAurasDueToSpell(SpellIds.Victorious);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterCast.Add(new CastHandler(HandleHeal));
|
||||
AfterCast.Add(new(HandleHeal));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user