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

Reflect

  • Like
Reactions: Godslayer
I made this spell off of a random want to make a spell. Somewhat of a useful spell i think, but you can judge that yourself when you try it :)

While you have the spell active it will reflect all damage taken. You lose 30 mana everytime it happens. You can change the specificity of the spell to only work for spells, ranged attacks, melee attacks, etc. Enjoy and leave comments! This is my second spell hope I did good :D

Tested- from what i know the spell is leakless and mui.

There is only ONE global variable!

To copy this spell just copy the triggers in the reflect folder. also copy the variable reflect_users. Furthermore, copy the 2 custom abilities and 1 custom unit. Abilities(reflect and reflect-counter). And the unit name escapes me right now but it's under custom units.

Updated:
-fixed the one leak
-fixed the dummy shadow
-cleaned up the code

-fixed the null variables
-cleaned up the code more

Keywords:
reflect, hit back, barrage, reflect, bounce back, on hit
Contents

Reflect (Map)

Reviews
18:24, 20th Sep 2009 The_Reborn_Devil: Triggering: There are no leaks now. I would recommend to replace those BJ's with the native versions though, but that is not necessary. Eye-Candy: The eye-candy is nice and original. Idea: The idea is...

Moderator

M

Moderator

18:24, 20th Sep 2009
The_Reborn_Devil:

Triggering:
There are no leaks now. I would recommend to replace those BJ's with the native versions though, but that is not necessary.
Eye-Candy:
The eye-candy is nice and original.
Idea:
The idea is not that original as I've seen a lot of spells that somehow block or reflect damage.
Tooltip:
The tooltip is good, and gives enough information to the user.
Implementation:
It should be easy to implement, but a little information couldn't do any harm.
Overall:
It got a lot of leaks, and the triggering could certainly get better.
It looks quite nice and I'm sure there are a lot of people who would want this kind of spell in their map.

Spell Approved.
I give this spell the rating useful.

If there's something you feel that's incorrect just PM me.
Remember to have a good reason for why you feel it's incorrect and I might review it again :)
 
Level 9
Joined
Jun 3, 2007
Messages
185
wow on the first look it just looks genius, but i think there might be some issues(or i just didnt get it right)

also the i am very thankfull for that trick to make -unit takes damage- available in GUI. i think that might be very usefull to me in the future

first one is in the trigger Trigg Reflect:
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Reflect_Users is empty) Equal to True
      • Then - Actions
        • Trigger - Add to Reflect <gen> the event (Unit - (Casting unit) Takes damage)
        • Unit Group - Add (Triggering unit) to Reflect_Users
        • Skip remaining actions
      • Else - Actions
    • Unit Group - Pick every unit in Reflect_Users and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Casting unit) Equal to (Picked unit)
          • Then - Actions
            • Skip remaining actions
          • Else - Actions
            • Unit Group - Add (Triggering unit) to Reflect_Users
            • Trigger - Add to Reflect <gen> the event (Unit - (Casting unit) Takes damage)
why u make the trigger skip the remaining actions, instead of just paste the remaining actions into the else-tree of the first if-then-else function?
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Reflect_Users is empty) Equal to True
      • Then - Actions
        • Trigger - Add to Reflect <gen> the event (Unit - (Casting unit) Takes damage)
        • Unit Group - Add (Triggering unit) to Reflect_Users
      • Else - Actions
        • Unit Group - Pick every unit in Reflect_Users and do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Casting unit) Equal to (Picked unit)
              • Then - Actions
                • Skip remaining actions
              • Else - Actions
                • Unit Group - Add (Triggering unit) to Reflect_Users
                • Trigger - Add to Reflect <gen> the event (Unit - (Casting unit) Takes damage)
also one well not leak, but not accaptable one is:

  • Else - Actions
    • Unit Group - Order (Units in (Playable map area)) to Night Elf Demon Hunter - Deactivate Immolation
because that will make all units turn off the reflect ability (and also other units with immolation)

instead u should make
  • Else - Actions
    • Unit - Order (Triggering unit) to Night Elf Demon Hunter - Deactivate Immolation
also i dont get why u create that dummyunit and make it cast that spell. why u just create a special affect at the damage source instead?

also u should remove the waits, because wait is evil (and minimum time for wait is 0.27 seconds acording to some tutorials here). and if you remove the waits and the dummy unit stuff, you could also save the triggering unit as some variable, to take some pressure from the cpu

anyway very good job :D and +rep btw

EDIT: also i dont get why u use -unit stops casting an ability-, wouldnt -starts the effect of an ability- be better?

also u should add that the "reflect" trigger is turned off when no unit has the ability active, because else every time a unit takes dmg it is checked if it has that buff. thats wasted CPU-power
 
Level 5
Joined
Jun 25, 2009
Messages
50
it doesn't check if a unit has the buff. it will only event trigger if it has events hence why it's always on. this is also my second spell :) so expect better things to come :D

@godslayer
thanks for the comments that else deactivate immolation isn't supposed to be used like that probably a minor mistake as i was trying to set up the spell structure
also, the waits are only in there so that the dummy units attack and deal the % damage better on time instead of instant but i thought of another way for the units to deal the damage just now but i probably won't implement it until later.

also, the second skip remaining actions is more so for newer people to understand what's going on.

@jack_sparrow
i took it in replays so i could get the coolest shot that explains the most of what it does. going 1/2 speed is much easier and also teh pause ability :)

to everyone i'll fix it up though expect update in a few hours or less.
 
Level 9
Joined
Jun 3, 2007
Messages
185
it doesn't check if a unit has the buff. it will only event trigger if it has events hence why it's always on.

once the event is addet, it will stay for that trigger. (because it is not beeing removed :D)

