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();
|
||||
|
||||
Reference in New Issue
Block a user