refactor(Core/Misc): sin() to std::sin() (#9795)

This commit is contained in:
Kitzunu
2022-01-06 19:29:40 +01:00
committed by GitHub
parent 66e6d33116
commit cb7e355291
66 changed files with 212 additions and 211 deletions

View File

@@ -171,7 +171,7 @@ public:
float z = player->GetPositionZ();
float ang = player->GetOrientation();
float rot2 = sin(ang / 2);
float rot2 = std::sin(ang / 2);
float rot3 = cos(ang / 2);
player->SummonGameObject(objectId, x, y, z, ang, 0, 0, rot2, rot3, spawntm);

View File

@@ -256,7 +256,7 @@ public:
{
Talk(SAY_ATTUMEN1_MOUNT);
_events.Reset();
me->GetMotionMaster()->MovePoint(POINT_MOVE_TO_MIDNIGHT, target->GetPositionX() + 2.0f * cos(target->GetAngle(me)), target->GetPositionY() + 2.0f * sin(target->GetAngle(me)), target->GetPositionZ() + 0.2f, true, true, MOTION_SLOT_CONTROLLED);
me->GetMotionMaster()->MovePoint(POINT_MOVE_TO_MIDNIGHT, target->GetPositionX() + 2.0f * cos(target->GetAngle(me)), target->GetPositionY() + 2.0f * std::sin(target->GetAngle(me)), target->GetPositionZ() + 0.2f, true, true, MOTION_SLOT_CONTROLLED);
}
}

View File

@@ -943,7 +943,7 @@ public:
if (summon->GetEntry() <= NPC_RIMBLAT_EARTHSHATTER && summon->GetEntry() != NPC_HIGHLORD_TIRION_FORDRING)
{
float o = lk->GetAngle(summon);
summon->GetMotionMaster()->MovePoint(3, lk->GetPositionX() + 2.0f * cos(o), lk->GetPositionY() + 2.0f * sin(o), lk->GetPositionZ());
summon->GetMotionMaster()->MovePoint(3, lk->GetPositionX() + 2.0f * cos(o), lk->GetPositionY() + 2.0f * std::sin(o), lk->GetPositionZ());
summon->ToTempSummon()->SetTempSummonType(TEMPSUMMON_MANUAL_DESPAWN);
}
}
@@ -1052,7 +1052,7 @@ public:
if (Creature* tirion = GetEntryFromSummons(NPC_HIGHLORD_TIRION_FORDRING))
{
float o = me->GetAngle(tirion);
tirion->GetMotionMaster()->MovePoint(4, me->GetPositionX() + 2.0f * cos(o), me->GetPositionY() + 2.0f * sin(o), me->GetPositionZ(), false);
tirion->GetMotionMaster()->MovePoint(4, me->GetPositionX() + 2.0f * cos(o), me->GetPositionY() + 2.0f * std::sin(o), me->GetPositionZ(), false);
tirion->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
tirion->SetFaction(FACTION_FRIENDLY);
}

View File

@@ -585,7 +585,7 @@ public:
for (uint8 i = 1; i < phase; ++i)
{
float x = me->GetPositionX() + 18.0f * cos((i * 2.0f - 1.0f) * M_PI / 3.0f);
float y = me->GetPositionY() + 18.0f * sin((i * 2.0f - 1.0f) * M_PI / 3.0f);
float y = me->GetPositionY() + 18.0f * std::sin((i * 2.0f - 1.0f) * M_PI / 3.0f);
if (Creature* orb = me->SummonCreature(NPC_SHIELD_ORB, x, y, 40.0f, 0, TEMPSUMMON_CORPSE_DESPAWN))
{
Movement::PointsArray movementArray;
@@ -595,7 +595,7 @@ public:
for (uint8 j = 1; j < 20; ++j)
{
x = me->GetPositionX() + 18.0f * cos(((i * 2.0f - 1.0f) * M_PI / 3.0f) + (j / 20.0f * 2 * M_PI));
y = me->GetPositionY() + 18.0f * sin(((i * 2.0f - 1.0f) * M_PI / 3.0f) + (j / 20.0f * 2 * M_PI));
y = me->GetPositionY() + 18.0f * std::sin(((i * 2.0f - 1.0f) * M_PI / 3.0f) + (j / 20.0f * 2 * M_PI));
movementArray.push_back(G3D::Vector3(x, y, 40.0f));
}
@@ -866,8 +866,8 @@ public:
events.ScheduleEvent(eventId + 1, 6000);
break;
case EVENT_SCENE_03:
me->SummonCreature(NPC_SHATTRATH_PORTAL_DUMMY, 1727.08f + cos(5.14f), 656.82f + sin(5.14f), 28.37f + 2.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 10000);
me->SummonCreature(NPC_SHATTRATH_PORTAL_DUMMY, 1738.84f + cos(2.0f), 627.32f + sin(2.0f), 28.26f + 2.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 10000);
me->SummonCreature(NPC_SHATTRATH_PORTAL_DUMMY, 1727.08f + cos(5.14f), 656.82f + std::sin(5.14f), 28.37f + 2.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 10000);
me->SummonCreature(NPC_SHATTRATH_PORTAL_DUMMY, 1738.84f + cos(2.0f), 627.32f + std::sin(2.0f), 28.26f + 2.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 10000);
events.ScheduleEvent(eventId + 1, 11000);
break;
case EVENT_SCENE_04:
@@ -880,7 +880,7 @@ public:
first->m_Events.AddEvent(new MoveDelayed(first, 1718.70f, 607.78f, 28.06f, 2.323f), first->m_Events.CalculateTime(5000));
first->m_Events.AddEvent(new FixOrientation(first), first->m_Events.CalculateTime(12000));
for (uint8 i = 0; i < 9; ++i)
if (Creature* follower = me->SummonCreature(NPC_SHATTERED_SUN_SOLDIER, 1729.48f + 5 * cos(i * 2.0f * M_PI / 9), 640.49f + 5 * sin(i * 2.0f * M_PI / 9), 28.06f, 3.49f))
if (Creature* follower = me->SummonCreature(NPC_SHATTERED_SUN_SOLDIER, 1729.48f + 5 * cos(i * 2.0f * M_PI / 9), 640.49f + 5 * std::sin(i * 2.0f * M_PI / 9), 28.06f, 3.49f))
follower->GetMotionMaster()->MoveFollow(first, 3.0f, follower->GetAngle(first));
}
events.ScheduleEvent(eventId + 1, 10000);
@@ -891,7 +891,7 @@ public:
first->m_Events.AddEvent(new MoveDelayed(first, 1678.69f, 649.27f, 28.06f, 5.46f), first->m_Events.CalculateTime(5000));
first->m_Events.AddEvent(new FixOrientation(first), first->m_Events.CalculateTime(14500));
for (uint8 i = 0; i < 9; ++i)
if (Creature* follower = me->SummonCreature(NPC_SHATTERED_SUN_SOLDIER, 1729.48f + 5 * cos(i * 2.0f * M_PI / 9), 640.49f + 5 * sin(i * 2.0f * M_PI / 9), 28.06f, 3.49f))
if (Creature* follower = me->SummonCreature(NPC_SHATTERED_SUN_SOLDIER, 1729.48f + 5 * cos(i * 2.0f * M_PI / 9), 640.49f + 5 * std::sin(i * 2.0f * M_PI / 9), 28.06f, 3.49f))
follower->GetMotionMaster()->MoveFollow(first, 3.0f, follower->GetAngle(first));
}
events.ScheduleEvent(eventId + 1, 12000);

View File

@@ -482,7 +482,7 @@ public:
if (target->GetDistance(GetCaster()) < 5.0f)
{
float o = frand(0, 2 * M_PI);
pos.Relocate(GetCaster()->GetPositionX() + 4.0f * cos(o), GetCaster()->GetPositionY() + 4.0f * sin(o), GetCaster()->GetPositionZ() + frand(10.0f, 15.0f));
pos.Relocate(GetCaster()->GetPositionX() + 4.0f * cos(o), GetCaster()->GetPositionY() + 4.0f * std::sin(o), GetCaster()->GetPositionZ() + frand(10.0f, 15.0f));
}
else
pos.Relocate(GetCaster()->GetPositionX(), GetCaster()->GetPositionY(), GetCaster()->GetPositionZ() + 1.0f);

View File

@@ -321,12 +321,12 @@ public:
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);
spawnPos.m_positionY += 5.0f * std::sin(4.5f);
for (uint8 i = 0; i < 5; ++i)
if (me->SummonCreature(NPC_SCOURGE_ZOMBIE, spawnPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000))
{
spawnPos.m_positionX += 2.5f * cos(4.5f);
spawnPos.m_positionY += 2.5f * sin(4.5f);
spawnPos.m_positionY += 2.5f * std::sin(4.5f);
}
}
break;
@@ -335,13 +335,13 @@ public:
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);
spawnPos.m_positionY += 7.0f * std::sin(4.0f);
for (uint8 i = 0; i < 3; ++i)
if (Creature* s = me->SummonCreature(NPC_GHOUL_INVADER, spawnPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000))
{
s->CastSpell(s, 66947, false); // emerge effect
spawnPos.m_positionX += 4.0f * cos(4.5f);
spawnPos.m_positionY += 4.0f * sin(4.5f);
spawnPos.m_positionY += 4.0f * std::sin(4.5f);
}
}
break;
@@ -350,13 +350,13 @@ public:
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);
spawnPos.m_positionY += 8.0f * std::sin(4.0f);
for (uint8 i = 0; i < 3; ++i)
if (Creature* s = me->SummonCreature(NPC_CRYPT_RAIDER, spawnPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000))
{
s->CastSpell(s, 66947, false); // emerge effect
spawnPos.m_positionX += 4.0f * cos(4.5f);
spawnPos.m_positionY += 4.0f * sin(4.5f);
spawnPos.m_positionY += 4.0f * std::sin(4.5f);
}
}
break;

View File

