Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
No edit summary
KethoBot (talk | contribs)
m (trim bullet points)
Tag: WoW API docs
 
(19 intermediate revisions by 7 users not shown)
Line 1: Line 1:
  +
{{wowapi}}
Get the name of the title used by the player.
 
  +
Returns the name of a player title.
 
name, playerTitle = GetTitleName(titleId)
   
 
==Arguments==
titleName = GetTitleName(titleId)
 
  +
:;[[TitleId|titleId]]:{{apitype|number}} - Ranging from 1 to {{api|GetNumTitles}}. Not necessarily an index as there can be missing/skipped IDs in between.
== Parameters ==
 
=== Arguments ===
 
:(titleId)
 
   
 
==Returns==
:;titleId : Number - The number of the title currently select by the player.
 
 
:;name:{{apitype|string}} - Name of the title.
=== Returns ===
 
  +
:;playerTitle:{{apitype|boolean}} - Seems to be true for all existing titles.
:name
 
   
  +
==Details==
:;name : String - The name of the title.
 
  +
* If the name has a trailing space, then the title is prefixed, otherwise it's suffixed.
== Example ==
 
  +
<syntaxhighlight lang="lua">
<!-- begin code -->
 
  +
/dump GetTitleName(2) -- "Corporal " → "Corporal Bob" (prefix)
local titleId = GetCurrentTitle();
 
  +
/dump GetTitleName(36) -- "Champion of the Naaru" → "Alice, Champion of the Naaru" (suffix)
local titleName = GetTitleName(titleId);
 
  +
</syntaxhighlight>
<!-- end code -->
 
__NOTOC__
 
   
== Notes ==
+
==Patch changes==
  +
{{Patch 2.0.1|note=Added.}}
Supported starting in build 20000
 
  +
  +
==See also==
  +
* {{api|GetCurrentTitle}}
  +
* {{api|IsTitleKnown}}

Latest revision as of 06:07, 1 August 2022

Returns the name of a player title.

name, playerTitle = GetTitleName(titleId)

Arguments

titleId
number - Ranging from 1 to GetNumTitles. Not necessarily an index as there can be missing/skipped IDs in between.

Returns

name
string - Name of the title.
playerTitle
boolean - Seems to be true for all existing titles.

Details

  • If the name has a trailing space, then the title is prefixed, otherwise it's suffixed.
/dump GetTitleName(2) -- "Corporal " → "Corporal Bob" (prefix)
/dump GetTitleName(36) -- "Champion of the Naaru" → "Alice, Champion of the Naaru" (suffix)

Patch changes

Bc icon Patch 2.0.1 (2006-12-05): Added.

See also