View Single Post
04-13-09, 10:12 AM   #1
Lhooq
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 3
Improve spells which target an item

I dislike the way spells like windfury work.
When I program a button with such configuration :
- type : spell
- spell : windfury
- target-slot : 17

I hope that only offhand weapon will be enchanted.
However SpellCanTargetItem will return false if there is no enchant on mainhand weapon, so UseInventoryItem will not be called.
And the result is that mainhand weapon is enchanted.

What I would like is an improved SpellCanTargetItem :
haveToTargetItem, mayTargetItem = SpellCanTargetItem();
So windfury spell will returns (false, true) when there is no enchant on mainhand weapon and (true, true) if both MH and OH weapons are enchanted with flametong.
Then in secureTemplates.lua you check the second boolean.

So I can create buttons which always enchant the MH or always the OH.
  Reply With Quote