@@ -381,7 +381,7 @@ struct npc_dark_iron_attack_generator : public ScriptedAI
float rand = 8 + rand_norm() * 12;
float angle = rand_norm() * 2 * M_PI;
float x = 1201.8f + rand * cos(angle);
float y = -4299.6f + rand * sin(angle);
float y = -4299.6f + rand * std::sin(angle);
if (Creature* cr = me->SummonCreature(NPC_MOLE_MACHINE_TRIGGER, x, y, 21.3f, 0.0f))
cr->CastSpell(cr, SPELL_SPAWN_MOLE_MACHINE, true);
}
@@ -390,7 +390,7 @@ struct npc_dark_iron_attack_generator : public ScriptedAI
float rand = rand_norm() * 20;
float angle = rand_norm() * 2 * M_PI;
float x = -5157.1f + rand * cos(angle);
float y = -598.98f + rand * sin(angle);
float y = -598.98f + rand * std::sin(angle);
if (Creature* cr = me->SummonCreature(NPC_MOLE_MACHINE_TRIGGER, x, y, 398.11f, 0.0f))
cr->CastSpell(cr, SPELL_SPAWN_MOLE_MACHINE, true);
}
@@ -422,7 +422,7 @@ struct npc_dark_iron_attack_generator : public ScriptedAI
thrown = 0;
sayer->Say("SOMEONE TRY THIS SUPER BREW!", LANG_UNIVERSAL);
//sayer->CastSpell(sayer, SPELL_CREATE_SUPER_BREW, true);
sayer->SummonCreature(NPC_SUPER_BREW_TRIGGER, sayer->GetPositionX() + 15 * cos(sayer->GetOrientation()), sayer->GetPositionY() + 15 * sin(sayer->GetOrientation()), sayer->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
sayer->SummonCreature(NPC_SUPER_BREW_TRIGGER, sayer->GetPositionX() + 15 * cos(sayer->GetOrientation()), sayer->GetPositionY() + 15 * std::sin(sayer->GetOrientation()), sayer->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
}
else
{

View File

@@ -187,7 +187,7 @@ struct npc_winterfin_playmate : public ScriptedAI
switch (phase)
{
case 1:
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->AI()->Talk(TEXT_ORACLE_ORPHAN_1);
timer = 3000;
break;
@@ -273,7 +273,7 @@ struct npc_snowfall_glade_playmate : public ScriptedAI
switch (phase)
{
case 1:
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->AI()->Talk(TEXT_WOLVAR_ORPHAN_1);
timer = 5000;
break;
@@ -362,7 +362,7 @@ struct npc_the_biggest_tree : public ScriptedAI
switch (phase)
{
case 1:
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
timer = 2000;
break;
case 2:
@@ -436,7 +436,7 @@ struct npc_high_oracle_soo_roo : public ScriptedAI
switch (phase)
{
case 1:
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->AI()->Talk(TEXT_ORACLE_ORPHAN_5);
timer = 3000;
break;
@@ -512,7 +512,7 @@ struct npc_elder_kekek : public ScriptedAI
switch (phase)
{
case 1:
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->AI()->Talk(TEXT_WOLVAR_ORPHAN_4);
timer = 3000;
break;
@@ -588,7 +588,7 @@ struct npc_the_etymidian : public ScriptedAI
switch (phase)
{
case 1:
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->AI()->Talk(TEXT_ORACLE_ORPHAN_7);
timer = 5000;
break;
@@ -697,7 +697,7 @@ struct npc_alexstraza_the_lifebinder : public ScriptedAI
switch (phase)
{
case 1:
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->AI()->Talk(TEXT_ORACLE_ORPHAN_11);
timer = 5000;
break;
@@ -728,7 +728,7 @@ struct npc_alexstraza_the_lifebinder : public ScriptedAI
Reset();
return;
case 7:
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->AI()->Talk(TEXT_WOLVAR_ORPHAN_11);
timer = 5000;
break;

View File

@@ -165,7 +165,7 @@ class spell_winter_veil_racer_rocket_slam : public SpellScript
{
Position pos;
float x = caster->GetPositionX() + 30 * cos(caster->GetOrientation());
float y = caster->GetPositionY() + 30 * sin(caster->GetOrientation());
float y = caster->GetPositionY() + 30 * std::sin(caster->GetOrientation());
pos.Relocate(x, y, caster->GetMap()->GetHeight(x, y, MAX_HEIGHT) + 0.5f);
//caster->GetFirstCollisionPosition(pos, 30.0f, caster->GetOrientation());
caster->CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), SPELL_RACER_CHARGE_TO_OBJECT, true);

View File

@@ -78,7 +78,7 @@ public:
if (Unit* medivh = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_MEDIVH)))
{
me->SetHomePosition(medivh->GetPositionX() + 14.0f * cos(medivh->GetAngle(me)), medivh->GetPositionY() + 14.0f * sin(medivh->GetAngle(me)), medivh->GetPositionZ(), me->GetAngle(medivh));
me->SetHomePosition(medivh->GetPositionX() + 14.0f * cos(medivh->GetAngle(me)), medivh->GetPositionY() + 14.0f * std::sin(medivh->GetAngle(me)), medivh->GetPositionZ(), me->GetAngle(medivh));
me->GetMotionMaster()->MoveTargetedHome();
}
}

View File

@@ -108,12 +108,12 @@ public:
groundArray.push_back(G3D::Vector3(creature->GetPositionX() + 8.0f, creature->GetPositionY(), creature->GetPositionZ()));
airArray.push_back(G3D::Vector3(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ()));
for (uint8 i = 0; i < 10; ++i)
groundArray.push_back(G3D::Vector3(creature->GetPositionX() + 8.0f * cos(2.0f * M_PI * i / 10.0f), creature->GetPositionY() + 8.0f * sin(2.0f * M_PI * i / 10.0f), creature->GetPositionZ()));
groundArray.push_back(G3D::Vector3(creature->GetPositionX() + 8.0f * cos(2.0f * M_PI * i / 10.0f), creature->GetPositionY() + 8.0f * std::sin(2.0f * M_PI * i / 10.0f), creature->GetPositionZ()));
for (uint8 i = 0; i < 40; ++i)
airArray.push_back(G3D::Vector3(creature->GetPositionX() + i * 0.25f * cos(2.0f * M_PI * i / 10.0f), creature->GetPositionY() + i * 0.25f * sin(2.0f * M_PI * i / 10.0f), creature->GetPositionZ() + i / 4.0f));
airArray.push_back(G3D::Vector3(creature->GetPositionX() + i * 0.25f * cos(2.0f * M_PI * i / 10.0f), creature->GetPositionY() + i * 0.25f * std::sin(2.0f * M_PI * i / 10.0f), creature->GetPositionZ() + i / 4.0f));
for (uint8 i = 40; i < 80; ++i)
airArray.push_back(G3D::Vector3(creature->GetPositionX() + 10.0f * cos(2.0f * M_PI * i / 10.0f), creature->GetPositionY() + 10.0f * sin(2.0f * M_PI * i / 10.0f), creature->GetPositionZ() + i / 4.0f));
airArray.push_back(G3D::Vector3(creature->GetPositionX() + 10.0f * cos(2.0f * M_PI * i / 10.0f), creature->GetPositionY() + 10.0f * std::sin(2.0f * M_PI * i / 10.0f), creature->GetPositionZ() + i / 4.0f));
}
InstanceScript* instance;
@@ -331,7 +331,7 @@ public:
if (Unit* medivh = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_MEDIVH)))
{
float o = medivh->GetAngle(summon) + frand(-1.0f, 1.0f);
summon->SetHomePosition(medivh->GetPositionX() + 14.0f * cos(o), medivh->GetPositionY() + 14.0f * sin(o), medivh->GetPositionZ(), summon->GetAngle(medivh));
summon->SetHomePosition(medivh->GetPositionX() + 14.0f * cos(o), medivh->GetPositionY() + 14.0f * std::sin(o), medivh->GetPositionZ(), summon->GetAngle(medivh));
summon->GetMotionMaster()->MoveTargetedHome();
summon->SetReactState(REACT_DEFENSIVE);
}

View File

@@ -272,8 +272,8 @@ public:
{
float angle = rand_norm() * 2 * M_PI;
float dist = rand_norm() * 4.0f;
me->CastSpell(-33.18f + cos(angle) * dist, -258.80f + sin(angle) * dist, -89.0f, 17646, true);
me->CastSpell(-32.535f + cos(angle) * dist, -170.190f + sin(angle) * dist, -89.0f, 17646, true);
me->CastSpell(-33.18f + cos(angle) * dist, -258.80f + std::sin(angle) * dist, -89.0f, 17646, true);
me->CastSpell(-32.535f + cos(angle) * dist, -170.190f + std::sin(angle) * dist, -89.0f, 17646, true);
whelpCount += 2;
whelpSpamTimer += 600;
}
@@ -502,8 +502,8 @@ public:
{
float angle = rand_norm() * 2 * M_PI;
float dist = rand_norm() * 4.0f;
me->CastSpell(-33.18f + cos(angle) * dist, -258.80f + sin(angle) * dist, -89.0f, 17646, true);
me->CastSpell(-32.535f + cos(angle) * dist, -170.190f + sin(angle) * dist, -89.0f, 17646, true);
me->CastSpell(-33.18f + cos(angle) * dist, -258.80f + std::sin(angle) * dist, -89.0f, 17646, true);
me->CastSpell(-32.535f + cos(angle) * dist, -170.190f + std::sin(angle) * dist, -89.0f, 17646, true);
events.RepeatEvent(30000);
break;
}

View File

@@ -262,8 +262,8 @@ public:
me->SummonCreature(NPC_WITHERED_BATTLE_BOAR, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
if (data > 0 && me->GetOrientation() < 4.0f)
me->SummonCreature(NPC_WITHERED_BATTLE_BOAR, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
me->SummonCreature(NPC_DEATHS_HEAD_GEOMANCER, me->GetPositionX() + (cos(me->GetOrientation() - (M_PI / 2)) * 2), me->GetPositionY() + (sin(me->GetOrientation() - (M_PI / 2)) * 2), me->GetPositionZ(), me->GetOrientation());
me->SummonCreature(NPC_WITHERED_QUILGUARD, me->GetPositionX() + (cos(me->GetOrientation() + (M_PI / 2)) * 2), me->GetPositionY() + (sin(me->GetOrientation() + (M_PI / 2)) * 2), me->GetPositionZ(), me->GetOrientation());
me->SummonCreature(NPC_DEATHS_HEAD_GEOMANCER, me->GetPositionX() + (cos(me->GetOrientation() - (M_PI / 2)) * 2), me->GetPositionY() + (std::sin(me->GetOrientation() - (M_PI / 2)) * 2), me->GetPositionZ(), me->GetOrientation());
me->SummonCreature(NPC_WITHERED_QUILGUARD, me->GetPositionX() + (cos(me->GetOrientation() + (M_PI / 2)) * 2), me->GetPositionY() + (std::sin(me->GetOrientation() + (M_PI / 2)) * 2), me->GetPositionZ(), me->GetOrientation());
}
else if (data == 7)
me->SummonCreature(NPC_PLAGUEMAW_THE_ROTTING, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());

View File

@@ -342,7 +342,7 @@ public:
{
float o = (i * M_PI / 2) + (M_PI / 4);
float x = me->GetPositionX() + cos(o) * 15.0f;
float y = me->GetPositionY() + sin(o) * 15.0f;
float y = me->GetPositionY() + std::sin(o) * 15.0f;
if ((cr = me->SummonCreature((i % 2 == 0 ? NPC_KOLKAR_WAYLAYER : NPC_KOLKAR_AMBUSHER),
x, y, me->GetMap()->GetHeight(x, y, MAX_HEIGHT), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)))
cr->AI()->AttackStart(me);
@@ -367,7 +367,7 @@ public:
{
float o = i * 2 * M_PI / 3;
float x = me->GetPositionX() + cos(o) * 10.0f;
float y = me->GetPositionY() + sin(o) * 10.0f;
float y = me->GetPositionY() + std::sin(o) * 10.0f;
uint32 entry = NPC_LESSER_INFERNAL;
if (i)
entry = i == 1 ? NPC_DOOMWARDER : NPC_NETHER;

View File

@@ -165,7 +165,7 @@ struct npc_taldaram_flamesphere : public NullCreatureAI
float angle = me->GetAngle(&victimPos) + angleOffset;
float x = me->GetPositionX() + DATA_SPHERE_DISTANCE * cos(angle);
float y = me->GetPositionY() + DATA_SPHERE_DISTANCE * sin(angle);
float y = me->GetPositionY() + DATA_SPHERE_DISTANCE * std::sin(angle);
me->GetMotionMaster()->MovePoint(POINT_ORB, x, y, me->GetPositionZ());
moveTimer = 0;

View File

@@ -824,7 +824,7 @@ public:
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[1][i]) )
{
float angle = rand_norm() * 2 * M_PI;
c->GetMotionMaster()->MovePoint(0, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * sin(angle), 411.3f);
c->GetMotionMaster()->MovePoint(0, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * std::sin(angle), 411.3f);
}
events.ScheduleEvent(EVENT_GRAND_GROUP_1_ATTACK, 3000);
@@ -850,7 +850,7 @@ public:
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[0][i]) )
{
float angle = rand_norm() * 2 * M_PI;
c->GetMotionMaster()->MovePoint(0, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * sin(angle), 411.3f);
c->GetMotionMaster()->MovePoint(0, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * std::sin(angle), 411.3f);
}
events.ScheduleEvent(EVENT_GRAND_GROUP_2_ATTACK, 3000);
@@ -875,7 +875,7 @@ public:
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[2][i]) )
{
float angle = rand_norm() * 2 * M_PI;
c->GetMotionMaster()->MovePoint(0, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * sin(angle), 411.3f);
c->GetMotionMaster()->MovePoint(0, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * std::sin(angle), 411.3f);
}
events.ScheduleEvent(EVENT_GRAND_GROUP_3_ATTACK, 3000);
@@ -900,7 +900,7 @@ public:
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
{
float angle = rand_norm() * 2 * M_PI;
c->GetMotionMaster()->MovePoint(4, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * sin(angle), 411.3f);
c->GetMotionMaster()->MovePoint(4, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * std::sin(angle), 411.3f);
}
events.ScheduleEvent(EVENT_GRAND_CHAMPIONS_MOUNTS_ATTACK, 3000);

