Core/Auras: Implemented SPELL_AURA_MOD_STUN_DISABLE_GRAVITY
Port From (https://github.com/TrinityCore/TrinityCore/commit/6515319b7542930ffe2237c309a3dc3773d70f72)
This commit is contained in:
@@ -5240,7 +5240,7 @@ namespace Game.Entities
|
|||||||
auraList.First().HandleEffect(this, AuraEffectHandleModes.SendForClient, true);
|
auraList.First().HandleEffect(this, AuraEffectHandleModes.SendForClient, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HasAuraType(AuraType.ModStun))
|
if (HasAuraType(AuraType.ModStun) || HasAuraType(AuraType.ModStunDisableGravity))
|
||||||
SetRooted(true);
|
SetRooted(true);
|
||||||
|
|
||||||
MoveSetCompoundState setCompoundState = new();
|
MoveSetCompoundState setCompoundState = new();
|
||||||
|
|||||||
@@ -1216,7 +1216,7 @@ namespace Game.Entities
|
|||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case UnitState.Stunned:
|
case UnitState.Stunned:
|
||||||
if (HasAuraType(AuraType.ModStun))
|
if (HasAuraType(AuraType.ModStun) || HasAuraType(AuraType.ModStunDisableGravity))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ClearUnitState(state);
|
ClearUnitState(state);
|
||||||
@@ -1255,7 +1255,7 @@ namespace Game.Entities
|
|||||||
void ApplyControlStatesIfNeeded()
|
void ApplyControlStatesIfNeeded()
|
||||||
{
|
{
|
||||||
// Unit States might have been already cleared but auras still present. I need to check with HasAuraType
|
// Unit States might have been already cleared but auras still present. I need to check with HasAuraType
|
||||||
if (HasUnitState(UnitState.Stunned) || HasAuraType(AuraType.ModStun))
|
if (HasUnitState(UnitState.Stunned) || HasAuraType(AuraType.ModStun) || HasAuraType(AuraType.ModStunDisableGravity))
|
||||||
SetStunned(true);
|
SetStunned(true);
|
||||||
|
|
||||||
if (HasUnitState(UnitState.Root) || HasAuraType(AuraType.ModRoot) || HasAuraType(AuraType.ModRoot2))
|
if (HasUnitState(UnitState.Root) || HasAuraType(AuraType.ModRoot) || HasAuraType(AuraType.ModRoot2))
|
||||||
|
|||||||
@@ -2467,6 +2467,31 @@ namespace Game.Spells
|
|||||||
target.SetControlled(false, UnitState.Fleeing);
|
target.SetControlled(false, UnitState.Fleeing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[AuraEffectHandler(AuraType.ModStunDisableGravity)]
|
||||||
|
void HandleAuraModStunAndDisableGravity(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||||
|
{
|
||||||
|
if (!mode.HasAnyFlag(AuraEffectHandleModes.Real))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Unit target = aurApp.GetTarget();
|
||||||
|
|
||||||
|
target.SetControlled(apply, UnitState.Stunned);
|
||||||
|
|
||||||
|
if (apply)
|
||||||
|
target.GetThreatManager().EvaluateSuppressed();
|
||||||
|
|
||||||
|
// Do not remove DisableGravity if there are more than this auraEffect of that kind on the unit or if it's a creature with DisableGravity on its movement template.
|
||||||
|
if (!apply
|
||||||
|
&& (target.HasAuraType(GetAuraType())
|
||||||
|
|| target.HasAuraType(AuraType.ModStunDisableGravity)
|
||||||
|
|| (target.IsCreature() && target.ToCreature().GetMovementTemplate().Flight == CreatureFlightMovementType.DisableGravity)))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (target.SetDisableGravity(apply))
|
||||||
|
if (!apply && !target.IsFlying())
|
||||||
|
target.GetMotionMaster().MoveFall();
|
||||||
|
}
|
||||||
|
|
||||||
/***************************/
|
/***************************/
|
||||||
/*** CHARM ***/
|
/*** CHARM ***/
|
||||||
/***************************/
|
/***************************/
|
||||||
@@ -3245,7 +3270,7 @@ namespace Game.Spells
|
|||||||
|
|
||||||
aurApp.GetTarget().UpdateArmor();
|
aurApp.GetTarget().UpdateArmor();
|
||||||
}
|
}
|
||||||
|
|
||||||
[AuraEffectHandler(AuraType.ModStatBonusPct)]
|
[AuraEffectHandler(AuraType.ModStatBonusPct)]
|
||||||
void HandleModStatBonusPercent(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
void HandleModStatBonusPercent(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||||
{
|
{
|
||||||
@@ -4646,7 +4671,7 @@ namespace Game.Spells
|
|||||||
target.RemoveUnitFlag3(UnitFlags3.AlternativeDefaultLanguage);
|
target.RemoveUnitFlag3(UnitFlags3.AlternativeDefaultLanguage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[AuraEffectHandler(AuraType.Linked)]
|
[AuraEffectHandler(AuraType.Linked)]
|
||||||
void HandleAuraLinked(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
void HandleAuraLinked(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||||
{
|
{
|
||||||
@@ -5762,7 +5787,7 @@ namespace Game.Spells
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[AuraEffectHandler(AuraType.SetFFAPvp)]
|
[AuraEffectHandler(AuraType.SetFFAPvp)]
|
||||||
void HandleSetFFAPvP(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
void HandleSetFFAPvP(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5901,6 +5901,7 @@ namespace Game.Spells
|
|||||||
switch (auraType)
|
switch (auraType)
|
||||||
{
|
{
|
||||||
case AuraType.ModStun:
|
case AuraType.ModStun:
|
||||||
|
case AuraType.ModStunDisableGravity:
|
||||||
return SpellCastResult.Stunned;
|
return SpellCastResult.Stunned;
|
||||||
case AuraType.ModFear:
|
case AuraType.ModFear:
|
||||||
return SpellCastResult.Fleeing;
|
return SpellCastResult.Fleeing;
|
||||||
@@ -5939,6 +5940,12 @@ namespace Game.Spells
|
|||||||
SpellCastResult mechanicResult = mechanicCheck(AuraType.ModFear, ref param1);
|
SpellCastResult mechanicResult = mechanicCheck(AuraType.ModFear, ref param1);
|
||||||
if (mechanicResult != SpellCastResult.SpellCastOk)
|
if (mechanicResult != SpellCastResult.SpellCastOk)
|
||||||
result = mechanicResult;
|
result = mechanicResult;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mechanicResult = mechanicCheck(AuraType.ModStunDisableGravity, ref param1);
|
||||||
|
if (mechanicResult != SpellCastResult.SpellCastOk)
|
||||||
|
result = mechanicResult;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (!CheckSpellCancelsFear(ref param1))
|
else if (!CheckSpellCancelsFear(ref param1))
|
||||||
result = SpellCastResult.Fleeing;
|
result = SpellCastResult.Fleeing;
|
||||||
|
|||||||
Reference in New Issue
Block a user