compute aura diminishing return info at startup and cache it
This commit is contained in:
+15
-378
@@ -626,384 +626,6 @@ namespace Game.Entities
|
||||
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()
|
||||
{
|
||||
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");
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
Dictionary<uint, SpellLevelsRecord> levelsBySpell = new Dictionary<uint, SpellLevelsRecord>();
|
||||
|
||||
Reference in New Issue
Block a user