so the trigger will always check. so u have to remove that event again(what is not possible i think) or deactivate the trigger

also i still dont get the dummy units, but lets see what ur next update brings.
 
Level 5
Joined
Jun 25, 2009
Messages
50
mmmk updated fixed the few things and the location leak :p tell me what you think!
also, godslayer. i use dummy units so that it visually shows the reflection missile not just damage. that's boring :p
furthermore, it is like that so that it can be mui. so that multiple units could use it. although i recommend not giving this to common scrap units but heroes :p

@nfwar
what's wrong? details plz.
 
Level 9
Joined
Jun 3, 2007
Messages
185
mmmk updated fixed the few things and the location leak :p tell me what you think!
also, godslayer. i use dummy units so that it visually shows the reflection missile not just damage. that's boring :p

@nfwar
what's wrong? details plz.

but u dont need the dummy unit XD
just make create a special affect like:

  • Actions
    • Custom script: local unit dummy
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Mana of (Attacked unit)) Greater than or equal to 30.00
      • Then - Actions
        • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))
        • Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) - 30.00)
        • Special Effect - Create a special effect attached to the chest of (Triggering unit) using Abilities\Spells\Items\SpellShieldAmulet\SpellShieldCaster.mdl
        • Special Effect - Destroy (Last created special effect)
        • Special Effect - Create a special effect attached to the chest of (Damage source) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
        • Special Effect - Destroy (Last created special effect)
        • Unit - Cause (Triggering unit) to damage (Damage source), dealing ((Damage taken) x (((Real((Level of Reflect for (Triggering unit)))) x 0.15) + 0.15)) damage of attack type Spells and damage type Normal
      • Else - Actions
        • Unit Group - Order (Units in (Playable map area)) to Night Elf Demon Hunter - Deactivate Immolation
that is far better than ur dummy unitstuff
 
Level 9
Joined
Jun 3, 2007
Messages
185
mine looks cooler :D
if you want to change stuff like that go ahead this is just a general spell. very simple to figure out what to change. although the on damage event was a bitc- to figure out T.T

its not about the effect, its about the triggering: because mine doesnt take dummy units and waits, wich is far better then creating dummy units and make em cast spells.

btw if you want that missile death animation, just create an dummy with the missile graphics at the position of the damage source, and kill it immediately. that would also be better then the casting dummy.
the casting dummy would only be usefull if you want to see a flying missile
 
Level 14
Joined
Jan 15, 2007
Messages
349
Maybe heard off nulling locals...? =)

Aww.. and btw maybe instead of this:
  • Unit Group - Pick every unit in Reflect_Users and do (Actions)
    • Loops - Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'- Condition
          • (Casting unit) Equal to (==) (Picked unit)
        • 'THEN'-Action
        • 'ELSE'-Action
          • Unit Group - Add (Triggering unit) to Reflect_Users
          • Trigger - Add to Reflect <gen> the event (Unit - (Casting unit) takes damage)
use this...

  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • 'IF'-Bedingungen
      • ((Triggering unit) is in Reflect_Users) Equal to (==) False
    • 'THEN'-Aktionen
      • Unit Group - Add (Triggering unit) to Reflect_Users
      • Trigger - Add to Reflect <gen> the event (Unit - (Casting unit) takes damage)
    • 'ELSE'-Aktionen
 
Last edited:
Level 17
Joined
Mar 17, 2009
Messages
1,349
What hanky is saying, at the end the trigger, null your local variables.
ie: set <somelocal> = null

Do that for all locals except reals, integers, and string :)


Now my advice:

Use:
  • Unit - A unit Starts the effect of an ability (Bad)
Instead of:
  • Unit - A unit Begins casting an ability

Also, don't use waits. Because: Avoiding the usage of Wait (Essentials Tutorial)


Also, don't these two conditions do the same thing?
  • Trigg Reflect
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Reflect
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Reflect_Users is empty) Equal to True
        • Then - Actions
          • Trigger - Add to Reflect <gen> the event (Unit - (Casting unit) Takes damage)
          • Unit Group - Add (Triggering unit) to Reflect_Users
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in Reflect_Users) Equal to True
        • Then - Actions
        • Else - Actions
          • Unit Group - Add (Triggering unit) to Reflect_Users
          • Trigger - Add to Reflect <gen> the event (Unit - (Casting unit) Takes damage)
Well I see coding to be very poor and needing some fixing. Good luck with that.
 
Level 5
Joined
Jun 25, 2009
Messages
50
originally, the coding wasn't like that if you look 2 posts before yours you'll see that. i changed it and just didn't think to delete that part. also, from your tutorial's description the reason we cannot use wait's is because it makes it not mui but my spell uses locals. hence why i do not need to not use wait. as for that first part i will remove it though.
 
Level 25
Joined
Feb 2, 2006
Messages
1,685
I think this is a pretty awesome spell but some suggestions:

  • Improve the demo map a bit. Give the Jedi a passive icon ability which describes the spell like here in the description of Hive. Otherwise, I have to read it again here. There is some stuff with a defend order and on hero revival but I can't do anything in the demo map with Defend or reviving my hero. Reveal the whole map from start and preplace everything you can do with the system.
  • Why are there so many GUI trigger variables? Are they from the dependency libraries? Why aren't they placed in vJass in a globals block?
  • Maybe you can list all dependency systems with links in the description on Hive to make it clear.
  • Is there a GUI version and a JASS version or is the pure JASS stuff just some code required for the system?
  • You can create a constant instead of this one global GUI variable for the Defend ability code.
  • Some blocking animation from the Jedi would be awesome. Maybe you need a modified model which can do a block while walking and standing and play the animation whenever the Jedi reflects a shot.
 
Top