<Bindings>

<Binding name="FUNC_ReloadUI" header="AAL_112_BINDINGS">ReloadUI()</Binding>
<Binding name="FUNC_Logout">Logout()</Binding>
<Binding name="FUNC_ResetInstances">ResetInstances()</Binding>
<Binding name="FUNC_OpenChatGM">ChatFrame_OpenChat(".")</Binding>
<Binding name="FUNC_EmoteSleep">DoEmote("sleep")</Binding>
<Binding name="FUNC_EmoteKneel">DoEmote("kneel")</Binding>
<Binding name="FUNC_EmoteRandom">local ems = {"salute","wave","point","shy","bow","beg","talk","roar","applaud","weep","talkex","puzzled","victory","kiss","laugh"}; DoEmote(ems[ math.random(1, table.getn(ems)) ])</Binding>
<Binding name="FUNC_SpellbookPrevPage">
if SpellBookFrame and SpellBookFrame:IsVisible() then
   if SpellBook_GetCurrentPage() > 1 then PrevPageButton_OnClick() end
end
</Binding>
<Binding name="FUNC_SpellbookNextPage">
if SpellBookFrame and SpellBookFrame:IsVisible() then
   local cur, max = SpellBook_GetCurrentPage();
   if max > cur then NextPageButton_OnClick() end
end
</Binding>
<Binding name="AAL_SwitchCloakAndHelm">AAL_SwitchCloakAndHelm()</Binding>
<Binding name="AAL_ChatTabNext">AAL_ToggleChatTab(1)</Binding>
<Binding name="AAL_ChatTabPrev">AAL_ToggleChatTab(-1)</Binding>
<Binding name="AAL_UnitInfo">AAL_UnitInfo()</Binding>
<Binding name="AAL_Test">AAL_Test()</Binding>

<Binding name="MACRO Speed3">AAL_Cast("MACRO Speed3")</Binding>
<Binding name="MACRO Speed1">AAL_Cast("MACRO Speed1")</Binding>
<Binding name="MACRO GM On">AAL_Cast("MACRO GM On")</Binding>
<Binding name="MACRO GM Off">AAL_Cast("MACRO GM Off")</Binding>
<Binding name="MACRO Kill">
if UnitIsDead("target") then AAL_Cast("MACRO Respawn")
else
   if UnitIsUnit("target","player") or UnitIsUnit("target","pet") then TargetNearestEnemy()
   else
      AAL_Cast("MACRO Kill")
      if UnitIsFriend("player","target") then TargetNearestFriend() else TargetNearestEnemy() end
   end
end
</Binding>
<Binding name="MACRO Cooldown">AAL_Cast("MACRO Cooldown")</Binding>


<Binding name="GQUICKLOOKB" runOnUp="true">
if keystate == "down" then GAR_LOOK_DEG = GAR_LOOK_DEG + 180; FlipCameraYaw(180)
else FlipCameraYaw(GAR_LOOK_DEG); GAR_LOOK_DEG = 0
end
</Binding>
<Binding name="GQUICKLOOKR" runOnUp="true">
if keystate == "down" then GAR_LOOK_DEG = GAR_LOOK_DEG + 90; FlipCameraYaw(-90)
else FlipCameraYaw(GAR_LOOK_DEG); GAR_LOOK_DEG = 0
end
</Binding>
<Binding name="GQUICKLOOKL" runOnUp="true">
if keystate == "down" then GAR_LOOK_DEG = GAR_LOOK_DEG - 90; FlipCameraYaw(90);
else FlipCameraYaw(GAR_LOOK_DEG); GAR_LOOK_DEG = 0;
end
</Binding>
<Binding name="GQUICKLOOKRESET" runOnUp="false">
FlipCameraYaw(GAR_LOOK_DEG); GAR_LOOK_DEG = 0;
</Binding>


<Binding name="DISMOUNT">AAL_DismountOrToggleHunterRunAspect()</Binding>
<Binding name="STOPATTACK">AAL_StopAction()</Binding>
<Binding name="AAL_TargetRareNPC">AAL_TargetRareNPC()</Binding>

