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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 27 ■ API <strong>Reference</strong> 549local creatureID = tonumber(“0x“..strsub(guid,9,12))local spawnCounter = tonumber(“0x“..strsub(guid,13))print(“Vehicle, ID #“,creatureID,“spawn #“,spawnCounter)endendHyperlinkA hyperlink is a string containing markup allowing the client to present it as a link,which the player can click to view more in<strong>for</strong>mation about or take action regardingthe data it represents.Hyperlinks take the <strong>for</strong>m |H(linktype):(linkdata)|h(text)|h, where(linktype) determines the type <strong>of</strong> link, (linkdata) is a code referencing the linkedin<strong>for</strong>mation, <strong>and</strong> (text) is the text visible to the player. Some API functions whichoperate on links do not require a full hyperlink, only its linktype:linkdata portion.Links are <strong>of</strong>ten encapsulated in a colorString. In such cases, the full colorString-wrapped link is the only <strong>for</strong>m <strong>of</strong> the link allowed to be used in chat;attempting to transmit an invalid link may cause the player to be disconnected fromthe server.The <strong>WoW</strong> client recognizes several kinds <strong>of</strong> hyperlinks, identified by their linktype:player spell talent itemplayerGM enchant achievementglyph quest tradeThey are described in the following sections. If linkdata elements noted as optionalare omitted the client can still resolve the link.playerExample: |Hplayer:Aerdrig|h[Aerdrig]|hRepresents a player character. Left-clicking a player link in the default UI opens theChatFrameEditBox to send a whispered message to the character. Right-clicking opensa menu with options <strong>for</strong> inviting the character to the player’s party/raid, adding thecharacter to the ignore list, or reporting the chat message in which the link appearsas spam. The linkdata <strong>for</strong> a player link consists solely <strong>of</strong> the player’s name (or incross-realm battlegrounds, the player’s name <strong>and</strong> home realm separated by a hyphen,e.g. ‘‘Gundark-Broxigar’’).playerGMExample: |HplayerGM:Eyonix|h[Eyonix]|hA variation on the player type used exclusively <strong>for</strong> Game Master chat.glyphExample: |cff66bbff|Hglyph:23:460|h[Glyph <strong>of</strong> Fortitude]|h|r

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

Saved successfully!

Ooh no, something went wrong!