I love it! I've made one that equips my Carrot on a Stick while I'm mounted. Itemrack already does this, but the one that this mod enabled me to make is better in two ways: (1) it won't interrupt your spell casting upon dismount, and (2) it takes into account trinkets that you manually equip while you're mounted. There are two places you might want to change it, and they're right in the beginning. One is the list of mounts (a full list can be found at
http://thottbot.com/?e=Apply%20Aura%3A%20Mounted#B::A under "spells"). The second is the ID of the item you're using (you might have your leatherworking trinket).
--declare item code for the trinket to be equipped
MountTrinketID="11122"
--declare names of the mount's spell and buff; NOT the item's name
MountNames={"Great Brown Kodo", "Silver Riding Talbuk", "Snowy Gryphon Mount"}
--track movements of items into top trinket slot
event "ITEM_LOCK_CHANGED"
function blah(slot)
if slot==13 then
T1ItemEquipped=string.sub(GetInventoryItemLink("player",13),18,22)
if not (T1ItemEquipped==MountTrinketID) then
TrinketEquippedBeforeMount=T1ItemEquipped
end
end
end
--mounting up
event "UNIT_SPELLCAST_SUCCEEDED"
function HantleMounting(arg1, arg2)
local mount=0
if arg1=="player" then
i=1
repeat
if arg2==MountNames[i] then
MountCastName = MountNames[i]
if not (TrinketSwapQueued==1) then
TrinketEquippedBeforeMount=T1ItemEquipped
if TrinketEquippedBeforeMount==nil then TrinketEquippedBeforeMount=string.sub(GetInventoryItemLink("player",13),18,22) end
if TrinketEquippedBeforeMount==MountTrinketID then TrinketEquippedBeforeMount=nil end
end
EquipItemByName(MountTrinketID)
CurrentMountName=MountCastName
end
i=i+1
until not (MountCastName==nil) or i>getn(MountNames)
MountCastName=nil
end
end
--dismounting
event "PLAYER_AURAS_CHANGED"
function HandleDismounting(arg1)
if not (CurrentMountName==nil) and GetPlayerBuffName(CurrentMountName)==nil then
if not (UnitCastingInfo("Player")==nil) or UnitAffectingCombat("player") then
TrinketSwapQueued=1
else
EquipItemByName(TrinketEquippedBeforeMount)
TrinketEquippedBeforeMount=nil
end
CurrentMountName=nil
end
end
--queued swap upon leaving combat
event "PLAYER_REGEN_ENABLED"
function HandleExitCombat()
if TrinketSwapQueued==1 and UnitCastingInfo("Player")==nil then
EquipItemByName(TrinketEquippedBeforeMount)
TrinketEquippedBeforeMount=nil
TrinketSwapQueued=0
end
end
--queued swap upon cast finishing
event "UNIT_SPELLCAST_STOP"
function HandleStopSpell(caster)
if TrinketSwapQueued==1 and caster=="player" and not UnitAffectingCombat("player") then
EquipItemByName(TrinketEquippedBeforeMount)
TrinketEquippedBeforeMount=nil
TrinketSwapQueued=0
end
end