Detecting Item Target

Sirroelivan

Gunnerkrigg Court
Reaction score
95
Is there any condition that can detect the target of the item from the event "specific unit uses an item"?
 

XeNiM666

I lurk for pizza
Reaction score
138
detect what target??

a unit-type?
or a specific unit like Footman <0092 gen>
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
well using an item on a unit is an order and you can get the target unit of issued order but you can't ask which order has been issued like smart or attack.
 

XeNiM666

I lurk for pizza
Reaction score
138
How bout using this?

Code:
Condition
    (Ability being cast) Equal to Item
    (Unit-type of (Target unit of ability being cast)) Equal to Footman]
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
use a unit is issued targeting an object (with your item) then the unit is the target of issued order but you wont be able to ask which order has been issued
 

Sirroelivan

Gunnerkrigg Court
Reaction score
95
But then'll have to change the event, no? I want to be able to detect the item-type and unit-type it's casted on without having to make a different ability for every item.

Edit: I could put a small wait in the "unit uses item" trigger and at the same time let another trigger fire that detects the ability cast and the target and then stores the target in a variable, which is then used in the first trigger.

Currently i'm using this trigger

Code:
Creature Card Played
    Events
        Unit - Deck Master 0001 <gen> Uses an item
        Unit - Deck Master 0002 <gen> Uses an item
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Item-type of (Item being manipulated)) Equal to Chillspawn Dragon
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of (Targeted unit)) Equal to Defender
            Then - Actions
                Set Point = (Random point in Reg_Defender[(Player number of (Owner of (Hero manipulating item)))])
                Unit - Create 1 Unt_Type_Creature[(Integer((Current life of (Item being manipulated))))] for (Owner of (Hero manipulating item)) at Point facing Default building facing degrees
                Custom script:   call RemoveLocation(udg_Point)
            Else - Actions
                Do nothing

PROBLEM FIXED: I've taken a completly other route, so help is no longer necessary. Everyone thx for the help.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top