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

Raises Skeletons

Status
Not open for further replies.
Level 4
Joined
Aug 28, 2015
Messages
75
I wonder if there is any way to chance the spell "Raise the dead"? Eg: "Raise a random skeleton (archer, warrior or wizard)... Has a 20% chance to raise a skeleton lieutenant and a 5% raise a skeletal hero"
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
I wonder if there is any way to chance the spell "Raise the dead"? Eg: "Raise a random skeleton (archer, warrior or wizard)... Has a 20% chance to raise a skeleton lieutenant and a 5% raise a skeletal hero"

It's possible. I just did this from my phone, so it may or may not work exactly the way I have the triggers setup. It should give you a really good idea of how to do it though. Keep in mind that 5 or 80 doesn't mean the actual percent. I check if RandomNumber is less than or equal to 5, meaning that only 5 of the numbers will summon the Skeleton Lt (5/100 = 5%). I also check if RandomNumber is greater than or equal to 80, meaning that only 20 of the numbers will summon the Skeleton Hero (20/100 (1/5)= 20%). You have to seperate them because if I had done Less than or equal to 5 AND less than or equal to 20, then theres a good chance that it will summon both units.
  • -------- Skeleton Lt. Chance --------
  • Set Chance[1] = 5
  • -------- Skeleton Hero Chance --------
  • Set Chance[2] = 80
  • Set RandomNumber = (Random integer number between 1 and 100)
  • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is dead) Equal to True)) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RandomNumber Less than or equal to Chance[1]
        • Then - Actions
          • ~create skeleton lt.~
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RandomNumber Greater than or equal to Chance[2]
            • Then - Actions
              • ~create skeleton hero~
 
Level 4
Joined
Aug 28, 2015
Messages
75
This trigger only works with 2 different types of skeletons ... And if I want to create more? Because I thought that is likely to raise up to 8 different types of skeletons ... Besides, what basis would the ability to create this ability? Since I tested with "Raise Dead" and always creates more of a skeleton, and I just want one
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
This trigger only works with 2 different types of skeletons ... And if I want to create more? Because I thought that is likely to raise up to 8 different types of skeletons ...

Well you only provided two, so I gave you two. You need to be more specific with your requests. Creating more wouldn't that much of a problem, just tell me the % chance you want them at and I can provide you an example.

Besides, what basis would the ability to create this ability? Since I tested with "Raise Dead" and always creates more of a skeleton, and I just want one

Channel with Instant (No Target) set as the spell type will work just fine.
 
Level 4
Joined
Aug 28, 2015
Messages
75
Sorry ... are 3 spells in total ... and looks like this: "Raise Skeleton: Raise a Skeleton (archer, mage or warrior) [equal chance for 3]" "Raise Greater Skeleton : 50% chance of Raise a Skeleton (archer, wizard or warrior), 45% chance of raise a Greater Skeleton (archer, mage or warrior), 5% chance of raise a Skeletal Hero " and " Rise Ultimate Skeleton: 45% chance of raise a Skeleton (archer, mage or warrior ), 30% chance of raise a Greater Skeleton (archer, mage or warrior), 20% chance of raise a Skeletal Hero, 5% chance of raise a Lieutenant Skeleton "...
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
Did this. Worked for me, though I will admit it was fairly hard to make the randomness work properly..
  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set units[1] = Footman
      • Set units[2] = Mortar Team
      • Set units[3] = Priest
      • -------- They have to be in order from lowest to highest or it will bug. --------
      • Set unitChance[1] = 25.00
      • Set unitChance[2] = 50.00
      • -------- The last one also needs to be set to 100, this means that this unit will spawn if all the others do not. --------
      • Set unitChance[3] = 100.00
      • Set unitCount = 3
  • revive
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Clap
    • Actions
      • Set caster = (Triggering unit)
      • Set loc = (Position of caster)
      • Set corpseGroup = (Units within 500.00 of loc matching ((((Matching unit) belongs to an ally of (Owner of caster)) Equal to True) and (((Matching unit) is dead) Equal to True)))
      • Set corpseCounter = (Number of units in corpseGroup)
      • Set rng = (Random integer number between 3 and 5)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • rng Greater than or equal to corpseCounter
        • Then - Actions
          • Unit Group - Pick every unit in corpseGroup and do (Actions)
            • Loop - Actions
              • Set temp_unit = (Picked unit)
              • Set temp_loc = (Position of temp_unit)
              • Special Effect - Create a special effect at temp_loc using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Set rng2 = (Random integer number between 1 and 100)
              • For each (Integer B) from 1 to unitCount, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • rng2 Less than or equal to (Integer(unitChance[(Integer B)]))
                    • Then - Actions
                      • Unit - Create 1 units[(Integer B)] for (Owner of temp_unit) at temp_loc facing Default building facing degrees
                      • Custom script: set bj_forLoopBIndex = bj_forLoopBIndexEnd
                      • Custom script: call RemoveLocation(udg_temp_loc)
                    • Else - Actions
        • Else - Actions
          • For each (Integer A) from 1 to rng, do (Actions)
            • Loop - Actions
              • Set temp_unit = (Random unit from corpseGroup)
              • Set temp_loc = (Position of temp_unit)
              • Special Effect - Create a special effect at temp_loc using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit Group - Remove temp_unit from corpseGroup
              • Set rng2 = (Random integer number between 1 and 100)
              • For each (Integer B) from 1 to unitCount, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • rng2 Less than or equal to (Integer(unitChance[(Integer B)]))
                    • Then - Actions
                      • Unit - Create 1 units[(Integer B)] for (Owner of temp_unit) at temp_loc facing Default building facing degrees
                      • Custom script: set bj_forLoopBIndex = bj_forLoopBIndexEnd
                      • Custom script: call RemoveLocation(udg_temp_loc)
                    • Else - Actions
      • Custom script: call DestroyGroup(udg_corpseGroup)
      • Custom script: call RemoveLocation(udg_loc)
 
Status
Not open for further replies.
Top