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

Mana Lose "Event"

Status
Not open for further replies.
Level 3
Joined
May 10, 2014
Messages
41
Hello!

Spell, that I trying to make should work like this:
1. Hero cast spell on unit;
2. Unit takes damage and specific buff (may be by a spell book, may be by poison - no matter);
3. During the next 30 seconds, everytime target unit will lose mana (use spells, or somebody drain his mana), he will take damage equal to lost mana.

The 1st problem is BUFF...
I plan to use it for a condition (if unit has specific buff)... is any other simple way to identify unit?

The 2nd problem is MANA...
I plan to subtract real variable from health... but how can I catch each mana lost event? And how can I get size of mana lost?

Spell can be used on several units at one time, so storing every unit is no good, i think. Also, I trying not to use Periodic Events and Timers...

Is it possible to realize this? Using GUI and Custom Script?
And without buging the map...

Anyway, Thanks for any help!
 
Level 17
Joined
Mar 21, 2011
Messages
1,597
i will do this spell for you, give me some time

EDIT: here it is. remember, it uses unit indexer, so credits also go to bribe

if you want to add an effect whenever he takes damage, add those 2 lines under the damage taken

  • Unit - Cause ML_Caster[ML_Index] to damage ML_Target, dealing (ML_Mana[ML_Index] - TempReal) damage of attack type Spell and damage type Normal
  • Special Effect - Create a special effect attached to the origin of ML_Target using YourEffect
  • Special Effect - Destroy (Last created special effect)
 

Attachments

  • Mana Leak.w3x
    22.4 KB · Views: 74
Last edited:
Level 13
Joined
Mar 24, 2013
Messages
1,105
Haven't looked at the above post's map, but you can just index this spell.

The buff could just be an aura in a hidden spell book.

Then just check every .03 or .05 whatever

And if the mana is < than it was x seconds ago deal the difference in damage
 
Status
Not open for further replies.
Top