• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Bounty System

Level 6
Joined
Mar 17, 2008
Messages
150
Hive.png


BOUNTY SYSTEM

What is a Bounty System?
A bounty system occurs when a unit dies and it drops an item. The item is specifically given. Percentage of course.

How do I do this?
If you read this tutorial by me. You'll know all about it

What do I need to do first?
Follow this steps:


VARIABLES
Create an Item Variable Array - Specify what they will drop.
Create an Integer Array - Specify the creep level to determine item.


Easy Triggers:
  • InitializeItemBountySystem
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Item[1] = Mask of Death
      • Set Item[2] = Kelen's Dagger of Escape
      • Set Item[3] = Crown of Kings +5
      • -------- What the items are. --------
      • Set Creep_Level[1] = 2
      • Set Creep_Level[2] = 3
      • Set Creep_Level[3] = 6
      • -------- Creep level --------
Pretty easy right?

That was easy, what will I do next?

Just listen, be patient

THE ITEM DROP

The triggers here are simple. If a unit dies, it will check what level the creep is and it drops the item given at the variable. We too make it drop in a certain rate.

For this part, I used a level 2, 3, and 6 creep.

For level 2, the drop rate is 60%
For level 3, the drop rate is 30%
For level 6, the drop rate is 15%


  • If - Conditions
    • (Level of (Dying unit)) Equal to Creep_Level[1]
    • (Random integer number between 1 and 100) Less than or equal to 60

The dying unit is specifies as the variable given earlier on...
That's the percentage drop rate. Find that in Conditions, Integer Comparison, Math - Random Number.


  • Then - Actions
    • Item - Create Item[1] at (Position of (Dying unit))
That's the item type that is given...

Do that to all the levels of the creeps you want..


Final Look:

  • Bounty System
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of (Dying unit)) Equal to Creep_Level[1]
          • (Random integer number between 1 and 100) Less than or equal to 60
        • Then - Actions
          • Item - Create Item[1] at (Position of (Dying unit))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 100) Less than or equal to 30
              • (Level of (Dying unit)) Equal to Creep_Level[2]
            • Then - Actions
              • Item - Create Item[2] at (Position of (Dying unit))
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random integer number between 1 and 100) Less than or equal to 15
                  • (Level of (Dying unit)) Equal to Creep_Level[3]
                • Then - Actions
                  • Item - Create Item[3] at (Position of (Dying unit))
                • Else - Actions
                  • Do nothing
Done! Hope you learned something!
 
Last edited:
Level 40
Joined
Dec 14, 2005
Messages
10,532
This is rather too restrictive - it only allows for one drop type per creep type. The system should at least support a table per creep type (level).

I suggest you look into Itempools, by the way. They're rather useful for this sort of thing (though they are Jass stuff, a few custom script actions can't hurt).
 
Level 4
Joined
Sep 27, 2007
Messages
85
whatr if you were to set multiple items to one EXAMPLE Set item 1 mask of death......... set item 1 robe of the magi........... set item 1 gauntlets of strength would that give it a chance to drop multiple items at the same percentage?
 
Top