<Binding name="AAL_SwitchWeapons">AAL_SwitchWeapons()</Binding>
<Binding name="AAL_ChangeStance">AAL_ChangeStance()</Binding>
<Binding name="AAL_Shoot">AAL_Shoot()</Binding>
<Binding name="AAL_SpellAttack">AAL_SpellAttack()</Binding>
<Binding name="AAL_SpellInstant">if UnitExists("target") and (UnitCanAttack("player","target") and not UnitIsDead("target") or UnitAffectingCombat("player")) and not AAL_IsMounted() and not UnitOnTaxi("player") then AAL_SpellInstant() else AAL_FindResourceSwitcher() end</Binding>
<Binding name="AAL_Taunt">AAL_Cast("*Taunt", "*Mocking Blow", "*Challenging Shout")</Binding>
<Binding name="AAL_MeleeAttack">AAL_MeleeAttack()</Binding>
<Binding name="AAL_MassRootOrSlow">AAL_Cast(".30 Frost Nova", ".Frost Nova(Rank 1)", "*Piercing Howl", ".Blast Wave")</Binding>
<Binding name="AAL_BackMeleeAttack">AAL_BackMeleeAttack()</Binding>
<Binding name="AAL_StunAttack">AAL_StunAttack()</Binding>
<Binding name="AAL_MarkRapidAimedMultiShot">AAL_MarkRapidAimedMultiShot()</Binding>
<Binding name="AAL_Bomb">AAL_Bomb()</Binding>
<Binding name="AAL_DisableEnemy">AAL_DisableEnemy()</Binding>
<Binding name="AAL_ControlEnemy">AAL_ControlEnemy()</Binding>
<Binding name="AAL_ScareEnemy">AAL_ScareEnemy()</Binding>
<Binding name="AAL_ScareMultipleEnemies">AAL_ScareMultipleEnemies()</Binding>
<Binding name="AAL_CameraFlipOrHinderEnemy" runOnUp="true">
local look = keystate ~= "down" or AAL_IsMounted() or UnitOnTaxi("player") or not CheckInteractDistance("target",4)
if not look and (not UnitCanAttack("player","target") or UnitIsDead("target") and not UnitIsPlayer("target")) then
   TargetNearestEnemy() 
   look = not UnitCanAttack("player","target") or UnitIsDead("target") and not UnitIsPlayer("target")
end   
if look then RunBinding("GQUICKLOOKB",keystate) else AAL_HinderEnemy() end
</Binding>
<Binding name="AAL_SootheEnemy">
if UnitCreatureType("target") == "Beast" then CastSpellByName("Soothe Animal") else CastSpellByName("Mind Soothe") end
</Binding>

<Binding name="AAL_Protection">AAL_Protection()</Binding>
<Binding name="AAL_EmergencyProtection">AAL_EmergencyProtection()</Binding>
<Binding name="AAL_Heal">AAL_SmartHeal(false)</Binding>
<Binding name="AAL_HealInstant">AAL_SmartHeal(true)</Binding>
<Binding name="AAL_Bandage">
if UnitAffectingCombat("player") then AAL_Cast("Major Healing Potion","Superior Healing Potion","Greater Healing Potion","Healing Potion") end
AAL_Cast(true, "Heavy Runecloth Bandage","Runecloth Bandage","Heavy Mageweave Bandage","Mageweave Bandage","Heavy Silk Bandage","Silk Bandage","Heavy Wool Bandage","Wool Bandage","Heavy Linen Bandage","Linen Bandage")
</Binding>
<Binding name="AAL_ReplenishMana">AAL_ReplenishMana()</Binding>
<Binding name="AAL_PetAttackOrSummon">AAL_PetAttackOrSummon()</Binding>
<Binding name="AAL_PetReviveOrFeedOrTauntOrTame">AAL_PetReviveOrFeedOrTauntOrTame()</Binding>
<Binding name="AAL_ProtectPet">AAL_ProtectPet()</Binding>
<Binding name="AAL_BuffPet">AAL_BuffPet()</Binding>
<Binding name="AAL_CreateManaGem">AAL_CreateItems('Mana Ruby',"Conjure Mana Ruby", 'Mana Citrine',"Conjure Mana Citrine", 'Mana Jade',"Conjure Mana Jade", 'Mana Agate',"Conjure Mana Agate")</Binding>
<Binding name="AAL_CreateHealthstone">AAL_CreateItems('Lily Root', "Lei of Lilies", 'Major Healthstone',"Create Healthstone (Major)", 'Greater Healthstone',"Create Healthstone (Greater)", 'Healthstone',"Create Healthstone", 'Lesser Healthstone',"Create Healthstone (Lesser)", 'Minor Healthstone',"Create Healthstone (Minor)")</Binding>
<Binding name="AAL_CreateSoulstone">
if UnitExists("target") and UnitIsFriend("player","target") and not UnitIsPlayer("target") then TargetUnit("player") end
AAL_UseOrCreateItem('Major Soulstone',"Create Soulstone (Major)", 'Greater Soulstone',"Create Soulstone (Greater)", 'Soulstone',"Create Soulstone", 'Lesser Soulstone',"Create Soulstone (Lesser)", 'Minor Soulstone',"Create Soulstone (Minor)")
</Binding>
<Binding name="AAL_CreateFirestone">AAL_UseOrCreateItem('Major Firestone',"Create Firestone (Major)", 'Greater Firestone',"Create Firestone (Greater)", 'Firestone',"Create Firestone", 'Lesser Firestone',"Create Firestone (Lesser)", 'Minor Firestone',"Create Firestone (Minor)")</Binding>
<Binding name="AAL_CreateSpellstone">AAL_UseOrCreateItem('Major Spellstone',"Create Spellstone (Major)", 'Greater Spellstone',"Create Spellstone (Greater)", 'Spellstone',"Create Spellstone", 'Lesser Spellstone',"Create Spellstone (Lesser)", 'Minor Spellstone',"Create Spellstone (Minor)")</Binding>

