API:Battlegrounds
From WCell Wiki
This article is related to development using the WCell API.
Battlegrounds are not to be confused with Instances.
Contents |
Implementing Battlegrounds
- Battleground-related code can be found in the Battlegrounds/ folder
- The default Battleground implementations can be found in the DefaultAddon's Battlegrounds/ folder.
- All Battlegrounds extend the Battleground class
- The actual classes to be instantiated for each kind of Battleground are defined in /Run/Content/Battlegrounds.xml
For examples and references, you can look at the Warsong Gulch Folder and, specifically, at the WarsongGulch class.
Creating custom Battlegrounds
- You can also use the WCell API to create custom Instances, independent on the default solutions, using GlobalBattlegroundQueue.CreateBattleground<B>():
// Either get the queue for a certain level range var queue = BattlegroundMgr.GetGlobalQueue(BattlegroundId.StrandOfTheAncients, 80); // or create a custom queue for all of these custom instances: var queue = new GlobalBattlegroundQueue(BattlegroundId.StrandOfTheAncients); // then create the Battleground instance: var myBG = queue.CreateBattlegrounds<MyCustomStrandOfTheAncients>();
Queuing
- Individuals or whole Groups will be enqueued into either of the following queues:
GlobalBattlegroundQueue
Stub
- Every Battleground belongs to a GlobalBattlegroundQueue which manages players who want to play in any instance
- It will create a new Instance once enough players are enqueued
InstanceBattlegroundQueue
- Every Battleground owns an InstanceBattlegroundQueue to manage players who want to play in that specific instance
The details
- Battlegrounds will continuously check for enqueued players as long as they are not full
- They will always first consider the instance queue, then the global queue
- Groups can only be invited if there is enough space for all eglible members of the Group to join at the same time
Fair teams
Stub
In order to make Battlegrounds fun, even on servers with fewer players, WCell offers several customizable features:
- BuffSmallerBGTeam
- AddPlayersToBiggerTeamDefault
- Teams with mixed factions
