Help with ability that activates an item in inventory
I have a system where Heroes purchase different items that are weapons (they can only have one weapon equipped at the same time). Basically I want to give all the Heroes the ability "Fire Weapon" that will instantly use the weapon item they're carrying. It should act as if the player had clicked on the actual item (get the target unit cursor, fire instantly, depending on each item).
Is there any way to trigger the "use" of an item through an ability, either through GUI or JASS? This is the GUI Script I have but it doesn't do anything:
Thanks a lot.
I have a system where Heroes purchase different items that are weapons (they can only have one weapon equipped at the same time). Basically I want to give all the Heroes the ability "Fire Weapon" that will instantly use the weapon item they're carrying. It should act as if the player had clicked on the actual item (get the target unit cursor, fire instantly, depending on each item).
Is there any way to trigger the "use" of an item through an ability, either through GUI or JASS? This is the GUI Script I have but it doesn't do anything:
-
Shoot Weapon
-
Events
- Unit - A unit Begins casting an ability
-
Conditions
- (Ability being cast) Equal to Fire Weapon
-
Actions
- Hero - Order (Triggering unit) to use HeroesWeapons[(Player number of (Owner of (Triggering unit)))]
-
Events
Thanks a lot.
Last edited: