• 🏆 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!

Detecting Ability Being Cast as item ability.

Status
Not open for further replies.
Level 13
Joined
Sep 29, 2008
Messages
671
As I said as a "condition".

let's say you made a trigger that everytime a hero casts a spell they are silenced.
if i use unit - starts the effect of an ability, it also works with item abilities.
that's y i was asking for condition to be able to negate items spells from triggering that event.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Is an ability being "cast from an item" not the same as an "item being used"?

Not really. Town Portal for example has cast time. The item only gets "used" until the ability has finished. Those events also provide different event responses. I believe charges are already subtracted on "use" etc.

What I was referring to, though, was whether TC meant the ability property "Is an item ability", which holds no gameplay effects afaik.
 
Is Item Ability (Boolean)

No but as I said before, the only way to do that is to save it into a hashtable. So like this...
  • Item abilities
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set IsAbilItem = (Last created hashtable)
      • Set TempAbil = Blink (Item Version)
      • Custom script: call SaveBoolean( udg_IsAbilItem, udg_TempAbil, 0, true )
  • ItemAbil Boolean Check
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set TempAbil = (Ability being cast)
      • Custom script: set udg_TempBoolean = LoadBoolean( udg_IsAbilItem, udg_TempAbil, 0 )
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempBoolean Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: ITEM ABIL!
        • Else - Actions
A quick lil demo of this is here View attachment IsItemAbil.w3x
 
Status
Not open for further replies.
Top