Minion Beta! - Help us test our new AddOn updater. Get it now!
Download
(33 Kb)
Download
Updated: 11-28-09 12:42 AM
Addon for:
ItemRack.
Updated:11-28-09 12:42 AM
Created:04-18-09 11:37 PM
Downloads:3,020
Favorites:22
MD5:
ItemRackStun
Version: r35
by: Draake [More]
Blizzard has made in-combat weapon swapping a protected action, so this addon is no longer able to function properly.

ItemRackStun is a LoD plugin for Gello's ItemRack addon that adds stun/disarm (or anything that causes you lose control of your character or weapon) detection, allowing weapon/gear changes to be postponed until those effects fade (instead of ItemRack trying a few times and then giving up; waiting until combat fades; etc...).

Example:

1) You use a macro which tells ItemRack to equip a sword/shield.
2) Another player disarms you either before or during your weapon swap.
3a) Without ItemRackStun: Normally, ItemRack would just keep trying to equip the weapon even though you can't swap weapons while disarmed. Eventually ItemRack would give up, sometimes disabling your ability to swap weapons until combat fades.
3b) With ItemRackStun: ItemRack detects that you've been disarmed and queues the weapon swap to be completed after disarm fades.


CanCastOptionParse:
I've added a new options parser for insecure actions (talking, dismounting, changing equipment, etc...) that checks a spell's casting status in addition to the player's control status.

The new options are:

spell(or &)=* -> The spell that is going to be checked. (If this is not specified then all other options will be ignored.)

gcd=* -> The maximum amount of time left on the spells cooldown in order to be considered ready. (Default: 0)

ignore:control/equip/form/reagent -> Specifies if the parser should ignore any spell form/equipment/reagent requirements or if the player is unable to act.

cast=*: Can be either start/stop/done/fail and will cause the command to be passed along to a handle which will be triggered when the provided spell (spell=* or the next sent spell) cast has either started, stopped, finished or failed.

no*: If any (or rather most) of the above options are prefixed with 'no' then the opposite will be checked/preformed.

To reiterate: This is only usable with INSECURE ACTIONS. You cannot use this to cast spells, change targets, etc...


Slash Commands:

/dismount & /itemrack: Now use CanCastOptionParse, so you can preform actions based on spell conditions.

/scopt: New command for performing any insecure action.

ex. /scopt [spell=Cyclone] /raid Casting Cyclone on %t!

This will announce "Casting Cyclone on <target>!" in raid chat if cyclone is castable.

Alternatively, you could do:

ex. /scopt [cast=start] /raid Casting Cyclone on %t!
/cast Cyclone

This will perform the same action as in the previous example except it will be triggered when the casting of Cyclone begins.


History:

