• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Help with ability that activated an item in inventory

Status
Not open for further replies.
Level 1
Joined
Nov 16, 2007
Messages
5
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:

  • 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)))]
(I store the weapon item in the global array HeroesWeapons[] whenever the hero purchases a new weapon)

Thanks a lot.
 
Last edited:
Status
Not open for further replies.
Top