• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Spell] A mana-to-life drain

Status
Not open for further replies.
Level 4
Joined
Apr 23, 2011
Messages
88
Energy Feast:

So, I want to make an ability (GUI) where, when the hero insta-casts the ability:

1. All enemy units within 700 range of the hero lose 25 mana (25 when at ability level is 1; more at levels 2 and 3)

AND

2. At the same time, the hero gains life equal to (all of the mana lost this way / [divided by] 3) (and divided by less as the hero increases level of the ability).


It'd be even better if both the subtraction of mana from enemy units and the addition of life to the hero happened over a few seconds (a drain).

Anyone know how to make this? I'm getting nowhere. Thx
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Would this do?

(I just noticed I didn't set a maximum range though, I can still add it if you want).

EnergyHPGain is a real percentage, 0.80 means that 80% of the drained mana is converted to HP.
I think the rest speaks for itself.

Edit:
- Set timer from every 0.04 to every 0.50 seconds.
- Commented the spell values.
- Removed the lightning, added special effects.
- Made it Mana Drain per second instead of Mana Drain for the entire spell duration.
 

Attachments

  • Energy Feast.w3x
    20.7 KB · Views: 48
Last edited:
Level 4
Joined
Apr 23, 2011
Messages
88
Looks great! Thanks much :)

A few quick changes, if you would (I'd do it but I just can't understand the hashtables coding yet):

1. Can you make the mana stolen per cast be a fixed number per second. Like, no matter the target unit, if they are in range for the full... 3 seconds... of the spell, they will lose 25 mana (and 45 at level 2, and 65 at level 3)?

2. Can you make the total mana stolen this way convert to hero's health at a 20% rate at level 1, 40% at lvl 2, and 60% at lvl 3?

3. Can you remove the lighting and, instead, attach a special effect buff to the overheads of the targeted units every .4 seconds, or whatever the interval is that the spell repeats itself at?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
1) Done. (It was already a fixed number before, but then for the entire duration, not per second).
Now it steals 25 - 45 - 65 mana per second.

2) Done. (This system was already implemented, just had to change the variable).

3) Done. Well, it ran every 0.04 seconds, but I changed that to 0.50 ^^ (2 reasons: 1) showing an effect every 0.04 seconds is horrible and 2) less CPU-demanding now).

I've also added a few comments, you should check them out (the middle trigger in the Spell-category).
You can easily change the values there so you can edit the spell to your needs.

(The spell can be found in my previous post).
 
Level 4
Joined
Apr 23, 2011
Messages
88
Awesome! I see one potential problem, though:

The units picked is set on the initial cast but it should be set every iteration of the drain, right?
 
Status
Not open for further replies.
Top