Core/Movement: Use SetWalk(true/false) instead of AddUnit/RemoveUnit.

This commit is contained in:
Venugh
2012-02-23 11:50:58 +01:00
parent 9219625243
commit 1cac01b3df
50 changed files with 131 additions and 122 deletions
@@ -307,11 +307,7 @@ void npc_escortAI::MovementInform(uint32 moveType, uint32 pointId)
{ {
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has returned to original position before combat"); sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has returned to original position before combat");
if (m_bIsRunning && me->HasUnitMovementFlag(MOVEMENTFLAG_WALKING)) me->SetWalk(!m_bIsRunning);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
else if (!m_bIsRunning && !me->HasUnitMovementFlag(MOVEMENTFLAG_WALKING))
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
RemoveEscortState(STATE_ESCORT_RETURNING); RemoveEscortState(STATE_ESCORT_RETURNING);
if (!m_uiWPWaitTimer) if (!m_uiWPWaitTimer)
@@ -400,14 +396,14 @@ void npc_escortAI::SetRun(bool on)
if (on) if (on)
{ {
if (!m_bIsRunning) if (!m_bIsRunning)
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
else else
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set run mode, but is already running."); sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set run mode, but is already running.");
} }
else else
{ {
if (m_bIsRunning) if (m_bIsRunning)
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
else else
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set walk mode, but is already walking."); sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set walk mode, but is already walking.");
} }
@@ -473,9 +469,9 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false
//Set initial speed //Set initial speed
if (m_bIsRunning) if (m_bIsRunning)
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
else else
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
AddEscortState(STATE_ESCORT_ESCORTING); AddEscortState(STATE_ESCORT_ESCORTING);
} }
+3 -3
View File
@@ -45,7 +45,7 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c)
mCanRepeatPath = false; mCanRepeatPath = false;
// spawn in run mode // spawn in run mode
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
mRun = false; mRun = false;
me->GetPosition(&mLastOOCPos); me->GetPosition(&mLastOOCPos);
@@ -720,9 +720,9 @@ uint64 SmartAI::GetGUID(int32 /*id*/)
void SmartAI::SetRun(bool run) void SmartAI::SetRun(bool run)
{ {
if (run) if (run)
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
else else
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
mRun = run; mRun = run;
} }
@@ -240,7 +240,7 @@ void CreatureGroup::LeaderMoveTo(float x, float y, float z)
if (member->IsWithinDist(m_leader, dist + MAX_DESYNC)) if (member->IsWithinDist(m_leader, dist + MAX_DESYNC))
member->SetUnitMovementFlags(m_leader->GetUnitMovementFlags()); member->SetUnitMovementFlags(m_leader->GetUnitMovementFlags());
else else
member->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); member->SetWalk(false);
member->GetMotionMaster()->MovePoint(0, dx, dy, dz); member->GetMotionMaster()->MovePoint(0, dx, dy, dz);
member->SetHomePosition(dx, dy, dz, pathangle); member->SetHomePosition(dx, dy, dz, pathangle);
+9 -1
View File
@@ -9906,7 +9906,7 @@ void Unit::SetCharm(Unit* charm, bool apply)
if (charm->HasUnitMovementFlag(MOVEMENTFLAG_WALKING)) if (charm->HasUnitMovementFlag(MOVEMENTFLAG_WALKING))
{ {
charm->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); charm->SetWalk(false);
charm->SendMovementFlagUpdate(); charm->SendMovementFlagUpdate();
} }
@@ -17455,3 +17455,11 @@ void Unit::SetFacingToObject(WorldObject* pObject)
// TODO: figure out under what conditions creature will move towards object instead of facing it where it currently is. // TODO: figure out under what conditions creature will move towards object instead of facing it where it currently is.
SetFacingTo(GetAngle(pObject)); SetFacingTo(GetAngle(pObject));
} }
void Unit::SetWalk(bool enable)
{
if (enable)
AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
else
RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
}
+1
View File
@@ -1627,6 +1627,7 @@ class Unit : public WorldObject
void SendMovementFlagUpdate(); void SendMovementFlagUpdate();
bool IsLevitating() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_LEVITATING);} bool IsLevitating() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_LEVITATING);}
bool IsWalking() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING);} bool IsWalking() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING);}
virtual void SetWalk(bool enable);
void SetInFront(Unit const* target); void SetInFront(Unit const* target);
void SetFacingTo(float ori); void SetFacingTo(float ori);
@@ -156,7 +156,7 @@ class instance_deadmines : public InstanceMapScript
void MoveCreatureInside(Creature* creature) void MoveCreatureInside(Creature* creature)
{ {
creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); creature->SetWalk(false);
creature->GetMotionMaster()->MovePoint(0, -102.7f, -655.9f, creature->GetPositionZ()); creature->GetMotionMaster()->MovePoint(0, -102.7f, -655.9f, creature->GetPositionZ());
} }
@@ -122,7 +122,7 @@ public:
me->SetSpeed(MOVE_RUN, 2.0f); me->SetSpeed(MOVE_RUN, 2.0f);
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
me->setActive(true); me->setActive(true);
if (instance) if (instance)
@@ -171,7 +171,7 @@ public:
float x, y, z; // coords that we move to, close to the crystal. float x, y, z; // coords that we move to, close to the crystal.
CrystalChosen->GetClosePoint(x, y, z, me->GetObjectSize(), CONTACT_DISTANCE); CrystalChosen->GetClosePoint(x, y, z, me->GetObjectSize(), CONTACT_DISTANCE);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
me->GetMotionMaster()->MovePoint(1, x, y, z); me->GetMotionMaster()->MovePoint(1, x, y, z);
DrainingCrystal = true; DrainingCrystal = true;
} }
@@ -587,7 +587,7 @@ public:
return; return;
TargetGUID = who->GetGUID(); TargetGUID = who->GetGUID();
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
me->SetSpeed(MOVE_RUN, 0.4f); me->SetSpeed(MOVE_RUN, 0.4f);
me->GetMotionMaster()->MoveChase(who); me->GetMotionMaster()->MoveChase(who);
me->SetTarget(TargetGUID); me->SetTarget(TargetGUID);
@@ -892,7 +892,7 @@ public:
{ {
if (Creature* miner = Unit::GetCreature(*me, minerGUID)) if (Creature* miner = Unit::GetCreature(*me, minerGUID))
{ {
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
//Not 100% correct, but movement is smooth. Sometimes miner walks faster //Not 100% correct, but movement is smooth. Sometimes miner walks faster
//than normal, this speed is fast enough to keep up at those times. //than normal, this speed is fast enough to keep up at those times.
@@ -400,7 +400,7 @@ public:
switch (uiStage) switch (uiStage)
{ {
case 1: case 1:
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
if (GameObject* tree = me->FindNearestGameObject(GO_INCONSPICUOUS_TREE, 40.0f)) if (GameObject* tree = me->FindNearestGameObject(GO_INCONSPICUOUS_TREE, 40.0f))
{ {
DoScriptText(SAY_TREE1, me); DoScriptText(SAY_TREE1, me);
@@ -502,7 +502,7 @@ public:
switch (wpId) switch (wpId)
{ {
case 0: case 0:
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
SetHoldState(true); SetHoldState(true);
break; break;
case 1: case 1:
@@ -537,7 +537,7 @@ public:
bIsBattle = true; bIsBattle = true;
break; break;
case 2: case 2:
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
DoCast(me, SPELL_THE_LIGHT_OF_DAWN); DoCast(me, SPELL_THE_LIGHT_OF_DAWN);
break; break;
case 3: case 3:
@@ -551,30 +551,30 @@ public:
{ {
if (temp->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0)) if (temp->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0))
temp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); temp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN);
temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(true);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[19].x, LightofDawnLoc[19].y, LightofDawnLoc[19].z); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[19].x, LightofDawnLoc[19].y, LightofDawnLoc[19].z);
} }
if (Creature* temp = Unit::GetCreature(*me, uiThassarianGUID)) if (Creature* temp = Unit::GetCreature(*me, uiThassarianGUID))
{ {
if (temp->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0)) if (temp->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0))
temp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); temp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN);
temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(true);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[21].x, LightofDawnLoc[21].y, LightofDawnLoc[21].z); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[21].x, LightofDawnLoc[21].y, LightofDawnLoc[21].z);
} }
if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID)) if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID))
{ {
temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(true);
temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[10].x, LightofDawnLoc[10].y, LightofDawnLoc[10].z); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[10].x, LightofDawnLoc[10].y, LightofDawnLoc[10].z);
} }
if (Creature* temp = Unit::GetCreature(*me, uiMaxwellGUID)) if (Creature* temp = Unit::GetCreature(*me, uiMaxwellGUID))
{ {
temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(true);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[13].x, LightofDawnLoc[13].y, LightofDawnLoc[13].z); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[13].x, LightofDawnLoc[13].y, LightofDawnLoc[13].z);
} }
if (Creature* temp = Unit::GetCreature(*me, uiEligorGUID)) if (Creature* temp = Unit::GetCreature(*me, uiEligorGUID))
{ {
temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(true);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[16].x, LightofDawnLoc[16].y, LightofDawnLoc[16].z); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[16].x, LightofDawnLoc[16].y, LightofDawnLoc[16].z);
} }
JumpToNextStep(10000); JumpToNextStep(10000);
@@ -664,7 +664,7 @@ public:
if (uiSummon_counter < ENCOUNTER_GHOUL_NUMBER) if (uiSummon_counter < ENCOUNTER_GHOUL_NUMBER)
{ {
Unit* temp = me->SummonCreature(NPC_ACHERUS_GHOUL, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); Unit* temp = me->SummonCreature(NPC_ACHERUS_GHOUL, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(false);
temp->setFaction(2084); temp->setFaction(2084);
uiGhoulGUID[uiSummon_counter] = temp->GetGUID(); uiGhoulGUID[uiSummon_counter] = temp->GetGUID();
++uiSummon_counter; ++uiSummon_counter;
@@ -682,7 +682,7 @@ public:
if (uiSummon_counter < ENCOUNTER_ABOMINATION_NUMBER) if (uiSummon_counter < ENCOUNTER_ABOMINATION_NUMBER)
{ {
Unit* temp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); Unit* temp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(false);
temp->setFaction(2084); temp->setFaction(2084);
uiAbominationGUID[uiSummon_counter] = temp->GetGUID(); uiAbominationGUID[uiSummon_counter] = temp->GetGUID();
++uiSummon_counter; ++uiSummon_counter;
@@ -700,7 +700,7 @@ public:
if (uiSummon_counter < ENCOUNTER_WARRIOR_NUMBER) if (uiSummon_counter < ENCOUNTER_WARRIOR_NUMBER)
{ {
Unit* temp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); Unit* temp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(false);
temp->setFaction(2084); temp->setFaction(2084);
uiWarriorGUID[uiSummon_counter] = temp->GetGUID(); uiWarriorGUID[uiSummon_counter] = temp->GetGUID();
++uiSummon_counter; ++uiSummon_counter;
@@ -718,7 +718,7 @@ public:
if (uiSummon_counter < ENCOUNTER_BEHEMOTH_NUMBER) if (uiSummon_counter < ENCOUNTER_BEHEMOTH_NUMBER)
{ {
Unit* temp = me->SummonCreature(NPC_FLESH_BEHEMOTH, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); Unit* temp = me->SummonCreature(NPC_FLESH_BEHEMOTH, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(false);
temp->setFaction(2084); temp->setFaction(2084);
uiBehemothGUID[uiSummon_counter] = temp->GetGUID(); uiBehemothGUID[uiSummon_counter] = temp->GetGUID();
++uiSummon_counter; ++uiSummon_counter;
@@ -739,17 +739,17 @@ public:
SetHoldState(false); SetHoldState(false);
if (Creature* temp = Unit::GetCreature(*me, uiKoltiraGUID)) if (Creature* temp = Unit::GetCreature(*me, uiKoltiraGUID))
{ {
temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(false);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z);
} }
if (Creature* temp = Unit::GetCreature(*me, uiOrbazGUID)) if (Creature* temp = Unit::GetCreature(*me, uiOrbazGUID))
{ {
temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(false);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z);
} }
if (Creature* temp = Unit::GetCreature(*me, uiThassarianGUID)) if (Creature* temp = Unit::GetCreature(*me, uiThassarianGUID))
{ {
temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(false);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z);
} }
for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i)
@@ -824,7 +824,7 @@ public:
if (Unit* temp = me->SummonCreature(NPC_DARION_MOGRAINE, LightofDawnLoc[24].x, LightofDawnLoc[24].y, LightofDawnLoc[24].z, LightofDawnLoc[24].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) if (Unit* temp = me->SummonCreature(NPC_DARION_MOGRAINE, LightofDawnLoc[24].x, LightofDawnLoc[24].y, LightofDawnLoc[24].z, LightofDawnLoc[24].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000))
{ {
DoScriptText(SAY_LIGHT_OF_DAWN35, temp); DoScriptText(SAY_LIGHT_OF_DAWN35, temp);
temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(false);
uiDarionGUID = temp->GetGUID(); uiDarionGUID = temp->GetGUID();
} }
JumpToNextStep(4000); JumpToNextStep(4000);
@@ -940,7 +940,7 @@ public:
DoCast(me, SPELL_MOGRAINE_CHARGE); // jumping charge DoCast(me, SPELL_MOGRAINE_CHARGE); // jumping charge
// doesn't make it looks well, so workarounds, Darion charges, looks better // doesn't make it looks well, so workarounds, Darion charges, looks better
me->SetSpeed(MOVE_RUN, 3.0f); me->SetSpeed(MOVE_RUN, 3.0f);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
SetHoldState(false); SetHoldState(false);
JumpToNextStep(0); JumpToNextStep(0);
break; break;
@@ -1013,7 +1013,7 @@ public:
Unit* temp; Unit* temp;
temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED);
temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(false);
temp->SetSpeed(MOVE_RUN, 2.0f); temp->SetSpeed(MOVE_RUN, 2.0f);
temp->setFaction(me->getFaction()); temp->setFaction(me->getFaction());
temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
@@ -1021,7 +1021,7 @@ public:
temp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); temp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED);
temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(false);
temp->SetSpeed(MOVE_RUN, 2.0f); temp->SetSpeed(MOVE_RUN, 2.0f);
temp->setFaction(me->getFaction()); temp->setFaction(me->getFaction());
temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
@@ -1030,7 +1030,7 @@ public:
if (Creature* temp = Unit::GetCreature(*me, uiMaxwellGUID)) if (Creature* temp = Unit::GetCreature(*me, uiMaxwellGUID))
{ {
temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED);
temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(false);
temp->SetSpeed(MOVE_RUN, 2.0f); temp->SetSpeed(MOVE_RUN, 2.0f);
temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
DoScriptText(SAY_LIGHT_OF_DAWN50, temp); DoScriptText(SAY_LIGHT_OF_DAWN50, temp);
@@ -1038,7 +1038,7 @@ public:
if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID)) if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID))
{ {
temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED);
temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(false);
temp->SetSpeed(MOVE_RUN, 2.0f); temp->SetSpeed(MOVE_RUN, 2.0f);
temp->HandleEmoteCommand(EMOTE_STATE_ATTACK_UNARMED); temp->HandleEmoteCommand(EMOTE_STATE_ATTACK_UNARMED);
temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
@@ -1046,7 +1046,7 @@ public:
if (Creature* temp = Unit::GetCreature(*me, uiEligorGUID)) if (Creature* temp = Unit::GetCreature(*me, uiEligorGUID))
{ {
temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED);
temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(false);
temp->SetSpeed(MOVE_RUN, 2.0f); temp->SetSpeed(MOVE_RUN, 2.0f);
temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
} }
@@ -1111,7 +1111,7 @@ public:
case 46: // Darion stand up, "not today" case 46: // Darion stand up, "not today"
me->SetSpeed(MOVE_RUN, 1.0f); me->SetSpeed(MOVE_RUN, 1.0f);
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
me->SetStandState(UNIT_STAND_STATE_STAND); me->SetStandState(UNIT_STAND_STATE_STAND);
DoScriptText(SAY_LIGHT_OF_DAWN53, me); DoScriptText(SAY_LIGHT_OF_DAWN53, me);
SetHoldState(false); // Darion throws sword SetHoldState(false); // Darion throws sword
@@ -1171,7 +1171,7 @@ public:
temp->CastSpell(temp, SPELL_TIRION_CHARGE, false); // jumping charge temp->CastSpell(temp, SPELL_TIRION_CHARGE, false); // jumping charge
temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H);
temp->SetSpeed(MOVE_RUN, 3.0f); // workarounds, make Tirion still running temp->SetSpeed(MOVE_RUN, 3.0f); // workarounds, make Tirion still running
temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(false);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[2].x, LightofDawnLoc[2].y, LightofDawnLoc[2].z); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[2].x, LightofDawnLoc[2].y, LightofDawnLoc[2].z);
if (Creature* lktemp = Unit::GetCreature(*me, uiLichKingGUID)) if (Creature* lktemp = Unit::GetCreature(*me, uiLichKingGUID))
lktemp->Relocate(LightofDawnLoc[28].x, LightofDawnLoc[28].y, LightofDawnLoc[28].z); // workarounds, he should kick back by Tirion, but here we relocate him lktemp->Relocate(LightofDawnLoc[28].x, LightofDawnLoc[28].y, LightofDawnLoc[28].z); // workarounds, he should kick back by Tirion, but here we relocate him
@@ -1189,7 +1189,7 @@ public:
if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID))
{ {
temp->SetSpeed(MOVE_RUN, 1.0f); temp->SetSpeed(MOVE_RUN, 1.0f);
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[29].x, LightofDawnLoc[29].y, LightofDawnLoc[29].z); // 26 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[29].x, LightofDawnLoc[29].y, LightofDawnLoc[29].z); // 26
} }
JumpToNextStep(4000); JumpToNextStep(4000);
@@ -1249,7 +1249,7 @@ public:
case 62: case 62:
if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID))
{ {
temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(true);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[7].x, LightofDawnLoc[7].y, LightofDawnLoc[7].z); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[7].x, LightofDawnLoc[7].y, LightofDawnLoc[7].z);
} }
JumpToNextStep(5500); JumpToNextStep(5500);
@@ -1438,7 +1438,7 @@ public:
me->DeleteThreatList(); me->DeleteThreatList();
me->CombatStop(true); me->CombatStop(true);
me->InterruptNonMeleeSpells(false); me->InterruptNonMeleeSpells(false);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i) for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i)
DespawnNPC(uiDefenderGUID[i]); DespawnNPC(uiDefenderGUID[i]);
@@ -1460,7 +1460,7 @@ public:
temp->CombatStop(true); temp->CombatStop(true);
temp->AttackStop(); temp->AttackStop();
temp->setFaction(me->getFaction()); temp->setFaction(me->getFaction());
temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(false);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[9].x, LightofDawnLoc[9].y, LightofDawnLoc[9].z); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[9].x, LightofDawnLoc[9].y, LightofDawnLoc[9].z);
} }
@@ -1471,7 +1471,7 @@ public:
temp->CombatStop(true); temp->CombatStop(true);
temp->AttackStop(); temp->AttackStop();
temp->setFaction(me->getFaction()); temp->setFaction(me->getFaction());
temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(false);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[12].x, LightofDawnLoc[12].y, LightofDawnLoc[12].z); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[12].x, LightofDawnLoc[12].y, LightofDawnLoc[12].z);
} }
@@ -1482,7 +1482,7 @@ public:
temp->CombatStop(true); temp->CombatStop(true);
temp->AttackStop(); temp->AttackStop();
temp->setFaction(me->getFaction()); temp->setFaction(me->getFaction());
temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(false);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[15].x, LightofDawnLoc[15].y, LightofDawnLoc[15].z); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[15].x, LightofDawnLoc[15].y, LightofDawnLoc[15].z);
} }
DespawnNPC(uiRayneGUID); DespawnNPC(uiRayneGUID);
@@ -1494,7 +1494,7 @@ public:
temp->CombatStop(true); temp->CombatStop(true);
temp->AttackStop(); temp->AttackStop();
temp->setFaction(me->getFaction()); temp->setFaction(me->getFaction());
temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(false);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[18].x, LightofDawnLoc[18].y, LightofDawnLoc[18].z); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[18].x, LightofDawnLoc[18].y, LightofDawnLoc[18].z);
temp->CastSpell(temp, SPELL_THE_LIGHT_OF_DAWN, false); temp->CastSpell(temp, SPELL_THE_LIGHT_OF_DAWN, false);
} }
@@ -1509,7 +1509,7 @@ public:
temp->CombatStop(true); temp->CombatStop(true);
temp->AttackStop(); temp->AttackStop();
temp->setFaction(me->getFaction()); temp->setFaction(me->getFaction());
temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(false);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[20].x, LightofDawnLoc[20].y, LightofDawnLoc[20].z); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[20].x, LightofDawnLoc[20].y, LightofDawnLoc[20].z);
temp->CastSpell(temp, SPELL_THE_LIGHT_OF_DAWN, false); temp->CastSpell(temp, SPELL_THE_LIGHT_OF_DAWN, false);
} }
@@ -74,7 +74,7 @@ public:
switch (phase) switch (phase)
{ {
case 0: case 0:
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
me->HandleEmoteCommand(EMOTE_STATE_FLYGRABCLOSED); me->HandleEmoteCommand(EMOTE_STATE_FLYGRABCLOSED);
FlyBackTimer = 500; FlyBackTimer = 500;
break; break;
@@ -501,7 +501,7 @@ class mob_janalai_hatcher : public CreatureScript
void Reset() void Reset()
{ {
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
side =(me->GetPositionY() < 1150); side =(me->GetPositionY() < 1150);
waypoint = 0; waypoint = 0;
isHatching = false; isHatching = false;
@@ -136,7 +136,7 @@ class boss_nalorakk : public CreatureScript
inMove = false; inMove = false;
waitTimer = 0; waitTimer = 0;
me->SetSpeed(MOVE_RUN, 2); me->SetSpeed(MOVE_RUN, 2);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
}else }else
{ {
(*me).GetMotionMaster()->MovePoint(0, NalorakkWay[7][0], NalorakkWay[7][1], NalorakkWay[7][2]); (*me).GetMotionMaster()->MovePoint(0, NalorakkWay[7][0], NalorakkWay[7][1], NalorakkWay[7][2]);
@@ -168,8 +168,10 @@ public:
me->AI()->AttackStart(Summ1); me->AI()->AttackStart(Summ1);
break; break;
} }
case 19: me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); break; case 19: me->SetWalk(false);
case 25: me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); break; break;
case 25: me->SetWalk(true);
break;
case 30: case 30:
if (player && player->GetTypeId() == TYPEID_PLAYER) if (player && player->GetTypeId() == TYPEID_PLAYER)
CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me); CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me);
@@ -273,7 +273,7 @@ public:
void JustSummoned(Creature* summoned) void JustSummoned(Creature* summoned)
{ {
summoned->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); summoned->SetWalk(false);
summoned->GetMotionMaster()->MovePoint(0, m_afAmbushMoveTo[m_iSpawnId].m_fX, m_afAmbushMoveTo[m_iSpawnId].m_fY, m_afAmbushMoveTo[m_iSpawnId].m_fZ); summoned->GetMotionMaster()->MovePoint(0, m_afAmbushMoveTo[m_iSpawnId].m_fX, m_afAmbushMoveTo[m_iSpawnId].m_fY, m_afAmbushMoveTo[m_iSpawnId].m_fZ);
} }
@@ -84,7 +84,7 @@ public:
return; return;
if (uiI >= 65 && me->GetUnitMovementFlags() == MOVEMENTFLAG_WALKING) if (uiI >= 65 && me->GetUnitMovementFlags() == MOVEMENTFLAG_WALKING)
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
switch (uiI) switch (uiI)
{ {
@@ -94,7 +94,7 @@ public:
uiPhase = 1; uiPhase = 1;
break; break;
case 65: case 65:
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
break; break;
case 115: case 115:
player->AreaExploredOrEventHappens(QUEST_MISSING_IN_ACTION); player->AreaExploredOrEventHappens(QUEST_MISSING_IN_ACTION);
@@ -391,7 +391,7 @@ public:
{ {
npc_marzon_silent_bladeAI(Creature* creature) : ScriptedAI(creature) npc_marzon_silent_bladeAI(Creature* creature) : ScriptedAI(creature)
{ {
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
} }
void Reset() void Reset()
@@ -492,7 +492,7 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
// Increment Enemy Count to be used in World States and instance script // Increment Enemy Count to be used in World States and instance script
++EnemyCount; ++EnemyCount;
creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); creature->SetWalk(false);
creature->setActive(true); creature->setActive(true);
switch (entry) switch (entry)
{ {
@@ -1014,7 +1014,7 @@ void hyjalAI::WaypointReached(uint32 i)
if ((*itr) && (*itr)->isAlive() && (*itr) != me && (*itr)->GetEntry() != JAINA) if ((*itr) && (*itr)->isAlive() && (*itr) != me && (*itr)->GetEntry() != JAINA)
{ {
if (!(*itr)->IsWithinDist(me, 60)) if (!(*itr)->IsWithinDist(me, 60))
(*itr)->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); (*itr)->SetWalk(false);
float x, y, z; float x, y, z;
(*itr)->SetDefaultMovementType(IDLE_MOTION_TYPE); (*itr)->SetDefaultMovementType(IDLE_MOTION_TYPE);
(*itr)->GetMotionMaster()->Initialize(); (*itr)->GetMotionMaster()->Initialize();
@@ -591,11 +591,11 @@ public:
} }
//After waypoint 0 //After waypoint 0
case 1: case 1:
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
if (Unit* pUther = me->SummonCreature(NPC_UTHER, 1794.357f, 1272.183f, 140.558f, 1.37f, TEMPSUMMON_DEAD_DESPAWN, 180000)) if (Unit* pUther = me->SummonCreature(NPC_UTHER, 1794.357f, 1272.183f, 140.558f, 1.37f, TEMPSUMMON_DEAD_DESPAWN, 180000))
{ {
uiUtherGUID = pUther->GetGUID(); uiUtherGUID = pUther->GetGUID();
pUther->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); pUther->SetWalk(false);
pUther->GetMotionMaster()->MovePoint(0, 1897.018f, 1287.487f, 143.481f); pUther->GetMotionMaster()->MovePoint(0, 1897.018f, 1287.487f, 143.481f);
pUther->SetTarget(me->GetGUID()); pUther->SetTarget(me->GetGUID());
me->SetTarget(uiUtherGUID); me->SetTarget(uiUtherGUID);
@@ -680,7 +680,7 @@ public:
case 17: case 17:
if (Creature* pUther = Unit::GetCreature(*me, uiUtherGUID)) if (Creature* pUther = Unit::GetCreature(*me, uiUtherGUID))
{ {
pUther->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); pUther->SetWalk(true);
pUther->GetMotionMaster()->MovePoint(0, 1794.357f, 1272.183f, 140.558f); pUther->GetMotionMaster()->MovePoint(0, 1794.357f, 1272.183f, 140.558f);
} }
JumpToNextStep(1000); JumpToNextStep(1000);
@@ -689,7 +689,7 @@ public:
if (Creature* pJaina = Unit::GetCreature(*me, uiJainaGUID)) if (Creature* pJaina = Unit::GetCreature(*me, uiJainaGUID))
{ {
me->SetTarget(uiJainaGUID); me->SetTarget(uiJainaGUID);
pJaina->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); pJaina->SetWalk(true);
pJaina->GetMotionMaster()->MovePoint(0, 1794.357f, 1272.183f, 140.558f); pJaina->GetMotionMaster()->MovePoint(0, 1794.357f, 1272.183f, 140.558f);
} }
JumpToNextStep(1000); JumpToNextStep(1000);
@@ -755,7 +755,7 @@ public:
if (Creature* pCityman = Unit::GetCreature(*me, uiCitymenGUID[0])) if (Creature* pCityman = Unit::GetCreature(*me, uiCitymenGUID[0]))
{ {
pCityman->SetTarget(me->GetGUID()); pCityman->SetTarget(me->GetGUID());
pCityman->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); pCityman->SetWalk(true);
pCityman->GetMotionMaster()->MovePoint(0, 2088.625f, 1279.191f, 140.743f); pCityman->GetMotionMaster()->MovePoint(0, 2088.625f, 1279.191f, 140.743f);
} }
JumpToNextStep(2000); JumpToNextStep(2000);
@@ -929,7 +929,7 @@ public:
if (Unit* pBoss = me->SummonCreature(uiBossID, 2232.19f, 1331.933f, 126.662f, 3.15f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000)) if (Unit* pBoss = me->SummonCreature(uiBossID, 2232.19f, 1331.933f, 126.662f, 3.15f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000))
{ {
uiBossGUID = pBoss->GetGUID(); uiBossGUID = pBoss->GetGUID();
pBoss->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); pBoss->SetWalk(true);
pBoss->GetMotionMaster()->MovePoint(0, 2194.110f, 1332.00f, 130.00f); pBoss->GetMotionMaster()->MovePoint(0, 2194.110f, 1332.00f, 130.00f);
} }
} }
@@ -401,7 +401,7 @@ public:
SetRun(); SetRun();
break; break;
case 91: case 91:
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
SetRun(false); SetRun(false);
break; break;
case 93: case 93:
@@ -301,7 +301,7 @@ public:
{ {
if (npc->isAlive()) if (npc->isAlive())
{ {
npc->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); npc->SetWalk(true);
npc->GetMotionMaster()->MovePoint(1, x, y, z); npc->GetMotionMaster()->MovePoint(1, x, y, z);
npc->SetHomePosition(x, y, z, o); npc->SetHomePosition(x, y, z, o);
} }
@@ -204,7 +204,7 @@ void initBlyCrewMember(InstanceScript* instance, uint32 entry, float x, float y,
if (Creature* crew = instance->instance->GetCreature(instance->GetData64(entry))) if (Creature* crew = instance->instance->GetCreature(instance->GetData64(entry)))
{ {
crew->SetReactState(REACT_AGGRESSIVE); crew->SetReactState(REACT_AGGRESSIVE);
crew->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); crew->SetWalk(true);
crew->SetHomePosition(x, y, z, 0); crew->SetHomePosition(x, y, z, 0);
crew->GetMotionMaster()->MovePoint(1, x, y, z); crew->GetMotionMaster()->MovePoint(1, x, y, z);
crew->setFaction(FACTION_FREED); crew->setFaction(FACTION_FREED);
@@ -640,7 +640,7 @@ public:
case 37: case 37:
DoScriptText(SAY_QUEST_COMPLETE, me, player); DoScriptText(SAY_QUEST_COMPLETE, me, player);
me->SetSpeed(MOVE_RUN, 1.2f, true); me->SetSpeed(MOVE_RUN, 1.2f, true);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
if (player && player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H)) if (player && player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H))
player->GroupEventHappens(QUEST_STINKYS_ESCAPE_H, me); player->GroupEventHappens(QUEST_STINKYS_ESCAPE_H, me);
if (player && player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A)) if (player && player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A))
@@ -480,7 +480,7 @@ public:
if (temp->isAlive() && !temp->getVictim()) if (temp->isAlive() && !temp->getVictim())
{ {
if (temp->HasUnitMovementFlag(MOVEMENTFLAG_WALKING)) if (temp->HasUnitMovementFlag(MOVEMENTFLAG_WALKING))
temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); temp->SetWalk(false);
if (temp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) if (temp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
@@ -71,7 +71,7 @@ class npc_xerestrasza : public CreatureScript
_isIntro = false; _isIntro = false;
Talk(SAY_XERESTRASZA_EVENT); Talk(SAY_XERESTRASZA_EVENT);
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
me->GetMotionMaster()->MovePoint(0, xerestraszaMovePos); me->GetMotionMaster()->MovePoint(0, xerestraszaMovePos);
_events.ScheduleEvent(EVENT_XERESTRASZA_EVENT_1, 16000); _events.ScheduleEvent(EVENT_XERESTRASZA_EVENT_1, 16000);
@@ -255,7 +255,7 @@ class boss_lich_king_toc : public CreatureScript
summoned->SetDisplayId(11686); summoned->SetDisplayId(11686);
} }
if (m_instance) m_instance->SetData(TYPE_LICH_KING, IN_PROGRESS); if (m_instance) m_instance->SetData(TYPE_LICH_KING, IN_PROGRESS);
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
} }
void MovementInform(uint32 uiType, uint32 uiId) void MovementInform(uint32 uiType, uint32 uiId)
@@ -378,7 +378,7 @@ class npc_fizzlebang_toc : public CreatureScript
void Reset() void Reset()
{ {
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
m_uiPortalGUID = 0; m_uiPortalGUID = 0;
me->GetMotionMaster()->MovePoint(1, ToCCommonLoc[10].GetPositionX(), ToCCommonLoc[10].GetPositionY()-60, ToCCommonLoc[10].GetPositionZ()); me->GetMotionMaster()->MovePoint(1, ToCCommonLoc[10].GetPositionX(), ToCCommonLoc[10].GetPositionY()-60, ToCCommonLoc[10].GetPositionZ());
} }
@@ -390,7 +390,7 @@ class npc_fizzlebang_toc : public CreatureScript
switch (uiId) switch (uiId)
{ {
case 1: case 1:
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
if (m_instance) if (m_instance)
{ {
m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR));
@@ -641,7 +641,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript
switch (id) switch (id)
{ {
case POINT_FIRST_STEP: case POINT_FIRST_STEP:
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
Talk(SAY_INTRO_HORDE_3); Talk(SAY_INTRO_HORDE_3);
_events.ScheduleEvent(EVENT_INTRO_HORDE_5, 15500, 0, PHASE_INTRO_H); _events.ScheduleEvent(EVENT_INTRO_HORDE_5, 15500, 0, PHASE_INTRO_H);
_events.ScheduleEvent(EVENT_INTRO_HORDE_6, 29500, 0, PHASE_INTRO_H); _events.ScheduleEvent(EVENT_INTRO_HORDE_6, 29500, 0, PHASE_INTRO_H);
@@ -687,7 +687,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript
switch (eventId) switch (eventId)
{ {
case EVENT_INTRO_HORDE_3: case EVENT_INTRO_HORDE_3:
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
me->GetMotionMaster()->MovePoint(POINT_FIRST_STEP, firstStepPos.GetPositionX(), firstStepPos.GetPositionY(), firstStepPos.GetPositionZ()); me->GetMotionMaster()->MovePoint(POINT_FIRST_STEP, firstStepPos.GetPositionX(), firstStepPos.GetPositionY(), firstStepPos.GetPositionZ());
break; break;
case EVENT_INTRO_HORDE_5: case EVENT_INTRO_HORDE_5:
@@ -718,7 +718,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript
{ {
float x, y, z; float x, y, z;
deathbringer->GetClosePoint(x, y, z, deathbringer->GetObjectSize()); deathbringer->GetClosePoint(x, y, z, deathbringer->GetObjectSize());
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
me->GetMotionMaster()->MovePoint(POINT_CORPSE, x, y, z); me->GetMotionMaster()->MovePoint(POINT_CORPSE, x, y, z);
} }
break; break;
@@ -841,7 +841,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript
{ {
if (type == POINT_MOTION_TYPE && id == POINT_FIRST_STEP) if (type == POINT_MOTION_TYPE && id == POINT_FIRST_STEP)
{ {
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
Talk(SAY_INTRO_ALLIANCE_4); Talk(SAY_INTRO_ALLIANCE_4);
_events.ScheduleEvent(EVENT_INTRO_ALLIANCE_5, 5000, 0, PHASE_INTRO_A); _events.ScheduleEvent(EVENT_INTRO_ALLIANCE_5, 5000, 0, PHASE_INTRO_A);
if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_DEATHBRINGER_SAURFANG))) if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_DEATHBRINGER_SAURFANG)))
@@ -865,7 +865,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript
switch (eventId) switch (eventId)
{ {
case EVENT_INTRO_ALLIANCE_4: case EVENT_INTRO_ALLIANCE_4:
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
me->GetMotionMaster()->MovePoint(POINT_FIRST_STEP, firstStepPos.GetPositionX(), firstStepPos.GetPositionY(), firstStepPos.GetPositionZ()); me->GetMotionMaster()->MovePoint(POINT_FIRST_STEP, firstStepPos.GetPositionX(), firstStepPos.GetPositionY(), firstStepPos.GetPositionZ());
break; break;
case EVENT_INTRO_ALLIANCE_5: case EVENT_INTRO_ALLIANCE_5:
@@ -191,7 +191,7 @@ class boss_professor_putricide : public CreatureScript
SetPhase(PHASE_COMBAT_1); SetPhase(PHASE_COMBAT_1);
_experimentState = EXPERIMENT_STATE_OOZE; _experimentState = EXPERIMENT_STATE_OOZE;
me->SetReactState(REACT_DEFENSIVE); me->SetReactState(REACT_DEFENSIVE);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE) if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
me->GetMotionMaster()->MovementExpired(); me->GetMotionMaster()->MovementExpired();
@@ -230,7 +230,7 @@ class boss_professor_putricide : public CreatureScript
void JustReachedHome() void JustReachedHome()
{ {
_JustReachedHome(); _JustReachedHome();
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
if (events.GetPhaseMask() & PHASE_MASK_COMBAT) if (events.GetPhaseMask() & PHASE_MASK_COMBAT)
instance->SetBossState(DATA_PROFESSOR_PUTRICIDE, FAIL); instance->SetBossState(DATA_PROFESSOR_PUTRICIDE, FAIL);
} }
@@ -660,7 +660,7 @@ class boss_the_lich_king : public CreatureScript
summons.DespawnAll(); summons.DespawnAll();
SendMusicToPlayers(MUSIC_FURY_OF_FROSTMOURNE); SendMusicToPlayers(MUSIC_FURY_OF_FROSTMOURNE);
DoCastAOE(SPELL_FURY_OF_FROSTMOURNE); DoCastAOE(SPELL_FURY_OF_FROSTMOURNE);
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
events.ScheduleEvent(EVENT_OUTRO_TALK_1, 2600, 0, PHASE_OUTRO); events.ScheduleEvent(EVENT_OUTRO_TALK_1, 2600, 0, PHASE_OUTRO);
events.ScheduleEvent(EVENT_OUTRO_EMOTE_TALK, 6600, 0, PHASE_OUTRO); events.ScheduleEvent(EVENT_OUTRO_EMOTE_TALK, 6600, 0, PHASE_OUTRO);
events.ScheduleEvent(EVENT_OUTRO_EMOTE_TALK, 17600, 0, PHASE_OUTRO); events.ScheduleEvent(EVENT_OUTRO_EMOTE_TALK, 17600, 0, PHASE_OUTRO);
@@ -864,7 +864,7 @@ class boss_the_lich_king : public CreatureScript
case EVENT_INTRO_MOVE_1: case EVENT_INTRO_MOVE_1:
me->SetSheath(SHEATH_STATE_MELEE); me->SetSheath(SHEATH_STATE_MELEE);
me->RemoveAurasDueToSpell(SPELL_EMOTE_SIT_NO_SHEATH); me->RemoveAurasDueToSpell(SPELL_EMOTE_SIT_NO_SHEATH);
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
me->GetMotionMaster()->MovePoint(POINT_LK_INTRO_1, LichKingIntro[0]); me->GetMotionMaster()->MovePoint(POINT_LK_INTRO_1, LichKingIntro[0]);
break; break;
case EVENT_INTRO_MOVE_2: case EVENT_INTRO_MOVE_2:
@@ -894,7 +894,7 @@ class boss_the_lich_king : public CreatureScript
events.ScheduleEvent(EVENT_FINISH_INTRO, 1000, 0, PHASE_INTRO); events.ScheduleEvent(EVENT_FINISH_INTRO, 1000, 0, PHASE_INTRO);
break; break;
case EVENT_FINISH_INTRO: case EVENT_FINISH_INTRO:
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_AGGRESSIVE); me->SetReactState(REACT_AGGRESSIVE);
events.SetPhase(PHASE_ONE); events.SetPhase(PHASE_ONE);
@@ -1226,7 +1226,7 @@ class npc_tirion_fordring_tft : public CreatureScript
{ {
_events.SetPhase(PHASE_INTRO); _events.SetPhase(PHASE_INTRO);
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
me->GetMotionMaster()->MovePoint(POINT_TIRION_INTRO, TirionIntro); me->GetMotionMaster()->MovePoint(POINT_TIRION_INTRO, TirionIntro);
} }
} }
@@ -1264,7 +1264,7 @@ class npc_tirion_fordring_tft : public CreatureScript
me->HandleEmoteCommand(EMOTE_ONESHOT_POINT_NO_SHEATHE); me->HandleEmoteCommand(EMOTE_ONESHOT_POINT_NO_SHEATHE);
break; break;
case EVENT_INTRO_CHARGE: case EVENT_INTRO_CHARGE:
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
me->GetMotionMaster()->MovePoint(POINT_TIRION_CHARGE, TirionCharge); me->GetMotionMaster()->MovePoint(POINT_TIRION_CHARGE, TirionCharge);
break; break;
case EVENT_OUTRO_TALK_1: case EVENT_OUTRO_TALK_1:
@@ -194,7 +194,7 @@ public:
{ {
movementStarted = true; movementStarted = true;
me->SetReactState(REACT_PASSIVE); me->SetReactState(REACT_PASSIVE);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
me->SetSpeed(MOVE_RUN, me->GetSpeedRate(MOVE_RUN), true); me->SetSpeed(MOVE_RUN, me->GetSpeedRate(MOVE_RUN), true);
switch (id) switch (id)
@@ -169,7 +169,8 @@ class npc_azure_ring_captain : public CreatureScript
{ {
targetGUID = 0; targetGUID = 0;
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING | MOVEMENTFLAG_FLYING); me->SetWalk(true);
me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
me->SetReactState(REACT_AGGRESSIVE); me->SetReactState(REACT_AGGRESSIVE);
} }
@@ -214,7 +215,7 @@ class npc_azure_ring_captain : public CreatureScript
if (Unit* victim = varos->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0)) if (Unit* victim = varos->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0))
{ {
me->SetReactState(REACT_PASSIVE); me->SetReactState(REACT_PASSIVE);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
me->GetMotionMaster()->MovePoint(ACTION_CALL_DRAGON_EVENT, victim->GetPositionX(), victim->GetPositionY(), victim->GetPositionZ() + 20.0f); me->GetMotionMaster()->MovePoint(ACTION_CALL_DRAGON_EVENT, victim->GetPositionX(), victim->GetPositionY(), victim->GetPositionZ() + 20.0f);
targetGUID = victim->GetGUID(); targetGUID = victim->GetGUID();
} }
@@ -647,7 +647,7 @@ class npc_expedition_commander : public CreatureScript
for (uint8 n = 0; n < RAID_MODE(2, 4); n++) for (uint8 n = 0; n < RAID_MODE(2, 4); n++)
{ {
Engineer[n] = me->SummonCreature(NPC_ENGINEER, PosEngSpawn, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); Engineer[n] = me->SummonCreature(NPC_ENGINEER, PosEngSpawn, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
Engineer[n]->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); Engineer[n]->SetWalk(false);
Engineer[n]->SetSpeed(MOVE_RUN, 0.5f); Engineer[n]->SetSpeed(MOVE_RUN, 0.5f);
Engineer[n]->SetHomePosition(PosEngRepair[n]); Engineer[n]->SetHomePosition(PosEngRepair[n]);
Engineer[n]->GetMotionMaster()->MoveTargetedHome(); Engineer[n]->GetMotionMaster()->MoveTargetedHome();
@@ -660,7 +660,7 @@ class npc_expedition_commander : public CreatureScript
for (uint8 n = 0; n < 4; n++) for (uint8 n = 0; n < 4; n++)
{ {
Defender[n] = me->SummonCreature(NPC_DEFENDER, PosDefSpawn[n], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); Defender[n] = me->SummonCreature(NPC_DEFENDER, PosDefSpawn[n], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
Defender[n]->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); Defender[n]->SetWalk(false);
Defender[n]->SetHomePosition(PosDefCombat[n]); Defender[n]->SetHomePosition(PosDefCombat[n]);
Defender[n]->GetMotionMaster()->MoveTargetedHome(); Defender[n]->GetMotionMaster()->MoveTargetedHome();
} }
@@ -240,7 +240,7 @@ public:
m_instance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, IN_PROGRESS); m_instance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, IN_PROGRESS);
m_instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); m_instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
me->GetMotionMaster()->MoveJump(Location[0].GetPositionX(), Location[0].GetPositionY(), Location[0].GetPositionZ(), 5.0f, 10.0f); me->GetMotionMaster()->MoveJump(Location[0].GetPositionX(), Location[0].GetPositionY(), Location[0].GetPositionZ(), 5.0f, 10.0f);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
m_uiMountTimer = 1000; m_uiMountTimer = 1000;
Summons.DespawnEntry(CREATURE_GRAUF); Summons.DespawnEntry(CREATURE_GRAUF);
} }
@@ -340,7 +340,7 @@ public:
if ((*itr)->isAlive()) if ((*itr)->isAlive())
{ {
(*itr)->SetStandState(UNIT_STAND_STATE_STAND); (*itr)->SetStandState(UNIT_STAND_STATE_STAND);
(*itr)->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); (*itr)->SetWalk(false);
(*itr)->GetMotionMaster()->MovePoint(1, spectatorWP[0][0], spectatorWP[0][1], spectatorWP[0][2]); (*itr)->GetMotionMaster()->MovePoint(1, spectatorWP[0][0], spectatorWP[0][1], spectatorWP[0][2]);
} }
} }
@@ -363,7 +363,7 @@ public:
{ {
if (Creature* pGuard = *itr) if (Creature* pGuard = *itr)
{ {
pGuard->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); pGuard->SetWalk(false);
pGuard->GetMotionMaster()->MovePoint(0, MovePosition); pGuard->GetMotionMaster()->MovePoint(0, MovePosition);
} }
} }
@@ -1030,16 +1030,16 @@ public:
uiArthas = pArthas->GetGUID(); uiArthas = pArthas->GetGUID();
pArthas->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); pArthas->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pArthas->SetReactState(REACT_PASSIVE); pArthas->SetReactState(REACT_PASSIVE);
pArthas->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); pArthas->SetWalk(true);
pArthas->GetMotionMaster()->MovePoint(0, 3737.374756f, 3564.841309f, 477.433014f); pArthas->GetMotionMaster()->MovePoint(0, 3737.374756f, 3564.841309f, 477.433014f);
} }
if (Creature* pTalbot = me->SummonCreature(NPC_COUNSELOR_TALBOT, 3747.23f, 3614.936f, 473.321f, 4.462012f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 120000)) if (Creature* pTalbot = me->SummonCreature(NPC_COUNSELOR_TALBOT, 3747.23f, 3614.936f, 473.321f, 4.462012f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 120000))
{ {
uiTalbot = pTalbot->GetGUID(); uiTalbot = pTalbot->GetGUID();
pTalbot->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); pTalbot->SetWalk(true);
pTalbot->GetMotionMaster()->MovePoint(0, 3738.000977f, 3568.882080f, 477.433014f); pTalbot->GetMotionMaster()->MovePoint(0, 3738.000977f, 3568.882080f, 477.433014f);
} }
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
break; break;
case 4: case 4:
@@ -1118,13 +1118,13 @@ public:
if (Creature* pArlos = me->SummonCreature(NPC_GENERAL_ARLOS, 3745.527100f, 3615.655029f, 473.321533f, 4.447805f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 120000)) if (Creature* pArlos = me->SummonCreature(NPC_GENERAL_ARLOS, 3745.527100f, 3615.655029f, 473.321533f, 4.447805f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 120000))
{ {
uiArlos = pArlos->GetGUID(); uiArlos = pArlos->GetGUID();
pArlos->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); pArlos->SetWalk(true);
pArlos->GetMotionMaster()->MovePoint(0, 3735.570068f, 3572.419922f, 477.441010f); pArlos->GetMotionMaster()->MovePoint(0, 3735.570068f, 3572.419922f, 477.441010f);
} }
if (Creature* pLeryssa = me->SummonCreature(NPC_LERYSSA, 3749.654541f, 3614.959717f, 473.323486f, 4.524959f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 120000)) if (Creature* pLeryssa = me->SummonCreature(NPC_LERYSSA, 3749.654541f, 3614.959717f, 473.323486f, 4.524959f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 120000))
{ {
uiLeryssa = pLeryssa->GetGUID(); uiLeryssa = pLeryssa->GetGUID();
pLeryssa->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); pLeryssa->SetWalk(false);
pLeryssa->SetReactState(REACT_PASSIVE); pLeryssa->SetReactState(REACT_PASSIVE);
pLeryssa->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); pLeryssa->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pLeryssa->GetMotionMaster()->MovePoint(0, 3741.969971f, 3571.439941f, 477.441010f); pLeryssa->GetMotionMaster()->MovePoint(0, 3741.969971f, 3571.439941f, 477.441010f);
@@ -1446,7 +1446,7 @@ public:
pArlos->Kill(pArlos, false); pArlos->Kill(pArlos, false);
pLeryssa->RemoveAura(SPELL_STUN); pLeryssa->RemoveAura(SPELL_STUN);
pLeryssa->ClearUnitState(UNIT_STATE_STUNNED); pLeryssa->ClearUnitState(UNIT_STATE_STUNNED);
pLeryssa->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); pLeryssa->SetWalk(false);
pLeryssa->GetMotionMaster()->MovePoint(0, 3722.114502f, 3564.201660f, 477.441437f); pLeryssa->GetMotionMaster()->MovePoint(0, 3722.114502f, 3564.201660f, 477.441437f);
if (killer->GetTypeId() == TYPEID_PLAYER) if (killer->GetTypeId() == TYPEID_PLAYER)
@@ -162,7 +162,7 @@ public:
player->GroupEventHappens(QUEST_PERILOUS_ADVENTURE, me); player->GroupEventHappens(QUEST_PERILOUS_ADVENTURE, me);
DoScriptText(SAY_QUEST_COMPLETE, me, player); DoScriptText(SAY_QUEST_COMPLETE, me, player);
} }
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
break; break;
case 25: case 25:
DoScriptText(SAY_VICTORY4, me); DoScriptText(SAY_VICTORY4, me);
@@ -389,7 +389,7 @@ public:
{ {
if (player->isAlive()) if (player->isAlive())
{ {
summon->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); summon->SetWalk(false);
summon->GetMotionMaster()->MovePoint(0, afCenter[0], afCenter[1], afCenter[2]); summon->GetMotionMaster()->MovePoint(0, afCenter[0], afCenter[1], afCenter[2]);
summon->AI()->AttackStart(player); summon->AI()->AttackStart(player);
return; return;
+1 -1
View File
@@ -1328,7 +1328,7 @@ public:
break; break;
case 2: case 2:
// walk forward // walk forward
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
me->GetMotionMaster()->MovePoint(0, me->GetPositionX() + (cos(m_heading) * 10), me->GetPositionY() + (sin(m_heading) * 10), me->GetPositionZ()); me->GetMotionMaster()->MovePoint(0, me->GetPositionX() + (cos(m_heading) * 10), me->GetPositionY() + (sin(m_heading) * 10), me->GetPositionZ());
m_uiTimer = 5000; m_uiTimer = 5000;
m_uiPhase = 3; m_uiPhase = 3;
@@ -750,7 +750,7 @@ public:
if (!Trigger) return; if (!Trigger) return;
Trigger->SetSpeed(MOVE_WALK, 3); Trigger->SetSpeed(MOVE_WALK, 3);
Trigger->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); Trigger->SetWalk(true);
Trigger->GetMotionMaster()->MovePoint(0, final.x, final.y, final.z); Trigger->GetMotionMaster()->MovePoint(0, final.x, final.y, final.z);
// Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); // Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -1537,7 +1537,7 @@ public:
void BeginWalk() void BeginWalk()
{ {
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
me->SetSpeed(MOVE_RUN, 1.0f); me->SetSpeed(MOVE_RUN, 1.0f);
me->GetMotionMaster()->MovePoint(0, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z); me->GetMotionMaster()->MovePoint(0, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z);
} }
@@ -1932,7 +1932,7 @@ void boss_illidan_stormrage::boss_illidan_stormrageAI::HandleTalkSequence()
// Equip our warglaives! // Equip our warglaives!
SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE);
me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
break; break;
case 9: case 9:
if (GETCRE(Akama, AkamaGUID)) if (GETCRE(Akama, AkamaGUID))
@@ -354,7 +354,7 @@ public:
if (Sorcerer) if (Sorcerer)
{ {
CAST_AI(mob_ashtongue_sorcerer::mob_ashtongue_sorcererAI, Sorcerer->AI())->ShadeGUID = me->GetGUID(); CAST_AI(mob_ashtongue_sorcerer::mob_ashtongue_sorcererAI, Sorcerer->AI())->ShadeGUID = me->GetGUID();
Sorcerer->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); Sorcerer->SetWalk(false);
Sorcerer->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); Sorcerer->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
Sorcerer->SetTarget(me->GetGUID()); Sorcerer->SetTarget(me->GetGUID());
Sorcerers.push_back(Sorcerer->GetGUID()); Sorcerers.push_back(Sorcerer->GetGUID());
@@ -369,7 +369,7 @@ public:
Creature* Spawn = me->SummonCreature(spawnEntries[i], X, Y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000); Creature* Spawn = me->SummonCreature(spawnEntries[i], X, Y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000);
if (Spawn) if (Spawn)
{ {
Spawn->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); Spawn->SetWalk(false);
Spawn->GetMotionMaster()->MovePoint(0, AGGRO_X, AGGRO_Y, AGGRO_Z); Spawn->GetMotionMaster()->MovePoint(0, AGGRO_X, AGGRO_Y, AGGRO_Z);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1); Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
Spawn->AI()->AttackStart(target); Spawn->AI()->AttackStart(target);
@@ -430,7 +430,7 @@ public:
Creature* Defender = me->SummonCreature(CREATURE_DEFENDER, SpawnLocations[ran].x, SpawnLocations[ran].y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000); Creature* Defender = me->SummonCreature(CREATURE_DEFENDER, SpawnLocations[ran].x, SpawnLocations[ran].y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000);
if (Defender) if (Defender)
{ {
Defender->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); Defender->SetWalk(false);
bool move = true; bool move = true;
if (AkamaGUID) if (AkamaGUID)
{ {
@@ -760,7 +760,7 @@ public:
{ {
ShadeHasDied = true; ShadeHasDied = true;
WayPointId = 0; WayPointId = 0;
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
me->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z); me->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z);
} }
if (Shade && Shade->isAlive()) if (Shade && Shade->isAlive())
@@ -644,7 +644,7 @@ public:
if (move <= diff) if (move <= diff)
{ {
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
if (phase == 1) if (phase == 1)
me->GetMotionMaster()->MovePoint(0, x, y, z); me->GetMotionMaster()->MovePoint(0, x, y, z);
if (phase == 1 && me->IsWithinDist3d(x, y, z, 0.1f)) if (phase == 1 && me->IsWithinDist3d(x, y, z, 0.1f))
@@ -146,7 +146,7 @@ class boss_nazan : public CreatureScript
BellowingRoar_Timer = 6000; BellowingRoar_Timer = 6000;
ConeOfFire_Timer = 12000; ConeOfFire_Timer = 12000;
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
me->GetMotionMaster()->Clear(); me->GetMotionMaster()->Clear();
if (Unit* victim = SelectTarget(SELECT_TARGET_NEAREST, 0)) if (Unit* victim = SelectTarget(SELECT_TARGET_NEAREST, 0))
me->AI()->AttackStart(victim); me->AI()->AttackStart(victim);
@@ -95,7 +95,7 @@ class boss_warchief_kargath_bladefist : public CreatureScript
removeAdds(); removeAdds();
me->SetSpeed(MOVE_RUN, 2); me->SetSpeed(MOVE_RUN, 2);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
summoned = 2; summoned = 2;
InBlade = false; InBlade = false;
+2 -2
View File
@@ -258,7 +258,7 @@ public:
if (summoned->isTotem()) if (summoned->isTotem())
return; return;
summoned->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); summoned->SetWalk(false);
summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
summoned->AI()->AttackStart(me); summoned->AI()->AttackStart(me);
@@ -603,7 +603,7 @@ public:
if (summoned->isTotem()) if (summoned->isTotem())
return; return;
summoned->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); summoned->SetWalk(false);
summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
summoned->AI()->AttackStart(me); summoned->AI()->AttackStart(me);
} }
@@ -366,7 +366,7 @@ public:
float x, y, z; float x, y, z;
caster->GetClosePoint(x, y, z, me->GetObjectSize()); caster->GetClosePoint(x, y, z, me->GetObjectSize());
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
me->GetMotionMaster()->MovePoint(1, x, y, z); me->GetMotionMaster()->MovePoint(1, x, y, z);
} }
} }
@@ -497,7 +497,8 @@ public:
me->SetInFront(player); break; me->SetInFront(player); break;
case 30: me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break; case 30: me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
case 31: DoCast(me, SPELL_CAT); case 31: DoCast(me, SPELL_CAT);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); break; me->SetWalk(false);
break;
} }
} }
@@ -198,7 +198,7 @@ class npc_dream_fog : public CreatureScript
me->GetMotionMaster()->MoveRandom(25.0f); me->GetMotionMaster()->MoveRandom(25.0f);
} }
// Seeping fog movement is slow enough for a player to be able to walk backwards and still outpace it // Seeping fog movement is slow enough for a player to be able to walk backwards and still outpace it
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(true);
me->SetSpeed(MOVE_WALK, 0.75f); me->SetSpeed(MOVE_WALK, 0.75f);
} }
else else
+1 -1
View File
@@ -764,7 +764,7 @@ public:
DoScriptText(RAND(SAY_DOC1, SAY_DOC2, SAY_DOC3), me); DoScriptText(RAND(SAY_DOC1, SAY_DOC2, SAY_DOC3), me);
uint32 mobId = me->GetEntry(); uint32 mobId = me->GetEntry();
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->SetWalk(false);
switch (mobId) switch (mobId)
{ {