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> 885PetCanBeDismissedReturns whether a Dismiss Pet comm<strong>and</strong> should be available <strong>for</strong> theplayer’s pet.canDismiss = PetCanBeDismissed()Returns 1 <strong>for</strong> hunter pets even though they use the Dismiss Pet (cast) spellinstead <strong>of</strong> a Dismiss Pet (instant) comm<strong>and</strong>; the value <strong>of</strong> PetCanBeAb<strong>and</strong>oned() overrides this in causing the default UI to hide the comm<strong>and</strong>.Currently unused, but may be used in the future <strong>for</strong> other pets.Returns:canDismiss—1 if a Dismiss Pet comm<strong>and</strong> should be available <strong>for</strong> the player’spet; otherwise nil (1nil)PetCanBeRenamedReturns whether the player’s pet can be renamed.canRename = PetCanBeRenamed()Only hunter pets can be renamed, <strong>and</strong> only once (barring use <strong>of</strong> a Certificate <strong>of</strong>Ownership).ProtectedProtectedProtectedReturns:canRename—1 if the player can rename the currently controlled pet, otherwisenil (1nil)PetDefensiveModeEnables defensive mode <strong>for</strong> the player’s pet.In this mode, the pet automatically attacks only units which attack it or theplayer or units the player is attacking.PetDismissDismisses the currently controlled pet.Used <strong>for</strong> dismissing Warlock pets, Mind Control targets, etc. Has no effect <strong>for</strong>Hunter pets, which can only be dismissed using the Dismiss Pet spell.PetFollowInstructs the pet to follow the player.If the pet is currently attacking a target, the pet will stop attacking.PetHasActionBarReturns whether the player’s current pet has an action bar.hasActionBar = PetHasActionBar()Returns:hasActionBar—Returns 1 if the player’s pet has an action bar; otherwise nil(1nil)PetPassiveModeEnables passive mode <strong>for</strong> the player’s pet.In this mode, the pet will not automatically attack any target.

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

Saved successfully!

Ooh no, something went wrong!