<Binding name="MACRO PetFollow">PetFollow()</Binding>

<Binding name="SPELL Find Treasure">CastSpellByName("Find Treasure")</Binding>
<Binding name="SPELL Find Herbs">CastSpellByName("Find Herbs")</Binding>
<Binding name="SPELL Find Minerals">CastSpellByName("Find Minerals")</Binding>
<Binding name="SPELL Track Beasts">CastSpellByName("Track Beasts")</Binding>
<Binding name="SPELL Track Humanoids">CastSpellByName("Track Humanoids")</Binding>
<Binding name="SPELL Track Hidden">CastSpellByName("Track Hidden")</Binding>
<Binding name="SPELL Track Giants">CastSpellByName("Track Giants")</Binding>
<Binding name="SPELL Track Undead">AAL_Cast("Track Undead", "Sense Undead")</Binding>
<Binding name="SPELL Track Elementals">CastSpellByName("Track Elementals")</Binding>
<Binding name="SPELL Track Dragonkin">CastSpellByName("Track Dragonkin")</Binding>
<Binding name="SPELL Track Demons">AAL_Cast("Sense Demons", "Track Demons")</Binding>
<Binding name="SPELL Volley">CastSpellByName("Volley")</Binding>

<Binding name="AAL_Fishing">AAL_Fishing()</Binding>
<Binding name="MACRO Ride">AAL_Mount()</Binding>
<Binding name="SPELL Cooking">CastSpellByName("Cooking")</Binding>
<Binding name="SPELL Basic Campfire">CastSpellByName("Basic Campfire")</Binding>
<Binding name="SPELL First Aid">CastSpellByName("First Aid")</Binding>
<Binding name="SPELL Enchanting">CastSpellByName("Enchanting")</Binding>
<Binding name="SPELL Disenchant">CastSpellByName("Disenchant")</Binding>
<Binding name="SPELL Alchemy">CastSpellByName("Alchemy")</Binding>
<Binding name="SPELL Smelting">CastSpellByName("Smelting")</Binding>
<Binding name="SPELL Blacksmithing">AAL_Cast("Armorsmith", "Weaponsmith", "Blacksmithing")</Binding>
<Binding name="SPELL Engineering">AAL_Cast("Goblin Engineer", "Gnomish Engineer", "Engineering")</Binding>
<Binding name="SPELL Leatherworking">AAL_Cast("Dragonscale Leatherworking", "Elemental Leatherworking", "Tribal Leatherworking", "Leatherworking")</Binding>
<Binding name="SPELL Tailoring">CastSpellByName("Tailoring")</Binding>

<Binding name="AAL_ItemUseAttack">AAL_Cast("Goblin Dragon Gun","Gnomish Death Ray","Stratholme Holy Water")</Binding>

<Binding name="SPELL Sprint">AAL_Cast("Sprint", "Goblin Rocket Boots","Gnomish Rocket Boots", "Dash")</Binding>
<Binding name="AAL_StealthOrVanish">AAL_StealthOrVanish()</Binding>
<Binding name="SPELL Pick Pocket">CastSpellByName("Pick Pocket")</Binding>
<Binding name="SPELL Pick Lock">CastSpellByName("Pick Lock")</Binding>
<Binding name="SPELL Poisons">CastSpellByName("Poisons")</Binding>
<Binding name="SPELL Distract">CastSpellByName("Distract")</Binding>

<Binding name="SPELL Feign Death">
if UnitHealth("player")~=0 then
   if AAL_Dismount() then
   else CastSpellByName("Feign Death")
   end