Blizzard's default API does not give any information whether a player is disarmed or completely unable to act (the closest is HasFullControl() which only returns false for Fear effects). So, I've created a library that watches for effects (gathered from WoW's DBC files) that cause the player to be stunned/feared/charmed/confused/disarmed and offers new functions and events regarding the players control state.

I'll be adding features as I (or anyone with any suggestions) comes up with them.

There are no options (and I can't really think of any to add), but if you have any you'd like to see please feel free to comment on them.
r35-Release
- Removed unneeded debugging output code.

r34-Release
- Fixed a few bugs related to channeled spells and having more than one of the same de/buff on at once.

r32-Release
- Added new insecure command option parser for player state and spell cast info.
- Removed the new slash commands as they were made obselte witht he new option parser.

r27-Release
- Fixed bug with sending player control events.
- Added a few extra slash commands.

r26-Release
- Disabled more debugging code.

r25-Release
- Removed some testing/debugging code.
- Cleaned up more of LPC-1.0's code.
- Added a global version of the function PlayerHasControl().

r23-Release
- Cleaned up LPC-1.0's code.

r21-Release
- Created LibPlayerControl-1.0 library for API and events related to players losing control of their character.
- Removed chatframe warnings/messages.
- Added experimental Itemrack functions.

r18-Release
- I finally took the time/effort to parse the spell DBC files within the WoW client and compiled a complete list of all stun/disarm effects.
- The chat warning will only be printed out once per effect (to make it less spammy).
Archived Files (4)
File Name
Version
Size
Author
Date
r34
33kB
Draake
11-27-09 09:38 PM
r32
27kB
Draake
11-18-09 10:18 AM
r27
25kB
Draake
11-13-09 09:40 PM
r23
22kB
Draake
10-22-09 05:27 AM


Post A Reply Comment Options
Unread 11-13-09, 01:51 AM  
Draake
A Kobold Labourer
 
Draake's Avatar
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 4
Uploads: 1
Originally posted by Inny
Can the PlayerHasControl() function be used from within a macro/script as an alternative to HasFullControl()? (which doesn't work as advertised, basically.)

Trying to use it with this macro to prevent spam when I'm bashing my CC button while unable to cast due to being CC'ed.

#showtooltip
/run s,t,c="Cyclone","target","RAID" if HasFullControl()==1 and GetUnitSpeed("player")==0 and GetSpellCooldown(s)==0 then SendChatMessage(s.." "..UnitName(t).." ("..UnitClass(t)..")",c)end
/cast Cyclone
I'm going to be adding slash commands and global functions after I 'publish' LibPlayerControl in the near future.

I'm not sure if you've gone ahead and done this anyway, but you should just edit LibPlayerControl-1.0.lua and add:

Code:
function PlayerHasControl()
    return lib:PlayerHasControl()
end
somewhere near the bottom until I do so. That will allow you to use 'PlayerHasControl()' in place of 'HasFullControl()==1'.

Edit: I just went ahead and added PlayerHasControl() as a global function. Also, sorry for the long delay in response. =x
__________________
When does the fun part start?
Last edited by Draake : 11-13-09 at 07:22 PM.
Draake is offline Report comment to moderator  
Reply With Quote
Unread 11-07-09, 01:05 PM  
Inny
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
Can the PlayerHasControl() function be used from within a macro/script as an alternative to HasFullControl()? (which doesn't work as advertised, basically.)

Trying to use it with this macro to prevent spam when I'm bashing my CC button while unable to cast due to being CC'ed.

#showtooltip
/run s,t,c="Cyclone","target","RAID" if HasFullControl()==1 and GetUnitSpeed("player")==0 and GetSpellCooldown(s)==0 then SendChatMessage(s.." "..UnitName(t).." ("..UnitClass(t)..")",c)end
/cast Cyclone
Last edited by Inny : 11-07-09 at 01:06 PM.
Inny is offline Report comment to moderator  
Reply With Quote
Unread 05-05-09, 09:09 PM  
Draake
A Kobold Labourer
 
Draake's Avatar
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 4
Uploads: 1
There's nothing to setup

Originally posted by Hidesato
Yes, I use the itemrack too
but I really don't know how the addon works, I must do a event in itemrack?
see image, so?: http://img11.imageshack.us/img11/258...0509153820.jpg

Thanks
You just use itemrack as normal. If you try to switch weapons (or anything) while stunned or disarmed, this addon causes ItemRack to wait for the debuff to fade before doing anything.

For example:

On my Warrior I use a macro that uses itemrack to equip my sword+shield.

Sometimes I would press the macro while a rogue simultaneously dismantles me. ItemRack doesn't check for debuffs normally so it would just keep trying to equip the weapon before giving up after a few tries. And for me, the addon would sometimes lock up and only respond once I left combat (or died in this case).

This addon makes ItemRack check for stun/disarm/etc debuffs and makes it wait for those effects to fade before attempting to swap weapons.
__________________
When does the fun part start?
Last edited by Draake : 05-05-09 at 09:49 PM.
Draake is offline Report comment to moderator  
Reply With Quote
Unread 05-05-09, 04:19 PM  
Hidesato
A Kobold Labourer

Forum posts: 0
File comments: 7
Uploads: 0
Re: Plugin; not Stand-Alone Addon

Originally posted by Draake
This is not a stand alone addon, but a plugin for the ItemRack addon.

Currently, ItemRack (or anything, really; including blizzards own macros) doesn't deal very well when you get stunned/disarmed halfway through a swap, or when you try to start a swap while stunned/disarmed. This plugin hooks into ItemRack and post pones the swap until the debuffs fade.
Yes, I use the itemrack too
but I really don't know how the addon works, I must do a event in itemrack?
see image, so?: http://img11.imageshack.us/img11/258...0509153820.jpg

Thanks
Hidesato is offline Report comment to moderator  
Reply With Quote
Unread 05-05-09, 04:02 AM  
Draake
A Kobold Labourer
 
Draake's Avatar
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 4
Uploads: 1
Plugin; not Stand-Alone Addon

Originally posted by Hidesato
Hi there.

Sorry if this is a bit stupid but I really don't know how the addon works. How do I get it to change weapons? And how do I choose which weapon it changes to? Also, does it change back to the weapon I had equipped before when the disarm effect is over?

Thanks.
This is not a stand alone addon, but a plugin for the ItemRack addon.

Currently, ItemRack (or anything, really; including blizzards own macros) doesn't deal very well when you get stunned/disarmed halfway through a swap, or when you try to start a swap while stunned/disarmed. This plugin hooks into ItemRack and post pones the swap until the debuffs fade.
__________________
When does the fun part start?
Last edited by Draake : 05-05-09 at 04:05 AM.
Draake is offline Report comment to moderator  
Reply With Quote
Unread 05-04-09, 05:21 PM  
Hidesato
A Kobold Labourer

Forum posts: 0
File comments: 7
Uploads: 0
Hi there.

Sorry if this is a bit stupid but I really don't know how the addon works. How do I get it to change weapons? And how do I choose which weapon it changes to? Also, does it change back to the weapon I had equipped before when the disarm effect is over?

Thanks.
Hidesato is offline Report comment to moderator  
Reply With Quote
Unread 04-24-09, 03:17 AM  
Draake
A Kobold Labourer
 
Draake's Avatar
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 4
Uploads: 1
Re: Love it

Originally posted by loladrunk
Just wanted to give my thanks,an awesome addition to ItemRack!
Glad you like it.
__________________
When does the fun part start?
Draake is offline Report comment to moderator  
Reply With Quote
Unread 04-22-09, 11:35 AM  
loladrunk
A Murloc Raider

Forum posts: 4
File comments: 8
Uploads: 0
Love it

Just wanted to give my thanks,an awesome addition to ItemRack!
loladrunk is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: