aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/Entities/Object/Updates/ViewerDependentValues.h2
-rw-r--r--src/server/game/Entities/Player/Player.cpp2
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp16
-rw-r--r--src/server/game/Entities/Unit/Unit.h16
-rw-r--r--src/server/game/Grids/Notifiers/GridNotifiers.h2
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp12
6 files changed, 22 insertions, 28 deletions
diff --git a/src/server/game/Entities/Object/Updates/ViewerDependentValues.h b/src/server/game/Entities/Object/Updates/ViewerDependentValues.h
index e5cd00485da..b60f95b5707 100644
--- a/src/server/game/Entities/Object/Updates/ViewerDependentValues.h
+++ b/src/server/game/Entities/Object/Updates/ViewerDependentValues.h
@@ -115,7 +115,7 @@ public:
CreatureTemplate const* cinfo = unit->ToCreature()->GetCreatureTemplate();
// this also applies for transform auras
- if (SpellInfo const* transform = sSpellMgr->GetSpellInfo(unit->getTransForm(), unit->GetMap()->GetDifficultyID()))
+ if (SpellInfo const* transform = sSpellMgr->GetSpellInfo(unit->GetTransformSpell(), unit->GetMap()->GetDifficultyID()))
{
for (SpellEffectInfo const& spellEffectInfo : transform->GetEffects())
{
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 4bf396c353c..3a2cf45cfa4 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -22683,7 +22683,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
if (GetDisplayId() != GetNativeDisplayId())
RestoreDisplayId(true);
- if (IsDisallowedMountForm(getTransForm(), FORM_NONE, GetDisplayId()))
+ if (IsDisallowedMountForm(GetTransformSpell(), FORM_NONE, GetDisplayId()))
{
GetSession()->SendActivateTaxiReply(ERR_TAXIPLAYERSHAPESHIFTED);
return false;
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index bd512988fb0..6f738188dc6 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -298,9 +298,9 @@ SpellNonMeleeDamage::SpellNonMeleeDamage(Unit* _attacker, Unit* _target, SpellIn
}
Unit::Unit(bool isWorldObject) :
- WorldObject(isWorldObject), m_playerMovingMe(nullptr), m_lastSanctuaryTime(0),
- LastCharmerGUID(), m_ControlledByPlayer(false),
- movespline(new Movement::MoveSpline()), m_AutoRepeatFirstCast(false), m_procDeep(0), m_removedAurasCount(0),
+ WorldObject(isWorldObject), m_playerMovingMe(nullptr), m_lastSanctuaryTime(0), LastCharmerGUID(),
+ movespline(new Movement::MoveSpline()), m_ControlledByPlayer(false), m_AutoRepeatFirstCast(false),
+ m_procDeep(0), m_transformSpell(0), m_removedAurasCount(0),
m_interruptMask(SpellAuraInterruptFlags::None), m_interruptMask2(SpellAuraInterruptFlags2::None),
m_charmer(nullptr), m_charmed(nullptr),
i_motionMaster(new MotionMaster(this)), m_regenTimer(0), m_vehicle(nullptr),
@@ -339,7 +339,6 @@ Unit::Unit(bool isWorldObject) :
m_auraUpdateIterator = m_ownedAuras.end();
- m_transform = 0;
m_canModifyStats = false;
for (uint8 i = 0; i < UNIT_MOD_END; ++i)
@@ -8440,7 +8439,7 @@ bool Unit::IsInFeralForm() const
bool Unit::IsInDisallowedMountForm() const
{
- return IsDisallowedMountForm(getTransForm(), GetShapeshiftForm(), GetDisplayId());
+ return IsDisallowedMountForm(GetTransformSpell(), GetShapeshiftForm(), GetDisplayId());
}
bool Unit::IsDisallowedMountForm(uint32 spellId, ShapeshiftForm form, uint32 displayId) const
@@ -9495,11 +9494,6 @@ Player* Unit::GetPlayerBeingMoved() const
return nullptr;
}
-bool Unit::isFrozen() const
-{
- return HasAuraState(AURA_STATE_FROZEN);
-}
-
uint32 createProcHitMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missCondition)
{
uint32 hitMask = PROC_HIT_NONE;
@@ -9842,7 +9836,7 @@ void Unit::SetAnimTier(UnitBytes1_Flags animTier, bool notifyClient)
bool Unit::IsPolymorphed() const
{
- uint32 transformId = getTransForm();
+ uint32 transformId = GetTransformSpell();
if (!transformId)
return false;
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index e6bd72cf6e7..874a69da264 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -1135,10 +1135,10 @@ class TC_GAME_API Unit : public WorldObject
bool HasStealthAura() const { return HasAuraType(SPELL_AURA_MOD_STEALTH); }
bool HasInvisibilityAura() const { return HasAuraType(SPELL_AURA_MOD_INVISIBILITY); }
- bool isFeared() const { return HasAuraType(SPELL_AURA_MOD_FEAR); }
+ bool IsFeared() const { return HasAuraType(SPELL_AURA_MOD_FEAR); }
+ bool HasRootAura() const { return HasAuraType(SPELL_AURA_MOD_ROOT) || HasAuraType(SPELL_AURA_MOD_ROOT_2); }
bool IsPolymorphed() const;
-
- bool isFrozen() const;
+ bool IsFrozen() const { return HasAuraState(AURA_STATE_FROZEN); }
bool isTargetableForAttack(bool checkFakeDeath = true) const;
@@ -1620,8 +1620,8 @@ class TC_GAME_API Unit : public WorldObject
SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::NativeDisplayID), displayId);
SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::NativeXDisplayScale), displayScale);
}
- void setTransForm(uint32 spellid) { m_transform = spellid;}
- uint32 getTransForm() const { return m_transform;}
+ void SetTransformSpell(uint32 spellid) { m_transformSpell = spellid;}
+ uint32 GetTransformSpell() const { return m_transformSpell;}
// DynamicObject management
void _RegisterDynObject(DynamicObject* dynObj);
@@ -1766,8 +1766,6 @@ class TC_GAME_API Unit : public WorldObject
/// Returns the transport this unit is on directly (if on vehicle and transport, return vehicle)
TransportBase* GetDirectTransport() const;
- bool m_ControlledByPlayer;
-
void HandleSpellClick(Unit* clicker, int8 seatId = -1);
void EnterVehicle(Unit* base, int8 seatId = -1);
void ExitVehicle(Position const* exitPosition = nullptr);
@@ -1857,6 +1855,8 @@ class TC_GAME_API Unit : public WorldObject
void _UpdateAutoRepeatSpell();
+ bool m_ControlledByPlayer;
+
bool m_AutoRepeatFirstCast;
float m_createStats[MAX_STATS];
@@ -1879,7 +1879,7 @@ class TC_GAME_API Unit : public WorldObject
typedef std::vector<AreaTrigger*> AreaTriggerList;
AreaTriggerList m_areaTrigger;
- uint32 m_transform;
+ uint32 m_transformSpell;
Spell* m_currentSpells[CURRENT_MAX_SPELL];
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h
index 2ec61224cd1..04f1e5bcf05 100644
--- a/src/server/game/Grids/Notifiers/GridNotifiers.h
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.h
@@ -892,7 +892,7 @@ namespace Trinity
bool operator()(Unit* u) const
{
if (u->IsAlive() && u->IsInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
- (u->isFeared() || u->IsCharmed() || u->isFrozen() || u->HasUnitState(UNIT_STATE_STUNNED) || u->HasUnitState(UNIT_STATE_CONFUSED)))
+ (u->IsFeared() || u->IsCharmed() || u->HasRootAura() || u->HasUnitState(UNIT_STATE_STUNNED) || u->HasUnitState(UNIT_STATE_CONFUSED)))
{
return true;
}
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index e2001c167dd..2b952d88cb1 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -1717,7 +1717,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo
// and polymorphic affects
if (target->IsPolymorphed())
- target->RemoveAurasDueToSpell(target->getTransForm());
+ target->RemoveAurasDueToSpell(target->GetTransformSpell());
break;
}
default:
@@ -1739,7 +1739,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo
if (modelid > 0)
{
- SpellInfo const* transformSpellInfo = sSpellMgr->GetSpellInfo(target->getTransForm(), GetBase()->GetCastDifficulty());
+ SpellInfo const* transformSpellInfo = sSpellMgr->GetSpellInfo(target->GetTransformSpell(), GetBase()->GetCastDifficulty());
if (!transformSpellInfo || !GetSpellInfo()->IsPositive())
target->SetDisplayId(modelid);
}
@@ -1838,10 +1838,10 @@ void AuraEffect::HandleAuraTransform(AuraApplication const* aurApp, uint8 mode,
if (apply)
{
// update active transform spell only when transform not set or not overwriting negative by positive case
- SpellInfo const* transformSpellInfo = sSpellMgr->GetSpellInfo(target->getTransForm(), GetBase()->GetCastDifficulty());
+ SpellInfo const* transformSpellInfo = sSpellMgr->GetSpellInfo(target->GetTransformSpell(), GetBase()->GetCastDifficulty());
if (!transformSpellInfo || !GetSpellInfo()->IsPositive() || transformSpellInfo->IsPositive())
{
- target->setTransForm(GetId());
+ target->SetTransformSpell(GetId());
// special case (spell specific functionality)
if (GetMiscValue() == 0)
{
@@ -2021,8 +2021,8 @@ void AuraEffect::HandleAuraTransform(AuraApplication const* aurApp, uint8 mode,
else
{
// HandleEffect(this, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, true) will reapply it if need
- if (target->getTransForm() == GetId())
- target->setTransForm(0);
+ if (target->GetTransformSpell() == GetId())
+ target->SetTransformSpell(0);
target->RestoreDisplayId(target->IsMounted());