Core/Auras: Implement SPELL_AURA_FORCE_BREATH_BAR
Port From (https://github.com/TrinityCore/TrinityCore/commit/6c01f761b2c00d9ea8d44f2856c7a82cadb9bbfc)
This commit is contained in:
@@ -185,7 +185,7 @@ namespace Framework.Constants
|
|||||||
ModHealthRegenInCombat = 161,
|
ModHealthRegenInCombat = 161,
|
||||||
PowerBurn = 162,
|
PowerBurn = 162,
|
||||||
ModCritDamageBonus = 163,
|
ModCritDamageBonus = 163,
|
||||||
ForceBeathBar = 164, //NYI
|
ForceBeathBar = 164,
|
||||||
MeleeAttackPowerAttackerBonus = 165,
|
MeleeAttackPowerAttackerBonus = 165,
|
||||||
ModAttackPowerPct = 166,
|
ModAttackPowerPct = 166,
|
||||||
ModRangedAttackPowerPct = 167,
|
ModRangedAttackPowerPct = 167,
|
||||||
|
|||||||
@@ -792,44 +792,33 @@ namespace Game.Entities
|
|||||||
// process liquid auras using generic unit code
|
// process liquid auras using generic unit code
|
||||||
base.ProcessTerrainStatusUpdate(oldLiquidStatus, newLiquidData);
|
base.ProcessTerrainStatusUpdate(oldLiquidStatus, newLiquidData);
|
||||||
|
|
||||||
|
m_MirrorTimerFlags &= ~(PlayerUnderwaterState.InWater | PlayerUnderwaterState.InLava | PlayerUnderwaterState.InSlime | PlayerUnderwaterState.InDarkWater);
|
||||||
|
|
||||||
// player specific logic for mirror timers
|
// player specific logic for mirror timers
|
||||||
if (GetLiquidStatus() != 0 && newLiquidData != null)
|
if (GetLiquidStatus() != 0 && newLiquidData != null)
|
||||||
{
|
{
|
||||||
// Breath bar state (under water in any liquid type)
|
// Breath bar state (under water in any liquid type)
|
||||||
if (newLiquidData.type_flags.HasAnyFlag(LiquidHeaderTypeFlags.AllLiquids))
|
if (newLiquidData.type_flags.HasAnyFlag(LiquidHeaderTypeFlags.AllLiquids))
|
||||||
{
|
|
||||||
if (GetLiquidStatus().HasAnyFlag(ZLiquidStatus.UnderWater))
|
if (GetLiquidStatus().HasAnyFlag(ZLiquidStatus.UnderWater))
|
||||||
m_MirrorTimerFlags |= PlayerUnderwaterState.InWater;
|
m_MirrorTimerFlags |= PlayerUnderwaterState.InWater;
|
||||||
else
|
|
||||||
m_MirrorTimerFlags &= ~PlayerUnderwaterState.InWater;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fatigue bar state (if not on flight path or transport)
|
// Fatigue bar state (if not on flight path or transport)
|
||||||
if (newLiquidData.type_flags.HasAnyFlag(LiquidHeaderTypeFlags.DarkWater) && !IsInFlight() && !GetTransport())
|
if (newLiquidData.type_flags.HasAnyFlag(LiquidHeaderTypeFlags.DarkWater) && !IsInFlight() && !GetTransport())
|
||||||
m_MirrorTimerFlags |= PlayerUnderwaterState.InDarkWater;
|
m_MirrorTimerFlags |= PlayerUnderwaterState.InDarkWater;
|
||||||
else
|
|
||||||
m_MirrorTimerFlags &= ~PlayerUnderwaterState.InDarkWater;
|
|
||||||
|
|
||||||
// Lava state (any contact)
|
// Lava state (any contact)
|
||||||
if (newLiquidData.type_flags.HasAnyFlag(LiquidHeaderTypeFlags.Magma))
|
if (newLiquidData.type_flags.HasAnyFlag(LiquidHeaderTypeFlags.Magma))
|
||||||
{
|
|
||||||
if (GetLiquidStatus().HasAnyFlag(ZLiquidStatus.InContact))
|
if (GetLiquidStatus().HasAnyFlag(ZLiquidStatus.InContact))
|
||||||
m_MirrorTimerFlags |= PlayerUnderwaterState.InLava;
|
m_MirrorTimerFlags |= PlayerUnderwaterState.InLava;
|
||||||
else
|
|
||||||
m_MirrorTimerFlags &= ~PlayerUnderwaterState.InLava;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Slime state (any contact)
|
// Slime state (any contact)
|
||||||
if (newLiquidData.type_flags.HasAnyFlag(LiquidHeaderTypeFlags.Slime))
|
if (newLiquidData.type_flags.HasAnyFlag(LiquidHeaderTypeFlags.Slime))
|
||||||
{
|
|
||||||
if (GetLiquidStatus().HasAnyFlag(ZLiquidStatus.InContact))
|
if (GetLiquidStatus().HasAnyFlag(ZLiquidStatus.InContact))
|
||||||
m_MirrorTimerFlags |= PlayerUnderwaterState.InSlime;
|
m_MirrorTimerFlags |= PlayerUnderwaterState.InSlime;
|
||||||
else
|
|
||||||
m_MirrorTimerFlags &= ~PlayerUnderwaterState.InSlime;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
m_MirrorTimerFlags &= ~(PlayerUnderwaterState.InWater | PlayerUnderwaterState.InLava | PlayerUnderwaterState.InSlime | PlayerUnderwaterState.InDarkWater);
|
if (HasAuraType(AuraType.ForceBeathBar))
|
||||||
|
m_MirrorTimerFlags |= PlayerUnderwaterState.InWater;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1989,7 +1989,7 @@ namespace Game.Spells
|
|||||||
}
|
}
|
||||||
|
|
||||||
// call functions which may have additional effects after changing state of unit
|
// call functions which may have additional effects after changing state of unit
|
||||||
if (target.IsInWorld)
|
if (target.IsInWorld)
|
||||||
target.UpdateObjectVisibility();
|
target.UpdateObjectVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3207,7 +3207,7 @@ namespace Game.Spells
|
|||||||
|
|
||||||
aurApp.GetTarget().HandleStatFlatModifier(UnitMods.Armor, UnitModifierFlatType.Base, GetAmount(), apply);
|
aurApp.GetTarget().HandleStatFlatModifier(UnitMods.Armor, UnitModifierFlatType.Base, GetAmount(), apply);
|
||||||
}
|
}
|
||||||
|
|
||||||
[AuraEffectHandler(AuraType.ModStatBonusPct)]
|
[AuraEffectHandler(AuraType.ModStatBonusPct)]
|
||||||
void HandleModStatBonusPercent(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
void HandleModStatBonusPercent(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||||
{
|
{
|
||||||
@@ -4762,7 +4762,7 @@ namespace Game.Spells
|
|||||||
|
|
||||||
aurApp.GetTarget().CastSpell(aurApp.GetTarget(), GetSpellEffectInfo().TriggerSpell, new CastSpellExtraArgs(this));
|
aurApp.GetTarget().CastSpell(aurApp.GetTarget(), GetSpellEffectInfo().TriggerSpell, new CastSpellExtraArgs(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
[AuraEffectHandler(AuraType.OpenStable)]
|
[AuraEffectHandler(AuraType.OpenStable)]
|
||||||
void HandleAuraOpenStable(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
void HandleAuraOpenStable(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||||
{
|
{
|
||||||
@@ -5873,7 +5873,7 @@ namespace Game.Spells
|
|||||||
|
|
||||||
aurApp.GetTarget().UpdateMountCapability();
|
aurApp.GetTarget().UpdateMountCapability();
|
||||||
}
|
}
|
||||||
|
|
||||||
[AuraEffectHandler(AuraType.CosmeticMounted)]
|
[AuraEffectHandler(AuraType.CosmeticMounted)]
|
||||||
void HandleCosmeticMounted(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
void HandleCosmeticMounted(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||||
{
|
{
|
||||||
@@ -5907,6 +5907,19 @@ namespace Game.Spells
|
|||||||
foreach (Aura aura in suppressedAuras)
|
foreach (Aura aura in suppressedAuras)
|
||||||
aura.ApplyForTargets();
|
aura.ApplyForTargets();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[AuraEffectHandler(AuraType.ForceBeathBar)]
|
||||||
|
void HandleForceBreathBar(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||||
|
{
|
||||||
|
if (!mode.HasAnyFlag(AuraEffectHandleModes.Real))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Player playerTarget = aurApp.GetTarget().ToPlayer();
|
||||||
|
if (playerTarget == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
playerTarget.UpdatePositionData();
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user