Merge [SD2]

r1171 Restore compile. Replace add/remove/has monster movement flag with new function and correct CreatureRelocation() and SendMonsterMove() related code.
Remove all use of Relocate() and replace with expected CreatureRelocation()
Requires Mangos 8078.

--HG--
branch : trunk
This commit is contained in:
Kudlaty
2009-08-10 20:32:12 +02:00
parent 77e186c95e
commit 3b3a878199
15 changed files with 23 additions and 23 deletions
@@ -279,7 +279,7 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI
if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH)) if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH))
i_pl->TeleportTo(m_creature->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT); i_pl->TeleportTo(m_creature->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT);
m_creature->Relocate(VorpilPosition[0],VorpilPosition[1],VorpilPosition[2]); m_creature->GetMap()->CreatureRelocation(m_creature, VorpilPosition[0],VorpilPosition[1],VorpilPosition[2],0.0f);
DoCast(m_creature,SPELL_DRAW_SHADOWS,true); DoCast(m_creature,SPELL_DRAW_SHADOWS,true);
DoCast(m_creature,HeroicMode?H_SPELL_RAIN_OF_FIRE:SPELL_RAIN_OF_FIRE); DoCast(m_creature,HeroicMode?H_SPELL_RAIN_OF_FIRE:SPELL_RAIN_OF_FIRE);
@@ -1930,8 +1930,8 @@ void boss_illidan_stormrageAI::HandleTalkSequence()
x += 10; y += 10; x += 10; y += 10;
Akama->GetMotionMaster()->Clear(false); Akama->GetMotionMaster()->Clear(false);
//Akama->GetMotionMaster()->MoveIdle(); //Akama->GetMotionMaster()->MoveIdle();
Akama->Relocate(x, y, z); Akama->GetMap()->CreatureRelocation(m_creature, x, y, z, 0.0f);
Akama->SendMonsterMove(x, y, z, 0);//Illidan must not die until Akama arrives. Akama->SendMonsterMove(x, y, z, 0, MOVEMENTFLAG_NONE, 0);//Illidan must not die until Akama arrives.
Akama->GetMotionMaster()->MoveChase(m_creature); Akama->GetMotionMaster()->MoveChase(m_creature);
} }
} }
@@ -1137,7 +1137,7 @@ struct mob_frost_wyrmAI : public hyjal_trashAI
m_creature->GetPosition(x,y,z); m_creature->GetPosition(x,y,z);
z = m_creature->GetMap()->GetVmapHeight(x, y, z, true); z = m_creature->GetMap()->GetVmapHeight(x, y, z, true);
m_creature->GetMotionMaster()->MovePoint(0,x,y,z); m_creature->GetMotionMaster()->MovePoint(0,x,y,z);
m_creature->Relocate(x,y,z,0); m_creature->GetMap()->CreatureRelocation(m_creature, x,y,z,0);
} }
void EnterCombat(Unit* who) {} void EnterCombat(Unit* who) {}
@@ -1250,7 +1250,7 @@ struct mob_gargoyleAI : public hyjal_trashAI
m_creature->GetPosition(x,y,z); m_creature->GetPosition(x,y,z);
z = m_creature->GetMap()->GetVmapHeight(x, y, z, true); z = m_creature->GetMap()->GetVmapHeight(x, y, z, true);
m_creature->GetMotionMaster()->MovePoint(0,x,y,z); m_creature->GetMotionMaster()->MovePoint(0,x,y,z);
m_creature->Relocate(x,y,z,0); m_creature->GetMap()->CreatureRelocation(m_creature, x,y,z,0);
hyjal_trashAI::JustDied(victim); hyjal_trashAI::JustDied(victim);
} }
@@ -1181,7 +1181,7 @@ struct TRINITY_DLL_DECL npc_valkyr_battle_maidenAI : public ScriptedAI
m_creature->GetPosition(x, y, z); m_creature->GetPosition(x, y, z);
z += 4; x -= 3.5; y -= 5; z += 4; x -= 3.5; y -= 5;
m_creature->GetMotionMaster()->Clear(false); m_creature->GetMotionMaster()->Clear(false);
m_creature->Relocate(x, y, z); m_creature->GetMap()->CreatureRelocation(m_creature, x, y, z, 0.0f);
} }
void Aggro(Unit *who){} void Aggro(Unit *who){}
@@ -195,7 +195,7 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
{ {
float x = KaelLocations[0][0]; float x = KaelLocations[0][0];
float y = KaelLocations[0][1]; float y = KaelLocations[0][1];
m_creature->Relocate(x, y, LOCATION_Z, 0); m_creature->GetMap()->CreatureRelocation(m_creature, x, y, LOCATION_Z, 0.0f);
//m_creature->SendMonsterMove(x, y, LOCATION_Z, 0, 0, 0); // causes some issues... //m_creature->SendMonsterMove(x, y, LOCATION_Z, 0, 0, 0); // causes some issues...
std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin(); std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i) for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i)
@@ -184,7 +184,7 @@ struct TRINITY_DLL_DECL boss_magus_telestraAI : public ScriptedAI
if (FireMagusDead && FrostMagusDead && ArcaneMagusDead) if (FireMagusDead && FrostMagusDead && ArcaneMagusDead)
{ {
m_creature->GetMotionMaster()->Clear(); m_creature->GetMotionMaster()->Clear();
m_creature->Relocate(CenterOfRoom[0][0], CenterOfRoom[0][1], CenterOfRoom[0][2], CenterOfRoom[0][3]); m_creature->GetMap()->CreatureRelocation(m_creature, CenterOfRoom[0][0], CenterOfRoom[0][1], CenterOfRoom[0][2], CenterOfRoom[0][3]);
DoCast(m_creature, SPELL_TELESTRA_BACK); DoCast(m_creature, SPELL_TELESTRA_BACK);
m_creature->SetVisibility(VISIBILITY_ON); m_creature->SetVisibility(VISIBILITY_ON);
if (Phase == 1) if (Phase == 1)
@@ -734,7 +734,7 @@ struct TRINITY_DLL_DECL mob_pulsing_pumpkinAI : public ScriptedAI
{ {
float x, y, z; float x, y, z;
m_creature->GetPosition(x, y, z); //this visual aura some under ground m_creature->GetPosition(x, y, z); //this visual aura some under ground
m_creature->Relocate(x,y,z + 0.35f); m_creature->GetMap()->CreatureRelocation(m_creature, x,y,z + 0.35f, 0.0f);
Despawn(); Despawn();
Creature *debuff = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,14500); Creature *debuff = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,14500);
if(debuff) if(debuff)
@@ -334,7 +334,7 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI
void JustDied(Unit *killer) void JustDied(Unit *killer)
{ {
DoScriptText(SAY_SATH_DEATH, m_creature); DoScriptText(SAY_SATH_DEATH, m_creature);
m_creature->Relocate(m_creature->GetPositionX(), m_creature->GetPositionY(), DRAGON_REALM_Z, m_creature->GetOrientation()); m_creature->GetMap()->CreatureRelocation(m_creature, m_creature->GetPositionX(), m_creature->GetPositionY(), DRAGON_REALM_Z, m_creature->GetOrientation());
TeleportAllPlayersBack(); TeleportAllPlayersBack();
if(Unit *Kalecgos = Unit::GetUnit(*m_creature, KalecgosGUID)) if(Unit *Kalecgos = Unit::GetUnit(*m_creature, KalecgosGUID))
{ {
@@ -273,7 +273,7 @@ struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI
float dist; float dist;
if (m_creature->IsWithinDist3d(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 5.0f)) dist = 5.0f; if (m_creature->IsWithinDist3d(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 5.0f)) dist = 5.0f;
WaitTimer = 1000 + floor(dist / 80 * 1000.0f); WaitTimer = 1000 + floor(dist / 80 * 1000.0f);
m_creature->Relocate(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0.0f);
m_creature->StopMoving(); m_creature->StopMoving();
WaitEvent = WE_LAND; WaitEvent = WE_LAND;
} }
@@ -267,7 +267,7 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
Phase1_Timer = 50000; Phase1_Timer = 50000;
//After these 50 seconds she portals to the middle of the room and disappears, leaving 3 light portals behind. //After these 50 seconds she portals to the middle of the room and disappears, leaving 3 light portals behind.
m_creature->GetMotionMaster()->Clear(); m_creature->GetMotionMaster()->Clear();
m_creature->Relocate(SolarianPos[0], SolarianPos[1], SolarianPos[2], SolarianPos[3]); m_creature->GetMap()->CreatureRelocation(m_creature, CENTER_X, CENTER_Y, CENTER_Z, CENTER_O);
for(uint8 i=0; i<=2; ++i) for(uint8 i=0; i<=2; ++i)
{ {
if (!i) if (!i)
@@ -331,7 +331,7 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
//15 seconds later Solarian reappears out of one of the 3 portals. Simultaneously, 2 healers appear in the two other portals. //15 seconds later Solarian reappears out of one of the 3 portals. Simultaneously, 2 healers appear in the two other portals.
int i = rand()%3; int i = rand()%3;
m_creature->GetMotionMaster()->Clear(); m_creature->GetMotionMaster()->Clear();
m_creature->Relocate(Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O); m_creature->GetMap()->CreatureRelocation(m_creature, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O);
for (int j=0; j<=2; j++) for (int j=0; j<=2; j++)
if (j!=i) if (j!=i)
@@ -809,7 +809,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
m_creature->StopMoving(); m_creature->StopMoving();
m_creature->GetMotionMaster()->Clear(); m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MoveIdle(); m_creature->GetMotionMaster()->MoveIdle();
m_creature->Relocate(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0); m_creature->GetMap()->CreatureRelocation(m_creature, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0);
m_creature->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, 0, 0); m_creature->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, 0, 0);
m_creature->InterruptNonMeleeSpells(false); m_creature->InterruptNonMeleeSpells(false);
@@ -873,8 +873,8 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
m_creature->StopMoving(); m_creature->StopMoving();
m_creature->GetMotionMaster()->Clear(); m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MoveIdle(); m_creature->GetMotionMaster()->MoveIdle();
m_creature->Relocate(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0); m_creature->GetMap()->CreatureRelocation(m_creature, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0);
m_creature->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, 0, 0); m_creature->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, MOVEMENTFLAG_NONE, 0);
// 1) Kael'thas will portal the whole raid right into his body // 1) Kael'thas will portal the whole raid right into his body
for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i) for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i)
@@ -160,15 +160,15 @@ struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI
switch(rand()%3) switch(rand()%3)
{ {
case 0: case 0:
m_creature->Relocate(-8340.782227,2083.814453,125.648788,0); m_creature->GetMap()->CreatureRelocation(m_creature, -8340.782227,2083.814453,125.648788,0.0f);
DoResetThreat(); DoResetThreat();
break; break;
case 1: case 1:
m_creature->Relocate(-8341.546875,2118.504639,133.058151,0); m_creature->GetMap()->CreatureRelocation(m_creature, -8341.546875,2118.504639,133.058151,0.0f);
DoResetThreat(); DoResetThreat();
break; break;
case 2: case 2:
m_creature->Relocate(-8318.822266,2058.231201,133.058151,0); m_creature->GetMap()->CreatureRelocation(m_creature, -8318.822266,2058.231201,133.058151,0.0f);
DoResetThreat(); DoResetThreat();
break; break;
} }
@@ -259,7 +259,7 @@ struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI
m_creature->RemoveAllAuras(); m_creature->RemoveAllAuras();
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetVisibility(VISIBILITY_OFF); m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->Relocate(bossc->x, bossc->y, bossc->z, bossc->r); m_creature->GetMap()->CreatureRelocation(m_creature, bossc->x, bossc->y, bossc->z, bossc->r);
Invisible = true; Invisible = true;
delete place1; delete place1;
delete place2; delete place2;
@@ -87,7 +87,7 @@ struct TRINITY_DLL_DECL npc_lady_sylvanas_windrunnerAI : public ScriptedAI
if( Unit* target = Unit::GetUnit(*summoned,targetGUID) ) if( Unit* target = Unit::GetUnit(*summoned,targetGUID) )
{ {
target->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), myZ+15.0,0); target->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), myZ+15.0,0);
target->Relocate(target->GetPositionX(), target->GetPositionY(), myZ+15.0); target->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), myZ+15.0, 0.0f);
summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false); summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false);
} }
@@ -326,7 +326,7 @@ struct TRINITY_DLL_DECL boss_hex_lord_malacrassAI : public ScriptedAI
else else
{ {
pCreature->AI()->EnterEvadeMode(); pCreature->AI()->EnterEvadeMode();
pCreature->Relocate(Pos_X[i], POS_Y, POS_Z, ORIENT); pCreature->GetMap()->CreatureRelocation(m_creature, Pos_X[i], POS_Y, POS_Z, ORIENT);
pCreature->StopMoving(); pCreature->StopMoving();
} }
} }
@@ -174,7 +174,7 @@ struct TRINITY_DLL_DECL boss_marliAI : public ScriptedAI
if (target) if (target)
{ {
DoCast(target, SPELL_CHARGE); DoCast(target, SPELL_CHARGE);
//m_creature->Relocate(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); //m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
//m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1); //m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1);
AttackStart(target); AttackStart(target);
} }