Item Variables

kungfuturte0

New Member
Reaction score
2
So annoying: :banghead:

I want to remove an item from a hero and give him another item. So to do this i have created an item variable array (gives a random item to hero). But now i need to set each variables as an item. To do this i have placed the item for each variable on the ground and hidden it. When i do this and give the hero a random array number, to give him a random item, he only gets the item once. Is there some way to make it so that when the hero is given the item it gives him a duplicate and keeps the original one there. OR could i use a variable item-type and give him this item somehow??? :banghead:

Thanks for any help. Any solution will result in Rep + :D
 
Reaction score
456
Code:
Hero - Create (Item-type of item_ar[(Random integer number between x and y)]) and give it to <your hero>

Work something out of that? (item_ar is a item array variable)
 

kungfuturte0

New Member
Reaction score
2
Code:
Hero - Create (Item-type of item_ar[(Random integer number between x and y)]) and give it to <your hero>

Work something out of that? (item_ar is a item array variable)

Thanks alot! Didn't realise that Hero - Create item also gave the item to the hero. Thanks alot! Rep + ;)
 

kungfuturte0

New Member
Reaction score
2
Code:
Dialog - A dialog button is clicked for Cain
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                And - All (Conditions) are true
                    Conditions
                        (Clicked dialog button) Equal to Cain_Indentify
                        (Player 1 (Red) Current gold) Greater than or equal to 100
                    [B][U]((Last created unit)[/U][/B] has an item of type |CFF7EBFF1Unindentified Sword) Equal to True
            Then - Actions
                    Player - Set Player 1 (Red) Current gold to ((Player 1 (Red) Current gold) - 100)
                Custom script:   set bj_wantDestroyGroup = true
                Item - Remove (Item carried by (Random unit from (Units owned by Player 1 (Red))) of type |CFF7EBFF1Unindentified Sword)
                Wait 0.25 seconds
                Custom script:   set bj_wantDestroyGroup = true
                Hero - Create (Item-type of Weapons[(Random integer number between 1 and 5)]) and give it to (Random unit from (Units owned by Player 1 (Red)))
            Else - Actions
                Do nothing

How can i get around this because my heros are created via dialog boxes. So i need something like hero-type. Do i need to use some kind of variable. Thanks again!
 
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