• 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.

[General] Cancel item being used

Status
Not open for further replies.
Level 1
Joined
Oct 16, 2019
Messages
4
In my map, heroes use wands to cast spells. A wand is an item with an assigned integer number from 1 to 100, that number indicates the percentage probability of a wand spell being cast successfully. If the cast roll is high enough, the spell casts as usual; if the cast fails, the spell must be cancelled.

My problem is that I can't order my hero to cancel the cast, because I'm using the "item is being used" event.

I tried:
1) to remove and add again the item being used
2) to drop the item being used
3) to order hero to stop

None of these worked. Please help me, I would be very grateful.
 
Level 30
Joined
Feb 18, 2014
Messages
3,623
Don't use the event "A unit Uses an item", use the event "A unit Starts the effect of an ability" instead and then order the triggering unit to stop if the roll fails.
  • Item Interrupt
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mass Teleport Item
    • Actions
      • Set RollChance = (Random integer number between 1 and 100)
      • Game - Display to (All players) the text: (String(RollChance))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RollChance Lesser than or Equal to 50
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop
        • Else - Actions
          • Do nothing
 
Last edited:
Status
Not open for further replies.
Top