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

Spell casted by an item. prob

Status
Not open for further replies.
Level 1
Joined
Sep 4, 2017
Messages
3
So when a unit is using item. How should i make conditions to call what item, what unit is targeted.
should i change the event to using ability but how do i call the targeted unit and spell on item being used?
i've tried many commands but none of it rly works..
 
Level 13
Joined
May 10, 2009
Messages
868
I might have not gotten what you meant, but in case you want to distinguish if target is an item or a unit, then:

You should make your trigger just like when creating a "normal" unit/hero ability. The only difference is that you should check if target is a unit or an item.

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Item Purge (3)
    • -------- Item Purge (3) is the actual spell from the Shamanic Totem item --------
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Target item of ability being cast) Not equal to No item
        • -------- If target item is not null, then --------
      • Then - Actions
        • -------- It's an item --------
      • Else - Actions
        • -------- It's a unit --------
 
Last edited:
Level 1
Joined
Sep 4, 2017
Messages
3
the event and condition than u suggest is the thing that i was looking for so ty ;) however i actually meant a Condition that says somethink like "if the target of spell equal "that current building on the map". Right now i am looking for a condition like that and don't see any. Is it even possible ?
 
Level 13
Joined
May 10, 2009
Messages
868
Yes, it is.

For a very specific unit/structure/hero, you can use the Unit Comparison:
  • (Target unit of ability being cast) Equal to YOUR_UNIT
For generic structures (any), check what type of unit they are through the Boolean Comparison:
  • ((Target unit of ability being cast) is A structure) Equal to True
There's also the Unit Type comparison:
  • (Unit-type of (Target unit of ability being cast)) Equal to UNIT_TYPE
There's even more: Create a unit group, and add your very specific units to it, then use Boolean Comparison for checking if unit is in a unit group.
  • ((Target unit of ability being cast) is in yourGroup) Equal to True
Depending one how and what you're trying to do, there are even more ways to create your conditions (using: hash table, unit custom value, unit point value, dynamic indexing), but let's just keep things simple.
 
Level 1
Joined
Sep 4, 2017
Messages
3
(Target unit of ability being cast) Equal to YOUR_UNIT <- ty that was the part i was looking for . i was actually searching in unit comparison but i didn't see "Target unit of ability being cast" line :d once again ty for help
 
Status
Not open for further replies.
Top