• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Make runes spawn in region in middle of map.

Status
Not open for further replies.
Level 15
Joined
Jul 19, 2007
Messages
857
I have made 5 different runes in my map and I want them to start spawning in middle of map after 5 minutes of gameplay. I also want only 1 rune to be spawned in the region at a time like in Dota. If a Hero uses the rune then I want it to wait 1 minute and then create a new rune at a random spot in the region. I have made 1 of the runes to be more rare then the rest of them so it should have less chance to be spawned than the rest 4 runes. I really have no idéa how to make this so I hope someone can help...
 

Uncle

Warcraft Moderator
Level 74
Joined
Aug 10, 2018
Messages
7,958
It's not too complicated once you get the hang of Arrays, For Loops, and Timers:
  • Setup First Rune
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- CUSTOMIZE: --------
      • -------- ----------------------------------------------------------------------------------------------- --------
      • Set VariableSet Rune_Total_Types = 5
      • -------- --------
      • Set VariableSet Rune_Types[1] = Rune of Greater Healing
      • Set VariableSet Rune_Types[2] = Rune of Greater Mana
      • Set VariableSet Rune_Types[3] = Rune of Dispel Magic
      • Set VariableSet Rune_Types[4] = Rune of Spirit Link
      • Set VariableSet Rune_Types[5] = Rune of the Watcher
      • -------- --------
      • -------- Make sure that the chances add up to 100: --------
      • Set VariableSet Rune_Chance[1] = 25
      • Set VariableSet Rune_Chance[2] = 25
      • Set VariableSet Rune_Chance[3] = 25
      • Set VariableSet Rune_Chance[4] = 20
      • Set VariableSet Rune_Chance[5] = 5
      • -------- --------
      • Set VariableSet Rune_Point = (Center of (Playable map area))
      • -------- --------
      • -------- Create the first rune: --------
      • Countdown Timer - Start Rune_Timer as a One-shot timer that will expire in 300.00 seconds
      • -------- ----------------------------------------------------------------------------------------------- --------
      • -------- --------
      • -------- Do NOT change: --------
      • For each (Integer Rune_Index) from 2 to Rune_Total_Types, do (Actions)
        • Loop - Actions
          • Set VariableSet Rune_Chance[Rune_Index] = (Rune_Chance[Rune_Index] + Rune_Chance[(Rune_Index - 1)])
I made the first 3 runes have a 25% chance to spawn, the 4th rune has a 20% chance to spawn, and the 5th rune has a 5% chance to spawn.
  • Setup Next Rune
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Powerup
    • Actions
      • For each (Integer Rune_Index) from 1 to Rune_Total_Types, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item being manipulated)) Equal to Rune_Types[Rune_Index]
            • Then - Actions
              • -------- Create another rune: --------
              • Countdown Timer - Start Rune_Timer as a One-shot timer that will expire in 60.00 seconds
              • Custom script: exitwhen true
            • Else - Actions
  • Spawn Rune
    • Events
      • Time - Rune_Timer expires
    • Conditions
    • Actions
      • Set VariableSet Rune_Roll = (Random integer number between 1 and 100)
      • -------- --------
      • For each (Integer Rune_Index) from 1 to Rune_Total_Types, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Rune_Roll Greater than Rune_Chance[(Rune_Index - 1)]
              • Rune_Roll Less than or equal to Rune_Chance[Rune_Index]
            • Then - Actions
              • Item - Create Rune_Types[Rune_Index] at Rune_Point
              • Custom script: exitwhen true
            • Else - Actions
You can change Rune_Point to be a Random point in your region:
  • Item - Create Rune_Types[Rune_Index] at (Random point in Region...)
 

Attachments

  • Rune System 1.w3m
    18.6 KB · Views: 5
Last edited:
Level 15
Joined
Jul 19, 2007
Messages
857
It's not too complicated once you get the hang of Arrays, For Loops, and Timers:
  • Setup First Rune
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- CUSTOMIZE: --------
      • -------- ----------------------------------------------------------------------------------------------- --------
      • Set VariableSet Rune_Total_Types = 5
      • -------- --------
      • Set VariableSet Rune_Types[1] = Rune of Greater Healing
      • Set VariableSet Rune_Types[2] = Rune of Greater Mana
      • Set VariableSet Rune_Types[3] = Rune of Dispel Magic
      • Set VariableSet Rune_Types[4] = Rune of Spirit Link
      • Set VariableSet Rune_Types[5] = Rune of the Watcher
      • -------- --------
      • -------- Make sure that the chances add up to 100: --------
      • Set VariableSet Rune_Chance[1] = 25
      • Set VariableSet Rune_Chance[2] = 25
      • Set VariableSet Rune_Chance[3] = 25
      • Set VariableSet Rune_Chance[4] = 20
      • Set VariableSet Rune_Chance[5] = 5
      • -------- --------
      • Set VariableSet Rune_Point = (Center of (Playable map area))
      • -------- --------
      • -------- Create the first rune: --------
      • Countdown Timer - Start Rune_Timer as a One-shot timer that will expire in 300.00 seconds
      • -------- ----------------------------------------------------------------------------------------------- --------
      • -------- --------
      • -------- Do NOT change: --------
      • For each (Integer Rune_Index) from 2 to Rune_Total_Types, do (Actions)
        • Loop - Actions
          • Set VariableSet Rune_Chance[Rune_Index] = (Rune_Chance[Rune_Index] + Rune_Chance[(Rune_Index - 1)])
I made the first 3 runes have a 25% chance to spawn, the 4th rune has a 20% chance to spawn, and the 5th rune has a 5% chance to spawn.
  • Setup Next Rune
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Powerup
    • Actions
      • For each (Integer Rune_Index) from 1 to Rune_Total_Types, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item being manipulated)) Equal to Rune_Types[Rune_Index]
            • Then - Actions
              • -------- Create another rune: --------
              • Countdown Timer - Start Rune_Timer as a One-shot timer that will expire in 60.00 seconds
              • Custom script: exitwhen true
            • Else - Actions
  • Spawn Rune
    • Events
      • Time - Rune_Timer expires
    • Conditions
    • Actions
      • Set VariableSet Rune_Roll = (Random integer number between 1 and 100)
      • -------- --------
      • For each (Integer Rune_Index) from 1 to Rune_Total_Types, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Rune_Roll Greater than Rune_Chance[(Rune_Index - 1)]
              • Rune_Roll Less than or equal to Rune_Chance[Rune_Index]
            • Then - Actions
              • Item - Create Rune_Types[Rune_Index] at Rune_Point
              • Custom script: exitwhen true
            • Else - Actions
You can change Rune_Point to be a Random point in your region:
  • Item - Create Rune_Types[Rune_Index] at (Random point in Region...)
Oh thank you so much! I thought it was more complicated than that.
 
Status
Not open for further replies.
Top