Core/Unit: Random code style/naming adjustments
Port From (https://github.com/TrinityCore/TrinityCore/commit/05119fd90949340cad4a700d12069154a2faf5f6)
This commit is contained in:
@@ -2216,7 +2216,7 @@ namespace Game.Entities
|
|||||||
CreatureTemplate cinfo = unit.ToCreature().GetCreatureTemplate();
|
CreatureTemplate cinfo = unit.ToCreature().GetCreatureTemplate();
|
||||||
|
|
||||||
// this also applies for transform auras
|
// this also applies for transform auras
|
||||||
SpellInfo transform = Global.SpellMgr.GetSpellInfo(unit.GetTransForm(), unit.GetMap().GetDifficultyID());
|
SpellInfo transform = Global.SpellMgr.GetSpellInfo(unit.GetTransformSpell(), unit.GetMap().GetDifficultyID());
|
||||||
if (transform != null)
|
if (transform != null)
|
||||||
{
|
{
|
||||||
foreach (var spellEffectInfo in transform.GetEffects())
|
foreach (var spellEffectInfo in transform.GetEffects())
|
||||||
|
|||||||
@@ -6731,7 +6731,7 @@ namespace Game.Entities
|
|||||||
if (GetDisplayId() != GetNativeDisplayId())
|
if (GetDisplayId() != GetNativeDisplayId())
|
||||||
RestoreDisplayId(true);
|
RestoreDisplayId(true);
|
||||||
|
|
||||||
if (IsDisallowedMountForm(GetTransForm(), ShapeShiftForm.None, GetDisplayId()))
|
if (IsDisallowedMountForm(GetTransformSpell(), ShapeShiftForm.None, GetDisplayId()))
|
||||||
{
|
{
|
||||||
GetSession().SendActivateTaxiReply(ActivateTaxiReply.PlayerShapeshifted);
|
GetSession().SendActivateTaxiReply(ActivateTaxiReply.PlayerShapeshifted);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ namespace Game.Entities
|
|||||||
public Vehicle VehicleKit { get; set; }
|
public Vehicle VehicleKit { get; set; }
|
||||||
bool canModifyStats;
|
bool canModifyStats;
|
||||||
public uint LastSanctuaryTime { get; set; }
|
public uint LastSanctuaryTime { get; set; }
|
||||||
uint m_transform;
|
uint m_transformSpell;
|
||||||
bool m_cleanupDone; // lock made to not add stuff after cleanup before delete
|
bool m_cleanupDone; // lock made to not add stuff after cleanup before delete
|
||||||
bool m_duringRemoveFromWorld; // lock made to not add stuff after begining removing from world
|
bool m_duringRemoveFromWorld; // lock made to not add stuff after begining removing from world
|
||||||
bool _instantCast;
|
bool _instantCast;
|
||||||
|
|||||||
@@ -1782,9 +1782,10 @@ namespace Game.Entities
|
|||||||
public bool HasInvisibilityAura() { return HasAuraType(AuraType.ModInvisibility); }
|
public bool HasInvisibilityAura() { return HasAuraType(AuraType.ModInvisibility); }
|
||||||
public bool IsFeared() { return HasAuraType(AuraType.ModFear); }
|
public bool IsFeared() { return HasAuraType(AuraType.ModFear); }
|
||||||
public bool IsFrozen() { return HasAuraState(AuraStateType.Frozen); }
|
public bool IsFrozen() { return HasAuraState(AuraStateType.Frozen); }
|
||||||
|
public bool HasRootAura() { return HasAuraType(AuraType.ModRoot) || HasAuraType(AuraType.ModRoot2); }
|
||||||
public bool IsPolymorphed()
|
public bool IsPolymorphed()
|
||||||
{
|
{
|
||||||
uint transformId = GetTransForm();
|
uint transformId = GetTransformSpell();
|
||||||
if (transformId == 0)
|
if (transformId == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public bool IsInDisallowedMountForm()
|
public bool IsInDisallowedMountForm()
|
||||||
{
|
{
|
||||||
return IsDisallowedMountForm(GetTransForm(), GetShapeshiftForm(), GetDisplayId());
|
return IsDisallowedMountForm(GetTransformSpell(), GetShapeshiftForm(), GetDisplayId());
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsDisallowedMountForm(uint spellId, ShapeShiftForm form, uint displayId)
|
public bool IsDisallowedMountForm(uint spellId, ShapeShiftForm form, uint displayId)
|
||||||
@@ -510,8 +510,8 @@ namespace Game.Entities
|
|||||||
base.CleanupsBeforeDelete(finalCleanup);
|
base.CleanupsBeforeDelete(finalCleanup);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetTransForm(uint spellid) { m_transform = spellid; }
|
public void SetTransformSpell(uint spellid) { m_transformSpell = spellid; }
|
||||||
public uint GetTransForm() { return m_transform; }
|
public uint GetTransformSpell() { return m_transformSpell; }
|
||||||
|
|
||||||
public Vehicle GetVehicleKit() { return VehicleKit; }
|
public Vehicle GetVehicleKit() { return VehicleKit; }
|
||||||
public Vehicle GetVehicle() { return m_vehicle; }
|
public Vehicle GetVehicle() { return m_vehicle; }
|
||||||
|
|||||||
@@ -1905,7 +1905,7 @@ namespace Game.Maps
|
|||||||
public bool Invoke(Creature u)
|
public bool Invoke(Creature u)
|
||||||
{
|
{
|
||||||
if (u.IsAlive() && u.IsInCombat() && !i_obj.IsHostileTo(u) && i_obj.IsWithinDistInMap(u, i_range) &&
|
if (u.IsAlive() && u.IsInCombat() && !i_obj.IsHostileTo(u) && i_obj.IsWithinDistInMap(u, i_range) &&
|
||||||
(u.IsFeared() || u.IsCharmed() || u.IsFrozen() || u.HasUnitState(UnitState.Stunned) || u.HasUnitState(UnitState.Confused)))
|
(u.IsFeared() || u.IsCharmed() || u.HasRootAura() || u.HasUnitState(UnitState.Stunned) || u.HasUnitState(UnitState.Confused)))
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1250,7 +1250,7 @@ namespace Game.Spells
|
|||||||
|
|
||||||
// and polymorphic affects
|
// and polymorphic affects
|
||||||
if (target.IsPolymorphed())
|
if (target.IsPolymorphed())
|
||||||
target.RemoveAurasDueToSpell(target.GetTransForm());
|
target.RemoveAurasDueToSpell(target.GetTransformSpell());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@@ -1272,7 +1272,7 @@ namespace Game.Spells
|
|||||||
|
|
||||||
if (modelid > 0)
|
if (modelid > 0)
|
||||||
{
|
{
|
||||||
SpellInfo transformSpellInfo = Global.SpellMgr.GetSpellInfo(target.GetTransForm(), GetBase().GetCastDifficulty());
|
SpellInfo transformSpellInfo = Global.SpellMgr.GetSpellInfo(target.GetTransformSpell(), GetBase().GetCastDifficulty());
|
||||||
if (transformSpellInfo == null || !GetSpellInfo().IsPositive())
|
if (transformSpellInfo == null || !GetSpellInfo().IsPositive())
|
||||||
target.SetDisplayId(modelid);
|
target.SetDisplayId(modelid);
|
||||||
}
|
}
|
||||||
@@ -1377,10 +1377,10 @@ namespace Game.Spells
|
|||||||
if (apply)
|
if (apply)
|
||||||
{
|
{
|
||||||
// update active transform spell only when transform not set or not overwriting negative by positive case
|
// update active transform spell only when transform not set or not overwriting negative by positive case
|
||||||
SpellInfo transformSpellInfo = Global.SpellMgr.GetSpellInfo(target.GetTransForm(), GetBase().GetCastDifficulty());
|
SpellInfo transformSpellInfo = Global.SpellMgr.GetSpellInfo(target.GetTransformSpell(), GetBase().GetCastDifficulty());
|
||||||
if (transformSpellInfo == null || !GetSpellInfo().IsPositive() || transformSpellInfo.IsPositive())
|
if (transformSpellInfo == null || !GetSpellInfo().IsPositive() || transformSpellInfo.IsPositive())
|
||||||
{
|
{
|
||||||
target.SetTransForm(GetId());
|
target.SetTransformSpell(GetId());
|
||||||
// special case (spell specific functionality)
|
// special case (spell specific functionality)
|
||||||
if (GetMiscValue() == 0)
|
if (GetMiscValue() == 0)
|
||||||
{
|
{
|
||||||
@@ -1558,8 +1558,8 @@ namespace Game.Spells
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (target.GetTransForm() == GetId())
|
if (target.GetTransformSpell() == GetId())
|
||||||
target.SetTransForm(0);
|
target.SetTransformSpell(0);
|
||||||
|
|
||||||
target.RestoreDisplayId(target.IsMounted());
|
target.RestoreDisplayId(target.IsMounted());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user