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

[Altered Melee] Forest Nothing (trees spawn creeps and gold at random, no goldmines)

Status
Not open for further replies.
Level 4
Joined
Nov 19, 2015
Messages
27
Had an idea for an AoE style forest nothing map, would anyone know how to set up the triggers to do the following:

Each time a player cuts down a tree theres a chance of either "creeps spawning" "Gold chest dropping" or nothing

As the players cut down more of the forest higher level creeps with more powerful drops start spawning

only worker units harvesting trees count towards the individual players percentage that increases spawn rates
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,580
There's no way to detect which unit destroyed a tree destructible but you can detect when a tree dies and spawn something in response.
  • Setup Tree Dies
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set VariableSet Tree_Trigger = Tree Dies <gen>
      • Destructible - Pick every destructible in (Playable map area) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Picked destructible)) Equal to Summer Tree Wall
            • Then - Actions
              • Custom script: call TriggerRegisterDeathEvent(udg_Tree_Trigger, GetEnumDestructable())
            • Else - Actions
  • Tree Dies
    • Events
    • Conditions
    • Actions
      • Set VariableSet Tree_Roll = (Random integer number between 1 and 100)
      • Set VariableSet Tree_Point = (Position of (Dying destructible))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Tree_Roll Less than or equal to 10
        • Then - Actions
          • Item - Create Gold Coins at Tree_Point
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Tree_Roll Less than or equal to 55
            • Then - Actions
              • Unit - Create 1 Dark Troll for Neutral Hostile at Tree_Point facing Default building facing degrees
            • Else - Actions
              • -------- Nothing happens --------
      • Custom script: call RemoveLocation(udg_Tree_Point)
The issue is that you can't determine who destroyed the tree, so you'll have to find some way of doing that before the rest of the systems could be made.
 

Attachments

  • Tree Example.w3m
    18.9 KB · Views: 4
Last edited:
Status
Not open for further replies.
Top