• 🏆 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!

Dig System

Dig System

Created by x-omg-x


Description
How to use:

Move your unit to a position with dirt.
Use the 'dig' abillity.
If you are lucky enought to find something, you will get an item.


About this system:

This is just an easy system i made for a request.
It do only contain 2 triggers and is very configureable and easy to read.
There are commented on most of the actions to make it easy to understand for everybody.
This system is MUI, leakless, laggless and bugless.

Copyright:

This system is made by me and all credits goes to X-OMG-X.
Do not distribute this system to any other sites.
Give credits if used.

  • DigInit
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- --------
      • -------- X-OMG-X's --------
      • -------- --------
      • -------- Dig System --------
      • -------- --------
      • -------- --------
      • -------- Here you can set the items that have a chance to be digged up --------
      • -------- If you want more than 10 items, just increase the array --------
      • -------- --------
      • Set Dig_Item[1] = Boots of Quel'Thalas +6
      • Set Dig_Item[2] = Orb of Frost
      • Set Dig_Item[3] = Ring of Protection +5
      • Set Dig_Item[4] = Ankh of Reincarnation
      • Set Dig_Item[5] = Claws of Attack +12
      • Set Dig_Item[6] = Scourge Bone Chimes
      • Set Dig_Item[7] = Scroll of Speed
      • Set Dig_Item[8] = Wand of Lightning Shield
      • Set Dig_Item[9] = Cloak of Flames
      • Set Dig_Item[10] = Periapt of Vitality
      • -------- --------
      • -------- This is the chance to get one of the items above --------
      • -------- --------
      • Set Dig_Chance = 30.00
      • -------- --------
      • -------- If the unit have to be on a specific tile to dig, set this to true --------
      • -------- --------
      • Set Dig_UseSpecificTile = True
      • -------- --------
      • -------- If Dig_UseSpecificTile is set to true, you can set the tile here --------
      • -------- --------
      • Set Dig_Tile = Ashenvale - Rough Dirt
  • DigLoop
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dig
    • Actions
      • -------- --------
      • -------- EDITING ANYTHING BELOW THIS LINE CAN CAUSE THE SYSTEM TO NOT WORK --------
      • -------- --------
      • Set Dig_Unit = (Triggering unit)
      • Set Dig_Position = (Position of Dig_Unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Dig_UseSpecificTile Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at Dig_Position) Equal to Dig_Tile
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random real number between 1.00 and 100.00) Less than or equal to Dig_Chance
                • Then - Actions
                  • Item - Create Dig_Item[(Random integer number between 1 and 10)] at Dig_Position
                  • Game - Display to (All players matching ((Owner of Dig_Unit) Equal to (Matching player))) for 5.00 seconds the text: (You found: + (Name of (Last created item)))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Size of inventory for Dig_Unit) Greater than 0
                    • Then - Actions
                      • Hero - Give (Last created item) to Dig_Unit
                    • Else - Actions
                • Else - Actions
                  • Game - Display to (All players matching ((Owner of Dig_Unit) Equal to (Matching player))) for 5.00 seconds the text: You didnt find anyt...
            • Else - Actions
              • Game - Display to (All players matching ((Owner of Dig_Unit) Equal to (Matching player))) for 5.00 seconds the text: Only useable on Dir...
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random real number between 1.00 and 100.00) Less than or equal to Dig_Chance
            • Then - Actions
              • Item - Create Dig_Item[(Random integer number between 1 and 10)] at Dig_Position
              • Game - Display to (All players matching ((Owner of Dig_Unit) Equal to (Matching player))) for 5.00 seconds the text: (You found: + (Name of (Last created item)))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Size of inventory for Dig_Unit) Greater than 0
                • Then - Actions
                  • Hero - Give (Last created item) to Dig_Unit
                • Else - Actions
            • Else - Actions
              • Game - Display to (All players matching ((Owner of Dig_Unit) Equal to (Matching player))) for 5.00 seconds the text: You didnt find anyt...
      • Custom script: call RemoveLocation(udg_Dig_Position)
      • -------- --------
      • -------- EDITING ANYTHING ABOVE THIS LINE CAN CAUSE THE SYSTEM TO NOT WORK --------
      • -------- --------

Now i dont have anything else to say than, enjoy!

Keywords:
system, dig, hole, dirt, rought, luck, lucky, unit, abillity
Contents

Dig [System] (Map)

Reviews
13:15, 23rd Dec 2009 The_Reborn_Devil: The triggers look good and there are no leaks. I do have some things I must point out: (Random real number between 1.00 and 100.00) Should be between 0 and 100, not a big deal though :D And you should make...

Moderator

M

Moderator

13:15, 23rd Dec 2009
The_Reborn_Devil:
The triggers look good and there are no leaks.
I do have some things I must point out:
  • (Random real number between 1.00 and 100.00)
Should be between 0 and 100, not a big deal though :D
And you should make it possible to add/remove items you can get.
One solution is just adding another variable which you can f.ex. call "Max_Dig_Items" and replace all
  • (Random integer number between 1 and 10)
with
  • (Random integer number between 1 and Max_Dig_Items)
Status: Approved
Rating: Useful
 
Level 8
Joined
Oct 28, 2007
Messages
435
Add a: Dig_ArraySize variable. Currently if you want more or less than 10 items you'll have to edit the random integer max yourself, which an't a problem, but I'm sure some "less experianced people" :p will forget to change it.
 
Wow thanks for the fast feedback and approval. I will change the mentoded things. Also, no i didnt copy the triggers from the map you linked. I didnt even know that map. If you check out some of my other resources, then you'll see that im not that kind of guys. Im making things by myself. Anyways, thanks for the nice comments. I'll be back with an update in a few minutes.
 
Level 8
Joined
Mar 18, 2005
Messages
168
took a break from mapping for a while, thought any set variable leaked I suppose... But if it doesnt leak then their is no point in setting it to a variable no?

Also, a good way to improve (or change) this system could be making it use random item of category/level... ex/ a random level 1 charged item or a random level 2 permanent item etc. based on chance
 
Level 11
Joined
Apr 29, 2007
Messages
826
took a break from mapping for a while, thought any set variable leaked I suppose... But if it doesnt leak then their is no point in setting it to a variable no?

Also, a good way to improve (or change) this system could be making it use random item of category/level... ex/ a random level 1 charged item or a random level 2 permanent item etc. based on chance
It's faster to use a variable instead of Triggering Unit.
 
Top