View File

@@ -182,7 +182,7 @@ public:
{
float angle = rand_norm() * 2 * M_PI;
float dist = rand_norm() * 40.0f;
if( Creature* c = me->SummonCreature(NPC_SCARAB, AnubLocs[0].GetPositionX() + cos(angle) * dist, AnubLocs[0].GetPositionY() + sin(angle) * dist, AnubLocs[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000) )
if( Creature* c = me->SummonCreature(NPC_SCARAB, AnubLocs[0].GetPositionX() + cos(angle) * dist, AnubLocs[0].GetPositionY() + std::sin(angle) * dist, AnubLocs[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000) )
{
c->SetFaction(FACTION_PREY);
c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
@@ -652,7 +652,7 @@ public:
o -= M_PI;
else
o += M_PI;
me->NearTeleportTo(target->GetPositionX() + cos(o) * 5.0f, target->GetPositionY() + sin(o) * 5.0f, target->GetPositionZ() + 0.6f, target->GetOrientation());
me->NearTeleportTo(target->GetPositionX() + cos(o) * 5.0f, target->GetPositionY() + std::sin(o) * 5.0f, target->GetPositionZ() + 0.6f, target->GetOrientation());
AttackStart(target);
me->GetMotionMaster()->MoveChase(target);
events.DelayEvents(3000);

View File

@@ -589,9 +589,9 @@ struct boss_jormungarAI : public ScriptedAI
c->SetSpeed(MOVE_RUN, 2.5f);
c->CastSpell(c, SPELL_CHURNING_GROUND, true);
c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED);
c->GetMotionMaster()->MovePoint(0, Locs[LOC_CENTER].GetPositionX() + cos(angle)*dist, Locs[LOC_CENTER].GetPositionY() + sin(angle)*dist, me->GetPositionZ());
c->GetMotionMaster()->MovePoint(0, Locs[LOC_CENTER].GetPositionX() + cos(angle)*dist, Locs[LOC_CENTER].GetPositionY() + std::sin(angle)*dist, me->GetPositionZ());
}
me->UpdatePosition(Locs[LOC_CENTER].GetPositionX() + cos(angle)*dist, Locs[LOC_CENTER].GetPositionY() + sin(angle)*dist, me->GetPositionZ(), me->GetOrientation(), true);
me->UpdatePosition(Locs[LOC_CENTER].GetPositionX() + cos(angle)*dist, Locs[LOC_CENTER].GetPositionY() + std::sin(angle)*dist, me->GetPositionZ(), me->GetOrientation(), true);
me->StopMovingOnCurrentPos();
DoResetThreat();
@@ -939,10 +939,10 @@ public:
if( angle > 1.0f && angle < 2.0f ) // near main gate
dist = 46.0f;
destX = Locs[LOC_CENTER].GetPositionX() + cos(angle) * dist;
destY = Locs[LOC_CENTER].GetPositionY() + sin(angle) * dist;
destY = Locs[LOC_CENTER].GetPositionY() + std::sin(angle) * dist;
destZ = Locs[LOC_CENTER].GetPositionZ() + 1.0f;
me->StopMoving();
me->GetMotionMaster()->MoveJump(Locs[LOC_CENTER].GetPositionX() + cos(jumpangle) * 35.0f, Locs[LOC_CENTER].GetPositionY() + sin(jumpangle) * 35.0f, Locs[LOC_CENTER].GetPositionZ() + 1.0f, 40.0f, 12.0f);
me->GetMotionMaster()->MoveJump(Locs[LOC_CENTER].GetPositionX() + cos(jumpangle) * 35.0f, Locs[LOC_CENTER].GetPositionY() + std::sin(jumpangle) * 35.0f, Locs[LOC_CENTER].GetPositionZ() + 1.0f, 40.0f, 12.0f);
events.RescheduleEvent(EVENT_TRAMPLE, 1500);

View File

@@ -319,7 +319,7 @@ struct boss_twin_valkyrAI : public ScriptedAI
for( uint8 i = 0; i < count; ++i )
{
float angle = rand_norm() * 2 * M_PI;
if( Creature* ball = me->SummonCreature((i % 2) ? NPC_CONCENTRATED_DARK : NPC_CONCENTRATED_LIGHT, Locs[LOC_CENTER].GetPositionX() + cos(angle) * 47.0f, Locs[LOC_CENTER].GetPositionY() + sin(angle) * 47.0f, Locs[LOC_CENTER].GetPositionZ() + 1.5f, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1500) )
if( Creature* ball = me->SummonCreature((i % 2) ? NPC_CONCENTRATED_DARK : NPC_CONCENTRATED_LIGHT, Locs[LOC_CENTER].GetPositionX() + cos(angle) * 47.0f, Locs[LOC_CENTER].GetPositionY() + std::sin(angle) * 47.0f, Locs[LOC_CENTER].GetPositionZ() + 1.5f, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1500) )
boss_twin_valkyrAI::JustSummoned(ball);
}
@@ -718,7 +718,7 @@ public:
void MoveToNextPoint()
{
float angle = rand_norm() * 2 * M_PI;
me->GetMotionMaster()->MovePoint(0, Locs[LOC_CENTER].GetPositionX() + cos(angle) * 47.0f, Locs[LOC_CENTER].GetPositionY() + sin(angle) * 47.0f, me->GetPositionZ());
me->GetMotionMaster()->MovePoint(0, Locs[LOC_CENTER].GetPositionX() + cos(angle) * 47.0f, Locs[LOC_CENTER].GetPositionY() + std::sin(angle) * 47.0f, me->GetPositionZ());
}
void UpdateAI(uint32 /*diff*/) override

View File

@@ -130,7 +130,7 @@ public:
if (Creature* boss = instance->GetCreature(NPC_DevourerGUID))
{
float angle = boss->GetAngle(leader);
leader->GetMotionMaster()->MovePoint(1, boss->GetPositionX() + 10.0f * cos(angle), boss->GetPositionY() + 10.0f * sin(angle), boss->GetPositionZ());
leader->GetMotionMaster()->MovePoint(1, boss->GetPositionX() + 10.0f * cos(angle), boss->GetPositionY() + 10.0f * std::sin(angle), boss->GetPositionZ());
}
for (int8 i = 0; outroPositions[i].entry[teamIdInInstance] != 0; ++i)

View File

@@ -148,7 +148,7 @@ public:
Position myPos(*me), exitPos;
float ang = me->GetOrientation() + 3 * M_PI / 2;
float dist = 3.0f;
exitPos.Relocate(myPos.GetPositionX() + dist * cos(ang), myPos.GetPositionY() + dist * sin(ang), 515.0f, M_PI);
exitPos.Relocate(myPos.GetPositionX() + dist * cos(ang), myPos.GetPositionY() + dist * std::sin(ang), 515.0f, M_PI);
exitPos.m_positionZ = me->GetMap()->GetHeight(exitPos.GetPositionX(), exitPos.GetPositionY(), exitPos.GetPositionZ());
if (exitPos.GetPositionZ() < 505.0f || exitPos.GetPositionZ() > 512.0f || !me->IsWithinLOS(exitPos.GetPositionX(), exitPos.GetPositionY(), exitPos.GetPositionZ()))
@@ -340,7 +340,7 @@ public:
float angle = me->GetAngle(c);
me->SetFacingTo(angle);
float x = me->GetPositionX() + cos(angle) * 7.0f;
float y = me->GetPositionY() + sin(angle) * 7.0f;
float y = me->GetPositionY() + std::sin(angle) * 7.0f;
c->GetMotionMaster()->MovePoint(0, x, y, me->GetPositionZ());
}

View File

@@ -198,7 +198,7 @@ public:
c->SendMovementFlagUpdate();
float dist = rand_norm() * 2.0f;
float angle = rand_norm() * 2 * M_PI;
c->GetMotionMaster()->MoveTakeoff(0, c->GetPositionX() + dist * cos(angle), c->GetPositionY() + dist * sin(angle), c->GetPositionZ() + 6.0f + (float)urand(0, 4), 1.5f + frand(0.0f, 1.5f));
c->GetMotionMaster()->MoveTakeoff(0, c->GetPositionX() + dist * cos(angle), c->GetPositionY() + dist * std::sin(angle), c->GetPositionZ() + 6.0f + (float)urand(0, 4), 1.5f + frand(0.0f, 1.5f));
}
}
@@ -280,7 +280,7 @@ public:
c->SetSpeed(MOVE_RUN, 0.8f);
c->SetInCombatWithZone();
c->GetMotionMaster()->MoveChase(me, dist, angle);
c->SetHomePosition(me->GetPositionX() + dist * cos(angle), me->GetPositionY() + dist * sin(angle), me->GetPositionZ(), 0.0f);
c->SetHomePosition(me->GetPositionX() + dist * cos(angle), me->GetPositionY() + dist * std::sin(angle), me->GetPositionZ(), 0.0f);
}
}
@@ -541,7 +541,7 @@ public:
{
float angle = c->GetAngle(me);
float x = c->GetPositionX() + cos(angle) * 12.0f;
float y = c->GetPositionY() + sin(angle) * 12.0f;
float y = c->GetPositionY() + std::sin(angle) * 12.0f;
me->GetMotionMaster()->MovePoint(2, x, y, c->GetPositionZ());
}
@@ -685,7 +685,7 @@ public:
me->SetFacingTo(PTSTyrannusWaitPos2.GetOrientation());
break;
case 5:
me->GetMotionMaster()->MoveTakeoff(10, me->GetPositionX() + 2.0f * cos(me->GetOrientation()), me->GetPositionY() + 2.0f * sin(me->GetOrientation()), me->GetPositionZ() + 30.0f, 7.0f);
me->GetMotionMaster()->MoveTakeoff(10, me->GetPositionX() + 2.0f * cos(me->GetOrientation()), me->GetPositionY() + 2.0f * std::sin(me->GetOrientation()), me->GetPositionZ() + 30.0f, 7.0f);
break;
case 6:
me->GetMotionMaster()->MovePoint(4, PTSTyrannusWaitPos3, false);
@@ -979,7 +979,7 @@ public:
c->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_CHEER);
float ang = frand(1.92f, 2.36f);
float dist = urand(50, 85);
c->GetMotionMaster()->MovePoint(0, TSSpawnPos.GetPositionX() + cos(ang)*dist, TSSpawnPos.GetPositionY() + sin(ang)*dist, 628.2f);
c->GetMotionMaster()->MovePoint(0, TSSpawnPos.GetPositionX() + cos(ang)*dist, TSSpawnPos.GetPositionY() + std::sin(ang)*dist, 628.2f);
}
}
else if (p == 3)
@@ -1187,7 +1187,7 @@ public:
{
float angle = rand_norm() * 2 * M_PI;
float dist = urand(1, 4);
target->ToPlayer()->NearTeleportTo(me->GetPositionX() + cos(angle)*dist, me->GetPositionY() + sin(angle)*dist, me->GetPositionZ(), me->GetOrientation());
target->ToPlayer()->NearTeleportTo(me->GetPositionX() + cos(angle)*dist, me->GetPositionY() + std::sin(angle)*dist, me->GetPositionZ(), me->GetOrientation());
}
}

