Trinitycore: BG's not working properly

Created on 20 Jan 2021  路  22Comments  路  Source: TrinityCore/TrinityCore

Not a major issue but more a hopeful of a fix scenario if easy enough.

Description:

Some Battlegrounds not selectable or game objects in working Bg's not working as intended

Expected behaviour:

CHANGEME Tell us what should happen instead.

Steps to reproduce the problem:

  1. Join Game, 9.0.2 client
  2. Type .level 59 or whatever level you like
  3. Press H
  4. Try to select Warsong Gulch or Arathi Basin, old school bg's that work in 3.3.5 client
  5. BG is unselectable whereas some do work Alterac Valley being one of them, Also in Isle of Conquest, all flags are unclickable, apart from quarry and refinery, those do work. Docks,Hangar and workshop don't work

Branch(es):

Master

Core Revision

Core: bb24c6a11b24
DB: TDB 837.20101

Operating system:

Win 10 x64

Branch-master Comp-Core Sub-PvP-Zones

Most helpful comment

Looking at the issue, the problem is with new battlegrounds that aren't in the database at the moment.
The relevant bgs that aren't in the database:

| Name | Type | Amount | BattlemasterListId |
| ----------- | -- | -- | -- |
| Temple of Kotmogu | Power Orbs | 10v10 | 699 |
| Silvershard Mines | Payload | 10v10 | 708 |
| Seething Shore | Resource Race | 10v10 | 894 |
| Warsong Gulch | Capture the Flag | 10v10 | 1014 |
| Battle for Wintergrasp | Epic Battleground | 30v30 | 1017 |
| Arathi Basin | Domination | 15v15 | 1018 |
| Ashran | Epic Battleground | 30v30 | 1020 |
| Deepwind Gorge | Domination | 15v15 | 1037 |

Note: The current Arathi Basin (id 3) and Warsong Gulch (id 2) that exist in db are the old/cassic bgs, and are not the same as these.

All 22 comments

@MaxtorCoder this is a fork of TC, and this fix fits TC without problems
since I am not sure of the complete correctness, I do not open PR TC

@MaxtorCoder this is a fork of TC, and this fix fits TC without problems

Make a PR to TC instead of linking code.

As much as i thank you for trying to fix, this didn't work for me. I select Warsong Gulch in this frame and click join battle but i don't even join the queue for that BG, same for most of the BG's listed there.

image

Only one that seems to work is Alterac Vally correctly

Looking at the issue, the problem is with new battlegrounds that aren't in the database at the moment.
The relevant bgs that aren't in the database:

| Name | Type | Amount | BattlemasterListId |
| ----------- | -- | -- | -- |
| Temple of Kotmogu | Power Orbs | 10v10 | 699 |
| Silvershard Mines | Payload | 10v10 | 708 |
| Seething Shore | Resource Race | 10v10 | 894 |
| Warsong Gulch | Capture the Flag | 10v10 | 1014 |
| Battle for Wintergrasp | Epic Battleground | 30v30 | 1017 |
| Arathi Basin | Domination | 15v15 | 1018 |
| Ashran | Epic Battleground | 30v30 | 1020 |
| Deepwind Gorge | Domination | 15v15 | 1037 |

Note: The current Arathi Basin (id 3) and Warsong Gulch (id 2) that exist in db are the old/cassic bgs, and are not the same as these.

Ok so firstly this needs to happen, if i have typed it correctly. Obviously i need to find the start locations etc and input them before running that query, but then i'm guessing a lot of the core code needs changing which is way out of my remit :D

INSERT INTO battleground_template (ID, AllianceStartLoc, HordeStartLoc, StartMaxDist, Weight, ScriptName, Comment) VALUES
(699,"","",0,1,"",Temple of Kotmogu),
(708,"","",0,1,"",Silvershard Mines),
(894,"","",0,1,"",Seething Shore),
(1014,"","",0,1,"",Warsong Gulch),
(1017,"","",0,1,"",Battle for Wintergrasp),
(1018,"","",0,1,"",Arathi Basin),
(1020,"","",0,1,"",Ashran),
(1037,"","",0,1,"",Deepwind Gorge),

@Spoony36 Each bg will need to be implemented, yes. But one step at a time. If you can get the locations that would be helpful to start with.

note: you might want to encapsule your entire sql code in backquotes rather than just part of it.

