- 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"
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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"
|
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
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)