View File

@@ -1722,7 +1722,7 @@ public:
if (Position* dest = const_cast<WorldLocation*>(GetExplTargetDest()))
{
float angle = dest->GetAngle(GetCaster());
Position offset = {6.0f * cos(angle), 6.0f * sin(angle), 10.0f, 0.0f};
Position offset = {6.0f * cos(angle), 6.0f * std::sin(angle), 10.0f, 0.0f};
dest->RelocateOffset(offset);
GetCaster()->UpdateAllowedPositionZ(dest->GetPositionX(), dest->GetPositionY(), dest->m_positionZ);
}
@@ -1762,7 +1762,7 @@ public:
for (uint8 i = 6; i > 0; --i)
{
float destX = summoner->GetPositionX() + cos(angle + a * M_PI) * i * 10.0f;
float destY = summoner->GetPositionY() + sin(angle + a * M_PI) * i * 10.0f;
float destY = summoner->GetPositionY() + std::sin(angle + a * M_PI) * i * 10.0f;
if (summoner->GetMap()->isInLineOfSight(summoner->GetPositionX(), summoner->GetPositionY(), summoner->GetPositionZ() + 10.0f, destX, destY, summoner->GetPositionZ() + 10.0f, summoner->GetPhaseMask(), LINEOFSIGHT_ALL_CHECKS) && destX > 4585.0f && destY > 2716.0f && destY < 2822.0f)
{
float destZ = summoner->GetMapHeight(summoner->GetPhaseMask(), destX, destY, summoner->GetPositionZ());

View File

@@ -339,7 +339,7 @@ public:
me->DisableSpline();
me->CastSpell(me, SPELL_COLDFLAME_SUMMON, true);
float nx = me->GetPositionX() + 5.0f * cos(me->GetOrientation());
float ny = me->GetPositionY() + 5.0f * sin(me->GetOrientation());
float ny = me->GetPositionY() + 5.0f * std::sin(me->GetOrientation());
if (!me->IsWithinLOS(nx, ny, 42.5f))
{
break;
@@ -495,12 +495,12 @@ public:
float dist = caster->GetObjectSize() / 2.0f;
float z = caster->GetPositionZ() + 2.5f;
float nx = caster->GetPositionX() + dist * cos(angle);
float ny = caster->GetPositionY() + dist * sin(angle);
float ny = caster->GetPositionY() + dist * std::sin(angle);
if (!caster->IsWithinLOS(nx, ny, z))
{
nx = caster->GetPositionX() + 0.5f * cos(angle);
ny = caster->GetPositionY() + 0.5f * sin(angle);
ny = caster->GetPositionY() + 0.5f * std::sin(angle);
}
if (caster->IsWithinLOS(nx, ny, z))
@@ -599,7 +599,7 @@ public:
for (uint8 i = 0; i < 4; ++i)
{
float nx = x + 2.5f * cos((M_PI / 4) + (i * (M_PI / 2)));
float ny = y + 2.5f * sin((M_PI / 4) + (i * (M_PI / 2)));
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));

View File

@@ -2541,7 +2541,7 @@ public:
me->CastSpell((Unit*)nullptr, SPELL_EJECT_ALL_PASSENGERS, false);
float dist = rand_norm() * 10.0f + 5.0f;
float angle = CenterPosition.GetAngle(me);
_destPoint.Relocate(CenterPosition.GetPositionX() + dist * cos(angle), CenterPosition.GetPositionY() + dist * sin(angle), 855.0f + frand(0.0f, 4.0f), 0.0f);
_destPoint.Relocate(CenterPosition.GetPositionX() + dist * cos(angle), CenterPosition.GetPositionY() + dist * std::sin(angle), 855.0f + frand(0.0f, 4.0f), 0.0f);
me->SetHomePosition(_destPoint);
_events.Reset();
_events.ScheduleEvent(EVENT_MOVE_TO_SIPHON_POS, 0);
@@ -2773,7 +2773,7 @@ public:
{
float dist = 2.0f + rand_norm() * 18.0f;
float angle = rand_norm() * 2 * M_PI;
Position const offset = {dist * cos(angle), dist * sin(angle), 0.0f, 0.0f};
Position const offset = {dist * cos(angle), dist * std::sin(angle), 0.0f, 0.0f};
WorldLocation* dest = const_cast<WorldLocation*>(GetExplTargetDest());
dest->RelocateOffset(offset);
GetHitDest()->RelocateOffset(offset);
@@ -3232,7 +3232,7 @@ public:
float angle = lichKing->GetAngle(me);
Movement::PointsArray path;
path.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
path.push_back(G3D::Vector3(lichKing->GetPositionX() + dist * cos(angle), lichKing->GetPositionY() + dist * sin(angle), 843.0f));
path.push_back(G3D::Vector3(lichKing->GetPositionX() + dist * cos(angle), lichKing->GetPositionY() + dist * std::sin(angle), 843.0f));
me->GetMotionMaster()->MoveSplinePath(&path);
}
break;

View File

@@ -1158,7 +1158,7 @@ public:
float startAngle = 3 * M_PI / 2;
float maxAddAngle = ((target->GetMap()->GetSpawnMode() % 2) == 0 ? M_PI : 2 * M_PI);
float angle = startAngle + rand_norm() * maxAddAngle;
target->CastSpell(target->GetPositionX() + cos(angle)*dist, target->GetPositionY() + sin(angle)*dist, target->GetPositionZ(), spellId, true);
target->CastSpell(target->GetPositionX() + cos(angle)*dist, target->GetPositionY() + std::sin(angle)*dist, target->GetPositionZ(), spellId, true);
}
void Register() override

View File

@@ -3215,7 +3215,7 @@ public:
float angle = who->GetAngle(me);
float dist = 3.0f;
pos.m_positionX += cos(angle) * dist;
pos.m_positionY += sin(angle) * dist;
pos.m_positionY += std::sin(angle) * dist;
me->GetMotionMaster()->MoveJump(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), 10.0f, 6.0f, 0);
}
}
@@ -3462,7 +3462,7 @@ public:
{
float dist = frand(18.0f, 39.0f);
float o = rand_norm() * 2 * M_PI;
if (Creature* broodling = me->SummonCreature(NPC_NERUBAR_BROODLING, me->GetPositionX() + cos(o) * dist, me->GetPositionY() + sin(o) * dist, 250.0f, Position::NormalizeOrientation(o - M_PI)))
if (Creature* broodling = me->SummonCreature(NPC_NERUBAR_BROODLING, me->GetPositionX() + cos(o) * dist, me->GetPositionY() + std::sin(o) * dist, 250.0f, Position::NormalizeOrientation(o - M_PI)))
{
broodling->CastSpell(broodling, SPELL_WEB_BEAM2, false);
broodling->GetMotionMaster()->MovePoint(POINT_ENTER_COMBAT, broodling->GetPositionX(), broodling->GetPositionY(), 213.03f, false);

View File

@@ -179,7 +179,7 @@ public:
for (uint8 j = 0; j < 8; ++j)
{
float angle = M_PI * 2 / 8 * j;
me->SummonCreature(NPC_SOLDIER_OF_THE_FROZEN_WASTES, SummonGroups[i].GetPositionX() + 6 * cos(angle), SummonGroups[i].GetPositionY() + 6 * sin(angle), SummonGroups[i].GetPositionZ(), SummonGroups[i].GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000);
me->SummonCreature(NPC_SOLDIER_OF_THE_FROZEN_WASTES, SummonGroups[i].GetPositionX() + 6 * cos(angle), SummonGroups[i].GetPositionY() + 6 * std::sin(angle), SummonGroups[i].GetPositionZ(), SummonGroups[i].GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000);
}
}
for (uint8 i = 6; i < 12; ++i)
@@ -188,7 +188,7 @@ public:
{
float dist = j == 2 ? 0.0f : 8.0f; // second in middle
float angle = SummonGroups[i].GetOrientation() + M_PI * 2 / 4 * j;
me->SummonCreature(NPC_UNSTOPPABLE_ABOMINATION, SummonGroups[i].GetPositionX() + dist * cos(angle), SummonGroups[i].GetPositionY() + dist * sin(angle), SummonGroups[i].GetPositionZ(), SummonGroups[i].GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000);
me->SummonCreature(NPC_UNSTOPPABLE_ABOMINATION, SummonGroups[i].GetPositionX() + dist * cos(angle), SummonGroups[i].GetPositionY() + dist * std::sin(angle), SummonGroups[i].GetPositionZ(), SummonGroups[i].GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000);
}
}
for (uint8 i = 6; i < 12; ++i)
@@ -196,7 +196,7 @@ public:
for (uint8 j = 0; j < 1; ++j)
{
float angle = SummonGroups[i].GetOrientation() + M_PI;
me->SummonCreature(NPC_SOUL_WEAVER, SummonGroups[i].GetPositionX() + 6 * cos(angle), SummonGroups[i].GetPositionY() + 6 * sin(angle), SummonGroups[i].GetPositionZ() + 0.5f, SummonGroups[i].GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000);
me->SummonCreature(NPC_SOUL_WEAVER, SummonGroups[i].GetPositionX() + 6 * cos(angle), SummonGroups[i].GetPositionY() + 6 * std::sin(angle), SummonGroups[i].GetPositionZ() + 0.5f, SummonGroups[i].GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000);
}
}
}

