diff options
| author | Treeston <treeston.mmoc@gmail.com> | 2018-04-01 13:52:36 +0200 |
|---|---|---|
| committer | Treeston <treeston.mmoc@gmail.com> | 2018-04-01 13:52:36 +0200 |
| commit | 4692e10ca2ffed5ba2a0336e9c93962b0fad9eaa (patch) | |
| tree | a5324da18c6bec3aab267006c6da615918329510 /src/server/scripts | |
| parent | fb39980c52cdb28b9de43356ee37470c7fd6797c (diff) | |
Core/Position: Refactor GetAngle -> GetAbsoluteAngle because code clarity is good.
Diffstat (limited to 'src/server/scripts')
19 files changed, 26 insertions, 26 deletions
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index a0d4d886717..fb98d0a3304 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -458,7 +458,7 @@ public: float x, y, z; target->GetContactPoint(_player, x, y, z); - _player->TeleportTo(target->GetMapId(), x, y, z, _player->GetAngle(target), TELE_TO_GM_MODE); + _player->TeleportTo(target->GetMapId(), x, y, z, _player->GetAbsoluteAngle(target), TELE_TO_GM_MODE); _player->SetPhaseMask(target->GetPhaseMask(), true); } else diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index dd6faeabca7..02dc899c02a 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -1655,7 +1655,7 @@ public: Player* chr = handler->GetSession()->GetPlayer(); - float followAngle = (creature->GetAngle(chr) - chr->GetOrientation()) * 180.0f / float(M_PI); + float followAngle = (creature->GetAbsoluteAngle(chr) - chr->GetOrientation()) * 180.0f / float(M_PI); float followDist = std::sqrt(std::pow(chr->GetPositionX() - creature->GetPositionX(), 2.f) + std::pow(chr->GetPositionY() - creature->GetPositionY(), 2.f)); uint32 groupAI = 0; sFormationMgr->AddFormationMember(lowguid, followAngle, followDist, leaderGUID, groupAI); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp index 1eaf4005e7b..7a2e7cf09ca 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp @@ -361,7 +361,7 @@ public: break; } case 6: - me->SetFacingTo(me->GetAngle(breathX, breathY)); + me->SetFacingTo(me->GetAbsoluteAngle(breathX, breathY)); //DoTextEmote("takes a deep breath.", nullptr); events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 10000); break; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index 4d02a6d8f71..1b022b2c6f3 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -972,7 +972,7 @@ void hyjalAI::WaypointReached(uint32 waypointId, uint32 /*pathId*/) (*itr)->GetMotionMaster()->Initialize(); float range = 10; if (me->GetEntry() == THRALL)range = 20; - me->GetNearPoint(me, x, y, z, range, 0, me->GetAngle((*itr))); + me->GetNearPoint(me, x, y, z, range, 0, me->GetAbsoluteAngle((*itr))); (*itr)->GetMotionMaster()->MovePoint(0, x+irand(-5, 5), y+irand(-5, 5), me->GetPositionZ()); } } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index a897b845744..3066efeb80f 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -317,7 +317,7 @@ public: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { //Face our target - DarkGlareAngle = me->GetAngle(target); + DarkGlareAngle = me->GetAbsoluteAngle(target); DarkGlareTickTimer = 1000; DarkGlareTick = 0; ClockWise = RAND(true, false); diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp index 1d6eed64946..9451f123ee2 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp @@ -368,7 +368,7 @@ class npc_prince_taldaram_flame_sphere : public CreatureScript if (!sphereTarget) return; - float angle = me->GetAngle(sphereTarget) + angleOffset; + float angle = me->GetAbsoluteAngle(sphereTarget) + angleOffset; float x = me->GetPositionX() + distOffset * std::cos(angle); float y = me->GetPositionY() + distOffset * std::sin(angle); diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp index 969ca6cd63f..4c902435ba8 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp @@ -1029,7 +1029,7 @@ class npc_meteor_strike_initial : public CreatureScript Position const* ownerPos = halionAI->GetMeteorStrikePosition(); float randomAdjustment = frand(static_cast<float>(M_PI / 5.0f), static_cast<float>(M_PI / 2.0f)); float angle[4]; - angle[0] = me->GetAngle(ownerPos); + angle[0] = me->GetAbsoluteAngle(ownerPos); angle[1] = angle[0] + randomAdjustment; angle[2] = angle[0] + static_cast<float>(M_PI); angle[3] = angle[2] + randomAdjustment; diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index 1a78118b7c1..0f0047ef819 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -2790,7 +2790,7 @@ class spell_hor_evasion : public SpellScriptLoader if (pos.IsInDist2d(&home, 15.0f)) return; - float angle = pos.GetAngle(&home); + float angle = pos.GetAbsoluteAngle(&home); float dist = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster()); target->MovePosition(pos, dist, angle); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp index 9190216e2a5..b4017d47908 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -647,7 +647,7 @@ class boss_prince_keleseth_icc : public CreatureScript summons.Summon(summon); Position pos = me->GetPosition(); float maxRange = me->GetDistance2d(summon); - float angle = me->GetAngle(summon); + float angle = me->GetAbsoluteAngle(summon); me->MovePositionToFirstCollision(pos, maxRange, angle); summon->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation()); summon->ToTempSummon()->SetTempSummonType(TEMPSUMMON_CORPSE_DESPAWN); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index e13d6fc5bd7..7830e96c29b 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -379,7 +379,7 @@ class npc_coldflame : public CreatureScript if (owner->HasAura(SPELL_BONE_STORM)) { - float ang = Position::NormalizeOrientation(pos.GetAngle(me)); + float ang = pos.GetAbsoluteAngle(me); me->SetOrientation(ang); owner->GetNearPoint2D(pos.m_positionX, pos.m_positionY, 5.0f - owner->GetCombatReach(), ang); } @@ -392,7 +392,7 @@ class npc_coldflame : public CreatureScript return; } - float ang = Position::NormalizeOrientation(pos.GetAngle(target)); + float ang = pos.GetAbsoluteAngle(target); me->SetOrientation(ang); owner->GetNearPoint2D(pos.m_positionX, pos.m_positionY, 15.0f - owner->GetCombatReach(), ang); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 6352fb71b8d..7353486e186 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -1715,7 +1715,7 @@ class npc_strangulate_vehicle : public CreatureScript { if (me->GetExactDist(lichKing) > 10.0f) { - Position pos = lichKing->GetNearPosition(float(rand_norm()) * 5.0f + 7.5f, lichKing->GetAngle(me)); + Position pos = lichKing->GetNearPosition(float(rand_norm()) * 5.0f + 7.5f, lichKing->GetAbsoluteAngle(me)); me->GetMotionMaster()->MovePoint(0, pos); } } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index fa0015c02d2..d9c1c8e1128 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -1290,7 +1290,7 @@ struct npc_argent_captainAI : public ScriptedAI if (Creature* crok = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_CROK_SCOURGEBANE))) { me->SetReactState(REACT_DEFENSIVE); - FollowAngle = me->GetAngle(crok) + me->GetOrientation(); + FollowAngle = me->GetAbsoluteAngle(crok) + me->GetOrientation(); FollowDist = me->GetDistance2d(crok); me->GetMotionMaster()->MoveFollow(crok, FollowDist, FollowAngle, MOTION_SLOT_IDLE); } diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 0d4dd46ed99..72acb22914a 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -464,7 +464,7 @@ public: { Position pos; pos.m_positionZ = alexstraszaBunny->GetPositionZ(); - alexstraszaBunny->GetNearPoint2D(pos.m_positionX, pos.m_positionY, 30.0f, alexstraszaBunny->GetAngle(me)); + alexstraszaBunny->GetNearPoint2D(pos.m_positionX, pos.m_positionY, 30.0f, alexstraszaBunny->GetAbsoluteAngle(me)); me->GetMotionMaster()->MoveLand(POINT_LAND_P_ONE, pos); me->SetImmuneToAll(false); me->SetReactState(REACT_AGGRESSIVE); @@ -847,7 +847,7 @@ public: Position randomPosOnRadius; // Hardcodded retail value, reason is Z getters can fail... (TO DO: Change to getter when height calculation works on 100%!) randomPosOnRadius.m_positionZ = 283.0521f; - alexstraszaBunny->GetNearPoint2D(randomPosOnRadius.m_positionX, randomPosOnRadius.m_positionY, 120.0f, alexstraszaBunny->GetAngle(me)); + alexstraszaBunny->GetNearPoint2D(randomPosOnRadius.m_positionX, randomPosOnRadius.m_positionY, 120.0f, alexstraszaBunny->GetAbsoluteAngle(me)); me->GetMotionMaster()->MovePoint(POINT_FLY_OUT_OF_PLATFORM_P_TWO, randomPosOnRadius); _flyingOutOfPlatform = true; } @@ -1673,7 +1673,7 @@ class spell_malygos_random_portal : public SpellScriptLoader { Position pos; pos.m_positionZ = target->GetPositionZ(); - target->GetNearPoint2D(pos.m_positionX, pos.m_positionY, frand(29.1f, 30.0f), target->GetAngle(malygos)); + target->GetNearPoint2D(pos.m_positionX, pos.m_positionY, frand(29.1f, 30.0f), target->GetAbsoluteAngle(malygos)); malygos->GetMotionMaster()->MovePoint(POINT_NEAR_RANDOM_PORTAL_P_NONE, pos); } } diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp index 4f72c6b80b6..f28253d6504 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp @@ -336,7 +336,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 angle = varos->GetAbsoluteAngle((*itr)->GetPositionX(), (*itr)->GetPositionY()); float diff = std::fabs(orientation - angle); if (diff > 1.0f) @@ -380,7 +380,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 angle = varos->GetAbsoluteAngle((*itr)->GetPositionX(), (*itr)->GetPositionY()); float diff = std::fabs(orientation - angle); if (diff > 1.0f) diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index 237e0ae6ef0..32ace5b6b0e 100644 --- a/src/server/scripts/Northrend/zone_icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp @@ -751,7 +751,7 @@ class npc_frostbrood_skytalon : public CreatureScript { Position randomPosOnRadius; randomPosOnRadius.m_positionZ = (me->GetPositionZ() + 40.0f); - me->GetNearPoint2D(randomPosOnRadius.m_positionX, randomPosOnRadius.m_positionY, 40.0f, me->GetAngle(me)); + me->GetNearPoint2D(randomPosOnRadius.m_positionX, randomPosOnRadius.m_positionY, 40.0f, me->GetAbsoluteAngle(me)); me->GetMotionMaster()->MovePoint(POINT_FLY_AWAY, randomPosOnRadius); } } diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 9a619f742f0..fc7343b8afc 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -885,7 +885,7 @@ struct boss_illidan_stormrage : public BossAI } case EVENT_FACE_MIDDLE: { - float angle = me->GetAngle(IllidanMiddlePoint); + float angle = me->GetAbsoluteAngle(IllidanMiddlePoint); me->SetFacingTo(angle); break; } diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp index 047ba40bd9f..cd42bf0bb37 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp @@ -195,7 +195,7 @@ class boss_warp_splinter : public CreatureScript float X = Treant_Spawn_Pos_X + TREANT_SPAWN_DIST * std::cos(angle); float Y = Treant_Spawn_Pos_Y + TREANT_SPAWN_DIST * std::sin(angle); - float O = - me->GetAngle(X, Y); + float O = - me->GetAbsoluteAngle(X, Y); if (Creature* pTreant = me->SummonCreature(CREATURE_TREANT, treant_pos[i][0], treant_pos[i][1], treant_pos[i][2], O, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000)) ENSURE_AI(npc_warp_splinter_treant::npc_warp_splinter_treantAI, pTreant->AI())->WarpGuid = me->GetGUID(); diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 45dec0da218..55ad8288099 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -310,7 +310,7 @@ public: me->UseDoorOrButton(); int Random = rand32() % (sizeof(NpcPrisonEntry) / sizeof(uint32)); - if (Creature* creature = player->SummonCreature(NpcPrisonEntry[Random], me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetAngle(player), + if (Creature* creature = player->SummonCreature(NpcPrisonEntry[Random], me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetAbsoluteAngle(player), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) { if (!creature->IsHostileTo(player)) @@ -370,7 +370,7 @@ public: me->UseDoorOrButton(); int Random = rand32() % (sizeof(NpcStasisEntry) / sizeof(uint32)); - player->SummonCreature(NpcStasisEntry[Random], me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetAngle(player), + player->SummonCreature(NpcStasisEntry[Random], me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetAbsoluteAngle(player), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); return false; @@ -1328,8 +1328,8 @@ public: bool GossipHello(Player* player) override { player->SendLoot(me->GetGUID(), LOOT_CORPSE); - me->SummonCreature(NPC_HIVE_AMBUSHER, me->GetPositionX() + 1, me->GetPositionY(), me->GetPositionZ(), me->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); - me->SummonCreature(NPC_HIVE_AMBUSHER, me->GetPositionX(), me->GetPositionY() + 1, me->GetPositionZ(), me->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); + me->SummonCreature(NPC_HIVE_AMBUSHER, me->GetPositionX() + 1, me->GetPositionY(), me->GetPositionZ(), me->GetAbsoluteAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); + me->SummonCreature(NPC_HIVE_AMBUSHER, me->GetPositionX(), me->GetPositionY() + 1, me->GetPositionZ(), me->GetAbsoluteAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); return true; } }; diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 1a8a5e97738..412ec4a3a84 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -2586,7 +2586,7 @@ class npc_train_wrecker : public CreatureScript _isSearching = false; _target = target->GetGUID(); me->SetWalk(true); - me->GetMotionMaster()->MovePoint(MOVEID_CHASE, target->GetNearPosition(3.0f, target->GetAngle(me))); + me->GetMotionMaster()->MovePoint(MOVEID_CHASE, target->GetNearPosition(3.0f, target->GetAbsoluteAngle(me))); } else _timer = 3 * IN_MILLISECONDS; |