Example of MarkDown code block with syntax highlighting, as well as applying proper TC codestyle adjustments:

-- 
DELETE FROM `battleground_template` WHERE `ID` IN (699, 708, 894, 1014, 1017, 1018, 1020, 1037);
INSERT INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `ScriptName`, `Comment`) VALUES
( 699, '', '', 0, 1, '', 'Temple of Kotmogu'),
( 708, '', '', 0, 1, '', 'Silvershard Mines'),
( 894, '', '', 0, 1, '', 'Seething Shore'),
(1014, '', '', 0, 1, '', 'Warsong Gulch'),
(1017, '', '', 0, 1, '', 'Battle for Wintergrasp'),
(1018, '', '', 0, 1, '', 'Arathi Basin'),
(1020, '', '', 0, 1, '', 'Ashran'),
(1037, '', '', 0, 1, '', 'Deepwind Gorge');

encapsulate your entire sql code in backquotes rather than just part of it.

The reason some of the code appears to be encapsulated is that the MD backticks are part of the SQL content, but interpreted by GitHub as a text formatting option as long as there is no specific code block present (3 backticks before, optionally 3 backticks after).

The column names are usually encapsulated within the SQL code itself, to avoid any random appearance of a column name also being some SQL keyword, and then read as a keyword instead of column name.

Hmmm blizz blocking coord's from Bg's?

image

Yes, you cannot get player positions in lua inside instances (changed with legion release, reason: mythic archimonde in hellfire citadel addons/weakauras)

Looking at DB, it's not player coord's i should be looking for it seems but locations

image

Where do those Horde and Alliance locations stem from and how do you go about finding out those numbers, for example the new WSG ones of 7051 and 7050 that someone provided earlier in this thread and i can have a go at finding out the rest.

Sorry for the noobness, i'm like a week old at this stuff but following the guys code changes up above i did at least get WSG to pop but still a few issues in that BG but it's a start

  • Can't capture the flag it seems
  • Timer for BG not working, stays on 00:00
  • Some of the BG buffs are down in the floor and barely visible

image

@Spoony36 The location seems to match an id from a location table, world_safe_locs.
Inside that table they are simply locations based on map with x,y,z and facing.

I do not know how to get them though. Even when running my own server, I can't teleport to a battleground, and debugging one won't help since you can't queue to one.

Ok, these are the one's that i have found so far, i just need to look into the code and try to change it so i can queue for the missing ones.

  • Temple of Kotmogu
  • Silvershard Mines
  • Deepwind Gorge
DELETE FROM `battleground_template` WHERE `ID` IN (699, 708, 894, 1014, 1017, 1018, 1020, 1037);
INSERT INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `ScriptName`, `Comment`) VALUES
( 699, '', '', 0, 1, '', 'Temple of Kotmogu'),
( 708, '', '', 0, 1, '', 'Silvershard Mines'),
( 894, '6163', '6164', 0, 1, '', 'Seething Shore'),
(1014, '7050', '7051', 0, 1, '', 'Warsong Gulch'),
(1017, '', '', 0, 1, '', 'Battle for Wintergrasp'),
(1018, '7056', '7055', 0, 1, '', 'Arathi Basin'),
(1020, '5276', '5275', 0, 1, '', 'Ashran'),
(1037, '', '', 0, 1, '', 'Deepwind Gorge');

For queueing you will need to add it to BattlegroundQueueTypeId as well as adding that type to BattlegroundMgr::BGQueueTypeId and BattlegroundMgr::BGTemplateId and most likely a lot more (need a new class that extends the Battleground class)

@Spoony36 : Please use MarkDown code block fencing (optionally with syntax highlighting) when you post code samples (to avoid making it look like the column names are encapsulated individually).

MarkDown code block fence: ``` (3 back ticks used on a blank line before & after the code sample)

SQL syntax highlighting: ```sql