View File

@@ -260,7 +260,7 @@ public:
{
float angle = me->GetOrientation();
float dist = 75.0f;
if (Creature* c = me->SummonCreature(NPC_PORTAL, me->GetPositionX() + cos(angle) * dist, me->GetPositionY() + sin(angle) * dist, me->GetPositionZ(), FourSidesPos[id].GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 13000))
if (Creature* c = me->SummonCreature(NPC_PORTAL, me->GetPositionX() + cos(angle) * dist, me->GetPositionY() + std::sin(angle) * dist, me->GetPositionZ(), FourSidesPos[id].GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 13000))
me->CastSpell(c, SPELL_PORTAL_BEAM, false);
timer2 = INTRO_MOVEMENT_INTERVAL - 10000;
}
@@ -399,7 +399,7 @@ public:
me->RemoveAllAuras();
float angle = CenterPos.GetAngle(me);
float x = CenterPos.GetPositionX() + cos(angle) * 35.0f;
float y = CenterPos.GetPositionY() + sin(angle) * 35.0f;
float y = CenterPos.GetPositionY() + std::sin(angle) * 35.0f;
float z = FourSidesPos[0].GetPositionZ();
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
me->GetMotionMaster()->MovePoint(MI_POINT_INTRO_CENTER_AIR, x, y, z);
@@ -485,7 +485,7 @@ public:
Position pos;
float angle = (me->GetOrientation() >= M_PI / 4 ? me->GetOrientation() - M_PI / 4 : 7 * M_PI / 4 + me->GetOrientation());
pos.m_positionX = CenterPos.GetPositionX() + cos(angle) * 40.0f;
pos.m_positionY = CenterPos.GetPositionY() + sin(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);
@@ -504,7 +504,7 @@ public:
Position plrpos;
float playerAngle = CenterPos.GetAngle(pPlayer);
plrpos.m_positionX = CenterPos.GetPositionX() + cos(playerAngle) * 5.0f;
plrpos.m_positionY = CenterPos.GetPositionY() + sin(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);
@@ -599,7 +599,7 @@ public:
{
float dist = 22.0f;
float angle = M_PI / 2 + ((float)i / MAX_NEXUS_LORDS) * 2 * M_PI;
if (Creature* disk = me->SummonCreature(NPC_HOVER_DISK, CenterPos.GetPositionX() + cos(angle) * dist, CenterPos.GetPositionY() + sin(angle) * dist, CenterPos.GetPositionZ() + 30.0f, 0.0f, TEMPSUMMON_MANUAL_DESPAWN, 0))
if (Creature* disk = me->SummonCreature(NPC_HOVER_DISK, CenterPos.GetPositionX() + cos(angle) * dist, CenterPos.GetPositionY() + std::sin(angle) * dist, CenterPos.GetPositionZ() + 30.0f, 0.0f, TEMPSUMMON_MANUAL_DESPAWN, 0))
if (Creature* c = me->SummonCreature(NPC_NEXUS_LORD, *disk, TEMPSUMMON_MANUAL_DESPAWN, 0))
{
c->EnterVehicle(disk, 0);
@@ -610,7 +610,7 @@ public:
{
float dist = 30.0f;
float angle = 0.0f + ((float)i / MAX_SCIONS_OF_ETERNITY) * 2 * M_PI;
if (Creature* disk = me->SummonCreature(NPC_HOVER_DISK, CenterPos.GetPositionX() + cos(angle) * dist, CenterPos.GetPositionY() + sin(angle) * dist, CenterPos.GetPositionZ() + 30.0f, 0.0f, TEMPSUMMON_MANUAL_DESPAWN, 0))
if (Creature* disk = me->SummonCreature(NPC_HOVER_DISK, CenterPos.GetPositionX() + cos(angle) * dist, CenterPos.GetPositionY() + std::sin(angle) * dist, CenterPos.GetPositionZ() + 30.0f, 0.0f, TEMPSUMMON_MANUAL_DESPAWN, 0))
if (Creature* c = me->SummonCreature(NPC_SCION_OF_ETERNITY, *disk, TEMPSUMMON_MANUAL_DESPAWN, 0))
{
c->EnterVehicle(disk, 0);
@@ -626,7 +626,7 @@ public:
float dist = urand(5, 30);
float angle = rand_norm() * 2 * M_PI;
float posx = CenterPos.GetPositionX() + cos(angle) * dist;
float posy = CenterPos.GetPositionY() + sin(angle) * dist;
float posy = CenterPos.GetPositionY() + std::sin(angle) * dist;
me->SetFacingTo(me->GetAngle(posx, posy));
me->CastSpell(posx, posy, CenterPos.GetPositionZ() + 1.5f, SPELL_ARCANE_OVERLOAD, true);
events.RepeatEvent(15000);
@@ -639,7 +639,7 @@ public:
float dist = Phase2NorthPos.GetExactDist2d(&CenterPos);
float newangle = angle + 0.5f;
if (newangle >= 2 * M_PI) newangle -= 2 * M_PI;
me->GetMotionMaster()->MovePoint(MI_POINT_CIRCLE_OUTSIDE_PH_2, CenterPos.GetPositionX() + cos(newangle)*dist, CenterPos.GetPositionY() + sin(newangle)*dist, Phase2NorthPos.GetPositionZ());
me->GetMotionMaster()->MovePoint(MI_POINT_CIRCLE_OUTSIDE_PH_2, CenterPos.GetPositionX() + cos(newangle)*dist, CenterPos.GetPositionY() + std::sin(newangle)*dist, Phase2NorthPos.GetPositionZ());
}
break;
case EVENT_MOVE_TO_SURGE_OF_POWER:
@@ -648,7 +648,7 @@ public:
float angle = CenterPos.GetAngle(me);
me->GetMotionMaster()->MoveIdle();
me->StopMoving();
me->GetMotionMaster()->MovePoint(MI_POINT_SURGE_OF_POWER_CENTER, CenterPos.GetPositionX() + cos(angle) * 10.0f, CenterPos.GetPositionY() + sin(angle) * 10.0f, Phase2NorthPos.GetPositionZ());
me->GetMotionMaster()->MovePoint(MI_POINT_SURGE_OF_POWER_CENTER, CenterPos.GetPositionX() + cos(angle) * 10.0f, CenterPos.GetPositionY() + std::sin(angle) * 10.0f, Phase2NorthPos.GetPositionZ());
events.CancelEventGroup(1); // everything beside berserk
}
break;
@@ -878,7 +878,7 @@ public:
float angle = CenterPos.GetAngle(me);
Position pos;
pos.m_positionX = CenterPos.GetPositionX() + VORTEX_RADIUS * cos(angle);
pos.m_positionY = CenterPos.GetPositionY() + VORTEX_RADIUS * sin(angle);
pos.m_positionY = CenterPos.GetPositionY() + VORTEX_RADIUS * std::sin(angle);
pos.m_positionZ = CenterPos.GetPositionZ() + h;
pos.m_orientation = pos.GetAngle(&CenterPos);
me->SetPosition(pos);
@@ -934,7 +934,7 @@ public:
if (newangle >= 2 * M_PI)
newangle -= 2 * M_PI;
float newx = CenterPos.GetPositionX() + VORTEX_RADIUS * cos(newangle);
float newy = CenterPos.GetPositionY() + VORTEX_RADIUS * sin(newangle);
float newy = CenterPos.GetPositionY() + VORTEX_RADIUS * std::sin(newangle);
float arcangle = me->GetAngle(newx, newy);
float dist = 2 * me->GetDistance2d(newx, newy);
if (me->GetVehicleKit()) if (Unit* pass = me->GetVehicleKit()->GetPassenger(0)) if (Player* plr = pass->ToPlayer())
@@ -949,7 +949,7 @@ public:
sScriptMgr->AnticheatSetUnderACKmount(plr);
}
plr->SendMonsterMove(me->GetPositionX() + dist * cos(arcangle), me->GetPositionY() + dist * sin(arcangle), me->GetPositionZ(), VORTEX_DEFAULT_DIFF * 2, SPLINEFLAG_FLYING);
plr->SendMonsterMove(me->GetPositionX() + dist * cos(arcangle), me->GetPositionY() + dist * std::sin(arcangle), me->GetPositionZ(), VORTEX_DEFAULT_DIFF * 2, SPLINEFLAG_FLYING);
me->Relocate(newx, newy);
}
@@ -1333,7 +1333,7 @@ public:
if (newangle < 0.0f) newangle += 2 * M_PI;
float newz = me->GetPositionZ() - 4.0f;
if (newz < CenterPos.GetPositionZ()) newz = CenterPos.GetPositionZ();
me->GetMotionMaster()->MovePoint(MI_POINT_NEXUS_LORD, CenterPos.GetPositionX() + cos(newangle) * 22.0f, CenterPos.GetPositionY() + sin(newangle) * 22.0f, newz);
me->GetMotionMaster()->MovePoint(MI_POINT_NEXUS_LORD, CenterPos.GetPositionX() + cos(newangle) * 22.0f, CenterPos.GetPositionY() + std::sin(newangle) * 22.0f, newz);
}
break;
case NPC_SCION_OF_ETERNITY:
@@ -1343,7 +1343,7 @@ public:
if (newangle < 0.0f) newangle += 2 * M_PI;
float newz = me->GetPositionZ() - 2.0f;
if (newz < CenterPos.GetPositionZ() + 20.0f) newz = CenterPos.GetPositionZ() + 20.0f;
me->GetMotionMaster()->MovePoint(MI_POINT_SCION, CenterPos.GetPositionX() + cos(newangle) * 30.0f, CenterPos.GetPositionY() + sin(newangle) * 30.0f, newz);
me->GetMotionMaster()->MovePoint(MI_POINT_SCION, CenterPos.GetPositionX() + cos(newangle) * 30.0f, CenterPos.GetPositionY() + std::sin(newangle) * 30.0f, newz);
}
break;
}