else CastSpellByName("Freezing Trap") end
</Binding>
<Binding name="SPELL Call Pet">CastSpellByName("Call Pet")</Binding>
<Binding name="SPELL Mend Pet">CastSpellByName("Mend Pet")</Binding>
<Binding name="SPELL Eagle Eye">CastSpellByName("Eagle Eye")</Binding>
<Binding name="SPELL Immolation Trap">CastSpellByName("Immolation Trap")</Binding>
<Binding name="SPELL Freezing Trap">CastSpellByName("Freezing Trap")</Binding>
<Binding name="SPELL Frost Trap">CastSpellByName("Frost Trap")</Binding>
<Binding name="SPELL Explosive Trap">CastSpellByName("Explosive Trap")</Binding>
<Binding name="SPELL Eyes of the Beast">CastSpellByName("Eyes of the Beast")</Binding>
<Binding name="SPELL Beast Lore">CastSpellByName("Beast Lore")</Binding>
<Binding name="SPELL Flare">CastSpellByName("Flare")</Binding>
<Binding name="AAL_ToggleHunterRangedAspect">
if AAL_IsAura("Spell_Nature_RavenForm") then CastSpellByName("Aspect of the Monkey")
else CastSpellByName("Aspect of the Hawk")
end
</Binding>
<Binding name="AAL_EyesOfPetOrKilrogg">
if PetHasActionBar() then CastSpellByName("Eyes of the Beast") else CastSpellByName("Eye of Kilrogg") end
</Binding>
<Binding name="AAL_DismissPet">
local f = UnitCreatureFamily("pet")
if f == "Imp" or f == "Voidwalker" or f == "Succubus" or f == "Felhunter" then PetDismiss()
else CastSpellByName("Dismiss Pet")
end
</Binding>

<Binding name="SPELL Entangling Roots">CastSpellByName("Entangling Roots")</Binding>
<Binding name="SPELL Bear Form">AAL_Dismount(); AAL_Cast("Dire Bear Form", "Bear Form")</Binding>
<Binding name="SPELL Cat Form">AAL_Dismount(); CastSpellByName("Cat Form")</Binding>
<Binding name="SPELL Nature's Grasp">CastSpellByName("Nature's Grasp")</Binding>
<Binding name="SPELL Tranquility">CastSpellByName("Tranquility")</Binding>
<Binding name="SPELL Hurricane">CastSpellByName("Hurricane")</Binding>
<Binding name="SPELL Barkskin">CastSpellByName("Barkskin")</Binding>
<Binding name="AAL_TravelOrAquaticForm">AAL_TravelOrAquaticForm()</Binding>

<Binding name="SPELL Fade">CastSpellByName("Fade")</Binding>
<Binding name="SPELL Mind Vision">CastSpellByName("Mind Vision")</Binding>
<Binding name="SPELL Fear Ward">if not AAL_Cast(".Fear Ward") and UnitAffectingCombat("player") then AAL_Cast("Berserker Rage", "Recklessness") end</Binding>
<Binding name="SPELL Mana Burn">AAL_Cast("Mana Burn")</Binding>
<Binding name="SPELL Dispel Magic">CastSpellByName("Dispel Magic")</Binding>
<Binding name="SPELL Shadowform">CastSpellByName("Shadowform")</Binding>
<Binding name="SPELL Shadow Protection">CastSpellByName("Shadow Protection")</Binding>

<Binding name="SPELL Blink">
local k_IceBlock = AAL_IsAura("Spell_Frost_Frost")
if k_IceBlock then CancelPlayerBuff( k_IceBlock ); return end
local f=AAL_Cast("Blink"); f = f or f==nil and AAL_Cast("Sprint") or AAL_Cast("Goblin Rocket Boots","Gnomish Rocket Boots")
</Binding>
<Binding name="SPELL Flamestrike">CastSpellByName("Flamestrike")</Binding>
<Binding name="SPELL Blizzard">if 1400 > UnitMana("player") then CastSpellByName("Blizzard(Rank 1)") else CastSpellByName("Blizzard") end</Binding>
<Binding name="SPELL Arcane Explosion">CastSpellByName("Arcane Explosion")</Binding>
<Binding name="SPELL Conjure Water">CastSpellByName("Conjure Water")</Binding>
<Binding name="SPELL Conjure Food">CastSpellByName("Conjure Food")</Binding>
<Binding name="SPELL Slow Fall">AAL_Cast(".Levitate", ".Slow Fall")</Binding>
<Binding name="SPELL Detect Magic">CastSpellByName("Detect Magic")</Binding>
<Binding name="SPELL Evocation">if UnitPowerType("player") ~= 0 or 0.70*UnitManaMax("player") > UnitMana("player") and AAL_Cast("Evocation") or CastSpellByName("Life Tap") then end</Binding>
<Binding name="SPELL Dampen Magic">CastSpellByName("Dampen Magic")</Binding>
<Binding name="SPELL Amplify Magic">CastSpellByName("Amplify Magic")</Binding>
<Binding name="SPELL Mana Shield">CastSpellByName("Mana Shield")</Binding>
<Binding name="SPELL Blizzard">CastSpellByName("Blizzard")</Binding>
<Binding name="SPELL Fire Ward">CastSpellByName("Fire Ward")</Binding>
<Binding name="SPELL Frost Ward">CastSpellByName("Frost Ward")</Binding>
<Binding name="SPELL Shadow Ward">CastSpellByName("Shadow Ward")</Binding>
<Binding name="SPELL Ice Block">CastSpellByName("Ice Block")</Binding>
<Binding name="SPELL Cone of Cold">
if not AAL_Cast(".20 Cone of Cold", ".Cone of Cold(Rank 1)") and not AAL_IsCD("Cold Snap") and not AAL_IsGCD() then
   AAL_Cast(".30 Frost Nova", ".Frost Nova(Rank 1)", "Cold Snap")
