Spellpack D.V.D Passive Spells

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
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
 

Jagan

New Member
Reaction score
30
Screenshots? And your code is not efficient. You're setting ifs for every level of the ability instead of setting them accordingly in one.
 

Kazuga

Let the game begin...
Reaction score
110
The spells are bad coded and extremely simple. You should just use a loop so it works for all levels, and demanding credits for a spell is a bit rude.

How you can improve the spells:
Add special effects, it gives more eye candy.
Make it more unique, these spells can be found in other maps as well, try to add something more to the spells. For instance, add extra attack/move speed for x seconds to the passive mirror image.
 

D.V.D

Make a wish
Reaction score
73
First of all, im not demanding credit, second of all, I'll make them better and I'll make more during the weekend when I have time.
 

Sevion

The DIY Ninja
Reaction score
413
"please give me credit if you use these in your map!"

Yes you are.

You should try learning JASS and optimizing it.

The spells seem a little bland IMHO.
 

Jagan

New Member
Reaction score
30
Oh and I forgot to mention the Positions of Attacking Units in your Passive Explosion trigger leaks. Clean 'em up.
 

Flare

Stops copies me!
Reaction score
662
You could do alot of improvement for the If's (taking Mirror Image as the example) - instead of 3 if's, you could do
Code:
Random integer between 1 and 100 is less than or equal to R2I (7.5 + 2.5x I2R (Level of Ability for Unit))

(R2I = Real 2 Integer, I2R = Integer 2 Real)
That way, you'd have 10/12.5/15% chance, but when the R2I conversion is done, it'll end up as 10/12/15, which is what you have there

There's no need to null globals

And the leaks, they must be sorted

"please give me credit if you use these in your map!"

Yes you are.
Sounds more like he is just requesting credits (nothing very demanding about the way he said it IMO)
 

D.V.D

Make a wish
Reaction score
73
Ok, I will make the spells better. its just a start. Im going to keep improving. Also, I can't attach another file by editing the post. it doesn't let me. Suggestions on what to do will help. And like I said before, I'm going to make the abilities better once the weekend comes because of school.
 

Sevion

The DIY Ninja
Reaction score
413
Does rep really matter that much? If it does to you, all you have to do is be helpful and follow the rules and rep will come with time.
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
I used to have really low rep, even at 1k posts. But after helping I'm up to 203. All you have to do is help. :D
 

D.V.D

Make a wish
Reaction score
73
I do and it pisses me off when romek minuses my rep for replying to coments on my post 3 times and he thinks there bumps.
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
All right, all right... We're getting off track here. Can we go back to the topic this thread was made for. :D

Your skills as far as functioning are fine, but provide leakless examples...
 

BRUTAL

I'm working
Reaction score
118
try fixing up the tooltips
why do you think theres different tooltips for each level in object editor
dont put level 1-w.e level 2 w.e all the same tooltips.
 

Charapanga

New Member
Reaction score
46
Hey!

I like the spells and if you let me i will use them in my upcoming map, oh and A Missle art for the Passive explosion would be great! You get +rep my friend :)

Chara
 

D.V.D

Make a wish
Reaction score
73
Thanks for the rep. I don`t mind if you use the spells and Im going to make them better. The mirror image will cast the spells that the hero casts and the explosion will have a missle art and made bigger.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top