View File

@@ -164,7 +164,7 @@ public:
{
float o = rand_norm() * 2.0f * M_PI;
float x = me->GetPositionX() + 5.0f * _spikesCount * cos(o);
float y = me->GetPositionY() + 5.0f * _spikesCount * sin(o);
float y = me->GetPositionY() + 5.0f * _spikesCount * std::sin(o);
float h = me->GetMapHeight(x, y, me->GetPositionZ());
if (h != INVALID_HEIGHT)

View File

@@ -162,7 +162,7 @@ public:
for( uint8 i = 0; i < 2; ++i )
{
float angle = rand_norm() * 2 * M_PI;
me->SummonCreature(NPC_UNSTABLE_SPHERE, me->GetPositionX() + 5.0f * cos(angle), me->GetPositionY() + 5.0f * sin(angle), me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 18000);
me->SummonCreature(NPC_UNSTABLE_SPHERE, me->GetPositionX() + 5.0f * cos(angle), me->GetPositionY() + 5.0f * std::sin(angle), me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 18000);
}
events.RepeatEvent(2000);
}
@@ -171,7 +171,7 @@ public:
for( uint8 i = 0; i < 4; ++i )
{
float angle = rand_norm() * 2 * M_PI;
me->SummonCreature(NPC_UNSTABLE_SPHERE, me->GetPositionX() + 5.0f * cos(angle), me->GetPositionY() + 5.0f * sin(angle), me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 18000);
me->SummonCreature(NPC_UNSTABLE_SPHERE, me->GetPositionX() + 5.0f * cos(angle), me->GetPositionY() + 5.0f * std::sin(angle), me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 18000);
}
break;
@@ -201,7 +201,7 @@ public:
{
float dist = rand_norm() * 40.0f;
float angle = rand_norm() * 2 * M_PI;
me->GetMotionMaster()->MovePoint(1, 961.29f + dist * cos(angle), 1049.0f + dist * sin(angle), 360.0f);
me->GetMotionMaster()->MovePoint(1, 961.29f + dist * cos(angle), 1049.0f + dist * std::sin(angle), 360.0f);
}
void MovementInform(uint32 type, uint32 id) override

View File

@@ -747,7 +747,7 @@ public:
_channelTimer = 0;
float o = urand(0, 5) * M_PI / 3.0f;
me->InterruptNonMeleeSpells(false);
me->GetMotionMaster()->MovePoint(POINT_CHANNEL_STEELBREAKER, 1587.18f + 10.0f * cos(o), 121.02f + 10.0f * sin(o), 427.3f);
me->GetMotionMaster()->MovePoint(POINT_CHANNEL_STEELBREAKER, 1587.18f + 10.0f * cos(o), 121.02f + 10.0f * std::sin(o), 427.3f);
}
}

View File

@@ -465,7 +465,7 @@ public:
{
if (aurEff->GetTotalTicks() >= 0 && aurEff->GetTickNumber() == uint32(aurEff->GetTotalTicks()))
if (Unit* c = GetCaster())
if (Creature* s = c->SummonCreature(NPC_SCORCHED_GROUND, c->GetPositionX() + 20.0f * cos(c->GetOrientation()), c->GetPositionY() + 20.0f * sin(c->GetOrientation()), 361.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 30000))
if (Creature* s = c->SummonCreature(NPC_SCORCHED_GROUND, c->GetPositionX() + 20.0f * cos(c->GetOrientation()), c->GetPositionY() + 20.0f * std::sin(c->GetOrientation()), 361.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 30000))
{
if (!s->FindNearestCreature(NPC_WATER_TRIGGER, 25.0f, true)) // must be away from the water
s->CastSpell(s, (aurEff->GetId() == 62546 ? SPELL_SCORCHED_GROUND_10 : SPELL_SCORCHED_GROUND_25), true);

View File

@@ -471,11 +471,11 @@ public:
Player* player = pg[index];
float angle = rand_norm() * 2 * M_PI;
float z = 364.35f;
if (!player->IsWithinLOS(player->GetPositionX() + cos(angle) * 5.0f, player->GetPositionY() + sin(angle) * 5.0f, z))
if (!player->IsWithinLOS(player->GetPositionX() + cos(angle) * 5.0f, player->GetPositionY() + std::sin(angle) * 5.0f, z))
{
angle = player->GetAngle(2744.65f, 2569.46f);
}
me->CastSpell(player->GetPositionX() + cos(angle) * 5.0f, player->GetPositionY() + sin(angle) * 5.0f, z, SPELL_SUMMON_FLAMES_INITIAL, true);
me->CastSpell(player->GetPositionX() + cos(angle) * 5.0f, player->GetPositionY() + std::sin(angle) * 5.0f, z, SPELL_SUMMON_FLAMES_INITIAL, true);
pg.erase(pg.begin() + index);
}
@@ -789,7 +789,7 @@ public:
float angle = VX001->GetOrientation();
float v_x = me->GetPositionX() + cos(angle) * 10.0f;
float v_y = me->GetPositionY() + sin(angle) * 10.0f;
float v_y = me->GetPositionY() + std::sin(angle) * 10.0f;
me->GetMotionMaster()->MoveJump(v_x, v_y, 364.32f, 7.0f, 7.0f);
if( pInstance )
@@ -1454,7 +1454,7 @@ public:
trigger->CastSpell(trigger, SPELL_ROCKET_STRIKE_AURA, true);
Position exitPos = r->GetPosition();
exitPos.m_positionX += cos(me->GetOrientation()) * 2.35f;
exitPos.m_positionY += sin(me->GetOrientation()) * 2.35f;
exitPos.m_positionY += std::sin(me->GetOrientation()) * 2.35f;
exitPos.m_positionZ += 2.0f * Phase;
r->_ExitVehicle(&exitPos);
me->RemoveAurasByType(SPELL_AURA_CONTROL_VEHICLE, r->GetGUID());
@@ -1760,7 +1760,7 @@ public:
float angle = victim->GetAngle(me->GetPositionX(), me->GetPositionY());
me->SetOrientation( me->GetAngle(victim->GetPositionX(), victim->GetPositionY()) );
float x = victim->GetPositionX() + 15.0f * cos(angle);
float y = victim->GetPositionY() + 15.0f * sin(angle);
float y = victim->GetPositionY() + 15.0f * std::sin(angle);
// check if there's magnetic core in line of movement
Creature* mc = nullptr;
@@ -2377,7 +2377,7 @@ public:
if (target && prevdist >= 4.0f) // no need to spread when player is standing in fire, check distance
{
float angle = last->GetAngle(target->GetPositionX(), target->GetPositionY()) - M_PI / 8 + rand_norm() * 2 * M_PI / 8;
SpreadFlame(last->GetPositionX() + 7.0f * cos(angle), last->GetPositionY() + 7.0f * sin(angle));
SpreadFlame(last->GetPositionX() + 7.0f * cos(angle), last->GetPositionY() + 7.0f * std::sin(angle));
}
}

