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

Item transportation.

Status
Not open for further replies.
Level 10
Joined
Mar 17, 2012
Messages
582
Hi there! Tell me please how to make next thing:

I have some event...
and some condition...
In actions hero have to disappear and on his place appears a new hero...

how to give the new hero all items that old hero had?
 
Level 10
Joined
Mar 17, 2012
Messages
582
  • Orc Monk
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Item-type of (Sold Item)) Equal to Orc Monk
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Buying unit)) Equal to Orc Fighter
          • (Level of (Buying unit)) Greater than or equal to 20
        • Then - Actions
          • Set Orc_Monk_Buyer = (Buying unit)
          • Set Orc_Fighter_Level = (Level of Orc_Monk_Buyer)
          • Set Orc_Monk_Point = (Position of Orc_Monk_Buyer)
          • Set Orc_Fighter_Exp = (Hero experience of Orc_Monk_Buyer)
          • Special Effect - Create a special effect at Orc_Monk_Point using Abilities\Spells\Orc\Reincarnation\ReincarnationTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • For each (Integer A) from Temp_Integer to 6, do (Actions)
            • Loop - Actions
              • Hero - Drop the item from slot Temp_Integer of Orc_Monk_Buyer
          • Unit - Remove Orc_Monk_Buyer from the game
          • Unit - Create 1 Orc Monk for (Owner of Orc_Monk_Buyer) at Orc_Monk_Point facing Default building facing degrees
          • Selection - Select (Last created unit) for (Owner of Orc_Monk_Buyer)
          • Hero - Set (Last created unit) experience to Orc_Fighter_Exp, Hide level-up graphics
          • For each (Integer A) from 1 to (Orc_Fighter_Level - 1), do (Actions)
            • Loop - Actions
              • Unit - Add CON Orc Fighter +47 to (Last created unit)
              • Unit - Increase level of CON Orc Fighter +47 for (Last created unit)
              • Unit - Remove CON Orc Fighter +47 from (Last created unit)
              • Unit - Add MEN Dwarf/Faceless/Orc Fighter +27 to (Last created unit)
              • Unit - Increase level of MEN Dwarf/Faceless/Orc Fighter +27 for (Last created unit)
              • Unit - Remove MEN Dwarf/Faceless/Orc Fighter +27 from (Last created unit)
          • For each (Integer A) from 1 to 3, do (Actions)
            • Loop - Actions
              • Hero - Modify Strength of (Last created unit): Add (40 / 10)
              • Hero - Modify Intelligence of (Last created unit): Add (18 / 10)
          • Set Orc_Monk_Buyer = No unit
          • Set Orc_Fighter_Level = 0
          • Set Orc_Fighter_Exp = 0
          • Custom script: call RemoveLocation(udg_Orc_Monk_Point)
        • Else - Actions
          • Game - Display to (All allies of (Owner of (Buying unit))) for 5.00 seconds the text: |cffff0000You are n...
          • Player - Add 15000 to (Owner of (Buying unit)) Current gold
 
Level 16
Joined
Dec 15, 2011
Messages
1,423
  • Orc Monk
    • For each (Integer A) from Temp_Integer to 6, do (Actions)
      • Loop - Actions
        • Hero - Drop the item from slot Temp_Integer of Orc_Monk_Buyer

This part is wrong. Fix'd below

  • For each (Integer Temp_Integer) from 1 to 6, do (Actions)
    • Loop - Actions
      • Hero - Drop the item from slot Temp_Integer of Orc_Monk_Buyer
      • Set Temp_Item[Temp_Integer] = (Last dropped item)
When you add them back

  • For each (Integer Temp_Integer) from 1 to 6, do (Actions)
    • Loop - Actions
      • Hero - Give Temp_Item[Temp_Integer] to (Last created unit)
Or you can create the new unit and execute the adding of items in the previous loop instead of using an item array as a medium.
 
Status
Not open for further replies.
Top