WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Released AddOns (https://www.wowinterface.com/forums/forumdisplay.php?f=9)
-   -   Behaviors (https://www.wowinterface.com/forums/showthread.php?t=17417)

Nexuapex 07-28-08 06:14 PM

Behaviors
 
Been working on it for a little while, and now my first publicly released add-on, Behaviors, is available. It's basically a lightweight way to add snippets of Lua to the game. I found myself one day with five or six macros and add-ons that all made tiny little tweaks, and decided that I wanted to make a lightweight add-on that let me keep all those tweaks in one place. This is the result.

The download page should have most of the useful information. Feedback would be awesome.

VonRoeder 07-28-08 06:46 PM

This is an exceptionally clever idea. I'm jealous I didn't think of it.

Nexuapex 07-30-08 03:45 PM

v1.01
 
I probably should do something besides work on this add-on.

Anyway, 1.01 adds support for enabling/disabling behaviors on a per-character basis, and also for adding slash commands.

hypehuman 08-03-08 07:35 AM

Mounting Trinket
 
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

Nexuapex 08-03-08 05:09 PM

I also have a Carrot on a Stick behavior, but it's a tad simpler (one mount, and doesn't watch changes to your trinket when mounted). One of the things on my wish list is a way to simplify these mount behaviors, but that may not happen, given WotLK's proximity.


All times are GMT -6. The time now is 02:23 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI