Rename "SetPosition" to "UpdatePosition".

Replace CreatureRelocation in scripts with new Creature::SetPosition.
This commit is contained in:
megamage
2011-10-10 17:08:01 -04:00
parent 76c9c30c2b
commit d156e066cf
33 changed files with 74 additions and 59 deletions
+1 -1
View File
@@ -623,7 +623,7 @@ public:
const_cast<CreatureData*>(data)->posZ = z;
const_cast<CreatureData*>(data)->orientation = o;
}
creature->GetMap()->CreatureRelocation(creature, x, y, z, o);
creature->SetPosition(x, y, z, o);
creature->GetMotionMaster()->Initialize();
if (creature->isAlive()) // dead creature will reset movement generator at respawn
{
@@ -206,7 +206,7 @@ public:
{
float x = KaelLocations[0][0];
float y = KaelLocations[0][1];
me->GetMap()->CreatureRelocation(me, x, y, LOCATION_Z, 0.0f);
me->SetPosition(x, y, LOCATION_Z, 0.0f);
//me->SendMonsterMove(x, y, LOCATION_Z, 0, 0, 0); // causes some issues...
std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
@@ -53,7 +53,7 @@ public:
me->GetPosition(x, y, z);
z += 4; x -= 3.5; y -= 5;
me->GetMotionMaster()->Clear(false);
me->GetMap()->CreatureRelocation(me, x, y, z, 0.0f);
me->SetPosition(x, y, z, 0.0f);
}
void UpdateAI(const uint32 diff)
@@ -756,7 +756,7 @@ public:
{
float x, y, z;
me->GetPosition(x, y, z); //this visual aura some under ground
me->GetMap()->CreatureRelocation(me, x, y, z + 0.35f, 0.0f);
me->SetPosition(x, y, z + 0.35f, 0.0f);
Despawn();
Creature* debuff = DoSpawnCreature(HELPER, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 14500);
if (debuff)
@@ -661,7 +661,7 @@ public:
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_SATH_DEATH, me);
me->GetMap()->CreatureRelocation(me, me->GetPositionX(), me->GetPositionY(), DRAGON_REALM_Z, me->GetOrientation());
me->SetPosition(me->GetPositionX(), me->GetPositionY(), DRAGON_REALM_Z, me->GetOrientation());
TeleportAllPlayersBack();
if (Creature* Kalecgos = Unit::GetCreature(*me, KalecgosGUID))
{
@@ -335,7 +335,7 @@ class boss_hexlord_malacrass : public CreatureScript
else
{
creature->AI()->EnterEvadeMode();
creature->GetMap()->CreatureRelocation(me, Pos_X[i], POS_Y, POS_Z, ORIENT);
creature->SetPosition(Pos_X[i], POS_Y, POS_Z, ORIENT);
creature->StopMoving();
}
}
@@ -185,7 +185,7 @@ class boss_marli : public CreatureScript
if (target)
{
DoCast(target, SPELL_CHARGE);
//me->GetMap()->CreatureRelocation(me, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
//me->SetPosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
//me->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true, 1);
AttackStart(target);
}
@@ -107,10 +107,10 @@ public:
{
if (summoned->GetEntry() == ENTRY_HIGHBORNE_BUNNY)
{
if (Unit* target = Unit::GetUnit(*summoned, targetGUID))
if (Creature* target = Unit::GetCreature(*summoned, targetGUID))
{
target->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0);
target->GetMap()->CreatureRelocation(me, target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0.0f);
target->SetPosition(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0.0f);
summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false);
}
@@ -187,7 +187,7 @@ public:
{
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->SendMonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, 5000);
me->GetMap()->CreatureRelocation(me, me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetOrientation());
me->SetPosition(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetOrientation());
EventMove = false;
} else EventMove_Timer -= diff;
}
@@ -1202,7 +1202,7 @@ public:
me->GetPosition(x, y, z);
z = me->GetMap()->GetHeight(x, y, z);
me->GetMotionMaster()->MovePoint(0, x, y, z);
me->GetMap()->CreatureRelocation(me, x, y, z, 0);
me->SetPosition(x, y, z, 0);
}
void EnterCombat(Unit* /*who*/) {}
@@ -1321,7 +1321,7 @@ public:
me->GetPosition(x, y, z);
z = me->GetMap()->GetHeight(x, y, z);
me->GetMotionMaster()->MovePoint(0, x, y, z);
me->GetMap()->CreatureRelocation(me, x, y, z, 0);
me->SetPosition(x, y, z, 0);
hyjal_trashAI::JustDied(victim);
}
@@ -1073,7 +1073,7 @@ public:
if (!target->HasAura(SPELL_DIGESTIVE_ACID))
{
me->GetMap()->CreatureRelocation(me, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
me->SetPosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
if (Creature* pPortal = me->SummonCreature(MOB_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
@@ -1185,7 +1185,7 @@ public:
if (!target->HasAura(SPELL_DIGESTIVE_ACID))
{
me->GetMap()->CreatureRelocation(me, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
me->SetPosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
if (Creature* pPortal = me->SummonCreature(MOB_GIANT_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
@@ -157,15 +157,15 @@ public:
switch (urand(0, 2))
{
case 0:
me->GetMap()->CreatureRelocation(me, -8340.782227f, 2083.814453f, 125.648788f, 0.0f);
me->SetPosition(-8340.782227f, 2083.814453f, 125.648788f, 0.0f);
DoResetThreat();
break;
case 1:
me->GetMap()->CreatureRelocation(me, -8341.546875f, 2118.504639f, 133.058151f, 0.0f);
me->SetPosition(-8341.546875f, 2118.504639f, 133.058151f, 0.0f);
DoResetThreat();
break;
case 2:
me->GetMap()->CreatureRelocation(me, -8318.822266f, 2058.231201f, 133.058151f, 0.0f);
me->SetPosition(-8318.822266f, 2058.231201f, 133.058151f, 0.0f);
DoResetThreat();
break;
}
@@ -252,7 +252,7 @@ public:
me->RemoveAllAuras();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetVisible(false);
me->GetMap()->CreatureRelocation(me, bossc->x, bossc->y, bossc->z, bossc->r);
me->SetPosition(bossc->x, bossc->y, bossc->z, bossc->r);
Invisible = true;
DoResetThreat();
DoStopAttack();
@@ -216,15 +216,12 @@ struct boss_twinemperorsAI : public ScriptedAI
if (pOtherBoss)
{
//me->MonsterYell("Teleporting ...", LANG_UNIVERSAL, 0);
float other_x = pOtherBoss->GetPositionX();
float other_y = pOtherBoss->GetPositionY();
float other_z = pOtherBoss->GetPositionZ();
float other_o = pOtherBoss->GetOrientation();
Map* thismap = me->GetMap();
thismap->CreatureRelocation(pOtherBoss, me->GetPositionX(),
me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
thismap->CreatureRelocation(me, other_x, other_y, other_z, other_o);
Position thisPos;
thisPos.Relocate(me);
Position otherPos;
otherPos.Relocate(pOtherBoss);
pOtherBoss->SetPosition(thisPos);
me->SetPosition(otherPos);
SetAfterTeleport();
CAST_AI(boss_twinemperorsAI, pOtherBoss->AI())->SetAfterTeleport();
+1 -1
View File
@@ -357,7 +357,7 @@ public:
Map* map = me->GetMap();
if (map)
{
map->CreatureRelocation(me, 3706.39f, -3969.15f, 35.9118f, 0);
me->SetPosition(3706.39f, -3969.15f, 35.9118f, 0);
me->AI_SendMoveToPacket(3706.39f, -3969.15f, 35.9118f, 0, 0, 0);
}
//begin swimming and summon depth charges
@@ -238,7 +238,7 @@ public:
for (uint8 n = 0; n < 3; ++n)
time[n] = 0;
me->GetMotionMaster()->Clear();
me->GetMap()->CreatureRelocation(me, CenterOfRoom.GetPositionX(), CenterOfRoom.GetPositionY(), CenterOfRoom.GetPositionZ(), CenterOfRoom.GetOrientation());
me->SetPosition(CenterOfRoom.GetPositionX(), CenterOfRoom.GetPositionY(), CenterOfRoom.GetPositionZ(), CenterOfRoom.GetOrientation());
DoCast(me, SPELL_TELESTRA_BACK);
me->SetVisible(true);
if (Phase == 1)
@@ -757,7 +757,7 @@ class boss_flame_leviathan_safety_container : public CreatureScript
me->GetPosition(x, y, z);
z = me->GetMap()->GetHeight(x, y, z);
me->GetMotionMaster()->MovePoint(0, x, y, z);
me->GetMap()->CreatureRelocation(me, x, y, z, 0);
me->SetPosition(x, y, z, 0);
}
void UpdateAI(uint32 const /*diff*/)
@@ -260,7 +260,7 @@ class mob_frozen_orb_stalker : public CreatureScript
{
Position pos;
me->GetNearPoint(toravon, pos.m_positionX, pos.m_positionY, pos.m_positionZ, 0.0f, 10.0f, 0.0f);
me->SetPosition(pos, true);
me->SetPosition(pos);
DoCast(me, SPELL_FROZEN_ORB_SUMMON);
}
}
@@ -291,7 +291,7 @@ public:
if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH))
i_pl->TeleportTo(me->GetMapId(), VorpilPosition[0], VorpilPosition[1], VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT);
me->GetMap()->CreatureRelocation(me, VorpilPosition[0], VorpilPosition[1], VorpilPosition[2], 0.0f);
me->SetPosition(VorpilPosition[0], VorpilPosition[1], VorpilPosition[2], 0.0f);
DoCast(me, SPELL_DRAW_SHADOWS, true);
DoCast(me, SPELL_RAIN_OF_FIRE);
@@ -1967,7 +1967,7 @@ void boss_illidan_stormrage::boss_illidan_stormrageAI::HandleTalkSequence()
Summons.DespawnAll();
break;
case 17:
if (GETUNIT(Akama, AkamaGUID))
if (GETCRE(Akama, AkamaGUID))
{
if (!me->IsWithinDistInMap(Akama, 15))
{
@@ -1976,7 +1976,7 @@ void boss_illidan_stormrage::boss_illidan_stormrageAI::HandleTalkSequence()
x += 10; y += 10;
Akama->GetMotionMaster()->Clear(false);
//Akama->GetMotionMaster()->MoveIdle();
Akama->GetMap()->CreatureRelocation(me, x, y, z, 0.0f);
Akama->SetPosition(x, y, z, 0.0f);
Akama->SendMonsterMove(x, y, z, 0, MOVEMENTFLAG_NONE, 0);//Illidan must not die until Akama arrives.
Akama->GetMotionMaster()->MoveChase(me);
}
@@ -291,7 +291,7 @@ class boss_alar : public CreatureScript
if (me->IsWithinDist3d(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 5.0f))
dist = 5.0f;
WaitTimer = 1000 + uint32(floor(dist / 80 * 1000.0f));
me->GetMap()->CreatureRelocation(me, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f);
me->SetPosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f);
me->StopMoving();
WaitEvent = WE_LAND;
}
@@ -278,7 +278,7 @@ class boss_high_astromancer_solarian : public CreatureScript
Phase1_Timer = 50000;
//After these 50 seconds she portals to the middle of the room and disappears, leaving 3 light portals behind.
me->GetMotionMaster()->Clear();
me->GetMap()->CreatureRelocation(me, CENTER_X, CENTER_Y, CENTER_Z, CENTER_O);
me->SetPosition(CENTER_X, CENTER_Y, CENTER_Z, CENTER_O);
for (uint8 i=0; i <= 2; ++i)
{
if (!i)
@@ -346,7 +346,7 @@ class boss_high_astromancer_solarian : public CreatureScript
//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;
me->GetMotionMaster()->Clear();
me->GetMap()->CreatureRelocation(me, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O);
me->SetPosition(Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O);
for (int j=0; j <= 2; j++)
if (j != i)
@@ -819,7 +819,7 @@ class boss_kaelthas : public CreatureScript
me->StopMoving();
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
me->GetMap()->CreatureRelocation(me, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0);
me->SetPosition(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0);
me->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, 0, 0);
me->InterruptNonMeleeSpells(false);
@@ -886,7 +886,7 @@ class boss_kaelthas : public CreatureScript
me->StopMoving();
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
me->GetMap()->CreatureRelocation(me, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0);
me->SetPosition(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0);
me->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, MOVEMENTFLAG_NONE, 0);
// 1) Kael'thas will portal the whole raid right into his body