Collecting spell

go7ary

New Member
Reaction score
0
hi everyone- i was hoping if someone could please help me make a spell- the spell is suppose to make a specific unit type collect a specific item- i think i need to make a dummy spell, but im not experienced with triggers. If someone could please post a trigger that would make the specific unit automatically collect a specific item that would be really helpful- if its possable i want the spell to be one of those right click and activate it automatically for as long as its selected. Thank yo :)
 

Rainther

I guess I should write something of value here...
Reaction score
61
Or to create an item directly to him? :p I haven't played much with items so I'll stay at the side and watch others solutions and learn something myself too :D

Best wishes.
 

go7ary

New Member
Reaction score
0
sorry for confusion :p - i mean to say is that i want a unit, that has an spell- when this spell is cast it collects a specific item near it- and the spell can be put on automatic mode
 

Hadezown

TH.net Regular
Reaction score
5
Try this:

Code:
Events
    Unit - A unit Starts the effect of an ability

Conditions
    (Ability being cast) Equal to ItemGivingAbility

Actions
    Hero - Create YourItem and give it to (Casting unit)

The ItemGivingAbility can be based on autocasting Frost Armor, that's just what I would use anyway. Just remove the armor bonus and duration of the frost armor and it should work fine. Inner Fire works too. Just keep in mind they will only autocast when the unit is attacking.
 

go7ary

New Member
Reaction score
0
thank you for the help- but i think you understood wrong - my fault for unclear explanation. There item is already on the map- i just want the unit to collect the item not create it.
 

Fallen-Kid

New Member
Reaction score
12
Do you want the unit to go to the point where it is? Or just have the item moved to his inventory?
 

Silver

New Member
Reaction score
21
Do what Hadezown said but first set the item type in a variable, then remove the item from the game, and then create the item again but put it in the inventory of the unit that cast the ability.

OR:
Trigger:
  • Hero - Give (Item) to (Triggering unit)

(Item) is a preset item that you selected in the world editor, and Triggering unit is the unit that cast the spell.
 

Devrak

New Member
Reaction score
17
Perhaps something like this?

Trigger:
  • Pick Item Ability
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to <YourCollectAbility>
    • Actions
      • Item - Pick every item in (Region centered at (Position of (Casting unit)) with size (200.00, 200.00)) and do (Actions)
        • Loop - Actions
          • Hero - Give (Picked item) to (Casting unit)


I haven't tried it though, so I'm not 100% it works good.
 

tommerbob

Minecraft. :D
Reaction score
110
That would probably work.

Make sure you remove the memory leak too, by setting the position of the unit to a variable, then remove it.
 
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