2,434
edits
(boilerplate) |
m (Move page script moved page API SetCurrentTitle to WoW:API SetCurrentTitle without leaving a redirect) |
||
(6 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{wowapi}} | {{protectedhwapi|3.3}} {{wowapi}} | ||
Changes your character's displayed title. | Changes your character's displayed title. | ||
SetCurrentTitle(titleId); | |||
== Arguments == | == Arguments == | ||
Line 9: | Line 9: | ||
SetCurrentTitle(43); | SetCurrentTitle(43); | ||
This sets the title " | This sets the title "Elder" if your character had earned the title, otherwise it removes any active title. | ||
/ | /run local t={}; for titles=1,GetNumTitles()-1,1 do if IsTitleKnown(titles)==1 then table.insert(t,titles) end; end; local x=random(#t); print("Using title: "..GetTitleName(t[x])); SetCurrentTitle(t[x]) | ||
This will | This macro will iterate over the list of titles, grab the ones the user has, then choose a random one from that list. | ||
== Details == | == Details == | ||
* The last indexed value (currently 143) returns nil and removes the player's name completely (not available to players). | * The last indexed value (currently 143) returns nil and removes the player's name completely (not available to players). | ||
* [[API GetTitleName|GetTitleName]] can be used to find the name associated with the [[TitleId]]. | * [[API GetTitleName|GetTitleName]] can be used to find the name associated with the [[TitleId]]. |
edits