Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/game/Battlegrounds/ArenaTeam.cpp src/server/game/Entities/Player/Player.cpp src/server/game/Entities/Unit/StatSystem.cpp src/server/game/Entities/Unit/Unit.cpp src/server/game/Spells/Spell.cpp src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp src/server/scripts/Kalimdor/zone_durotar.cpp src/server/scripts/Spells/spell_warrior.cpp
This commit is contained in:
commit
547115476f
91 files changed
+334
-257
No files matched your search
@@ -1405,7 +1405,7 @@ public:
|
||||
// place pet before player
|
||||
float x, y, z;
|
||||
player->GetClosePoint (x, y, z, creatureTarget->GetObjectSize(), CONTACT_DISTANCE);
|
||||
pet->Relocate(x, y, z, M_PI-player->GetOrientation());
|
||||
pet->Relocate(x, y, z, float(M_PI) - player->GetOrientation());
|
||||
|
||||
// set pet to defensive mode by default (some classes can't control controlled pets in fact).
|
||||
pet->SetReactState(REACT_DEFENSIVE);
|
||||
@@ -1460,8 +1460,8 @@ public:
|
||||
FormationInfo* group_member;
|
||||
|
||||
group_member = new FormationInfo;
|
||||
group_member->follow_angle = (creature->GetAngle(chr) - chr->GetOrientation()) * 180 / M_PI;
|
||||
group_member->follow_dist = sqrtf(pow(chr->GetPositionX() - creature->GetPositionX(), int(2))+pow(chr->GetPositionY() - creature->GetPositionY(), int(2)));
|
||||
group_member->follow_angle = (creature->GetAngle(chr) - chr->GetOrientation()) * 180 / float(M_PI);
|
||||
group_member->follow_dist = std::sqrt(std::pow(chr->GetPositionX() - creature->GetPositionX(), 2.f) + std::pow(chr->GetPositionY() - creature->GetPositionY(), 2.f));
|
||||
group_member->leaderGUID = leaderGUID;
|
||||
group_member->groupAI = 0;
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
|
||||
float dist(float xa, float ya, float xb, float yb) // auxiliary method for distance
|
||||
{
|
||||
return sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
|
||||
return std::sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
|
||||
@@ -328,7 +328,7 @@ public:
|
||||
if (TailSweepTimer <= diff)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
if (!me->HasInArc(M_PI, target))
|
||||
if (!me->HasInArc(float(M_PI), target))
|
||||
DoCast(target, SPELL_TAIL_SWEEP);
|
||||
TailSweepTimer = 15000;
|
||||
} else TailSweepTimer -= diff;
|
||||
|
||||
@@ -1290,7 +1290,7 @@ public:
|
||||
if (BackwardLungeTimer <= diff)
|
||||
{
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
|
||||
if (target && !me->HasInArc(M_PI, target))
|
||||
if (target && !me->HasInArc(float(M_PI), target))
|
||||
{
|
||||
DoCast(target, SPELL_BACKWARD_LUNGE);
|
||||
BackwardLungeTimer = urand(15000, 30000);
|
||||
|
||||
@@ -1191,8 +1191,8 @@ public:
|
||||
bPointReached = false;
|
||||
uiCheckTimer = 1000;
|
||||
me->GetMotionMaster()->MovePoint(1, x, y, SHIELD_ORB_Z);
|
||||
c += M_PI/32;
|
||||
if (c >= 2*M_PI) c = 0;
|
||||
c += float(M_PI)/32;
|
||||
if (c >= 2 * float(M_PI)) c = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -193,7 +193,7 @@ class npc_winterfin_playmate : public CreatureScript
|
||||
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() + std::cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
|
||||
orphan->AI()->Talk(TEXT_ORACLE_ORPHAN_1);
|
||||
timer = 3000;
|
||||
break;
|
||||
@@ -292,7 +292,7 @@ class npc_snowfall_glade_playmate : public CreatureScript
|
||||
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() + std::cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
|
||||
orphan->AI()->Talk(TEXT_WOLVAR_ORPHAN_1);
|
||||
timer = 5000;
|
||||
break;
|
||||
@@ -393,7 +393,7 @@ class npc_the_biggest_tree : public CreatureScript
|
||||
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() + std::cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
|
||||
timer = 2000;
|
||||
break;
|
||||
case 2:
|
||||
@@ -480,7 +480,7 @@ class npc_high_oracle_soo_roo : public CreatureScript
|
||||
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() + std::cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
|
||||
orphan->AI()->Talk(TEXT_ORACLE_ORPHAN_5);
|
||||
timer = 3000;
|
||||
break;
|
||||
@@ -569,7 +569,7 @@ class npc_elder_kekek : public CreatureScript
|
||||
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() + std::cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
|
||||
orphan->AI()->Talk(TEXT_WOLVAR_ORPHAN_4);
|
||||
timer = 3000;
|
||||
break;
|
||||
@@ -658,7 +658,7 @@ class npc_the_etymidian : public CreatureScript
|
||||
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() + std::cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
|
||||
orphan->AI()->Talk(TEXT_ORACLE_ORPHAN_7);
|
||||
timer = 5000;
|
||||
break;
|
||||
@@ -780,7 +780,7 @@ class npc_alexstraza_the_lifebinder : public CreatureScript
|
||||
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() + std::cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
|
||||
orphan->AI()->Talk(TEXT_ORACLE_ORPHAN_11);
|
||||
timer = 5000;
|
||||
break;
|
||||
@@ -811,7 +811,7 @@ class npc_alexstraza_the_lifebinder : public CreatureScript
|
||||
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() + std::cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
|
||||
orphan->AI()->Talk(TEXT_WOLVAR_ORPHAN_11);
|
||||
timer = 5000;
|
||||
break;
|
||||
|
||||
@@ -280,8 +280,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() + (std::cos(me->GetOrientation() - (float(M_PI) / 2)) * 2), me->GetPositionY() + (std::sin(me->GetOrientation() - (float(M_PI) / 2)) * 2), me->GetPositionZ(), me->GetOrientation());
|
||||
me->SummonCreature(NPC_WITHERED_QUILGUARD, me->GetPositionX() + (std::cos(me->GetOrientation() + (float(M_PI) / 2)) * 2), me->GetPositionY() + (std::sin(me->GetOrientation() + (float(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());
|
||||
|
||||
@@ -334,9 +334,9 @@ public:
|
||||
{
|
||||
//Set angle and cast
|
||||
if (ClockWise)
|
||||
me->SetOrientation(DarkGlareAngle + DarkGlareTick * M_PI / 35);
|
||||
me->SetOrientation(DarkGlareAngle + DarkGlareTick * float(M_PI) / 35);
|
||||
else
|
||||
me->SetOrientation(DarkGlareAngle - DarkGlareTick * M_PI / 35);
|
||||
me->SetOrientation(DarkGlareAngle - DarkGlareTick * float(M_PI) / 35);
|
||||
|
||||
me->StopMoving();
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ class boss_viscidus : public CreatureScript
|
||||
uint8 NumGlobes = me->GetHealthPct() / 5.0f;
|
||||
for (uint8 i = 0; i < NumGlobes; ++i)
|
||||
{
|
||||
float Angle = i * 2 * M_PI / NumGlobes;
|
||||
float Angle = i * 2 * float(M_PI) / NumGlobes;
|
||||
float X = ViscidusCoord.GetPositionX() + std::cos(Angle) * RoomRadius;
|
||||
float Y = ViscidusCoord.GetPositionY() + std::sin(Angle) * RoomRadius;
|
||||
float Z = -35.0f;
|
||||
|
||||
@@ -1258,7 +1258,7 @@ class go_wind_stone : public GameObjectScript
|
||||
void SummonNPC(GameObject* go, Player* player, uint32 npc, uint32 spell)
|
||||
{
|
||||
go->CastSpell(player, spell);
|
||||
TempSummon* summons = go->SummonCreature(npc, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), player->GetOrientation() - M_PI, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 10 * 60 * 1000);
|
||||
TempSummon* summons = go->SummonCreature(npc, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), player->GetOrientation() - float(M_PI), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 10 * 60 * 1000);
|
||||
summons->CastSpell(summons, SPELL_SPAWN_IN, false);
|
||||
switch (summons->GetEntry())
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ enum Misc
|
||||
};
|
||||
|
||||
#define DATA_SPHERE_DISTANCE 25.0f
|
||||
#define DATA_SPHERE_ANGLE_OFFSET M_PI / 2
|
||||
#define DATA_SPHERE_ANGLE_OFFSET float(M_PI) / 2
|
||||
#define DATA_GROUND_POSITION_Z 11.30809f
|
||||
|
||||
enum Yells
|
||||
|
||||
+3
-3
@@ -289,13 +289,13 @@ public:
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
pAdd->GetMotionMaster()->MoveFollow(pBoss, 2.0f, M_PI);
|
||||
pAdd->GetMotionMaster()->MoveFollow(pBoss, 2.0f, float(M_PI));
|
||||
break;
|
||||
case 1:
|
||||
pAdd->GetMotionMaster()->MoveFollow(pBoss, 2.0f, M_PI / 2);
|
||||
pAdd->GetMotionMaster()->MoveFollow(pBoss, 2.0f, float(M_PI) / 2);
|
||||
break;
|
||||
case 2:
|
||||
pAdd->GetMotionMaster()->MoveFollow(pBoss, 2.0f, M_PI / 2 + M_PI);
|
||||
pAdd->GetMotionMaster()->MoveFollow(pBoss, 2.0f, float(M_PI) / 2 + float(M_PI));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -531,8 +531,8 @@ struct npc_unleashed_ballAI : public ScriptedAI
|
||||
float x0 = ToCCommonLoc[1].GetPositionX(), y0 = ToCCommonLoc[1].GetPositionY(), r = 47.0f;
|
||||
float y = y0;
|
||||
float x = frand(x0 - r, x0 + r);
|
||||
float sq = pow(r, 2) - pow(x - x0, 2);
|
||||
float rt = sqrtf(fabs(sq));
|
||||
float sq = std::pow(r, 2.f) - std::pow(x - x0, 2.f);
|
||||
float rt = std::sqrt(std::fabs(sq));
|
||||
if (urand(0, 1))
|
||||
y = y0 + rt;
|
||||
else
|
||||
@@ -756,7 +756,7 @@ class spell_valkyr_essences : public SpellScriptLoader
|
||||
// Twin Vortex part
|
||||
uint32 lightVortex = sSpellMgr->GetSpellIdForDifficulty(SPELL_LIGHT_VORTEX_DAMAGE, owner);
|
||||
uint32 darkVortex = sSpellMgr->GetSpellIdForDifficulty(SPELL_DARK_VORTEX_DAMAGE, owner);
|
||||
int32 stacksCount = int32(dmgInfo.GetSpellInfo()->Effects[EFFECT_0].CalcValue()) * 0.001 - 1;
|
||||
int32 stacksCount = dmgInfo.GetSpellInfo()->Effects[EFFECT_0].CalcValue() / 1000 - 1;
|
||||
|
||||
if (lightVortex && darkVortex && stacksCount)
|
||||
{
|
||||
|
||||
@@ -292,7 +292,7 @@ class boss_devourer_of_souls : public CreatureScript
|
||||
|
||||
beamAngle = me->GetOrientation();
|
||||
|
||||
beamAngleDiff = M_PI/30.0f; // PI/2 in 15 sec = PI/30 per tick
|
||||
beamAngleDiff = float(M_PI)/30.0f; // PI/2 in 15 sec = PI/30 per tick
|
||||
if (RAND(true, false))
|
||||
beamAngleDiff = -beamAngleDiff;
|
||||
|
||||
|
||||
@@ -205,8 +205,8 @@ enum EncounterActions
|
||||
ACTION_SHIP_VISITS = 5
|
||||
};
|
||||
|
||||
Position const SkybreakerAddsSpawnPos = { 15.91131f, 0.0f, 20.4628f, M_PI };
|
||||
Position const OrgrimsHammerAddsSpawnPos = { 60.728395f, 0.0f, 38.93467f, M_PI };
|
||||
Position const SkybreakerAddsSpawnPos = { 15.91131f, 0.0f, 20.4628f, float(M_PI) };
|
||||
Position const OrgrimsHammerAddsSpawnPos = { 60.728395f, 0.0f, 38.93467f, float(M_PI) };
|
||||
|
||||
// Horde encounter
|
||||
Position const SkybreakerTeleportPortal = { 6.666975f, 0.013001f, 20.87888f, 0.0f };
|
||||
@@ -439,7 +439,7 @@ private:
|
||||
Position SelectSpawnPoint() const
|
||||
{
|
||||
Position newPos;
|
||||
float angle = frand(-M_PI * 0.5f, M_PI * 0.5f);
|
||||
float angle = frand(float(-M_PI) * 0.5f, float(M_PI) * 0.5f);
|
||||
newPos.m_positionX = _spawnPoint->GetPositionX() + 2.0f * std::cos(angle);
|
||||
newPos.m_positionY = _spawnPoint->GetPositionY() + 2.0f * std::sin(angle);
|
||||
newPos.m_positionZ = _spawnPoint->GetPositionZ();
|
||||
@@ -1455,7 +1455,7 @@ struct npc_gunship_boarding_addAI : public gunship_npc_AI
|
||||
if (Transport* destTransport = go->ToTransport())
|
||||
destTransport->CalculatePassengerPosition(x, y, z, &o);
|
||||
|
||||
float angle = frand(0, M_PI * 2.0f);
|
||||
float angle = frand(0, float(M_PI) * 2.0f);
|
||||
x += 2.0f * std::cos(angle);
|
||||
y += 2.0f * std::sin(angle);
|
||||
|
||||
|
||||
@@ -674,7 +674,7 @@ class spell_marrowgar_bone_storm : public SpellScriptLoader
|
||||
|
||||
void RecalculateDamage()
|
||||
{
|
||||
SetHitDamage(int32(GetHitDamage() / std::max(sqrtf(GetHitUnit()->GetExactDist2d(GetCaster())), 1.0f)));
|
||||
SetHitDamage(int32(GetHitDamage() / std::max(std::sqrt(GetHitUnit()->GetExactDist2d(GetCaster())), 1.0f)));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
{
|
||||
float x, y, z, o;
|
||||
me->GetHomePosition(x, y, z, o);
|
||||
me->NearTeleportTo(x, y, z, o - G3D::halfPi());
|
||||
me->NearTeleportTo(x, y, z, o - (float(M_PI) / 2));
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
me->SetTarget(0);
|
||||
|
||||
@@ -1014,7 +1014,7 @@ public:
|
||||
// Used to generate perfect cyclic movements (Enter Circle).
|
||||
void FillCirclePath(Position const& centerPos, float radius, float z, Movement::PointsArray& path, bool clockwise)
|
||||
{
|
||||
float step = clockwise ? -M_PI / 8.0f : M_PI / 8.0f;
|
||||
float step = clockwise ? float(-M_PI) / 8.0f : float(M_PI) / 8.0f;
|
||||
float angle = centerPos.GetAngle(me->GetPositionX(), me->GetPositionY());
|
||||
|
||||
for (uint8 i = 0; i < 16; angle += step, ++i)
|
||||
@@ -1326,7 +1326,7 @@ public:
|
||||
private:
|
||||
void FillCirclePath(Position const& centerPos, float radius, float z, Movement::PointsArray& path, bool clockwise)
|
||||
{
|
||||
float step = clockwise ? -M_PI / 9.0f : M_PI / 9.0f;
|
||||
float step = clockwise ? float(-M_PI) / 9.0f : float(M_PI) / 9.0f;
|
||||
float angle = centerPos.GetAngle(me->GetPositionX(), me->GetPositionY());
|
||||
|
||||
for (uint8 i = 0; i < 18; angle += step, ++i)
|
||||
|
||||
@@ -315,7 +315,7 @@ class spell_varos_energize_core_area_enemy : public SpellScriptLoader
|
||||
for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end();)
|
||||
{
|
||||
float angle = varos->GetAngle((*itr)->GetPositionX(), (*itr)->GetPositionY());
|
||||
float diff = fabs(orientation - angle);
|
||||
float diff = std::fabs(orientation - angle);
|
||||
|
||||
if (diff > 1.0f)
|
||||
itr = targets.erase(itr);
|
||||
@@ -359,7 +359,7 @@ class spell_varos_energize_core_area_entry : public SpellScriptLoader
|
||||
for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end();)
|
||||
{
|
||||
float angle = varos->GetAngle((*itr)->GetPositionX(), (*itr)->GetPositionY());
|
||||
float diff = fabs(orientation - angle);
|
||||
float diff = std::fabs(orientation - angle);
|
||||
|
||||
if (diff > 1.0f)
|
||||
itr = targets.erase(itr);
|
||||
|
||||
@@ -526,7 +526,7 @@ class spell_general_vezax_saronite_vapors : public SpellScriptLoader
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
int32 mana = int32(aurEff->GetAmount() * pow(2.0f, GetStackAmount())); // mana restore - bp * 2^stackamount
|
||||
int32 mana = int32(aurEff->GetAmount() * std::pow(2.0f, GetStackAmount())); // mana restore - bp * 2^stackamount
|
||||
int32 damage = mana * 2;
|
||||
caster->CastCustomSpell(GetTarget(), SPELL_SARONITE_VAPORS_ENERGIZE, &mana, NULL, NULL, true);
|
||||
caster->CastCustomSpell(GetTarget(), SPELL_SARONITE_VAPORS_DAMAGE, &damage, NULL, NULL, true);
|
||||
|
||||
@@ -985,7 +985,7 @@ public:
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
int32 damage = int32(200 * pow(2.0f, GetStackAmount()));
|
||||
int32 damage = int32(200 * std::pow(2.0f, GetStackAmount()));
|
||||
caster->CastCustomSpell(caster, SPELL_BITING_COLD_DAMAGE, &damage, NULL, NULL, true);
|
||||
|
||||
if (caster->isMoving())
|
||||
|
||||
@@ -498,7 +498,7 @@ class spell_ulduar_squeezed_lifeless : public SpellScriptLoader
|
||||
pos.m_positionX = 1756.25f + irand(-3, 3);
|
||||
pos.m_positionY = -8.3f + irand(-3, 3);
|
||||
pos.m_positionZ = 448.8f;
|
||||
pos.SetOrientation(M_PI);
|
||||
pos.SetOrientation(float(M_PI));
|
||||
GetHitPlayer()->DestroyForNearbyPlayers();
|
||||
GetHitPlayer()->ExitVehicle(&pos);
|
||||
GetHitPlayer()->UpdateObjectVisibility(false);
|
||||
|
||||
@@ -839,7 +839,7 @@ class boss_sara : public CreatureScript
|
||||
{
|
||||
Position pos;
|
||||
float radius = frand(25.0f, 50.0f);
|
||||
float angle = frand(0.0f, 2.0f * M_PI);
|
||||
float angle = frand(0.0f, 2.0f * float(M_PI));
|
||||
pos.m_positionX = YoggSaronSpawnPos.GetPositionX() + radius * cosf(angle);
|
||||
pos.m_positionY = YoggSaronSpawnPos.GetPositionY() + radius * sinf(angle);
|
||||
pos.m_positionZ = me->GetMap()->GetHeight(me->GetPhaseMask(), pos.GetPositionX(), pos.GetPositionY(), YoggSaronSpawnPos.GetPositionZ() + 5.0f);
|
||||
@@ -1119,7 +1119,7 @@ class npc_ominous_cloud : public CreatureScript
|
||||
|
||||
void FillCirclePath(Position const& centerPos, float radius, float z, Movement::PointsArray& path, bool clockwise)
|
||||
{
|
||||
float step = clockwise ? -M_PI / 8.0f : M_PI / 8.0f;
|
||||
float step = clockwise ? float(-M_PI) / 8.0f : float(M_PI) / 8.0f;
|
||||
float angle = centerPos.GetAngle(me->GetPositionX(), me->GetPositionY());
|
||||
|
||||
for (uint8 i = 0; i < 16; angle += step, ++i)
|
||||
@@ -2502,7 +2502,7 @@ class spell_yogg_saron_empowered : public SpellScriptLoader // 64161
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
float stack = ceil((target->GetHealthPct() / 10) - 1);
|
||||
float stack = std::ceil((target->GetHealthPct() / 10) - 1);
|
||||
target->RemoveAurasDueToSpell(SPELL_EMPOWERED_BUFF);
|
||||
|
||||
if (stack)
|
||||
|
||||
@@ -718,7 +718,7 @@ public:
|
||||
if (me->GetEntry() == NPC_LAKE_FROG)
|
||||
{
|
||||
me->AddAura(SPELL_FROG_LOVE, me);
|
||||
me->GetMotionMaster()->MoveFollow(player, 0.3f, frand(M_PI/2, M_PI + (M_PI/2)));
|
||||
me->GetMotionMaster()->MoveFollow(player, 0.3f, frand(float(M_PI) / 2, float(M_PI) + (float(M_PI) / 2)));
|
||||
_following = true;
|
||||
}
|
||||
else if (me->GetEntry() == NPC_LAKE_FROG_QUEST)
|
||||
|
||||
@@ -410,7 +410,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() + std::cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
|
||||
orphan->AI()->Talk(TEXT_WOLVAR_ORPHAN_6);
|
||||
timer = 5000;
|
||||
break;
|
||||
|
||||
@@ -247,7 +247,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() + (std::cos(_heading) * 10), me->GetPositionY() + (std::sin(_heading) * 10), me->GetPositionZ());
|
||||
me->DespawnOrUnsummon(5000);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -244,8 +244,8 @@ public:
|
||||
|
||||
if (me->GetAuraCount(SPELL_SHADE_SOUL_CHANNEL_2) <= 3)
|
||||
{
|
||||
moveSpeed = (2.0 - (0.6 * me->GetAuraCount(SPELL_SHADE_SOUL_CHANNEL_2)));
|
||||
me->SetSpeed(MOVE_WALK, moveSpeed / 2.5);
|
||||
moveSpeed = (2.0f - (0.6f * me->GetAuraCount(SPELL_SHADE_SOUL_CHANNEL_2)));
|
||||
me->SetSpeed(MOVE_WALK, moveSpeed / 2.5f);
|
||||
me->SetSpeed(MOVE_RUN, (moveSpeed * 2) / 7);
|
||||
me->ClearUnitState(UNIT_STATE_ROOT);
|
||||
}
|
||||
|
||||
+1
-1
@@ -278,7 +278,7 @@ public:
|
||||
if (me->IsWithinDistInMap(who, attackRadius))
|
||||
{
|
||||
// Check first that object is in an angle in front of this one before LoS check
|
||||
if (me->HasInArc(M_PI/2.0f, who) && me->IsWithinLOSInMap(who))
|
||||
if (me->HasInArc(float(M_PI) / 2.0f, who) && me->IsWithinLOSInMap(who))
|
||||
{
|
||||
AttackStart(who);
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ class boss_high_astromancer_solarian : public CreatureScript
|
||||
{
|
||||
float z = RAND(1.0f, -1.0f);
|
||||
|
||||
return (z*sqrt(radius*radius - (x - CENTER_X)*(x - CENTER_X)) + CENTER_Y);
|
||||
return (z*std::sqrt(radius*radius - (x - CENTER_X)*(x - CENTER_X)) + CENTER_Y);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
|
||||
@@ -179,7 +179,7 @@ class boss_warp_splinter : public CreatureScript
|
||||
{
|
||||
for (uint8 i = 0; i < 6; ++i)
|
||||
{
|
||||
float angle = (M_PI / 3) * i;
|
||||
float angle = (float(M_PI) / 3) * i;
|
||||
|
||||
float X = Treant_Spawn_Pos_X + TREANT_SPAWN_DIST * std::cos(angle);
|
||||
float Y = Treant_Spawn_Pos_Y + TREANT_SPAWN_DIST * std::sin(angle);
|
||||
|
||||
@@ -1601,7 +1601,7 @@ class spell_gen_gift_of_naaru : public SpellScriptLoader
|
||||
break;
|
||||
}
|
||||
|
||||
int32 healTick = floor(heal / aurEff->GetTotalTicks());
|
||||
int32 healTick = std::floor(heal / aurEff->GetTotalTicks());
|
||||
amount += int32(std::max(healTick, 0));
|
||||
}
|
||||
|
||||
|
||||
@@ -2456,7 +2456,7 @@ class spell_item_unusual_compass : public SpellScriptLoader
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
caster->SetFacingTo(frand(0.0f, 2.0f * M_PI));
|
||||
caster->SetFacingTo(frand(0.0f, 2.0f * float(M_PI)));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -2008,7 +2008,7 @@ class spell_q12308_escape_from_silverbrook_summon_worgen : public SpellScriptLoa
|
||||
void ModDest(SpellDestination& dest)
|
||||
{
|
||||
float dist = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster());
|
||||
float angle = frand(0.75f, 1.25f) * M_PI;
|
||||
float angle = frand(0.75f, 1.25f) * float(M_PI);
|
||||
|
||||
Position pos = GetCaster()->GetNearPosition(dist, angle);
|
||||
dest.Relocate(pos);
|
||||
|
||||
@@ -621,7 +621,7 @@ class spell_warr_retaliation : public SpellScriptLoader
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
// check attack comes not from behind and warrior is not stunned
|
||||
return GetTarget()->isInFront(eventInfo.GetProcTarget(), M_PI) && !GetTarget()->HasUnitState(UNIT_STATE_STUNNED);
|
||||
return GetTarget()->isInFront(eventInfo.GetActor(), float(M_PI)) && !GetTarget()->HasUnitState(UNIT_STATE_STUNNED);
|
||||
}
|
||||
|
||||
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
|
||||
@@ -2231,7 +2231,7 @@ public:
|
||||
if (GameObject* launcher = FindNearestLauncher())
|
||||
{
|
||||
launcher->SendCustomAnim(ANIM_GO_LAUNCH_FIREWORK);
|
||||
me->SetOrientation(launcher->GetOrientation() + M_PI/2);
|
||||
me->SetOrientation(launcher->GetOrientation() + float(M_PI) / 2);
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user