View File

@@ -412,7 +412,7 @@ public:
for( int j = 0; j < 4; ++j )
{
float x = cords[i][0] + 4.0f * cos(j * M_PI / 2);
float y = cords[i][1] + 4.0f * sin(j * M_PI / 2);
float y = cords[i][1] + 4.0f * std::sin(j * M_PI / 2);
uint32 npc_entry = 0;
switch( opt )
@@ -878,7 +878,7 @@ public:
if (!fs->AI()->GetData(2))
{
float a = rand_norm() * M_PI;
me->GetMotionMaster()->MovePoint(0, fs->GetPositionX() + 3.0f * cos(a), fs->GetPositionY() + 3.0f * sin(a), fs->GetPositionZ());
me->GetMotionMaster()->MovePoint(0, fs->GetPositionX() + 3.0f * cos(a), fs->GetPositionY() + 3.0f * std::sin(a), fs->GetPositionZ());
fixingGUID = fs->GetGUID();
return;
}

View File

@@ -617,7 +617,7 @@ public:
if ((cr = me->SummonCreature((_spawnCommoners ? NPC_DARK_RUNE_COMMONER : RollTable[urand(0, 2)]), ArenaNPCs[rnd], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000)))
cr->GetMotionMaster()->MoveJump(
Middle.GetPositionX() + urand(19, 24) * cos(Middle.GetAngle(cr)),
Middle.GetPositionY() + urand(19, 24) * sin(Middle.GetAngle(cr)),
Middle.GetPositionY() + urand(19, 24) * std::sin(Middle.GetAngle(cr)),
Middle.GetPositionZ(), 20, 20);
}
}

View File

@@ -534,7 +534,7 @@ public:
uint32 dist = urand(38, 48);
float o = rand_norm() * M_PI * 2;
float Zplus = (dist - 38) / 6.5f;
if (Creature* cr = me->SummonCreature(entry, me->GetPositionX() + dist * cos(o), me->GetPositionY() + dist * sin(o), 327.2 + Zplus, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000))
if (Creature* cr = me->SummonCreature(entry, me->GetPositionX() + dist * cos(o), me->GetPositionY() + dist * std::sin(o), 327.2 + Zplus, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000))
{
cr->CastSpell(cr, SPELL_TENTACLE_ERUPT, true);
cr->CastSpell(cr, SPELL_VOID_ZONE_SMALL, true);
@@ -549,7 +549,7 @@ public:
uint32 dist = urand(38, 48);
float o = rand_norm() * M_PI * 2;
float Zplus = (dist - 38) / 6.5f;
me->SummonCreature(NPC_DEATH_ORB, me->GetPositionX() + dist * cos(o), me->GetPositionY() + dist * sin(o), 327.2 + Zplus, 0, TEMPSUMMON_TIMED_DESPAWN, 20000);
me->SummonCreature(NPC_DEATH_ORB, me->GetPositionX() + dist * cos(o), me->GetPositionY() + dist * std::sin(o), 327.2 + Zplus, 0, TEMPSUMMON_TIMED_DESPAWN, 20000);
}
}
@@ -947,7 +947,7 @@ public:
for (uint8 i = 0; i <= dist; ++i)
{
float angle = M_PI * 2 / dist * i;
AddWaypoint(i, Middle.GetPositionX() + dist * cos(angle), Middle.GetPositionY() + dist * sin(angle), me->GetPositionZ(), 0);
AddWaypoint(i, Middle.GetPositionX() + dist * cos(angle), Middle.GetPositionY() + dist * std::sin(angle), me->GetPositionZ(), 0);
}
}
else
@@ -955,7 +955,7 @@ public:
for (uint8 i = 0; i <= dist; ++i)
{
float angle = M_PI * 2 - (M_PI * 2 / dist * i);
AddWaypoint(i, Middle.GetPositionX() + dist * cos(angle), Middle.GetPositionY() + dist * sin(angle), me->GetPositionZ(), 0);
AddWaypoint(i, Middle.GetPositionX() + dist * cos(angle), Middle.GetPositionY() + dist * std::sin(angle), me->GetPositionZ(), 0);
}
}
}
@@ -1071,7 +1071,7 @@ public:
uint32 dist = urand(38, 48);
float o = rand_norm() * M_PI * 2;
float Zplus = (dist - 38) / 6.5f;
me->SummonCreature(NPC_IMMORTAL_GUARDIAN, me->GetPositionX() + dist * cos(o), me->GetPositionY() + dist * sin(o), 327.2 + Zplus, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
me->SummonCreature(NPC_IMMORTAL_GUARDIAN, me->GetPositionX() + dist * cos(o), me->GetPositionY() + dist * std::sin(o), 327.2 + Zplus, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
}
void JustDied(Unit* /*who*/) override

View File

@@ -137,7 +137,7 @@ public:
{
float a = rand_norm() * 2 * M_PI;
float d = rand_norm() * 4.0f;
if (Creature* c = me->SummonCreature(34137, me->GetPositionX() + cos(a) * d, me->GetPositionY() + sin(a) * d, me->GetPositionZ() + 1.0f, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000))
if (Creature* c = me->SummonCreature(34137, me->GetPositionX() + cos(a) * d, me->GetPositionY() + std::sin(a) * d, me->GetPositionZ() + 1.0f, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000))
c->AI()->AttackStart(who);
}
}

View File

@@ -214,7 +214,7 @@ public:
{
float dist = rand_norm() * 4 + 3.0f;
float angle = rand_norm() * 2 * M_PI;
if( Creature* c = me->SummonCreature(NPC_SKELETON, 156.2f + cos(angle) * dist, 259.1f + sin(angle) * dist, 42.9f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000) )
if( Creature* c = me->SummonCreature(NPC_SKELETON, 156.2f + cos(angle) * dist, 259.1f + std::sin(angle) * dist, 42.9f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000) )
if( Unit* target = c->SelectNearestTarget(250.0f) )
{
c->AddThreat(target, 5.0f);

View File

@@ -198,9 +198,9 @@ public:
float angle = rand_norm() * 2 * M_PI;
Position p1(SpawnLoc[i]), p2(SpawnLoc[i]);
p1.m_positionX += 2.5f * cos(angle);
p1.m_positionY += 2.5f * sin(angle);
p1.m_positionY += 2.5f * std::sin(angle);
p2.m_positionX -= 2.5f * cos(angle);
p2.m_positionY -= 2.5f * sin(angle);
p2.m_positionY -= 2.5f * std::sin(angle);
DoSummon(NPC_ICHOR_GLOBULE, p1, 60000, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN);
DoSummon(NPC_ICHOR_GLOBULE, p2, 60000, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN);
}

View File

@@ -477,7 +477,7 @@ public:
float dist = position->GetExactDist2d(player->GetPositionX(), player->GetPositionY());
float elevation = GetSpell()->m_targets.GetElevation();
float speedZ = std::max(10.0f, float(50.0f * sin(elevation)));
float speedZ = std::max(10.0f, float(50.0f * std::sin(elevation)));
float speedXY = dist * 10.0f / speedZ;
player->GetMotionMaster()->MoveJump(position->GetPositionX(), position->GetPositionY(), position->GetPositionZ(), speedXY, speedZ);

View File

@@ -507,7 +507,7 @@ public:
_landgrenGUID = cr->GetGUID();
float o = cr->GetAngle(me);
me->GetMotionMaster()->MovePoint(1, cr->GetPositionX() + cos(o) * 3, cr->GetPositionY() + sin(o) * 3, cr->GetPositionZ());
me->GetMotionMaster()->MovePoint(1, cr->GetPositionX() + cos(o) * 3, cr->GetPositionY() + std::sin(o) * 3, cr->GetPositionZ());
events.RescheduleEvent(EVENT_SOUL_COAX, 5000);
}
else
@@ -913,7 +913,7 @@ public:
if (summon->GetEntry() == NPC_DISGUISED_CRUSADER)
{
summon->SetWalk(false);
summon->GetMotionMaster()->MovePoint(2, 6132.38f + 4 * cos(2 * M_PI * (i / 3.0)), 2760.76f + 4 * sin(2 * M_PI * (i / 3.0)), me->GetPositionZ());
summon->GetMotionMaster()->MovePoint(2, 6132.38f + 4 * cos(2 * M_PI * (i / 3.0)), 2760.76f + 4 * std::sin(2 * M_PI * (i / 3.0)), me->GetPositionZ());
}
break;
}

View File

