mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 18:40:28 +00:00
feat(Core/Position): own file (#10505)
This commit is contained in:
committed by
GitHub
parent
b0b9fece99
commit
93520f6466
@@ -133,7 +133,7 @@ public:
|
||||
// Teleports a random player and spawns 9 Sacrificed Trolls to attack player
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
|
||||
{
|
||||
DoTeleportPlayer(target, TeleportLoc.m_positionX, TeleportLoc.m_positionY, TeleportLoc.m_positionZ, TeleportLoc.m_orientation);
|
||||
DoTeleportPlayer(target, TeleportLoc.m_positionX, TeleportLoc.m_positionY, TeleportLoc.m_positionZ, TeleportLoc.GetOrientation());
|
||||
if (DoGetThreat(me->GetVictim()))
|
||||
DoModifyThreatPercent(target, -100);
|
||||
Creature* SacrificedTroll;
|
||||
|
||||
@@ -319,7 +319,7 @@ public:
|
||||
case EVENT_SPAWN_WAVE_1:
|
||||
{
|
||||
Position spawnPos = c->GetPosition();
|
||||
spawnPos.m_orientation = 5.80f;
|
||||
spawnPos.SetOrientation(5.80f);
|
||||
spawnPos.m_positionX += 5.0f * cos(4.5f);
|
||||
spawnPos.m_positionY += 5.0f * std::sin(4.5f);
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
@@ -333,7 +333,7 @@ public:
|
||||
case EVENT_SPAWN_WAVE_2:
|
||||
{
|
||||
Position spawnPos = c->GetPosition();
|
||||
spawnPos.m_orientation = 5.80f;
|
||||
spawnPos.SetOrientation(5.80f);
|
||||
spawnPos.m_positionX += 7.0f * cos(4.0f);
|
||||
spawnPos.m_positionY += 7.0f * std::sin(4.0f);
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
@@ -348,7 +348,7 @@ public:
|
||||
case EVENT_SPAWN_WAVE_3:
|
||||
{
|
||||
Position spawnPos = c->GetPosition();
|
||||
spawnPos.m_orientation = 5.80f;
|
||||
spawnPos.SetOrientation(5.80f);
|
||||
spawnPos.m_positionX += 8.0f * cos(4.0f);
|
||||
spawnPos.m_positionY += 8.0f * std::sin(4.0f);
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
|
||||
@@ -372,12 +372,12 @@ public:
|
||||
void DoSummonPriestess()
|
||||
{
|
||||
// Summon 2 Elune priestess and make each of them move to a different spot
|
||||
if (Creature* priestess = me->SummonCreature(NPC_PRIESTESS_ELUNE, wingThicketLocations[0].m_positionX, wingThicketLocations[0].m_positionY, wingThicketLocations[0].m_positionZ, wingThicketLocations[0].m_orientation, TEMPSUMMON_CORPSE_DESPAWN, 0))
|
||||
if (Creature* priestess = me->SummonCreature(NPC_PRIESTESS_ELUNE, wingThicketLocations[0].m_positionX, wingThicketLocations[0].m_positionY, wingThicketLocations[0].m_positionZ, wingThicketLocations[0].GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0))
|
||||
{
|
||||
priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[3].m_positionX, wingThicketLocations[3].m_positionY, wingThicketLocations[3].m_positionZ);
|
||||
_firstPriestessGUID = priestess->GetGUID();
|
||||
}
|
||||
if (Creature* priestess = me->SummonCreature(NPC_PRIESTESS_ELUNE, wingThicketLocations[1].m_positionX, wingThicketLocations[1].m_positionY, wingThicketLocations[1].m_positionZ, wingThicketLocations[1].m_orientation, TEMPSUMMON_CORPSE_DESPAWN, 0))
|
||||
if (Creature* priestess = me->SummonCreature(NPC_PRIESTESS_ELUNE, wingThicketLocations[1].m_positionX, wingThicketLocations[1].m_positionY, wingThicketLocations[1].m_positionZ, wingThicketLocations[1].GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0))
|
||||
{
|
||||
// Left priestess should have a distinct move point because she is the one who starts the dialogue at point reach
|
||||
priestess->GetMotionMaster()->MovePoint(1, wingThicketLocations[4].m_positionX, wingThicketLocations[4].m_positionY, wingThicketLocations[4].m_positionZ);
|
||||
@@ -475,7 +475,7 @@ public:
|
||||
break;
|
||||
case SAY_PRIESTESS_ALTAR_13:
|
||||
// summon the Guardian of Elune
|
||||
if (Creature* guard = me->SummonCreature(NPC_GUARDIAN_ELUNE, wingThicketLocations[2].m_positionX, wingThicketLocations[2].m_positionY, wingThicketLocations[2].m_positionZ, wingThicketLocations[2].m_orientation, TEMPSUMMON_CORPSE_DESPAWN, 0))
|
||||
if (Creature* guard = me->SummonCreature(NPC_GUARDIAN_ELUNE, wingThicketLocations[2].m_positionX, wingThicketLocations[2].m_positionY, wingThicketLocations[2].m_positionZ, wingThicketLocations[2].GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0))
|
||||
{
|
||||
guard->GetMotionMaster()->MovePoint(0, wingThicketLocations[5].m_positionX, wingThicketLocations[5].m_positionY, wingThicketLocations[5].m_positionZ);
|
||||
_guardEluneGUID = guard->GetGUID();
|
||||
|
||||
@@ -505,7 +505,7 @@ public:
|
||||
|
||||
if (caster->IsWithinLOS(nx, ny, z))
|
||||
{
|
||||
caster->m_orientation = angle;
|
||||
caster->SetOrientation(angle);
|
||||
caster->CastSpell(nx, ny, z, uint32(GetEffectValue()), true);
|
||||
}
|
||||
}
|
||||
@@ -602,7 +602,7 @@ public:
|
||||
float ny = y + 2.5f * std::sin((M_PI / 4) + (i * (M_PI / 2)));
|
||||
if (caster->IsWithinLOS(nx, ny, z))
|
||||
{
|
||||
caster->m_orientation = (M_PI / 4) + (i * (M_PI / 2));
|
||||
caster->SetOrientation((M_PI / 4) + (i * (M_PI / 2)));
|
||||
caster->CastSpell(nx, ny, z, uint32(GetEffectValue() + i), true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -487,7 +487,7 @@ public:
|
||||
pos.m_positionX = CenterPos.GetPositionX() + cos(angle) * 40.0f;
|
||||
pos.m_positionY = CenterPos.GetPositionY() + std::sin(angle) * 40.0f;
|
||||
pos.m_positionZ = CenterPos.GetPositionZ() + 20.0f;
|
||||
pos.m_orientation = pos.GetAngle(&CenterPos);
|
||||
pos.SetOrientation(pos.GetAngle(&CenterPos));
|
||||
|
||||
if (Creature* vp = me->SummonCreature(NPC_WORLD_TRIGGER_LAOI, pos, TEMPSUMMON_TIMED_DESPAWN, 14000))
|
||||
{
|
||||
@@ -506,7 +506,7 @@ public:
|
||||
plrpos.m_positionX = CenterPos.GetPositionX() + cos(playerAngle) * 5.0f;
|
||||
plrpos.m_positionY = CenterPos.GetPositionY() + std::sin(playerAngle) * 5.0f;
|
||||
plrpos.m_positionZ = CenterPos.GetPositionZ() + 18.0f;
|
||||
plrpos.m_orientation = plrpos.GetAngle(&CenterPos);
|
||||
plrpos.SetOrientation(plrpos.GetAngle(&CenterPos));
|
||||
|
||||
if (Creature* c = me->SummonCreature(NPC_VORTEX, plrpos, TEMPSUMMON_TIMED_DESPAWN, 15000))
|
||||
{
|
||||
@@ -880,7 +880,7 @@ public:
|
||||
pos.m_positionX = CenterPos.GetPositionX() + VORTEX_RADIUS * cos(angle);
|
||||
pos.m_positionY = CenterPos.GetPositionY() + VORTEX_RADIUS * std::sin(angle);
|
||||
pos.m_positionZ = CenterPos.GetPositionZ() + h;
|
||||
pos.m_orientation = pos.GetAngle(&CenterPos);
|
||||
pos.SetOrientation(pos.GetAngle(&CenterPos));
|
||||
me->SetPosition(pos);
|
||||
timer = 0;
|
||||
despawnTimer = 9500;
|
||||
|
||||
@@ -2470,9 +2470,9 @@ public:
|
||||
break;
|
||||
case EVENT_EMERGENCY_BOT_CHECK:
|
||||
events.RepeatEvent(15000); // just in case, will be rescheduled
|
||||
if( Creature* flame = me->FindNearestCreature(NPC_FLAMES_SPREAD, 150.0f, true) )
|
||||
if (Creature* flame = me->FindNearestCreature(NPC_FLAMES_SPREAD, 150.0f, true))
|
||||
{
|
||||
me->m_orientation = me->GetAngle(flame->GetPositionX(), flame->GetPositionY());
|
||||
me->SetOrientation(me->GetAngle(flame->GetPositionX(), flame->GetPositionY()));
|
||||
float dist = me->GetExactDist2d(flame);
|
||||
if (dist <= 5.0f)
|
||||
events.ScheduleEvent(EVENT_EMERGENCY_BOT_ATTACK, 0);
|
||||
|
||||
@@ -1533,7 +1533,7 @@ public:
|
||||
{
|
||||
if (id == 1)
|
||||
{
|
||||
me->SetFacingTo(PosTalkLocations[talkWing].m_orientation);
|
||||
me->SetFacingTo(PosTalkLocations[talkWing].GetOrientation());
|
||||
TurnAudience();
|
||||
|
||||
switch (talkWing)
|
||||
|
||||
@@ -1093,7 +1093,7 @@ class spell_item_draenic_pale_ale : public SpellScript
|
||||
for (uint8 count = 0; count < GetEffectValue(); ++count)
|
||||
{
|
||||
Position pos = *GetCaster();
|
||||
GetCaster()->GetClosePoint(pos.m_positionX, pos.m_positionY, pos.m_positionZ, pos.m_orientation, radius, M_PI - 1.2f + 0.3f * urand(0, 8));
|
||||
GetCaster()->GetClosePoint(pos.m_positionX, pos.m_positionY, pos.m_positionZ, pos.GetOrientation(), radius, M_PI - 1.2f + 0.3f * urand(0, 8));
|
||||
Creature* summon = GetCaster()->SummonCreature(GetSpellInfo()->Effects[effIndex].MiscValue, pos, TEMPSUMMON_TIMED_DESPAWN, GetSpellInfo()->GetDuration());
|
||||
if (!summon)
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user