From e2029c363323d8bde195a302b6934497b57197ba Mon Sep 17 00:00:00 2001 From: sudlud Date: Wed, 15 May 2024 20:41:59 +0200 Subject: [PATCH] fix(Core/BattlegroundAV): spawn generic gameobjects in Alterac Valley (#18764) * fix(Scripts/PVP): correctly spawn generic gameobjects in Alterac Valley I've been "collecting" these in the DB for a while, now it's time to move these spawns to the AV script and actually spawn them. * add 2 additional generic gameobjects --- .../rev_1713526355691722800.sql | 3 + .../Battlegrounds/Zones/BattlegroundAV.cpp | 24 +++++ .../game/Battlegrounds/Zones/BattlegroundAV.h | 95 ++++++++++++++++++- 3 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 data/sql/updates/pending_db_world/rev_1713526355691722800.sql diff --git a/data/sql/updates/pending_db_world/rev_1713526355691722800.sql b/data/sql/updates/pending_db_world/rev_1713526355691722800.sql new file mode 100644 index 00000000000000..d6c2c54e7230b1 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1713526355691722800.sql @@ -0,0 +1,3 @@ +-- clear all gameobjects in map 30 "Alterac Valley" +-- these will be spawned in the bg script +DELETE FROM `gameobject` WHERE `map` = 30; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index d9369ec4878c8c..7f2c7cb3ef8c05 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -1349,6 +1349,26 @@ bool BattlegroundAV::SetupBattleground() return false; } + // Generic gameobjects + for (uint16 i = 0; i <= (BG_AV_OBJECT_GENERIC_MAX - BG_AV_OBJECT_GENERIC_MIN); i++) + { + if (!AddObject(BG_AV_OBJECT_GENERIC_MIN + i, + std::get<0>(BG_AV_GenericObjectPos[i]), + std::get<1>(BG_AV_GenericObjectPos[i]).GetPositionX(), + std::get<1>(BG_AV_GenericObjectPos[i]).GetPositionY(), + std::get<1>(BG_AV_GenericObjectPos[i]).GetPositionZ(), + std::get<1>(BG_AV_GenericObjectPos[i]).GetOrientation(), + std::get<2>(BG_AV_GenericObjectPos[i])[0], + std::get<2>(BG_AV_GenericObjectPos[i])[1], + std::get<2>(BG_AV_GenericObjectPos[i])[2], + std::get<2>(BG_AV_GenericObjectPos[i])[3], + RESPAWN_ONE_DAY)) + { + LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!10.{}", i); + return false; + } + } + // 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, std::sin(BG_AV_ObjectPos[AV_OPLACE_FROSTWOLF_BANNER][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_FROSTWOLF_BANNER][3] / 2), RESPAWN_ONE_DAY)) { @@ -1404,6 +1424,10 @@ bool BattlegroundAV::SetupBattleground() for (i = BG_AV_OBJECT_HANDPACKED_SNOWDRIFT_MIN ; i <= BG_AV_OBJECT_HANDPACKED_SNOWDRIFT_MAX; i++) SpawnBGObject(i, RESPAWN_IMMEDIATELY); + // Generic gameobjects + for (uint16 i = BG_AV_OBJECT_GENERIC_MIN; i <= BG_AV_OBJECT_GENERIC_MAX; i++) + SpawnBGObject(i, RESPAWN_IMMEDIATELY); + // Quest banners SpawnBGObject(BG_AV_OBJECT_FROSTWOLF_BANNER, RESPAWN_IMMEDIATELY); SpawnBGObject(BG_AV_OBJECT_STORMPIKE_BANNER, RESPAWN_IMMEDIATELY); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h index 3768004febc13b..7a395bfd085fc8 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h @@ -324,8 +324,10 @@ enum BG_AV_ObjectTypes BG_AV_OBJECT_HANDPACKED_SNOWDRIFT_MAX = 246, BG_AV_OBJECT_FROSTWOLF_BANNER = 247, BG_AV_OBJECT_STORMPIKE_BANNER = 248, + BG_AV_OBJECT_GENERIC_MIN = 249, + BG_AV_OBJECT_GENERIC_MAX = 323, - BG_AV_OBJECT_MAX = 249 + BG_AV_OBJECT_MAX = 324 }; enum BG_AV_OBJECTS @@ -565,6 +567,97 @@ const float BG_AV_ObjectPos[AV_OPLACE_MAX][4] = {40.0913f, 0.0153897f, -4.0962f, 0.96131f} }; +// GO template ID, Position, rotation0-3, VerifiedBuild +std::tuple> const BG_AV_GenericObjectPos[BG_AV_OBJECT_GENERIC_MAX - BG_AV_OBJECT_GENERIC_MIN + 1] = +{ + // Burning Embers + { 3832, { -1235.57f, -241.478f, 73.4377f, 1.48353f }, { 0.0f, 0.0f, 0.67559f, 0.737278f } }, // 46248 + { 3833, { -1248.85f, -254.06f, 73.4377f, 1.48353f }, { 0.0f, 0.0f, 0.67559f, 0.737278f } }, // 46248 + { 3834, { -1248.15f, -245.599f, 73.4377f, 6.23083f }, { 0.0f, 0.0f, -0.0261765f, 0.999657f } }, // 46248 + { 3835, { -1237.21f, -260.168f, 73.4377f, 1.48353f }, { 0.0f, 0.0f, 0.67559f, 0.737278f } }, // 46248 + { 3836, { -1260.37f, -248.767f, 77.9454f, 1.48353f }, { 0.0f, 0.0f, 0.67559f, 0.737278f } }, // 46248 + { 3837, { -1249.32f, -244.907f, 92.3372f, 0.401425f }, { 0.0f, 0.0f, 0.199368f, 0.979925f } }, // 46248 + { 3838, { -1250.09f, -254.604f, 92.3015f, 0.148352f }, { 0.0f, 0.0f, 0.0741081f, 0.99725f } }, // 46248 + // Wooden Chair + { 28048, { 41.1672f, -426.866f, 44.6828f, 2.7838f }, { 0.0f, 0.0f, 0.98404f, 0.177946f } }, // 52237 + { 28049, { 39.0988f, -425.746f, 44.688f, 5.66359f }, { 0.0f, 0.0f, -0.304864f, 0.952396f } }, // 52237 + { 28605, { 25.2482f, -433.104f, 47.6369f, 2.38237f }, { 0.0f, 0.0f, 0.928809f, 0.370558f } }, // 52237 + { 28606, { 25.758f, -425.837f, 47.6369f, 4.30224f }, { 0.0f, 0.0f, -0.836286f, 0.548294f } }, // 52237 + { 28607, { 27.6786f, -427.69f, 47.6369f, 3.60411f }, { 0.0f, 0.0f, -0.973379f, 0.229201f } }, // 52237 + // Anvil + { 32571, { -100.071f, -583.512f, 41.7316f, 0.00872424f }, { 0.0f, 0.0f, 0.00436211f, 0.99999f } }, // 46248 + { 32572, { -102.733f, -588.775f, 41.7316f, 5.24472f }, { 0.0f, 0.0f, -0.496216f, 0.868199f } }, // 46248 + { 32573, { -100.966f, -586.958f, 41.7316f, 5.76831f }, { 0.0f, 0.0f, -0.254601f, 0.967046f } }, // 46248 + { 32574, { -106.172f, -589.721f, 41.7316f, 4.72112f }, { 0.0f, 0.0f, -0.704014f, 0.710186f } }, // 46248 + { 51704, { -1245.2f, -307.059f, 63.3199f, 3.0796f }, { -0.00711155f, -0.0236301f, 0.99922f, 0.0308324f } }, // 46248 + { 51705, { -1258.23f, -310.977f, 63.2015f, 0.862903f }, { 0.0179744f, -0.0169086f, 0.418255f, 0.907994f } }, // 46248 + { 161489, { 360.38f, -527.549f, 71.1205f, 4.23242f }, { 0.0f, 0.0f, -0.854912f, 0.518773f } }, // 46248 + { 178685, { 646.207f, -57.2431f, 41.6587f, 6.12611f }, { 0.0f, 0.0f, -0.0784588f, 0.996917f } }, // 46248 + { 179391, { 548.682f, -100.846f, 44.8191f, 1.46608f }, { 0.0f, 0.0f, 0.66913f, 0.743145f } }, // 46248 + { 179391, { -172.363f, -452.824f, 33.2796f, 0.628319f }, { 0.0f, 0.0f, 0.309017f, 0.951056f } }, // 46248 + { 179392, { 552.429f, -102.764f, 44.8191f, 2.46964f }, { 0.0f, 0.0f, 0.944089f, 0.329691f } }, // 46248 + { 179392, { -171.282f, -456.892f, 33.2796f, 1.63188f }, { 0.0f, 0.0f, 0.728371f, 0.685183f } }, // 46248 + { 179393, { 549.472f, -101.547f, 44.8191f, 1.16064f }, { 0.0f, 0.0f, 0.548293f, 0.836286f } }, // 46248 + { 179393, { -172.356f, -453.88f, 33.2796f, 0.322884f }, { 0.0f, 0.0f, 0.160742f, 0.986997f } }, // 46248 + { 179394, { 550.347f, -101.698f, 44.8191f, 1.59698f }, { 0.0f, 0.0f, 0.716302f, 0.69779f } }, // 46248 + { 179394, { -171.882f, -454.632f, 33.2796f, 0.759217f }, { 0.0f, 0.0f, 0.370557f, 0.92881f } }, // 46248 + { 179395, { 551.271f, -102.226f, 44.8191f, 0.898843f }, { 0.0f, 0.0f, 0.434444f, 0.900699f } }, // 46248 + { 179395, { -171.656f, -455.671f, 33.2796f, 0.0610847f }, { 0.0f, 0.0f, 0.0305376f, 0.999534f } }, // 46248 + { 179396, { -170.699f, -458.41f, 33.2796f, 5.25344f }, { 0.0f, 0.0f, -0.492423f, 0.870356f } }, // 46248 + { 179396, { 553.947f, -103.347f, 44.8191f, 6.0912f }, { 0.0f, 0.0f, -0.0958452f, 0.995396f } }, // 46248 + { 179397, { -170.14f, -457.609f, 33.2796f, 5.60251f }, { 0.0f, 0.0f, -0.333806f, 0.942642f } }, // 46248 + { 179397, { 553.725f, -102.396f, 44.8191f, 0.157079f }, { 0.0f, 0.0f, 0.0784588f, 0.996917f } }, // 46248 + // Forge + { 34571, { -105.423f, -584.352f, 42.0149f, 2.36492f }, { 0.0f, 0.0f, 0.92554f, 0.37865f } }, // 46248 + { 161487, { 361.097f, -531.693f, 71.1898f, 4.12771f }, { 0.0f, 0.0f, -0.88089f, 0.473321f } }, // 46248 + { 178684, { 649.264f, -59.1111f, 41.5476f, 3.59538f }, { 0.0f, 0.0f, -0.97437f, 0.224951f } }, // 46248 + // Bonfire + { 161488, { 360.915f, -497.099f, 71.3389f, 3.14159f }, { 0.0f, 0.0f, -1.0f, 0.0f } }, // 46248 + { 177408, { -743.427f, -398.241f, 76.4266f, 0.872664f }, { 0.0173936f, -0.00633049f, 0.422701f, 0.90608f } }, // 46248 + // Brazier + { 177261, { -1290.27f, -172.47f, 72.1853f, 3.06302f }, { 0.00871992f, -0.00034237f, 0.99919f, 0.0392748f } }, // 46248 + { 177292, { -1099.21f, -266.231f, 57.8849f, 3.99681f }, { 0.0f, 0.0f, -0.909961f, 0.414694f } }, // 46248 + { 177293, { -1082.6f, -266.681f, 57.8575f, 2.40855f }, { 0.0f, 0.0f, 0.933579f, 0.35837f } }, // 46248 + { 177405, { -1140.82f, -343.392f, 50.9077f, 3.49939f }, { 0.0f, 0.0f, -0.98404f, 0.177946f } }, // 46248 + { 177406, { -1139.68f, -356.288f, 51.264f, 5.57633f }, { 0.0f, 0.0f, -0.346116f, 0.938192f } }, // 46248 + { 177409, { -1215.59f, -371.946f, 56.5293f, 0.357792f }, { 0.0f, 0.0f, 0.177943f, 0.984041f } }, // 46248 + { 177410, { -1241.25f, -345.115f, 59.6867f, 0.357792f }, { 0.0f, 0.0f, 0.177943f, 0.984041f } }, // 46248 + { 177411, { -1202.81f, -271.599f, 72.5805f, 0.357792f }, { 0.0f, 0.0f, 0.177943f, 0.984041f } }, // 46248 + { 177412, { -1282.21f, -284.083f, 87.256f, 6.2221f }, { 0.0f, 0.0f, -0.0305376f, 0.999534f } }, // 46248 + { 177413, { -1256.55f, -280.278f, 73.9473f, 6.2221f }, { 0.0f, 0.0f, -0.0305376f, 0.999534f } }, // 46248 + { 179419, { -1423.16f, -318.436f, 89.1136f, 2.35619f }, { 0.0f, 0.0f, 0.923879f, 0.382686f } }, // 46248 + // Campfire + { 177262, { -1286.25f, -184.481f, 71.8334f, 4.23243f }, { -0.00733089f, -0.0299597f, -0.854258f, 0.518934f } }, // 46248 + { 177263, { -1280.17f, -220.536f, 72.2686f, 1.62315f }, { 0.0f, 0.0f, 0.725373f, 0.688356f } }, // 46248 + { 177324, { -375.017f, -523.71f, 84.0771f, 3.14159f }, { 0.0f, 0.0f, -1.0f, 0.0f } }, // 46248 + { 177325, { -413.51f, -521.413f, 84.0771f, 2.05948f }, { 0.0f, 0.0f, 0.857166f, 0.51504f } }, // 46248 + { 177326, { -487.401f, -526.486f, 82.5708f, 5.47161f }, { 0.0f, 0.0f, -0.394743f, 0.918792f } }, // 46248 + { 177327, { -251.556f, -562.061f, 68.1725f, 6.11738f }, { 0.0f, 0.0f, -0.0828075f, 0.996566f } }, // 46248 + { 177425, { -353.118f, 37.0955f, 65.8904f, 3.14159f }, { 0.0f, 0.0f, -1.0f, 0.0f } }, // 48632 + { 179945, { -1070.53f, -617.908f, 51.3249f, 5.83813f }, { 0.0f, 0.0f, -0.220697f, 0.975342f } }, // 46248 + // Cauldron + { 177396, { 12.8247f, -120.21f, 41.6669f, 3.14159f }, { 0.0f, 0.0f, -1.0f, 0.0f } }, // 46248 + // Chair + { 179384, { -145.341f, -444.846f, 26.4163f, 6.23083f }, { 0.0f, 0.0f, -0.0261765f, 0.999657f } }, // 52237 + { 179384, { 560.834f, -75.4266f, 37.9558f, 0.785397f }, { 0.0f, 0.0f, 0.382683f, 0.92388f } }, // 52237 + { 179385, { 550.678f, -79.8234f, 44.8257f, 3.18527f }, { 0.0f, 0.0f, -0.999762f, 0.0218352f } }, // 52237 + { 179385, { -155.405f, -440.24f, 33.2862f, 2.34747f }, { 0.0f, 0.0f, 0.922201f, 0.38671f } }, // 52237 + { 179386, { 568.326f, -89.4992f, 37.9558f, 1.39626f }, { 0.0f, 0.0f, 0.642787f, 0.766045f } }, // 52237 + { 179386, { -150.787f, -459.829f, 26.4163f, 0.558504f }, { 0.0f, 0.0f, 0.275637f, 0.961262f } }, // 52237 + { 179387, { 550.597f, -77.5213f, 44.8257f, 4.23242f }, { 0.0f, 0.0f, -0.854912f, 0.518773f } }, // 52237 + { 179387, { -153.748f, -438.639f, 33.2862f, 3.39467f }, { 0.0f, 0.0f, -0.992004f, 0.126203f } }, // 52237 + { 179388, { 570.419f, -89.0567f, 37.9558f, 2.22529f }, { 0.0f, 0.0f, 0.896873f, 0.442289f } }, // 52237 + { 179388, { -149.057f, -461.089f, 26.4163f, 1.38754f }, { 0.0f, 0.0f, 0.63944f, 0.768841f } }, // 52237 + { 179389, { 555.517f, -101.589f, 44.8257f, 0.392697f }, { 0.0f, 0.0f, 0.195089f, 0.980785f } }, // 52237 + { 179389, { -168.342f, -458.4f, 33.2862f, 5.83813f }, { 0.0f, 0.0f, -0.220697f, 0.975342f } }, // 52237 + { 179390, { 561.851f, -73.1481f, 37.9558f, 4.88692f }, { 0.0f, 0.0f, -0.642787f, 0.766045f } }, // 52237 + { 179390, { -142.968f, -444.076f, 26.4163f, 4.04917f }, { 0.0f, 0.0f, -0.898793f, 0.438373f } }, // 52237 + // Wanted: ORCS! + { 179437, { 618.748f, -52.1126f, 42.1122f, 6.21337f }, { 0.0f, 0.0f, -0.0348988f, 0.999390f } }, // 46248 + // Wanted: DWARVES! + { 179438, { -1181.10f, -370.747f, 53.6246f, 2.68781f }, { 0.0f, 0.0f, 0.974370f, 0.224951f } }, // 46248 +}; + const float BG_AV_DoorPositons[2][4] = { {780.487f, -493.024f, 99.9553f, 3.0976f}, //alliance