• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Damage Re-Infliction Spell

Status
Not open for further replies.
Level 2
Joined
Jan 2, 2008
Messages
10
I'm having a little trouble programming this spell.

I'm trying to make a custom spell that inflicts a certain amount of damage that the caster has taken in the past 10 seconds. I'm basing it off Channel, since I can use that to make custom skills, right? Of course, triggers have to accompany it.

Can anyone help me with this? I think I have an idea of what the variables should be. So basically:

  • Level 1 - Deals 50% of the damage the caster has taken over the past 10 seconds.
  • Level 2 - Deals 75% of the damage the caster has taken over the past 10 seconds.
  • Level 3 - Deals 100% of the damage the caster has taken over the past 10 seconds.

The damage should be Hero.

It's for my AoS map. :) I'll give credit for those who help me make the spell possible! >:D
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
If you want this MUI it has to use JASS, if you want it MPI (one unit per player can do at the same time), use arrays for each hero you want and check times.

In anyway you do it I think its gonna be pretty hard calculations.
Can't think about it at the moment coss my bugger friends lol :xxd:
 
Level 2
Joined
Aug 11, 2007
Messages
12
Wait...do you want it so that if you cast the spell, all damage from the last 10 seconds happens? Or when you cast it, wait 10 seconds, then deal the damage that happened during those 10 seconds.
 
Level 2
Joined
Jan 2, 2008
Messages
10
If you want this MUI it has to use JASS, if you want it MPI (one unit per player can do at the same time), use arrays for each hero you want and check times.

In anyway you do it I think its gonna be pretty hard calculations.
Can't think about it at the moment coss my bugger friends lol :xxd:
Arrays you say? Should I also use a countdown timer?

Wait...do you want it so that if you cast the spell, all damage from the last 10 seconds happens? Or when you cast it, wait 10 seconds, then deal the damage that happened during those 10 seconds.
That when they cast the spell, all damage from the last 10 damage happens. It's for a tanker hero, as you can see.
 
Level 2
Joined
Aug 11, 2007
Messages
12
Eh....I see. Not quite sure how it would go. I could figure it out though, if I had some time. Something along the lines of....

Unit attacked

= to w/e your hero is

add something to an integer variable...maybe do something with 2...perhaps arrays, for MPI
wait 10 seconds
do something complicated that would work, so the variables arent overwritten or something

Like I said, I'm not sure what would be needed. =P If you still need help when I get back from school tomorrow, I'll take a look at it. ^_^
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Ok at the end its very simple lol.

  • Untitled Trigger 004
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set Units[1] = someUnit
      • Set Units[2] = someOtherUnit
      • Trigger - Add to Untitled Trigger 003 <gen> the event (Unit - Units[1] Takes damage)
      • Trigger - Add to Untitled Trigger 003 <gen> the event (Unit - Units[2] Takes damage)
  • Untitled Trigger 003
    • Events
    • Conditions
    • Actions
      • Set Real_Damage[(Player number of (Owner of (Triggering unit)))] = (Real_Damage[(Player number of (Owner of (Triggering unit)))] + (Damage taken))
      • Wait 10.00 seconds
      • Set Real_Damage[(Player number of (Owner of (Triggering unit)))] = (Real_Damage[(Player number of (Owner of (Triggering unit)))] - (Damage taken))

When you want the spell to damage, just damage the target with Real_Damage (in your case Real_Damage/2 , Real_Damage*0.75, Real_Damage).
 
Level 2
Joined
Jan 2, 2008
Messages
10
Sweet! Thanks much. I was playing around with triggers in the meanwhile. Of course, my triggers didn't work, and it's a shocking surprise they weren't close to yours, except for variables.
 
Status
Not open for further replies.
Top