D.V.D
Make a wish
- Reaction score
- 73
Hey guys, i made some passive spells for fun. First one is from my tutorial Passive Mirror Image. Second one is passive explosion. Codes are below and please give me credit if you use these in your map! Enjoy !
Passive Mirror Image
Passive Explosion
Passive Mirror Image
Code:
Passive Mirror Image
Events
Unit - A unit Is attacked
Conditions
Actions
Set Caster = (Triggering unit)
Set Point[0] = (Position of Caster)
Set Player = (Owner of Caster)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Passive Mirror Image for Caster) Equal to 1
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Less than or equal to 10
Then - Actions
Unit - Create 1 Dummy for Player at Point[0] facing Point[0]
Set Dummy = (Last created unit)
Unit - Add Inventory (Hero) to Dummy
Hero - Create Wand of Illusion and give it to Dummy
Set Item = (Last created item)
Hero - Order Dummy to use Item on Caster
Unit - Add a 1.00 second Generic expiration timer to Dummy
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Passive Mirror Image for Caster) Equal to 2
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Less than or equal to 12
Then - Actions
Unit - Create 1 Dummy for Player at Point[0] facing Point[0]
Set Dummy = (Last created unit)
Unit - Add Inventory (Hero) to Dummy
Hero - Create Wand of Illusion and give it to Dummy
Set Item = (Last created item)
Hero - Order Dummy to use Item on Caster
Unit - Add a 1.00 second Generic expiration timer to Dummy
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Passive Mirror Image for Caster) Equal to 3
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Less than or equal to 15
Then - Actions
Unit - Create 1 Dummy for Player at Point[0] facing Point[0]
Set Dummy = (Last created unit)
Unit - Add Inventory (Hero) to Dummy
Hero - Create Wand of Illusion and give it to Dummy
Set Item = (Last created item)
Hero - Order Dummy to use Item on Caster
Unit - Add a 1.00 second Generic expiration timer to Dummy
Else - Actions
Else - Actions
Custom script: call RemoveLocation (udg_Point[0])
Custom script: set udg_Caster = null
Custom script: set udg_Dummy = null
Custom script: set udg_Target = null
Passive Explosion
Code:
Passive Explosion
Events
Unit - A unit Is attacked
Conditions
Actions
Set Caster = (Triggering unit)
Set Target = (Attacking unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Passive Explosion for Caster) Equal to 1
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Less than or equal to 12
Then - Actions
Special Effect - Create a special effect at (Position of (Attacking unit)) using Objects\Spawnmodels\Human\FragmentationShards\FragBoomSpawn.mdl
Set SpecialEffect = (Last created special effect)
Unit - Cause Caster to damage Target, dealing 50.00 damage of attack type Spells and damage type Normal
Special Effect - Destroy SpecialEffect
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Passive Explosion for Caster) Equal to 2
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Less than or equal to 15
Then - Actions
Special Effect - Create a special effect at (Position of (Attacking unit)) using Objects\Spawnmodels\Human\FragmentationShards\FragBoomSpawn.mdl
Set SpecialEffect = (Last created special effect)
Unit - Cause Caster to damage Target, dealing 60.00 damage of attack type Spells and damage type Normal
Special Effect - Destroy SpecialEffect
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Passive Explosion for (Triggering unit)) Equal to 3
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Less than or equal to 20
Then - Actions
Special Effect - Create a special effect at (Position of (Attacking unit)) using Objects\Spawnmodels\Human\FragmentationShards\FragBoomSpawn.mdl
Set SpecialEffect = (Last created special effect)
Unit - Cause Caster to damage Target, dealing 80.00 damage of attack type Spells and damage type Normal
Special Effect - Destroy SpecialEffect
Else - Actions
Else - Actions
Custom script: set udg_Caster = null
Custom script: set udg_Target = null