@@ -929,7 +929,7 @@ public:
switch (phase)
{
case 1:
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->AI()->Talk(TEXT_WOLVAR_ORPHAN_6);
timer = 5000;
break;

View File

@@ -267,7 +267,7 @@ public:
{
ghoul->SetReactState(REACT_DEFENSIVE);
float o = me->GetAngle(ghoul);
ghoul->GetMotionMaster()->MovePoint(1, me->GetPositionX() + 2 * cos(o), me->GetPositionY() + 2 * sin(o), me->GetPositionZ());
ghoul->GetMotionMaster()->MovePoint(1, me->GetPositionX() + 2 * cos(o), me->GetPositionY() + 2 * std::sin(o), me->GetPositionZ());
checkTimer = 1;
findTimer = 0;
}
@@ -451,7 +451,7 @@ public:
me->SetFacingToObject(cr);
lichGUID = cr->GetGUID();
float o = me->GetAngle(cr);
cr->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(o) * 6.0f, me->GetPositionY() + sin(o) * 6.0f, me->GetPositionZ());
cr->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(o) * 6.0f, me->GetPositionY() + std::sin(o) * 6.0f, me->GetPositionZ());
}
}
@@ -834,7 +834,7 @@ public:
break;
case EVENT_RECRUIT_2:
me->SetWalk(true);
me->GetMotionMaster()->MovePoint(0, me->GetPositionX() + (cos(_heading) * 10), me->GetPositionY() + (sin(_heading) * 10), me->GetPositionZ());
me->GetMotionMaster()->MovePoint(0, me->GetPositionX() + (cos(_heading) * 10), me->GetPositionY() + (std::sin(_heading) * 10), me->GetPositionZ());
me->DespawnOrUnsummon(5000);
break;
default:

View File

@@ -253,7 +253,7 @@ public:
Talk(SAY_SUMMON);
me->CastSpell(me, SPELL_BANISH_SELF, true);
for (uint8 i = 0; i < 5; ++i)
me->SummonCreature(23132 /*NPC_BROOD_OF_ANZU*/, me->GetPositionX() + 20 * cos((float)i), me->GetPositionY() + 20 * sin((float)i), me->GetPositionZ() + 25.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
me->SummonCreature(23132 /*NPC_BROOD_OF_ANZU*/, me->GetPositionX() + 20 * cos((float)i), me->GetPositionY() + 20 * std::sin((float)i), me->GetPositionZ() + 25.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
}
void UpdateAI(uint32 diff) override

View File

@@ -341,7 +341,7 @@ public:
{
float dist = frand(30.0f, 32.0f);
summon->SetWalk(true);
summon->GetMotionMaster()->MovePoint(POINT_START, summon->GetPositionX() + dist * cos(summon->GetOrientation()), summon->GetPositionY() + dist * sin(summon->GetOrientation()), summon->GetPositionZ(), false);
summon->GetMotionMaster()->MovePoint(POINT_START, summon->GetPositionX() + dist * cos(summon->GetOrientation()), summon->GetPositionY() + dist * std::sin(summon->GetOrientation()), summon->GetPositionZ(), false);
summons.Summon(summon);
}

View File

@@ -232,7 +232,7 @@ public:
{
float dist = (float)urand(3, 10);
float angle = rand_norm() * 2 * M_PI;
me->CastSpell(MinionSummonPos.GetPositionX() + cos(angle)*dist, MinionSummonPos.GetPositionY() + sin(angle)*dist, MinionSummonPos.GetPositionZ(), SPELL_SUMMON_HAILSTONE, false);
me->CastSpell(MinionSummonPos.GetPositionX() + cos(angle)*dist, MinionSummonPos.GetPositionY() + std::sin(angle)*dist, MinionSummonPos.GetPositionZ(), SPELL_SUMMON_HAILSTONE, false);
events.RepeatEvent(30000);
}
break;
@@ -241,12 +241,12 @@ public:
{
float dist = (float)urand(3, 10);
float angle = rand_norm() * 2 * M_PI;
me->CastSpell(MinionSummonPos.GetPositionX() + cos(angle)*dist, MinionSummonPos.GetPositionY() + sin(angle)*dist, MinionSummonPos.GetPositionZ(), SPELL_SUMMON_COLDWAVE, false);
me->CastSpell(MinionSummonPos.GetPositionX() + cos(angle)*dist, MinionSummonPos.GetPositionY() + std::sin(angle)*dist, MinionSummonPos.GetPositionZ(), SPELL_SUMMON_COLDWAVE, false);
}
{
float dist = (float)urand(3, 10);
float angle = rand_norm() * 2 * M_PI;
me->CastSpell(MinionSummonPos.GetPositionX() + cos(angle)*dist, MinionSummonPos.GetPositionY() + sin(angle)*dist, MinionSummonPos.GetPositionZ(), SPELL_SUMMON_FROSTWIND, false);
me->CastSpell(MinionSummonPos.GetPositionX() + cos(angle)*dist, MinionSummonPos.GetPositionY() + std::sin(angle)*dist, MinionSummonPos.GetPositionZ(), SPELL_SUMMON_FROSTWIND, false);
}
events.RepeatEvent(6000);
break;

View File

@@ -170,9 +170,9 @@ public:
{
float o = rand_norm() * 2 * M_PI;
if (i == 0)
me->SummonCreature(NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT, CENTER_X + cos(o)*INNER_PORTAL_RADIUS, CENTER_Y + sin(o)*INNER_PORTAL_RADIUS, CENTER_Z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 26000);
me->SummonCreature(NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT, CENTER_X + cos(o)*INNER_PORTAL_RADIUS, CENTER_Y + std::sin(o)*INNER_PORTAL_RADIUS, CENTER_Z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 26000);
else
me->SummonCreature(NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT, CENTER_X + cos(o)*OUTER_PORTAL_RADIUS, CENTER_Y + sin(o)*OUTER_PORTAL_RADIUS, PORTAL_Z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 26000);
me->SummonCreature(NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT, CENTER_X + cos(o)*OUTER_PORTAL_RADIUS, CENTER_Y + std::sin(o)*OUTER_PORTAL_RADIUS, PORTAL_Z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 26000);
}
break;
case EVENT_SUMMON_ADDS:

View File

@@ -1036,7 +1036,7 @@ public:
{
PreventHitEffect(effIndex);
for (uint32 i = 0; i < 5; ++i)
GetCaster()->SummonCreature(NPC_NETHER_VAPOR, GetCaster()->GetPositionX() + 6 * cos(i / 5.0f * 2 * M_PI), GetCaster()->GetPositionY() + 6 * sin(i / 5.0f * 2 * M_PI), GetCaster()->GetPositionZ() + 7.0f + i, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 30000);
GetCaster()->SummonCreature(NPC_NETHER_VAPOR, GetCaster()->GetPositionX() + 6 * cos(i / 5.0f * 2 * M_PI), GetCaster()->GetPositionY() + 6 * std::sin(i / 5.0f * 2 * M_PI), GetCaster()->GetPositionZ() + 7.0f + i, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 30000);
}
void Register() override

View File

@@ -156,7 +156,7 @@ public:
me->SetSpeed(MOVE_FLIGHT, 1.0f, true);
me->SetSpeed(MOVE_RUN, 1.0f, true);
float x = me->GetPositionX() + 20 * cos(me->GetOrientation());
float y = me->GetPositionY() + 20 * sin(me->GetOrientation());
float y = me->GetPositionY() + 20 * std::sin(me->GetOrientation());
float z = me->GetPositionZ() + 40;
me->DisableSpline();
me->GetMotionMaster()->Clear(false);

View File

@@ -89,7 +89,7 @@ struct npc_pet_mage_mirror_image : CasterAI
((Minion*)me)->SetFollowAngle(angle);
if (owner->IsInCombat())
me->NearTeleportTo(me->GetPositionX() + cos(angle)*dist, me->GetPositionY() + sin(angle)*dist, me->GetPositionZ(), me->GetOrientation(), false, false, false, false);
me->NearTeleportTo(me->GetPositionX() + cos(angle)*dist, me->GetPositionY() + std::sin(angle)*dist, me->GetPositionZ(), me->GetOrientation(), false, false, false, false);
else
me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle(), MOTION_SLOT_ACTIVE);

View File

@@ -163,7 +163,7 @@ class spell_q12014_steady_as_a_rock : public SpellScript
if (caster->ToPlayer()->GetQuestStatus(12014 /*QUEST_STEADY_AS_A_ROCK*/) == QUEST_STATUS_INCOMPLETE)
{
float x = caster->GetPositionX() + 3.0f * cos(caster->GetOrientation());
float y = caster->GetPositionY() + 3.0f * sin(caster->GetOrientation());
float y = caster->GetPositionY() + 3.0f * std::sin(caster->GetOrientation());
float o = caster->GetOrientation() < M_PI ? caster->GetOrientation() + M_PI : caster->GetOrientation() - M_PI;
caster->SummonGameObject(188367, x, y, caster->GetPositionZ(), o, 0.0f, 0.0f, 0.0f, 0.0f, 60000);
}
@@ -473,7 +473,7 @@ class spell_quest_dragonmaw_race_generic : public SpellScript
float o = Position::NormalizeOrientation(caster->GetOrientation() + frand(0.0f, 2 * M_PI));
float dist = frand(5.0f, 30.0f);
_x = caster->GetPositionX() + dist * cos(o);
_y = caster->GetPositionY() + dist * sin(o);
_y = caster->GetPositionY() + dist * std::sin(o);
_z = caster->GetPositionZ() + frand(-10.0f, 15.0f);
GetSpell()->m_targets.SetDst(_x, _y, _z, 0.0f, caster->GetMapId());
return SPELL_CAST_OK;

View File

@@ -295,7 +295,7 @@ public:
requireSummon = 0;
int8 count = urand(1, 3);
for (int8 i = 0; i < count; ++i)
me->SummonCreature(NPC_WINTERFIN_TADPOLE, me->GetPositionX() + cos(2 * M_PI * i / 3.0f) * 0.60f, me->GetPositionY() + sin(2 * M_PI * i / 3.0f) * 0.60f, me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
me->SummonCreature(NPC_WINTERFIN_TADPOLE, me->GetPositionX() + cos(2 * M_PI * i / 3.0f) * 0.60f, me->GetPositionY() + std::sin(2 * M_PI * i / 3.0f) * 0.60f, me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
}
void OnStateChanged(uint32 state, Unit* /*unit*/) override