Creating Permanent Units with Item

johnnyfire

New Member
Reaction score
8
This is the trigger I used in my DotA Troops map to make units from an item.
I was wondering if it leaked or if there was an easier way to create units with an item.

Example
-created charged item that is actively used [chargeitem]
-food [#] is max food minus food needed
-used this trigger
Create Unit
Events
Unit - A unit Uses an item
Conditions
(Item-type of (Item being manipulated)) Equal to [chargeitem]
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Hero manipulating item)) Food used) Less than or equal to [#]
Then - Actions
Unit - Create 6 [unit] for (Triggering player) at (Position of (Triggering unit)) facing (Facing of (Triggering unit)) degrees
Else - Actions
Hero - Create [chargeitem] and give it to (Hero manipulating item)
 

Knocksious

Sweet, I got 2 little green bars!
Reaction score
46
why not just make an item ability based off of summon water elemental, and give it no buffs, and set the duration to the max duration
 

Sim

Forum Administrator
Staff member
Reaction score
534
> Unit - Create 6 [unit] for (Triggering player) at (Position of (Triggering unit)) facing (Facing of (Triggering unit)) degrees

Leaks a point.

Set Point_Loc = (Position of (Triggering unit))
Unit - Create 6 [unit] for (Owner of (Triggering Unit)) at Point_Loc facing (Facing of (Triggering unit)) degrees
Custom script: call RemoveLocation(udg_Point_Loc)

I think you can't use (Triggering player) but don't quote me there. I heard sometimes it's ok to use it even if there's no "triggering player" really. I myself never use it unless the event has a direct connection with a player.

And your method is ok.
 

johnnyfire

New Member
Reaction score
8
I tested it out and it works, but i just wanted to know if there would be an instance in which it would not work
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top