• Check out the results of the Techtree Contest #19!
  • 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 void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Random Respawn

Status
Not open for further replies.
Level 8
Joined
Feb 20, 2020
Messages
222
Hello guys, i need a simple system that respawn a list of random heroes with different chances for each of them to spawn in many small regions (like monster master rpg respawn but with random monster or like a "pokemon respawn".

The idea is that:

set Forest[1] = region1
set Forest[2] = region2
set Forest[3] = region3
set onwer of monster = player X;
set monster [1] = paladin
set monster [2] = archmage
set monster [3] = mountain king
set monster [4] = blood mage
set monster [5] = blademaster

set chance of appearing
- 1~20 = paladin
- 21~40 = mountain king
- 41~70 = archmage
- 71~95 = bloodmage
- 96~100 = blademaster

for integer A [1~3]
generate a random number between 1~100
create the monster [random number] in region [integer A];
generate a random number between 1~100
create the monster [random number] in region [integer A];
generate a random number between 1~100
create the monster [random number] in region [integer A];

And when they die, i remove the dead hero from the game and create a new random hero for the onwer of the diyng unit after a time of 60 seconds in the region that the dying unit was.
 
Where are you blocked at ? There is no question in your post so it's hard to help you unless you are expecting someone to come with all the triggers you need to achieve this.
 
The random summoning is working, but the revive not.
Here is my trigger, its just reviving the last monster that died...
i need it to revive each of the monsters that died, so a counter for each monster is needed...

  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet ForestRegions[1] = Flor1 <gen>
      • Set VariableSet ForestRegions[2] = Flor2 <gen>
      • Set VariableSet ForestRegions[3] = Flor3 <gen>
      • Set VariableSet ForestRegions[4] = Flor4 <gen>
      • Set VariableSet ForestRegions[5] = Flor5 <gen>
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Set VariableSet RandomForestChance = (Random integer number between 1 and 100)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RandomForestChance Less than or equal to 20
            • Then - Actions
              • Unit - Create 1 Paladin for Player 11 (Dark Green) at (Center of ForestRegions[(Integer A)]) facing Default building facing degrees
              • Unit Group - Add (Last created unit) to ForestGroup
              • Set VariableSet ForestMonsterList[(Integer A)] = (Last created unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • RandomForestChance Less than or equal to 40
                • Then - Actions
                  • Unit - Create 1 Archmage for Player 11 (Dark Green) at (Center of ForestRegions[(Integer A)]) facing Default building facing degrees
                  • Unit Group - Add (Last created unit) to ForestGroup
                  • Set VariableSet ForestMonsterList[(Integer A)] = (Last created unit)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • RandomForestChance Less than or equal to 70
                    • Then - Actions
                      • Unit - Create 1 Mountain King for Player 11 (Dark Green) at (Center of ForestRegions[(Integer A)]) facing Default building facing degrees
                      • Unit Group - Add (Last created unit) to ForestGroup
                      • Set VariableSet ForestMonsterList[(Integer A)] = (Last created unit)
                    • Else - Actions
                      • Unit - Create 1 Blood Mage for Player 11 (Dark Green) at (Center of ForestRegions[(Integer A)]) facing Default building facing degrees
                      • Unit Group - Add (Last created unit) to ForestGroup
                      • Set VariableSet ForestMonsterList[(Integer A)] = (Last created unit)
  • Respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is in ForestGroup.) Equal to True
      • ((Dying unit) is A Hero) Equal to True
      • (Owner of (Dying unit)) Equal to Player 11 (Dark Green)
    • Actions
      • Set VariableSet MonsterDead = (Dying unit)
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MonsterDead Equal to ForestMonsterList[(Integer A)]
            • Then - Actions
              • Unit Group - Remove MonsterDead from ForestGroup.
              • Set VariableSet ForestPositionRespawn = ForestRegions[(Integer A)]
              • Set VariableSet MonsterNumber = (Integer A)
              • Countdown Timer - Start ForestMonsterTimer as a One-shot timer that will expire in 30.00 seconds
            • Else - Actions

  • Respawn New
    • Events
      • Time - ForestMonsterTimer expires
    • Conditions
    • Actions
      • Set VariableSet RandomForestChance = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RandomForestChance Less than or equal to 20
        • Then - Actions
          • Unit - Create 1 Paladin for Player 11 (Dark Green) at (Center of ForestPositionRespawn) facing Default building facing degrees
          • Unit Group - Add (Last created unit) to ForestGroup
          • Set VariableSet ForestMonsterList[MonsterNumber] = (Last created unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RandomForestChance Less than or equal to 40
            • Then - Actions
              • Unit - Create 1 Archmage for Player 11 (Dark Green) at (Center of ForestPositionRespawn) facing Default building facing degrees
              • Unit Group - Add (Last created unit) to ForestGroup
              • Set VariableSet ForestMonsterList[MonsterNumber] = (Last created unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • RandomForestChance Less than or equal to 70
                • Then - Actions
                  • Unit - Create 1 Mountain King for Player 11 (Dark Green) at (Center of ForestPositionRespawn) facing Default building facing degrees
                  • Unit Group - Add (Last created unit) to ForestGroup
                  • Set VariableSet ForestMonsterList[MonsterNumber] = (Last created unit)
                • Else - Actions
                  • Unit - Create 1 Blood Mage for Player 11 (Dark Green) at (Center of ForestPositionRespawn) facing Default building facing degrees
                  • Unit Group - Add (Last created unit) to ForestGroup
                  • Set VariableSet ForestMonsterList[MonsterNumber] = (Last created unit)
 
Last edited:
Status
Not open for further replies.
Back
Top