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> 847IsGuildLeaderReturns whether or player is leader <strong>of</strong> his or her guild.isLeader = IsGuildLeader()Returns:isLeader—1 if the player is a guild leader; otherwise nil (1nil)IsHarmfulItemReturns whether an item can be used against hostile units.isHarmful = IsHarmfulItem(itemID) or IsHarmfulItem(“itemName“) or iIsHarmfulItem(“itemLink“)Harmful items include grenades <strong>and</strong> various quest items (‘‘Use this to zap 30murlocs!’’).Arguments:itemID—An item’s ID (number)itemName—An item’s name (string)itemLink—An item’s hyperlink, or any string containing the itemString portion<strong>of</strong> an item link (string)Returns:isHarmful—1 if the item can be used against hostile units; otherwise nil(1nil)IsHarmfulSpellReturns whether a spell can be used against hostile units.isHarmful = IsHarmfulSpell(index, “bookType“) or IsHarmfulSpell(“name“)Arguments:index—Index <strong>of</strong> a spell in the spellbook (number, spellbookID)bookType—Type <strong>of</strong> spellbook (string)pet—The pet’s spellbookspell—The player’s spellbookname—Name <strong>of</strong> a spell (string)Returns:isHarmful—1 if the spell can be used against hostile units; otherwise nil(1nil)Example:-- print a list <strong>of</strong> harmful spellslocal numTabs = GetNumSpellTabs()<strong>for</strong> i=1,numTabs dolocal name,texture,<strong>of</strong>fset,numSpells = GetSpellTabInfo(i)<strong>for</strong> spellId=1,numSpells dolocal harmful = IsHarmfulSpell(i, “spell“)if harmful thenlocal name,rank = GetSpellName(i, “spell“)

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

Saved successfully!

Ooh no, something went wrong!