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

Random Drop SetUp Question

Status
Not open for further replies.
Level 7
Joined
Nov 6, 2019
Messages
192
ok so this is just a test for future references, but iu like idea of drops same item but randomize the stats it has.

i got it set up like this to test atm, the description and tooltip change, however the name doesn't and it doesn't add the ability to the item like it meant to

  • DropItem
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Peasant
      • (Owner of (Dying unit)) Equal to Neutral Hostile
    • Actions
      • Item - Create Claws at (Position of (Dying unit))
      • Set VariableSet TheDrop = (Last created item)
      • Wait 0.10 seconds
      • Item - Set Name of TheDrop to ((Name of TheDrop) + ( - |cffff8080Level|r: + (String((Hero level of (Killing unit))))))
      • Set VariableSet SetInt[1] = (Random integer number between 1 and 3)
      • Set VariableSet SetInt[2] = (Random integer number between 1 and 3)
      • Set VariableSet SetInt[3] = (Random integer number between 1 and 3)
      • -------- Armor --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SetInt[1] Equal to 1
        • Then - Actions
          • Set VariableSet IDropString[1] = |cff808080Armor|r: +1|n
          • Item - For Item: TheDrop, Add Ability: Armor (+1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SetInt[1] Equal to 2
        • Then - Actions
          • Set VariableSet IDropString[1] = |cff808080Armor|r: +2|n
          • Item - For Item: TheDrop, Add Ability: Armor (+2)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SetInt[1] Equal to 3
        • Then - Actions
          • Set VariableSet IDropString[1] = |cff808080Armor|r: +3|n
          • Item - For Item: TheDrop, Add Ability: Armor (+3)
        • Else - Actions
      • -------- Damage --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SetInt[2] Equal to 1
        • Then - Actions
          • Set VariableSet IDropString[2] = |cffff0000Damage|r: +1|n
          • Item - For Item: TheDrop, Add Ability: Damage (+1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SetInt[2] Equal to 2
        • Then - Actions
          • Set VariableSet IDropString[2] = |cffff0000Damage|r: +2|n
          • Item - For Item: TheDrop, Add Ability: Damage (+2)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SetInt[2] Equal to 3
        • Then - Actions
          • Set VariableSet IDropString[2] = |cffff0000Damage|r: +3|n
          • Item - For Item: TheDrop, Add Ability: Damage (+3)
        • Else - Actions
      • -------- Speed --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SetInt[3] Equal to 1
        • Then - Actions
          • Set VariableSet IDropString[3] = |cffffff00Movement|r: +25|n
          • Item - For Item: TheDrop, Add Ability: Speed (+25)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SetInt[3] Equal to 2
        • Then - Actions
          • Set VariableSet IDropString[3] = |cffffff00Movement|r: +45|n
          • Item - For Item: TheDrop, Add Ability: Speed (+45)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SetInt[3] Equal to 3
        • Then - Actions
          • Set VariableSet IDropString[3] = |cffffff00Movement|r: +75|n
          • Item - For Item: TheDrop, Add Ability: Speed (+75)
        • Else - Actions
      • -------- Item Description --------
      • Set VariableSet IDropString[0] = ((Name of TheDrop) + ( - |cffff8080Level|r: + ((String((Hero level of (Killing unit)))) + |n|n)))
      • Set VariableSet IDropDescription = (IDropString[0] + (IDropString[1] + (IDropString[2] + IDropString[3])))
      • Item - Set Name of TheDrop to ((Name of TheDrop) + ( - |cffff8080Level|r: + (String((Hero level of (Killing unit))))))
      • Item - Set Description of TheDrop to IDropDescription
      • Item - Set Extended Tooltip of TheDrop to IDropDescription

in end after ig et it working, it gonna depend on ur level when u kill the enemy, then it will roll between a dif set of items, per level, so higher level u are the more stats it gives.

ATM trying to figure out how tog et it to add the ability and change item name

then i will go make the full system on my map.

and Of Cos ScreenShot, and Test Map.
 

Attachments

  • Test.png
    Test.png
    566.4 KB · Views: 10
  • Test.w3m
    19.7 KB · Views: 3
Last edited:

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
These functions are all pretty buggy and tend to not work properly if at all.


I'd recommend a Custom UI system, Tasyen has you covered for just about anything you need:
Then you can use a stat system like this to easily add stat bonuses to your Items:

With custom UI you gain far more control and can do things well beyond the GUI limitations. You could make an item system straight out of Diablo 2 if you wanted.

Also, and you probably already know this:
  • Wait 0.10 seconds
This Wait will break your trigger if two or more items spawn within ~0.25 seconds of one another. You're also leaking a Point.
 
Last edited:
Level 7
Joined
Nov 6, 2019
Messages
192
i am unsure how a custom ui would change items stats, and the drop system, well to me didnt make sense, but ty for reply

reason for 0.10 wait as if u dont have a wait it doesnt update the strings which is odd
 

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
i am unsure how a custom ui would change items stats, and the drop system, well to me didnt make sense, but ty for reply

reason for 0.10 wait as if u dont have a wait it doesnt update the strings which is odd
The idea is that you can create anything you want with custom UI. You could have a 1000 slot inventory if you really wanted to. It's not a simple task but it's honestly not that difficult either.

You can fix the trigger issues I described by using a local variable and point variable:
  • Actions
    • Custom script: local item udg_TheDrop
    • Set Variable ItemPoint = (Position of (Dying unit))
    • Item - Create Claws at ItemPoint
    • Set VariableSet TheDrop = (Last created item)
    • Custom script: call RemoveLocation(udg_ItemPoint)
This will store TheDrop in a hybrid local/global variable, which means that for the remainder of the trigger it's value cannot get changed from an outside source. The only downside of this method is that you can't reference TheDrop inside of the Conditions block of an If Then Else statement. Luckily, your trigger doesn't do that anywhere so it's fine.

You could also Hide the Item immediately after it's created and then Unhide it once the Wait is over if you don't want the players to see it until it's finished updating.
 
Last edited:
Status
Not open for further replies.
Top