12.07.2015 Views

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 27 ■ API <strong>Reference</strong> 665honorableKills—Number <strong>of</strong> honorable kills scored by the participant duringthe match (number)deaths—Number <strong>of</strong> times the participant died during the match (number)honorGained—Amount <strong>of</strong> honor points gained by the participant during thematch (number)faction—Faction or team to which the participant belongs (number)0—Horde (Battleground) / Green Team (Arena)1—Alliance (Battleground) / Gold Team (Arena)rank—Deprecated; always 0 (number)race—Localized name <strong>of</strong> the participant’s race (string)classToken—Non-localized token representing the participant’s class (string)damageDone—Total amount <strong>of</strong> damage done by the participant during thematch (number)healingDone—Total amount <strong>of</strong> healing done by the participant during thematch (number)GetBattlefieldStatDataReturns battleground-specific scoreboard in<strong>for</strong>mation <strong>for</strong> a battlegroundparticipant.columnData = GetBattlefieldStatData(index, statIndex)Battleground-specific statistics include flags captured in Warsong Gulch,towers assaulted in Alterac Valley, etc. For the name <strong>and</strong> icon associated witheach statistic, see GetBattlefieldStatInfo(). For basic battleground scorein<strong>for</strong>mation, see GetBattlefieldScore().Arguments:index—Index <strong>of</strong> a participant in the battleground/arena scoreboard(between 1 <strong>and</strong> GetNumBattlefieldScores()) (number)statIndex—Index <strong>of</strong> a battleground-specific statistic (between 1 <strong>and</strong>GetNumBattlefieldStats()) (number)Returns:columnData—The participant’s score <strong>for</strong> the statistic (number)Example:-- Print out the player’s battleground statisticslocal playerName = UnitName(“player“)<strong>for</strong> playerIndex = 1, GetNumBattlefieldStats() dolocal name = GetBattlefieldScore(playerIndex)if name == playerName thenlocal output = “Battleground stats <strong>for</strong> “..name..“:\n“<strong>for</strong> statIndex = 1, GetNumBattlefieldStats() dooutput = output .. “ “ .. GetBattlefieldStatInfo(statIndex) i.. “: “ ..GetBattlefieldStatData(statIndex) .. “\n“endprint(output)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!