• 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.

transferring Items from unit to unit

Status
Not open for further replies.
Level 5
Joined
Oct 20, 2019
Messages
60
Hello, i could need some help =)

I have this unit that wants to evolve from one unit to another more improved unit and that non evolved unit has some items on him, however those items obviously disappears when i remove the old unit and creates the new evolved unit.

So my question is, how do i get the old units items to transfer to the new unit before i remove the old unit entirely?

I have created this trigger for the evolution, probably extremely basic but it works, but i need to implement a solution for this item problem that i have.

I'm greatful for any help =)


  • Human Guardian Evolve
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Human Guardian Stage 1
    • Actions
      • Set VariableSet HumanGuardianLvl = (HumanGuardianLvl + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HumanGuardianLvl Equal to 15
        • Then - Actions
          • Set VariableSet CrushingBlowLvl = (Level of Crushing Blow for HumanGuardian)
          • Set VariableSet ShieldSlamLvl = (Level of Shield Slam for HumanGuardian)
          • Set VariableSet ShieldBlockLvl = (Level of Shield Block for HumanGuardian)
          • Set VariableSet HeroLevelInteger = (Player number of (Owner of (Triggering unit)))
          • Set VariableSet HeroToLevel[HeroLevelInteger] = (Triggering unit)
          • Set VariableSet HumanGuardianPosition = (Position of HeroToLevel[HeroLevelInteger])
          • Unit - Remove HeroToLevel[HeroLevelInteger] from the game
          • Unit - Create 1 Human Guardian Stage 2 for (Owner of HeroToLevel[HeroLevelInteger]) at HumanGuardianPosition facing Default building facing degrees
          • Set VariableSet HumanGuardian = (Last created unit)
          • Hero - Set Name of HumanGuardian to (Name of (Owner of HumanGuardian))
          • Hero - Set HumanGuardian Hero-level to 15, Show level-up graphics
          • Selection - Add HumanGuardian to selection for (Owner of HumanGuardian)
          • Hero - Learn skill for HumanGuardian: Crushing Blow
          • Unit - Set level of Crushing Blow for HumanGuardian to CrushingBlowLvl
          • Hero - Learn skill for HumanGuardian: Shield Slam
          • Unit - Set level of Shield Slam for HumanGuardian to ShieldSlamLvl
          • Hero - Learn skill for HumanGuardian: Shield Block
          • Unit - Set level of Shield Block for HumanGuardian to ShieldBlockLvl
          • Custom script: call RemoveLocation(udg_HumanGuardianPosition)
        • Else - Actions
 
Status
Not open for further replies.
Top