1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  3. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  4. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Reflect

Submitted by deth_lord
This bundle is marked as approved. It works and satisfies the submission rules.
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
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...
  1. 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 :)
     
  2. Jack_Sparrow93

    Jack_Sparrow93

    Joined:
    May 9, 2008
    Messages:
    1,429
    Resources:
    6
    Icons:
    5
    Maps:
    1
    Resources:
    6
    Why did u take the screenshot in a replay? Just courious... ;)
     
  3. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,174
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    It leaks locations.

    • Unit - Create 1 ReflectDummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing (Position of (Damage source))
     
  4. Godslayer

    Godslayer

    Joined:
    Jun 3, 2007
    Messages:
    169
    Resources:
    9
    Icons:
    8
    Skins:
    1
    Resources:
    9
    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
     
  5. deth_lord

    deth_lord

    Joined:
    Jun 25, 2009
    Messages:
    47
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    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.
     
  6. NFWar

    NFWar

    Joined:
    Jul 27, 2008
    Messages:
    1,314
    Resources:
    228
    Models:
    1
    Icons:
    216
    Packs:
    1
    Skins:
    2
    Spells:
    6
    Tutorials:
    2
    Resources:
    228
    Triggering is poor. Also you use w8 actions. this is not good at all.
    It is very strange: you use jass functions and dont know how to clear point leaks.
    I dont likeit at all.
     
  7. Godslayer

    Godslayer

    Joined:
    Jun 3, 2007
    Messages:
    169
    Resources:
    9
    Icons:
    8
    Skins:
    1
    Resources:
    9
    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.
     
  8. deth_lord

    deth_lord

    Joined:
    Jun 25, 2009
    Messages:
    47
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    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.
     
  9. Godslayer

    Godslayer

    Joined:
    Jun 3, 2007
    Messages:
    169
    Resources:
    9
    Icons:
    8
    Skins:
    1
    Resources:
    9
    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
     
  10. deth_lord

    deth_lord

    Joined:
    Jun 25, 2009
    Messages:
    47
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    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
     
  11. Godslayer

    Godslayer

    Joined:
    Jun 3, 2007
    Messages:
    169
    Resources:
    9
    Icons:
    8
    Skins:
    1
    Resources:
    9
    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
     
  12. Deuterium

    Deuterium

    Joined:
    Mar 17, 2009
    Messages:
    1,301
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Well, idea seems cool :p I'll check it tomoro if I get the time :)
     
  13. D4RK_G4ND4LF

    D4RK_G4ND4LF

    Joined:
    Feb 4, 2009
    Messages:
    1,196
    Resources:
    20
    Models:
    3
    Spells:
    15
    Tutorials:
    2
    Resources:
    20
    the dummy leaves a shadow behind
    [​IMG]
    the idea is basic but nice and there are several things which could be improved
    gl improving it

    edit:
    yay!!! 256 posts!! xD
     
    Last edited: Sep 19, 2009
  14. Hanky

    Hanky

    Joined:
    Jan 15, 2007
    Messages:
    353
    Resources:
    4
    Maps:
    1
    Spells:
    3
    Resources:
    4
    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: Sep 19, 2009
  15. deth_lord

    deth_lord

    Joined:
    Jun 25, 2009
    Messages:
    47
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    k updated dummy no longer has shadow and the if is changed. didn't know there was one or i'd have used it :p i look but there's no unit-group comparison for some reason T.T
    also @Hanky english please :p
     
  16. Hanky

    Hanky

    Joined:
    Jan 15, 2007
    Messages:
    353
    Resources:
    4
    Maps:
    1
    Spells:
    3
    Resources:
    4
    I guess I wrote english?... well after you used those locals null them otherwise they'll cause leak...

    But the second point I told you isn't hard to understand, is it?
     
  17. Deuterium

    Deuterium

    Joined:
    Mar 17, 2009
    Messages:
    1,301
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    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.
     
  18. deth_lord

    deth_lord

    Joined:
    Jun 25, 2009
    Messages:
    47
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    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.
     
  19. Deuterium

    Deuterium

    Joined:
    Mar 17, 2009
    Messages:
    1,301
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Yes I understand the thing on MUI, but both Wait's are under 0.27 seconds, thus you can't use them :s I explained that in the tutorial too :p