• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Changed hero has previous hero's item

Status
Not open for further replies.
Level 11
Joined
Oct 31, 2010
Messages
1,057
how do i make that when a hero is killed and another hero is created, the killed hero's item is given to the newly created hero
edit : i need it for when a hero goes through a job advancement, the hero's item are given to the new hero
 
how do i make that when a hero is killed and another hero is created, the killed hero's item is given to the newly created hero
edit : i need it for when a hero goes through a job advancement, the hero's item are given to the new hero

OPTION 1 : the item would be given to the new unit and then your old unit would get removed

  • Untitled Trigger 002
    • Events
    • Conditions
    • Actions
      • Unit - Create 1 New Unit for Owner of Last Unit at Position of Last Unit facing Default building facing degrees
      • Set NewUnit = (Last created unit)
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Hero - Give (Item carried by (Old Unit) in slot (Integer A)) to NewUnit
          • Unit - Remove (Old Unit) from the game
OPTION 2 : the items would be lying on the ground and the new unit could pick it up afterwards
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Hero - Drop the item from slot (Integer A) of (Old Unit)
          • Unit - Remove (Old Unit) from the game
          • Unit - Create 1 New Unit for Owner of Last Unit at Position of Last Unit facing Default building facing degrees
 
does triggering unit works for a unit dies event ?

yes, it works :)
the (Triggering Unit) refer to your old unit

Edit : did you mean option 1 ?
yeah, you don't need that variable, forgive me.. just change it to (Last Created Unit)


  • Untitled Trigger 002
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Unit - Create 1 Paladin for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Hero - Give (Item carried by (Triggering unit) in slot (Integer A)) to (Last created unit)
          • Unit - Remove (Triggering unit) from the game
Note : if you use wait, then this trigger wouldn't work..
 
Status
Not open for further replies.
Back
Top