mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-18 13:59:39 -04:00
Core/Misc: Rename UNIT_STAT_* enums to UNIT_STATE_*
This commit is contained in:
@@ -99,7 +99,7 @@ void CombatAI::UpdateAI(const uint32 diff)
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
if (uint32 spellId = events.ExecuteEvent())
|
||||
@@ -158,7 +158,7 @@ void CasterAI::UpdateAI(const uint32 diff)
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
if (uint32 spellId = events.ExecuteEvent())
|
||||
|
||||
@@ -61,14 +61,14 @@ void PossessedAI::KilledUnit(Unit* victim)
|
||||
|
||||
void CritterAI::DamageTaken(Unit* /*done_by*/, uint32&)
|
||||
{
|
||||
if (!me->HasUnitState(UNIT_STAT_FLEEING))
|
||||
me->SetControlled(true, UNIT_STAT_FLEEING);
|
||||
if (!me->HasUnitState(UNIT_STATE_FLEEING))
|
||||
me->SetControlled(true, UNIT_STATE_FLEEING);
|
||||
}
|
||||
|
||||
void CritterAI::EnterEvadeMode()
|
||||
{
|
||||
if (me->HasUnitState(UNIT_STAT_FLEEING))
|
||||
me->SetControlled(false, UNIT_STAT_FLEEING);
|
||||
if (me->HasUnitState(UNIT_STATE_FLEEING))
|
||||
me->SetControlled(false, UNIT_STATE_FLEEING);
|
||||
CreatureAI::EnterEvadeMode();
|
||||
}
|
||||
|
||||
|
||||
@@ -116,14 +116,14 @@ void PetAI::UpdateAI(const uint32 diff)
|
||||
else
|
||||
HandleReturnMovement();
|
||||
}
|
||||
else if (owner && !me->HasUnitState(UNIT_STAT_FOLLOW)) // no charm info and no victim
|
||||
else if (owner && !me->HasUnitState(UNIT_STATE_FOLLOW)) // no charm info and no victim
|
||||
me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle());
|
||||
|
||||
if (!me->GetCharmInfo())
|
||||
return;
|
||||
|
||||
// Autocast (casted only in combat or persistent spells in any state)
|
||||
if (!me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (!me->HasUnitState(UNIT_STATE_CASTING))
|
||||
{
|
||||
typedef std::vector<std::pair<Unit*, Spell*> > TargetSpellList;
|
||||
TargetSpellList targetSpellStore;
|
||||
|
||||
@@ -40,7 +40,7 @@ void UnitAI::AttackStartCaster(Unit* victim, float dist)
|
||||
|
||||
void UnitAI::DoMeleeAttackIfReady()
|
||||
{
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
Unit* victim = me->getVictim();
|
||||
@@ -60,7 +60,7 @@ void UnitAI::DoMeleeAttackIfReady()
|
||||
|
||||
bool UnitAI::DoSpellAttackIfReady(uint32 spell)
|
||||
{
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return true;
|
||||
|
||||
if (me->isAttackReady())
|
||||
|
||||
@@ -596,7 +596,7 @@ inline bool CreatureAI::_EnterEvadeMode()
|
||||
|
||||
inline void UnitAI::DoCast(Unit* victim, uint32 spellId, bool triggered)
|
||||
{
|
||||
if (!victim || (me->HasUnitState(UNIT_STAT_CASTING) && !triggered))
|
||||
if (!victim || (me->HasUnitState(UNIT_STATE_CASTING) && !triggered))
|
||||
return;
|
||||
|
||||
me->CastSpell(victim, spellId, triggered);
|
||||
@@ -609,7 +609,7 @@ inline void UnitAI::DoCastVictim(uint32 spellId, bool triggered)
|
||||
|
||||
inline void UnitAI::DoCastAOE(uint32 spellId, bool triggered)
|
||||
{
|
||||
if (!triggered && me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (!triggered && me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
me->CastSpell((Unit*)NULL, spellId, triggered);
|
||||
|
||||
@@ -577,7 +577,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
||||
{
|
||||
if (action.combat_movement.melee)
|
||||
{
|
||||
me->AddUnitState(UNIT_STAT_MELEE_ATTACKING);
|
||||
me->AddUnitState(UNIT_STATE_MELEE_ATTACKING);
|
||||
me->SendMeleeAttackStart(victim);
|
||||
}
|
||||
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE)
|
||||
@@ -591,7 +591,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
||||
Unit* victim = me->getVictim();
|
||||
if (action.combat_movement.melee && victim)
|
||||
{
|
||||
me->ClearUnitState(UNIT_STAT_MELEE_ATTACKING);
|
||||
me->ClearUnitState(UNIT_STATE_MELEE_ATTACKING);
|
||||
me->SendMeleeAttackStop(victim);
|
||||
}
|
||||
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
|
||||
|
||||
@@ -595,7 +595,7 @@ void BossAI::UpdateAI(uint32 const diff)
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -654,7 +654,7 @@ void WorldBossAI::UpdateAI(uint32 const diff)
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -90,7 +90,7 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* who)
|
||||
|
||||
void npc_escortAI::MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (!me->HasUnitState(UNIT_STAT_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me))
|
||||
if (!me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me))
|
||||
{
|
||||
if (HasEscortState(STATE_ESCORT_ESCORTING) && AssistPlayerInCombat(who))
|
||||
return;
|
||||
|
||||
@@ -38,8 +38,8 @@ void FollowerAI::AttackStart(Unit* who)
|
||||
me->SetInCombatWith(who);
|
||||
who->SetInCombatWith(me);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_FOLLOW))
|
||||
me->ClearUnitState(UNIT_STAT_FOLLOW);
|
||||
if (me->HasUnitState(UNIT_STATE_FOLLOW))
|
||||
me->ClearUnitState(UNIT_STATE_FOLLOW);
|
||||
|
||||
if (IsCombatMovementAllowed())
|
||||
me->GetMotionMaster()->MoveChase(who);
|
||||
@@ -88,7 +88,7 @@ bool FollowerAI::AssistPlayerInCombat(Unit* who)
|
||||
|
||||
void FollowerAI::MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (!me->HasUnitState(UNIT_STAT_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me))
|
||||
if (!me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me))
|
||||
{
|
||||
if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(who))
|
||||
return;
|
||||
@@ -340,9 +340,9 @@ Player* FollowerAI::GetLeaderForFollower()
|
||||
|
||||
void FollowerAI::SetFollowComplete(bool bWithEndEvent)
|
||||
{
|
||||
if (me->HasUnitState(UNIT_STAT_FOLLOW))
|
||||
if (me->HasUnitState(UNIT_STATE_FOLLOW))
|
||||
{
|
||||
me->ClearUnitState(UNIT_STAT_FOLLOW);
|
||||
me->ClearUnitState(UNIT_STATE_FOLLOW);
|
||||
|
||||
me->StopMoving();
|
||||
me->GetMotionMaster()->Clear();
|
||||
@@ -369,9 +369,9 @@ void FollowerAI::SetFollowPaused(bool paused)
|
||||
{
|
||||
AddFollowState(STATE_FOLLOW_PAUSED);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_FOLLOW))
|
||||
if (me->HasUnitState(UNIT_STATE_FOLLOW))
|
||||
{
|
||||
me->ClearUnitState(UNIT_STAT_FOLLOW);
|
||||
me->ClearUnitState(UNIT_STATE_FOLLOW);
|
||||
|
||||
me->StopMoving();
|
||||
me->GetMotionMaster()->Clear();
|
||||
|
||||
@@ -2718,7 +2718,7 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff)
|
||||
{
|
||||
if (!(e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS))
|
||||
{
|
||||
if (me && me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me && me->HasUnitState(UNIT_STATE_CASTING))
|
||||
{
|
||||
e.timer = 1;
|
||||
return;
|
||||
|
||||
@@ -180,7 +180,7 @@ void HostileReference::updateOnlineStatus()
|
||||
// target is not in flight
|
||||
if (isValid()
|
||||
&& (getTarget()->GetTypeId() != TYPEID_PLAYER || !getTarget()->ToPlayer()->isGameMaster())
|
||||
&& !getTarget()->HasUnitState(UNIT_STAT_IN_FLIGHT)
|
||||
&& !getTarget()->HasUnitState(UNIT_STATE_IN_FLIGHT)
|
||||
&& getTarget()->IsInMap(getSourceUnit())
|
||||
)
|
||||
{
|
||||
|
||||
@@ -1762,7 +1762,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
|
||||
error = LFG_TELEPORTERROR_INVALID_LOCATION;
|
||||
else if (!player->isAlive())
|
||||
error = LFG_TELEPORTERROR_PLAYER_DEAD;
|
||||
else if (player->IsFalling() || player->HasUnitState(UNIT_STAT_JUMPING))
|
||||
else if (player->IsFalling() || player->HasUnitState(UNIT_STATE_JUMPING))
|
||||
error = LFG_TELEPORTERROR_FALLING;
|
||||
else
|
||||
{
|
||||
|
||||
@@ -685,7 +685,7 @@ void Creature::DoFleeToGetAssistance()
|
||||
if (!creature)
|
||||
//SetFeared(true, getVictim()->GetGUID(), 0, sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY));
|
||||
//TODO: use 31365
|
||||
SetControlled(true, UNIT_STAT_FLEEING);
|
||||
SetControlled(true, UNIT_STATE_FLEEING);
|
||||
else
|
||||
GetMotionMaster()->MoveSeekAssistance(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ());
|
||||
}
|
||||
@@ -1536,7 +1536,7 @@ void Creature::setDeathState(DeathState s)
|
||||
if (GetCreatureInfo()->InhabitType & INHABIT_WATER)
|
||||
AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING);
|
||||
SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag);
|
||||
ClearUnitState(uint32(UNIT_STAT_ALL_STATE));
|
||||
ClearUnitState(uint32(UNIT_STATE_ALL_STATE));
|
||||
SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool));
|
||||
LoadCreaturesAddon(true);
|
||||
Motion_Initialize();
|
||||
@@ -1947,7 +1947,7 @@ bool Creature::_IsTargetAcceptable(const Unit* target) const
|
||||
|| (m_vehicle && (IsOnVehicle(target) || m_vehicle->GetBase()->IsOnVehicle(target))))
|
||||
return false;
|
||||
|
||||
if (target->HasUnitState(UNIT_STAT_DIED))
|
||||
if (target->HasUnitState(UNIT_STATE_DIED))
|
||||
{
|
||||
// guards can detect fake death
|
||||
if (isGuard() && target->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH))
|
||||
|
||||
@@ -512,7 +512,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature
|
||||
|
||||
uint8 getLevelForTarget(WorldObject const* target) const; // overwrite Unit::getLevelForTarget for boss level support
|
||||
|
||||
bool IsInEvadeMode() const { return HasUnitState(UNIT_STAT_EVADE); }
|
||||
bool IsInEvadeMode() const { return HasUnitState(UNIT_STATE_EVADE); }
|
||||
|
||||
bool AIM_Initialize(CreatureAI* ai = NULL);
|
||||
void Motion_Initialize();
|
||||
|
||||
@@ -2458,7 +2458,7 @@ namespace Trinity
|
||||
|
||||
float x, y, z;
|
||||
|
||||
if (!c->isAlive() || c->HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED) ||
|
||||
if (!c->isAlive() || c->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED) ||
|
||||
!c->GetMotionMaster()->GetDestination(x, y, z))
|
||||
{
|
||||
x = c->GetPositionX();
|
||||
|
||||
@@ -1589,7 +1589,7 @@ void Player::Update(uint32 p_time)
|
||||
|
||||
GetAchievementMgr().UpdateTimedAchievements(p_time);
|
||||
|
||||
if (HasUnitState(UNIT_STAT_MELEE_ATTACKING) && !HasUnitState(UNIT_STAT_CASTING))
|
||||
if (HasUnitState(UNIT_STATE_MELEE_ATTACKING) && !HasUnitState(UNIT_STATE_CASTING))
|
||||
{
|
||||
if (Unit* pVictim = getVictim())
|
||||
{
|
||||
@@ -11385,7 +11385,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
|
||||
{
|
||||
// May be here should be more stronger checks; STUNNED checked
|
||||
// ROOT, CONFUSED, DISTRACTED, FLEEING this needs to be checked.
|
||||
if (HasUnitState(UNIT_STAT_STUNNED))
|
||||
if (HasUnitState(UNIT_STATE_STUNNED))
|
||||
return EQUIP_ERR_YOU_ARE_STUNNED;
|
||||
|
||||
// do not allow equipping gear except weapons, offhands, projectiles, relics in
|
||||
@@ -20265,7 +20265,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
|
||||
return false;
|
||||
|
||||
// not let cheating with start flight in time of logout process || while in combat || has type state: stunned || has type state: root
|
||||
if (GetSession()->isLogingOut() || isInCombat() || HasUnitState(UNIT_STAT_STUNNED) || HasUnitState(UNIT_STAT_ROOT))
|
||||
if (GetSession()->isLogingOut() || isInCombat() || HasUnitState(UNIT_STATE_STUNNED) || HasUnitState(UNIT_STATE_ROOT))
|
||||
{
|
||||
WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4);
|
||||
data << uint32(ERR_TAXIPLAYERBUSY);
|
||||
@@ -21560,7 +21560,7 @@ void Player::SendInitialVisiblePackets(Unit* target)
|
||||
SendAurasForTarget(target);
|
||||
if (target->isAlive())
|
||||
{
|
||||
if (target->HasUnitState(UNIT_STAT_MELEE_ATTACKING) && target->getVictim())
|
||||
if (target->HasUnitState(UNIT_STATE_MELEE_ATTACKING) && target->getVictim())
|
||||
target->SendMeleeAttackStart(target->getVictim());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1806,7 +1806,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
void SetContestedPvPTimer(uint32 newTime) {m_contestedPvPTimer = newTime;}
|
||||
void ResetContestedPvP()
|
||||
{
|
||||
ClearUnitState(UNIT_STAT_ATTACK_PLAYER);
|
||||
ClearUnitState(UNIT_STATE_ATTACK_PLAYER);
|
||||
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP);
|
||||
m_contestedPvPTimer = 0;
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ void Unit::Update(uint32 p_time)
|
||||
// update combat timer only for players and pets (only pets with PetAI)
|
||||
if (isInCombat() && (GetTypeId() == TYPEID_PLAYER || (ToCreature()->isPet() && IsControlledByPlayer())))
|
||||
{
|
||||
// Check UNIT_STAT_MELEE_ATTACKING or UNIT_STAT_CHASE (without UNIT_STAT_FOLLOW in this case) so pets can reach far away
|
||||
// Check UNIT_STATE_MELEE_ATTACKING or UNIT_STATE_CHASE (without UNIT_STATE_FOLLOW in this case) so pets can reach far away
|
||||
// targets without stopping half way there and running off.
|
||||
// These flags are reset after target dies or another command is given.
|
||||
if (m_HostileRefManager.isEmpty())
|
||||
@@ -518,7 +518,7 @@ bool Unit::HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint
|
||||
|
||||
void Unit::DealDamageMods(Unit* victim, uint32 &damage, uint32* absorb)
|
||||
{
|
||||
if (!victim || !victim->isAlive() || victim->HasUnitState(UNIT_STAT_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode()))
|
||||
if (!victim || !victim->isAlive() || victim->HasUnitState(UNIT_STATE_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode()))
|
||||
{
|
||||
if (absorb)
|
||||
*absorb += damage;
|
||||
@@ -1046,7 +1046,7 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage* damageInfo, bool durabilityLoss)
|
||||
if (!victim)
|
||||
return;
|
||||
|
||||
if (!victim->isAlive() || victim->HasUnitState(UNIT_STAT_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode()))
|
||||
if (!victim->isAlive() || victim->HasUnitState(UNIT_STATE_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode()))
|
||||
return;
|
||||
|
||||
SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(damageInfo->SpellID);
|
||||
@@ -1263,7 +1263,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
|
||||
{
|
||||
Unit* victim = damageInfo->target;
|
||||
|
||||
if (!victim->isAlive() || victim->HasUnitState(UNIT_STAT_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode()))
|
||||
if (!victim->isAlive() || victim->HasUnitState(UNIT_STATE_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode()))
|
||||
return;
|
||||
|
||||
// Hmmmm dont like this emotes client must by self do all animations
|
||||
@@ -1839,7 +1839,7 @@ void Unit::CalcHealAbsorb(Unit* victim, const SpellInfo* healSpell, uint32 &heal
|
||||
|
||||
void Unit::AttackerStateUpdate (Unit* victim, WeaponAttackType attType, bool extra)
|
||||
{
|
||||
if (HasUnitState(UNIT_STAT_CANNOT_AUTOATTACK) || HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED))
|
||||
if (HasUnitState(UNIT_STATE_CANNOT_AUTOATTACK) || HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED))
|
||||
return;
|
||||
|
||||
if (!victim->isAlive())
|
||||
@@ -2557,7 +2557,7 @@ uint32 Unit::GetDefenseSkillValue(Unit const* target) const
|
||||
|
||||
float Unit::GetUnitDodgeChance() const
|
||||
{
|
||||
if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STAT_CONTROLLED))
|
||||
if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STATE_CONTROLLED))
|
||||
return 0.0f;
|
||||
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -2577,7 +2577,7 @@ float Unit::GetUnitDodgeChance() const
|
||||
|
||||
float Unit::GetUnitParryChance() const
|
||||
{
|
||||
if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STAT_CONTROLLED))
|
||||
if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STATE_CONTROLLED))
|
||||
return 0.0f;
|
||||
|
||||
float chance = 0.0f;
|
||||
@@ -2623,7 +2623,7 @@ float Unit::GetUnitMissChance(WeaponAttackType attType) const
|
||||
|
||||
float Unit::GetUnitBlockChance() const
|
||||
{
|
||||
if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STAT_CONTROLLED))
|
||||
if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STATE_CONTROLLED))
|
||||
return 0.0f;
|
||||
|
||||
if (Player const* player = ToPlayer())
|
||||
@@ -2875,7 +2875,7 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell)
|
||||
InterruptSpell(CURRENT_AUTOREPEAT_SPELL);
|
||||
m_AutoRepeatFirstCast = true;
|
||||
}
|
||||
AddUnitState(UNIT_STAT_CASTING);
|
||||
AddUnitState(UNIT_STATE_CASTING);
|
||||
} break;
|
||||
|
||||
case CURRENT_CHANNELED_SPELL:
|
||||
@@ -2888,7 +2888,7 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell)
|
||||
if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL] &&
|
||||
m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != 75)
|
||||
InterruptSpell(CURRENT_AUTOREPEAT_SPELL);
|
||||
AddUnitState(UNIT_STAT_CASTING);
|
||||
AddUnitState(UNIT_STATE_CASTING);
|
||||
} break;
|
||||
|
||||
case CURRENT_AUTOREPEAT_SPELL:
|
||||
@@ -9347,16 +9347,16 @@ bool Unit::Attack(Unit* victim, bool meleeAttack)
|
||||
// switch to melee attack from ranged/magic
|
||||
if (meleeAttack)
|
||||
{
|
||||
if (!HasUnitState(UNIT_STAT_MELEE_ATTACKING))
|
||||
if (!HasUnitState(UNIT_STATE_MELEE_ATTACKING))
|
||||
{
|
||||
AddUnitState(UNIT_STAT_MELEE_ATTACKING);
|
||||
AddUnitState(UNIT_STATE_MELEE_ATTACKING);
|
||||
SendMeleeAttackStart(victim);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (HasUnitState(UNIT_STAT_MELEE_ATTACKING))
|
||||
else if (HasUnitState(UNIT_STATE_MELEE_ATTACKING))
|
||||
{
|
||||
ClearUnitState(UNIT_STAT_MELEE_ATTACKING);
|
||||
ClearUnitState(UNIT_STATE_MELEE_ATTACKING);
|
||||
SendMeleeAttackStop(victim);
|
||||
return true;
|
||||
}
|
||||
@@ -9366,7 +9366,7 @@ bool Unit::Attack(Unit* victim, bool meleeAttack)
|
||||
// switch target
|
||||
InterruptSpell(CURRENT_MELEE_SPELL);
|
||||
if (!meleeAttack)
|
||||
ClearUnitState(UNIT_STAT_MELEE_ATTACKING);
|
||||
ClearUnitState(UNIT_STATE_MELEE_ATTACKING);
|
||||
}
|
||||
|
||||
if (m_attacking)
|
||||
@@ -9379,7 +9379,7 @@ bool Unit::Attack(Unit* victim, bool meleeAttack)
|
||||
SetTarget(victim->GetGUID());
|
||||
|
||||
if (meleeAttack)
|
||||
AddUnitState(UNIT_STAT_MELEE_ATTACKING);
|
||||
AddUnitState(UNIT_STATE_MELEE_ATTACKING);
|
||||
|
||||
// set position before any AI calls/assistance
|
||||
//if (GetTypeId() == TYPEID_UNIT)
|
||||
@@ -9420,7 +9420,7 @@ bool Unit::AttackStop()
|
||||
// Clear our target
|
||||
SetTarget(0);
|
||||
|
||||
ClearUnitState(UNIT_STAT_MELEE_ATTACKING);
|
||||
ClearUnitState(UNIT_STATE_MELEE_ATTACKING);
|
||||
|
||||
InterruptSpell(CURRENT_MELEE_SPELL);
|
||||
|
||||
@@ -9463,7 +9463,7 @@ void Unit::CombatStopWithPets(bool includingCast)
|
||||
|
||||
bool Unit::isAttackingPlayer() const
|
||||
{
|
||||
if (HasUnitState(UNIT_STAT_ATTACK_PLAYER))
|
||||
if (HasUnitState(UNIT_STATE_ATTACK_PLAYER))
|
||||
return true;
|
||||
|
||||
for (ControlList::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
|
||||
@@ -11899,7 +11899,7 @@ void Unit::Dismount()
|
||||
{
|
||||
if (Pet* pPet = player->GetPet())
|
||||
{
|
||||
if (pPet->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED) && !pPet->HasUnitState(UNIT_STAT_STUNNED))
|
||||
if (pPet->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED) && !pPet->HasUnitState(UNIT_STATE_STUNNED))
|
||||
pPet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
|
||||
}
|
||||
else
|
||||
@@ -11968,7 +11968,7 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy)
|
||||
if (PvP)
|
||||
m_CombatTimer = 5000;
|
||||
|
||||
if (isInCombat() || HasUnitState(UNIT_STAT_EVADE))
|
||||
if (isInCombat() || HasUnitState(UNIT_STATE_EVADE))
|
||||
return;
|
||||
|
||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
|
||||
@@ -12021,7 +12021,7 @@ void Unit::ClearInCombat()
|
||||
if (creature->GetCreatureInfo() && creature->GetCreatureInfo()->unit_flags & UNIT_FLAG_OOC_NOT_ATTACKABLE)
|
||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); // re-apply Out of Combat Non Attackable flag if we leave combat, can be overriden in scripts in EnterEvadeMode()
|
||||
|
||||
ClearUnitState(UNIT_STAT_ATTACK_PLAYER);
|
||||
ClearUnitState(UNIT_STATE_ATTACK_PLAYER);
|
||||
if (HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED))
|
||||
SetUInt32Value(UNIT_DYNAMIC_FLAGS, creature->GetCreatureInfo()->dynamicflags);
|
||||
|
||||
@@ -12053,7 +12053,7 @@ bool Unit::isTargetableForAttack(bool checkFakeDeath) const
|
||||
if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->isGameMaster())
|
||||
return false;
|
||||
|
||||
return !HasUnitState(UNIT_STAT_UNATTACKABLE) && (!checkFakeDeath || !HasUnitState(UNIT_STAT_DIED));
|
||||
return !HasUnitState(UNIT_STATE_UNATTACKABLE) && (!checkFakeDeath || !HasUnitState(UNIT_STATE_DIED));
|
||||
}
|
||||
|
||||
bool Unit::IsValidAttackTarget(Unit const* target) const
|
||||
@@ -12071,7 +12071,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) co
|
||||
return false;
|
||||
|
||||
// can't attack unattackable units or GMs
|
||||
if (target->HasUnitState(UNIT_STAT_UNATTACKABLE)
|
||||
if (target->HasUnitState(UNIT_STATE_UNATTACKABLE)
|
||||
|| (target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->isGameMaster()))
|
||||
return false;
|
||||
|
||||
@@ -12165,7 +12165,7 @@ bool Unit::_IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) co
|
||||
return true;
|
||||
|
||||
// can't assist unattackable units or GMs
|
||||
if (target->HasUnitState(UNIT_STAT_UNATTACKABLE)
|
||||
if (target->HasUnitState(UNIT_STATE_UNATTACKABLE)
|
||||
|| (target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->isGameMaster()))
|
||||
return false;
|
||||
|
||||
@@ -14596,7 +14596,7 @@ void Unit::SendPetAIReaction(uint64 guid)
|
||||
|
||||
void Unit::StopMoving()
|
||||
{
|
||||
ClearUnitState(UNIT_STAT_MOVING);
|
||||
ClearUnitState(UNIT_STATE_MOVING);
|
||||
|
||||
// not need send any packets if not in world
|
||||
if (!IsInWorld())
|
||||
@@ -14978,16 +14978,16 @@ void Unit::SetContestedPvP(Player* attackedPlayer)
|
||||
return;
|
||||
|
||||
player->SetContestedPvPTimer(30000);
|
||||
if (!player->HasUnitState(UNIT_STAT_ATTACK_PLAYER))
|
||||
if (!player->HasUnitState(UNIT_STATE_ATTACK_PLAYER))
|
||||
{
|
||||
player->AddUnitState(UNIT_STAT_ATTACK_PLAYER);
|
||||
player->AddUnitState(UNIT_STATE_ATTACK_PLAYER);
|
||||
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP);
|
||||
// call MoveInLineOfSight for nearby contested guards
|
||||
UpdateObjectVisibility();
|
||||
}
|
||||
if (!HasUnitState(UNIT_STAT_ATTACK_PLAYER))
|
||||
if (!HasUnitState(UNIT_STATE_ATTACK_PLAYER))
|
||||
{
|
||||
AddUnitState(UNIT_STAT_ATTACK_PLAYER);
|
||||
AddUnitState(UNIT_STATE_ATTACK_PLAYER);
|
||||
// call MoveInLineOfSight for nearby contested guards
|
||||
UpdateObjectVisibility();
|
||||
}
|
||||
@@ -15555,28 +15555,28 @@ void Unit::SetControlled(bool apply, UnitState state)
|
||||
AddUnitState(state);
|
||||
switch (state)
|
||||
{
|
||||
case UNIT_STAT_STUNNED:
|
||||
case UNIT_STATE_STUNNED:
|
||||
SetStunned(true);
|
||||
CastStop();
|
||||
break;
|
||||
case UNIT_STAT_ROOT:
|
||||
if (!HasUnitState(UNIT_STAT_STUNNED))
|
||||
case UNIT_STATE_ROOT:
|
||||
if (!HasUnitState(UNIT_STATE_STUNNED))
|
||||
SetRooted(true);
|
||||
break;
|
||||
case UNIT_STAT_CONFUSED:
|
||||
if (!HasUnitState(UNIT_STAT_STUNNED))
|
||||
case UNIT_STATE_CONFUSED:
|
||||
if (!HasUnitState(UNIT_STATE_STUNNED))
|
||||
{
|
||||
ClearUnitState(UNIT_STAT_MELEE_ATTACKING);
|
||||
ClearUnitState(UNIT_STATE_MELEE_ATTACKING);
|
||||
SendMeleeAttackStop();
|
||||
// SendAutoRepeatCancel ?
|
||||
SetConfused(true);
|
||||
CastStop();
|
||||
}
|
||||
break;
|
||||
case UNIT_STAT_FLEEING:
|
||||
if (!HasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_CONFUSED))
|
||||
case UNIT_STATE_FLEEING:
|
||||
if (!HasUnitState(UNIT_STATE_STUNNED | UNIT_STATE_CONFUSED))
|
||||
{
|
||||
ClearUnitState(UNIT_STAT_MELEE_ATTACKING);
|
||||
ClearUnitState(UNIT_STATE_MELEE_ATTACKING);
|
||||
SendMeleeAttackStop();
|
||||
// SendAutoRepeatCancel ?
|
||||
SetFeared(true);
|
||||
@@ -15591,29 +15591,29 @@ void Unit::SetControlled(bool apply, UnitState state)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case UNIT_STAT_STUNNED: if (HasAuraType(SPELL_AURA_MOD_STUN)) return;
|
||||
case UNIT_STATE_STUNNED: if (HasAuraType(SPELL_AURA_MOD_STUN)) return;
|
||||
else SetStunned(false); break;
|
||||
case UNIT_STAT_ROOT: if (HasAuraType(SPELL_AURA_MOD_ROOT) || GetVehicle()) return;
|
||||
case UNIT_STATE_ROOT: if (HasAuraType(SPELL_AURA_MOD_ROOT) || GetVehicle()) return;
|
||||
else SetRooted(false); break;
|
||||
case UNIT_STAT_CONFUSED:if (HasAuraType(SPELL_AURA_MOD_CONFUSE)) return;
|
||||
case UNIT_STATE_CONFUSED:if (HasAuraType(SPELL_AURA_MOD_CONFUSE)) return;
|
||||
else SetConfused(false); break;
|
||||
case UNIT_STAT_FLEEING: if (HasAuraType(SPELL_AURA_MOD_FEAR)) return;
|
||||
case UNIT_STATE_FLEEING: if (HasAuraType(SPELL_AURA_MOD_FEAR)) return;
|
||||
else SetFeared(false); break;
|
||||
default: return;
|
||||
}
|
||||
|
||||
ClearUnitState(state);
|
||||
|
||||
if (HasUnitState(UNIT_STAT_STUNNED))
|
||||
if (HasUnitState(UNIT_STATE_STUNNED))
|
||||
SetStunned(true);
|
||||
else
|
||||
{
|
||||
if (HasUnitState(UNIT_STAT_ROOT))
|
||||
if (HasUnitState(UNIT_STATE_ROOT))
|
||||
SetRooted(true);
|
||||
|
||||
if (HasUnitState(UNIT_STAT_CONFUSED))
|
||||
if (HasUnitState(UNIT_STATE_CONFUSED))
|
||||
SetConfused(true);
|
||||
else if (HasUnitState(UNIT_STAT_FLEEING))
|
||||
else if (HasUnitState(UNIT_STATE_FLEEING))
|
||||
SetFeared(true);
|
||||
}
|
||||
}
|
||||
@@ -15655,7 +15655,7 @@ void Unit::SetStunned(bool apply)
|
||||
if (!owner || (owner->GetTypeId() == TYPEID_PLAYER && !owner->ToPlayer()->IsMounted()))
|
||||
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
|
||||
|
||||
if (!HasUnitState(UNIT_STAT_ROOT)) // prevent moving if it also has root effect
|
||||
if (!HasUnitState(UNIT_STATE_ROOT)) // prevent moving if it also has root effect
|
||||
{
|
||||
WorldPacket data(SMSG_FORCE_MOVE_UNROOT, 8+4);
|
||||
data.append(GetPackGUID());
|
||||
@@ -15697,7 +15697,7 @@ void Unit::SetRooted(bool apply)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!HasUnitState(UNIT_STAT_STUNNED)) // prevent moving if it also has stun effect
|
||||
if (!HasUnitState(UNIT_STATE_STUNNED)) // prevent moving if it also has stun effect
|
||||
{
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
@@ -15789,7 +15789,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
|
||||
return false;
|
||||
}
|
||||
|
||||
//if (HasUnitState(UNIT_STAT_UNATTACKABLE))
|
||||
//if (HasUnitState(UNIT_STATE_UNATTACKABLE))
|
||||
// return false;
|
||||
|
||||
if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->GetTransport())
|
||||
@@ -15882,7 +15882,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
|
||||
charmer->ToPlayer()->VehicleSpellInitialize();
|
||||
break;
|
||||
case CHARM_TYPE_POSSESS:
|
||||
AddUnitState(UNIT_STAT_POSSESSED);
|
||||
AddUnitState(UNIT_STATE_POSSESSED);
|
||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
|
||||
charmer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
charmer->ToPlayer()->SetClientControl(this, 1);
|
||||
@@ -15933,7 +15933,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
|
||||
}
|
||||
|
||||
CharmType type;
|
||||
if (HasUnitState(UNIT_STAT_POSSESSED))
|
||||
if (HasUnitState(UNIT_STATE_POSSESSED))
|
||||
type = CHARM_TYPE_POSSESS;
|
||||
else if (charmer && charmer->IsOnVehicle(this))
|
||||
type = CHARM_TYPE_VEHICLE;
|
||||
@@ -15951,7 +15951,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
|
||||
|
||||
if (type == CHARM_TYPE_POSSESS)
|
||||
{
|
||||
ClearUnitState(UNIT_STAT_POSSESSED);
|
||||
ClearUnitState(UNIT_STATE_POSSESSED);
|
||||
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
|
||||
}
|
||||
|
||||
@@ -16990,7 +16990,7 @@ void Unit::_ExitVehicle(Position const* exitPosition)
|
||||
Vehicle* vehicle = m_vehicle;
|
||||
m_vehicle = NULL;
|
||||
|
||||
SetControlled(false, UNIT_STAT_ROOT); // SMSG_MOVE_FORCE_UNROOT, ~MOVEMENTFLAG_ROOT
|
||||
SetControlled(false, UNIT_STATE_ROOT); // SMSG_MOVE_FORCE_UNROOT, ~MOVEMENTFLAG_ROOT
|
||||
|
||||
Position pos;
|
||||
if (!exitPosition) // Exit position not specified
|
||||
@@ -16998,7 +16998,7 @@ void Unit::_ExitVehicle(Position const* exitPosition)
|
||||
else
|
||||
pos = *exitPosition;
|
||||
|
||||
AddUnitState(UNIT_STAT_MOVE);
|
||||
AddUnitState(UNIT_STATE_MOVE);
|
||||
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
ToPlayer()->SetFallInformation(0, GetPositionZ());
|
||||
@@ -17390,7 +17390,7 @@ bool CharmInfo::IsReturning()
|
||||
|
||||
void Unit::SetInFront(Unit const* target)
|
||||
{
|
||||
if (!HasUnitState(UNIT_STAT_CANNOT_TURN))
|
||||
if (!HasUnitState(UNIT_STATE_CANNOT_TURN))
|
||||
SetOrientation(GetAngle(target));
|
||||
}
|
||||
|
||||
|
||||
@@ -469,46 +469,46 @@ enum DeathState
|
||||
|
||||
enum UnitState
|
||||
{
|
||||
UNIT_STAT_DIED = 0x00000001, // player has fake death aura
|
||||
UNIT_STAT_MELEE_ATTACKING = 0x00000002, // player is melee attacking someone
|
||||
//UNIT_STAT_MELEE_ATTACK_BY = 0x00000004, // player is melee attack by someone
|
||||
UNIT_STAT_STUNNED = 0x00000008,
|
||||
UNIT_STAT_ROAMING = 0x00000010,
|
||||
UNIT_STAT_CHASE = 0x00000020,
|
||||
//UNIT_STAT_SEARCHING = 0x00000040,
|
||||
UNIT_STAT_FLEEING = 0x00000080,
|
||||
UNIT_STAT_IN_FLIGHT = 0x00000100, // player is in flight mode
|
||||
UNIT_STAT_FOLLOW = 0x00000200,
|
||||
UNIT_STAT_ROOT = 0x00000400,
|
||||
UNIT_STAT_CONFUSED = 0x00000800,
|
||||
UNIT_STAT_DISTRACTED = 0x00001000,
|
||||
UNIT_STAT_ISOLATED = 0x00002000, // area auras do not affect other players
|
||||
UNIT_STAT_ATTACK_PLAYER = 0x00004000,
|
||||
UNIT_STAT_CASTING = 0x00008000,
|
||||
UNIT_STAT_POSSESSED = 0x00010000,
|
||||
UNIT_STAT_CHARGING = 0x00020000,
|
||||
UNIT_STAT_JUMPING = 0x00040000,
|
||||
UNIT_STAT_ONVEHICLE = 0x00080000,
|
||||
UNIT_STAT_MOVE = 0x00100000,
|
||||
UNIT_STAT_ROTATING = 0x00200000,
|
||||
UNIT_STAT_EVADE = 0x00400000,
|
||||
UNIT_STAT_ROAMING_MOVE = 0x00800000,
|
||||
UNIT_STAT_CONFUSED_MOVE = 0x01000000,
|
||||
UNIT_STAT_FLEEING_MOVE = 0x02000000,
|
||||
UNIT_STAT_CHASE_MOVE = 0x04000000,
|
||||
UNIT_STAT_FOLLOW_MOVE = 0x08000000,
|
||||
UNIT_STAT_UNATTACKABLE = (UNIT_STAT_IN_FLIGHT | UNIT_STAT_ONVEHICLE),
|
||||
//UNIT_STAT_MOVING = (UNIT_STAT_ROAMING | UNIT_STAT_CHASE),
|
||||
UNIT_STATE_DIED = 0x00000001, // player has fake death aura
|
||||
UNIT_STATE_MELEE_ATTACKING = 0x00000002, // player is melee attacking someone
|
||||
//UNIT_STATE_MELEE_ATTACK_BY = 0x00000004, // player is melee attack by someone
|
||||
UNIT_STATE_STUNNED = 0x00000008,
|
||||
UNIT_STATE_ROAMING = 0x00000010,
|
||||
UNIT_STATE_CHASE = 0x00000020,
|
||||
//UNIT_STATE_SEARCHING = 0x00000040,
|
||||
UNIT_STATE_FLEEING = 0x00000080,
|
||||
UNIT_STATE_IN_FLIGHT = 0x00000100, // player is in flight mode
|
||||
UNIT_STATE_FOLLOW = 0x00000200,
|
||||
UNIT_STATE_ROOT = 0x00000400,
|
||||
UNIT_STATE_CONFUSED = 0x00000800,
|
||||
UNIT_STATE_DISTRACTED = 0x00001000,
|
||||
UNIT_STATE_ISOLATED = 0x00002000, // area auras do not affect other players
|
||||
UNIT_STATE_ATTACK_PLAYER = 0x00004000,
|
||||
UNIT_STATE_CASTING = 0x00008000,
|
||||
UNIT_STATE_POSSESSED = 0x00010000,
|
||||
UNIT_STATE_CHARGING = 0x00020000,
|
||||
UNIT_STATE_JUMPING = 0x00040000,
|
||||
UNIT_STATE_ONVEHICLE = 0x00080000,
|
||||
UNIT_STATE_MOVE = 0x00100000,
|
||||
UNIT_STATE_ROTATING = 0x00200000,
|
||||
UNIT_STATE_EVADE = 0x00400000,
|
||||
UNIT_STATE_ROAMING_MOVE = 0x00800000,
|
||||
UNIT_STATE_CONFUSED_MOVE = 0x01000000,
|
||||
UNIT_STATE_FLEEING_MOVE = 0x02000000,
|
||||
UNIT_STATE_CHASE_MOVE = 0x04000000,
|
||||
UNIT_STATE_FOLLOW_MOVE = 0x08000000,
|
||||
UNIT_STATE_UNATTACKABLE = (UNIT_STATE_IN_FLIGHT | UNIT_STATE_ONVEHICLE),
|
||||
//UNIT_STATE_MOVING = (UNIT_STATE_ROAMING | UNIT_STATE_CHASE),
|
||||
// for real move using movegen check and stop (except unstoppable flight)
|
||||
UNIT_STAT_MOVING = UNIT_STAT_ROAMING_MOVE | UNIT_STAT_CONFUSED_MOVE | UNIT_STAT_FLEEING_MOVE| UNIT_STAT_CHASE_MOVE | UNIT_STAT_FOLLOW_MOVE ,
|
||||
UNIT_STAT_CONTROLLED = (UNIT_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING),
|
||||
UNIT_STAT_LOST_CONTROL = (UNIT_STAT_CONTROLLED | UNIT_STAT_JUMPING | UNIT_STAT_CHARGING),
|
||||
UNIT_STAT_SIGHTLESS = (UNIT_STAT_LOST_CONTROL | UNIT_STAT_EVADE),
|
||||
UNIT_STAT_CANNOT_AUTOATTACK = (UNIT_STAT_LOST_CONTROL | UNIT_STAT_CASTING),
|
||||
UNIT_STAT_CANNOT_TURN = (UNIT_STAT_LOST_CONTROL | UNIT_STAT_ROTATING),
|
||||
UNIT_STATE_MOVING = UNIT_STATE_ROAMING_MOVE | UNIT_STATE_CONFUSED_MOVE | UNIT_STATE_FLEEING_MOVE| UNIT_STATE_CHASE_MOVE | UNIT_STATE_FOLLOW_MOVE ,
|
||||
UNIT_STATE_CONTROLLED = (UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING),
|
||||
UNIT_STATE_LOST_CONTROL = (UNIT_STATE_CONTROLLED | UNIT_STATE_JUMPING | UNIT_STATE_CHARGING),
|
||||
UNIT_STATE_SIGHTLESS = (UNIT_STATE_LOST_CONTROL | UNIT_STATE_EVADE),
|
||||
UNIT_STATE_CANNOT_AUTOATTACK = (UNIT_STATE_LOST_CONTROL | UNIT_STATE_CASTING),
|
||||
UNIT_STATE_CANNOT_TURN = (UNIT_STATE_LOST_CONTROL | UNIT_STATE_ROTATING),
|
||||
// stay by different reasons
|
||||
UNIT_STAT_NOT_MOVE = UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DIED | UNIT_STAT_DISTRACTED,
|
||||
UNIT_STAT_ALL_STATE = 0xffffffff //(UNIT_STAT_STOPPED | UNIT_STAT_MOVING | UNIT_STAT_IN_COMBAT | UNIT_STAT_IN_FLIGHT)
|
||||
UNIT_STATE_NOT_MOVE = UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DIED | UNIT_STATE_DISTRACTED,
|
||||
UNIT_STATE_ALL_STATE = 0xffffffff //(UNIT_STATE_STOPPED | UNIT_STATE_MOVING | UNIT_STATE_IN_COMBAT | UNIT_STATE_IN_FLIGHT)
|
||||
};
|
||||
|
||||
enum UnitMoveType
|
||||
@@ -1289,8 +1289,8 @@ class Unit : public WorldObject
|
||||
void ClearUnitState(uint32 f) { m_state &= ~f; }
|
||||
bool CanFreeMove() const
|
||||
{
|
||||
return !HasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_FLEEING | UNIT_STAT_IN_FLIGHT |
|
||||
UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED) && GetOwnerGUID() == 0;
|
||||
return !HasUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_FLEEING | UNIT_STATE_IN_FLIGHT |
|
||||
UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED) && GetOwnerGUID() == 0;
|
||||
}
|
||||
|
||||
uint32 HasUnitTypeMask(uint32 mask) const { return mask & m_unitTypeMask; }
|
||||
@@ -1525,7 +1525,7 @@ class Unit : public WorldObject
|
||||
}
|
||||
bool isSpiritService() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITHEALER | UNIT_NPC_FLAG_SPIRITGUIDE); }
|
||||
|
||||
bool isInFlight() const { return HasUnitState(UNIT_STAT_IN_FLIGHT); }
|
||||
bool isInFlight() const { return HasUnitState(UNIT_STATE_IN_FLIGHT); }
|
||||
|
||||
bool isInCombat() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); }
|
||||
void CombatStart(Unit* target, bool initialAggro = true);
|
||||
@@ -1682,8 +1682,8 @@ class Unit : public WorldObject
|
||||
void RemoveAllControlled();
|
||||
|
||||
bool isCharmed() const { return GetCharmerGUID() != 0; }
|
||||
bool isPossessed() const { return HasUnitState(UNIT_STAT_POSSESSED); }
|
||||
bool isPossessedByPlayer() const { return HasUnitState(UNIT_STAT_POSSESSED) && IS_PLAYER_GUID(GetCharmerGUID()); }
|
||||
bool isPossessed() const { return HasUnitState(UNIT_STATE_POSSESSED); }
|
||||
bool isPossessedByPlayer() const { return HasUnitState(UNIT_STATE_POSSESSED) && IS_PLAYER_GUID(GetCharmerGUID()); }
|
||||
bool isPossessing() const
|
||||
{
|
||||
if (Unit* u = GetCharm())
|
||||
@@ -2048,7 +2048,7 @@ class Unit : public WorldObject
|
||||
MotionMaster* GetMotionMaster() { return &i_motionMaster; }
|
||||
const MotionMaster* GetMotionMaster() const { return &i_motionMaster; }
|
||||
|
||||
bool IsStopped() const { return !(HasUnitState(UNIT_STAT_MOVING)); }
|
||||
bool IsStopped() const { return !(HasUnitState(UNIT_STATE_MOVING)); }
|
||||
void StopMoving();
|
||||
|
||||
void AddUnitMovementFlag(uint32 f) { m_movementInfo.flags |= f; }
|
||||
|
||||
@@ -176,7 +176,7 @@ void Vehicle::ApplyAllImmunities()
|
||||
case 160: // Strand of the Ancients
|
||||
case 244: // Wintergrasp
|
||||
case 510: // Isle of Conquest
|
||||
_me->SetControlled(true, UNIT_STAT_ROOT);
|
||||
_me->SetControlled(true, UNIT_STATE_ROOT);
|
||||
// why we need to apply this? we can simple add immunities to slow mechanic in DB
|
||||
_me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_DECREASE_SPEED, true);
|
||||
break;
|
||||
@@ -342,7 +342,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId)
|
||||
}
|
||||
|
||||
if (seat->second.SeatInfo->m_flags && !(seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_UNK1))
|
||||
unit->AddUnitState(UNIT_STAT_ONVEHICLE);
|
||||
unit->AddUnitState(UNIT_STATE_ONVEHICLE);
|
||||
|
||||
unit->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
|
||||
VehicleSeatEntry const* veSeat = seat->second.SeatInfo;
|
||||
@@ -364,7 +364,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId)
|
||||
if (_me->IsInWorld())
|
||||
{
|
||||
unit->SendClearTarget(); // SMSG_BREAK_TARGET
|
||||
unit->SetControlled(true, UNIT_STAT_ROOT); // SMSG_FORCE_ROOT - In some cases we send SMSG_SPLINE_MOVE_ROOT here (for creatures)
|
||||
unit->SetControlled(true, UNIT_STATE_ROOT); // SMSG_FORCE_ROOT - In some cases we send SMSG_SPLINE_MOVE_ROOT here (for creatures)
|
||||
// also adds MOVEMENTFLAG_ROOT
|
||||
unit->SendMonsterMoveTransport(_me); // SMSG_MONSTER_MOVE_TRANSPORT
|
||||
|
||||
@@ -407,7 +407,7 @@ void Vehicle::RemovePassenger(Unit* unit)
|
||||
++_usableSeatNum;
|
||||
}
|
||||
|
||||
unit->ClearUnitState(UNIT_STAT_ONVEHICLE);
|
||||
unit->ClearUnitState(UNIT_STATE_ONVEHICLE);
|
||||
|
||||
if (_me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER && seat->first == 0 && seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_CAN_CONTROL)
|
||||
_me->RemoveCharmedBy(unit);
|
||||
|
||||
@@ -113,7 +113,7 @@ inline void CreatureUnitRelocationWorker(Creature* c, Unit* u)
|
||||
if (!u->isAlive() || !c->isAlive() || c == u || u->isInFlight())
|
||||
return;
|
||||
|
||||
if (c->HasReactState(REACT_AGGRESSIVE) && !c->HasUnitState(UNIT_STAT_SIGHTLESS))
|
||||
if (c->HasReactState(REACT_AGGRESSIVE) && !c->HasUnitState(UNIT_STATE_SIGHTLESS))
|
||||
if (c->IsAIEnabled && c->canSeeOrDetect(u, false, true))
|
||||
c->AI()->MoveInLineOfSight_Safe(u);
|
||||
}
|
||||
|
||||
@@ -746,7 +746,7 @@ namespace Trinity
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
if (u->isAlive() && u->isInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
|
||||
(u->isFeared() || u->isCharmed() || u->isFrozen() || u->HasUnitState(UNIT_STAT_STUNNED) || u->HasUnitState(UNIT_STAT_CONFUSED)))
|
||||
(u->isFeared() || u->isCharmed() || u->isFrozen() || u->HasUnitState(UNIT_STATE_STUNNED) || u->HasUnitState(UNIT_STATE_CONFUSED)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ void WorldSession::HandleAuctionHelloOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
SendAuctionHello(guid, unit);
|
||||
@@ -161,7 +161,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
Item* it = player->GetItemByGuid(item);
|
||||
@@ -274,7 +274,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
|
||||
@@ -394,7 +394,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
|
||||
@@ -482,7 +482,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
|
||||
@@ -531,7 +531,7 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
|
||||
@@ -586,7 +586,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
|
||||
|
||||
@@ -1004,7 +1004,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
|
||||
sLog->outChar("Account: %d (IP: %s) Login Character:[%s] (GUID: %u)",
|
||||
GetAccountId(), IP_str.c_str(), pCurrChar->GetName(), pCurrChar->GetGUIDLow());
|
||||
|
||||
if (!pCurrChar->IsStandState() && !pCurrChar->HasUnitState(UNIT_STAT_STUNNED))
|
||||
if (!pCurrChar->IsStandState() && !pCurrChar->HasUnitState(UNIT_STATE_STUNNED))
|
||||
pCurrChar->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
|
||||
m_playerLoading = false;
|
||||
|
||||
@@ -481,7 +481,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
|
||||
|
||||
void WorldSession::HandleEmoteOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
if (!GetPlayer()->isAlive() || GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (!GetPlayer()->isAlive() || GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
return;
|
||||
|
||||
uint32 emote;
|
||||
@@ -558,7 +558,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket & recv_data)
|
||||
break;
|
||||
default:
|
||||
// Only allow text-emotes for "dead" entities (feign death included)
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
break;
|
||||
GetPlayer()->HandleEmoteCommand(emote_anim);
|
||||
break;
|
||||
|
||||
@@ -303,7 +303,7 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket)
|
||||
if (GetPlayer()->GetNPCIfCanInteractWith(vendorGuid, UNIT_NPC_FLAG_TABARDDESIGNER))
|
||||
{
|
||||
// Remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
if (Guild* guild = _GetPlayerGuild(this))
|
||||
|
||||
@@ -503,7 +503,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
Item* pItem = _player->GetItemByGuid(itemguid);
|
||||
@@ -614,7 +614,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
Item* pItem = _player->GetItemFromBuyBackSlot(slot);
|
||||
@@ -732,11 +732,11 @@ void WorldSession::SendListInventory(uint64 vendorGuid)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
// Stop the npc if moving
|
||||
if (vendor->HasUnitState(UNIT_STAT_MOVING))
|
||||
if (vendor->HasUnitState(UNIT_STATE_MOVING))
|
||||
vendor->StopMoving();
|
||||
|
||||
VendorItemData const* items = vendor->GetVendorItems();
|
||||
|
||||
@@ -122,7 +122,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
if ((unit && unit->GetCreatureInfo()->ScriptID != unit->LastUsedScriptID) || (go && go->GetGOInfo()->ScriptId != go->LastUsedScriptID))
|
||||
|
||||
@@ -60,7 +60,7 @@ void WorldSession::HandleTabardVendorActivateOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
SendTabardVendorActivate(guid);
|
||||
@@ -89,7 +89,7 @@ void WorldSession::HandleBankerActivateOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
SendShowBank(guid);
|
||||
@@ -128,7 +128,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
// trainer list loaded at check;
|
||||
@@ -250,7 +250,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
if (!unit->isCanTrainingOf(_player, true))
|
||||
@@ -314,7 +314,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data)
|
||||
|
||||
GetPlayer()->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK);
|
||||
// remove fake death
|
||||
//if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
//if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
// GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
if (unit->isArmorer() || unit->isCivilian() || unit->isQuestGiver() || unit->isServiceProvider() || unit->isGuard())
|
||||
@@ -369,7 +369,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
if (!code.empty())
|
||||
@@ -400,7 +400,7 @@ void WorldSession::HandleSpiritHealerActivateOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
SendSpiritResurrect();
|
||||
@@ -455,7 +455,7 @@ void WorldSession::HandleBinderActivateOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
SendBindPoint(unit);
|
||||
@@ -507,7 +507,7 @@ void WorldSession::HandleListStabledPetsOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
// remove mounts this fix bug where getting pet from stable while mounted deletes pet.
|
||||
@@ -609,7 +609,7 @@ void WorldSession::HandleStablePet(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
Pet* pet = _player->GetPet();
|
||||
@@ -679,7 +679,7 @@ void WorldSession::HandleUnstablePet(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_ENTRY);
|
||||
@@ -759,7 +759,7 @@ void WorldSession::HandleBuyStableSlot(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
if (GetPlayer()->m_stableSlots < MAX_PET_STABLES)
|
||||
@@ -798,7 +798,7 @@ void WorldSession::HandleStableSwapPet(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
Pet* pet = _player->GetPet();
|
||||
@@ -886,7 +886,7 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
// reputation discount
|
||||
|
||||
@@ -202,7 +202,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid
|
||||
return;
|
||||
}
|
||||
|
||||
pet->ClearUnitState(UNIT_STAT_FOLLOW);
|
||||
pet->ClearUnitState(UNIT_STATE_FOLLOW);
|
||||
// This is true if pet has no target or has target but targets differs.
|
||||
if (pet->getVictim() != TargetUnit || (pet->getVictim() == TargetUnit && !pet->GetCharmInfo()->IsCommandAttack()))
|
||||
{
|
||||
@@ -777,7 +777,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket)
|
||||
targets.Read(recvPacket, caster);
|
||||
HandleClientCastFlags(recvPacket, castFlags, targets);
|
||||
|
||||
caster->ClearUnitState(UNIT_STAT_FOLLOW);
|
||||
caster->ClearUnitState(UNIT_STATE_FOLLOW);
|
||||
|
||||
Spell* spell = new Spell(caster, spellInfo, TRIGGERED_NONE);
|
||||
spell->m_cast_count = castCount; // probably pending spell cast
|
||||
|
||||
@@ -98,7 +98,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
uint32 charterid = 0;
|
||||
|
||||
@@ -95,7 +95,7 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
// Stop the npc if moving
|
||||
creature->StopMoving();
|
||||
|
||||
@@ -68,7 +68,7 @@ void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
if (!(_player->resetTalents()))
|
||||
|
||||
@@ -79,7 +79,7 @@ void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
// unknown taxi node case
|
||||
@@ -118,7 +118,7 @@ void WorldSession::SendTaxiMenu(Creature* unit)
|
||||
void WorldSession::SendDoFlight(uint32 mountDisplayId, uint32 path, uint32 pathNode)
|
||||
{
|
||||
// remove fake death
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
while (GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE)
|
||||
|
||||
@@ -561,7 +561,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_STUNNED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_STUNNED))
|
||||
{
|
||||
SendTradeStatus(TRADE_STATUS_YOU_STUNNED);
|
||||
return;
|
||||
@@ -611,7 +611,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
if (pOther->HasUnitState(UNIT_STAT_STUNNED))
|
||||
if (pOther->HasUnitState(UNIT_STATE_STUNNED))
|
||||
{
|
||||
SendTradeStatus(TRADE_STATUS_TARGET_STUNNED);
|
||||
return;
|
||||
|
||||
@@ -80,7 +80,7 @@ void MotionMaster::UpdateMotion(uint32 diff)
|
||||
if (!i_owner)
|
||||
return;
|
||||
|
||||
if (i_owner->HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) // what about UNIT_STAT_DISTRACTED? Why is this not included?
|
||||
if (i_owner->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) // what about UNIT_STATE_DISTRACTED? Why is this not included?
|
||||
return;
|
||||
|
||||
ASSERT(!empty());
|
||||
@@ -237,7 +237,7 @@ void MotionMaster::MoveChase(Unit* target, float dist, float angle)
|
||||
if (!target || target == i_owner || i_owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE))
|
||||
return;
|
||||
|
||||
//i_owner->ClearUnitState(UNIT_STAT_FOLLOW);
|
||||
//i_owner->ClearUnitState(UNIT_STATE_FOLLOW);
|
||||
if (i_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
sLog->outStaticDebug("Player (GUID: %u) chase to %s (GUID: %u)",
|
||||
@@ -262,7 +262,7 @@ void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlo
|
||||
if (!target || target == i_owner || i_owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE))
|
||||
return;
|
||||
|
||||
//i_owner->AddUnitState(UNIT_STAT_FOLLOW);
|
||||
//i_owner->AddUnitState(UNIT_STATE_FOLLOW);
|
||||
if (i_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
sLog->outStaticDebug("Player (GUID: %u) follow to %s (GUID: %u)", i_owner->GetGUIDLow(),
|
||||
|
||||
@@ -71,7 +71,7 @@ void ConfusedMovementGenerator<T>::Initialize(T &unit)
|
||||
|
||||
unit.StopMoving();
|
||||
unit.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
|
||||
unit.AddUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_CONFUSED_MOVE);
|
||||
unit.AddUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE);
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -94,19 +94,19 @@ void ConfusedMovementGenerator<T>::Reset(T &unit)
|
||||
i_nextMove = 1;
|
||||
i_nextMoveTime.Reset(0);
|
||||
unit.StopMoving();
|
||||
unit.AddUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_CONFUSED_MOVE);
|
||||
unit.AddUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
bool ConfusedMovementGenerator<T>::Update(T &unit, const uint32 &diff)
|
||||
{
|
||||
if (unit.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
|
||||
if (unit.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED))
|
||||
return true;
|
||||
|
||||
if (i_nextMoveTime.Passed())
|
||||
{
|
||||
// currently moving, update location
|
||||
unit.AddUnitState(UNIT_STAT_CONFUSED_MOVE);
|
||||
unit.AddUnitState(UNIT_STATE_CONFUSED_MOVE);
|
||||
|
||||
if (unit.movespline->Finalized())
|
||||
{
|
||||
@@ -121,7 +121,7 @@ bool ConfusedMovementGenerator<T>::Update(T &unit, const uint32 &diff)
|
||||
if(i_nextMoveTime.Passed() )
|
||||
{
|
||||
// start moving
|
||||
unit.AddUnitState(UNIT_STAT_CONFUSED_MOVE);
|
||||
unit.AddUnitState(UNIT_STATE_CONFUSED_MOVE);
|
||||
|
||||
ASSERT( i_nextMove <= MAX_CONF_WAYPOINTS );
|
||||
float x = i_waypoints[i_nextMove][0];
|
||||
@@ -141,14 +141,14 @@ template<>
|
||||
void ConfusedMovementGenerator<Player>::Finalize(Player &unit)
|
||||
{
|
||||
unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
|
||||
unit.ClearUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_CONFUSED_MOVE);
|
||||
unit.ClearUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE);
|
||||
}
|
||||
|
||||
template<>
|
||||
void ConfusedMovementGenerator<Creature>::Finalize(Creature &unit)
|
||||
{
|
||||
unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
|
||||
unit.ClearUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_CONFUSED_MOVE);
|
||||
unit.ClearUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE);
|
||||
if (unit.getVictim())
|
||||
unit.SetTarget(unit.getVictim()->GetGUID());
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ FleeingMovementGenerator<T>::_setTargetLocation(T &owner)
|
||||
if (!&owner)
|
||||
return;
|
||||
|
||||
if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED))
|
||||
if (owner.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
|
||||
return;
|
||||
|
||||
if (!_setMoveData(owner))
|
||||
@@ -44,7 +44,7 @@ FleeingMovementGenerator<T>::_setTargetLocation(T &owner)
|
||||
if (!_getPoint(owner, x, y, z))
|
||||
return;
|
||||
|
||||
owner.AddUnitState(UNIT_STAT_FLEEING_MOVE);
|
||||
owner.AddUnitState(UNIT_STATE_FLEEING_MOVE);
|
||||
|
||||
Movement::MoveSplineInit init(owner);
|
||||
init.MoveTo(x,y,z);
|
||||
@@ -287,7 +287,7 @@ FleeingMovementGenerator<T>::Initialize(T &owner)
|
||||
return;
|
||||
|
||||
owner.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
|
||||
owner.AddUnitState(UNIT_STAT_FLEEING|UNIT_STAT_FLEEING_MOVE);
|
||||
owner.AddUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE);
|
||||
|
||||
_Init(owner);
|
||||
|
||||
@@ -335,14 +335,14 @@ template<>
|
||||
void FleeingMovementGenerator<Player>::Finalize(Player &owner)
|
||||
{
|
||||
owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
|
||||
owner.ClearUnitState(UNIT_STAT_FLEEING|UNIT_STAT_FLEEING_MOVE);
|
||||
owner.ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE);
|
||||
}
|
||||
|
||||
template<>
|
||||
void FleeingMovementGenerator<Creature>::Finalize(Creature &owner)
|
||||
{
|
||||
owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
|
||||
owner.ClearUnitState(UNIT_STAT_FLEEING|UNIT_STAT_FLEEING_MOVE);
|
||||
owner.ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE);
|
||||
if (owner.getVictim())
|
||||
owner.SetTarget(owner.getVictim()->GetGUID());
|
||||
}
|
||||
@@ -359,9 +359,9 @@ FleeingMovementGenerator<T>::Update(T &owner, const uint32 &time_diff)
|
||||
{
|
||||
if (!&owner || !owner.isAlive())
|
||||
return false;
|
||||
if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED))
|
||||
if (owner.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
|
||||
{
|
||||
owner.ClearUnitState(UNIT_STAT_FLEEING_MOVE);
|
||||
owner.ClearUnitState(UNIT_STATE_FLEEING_MOVE);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -388,7 +388,7 @@ template bool FleeingMovementGenerator<Creature>::Update(Creature &, const uint3
|
||||
void TimedFleeingMovementGenerator::Finalize(Unit &owner)
|
||||
{
|
||||
owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
|
||||
owner.ClearUnitState(UNIT_STAT_FLEEING|UNIT_STAT_FLEEING_MOVE);
|
||||
owner.ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE);
|
||||
if (Unit* victim = owner.getVictim())
|
||||
{
|
||||
if (owner.isAlive())
|
||||
@@ -404,9 +404,9 @@ bool TimedFleeingMovementGenerator::Update(Unit & owner, const uint32 time_diff)
|
||||
if (!owner.isAlive())
|
||||
return false;
|
||||
|
||||
if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED))
|
||||
if (owner.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
|
||||
{
|
||||
owner.ClearUnitState(UNIT_STAT_FLEEING_MOVE);
|
||||
owner.ClearUnitState(UNIT_STATE_FLEEING_MOVE);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
void HomeMovementGenerator<Creature>::Initialize(Creature & owner)
|
||||
{
|
||||
owner.AddUnitState(UNIT_STAT_EVADE);
|
||||
owner.AddUnitState(UNIT_STATE_EVADE);
|
||||
_setTargetLocation(owner);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ void HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner)
|
||||
if (!&owner)
|
||||
return;
|
||||
|
||||
if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
|
||||
if (owner.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED))
|
||||
return;
|
||||
|
||||
Movement::MoveSplineInit init(owner);
|
||||
@@ -54,7 +54,7 @@ void HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner)
|
||||
init.Launch();
|
||||
|
||||
arrived = false;
|
||||
owner.ClearUnitState(UNIT_STAT_ALL_STATE & ~UNIT_STAT_EVADE);
|
||||
owner.ClearUnitState(UNIT_STATE_ALL_STATE & ~UNIT_STATE_EVADE);
|
||||
}
|
||||
|
||||
bool HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32 time_diff)
|
||||
@@ -67,7 +67,7 @@ void HomeMovementGenerator<Creature>::Finalize(Creature& owner)
|
||||
{
|
||||
if (arrived)
|
||||
{
|
||||
owner.ClearUnitState(UNIT_STAT_EVADE);
|
||||
owner.ClearUnitState(UNIT_STATE_EVADE);
|
||||
owner.SetWalk(true);
|
||||
owner.LoadCreaturesAddon(true);
|
||||
owner.AI()->JustReachedHome();
|
||||
|
||||
@@ -32,19 +32,19 @@ void IdleMovementGenerator::Initialize(Unit &owner)
|
||||
void
|
||||
IdleMovementGenerator::Reset(Unit& owner)
|
||||
{
|
||||
if (owner.HasUnitState(UNIT_STAT_MOVE))
|
||||
if (owner.HasUnitState(UNIT_STATE_MOVE))
|
||||
owner.StopMoving();
|
||||
}
|
||||
|
||||
void RotateMovementGenerator::Initialize(Unit& owner)
|
||||
{
|
||||
if (owner.HasUnitState(UNIT_STAT_MOVE))
|
||||
if (owner.HasUnitState(UNIT_STATE_MOVE))
|
||||
owner.StopMoving();
|
||||
|
||||
if (owner.getVictim())
|
||||
owner.SetInFront(owner.getVictim());
|
||||
|
||||
owner.AddUnitState(UNIT_STAT_ROTATING);
|
||||
owner.AddUnitState(UNIT_STATE_ROTATING);
|
||||
|
||||
owner.AttackStop();
|
||||
}
|
||||
@@ -75,7 +75,7 @@ bool RotateMovementGenerator::Update(Unit& owner, const uint32 diff)
|
||||
|
||||
void RotateMovementGenerator::Finalize(Unit &unit)
|
||||
{
|
||||
unit.ClearUnitState(UNIT_STAT_ROTATING);
|
||||
unit.ClearUnitState(UNIT_STATE_ROTATING);
|
||||
if (unit.GetTypeId() == TYPEID_UNIT)
|
||||
unit.ToCreature()->AI()->MovementInform(ROTATE_MOTION_TYPE, 0);
|
||||
}
|
||||
@@ -83,13 +83,13 @@ void RotateMovementGenerator::Finalize(Unit &unit)
|
||||
void
|
||||
DistractMovementGenerator::Initialize(Unit& owner)
|
||||
{
|
||||
owner.AddUnitState(UNIT_STAT_DISTRACTED);
|
||||
owner.AddUnitState(UNIT_STATE_DISTRACTED);
|
||||
}
|
||||
|
||||
void
|
||||
DistractMovementGenerator::Finalize(Unit& owner)
|
||||
{
|
||||
owner.ClearUnitState(UNIT_STAT_DISTRACTED);
|
||||
owner.ClearUnitState(UNIT_STATE_DISTRACTED);
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -105,7 +105,7 @@ DistractMovementGenerator::Update(Unit& /*owner*/, const uint32 time_diff)
|
||||
void
|
||||
AssistanceDistractMovementGenerator::Finalize(Unit &unit)
|
||||
{
|
||||
unit.ClearUnitState(UNIT_STAT_DISTRACTED);
|
||||
unit.ClearUnitState(UNIT_STATE_DISTRACTED);
|
||||
unit.ToCreature()->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ void PointMovementGenerator<T>::Initialize(T &unit)
|
||||
if (!unit.IsStopped())
|
||||
unit.StopMoving();
|
||||
|
||||
unit.AddUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE);
|
||||
unit.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
|
||||
Movement::MoveSplineInit init(unit);
|
||||
init.MoveTo(i_x, i_y, i_z);
|
||||
if (speed > 0.0f)
|
||||
@@ -46,20 +46,20 @@ bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff)
|
||||
if (!&unit)
|
||||
return false;
|
||||
|
||||
if(unit.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED))
|
||||
if(unit.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
|
||||
{
|
||||
unit.ClearUnitState(UNIT_STAT_ROAMING_MOVE);
|
||||
unit.ClearUnitState(UNIT_STATE_ROAMING_MOVE);
|
||||
return true;
|
||||
}
|
||||
|
||||
unit.AddUnitState(UNIT_STAT_ROAMING_MOVE);
|
||||
unit.AddUnitState(UNIT_STATE_ROAMING_MOVE);
|
||||
return !unit.movespline->Finalized();
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void PointMovementGenerator<T>:: Finalize(T &unit)
|
||||
{
|
||||
unit.ClearUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE);
|
||||
unit.ClearUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
|
||||
|
||||
if (unit.movespline->Finalized())
|
||||
MovementInform(unit);
|
||||
@@ -71,7 +71,7 @@ void PointMovementGenerator<T>::Reset(T &unit)
|
||||
if (!unit.IsStopped())
|
||||
unit.StopMoving();
|
||||
|
||||
unit.AddUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE);
|
||||
unit.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@@ -120,7 +120,7 @@ void EffectMovementGenerator::Finalize(Unit &unit)
|
||||
if (((Creature&)unit).AI() && unit.movespline->Finalized())
|
||||
((Creature&)unit).AI()->MovementInform(EFFECT_MOTION_TYPE, m_Id);
|
||||
// Need restore previous movement since we have no proper states system
|
||||
//if (unit.isAlive() && !unit.HasUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_FLEEING))
|
||||
//if (unit.isAlive() && !unit.HasUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_FLEEING))
|
||||
//{
|
||||
// if (Unit * victim = unit.getVictim())
|
||||
// unit.GetMotionMaster()->MoveChase(victim);
|
||||
|
||||
@@ -102,7 +102,7 @@ void RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature)
|
||||
else
|
||||
i_nextMoveTime.Reset(urand(500, 10000));
|
||||
|
||||
creature.AddUnitState(UNIT_STAT_ROAMING_MOVE);
|
||||
creature.AddUnitState(UNIT_STATE_ROAMING_MOVE);
|
||||
|
||||
Movement::MoveSplineInit init(creature);
|
||||
init.MoveTo(destX, destY, destZ);
|
||||
@@ -123,7 +123,7 @@ void RandomMovementGenerator<Creature>::Initialize(Creature &creature)
|
||||
if (!wander_distance)
|
||||
wander_distance = creature.GetRespawnRadius();
|
||||
|
||||
creature.AddUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE);
|
||||
creature.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
|
||||
_setRandomLocation(creature);
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ RandomMovementGenerator<Creature>::Reset(Creature &creature)
|
||||
template<>
|
||||
void RandomMovementGenerator<Creature>::Finalize(Creature &creature)
|
||||
{
|
||||
creature.ClearUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE);
|
||||
creature.ClearUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
|
||||
creature.SetWalk(false);
|
||||
}
|
||||
|
||||
@@ -145,10 +145,10 @@ template<>
|
||||
bool
|
||||
RandomMovementGenerator<Creature>::Update(Creature &creature, const uint32 diff)
|
||||
{
|
||||
if (creature.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
|
||||
if (creature.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED))
|
||||
{
|
||||
i_nextMoveTime.Reset(0); // Expire the timer
|
||||
creature.ClearUnitState(UNIT_STAT_ROAMING_MOVE);
|
||||
creature.ClearUnitState(UNIT_STATE_ROAMING_MOVE);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T &owner)
|
||||
if (!i_target.isValid() || !i_target->IsInWorld())
|
||||
return;
|
||||
|
||||
if (owner.HasUnitState(UNIT_STAT_NOT_MOVE))
|
||||
if (owner.HasUnitState(UNIT_STATE_NOT_MOVE))
|
||||
return;
|
||||
|
||||
float x, y, z;
|
||||
@@ -125,7 +125,7 @@ bool TargetedMovementGeneratorMedium<T,D>::Update(T &owner, const uint32 & time_
|
||||
if (!owner.isAlive())
|
||||
return true;
|
||||
|
||||
if (owner.HasUnitState(UNIT_STAT_NOT_MOVE))
|
||||
if (owner.HasUnitState(UNIT_STATE_NOT_MOVE))
|
||||
{
|
||||
D::_clearUnitStateMove(owner);
|
||||
return true;
|
||||
@@ -188,7 +188,7 @@ void ChaseMovementGenerator<T>::_reachTarget(T &owner)
|
||||
template<>
|
||||
void ChaseMovementGenerator<Player>::Initialize(Player &owner)
|
||||
{
|
||||
owner.AddUnitState(UNIT_STAT_CHASE|UNIT_STAT_CHASE_MOVE);
|
||||
owner.AddUnitState(UNIT_STATE_CHASE|UNIT_STATE_CHASE_MOVE);
|
||||
_setTargetLocation(owner);
|
||||
}
|
||||
|
||||
@@ -196,14 +196,14 @@ template<>
|
||||
void ChaseMovementGenerator<Creature>::Initialize(Creature &owner)
|
||||
{
|
||||
owner.SetWalk(false);
|
||||
owner.AddUnitState(UNIT_STAT_CHASE|UNIT_STAT_CHASE_MOVE);
|
||||
owner.AddUnitState(UNIT_STATE_CHASE|UNIT_STATE_CHASE_MOVE);
|
||||
_setTargetLocation(owner);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void ChaseMovementGenerator<T>::Finalize(T &owner)
|
||||
{
|
||||
owner.ClearUnitState(UNIT_STAT_CHASE|UNIT_STAT_CHASE_MOVE);
|
||||
owner.ClearUnitState(UNIT_STATE_CHASE|UNIT_STATE_CHASE_MOVE);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@@ -259,7 +259,7 @@ void FollowMovementGenerator<Creature>::_updateSpeed(Creature &u)
|
||||
template<>
|
||||
void FollowMovementGenerator<Player>::Initialize(Player &owner)
|
||||
{
|
||||
owner.AddUnitState(UNIT_STAT_FOLLOW|UNIT_STAT_FOLLOW_MOVE);
|
||||
owner.AddUnitState(UNIT_STATE_FOLLOW|UNIT_STATE_FOLLOW_MOVE);
|
||||
_updateSpeed(owner);
|
||||
_setTargetLocation(owner);
|
||||
}
|
||||
@@ -267,7 +267,7 @@ void FollowMovementGenerator<Player>::Initialize(Player &owner)
|
||||
template<>
|
||||
void FollowMovementGenerator<Creature>::Initialize(Creature &owner)
|
||||
{
|
||||
owner.AddUnitState(UNIT_STAT_FOLLOW|UNIT_STAT_FOLLOW_MOVE);
|
||||
owner.AddUnitState(UNIT_STATE_FOLLOW|UNIT_STATE_FOLLOW_MOVE);
|
||||
_updateSpeed(owner);
|
||||
_setTargetLocation(owner);
|
||||
}
|
||||
@@ -275,7 +275,7 @@ void FollowMovementGenerator<Creature>::Initialize(Creature &owner)
|
||||
template<class T>
|
||||
void FollowMovementGenerator<T>::Finalize(T &owner)
|
||||
{
|
||||
owner.ClearUnitState(UNIT_STAT_FOLLOW|UNIT_STAT_FOLLOW_MOVE);
|
||||
owner.ClearUnitState(UNIT_STATE_FOLLOW|UNIT_STATE_FOLLOW_MOVE);
|
||||
_updateSpeed(owner);
|
||||
}
|
||||
|
||||
|
||||
@@ -79,8 +79,8 @@ class ChaseMovementGenerator : public TargetedMovementGeneratorMedium<T, ChaseMo
|
||||
void Reset(T &);
|
||||
void MovementInform(T &);
|
||||
|
||||
static void _clearUnitStateMove(T &u) { u.ClearUnitState(UNIT_STAT_CHASE_MOVE); }
|
||||
static void _addUnitStateMove(T &u) { u.AddUnitState(UNIT_STAT_CHASE_MOVE); }
|
||||
static void _clearUnitStateMove(T &u) { u.ClearUnitState(UNIT_STATE_CHASE_MOVE); }
|
||||
static void _addUnitStateMove(T &u) { u.AddUnitState(UNIT_STATE_CHASE_MOVE); }
|
||||
bool EnableWalking() const { return false;}
|
||||
bool _lostTarget(T &u) const { return u.getVictim() != this->GetTarget(); }
|
||||
void _reachTarget(T &);
|
||||
@@ -103,8 +103,8 @@ class FollowMovementGenerator : public TargetedMovementGeneratorMedium<T, Follow
|
||||
void Reset(T &);
|
||||
void MovementInform(T &);
|
||||
|
||||
static void _clearUnitStateMove(T &u) { u.ClearUnitState(UNIT_STAT_FOLLOW_MOVE); }
|
||||
static void _addUnitStateMove(T &u) { u.AddUnitState(UNIT_STAT_FOLLOW_MOVE); }
|
||||
static void _clearUnitStateMove(T &u) { u.ClearUnitState(UNIT_STATE_FOLLOW_MOVE); }
|
||||
static void _addUnitStateMove(T &u) { u.AddUnitState(UNIT_STATE_FOLLOW_MOVE); }
|
||||
bool EnableWalking() const;
|
||||
bool _lostTarget(T &) const { return false; }
|
||||
void _reachTarget(T &) {}
|
||||
|
||||
@@ -51,18 +51,18 @@ void WaypointMovementGenerator<Creature>::LoadPath(Creature &creature)
|
||||
void WaypointMovementGenerator<Creature>::Initialize(Creature &creature)
|
||||
{
|
||||
LoadPath(creature);
|
||||
creature.AddUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE);
|
||||
creature.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
|
||||
}
|
||||
|
||||
void WaypointMovementGenerator<Creature>::Finalize(Creature &creature)
|
||||
{
|
||||
creature.ClearUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE);
|
||||
creature.ClearUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
|
||||
creature.SetWalk(false);
|
||||
}
|
||||
|
||||
void WaypointMovementGenerator<Creature>::Reset(Creature &creature)
|
||||
{
|
||||
creature.AddUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE);
|
||||
creature.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
|
||||
StartMoveNow(creature);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ void WaypointMovementGenerator<Creature>::OnArrived(Creature& creature)
|
||||
if (m_isArrivalDone)
|
||||
return;
|
||||
|
||||
creature.ClearUnitState(UNIT_STAT_ROAMING_MOVE);
|
||||
creature.ClearUnitState(UNIT_STATE_ROAMING_MOVE);
|
||||
m_isArrivalDone = true;
|
||||
|
||||
if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance)
|
||||
@@ -111,7 +111,7 @@ bool WaypointMovementGenerator<Creature>::StartMove(Creature &creature)
|
||||
|
||||
m_isArrivalDone = false;
|
||||
|
||||
creature.AddUnitState(UNIT_STAT_ROAMING_MOVE);
|
||||
creature.AddUnitState(UNIT_STATE_ROAMING_MOVE);
|
||||
|
||||
Movement::MoveSplineInit init(creature);
|
||||
init.MoveTo(node->x, node->y, node->z);
|
||||
@@ -133,9 +133,9 @@ bool WaypointMovementGenerator<Creature>::Update(Creature &creature, const uint3
|
||||
{
|
||||
// Waypoint movement can be switched on/off
|
||||
// This is quite handy for escort quests and other stuff
|
||||
if (creature.HasUnitState(UNIT_STAT_NOT_MOVE))
|
||||
if (creature.HasUnitState(UNIT_STATE_NOT_MOVE))
|
||||
{
|
||||
creature.ClearUnitState(UNIT_STAT_ROAMING_MOVE);
|
||||
creature.ClearUnitState(UNIT_STATE_ROAMING_MOVE);
|
||||
return true;
|
||||
}
|
||||
// prevent a crash at empty waypoint path.
|
||||
@@ -204,7 +204,7 @@ void FlightPathMovementGenerator::Initialize(Player &player)
|
||||
void FlightPathMovementGenerator::Finalize(Player & player)
|
||||
{
|
||||
// remove flag to prevent send object build movement packets for flight state and crash (movement generator already not at top of stack)
|
||||
player.ClearUnitState(UNIT_STAT_IN_FLIGHT);
|
||||
player.ClearUnitState(UNIT_STATE_IN_FLIGHT);
|
||||
|
||||
player.Dismount();
|
||||
player.RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
|
||||
@@ -227,7 +227,7 @@ void FlightPathMovementGenerator::Finalize(Player & player)
|
||||
void FlightPathMovementGenerator::Reset(Player & player)
|
||||
{
|
||||
player.getHostileRefManager().setOnlineOfflineState(false);
|
||||
player.AddUnitState(UNIT_STAT_IN_FLIGHT);
|
||||
player.AddUnitState(UNIT_STATE_IN_FLIGHT);
|
||||
player.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
|
||||
|
||||
Movement::MoveSplineInit init(player);
|
||||
|
||||
@@ -2417,7 +2417,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo
|
||||
target->VisitNearbyObject(target->GetMap()->GetVisibilityRange(), searcher);
|
||||
for (UnitList::iterator iter = targets.begin(); iter != targets.end(); ++iter)
|
||||
{
|
||||
if (!(*iter)->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (!(*iter)->HasUnitState(UNIT_STATE_CASTING))
|
||||
continue;
|
||||
|
||||
for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; i++)
|
||||
@@ -2448,7 +2448,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo
|
||||
// blizz like 2.0.x
|
||||
target->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
|
||||
target->AddUnitState(UNIT_STAT_DIED);
|
||||
target->AddUnitState(UNIT_STATE_DIED);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2465,7 +2465,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo
|
||||
// blizz like 2.0.x
|
||||
target->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
|
||||
target->ClearUnitState(UNIT_STAT_DIED);
|
||||
target->ClearUnitState(UNIT_STATE_DIED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3031,7 +3031,7 @@ void AuraEffect::HandleModConfuse(AuraApplication const* aurApp, uint8 mode, boo
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
target->SetControlled(apply, UNIT_STAT_CONFUSED);
|
||||
target->SetControlled(apply, UNIT_STATE_CONFUSED);
|
||||
}
|
||||
|
||||
void AuraEffect::HandleModFear(AuraApplication const* aurApp, uint8 mode, bool apply) const
|
||||
@@ -3041,7 +3041,7 @@ void AuraEffect::HandleModFear(AuraApplication const* aurApp, uint8 mode, bool a
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
target->SetControlled(apply, UNIT_STAT_FLEEING);
|
||||
target->SetControlled(apply, UNIT_STATE_FLEEING);
|
||||
}
|
||||
|
||||
void AuraEffect::HandleAuraModStun(AuraApplication const* aurApp, uint8 mode, bool apply) const
|
||||
@@ -3051,7 +3051,7 @@ void AuraEffect::HandleAuraModStun(AuraApplication const* aurApp, uint8 mode, bo
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
target->SetControlled(apply, UNIT_STAT_STUNNED);
|
||||
target->SetControlled(apply, UNIT_STATE_STUNNED);
|
||||
}
|
||||
|
||||
void AuraEffect::HandleAuraModRoot(AuraApplication const* aurApp, uint8 mode, bool apply) const
|
||||
@@ -3061,7 +3061,7 @@ void AuraEffect::HandleAuraModRoot(AuraApplication const* aurApp, uint8 mode, bo
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
target->SetControlled(apply, UNIT_STAT_ROOT);
|
||||
target->SetControlled(apply, UNIT_STATE_ROOT);
|
||||
}
|
||||
|
||||
void AuraEffect::HandlePreventFleeing(AuraApplication const* aurApp, uint8 mode, bool apply) const
|
||||
@@ -3072,7 +3072,7 @@ void AuraEffect::HandlePreventFleeing(AuraApplication const* aurApp, uint8 mode,
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
if (target->HasAuraType(SPELL_AURA_MOD_FEAR))
|
||||
target->SetControlled(!(apply), UNIT_STAT_FLEEING);
|
||||
target->SetControlled(!(apply), UNIT_STATE_FLEEING);
|
||||
}
|
||||
|
||||
/***************************/
|
||||
@@ -3465,7 +3465,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint
|
||||
if (GetSpellInfo()->Mechanic == MECHANIC_BANISH)
|
||||
{
|
||||
if (apply)
|
||||
target->AddUnitState(UNIT_STAT_ISOLATED);
|
||||
target->AddUnitState(UNIT_STATE_ISOLATED);
|
||||
else
|
||||
{
|
||||
bool banishFound = false;
|
||||
@@ -3477,7 +3477,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint
|
||||
break;
|
||||
}
|
||||
if (!banishFound)
|
||||
target->ClearUnitState(UNIT_STAT_ISOLATED);
|
||||
target->ClearUnitState(UNIT_STATE_ISOLATED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6156,7 +6156,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
|
||||
if (!caster || !target->isAlive())
|
||||
return;
|
||||
|
||||
if (target->HasUnitState(UNIT_STAT_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo()))
|
||||
if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo()))
|
||||
{
|
||||
SendTickImmune(target, caster);
|
||||
return;
|
||||
@@ -6297,7 +6297,7 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c
|
||||
if (!caster || !caster->isAlive() || !target->isAlive())
|
||||
return;
|
||||
|
||||
if (target->HasUnitState(UNIT_STAT_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo()))
|
||||
if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo()))
|
||||
{
|
||||
SendTickImmune(target, caster);
|
||||
return;
|
||||
@@ -6363,7 +6363,7 @@ void AuraEffect::HandlePeriodicHealthFunnelAuraTick(Unit* target, Unit* caster)
|
||||
if (!caster || !caster->isAlive() || !target->isAlive())
|
||||
return;
|
||||
|
||||
if (target->HasUnitState(UNIT_STAT_ISOLATED))
|
||||
if (target->HasUnitState(UNIT_STATE_ISOLATED))
|
||||
{
|
||||
SendTickImmune(target, caster);
|
||||
return;
|
||||
@@ -6391,7 +6391,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
|
||||
if (!caster || !target->isAlive())
|
||||
return;
|
||||
|
||||
if (target->HasUnitState(UNIT_STAT_ISOLATED))
|
||||
if (target->HasUnitState(UNIT_STATE_ISOLATED))
|
||||
{
|
||||
SendTickImmune(target, caster);
|
||||
return;
|
||||
@@ -6507,7 +6507,7 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con
|
||||
if (!caster || !caster->isAlive() || !target->isAlive() || target->getPowerType() != powerType)
|
||||
return;
|
||||
|
||||
if (target->HasUnitState(UNIT_STAT_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo()))
|
||||
if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo()))
|
||||
{
|
||||
SendTickImmune(target, caster);
|
||||
return;
|
||||
@@ -6607,7 +6607,7 @@ void AuraEffect::HandleObsModPowerAuraTick(Unit* target, Unit* caster) const
|
||||
if (!target->isAlive() || !target->GetMaxPower(powerType))
|
||||
return;
|
||||
|
||||
if (target->HasUnitState(UNIT_STAT_ISOLATED))
|
||||
if (target->HasUnitState(UNIT_STATE_ISOLATED))
|
||||
{
|
||||
SendTickImmune(target, caster);
|
||||
return;
|
||||
@@ -6638,7 +6638,7 @@ void AuraEffect::HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) cons
|
||||
if (!target->isAlive() || !target->GetMaxPower(powerType))
|
||||
return;
|
||||
|
||||
if (target->HasUnitState(UNIT_STAT_ISOLATED))
|
||||
if (target->HasUnitState(UNIT_STATE_ISOLATED))
|
||||
{
|
||||
SendTickImmune(target, caster);
|
||||
return;
|
||||
@@ -6670,7 +6670,7 @@ void AuraEffect::HandlePeriodicPowerBurnAuraTick(Unit* target, Unit* caster) con
|
||||
if (!caster || !target->isAlive() || target->getPowerType() != powerType)
|
||||
return;
|
||||
|
||||
if (target->HasUnitState(UNIT_STAT_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo()))
|
||||
if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo()))
|
||||
{
|
||||
SendTickImmune(target, caster);
|
||||
return;
|
||||
|
||||
@@ -2342,7 +2342,7 @@ void UnitAura::FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster)
|
||||
{
|
||||
float radius = GetSpellInfo()->Effects[effIndex].CalcRadius(caster);
|
||||
|
||||
if (!GetUnitOwner()->HasUnitState(UNIT_STAT_ISOLATED))
|
||||
if (!GetUnitOwner()->HasUnitState(UNIT_STATE_ISOLATED))
|
||||
{
|
||||
switch (GetSpellInfo()->Effects[effIndex].Effect)
|
||||
{
|
||||
|
||||
@@ -1447,7 +1447,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, const uint32 effectMask, bool
|
||||
return SPELL_MISS_EVADE;
|
||||
|
||||
// assisting case, healing and resurrection
|
||||
if (unit->HasUnitState(UNIT_STAT_ATTACK_PLAYER))
|
||||
if (unit->HasUnitState(UNIT_STATE_ATTACK_PLAYER))
|
||||
{
|
||||
m_caster->SetContestedPvP();
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -3214,8 +3214,8 @@ void Spell::cast(bool skipCheck)
|
||||
m_spellState = SPELL_STATE_DELAYED;
|
||||
SetDelayStart(0);
|
||||
|
||||
if (m_caster->HasUnitState(UNIT_STAT_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true))
|
||||
m_caster->ClearUnitState(UNIT_STAT_CASTING);
|
||||
if (m_caster->HasUnitState(UNIT_STATE_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true))
|
||||
m_caster->ClearUnitState(UNIT_STATE_CASTING);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3581,8 +3581,8 @@ void Spell::finish(bool ok)
|
||||
if (m_spellInfo->IsChanneled())
|
||||
m_caster->UpdateInterruptMask();
|
||||
|
||||
if (m_caster->HasUnitState(UNIT_STAT_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true))
|
||||
m_caster->ClearUnitState(UNIT_STAT_CASTING);
|
||||
if (m_caster->HasUnitState(UNIT_STATE_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true))
|
||||
m_caster->ClearUnitState(UNIT_STATE_CASTING);
|
||||
|
||||
// Unsummon summon as possessed creatures on spell cancel
|
||||
if (m_spellInfo->IsChanneled() && m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -5000,7 +5000,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if (strict && m_caster->IsScriptOverriden(m_spellInfo, 6953))
|
||||
m_caster->RemoveMovementImpairingAuras();
|
||||
}
|
||||
if (m_caster->HasUnitState(UNIT_STAT_ROOT))
|
||||
if (m_caster->HasUnitState(UNIT_STATE_ROOT))
|
||||
return SPELL_FAILED_ROOTED;
|
||||
break;
|
||||
}
|
||||
@@ -5228,7 +5228,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
|
||||
|
||||
Unit* target = m_targets.GetUnitTarget();
|
||||
if (m_caster == target && m_caster->HasUnitState(UNIT_STAT_ROOT))
|
||||
if (m_caster == target && m_caster->HasUnitState(UNIT_STATE_ROOT))
|
||||
{
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
return SPELL_FAILED_ROOTED;
|
||||
@@ -5455,7 +5455,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
|
||||
SpellCastResult Spell::CheckPetCast(Unit* target)
|
||||
{
|
||||
if (m_caster->HasUnitState(UNIT_STAT_CASTING) && !(_triggeredCastFlags & TRIGGERED_IGNORE_CAST_IN_PROGRESS)) //prevent spellcast interruption by another spellcast
|
||||
if (m_caster->HasUnitState(UNIT_STATE_CASTING) && !(_triggeredCastFlags & TRIGGERED_IGNORE_CAST_IN_PROGRESS)) //prevent spellcast interruption by another spellcast
|
||||
return SPELL_FAILED_SPELL_IN_PROGRESS;
|
||||
|
||||
// dead owner (pets still alive when owners ressed?)
|
||||
|
||||
@@ -1338,7 +1338,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
}
|
||||
|
||||
//Any effect which causes you to lose control of your character will supress the starfall effect.
|
||||
if (m_caster->HasUnitState(UNIT_STAT_CONTROLLED))
|
||||
if (m_caster->HasUnitState(UNIT_STATE_CONTROLLED))
|
||||
return;
|
||||
|
||||
m_caster->CastSpell(unitTarget, damage, true);
|
||||
@@ -3360,11 +3360,11 @@ void Spell::EffectDistract(SpellEffIndex /*effIndex*/)
|
||||
return;
|
||||
|
||||
// target must be OK to do this
|
||||
if (unitTarget->HasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING))
|
||||
if (unitTarget->HasUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING))
|
||||
return;
|
||||
|
||||
unitTarget->SetFacingTo(unitTarget->GetAngle(m_targets.GetDst()));
|
||||
unitTarget->ClearUnitState(UNIT_STAT_MOVING);
|
||||
unitTarget->ClearUnitState(UNIT_STATE_MOVING);
|
||||
|
||||
if (unitTarget->GetTypeId() == TYPEID_UNIT)
|
||||
unitTarget->GetMotionMaster()->MoveDistract(damage * IN_MILLISECONDS);
|
||||
@@ -6426,7 +6426,7 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/)
|
||||
pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE);
|
||||
pet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
|
||||
pet->setDeathState(ALIVE);
|
||||
pet->ClearUnitState(uint32(UNIT_STAT_ALL_STATE));
|
||||
pet->ClearUnitState(uint32(UNIT_STATE_ALL_STATE));
|
||||
pet->SetHealth(pet->CountPctFromMaxHealth(damage));
|
||||
|
||||
//pet->AIM_Initialize();
|
||||
|
||||
@@ -1604,7 +1604,7 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, Unit const* target, b
|
||||
}
|
||||
|
||||
// not allow casting on flying player
|
||||
if (target->HasUnitState(UNIT_STAT_IN_FLIGHT))
|
||||
if (target->HasUnitState(UNIT_STATE_IN_FLIGHT))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
if (TargetAuraState && !target->HasAuraState(AuraStateType(TargetAuraState), this, caster))
|
||||
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -351,7 +351,7 @@ public:
|
||||
|
||||
//Teleport self to a hiding spot (this causes errors in the Trinity log but no real issues)
|
||||
DoTeleportTo(HIDE_X, HIDE_Y, HIDE_Z);
|
||||
me->AddUnitState(UNIT_STAT_FLEEING);
|
||||
me->AddUnitState(UNIT_STATE_FLEEING);
|
||||
|
||||
//Spawn nef and have him attack a random target
|
||||
Creature* Nefarian = me->SummonCreature(CREATURE_NEFARIAN, NEF_X, NEF_Y, NEF_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
|
||||
|
||||
@@ -393,7 +393,7 @@ public:
|
||||
EnfeebleResetTimer = 0;
|
||||
} else EnfeebleResetTimer -= diff;
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_STUNNED)) // While shifting to phase 2 malchezaar stuns himself
|
||||
if (me->HasUnitState(UNIT_STATE_STUNNED)) // While shifting to phase 2 malchezaar stuns himself
|
||||
return;
|
||||
|
||||
if (me->GetUInt64Value(UNIT_FIELD_TARGET) != me->getVictim()->GetGUID())
|
||||
|
||||
@@ -80,7 +80,7 @@ class boss_baron_geddon : public CreatureScript
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -71,7 +71,7 @@ class boss_garr : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -68,7 +68,7 @@ class boss_gehennas : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -91,7 +91,7 @@ class boss_golemagg : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -68,7 +68,7 @@ class boss_lucifron : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -80,7 +80,7 @@ class boss_magmadar : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -116,7 +116,7 @@ class boss_majordomo : public CreatureScript
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
if (HealthBelowPct(50))
|
||||
|
||||
@@ -73,7 +73,7 @@ class boss_shazzrah : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -84,7 +84,7 @@ class boss_sulfuron : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -169,7 +169,7 @@ class mob_flamewaker_priest : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -425,7 +425,7 @@ public:
|
||||
{
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->AddUnitState(UNIT_STAT_STUNNED);
|
||||
me->AddUnitState(UNIT_STATE_STUNNED);
|
||||
|
||||
ScriptedAI::InitializeAI();
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ public:
|
||||
summoned->CastSpell(summoned, SPELL_DARKFIEND_VISUAL, false);
|
||||
break;
|
||||
case CREATURE_DARKNESS:
|
||||
summoned->AddUnitState(UNIT_STAT_STUNNED);
|
||||
summoned->AddUnitState(UNIT_STATE_STUNNED);
|
||||
float x, y, z, o;
|
||||
summoned->GetHomePosition(x, y, z, o);
|
||||
me->SummonCreature(CREATURE_DARK_FIENDS, x, y, z, o, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
@@ -399,7 +399,7 @@ public:
|
||||
InAction = false;
|
||||
SummonSentinel = false;
|
||||
|
||||
me->AddUnitState(UNIT_STAT_STUNNED);
|
||||
me->AddUnitState(UNIT_STATE_STUNNED);
|
||||
|
||||
Summons.DespawnAll();
|
||||
}
|
||||
@@ -472,7 +472,7 @@ public:
|
||||
WaitTimer = 2000;
|
||||
InAction = false;
|
||||
|
||||
me->AddUnitState(UNIT_STAT_STUNNED);
|
||||
me->AddUnitState(UNIT_STATE_STUNNED);
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, const SpellInfo* Spell)
|
||||
@@ -491,7 +491,7 @@ public:
|
||||
{
|
||||
if (!InAction)
|
||||
{
|
||||
me->ClearUnitState(UNIT_STAT_STUNNED);
|
||||
me->ClearUnitState(UNIT_STATE_STUNNED);
|
||||
DoCastAOE(SPELL_DARKFIEND_SKIN, false);
|
||||
AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true));
|
||||
InAction = true;
|
||||
@@ -599,7 +599,7 @@ public:
|
||||
SpellTimer = 5000;
|
||||
Phase = 0;
|
||||
|
||||
me->AddUnitState(UNIT_STAT_STUNNED);
|
||||
me->AddUnitState(UNIT_STATE_STUNNED);
|
||||
DoCastAOE(SPELL_BLACKHOLE_SPAWN, true);
|
||||
}
|
||||
|
||||
@@ -611,7 +611,7 @@ public:
|
||||
switch (NeedForAHack)
|
||||
{
|
||||
case 0:
|
||||
me->ClearUnitState(UNIT_STAT_STUNNED);
|
||||
me->ClearUnitState(UNIT_STATE_STUNNED);
|
||||
DoCastAOE(SPELL_BLACKHOLE_GROW, false);
|
||||
if (Victim)
|
||||
AttackStart(Victim);
|
||||
|
||||
@@ -173,7 +173,7 @@ class boss_venoxis : public CreatureScript
|
||||
events.Update(diff);
|
||||
|
||||
// return back to main code if we're still casting
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -75,7 +75,7 @@ class boss_kurinnaxx : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -127,7 +127,7 @@ class boss_moam : public CreatureScript
|
||||
}
|
||||
|
||||
// Messing up mana-drain channel
|
||||
//if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
//if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
// return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -93,7 +93,7 @@ class boss_rajaxx : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -90,7 +90,7 @@ struct boss_twinemperorsAI : public ScriptedAI
|
||||
AfterTeleportTimer = 0;
|
||||
Abuse_Bug_Timer = urand(10000, 17000);
|
||||
BugsTimer = 2000;
|
||||
me->ClearUnitState(UNIT_STAT_STUNNED);
|
||||
me->ClearUnitState(UNIT_STATE_STUNNED);
|
||||
DontYellWhenDead = false;
|
||||
EnrageTimer = 15*60000;
|
||||
}
|
||||
@@ -234,7 +234,7 @@ struct boss_twinemperorsAI : public ScriptedAI
|
||||
DoStopAttack();
|
||||
DoResetThreat();
|
||||
DoCast(me, SPELL_TWIN_TELEPORT_VISUAL);
|
||||
me->AddUnitState(UNIT_STAT_STUNNED);
|
||||
me->AddUnitState(UNIT_STATE_STUNNED);
|
||||
AfterTeleport = true;
|
||||
AfterTeleportTimer = 2000;
|
||||
tspellcasted = false;
|
||||
@@ -246,9 +246,9 @@ struct boss_twinemperorsAI : public ScriptedAI
|
||||
{
|
||||
if (!tspellcasted)
|
||||
{
|
||||
me->ClearUnitState(UNIT_STAT_STUNNED);
|
||||
me->ClearUnitState(UNIT_STATE_STUNNED);
|
||||
DoCast(me, SPELL_TWIN_TELEPORT);
|
||||
me->AddUnitState(UNIT_STAT_STUNNED);
|
||||
me->AddUnitState(UNIT_STATE_STUNNED);
|
||||
}
|
||||
|
||||
tspellcasted = true;
|
||||
@@ -256,7 +256,7 @@ struct boss_twinemperorsAI : public ScriptedAI
|
||||
if (AfterTeleportTimer <= diff)
|
||||
{
|
||||
AfterTeleport = false;
|
||||
me->ClearUnitState(UNIT_STAT_STUNNED);
|
||||
me->ClearUnitState(UNIT_STATE_STUNNED);
|
||||
if (Unit* nearu = me->SelectNearestTarget(100))
|
||||
{
|
||||
//DoYell(nearu->GetName(), LANG_UNIVERSAL, 0);
|
||||
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
DoCast(me, INSANITY_VISUAL, true);
|
||||
// Unattackable
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetControlled(true, UNIT_STAT_STUNNED);
|
||||
me->SetControlled(true, UNIT_STATE_STUNNED);
|
||||
}
|
||||
// phase mask
|
||||
target->CastSpell(target, SPELL_INSANITY_TARGET+insanityHandled, true);
|
||||
@@ -171,7 +171,7 @@ public:
|
||||
// Cleanup
|
||||
Summons.DespawnAll();
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetControlled(false, UNIT_STAT_STUNNED);
|
||||
me->SetControlled(false, UNIT_STATE_STUNNED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
@@ -271,7 +271,7 @@ public:
|
||||
|
||||
insanityHandled = 0;
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetControlled(false, UNIT_STAT_STUNNED);
|
||||
me->SetControlled(false, UNIT_STATE_STUNNED);
|
||||
me->RemoveAurasDueToSpell(INSANITY_VISUAL);
|
||||
}
|
||||
|
||||
|
||||
@@ -283,7 +283,7 @@ public:
|
||||
if (((UndergroundPhase == 0 && HealthBelowPct(75))
|
||||
|| (UndergroundPhase == 1 && HealthBelowPct(50))
|
||||
|| (UndergroundPhase == 2 && HealthBelowPct(25)))
|
||||
&& !me->HasUnitState(UNIT_STAT_CASTING))
|
||||
&& !me->HasUnitState(UNIT_STATE_CASTING))
|
||||
{
|
||||
GuardianSummoned = false;
|
||||
VenomancerSummoned = false;
|
||||
|
||||
+2
-2
@@ -174,7 +174,7 @@ class boss_baltharus_the_warborn : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING) && !(events.GetPhaseMask() & PHASE_INTRO_MASK))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) && !(events.GetPhaseMask() & PHASE_INTRO_MASK))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -268,7 +268,7 @@ class npc_baltharus_the_warborn_clone : public CreatureScript
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
|
||||
+2
-2
@@ -148,7 +148,7 @@ class boss_general_zarithrian : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -257,7 +257,7 @@ class npc_onyx_flamecaller : public CreatureScript
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
|
||||
@@ -137,7 +137,7 @@ class boss_saviana_ragefire : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
+6
-6
@@ -111,7 +111,7 @@ public:
|
||||
{
|
||||
RemoveSummons();
|
||||
me->SetDisplayId(me->GetNativeDisplayId());
|
||||
me->ClearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
|
||||
me->ClearUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED);
|
||||
|
||||
bEventInProgress = false;
|
||||
bEvent = false;
|
||||
@@ -167,7 +167,7 @@ public:
|
||||
uiPhase++;
|
||||
uiResurrectTimer = 4000;
|
||||
bEventInProgress = false;
|
||||
me->ClearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
|
||||
me->ClearUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED);
|
||||
} else uiResurrectTimer -= uiDiff;
|
||||
}
|
||||
|
||||
@@ -211,14 +211,14 @@ public:
|
||||
if (!bSummonArmy)
|
||||
{
|
||||
bSummonArmy = true;
|
||||
me->AddUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
|
||||
me->AddUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED);
|
||||
DoCast(me, SPELL_ARMY_DEAD);
|
||||
}
|
||||
if (!bDeathArmyDone)
|
||||
{
|
||||
if (uiDeathArmyCheckTimer <= uiDiff)
|
||||
{
|
||||
me->ClearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
|
||||
me->ClearUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED);
|
||||
uiDeathArmyCheckTimer = 0;
|
||||
bDeathArmyDone = true;
|
||||
} else uiDeathArmyCheckTimer -= uiDiff;
|
||||
@@ -263,7 +263,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (!me->HasUnitState(UNIT_STAT_ROOT) && !me->HealthBelowPct(1))
|
||||
if (!me->HasUnitState(UNIT_STATE_ROOT) && !me->HealthBelowPct(1))
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ public:
|
||||
{
|
||||
uiDamage = 0;
|
||||
me->SetHealth(0);
|
||||
me->AddUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
|
||||
me->AddUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED);
|
||||
RemoveSummons();
|
||||
switch (uiPhase)
|
||||
{
|
||||
|
||||
@@ -142,7 +142,7 @@ class boss_bronjahm : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -260,7 +260,7 @@ class boss_devourer_of_souls : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -441,7 +441,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -497,7 +497,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -555,7 +555,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -612,7 +612,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -672,7 +672,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -738,7 +738,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -811,7 +811,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -878,7 +878,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
|
||||
@@ -659,7 +659,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -742,7 +742,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -842,7 +842,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -912,7 +912,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -978,7 +978,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -190,7 +190,7 @@ class boss_garfrost : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -215,7 +215,7 @@ class boss_ick : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -72,7 +72,7 @@ class mob_ymirjar_flamebearer : public CreatureScript
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
@@ -187,7 +187,7 @@ class mob_wrathbone_laborer : public CreatureScript
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
|
||||
@@ -212,7 +212,7 @@ class boss_drakkari_colossus : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -289,7 +289,7 @@ class boss_drakkari_elemental : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -335,7 +335,7 @@ class boss_drakkari_elemental : public CreatureScript
|
||||
damage = 0;
|
||||
|
||||
// to prevent spell spaming
|
||||
if (me->HasUnitState(UNIT_STAT_CHARGING))
|
||||
if (me->HasUnitState(UNIT_STATE_CHARGING))
|
||||
return;
|
||||
|
||||
// not sure about this, the idea of this code is to prevent bug the elemental
|
||||
|
||||
@@ -148,7 +148,7 @@ public:
|
||||
DoScriptText(SAY_TRANSFORM_1, me);
|
||||
uiTransformationTimer = 5*IN_MILLISECONDS;
|
||||
bStartOfTransformation = true;
|
||||
me->ClearUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
|
||||
me->ClearUnitState(UNIT_STATE_STUNNED|UNIT_STATE_ROOT);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
else
|
||||
@@ -158,7 +158,7 @@ public:
|
||||
if (bStartOfTransformation)
|
||||
{
|
||||
bStartOfTransformation = false;
|
||||
me->AddUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
|
||||
me->AddUnitState(UNIT_STATE_STUNNED|UNIT_STATE_ROOT);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
}
|
||||
@@ -191,7 +191,7 @@ public:
|
||||
DoScriptText(SAY_TRANSFORM_2, me);
|
||||
uiTransformationTimer = 9*IN_MILLISECONDS;
|
||||
bStartOfTransformation = true;
|
||||
me->ClearUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
|
||||
me->ClearUnitState(UNIT_STATE_STUNNED|UNIT_STATE_ROOT);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
else
|
||||
@@ -201,7 +201,7 @@ public:
|
||||
if (bStartOfTransformation)
|
||||
{
|
||||
bStartOfTransformation = false;
|
||||
me->AddUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
|
||||
me->AddUnitState(UNIT_STATE_STUNNED|UNIT_STATE_ROOT);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,7 +287,7 @@ class boss_blood_council_controller : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -535,7 +535,7 @@ class boss_prince_keleseth_icc : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -753,7 +753,7 @@ class boss_prince_taldaram_icc : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -990,7 +990,7 @@ class boss_prince_valanar_icc : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -1179,7 +1179,7 @@ class npc_ball_of_flame : public CreatureScript
|
||||
if (Player* target = ObjectAccessor::GetPlayer(*me, _chaseGUID))
|
||||
{
|
||||
// need to clear states now because this call is before AuraEffect is fully removed
|
||||
me->ClearUnitState(UNIT_STAT_CASTING | UNIT_STAT_STUNNED);
|
||||
me->ClearUnitState(UNIT_STATE_CASTING | UNIT_STATE_STUNNED);
|
||||
if (target && me->Attack(target, true))
|
||||
me->GetMotionMaster()->MoveChase(target, 1.0f);
|
||||
}
|
||||
@@ -1316,7 +1316,7 @@ class npc_dark_nucleus : public CreatureScript
|
||||
}
|
||||
|
||||
DoCast(who, SPELL_SHADOW_RESONANCE_RESIST);
|
||||
me->ClearUnitState(UNIT_STAT_CASTING);
|
||||
me->ClearUnitState(UNIT_STATE_CASTING);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
@@ -1350,7 +1350,7 @@ class npc_dark_nucleus : public CreatureScript
|
||||
!victim->HasAura(SPELL_SHADOW_RESONANCE_RESIST, me->GetGUID()))
|
||||
{
|
||||
DoCast(victim, SPELL_SHADOW_RESONANCE_RESIST);
|
||||
me->ClearUnitState(UNIT_STAT_CASTING);
|
||||
me->ClearUnitState(UNIT_STATE_CASTING);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1369,7 +1369,7 @@ class npc_dark_nucleus : public CreatureScript
|
||||
_lockedTarget = true;
|
||||
AttackStart(victim);
|
||||
DoCast(victim, SPELL_SHADOW_RESONANCE_RESIST);
|
||||
me->ClearUnitState(UNIT_STAT_CASTING);
|
||||
me->ClearUnitState(UNIT_STATE_CASTING);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ class boss_blood_queen_lana_thel : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -403,7 +403,7 @@ class boss_deathbringer_saurfang : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user