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
@@ -377,14 +377,14 @@ bool BattlegroundAB::SetupBattleground()
{ {
for (uint32 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i) for (uint32 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
{ {
AddObject(BG_AB_OBJECT_BANNER_NEUTRAL + BG_AB_OBJECTS_PER_NODE * i, BG_AB_OBJECTID_NODE_BANNER_0 + i, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3] / 2), cos(BG_AB_NodePositions[i][3] / 2), RESPAWN_ONE_DAY); AddObject(BG_AB_OBJECT_BANNER_NEUTRAL + BG_AB_OBJECTS_PER_NODE * i, BG_AB_OBJECTID_NODE_BANNER_0 + i, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, std::sin(BG_AB_NodePositions[i][3] / 2), cos(BG_AB_NodePositions[i][3] / 2), RESPAWN_ONE_DAY);
AddObject(BG_AB_OBJECT_BANNER_ALLY + BG_AB_OBJECTS_PER_NODE * i, BG_AB_OBJECTID_BANNER_A, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3] / 2), cos(BG_AB_NodePositions[i][3] / 2), RESPAWN_ONE_DAY); AddObject(BG_AB_OBJECT_BANNER_ALLY + BG_AB_OBJECTS_PER_NODE * i, BG_AB_OBJECTID_BANNER_A, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, std::sin(BG_AB_NodePositions[i][3] / 2), cos(BG_AB_NodePositions[i][3] / 2), RESPAWN_ONE_DAY);
AddObject(BG_AB_OBJECT_BANNER_HORDE + BG_AB_OBJECTS_PER_NODE * i, BG_AB_OBJECTID_BANNER_H, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3] / 2), cos(BG_AB_NodePositions[i][3] / 2), RESPAWN_ONE_DAY); AddObject(BG_AB_OBJECT_BANNER_HORDE + BG_AB_OBJECTS_PER_NODE * i, BG_AB_OBJECTID_BANNER_H, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, std::sin(BG_AB_NodePositions[i][3] / 2), cos(BG_AB_NodePositions[i][3] / 2), RESPAWN_ONE_DAY);
AddObject(BG_AB_OBJECT_BANNER_CONT_A + BG_AB_OBJECTS_PER_NODE * i, BG_AB_OBJECTID_BANNER_CONT_A, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3] / 2), cos(BG_AB_NodePositions[i][3] / 2), RESPAWN_ONE_DAY); AddObject(BG_AB_OBJECT_BANNER_CONT_A + BG_AB_OBJECTS_PER_NODE * i, BG_AB_OBJECTID_BANNER_CONT_A, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, std::sin(BG_AB_NodePositions[i][3] / 2), cos(BG_AB_NodePositions[i][3] / 2), RESPAWN_ONE_DAY);
AddObject(BG_AB_OBJECT_BANNER_CONT_H + BG_AB_OBJECTS_PER_NODE * i, BG_AB_OBJECTID_BANNER_CONT_H, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3] / 2), cos(BG_AB_NodePositions[i][3] / 2), RESPAWN_ONE_DAY); AddObject(BG_AB_OBJECT_BANNER_CONT_H + BG_AB_OBJECTS_PER_NODE * i, BG_AB_OBJECTID_BANNER_CONT_H, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, std::sin(BG_AB_NodePositions[i][3] / 2), cos(BG_AB_NodePositions[i][3] / 2), RESPAWN_ONE_DAY);
AddObject(BG_AB_OBJECT_AURA_ALLY + BG_AB_OBJECTS_PER_NODE * i, BG_AB_OBJECTID_AURA_A, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3] / 2), cos(BG_AB_NodePositions[i][3] / 2), RESPAWN_ONE_DAY); AddObject(BG_AB_OBJECT_AURA_ALLY + BG_AB_OBJECTS_PER_NODE * i, BG_AB_OBJECTID_AURA_A, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, std::sin(BG_AB_NodePositions[i][3] / 2), cos(BG_AB_NodePositions[i][3] / 2), RESPAWN_ONE_DAY);
AddObject(BG_AB_OBJECT_AURA_HORDE + BG_AB_OBJECTS_PER_NODE * i, BG_AB_OBJECTID_AURA_H, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3] / 2), cos(BG_AB_NodePositions[i][3] / 2), RESPAWN_ONE_DAY); AddObject(BG_AB_OBJECT_AURA_HORDE + BG_AB_OBJECTS_PER_NODE * i, BG_AB_OBJECTID_AURA_H, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, std::sin(BG_AB_NodePositions[i][3] / 2), cos(BG_AB_NodePositions[i][3] / 2), RESPAWN_ONE_DAY);
AddObject(BG_AB_OBJECT_AURA_CONTESTED + BG_AB_OBJECTS_PER_NODE * i, BG_AB_OBJECTID_AURA_C, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3] / 2), cos(BG_AB_NodePositions[i][3] / 2), RESPAWN_ONE_DAY); AddObject(BG_AB_OBJECT_AURA_CONTESTED + BG_AB_OBJECTS_PER_NODE * i, BG_AB_OBJECTID_AURA_C, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, std::sin(BG_AB_NodePositions[i][3] / 2), cos(BG_AB_NodePositions[i][3] / 2), RESPAWN_ONE_DAY);
} }
AddObject(BG_AB_OBJECT_GATE_A, BG_AB_OBJECTID_GATE_A, BG_AB_DoorPositions[0][0], BG_AB_DoorPositions[0][1], BG_AB_DoorPositions[0][2], BG_AB_DoorPositions[0][3], BG_AB_DoorPositions[0][4], BG_AB_DoorPositions[0][5], BG_AB_DoorPositions[0][6], BG_AB_DoorPositions[0][7], RESPAWN_IMMEDIATELY); AddObject(BG_AB_OBJECT_GATE_A, BG_AB_OBJECTID_GATE_A, BG_AB_DoorPositions[0][0], BG_AB_DoorPositions[0][1], BG_AB_DoorPositions[0][2], BG_AB_DoorPositions[0][3], BG_AB_DoorPositions[0][4], BG_AB_DoorPositions[0][5], BG_AB_DoorPositions[0][6], BG_AB_DoorPositions[0][7], RESPAWN_IMMEDIATELY);
@@ -392,9 +392,9 @@ bool BattlegroundAB::SetupBattleground()
for (uint32 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i) for (uint32 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
{ {
AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i, Buff_Entries[0], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, sin(BG_AB_BuffPositions[i][3] / 2), cos(BG_AB_BuffPositions[i][3] / 2), RESPAWN_ONE_DAY); AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i, Buff_Entries[0], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, std::sin(BG_AB_BuffPositions[i][3] / 2), cos(BG_AB_BuffPositions[i][3] / 2), RESPAWN_ONE_DAY);
AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i + 1, Buff_Entries[1], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, sin(BG_AB_BuffPositions[i][3] / 2), cos(BG_AB_BuffPositions[i][3] / 2), RESPAWN_ONE_DAY); AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i + 1, Buff_Entries[1], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, std::sin(BG_AB_BuffPositions[i][3] / 2), cos(BG_AB_BuffPositions[i][3] / 2), RESPAWN_ONE_DAY);
AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i + 2, Buff_Entries[2], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, sin(BG_AB_BuffPositions[i][3] / 2), cos(BG_AB_BuffPositions[i][3] / 2), RESPAWN_ONE_DAY); AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i + 2, Buff_Entries[2], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, std::sin(BG_AB_BuffPositions[i][3] / 2), cos(BG_AB_BuffPositions[i][3] / 2), RESPAWN_ONE_DAY);
} }
AddSpiritGuide(BG_AB_SPIRIT_ALIANCE, BG_AB_SpiritGuidePos[BG_AB_SPIRIT_ALIANCE][0], BG_AB_SpiritGuidePos[BG_AB_SPIRIT_ALIANCE][1], BG_AB_SpiritGuidePos[BG_AB_SPIRIT_ALIANCE][2], BG_AB_SpiritGuidePos[BG_AB_SPIRIT_ALIANCE][3], TEAM_ALLIANCE); AddSpiritGuide(BG_AB_SPIRIT_ALIANCE, BG_AB_SpiritGuidePos[BG_AB_SPIRIT_ALIANCE][0], BG_AB_SpiritGuidePos[BG_AB_SPIRIT_ALIANCE][1], BG_AB_SpiritGuidePos[BG_AB_SPIRIT_ALIANCE][2], BG_AB_SpiritGuidePos[BG_AB_SPIRIT_ALIANCE][3], TEAM_ALLIANCE);
@@ -1212,14 +1212,14 @@ bool BattlegroundAV::SetupBattleground()
{ {
if (i <= BG_AV_NODES_FROSTWOLF_HUT) if (i <= BG_AV_NODES_FROSTWOLF_HUT)
{ {
if (!AddObject(i, BG_AV_OBJECTID_BANNER_A_B, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3] / 2), cos(BG_AV_ObjectPos[i][3] / 2), RESPAWN_ONE_DAY) if (!AddObject(i, BG_AV_OBJECTID_BANNER_A_B, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, std::sin(BG_AV_ObjectPos[i][3] / 2), cos(BG_AV_ObjectPos[i][3] / 2), RESPAWN_ONE_DAY)
|| !AddObject(i + 11, BG_AV_OBJECTID_BANNER_CONT_A_B, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3] / 2), cos(BG_AV_ObjectPos[i][3] / 2), RESPAWN_ONE_DAY) || !AddObject(i + 11, BG_AV_OBJECTID_BANNER_CONT_A_B, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, std::sin(BG_AV_ObjectPos[i][3] / 2), cos(BG_AV_ObjectPos[i][3] / 2), RESPAWN_ONE_DAY)
|| !AddObject(i + 33, BG_AV_OBJECTID_BANNER_H_B, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3] / 2), cos(BG_AV_ObjectPos[i][3] / 2), RESPAWN_ONE_DAY) || !AddObject(i + 33, BG_AV_OBJECTID_BANNER_H_B, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, std::sin(BG_AV_ObjectPos[i][3] / 2), cos(BG_AV_ObjectPos[i][3] / 2), RESPAWN_ONE_DAY)
|| !AddObject(i + 22, BG_AV_OBJECTID_BANNER_CONT_H_B, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3] / 2), cos(BG_AV_ObjectPos[i][3] / 2), RESPAWN_ONE_DAY) || !AddObject(i + 22, BG_AV_OBJECTID_BANNER_CONT_H_B, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, std::sin(BG_AV_ObjectPos[i][3] / 2), cos(BG_AV_ObjectPos[i][3] / 2), RESPAWN_ONE_DAY)
//aura //aura
|| !AddObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION + i * 3, BG_AV_OBJECTID_AURA_N, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3] / 2), cos(BG_AV_ObjectPos[i][3] / 2), RESPAWN_ONE_DAY) || !AddObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION + i * 3, BG_AV_OBJECTID_AURA_N, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, std::sin(BG_AV_ObjectPos[i][3] / 2), cos(BG_AV_ObjectPos[i][3] / 2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION + i * 3, BG_AV_OBJECTID_AURA_A, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3] / 2), cos(BG_AV_ObjectPos[i][3] / 2), RESPAWN_ONE_DAY) || !AddObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION + i * 3, BG_AV_OBJECTID_AURA_A, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, std::sin(BG_AV_ObjectPos[i][3] / 2), cos(BG_AV_ObjectPos[i][3] / 2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_AURA_H_FIRSTAID_STATION + i * 3, BG_AV_OBJECTID_AURA_H, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3] / 2), cos(BG_AV_ObjectPos[i][3] / 2), RESPAWN_ONE_DAY)) || !AddObject(BG_AV_OBJECT_AURA_H_FIRSTAID_STATION + i * 3, BG_AV_OBJECTID_AURA_H, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, std::sin(BG_AV_ObjectPos[i][3] / 2), cos(BG_AV_ObjectPos[i][3] / 2), RESPAWN_ONE_DAY))
{ {
LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!2"); LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!2");
return false; return false;
@@ -1229,12 +1229,12 @@ bool BattlegroundAV::SetupBattleground()
{ {
if (i <= BG_AV_NODES_STONEHEART_BUNKER) //alliance towers if (i <= BG_AV_NODES_STONEHEART_BUNKER) //alliance towers
{ {
if (!AddObject(i, BG_AV_OBJECTID_BANNER_A, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3] / 2), cos(BG_AV_ObjectPos[i][3] / 2), RESPAWN_ONE_DAY) if (!AddObject(i, BG_AV_OBJECTID_BANNER_A, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, std::sin(BG_AV_ObjectPos[i][3] / 2), cos(BG_AV_ObjectPos[i][3] / 2), RESPAWN_ONE_DAY)
|| !AddObject(i + 22, BG_AV_OBJECTID_BANNER_CONT_H, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3] / 2), cos(BG_AV_ObjectPos[i][3] / 2), RESPAWN_ONE_DAY) || !AddObject(i + 22, BG_AV_OBJECTID_BANNER_CONT_H, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, std::sin(BG_AV_ObjectPos[i][3] / 2), cos(BG_AV_ObjectPos[i][3] / 2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH + (2 * (i - BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_AURA_A, BG_AV_ObjectPos[i + 8][0], BG_AV_ObjectPos[i + 8][1], BG_AV_ObjectPos[i + 8][2], BG_AV_ObjectPos[i + 8][3], 0, 0, sin(BG_AV_ObjectPos[i + 8][3] / 2), cos(BG_AV_ObjectPos[i + 8][3] / 2), RESPAWN_ONE_DAY) || !AddObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH + (2 * (i - BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_AURA_A, BG_AV_ObjectPos[i + 8][0], BG_AV_ObjectPos[i + 8][1], BG_AV_ObjectPos[i + 8][2], BG_AV_ObjectPos[i + 8][3], 0, 0, std::sin(BG_AV_ObjectPos[i + 8][3] / 2), cos(BG_AV_ObjectPos[i + 8][3] / 2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TAURA_H_DUNBALDAR_SOUTH + (2 * (i - BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_AURA_N, BG_AV_ObjectPos[i + 8][0], BG_AV_ObjectPos[i + 8][1], BG_AV_ObjectPos[i + 8][2], BG_AV_ObjectPos[i + 8][3], 0, 0, sin(BG_AV_ObjectPos[i + 8][3] / 2), cos(BG_AV_ObjectPos[i + 8][3] / 2), RESPAWN_ONE_DAY) || !AddObject(BG_AV_OBJECT_TAURA_H_DUNBALDAR_SOUTH + (2 * (i - BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_AURA_N, BG_AV_ObjectPos[i + 8][0], BG_AV_ObjectPos[i + 8][1], BG_AV_ObjectPos[i + 8][2], BG_AV_ObjectPos[i + 8][3], 0, 0, std::sin(BG_AV_ObjectPos[i + 8][3] / 2), cos(BG_AV_ObjectPos[i + 8][3] / 2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH + (2 * (i - BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_A, BG_AV_ObjectPos[i + 8][0], BG_AV_ObjectPos[i + 8][1], BG_AV_ObjectPos[i + 8][2], BG_AV_ObjectPos[i + 8][3], 0, 0, sin(BG_AV_ObjectPos[i + 8][3] / 2), cos(BG_AV_ObjectPos[i + 8][3] / 2), RESPAWN_ONE_DAY) || !AddObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH + (2 * (i - BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_A, BG_AV_ObjectPos[i + 8][0], BG_AV_ObjectPos[i + 8][1], BG_AV_ObjectPos[i + 8][2], BG_AV_ObjectPos[i + 8][3], 0, 0, std::sin(BG_AV_ObjectPos[i + 8][3] / 2), cos(BG_AV_ObjectPos[i + 8][3] / 2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH + (2 * (i - BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_PH, BG_AV_ObjectPos[i + 8][0], BG_AV_ObjectPos[i + 8][1], BG_AV_ObjectPos[i + 8][2], BG_AV_ObjectPos[i + 8][3], 0, 0, sin(BG_AV_ObjectPos[i + 8][3] / 2), cos(BG_AV_ObjectPos[i + 8][3] / 2), RESPAWN_ONE_DAY)) || !AddObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH + (2 * (i - BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_PH, BG_AV_ObjectPos[i + 8][0], BG_AV_ObjectPos[i + 8][1], BG_AV_ObjectPos[i + 8][2], BG_AV_ObjectPos[i + 8][3], 0, 0, std::sin(BG_AV_ObjectPos[i + 8][3] / 2), cos(BG_AV_ObjectPos[i + 8][3] / 2), RESPAWN_ONE_DAY))
{ {
LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!3"); LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!3");
return false; return false;
@@ -1242,12 +1242,12 @@ bool BattlegroundAV::SetupBattleground()
} }
else //horde towers else //horde towers
{ {
if (!AddObject(i + 7, BG_AV_OBJECTID_BANNER_CONT_A, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3] / 2), cos(BG_AV_ObjectPos[i][3] / 2), RESPAWN_ONE_DAY) if (!AddObject(i + 7, BG_AV_OBJECTID_BANNER_CONT_A, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, std::sin(BG_AV_ObjectPos[i][3] / 2), cos(BG_AV_ObjectPos[i][3] / 2), RESPAWN_ONE_DAY)
|| !AddObject(i + 29, BG_AV_OBJECTID_BANNER_H, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3] / 2), cos(BG_AV_ObjectPos[i][3] / 2), RESPAWN_ONE_DAY) || !AddObject(i + 29, BG_AV_OBJECTID_BANNER_H, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, std::sin(BG_AV_ObjectPos[i][3] / 2), cos(BG_AV_ObjectPos[i][3] / 2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH + (2 * (i - BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_AURA_N, BG_AV_ObjectPos[i + 8][0], BG_AV_ObjectPos[i + 8][1], BG_AV_ObjectPos[i + 8][2], BG_AV_ObjectPos[i + 8][3], 0, 0, sin(BG_AV_ObjectPos[i + 8][3] / 2), cos(BG_AV_ObjectPos[i + 8][3] / 2), RESPAWN_ONE_DAY) || !AddObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH + (2 * (i - BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_AURA_N, BG_AV_ObjectPos[i + 8][0], BG_AV_ObjectPos[i + 8][1], BG_AV_ObjectPos[i + 8][2], BG_AV_ObjectPos[i + 8][3], 0, 0, std::sin(BG_AV_ObjectPos[i + 8][3] / 2), cos(BG_AV_ObjectPos[i + 8][3] / 2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TAURA_H_DUNBALDAR_SOUTH + (2 * (i - BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_AURA_H, BG_AV_ObjectPos[i + 8][0], BG_AV_ObjectPos[i + 8][1], BG_AV_ObjectPos[i + 8][2], BG_AV_ObjectPos[i + 8][3], 0, 0, sin(BG_AV_ObjectPos[i + 8][3] / 2), cos(BG_AV_ObjectPos[i + 8][3] / 2), RESPAWN_ONE_DAY) || !AddObject(BG_AV_OBJECT_TAURA_H_DUNBALDAR_SOUTH + (2 * (i - BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_AURA_H, BG_AV_ObjectPos[i + 8][0], BG_AV_ObjectPos[i + 8][1], BG_AV_ObjectPos[i + 8][2], BG_AV_ObjectPos[i + 8][3], 0, 0, std::sin(BG_AV_ObjectPos[i + 8][3] / 2), cos(BG_AV_ObjectPos[i + 8][3] / 2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH + (2 * (i - BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_PA, BG_AV_ObjectPos[i + 8][0], BG_AV_ObjectPos[i + 8][1], BG_AV_ObjectPos[i + 8][2], BG_AV_ObjectPos[i + 8][3], 0, 0, sin(BG_AV_ObjectPos[i + 8][3] / 2), cos(BG_AV_ObjectPos[i + 8][3] / 2), RESPAWN_ONE_DAY) || !AddObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH + (2 * (i - BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_PA, BG_AV_ObjectPos[i + 8][0], BG_AV_ObjectPos[i + 8][1], BG_AV_ObjectPos[i + 8][2], BG_AV_ObjectPos[i + 8][3], 0, 0, std::sin(BG_AV_ObjectPos[i + 8][3] / 2), cos(BG_AV_ObjectPos[i + 8][3] / 2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH + (2 * (i - BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_H, BG_AV_ObjectPos[i + 8][0], BG_AV_ObjectPos[i + 8][1], BG_AV_ObjectPos[i + 8][2], BG_AV_ObjectPos[i + 8][3], 0, 0, sin(BG_AV_ObjectPos[i + 8][3] / 2), cos(BG_AV_ObjectPos[i + 8][3] / 2), RESPAWN_ONE_DAY)) || !AddObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH + (2 * (i - BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_H, BG_AV_ObjectPos[i + 8][0], BG_AV_ObjectPos[i + 8][1], BG_AV_ObjectPos[i + 8][2], BG_AV_ObjectPos[i + 8][3], 0, 0, std::sin(BG_AV_ObjectPos[i + 8][3] / 2), cos(BG_AV_ObjectPos[i + 8][3] / 2), RESPAWN_ONE_DAY))
{ {
LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!4"); LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!4");
return false; return false;
@@ -1255,7 +1255,7 @@ bool BattlegroundAV::SetupBattleground()
} }
for (uint8 j = 0; j <= 9; j++) //burning aura for (uint8 j = 0; j <= 9; j++) //burning aura
{ {
if (!AddObject(BG_AV_OBJECT_BURN_DUNBALDAR_SOUTH + ((i - BG_AV_NODES_DUNBALDAR_SOUTH) * 10) + j, BG_AV_OBJECTID_FIRE, BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH + ((i - BG_AV_NODES_DUNBALDAR_SOUTH) * 10) + j][0], BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH + ((i - BG_AV_NODES_DUNBALDAR_SOUTH) * 10) + j][1], BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH + ((i - BG_AV_NODES_DUNBALDAR_SOUTH) * 10) + j][2], BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH + ((i - BG_AV_NODES_DUNBALDAR_SOUTH) * 10) + j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH + ((i - BG_AV_NODES_DUNBALDAR_SOUTH) * 10) + j][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH + ((i - BG_AV_NODES_DUNBALDAR_SOUTH) * 10) + j][3] / 2), RESPAWN_ONE_DAY)) if (!AddObject(BG_AV_OBJECT_BURN_DUNBALDAR_SOUTH + ((i - BG_AV_NODES_DUNBALDAR_SOUTH) * 10) + j, BG_AV_OBJECTID_FIRE, BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH + ((i - BG_AV_NODES_DUNBALDAR_SOUTH) * 10) + j][0], BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH + ((i - BG_AV_NODES_DUNBALDAR_SOUTH) * 10) + j][1], BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH + ((i - BG_AV_NODES_DUNBALDAR_SOUTH) * 10) + j][2], BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH + ((i - BG_AV_NODES_DUNBALDAR_SOUTH) * 10) + j][3], 0, 0, std::sin(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH + ((i - BG_AV_NODES_DUNBALDAR_SOUTH) * 10) + j][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH + ((i - BG_AV_NODES_DUNBALDAR_SOUTH) * 10) + j][3] / 2), RESPAWN_ONE_DAY))
{ {
LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!5.%i", i); LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!5.%i", i);
return false; return false;
@@ -1269,7 +1269,7 @@ bool BattlegroundAV::SetupBattleground()
{ {
if (j < 5) if (j < 5)
{ {
if (!AddObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE + (i * 10) + j, BG_AV_OBJECTID_SMOKE, BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][0], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][1], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][2], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][3] / 2), RESPAWN_ONE_DAY)) if (!AddObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE + (i * 10) + j, BG_AV_OBJECTID_SMOKE, BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][0], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][1], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][2], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][3], 0, 0, std::sin(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][3] / 2), RESPAWN_ONE_DAY))
{ {
LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!6.%i", i); LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!6.%i", i);
return false; return false;
@@ -1277,7 +1277,7 @@ bool BattlegroundAV::SetupBattleground()
} }
else else
{ {
if (!AddObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE + (i * 10) + j, BG_AV_OBJECTID_FIRE, BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][0], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][1], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][2], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][3] / 2), RESPAWN_ONE_DAY)) if (!AddObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE + (i * 10) + j, BG_AV_OBJECTID_FIRE, BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][0], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][1], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][2], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][3], 0, 0, std::sin(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A + (i * 10) + j][3] / 2), RESPAWN_ONE_DAY))
{ {
LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!7.%i", i); LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!7.%i", i);
return false; return false;
@@ -1287,7 +1287,7 @@ bool BattlegroundAV::SetupBattleground()
} }
for (uint16 i = 0; i <= (BG_AV_OBJECT_MINE_SUPPLY_N_MAX - BG_AV_OBJECT_MINE_SUPPLY_N_MIN); i++) for (uint16 i = 0; i <= (BG_AV_OBJECT_MINE_SUPPLY_N_MAX - BG_AV_OBJECT_MINE_SUPPLY_N_MIN); i++)
{ {
if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_N_MIN + i, BG_AV_OBJECTID_MINE_N, BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN + i][0], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN + i][1], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN + i][2], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN + i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN + i][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN + i][3] / 2), RESPAWN_ONE_DAY)) if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_N_MIN + i, BG_AV_OBJECTID_MINE_N, BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN + i][0], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN + i][1], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN + i][2], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN + i][3], 0, 0, std::sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN + i][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN + i][3] / 2), RESPAWN_ONE_DAY))
{ {
LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.5.%i", i); LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.5.%i", i);
return false; return false;
@@ -1295,24 +1295,24 @@ bool BattlegroundAV::SetupBattleground()
} }
for (uint16 i = 0; i <= (BG_AV_OBJECT_MINE_SUPPLY_S_MAX - BG_AV_OBJECT_MINE_SUPPLY_S_MIN); i++) for (uint16 i = 0; i <= (BG_AV_OBJECT_MINE_SUPPLY_S_MAX - BG_AV_OBJECT_MINE_SUPPLY_S_MIN); i++)
{ {
if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_S_MIN + i, BG_AV_OBJECTID_MINE_S, BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN + i][0], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN + i][1], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN + i][2], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN + i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN + i][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN + i][3] / 2), RESPAWN_ONE_DAY)) if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_S_MIN + i, BG_AV_OBJECTID_MINE_S, BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN + i][0], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN + i][1], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN + i][2], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN + i][3], 0, 0, std::sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN + i][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN + i][3] / 2), RESPAWN_ONE_DAY))
{ {
LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.6.%i", i); LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.6.%i", i);
return false; return false;
} }
} }
if (!AddObject(BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE, BG_AV_OBJECTID_BANNER_SNOWFALL_N, BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][0], BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][1], BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][2], BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3], 0, 0, sin(BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3] / 2), cos(BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3] / 2), RESPAWN_ONE_DAY)) if (!AddObject(BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE, BG_AV_OBJECTID_BANNER_SNOWFALL_N, BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][0], BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][1], BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][2], BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3], 0, 0, std::sin(BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3] / 2), cos(BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3] / 2), RESPAWN_ONE_DAY))
{ {
LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!8"); LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!8");
return false; return false;
} }
for (uint8 i = 0; i < 4; i++) for (uint8 i = 0; i < 4; i++)
{ {
if (!AddObject(BG_AV_OBJECT_SNOW_EYECANDY_A + i, BG_AV_OBJECTID_SNOWFALL_CANDY_A, BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][0], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][1], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][2], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3] / 2), RESPAWN_ONE_DAY) if (!AddObject(BG_AV_OBJECT_SNOW_EYECANDY_A + i, BG_AV_OBJECTID_SNOWFALL_CANDY_A, BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][0], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][1], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][2], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3], 0, 0, std::sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3] / 2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_PA + i, BG_AV_OBJECTID_SNOWFALL_CANDY_PA, BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][0], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][1], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][2], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3] / 2), RESPAWN_ONE_DAY) || !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_PA + i, BG_AV_OBJECTID_SNOWFALL_CANDY_PA, BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][0], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][1], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][2], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3], 0, 0, std::sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3] / 2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_H + i, BG_AV_OBJECTID_SNOWFALL_CANDY_H, BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][0], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][1], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][2], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3] / 2), RESPAWN_ONE_DAY) || !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_H + i, BG_AV_OBJECTID_SNOWFALL_CANDY_H, BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][0], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][1], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][2], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3], 0, 0, std::sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3] / 2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_PH + i, BG_AV_OBJECTID_SNOWFALL_CANDY_PH, BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][0], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][1], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][2], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3] / 2), RESPAWN_ONE_DAY)) || !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_PH + i, BG_AV_OBJECTID_SNOWFALL_CANDY_PH, BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][0], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][1], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][2], BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3], 0, 0, std::sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1 + i][3] / 2), RESPAWN_ONE_DAY))
{ {
LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!9.%i", i); LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!9.%i", i);
return false; return false;
@@ -1323,17 +1323,17 @@ bool BattlegroundAV::SetupBattleground()
if (IsHolidayActive(HOLIDAY_FEAST_OF_WINTER_VEIL)) if (IsHolidayActive(HOLIDAY_FEAST_OF_WINTER_VEIL))
for (uint16 i = 0 ; i <= (BG_AV_OBJECT_HANDPACKED_SNOWDRIFT_MAX - BG_AV_OBJECT_HANDPACKED_SNOWDRIFT_MIN); i++) for (uint16 i = 0 ; i <= (BG_AV_OBJECT_HANDPACKED_SNOWDRIFT_MAX - BG_AV_OBJECT_HANDPACKED_SNOWDRIFT_MIN); i++)
{ {
if (!AddObject(BG_AV_OBJECT_HANDPACKED_SNOWDRIFT_MIN + i, BG_AV_OBJECTID_HARDPACKED_SNOWDRIFT, BG_AV_ObjectPos[AV_OPLACE_HANDPACKED_SNOWDRIFT_MIN + i][0], BG_AV_ObjectPos[AV_OPLACE_HANDPACKED_SNOWDRIFT_MIN + i][1], BG_AV_ObjectPos[AV_OPLACE_HANDPACKED_SNOWDRIFT_MIN + i][2], BG_AV_ObjectPos[AV_OPLACE_HANDPACKED_SNOWDRIFT_MIN + i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_HANDPACKED_SNOWDRIFT_MIN + i][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_HANDPACKED_SNOWDRIFT_MIN + i][3] / 2), RESPAWN_ONE_DAY)) if (!AddObject(BG_AV_OBJECT_HANDPACKED_SNOWDRIFT_MIN + i, BG_AV_OBJECTID_HARDPACKED_SNOWDRIFT, BG_AV_ObjectPos[AV_OPLACE_HANDPACKED_SNOWDRIFT_MIN + i][0], BG_AV_ObjectPos[AV_OPLACE_HANDPACKED_SNOWDRIFT_MIN + i][1], BG_AV_ObjectPos[AV_OPLACE_HANDPACKED_SNOWDRIFT_MIN + i][2], BG_AV_ObjectPos[AV_OPLACE_HANDPACKED_SNOWDRIFT_MIN + i][3], 0, 0, std::sin(BG_AV_ObjectPos[AV_OPLACE_HANDPACKED_SNOWDRIFT_MIN + i][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_HANDPACKED_SNOWDRIFT_MIN + i][3] / 2), RESPAWN_ONE_DAY))
return false; return false;
} }
// Quest banners // Quest banners
if (!AddObject(BG_AV_OBJECT_FROSTWOLF_BANNER, BG_AV_OBJECTID_FROSTWOLF_BANNER, BG_AV_ObjectPos[AV_OPLACE_FROSTWOLF_BANNER][0], BG_AV_ObjectPos[AV_OPLACE_FROSTWOLF_BANNER][1], BG_AV_ObjectPos[AV_OPLACE_FROSTWOLF_BANNER][2], BG_AV_ObjectPos[AV_OPLACE_FROSTWOLF_BANNER][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_FROSTWOLF_BANNER][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_FROSTWOLF_BANNER][3] / 2), RESPAWN_ONE_DAY)) if (!AddObject(BG_AV_OBJECT_FROSTWOLF_BANNER, BG_AV_OBJECTID_FROSTWOLF_BANNER, BG_AV_ObjectPos[AV_OPLACE_FROSTWOLF_BANNER][0], BG_AV_ObjectPos[AV_OPLACE_FROSTWOLF_BANNER][1], BG_AV_ObjectPos[AV_OPLACE_FROSTWOLF_BANNER][2], BG_AV_ObjectPos[AV_OPLACE_FROSTWOLF_BANNER][3], 0, 0, std::sin(BG_AV_ObjectPos[AV_OPLACE_FROSTWOLF_BANNER][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_FROSTWOLF_BANNER][3] / 2), RESPAWN_ONE_DAY))
{ {
LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!8"); LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!8");
return false; return false;
} }
if (!AddObject(BG_AV_OBJECT_STORMPIKE_BANNER, BG_AV_OBJECTID_STORMPIKE_BANNER, BG_AV_ObjectPos[AV_OPLACE_STORMPIKE_BANNER][0], BG_AV_ObjectPos[AV_OPLACE_STORMPIKE_BANNER][1], BG_AV_ObjectPos[AV_OPLACE_STORMPIKE_BANNER][2], BG_AV_ObjectPos[AV_OPLACE_STORMPIKE_BANNER][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_STORMPIKE_BANNER][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_STORMPIKE_BANNER][3] / 2), RESPAWN_ONE_DAY)) if (!AddObject(BG_AV_OBJECT_STORMPIKE_BANNER, BG_AV_OBJECTID_STORMPIKE_BANNER, BG_AV_ObjectPos[AV_OPLACE_STORMPIKE_BANNER][0], BG_AV_ObjectPos[AV_OPLACE_STORMPIKE_BANNER][1], BG_AV_ObjectPos[AV_OPLACE_STORMPIKE_BANNER][2], BG_AV_ObjectPos[AV_OPLACE_STORMPIKE_BANNER][3], 0, 0, std::sin(BG_AV_ObjectPos[AV_OPLACE_STORMPIKE_BANNER][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_STORMPIKE_BANNER][3] / 2), RESPAWN_ONE_DAY))
{ {
LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!8"); LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!8");
return false; return false;
@@ -1409,9 +1409,9 @@ bool BattlegroundAV::SetupBattleground()
if ( if (
// alliance gates // alliance gates
!AddObject(BG_AV_OBJECT_DOOR_A, BG_AV_OBJECTID_GATE_A, BG_AV_DoorPositons[0][0], BG_AV_DoorPositons[0][1], BG_AV_DoorPositons[0][2], BG_AV_DoorPositons[0][3], 0, 0, sin(BG_AV_DoorPositons[0][3] / 2), cos(BG_AV_DoorPositons[0][3] / 2), RESPAWN_IMMEDIATELY) !AddObject(BG_AV_OBJECT_DOOR_A, BG_AV_OBJECTID_GATE_A, BG_AV_DoorPositons[0][0], BG_AV_DoorPositons[0][1], BG_AV_DoorPositons[0][2], BG_AV_DoorPositons[0][3], 0, 0, std::sin(BG_AV_DoorPositons[0][3] / 2), cos(BG_AV_DoorPositons[0][3] / 2), RESPAWN_IMMEDIATELY)
// horde gates // horde gates
|| !AddObject(BG_AV_OBJECT_DOOR_H, BG_AV_OBJECTID_GATE_H, BG_AV_DoorPositons[1][0], BG_AV_DoorPositons[1][1], BG_AV_DoorPositons[1][2], BG_AV_DoorPositons[1][3], 0, 0, sin(BG_AV_DoorPositons[1][3] / 2), cos(BG_AV_DoorPositons[1][3] / 2), RESPAWN_IMMEDIATELY)) || !AddObject(BG_AV_OBJECT_DOOR_H, BG_AV_OBJECTID_GATE_H, BG_AV_DoorPositons[1][0], BG_AV_DoorPositons[1][1], BG_AV_DoorPositons[1][2], BG_AV_DoorPositons[1][3], 0, 0, std::sin(BG_AV_DoorPositons[1][3] / 2), cos(BG_AV_DoorPositons[1][3] / 2), RESPAWN_IMMEDIATELY))
{ {
LOG_ERROR("sql.sql", "BatteGroundAV: Failed to spawn some object Battleground not created!1"); LOG_ERROR("sql.sql", "BatteGroundAV: Failed to spawn some object Battleground not created!1");
return false; return false;
+1 -1
View File
@@ -656,7 +656,7 @@ G3D::Vector3 TranslateLocation(G3D::Vector4 const* DBCPosition, G3D::Vector3 con
angle += 2 * float(M_PI); angle += 2 * float(M_PI);
} }
work.x = DBCPosition->x + (distance * sin(angle)); work.x = DBCPosition->x + (distance * std::sin(angle));
work.y = DBCPosition->y + (distance * cos(angle)); work.y = DBCPosition->y + (distance * cos(angle));
work.z = DBCPosition->z + z; work.z = DBCPosition->z + z;
return work; return work;
@@ -1514,7 +1514,7 @@ void GameObject::Use(Unit* user)
float relativeDistance = (info->size * itr->first) - (info->size * (info->chair.slots - 1) / 2.0f); float relativeDistance = (info->size * itr->first) - (info->size * (info->chair.slots - 1) / 2.0f);
float x_i = GetPositionX() + relativeDistance * cos(orthogonalOrientation); float x_i = GetPositionX() + relativeDistance * cos(orthogonalOrientation);
float y_i = GetPositionY() + relativeDistance * sin(orthogonalOrientation); float y_i = GetPositionY() + relativeDistance * std::sin(orthogonalOrientation);
if (itr->second) if (itr->second)
{ {
@@ -2082,7 +2082,7 @@ bool GameObject::IsInRange(float x, float y, float z, float radius) const
if (!info) if (!info)
return IsWithinDist3d(x, y, z, radius); return IsWithinDist3d(x, y, z, radius);
float sinA = sin(GetOrientation()); float sinA = std::sin(GetOrientation());
float cosA = cos(GetOrientation()); float cosA = cos(GetOrientation());
float dx = x - GetPositionX(); float dx = x - GetPositionX();
float dy = y - GetPositionY(); float dy = y - GetPositionY();
+11 -10
View File
@@ -1022,7 +1022,8 @@ bool Position::HasInLine(WorldObject const* target, float width) const
return false; return false;
width += target->GetObjectSize(); width += target->GetObjectSize();
float angle = GetRelativeAngle(target); float angle = GetRelativeAngle(target);
return std::fabs(sin(angle)) * GetExactDist2d(target->GetPositionX(), target->GetPositionY()) < width;
return std::fabs(std::sin(angle)) * GetExactDist2d(target->GetPositionX(), target->GetPositionY()) < width;
} }
std::string Position::ToString() const std::string Position::ToString() const
@@ -1519,8 +1520,8 @@ bool WorldObject::IsInRange3d(float x, float y, float z, float minRange, float m
void Position::RelocateOffset(const Position& offset) void Position::RelocateOffset(const Position& offset)
{ {
m_positionX = GetPositionX() + (offset.GetPositionX() * cos(GetOrientation()) + offset.GetPositionY() * sin(GetOrientation() + M_PI)); m_positionX = GetPositionX() + (offset.GetPositionX() * cos(GetOrientation()) + offset.GetPositionY() * std::sin(GetOrientation() + M_PI));
m_positionY = GetPositionY() + (offset.GetPositionY() * cos(GetOrientation()) + offset.GetPositionX() * sin(GetOrientation())); m_positionY = GetPositionY() + (offset.GetPositionY() * cos(GetOrientation()) + offset.GetPositionX() * std::sin(GetOrientation()));
m_positionZ = GetPositionZ() + offset.GetPositionZ(); m_positionZ = GetPositionZ() + offset.GetPositionZ();
m_orientation = GetOrientation() + offset.GetOrientation(); m_orientation = GetOrientation() + offset.GetOrientation();
} }
@@ -1530,8 +1531,8 @@ void Position::GetPositionOffsetTo(const Position& endPos, Position& retOffset)
float dx = endPos.GetPositionX() - GetPositionX(); float dx = endPos.GetPositionX() - GetPositionX();
float dy = endPos.GetPositionY() - GetPositionY(); float dy = endPos.GetPositionY() - GetPositionY();
retOffset.m_positionX = dx * cos(GetOrientation()) + dy * sin(GetOrientation()); retOffset.m_positionX = dx * cos(GetOrientation()) + dy * std::sin(GetOrientation());
retOffset.m_positionY = dy * cos(GetOrientation()) - dx * sin(GetOrientation()); retOffset.m_positionY = dy * cos(GetOrientation()) - dx * std::sin(GetOrientation());
retOffset.m_positionZ = endPos.GetPositionZ() - GetPositionZ(); retOffset.m_positionZ = endPos.GetPositionZ() - GetPositionZ();
retOffset.m_orientation = endPos.GetOrientation() - GetOrientation(); retOffset.m_orientation = endPos.GetOrientation() - GetOrientation();
} }
@@ -1559,7 +1560,7 @@ void Position::GetSinCos(const float x, const float y, float& vsin, float& vcos)
{ {
float angle = (float)rand_norm() * static_cast<float>(2 * M_PI); float angle = (float)rand_norm() * static_cast<float>(2 * M_PI);
vcos = cos(angle); vcos = cos(angle);
vsin = sin(angle); vsin = std::sin(angle);
} }
else else
{ {
@@ -1678,7 +1679,7 @@ void WorldObject::GetRandomPoint(const Position& pos, float distance, float& ran
float new_dist = (float)rand_norm() * static_cast<float>(distance); float new_dist = (float)rand_norm() * static_cast<float>(distance);
rand_x = pos.m_positionX + new_dist * cos(angle); rand_x = pos.m_positionX + new_dist * cos(angle);
rand_y = pos.m_positionY + new_dist * sin(angle); rand_y = pos.m_positionY + new_dist * std::sin(angle);
rand_z = pos.m_positionZ; rand_z = pos.m_positionZ;
Acore::NormalizeMapCoord(rand_x); Acore::NormalizeMapCoord(rand_x);
@@ -2863,7 +2864,7 @@ void WorldObject::MovePosition(Position& pos, float dist, float angle)
angle += m_orientation; angle += m_orientation;
float destx, desty, destz, ground, floor; float destx, desty, destz, ground, floor;
destx = pos.m_positionX + dist * cos(angle); destx = pos.m_positionX + dist * cos(angle);
desty = pos.m_positionY + dist * sin(angle); desty = pos.m_positionY + dist * std::sin(angle);
// Prevent invalid coordinates here, position is unchanged // Prevent invalid coordinates here, position is unchanged
if (!Acore::IsValidMapCoord(destx, desty)) if (!Acore::IsValidMapCoord(destx, desty))
@@ -2884,7 +2885,7 @@ void WorldObject::MovePosition(Position& pos, float dist, float angle)
if (std::fabs(pos.m_positionZ - destz) > 6.0f) if (std::fabs(pos.m_positionZ - destz) > 6.0f)
{ {
destx -= step * cos(angle); destx -= step * cos(angle);
desty -= step * sin(angle); desty -= step * std::sin(angle);
ground = GetMapHeight(destx, desty, MAX_HEIGHT); ground = GetMapHeight(destx, desty, MAX_HEIGHT);
floor = GetMapHeight(destx, desty, pos.m_positionZ); floor = GetMapHeight(destx, desty, pos.m_positionZ);
destz = std::fabs(ground - pos.m_positionZ) <= std::fabs(floor - pos.m_positionZ) ? ground : floor; destz = std::fabs(ground - pos.m_positionZ) <= std::fabs(floor - pos.m_positionZ) ? ground : floor;
@@ -2945,7 +2946,7 @@ void WorldObject::MovePositionToFirstCollision(Position& pos, float dist, float
angle += GetOrientation(); angle += GetOrientation();
float destx, desty, destz; float destx, desty, destz;
destx = pos.m_positionX + dist * cos(angle); destx = pos.m_positionX + dist * cos(angle);
desty = pos.m_positionY + dist * sin(angle); desty = pos.m_positionY + dist * std::sin(angle);
destz = pos.m_positionZ; destz = pos.m_positionZ;
if (!GetMap()->CheckCollisionAndGetValidCoords(this, pos.m_positionX, pos.m_positionY, pos.m_positionZ, destx, desty, destz, false)) if (!GetMap()->CheckCollisionAndGetValidCoords(this, pos.m_positionX, pos.m_positionY, pos.m_positionZ, destx, desty, destz, false))
@@ -877,7 +877,7 @@ void StaticTransport::RelocateToProgress(uint32 progress)
// reminder: WorldRotation only influences model rotation, not the path // reminder: WorldRotation only influences model rotation, not the path
float sign = GetFloatValue(GAMEOBJECT_PARENTROTATION + 2) >= 0.0f ? 1.0f : -1.0f; float sign = GetFloatValue(GAMEOBJECT_PARENTROTATION + 2) >= 0.0f ? 1.0f : -1.0f;
float pathRotAngle = sign * 2.0f * acos(GetFloatValue(GAMEOBJECT_PARENTROTATION + 3)); float pathRotAngle = sign * 2.0f * acos(GetFloatValue(GAMEOBJECT_PARENTROTATION + 3));
float cs = cos(pathRotAngle), sn = sin(pathRotAngle); float cs = cos(pathRotAngle), sn = std::sin(pathRotAngle);
float nx = pos.x * cs - pos.y * sn; float nx = pos.x * cs - pos.y * sn;
float ny = pos.x * sn + pos.y * cs; float ny = pos.x * sn + pos.y * cs;
pos.x = nx; pos.x = nx;
+3 -3
View File
@@ -18716,7 +18716,7 @@ void Unit::JumpTo(float speedXY, float speedZ, bool forward)
else else
{ {
float vcos = cos(angle + GetOrientation()); float vcos = cos(angle + GetOrientation());
float vsin = sin(angle + GetOrientation()); float vsin = std::sin(angle + GetOrientation());
WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8 + 4 + 4 + 4 + 4 + 4)); WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8 + 4 + 4 + 4 + 4 + 4));
data << GetPackGUID(); data << GetPackGUID();
@@ -18982,7 +18982,7 @@ void Unit::_ExitVehicle(Position const* exitPosition)
else if (vehicle->GetVehicleInfo()->m_ID == 349) // AT Mounts, dismount to the right else if (vehicle->GetVehicleInfo()->m_ID == 349) // AT Mounts, dismount to the right
{ {
float x = pos.GetPositionX() + 2.0f * cos(pos.GetOrientation() - M_PI / 2.0f); float x = pos.GetPositionX() + 2.0f * cos(pos.GetOrientation() - M_PI / 2.0f);
float y = pos.GetPositionY() + 2.0f * sin(pos.GetOrientation() - M_PI / 2.0f); float y = pos.GetPositionY() + 2.0f * std::sin(pos.GetOrientation() - M_PI / 2.0f);
float z = GetMapHeight(x, y, pos.GetPositionZ()); float z = GetMapHeight(x, y, pos.GetPositionZ());
if (z > INVALID_HEIGHT) if (z > INVALID_HEIGHT)
pos.Relocate(x, y, z); pos.Relocate(x, y, z);
@@ -19017,7 +19017,7 @@ void Unit::_ExitVehicle(Position const* exitPosition)
{ {
float o = pos.GetAngle(this); float o = pos.GetAngle(this);
Movement::MoveSplineInit init(this); Movement::MoveSplineInit init(this);
init.MoveTo(pos.GetPositionX() + 8 * cos(o), pos.GetPositionY() + 8 * sin(o), pos.GetPositionZ() + 16.0f); init.MoveTo(pos.GetPositionX() + 8 * cos(o), pos.GetPositionY() + 8 * std::sin(o), pos.GetPositionZ() + 16.0f);
init.SetFacing(GetOrientation()); init.SetFacing(GetOrientation());
init.SetTransportExit(); init.SetTransportExit();
init.Launch(); init.Launch();
@@ -152,7 +152,7 @@ bool FleeingMovementGenerator<T>::_getPoint(T* owner, float& x, float& y, float&
} }
temp_x = x + distance * cos(angle); temp_x = x + distance * cos(angle);
temp_y = y + distance * sin(angle); temp_y = y + distance * std::sin(angle);
float temp_z = z; float temp_z = z;
if (!_map->CanReachPositionAndGetValidCoords(owner, temp_x, temp_y, temp_z, true, true)) if (!_map->CanReachPositionAndGetValidCoords(owner, temp_x, temp_y, temp_z, true, true))
@@ -162,8 +162,8 @@ bool FleeingMovementGenerator<T>::_getPoint(T* owner, float& x, float& y, float&
if (!(temp_z - z) || distance / std::fabs(temp_z - z) > 1.0f) if (!(temp_z - z) || distance / std::fabs(temp_z - z) > 1.0f)
{ {
float temp_z_left = _map->GetHeight(owner->GetPhaseMask(), temp_x + 1.0f * cos(angle + static_cast<float>(M_PI / 2)), temp_y + 1.0f * sin(angle + static_cast<float>(M_PI / 2)), z, true); float temp_z_left = _map->GetHeight(owner->GetPhaseMask(), temp_x + 1.0f * cos(angle + static_cast<float>(M_PI / 2)), temp_y + 1.0f * std::sin(angle + static_cast<float>(M_PI / 2)), z, true);
float temp_z_right = _map->GetHeight(owner->GetPhaseMask(), temp_x + 1.0f * cos(angle - static_cast<float>(M_PI / 2)), temp_y + 1.0f * sin(angle - static_cast<float>(M_PI / 2)), z, true); float temp_z_right = _map->GetHeight(owner->GetPhaseMask(), temp_x + 1.0f * cos(angle - static_cast<float>(M_PI / 2)), temp_y + 1.0f * std::sin(angle - static_cast<float>(M_PI / 2)), z, true);
if (std::fabs(temp_z_left - temp_z) < 1.2f && std::fabs(temp_z_right - temp_z) < 1.2f) if (std::fabs(temp_z_left - temp_z) < 1.2f && std::fabs(temp_z_right - temp_z) < 1.2f)
{ {
// use new values // use new values
@@ -65,7 +65,7 @@ void PointMovementGenerator<T>::DoInitialize(T* unit)
if (G3D::fuzzyEq(unit->GetPositionX(), i_x) && G3D::fuzzyEq(unit->GetPositionY(), i_y)) if (G3D::fuzzyEq(unit->GetPositionX(), i_x) && G3D::fuzzyEq(unit->GetPositionY(), i_y))
{ {
i_x += 0.2f * cos(unit->GetOrientation()); i_x += 0.2f * cos(unit->GetOrientation());
i_y += 0.2f * sin(unit->GetOrientation()); i_y += 0.2f * std::sin(unit->GetOrientation());
} }
init.MoveTo(i_x, i_y, i_z, true); init.MoveTo(i_x, i_y, i_z, true);
@@ -77,7 +77,7 @@ void PointMovementGenerator<T>::DoInitialize(T* unit)
if (G3D::fuzzyEq(unit->GetPositionX(), i_x) && G3D::fuzzyEq(unit->GetPositionY(), i_y)) if (G3D::fuzzyEq(unit->GetPositionX(), i_x) && G3D::fuzzyEq(unit->GetPositionY(), i_y))
{ {
i_x += 0.2f * cos(unit->GetOrientation()); i_x += 0.2f * cos(unit->GetOrientation());
i_y += 0.2f * sin(unit->GetOrientation()); i_y += 0.2f * std::sin(unit->GetOrientation());
} }
init.MoveTo(i_x, i_y, i_z, true); init.MoveTo(i_x, i_y, i_z, true);
@@ -247,7 +247,7 @@ void RandomMovementGenerator<Creature>::DoInitialize(Creature* creature)
{ {
float angle = (M_PI * 2.0f / (float)RANDOM_POINTS_NUMBER) * i; float angle = (M_PI * 2.0f / (float)RANDOM_POINTS_NUMBER) * i;
float factor = 0.5f + rand_norm() * 0.5f; float factor = 0.5f + rand_norm() * 0.5f;
_destinationPoints.push_back(G3D::Vector3(_initialPosition.GetPositionX() + _wanderDistance * cos(angle)*factor, _initialPosition.GetPositionY() + _wanderDistance * sin(angle)*factor, _initialPosition.GetPositionZ())); _destinationPoints.push_back(G3D::Vector3(_initialPosition.GetPositionX() + _wanderDistance * cos(angle)*factor, _initialPosition.GetPositionY() + _wanderDistance * std::sin(angle)*factor, _initialPosition.GetPositionZ()));
} }
} }
@@ -308,23 +308,23 @@ static Position const PredictPosition(Unit* target)
if (target->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FORWARD)) if (target->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FORWARD))
{ {
pos.m_positionX += cos(orientation) * speed; pos.m_positionX += cos(orientation) * speed;
pos.m_positionY += sin(orientation) * speed; pos.m_positionY += std::sin(orientation) * speed;
} }
else if (target->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_BACKWARD)) else if (target->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_BACKWARD))
{ {
pos.m_positionX -= cos(orientation) * speed; pos.m_positionX -= cos(orientation) * speed;
pos.m_positionY -= sin(orientation) * speed; pos.m_positionY -= std::sin(orientation) * speed;
} }
if (target->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_STRAFE_LEFT)) if (target->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_STRAFE_LEFT))
{ {
pos.m_positionX += cos(orientation + M_PI / 2.f) * speed; pos.m_positionX += cos(orientation + M_PI / 2.f) * speed;
pos.m_positionY += sin(orientation + M_PI / 2.f) * speed; pos.m_positionY += std::sin(orientation + M_PI / 2.f) * speed;
} }
else if (target->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_STRAFE_RIGHT)) else if (target->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_STRAFE_RIGHT))
{ {
pos.m_positionX += cos(orientation - M_PI / 2.f) * speed; pos.m_positionX += cos(orientation - M_PI / 2.f) * speed;
pos.m_positionY += sin(orientation - M_PI / 2.f) * speed; pos.m_positionY += std::sin(orientation - M_PI / 2.f) * speed;
} }
return pos; return pos;
+1 -1
View File
@@ -1781,7 +1781,7 @@ void Spell::SelectImplicitTrajTargets(SpellEffIndex effIndex, SpellImplicitTarge
if (m_targets.GetSrcPos()->GetExactDist2d(m_targets.GetDstPos()) > bestDist) if (m_targets.GetSrcPos()->GetExactDist2d(m_targets.GetDstPos()) > bestDist)
{ {
float x = m_targets.GetSrcPos()->m_positionX + cos(m_caster->GetOrientation()) * bestDist; float x = m_targets.GetSrcPos()->m_positionX + cos(m_caster->GetOrientation()) * bestDist;
float y = m_targets.GetSrcPos()->m_positionY + sin(m_caster->GetOrientation()) * bestDist; float y = m_targets.GetSrcPos()->m_positionY + std::sin(m_caster->GetOrientation()) * bestDist;
float z = m_targets.GetSrcPos()->m_positionZ + bestDist * (a * bestDist + b); float z = m_targets.GetSrcPos()->m_positionZ + bestDist * (a * bestDist + b);
if (itr != targets.end()) if (itr != targets.end())
+1 -1
View File
@@ -172,7 +172,7 @@ public:
float GetDist2d() const { return m_src._position.GetExactDist2d(&m_dst._position); } float GetDist2d() const { return m_src._position.GetExactDist2d(&m_dst._position); }
float GetSpeedXY() const { return m_speed * cos(m_elevation); } float GetSpeedXY() const { return m_speed * cos(m_elevation); }
float GetSpeedZ() const { return m_speed * sin(m_elevation); } float GetSpeedZ() const { return m_speed * std::sin(m_elevation); }
void Update(Unit* caster); void Update(Unit* caster);
void OutDebug() const; void OutDebug() const;
+1 -1
View File
@@ -171,7 +171,7 @@ public:
float z = player->GetPositionZ(); float z = player->GetPositionZ();
float ang = player->GetOrientation(); float ang = player->GetOrientation();
float rot2 = sin(ang / 2); float rot2 = std::sin(ang / 2);
float rot3 = cos(ang / 2); float rot3 = cos(ang / 2);
player->SummonGameObject(objectId, x, y, z, ang, 0, 0, rot2, rot3, spawntm); player->SummonGameObject(objectId, x, y, z, ang, 0, 0, rot2, rot3, spawntm);
@@ -256,7 +256,7 @@ public:
{ {
Talk(SAY_ATTUMEN1_MOUNT); Talk(SAY_ATTUMEN1_MOUNT);
_events.Reset(); _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);
} }
} }
@@ -943,7 +943,7 @@ public:
if (summon->GetEntry() <= NPC_RIMBLAT_EARTHSHATTER && summon->GetEntry() != NPC_HIGHLORD_TIRION_FORDRING) if (summon->GetEntry() <= NPC_RIMBLAT_EARTHSHATTER && summon->GetEntry() != NPC_HIGHLORD_TIRION_FORDRING)
{ {
float o = lk->GetAngle(summon); 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); summon->ToTempSummon()->SetTempSummonType(TEMPSUMMON_MANUAL_DESPAWN);
} }
} }
@@ -1052,7 +1052,7 @@ public:
if (Creature* tirion = GetEntryFromSummons(NPC_HIGHLORD_TIRION_FORDRING)) if (Creature* tirion = GetEntryFromSummons(NPC_HIGHLORD_TIRION_FORDRING))
{ {
float o = me->GetAngle(tirion); 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->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
tirion->SetFaction(FACTION_FRIENDLY); tirion->SetFaction(FACTION_FRIENDLY);
} }
@@ -585,7 +585,7 @@ public:
for (uint8 i = 1; i < phase; ++i) for (uint8 i = 1; i < phase; ++i)
{ {
float x = me->GetPositionX() + 18.0f * cos((i * 2.0f - 1.0f) * M_PI / 3.0f); 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)) if (Creature* orb = me->SummonCreature(NPC_SHIELD_ORB, x, y, 40.0f, 0, TEMPSUMMON_CORPSE_DESPAWN))
{ {
Movement::PointsArray movementArray; Movement::PointsArray movementArray;
@@ -595,7 +595,7 @@ public:
for (uint8 j = 1; j < 20; ++j) 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)); 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)); movementArray.push_back(G3D::Vector3(x, y, 40.0f));
} }
@@ -866,8 +866,8 @@ public:
events.ScheduleEvent(eventId + 1, 6000); events.ScheduleEvent(eventId + 1, 6000);
break; break;
case EVENT_SCENE_03: 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, 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 + sin(2.0f), 28.26f + 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); events.ScheduleEvent(eventId + 1, 11000);
break; break;
case EVENT_SCENE_04: 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 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)); first->m_Events.AddEvent(new FixOrientation(first), first->m_Events.CalculateTime(12000));
for (uint8 i = 0; i < 9; ++i) 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)); follower->GetMotionMaster()->MoveFollow(first, 3.0f, follower->GetAngle(first));
} }
events.ScheduleEvent(eventId + 1, 10000); 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 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)); first->m_Events.AddEvent(new FixOrientation(first), first->m_Events.CalculateTime(14500));
for (uint8 i = 0; i < 9; ++i) 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)); follower->GetMotionMaster()->MoveFollow(first, 3.0f, follower->GetAngle(first));
} }
events.ScheduleEvent(eventId + 1, 12000); events.ScheduleEvent(eventId + 1, 12000);
@@ -482,7 +482,7 @@ public:
if (target->GetDistance(GetCaster()) < 5.0f) if (target->GetDistance(GetCaster()) < 5.0f)
{ {
float o = frand(0, 2 * M_PI); 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 else
pos.Relocate(GetCaster()->GetPositionX(), GetCaster()->GetPositionY(), GetCaster()->GetPositionZ() + 1.0f); pos.Relocate(GetCaster()->GetPositionX(), GetCaster()->GetPositionY(), GetCaster()->GetPositionZ() + 1.0f);
@@ -321,12 +321,12 @@ public:
Position spawnPos = c->GetPosition(); Position spawnPos = c->GetPosition();
spawnPos.m_orientation = 5.80f; spawnPos.m_orientation = 5.80f;
spawnPos.m_positionX += 5.0f * cos(4.5f); 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) for (uint8 i = 0; i < 5; ++i)
if (me->SummonCreature(NPC_SCOURGE_ZOMBIE, spawnPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000)) if (me->SummonCreature(NPC_SCOURGE_ZOMBIE, spawnPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000))
{ {
spawnPos.m_positionX += 2.5f * cos(4.5f); 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; break;
@@ -335,13 +335,13 @@ public:
Position spawnPos = c->GetPosition(); Position spawnPos = c->GetPosition();
spawnPos.m_orientation = 5.80f; spawnPos.m_orientation = 5.80f;
spawnPos.m_positionX += 7.0f * cos(4.0f); 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) for (uint8 i = 0; i < 3; ++i)
if (Creature* s = me->SummonCreature(NPC_GHOUL_INVADER, spawnPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000)) if (Creature* s = me->SummonCreature(NPC_GHOUL_INVADER, spawnPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000))
{ {
s->CastSpell(s, 66947, false); // emerge effect s->CastSpell(s, 66947, false); // emerge effect
spawnPos.m_positionX += 4.0f * cos(4.5f); 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; break;
@@ -350,13 +350,13 @@ public:
Position spawnPos = c->GetPosition(); Position spawnPos = c->GetPosition();
spawnPos.m_orientation = 5.80f; spawnPos.m_orientation = 5.80f;
spawnPos.m_positionX += 8.0f * cos(4.0f); 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) for (uint8 i = 0; i < 3; ++i)
if (Creature* s = me->SummonCreature(NPC_CRYPT_RAIDER, spawnPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000)) if (Creature* s = me->SummonCreature(NPC_CRYPT_RAIDER, spawnPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000))
{ {
s->CastSpell(s, 66947, false); // emerge effect s->CastSpell(s, 66947, false); // emerge effect
spawnPos.m_positionX += 4.0f * cos(4.5f); 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; break;
+3 -3
View File
@@ -381,7 +381,7 @@ struct npc_dark_iron_attack_generator : public ScriptedAI
float rand = 8 + rand_norm() * 12; float rand = 8 + rand_norm() * 12;
float angle = rand_norm() * 2 * M_PI; float angle = rand_norm() * 2 * M_PI;
float x = 1201.8f + rand * cos(angle); 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)) if (Creature* cr = me->SummonCreature(NPC_MOLE_MACHINE_TRIGGER, x, y, 21.3f, 0.0f))
cr->CastSpell(cr, SPELL_SPAWN_MOLE_MACHINE, true); 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 rand = rand_norm() * 20;
float angle = rand_norm() * 2 * M_PI; float angle = rand_norm() * 2 * M_PI;
float x = -5157.1f + rand * cos(angle); 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)) if (Creature* cr = me->SummonCreature(NPC_MOLE_MACHINE_TRIGGER, x, y, 398.11f, 0.0f))
cr->CastSpell(cr, SPELL_SPAWN_MOLE_MACHINE, true); cr->CastSpell(cr, SPELL_SPAWN_MOLE_MACHINE, true);
} }
@@ -422,7 +422,7 @@ struct npc_dark_iron_attack_generator : public ScriptedAI
thrown = 0; thrown = 0;
sayer->Say("SOMEONE TRY THIS SUPER BREW!", LANG_UNIVERSAL); sayer->Say("SOMEONE TRY THIS SUPER BREW!", LANG_UNIVERSAL);
//sayer->CastSpell(sayer, SPELL_CREATE_SUPER_BREW, true); //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 else
{ {
+8 -8
View File
@@ -187,7 +187,7 @@ struct npc_winterfin_playmate : public ScriptedAI
switch (phase) switch (phase)
{ {
case 1: 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); orphan->AI()->Talk(TEXT_ORACLE_ORPHAN_1);
timer = 3000; timer = 3000;
break; break;
@@ -273,7 +273,7 @@ struct npc_snowfall_glade_playmate : public ScriptedAI
switch (phase) switch (phase)
{ {
case 1: 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); orphan->AI()->Talk(TEXT_WOLVAR_ORPHAN_1);
timer = 5000; timer = 5000;
break; break;
@@ -362,7 +362,7 @@ struct npc_the_biggest_tree : public ScriptedAI
switch (phase) switch (phase)
{ {
case 1: 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; timer = 2000;
break; break;
case 2: case 2:
@@ -436,7 +436,7 @@ struct npc_high_oracle_soo_roo : public ScriptedAI
switch (phase) switch (phase)
{ {
case 1: 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); orphan->AI()->Talk(TEXT_ORACLE_ORPHAN_5);
timer = 3000; timer = 3000;
break; break;
@@ -512,7 +512,7 @@ struct npc_elder_kekek : public ScriptedAI
switch (phase) switch (phase)
{ {
case 1: 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); orphan->AI()->Talk(TEXT_WOLVAR_ORPHAN_4);
timer = 3000; timer = 3000;
break; break;
@@ -588,7 +588,7 @@ struct npc_the_etymidian : public ScriptedAI
switch (phase) switch (phase)
{ {
case 1: 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); orphan->AI()->Talk(TEXT_ORACLE_ORPHAN_7);
timer = 5000; timer = 5000;
break; break;
@@ -697,7 +697,7 @@ struct npc_alexstraza_the_lifebinder : public ScriptedAI
switch (phase) switch (phase)
{ {
case 1: 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); orphan->AI()->Talk(TEXT_ORACLE_ORPHAN_11);
timer = 5000; timer = 5000;
break; break;
@@ -728,7 +728,7 @@ struct npc_alexstraza_the_lifebinder : public ScriptedAI
Reset(); Reset();
return; return;
case 7: 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); orphan->AI()->Talk(TEXT_WOLVAR_ORPHAN_11);
timer = 5000; timer = 5000;
break; break;
+1 -1
View File
@@ -165,7 +165,7 @@ class spell_winter_veil_racer_rocket_slam : public SpellScript
{ {
Position pos; Position pos;
float x = caster->GetPositionX() + 30 * cos(caster->GetOrientation()); 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); pos.Relocate(x, y, caster->GetMap()->GetHeight(x, y, MAX_HEIGHT) + 0.5f);
//caster->GetFirstCollisionPosition(pos, 30.0f, caster->GetOrientation()); //caster->GetFirstCollisionPosition(pos, 30.0f, caster->GetOrientation());
caster->CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), SPELL_RACER_CHARGE_TO_OBJECT, true); caster->CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), SPELL_RACER_CHARGE_TO_OBJECT, true);
@@ -78,7 +78,7 @@ public:
if (Unit* medivh = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_MEDIVH))) 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(); me->GetMotionMaster()->MoveTargetedHome();
} }
} }
@@ -108,12 +108,12 @@ public:
groundArray.push_back(G3D::Vector3(creature->GetPositionX() + 8.0f, creature->GetPositionY(), creature->GetPositionZ())); groundArray.push_back(G3D::Vector3(creature->GetPositionX() + 8.0f, creature->GetPositionY(), creature->GetPositionZ()));
airArray.push_back(G3D::Vector3(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ())); airArray.push_back(G3D::Vector3(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ()));
for (uint8 i = 0; i < 10; ++i) 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) 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) 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; InstanceScript* instance;
@@ -331,7 +331,7 @@ public:
if (Unit* medivh = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_MEDIVH))) if (Unit* medivh = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_MEDIVH)))
{ {
float o = medivh->GetAngle(summon) + frand(-1.0f, 1.0f); 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->GetMotionMaster()->MoveTargetedHome();
summon->SetReactState(REACT_DEFENSIVE); summon->SetReactState(REACT_DEFENSIVE);
} }
@@ -272,8 +272,8 @@ public:
{ {
float angle = rand_norm() * 2 * M_PI; float angle = rand_norm() * 2 * M_PI;
float dist = rand_norm() * 4.0f; float dist = rand_norm() * 4.0f;
me->CastSpell(-33.18f + cos(angle) * dist, -258.80f + 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 + 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; whelpCount += 2;
whelpSpamTimer += 600; whelpSpamTimer += 600;
} }
@@ -502,8 +502,8 @@ public:
{ {
float angle = rand_norm() * 2 * M_PI; float angle = rand_norm() * 2 * M_PI;
float dist = rand_norm() * 4.0f; float dist = rand_norm() * 4.0f;
me->CastSpell(-33.18f + cos(angle) * dist, -258.80f + 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 + 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); events.RepeatEvent(30000);
break; break;
} }
@@ -262,8 +262,8 @@ public:
me->SummonCreature(NPC_WITHERED_BATTLE_BOAR, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); me->SummonCreature(NPC_WITHERED_BATTLE_BOAR, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
if (data > 0 && me->GetOrientation() < 4.0f) if (data > 0 && me->GetOrientation() < 4.0f)
me->SummonCreature(NPC_WITHERED_BATTLE_BOAR, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); 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_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() + (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) else if (data == 7)
me->SummonCreature(NPC_PLAGUEMAW_THE_ROTTING, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); me->SummonCreature(NPC_PLAGUEMAW_THE_ROTTING, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
@@ -342,7 +342,7 @@ public:
{ {
float o = (i * M_PI / 2) + (M_PI / 4); float o = (i * M_PI / 2) + (M_PI / 4);
float x = me->GetPositionX() + cos(o) * 15.0f; 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), 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))) x, y, me->GetMap()->GetHeight(x, y, MAX_HEIGHT), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)))
cr->AI()->AttackStart(me); cr->AI()->AttackStart(me);
@@ -367,7 +367,7 @@ public:
{ {
float o = i * 2 * M_PI / 3; float o = i * 2 * M_PI / 3;
float x = me->GetPositionX() + cos(o) * 10.0f; 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; uint32 entry = NPC_LESSER_INFERNAL;
if (i) if (i)
entry = i == 1 ? NPC_DOOMWARDER : NPC_NETHER; entry = i == 1 ? NPC_DOOMWARDER : NPC_NETHER;
@@ -165,7 +165,7 @@ struct npc_taldaram_flamesphere : public NullCreatureAI
float angle = me->GetAngle(&victimPos) + angleOffset; float angle = me->GetAngle(&victimPos) + angleOffset;
float x = me->GetPositionX() + DATA_SPHERE_DISTANCE * cos(angle); 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()); me->GetMotionMaster()->MovePoint(POINT_ORB, x, y, me->GetPositionZ());
moveTimer = 0; moveTimer = 0;
@@ -824,7 +824,7 @@ public:
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[1][i]) ) if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[1][i]) )
{ {
float angle = rand_norm() * 2 * M_PI; 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); events.ScheduleEvent(EVENT_GRAND_GROUP_1_ATTACK, 3000);
@@ -850,7 +850,7 @@ public:
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[0][i]) ) if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[0][i]) )
{ {
float angle = rand_norm() * 2 * M_PI; 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); events.ScheduleEvent(EVENT_GRAND_GROUP_2_ATTACK, 3000);
@@ -875,7 +875,7 @@ public:
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[2][i]) ) if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[2][i]) )
{ {
float angle = rand_norm() * 2 * M_PI; 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); events.ScheduleEvent(EVENT_GRAND_GROUP_3_ATTACK, 3000);
@@ -900,7 +900,7 @@ public:
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) ) if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
{ {
float angle = rand_norm() * 2 * M_PI; 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); events.ScheduleEvent(EVENT_GRAND_CHAMPIONS_MOUNTS_ATTACK, 3000);
@@ -182,7 +182,7 @@ public:
{ {
float angle = rand_norm() * 2 * M_PI; float angle = rand_norm() * 2 * M_PI;
float dist = rand_norm() * 40.0f; 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->SetFaction(FACTION_PREY);
c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
@@ -652,7 +652,7 @@ public:
o -= M_PI; o -= M_PI;
else else
o += M_PI; 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); AttackStart(target);
me->GetMotionMaster()->MoveChase(target); me->GetMotionMaster()->MoveChase(target);
events.DelayEvents(3000); events.DelayEvents(3000);
@@ -589,9 +589,9 @@ struct boss_jormungarAI : public ScriptedAI
c->SetSpeed(MOVE_RUN, 2.5f); c->SetSpeed(MOVE_RUN, 2.5f);
c->CastSpell(c, SPELL_CHURNING_GROUND, true); c->CastSpell(c, SPELL_CHURNING_GROUND, true);
c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED); 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(); me->StopMovingOnCurrentPos();
DoResetThreat(); DoResetThreat();
@@ -939,10 +939,10 @@ public:
if( angle > 1.0f && angle < 2.0f ) // near main gate if( angle > 1.0f && angle < 2.0f ) // near main gate
dist = 46.0f; dist = 46.0f;
destX = Locs[LOC_CENTER].GetPositionX() + cos(angle) * dist; 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; destZ = Locs[LOC_CENTER].GetPositionZ() + 1.0f;
me->StopMoving(); 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); events.RescheduleEvent(EVENT_TRAMPLE, 1500);
@@ -319,7 +319,7 @@ struct boss_twin_valkyrAI : public ScriptedAI
for( uint8 i = 0; i < count; ++i ) for( uint8 i = 0; i < count; ++i )
{ {
float angle = rand_norm() * 2 * M_PI; 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); boss_twin_valkyrAI::JustSummoned(ball);
} }
@@ -718,7 +718,7 @@ public:
void MoveToNextPoint() void MoveToNextPoint()
{ {
float angle = rand_norm() * 2 * M_PI; 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 void UpdateAI(uint32 /*diff*/) override
@@ -130,7 +130,7 @@ public:
if (Creature* boss = instance->GetCreature(NPC_DevourerGUID)) if (Creature* boss = instance->GetCreature(NPC_DevourerGUID))
{ {
float angle = boss->GetAngle(leader); 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) for (int8 i = 0; outroPositions[i].entry[teamIdInInstance] != 0; ++i)
@@ -148,7 +148,7 @@ public:
Position myPos(*me), exitPos; Position myPos(*me), exitPos;
float ang = me->GetOrientation() + 3 * M_PI / 2; float ang = me->GetOrientation() + 3 * M_PI / 2;
float dist = 3.0f; 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()); 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())) 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); float angle = me->GetAngle(c);
me->SetFacingTo(angle); me->SetFacingTo(angle);
float x = me->GetPositionX() + cos(angle) * 7.0f; 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()); c->GetMotionMaster()->MovePoint(0, x, y, me->GetPositionZ());
} }
@@ -198,7 +198,7 @@ public:
c->SendMovementFlagUpdate(); c->SendMovementFlagUpdate();
float dist = rand_norm() * 2.0f; float dist = rand_norm() * 2.0f;
float angle = rand_norm() * 2 * M_PI; 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->SetSpeed(MOVE_RUN, 0.8f);
c->SetInCombatWithZone(); c->SetInCombatWithZone();
c->GetMotionMaster()->MoveChase(me, dist, angle); 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 angle = c->GetAngle(me);
float x = c->GetPositionX() + cos(angle) * 12.0f; 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()); me->GetMotionMaster()->MovePoint(2, x, y, c->GetPositionZ());
} }
@@ -685,7 +685,7 @@ public:
me->SetFacingTo(PTSTyrannusWaitPos2.GetOrientation()); me->SetFacingTo(PTSTyrannusWaitPos2.GetOrientation());
break; break;
case 5: 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; break;
case 6: case 6:
me->GetMotionMaster()->MovePoint(4, PTSTyrannusWaitPos3, false); me->GetMotionMaster()->MovePoint(4, PTSTyrannusWaitPos3, false);
@@ -979,7 +979,7 @@ public:
c->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_CHEER); c->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_CHEER);
float ang = frand(1.92f, 2.36f); float ang = frand(1.92f, 2.36f);
float dist = urand(50, 85); 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) else if (p == 3)
@@ -1187,7 +1187,7 @@ public:
{ {
float angle = rand_norm() * 2 * M_PI; float angle = rand_norm() * 2 * M_PI;
float dist = urand(1, 4); 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());
} }
} }
@@ -1722,7 +1722,7 @@ public:
if (Position* dest = const_cast<WorldLocation*>(GetExplTargetDest())) if (Position* dest = const_cast<WorldLocation*>(GetExplTargetDest()))
{ {
float angle = dest->GetAngle(GetCaster()); 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); dest->RelocateOffset(offset);
GetCaster()->UpdateAllowedPositionZ(dest->GetPositionX(), dest->GetPositionY(), dest->m_positionZ); GetCaster()->UpdateAllowedPositionZ(dest->GetPositionX(), dest->GetPositionY(), dest->m_positionZ);
} }
@@ -1762,7 +1762,7 @@ public:
for (uint8 i = 6; i > 0; --i) for (uint8 i = 6; i > 0; --i)
{ {
float destX = summoner->GetPositionX() + cos(angle + a * M_PI) * i * 10.0f; 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) 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()); float destZ = summoner->GetMapHeight(summoner->GetPhaseMask(), destX, destY, summoner->GetPositionZ());
@@ -339,7 +339,7 @@ public:
me->DisableSpline(); me->DisableSpline();
me->CastSpell(me, SPELL_COLDFLAME_SUMMON, true); me->CastSpell(me, SPELL_COLDFLAME_SUMMON, true);
float nx = me->GetPositionX() + 5.0f * cos(me->GetOrientation()); 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)) if (!me->IsWithinLOS(nx, ny, 42.5f))
{ {
break; break;
@@ -495,12 +495,12 @@ public:
float dist = caster->GetObjectSize() / 2.0f; float dist = caster->GetObjectSize() / 2.0f;
float z = caster->GetPositionZ() + 2.5f; float z = caster->GetPositionZ() + 2.5f;
float nx = caster->GetPositionX() + dist * cos(angle); 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)) if (!caster->IsWithinLOS(nx, ny, z))
{ {
nx = caster->GetPositionX() + 0.5f * cos(angle); 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)) if (caster->IsWithinLOS(nx, ny, z))
@@ -599,7 +599,7 @@ public:
for (uint8 i = 0; i < 4; ++i) for (uint8 i = 0; i < 4; ++i)
{ {
float nx = x + 2.5f * cos((M_PI / 4) + (i * (M_PI / 2))); 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)) if (caster->IsWithinLOS(nx, ny, z))
{ {
caster->m_orientation = (M_PI / 4) + (i * (M_PI / 2)); caster->m_orientation = (M_PI / 4) + (i * (M_PI / 2));
@@ -2541,7 +2541,7 @@ public:
me->CastSpell((Unit*)nullptr, SPELL_EJECT_ALL_PASSENGERS, false); me->CastSpell((Unit*)nullptr, SPELL_EJECT_ALL_PASSENGERS, false);
float dist = rand_norm() * 10.0f + 5.0f; float dist = rand_norm() * 10.0f + 5.0f;
float angle = CenterPosition.GetAngle(me); 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); me->SetHomePosition(_destPoint);
_events.Reset(); _events.Reset();
_events.ScheduleEvent(EVENT_MOVE_TO_SIPHON_POS, 0); _events.ScheduleEvent(EVENT_MOVE_TO_SIPHON_POS, 0);
@@ -2773,7 +2773,7 @@ public:
{ {
float dist = 2.0f + rand_norm() * 18.0f; float dist = 2.0f + rand_norm() * 18.0f;
float angle = rand_norm() * 2 * M_PI; 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()); WorldLocation* dest = const_cast<WorldLocation*>(GetExplTargetDest());
dest->RelocateOffset(offset); dest->RelocateOffset(offset);
GetHitDest()->RelocateOffset(offset); GetHitDest()->RelocateOffset(offset);
@@ -3232,7 +3232,7 @@ public:
float angle = lichKing->GetAngle(me); float angle = lichKing->GetAngle(me);
Movement::PointsArray path; Movement::PointsArray path;
path.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ())); 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); me->GetMotionMaster()->MoveSplinePath(&path);
} }
break; break;
@@ -1158,7 +1158,7 @@ public:
float startAngle = 3 * M_PI / 2; float startAngle = 3 * M_PI / 2;
float maxAddAngle = ((target->GetMap()->GetSpawnMode() % 2) == 0 ? M_PI : 2 * M_PI); float maxAddAngle = ((target->GetMap()->GetSpawnMode() % 2) == 0 ? M_PI : 2 * M_PI);
float angle = startAngle + rand_norm() * maxAddAngle; 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 void Register() override
@@ -3215,7 +3215,7 @@ public:
float angle = who->GetAngle(me); float angle = who->GetAngle(me);
float dist = 3.0f; float dist = 3.0f;
pos.m_positionX += cos(angle) * dist; 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); 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 dist = frand(18.0f, 39.0f);
float o = rand_norm() * 2 * M_PI; 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->CastSpell(broodling, SPELL_WEB_BEAM2, false);
broodling->GetMotionMaster()->MovePoint(POINT_ENTER_COMBAT, broodling->GetPositionX(), broodling->GetPositionY(), 213.03f, false); broodling->GetMotionMaster()->MovePoint(POINT_ENTER_COMBAT, broodling->GetPositionX(), broodling->GetPositionY(), 213.03f, false);
@@ -179,7 +179,7 @@ public:
for (uint8 j = 0; j < 8; ++j) for (uint8 j = 0; j < 8; ++j)
{ {
float angle = M_PI * 2 / 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) for (uint8 i = 6; i < 12; ++i)
@@ -188,7 +188,7 @@ public:
{ {
float dist = j == 2 ? 0.0f : 8.0f; // second in middle float dist = j == 2 ? 0.0f : 8.0f; // second in middle
float angle = SummonGroups[i].GetOrientation() + M_PI * 2 / 4 * j; 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) for (uint8 i = 6; i < 12; ++i)
@@ -196,7 +196,7 @@ public:
for (uint8 j = 0; j < 1; ++j) for (uint8 j = 0; j < 1; ++j)
{ {
float angle = SummonGroups[i].GetOrientation() + M_PI; 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);
} }
} }
} }
@@ -260,7 +260,7 @@ public:
{ {
float angle = me->GetOrientation(); float angle = me->GetOrientation();
float dist = 75.0f; 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); me->CastSpell(c, SPELL_PORTAL_BEAM, false);
timer2 = INTRO_MOVEMENT_INTERVAL - 10000; timer2 = INTRO_MOVEMENT_INTERVAL - 10000;
} }
@@ -399,7 +399,7 @@ public:
me->RemoveAllAuras(); me->RemoveAllAuras();
float angle = CenterPos.GetAngle(me); float angle = CenterPos.GetAngle(me);
float x = CenterPos.GetPositionX() + cos(angle) * 35.0f; 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(); float z = FourSidesPos[0].GetPositionZ();
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
me->GetMotionMaster()->MovePoint(MI_POINT_INTRO_CENTER_AIR, x, y, z); me->GetMotionMaster()->MovePoint(MI_POINT_INTRO_CENTER_AIR, x, y, z);
@@ -485,7 +485,7 @@ public:
Position pos; Position pos;
float angle = (me->GetOrientation() >= M_PI / 4 ? me->GetOrientation() - M_PI / 4 : 7 * M_PI / 4 + me->GetOrientation()); 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_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_positionZ = CenterPos.GetPositionZ() + 20.0f;
pos.m_orientation = pos.GetAngle(&CenterPos); pos.m_orientation = pos.GetAngle(&CenterPos);
@@ -504,7 +504,7 @@ public:
Position plrpos; Position plrpos;
float playerAngle = CenterPos.GetAngle(pPlayer); float playerAngle = CenterPos.GetAngle(pPlayer);
plrpos.m_positionX = CenterPos.GetPositionX() + cos(playerAngle) * 5.0f; 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_positionZ = CenterPos.GetPositionZ() + 18.0f;
plrpos.m_orientation = plrpos.GetAngle(&CenterPos); plrpos.m_orientation = plrpos.GetAngle(&CenterPos);
@@ -599,7 +599,7 @@ public:
{ {
float dist = 22.0f; float dist = 22.0f;
float angle = M_PI / 2 + ((float)i / MAX_NEXUS_LORDS) * 2 * M_PI; 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)) if (Creature* c = me->SummonCreature(NPC_NEXUS_LORD, *disk, TEMPSUMMON_MANUAL_DESPAWN, 0))
{ {
c->EnterVehicle(disk, 0); c->EnterVehicle(disk, 0);
@@ -610,7 +610,7 @@ public:
{ {
float dist = 30.0f; float dist = 30.0f;
float angle = 0.0f + ((float)i / MAX_SCIONS_OF_ETERNITY) * 2 * M_PI; 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)) if (Creature* c = me->SummonCreature(NPC_SCION_OF_ETERNITY, *disk, TEMPSUMMON_MANUAL_DESPAWN, 0))
{ {
c->EnterVehicle(disk, 0); c->EnterVehicle(disk, 0);
@@ -626,7 +626,7 @@ public:
float dist = urand(5, 30); float dist = urand(5, 30);
float angle = rand_norm() * 2 * M_PI; float angle = rand_norm() * 2 * M_PI;
float posx = CenterPos.GetPositionX() + cos(angle) * dist; 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->SetFacingTo(me->GetAngle(posx, posy));
me->CastSpell(posx, posy, CenterPos.GetPositionZ() + 1.5f, SPELL_ARCANE_OVERLOAD, true); me->CastSpell(posx, posy, CenterPos.GetPositionZ() + 1.5f, SPELL_ARCANE_OVERLOAD, true);
events.RepeatEvent(15000); events.RepeatEvent(15000);
@@ -639,7 +639,7 @@ public:
float dist = Phase2NorthPos.GetExactDist2d(&CenterPos); float dist = Phase2NorthPos.GetExactDist2d(&CenterPos);
float newangle = angle + 0.5f; float newangle = angle + 0.5f;
if (newangle >= 2 * M_PI) newangle -= 2 * M_PI; 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; break;
case EVENT_MOVE_TO_SURGE_OF_POWER: case EVENT_MOVE_TO_SURGE_OF_POWER:
@@ -648,7 +648,7 @@ public:
float angle = CenterPos.GetAngle(me); float angle = CenterPos.GetAngle(me);
me->GetMotionMaster()->MoveIdle(); me->GetMotionMaster()->MoveIdle();
me->StopMoving(); 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 events.CancelEventGroup(1); // everything beside berserk
} }
break; break;
@@ -878,7 +878,7 @@ public:
float angle = CenterPos.GetAngle(me); float angle = CenterPos.GetAngle(me);
Position pos; Position pos;
pos.m_positionX = CenterPos.GetPositionX() + VORTEX_RADIUS * cos(angle); 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_positionZ = CenterPos.GetPositionZ() + h;
pos.m_orientation = pos.GetAngle(&CenterPos); pos.m_orientation = pos.GetAngle(&CenterPos);
me->SetPosition(pos); me->SetPosition(pos);
@@ -934,7 +934,7 @@ public:
if (newangle >= 2 * M_PI) if (newangle >= 2 * M_PI)
newangle -= 2 * M_PI; newangle -= 2 * M_PI;
float newx = CenterPos.GetPositionX() + VORTEX_RADIUS * cos(newangle); 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 arcangle = me->GetAngle(newx, newy);
float dist = 2 * me->GetDistance2d(newx, newy); float dist = 2 * me->GetDistance2d(newx, newy);
if (me->GetVehicleKit()) if (Unit* pass = me->GetVehicleKit()->GetPassenger(0)) if (Player* plr = pass->ToPlayer()) if (me->GetVehicleKit()) if (Unit* pass = me->GetVehicleKit()->GetPassenger(0)) if (Player* plr = pass->ToPlayer())
@@ -949,7 +949,7 @@ public:
sScriptMgr->AnticheatSetUnderACKmount(plr); 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); me->Relocate(newx, newy);
} }
@@ -1333,7 +1333,7 @@ public:
if (newangle < 0.0f) newangle += 2 * M_PI; if (newangle < 0.0f) newangle += 2 * M_PI;
float newz = me->GetPositionZ() - 4.0f; float newz = me->GetPositionZ() - 4.0f;
if (newz < CenterPos.GetPositionZ()) newz = CenterPos.GetPositionZ(); 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; break;
case NPC_SCION_OF_ETERNITY: case NPC_SCION_OF_ETERNITY:
@@ -1343,7 +1343,7 @@ public:
if (newangle < 0.0f) newangle += 2 * M_PI; if (newangle < 0.0f) newangle += 2 * M_PI;
float newz = me->GetPositionZ() - 2.0f; float newz = me->GetPositionZ() - 2.0f;
if (newz < CenterPos.GetPositionZ() + 20.0f) newz = CenterPos.GetPositionZ() + 20.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; break;
} }
@@ -164,7 +164,7 @@ public:
{ {
float o = rand_norm() * 2.0f * M_PI; float o = rand_norm() * 2.0f * M_PI;
float x = me->GetPositionX() + 5.0f * _spikesCount * cos(o); 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()); float h = me->GetMapHeight(x, y, me->GetPositionZ());
if (h != INVALID_HEIGHT) if (h != INVALID_HEIGHT)
@@ -162,7 +162,7 @@ public:
for( uint8 i = 0; i < 2; ++i ) for( uint8 i = 0; i < 2; ++i )
{ {
float angle = rand_norm() * 2 * M_PI; 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); events.RepeatEvent(2000);
} }
@@ -171,7 +171,7 @@ public:
for( uint8 i = 0; i < 4; ++i ) for( uint8 i = 0; i < 4; ++i )
{ {
float angle = rand_norm() * 2 * M_PI; 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; break;
@@ -201,7 +201,7 @@ public:
{ {
float dist = rand_norm() * 40.0f; float dist = rand_norm() * 40.0f;
float angle = rand_norm() * 2 * M_PI; 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 void MovementInform(uint32 type, uint32 id) override
@@ -747,7 +747,7 @@ public:
_channelTimer = 0; _channelTimer = 0;
float o = urand(0, 5) * M_PI / 3.0f; float o = urand(0, 5) * M_PI / 3.0f;
me->InterruptNonMeleeSpells(false); 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);
} }
} }
@@ -465,7 +465,7 @@ public:
{ {
if (aurEff->GetTotalTicks() >= 0 && aurEff->GetTickNumber() == uint32(aurEff->GetTotalTicks())) if (aurEff->GetTotalTicks() >= 0 && aurEff->GetTickNumber() == uint32(aurEff->GetTotalTicks()))
if (Unit* c = GetCaster()) 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 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); s->CastSpell(s, (aurEff->GetId() == 62546 ? SPELL_SCORCHED_GROUND_10 : SPELL_SCORCHED_GROUND_25), true);
@@ -471,11 +471,11 @@ public:
Player* player = pg[index]; Player* player = pg[index];
float angle = rand_norm() * 2 * M_PI; float angle = rand_norm() * 2 * M_PI;
float z = 364.35f; 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); 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); pg.erase(pg.begin() + index);
} }
@@ -789,7 +789,7 @@ public:
float angle = VX001->GetOrientation(); float angle = VX001->GetOrientation();
float v_x = me->GetPositionX() + cos(angle) * 10.0f; 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); me->GetMotionMaster()->MoveJump(v_x, v_y, 364.32f, 7.0f, 7.0f);
if( pInstance ) if( pInstance )
@@ -1454,7 +1454,7 @@ public:
trigger->CastSpell(trigger, SPELL_ROCKET_STRIKE_AURA, true); trigger->CastSpell(trigger, SPELL_ROCKET_STRIKE_AURA, true);
Position exitPos = r->GetPosition(); Position exitPos = r->GetPosition();
exitPos.m_positionX += cos(me->GetOrientation()) * 2.35f; 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; exitPos.m_positionZ += 2.0f * Phase;
r->_ExitVehicle(&exitPos); r->_ExitVehicle(&exitPos);
me->RemoveAurasByType(SPELL_AURA_CONTROL_VEHICLE, r->GetGUID()); me->RemoveAurasByType(SPELL_AURA_CONTROL_VEHICLE, r->GetGUID());
@@ -1760,7 +1760,7 @@ public:
float angle = victim->GetAngle(me->GetPositionX(), me->GetPositionY()); float angle = victim->GetAngle(me->GetPositionX(), me->GetPositionY());
me->SetOrientation( me->GetAngle(victim->GetPositionX(), victim->GetPositionY()) ); me->SetOrientation( me->GetAngle(victim->GetPositionX(), victim->GetPositionY()) );
float x = victim->GetPositionX() + 15.0f * cos(angle); 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 // check if there's magnetic core in line of movement
Creature* mc = nullptr; 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 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; 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));
} }
} }
@@ -412,7 +412,7 @@ public:
for( int j = 0; j < 4; ++j ) for( int j = 0; j < 4; ++j )
{ {
float x = cords[i][0] + 4.0f * cos(j * M_PI / 2); 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; uint32 npc_entry = 0;
switch( opt ) switch( opt )
@@ -878,7 +878,7 @@ public:
if (!fs->AI()->GetData(2)) if (!fs->AI()->GetData(2))
{ {
float a = rand_norm() * M_PI; 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(); fixingGUID = fs->GetGUID();
return; return;
} }
@@ -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))) if ((cr = me->SummonCreature((_spawnCommoners ? NPC_DARK_RUNE_COMMONER : RollTable[urand(0, 2)]), ArenaNPCs[rnd], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000)))
cr->GetMotionMaster()->MoveJump( cr->GetMotionMaster()->MoveJump(
Middle.GetPositionX() + urand(19, 24) * cos(Middle.GetAngle(cr)), 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); Middle.GetPositionZ(), 20, 20);
} }
} }
@@ -534,7 +534,7 @@ public:
uint32 dist = urand(38, 48); uint32 dist = urand(38, 48);
float o = rand_norm() * M_PI * 2; float o = rand_norm() * M_PI * 2;
float Zplus = (dist - 38) / 6.5f; 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_TENTACLE_ERUPT, true);
cr->CastSpell(cr, SPELL_VOID_ZONE_SMALL, true); cr->CastSpell(cr, SPELL_VOID_ZONE_SMALL, true);
@@ -549,7 +549,7 @@ public:
uint32 dist = urand(38, 48); uint32 dist = urand(38, 48);
float o = rand_norm() * M_PI * 2; float o = rand_norm() * M_PI * 2;
float Zplus = (dist - 38) / 6.5f; 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) for (uint8 i = 0; i <= dist; ++i)
{ {
float angle = M_PI * 2 / 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 else
@@ -955,7 +955,7 @@ public:
for (uint8 i = 0; i <= dist; ++i) for (uint8 i = 0; i <= dist; ++i)
{ {
float angle = M_PI * 2 - (M_PI * 2 / 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); uint32 dist = urand(38, 48);
float o = rand_norm() * M_PI * 2; float o = rand_norm() * M_PI * 2;
float Zplus = (dist - 38) / 6.5f; 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 void JustDied(Unit* /*who*/) override
@@ -137,7 +137,7 @@ public:
{ {
float a = rand_norm() * 2 * M_PI; float a = rand_norm() * 2 * M_PI;
float d = rand_norm() * 4.0f; 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); c->AI()->AttackStart(who);
} }
} }
@@ -214,7 +214,7 @@ public:
{ {
float dist = rand_norm() * 4 + 3.0f; float dist = rand_norm() * 4 + 3.0f;
float angle = rand_norm() * 2 * M_PI; 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) ) if( Unit* target = c->SelectNearestTarget(250.0f) )
{ {
c->AddThreat(target, 5.0f); c->AddThreat(target, 5.0f);
@@ -198,9 +198,9 @@ public:
float angle = rand_norm() * 2 * M_PI; float angle = rand_norm() * 2 * M_PI;
Position p1(SpawnLoc[i]), p2(SpawnLoc[i]); Position p1(SpawnLoc[i]), p2(SpawnLoc[i]);
p1.m_positionX += 2.5f * cos(angle); 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_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, p1, 60000, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN);
DoSummon(NPC_ICHOR_GLOBULE, p2, 60000, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN); DoSummon(NPC_ICHOR_GLOBULE, p2, 60000, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN);
} }
@@ -477,7 +477,7 @@ public:
float dist = position->GetExactDist2d(player->GetPositionX(), player->GetPositionY()); float dist = position->GetExactDist2d(player->GetPositionX(), player->GetPositionY());
float elevation = GetSpell()->m_targets.GetElevation(); 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; float speedXY = dist * 10.0f / speedZ;
player->GetMotionMaster()->MoveJump(position->GetPositionX(), position->GetPositionY(), position->GetPositionZ(), speedXY, speedZ); player->GetMotionMaster()->MoveJump(position->GetPositionX(), position->GetPositionY(), position->GetPositionZ(), speedXY, speedZ);
@@ -507,7 +507,7 @@ public:
_landgrenGUID = cr->GetGUID(); _landgrenGUID = cr->GetGUID();
float o = cr->GetAngle(me); 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); events.RescheduleEvent(EVENT_SOUL_COAX, 5000);
} }
else else
@@ -913,7 +913,7 @@ public:
if (summon->GetEntry() == NPC_DISGUISED_CRUSADER) if (summon->GetEntry() == NPC_DISGUISED_CRUSADER)
{ {
summon->SetWalk(false); 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; break;
} }
@@ -929,7 +929,7 @@ public:
switch (phase) switch (phase)
{ {
case 1: 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); orphan->AI()->Talk(TEXT_WOLVAR_ORPHAN_6);
timer = 5000; timer = 5000;
break; break;
@@ -267,7 +267,7 @@ public:
{ {
ghoul->SetReactState(REACT_DEFENSIVE); ghoul->SetReactState(REACT_DEFENSIVE);
float o = me->GetAngle(ghoul); 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; checkTimer = 1;
findTimer = 0; findTimer = 0;
} }
@@ -451,7 +451,7 @@ public:
me->SetFacingToObject(cr); me->SetFacingToObject(cr);
lichGUID = cr->GetGUID(); lichGUID = cr->GetGUID();
float o = me->GetAngle(cr); 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; break;
case EVENT_RECRUIT_2: case EVENT_RECRUIT_2:
me->SetWalk(true); 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); me->DespawnOrUnsummon(5000);
break; break;
default: default:
@@ -253,7 +253,7 @@ public:
Talk(SAY_SUMMON); Talk(SAY_SUMMON);
me->CastSpell(me, SPELL_BANISH_SELF, true); me->CastSpell(me, SPELL_BANISH_SELF, true);
for (uint8 i = 0; i < 5; ++i) 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 void UpdateAI(uint32 diff) override
@@ -341,7 +341,7 @@ public:
{ {
float dist = frand(30.0f, 32.0f); float dist = frand(30.0f, 32.0f);
summon->SetWalk(true); 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); summons.Summon(summon);
} }
@@ -232,7 +232,7 @@ public:
{ {
float dist = (float)urand(3, 10); float dist = (float)urand(3, 10);
float angle = rand_norm() * 2 * M_PI; 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); events.RepeatEvent(30000);
} }
break; break;
@@ -241,12 +241,12 @@ public:
{ {
float dist = (float)urand(3, 10); float dist = (float)urand(3, 10);
float angle = rand_norm() * 2 * M_PI; 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 dist = (float)urand(3, 10);
float angle = rand_norm() * 2 * M_PI; 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); events.RepeatEvent(6000);
break; break;
@@ -170,9 +170,9 @@ public:
{ {
float o = rand_norm() * 2 * M_PI; float o = rand_norm() * 2 * M_PI;
if (i == 0) 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 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; break;
case EVENT_SUMMON_ADDS: case EVENT_SUMMON_ADDS:
@@ -1036,7 +1036,7 @@ public:
{ {
PreventHitEffect(effIndex); PreventHitEffect(effIndex);
for (uint32 i = 0; i < 5; ++i) 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 void Register() override
+1 -1
View File
@@ -156,7 +156,7 @@ public:
me->SetSpeed(MOVE_FLIGHT, 1.0f, true); me->SetSpeed(MOVE_FLIGHT, 1.0f, true);
me->SetSpeed(MOVE_RUN, 1.0f, true); me->SetSpeed(MOVE_RUN, 1.0f, true);
float x = me->GetPositionX() + 20 * cos(me->GetOrientation()); 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; float z = me->GetPositionZ() + 40;
me->DisableSpline(); me->DisableSpline();
me->GetMotionMaster()->Clear(false); me->GetMotionMaster()->Clear(false);
+1 -1
View File
@@ -89,7 +89,7 @@ struct npc_pet_mage_mirror_image : CasterAI
((Minion*)me)->SetFollowAngle(angle); ((Minion*)me)->SetFollowAngle(angle);
if (owner->IsInCombat()) 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 else
me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle(), MOTION_SLOT_ACTIVE); me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle(), MOTION_SLOT_ACTIVE);
+2 -2
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) if (caster->ToPlayer()->GetQuestStatus(12014 /*QUEST_STEADY_AS_A_ROCK*/) == QUEST_STATUS_INCOMPLETE)
{ {
float x = caster->GetPositionX() + 3.0f * cos(caster->GetOrientation()); 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; 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); 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 o = Position::NormalizeOrientation(caster->GetOrientation() + frand(0.0f, 2 * M_PI));
float dist = frand(5.0f, 30.0f); float dist = frand(5.0f, 30.0f);
_x = caster->GetPositionX() + dist * cos(o); _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); _z = caster->GetPositionZ() + frand(-10.0f, 15.0f);
GetSpell()->m_targets.SetDst(_x, _y, _z, 0.0f, caster->GetMapId()); GetSpell()->m_targets.SetDst(_x, _y, _z, 0.0f, caster->GetMapId());
return SPELL_CAST_OK; return SPELL_CAST_OK;
+1 -1
View File
@@ -295,7 +295,7 @@ public:
requireSummon = 0; requireSummon = 0;
int8 count = urand(1, 3); int8 count = urand(1, 3);
for (int8 i = 0; i < count; ++i) 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 void OnStateChanged(uint32 state, Unit* /*unit*/) override