Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

API GetBattlefieldScore

Last wiki revision 2022-12-26

Returns info for a player's score in battlefields. name, killingBlows, honorableKills, deaths, honorGained, faction, race, class, classToken, damageDone, healingDone, bgRating, ratingChange, preMatchMMR, mmrChange, talentSpec = GetBattlefieldScore(index)

  • index: - The characters index in battlegrounds, going from 1 to GetNumBattlefieldScores.
  • name: - The player's name, with their server name attached if from a different server to the player.
  • killingBlows: - Number of killing blows.
  • honorableKills: - Number of honorable kills.
  • deaths: - The number of deaths.
  • honorGained: - The amount of honour gained so far (Bonus Honour).
  • faction: - (Battlegrounds: Horde = 0, Alliance = 1 / Arenas: Green Team = 0, Yellow Team = 1).
  • race: - The players race (Orc, Undead, Human, etc).
  • class: - The players class (Mage, Hunter, Warrior, etc).
  • classToken: - The player's class name in english given in all capitals (MAGE, HUNTER, WARRIOR, etc)
  • damageDone: - The amount of damage done.
  • healingDone: - The amount of healing done.
  • talentSpec: - Localized name of player build

How to count the number of players in each faction.

local numScores = GetNumBattlefieldScores local numHorde = 0 local numAlliance = 0 for i=1, numScores do name, killingBlows, honorableKills, deaths, honorGained, faction = GetBattlefieldScore(i); if ( faction ) then if ( faction == 0 ) then numHorde = numHorde + 1 else numAlliance = numAlliance + 1 end end end

Source

https://warcraft.wiki.gg/wiki/API_GetBattlefieldScore · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.