compute aura diminishing return info at startup and cache it

This commit is contained in:
hondacrx
2017-10-04 15:07:46 -04:00
parent 4424eb6af6
commit 7bd260c2df
8 changed files with 530 additions and 472 deletions
@@ -551,6 +551,8 @@ namespace Framework.Constants
AOEKnockback = 6, AOEKnockback = 6,
Taunt = 7, Taunt = 7,
LimitOnly = 8, LimitOnly = 8,
Max
} }
public enum DiminishingLevels public enum DiminishingLevels
+7 -7
View File
@@ -2506,14 +2506,14 @@ namespace Game.Entities
public void SetFieldNotifyFlag(uint flag) { _fieldNotifyFlags |= flag; } public void SetFieldNotifyFlag(uint flag) { _fieldNotifyFlags |= flag; }
public void RemoveFieldNotifyFlag(uint flag) { _fieldNotifyFlags &= ~flag; } public void RemoveFieldNotifyFlag(uint flag) { _fieldNotifyFlags &= ~flag; }
bool IsCreature() { return GetTypeId() == TypeId.Unit; } public bool IsCreature() { return GetTypeId() == TypeId.Unit; }
public bool IsPlayer() { return GetTypeId() == TypeId.Player; } public bool IsPlayer() { return GetTypeId() == TypeId.Player; }
bool IsGameObject() { return GetTypeId() == TypeId.GameObject; } public bool IsGameObject() { return GetTypeId() == TypeId.GameObject; }
bool IsUnit() { return isTypeMask(TypeMask.Unit); } public bool IsUnit() { return isTypeMask(TypeMask.Unit); }
bool IsCorpse() { return GetTypeId() == TypeId.Corpse; } public bool IsCorpse() { return GetTypeId() == TypeId.Corpse; }
bool IsDynObject() { return GetTypeId() == TypeId.DynamicObject; } public bool IsDynObject() { return GetTypeId() == TypeId.DynamicObject; }
bool IsAreaTrigger() { return GetTypeId() == TypeId.AreaTrigger; } public bool IsAreaTrigger() { return GetTypeId() == TypeId.AreaTrigger; }
bool IsConversation() { return GetTypeId() == TypeId.Conversation; } public bool IsConversation() { return GetTypeId() == TypeId.Conversation; }
public Creature ToCreature() { return IsCreature() ? (this as Creature) : null; } public Creature ToCreature() { return IsCreature() ? (this as Creature) : null; }
public Player ToPlayer() { return IsPlayer() ? (this as Player) : null; } public Player ToPlayer() { return IsPlayer() ? (this as Player) : null; }
+15 -10
View File
@@ -107,7 +107,7 @@ namespace Game.Entities
uint m_removedAurasCount; uint m_removedAurasCount;
//General //General
List<DiminishingReturn> m_Diminishing = new List<DiminishingReturn>(); Array<DiminishingReturn> m_Diminishing = new Array<DiminishingReturn>((int)DiminishingGroup.Max);
protected List<GameObject> m_gameObj = new List<GameObject>(); protected List<GameObject> m_gameObj = new List<GameObject>();
List<AreaTrigger> m_areaTrigger = new List<AreaTrigger>(); List<AreaTrigger> m_areaTrigger = new List<AreaTrigger>();
protected List<DynamicObject> m_dynObj = new List<DynamicObject>(); protected List<DynamicObject> m_dynObj = new List<DynamicObject>();
@@ -140,18 +140,23 @@ namespace Game.Entities
public class DiminishingReturn public class DiminishingReturn
{ {
public DiminishingReturn(DiminishingGroup group, uint t, DiminishingLevels count) public DiminishingReturn(uint hitTime, DiminishingLevels hitCount)
{ {
DRGroup = group; Stack = 0;
stack = 0; HitTime = hitTime;
hitTime = t; HitCount = hitCount;
hitCount = count;
} }
public DiminishingGroup DRGroup; public void Clear()
public uint stack; {
public uint hitTime; Stack = 0;
public DiminishingLevels hitCount; HitTime = 0;
HitCount = DiminishingLevels.Level1;
}
public uint Stack;
public uint HitTime;
public DiminishingLevels HitCount;
} }
public class ProcEventInfo public class ProcEventInfo
+50 -52
View File
@@ -2657,61 +2657,57 @@ namespace Game.Entities
public DiminishingLevels GetDiminishing(DiminishingGroup group) public DiminishingLevels GetDiminishing(DiminishingGroup group)
{ {
foreach (var dim in m_Diminishing) DiminishingReturn diminish = m_Diminishing[(int)group];
if (diminish == null)
return DiminishingLevels.Level1;
if (diminish.HitCount == 0)
return DiminishingLevels.Level1;
if (diminish.HitTime == 0)
return DiminishingLevels.Level1;
// If last spell was cast more than 18 seconds ago - reset the count.
if (diminish.Stack == 0 && Time.GetMSTimeDiffToNow(diminish.HitTime) > 18 * Time.InMilliseconds)
{ {
if (dim.DRGroup != group) diminish.HitCount = DiminishingLevels.Level1;
continue;
if (dim.hitCount == 0)
return DiminishingLevels.Level1;
if (dim.hitTime == 0)
return DiminishingLevels.Level1;
// If last spell was casted more than 18 seconds ago - reset the count.
if (dim.stack == 0 && Time.GetMSTimeDiff(dim.hitTime, Time.GetMSTime()) > 18 * Time.InMilliseconds)
{
dim.hitCount = DiminishingLevels.Level1;
return DiminishingLevels.Level1;
}
// or else increase the count.
else
return dim.hitCount;
}
return DiminishingLevels.Level1; return DiminishingLevels.Level1;
} }
public void IncrDiminishing(DiminishingGroup group) return diminish.HitCount;
}
public void IncrDiminishing(SpellInfo auraSpellInfo, bool triggered)
{ {
DiminishingGroup group = auraSpellInfo.GetDiminishingReturnsGroupForSpell(triggered);
DiminishingLevels maxLevel = auraSpellInfo.GetDiminishingReturnsMaxLevel(triggered);
// Checking for existing in the table // Checking for existing in the table
foreach (var dim in m_Diminishing) DiminishingReturn diminish = m_Diminishing[(int)group];
{ if (diminish.HitCount < maxLevel)
if (dim.DRGroup != group) ++diminish.HitCount;
continue;
if (dim.hitCount < Global.SpellMgr.GetDiminishingReturnsMaxLevel(group))
dim.hitCount += 1;
return;
}
m_Diminishing.Add(new DiminishingReturn(group, Time.GetMSTime(), DiminishingLevels.Level2));
} }
public float ApplyDiminishingToDuration(DiminishingGroup group, int duration, Unit caster, DiminishingLevels Level, int limitduration) public float ApplyDiminishingToDuration(SpellInfo auraSpellInfo, bool triggered, ref int duration, Unit caster, DiminishingLevels previousLevel)
{ {
DiminishingGroup group = auraSpellInfo.GetDiminishingReturnsGroupForSpell(triggered);
if (duration == -1 || group == DiminishingGroup.None) if (duration == -1 || group == DiminishingGroup.None)
return 1.0f; return 1.0f;
int limitDuration = auraSpellInfo.GetDiminishingReturnsLimitDuration(triggered);
// test pet/charm masters instead pets/charmeds // test pet/charm masters instead pets/charmeds
Unit targetOwner = GetCharmerOrOwner(); Unit targetOwner = GetCharmerOrOwner();
Unit casterOwner = caster.GetCharmerOrOwner(); Unit casterOwner = caster.GetCharmerOrOwner();
if (limitduration > 0 && duration > limitduration) if (limitDuration > 0 && duration > limitDuration)
{ {
Unit target = targetOwner ?? this; Unit target = targetOwner ?? this;
Unit source = casterOwner ?? caster; Unit source = casterOwner ?? caster;
if ((target.IsTypeId(TypeId.Player) || target.ToCreature().GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.AllDiminish)) if ((target.IsTypeId(TypeId.Player) || target.ToCreature().GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.AllDiminish))
&& source.IsTypeId(TypeId.Player)) && source.IsTypeId(TypeId.Player))
duration = limitduration; duration = limitDuration;
} }
float mod = 1.0f; float mod = 1.0f;
@@ -2721,7 +2717,7 @@ namespace Game.Entities
case DiminishingGroup.Taunt: case DiminishingGroup.Taunt:
if (IsTypeId(TypeId.Unit) && ToCreature().GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.TauntDiminish)) if (IsTypeId(TypeId.Unit) && ToCreature().GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.TauntDiminish))
{ {
DiminishingLevels diminish = Level; DiminishingLevels diminish = previousLevel;
switch (diminish) switch (diminish)
{ {
case DiminishingLevels.Level1: case DiminishingLevels.Level1:
@@ -2744,11 +2740,11 @@ namespace Game.Entities
} }
break; break;
case DiminishingGroup.AOEKnockback: case DiminishingGroup.AOEKnockback:
if ((Global.SpellMgr.GetDiminishingReturnsGroupType(group) == DiminishingReturnsType.Player && (((targetOwner ? targetOwner : this).ToPlayer()) if ((auraSpellInfo.GetDiminishingReturnsGroupType(triggered) == DiminishingReturnsType.Player && (((targetOwner ? targetOwner : this).ToPlayer())
|| IsTypeId(TypeId.Unit) && ToCreature().GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.AllDiminish))) || IsCreature() && ToCreature().GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.AllDiminish)))
|| Global.SpellMgr.GetDiminishingReturnsGroupType(group) == DiminishingReturnsType.All) || auraSpellInfo.GetDiminishingReturnsGroupType(triggered) == DiminishingReturnsType.All)
{ {
DiminishingLevels diminish = Level; DiminishingLevels diminish = previousLevel;
switch (diminish) switch (diminish)
{ {
case DiminishingLevels.Level1: case DiminishingLevels.Level1:
@@ -2762,11 +2758,11 @@ namespace Game.Entities
} }
break; break;
default: default:
if ((Global.SpellMgr.GetDiminishingReturnsGroupType(group) == DiminishingReturnsType.Player && (((targetOwner ? targetOwner : this).ToPlayer()) if ((auraSpellInfo.GetDiminishingReturnsGroupType(triggered) == DiminishingReturnsType.Player && (((targetOwner ? targetOwner : this).ToPlayer())
|| IsTypeId(TypeId.Unit) && ToCreature().GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.AllDiminish))) || IsCreature() && ToCreature().GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.AllDiminish)))
|| Global.SpellMgr.GetDiminishingReturnsGroupType(group) == DiminishingReturnsType.All) || auraSpellInfo.GetDiminishingReturnsGroupType(triggered) == DiminishingReturnsType.All)
{ {
DiminishingLevels diminish = Level; DiminishingLevels diminish = previousLevel;
switch (diminish) switch (diminish)
{ {
case DiminishingLevels.Level1: case DiminishingLevels.Level1:
@@ -2793,22 +2789,24 @@ namespace Game.Entities
public void ApplyDiminishingAura(DiminishingGroup group, bool apply) public void ApplyDiminishingAura(DiminishingGroup group, bool apply)
{ {
// Checking for existing in the table // Checking for existing in the table
foreach (var dim in m_Diminishing) DiminishingReturn diminish = m_Diminishing[(int)group];
{
if (dim.DRGroup != group)
continue;
if (apply) if (apply)
dim.stack += 1; ++diminish.Stack;
else if (dim.stack != 0) else if (diminish.Stack != 0)
{ {
dim.stack -= 1; --diminish.Stack;
// Remember time after last aura from group removed // Remember time after last aura from group removed
if (dim.stack == 0) if (diminish.Stack == 0)
dim.hitTime = Time.GetMSTime(); diminish.HitTime = Time.GetMSTime();
} }
break;
} }
void ClearDiminishings()
{
for (int i = 0; i < (int)DiminishingGroup.Max; ++i)
m_Diminishing[i].Clear();
} }
public uint GetRemainingPeriodicAmount(ObjectGuid caster, uint spellId, AuraType auraType, int effectIndex = 0) public uint GetRemainingPeriodicAmount(ObjectGuid caster, uint spellId, AuraType auraType, int effectIndex = 0)
+3
View File
@@ -374,6 +374,9 @@ namespace Game
Log.outInfo(LogFilter.ServerLoading, "Loading SpellInfo SpellSpecific and AuraState..."); Log.outInfo(LogFilter.ServerLoading, "Loading SpellInfo SpellSpecific and AuraState...");
Global.SpellMgr.LoadSpellInfoSpellSpecificAndAuraState(); Global.SpellMgr.LoadSpellInfoSpellSpecificAndAuraState();
Log.outInfo(LogFilter.ServerLoading, "Loading SpellInfo diminishing infos...");
Global.SpellMgr.LoadSpellInfoDiminishing();
Log.outInfo(LogFilter.ServerLoading, "Loading PetFamilySpellsStore Data..."); Log.outInfo(LogFilter.ServerLoading, "Loading PetFamilySpellsStore Data...");
Global.SpellMgr.LoadPetFamilySpellsStore(); Global.SpellMgr.LoadPetFamilySpellsStore();
+15 -21
View File
@@ -107,8 +107,6 @@ namespace Game.Spells
_triggeredCastFlags = _triggeredCastFlags | TriggerCastFlags.IgnoreCastInProgress | TriggerCastFlags.CastDirectly; _triggeredCastFlags = _triggeredCastFlags | TriggerCastFlags.IgnoreCastInProgress | TriggerCastFlags.CastDirectly;
effectHandleMode = SpellEffectHandleMode.Launch; effectHandleMode = SpellEffectHandleMode.Launch;
m_diminishLevel = DiminishingLevels.Level1;
m_diminishGroup = DiminishingGroup.None;
//Auto Shot & Shoot (wand) //Auto Shot & Shoot (wand)
m_autoRepeat = m_spellInfo.IsAutoRepeatRangedSpell(); m_autoRepeat = m_spellInfo.IsAutoRepeatRangedSpell();
@@ -2113,15 +2111,19 @@ namespace Game.Spells
aura_effmask |= (1u << (int)effect.EffectIndex); aura_effmask |= (1u << (int)effect.EffectIndex);
// Get Data Needed for Diminishing Returns, some effects may have multiple auras, so this must be done on spell hit, not aura add // Get Data Needed for Diminishing Returns, some effects may have multiple auras, so this must be done on spell hit, not aura add
m_diminishGroup = Global.SpellMgr.GetDiminishingReturnsGroupForSpell(m_spellInfo); bool triggered = m_triggeredByAuraSpell != null;
if (m_diminishGroup != 0 && aura_effmask != 0) DiminishingGroup diminishGroup = m_spellInfo.GetDiminishingReturnsGroupForSpell(triggered);
{
m_diminishLevel = unit.GetDiminishing(m_diminishGroup); DiminishingLevels diminishLevel = DiminishingLevels.Level1;
DiminishingReturnsType type = Global.SpellMgr.GetDiminishingReturnsGroupType(m_diminishGroup); if (diminishGroup != 0 && aura_effmask != 0)
{
diminishLevel = unit.GetDiminishing(diminishGroup);
DiminishingReturnsType type = m_spellInfo.GetDiminishingReturnsGroupType(triggered);
// Increase Diminishing on unit, current informations for actually casts will use values above // Increase Diminishing on unit, current informations for actually casts will use values above
if ((type == DiminishingReturnsType.Player && unit.GetCharmerOrOwnerPlayerOrPlayerItself() != null) || type == DiminishingReturnsType.All) if ((type == DiminishingReturnsType.Player && (unit.GetCharmerOrOwnerPlayerOrPlayerItself()
unit.IncrDiminishing(m_diminishGroup); || (unit.IsCreature() && unit.ToCreature().GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.AllDiminish))))
|| type == DiminishingReturnsType.All)
unit.IncrDiminishing(m_spellInfo, triggered);
} }
if (aura_effmask != 0) if (aura_effmask != 0)
@@ -2168,8 +2170,7 @@ namespace Game.Spells
// Now Reduce spell duration using data received at spell hit // Now Reduce spell duration using data received at spell hit
int duration = m_spellAura.GetMaxDuration(); int duration = m_spellAura.GetMaxDuration();
int limitduration = m_diminishGroup != 0 ? Global.SpellMgr.GetDiminishingReturnsLimitDuration(aurSpellInfo) : 0; float diminishMod = unit.ApplyDiminishingToDuration(aurSpellInfo, triggered, ref duration, m_originalCaster, diminishLevel);
float diminishMod = unit.ApplyDiminishingToDuration(m_diminishGroup, duration, m_originalCaster, m_diminishLevel, limitduration);
// unit is immune to aura if it was diminished to 0 duration // unit is immune to aura if it was diminished to 0 duration
if (diminishMod == 0.0f) if (diminishMod == 0.0f)
@@ -2184,7 +2185,7 @@ namespace Game.Spells
} }
else else
{ {
((UnitAura)m_spellAura).SetDiminishGroup(m_diminishGroup); ((UnitAura)m_spellAura).SetDiminishGroup(diminishGroup);
bool positive = m_spellAura.GetSpellInfo().IsPositive(); bool positive = m_spellAura.GetSpellInfo().IsPositive();
AuraApplication aurApp = m_spellAura.GetApplicationOfTarget(m_originalCaster.GetGUID()); AuraApplication aurApp = m_spellAura.GetApplicationOfTarget(m_originalCaster.GetGUID());
@@ -3053,9 +3054,6 @@ namespace Game.Spells
void _handle_immediate_phase() void _handle_immediate_phase()
{ {
m_spellAura = null; m_spellAura = null;
// initialize Diminishing Returns Data
m_diminishLevel = DiminishingLevels.Level1;
m_diminishGroup = DiminishingGroup.None;
// handle some immediate features of the spell here // handle some immediate features of the spell here
HandleThreatSpells(); HandleThreatSpells();
@@ -4262,7 +4260,7 @@ namespace Game.Spells
continue; continue;
// positive spells distribute threat among all units that are in combat with target, like healing // positive spells distribute threat among all units that are in combat with target, like healing
if (m_spellInfo._IsPositiveSpell()) if (m_spellInfo.IsPositive())
target.getHostileRefManager().threatAssist(m_caster, threatToAdd, m_spellInfo); target.getHostileRefManager().threatAssist(m_caster, threatToAdd, m_spellInfo);
// for negative spells threat gets distributed among affected targets // for negative spells threat gets distributed among affected targets
else else
@@ -4273,7 +4271,7 @@ namespace Game.Spells
target.AddThreat(m_caster, threatToAdd, m_spellInfo.GetSchoolMask(), m_spellInfo); target.AddThreat(m_caster, threatToAdd, m_spellInfo.GetSchoolMask(), m_spellInfo);
} }
} }
Log.outDebug(LogFilter.Spells, "Spell {0}, added an additional {1} threat for {2} {3} target(s)", m_spellInfo.Id, threat, m_spellInfo._IsPositiveSpell() ? "assisting" : "harming", m_UniqueTargetInfo.Count); Log.outDebug(LogFilter.Spells, "Spell {0}, added an additional {1} threat for {2} {3} target(s)", m_spellInfo.Id, threat, m_spellInfo.IsPositive() ? "assisting" : "harming", m_UniqueTargetInfo.Count);
} }
void HandleEffects(Unit pUnitTarget, Item pItemTarget, GameObject pGOTarget, uint i, SpellEffectHandleMode mode) void HandleEffects(Unit pUnitTarget, Item pItemTarget, GameObject pGOTarget, uint i, SpellEffectHandleMode mode)
@@ -7228,10 +7226,6 @@ namespace Game.Spells
// used in effects handlers // used in effects handlers
public Aura m_spellAura; public Aura m_spellAura;
// this is set in Spell Hit, but used in Apply Aura handler
DiminishingLevels m_diminishLevel;
DiminishingGroup m_diminishGroup;
// ------------------------------------------- // -------------------------------------------
GameObject focusObject; GameObject focusObject;
+419
View File
@@ -1537,6 +1537,415 @@ namespace Game.Spells
} }
} }
public void _LoadSpellDiminishInfo()
{
SpellDiminishInfo diminishInfo = new SpellDiminishInfo();
diminishInfo.DiminishGroup = diminishingGroupCompute();
diminishInfo.DiminishReturnType = diminishingTypeCompute(diminishInfo.DiminishGroup);
diminishInfo.DiminishMaxLevel = diminishingMaxLevelCompute(diminishInfo.DiminishGroup);
diminishInfo.DiminishDurationLimit = diminishingLimitDurationCompute();
_diminishInfo = diminishInfo;
}
public DiminishingGroup GetDiminishingReturnsGroupForSpell()
{
return _diminishInfo.DiminishGroup;
}
public DiminishingReturnsType GetDiminishingReturnsGroupType()
{
return _diminishInfo.DiminishReturnType;
}
public DiminishingLevels GetDiminishingReturnsMaxLevel(bool triggered)
{
return _diminishInfo.DiminishMaxLevel;
}
public int GetDiminishingReturnsLimitDuration(bool triggered)
{
return _diminishInfo.DiminishDurationLimit;
}
DiminishingGroup diminishingGroupCompute()
{
if (IsPositive())
return DiminishingGroup.None;
if (HasAura(Difficulty.None, AuraType.ModTaunt))
return DiminishingGroup.Taunt;
switch (Id)
{
case 64803: // Entrapment
case 135373: // Entrapment
return DiminishingGroup.Root;
case 24394: // Intimidation
return DiminishingGroup.Stun;
case 118345: // Pulverize (Primal Earth Elemental)
return DiminishingGroup.Stun;
case 118905: // Static Charge (Capacitor Totem)
return DiminishingGroup.Stun;
case 108199: // Gorefiend's Grasp
return DiminishingGroup.AOEKnockback;
default:
break;
}
// Explicit Diminishing Groups
switch (SpellFamilyName)
{
case SpellFamilyNames.Generic:
break;
case SpellFamilyNames.Mage:
{
// Frostjaw -- 102051
if (SpellFamilyFlags[2].HasAnyFlag(0x40000u))
return DiminishingGroup.Silence;
// Frost Nova -- 122
if (SpellFamilyFlags[0].HasAnyFlag(0x40u))
return DiminishingGroup.Root;
// Ice Ward -- 111340
if (SpellFamilyFlags[0].HasAnyFlag(0x80000u) && SpellFamilyFlags[2].HasAnyFlag(0x2000u))
return DiminishingGroup.Root;
// Freeze (Water Elemental) -- 33395
if (SpellFamilyFlags[2].HasAnyFlag(0x200u))
return DiminishingGroup.Root;
// Deep Freeze -- 44572
if (SpellFamilyFlags[1].HasAnyFlag(0x100000u))
return DiminishingGroup.Stun;
// Dragon's Breath -- 31661
if (SpellFamilyFlags[0].HasAnyFlag(0x800000u))
return DiminishingGroup.Incapacitate;
// Polymorph -- 118
if (SpellFamilyFlags[0].HasAnyFlag(0x1000000u))
return DiminishingGroup.Incapacitate;
// Ring of Frost -- 82691
if (SpellFamilyFlags[2].HasAnyFlag(0x40u))
return DiminishingGroup.Incapacitate;
// Ice Nova -- 157997
if (SpellFamilyFlags[2].HasAnyFlag(0x800000u))
return DiminishingGroup.Incapacitate;
break;
}
case SpellFamilyNames.Warrior:
{
// Shockwave -- 132168
if (SpellFamilyFlags[1].HasAnyFlag(0x8000u))
return DiminishingGroup.Stun;
// Storm Bolt -- 132169
if (SpellFamilyFlags[2].HasAnyFlag(0x1000u))
return DiminishingGroup.Stun;
// Intimidating Shout -- 5246
if (SpellFamilyFlags[0].HasAnyFlag(0x40000u))
return DiminishingGroup.Disorient;
// Hamstring -- 1715, 8 seconds in PvP (6.0)
if (SpellFamilyFlags[0].HasAnyFlag(0x2u))
return DiminishingGroup.LimitOnly;
break;
}
case SpellFamilyNames.Warlock:
{
// Mortal Coil -- 6789
if (SpellFamilyFlags[0].HasAnyFlag(0x80000u))
return DiminishingGroup.Incapacitate;
// Banish -- 710
if (SpellFamilyFlags[1].HasAnyFlag(0x8000000u))
return DiminishingGroup.Incapacitate;
// Fear -- 118699
if (SpellFamilyFlags[1].HasAnyFlag(0x400u))
return DiminishingGroup.Disorient;
// Howl of Terror -- 5484
if (SpellFamilyFlags[1].HasAnyFlag(0x8u))
return DiminishingGroup.Disorient;
// Shadowfury -- 30283
if (SpellFamilyFlags[1].HasAnyFlag(0x1000u))
return DiminishingGroup.Stun;
// Summon Infernal -- 22703
if (SpellFamilyFlags[0].HasAnyFlag(0x1000u))
return DiminishingGroup.Stun;
break;
}
case SpellFamilyNames.WarlockPet:
{
// Fellash -- 115770
// Whiplash -- 6360
if (SpellFamilyFlags[0].HasAnyFlag(0x8000000u))
return DiminishingGroup.AOEKnockback;
// Mesmerize (Shivarra pet) -- 115268
// Seduction (Succubus pet) -- 6358
if (SpellFamilyFlags[0].HasAnyFlag(0x2000000u))
return DiminishingGroup.Disorient;
// Axe Toss (Felguard pet) -- 89766
if (SpellFamilyFlags[1].HasAnyFlag(0x4u))
return DiminishingGroup.Stun;
break;
}
case SpellFamilyNames.Druid:
{
// Maim -- 22570
if (SpellFamilyFlags[1].HasAnyFlag(0x80u))
return DiminishingGroup.Stun;
// Mighty Bash -- 5211
if (SpellFamilyFlags[0].HasAnyFlag(0x2000u))
return DiminishingGroup.Stun;
// Rake -- 163505 -- no flags on the stun
if (Id == 163505)
return DiminishingGroup.Stun;
// Incapacitating Roar -- 99, no flags on the stun, 14
if (SpellFamilyFlags[1].HasAnyFlag(0x1u))
return DiminishingGroup.Incapacitate;
// Cyclone -- 33786
if (SpellFamilyFlags[1].HasAnyFlag(0x20u))
return DiminishingGroup.Disorient;
// Typhoon -- 61391
if (SpellFamilyFlags[1].HasAnyFlag(0x1000000u))
return DiminishingGroup.AOEKnockback;
// Ursol's Vortex -- 118283, no family flags
if (Id == 118283)
return DiminishingGroup.AOEKnockback;
// Entangling Roots -- 339
if (SpellFamilyFlags[0].HasAnyFlag(0x200u))
return DiminishingGroup.Root;
// Mass Entanglement -- 102359
if (SpellFamilyFlags[2].HasAnyFlag(0x4u))
return DiminishingGroup.Root;
// Faerie Fire -- 770, 20 seconds in PvP (6.0)
if (SpellFamilyFlags[0].HasAnyFlag(0x400u))
return DiminishingGroup.LimitOnly;
break;
}
case SpellFamilyNames.Rogue:
{
// Cheap Shot -- 1833
if (SpellFamilyFlags[0].HasAnyFlag(0x400u))
return DiminishingGroup.Stun;
// Kidney Shot -- 408
if (SpellFamilyFlags[0].HasAnyFlag(0x200000u))
return DiminishingGroup.Stun;
// Gouge -- 1776
if (SpellFamilyFlags[0].HasAnyFlag(0x8u))
return DiminishingGroup.Incapacitate;
// Sap -- 6770
if (SpellFamilyFlags[0].HasAnyFlag(0x80u))
return DiminishingGroup.Incapacitate;
// Blind -- 2094
if (SpellFamilyFlags[0].HasAnyFlag(0x1000000u))
return DiminishingGroup.Disorient;
// Garrote -- 1330
if (SpellFamilyFlags[1].HasAnyFlag(0x20000000u))
return DiminishingGroup.Silence;
break;
}
case SpellFamilyNames.Hunter:
{
// Charge (Tenacity pet) -- 53148, no flags
if (Id == 53148)
return DiminishingGroup.Root;
// Narrow Escape -- 136634, no flags
if (Id == 136634)
return DiminishingGroup.Root;
// Binding Shot -- 117526, no flags
if (Id == 117526)
return DiminishingGroup.Stun;
// Freezing Trap -- 3355
if (SpellFamilyFlags[0].HasAnyFlag(0x8u))
return DiminishingGroup.Incapacitate;
// Wyvern Sting -- 19386
if (SpellFamilyFlags[1].HasAnyFlag(0x1000u))
return DiminishingGroup.Incapacitate;
break;
}
case SpellFamilyNames.Paladin:
{
// Repentance -- 20066
if (SpellFamilyFlags[0].HasAnyFlag(0x4u))
return DiminishingGroup.Incapacitate;
// Turn Evil -- 10326
if (SpellFamilyFlags[1].HasAnyFlag(0x800000u))
return DiminishingGroup.Disorient;
// Avenger's Shield -- 31935
if (SpellFamilyFlags[0].HasAnyFlag(0x4000u))
return DiminishingGroup.Silence;
// Fist of Justice -- 105593
// Hammer of Justice -- 853
if (SpellFamilyFlags[0].HasAnyFlag(0x800u))
return DiminishingGroup.Stun;
// Holy Wrath -- 119072
if (SpellFamilyFlags[1].HasAnyFlag(0x200000u))
return DiminishingGroup.Stun;
break;
}
case SpellFamilyNames.Shaman:
{
// Hex -- 51514
if (SpellFamilyFlags[1].HasAnyFlag(0x8000u))
return DiminishingGroup.Incapacitate;
// Thunderstorm -- 51490
if (SpellFamilyFlags[1].HasAnyFlag(0x2000u))
return DiminishingGroup.AOEKnockback;
// Earthgrab Totem -- 64695
if (SpellFamilyFlags[2].HasAnyFlag(0x4000u))
return DiminishingGroup.Root;
break;
}
case SpellFamilyNames.Deathknight:
{
// Strangulate -- 47476
if (SpellFamilyFlags[0].HasAnyFlag(0x200u))
return DiminishingGroup.Silence;
// Asphyxiate -- 108194
if (SpellFamilyFlags[2].HasAnyFlag(0x100000u))
return DiminishingGroup.Stun;
// Gnaw (Ghoul) -- 91800, no flags
if (Id == 91800)
return DiminishingGroup.Stun;
// Monstrous Blow (Ghoul w/ Dark Transformation active) -- 91797
if (Id == 91797)
return DiminishingGroup.Stun;
break;
}
case SpellFamilyNames.Priest:
{
// Dominate Mind -- 605
if (SpellFamilyFlags[0].HasAnyFlag(0x20000u) && GetSpellVisual() == 39068)
return DiminishingGroup.Incapacitate;
// Holy Word: Chastise -- 88625
if (SpellFamilyFlags[2].HasAnyFlag(0x20u))
return DiminishingGroup.Incapacitate;
// Psychic Horror -- 64044
if (SpellFamilyFlags[2].HasAnyFlag(0x2000u))
return DiminishingGroup.Incapacitate;
// Psychic Scream -- 8122
if (SpellFamilyFlags[0].HasAnyFlag(0x10000u))
return DiminishingGroup.Disorient;
// Silence -- 15487
if (SpellFamilyFlags[1].HasAnyFlag(0x200000u) && SchoolMask == (SpellSchoolMask)32)
return DiminishingGroup.Silence;
break;
}
case SpellFamilyNames.Monk:
{
// Disable -- 116706, no flags
if (Id == 116706)
return DiminishingGroup.Root;
// Charging Ox Wave -- 119392
if (SpellFamilyFlags[1].HasAnyFlag(0x10000u))
return DiminishingGroup.Stun;
// Fists of Fury -- 120086
if (SpellFamilyFlags[1].HasAnyFlag(0x800000u) && !SpellFamilyFlags[2].HasAnyFlag(0x8u))
return DiminishingGroup.Stun;
// Leg Sweep -- 119381
if (SpellFamilyFlags[1].HasAnyFlag(0x200u))
return DiminishingGroup.Stun;
// Incendiary Breath (honor talent) -- 202274, no flags
if (Id == 202274)
return DiminishingGroup.Incapacitate;
// Paralysis -- 115078
if (SpellFamilyFlags[2].HasAnyFlag(0x800000u))
return DiminishingGroup.Incapacitate;
break;
}
default:
break;
}
return DiminishingGroup.None;
}
DiminishingReturnsType diminishingTypeCompute(DiminishingGroup group)
{
switch (group)
{
case DiminishingGroup.Taunt:
case DiminishingGroup.Stun:
return DiminishingReturnsType.All;
case DiminishingGroup.LimitOnly:
case DiminishingGroup.None:
return DiminishingReturnsType.None;
default:
return DiminishingReturnsType.Player;
}
}
DiminishingLevels diminishingMaxLevelCompute(DiminishingGroup group)
{
switch (group)
{
case DiminishingGroup.Taunt:
return DiminishingLevels.TauntImmune;
case DiminishingGroup.AOEKnockback:
return DiminishingLevels.Level2;
default:
return DiminishingLevels.Immune;
}
}
int diminishingLimitDurationCompute()
{
// Explicit diminishing duration
switch (SpellFamilyName)
{
case SpellFamilyNames.Druid:
{
// Faerie Fire - 20 seconds in PvP (6.0)
if (SpellFamilyFlags[0].HasAnyFlag(0x400u))
return 20 * Time.InMilliseconds;
break;
}
case SpellFamilyNames.Hunter:
{
// Binding Shot - 3 seconds in PvP (6.0)
if (Id == 117526)
return 3 * Time.InMilliseconds;
// Wyvern Sting - 6 seconds in PvP (6.0)
if (SpellFamilyFlags[1].HasAnyFlag(0x1000u))
return 6 * Time.InMilliseconds;
break;
}
case SpellFamilyNames.Monk:
{
// Paralysis - 4 seconds in PvP regardless of if they are facing you (6.0)
if (SpellFamilyFlags[2].HasAnyFlag(0x800000u))
return 4 * Time.InMilliseconds;
break;
}
default:
break;
}
return 8 * Time.InMilliseconds;
}
public float GetMinRange(bool positive = false) public float GetMinRange(bool positive = false)
{ {
if (RangeEntry == null) if (RangeEntry == null)
@@ -2666,6 +3075,8 @@ namespace Game.Spells
bool _hasPowerDifficultyData; bool _hasPowerDifficultyData;
SpellSpecificType _spellSpecific; SpellSpecificType _spellSpecific;
AuraStateType _auraState; AuraStateType _auraState;
SpellDiminishInfo _diminishInfo;
#endregion #endregion
public struct ScalingInfo public struct ScalingInfo
@@ -3707,5 +4118,13 @@ namespace Game.Spells
public PowerType Power; public PowerType Power;
public int Amount; public int Amount;
} }
class SpellDiminishInfo
{
public DiminishingGroup DiminishGroup = DiminishingGroup.None;
public DiminishingReturnsType DiminishReturnType = DiminishingReturnsType.None;
public DiminishingLevels DiminishMaxLevel = DiminishingLevels.Immune;
public int DiminishDurationLimit;
}
} }
+15 -378
View File
@@ -626,384 +626,6 @@ namespace Game.Entities
return mSpellAreaForQuestAreaMap.LookupByKey(Tuple.Create(area_id, quest_id)); return mSpellAreaForQuestAreaMap.LookupByKey(Tuple.Create(area_id, quest_id));
} }
public DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellInfo spellproto)
{
if (spellproto.IsPositive())
return DiminishingGroup.None;
if (spellproto.HasAura(Difficulty.None, AuraType.ModTaunt))
return DiminishingGroup.Taunt;
switch (spellproto.Id)
{
case 64803: // Entrapment
case 135373: // Entrapment
return DiminishingGroup.Root;
case 24394: // Intimidation
return DiminishingGroup.Stun;
case 118345: // Pulverize (Primal Earth Elemental)
return DiminishingGroup.Stun;
case 118905: // Static Charge (Capacitor Totem)
return DiminishingGroup.Stun;
case 108199: // Gorefiend's Grasp
return DiminishingGroup.AOEKnockback;
default:
break;
}
// Explicit Diminishing Groups
switch (spellproto.SpellFamilyName)
{
case SpellFamilyNames.Generic:
break;
case SpellFamilyNames.Mage:
{
// Frostjaw -- 102051
if (spellproto.SpellFamilyFlags[2].HasAnyFlag(0x40000u))
return DiminishingGroup.Silence;
// Frost Nova -- 122
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x40u))
return DiminishingGroup.Root;
// Ice Ward -- 111340
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x80000u) && spellproto.SpellFamilyFlags[2].HasAnyFlag(0x2000u))
return DiminishingGroup.Root;
// Freeze (Water Elemental) -- 33395
if (spellproto.SpellFamilyFlags[2].HasAnyFlag(0x200u))
return DiminishingGroup.Root;
// Deep Freeze -- 44572
if (spellproto.SpellFamilyFlags[1].HasAnyFlag(0x100000u))
return DiminishingGroup.Stun;
// Dragon's Breath -- 31661
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x800000u))
return DiminishingGroup.Incapacitate;
// Polymorph -- 118
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x1000000u))
return DiminishingGroup.Incapacitate;
// Ring of Frost -- 82691
if (spellproto.SpellFamilyFlags[2].HasAnyFlag(0x40u))
return DiminishingGroup.Incapacitate;
// Ice Nova -- 157997
if (spellproto.SpellFamilyFlags[2].HasAnyFlag(0x800000u))
return DiminishingGroup.Incapacitate;
break;
}
case SpellFamilyNames.Warrior:
{
// Shockwave -- 132168
if (spellproto.SpellFamilyFlags[1].HasAnyFlag(0x8000u))
return DiminishingGroup.Stun;
// Storm Bolt -- 132169
if (spellproto.SpellFamilyFlags[2].HasAnyFlag(0x1000u))
return DiminishingGroup.Stun;
// Intimidating Shout -- 5246
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x40000u))
return DiminishingGroup.Disorient;
// Hamstring -- 1715, 8 seconds in PvP (6.0)
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x2u))
return DiminishingGroup.LimitOnly;
break;
}
case SpellFamilyNames.Warlock:
{
// Mortal Coil -- 6789
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x80000u))
return DiminishingGroup.Incapacitate;
// Banish -- 710
if (spellproto.SpellFamilyFlags[1].HasAnyFlag(0x8000000u))
return DiminishingGroup.Incapacitate;
// Fear -- 118699
if (spellproto.SpellFamilyFlags[1].HasAnyFlag(0x400u))
return DiminishingGroup.Disorient;
// Howl of Terror -- 5484
if (spellproto.SpellFamilyFlags[1].HasAnyFlag(0x8u))
return DiminishingGroup.Disorient;
// Shadowfury -- 30283
if (spellproto.SpellFamilyFlags[1].HasAnyFlag(0x1000u))
return DiminishingGroup.Stun;
// Summon Infernal -- 22703
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x1000u))
return DiminishingGroup.Stun;
break;
}
case SpellFamilyNames.WarlockPet:
{
// Fellash -- 115770
// Whiplash -- 6360
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x8000000u))
return DiminishingGroup.AOEKnockback;
// Mesmerize (Shivarra pet) -- 115268
// Seduction (Succubus pet) -- 6358
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x2000000u))
return DiminishingGroup.Disorient;
// Axe Toss (Felguard pet) -- 89766
if (spellproto.SpellFamilyFlags[1].HasAnyFlag(0x4u))
return DiminishingGroup.Stun;
break;
}
case SpellFamilyNames.Druid:
{
// Maim -- 22570
if (spellproto.SpellFamilyFlags[1].HasAnyFlag(0x80u))
return DiminishingGroup.Stun;
// Mighty Bash -- 5211
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x2000u))
return DiminishingGroup.Stun;
// Rake -- 163505 -- no flags on the stun
if (spellproto.Id == 163505)
return DiminishingGroup.Stun;
// Incapacitating Roar -- 99, no flags on the stun, 14
if (spellproto.SpellFamilyFlags[1].HasAnyFlag(0x1u))
return DiminishingGroup.Incapacitate;
// Cyclone -- 33786
if (spellproto.SpellFamilyFlags[1].HasAnyFlag(0x20u))
return DiminishingGroup.Disorient;
// Typhoon -- 61391
if (spellproto.SpellFamilyFlags[1].HasAnyFlag(0x1000000u))
return DiminishingGroup.AOEKnockback;
// Ursol's Vortex -- 118283, no family flags
if (spellproto.Id == 118283)
return DiminishingGroup.AOEKnockback;
// Entangling Roots -- 339
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x200u))
return DiminishingGroup.Root;
// Mass Entanglement -- 102359
if (spellproto.SpellFamilyFlags[2].HasAnyFlag(0x4u))
return DiminishingGroup.Root;
// Faerie Fire -- 770, 20 seconds in PvP (6.0)
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x400u))
return DiminishingGroup.LimitOnly;
break;
}
case SpellFamilyNames.Rogue:
{
// Cheap Shot -- 1833
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x400u))
return DiminishingGroup.Stun;
// Kidney Shot -- 408
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x200000u))
return DiminishingGroup.Stun;
// Gouge -- 1776
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x8u))
return DiminishingGroup.Incapacitate;
// Sap -- 6770
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x80u))
return DiminishingGroup.Incapacitate;
// Blind -- 2094
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x1000000u))
return DiminishingGroup.Disorient;
// Garrote -- 1330
if (spellproto.SpellFamilyFlags[1].HasAnyFlag(0x20000000u))
return DiminishingGroup.Silence;
break;
}
case SpellFamilyNames.Hunter:
{
// Charge (Tenacity pet) -- 53148, no flags
if (spellproto.Id == 53148)
return DiminishingGroup.Root;
// Narrow Escape -- 136634, no flags
if (spellproto.Id == 136634)
return DiminishingGroup.Root;
// Binding Shot -- 117526, no flags
if (spellproto.Id == 117526)
return DiminishingGroup.Stun;
// Freezing Trap -- 3355
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x8u))
return DiminishingGroup.Incapacitate;
// Wyvern Sting -- 19386
if (spellproto.SpellFamilyFlags[1].HasAnyFlag(0x1000u))
return DiminishingGroup.Incapacitate;
break;
}
case SpellFamilyNames.Paladin:
{
// Repentance -- 20066
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x4u))
return DiminishingGroup.Incapacitate;
// Turn Evil -- 10326
if (spellproto.SpellFamilyFlags[1].HasAnyFlag(0x800000u))
return DiminishingGroup.Disorient;
// Avenger's Shield -- 31935
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x4000u))
return DiminishingGroup.Silence;
// Fist of Justice -- 105593
// Hammer of Justice -- 853
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x800u))
return DiminishingGroup.Stun;
// Holy Wrath -- 119072
if (spellproto.SpellFamilyFlags[1].HasAnyFlag(0x200000u))
return DiminishingGroup.Stun;
break;
}
case SpellFamilyNames.Shaman:
{
// Hex -- 51514
if (spellproto.SpellFamilyFlags[1].HasAnyFlag(0x8000u))
return DiminishingGroup.Incapacitate;
// Thunderstorm -- 51490
if (spellproto.SpellFamilyFlags[1].HasAnyFlag(0x2000u))
return DiminishingGroup.AOEKnockback;
// Earthgrab Totem -- 64695
if (spellproto.SpellFamilyFlags[2].HasAnyFlag(0x4000u))
return DiminishingGroup.Root;
break;
}
case SpellFamilyNames.Deathknight:
{
// Strangulate -- 47476
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x200u))
return DiminishingGroup.Silence;
// Asphyxiate -- 108194
if (spellproto.SpellFamilyFlags[2].HasAnyFlag(0x100000u))
return DiminishingGroup.Stun;
// Gnaw (Ghoul) -- 91800, no flags
if (spellproto.Id == 91800)
return DiminishingGroup.Stun;
// Monstrous Blow (Ghoul w/ Dark Transformation active) -- 91797
if (spellproto.Id == 91797)
return DiminishingGroup.Stun;
break;
}
case SpellFamilyNames.Priest:
{
// Dominate Mind -- 605
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x20000u) && spellproto.GetSpellVisual() == 39068)
return DiminishingGroup.Incapacitate;
// Holy Word: Chastise -- 88625
if (spellproto.SpellFamilyFlags[2].HasAnyFlag(0x20u))
return DiminishingGroup.Incapacitate;
// Psychic Horror -- 64044
if (spellproto.SpellFamilyFlags[2].HasAnyFlag(0x2000u))
return DiminishingGroup.Incapacitate;
// Psychic Scream -- 8122
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x10000u))
return DiminishingGroup.Disorient;
// Silence -- 15487
if (spellproto.SpellFamilyFlags[1].HasAnyFlag(0x200000u) && spellproto.SchoolMask == (SpellSchoolMask)32)
return DiminishingGroup.Silence;
break;
}
case SpellFamilyNames.Monk:
{
// Disable -- 116706, no flags
if (spellproto.Id == 116706)
return DiminishingGroup.Root;
// Charging Ox Wave -- 119392
if (spellproto.SpellFamilyFlags[1].HasAnyFlag(0x10000u))
return DiminishingGroup.Stun;
// Fists of Fury -- 120086
if (spellproto.SpellFamilyFlags[1].HasAnyFlag(0x800000u) && !spellproto.SpellFamilyFlags[2].HasAnyFlag(0x8u))
return DiminishingGroup.Stun;
// Leg Sweep -- 119381
if (spellproto.SpellFamilyFlags[1].HasAnyFlag(0x200u))
return DiminishingGroup.Stun;
// Incendiary Breath (honor talent) -- 202274, no flags
if (spellproto.Id == 202274)
return DiminishingGroup.Incapacitate;
// Paralysis -- 115078
if (spellproto.SpellFamilyFlags[2].HasAnyFlag(0x800000u))
return DiminishingGroup.Incapacitate;
break;
}
default:
break;
}
return DiminishingGroup.None;
}
public DiminishingReturnsType GetDiminishingReturnsGroupType(DiminishingGroup group)
{
switch (group)
{
case DiminishingGroup.Taunt:
case DiminishingGroup.Stun:
return DiminishingReturnsType.All;
case DiminishingGroup.LimitOnly:
case DiminishingGroup.None:
return DiminishingReturnsType.None;
default:
return DiminishingReturnsType.Player;
}
}
public DiminishingLevels GetDiminishingReturnsMaxLevel(DiminishingGroup group)
{
switch (group)
{
case DiminishingGroup.Taunt:
return DiminishingLevels.TauntImmune;
case DiminishingGroup.AOEKnockback:
return DiminishingLevels.Level2;
default:
return DiminishingLevels.Immune;
}
}
public int GetDiminishingReturnsLimitDuration(SpellInfo spellproto)
{
// Explicit diminishing duration
switch (spellproto.SpellFamilyName)
{
case SpellFamilyNames.Druid:
{
// Faerie Fire - 20 seconds in PvP (6.0)
if (spellproto.SpellFamilyFlags[0].HasAnyFlag(0x400u))
return 20 * Time.InMilliseconds;
break;
}
case SpellFamilyNames.Hunter:
{
// Binding Shot - 3 seconds in PvP (6.0)
if (spellproto.Id == 117526)
return 3 * Time.InMilliseconds;
// Wyvern Sting - 6 seconds in PvP (6.0)
if (spellproto.SpellFamilyFlags[1].HasAnyFlag(0x1000u))
return 6 * Time.InMilliseconds;
break;
}
case SpellFamilyNames.Monk:
{
// Paralysis - 4 seconds in PvP regardless of if they are facing you (6.0)
if (spellproto.SpellFamilyFlags[2].HasAnyFlag(0x800000u))
return 4 * Time.InMilliseconds;
break;
}
default:
break;
}
return 8 * Time.InMilliseconds;
}
void UnloadSpellInfoChains() void UnloadSpellInfoChains()
{ {
foreach (var chain in mSpellChains) foreach (var chain in mSpellChains)
@@ -3119,6 +2741,21 @@ namespace Game.Entities
Log.outInfo(LogFilter.ServerLoading, $"Loaded SpellInfo SpellSpecific and AuraState in {Time.GetMSTimeDiffToNow(oldMSTime)} ms"); Log.outInfo(LogFilter.ServerLoading, $"Loaded SpellInfo SpellSpecific and AuraState in {Time.GetMSTimeDiffToNow(oldMSTime)} ms");
} }
public void LoadSpellInfoDiminishing()
{
uint oldMSTime = Time.GetMSTime();
foreach (SpellInfo spellInfo in mSpellInfoMap.Values)
{
if (spellInfo == null)
continue;
spellInfo._LoadSpellDiminishInfo();
}
Log.outInfo(LogFilter.ServerLoading, "Loaded SpellInfo diminishing infos in {0} ms", Time.GetMSTimeDiffToNow(oldMSTime));
}
public void LoadPetFamilySpellsStore() public void LoadPetFamilySpellsStore()
{ {
Dictionary<uint, SpellLevelsRecord> levelsBySpell = new Dictionary<uint, SpellLevelsRecord>(); Dictionary<uint, SpellLevelsRecord> levelsBySpell = new Dictionary<uint, SpellLevelsRecord>();