• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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

Status
Not open for further replies.

Mythran

M

Mythran

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 by a moderator:
Status
Not open for further replies.
Back
Top