Core/Unit: Renamed addUnitState/hasUnitState/clearUnitState to AddUnitState/HasUnitState/ClearUnitState
Core/Vehicles: Allow the vehicle to always damage the passenger (removed unneded dbc hacks from scripts) --HG-- branch : trunk
This commit is contained in:
@@ -102,7 +102,7 @@ void CombatAI::UpdateAI(const uint32 diff)
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
if (uint32 spellId = events.ExecuteEvent())
|
||||
@@ -161,7 +161,7 @@ void CasterAI::UpdateAI(const uint32 diff)
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
if (uint32 spellId = events.ExecuteEvent())
|
||||
|
||||
@@ -61,13 +61,13 @@ void PossessedAI::KilledUnit(Unit* victim)
|
||||
|
||||
void CritterAI::DamageTaken(Unit * /*done_by*/, uint32 &)
|
||||
{
|
||||
if (!me->hasUnitState(UNIT_STAT_FLEEING))
|
||||
if (!me->HasUnitState(UNIT_STAT_FLEEING))
|
||||
me->SetControlled(true, UNIT_STAT_FLEEING);
|
||||
}
|
||||
|
||||
void CritterAI::EnterEvadeMode()
|
||||
{
|
||||
if (me->hasUnitState(UNIT_STAT_FLEEING))
|
||||
if (me->HasUnitState(UNIT_STAT_FLEEING))
|
||||
me->SetControlled(false, UNIT_STAT_FLEEING);
|
||||
CreatureAI::EnterEvadeMode();
|
||||
}
|
||||
|
||||
@@ -115,14 +115,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_STAT_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->GetGlobalCooldown() == 0 && !me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->GetGlobalCooldown() == 0 && !me->HasUnitState(UNIT_STAT_CASTING))
|
||||
{
|
||||
typedef std::vector<std::pair<Unit*, Spell*> > TargetSpellList;
|
||||
TargetSpellList targetSpellStore;
|
||||
@@ -427,7 +427,7 @@ void PetAI::MovementInform(uint32 moveType, uint32 data)
|
||||
me->GetCharmInfo()->SetIsReturning(false);
|
||||
me->GetCharmInfo()->SetIsFollowing(true);
|
||||
me->GetCharmInfo()->SetIsCommandAttack(false);
|
||||
me->addUnitState(UNIT_STAT_FOLLOW);
|
||||
me->AddUnitState(UNIT_STAT_FOLLOW);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -38,7 +38,7 @@ void UnitAI::AttackStartCaster(Unit *victim, float dist)
|
||||
|
||||
void UnitAI::DoMeleeAttackIfReady()
|
||||
{
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
//Make sure our attack is ready and we aren't currently casting before checking distance
|
||||
@@ -64,7 +64,7 @@ void UnitAI::DoMeleeAttackIfReady()
|
||||
|
||||
bool UnitAI::DoSpellAttackIfReady(uint32 spell)
|
||||
{
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return true;
|
||||
|
||||
if (me->isAttackReady())
|
||||
|
||||
@@ -576,7 +576,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_STAT_CASTING) && !triggered))
|
||||
return;
|
||||
|
||||
me->CastSpell(victim, spellId, triggered);
|
||||
@@ -589,7 +589,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_STAT_CASTING))
|
||||
return;
|
||||
|
||||
me->CastSpell((Unit*)NULL, spellId, triggered);
|
||||
|
||||
@@ -580,7 +580,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
||||
{
|
||||
if (action.combat_movement.melee)
|
||||
{
|
||||
me->addUnitState(UNIT_STAT_MELEE_ATTACKING);
|
||||
me->AddUnitState(UNIT_STAT_MELEE_ATTACKING);
|
||||
me->SendMeleeAttackStart(victim);
|
||||
}
|
||||
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE)
|
||||
@@ -594,7 +594,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_STAT_MELEE_ATTACKING);
|
||||
me->SendMeleeAttackStop(victim);
|
||||
}
|
||||
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
|
||||
|
||||
@@ -90,7 +90,7 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* pWho)
|
||||
|
||||
void npc_escortAI::MoveInLineOfSight(Unit* pWho)
|
||||
{
|
||||
if (!me->hasUnitState(UNIT_STAT_STUNNED) && pWho->isTargetableForAttack() && pWho->isInAccessiblePlaceFor(me))
|
||||
if (!me->HasUnitState(UNIT_STAT_STUNNED) && pWho->isTargetableForAttack() && pWho->isInAccessiblePlaceFor(me))
|
||||
{
|
||||
if (HasEscortState(STATE_ESCORT_ESCORTING) && AssistPlayerInCombat(pWho))
|
||||
return;
|
||||
|
||||
@@ -38,8 +38,8 @@ void FollowerAI::AttackStart(Unit* pWho)
|
||||
me->SetInCombatWith(pWho);
|
||||
pWho->SetInCombatWith(me);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_FOLLOW))
|
||||
me->clearUnitState(UNIT_STAT_FOLLOW);
|
||||
if (me->HasUnitState(UNIT_STAT_FOLLOW))
|
||||
me->ClearUnitState(UNIT_STAT_FOLLOW);
|
||||
|
||||
if (IsCombatMovement())
|
||||
me->GetMotionMaster()->MoveChase(pWho);
|
||||
@@ -88,7 +88,7 @@ bool FollowerAI::AssistPlayerInCombat(Unit* pWho)
|
||||
|
||||
void FollowerAI::MoveInLineOfSight(Unit* pWho)
|
||||
{
|
||||
if (!me->hasUnitState(UNIT_STAT_STUNNED) && pWho->isTargetableForAttack() && pWho->isInAccessiblePlaceFor(me))
|
||||
if (!me->HasUnitState(UNIT_STAT_STUNNED) && pWho->isTargetableForAttack() && pWho->isInAccessiblePlaceFor(me))
|
||||
{
|
||||
if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(pWho))
|
||||
return;
|
||||
@@ -340,9 +340,9 @@ Player* FollowerAI::GetLeaderForFollower()
|
||||
|
||||
void FollowerAI::SetFollowComplete(bool bWithEndEvent)
|
||||
{
|
||||
if (me->hasUnitState(UNIT_STAT_FOLLOW))
|
||||
if (me->HasUnitState(UNIT_STAT_FOLLOW))
|
||||
{
|
||||
me->clearUnitState(UNIT_STAT_FOLLOW);
|
||||
me->ClearUnitState(UNIT_STAT_FOLLOW);
|
||||
|
||||
me->StopMoving();
|
||||
me->GetMotionMaster()->Clear();
|
||||
@@ -369,9 +369,9 @@ void FollowerAI::SetFollowPaused(bool bPaused)
|
||||
{
|
||||
AddFollowState(STATE_FOLLOW_PAUSED);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_FOLLOW))
|
||||
if (me->HasUnitState(UNIT_STAT_FOLLOW))
|
||||
{
|
||||
me->clearUnitState(UNIT_STAT_FOLLOW);
|
||||
me->ClearUnitState(UNIT_STAT_FOLLOW);
|
||||
|
||||
me->StopMoving();
|
||||
me->GetMotionMaster()->Clear();
|
||||
|
||||
@@ -132,7 +132,7 @@ void HostileReference::updateOnlineStatus()
|
||||
// target is not in flight
|
||||
if (isValid() &&
|
||||
((getTarget()->GetTypeId() != TYPEID_PLAYER || !((Player*)getTarget())->isGameMaster()) ||
|
||||
!getTarget()->hasUnitState(UNIT_STAT_IN_FLIGHT)))
|
||||
!getTarget()->HasUnitState(UNIT_STAT_IN_FLIGHT)))
|
||||
{
|
||||
Creature* creature = getSourceUnit()->ToCreature();
|
||||
online = getTarget()->isInAccessiblePlaceFor(creature);
|
||||
|
||||
@@ -1683,7 +1683,7 @@ void LFGMgr::TeleportPlayer(Player* plr, bool out, bool fromOpcode /*= false*/)
|
||||
error = LFG_TELEPORTERROR_INVALID_LOCATION;
|
||||
else if (!plr->isAlive())
|
||||
error = LFG_TELEPORTERROR_PLAYER_DEAD;
|
||||
else if (plr->IsFalling() || plr->hasUnitState(UNIT_STAT_JUMPING))
|
||||
else if (plr->IsFalling() || plr->HasUnitState(UNIT_STAT_JUMPING))
|
||||
error = LFG_TELEPORTERROR_FALLING;
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1541,7 +1541,7 @@ void Creature::setDeathState(DeathState s)
|
||||
if (GetCreatureInfo()->InhabitType & INHABIT_WATER)
|
||||
AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING);
|
||||
SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag);
|
||||
clearUnitState(UNIT_STAT_ALL_STATE);
|
||||
ClearUnitState(UNIT_STAT_ALL_STATE);
|
||||
SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool));
|
||||
LoadCreaturesAddon(true);
|
||||
Motion_Initialize();
|
||||
@@ -1604,7 +1604,7 @@ void Creature::Respawn(bool force)
|
||||
{
|
||||
setDeathState(JUST_DIED);
|
||||
i_motionMaster.Clear();
|
||||
clearUnitState(UNIT_STAT_ALL_STATE);
|
||||
ClearUnitState(UNIT_STAT_ALL_STATE);
|
||||
LoadCreaturesAddon(true);
|
||||
}
|
||||
else
|
||||
@@ -1946,7 +1946,7 @@ bool Creature::_IsTargetAcceptable(const Unit *target) const
|
||||
// if the target cannot be attacked, the target is not acceptable
|
||||
if (IsFriendlyTo(target)
|
||||
|| !target->isAttackableByAOE()
|
||||
|| target->hasUnitState(UNIT_STAT_DIED)
|
||||
|| target->HasUnitState(UNIT_STAT_DIED)
|
||||
|| (m_vehicle && (IsOnVehicle(target) || m_vehicle->GetBase()->IsOnVehicle(target))))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -473,7 +473,7 @@ class Creature : public Unit, public GridObject<Creature>
|
||||
|
||||
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_STAT_EVADE); }
|
||||
|
||||
bool AIM_Initialize(CreatureAI* ai = NULL);
|
||||
void Motion_Initialize();
|
||||
|
||||
@@ -2379,7 +2379,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_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED) ||
|
||||
!c->GetMotionMaster()->GetDestination(x,y,z))
|
||||
{
|
||||
x = c->GetPositionX();
|
||||
|
||||
@@ -1330,7 +1330,7 @@ void Player::Update(uint32 p_time)
|
||||
|
||||
GetAchievementMgr().UpdateTimedAchievements(p_time);
|
||||
|
||||
if (hasUnitState(UNIT_STAT_MELEE_ATTACKING) && !hasUnitState(UNIT_STAT_CASTING))
|
||||
if (HasUnitState(UNIT_STAT_MELEE_ATTACKING) && !HasUnitState(UNIT_STAT_CASTING))
|
||||
{
|
||||
if (Unit *pVictim = getVictim())
|
||||
{
|
||||
@@ -11023,7 +11023,7 @@ uint8 Player::CanEquipItem(uint8 slot, uint16 &dest, Item *pItem, bool swap, boo
|
||||
{
|
||||
// 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_STAT_STUNNED))
|
||||
return EQUIP_ERR_YOU_ARE_STUNNED;
|
||||
|
||||
// do not allow equipping gear except weapons, offhands, projectiles, relics in
|
||||
@@ -19395,7 +19395,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_STAT_STUNNED) || HasUnitState(UNIT_STAT_ROOT))
|
||||
{
|
||||
WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4);
|
||||
data << uint32(ERR_TAXIPLAYERBUSY);
|
||||
@@ -20688,7 +20688,7 @@ void Player::SendInitialVisiblePackets(Unit* target)
|
||||
{
|
||||
if (target->GetMotionMaster()->GetCurrentMovementGeneratorType() != IDLE_MOTION_TYPE)
|
||||
target->SendMonsterMoveWithSpeedToCurrentDestination(this);
|
||||
if (target->hasUnitState(UNIT_STAT_MELEE_ATTACKING) && target->getVictim())
|
||||
if (target->HasUnitState(UNIT_STAT_MELEE_ATTACKING) && target->getVictim())
|
||||
target->SendMeleeAttackStart(target->getVictim());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1695,7 +1695,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
void SetContestedPvPTimer(uint32 newTime) {m_contestedPvPTimer = newTime;}
|
||||
void ResetContestedPvP()
|
||||
{
|
||||
clearUnitState(UNIT_STAT_ATTACK_PLAYER);
|
||||
ClearUnitState(UNIT_STAT_ATTACK_PLAYER);
|
||||
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP);
|
||||
m_contestedPvPTimer = 0;
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ void Unit::Update(uint32 p_time)
|
||||
}
|
||||
|
||||
//not implemented before 3.0.2
|
||||
//if (!hasUnitState(UNIT_STAT_CASTING))
|
||||
//if (!HasUnitState(UNIT_STAT_CASTING))
|
||||
{
|
||||
if (uint32 base_att = getAttackTimer(BASE_ATTACK))
|
||||
setAttackTimer(BASE_ATTACK, (p_time >= base_att ? 0 : base_att - p_time));
|
||||
@@ -359,7 +359,7 @@ void Unit::SendMonsterStop(bool on_death)
|
||||
|
||||
SendMessageToSet(&data, true);
|
||||
|
||||
clearUnitState(UNIT_STAT_MOVE);
|
||||
ClearUnitState(UNIT_STAT_MOVE);
|
||||
}
|
||||
|
||||
void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 Time, Player* player)
|
||||
@@ -382,7 +382,7 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 T
|
||||
else
|
||||
SendMessageToSet(&data, true);
|
||||
|
||||
addUnitState(UNIT_STAT_MOVE);
|
||||
AddUnitState(UNIT_STAT_MOVE);
|
||||
}
|
||||
|
||||
void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 MoveFlags, uint32 time, float speedZ, Player *player)
|
||||
@@ -513,12 +513,12 @@ bool Unit::HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint
|
||||
|
||||
void Unit::DealDamageMods(Unit *pVictim, uint32 &damage, uint32* absorb)
|
||||
{
|
||||
if (!pVictim->isAlive() || pVictim->hasUnitState(UNIT_STAT_UNATTACKABLE) || (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->ToCreature()->IsInEvadeMode()))
|
||||
if (!pVictim->isAlive() || pVictim->HasUnitState(UNIT_STAT_IN_FLIGHT) || (pVictim->HasUnitState(UNIT_STAT_ONVEHICLE) && pVictim->GetVehicleBase() != this) || (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->ToCreature()->IsInEvadeMode()))
|
||||
{
|
||||
if (absorb)
|
||||
*absorb += damage;
|
||||
damage = 0;
|
||||
return;
|
||||
if (absorb)
|
||||
*absorb += damage;
|
||||
damage = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
//You don't lose health from damage taken from another player while in a sanctuary
|
||||
@@ -1061,7 +1061,7 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss)
|
||||
if (!pVictim)
|
||||
return;
|
||||
|
||||
if (!pVictim->isAlive() || pVictim->hasUnitState(UNIT_STAT_UNATTACKABLE) || (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->ToCreature()->IsInEvadeMode()))
|
||||
if (!pVictim->isAlive() || pVictim->HasUnitState(UNIT_STAT_IN_FLIGHT) || (pVictim->HasUnitState(UNIT_STAT_ONVEHICLE) && pVictim->GetVehicleBase() != this) || (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->ToCreature()->IsInEvadeMode()))
|
||||
return;
|
||||
|
||||
SpellEntry const *spellProto = sSpellStore.LookupEntry(damageInfo->SpellID);
|
||||
@@ -1298,7 +1298,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
|
||||
{
|
||||
Unit *pVictim = damageInfo->target;
|
||||
|
||||
if (!pVictim->isAlive() || pVictim->hasUnitState(UNIT_STAT_UNATTACKABLE) || (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->ToCreature()->IsInEvadeMode()))
|
||||
if (!pVictim->isAlive() || pVictim->HasUnitState(UNIT_STAT_IN_FLIGHT) || (pVictim->HasUnitState(UNIT_STAT_ONVEHICLE) && pVictim->GetVehicleBase() != this) || (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->ToCreature()->IsInEvadeMode()))
|
||||
return;
|
||||
|
||||
//You don't lose health from damage taken from another player while in a sanctuary
|
||||
@@ -2236,7 +2236,7 @@ void Unit::CalcHealAbsorb(Unit *pVictim, const SpellEntry *healSpell, uint32 &he
|
||||
|
||||
void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool extra)
|
||||
{
|
||||
if (hasUnitState(UNIT_STAT_CANNOT_AUTOATTACK) || HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED))
|
||||
if (HasUnitState(UNIT_STAT_CANNOT_AUTOATTACK) || HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED))
|
||||
return;
|
||||
|
||||
if (!pVictim->isAlive())
|
||||
@@ -2927,7 +2927,7 @@ uint32 Unit::GetDefenseSkillValue(Unit const* target) const
|
||||
|
||||
float Unit::GetUnitDodgeChance() const
|
||||
{
|
||||
if (hasUnitState(UNIT_STAT_STUNNED))
|
||||
if (HasUnitState(UNIT_STAT_STUNNED))
|
||||
return 0.0f;
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
return GetFloatValue(PLAYER_DODGE_PERCENTAGE);
|
||||
@@ -2946,7 +2946,7 @@ float Unit::GetUnitDodgeChance() const
|
||||
|
||||
float Unit::GetUnitParryChance() const
|
||||
{
|
||||
if (IsNonMeleeSpellCasted(false) || hasUnitState(UNIT_STAT_STUNNED))
|
||||
if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STAT_STUNNED))
|
||||
return 0.0f;
|
||||
|
||||
float chance = 0.0f;
|
||||
@@ -2978,7 +2978,7 @@ float Unit::GetUnitParryChance() const
|
||||
|
||||
float Unit::GetUnitBlockChance() const
|
||||
{
|
||||
if (IsNonMeleeSpellCasted(false) || hasUnitState(UNIT_STAT_STUNNED))
|
||||
if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STAT_STUNNED))
|
||||
return 0.0f;
|
||||
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -3231,7 +3231,7 @@ void Unit::SetCurrentCastedSpell(Spell * pSpell)
|
||||
InterruptSpell(CURRENT_AUTOREPEAT_SPELL);
|
||||
m_AutoRepeatFirstCast = true;
|
||||
}
|
||||
addUnitState(UNIT_STAT_CASTING);
|
||||
AddUnitState(UNIT_STAT_CASTING);
|
||||
} break;
|
||||
|
||||
case CURRENT_CHANNELED_SPELL:
|
||||
@@ -3244,7 +3244,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_STAT_CASTING);
|
||||
} break;
|
||||
|
||||
case CURRENT_AUTOREPEAT_SPELL:
|
||||
@@ -9461,16 +9461,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_STAT_MELEE_ATTACKING))
|
||||
{
|
||||
addUnitState(UNIT_STAT_MELEE_ATTACKING);
|
||||
AddUnitState(UNIT_STAT_MELEE_ATTACKING);
|
||||
SendMeleeAttackStart(victim);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (hasUnitState(UNIT_STAT_MELEE_ATTACKING))
|
||||
else if (HasUnitState(UNIT_STAT_MELEE_ATTACKING))
|
||||
{
|
||||
clearUnitState(UNIT_STAT_MELEE_ATTACKING);
|
||||
ClearUnitState(UNIT_STAT_MELEE_ATTACKING);
|
||||
SendMeleeAttackStop(victim);
|
||||
return true;
|
||||
}
|
||||
@@ -9480,7 +9480,7 @@ bool Unit::Attack(Unit *victim, bool meleeAttack)
|
||||
//switch target
|
||||
InterruptSpell(CURRENT_MELEE_SPELL);
|
||||
if (!meleeAttack)
|
||||
clearUnitState(UNIT_STAT_MELEE_ATTACKING);
|
||||
ClearUnitState(UNIT_STAT_MELEE_ATTACKING);
|
||||
}
|
||||
|
||||
if (m_attacking)
|
||||
@@ -9493,7 +9493,7 @@ bool Unit::Attack(Unit *victim, bool meleeAttack)
|
||||
SetUInt64Value(UNIT_FIELD_TARGET, victim->GetGUID());
|
||||
|
||||
if (meleeAttack)
|
||||
addUnitState(UNIT_STAT_MELEE_ATTACKING);
|
||||
AddUnitState(UNIT_STAT_MELEE_ATTACKING);
|
||||
|
||||
// set position before any AI calls/assistance
|
||||
//if (GetTypeId() == TYPEID_UNIT)
|
||||
@@ -9534,7 +9534,7 @@ bool Unit::AttackStop()
|
||||
// Clear our target
|
||||
SetUInt64Value(UNIT_FIELD_TARGET, 0);
|
||||
|
||||
clearUnitState(UNIT_STAT_MELEE_ATTACKING);
|
||||
ClearUnitState(UNIT_STAT_MELEE_ATTACKING);
|
||||
|
||||
InterruptSpell(CURRENT_MELEE_SPELL);
|
||||
|
||||
@@ -9577,7 +9577,7 @@ void Unit::CombatStopWithPets(bool includingCast)
|
||||
|
||||
bool Unit::isAttackingPlayer() const
|
||||
{
|
||||
if (hasUnitState(UNIT_STAT_ATTACK_PLAYER))
|
||||
if (HasUnitState(UNIT_STAT_ATTACK_PLAYER))
|
||||
return true;
|
||||
|
||||
for (ControlList::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
|
||||
@@ -10949,7 +10949,7 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
|
||||
// Judgement of Command proc always crits on stunned target
|
||||
if (spellProto->SpellFamilyName == SPELLFAMILY_PALADIN)
|
||||
if (spellProto->SpellFamilyFlags[0] & 0x0000000000800000LL && spellProto->SpellIconID == 561)
|
||||
if (pVictim->hasUnitState(UNIT_STAT_STUNNED))
|
||||
if (pVictim->HasUnitState(UNIT_STAT_STUNNED))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -11930,7 +11930,7 @@ void Unit::Unmount()
|
||||
{
|
||||
if (Pet *pPet = this->ToPlayer()->GetPet())
|
||||
{
|
||||
if (pPet && pPet->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED) && !pPet->hasUnitState(UNIT_STAT_STUNNED))
|
||||
if (pPet && pPet->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED) && !pPet->HasUnitState(UNIT_STAT_STUNNED))
|
||||
pPet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
|
||||
}
|
||||
else
|
||||
@@ -12009,7 +12009,7 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy)
|
||||
if (PvP)
|
||||
m_CombatTimer = 5000;
|
||||
|
||||
if (isInCombat() || hasUnitState(UNIT_STAT_EVADE))
|
||||
if (isInCombat() || HasUnitState(UNIT_STAT_EVADE))
|
||||
return;
|
||||
|
||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
|
||||
@@ -12060,7 +12060,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_STAT_ATTACK_PLAYER);
|
||||
if (HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED))
|
||||
SetUInt32Value(UNIT_DYNAMIC_FLAGS, ((Creature*)this)->GetCreatureInfo()->dynamicflags);
|
||||
}
|
||||
@@ -12083,7 +12083,7 @@ void Unit::ClearInCombat()
|
||||
//TODO: remove this function
|
||||
bool Unit::isTargetableForAttack() const
|
||||
{
|
||||
return isAttackableByAOE() && !hasUnitState(UNIT_STAT_DIED);
|
||||
return isAttackableByAOE() && !HasUnitState(UNIT_STAT_DIED);
|
||||
}
|
||||
|
||||
bool Unit::canAttack(Unit const* target, bool force) const
|
||||
@@ -12110,7 +12110,7 @@ bool Unit::canAttack(Unit const* target, bool force) const
|
||||
else if (!IsHostileTo(target))
|
||||
return false;
|
||||
|
||||
if (!target->isAttackableByAOE() || target->hasUnitState(UNIT_STAT_DIED))
|
||||
if (!target->isAttackableByAOE() || target->HasUnitState(UNIT_STAT_DIED))
|
||||
return false;
|
||||
|
||||
if (m_vehicle)
|
||||
@@ -12132,7 +12132,7 @@ bool Unit::isAttackableByAOE(bool requireDeadTarget) const
|
||||
if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->isGameMaster())
|
||||
return false;
|
||||
|
||||
return !hasUnitState(UNIT_STAT_UNATTACKABLE);
|
||||
return !HasUnitState(UNIT_STAT_UNATTACKABLE);
|
||||
}
|
||||
|
||||
int32 Unit::ModifyHealth(int32 dVal)
|
||||
@@ -14445,7 +14445,7 @@ void Unit::SendPetAIReaction(uint64 guid)
|
||||
|
||||
void Unit::StopMoving()
|
||||
{
|
||||
clearUnitState(UNIT_STAT_MOVING);
|
||||
ClearUnitState(UNIT_STAT_MOVING);
|
||||
|
||||
// send explicit stop packet
|
||||
// rely on vmaps here because for example stormwind is in air
|
||||
@@ -14804,16 +14804,16 @@ void Unit::SetContestedPvP(Player *attackedPlayer)
|
||||
return;
|
||||
|
||||
player->SetContestedPvPTimer(30000);
|
||||
if (!player->hasUnitState(UNIT_STAT_ATTACK_PLAYER))
|
||||
if (!player->HasUnitState(UNIT_STAT_ATTACK_PLAYER))
|
||||
{
|
||||
player->addUnitState(UNIT_STAT_ATTACK_PLAYER);
|
||||
player->AddUnitState(UNIT_STAT_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_STAT_ATTACK_PLAYER))
|
||||
{
|
||||
addUnitState(UNIT_STAT_ATTACK_PLAYER);
|
||||
AddUnitState(UNIT_STAT_ATTACK_PLAYER);
|
||||
// call MoveInLineOfSight for nearby contested guards
|
||||
UpdateObjectVisibility();
|
||||
}
|
||||
@@ -15394,10 +15394,10 @@ void Unit::SetControlled(bool apply, UnitState state)
|
||||
{
|
||||
if (apply)
|
||||
{
|
||||
if (hasUnitState(state))
|
||||
if (HasUnitState(state))
|
||||
return;
|
||||
|
||||
addUnitState(state);
|
||||
AddUnitState(state);
|
||||
switch(state)
|
||||
{
|
||||
case UNIT_STAT_STUNNED:
|
||||
@@ -15405,18 +15405,18 @@ void Unit::SetControlled(bool apply, UnitState state)
|
||||
CastStop();
|
||||
break;
|
||||
case UNIT_STAT_ROOT:
|
||||
if (!hasUnitState(UNIT_STAT_STUNNED))
|
||||
if (!HasUnitState(UNIT_STAT_STUNNED))
|
||||
SetRooted(true);
|
||||
break;
|
||||
case UNIT_STAT_CONFUSED:
|
||||
if (!hasUnitState(UNIT_STAT_STUNNED))
|
||||
if (!HasUnitState(UNIT_STAT_STUNNED))
|
||||
{
|
||||
SetConfused(true);
|
||||
CastStop();
|
||||
}
|
||||
break;
|
||||
case UNIT_STAT_FLEEING:
|
||||
if (!hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_CONFUSED))
|
||||
if (!HasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_CONFUSED))
|
||||
{
|
||||
SetFeared(true);
|
||||
CastStop();
|
||||
@@ -15441,18 +15441,18 @@ void Unit::SetControlled(bool apply, UnitState state)
|
||||
default: return;
|
||||
}
|
||||
|
||||
clearUnitState(state);
|
||||
ClearUnitState(state);
|
||||
|
||||
if (hasUnitState(UNIT_STAT_STUNNED))
|
||||
if (HasUnitState(UNIT_STAT_STUNNED))
|
||||
SetStunned(true);
|
||||
else
|
||||
{
|
||||
if (hasUnitState(UNIT_STAT_ROOT))
|
||||
if (HasUnitState(UNIT_STAT_ROOT))
|
||||
SetRooted(true);
|
||||
|
||||
if (hasUnitState(UNIT_STAT_CONFUSED))
|
||||
if (HasUnitState(UNIT_STAT_CONFUSED))
|
||||
SetConfused(true);
|
||||
else if (hasUnitState(UNIT_STAT_FLEEING))
|
||||
else if (HasUnitState(UNIT_STAT_FLEEING))
|
||||
SetFeared(true);
|
||||
}
|
||||
}
|
||||
@@ -15488,7 +15488,7 @@ void Unit::SetStunned(bool apply)
|
||||
if (!pOwner || (pOwner->GetTypeId() == TYPEID_PLAYER && !pOwner->ToPlayer()->IsMounted()))
|
||||
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
|
||||
|
||||
if (!hasUnitState(UNIT_STAT_ROOT)) // prevent allow move if have also root effect
|
||||
if (!HasUnitState(UNIT_STAT_ROOT)) // prevent allow move if have also root effect
|
||||
{
|
||||
WorldPacket data(SMSG_FORCE_MOVE_UNROOT, 8+4);
|
||||
data.append(GetPackGUID());
|
||||
@@ -15519,7 +15519,7 @@ void Unit::SetRooted(bool apply)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!hasUnitState(UNIT_STAT_STUNNED)) // prevent allow move if have also stun effect
|
||||
if (!HasUnitState(UNIT_STAT_STUNNED)) // prevent allow move if have also stun effect
|
||||
{
|
||||
m_rootTimes++; //blizzard internal check?
|
||||
|
||||
@@ -15604,7 +15604,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type)
|
||||
return false;
|
||||
}
|
||||
|
||||
//if (hasUnitState(UNIT_STAT_UNATTACKABLE))
|
||||
//if (HasUnitState(UNIT_STAT_UNATTACKABLE))
|
||||
// return false;
|
||||
|
||||
if (GetTypeId() == TYPEID_PLAYER && this->ToPlayer()->GetTransport())
|
||||
@@ -15685,7 +15685,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type)
|
||||
charmer->ToPlayer()->VehicleSpellInitialize();
|
||||
break;
|
||||
case CHARM_TYPE_POSSESS:
|
||||
addUnitState(UNIT_STAT_POSSESSED);
|
||||
AddUnitState(UNIT_STAT_POSSESSED);
|
||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
|
||||
charmer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
charmer->ToPlayer()->SetClientControl(this, 1);
|
||||
@@ -15735,7 +15735,7 @@ void Unit::RemoveCharmedBy(Unit *charmer)
|
||||
}
|
||||
|
||||
CharmType type;
|
||||
if (hasUnitState(UNIT_STAT_POSSESSED))
|
||||
if (HasUnitState(UNIT_STAT_POSSESSED))
|
||||
type = CHARM_TYPE_POSSESS;
|
||||
else if (charmer->IsOnVehicle(this))
|
||||
type = CHARM_TYPE_VEHICLE;
|
||||
@@ -15753,7 +15753,7 @@ void Unit::RemoveCharmedBy(Unit *charmer)
|
||||
|
||||
if (type == CHARM_TYPE_POSSESS)
|
||||
{
|
||||
clearUnitState(UNIT_STAT_POSSESSED);
|
||||
ClearUnitState(UNIT_STAT_POSSESSED);
|
||||
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
|
||||
}
|
||||
|
||||
|
||||
@@ -1169,12 +1169,12 @@ class Unit : public WorldObject
|
||||
void SendMeleeAttackStop(Unit* victim);
|
||||
void SendMeleeAttackStart(Unit* pVictim);
|
||||
|
||||
void addUnitState(uint32 f) { m_state |= f; }
|
||||
bool hasUnitState(const uint32 f) const { return (m_state & f); }
|
||||
void clearUnitState(uint32 f) { m_state &= ~f; }
|
||||
void AddUnitState(uint32 f) { m_state |= f; }
|
||||
bool HasUnitState(const uint32 f) const { return (m_state & f); }
|
||||
void ClearUnitState(uint32 f) { m_state &= ~f; }
|
||||
bool CanFreeMove() const
|
||||
{
|
||||
return !hasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_FLEEING | UNIT_STAT_IN_FLIGHT |
|
||||
return !HasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_FLEEING | UNIT_STAT_IN_FLIGHT |
|
||||
UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED) && GetOwnerGUID() == 0;
|
||||
}
|
||||
|
||||
@@ -1387,7 +1387,7 @@ class Unit : public WorldObject
|
||||
//Need fix or use this
|
||||
bool isGuard() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GUARD); }
|
||||
|
||||
bool isInFlight() const { return hasUnitState(UNIT_STAT_IN_FLIGHT); }
|
||||
bool isInFlight() const { return HasUnitState(UNIT_STAT_IN_FLIGHT); }
|
||||
|
||||
bool isInCombat() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); }
|
||||
void CombatStart(Unit* target, bool initialAggro = true);
|
||||
@@ -1531,8 +1531,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_STAT_POSSESSED); }
|
||||
bool isPossessedByPlayer() const { return HasUnitState(UNIT_STAT_POSSESSED) && IS_PLAYER_GUID(GetCharmerGUID()); }
|
||||
bool isPossessing() const
|
||||
{
|
||||
if (Unit *u = GetCharm())
|
||||
@@ -1766,7 +1766,7 @@ class Unit : public WorldObject
|
||||
bool isInFrontInMap(Unit const* target,float distance, float arc = M_PI) const;
|
||||
void SetInFront(Unit const* target)
|
||||
{
|
||||
if (!hasUnitState(UNIT_STAT_CANNOT_TURN))
|
||||
if (!HasUnitState(UNIT_STAT_CANNOT_TURN))
|
||||
SetOrientation(GetAngle(target));
|
||||
}
|
||||
bool isInBackInMap(Unit const* target, float distance, float arc = M_PI) const;
|
||||
@@ -1900,7 +1900,7 @@ class Unit : public WorldObject
|
||||
|
||||
MotionMaster* GetMotionMaster(){ return &i_motionMaster; }
|
||||
|
||||
bool IsStopped() const { return !(hasUnitState(UNIT_STAT_MOVING)); }
|
||||
bool IsStopped() const { return !(HasUnitState(UNIT_STAT_MOVING)); }
|
||||
void StopMoving();
|
||||
|
||||
void AddUnitMovementFlag(uint32 f) { m_movementInfo.flags |= f; }
|
||||
|
||||
@@ -311,7 +311,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId)
|
||||
}
|
||||
|
||||
if (seat->second.seatInfo->m_flags && !(seat->second.seatInfo->m_flags & VEHICLE_SEAT_FLAG_UNK11))
|
||||
unit->addUnitState(UNIT_STAT_ONVEHICLE);
|
||||
unit->AddUnitState(UNIT_STAT_ONVEHICLE);
|
||||
|
||||
unit->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
|
||||
VehicleSeatEntry const *veSeat = seat->second.seatInfo;
|
||||
@@ -392,7 +392,7 @@ void Vehicle::RemovePassenger(Unit *unit)
|
||||
++m_usableSeatNum;
|
||||
}
|
||||
|
||||
unit->clearUnitState(UNIT_STAT_ONVEHICLE);
|
||||
unit->ClearUnitState(UNIT_STAT_ONVEHICLE);
|
||||
|
||||
if (me->GetTypeId() == TYPEID_UNIT
|
||||
&& unit->GetTypeId() == TYPEID_PLAYER
|
||||
|
||||
@@ -116,7 +116,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_STAT_SIGHTLESS))
|
||||
if (c->IsAIEnabled && c->canSeeOrDetect(u, false, true))
|
||||
c->AI()->MoveInLineOfSight_Safe(u);
|
||||
}
|
||||
|
||||
@@ -735,7 +735,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_STAT_STUNNED) || u->HasUnitState(UNIT_STAT_CONFUSED)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -94,11 +94,11 @@ class ObjectWorldLoader
|
||||
uint32 i_corpses;
|
||||
};
|
||||
|
||||
template<class T> void addUnitState(T* /*obj*/, CellPair const& /*cell_pair*/)
|
||||
template<class T> void AddUnitState(T* /*obj*/, CellPair const& /*cell_pair*/)
|
||||
{
|
||||
}
|
||||
|
||||
template<> void addUnitState(Creature *obj, CellPair const& cell_pair)
|
||||
template<> void AddUnitState(Creature *obj, CellPair const& cell_pair)
|
||||
{
|
||||
Cell cell(cell_pair);
|
||||
|
||||
@@ -109,7 +109,7 @@ template <class T>
|
||||
void AddObjectHelper(CellPair &cell, GridRefManager<T> &m, uint32 &count, Map* map, T *obj)
|
||||
{
|
||||
obj->GetGridRef().link(&m, obj);
|
||||
addUnitState(obj,cell);
|
||||
AddUnitState(obj,cell);
|
||||
obj->AddToWorld();
|
||||
if (obj->isActiveObject())
|
||||
map->AddToActive(obj);
|
||||
|
||||
@@ -109,10 +109,10 @@ DestinationHolder<TRAVELLER>::UpdateTraveller(TRAVELLER &traveller, uint32 diff,
|
||||
GetLocationNowNoMicroMovement(x, y, z);
|
||||
else
|
||||
{
|
||||
if (!traveller.GetTraveller().hasUnitState(UNIT_STAT_MOVING | UNIT_STAT_IN_FLIGHT))
|
||||
if (!traveller.GetTraveller().HasUnitState(UNIT_STAT_MOVING | UNIT_STAT_IN_FLIGHT))
|
||||
return true;
|
||||
|
||||
if (traveller.GetTraveller().hasUnitState(UNIT_STAT_IN_FLIGHT))
|
||||
if (traveller.GetTraveller().HasUnitState(UNIT_STAT_IN_FLIGHT))
|
||||
GetLocationNow(traveller.GetTraveller().GetBaseMap() ,x, y, z, true); // Should reposition Object with right Coord, so I can bypass some Grid Relocation
|
||||
else
|
||||
GetLocationNow(traveller.GetTraveller().GetBaseMap(), x, y, z, false);
|
||||
|
||||
@@ -79,7 +79,7 @@ MotionMaster::~MotionMaster()
|
||||
void
|
||||
MotionMaster::UpdateMotion(uint32 diff)
|
||||
{
|
||||
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_STAT_ROOT | UNIT_STAT_STUNNED)) // what about UNIT_STAT_DISTRACTED? Why is this not included?
|
||||
return;
|
||||
ASSERT(!empty());
|
||||
m_cleanFlag |= MMCF_UPDATE;
|
||||
@@ -197,7 +197,7 @@ MotionMaster::MoveRandom(float spawndist)
|
||||
void
|
||||
MotionMaster::MoveTargetedHome()
|
||||
{
|
||||
//if (i_owner->hasUnitState(UNIT_STAT_FLEEING))
|
||||
//if (i_owner->HasUnitState(UNIT_STAT_FLEEING))
|
||||
// return;
|
||||
|
||||
Clear(false);
|
||||
@@ -236,7 +236,7 @@ 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_STAT_FOLLOW);
|
||||
if (i_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
sLog.outStaticDebug("Player (GUID: %u) chase to %s (GUID: %u)",
|
||||
@@ -262,7 +262,7 @@ MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlot slo
|
||||
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_STAT_FOLLOW);
|
||||
if (i_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
sLog.outStaticDebug("Player (GUID: %u) follow to %s (GUID: %u)", i_owner->GetGUIDLow(),
|
||||
@@ -329,7 +329,7 @@ void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float spee
|
||||
if (i_owner->IsNonMeleeSpellCasted(true))
|
||||
i_owner->InterruptNonMeleeSpells(true);
|
||||
|
||||
i_owner->addUnitState(UNIT_STAT_CHARGING | UNIT_STAT_JUMPING);
|
||||
i_owner->AddUnitState(UNIT_STAT_CHARGING | UNIT_STAT_JUMPING);
|
||||
i_owner->m_TempSpeed = speedXY;
|
||||
if (i_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
@@ -352,7 +352,7 @@ MotionMaster::MoveCharge(float x, float y, float z, float speed, uint32 id)
|
||||
if (Impl[MOTION_SLOT_CONTROLLED] && Impl[MOTION_SLOT_CONTROLLED]->GetMovementGeneratorType() != DISTRACT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
i_owner->addUnitState(UNIT_STAT_CHARGING);
|
||||
i_owner->AddUnitState(UNIT_STAT_CHARGING);
|
||||
i_owner->m_TempSpeed = speed;
|
||||
if (i_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
|
||||
@@ -90,7 +90,7 @@ ConfusedMovementGenerator<T>::Initialize(T &unit)
|
||||
unit.CastStop();
|
||||
unit.StopMoving();
|
||||
unit.RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
unit.addUnitState(UNIT_STAT_CONFUSED);
|
||||
unit.AddUnitState(UNIT_STAT_CONFUSED);
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -126,7 +126,7 @@ ConfusedMovementGenerator<T>::Update(T &unit, const uint32 &diff)
|
||||
if (!&unit)
|
||||
return true;
|
||||
|
||||
if (unit.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
|
||||
if (unit.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
|
||||
return true;
|
||||
|
||||
if (i_nextMoveTime.Passed())
|
||||
@@ -138,7 +138,7 @@ ConfusedMovementGenerator<T>::Update(T &unit, const uint32 &diff)
|
||||
if (i_destinationHolder.HasArrived())
|
||||
{
|
||||
// arrived, stop and wait a bit
|
||||
unit.clearUnitState(UNIT_STAT_MOVE);
|
||||
unit.ClearUnitState(UNIT_STAT_MOVE);
|
||||
|
||||
i_nextMove = urand(1,MAX_CONF_WAYPOINTS);
|
||||
i_nextMoveTime.Reset(urand(0, 1500-1)); // TODO: check the minimum reset time, should be probably higher
|
||||
@@ -168,7 +168,7 @@ void
|
||||
ConfusedMovementGenerator<T>::Finalize(T &unit)
|
||||
{
|
||||
unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
|
||||
unit.clearUnitState(UNIT_STAT_CONFUSED);
|
||||
unit.ClearUnitState(UNIT_STAT_CONFUSED);
|
||||
if (unit.GetTypeId() == TYPEID_UNIT && unit.getVictim())
|
||||
unit.SetUInt64Value(UNIT_FIELD_TARGET, unit.getVictim()->GetGUID());
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ FleeingMovementGenerator<T>::_setTargetLocation(T &owner)
|
||||
if (!&owner)
|
||||
return;
|
||||
|
||||
if (owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED))
|
||||
if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED))
|
||||
return;
|
||||
|
||||
if (!_setMoveData(owner))
|
||||
@@ -43,7 +43,7 @@ FleeingMovementGenerator<T>::_setTargetLocation(T &owner)
|
||||
if (!_getPoint(owner, x, y, z))
|
||||
return;
|
||||
|
||||
owner.addUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING);
|
||||
owner.AddUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING);
|
||||
Traveller<T> traveller(owner);
|
||||
i_destinationHolder.SetDestination(traveller, x, y, z);
|
||||
}
|
||||
@@ -302,7 +302,7 @@ FleeingMovementGenerator<T>::Initialize(T &owner)
|
||||
|
||||
_Init(owner);
|
||||
owner.CastStop();
|
||||
owner.addUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING);
|
||||
owner.AddUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING);
|
||||
owner.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
|
||||
owner.SetUInt64Value(UNIT_FIELD_TARGET, 0);
|
||||
owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
@@ -351,7 +351,7 @@ void
|
||||
FleeingMovementGenerator<T>::Finalize(T &owner)
|
||||
{
|
||||
owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
|
||||
owner.clearUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING);
|
||||
owner.ClearUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING);
|
||||
if (owner.GetTypeId() == TYPEID_UNIT && owner.getVictim())
|
||||
owner.SetUInt64Value(UNIT_FIELD_TARGET, owner.getVictim()->GetGUID());
|
||||
}
|
||||
@@ -369,7 +369,7 @@ 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_STAT_ROOT | UNIT_STAT_STUNNED))
|
||||
return true;
|
||||
|
||||
Traveller<T> traveller(owner);
|
||||
@@ -412,7 +412,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_ROAMING);
|
||||
owner.ClearUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING);
|
||||
if (Unit* victim = owner.getVictim())
|
||||
{
|
||||
if (owner.isAlive())
|
||||
@@ -428,7 +428,7 @@ bool TimedFleeingMovementGenerator::Update(Unit & owner, const uint32 & time_dif
|
||||
if (!owner.isAlive())
|
||||
return false;
|
||||
|
||||
if (owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED))
|
||||
if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED))
|
||||
return true;
|
||||
|
||||
i_totalFleeTime.Update(time_diff);
|
||||
|
||||
@@ -29,7 +29,7 @@ HomeMovementGenerator<Creature>::Initialize(Creature & owner)
|
||||
float x, y, z;
|
||||
owner.GetHomePosition(x, y, z, ori);
|
||||
owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
owner.addUnitState(UNIT_STAT_EVADE);
|
||||
owner.AddUnitState(UNIT_STAT_EVADE);
|
||||
_setTargetLocation(owner);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner)
|
||||
if (!&owner)
|
||||
return;
|
||||
|
||||
if (owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
|
||||
if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
|
||||
return;
|
||||
|
||||
float x, y, z;
|
||||
@@ -54,7 +54,7 @@ HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner)
|
||||
|
||||
uint32 travel_time = i_destinationHolder.SetDestination(traveller, x, y, z);
|
||||
modifyTravelTime(travel_time);
|
||||
owner.clearUnitState(UNIT_STAT_ALL_STATE & ~UNIT_STAT_EVADE);
|
||||
owner.ClearUnitState(UNIT_STAT_ALL_STATE & ~UNIT_STAT_EVADE);
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -77,7 +77,7 @@ HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32& time_diff
|
||||
owner.SendMessageToSet(&packet, false);
|
||||
}
|
||||
|
||||
owner.clearUnitState(UNIT_STAT_EVADE);
|
||||
owner.ClearUnitState(UNIT_STAT_EVADE);
|
||||
owner.LoadCreaturesAddon(true);
|
||||
owner.AI()->JustReachedHome();
|
||||
return false;
|
||||
|
||||
@@ -32,19 +32,19 @@ void IdleMovementGenerator::Initialize(Unit &owner)
|
||||
void
|
||||
IdleMovementGenerator::Reset(Unit& owner)
|
||||
{
|
||||
if (owner.hasUnitState(UNIT_STAT_MOVE))
|
||||
if (owner.HasUnitState(UNIT_STAT_MOVE))
|
||||
owner.StopMoving();
|
||||
}
|
||||
|
||||
void RotateMovementGenerator::Initialize(Unit& owner)
|
||||
{
|
||||
if (owner.hasUnitState(UNIT_STAT_MOVE))
|
||||
if (owner.HasUnitState(UNIT_STAT_MOVE))
|
||||
owner.StopMoving();
|
||||
|
||||
if (owner.getVictim())
|
||||
owner.SetInFront(owner.getVictim());
|
||||
|
||||
owner.addUnitState(UNIT_STAT_ROTATING);
|
||||
owner.AddUnitState(UNIT_STAT_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_STAT_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_STAT_DISTRACTED);
|
||||
}
|
||||
|
||||
void
|
||||
DistractMovementGenerator::Finalize(Unit& owner)
|
||||
{
|
||||
owner.clearUnitState(UNIT_STAT_DISTRACTED);
|
||||
owner.ClearUnitState(UNIT_STAT_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_STAT_DISTRACTED);
|
||||
unit.ToCreature()->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ void PointMovementGenerator<T>::Initialize(T &unit)
|
||||
unit.StopMoving();
|
||||
Traveller<T> traveller(unit);
|
||||
// knockback effect has UNIT_STAT_JUMPING set,so if here we disable sentmonstermove there will be creature position sync problem between client and server
|
||||
i_destinationHolder.SetDestination(traveller,i_x,i_y,i_z, true /* !unit.hasUnitState(UNIT_STAT_JUMPING)*/);
|
||||
i_destinationHolder.SetDestination(traveller,i_x,i_y,i_z, true /* !unit.HasUnitState(UNIT_STAT_JUMPING)*/);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@@ -39,9 +39,9 @@ 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_STAT_ROOT | UNIT_STAT_STUNNED))
|
||||
{
|
||||
if (unit.hasUnitState(UNIT_STAT_CHARGING))
|
||||
if (unit.HasUnitState(UNIT_STAT_CHARGING))
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
@@ -53,7 +53,7 @@ bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff)
|
||||
|
||||
if (i_destinationHolder.HasArrived())
|
||||
{
|
||||
unit.clearUnitState(UNIT_STAT_MOVE);
|
||||
unit.ClearUnitState(UNIT_STAT_MOVE);
|
||||
arrived = true;
|
||||
return false;
|
||||
}
|
||||
@@ -64,8 +64,8 @@ bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff)
|
||||
template<class T>
|
||||
void PointMovementGenerator<T>:: Finalize(T &unit)
|
||||
{
|
||||
if (unit.hasUnitState(UNIT_STAT_CHARGING))
|
||||
unit.clearUnitState(UNIT_STAT_CHARGING | UNIT_STAT_JUMPING);
|
||||
if (unit.HasUnitState(UNIT_STAT_CHARGING))
|
||||
unit.ClearUnitState(UNIT_STAT_CHARGING | UNIT_STAT_JUMPING);
|
||||
if (arrived) // without this crash!
|
||||
MovementInform(unit);
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature)
|
||||
Traveller<Creature> traveller(creature);
|
||||
creature.SetOrientation(creature.GetAngle(nx,ny));
|
||||
i_destinationHolder.SetDestination(traveller, nx, ny, nz);
|
||||
creature.addUnitState(UNIT_STAT_ROAMING);
|
||||
creature.AddUnitState(UNIT_STAT_ROAMING);
|
||||
if (is_air_ok)
|
||||
{
|
||||
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
|
||||
@@ -164,20 +164,20 @@ 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_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
|
||||
{
|
||||
i_nextMoveTime.Update(i_nextMoveTime.GetExpiry()); // Expire the timer
|
||||
creature.clearUnitState(UNIT_STAT_ROAMING);
|
||||
creature.ClearUnitState(UNIT_STAT_ROAMING);
|
||||
return true;
|
||||
}
|
||||
|
||||
i_nextMoveTime.Update(diff);
|
||||
|
||||
if (i_destinationHolder.HasArrived() && !creature.IsStopped() && !creature.canFly())
|
||||
creature.clearUnitState(UNIT_STAT_ROAMING | UNIT_STAT_MOVE);
|
||||
creature.ClearUnitState(UNIT_STAT_ROAMING | UNIT_STAT_MOVE);
|
||||
|
||||
if (!i_destinationHolder.HasArrived() && creature.IsStopped())
|
||||
creature.addUnitState(UNIT_STAT_ROAMING);
|
||||
creature.AddUnitState(UNIT_STAT_ROAMING);
|
||||
|
||||
CreatureTraveller traveller(creature);
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ TargetedMovementGenerator<T>::_setTargetLocation(T &owner)
|
||||
if (!i_target.isValid() || !i_target->IsInWorld())
|
||||
return false;
|
||||
|
||||
if (owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
|
||||
if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
|
||||
return false;
|
||||
|
||||
float x, y, z;
|
||||
@@ -70,7 +70,7 @@ TargetedMovementGenerator<T>::_setTargetLocation(T &owner)
|
||||
if (i_target->IsWithinMeleeRange(&owner))
|
||||
return false;
|
||||
}
|
||||
else if (!i_angle && !owner.hasUnitState(UNIT_STAT_FOLLOW))
|
||||
else if (!i_angle && !owner.HasUnitState(UNIT_STAT_FOLLOW))
|
||||
{
|
||||
if (i_target->IsWithinDistInMap(&owner, i_offset))
|
||||
return false;
|
||||
@@ -89,7 +89,7 @@ TargetedMovementGenerator<T>::_setTargetLocation(T &owner)
|
||||
if (i_target->IsWithinMeleeRange(&owner, 0))
|
||||
stop = true;
|
||||
}
|
||||
else if (!i_angle && !owner.hasUnitState(UNIT_STAT_FOLLOW))
|
||||
else if (!i_angle && !owner.HasUnitState(UNIT_STAT_FOLLOW))
|
||||
{
|
||||
if (i_target->IsWithinDist(&owner, i_offset * 0.8f))
|
||||
stop = true;
|
||||
@@ -114,7 +114,7 @@ TargetedMovementGenerator<T>::_setTargetLocation(T &owner)
|
||||
// to nearest random contact position
|
||||
i_target->GetRandomContactPoint(&owner, x, y, z, 0, MELEE_RANGE - 0.5f);
|
||||
}
|
||||
else if (!i_angle && !owner.hasUnitState(UNIT_STAT_FOLLOW))
|
||||
else if (!i_angle && !owner.HasUnitState(UNIT_STAT_FOLLOW))
|
||||
{
|
||||
// caster chase
|
||||
i_target->GetContactPoint(&owner, x, y, z, i_offset * urand(80, 95) * 0.01f);
|
||||
@@ -142,7 +142,7 @@ TargetedMovementGenerator<T>::_setTargetLocation(T &owner)
|
||||
return;
|
||||
*/
|
||||
i_destinationHolder.SetDestination(traveller, x, y, z);
|
||||
owner.addUnitState(UNIT_STAT_CHASE);
|
||||
owner.AddUnitState(UNIT_STAT_CHASE);
|
||||
i_destinationHolder.StartTravel(traveller);
|
||||
return true;
|
||||
}
|
||||
@@ -161,7 +161,7 @@ template<class T>
|
||||
void
|
||||
TargetedMovementGenerator<T>::Finalize(T &owner)
|
||||
{
|
||||
owner.clearUnitState(UNIT_STAT_CHASE);
|
||||
owner.ClearUnitState(UNIT_STAT_CHASE);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@@ -181,11 +181,11 @@ TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff)
|
||||
if (!&owner || !owner.isAlive())
|
||||
return true;
|
||||
|
||||
if (owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_DISTRACTED))
|
||||
if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_DISTRACTED))
|
||||
return true;
|
||||
|
||||
// prevent movement while casting spells with cast time or channel time
|
||||
if (owner.hasUnitState(UNIT_STAT_CASTING))
|
||||
if (owner.HasUnitState(UNIT_STAT_CASTING))
|
||||
{
|
||||
if (!owner.IsStopped())
|
||||
owner.StopMoving();
|
||||
@@ -193,7 +193,7 @@ TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff)
|
||||
}
|
||||
|
||||
// prevent crash after creature killed pet
|
||||
if (!owner.hasUnitState(UNIT_STAT_FOLLOW) && owner.getVictim() != i_target.getTarget())
|
||||
if (!owner.HasUnitState(UNIT_STAT_FOLLOW) && owner.getVictim() != i_target.getTarget())
|
||||
return true;
|
||||
|
||||
Traveller<T> traveller(owner);
|
||||
@@ -202,7 +202,7 @@ TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff)
|
||||
_setTargetLocation(owner);
|
||||
else if (owner.IsStopped() && !i_destinationHolder.HasArrived())
|
||||
{
|
||||
owner.addUnitState(UNIT_STAT_CHASE);
|
||||
owner.AddUnitState(UNIT_STAT_CHASE);
|
||||
i_destinationHolder.StartTravel(traveller);
|
||||
return true;
|
||||
}
|
||||
@@ -217,7 +217,7 @@ TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff)
|
||||
if (i_targetX != i_target->GetPositionX() || i_targetY != i_target->GetPositionY()
|
||||
|| i_targetZ != i_target->GetPositionZ())
|
||||
{
|
||||
if (_setTargetLocation(owner) || !owner.hasUnitState(UNIT_STAT_FOLLOW))
|
||||
if (_setTargetLocation(owner) || !owner.HasUnitState(UNIT_STAT_FOLLOW))
|
||||
owner.SetInFront(i_target.getTarget());
|
||||
i_target->GetPosition(i_targetX, i_targetY, i_targetZ);
|
||||
}
|
||||
@@ -229,7 +229,7 @@ TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff)
|
||||
owner.SetInFront(i_target.getTarget());
|
||||
|
||||
owner.StopMoving();
|
||||
if (owner.IsWithinMeleeRange(i_target.getTarget()) && !owner.hasUnitState(UNIT_STAT_FOLLOW))
|
||||
if (owner.IsWithinMeleeRange(i_target.getTarget()) && !owner.HasUnitState(UNIT_STAT_FOLLOW))
|
||||
owner.Attack(i_target.getTarget(),true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ void WaypointMovementGenerator<Creature>::InitTraveller(Creature &unit, const Wa
|
||||
if (unit.canFly())
|
||||
unit.SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02);
|
||||
|
||||
unit.addUnitState(UNIT_STAT_ROAMING);
|
||||
unit.AddUnitState(UNIT_STAT_ROAMING);
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -143,7 +143,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
|
||||
|
||||
// Waypoint movement can be switched on/off
|
||||
// This is quite handy for escort quests and other stuff
|
||||
if (unit.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
|
||||
if (unit.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
|
||||
return true;
|
||||
|
||||
// Clear the generator if the path doesn't exist
|
||||
@@ -205,7 +205,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
|
||||
i_destinationHolder.ResetTravelTime();
|
||||
MovementInform(unit);
|
||||
unit.UpdateWaypointID(i_currentNode);
|
||||
unit.clearUnitState(UNIT_STAT_ROAMING);
|
||||
unit.ClearUnitState(UNIT_STAT_ROAMING);
|
||||
unit.Relocate(node->x, node->y, node->z);
|
||||
}
|
||||
}
|
||||
@@ -248,7 +248,7 @@ uint32 FlightPathMovementGenerator::GetPathAtMapEnd() const
|
||||
void FlightPathMovementGenerator::Initialize(Player &player)
|
||||
{
|
||||
player.getHostileRefManager().setOnlineOfflineState(false);
|
||||
player.addUnitState(UNIT_STAT_IN_FLIGHT);
|
||||
player.AddUnitState(UNIT_STAT_IN_FLIGHT);
|
||||
player.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
|
||||
Traveller<Player> traveller(player);
|
||||
// do not send movement, it was sent already
|
||||
@@ -260,7 +260,7 @@ void FlightPathMovementGenerator::Initialize(Player &player)
|
||||
|
||||
void FlightPathMovementGenerator::Finalize(Player & player)
|
||||
{
|
||||
player.clearUnitState(UNIT_STAT_IN_FLIGHT);
|
||||
player.ClearUnitState(UNIT_STAT_IN_FLIGHT);
|
||||
|
||||
float x = 0;
|
||||
float y = 0;
|
||||
|
||||
@@ -73,7 +73,7 @@ inline uint32 Traveller<T>::GetTotalTrevelTimeTo(float x, float y, float z)
|
||||
template<>
|
||||
inline float Traveller<Creature>::Speed()
|
||||
{
|
||||
if (i_traveller.hasUnitState(UNIT_STAT_CHARGING))
|
||||
if (i_traveller.HasUnitState(UNIT_STAT_CHARGING))
|
||||
return i_traveller.m_TempSpeed;
|
||||
else if (i_traveller.HasUnitMovementFlag(MOVEMENTFLAG_WALKING))
|
||||
return i_traveller.GetSpeed(MOVE_WALK);
|
||||
@@ -113,7 +113,7 @@ inline void Traveller<Creature>::MoveTo(float x, float y, float z, uint32 t)
|
||||
template<>
|
||||
inline float Traveller<Player>::Speed()
|
||||
{
|
||||
if (i_traveller.hasUnitState(UNIT_STAT_CHARGING))
|
||||
if (i_traveller.HasUnitState(UNIT_STAT_CHARGING))
|
||||
return i_traveller.m_TempSpeed;
|
||||
else if (i_traveller.isInFlight())
|
||||
return PLAYER_FLIGHT_SPEED;
|
||||
|
||||
@@ -45,7 +45,7 @@ void WorldSession::HandleAuctionHelloOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
SendAuctionHello(guid, unit);
|
||||
@@ -162,7 +162,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
Item *it = pl->GetItemByGuid(item);
|
||||
@@ -273,7 +273,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
AuctionHouseObject *auctionHouse = sAuctionMgr.GetAuctionsMap(pCreature->getFaction());
|
||||
@@ -391,7 +391,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap(pCreature->getFaction());
|
||||
@@ -476,7 +476,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap(pCreature->getFaction());
|
||||
@@ -523,7 +523,7 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap(pCreature->getFaction());
|
||||
@@ -576,7 +576,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap(pCreature->getFaction());
|
||||
|
||||
@@ -875,7 +875,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_STAT_STUNNED))
|
||||
pCurrChar->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
|
||||
m_playerLoading = false;
|
||||
|
||||
@@ -473,7 +473,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_STAT_DIED))
|
||||
return;
|
||||
|
||||
uint32 emote;
|
||||
@@ -550,7 +550,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_STAT_DIED))
|
||||
break;
|
||||
GetPlayer()->HandleEmoteCommand(emote_anim);
|
||||
break;
|
||||
|
||||
@@ -302,7 +302,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_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
if (Guild* pGuild = _GetPlayerGuild(this))
|
||||
|
||||
@@ -502,7 +502,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
Item *pItem = _player->GetItemByGuid(itemguid);
|
||||
@@ -607,7 +607,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
Item *pItem = _player->GetItemFromBuyBackSlot(slot);
|
||||
@@ -725,11 +725,11 @@ void WorldSession::SendListInventory(uint64 vendorguid)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
// Stop the npc if moving
|
||||
if (pCreature->hasUnitState(UNIT_STAT_MOVING))
|
||||
if (pCreature->HasUnitState(UNIT_STAT_MOVING))
|
||||
pCreature->StopMoving();
|
||||
|
||||
VendorItemData const* vItems = pCreature->GetVendorItems();
|
||||
|
||||
@@ -122,7 +122,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
if ((unit && unit->GetCreatureInfo()->ScriptID != unit->LastUsedScriptID) || (go && go->GetGOInfo()->ScriptId != go->LastUsedScriptID))
|
||||
|
||||
@@ -59,7 +59,7 @@ void WorldSession::HandleTabardVendorActivateOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
SendTabardVendorActivate(guid);
|
||||
@@ -88,7 +88,7 @@ void WorldSession::HandleBankerActivateOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
SendShowBank(guid);
|
||||
@@ -127,7 +127,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
// trainer list loaded at check;
|
||||
@@ -251,7 +251,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
if (!unit->isCanTrainingOf(_player,true))
|
||||
@@ -318,7 +318,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_STAT_DIED))
|
||||
// GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
if (unit->isArmorer() || unit->isCivilian() || unit->isQuestGiver() || unit->isServiceProvider())
|
||||
@@ -373,7 +373,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
if (!code.empty())
|
||||
@@ -404,7 +404,7 @@ void WorldSession::HandleSpiritHealerActivateOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
SendSpiritResurrect();
|
||||
@@ -459,7 +459,7 @@ void WorldSession::HandleBinderActivateOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
SendBindPoint(unit);
|
||||
@@ -504,7 +504,7 @@ void WorldSession::HandleListStabledPetsOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
// remove mounts this fix bug where getting pet from stable while mounted deletes pet.
|
||||
@@ -603,7 +603,7 @@ void WorldSession::HandleStablePet(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
Pet *pet = _player->GetPet();
|
||||
@@ -669,7 +669,7 @@ void WorldSession::HandleUnstablePet(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
m_unstablePetCallback.SetParam(petnumber);
|
||||
@@ -745,7 +745,7 @@ void WorldSession::HandleBuyStableSlot(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
if (GetPlayer()->m_stableSlots < MAX_PET_STABLES)
|
||||
@@ -784,7 +784,7 @@ void WorldSession::HandleStableSwapPet(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
Pet* pet = _player->GetPet();
|
||||
@@ -869,7 +869,7 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
// reputation discount
|
||||
|
||||
@@ -197,7 +197,7 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid
|
||||
return;
|
||||
}
|
||||
|
||||
pet->clearUnitState(UNIT_STAT_FOLLOW);
|
||||
pet->ClearUnitState(UNIT_STAT_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()))
|
||||
{
|
||||
@@ -765,7 +765,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket)
|
||||
targets.read(recvPacket, caster);
|
||||
HandleClientCastFlags(recvPacket, castFlags, targets);
|
||||
|
||||
caster->clearUnitState(UNIT_STAT_FOLLOW);
|
||||
caster->ClearUnitState(UNIT_STAT_FOLLOW);
|
||||
|
||||
Spell *spell = new Spell(caster, spellInfo, false);
|
||||
spell->m_cast_count = castCount; // probably pending spell cast
|
||||
|
||||
@@ -97,7 +97,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
uint32 charterid = 0;
|
||||
@@ -886,7 +886,7 @@ void WorldSession::SendPetitionShowList(uint64 guid)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
uint8 count = 0;
|
||||
|
||||
@@ -98,7 +98,7 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
// Stop the npc if moving
|
||||
pCreature->StopMoving();
|
||||
|
||||
@@ -68,7 +68,7 @@ void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
if (!(_player->resetTalents()))
|
||||
|
||||
@@ -80,7 +80,7 @@ void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
// unknown taxi node case
|
||||
@@ -119,7 +119,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_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
while (GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE)
|
||||
|
||||
@@ -556,7 +556,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_STUNNED))
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_STUNNED))
|
||||
{
|
||||
SendTradeStatus(TRADE_STATUS_YOU_STUNNED);
|
||||
return;
|
||||
@@ -608,7 +608,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
if (pOther->hasUnitState(UNIT_STAT_STUNNED))
|
||||
if (pOther->HasUnitState(UNIT_STAT_STUNNED))
|
||||
{
|
||||
SendTradeStatus(TRADE_STATUS_TARGET_STUNNED);
|
||||
return;
|
||||
|
||||
@@ -1075,7 +1075,7 @@ void AuraEffect::Update(uint32 diff, Unit * caster)
|
||||
std::list<AuraApplication*> effectApplications;
|
||||
GetApplicationList(effectApplications);
|
||||
// tick on targets of effects
|
||||
if (!caster || !caster->hasUnitState(UNIT_STAT_ISOLATED))
|
||||
if (!caster || !caster->HasUnitState(UNIT_STAT_ISOLATED))
|
||||
{
|
||||
for (std::list<AuraApplication*>::iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
|
||||
PeriodicTick(*apptItr, caster);
|
||||
@@ -1258,7 +1258,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const
|
||||
if (!target->isAlive())
|
||||
return;
|
||||
|
||||
if (target->hasUnitState(UNIT_STAT_ISOLATED))
|
||||
if (target->HasUnitState(UNIT_STAT_ISOLATED))
|
||||
{
|
||||
SendTickImmune(target, caster);
|
||||
return;
|
||||
@@ -1415,7 +1415,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const
|
||||
if (!target->isAlive())
|
||||
return;
|
||||
|
||||
if (target->hasUnitState(UNIT_STAT_ISOLATED))
|
||||
if (target->HasUnitState(UNIT_STAT_ISOLATED))
|
||||
{
|
||||
SendTickImmune(target, caster);
|
||||
return;
|
||||
@@ -1498,7 +1498,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const
|
||||
if (!target->isAlive())
|
||||
return;
|
||||
|
||||
if (target->hasUnitState(UNIT_STAT_ISOLATED))
|
||||
if (target->HasUnitState(UNIT_STAT_ISOLATED))
|
||||
{
|
||||
SendTickImmune(target, caster);
|
||||
return;
|
||||
@@ -1531,7 +1531,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const
|
||||
if (!target->isAlive())
|
||||
return;
|
||||
|
||||
if (target->hasUnitState(UNIT_STAT_ISOLATED))
|
||||
if (target->HasUnitState(UNIT_STAT_ISOLATED))
|
||||
{
|
||||
SendTickImmune(target, caster);
|
||||
return;
|
||||
@@ -1640,7 +1640,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const
|
||||
if (!target->isAlive())
|
||||
return;
|
||||
|
||||
if (target->hasUnitState(UNIT_STAT_ISOLATED))
|
||||
if (target->HasUnitState(UNIT_STAT_ISOLATED))
|
||||
{
|
||||
SendTickImmune(target, caster);
|
||||
return;
|
||||
@@ -1753,7 +1753,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const
|
||||
if (!target->isAlive())
|
||||
return;
|
||||
|
||||
if (target->hasUnitState(UNIT_STAT_ISOLATED))
|
||||
if (target->HasUnitState(UNIT_STAT_ISOLATED))
|
||||
{
|
||||
SendTickImmune(target, caster);
|
||||
return;
|
||||
@@ -1793,7 +1793,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const
|
||||
if (!target->isAlive())
|
||||
return;
|
||||
|
||||
if (target->hasUnitState(UNIT_STAT_ISOLATED))
|
||||
if (target->HasUnitState(UNIT_STAT_ISOLATED))
|
||||
{
|
||||
SendTickImmune(target, caster);
|
||||
return;
|
||||
@@ -1829,7 +1829,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const
|
||||
if (!target->isAlive())
|
||||
return;
|
||||
|
||||
if (target->hasUnitState(UNIT_STAT_ISOLATED))
|
||||
if (target->HasUnitState(UNIT_STAT_ISOLATED))
|
||||
{
|
||||
SendTickImmune(target, caster);
|
||||
return;
|
||||
@@ -3424,7 +3424,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const * aurApp, uint8 mode, bo
|
||||
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_STAT_CASTING))
|
||||
continue;
|
||||
|
||||
for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; i++)
|
||||
@@ -3443,7 +3443,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const * aurApp, uint8 mode, bo
|
||||
// blizz like 2.0.x
|
||||
target->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
|
||||
target->addUnitState(UNIT_STAT_DIED);
|
||||
target->AddUnitState(UNIT_STAT_DIED);
|
||||
target->CombatStop();
|
||||
target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION);
|
||||
|
||||
@@ -3468,7 +3468,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const * aurApp, uint8 mode, bo
|
||||
// blizz like 2.0.x
|
||||
target->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
|
||||
target->clearUnitState(UNIT_STAT_DIED);
|
||||
target->ClearUnitState(UNIT_STAT_DIED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4482,7 +4482,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const * aurApp, uin
|
||||
if (GetSpellProto()->Mechanic == MECHANIC_BANISH)
|
||||
{
|
||||
if (apply)
|
||||
target->addUnitState(UNIT_STAT_ISOLATED);
|
||||
target->AddUnitState(UNIT_STAT_ISOLATED);
|
||||
else
|
||||
{
|
||||
bool banishFound = false;
|
||||
@@ -4494,7 +4494,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const * aurApp, uin
|
||||
break;
|
||||
}
|
||||
if (!banishFound)
|
||||
target->clearUnitState(UNIT_STAT_ISOLATED);
|
||||
target->ClearUnitState(UNIT_STAT_ISOLATED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1823,7 +1823,7 @@ void UnitAura::FillTargetMap(std::map<Unit *, uint8> & targets, Unit * caster)
|
||||
if (modOwner)
|
||||
modOwner->ApplySpellMod(GetId(), SPELLMOD_RADIUS, radius);
|
||||
|
||||
if (!GetUnitOwner()->hasUnitState(UNIT_STAT_ISOLATED))
|
||||
if (!GetUnitOwner()->HasUnitState(UNIT_STAT_ISOLATED))
|
||||
{
|
||||
switch(GetSpellProto()->Effect[effIndex])
|
||||
{
|
||||
|
||||
@@ -1415,7 +1415,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool
|
||||
}
|
||||
|
||||
// assisting case, healing and resurrection
|
||||
if (unit->hasUnitState(UNIT_STAT_ATTACK_PLAYER))
|
||||
if (unit->HasUnitState(UNIT_STAT_ATTACK_PLAYER))
|
||||
{
|
||||
m_caster->SetContestedPvP();
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -3357,8 +3357,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_STAT_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true))
|
||||
m_caster->ClearUnitState(UNIT_STAT_CASTING);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3731,8 +3731,8 @@ void Spell::finish(bool ok)
|
||||
if (IsChanneledSpell(m_spellInfo))
|
||||
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_STAT_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true))
|
||||
m_caster->ClearUnitState(UNIT_STAT_CASTING);
|
||||
|
||||
// Unsummon summon as possessed creatures on spell cancel
|
||||
if (IsChanneledSpell(m_spellInfo) && m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -4870,8 +4870,8 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if (!m_IsTriggeredSpell && m_spellInfo->TargetAuraState && !target->HasAuraState(AuraState(m_spellInfo->TargetAuraState), m_spellInfo, m_caster))
|
||||
return SPELL_FAILED_TARGET_AURASTATE;
|
||||
|
||||
// Not allow casting on flying player
|
||||
if (target->hasUnitState(UNIT_STAT_UNATTACKABLE))
|
||||
// Not allow casting on flying player or on vehicle player (if caster isnt vehicle)
|
||||
if (target->HasUnitState(UNIT_STAT_IN_FLIGHT) || (target->HasUnitState(UNIT_STAT_ONVEHICLE) && target->GetVehicleBase() != m_caster))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
if (!m_IsTriggeredSpell && !m_caster->canSeeOrDetect(target))
|
||||
@@ -5225,7 +5225,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_STAT_ROOT))
|
||||
return SPELL_FAILED_ROOTED;
|
||||
break;
|
||||
}
|
||||
@@ -5426,7 +5426,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_STAT_ROOT))
|
||||
{
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
return SPELL_FAILED_ROOTED;
|
||||
@@ -5652,7 +5652,7 @@ SpellCastResult Spell::CheckPetCast(Unit* target)
|
||||
if (!m_caster->isAlive() && !(m_spellInfo->Attributes & SPELL_ATTR_CASTABLE_WHILE_DEAD))
|
||||
return SPELL_FAILED_CASTER_DEAD;
|
||||
|
||||
if (m_caster->hasUnitState(UNIT_STAT_CASTING) && !m_IsTriggeredSpell) //prevent spellcast interruption by another spellcast
|
||||
if (m_caster->HasUnitState(UNIT_STAT_CASTING) && !m_IsTriggeredSpell) //prevent spellcast interruption by another spellcast
|
||||
return SPELL_FAILED_SPELL_IN_PROGRESS;
|
||||
if (m_caster->isInCombat() && IsNonCombatSpell(m_spellInfo))
|
||||
return SPELL_FAILED_AFFECTING_COMBAT;
|
||||
|
||||
@@ -1320,7 +1320,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_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_ROOT | UNIT_STAT_CONFUSED))
|
||||
if (m_caster->HasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_ROOT | UNIT_STAT_CONFUSED))
|
||||
return;
|
||||
|
||||
m_caster->CastSpell(unitTarget, damage, true);
|
||||
@@ -3241,7 +3241,7 @@ 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_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING))
|
||||
return;
|
||||
|
||||
float angle = unitTarget->GetAngle(&m_targets.m_dstPos);
|
||||
@@ -6178,7 +6178,7 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/)
|
||||
pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
|
||||
pet->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
|
||||
pet->setDeathState(ALIVE);
|
||||
pet->clearUnitState(UNIT_STAT_ALL_STATE);
|
||||
pet->ClearUnitState(UNIT_STAT_ALL_STATE);
|
||||
pet->SetHealth(pet->CountPctFromMaxHealth(damage));
|
||||
|
||||
//pet->AIM_Initialize();
|
||||
|
||||
@@ -342,7 +342,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_STAT_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_STAT_STUNNED)) // While shifting to phase 2 malchezaar stuns himself
|
||||
return;
|
||||
|
||||
if (me->GetUInt64Value(UNIT_FIELD_TARGET) != me->getVictim()->GetGUID())
|
||||
|
||||
@@ -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_STAT_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_STAT_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);
|
||||
@@ -401,7 +401,7 @@ public:
|
||||
InAction = false;
|
||||
SummonSentinel = false;
|
||||
|
||||
me->addUnitState(UNIT_STAT_STUNNED);
|
||||
me->AddUnitState(UNIT_STAT_STUNNED);
|
||||
|
||||
Summons.DespawnAll();
|
||||
}
|
||||
@@ -475,7 +475,7 @@ public:
|
||||
WaitTimer = 2000;
|
||||
InAction = false;
|
||||
|
||||
me->addUnitState(UNIT_STAT_STUNNED);
|
||||
me->AddUnitState(UNIT_STAT_STUNNED);
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, const SpellEntry* Spell)
|
||||
@@ -494,7 +494,7 @@ public:
|
||||
{
|
||||
if (!InAction)
|
||||
{
|
||||
me->clearUnitState(UNIT_STAT_STUNNED);
|
||||
me->ClearUnitState(UNIT_STAT_STUNNED);
|
||||
DoCastAOE(SPELL_DARKFIEND_SKIN, false);
|
||||
AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true));
|
||||
InAction = true;
|
||||
@@ -604,7 +604,7 @@ public:
|
||||
SpellTimer = 5000;
|
||||
Phase = 0;
|
||||
|
||||
me->addUnitState(UNIT_STAT_STUNNED);
|
||||
me->AddUnitState(UNIT_STAT_STUNNED);
|
||||
DoCastAOE(SPELL_BLACKHOLE_SPAWN, true);
|
||||
}
|
||||
|
||||
@@ -616,7 +616,7 @@ public:
|
||||
switch (NeedForAHack)
|
||||
{
|
||||
case 0:
|
||||
me->clearUnitState(UNIT_STAT_STUNNED);
|
||||
me->ClearUnitState(UNIT_STAT_STUNNED);
|
||||
DoCastAOE(SPELL_BLACKHOLE_GROW, false);
|
||||
if (Victim)
|
||||
AttackStart(Victim);
|
||||
|
||||
@@ -90,7 +90,7 @@ struct boss_twinemperorsAI : public ScriptedAI
|
||||
AfterTeleportTimer = 0;
|
||||
Abuse_Bug_Timer = 10000 + rand()%7000;
|
||||
BugsTimer = 2000;
|
||||
me->clearUnitState(UNIT_STAT_STUNNED);
|
||||
me->ClearUnitState(UNIT_STAT_STUNNED);
|
||||
DontYellWhenDead = false;
|
||||
EnrageTimer = 15*60000;
|
||||
}
|
||||
@@ -237,7 +237,7 @@ struct boss_twinemperorsAI : public ScriptedAI
|
||||
DoStopAttack();
|
||||
DoResetThreat();
|
||||
DoCast(me, SPELL_TWIN_TELEPORT_VISUAL);
|
||||
me->addUnitState(UNIT_STAT_STUNNED);
|
||||
me->AddUnitState(UNIT_STAT_STUNNED);
|
||||
AfterTeleport = true;
|
||||
AfterTeleportTimer = 2000;
|
||||
tspellcasted = false;
|
||||
@@ -249,9 +249,9 @@ struct boss_twinemperorsAI : public ScriptedAI
|
||||
{
|
||||
if (!tspellcasted)
|
||||
{
|
||||
me->clearUnitState(UNIT_STAT_STUNNED);
|
||||
me->ClearUnitState(UNIT_STAT_STUNNED);
|
||||
DoCast(me, SPELL_TWIN_TELEPORT);
|
||||
me->addUnitState(UNIT_STAT_STUNNED);
|
||||
me->AddUnitState(UNIT_STAT_STUNNED);
|
||||
}
|
||||
|
||||
tspellcasted = true;
|
||||
@@ -259,7 +259,7 @@ struct boss_twinemperorsAI : public ScriptedAI
|
||||
if (AfterTeleportTimer <= diff)
|
||||
{
|
||||
AfterTeleport = false;
|
||||
me->clearUnitState(UNIT_STAT_STUNNED);
|
||||
me->ClearUnitState(UNIT_STAT_STUNNED);
|
||||
if (Unit *nearu = me->SelectNearestTarget(100))
|
||||
{
|
||||
//DoYell(nearu->GetName(), LANG_UNIVERSAL, 0);
|
||||
|
||||
@@ -271,7 +271,7 @@ public:
|
||||
if (((uiUndergroundPhase == 0 && HealthBelowPct(75))
|
||||
|| (uiUndergroundPhase == 1 && HealthBelowPct(50))
|
||||
|| (uiUndergroundPhase == 2 && HealthBelowPct(25)))
|
||||
&& !me->hasUnitState(UNIT_STAT_CASTING))
|
||||
&& !me->HasUnitState(UNIT_STAT_CASTING))
|
||||
{
|
||||
bGuardianSummoned = false;
|
||||
bVenomancerSummoned = false;
|
||||
|
||||
+6
-6
@@ -109,7 +109,7 @@ public:
|
||||
{
|
||||
RemoveSummons();
|
||||
me->SetDisplayId(me->GetNativeDisplayId());
|
||||
me->clearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
|
||||
me->ClearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
|
||||
|
||||
bEventInProgress = false;
|
||||
bEvent = false;
|
||||
@@ -165,7 +165,7 @@ public:
|
||||
uiPhase++;
|
||||
uiResurrectTimer = 4000;
|
||||
bEventInProgress = false;
|
||||
me->clearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
|
||||
me->ClearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
|
||||
} else uiResurrectTimer -= uiDiff;
|
||||
}
|
||||
|
||||
@@ -209,14 +209,14 @@ public:
|
||||
if (!bSummonArmy)
|
||||
{
|
||||
bSummonArmy = true;
|
||||
me->addUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
|
||||
me->AddUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
|
||||
DoCast(me, SPELL_ARMY_DEAD);
|
||||
}
|
||||
if (!bDeathArmyDone)
|
||||
{
|
||||
if (uiDeathArmyCheckTimer <= uiDiff)
|
||||
{
|
||||
me->clearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
|
||||
me->ClearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
|
||||
uiDeathArmyCheckTimer = 0;
|
||||
bDeathArmyDone = true;
|
||||
} else uiDeathArmyCheckTimer -= uiDiff;
|
||||
@@ -261,7 +261,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (!me->hasUnitState(UNIT_STAT_ROOT) && !me->HealthBelowPct(1))
|
||||
if (!me->HasUnitState(UNIT_STAT_ROOT) && !me->HealthBelowPct(1))
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ public:
|
||||
{
|
||||
uiDamage = 0;
|
||||
me->SetHealth(0);
|
||||
me->addUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
|
||||
me->AddUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
|
||||
RemoveSummons();
|
||||
switch(uiPhase)
|
||||
{
|
||||
|
||||
@@ -138,7 +138,7 @@ class boss_bronjahm : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -248,7 +248,7 @@ class boss_devourer_of_souls : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_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_STAT_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_STAT_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_STAT_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_STAT_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_STAT_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_STAT_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_STAT_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_STAT_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_STAT_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
|
||||
@@ -657,7 +657,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -740,7 +740,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -840,7 +840,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -910,7 +910,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -976,7 +976,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -177,7 +177,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -204,7 +204,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
switch(events.ExecuteEvent())
|
||||
|
||||
@@ -160,7 +160,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -237,7 +237,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -186,7 +186,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -244,7 +244,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -306,7 +306,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -373,7 +373,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -432,7 +432,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -499,7 +499,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -561,7 +561,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -624,7 +624,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -689,7 +689,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -745,7 +745,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -803,7 +803,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -868,7 +868,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -930,7 +930,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -988,7 +988,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -1050,7 +1050,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -1108,7 +1108,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->clearUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT);
|
||||
me->ClearUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
MightyBlowTimer = 10*IN_MILLISECONDS;
|
||||
bHealth = false;
|
||||
@@ -86,14 +86,14 @@ public:
|
||||
|
||||
if (bRestore)
|
||||
{
|
||||
pWho->clearUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT);
|
||||
pWho->ClearUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT);
|
||||
pWho->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
if (pWho == me)
|
||||
me->RemoveAura(SPELL_FREEZE_ANIM);
|
||||
}else
|
||||
{
|
||||
pWho->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
pWho->addUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT);
|
||||
pWho->AddUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT);
|
||||
if (pWho == me)
|
||||
DoCast(me,SPELL_FREEZE_ANIM);
|
||||
}
|
||||
@@ -127,7 +127,7 @@ public:
|
||||
MightyBlowTimer = 10*IN_MILLISECONDS;
|
||||
} else MightyBlowTimer -= diff;
|
||||
|
||||
if (!me->hasUnitState(UNIT_STAT_STUNNED))
|
||||
if (!me->HasUnitState(UNIT_STAT_STUNNED))
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
DoScriptText(SAY_TRANSFORM_1, me);
|
||||
uiTransformationTimer = 5*IN_MILLISECONDS;
|
||||
bStartOfTransformation = true;
|
||||
me->clearUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
|
||||
me->ClearUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
else
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
if (bStartOfTransformation)
|
||||
{
|
||||
bStartOfTransformation = false;
|
||||
me->addUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
|
||||
me->AddUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
}
|
||||
@@ -195,7 +195,7 @@ public:
|
||||
DoScriptText(SAY_TRANSFORM_2, me);
|
||||
uiTransformationTimer = 9*IN_MILLISECONDS;
|
||||
bStartOfTransformation = true;
|
||||
me->clearUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
|
||||
me->ClearUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
else
|
||||
@@ -205,7 +205,7 @@ public:
|
||||
if (bStartOfTransformation)
|
||||
{
|
||||
bStartOfTransformation = false;
|
||||
me->addUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
|
||||
me->AddUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ class boss_blood_council_controller : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -485,7 +485,7 @@ class boss_prince_keleseth_icc : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -679,7 +679,7 @@ class boss_prince_taldaram_icc : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -892,7 +892,7 @@ class boss_prince_valanar_icc : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -1089,7 +1089,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_STAT_CASTING | UNIT_STAT_STUNNED);
|
||||
if (target && me->Attack(target, true))
|
||||
me->GetMotionMaster()->MoveChase(target, 1.0f);
|
||||
}
|
||||
@@ -1214,7 +1214,7 @@ class npc_dark_nucleus : public CreatureScript
|
||||
}
|
||||
|
||||
DoCast(who, SPELL_SHADOW_RESONANCE_RESIST);
|
||||
me->clearUnitState(UNIT_STAT_CASTING);
|
||||
me->ClearUnitState(UNIT_STAT_CASTING);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
@@ -1248,7 +1248,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_STAT_CASTING);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1267,7 +1267,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_STAT_CASTING);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ class boss_blood_queen_lana_thel : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -392,7 +392,7 @@ class boss_deathbringer_saurfang : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -176,7 +176,7 @@ class boss_festergut : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -307,7 +307,7 @@ class npc_stinky_icc : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -345,7 +345,7 @@ class boss_lady_deathwhisper : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING) && !(events.GetPhaseMask() & PHASE_INTRO_MASK))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING) && !(events.GetPhaseMask() & PHASE_INTRO_MASK))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -592,7 +592,7 @@ class npc_cult_fanatic : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -670,7 +670,7 @@ class npc_cult_adherent : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -156,7 +156,7 @@ class boss_lord_marrowgar : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -532,8 +532,4 @@ void AddSC_boss_lord_marrowgar()
|
||||
new spell_marrowgar_coldflame();
|
||||
new spell_marrowgar_bone_spike_graveyard();
|
||||
new spell_marrowgar_bone_storm();
|
||||
|
||||
// has to be done or else players threat will be wiped for impaled player and he will absorb all damage
|
||||
if (VehicleSeatEntry* vehSeat = const_cast<VehicleSeatEntry*>(sVehicleSeatStore.LookupEntry(6206)))
|
||||
vehSeat->m_flags |= 0x400;
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ class boss_professor_putricide : public CreatureScript
|
||||
{
|
||||
summon->AI()->AttackStart(target);
|
||||
summon->CastCustomSpell(SPELL_GASEOUS_BLOAT, SPELLVALUE_MAX_TARGETS, 1, target, false);
|
||||
summon->clearUnitState(UNIT_STAT_CASTING);
|
||||
summon->ClearUnitState(UNIT_STAT_CASTING);
|
||||
summon->GetMotionMaster()->MoveIdle();
|
||||
summon->m_Events.AddEvent(new StartMovementEvent(*summon), summon->m_Events.CalculateTime(3500));
|
||||
}
|
||||
@@ -280,7 +280,7 @@ class boss_professor_putricide : public CreatureScript
|
||||
{
|
||||
summon->AI()->AttackStart(target);
|
||||
summon->CastCustomSpell(SPELL_VOLATILE_OOZE_ADHESIVE, SPELLVALUE_MAX_TARGETS, 1, target, false);
|
||||
summon->clearUnitState(UNIT_STAT_CASTING);
|
||||
summon->ClearUnitState(UNIT_STAT_CASTING);
|
||||
summon->GetMotionMaster()->MoveIdle();
|
||||
summon->m_Events.AddEvent(new StartMovementEvent(*summon), summon->m_Events.CalculateTime(3500));
|
||||
}
|
||||
@@ -524,7 +524,7 @@ class boss_professor_putricide : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -184,7 +184,7 @@ class boss_rotface : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -410,7 +410,7 @@ class npc_precious_icc : public CreatureScript
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -129,7 +129,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -342,7 +342,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -396,7 +396,7 @@ public:
|
||||
instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE);
|
||||
}
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -476,7 +476,7 @@ public:
|
||||
else uiGuardiansOfIcecrownTimer -= diff;
|
||||
}
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
if (uint32 eventId = events.GetEvent())
|
||||
|
||||
@@ -224,7 +224,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -397,11 +397,11 @@ public:
|
||||
if (me->HasAura(SPELL_SYSTEMS_SHUTDOWN))
|
||||
{
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->addUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT);
|
||||
me->AddUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT);
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
if (me->HasAura(SPELL_SYSTEMS_SHUTDOWN))
|
||||
@@ -466,7 +466,7 @@ public:
|
||||
break;
|
||||
case EVENT_REPAIR:
|
||||
me->MonsterTextEmote(EMOTE_REPAIR, 0, true);
|
||||
me->clearUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT);
|
||||
me->ClearUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT);
|
||||
InstallAdds(false);
|
||||
events.CancelEvent(EVENT_REPAIR);
|
||||
break;
|
||||
|
||||
@@ -192,7 +192,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
EncounterTime += diff;
|
||||
@@ -482,8 +482,4 @@ void AddSC_boss_ignis()
|
||||
new npc_iron_construct();
|
||||
new npc_scorch_ground();
|
||||
new spell_ignis_slag_pot();
|
||||
|
||||
// has to be done or else players wil absorb dmg from slag pot vehicle seat 1 slagpot
|
||||
if (VehicleSeatEntry* vehSeat = const_cast<VehicleSeatEntry*>(sVehicleSeatStore.LookupEntry(3206)))
|
||||
vehSeat->m_flags |= 0x400;
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
// TODO: because we are using hack, he is stunned and cannot cast, so we use triggered for every spell
|
||||
|
||||
@@ -206,7 +206,7 @@ public:
|
||||
|
||||
if (uiCleaveTimer <= diff)
|
||||
{
|
||||
if (!me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (!me->HasUnitState(UNIT_STAT_CASTING))
|
||||
{
|
||||
if (bIsUndead)
|
||||
DoCast(me->getVictim(), SPELL_WOE_STRIKE);
|
||||
@@ -218,7 +218,7 @@ public:
|
||||
|
||||
if (uiSmashTimer <= diff)
|
||||
{
|
||||
if (!me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (!me->HasUnitState(UNIT_STAT_CASTING))
|
||||
{
|
||||
if (bIsUndead)
|
||||
DoCast(me->getVictim(), SPELL_DARK_SMASH);
|
||||
@@ -239,7 +239,7 @@ public:
|
||||
{
|
||||
if (uiEnrageTimer <= diff)
|
||||
{
|
||||
if (!me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (!me->HasUnitState(UNIT_STAT_CASTING))
|
||||
{
|
||||
// Spawn target for Axe
|
||||
Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1);
|
||||
@@ -256,7 +256,7 @@ public:
|
||||
|
||||
if (uiRoarTimer <= diff)
|
||||
{
|
||||
if (!me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (!me->HasUnitState(UNIT_STAT_CASTING))
|
||||
{
|
||||
if (bIsUndead)
|
||||
DoCast(me, SPELL_DREADFUL_ROAR);
|
||||
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
@@ -226,7 +226,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
if (Aura *overchargedAura = me->GetAura(SPELL_OVERCHARGED))
|
||||
|
||||
@@ -116,7 +116,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->HasUnitState(UNIT_STAT_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_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
@@ -1328,7 +1328,7 @@ public:
|
||||
if (uiType != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
me->addUnitState(UNIT_STAT_STUNNED);
|
||||
me->AddUnitState(UNIT_STAT_STUNNED);
|
||||
me->CastSpell(me, SPELL_STUN, true);
|
||||
if (me->isSummon())
|
||||
if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
|
||||
@@ -1445,7 +1445,7 @@ public:
|
||||
DoScriptText(SAY_LERYSSA_1, pLeryssa);
|
||||
pArlos->Kill(pArlos, false);
|
||||
pLeryssa->RemoveAura(SPELL_STUN);
|
||||
pLeryssa->clearUnitState(UNIT_STAT_STUNNED);
|
||||
pLeryssa->ClearUnitState(UNIT_STAT_STUNNED);
|
||||
pLeryssa->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
pLeryssa->GetMotionMaster()->MovePoint(0,3722.114502f, 3564.201660f, 477.441437f);
|
||||
|
||||
@@ -1495,7 +1495,7 @@ public:
|
||||
if (Creature* pTalbot = me->FindNearestCreature(NPC_PRINCE_VALANAR, 50.0f, true))
|
||||
CAST_AI(npc_counselor_talbot::npc_counselor_talbotAI, pTalbot->AI())->bCheck = true;
|
||||
|
||||
me->addUnitState(UNIT_STAT_STUNNED);
|
||||
me->AddUnitState(UNIT_STAT_STUNNED);
|
||||
me->CastSpell(me, SPELL_STUN, true);
|
||||
|
||||
if (me->isSummon())
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ public:
|
||||
summoned->CastSpell(summoned,SPELL_FOCUS_FIRE_VISUAL,false);
|
||||
summoned->setFaction(me->getFaction());
|
||||
summoned->SetLevel(me->getLevel());
|
||||
summoned->addUnitState(UNIT_STAT_ROOT);
|
||||
summoned->AddUnitState(UNIT_STAT_ROOT);
|
||||
|
||||
if (Unit *pFocusedTarget = Unit::GetUnit(*me, FocusedTargetGUID))
|
||||
summoned->AI()->AttackStart(pFocusedTarget);
|
||||
|
||||
+2
-2
@@ -337,7 +337,7 @@ class boss_vazruden_the_herald : public CreatureScript
|
||||
VazrudenGUID = 0;
|
||||
}
|
||||
summoned = false;
|
||||
me->clearUnitState(UNIT_STAT_ROOT);
|
||||
me->ClearUnitState(UNIT_STAT_ROOT);
|
||||
me->SetVisible(true);
|
||||
}
|
||||
}
|
||||
@@ -352,7 +352,7 @@ class boss_vazruden_the_herald : public CreatureScript
|
||||
NazanGUID = Nazan->GetGUID();
|
||||
summoned = true;
|
||||
me->SetVisible(false);
|
||||
me->addUnitState(UNIT_STAT_ROOT);
|
||||
me->AddUnitState(UNIT_STAT_ROOT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -267,7 +267,7 @@ class boss_magtheridon : public CreatureScript
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
me->addUnitState(UNIT_STAT_STUNNED);
|
||||
me->AddUnitState(UNIT_STAT_STUNNED);
|
||||
DoCast(me, SPELL_SHADOW_CAGE_C, true);
|
||||
}
|
||||
|
||||
@@ -348,7 +348,7 @@ class boss_magtheridon : public CreatureScript
|
||||
|
||||
void AttackStart(Unit *who)
|
||||
{
|
||||
if (!me->hasUnitState(UNIT_STAT_STUNNED))
|
||||
if (!me->HasUnitState(UNIT_STAT_STUNNED))
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
|
||||
@@ -402,7 +402,7 @@ class boss_magtheridon : public CreatureScript
|
||||
if (BlastNova_Timer <= diff)
|
||||
{
|
||||
// to avoid earthquake interruption
|
||||
if (!me->hasUnitState(UNIT_STAT_STUNNED))
|
||||
if (!me->HasUnitState(UNIT_STAT_STUNNED))
|
||||
{
|
||||
DoScriptText(EMOTE_BLASTNOVA, me);
|
||||
DoCast(me, SPELL_BLASTNOVA);
|
||||
@@ -445,7 +445,7 @@ class boss_magtheridon : public CreatureScript
|
||||
|
||||
if (!Phase3 && HealthBelowPct(30)
|
||||
&& !me->IsNonMeleeSpellCasted(false) // blast nova
|
||||
&& !me->hasUnitState(UNIT_STAT_STUNNED)) // shadow cage and earthquake
|
||||
&& !me->HasUnitState(UNIT_STAT_STUNNED)) // shadow cage and earthquake
|
||||
{
|
||||
Phase3 = true;
|
||||
DoScriptText(SAY_CHAMBER_DESTROY, me);
|
||||
|
||||
+1
-1
@@ -224,7 +224,7 @@ class instance_magtheridons_lair : public InstanceMapScript
|
||||
Creature* Magtheridon = instance->GetCreature(MagtheridonGUID);
|
||||
if (Magtheridon && Magtheridon->isAlive())
|
||||
{
|
||||
Magtheridon->clearUnitState(UNIT_STAT_STUNNED);
|
||||
Magtheridon->ClearUnitState(UNIT_STAT_STUNNED);
|
||||
Magtheridon->AI()->AttackStart(Magtheridon->SelectNearestTarget(999));
|
||||
}
|
||||
CageTimer = 0;
|
||||
|
||||
@@ -398,7 +398,7 @@ class boss_kaelthas : public CreatureScript
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if (!me->hasUnitState(UNIT_STAT_STUNNED) && who->isTargetableForAttack() &&
|
||||
if (!me->HasUnitState(UNIT_STAT_STUNNED) && who->isTargetableForAttack() &&
|
||||
me->IsHostileTo(who) && who->isInAccessiblePlaceFor(me))
|
||||
{
|
||||
if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
|
||||
@@ -798,7 +798,7 @@ public:
|
||||
Materialize = true;
|
||||
}
|
||||
|
||||
if (me->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED) || me->hasUnitState(UNIT_STAT_ROOT)) // if the mob is rooted/slowed by spells eg.: Entangling Roots, Frost Nova, Hamstring, Crippling Poison, etc. => remove it
|
||||
if (me->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED) || me->HasUnitState(UNIT_STAT_ROOT)) // if the mob is rooted/slowed by spells eg.: Entangling Roots, Frost Nova, Hamstring, Crippling Poison, etc. => remove it
|
||||
DoCast(me, SPELL_PHASE_SLIP);
|
||||
|
||||
if (!UpdateVictim())
|
||||
|
||||
@@ -1258,7 +1258,7 @@ public:
|
||||
AggroTargetGUID = 0;
|
||||
Timers = false;
|
||||
|
||||
me->addUnitState(UNIT_STAT_ROOT);
|
||||
me->AddUnitState(UNIT_STAT_ROOT);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
|
||||
}
|
||||
@@ -1302,7 +1302,7 @@ public:
|
||||
if (Player* AggroTarget = (Unit::GetPlayer(*me, AggroTargetGUID)))
|
||||
{
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->clearUnitState(UNIT_STAT_ROOT);
|
||||
me->ClearUnitState(UNIT_STAT_ROOT);
|
||||
|
||||
float x, y, z;
|
||||
AggroTarget->GetPosition(x,y,z);
|
||||
|
||||
@@ -223,7 +223,7 @@ public:
|
||||
{
|
||||
Unit* pTarget = aurApp->GetTarget();
|
||||
pTarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
pTarget->addUnitState(UNIT_STAT_ROOT);
|
||||
pTarget->AddUnitState(UNIT_STAT_ROOT);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const * /*aurEff*/, AuraApplication const * aurApp, AuraEffectHandleModes /*mode*/)
|
||||
|
||||
@@ -1873,7 +1873,7 @@ public:
|
||||
Unit *owner = me->GetCharmerOrOwner();
|
||||
|
||||
me->CombatStop(true);
|
||||
if (owner && !me->hasUnitState(UNIT_STAT_FOLLOW))
|
||||
if (owner && !me->HasUnitState(UNIT_STAT_FOLLOW))
|
||||
{
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle(), MOTION_SLOT_ACTIVE);
|
||||
@@ -2056,7 +2056,7 @@ public:
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (!me->hasUnitState(UNIT_STAT_STUNNED))
|
||||
if (!me->HasUnitState(UNIT_STAT_STUNNED))
|
||||
me->SetControlled(true,UNIT_STAT_STUNNED);//disable rotate
|
||||
|
||||
if (uiEntry != NPC_ADVANCED_TARGET_DUMMY && uiEntry != NPC_TARGET_DUMMY)
|
||||
|
||||
Reference in New Issue
Block a user