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> 893-- play a sound file from an addonPlayMusic(“Interface\\AddOns\\MyAddOn\\MySound.wav“)PlayerCanTeleportReturns whether the player can accept a summons.amount = PlayerCanTeleport()Returns:amount—True if the player is currently allowed to accept a summons (boolean)PlayerIsPVPInactiveReturns whether a battleground participant is inactive (<strong>and</strong> eligible <strong>for</strong>reporting as AFK).isInactive = PlayerIsPVPInactive(“name“) or PlayerIsPVPInactive(“unit“)Arguments:name—Name <strong>of</strong> a friendly player unit in the current battleground (string)unit—A friendly player unit in the current battleground (string, unitID)Returns:isInactive—True if the unit can be reported as AFK; otherwise false(boolean)PrevViewMoves the camera to the previous predefined setting.There are five ‘‘slots’’ <strong>for</strong> saved camera settings, indexed 1-5. These views canbe set <strong>and</strong> accessed directly using SaveView() <strong>and</strong> SetView(), <strong>and</strong> cycledthrough using NextView() <strong>and</strong> PrevView().ProcessMapClickPossibly changes the <strong>World</strong>Map based on a mouse click.ProcessMapClick(clickX, clickY)May change the map zone or zoom based on the click location: e.g. if the worldmap shows Dragonblight <strong>and</strong> one clicks in the area labeled ‘‘Wintergrasp’’ onthe map, the current map zone changes to show Wintergrasp.Arguments:clickX—Horizontal position <strong>of</strong> the click relative to the current world map (0 =left edge, 1 = right edge) (number)clickY—Vertical position <strong>of</strong> the click relative to the current world map (0 = top,1 = bottom) (number)PromoteToAssistantPromotes a raid member to raid assistant.PromoteToAssistant(“unit“) or PromoteToAssistant(“name“ [, exactMatch])Arguments:unit—A unit in the raid (string, unitID)name—Name <strong>of</strong> a unit in the raid (string)exactMatch (optional)—True to check only units whose name exactlymatches the name given; false to allow partial matches (boolean)

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

Saved successfully!

Ooh no, something went wrong!