Core/Auras: Implemented using all aura interrupt flag fields

This commit is contained in:
hondacrx
2017-12-18 10:14:17 -05:00
parent ff15083cfe
commit 1e5249b6b0
12 changed files with 126 additions and 41 deletions
@@ -141,6 +141,11 @@ namespace Framework.Constants
NotVictim = (Hitbyspell | TakeDamage | DirectDamage) NotVictim = (Hitbyspell | TakeDamage | DirectDamage)
} }
public enum SpellAuraInterruptFlags2
{
}
// Enum with EffectRadiusIndex and their actual radius // Enum with EffectRadiusIndex and their actual radius
public enum EffectRadiusIndex public enum EffectRadiusIndex
{ {
+1 -1
View File
@@ -249,7 +249,7 @@ namespace Game.AI
float range = spellInfo.GetMaxRange(false); float range = spellInfo.GetMaxRange(false);
DefaultTargetSelector targetSelector = new DefaultTargetSelector(me, range, playerOnly, -(int)spellId); DefaultTargetSelector targetSelector = new DefaultTargetSelector(me, range, playerOnly, -(int)spellId);
if (!spellInfo.AuraInterruptFlags.HasAnyFlag(SpellAuraInterruptFlags.NotVictim) if (!spellInfo.HasAuraInterruptFlag(SpellAuraInterruptFlags.NotVictim)
&& targetSelector.Check(me.GetVictim())) && targetSelector.Check(me.GetVictim()))
target = me.GetVictim(); target = me.GetVictim();
else else
+1 -1
View File
@@ -381,7 +381,7 @@ namespace Game.Combat
Contract.Assert(target); // if the ref has status online the target must be there ! Contract.Assert(target); // if the ref has status online the target must be there !
// some units are prefered in comparison to others // some units are prefered in comparison to others
if (!noPriorityTargetFound && (target.IsImmunedToDamage(attacker.GetMeleeDamageSchoolMask()) || target.HasNegativeAuraWithInterruptFlag((uint)SpellAuraInterruptFlags.TakeDamage))) if (!noPriorityTargetFound && (target.IsImmunedToDamage(attacker.GetMeleeDamageSchoolMask()) || target.HasNegativeAuraWithInterruptFlag(SpellAuraInterruptFlags.TakeDamage)))
{ {
if (i != threatList.Count - 1) if (i != threatList.Count - 1)
{ {
+2 -6
View File
@@ -1083,12 +1083,8 @@ namespace Game.Entities
} }
Spell spell1 = victim.GetCurrentSpell(CurrentSpellTypes.Channeled); Spell spell1 = victim.GetCurrentSpell(CurrentSpellTypes.Channeled);
if (spell1 != null) if (spell1 != null)
if (spell1.getState() == SpellState.Casting) if (spell1.getState() == SpellState.Casting && spell1.m_spellInfo.HasChannelInterruptFlag(SpellChannelInterruptFlags.Delay) && damagetype != DamageEffectType.DOT)
{ spell1.DelayedChannel();
var channelInterruptFlags = spell1.m_spellInfo.ChannelInterruptFlags;
if (((channelInterruptFlags & SpellChannelInterruptFlags.Delay) != 0) && (damagetype != DamageEffectType.DOT))
spell1.DelayedChannel();
}
} }
} }
// last damage from duel opponent // last damage from duel opponent
+1 -1
View File
@@ -86,7 +86,7 @@ namespace Game.Entities
protected Dictionary<CurrentSpellTypes, Spell> m_currentSpells = new Dictionary<CurrentSpellTypes, Spell>((int)CurrentSpellTypes.Max); protected Dictionary<CurrentSpellTypes, Spell> m_currentSpells = new Dictionary<CurrentSpellTypes, Spell>((int)CurrentSpellTypes.Max);
Dictionary<SpellValueMod, int> CustomSpellValueMod = new Dictionary<SpellValueMod, int>(); Dictionary<SpellValueMod, int> CustomSpellValueMod = new Dictionary<SpellValueMod, int>();
MultiMap<SpellImmunity, SpellImmune> m_spellImmune = new MultiMap<SpellImmunity, SpellImmune>(); MultiMap<SpellImmunity, SpellImmune> m_spellImmune = new MultiMap<SpellImmunity, SpellImmune>();
uint m_interruptMask; uint[] m_interruptMask = new uint[2];
protected int m_procDeep; protected int m_procDeep;
bool m_AutoRepeatFirstCast; bool m_AutoRepeatFirstCast;
SpellHistory _spellHistory; SpellHistory _spellHistory;
+48 -16
View File
@@ -1444,7 +1444,7 @@ namespace Game.Entities
var auras = GetAuraEffectsByType(type); var auras = GetAuraEffectsByType(type);
foreach (var eff in auras) foreach (var eff in auras)
if ((excludeAura == 0 || excludeAura != eff.GetSpellInfo().Id) && //Avoid self interrupt of channeled Crowd Control spells like Seduction if ((excludeAura == 0 || excludeAura != eff.GetSpellInfo().Id) && //Avoid self interrupt of channeled Crowd Control spells like Seduction
eff.GetSpellInfo().AuraInterruptFlags.HasAnyFlag(SpellAuraInterruptFlags.TakeDamage)) eff.GetSpellInfo().HasAuraInterruptFlag(SpellAuraInterruptFlags.TakeDamage))
return true; return true;
return false; return false;
} }
@@ -2891,14 +2891,22 @@ namespace Game.Entities
} }
public void UpdateInterruptMask() public void UpdateInterruptMask()
{ {
m_interruptMask = 0; m_interruptMask.Initialize();
foreach (var app in m_interruptableAuras) foreach (AuraApplication aurApp in m_interruptableAuras)
m_interruptMask |= (uint)app.GetBase().GetSpellInfo().AuraInterruptFlags; {
for (var i = 0; i < m_interruptMask.Length; ++i)
m_interruptMask[i] |= aurApp.GetBase().GetSpellInfo().AuraInterruptFlags[i];
}
Spell spell = GetCurrentSpell(CurrentSpellTypes.Channeled); Spell spell = GetCurrentSpell(CurrentSpellTypes.Channeled);
if (spell != null) if (spell != null)
{
if (spell.getState() == SpellState.Casting) if (spell.getState() == SpellState.Casting)
m_interruptMask |= (uint)spell.m_spellInfo.ChannelInterruptFlags; {
for (var i = 0; i < m_interruptMask.Length; ++i)
m_interruptMask[i] |= spell.m_spellInfo.ChannelInterruptFlags[i];
}
}
} }
// Auras // Auras
@@ -3178,13 +3186,24 @@ namespace Game.Entities
return false; return false;
} }
public bool HasNegativeAuraWithInterruptFlag(uint flag, ObjectGuid guid = default(ObjectGuid)) public bool HasNegativeAuraWithInterruptFlag(SpellAuraInterruptFlags flag, ObjectGuid guid = default(ObjectGuid))
{ {
if (!Convert.ToBoolean(m_interruptMask & flag)) return HasNegativeAuraWithInterruptFlag((uint)flag, 0, guid);
}
public bool HasNegativeAuraWithInterruptFlag(SpellAuraInterruptFlags2 flag, ObjectGuid guid = default(ObjectGuid))
{
return HasNegativeAuraWithInterruptFlag((uint)flag, 1, guid);
}
public bool HasNegativeAuraWithInterruptFlag(uint flag, int index, ObjectGuid guid = default(ObjectGuid))
{
if (!Convert.ToBoolean(m_interruptMask[index] & flag))
return false; return false;
foreach (var aura in m_interruptableAuras) foreach (var aura in m_interruptableAuras)
{ {
if (!aura.IsPositive() && Convert.ToBoolean((uint)aura.GetBase().GetSpellInfo().AuraInterruptFlags & flag) if (!aura.IsPositive() && Convert.ToBoolean(aura.GetBase().GetSpellInfo().AuraInterruptFlags[index] & flag)
&& (guid.IsEmpty() || aura.GetBase().GetCasterGUID() == guid)) && (guid.IsEmpty() || aura.GetBase().GetCasterGUID() == guid))
return true; return true;
} }
@@ -3271,7 +3290,17 @@ namespace Game.Entities
public void RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags flag, uint except = 0) public void RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags flag, uint except = 0)
{ {
if (!Convert.ToBoolean(m_interruptMask & (uint)flag)) RemoveAurasWithInterruptFlags((uint)flag, 0, except);
}
public void RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2 flag, uint except = 0)
{
RemoveAurasWithInterruptFlags((uint)flag, 1, except);
}
void RemoveAurasWithInterruptFlags(uint flag, int index, uint except = 0)
{
if (!Convert.ToBoolean(m_interruptMask[index] & flag))
return; return;
// interrupt auras // interrupt auras
@@ -3279,8 +3308,8 @@ namespace Game.Entities
{ {
Aura aura = m_interruptableAuras[i].GetBase(); Aura aura = m_interruptableAuras[i].GetBase();
if (Convert.ToBoolean(aura.GetSpellInfo().AuraInterruptFlags & flag) && (except == 0 || aura.GetId() != except) if (Convert.ToBoolean(aura.GetSpellInfo().AuraInterruptFlags[index] & flag) && (except == 0 || aura.GetId() != except)
&& !(Convert.ToBoolean(flag & SpellAuraInterruptFlags.Move) && HasAuraTypeWithAffectMask(AuraType.CastWhileWalking, aura.GetSpellInfo()))) && !(Convert.ToBoolean(flag & (uint)SpellAuraInterruptFlags.Move) && HasAuraTypeWithAffectMask(AuraType.CastWhileWalking, aura.GetSpellInfo())))
{ {
uint removedAuras = m_removedAurasCount; uint removedAuras = m_removedAurasCount;
RemoveAura(aura); RemoveAura(aura);
@@ -3292,14 +3321,17 @@ namespace Game.Entities
// interrupt channeled spell // interrupt channeled spell
Spell spell = GetCurrentSpell(CurrentSpellTypes.Channeled); Spell spell = GetCurrentSpell(CurrentSpellTypes.Channeled);
if (spell != null) if (spell != null)
{
if (spell.getState() == SpellState.Casting if (spell.getState() == SpellState.Casting
&& Convert.ToBoolean((uint)spell.m_spellInfo.ChannelInterruptFlags & (uint)flag) && Convert.ToBoolean(spell.GetSpellInfo().ChannelInterruptFlags[index] & flag)
&& spell.m_spellInfo.Id != except && spell.GetSpellInfo().Id != except
&& !(Convert.ToBoolean(flag & SpellAuraInterruptFlags.Move) && HasAuraTypeWithAffectMask(AuraType.CastWhileWalking, spell.GetSpellInfo()))) && !(Convert.ToBoolean(flag & (uint)SpellAuraInterruptFlags.Move) && HasAuraTypeWithAffectMask(AuraType.CastWhileWalking, spell.GetSpellInfo())))
InterruptNonMeleeSpells(false); InterruptNonMeleeSpells(false);
}
UpdateInterruptMask(); UpdateInterruptMask();
} }
public void RemoveAurasWithMechanic(uint mechanic_mask, AuraRemoveMode removemode = AuraRemoveMode.Default, uint except = 0) public void RemoveAurasWithMechanic(uint mechanic_mask, AuraRemoveMode removemode = AuraRemoveMode.Default, uint except = 0)
{ {
foreach (var app in GetAppliedAuras()) foreach (var app in GetAppliedAuras())
@@ -3931,7 +3963,7 @@ namespace Game.Entities
m_appliedAuras.Remove(pair); m_appliedAuras.Remove(pair);
if (aura.GetSpellInfo().AuraInterruptFlags != 0) if (aura.GetSpellInfo().HasAnyAuraInterruptFlag())
{ {
m_interruptableAuras.Remove(aurApp); m_interruptableAuras.Remove(aurApp);
UpdateInterruptMask(); UpdateInterruptMask();
@@ -4119,7 +4151,7 @@ namespace Game.Entities
return; return;
// Sitdown on apply aura req seated // Sitdown on apply aura req seated
if (aura.GetSpellInfo().AuraInterruptFlags.HasAnyFlag(SpellAuraInterruptFlags.NotSeated) && !IsSitState()) if (aura.GetSpellInfo().HasAuraInterruptFlag(SpellAuraInterruptFlags.NotSeated) && !IsSitState())
SetStandState(UnitStandStateType.Sit); SetStandState(UnitStandStateType.Sit);
Unit caster = aura.GetCaster(); Unit caster = aura.GetCaster();
+7 -3
View File
@@ -1875,10 +1875,10 @@ namespace Game.Entities
AuraApplication aurApp = new AuraApplication(this, caster, aura, effMask); AuraApplication aurApp = new AuraApplication(this, caster, aura, effMask);
m_appliedAuras.Add(aurId, aurApp); m_appliedAuras.Add(aurId, aurApp);
if (aurSpellInfo.AuraInterruptFlags != 0) if (aurSpellInfo.HasAnyAuraInterruptFlag())
{ {
m_interruptableAuras.Add(aurApp); m_interruptableAuras.Add(aurApp);
AddInterruptMask((uint)aurSpellInfo.AuraInterruptFlags); AddInterruptMask(aurSpellInfo.AuraInterruptFlags);
} }
AuraStateType aState = aura.GetSpellInfo().GetAuraState(); AuraStateType aState = aura.GetSpellInfo().GetAuraState();
@@ -1888,7 +1888,11 @@ namespace Game.Entities
aura._ApplyForTarget(this, caster, aurApp); aura._ApplyForTarget(this, caster, aurApp);
return aurApp; return aurApp;
} }
public void AddInterruptMask(uint mask) { m_interruptMask |= mask; } public void AddInterruptMask(uint[] mask)
{
for (int i = 0; i < m_interruptMask.Length; ++i)
m_interruptMask[i] |= mask[i];
}
void _UpdateAutoRepeatSpell() void _UpdateAutoRepeatSpell()
{ {
+1 -1
View File
@@ -3058,7 +3058,7 @@ namespace Game.Spells
// when removing flag aura, handle flag drop // when removing flag aura, handle flag drop
Player player = target.ToPlayer(); Player player = target.ToPlayer();
if (!apply && player != null && (GetSpellInfo().AuraInterruptFlags.HasAnyFlag(SpellAuraInterruptFlags.ImmuneOrLostSelection))) if (!apply && player != null && GetSpellInfo().HasAuraInterruptFlag(SpellAuraInterruptFlags.ImmuneOrLostSelection))
{ {
if (player.InBattleground()) if (player.InBattleground())
{ {
+3 -3
View File
@@ -2987,13 +2987,13 @@ namespace Game.Spells
m_caster.ModSpellDurationTime(m_spellInfo, ref duration, this); m_caster.ModSpellDurationTime(m_spellInfo, ref duration, this);
m_spellState = SpellState.Casting; m_spellState = SpellState.Casting;
m_caster.AddInterruptMask((uint)m_spellInfo.ChannelInterruptFlags); m_caster.AddInterruptMask(m_spellInfo.ChannelInterruptFlags);
SendChannelStart((uint)duration); SendChannelStart((uint)duration);
} }
else if (duration == -1) else if (duration == -1)
{ {
m_spellState = SpellState.Casting; m_spellState = SpellState.Casting;
m_caster.AddInterruptMask((uint)m_spellInfo.ChannelInterruptFlags); m_caster.AddInterruptMask(m_spellInfo.ChannelInterruptFlags);
SendChannelStart((uint)duration); SendChannelStart((uint)duration);
} }
} }
@@ -4484,7 +4484,7 @@ namespace Game.Spells
// skip stuck spell to allow use it in falling case and apply spell limitations at movement // skip stuck spell to allow use it in falling case and apply spell limitations at movement
SpellEffectInfo effect = GetEffect(0); SpellEffectInfo effect = GetEffect(0);
if ((!m_caster.HasUnitMovementFlag(MovementFlag.FallingFar) || (effect != null && effect.Effect != SpellEffectName.Stuck)) && if ((!m_caster.HasUnitMovementFlag(MovementFlag.FallingFar) || (effect != null && effect.Effect != SpellEffectName.Stuck)) &&
(IsAutoRepeat() || (m_spellInfo.AuraInterruptFlags & SpellAuraInterruptFlags.NotSeated) != 0)) (IsAutoRepeat() || m_spellInfo.HasAuraInterruptFlag(SpellAuraInterruptFlags.NotSeated)))
return SpellCastResult.Moving; return SpellCastResult.Moving;
} }
+1 -1
View File
@@ -2849,7 +2849,7 @@ namespace Game.Spells
|| (spell.getState() == SpellState.Preparing && spell.GetCastTime() > 0.0f)) || (spell.getState() == SpellState.Preparing && spell.GetCastTime() > 0.0f))
&& (curSpellInfo.PreventionType.HasAnyFlag(SpellPreventionType.Silence)) && (curSpellInfo.PreventionType.HasAnyFlag(SpellPreventionType.Silence))
&& ((i == CurrentSpellTypes.Generic && curSpellInfo.InterruptFlags.HasAnyFlag(SpellInterruptFlags.Interrupt)) && ((i == CurrentSpellTypes.Generic && curSpellInfo.InterruptFlags.HasAnyFlag(SpellInterruptFlags.Interrupt))
|| (i == CurrentSpellTypes.Channeled && curSpellInfo.ChannelInterruptFlags.HasAnyFlag(SpellChannelInterruptFlags.Interrupt)))) || (i == CurrentSpellTypes.Channeled && curSpellInfo.HasChannelInterruptFlag(SpellChannelInterruptFlags.Interrupt))))
{ {
if (m_originalCaster != null) if (m_originalCaster != null)
{ {
+12 -5
View File
@@ -191,8 +191,8 @@ namespace Game.Spells
{ {
InterruptFlags = (SpellInterruptFlags)_interrupt.InterruptFlags; InterruptFlags = (SpellInterruptFlags)_interrupt.InterruptFlags;
// TODO: 6.x these flags have 2 parts // TODO: 6.x these flags have 2 parts
AuraInterruptFlags = (SpellAuraInterruptFlags)_interrupt.AuraInterruptFlags[0]; AuraInterruptFlags = _interrupt.AuraInterruptFlags;
ChannelInterruptFlags = (SpellChannelInterruptFlags)_interrupt.ChannelInterruptFlags[0]; ChannelInterruptFlags = _interrupt.ChannelInterruptFlags;
} }
// SpellLevelsEntry // SpellLevelsEntry
@@ -1367,7 +1367,7 @@ namespace Game.Spells
case SpellFamilyNames.Generic: case SpellFamilyNames.Generic:
{ {
// Food / Drinks (mostly) // Food / Drinks (mostly)
if (AuraInterruptFlags.HasAnyFlag(SpellAuraInterruptFlags.NotSeated)) if (HasAuraInterruptFlag(SpellAuraInterruptFlags.NotSeated))
{ {
bool food = false; bool food = false;
bool drink = false; bool drink = false;
@@ -3051,6 +3051,13 @@ namespace Game.Spells
public bool HasAttribute(SpellAttr13 attribute) { return Convert.ToBoolean(AttributesEx13 & attribute); } public bool HasAttribute(SpellAttr13 attribute) { return Convert.ToBoolean(AttributesEx13 & attribute); }
public bool HasAttribute(SpellCustomAttributes attribute) { return Convert.ToBoolean(AttributesCu & attribute); } public bool HasAttribute(SpellCustomAttributes attribute) { return Convert.ToBoolean(AttributesCu & attribute); }
public bool HasAnyAuraInterruptFlag() { return AuraInterruptFlags.Any(flag => { return flag != 0; }); }
public bool HasAuraInterruptFlag(SpellAuraInterruptFlags flag) { return (AuraInterruptFlags[0] & (uint)flag) != 0; }
public bool HasAuraInterruptFlag(SpellAuraInterruptFlags2 flag) { return (AuraInterruptFlags[1] & (uint)flag) != 0; }
public bool HasChannelInterruptFlag(SpellChannelInterruptFlags flag) { return (ChannelInterruptFlags[0] & (uint)flag) != 0; }
#region Fields #region Fields
public uint Id; public uint Id;
uint CategoryId; uint CategoryId;
@@ -3091,8 +3098,8 @@ namespace Game.Spells
public uint StartRecoveryCategory { get; set; } public uint StartRecoveryCategory { get; set; }
public uint StartRecoveryTime { get; set; } public uint StartRecoveryTime { get; set; }
public SpellInterruptFlags InterruptFlags { get; set; } public SpellInterruptFlags InterruptFlags { get; set; }
public SpellAuraInterruptFlags AuraInterruptFlags { get; set; } public uint[] AuraInterruptFlags { get; set; } = new uint[2];
public SpellChannelInterruptFlags ChannelInterruptFlags { get; set; } public uint[] ChannelInterruptFlags { get; set; } = new uint[2];
public ProcFlags ProcFlags { get; set; } public ProcFlags ProcFlags { get; set; }
public uint ProcChance { get; set; } public uint ProcChance { get; set; }
public uint ProcCharges { get; set; } public uint ProcCharges { get; set; }
+44 -3
View File
@@ -2389,7 +2389,7 @@ namespace Game.Entities
spellInfo.GetEffect(0).BasePoints = 0;// force seat 0, vehicle doesn't have the required seat flags for "no seat specified (-1)" spellInfo.GetEffect(0).BasePoints = 0;// force seat 0, vehicle doesn't have the required seat flags for "no seat specified (-1)"
break; break;
case 61719: // Easter Lay Noblegarden Egg Aura - Interrupt flags copied from aura which this aura is linked with case 61719: // Easter Lay Noblegarden Egg Aura - Interrupt flags copied from aura which this aura is linked with
spellInfo.AuraInterruptFlags = SpellAuraInterruptFlags.Hitbyspell | SpellAuraInterruptFlags.TakeDamage; spellInfo.AuraInterruptFlags[0] = (uint)(SpellAuraInterruptFlags.Hitbyspell | SpellAuraInterruptFlags.TakeDamage);
break; break;
case 71838: // Drain Life - Bryntroll Normal case 71838: // Drain Life - Bryntroll Normal
case 71839: // Drain Life - Bryntroll Heroic case 71839: // Drain Life - Bryntroll Heroic
@@ -2488,7 +2488,7 @@ namespace Game.Entities
break; break;
case 63414: // Spinning Up (Mimiron) case 63414: // Spinning Up (Mimiron)
spellInfo.GetEffect(0).TargetB = new SpellImplicitTargetInfo(Targets.UnitCaster); spellInfo.GetEffect(0).TargetB = new SpellImplicitTargetInfo(Targets.UnitCaster);
spellInfo.ChannelInterruptFlags = 0; spellInfo.ChannelInterruptFlags.Initialize();
break; break;
case 63036: // Rocket Strike (Mimiron) case 63036: // Rocket Strike (Mimiron)
spellInfo.Speed = 0; spellInfo.Speed = 0;
@@ -2698,7 +2698,7 @@ namespace Game.Entities
spellInfo.GetEffect(0).MaxRadiusEntry = CliDB.SpellRadiusStorage.LookupByKey(EffectRadiusIndex.Yards45); spellInfo.GetEffect(0).MaxRadiusEntry = CliDB.SpellRadiusStorage.LookupByKey(EffectRadiusIndex.Yards45);
break; break;
case 24314: // Threatening Gaze case 24314: // Threatening Gaze
spellInfo.AuraInterruptFlags |= SpellAuraInterruptFlags.Cast | SpellAuraInterruptFlags.Move | SpellAuraInterruptFlags.Jump; spellInfo.AuraInterruptFlags[0] |= (uint)(SpellAuraInterruptFlags.Cast | SpellAuraInterruptFlags.Move | SpellAuraInterruptFlags.Jump);
break; break;
case 5420: // Tree of Life (Passive) case 5420: // Tree of Life (Passive)
spellInfo.Stances = 1 << ((int)ShapeShiftForm.TreeOfLife - 1); spellInfo.Stances = 1 << ((int)ShapeShiftForm.TreeOfLife - 1);
@@ -2722,12 +2722,53 @@ namespace Game.Entities
break; break;
// ENDOF ISLE OF CONQUEST SPELLS // ENDOF ISLE OF CONQUEST SPELLS
// //
// FIRELANDS SPELLS
// Torment Searcher
case 99253:
spellInfo.GetEffect(0).MaxRadiusEntry = CliDB.SpellRadiusStorage.LookupByKey(EffectRadiusIndex.Yards15);
break;
// Torment Damage
case 99256:
spellInfo.Attributes |= SpellAttr0.Negative1;
break;
// Blaze of Glory
case 99252:
spellInfo.AuraInterruptFlags[0] |= (uint)SpellAuraInterruptFlags.ChangeMap;
break;
// ENDOF FIRELANDS SPELLS
case 102445: // Summon Master Li Fei case 102445: // Summon Master Li Fei
spellInfo.GetEffect(0).TargetA = new SpellImplicitTargetInfo(Targets.DestDb); spellInfo.GetEffect(0).TargetA = new SpellImplicitTargetInfo(Targets.DestDb);
break; break;
} }
} }
foreach (var spellInfo in mSpellInfoMap.Values)
{
foreach (SpellEffectInfo effect in spellInfo.GetEffectsForDifficulty(Difficulty.None))
{
if (effect == null)
continue;
switch (effect.Effect)
{
case SpellEffectName.Charge:
case SpellEffectName.ChargeDest:
case SpellEffectName.Jump:
case SpellEffectName.JumpDest:
case SpellEffectName.LeapBack:
if (spellInfo.Speed == 0 && spellInfo.SpellFamilyName == 0)
spellInfo.Speed = MotionMaster.SPEED_CHARGE;
break;
}
if (effect.TargetA.GetSelectionCategory() == SpellTargetSelectionCategories.Cone || effect.TargetB.GetSelectionCategory() == SpellTargetSelectionCategories.Cone)
if (MathFunctions.fuzzyEq(spellInfo.ConeAngle, 0.0f))
spellInfo.ConeAngle = 90.0f;
}
if (spellInfo.ActiveIconFileDataId == 135754) // flight
spellInfo.Attributes |= SpellAttr0.Passive;
}
SummonPropertiesRecord properties = CliDB.SummonPropertiesStorage.LookupByKey(121); SummonPropertiesRecord properties = CliDB.SummonPropertiesStorage.LookupByKey(121);
if (properties != null) if (properties != null)
properties.Type = SummonType.Totem; properties.Type = SummonType.Totem;