Core/Auras: Update AuraState enum and implement missing new ones

Port From (https://github.com/TrinityCore/TrinityCore/commit/69e0b9a98516a0cac14bc3f985a2deb2fe79205f)
This commit is contained in:
hondacrx
2021-03-17 21:51:55 -04:00
parent 97a89d0c8c
commit 76d79ff2e6
8 changed files with 98 additions and 105 deletions
+9 -15
View File
@@ -1729,16 +1729,12 @@ namespace Game.Entities
switch (reactive)
{
case ReactiveType.Defense:
if (HasAuraState(AuraStateType.Defense))
ModifyAuraState(AuraStateType.Defense, false);
if (HasAuraState(AuraStateType.Defensive))
ModifyAuraState(AuraStateType.Defensive, false);
break;
case ReactiveType.HunterParry:
if (GetClass() == Class.Hunter && HasAuraState(AuraStateType.HunterParry))
ModifyAuraState(AuraStateType.HunterParry, false);
break;
case ReactiveType.OverPower:
if (GetClass() == Class.Warrior && IsTypeId(TypeId.Player))
ToPlayer().ClearComboPoints();
case ReactiveType.Defense2:
if (HasAuraState(AuraStateType.Defensive2))
ModifyAuraState(AuraStateType.Defensive2, false);
break;
}
}
@@ -1836,12 +1832,10 @@ namespace Game.Entities
for (ReactiveType i = 0; i < ReactiveType.Max; ++i)
m_reactiveTimer[i] = 0;
if (HasAuraState(AuraStateType.Defense))
ModifyAuraState(AuraStateType.Defense, false);
if (GetClass() == Class.Hunter && HasAuraState(AuraStateType.HunterParry))
ModifyAuraState(AuraStateType.HunterParry, false);
if (GetClass() == Class.Warrior && IsTypeId(TypeId.Player))
ToPlayer().ClearComboPoints();
if (HasAuraState(AuraStateType.Defensive))
ModifyAuraState(AuraStateType.Defensive, false);
if (HasAuraState(AuraStateType.Defensive2))
ModifyAuraState(AuraStateType.Defensive2, false);
}
public virtual bool CanUseAttackType(WeaponAttackType attacktype)
+6 -24
View File
@@ -242,7 +242,7 @@ namespace Game.Entities
// Drain Soul - increased damage for targets under 20% HP
if (spellProto.Id == 198590)
if (HasAuraState(AuraStateType.HealthLess20Percent))
if (HasAuraState(AuraStateType.Wounded20Percent))
DoneTotalMod *= 2;
break;
}
@@ -1851,41 +1851,23 @@ namespace Game.Entities
// Update AURA_STATE on dodge
if (GetClass() != Class.Rogue) // skip Rogue Riposte
{
ModifyAuraState(AuraStateType.Defense, true);
ModifyAuraState(AuraStateType.Defensive, true);
StartReactiveTimer(ReactiveType.Defense);
}
}
// if victim and parry attack
if (hitMask.HasAnyFlag(ProcFlagsHit.Parry))
{
// For Hunters only Counterattack (skip Mongoose bite)
if (GetClass() == Class.Hunter)
{
ModifyAuraState(AuraStateType.HunterParry, true);
StartReactiveTimer(ReactiveType.HunterParry);
}
else
{
ModifyAuraState(AuraStateType.Defense, true);
StartReactiveTimer(ReactiveType.Defense);
}
ModifyAuraState(AuraStateType.Defensive, true);
StartReactiveTimer(ReactiveType.Defense);
}
// if and victim block attack
if (hitMask.HasAnyFlag(ProcFlagsHit.Block))
{
ModifyAuraState(AuraStateType.Defense, true);
ModifyAuraState(AuraStateType.Defensive, true);
StartReactiveTimer(ReactiveType.Defense);
}
}
else // For attacker
{
// Overpower on victim dodge
if (hitMask.HasAnyFlag(ProcFlagsHit.Dodge) && IsPlayer() && GetClass() == Class.Warrior)
{
ToPlayer().AddComboPoints(1);
StartReactiveTimer(ReactiveType.OverPower);
}
}
}
}
}
@@ -3888,7 +3870,7 @@ namespace Game.Entities
continue;
SpellInfo spellProto = app.Value.GetBase().GetSpellInfo();
if (app.Value.GetBase().GetCasterGUID() == GetGUID() && spellProto.CasterAuraState == flag && (spellProto.IsPassive() || flag != AuraStateType.Enrage))
if (app.Value.GetBase().GetCasterGUID() == GetGUID() && spellProto.CasterAuraState == flag && (spellProto.IsPassive() || flag != AuraStateType.Enraged))
RemoveAura(app);
}
}
+6 -3
View File
@@ -184,9 +184,12 @@ namespace Game.Entities
if (IsAlive())
{
ModifyAuraState(AuraStateType.HealthLess20Percent, HealthBelowPct(20));
ModifyAuraState(AuraStateType.HealthLess35Percent, HealthBelowPct(35));
ModifyAuraState(AuraStateType.HealthAbove75Percent, HealthAbovePct(75));
ModifyAuraState(AuraStateType.Wounded20Percent, HealthBelowPct(20));
ModifyAuraState(AuraStateType.Wounded25Percent, HealthBelowPct(25));
ModifyAuraState(AuraStateType.Wounded35Percent, HealthBelowPct(35));
ModifyAuraState(AuraStateType.WoundHealth20_80, HealthBelowPct(20) || HealthAbovePct(80));
ModifyAuraState(AuraStateType.Healthy75Percent, HealthAbovePct(75));
ModifyAuraState(AuraStateType.WoundHealth35_80, HealthBelowPct(35) || HealthAbovePct(80));
}
UpdateSplineMovement(diff);
+2
View File
@@ -3986,6 +3986,8 @@ namespace Game.Spells
return;
target.RemoveUnitFlag(UnitFlags.Preparation);
}
target.ModifyAuraState(AuraStateType.ArenaPreparation, apply);
}
[AuraEffectHandler(AuraType.NoReagentUse)]
+47 -34
View File
@@ -1354,45 +1354,25 @@ namespace Game.Spells
{
_auraState = AuraStateType.None;
// Seals
if (GetSpellSpecific() == SpellSpecificType.Seal)
_auraState = AuraStateType.Judgement;
// Conflagrate aura state on Immolate and Shadowflame
if (SpellFamilyName == SpellFamilyNames.Warlock &&
// Immolate
(SpellFamilyFlags[0].HasAnyFlag(4u) ||
// Shadowflame
SpellFamilyFlags[2].HasAnyFlag(2u)))
_auraState = AuraStateType.Conflagrate;
// Faerie Fire (druid versions)
if (SpellFamilyName == SpellFamilyNames.Druid && SpellFamilyFlags[0].HasAnyFlag(0x400u))
_auraState = AuraStateType.FaerieFire;
// Sting (hunter's pet ability)
// Faerie Fire
if (GetCategory() == 1133)
_auraState = AuraStateType.FaerieFire;
// Victorious
if (SpellFamilyName == SpellFamilyNames.Warrior && SpellFamilyFlags[1].HasAnyFlag(0x40000u))
_auraState = AuraStateType.WarriorVictoryRush;
// Swiftmend state on Regrowth & Rejuvenation
if (SpellFamilyName == SpellFamilyNames.Druid && SpellFamilyFlags[0].HasAnyFlag(0x50u))
_auraState = AuraStateType.Swiftmend;
// Swiftmend state on Regrowth, Rejuvenation, Wild Growth
if (SpellFamilyName == SpellFamilyNames.Druid && (SpellFamilyFlags[0].HasAnyFlag(0x50u) || SpellFamilyFlags[1].HasAnyFlag(0x4000000u)))
_auraState = AuraStateType.DruidPeriodicHeal;
// Deadly poison aura state
if (SpellFamilyName == SpellFamilyNames.Rogue && SpellFamilyFlags[0].HasAnyFlag(0x10000u))
_auraState = AuraStateType.DeadlyPoison;
_auraState = AuraStateType.RoguePoisoned;
// Enrage aura state
if (Dispel == DispelType.Enrage)
_auraState = AuraStateType.Enrage;
_auraState = AuraStateType.Enraged;
// Bleeding aura state
if (Convert.ToBoolean(GetAllEffectsMechanicMask() & 1 << (int)Mechanics.Bleed))
_auraState = AuraStateType.Bleeding;
_auraState = AuraStateType.Bleed;
if (Convert.ToBoolean(GetSchoolMask() & SpellSchoolMask.Frost))
{
@@ -1403,16 +1383,49 @@ namespace Game.Spells
switch (Id)
{
case 1064: // Dazed
_auraState = AuraStateType.Dazed;
break;
case 32216: // Victorious
_auraState = AuraStateType.Victorious;
break;
case 71465: // Divine Surge
case 50241: // Evasive Charges
_auraState = AuraStateType.Unk22;
_auraState = AuraStateType.RaidEncounter;
break;
case 9991: // Touch of Zanzil
case 35325: // Glowing Blood
case 35328: // Lambent Blood
case 35329: // Vibrant Blood
case 35331: // Black Blood
case 49163: // Perpetual Instability
case 6950: // Faerie Fire
case 9806: // Phantom Strike
case 9991: // Touch of Zanzil
case 13424: // Faerie Fire
case 13752: // Faerie Fire
case 16432: // Plague Mist
case 20656: // Faerie Fire
case 25602: // Faerie Fire
case 32129: // Faerie Fire
case 35325: // Glowing Blood
case 35328: // Lambent Blood
case 35329: // Vibrant Blood
case 35331: // Black Blood
case 49163: // Perpetual Instability
case 65863: // Faerie Fire
case 79559: // Luxscale Light
case 82855: // Dazzling
case 102953: // In the Rumpus
case 127907: // Phosphorescence
case 127913: // Phosphorescence
case 129007: // Zijin Sting
case 130159: // Fae Touch
case 142537: // Spotter Smoke
case 168455: // Spotted!
case 176905: // Super Sticky Glitter Bomb
case 189502: // Marked
case 201785: // Intruder Alert!
case 201786: // Intruder Alert!
case 201935: // Spotted!
case 239233: // Smoke Bomb
case 319400: // Glitter Burst
case 321470: // Dimensional Shifter Mishap
case 331134: // Spotted
_auraState = AuraStateType.FaerieFire;
break;
default: