help with trigger ability item

1346610

New Member
Reaction score
6
Hello guys i am trying to make this

Whenever you cast a spell, a explosion of fire is realesed from the unit, dealing 120 damage to all units within 300.

Any explain or example of the trigger?

And Mostly,how do i check if unit has item and how do i make it to damage only enemy units?

Thanks.

EDIT: I guess i made it simple but didnt test it yet

Trigger:
  • Hellfire Ring Ability
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Triggering unit) has an item of type Hellfire Ring) Equal to (==) True
    • Actions
      • Set point = (Position of (Casting unit))
      • Unit - Create 1 dummy ring item for Player 1 (Red) at point facing Default building facing (270.0) degrees
      • Unit - Add a 0.40 second Generic expiration timer to (Last created unit)


Added to the dummy permanent immolation 300 aoe 120 dmg ;) now ima gona test it

EDIT2: Omg it works ! Omg first time i did a trigger like it and it works ! :D

You guys can still be useful for me for any suggest for remove leaks if there are etc ;)
 

Ryushi

"I will stand, or I will fall. I will not sit."
Reaction score
59
You would have to add in a call RemoveLocation (udg_point) to finish removing the leak.
 

1346610

New Member
Reaction score
6
You would have to add in a call RemoveLocation (udg_point) to finish removing the leak.

Yes i thought at that, thank you :p

Trigger:
  • Hellfire Ring Ability
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Triggering unit) has an item of type Hellfire Ring) Equal to (==) True
    • Actions
      • Set point = (Position of (Casting unit))
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
          • Then - Actions
            • Unit - Create 1 dummy ring item for Player 1 (Red) at point facing Default building facing (270.0) degrees
            • Wait 0.30 seconds
            • Unit - Add Immolation Hellfire ring to (Last created unit)
            • Unit - Add a 0.40 second Generic expiration timer to (Last created unit)
          • Else - Actions
      • Custom script: call RemoveLocation (udg_point)


Used wait for a good reason, i just created the unit with model of phoenix something so when it hits the floor he damages,it works perfectly.
 

Smitty

Member
Reaction score
20
Um, what's the purpose of the 0.3s wait? Because it could cause your trigger to malfunction. Also, why is the dummy created for player 1, rather than the owner of the unit using the item?
 

1346610

New Member
Reaction score
6
Um, what's the purpose of the 0.3s wait? Because it could cause your trigger to malfunction. Also, why is the dummy created for player 1, rather than the owner of the unit using the item?

Yes i allready modified it , this trigger is old but i am not having problems with the waits,i coudnt add timers anyway...
 

Smitty

Member
Reaction score
20
You won't have problems with waits until you have mutiple triggers running at once, and one creates a unit in that 0.3s, then last created unit would refer to the wrong unit in this trigger.
 

1346610

New Member
Reaction score
6
You won't have problems with waits until you have mutiple triggers running at once, and one creates a unit in that 0.3s, then last created unit would refer to the wrong unit in this trigger.

Ok ok let me post because you still talking about the owner of created unit -.-

Trigger:
  • Hellfire Ring Ability
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Triggering unit) has an item of type Hellfire Ring) Equal to (==) True
      • (Ability being cast) Not equal to (!=) Incinerate
    • Actions
      • Set point = (Position of (Casting unit))
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
          • Then - Actions
            • Unit - Create 1 Dummy for (Owner of (Casting unit)) at point facing Default building facing (270.0) degrees
            • Wait 0.35 seconds
            • Unit - Add Immolation Hellfire ring to (Last created unit)
            • Unit - Add a 0.40 second Generic expiration timer to (Last created unit)
          • Else - Actions
      • Custom script: call RemoveLocation (udg_point)


Well so if you can tell me how to do it with timers instead of saying waits will cause problem(coz i know that),i would appreciate it.
 

Smitty

Member
Reaction score
20
Read what I said. I didn't say anything in my second post about the owner of the unit. What I said was that using 'last created unit' across a wait is bad, and may cause the trigger to not function properly. Read first and think please.

Regarding timers I can't tell you offhand, but if you create the dummy AFTER the wait, it would work fine as far as I can see.
 

1346610

New Member
Reaction score
6
Read what I said. I didn't say anything in my second post about the owner of the unit. What I said was that using 'last created unit' across a wait is bad, and may cause the trigger to not function properly. Read first and think please.

Regarding timers I can't tell you offhand, but if you create the dummy AFTER the wait, it would work fine as far as I can see.

It works for me with the owner of casting unit and i thought at all.
 

Smitty

Member
Reaction score
20
*sigh* I'm not talking about the owner of the dummy! I'm taking about the wait between creating the dummy and referring to it as 'last created unit'. THAT'S what the problem is here that I'm taping about :x
 

1346610

New Member
Reaction score
6
but if you create the dummy AFTER the wait, it would work fine as far as I can see.
*sigh* I'm not talking about the owner of the dummy! I'm taking about the wait between creating the dummy and referring to it as 'last created unit'. THAT'S what the problem is here that I'm taping about :x

Yeah but it needs for the effect that when it hits the floor he deals dmg... because the phoenix effect has a delay for hit the floor :(
 

Smitty

Member
Reaction score
20
Instead of immolation then, just pick every unit matching conditions, and damage them using triggers.
 

Smitty

Member
Reaction score
20
Not really, just check that units are not allied to the triggering unit. Or magic immune. Done.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
just do this... set a variable with an index equal to the unit that was created for the wait, and save the index as the player number of the owner, that way you can just reference that and the wait wont matter at all anyway...
then for the damage just do this...
Trigger:
  • Actions
    • Set Temp_Group = Units within Xrange of triggering unit matching condition (owner of matching unit is an enemy of owner of triggering unit)
    • Unit Group - Pick all units in Temp_Group and do actions
      • Loop Actions
        • Unit - Cause triggering unit to damage picked unit for Xdamage
    • Custom Script: Call destroyunitgroup(UDG_Temp_Group)
 
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