edit: C++ highlighting: ```cpp

REPLACE INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `ScriptName`, `Comment`) VALUES (1, 611, 610, 150, 1, '', 'Alterac Valley');
REPLACE INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `ScriptName`, `Comment`) VALUES (4, 929, 936, 0, 1, '', 'Nagrand Arena');
REPLACE INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `ScriptName`, `Comment`) VALUES (5, 939, 940, 0, 1, '', 'Blades\'s Edge Arena');
REPLACE INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `ScriptName`, `Comment`) VALUES (6, 0, 0, 0, 1, '', 'All Arena');
REPLACE INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `ScriptName`, `Comment`) VALUES (7, 1103, 1104, 75, 1, '', 'Eye of The Storm');
REPLACE INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `ScriptName`, `Comment`) VALUES (8, 1258, 1259, 0, 1, '', 'Ruins of Lordaeron');
REPLACE INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `ScriptName`, `Comment`) VALUES (9, 1367, 1368, 0, 1, '', 'Strand of the Ancients');
REPLACE INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `ScriptName`, `Comment`) VALUES (10, 1362, 1363, 0, 1, '', 'Dalaran Sewers');
REPLACE INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `ScriptName`, `Comment`) VALUES (11, 1364, 1365, 0, 1, '', 'The Ring of Valor');
REPLACE INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `ScriptName`, `Comment`) VALUES (30, 1299, 1245, 200, 1, '', 'Isle of Conquest');
REPLACE INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `ScriptName`, `Comment`) VALUES (32, 0, 0, 0, 1, '', 'Random battleground');
REPLACE INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `ScriptName`, `Comment`) VALUES (108, 1726, 1727, 0, 0, '', 'Twin Peaks');
REPLACE INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `ScriptName`, `Comment`) VALUES (120, 1798, 1799, 0, 0, '', 'The Battle for Gilneas');
REPLACE INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `ScriptName`, `Comment`) VALUES (699, 4059, 4060, 0, 1, '', 'Temple of Kotmogu');
REPLACE INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `ScriptName`, `Comment`) VALUES (708, 4062, 4061, 0, 1, '', 'Silvershard Mines');
REPLACE INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `ScriptName`, `Comment`) VALUES (1014, 7050, 7051, 0, 1, '', 'Warsong Gulch');
REPLACE INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `ScriptName`, `Comment`) VALUES (1018, 7056, 7055, 0, 1, '', 'Arathi Basin');
REPLACE INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `ScriptName`, `Comment`) VALUES (1020, 5276, 5275, 0, 1, '', 'Ashran');
REPLACE INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `ScriptName`, `Comment`) VALUES (1037, 4487, 4486, 0, 1, '', 'Deepwind Gorge');

I think this is all of them, haven't been able to get the queue to pop for

  • Temple of Kotmogu
  • Ashran
  • Deepwind Gorge
  • Silvershard Mines

So can't verify the start cord's are correct as i have no experience whatsoever with coding :D Just a PvP nut who spends all of his time in BG's. I did try editing some files to try and at least make them queueable but messed up somewhere along the line :D

Added a few things in BattlegroundMGR, Battleground Zones and tried to follow the formatting in there already but messed up somewhere :D

image

@Spoony36 I'll try to take a look at the next couple of days, although I can't promise anything.
Tell me the one you like the most and I'll check it out.

Please also refrain from using REPLACE INTO and use the pair DELETE FROM + INSERT INTO (TC SQL codestyle) along with the required SQL parameters (as in your SQL sample in https://github.com/TrinityCore/TrinityCore/issues/25897#issuecomment-766326607).

@matanshukry I really don't mind, it was more of just letting the team know that BG's needed a fix but just messing with game, i realise more important fixes are needed and people might already be working on these or not.

  • DH and Monk were implemented post cataclysm so probably not even worth creating one of them at the moment as nothing coded for them i'm guessing
  • All classes probably need looking into due to rework for SL
  • Quests
  • Getting data that is SL related.

Anyways it's not an urgent fix needed unless you want to look into it, otherwise if you feel up to it, you can look at class fixes or something of your choosing but much appreciated to everyone that has provided guidance in this thread.

i will leave this open as a reminder for someone who is a coder to get to eventually but i am not a coder myself so this can be closed if needed but really do appreciate the guidance.

@Spoony36 Create issues for each one of them though please. If you can get more detailed information about the actual things that missing (since some will probably still work), it can be helpful to others who will try to implement and fix what's missing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

daddycaddy picture daddycaddy  路  3Comments

Tatara902 picture Tatara902  路  3Comments

Blasphemous picture Blasphemous  路  3Comments

Rushor picture Rushor  路  3Comments

Jildor picture Jildor  路  3Comments