end
</Binding>

<Binding name="SPELL Life Tap">AAL_Cast("Life Tap")</Binding>
<Binding name="SPELL Summon Imp">CastSpellByName("Summon Imp")</Binding>
<Binding name="SPELL Summon Voidwalker">if not AAL_Cast("Abyss Shard") then CastSpellByName("Summon Voidwalker") end</Binding>
<Binding name="SPELL Summon Succubus">CastSpellByName("Summon Succubus")</Binding>
<Binding name="SPELL Summon Felhunter">CastSpellByName("Summon Felhunter")</Binding>
<Binding name="SPELL Inferno">CastSpellByName("Inferno")</Binding>
<Binding name="SPELL Ritual of Doom">CastSpellByName("Ritual of Doom")</Binding>
<Binding name="AAL_DetectInvisibility">AAL_Cast(".Detect Greater Invisibility", ".Detect Invisibility", ".Detect Lesser Invisibility")</Binding>
<Binding name="SPELL Unending Breath">CastSpellByName("Unending Breath")</Binding>
<Binding name="SPELL Drain Soul">if not AAL_IsGCD() then CastSpellByName("Drain Soul") end</Binding>
<Binding name="SPELL Drain Life">AAL_Cast("Drain Life")</Binding>
<Binding name="SPELL Drain Mana">AAL_Cast("Drain Mana")</Binding>
<Binding name="SPELL Health Funnel">CastSpellByName("Health Funnel(Rank 3)")</Binding>
<Binding name="SPELL Rain of Fire">CastSpellByName("Rain of Fire")</Binding>
<Binding name="SPELL Hellfire">CastSpellByName("Hellfire")</Binding>

<Binding name="SPELL Far Sight">CastSpellByName("Far Sight")</Binding>

<Binding name="SPELL Consecration">CastSpellByName("Consecration")</Binding>
<Binding name="SPELL Holy Wrath">CastSpellByName("Holy Wrath")</Binding>
<Binding name="SPELL Blessing of Sanctuary">CastSpellByName("Blessing of Sanctuary")</Binding>
<Binding name="SPELL Judgement">
if AAL_IsAura( unpack(aal_PaladinSealIcons) ) then CastSpellByName("Judgement")
else AAL_Cast(".Seal of the Crusader")
end
</Binding>

<Binding name="SPELL Retaliation">if AAL_IsActiveSpell("Battle Stance") then CastSpellByName("Retaliation") else CastSpellByName("Battle Stance") end</Binding>
<Binding name="AAL_TranqShotOrDisarmOrFinishEnemy">AAL_TranqShotOrDisarmOrFinishEnemy()</Binding>
<Binding name="AAL_ChargeOrIntercept">
if not UnitAffectingCombat("player") then
   if not AAL_IsActiveSpell("Battle Stance") then CastSpellByName("Battle Stance")
   else CastSpellByName("Charge")
   end
else
   if not AAL_IsActiveSpell("Berserker Stance") then CastSpellByName("Berserker Stance")
   else CastSpellByName("Intercept")
   end
end
</Binding>

<Binding name="AAL_AutoBuffOrPickPocketOrArcanePower">
 local iSpell = aal_Abilities and aal_Abilities["Stealth"]
 if iSpell and IsCurrentCast(iSpell, BOOKTYPE_SPELL) then
    if UnitIsFriend("player","target") or not CheckInteractDistance("target",3) then TargetNearestEnemy() end
    CastSpellByName("Pick Pocket")
 elseif SpellIsTargeting() then CastSpellByName("Arcane Power")
 else RunBinding("AUTOBUFF_TRIGGER")
 end
</Binding>

</Bindings>
