Item Sync Trigger

Joshman_09

New Member
Reaction score
2
I need a trigger that when a unit aquires an item, a hero gets said abilitys from item...

I know how to do this with a certain item however theres so many items im hoping i can just do this generically... any ideas?
 

HydraRancher

Truth begins in lies
Reaction score
197
You would have to do this manually for every item. Alternatively, you could try storing all the abilities into an array, and matching it with an item.

Like this:

Trigger:
  • Abilities
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • Set Ability[1] = Curse
      • Set Ability[2] = Unholy Frenzy
      • Set Ability[3] = Cripple
      • --------And so on--------


Trigger:
  • Acquire
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Unit - Add Ability[(Level of (Item being Manipulated))]


Or something like that.
 

Joshman_09

New Member
Reaction score
2
Nooo i mean, like

an item thats gives +15 damage is giving to a unit. then a different hero gets that 15 bonus damage also.
 

TomTTT

New Member
Reaction score
44
You would have to do this manually for every item. Alternatively, you could try storing all the abilities into an array, and matching it with an item.

Like this:

Trigger:
  • Abilities
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • Set Ability[1] = Curse
      • Set Ability[2] = Unholy Frenzy
      • Set Ability[3] = Cripple
      • --------And so on--------


Trigger:
  • Acquire
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Unit - Add Ability[(Level of (Item being Manipulated))]


Or something like that.
Isn't that like... Completely wrong?
Level of Item being Manipulated is the level set in the Object Editor...
To find what array was, you need to create a loop, and use a Custom Sctipe to exit when bla bla. If you look at Andrewgosu's spell shop system, you'll see that custom script.

Nooo i mean, like

an item thats gives +15 damage is giving to a unit. then a different hero gets that 15 bonus damage also.

Thats easy. Make a trigger the when
Trigger:
  • Unit - A unit Aquires an item
    • Set tmpUnitGroup = (All units matching ((Matched unit) Is a hero equal to True))
    • Unit Group - Pick every unit in tmpUnitGroup and do (Action)
    • Loop - Actions
    • Item - Create (Item type of (Item being manipulated)) and give it to Picked unit.

Sorry, handwritten. If you can also buy the item, you should make another trigger similiar to thise with the event Unit - A unit Sells an item, and change the Function to Item type of Sold Item.
 

HydraRancher

Truth begins in lies
Reaction score
197
Isn't that like... Completely wrong?
Level of Item being Manipulated is the level set in the Object Editor...

Um yes that was what I was going for.

Apparently that wasn't his question though.

He wants to create a controlled state between two units. I think he doesn't want to replicate the item, he wants to replicate the ability.
 

Joshman_09

New Member
Reaction score
2
^^ yesssss that man's got it lol

na i dont want to replicate the item, i just want the hero to get the same buffs from the items the other unit has.
 

HydraRancher

Truth begins in lies
Reaction score
197
Then you either have to do each item individually, or do what I did earlier.


The way my trigger works is you create a list or array of abilities, and then assign each item a item level, that corresponds to the ability. For instance, it would be something like:

Ability[1] = +15% ATK Speed

Item (Level 1) = Gloves of Haste


And then use a trigger to make that work. But that is probably more work than just doing each trigger separately so I recommend that instead.
 
General chit-chat
Help Users

      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