feat(Core/Misc): change how Position struct is retrieved (#9017)
Update Position::GetPosition() and similar methods signatures to reflect 2a4c9bc changes by return a Position object instead of accepting a Position parameter by reference.
Cherry pick of 2585e799f9
This commit is contained in:
parent
d31d8279ca
commit
b7f8083915
36 changed files with 68 additions and 133 deletions
|
|
@ -355,15 +355,13 @@ Creature* CreatureAI::DoSummon(uint32 entry, const Position& pos, uint32 despawn
|
|||
|
||||
Creature* CreatureAI::DoSummon(uint32 entry, WorldObject* obj, float radius, uint32 despawnTime, TempSummonType summonType)
|
||||
{
|
||||
Position pos;
|
||||
obj->GetRandomNearPosition(pos, radius);
|
||||
Position pos = obj->GetRandomNearPosition(radius);
|
||||
return me->SummonCreature(entry, pos, summonType, despawnTime);
|
||||
}
|
||||
|
||||
Creature* CreatureAI::DoSummonFlyer(uint32 entry, WorldObject* obj, float flightZ, float radius, uint32 despawnTime, TempSummonType summonType)
|
||||
{
|
||||
Position pos;
|
||||
obj->GetRandomNearPosition(pos, radius);
|
||||
Position pos = obj->GetRandomNearPosition(radius);
|
||||
pos.m_positionZ += flightZ;
|
||||
return me->SummonCreature(entry, pos, summonType, despawnTime);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1484,9 +1484,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
for (uint32 i = 0; i < e.target.randomPoint.amount; i++)
|
||||
{
|
||||
if (e.target.randomPoint.self > 0)
|
||||
me->GetRandomPoint(me->GetPosition(), range, randomPoint);
|
||||
randomPoint = me->GetRandomPoint(me->GetPosition(), range);
|
||||
else
|
||||
me->GetRandomPoint(srcPos, range, randomPoint);
|
||||
randomPoint = me->GetRandomPoint(srcPos, range);
|
||||
if (Creature* summon = summoner->SummonCreature(e.action.summonCreature.creature, randomPoint, (TempSummonType)e.action.summonCreature.type, e.action.summonCreature.duration))
|
||||
{
|
||||
if (unit && e.action.summonCreature.attackInvoker)
|
||||
|
|
@ -1854,9 +1854,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
if (me)
|
||||
{
|
||||
float range = (float)e.target.randomPoint.range;
|
||||
Position randomPoint;
|
||||
Position srcPos = { e.target.x, e.target.y, e.target.z, e.target.o };
|
||||
me->GetRandomPoint(srcPos, range, randomPoint);
|
||||
Position randomPoint = me->GetRandomPoint(srcPos, range);
|
||||
me->GetMotionMaster()->MovePoint(
|
||||
e.action.MoveToPos.pointId,
|
||||
randomPoint.m_positionX,
|
||||
|
|
@ -2438,9 +2437,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
if (me)
|
||||
{
|
||||
float range = (float)e.target.randomPoint.range;
|
||||
Position randomPoint;
|
||||
Position srcPos = { e.target.x, e.target.y, e.target.z, e.target.o };
|
||||
me->GetRandomPoint(srcPos, range, randomPoint);
|
||||
Position randomPoint = me->GetRandomPoint(srcPos, range);
|
||||
me->GetMotionMaster()->MoveJump(randomPoint, (float)e.action.jump.speedxy, (float)e.action.jump.speedz);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -155,8 +155,7 @@ bool BattlefieldWG::SetupBattlefield()
|
|||
// Spawn turrets and hide them per default
|
||||
for (uint8 i = 0; i < WG_MAX_TURRET; i++)
|
||||
{
|
||||
Position towerCannonPos;
|
||||
WGTurret[i].GetPosition(&towerCannonPos);
|
||||
Position towerCannonPos = WGTurret[i].GetPosition();
|
||||
if (Creature* creature = SpawnCreature(NPC_WINTERGRASP_TOWER_CANNON, towerCannonPos, TEAM_ALLIANCE))
|
||||
{
|
||||
CanonList.insert(creature->GetGUID());
|
||||
|
|
|
|||
|
|
@ -1338,8 +1338,7 @@ struct BfWGGameObjectBuilding
|
|||
// Spawn Turret bottom
|
||||
for (uint8 i = 0; i < TowerCannon[towerid].nbTowerCannonBottom; i++)
|
||||
{
|
||||
Position turretPos;
|
||||
TowerCannon[towerid].TowerCannonBottom[i].GetPosition(&turretPos);
|
||||
Position turretPos = TowerCannon[towerid].TowerCannonBottom[i].GetPosition();
|
||||
if (Creature* turret = m_WG->SpawnCreature(NPC_WINTERGRASP_TOWER_CANNON, turretPos, TEAM_ALLIANCE))
|
||||
{
|
||||
m_TowerCannonBottomList.insert(turret->GetGUID());
|
||||
|
|
@ -1350,8 +1349,7 @@ struct BfWGGameObjectBuilding
|
|||
// Spawn Turret top
|
||||
for (uint8 i = 0; i < TowerCannon[towerid].nbTurretTop; i++)
|
||||
{
|
||||
Position towerCannonPos;
|
||||
TowerCannon[towerid].TurretTop[i].GetPosition(&towerCannonPos);
|
||||
Position towerCannonPos = TowerCannon[towerid].TurretTop[i].GetPosition();
|
||||
if (Creature* turret = m_WG->SpawnCreature(NPC_WINTERGRASP_TOWER_CANNON, towerCannonPos, TEAM_ALLIANCE))
|
||||
{
|
||||
m_TurretTopList.insert(turret->GetGUID());
|
||||
|
|
|
|||
|
|
@ -310,11 +310,10 @@ inline void Battleground::_CheckSafePositions(uint32 diff)
|
|||
{
|
||||
m_ValidStartPositionTimer = 0;
|
||||
|
||||
Position pos;
|
||||
float x, y, z, o;
|
||||
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
|
||||
{
|
||||
itr->second->GetPosition(&pos);
|
||||
Position pos = itr->second->GetPosition();
|
||||
GetTeamStartLoc(itr->second->GetBgTeamId(), x, y, z, o);
|
||||
if (pos.GetExactDistSq(x, y, z) > maxDist)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1684,11 +1684,11 @@ void WorldObject::GetRandomPoint(const Position& pos, float distance, float& ran
|
|||
UpdateGroundPositionZ(rand_x, rand_y, rand_z); // update to LOS height if available
|
||||
}
|
||||
|
||||
void WorldObject::GetRandomPoint(const Position& srcPos, float distance, Position& pos) const
|
||||
Position WorldObject::GetRandomPoint(const Position& srcPos, float distance) const
|
||||
{
|
||||
float x, y, z;
|
||||
GetRandomPoint(srcPos, distance, x, y, z);
|
||||
pos.Relocate(x, y, z, GetOrientation());
|
||||
return Position(x, y, z, GetOrientation());
|
||||
}
|
||||
|
||||
void WorldObject::UpdateGroundPositionZ(float x, float y, float &z) const
|
||||
|
|
@ -2797,22 +2797,18 @@ bool WorldObject::GetClosePoint(float& x, float& y, float& z, float size, float
|
|||
return true;
|
||||
}
|
||||
|
||||
void WorldObject::GetNearPosition(Position& pos, float dist, float angle)
|
||||
Position WorldObject::GetNearPosition(float dist, float angle)
|
||||
{
|
||||
GetPosition(&pos);
|
||||
Position pos = GetPosition();
|
||||
MovePosition(pos, dist, angle);
|
||||
return pos;
|
||||
}
|
||||
|
||||
void WorldObject::GetFirstCollisionPosition(Position& pos, float dist, float angle)
|
||||
Position WorldObject::GetRandomNearPosition(float radius)
|
||||
{
|
||||
GetPosition(&pos);
|
||||
MovePositionToFirstCollision(pos, dist, angle);
|
||||
}
|
||||
|
||||
void WorldObject::GetRandomNearPosition(Position& pos, float radius)
|
||||
{
|
||||
GetPosition(&pos);
|
||||
Position pos = GetPosition();
|
||||
MovePosition(pos, radius * (float) rand_norm(), (float) rand_norm() * static_cast<float>(2 * M_PI));
|
||||
return pos;
|
||||
}
|
||||
|
||||
void WorldObject::GetContactPoint(const WorldObject* obj, float& x, float& y, float& z, float distance2d) const
|
||||
|
|
@ -2926,7 +2922,7 @@ Position WorldObject::GetFirstCollisionPosition(float destX, float destY, float
|
|||
Position WorldObject::GetFirstCollisionPosition(float dist, float angle)
|
||||
{
|
||||
Position pos = GetPosition();
|
||||
GetFirstCollisionPosition(pos, dist, angle);
|
||||
MovePositionToFirstCollision(pos, dist, angle);
|
||||
return pos;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -354,11 +354,6 @@ struct Position
|
|||
z = m_positionZ;
|
||||
o = m_orientation;
|
||||
}
|
||||
void GetPosition(Position* pos) const
|
||||
{
|
||||
if (pos)
|
||||
pos->Relocate(m_positionX, m_positionY, m_positionZ, m_orientation);
|
||||
}
|
||||
|
||||
[[nodiscard]] Position GetPosition() const { return *this; }
|
||||
|
||||
|
|
@ -697,13 +692,12 @@ public:
|
|||
void GetVoidClosePoint(float& x, float& y, float& z, float size, float distance2d = 0, float relAngle = 0, float controlZ = 0) const;
|
||||
bool GetClosePoint(float& x, float& y, float& z, float size, float distance2d = 0, float angle = 0, const WorldObject* forWho = nullptr, bool force = false) const;
|
||||
void MovePosition(Position& pos, float dist, float angle);
|
||||
void GetNearPosition(Position& pos, float dist, float angle);
|
||||
Position GetNearPosition(float dist, float angle);
|
||||
void MovePositionToFirstCollision(Position& pos, float dist, float angle);
|
||||
Position GetFirstCollisionPosition(float startX, float startY, float startZ, float destX, float destY);
|
||||
Position GetFirstCollisionPosition(float destX, float destY, float destZ);
|
||||
Position GetFirstCollisionPosition(float dist, float angle);
|
||||
void GetFirstCollisionPosition(Position& pos, float dist, float angle);
|
||||
void GetRandomNearPosition(Position& pos, float radius);
|
||||
Position GetRandomNearPosition(float radius);
|
||||
|
||||
void GetContactPoint(const WorldObject* obj, float& x, float& y, float& z, float distance2d = CONTACT_DISTANCE) const;
|
||||
void GetChargeContactPoint(const WorldObject* obj, float& x, float& y, float& z, float distance2d = CONTACT_DISTANCE) const;
|
||||
|
|
@ -715,7 +709,7 @@ public:
|
|||
void UpdateAllowedPositionZ(float x, float y, float& z, float* groundZ = nullptr) const;
|
||||
|
||||
void GetRandomPoint(const Position& srcPos, float distance, float& rand_x, float& rand_y, float& rand_z) const;
|
||||
void GetRandomPoint(const Position& srcPos, float distance, Position& pos) const;
|
||||
Position GetRandomPoint(const Position& srcPos, float distance) const;
|
||||
|
||||
[[nodiscard]] uint32 GetInstanceId() const { return m_InstanceId; }
|
||||
|
||||
|
|
|
|||
|
|
@ -1439,8 +1439,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
|
|||
// near teleport, triggering send MSG_MOVE_TELEPORT_ACK from client at landing
|
||||
if (!GetSession()->PlayerLogout())
|
||||
{
|
||||
Position oldPos;
|
||||
GetPosition(&oldPos);
|
||||
Position oldPos = GetPosition();
|
||||
Relocate(x, y, z, orientation);
|
||||
SendTeleportAckPacket();
|
||||
SendTeleportPacket(oldPos); // this automatically relocates to oldPos in order to broadcast the packet in the right place
|
||||
|
|
|
|||
|
|
@ -18833,7 +18833,7 @@ void Unit::_ExitVehicle(Position const* exitPosition)
|
|||
|
||||
Position pos;
|
||||
if (!exitPosition) // Exit position not specified
|
||||
vehicleBase->GetPosition(&pos); // This should use passenger's current position, leaving it as it is now
|
||||
pos = vehicleBase->GetPosition(); // This should use passenger's current position, leaving it as it is now
|
||||
// because we calculate positions incorrect (sometimes under map)
|
||||
else
|
||||
pos = *exitPosition;
|
||||
|
|
|
|||
|
|
@ -2491,7 +2491,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
|
|||
pos = *destTarget;
|
||||
else
|
||||
// randomize position for multiple summons
|
||||
m_caster->GetRandomPoint(*destTarget, radius, pos);
|
||||
pos = m_caster->GetRandomPoint(*destTarget, radius);
|
||||
|
||||
summon = m_originalCaster->SummonCreature(entry, pos, summonType, duration);
|
||||
if (!summon)
|
||||
|
|
@ -4883,8 +4883,7 @@ void Spell::EffectLeap(SpellEffIndex /*effIndex*/)
|
|||
if (!m_targets.HasDst())
|
||||
return;
|
||||
|
||||
Position dstpos;
|
||||
destTarget->GetPosition(&dstpos);
|
||||
Position dstpos = destTarget->GetPosition();
|
||||
unitTarget->NearTeleportTo(dstpos.GetPositionX(), dstpos.GetPositionY(), dstpos.GetPositionZ(), dstpos.GetOrientation(), unitTarget == m_caster);
|
||||
}
|
||||
|
||||
|
|
@ -5118,15 +5117,7 @@ void Spell::EffectCharge(SpellEffIndex /*effIndex*/)
|
|||
}
|
||||
else
|
||||
{
|
||||
Position pos;
|
||||
unitTarget->GetContactPoint(m_caster, pos.m_positionX, pos.m_positionY, pos.m_positionZ);
|
||||
// assume that target is not in water - else should be always in los
|
||||
if (!m_caster->IsWithinLOS(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ()))
|
||||
{
|
||||
float angle = m_caster->GetRelativeAngle(&pos);
|
||||
float dist = m_caster->GetDistance(pos);
|
||||
m_caster->GetFirstCollisionPosition(pos, dist, angle);
|
||||
}
|
||||
Position pos = unitTarget->GetFirstCollisionPosition(unitTarget->GetObjectSize(), unitTarget->GetRelativeAngle(m_caster));
|
||||
|
||||
m_caster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ + Z_OFFSET_FIND_HEIGHT, SPEED_CHARGE, EVENT_CHARGE,
|
||||
nullptr, false, 0.f, targetGUID);
|
||||
|
|
@ -5156,14 +5147,13 @@ void Spell::EffectChargeDest(SpellEffIndex /*effIndex*/)
|
|||
|
||||
if (m_targets.HasDst())
|
||||
{
|
||||
Position pos;
|
||||
destTarget->GetPosition(&pos);
|
||||
Position pos = destTarget->GetPosition();
|
||||
|
||||
if (!m_caster->IsWithinLOS(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ()))
|
||||
{
|
||||
float angle = m_caster->GetRelativeAngle(pos.GetPositionX(), pos.GetPositionY());
|
||||
float dist = m_caster->GetDistance(pos);
|
||||
m_caster->GetFirstCollisionPosition(pos, dist, angle);
|
||||
pos = m_caster->GetFirstCollisionPosition(dist, angle);
|
||||
}
|
||||
|
||||
m_caster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ);
|
||||
|
|
@ -6206,7 +6196,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const*
|
|||
else
|
||||
{
|
||||
// randomize position
|
||||
m_caster->GetRandomPoint(*destTarget, radius, pos);
|
||||
pos = m_caster->GetRandomPoint(*destTarget, radius);
|
||||
}
|
||||
|
||||
summon = map->SummonCreature(entry, pos, properties, duration, caster, m_spellInfo->Id);
|
||||
|
|
@ -6470,8 +6460,7 @@ void Spell::EffectBind(SpellEffIndex effIndex)
|
|||
homeLoc.WorldRelocate(*destTarget);
|
||||
else
|
||||
{
|
||||
player->GetPosition(&homeLoc);
|
||||
homeLoc.m_mapId = player->GetMapId();
|
||||
homeLoc = player->GetWorldLocation();
|
||||
}
|
||||
|
||||
player->SetHomebind(homeLoc, areaId);
|
||||
|
|
|
|||
|
|
@ -62,8 +62,7 @@ public:
|
|||
bool Execute(uint64 /*time*/, uint32 /*diff*/) override
|
||||
{
|
||||
_me->SetReactState(REACT_PASSIVE);
|
||||
Position movePos;
|
||||
_me->GetRandomPoint(OrcsRunawayPosition, 10.0f, movePos);
|
||||
Position movePos = _me->GetRandomPoint(OrcsRunawayPosition, 10.0f);
|
||||
_me->GetMotionMaster()->MovePoint(1, movePos);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -272,8 +272,7 @@ public:
|
|||
PreventHitDefaultEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
Position pos;
|
||||
target->GetFirstCollisionPosition(pos, 5.0f, M_PI);
|
||||
Position pos = target->GetFirstCollisionPosition(5.0f, M_PI);
|
||||
GetCaster()->CastSpell(target, SPELL_GARROTE_DUMMY, true);
|
||||
GetCaster()->RemoveAurasDueToSpell(SPELL_VANISH);
|
||||
GetCaster()->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), target->GetOrientation());
|
||||
|
|
|
|||
|
|
@ -299,7 +299,7 @@ public:
|
|||
|
||||
if ((me->GetMapId() == 532))
|
||||
{
|
||||
me->GetRandomNearPosition(pos, 40.0);
|
||||
pos = me->GetRandomNearPosition(40.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -778,8 +778,7 @@ public:
|
|||
|
||||
if (MoveTimer <= diff)
|
||||
{
|
||||
Position pos;
|
||||
me->GetRandomNearPosition(pos, 10);
|
||||
Position pos = me->GetRandomNearPosition(10);
|
||||
me->GetMotionMaster()->MovePoint(0, pos);
|
||||
MoveTimer = urand(3000, 5000);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -318,8 +318,7 @@ public:
|
|||
// emerge cast tr false 66947
|
||||
case EVENT_SPAWN_WAVE_1:
|
||||
{
|
||||
Position spawnPos;
|
||||
c->GetPosition(&spawnPos);
|
||||
Position spawnPos = c->GetPosition();
|
||||
spawnPos.m_orientation = 5.80f;
|
||||
spawnPos.m_positionX += 5.0f * cos(4.5f);
|
||||
spawnPos.m_positionY += 5.0f * sin(4.5f);
|
||||
|
|
@ -333,8 +332,7 @@ public:
|
|||
break;
|
||||
case EVENT_SPAWN_WAVE_2:
|
||||
{
|
||||
Position spawnPos;
|
||||
c->GetPosition(&spawnPos);
|
||||
Position spawnPos = c->GetPosition();
|
||||
spawnPos.m_orientation = 5.80f;
|
||||
spawnPos.m_positionX += 7.0f * cos(4.0f);
|
||||
spawnPos.m_positionY += 7.0f * sin(4.0f);
|
||||
|
|
@ -349,8 +347,7 @@ public:
|
|||
break;
|
||||
case EVENT_SPAWN_WAVE_3:
|
||||
{
|
||||
Position spawnPos;
|
||||
c->GetPosition(&spawnPos);
|
||||
Position spawnPos = c->GetPosition();
|
||||
spawnPos.m_orientation = 5.80f;
|
||||
spawnPos.m_positionX += 8.0f * cos(4.0f);
|
||||
spawnPos.m_positionY += 8.0f * sin(4.0f);
|
||||
|
|
|
|||
|
|
@ -1199,8 +1199,7 @@ public:
|
|||
events.CancelEvent(EVENT_HORSEMAN_CLEAVE);
|
||||
|
||||
// Summon Head
|
||||
Position pos;
|
||||
me->GetNearPosition(pos, 15.0f, rand_norm() * 2 * M_PI);
|
||||
Position pos = me->GetNearPosition(15.0f, rand_norm() * 2 * M_PI);
|
||||
if (Creature* cr = me->SummonCreature(NPC_HORSEMAN_HEAD, pos))
|
||||
{
|
||||
if (health)
|
||||
|
|
|
|||
|
|
@ -233,8 +233,7 @@ public:
|
|||
}
|
||||
else
|
||||
{
|
||||
Position pos;
|
||||
me->GetRandomNearPosition(pos, 40);
|
||||
Position pos = me->GetRandomNearPosition(40);
|
||||
me->GetMotionMaster()->MovePoint(0, pos.m_positionX, pos.m_positionY, pos.m_positionZ);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -301,8 +301,7 @@ public:
|
|||
if (!instance->GetPlayers().isEmpty())
|
||||
if (Player* player = instance->GetPlayers().getFirst()->GetSource())
|
||||
{
|
||||
Position pos;
|
||||
player->GetPosition(&pos);
|
||||
Position pos = player->GetPosition();
|
||||
if (Creature* cr = instance->SummonCreature(NPC_CHROMIE_MIDDLE, pos))
|
||||
{
|
||||
cr->SetVisible(false);
|
||||
|
|
|
|||
|
|
@ -268,8 +268,7 @@ public:
|
|||
break;
|
||||
}
|
||||
|
||||
Position pos;
|
||||
rift->GetNearPosition(pos, 10.0f, 2 * M_PI * rand_norm());
|
||||
Position pos = rift->GetNearPosition(10.0f, 2 * M_PI * rand_norm());
|
||||
|
||||
if (TempSummon* summon = instance->SummonCreature(abs(entry), pos))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -323,8 +323,7 @@ public:
|
|||
|
||||
void DoSummonAtRift(uint32 entry)
|
||||
{
|
||||
Position pos;
|
||||
me->GetNearPosition(pos, 10.0f, 2 * M_PI * rand_norm());
|
||||
Position pos = me->GetNearPosition(10.0f, 2 * M_PI * rand_norm());
|
||||
|
||||
if (Creature* summon = me->SummonCreature(entry, pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 150000))
|
||||
if (instance)
|
||||
|
|
|
|||
|
|
@ -155,8 +155,7 @@ public:
|
|||
_phase = PHASE_GROUND;
|
||||
SetCombatMovement(true);
|
||||
me->SetCanFly(false);
|
||||
Position VictimPos;
|
||||
me->GetVictim()->GetPosition(&VictimPos);
|
||||
Position VictimPos = me->GetVictim()->GetPosition();
|
||||
me->GetMotionMaster()->MovePoint(POINT_GROUND, VictimPos);
|
||||
DoResetThreat();
|
||||
events.ScheduleEvent(EVENT_LASH, urand(5000, 8000));
|
||||
|
|
@ -208,8 +207,7 @@ public:
|
|||
break;
|
||||
case EVENT_SUMMON_SWARMER:
|
||||
{
|
||||
Position Pos;
|
||||
me->GetRandomPoint(SwarmerPos, 80.0f, Pos);
|
||||
Position Pos = me->GetRandomPoint(SwarmerPos, 80.0f);
|
||||
me->SummonCreature(NPC_SWARMER, Pos);
|
||||
events.ScheduleEvent(EVENT_SUMMON_SWARMER, 5000);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -146,8 +146,7 @@ public:
|
|||
|
||||
for (uint8 i = 0; i < NUM_TORNADOS; ++i)
|
||||
{
|
||||
Position Point;
|
||||
me->GetRandomPoint(RoomCenter, RoomRadius, Point);
|
||||
Position Point = me->GetRandomPoint(RoomCenter, RoomRadius);
|
||||
if (Creature* Tornado = me->GetMap()->SummonCreature(NPC_SAND_VORTEX, Point))
|
||||
Tornado->CastSpell(Tornado, SPELL_SAND_STORM, true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -462,8 +462,7 @@ public:
|
|||
Talk(CAPITIVE_SAY, owner);
|
||||
_playerGUID = owner->GetGUID();
|
||||
}
|
||||
Position pos;
|
||||
me->GetNearPosition(pos, 3.0f, 0.0f);
|
||||
Position pos = me->GetNearPosition(3.0f, 0.0f);
|
||||
me->GetMotionMaster()->MovePoint(POINT_INIT, pos);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1045,8 +1045,7 @@ public:
|
|||
SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(uint32(GetSpellInfo()->Effects[effIndex].MiscValueB));
|
||||
uint32 duration = uint32(GetSpellInfo()->GetDuration());
|
||||
|
||||
Position pos;
|
||||
caster->GetPosition(&pos);
|
||||
Position pos = caster->GetPosition();
|
||||
if (Creature* summon = caster->GetMap()->SummonCreature(entry, pos, properties, duration, caster, GetSpellInfo()->Id))
|
||||
{
|
||||
bool heroic = summon->GetMap()->IsHeroic();
|
||||
|
|
|
|||
|
|
@ -2428,8 +2428,7 @@ public:
|
|||
if (!si)
|
||||
return;
|
||||
SpellCastTargets targets;
|
||||
Position dest;
|
||||
GetExplTargetDest()->GetPosition(&dest);
|
||||
Position dest = GetExplTargetDest()->GetPosition();
|
||||
targets.SetDst(dest);
|
||||
CustomSpellValues values;
|
||||
int32 damage = si->Effects[0].CalcValue() + _energyLeft * _energyLeft * 8;
|
||||
|
|
|
|||
|
|
@ -1538,8 +1538,7 @@ public:
|
|||
SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(uint32(GetSpellInfo()->Effects[effIndex].MiscValueB));
|
||||
uint32 duration = uint32(GetSpellInfo()->GetDuration());
|
||||
|
||||
Position pos;
|
||||
caster->GetPosition(&pos);
|
||||
Position pos = caster->GetPosition();
|
||||
TempSummon* summon = caster->GetMap()->SummonCreature(entry, pos, properties, duration, caster, GetSpellInfo()->Id);
|
||||
if (!summon || !summon->IsVehicle())
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -215,8 +215,7 @@ public:
|
|||
if (!sindragosa->IsAlive())
|
||||
return true;
|
||||
|
||||
Position pos;
|
||||
_owner->GetPosition(&pos);
|
||||
Position pos = _owner->GetPosition();
|
||||
_owner->UpdateGroundPositionZ(pos.m_positionX, pos.m_positionY, pos.m_positionZ);
|
||||
|
||||
if (TempSummon* summon = sindragosa->SummonCreature(NPC_ICE_TOMB, pos))
|
||||
|
|
|
|||
|
|
@ -1770,8 +1770,7 @@ public:
|
|||
{
|
||||
if (spell->Id == 71306 && c->GetTypeId() == TYPEID_UNIT) // Twisted Winds
|
||||
{
|
||||
Position myPos;
|
||||
me->GetPosition(&myPos);
|
||||
Position myPos = me->GetPosition();
|
||||
me->NearTeleportTo(c->GetPositionX(), c->GetPositionY(), c->GetPositionZ(), c->GetOrientation());
|
||||
c->NearTeleportTo(myPos.GetPositionX(), myPos.GetPositionY(), myPos.GetPositionZ(), myPos.GetOrientation());
|
||||
const ThreatContainer::StorageType me_tl = me->getThreatMgr().getThreatList();
|
||||
|
|
@ -2181,9 +2180,7 @@ public:
|
|||
if (!caster)
|
||||
return;
|
||||
|
||||
Position pos;
|
||||
caster->GetPosition(&pos);
|
||||
caster->GetNearPosition(pos, 5.0f, 0.0f);
|
||||
Position pos = caster->GetNearPosition(5.0f, 0.0f);
|
||||
pos.m_positionZ = caster->GetMap()->GetHeight(caster->GetPhaseMask(), pos.GetPositionX(), pos.GetPositionY(), caster->GetPositionZ(), true, 50.0f);
|
||||
pos.m_positionZ += 0.1f;
|
||||
caster->SendMeleeAttackStop(caster->GetVictim());
|
||||
|
|
@ -3214,8 +3211,7 @@ public:
|
|||
|
||||
if (currPipeWP != VENGEFUL_WP_COUNT)
|
||||
{
|
||||
Position pos;
|
||||
who->GetPosition(&pos);
|
||||
Position pos = who->GetPosition();
|
||||
float angle = who->GetAngle(me);
|
||||
float dist = 3.0f;
|
||||
pos.m_positionX += cos(angle) * dist;
|
||||
|
|
|
|||
|
|
@ -778,8 +778,7 @@ public:
|
|||
ACU->DespawnOrUnsummon(7000);
|
||||
ACU->SetReactState(REACT_PASSIVE);
|
||||
|
||||
Position exitPos;
|
||||
me->GetPosition(&exitPos);
|
||||
Position exitPos = me->GetPosition();
|
||||
me->_ExitVehicle(&exitPos);
|
||||
me->AttackStop();
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK);
|
||||
|
|
@ -1453,8 +1452,7 @@ public:
|
|||
{
|
||||
if( Creature* trigger = me->SummonCreature(NPC_ROCKET_STRIKE_N, temp->GetPositionX(), temp->GetPositionY(), temp->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 6000) )
|
||||
trigger->CastSpell(trigger, SPELL_ROCKET_STRIKE_AURA, true);
|
||||
Position exitPos;
|
||||
r->GetPosition(&exitPos);
|
||||
Position exitPos = r->GetPosition();
|
||||
exitPos.m_positionX += cos(me->GetOrientation()) * 2.35f;
|
||||
exitPos.m_positionY += sin(me->GetOrientation()) * 2.35f;
|
||||
exitPos.m_positionZ += 2.0f * Phase;
|
||||
|
|
|
|||
|
|
@ -585,8 +585,7 @@ public:
|
|||
case EVENT_BLINK:
|
||||
{
|
||||
DoCast(me, SPELL_IMPROVED_BLINK);
|
||||
Position pos;
|
||||
me->GetRandomNearPosition(pos, (urand(15, 40)));
|
||||
Position pos = me->GetRandomNearPosition((urand(15, 40)));
|
||||
me->GetMotionMaster()->MovePoint(0, pos.m_positionX, pos.m_positionY, pos.m_positionZ);
|
||||
events.ScheduleEvent(EVENT_DESPAWN, 3 * IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_DESPAWN_VISUAL, 2.5 * IN_MILLISECONDS);
|
||||
|
|
|
|||
|
|
@ -118,8 +118,7 @@ public:
|
|||
break;
|
||||
case EVENT_SUMMON_NETHER_CHARGE:
|
||||
{
|
||||
Position pos;
|
||||
me->GetRandomNearPosition(pos, 8.0f);
|
||||
Position pos = me->GetRandomNearPosition(8.0f);
|
||||
me->SummonCreature(NPC_NETHER_CHARGE, pos, TEMPSUMMON_TIMED_DESPAWN, 18000);
|
||||
events.ScheduleEvent(EVENT_SUMMON_NETHER_CHARGE, 5000);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -535,10 +535,10 @@ public:
|
|||
|
||||
Position pos;
|
||||
if (Unit* EscapeDummy = me->FindNearestCreature(NPC_ESCAPE_DUMMY, 30))
|
||||
EscapeDummy->GetPosition(&pos);
|
||||
pos = EscapeDummy->GetPosition();
|
||||
else
|
||||
{
|
||||
me->GetRandomNearPosition(pos, 20);
|
||||
pos = me->GetRandomNearPosition(20);
|
||||
pos.m_positionZ += 25;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1389,8 +1389,7 @@ public:
|
|||
float dist = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster());
|
||||
float angle = frand(0.0f, 2 * M_PI);
|
||||
|
||||
Position pos;
|
||||
GetCaster()->GetNearPosition(pos, dist, angle);
|
||||
Position pos = GetCaster()->GetNearPosition(dist, angle);
|
||||
dest.Relocate(pos);
|
||||
}
|
||||
|
||||
|
|
@ -1562,8 +1561,7 @@ public:
|
|||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
Position pos;
|
||||
caster->GetRandomNearPosition(pos, 5.0f);
|
||||
Position pos = caster->GetRandomNearPosition(5.0f);
|
||||
if (Creature* haunt = caster->SummonCreature(NPC_SCOURGE_HAUNT, pos, TEMPSUMMON_TIMED_DESPAWN, urand(10, 20) * IN_MILLISECONDS))
|
||||
{
|
||||
haunt->SetSpeed(MOVE_RUN, 0.5, true);
|
||||
|
|
@ -1602,8 +1600,7 @@ public:
|
|||
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
Position pos;
|
||||
caster->GetRandomNearPosition(pos, 5.0f);
|
||||
Position pos = caster->GetRandomNearPosition(5.0f);
|
||||
if (Creature* haunt = caster->SummonCreature(NPC_SCOURGE_HAUNT, pos, TEMPSUMMON_TIMED_DESPAWN, urand(10, 20) * IN_MILLISECONDS))
|
||||
{
|
||||
haunt->SetSpeed(MOVE_RUN, 0.5, true);
|
||||
|
|
|
|||
|
|
@ -2171,8 +2171,7 @@ class spell_q12308_escape_from_silverbrook_summon_worgen : public SpellScript
|
|||
float dist = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster());
|
||||
float angle = frand(0.75f, 1.25f) * M_PI;
|
||||
|
||||
Position pos;
|
||||
GetCaster()->GetNearPosition(pos, dist, angle);
|
||||
Position pos = GetCaster()->GetNearPosition(dist, angle);
|
||||
dest.Relocate(pos);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -364,8 +364,7 @@ public:
|
|||
{
|
||||
if (spell->Id == SPELL_DRAW_SPIRIT && target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Position targetPos;
|
||||
target->GetPosition(&targetPos);
|
||||
Position targetPos = target->GetPosition();
|
||||
me->SummonCreature(NPC_SPIRIT_SHADE, targetPos, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 50000);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -140,8 +140,7 @@ bool NPCStaveQuestAI::ValidThreatlist()
|
|||
|
||||
void NPCStaveQuestAI::SetHomePosition()
|
||||
{
|
||||
Position homePosition;
|
||||
me->GetPosition(&homePosition);
|
||||
Position homePosition = me->GetPosition();
|
||||
|
||||
if (homePosition.IsPositionValid())
|
||||
{
|
||||
|
|
@ -564,8 +563,7 @@ public:
|
|||
|
||||
void RespawnPet()
|
||||
{
|
||||
Position current;
|
||||
me->GetNearPosition(current, -5.0f, 0.0f);
|
||||
Position current = me->GetNearPosition(-5.0f, 0.0f);
|
||||
Precious()->RemoveCorpse(false, false);
|
||||
Precious()->SetPosition(current);
|
||||
Precious()->SetHomePosition(current);
|
||||
|
|
@ -609,8 +607,7 @@ public:
|
|||
return;
|
||||
}
|
||||
|
||||
Position petResetPos;
|
||||
me->GetNearPosition(petResetPos, -5.0f, 0.0f);
|
||||
Position petResetPos = me->GetNearPosition(-5.0f, 0.0f);
|
||||
|
||||
if (petResetPos.IsPositionValid())
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue