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
@@ -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