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

The Backfire Spell Request

Status
Not open for further replies.
:D Greetings to all of you Spell Makers! :D I have a request for a spell. Here's how it goes:

Backfire - Curses a target enemy unit so that whenever it attacks it will take back a percent of the damage it dealt.
Lasts 15 seconds.
Level 1 - 50% of the damage backfired.
Level 2 - 100% of the damage backfired.
Level 3 - 150% of the damage backfired.

:) I'll credit anyone who makes this spell. Make it in JASS if possible, please! :wink:
 
Level 3
Joined
Dec 31, 2003
Messages
42
I like the vampiric potion idea, then you could just modify it so it's an item which is used when picked up and give it to the unit Backfire is cast on :)

A problem could be that (other) vampiric auras/potions might override it...
 
Level 7
Joined
May 16, 2004
Messages
355
Generic "Unit Takes Damage' Event is as follows:

Code:
Generic Damage Calculator Secondary
    Events
        Map initialization
    Conditions
    Actions
        Custom script:   set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                -------- Deadly Aim --------
                Trigger - Add to Deadly Aim <gen> the event (Unit - (Picked unit) Takes damage)


Code:
Generic Damage Calculator
    Events
        Unit - A unit enters (Playable map area)
    Conditions
    Actions
        -------- Deadly Aim --------
        Trigger - Add to Deadly Aim <gen> the event (Unit - (Entering unit) Takes damage)

Try it out, it will result in what is basically a generic "Unit Takes Damage" Event.

Note that it will also work with any of the preplaced specific events. However it may not be that efficient, I'm not too sure but I get the feeling that constantly adding events to a trigger will cause leaks or some other lag causing reactions.
 
Level 3
Joined
Jan 31, 2007
Messages
34
Well there is an easyer way (for me)

Take a curse with effects which you can easily nullify the start triggering. I haven't tested it but it should be something like this:

Events
Unit - A unit is attacked (Unit - Generic Unit Event)
Conditions
((Attacking unit) has buff [buff]) Equal to True (Boolean Comparison) (the part in () is Unit - Unit has specific buff and (Attacking unit) is Event Response - Attacking Unit)
Actions
Set life of (Attacking unit) to (Life of (Attacking unit)) - (Damage taken)) (This is Unit - Set Life (To Value)) (the (Attacking unit)s type can be seen above) (Use Arithmetic for the "-" and set the values to (Unit property) - (Event Response - Damage Taken))

Like I said I haven't tested it and it's as detailed as I could make it so here is a clean version:

Events
Unit - A unit is attacked
Conditions
((Attacking unit) has buff [buff]) Equal to True
Actions
Set life of (Attacking unit) to (Life of (Attacking unit)) - (Damage taken))

Short, simple and probably working :)
 
Status
Not open for further replies.
Top