• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Mana drain on attack? :)

Status
Not open for further replies.
Level 6
Joined
Jan 6, 2005
Messages
136
Hey, i tried making this myself, and i just dont see why it dosen't work, to me it seems kinda simple.. yet.. dosen't work .. well, i wan't an abillity that gives the hero 2%,4%,6%,8% and10% of it's damage it deals to enemies to its own mana, so that if it deals 100 damage, it will at level 5 give the hero 10 mana, now.. here is what i did

Event:
Any unit is attacked



Conditions:
Level of (mana burn spell dummy) is greater or equal to 1

Type of attacking unit Equal to (Hero type)



Actions:
Set Variable (lifeoftarget) to life of attaced unit

wait 0.5 seconds
set attacking units mana to (lifeoftarget) - (life of attacked unit*(level of (spell dummy for (hero))*0.02)


Set Variable (lifeoftarget) to life of attaced unit
 
Perhaps, but as the trigger is triggred by "attacked" it is therefore the order of attack that triggers the trigger and again therefore will the trigger then execute before the target has lost hp and again then not work, see? :/-.- any other way to do this you think ?
 
  • ManaDrainOnAttack
    • Events:
      • Unit - A unit deals damage
    • Conditions:
      • (Level of (ManaDrainAbility) for (Triggering unit) Greater than or equal to 1)
    • Actions:
      • Unit - Add ((Damage dealt) x ((Level of (ManaDrainAbility) for (Triggering unit)) x 0.02 ))) to (Triggering unit)'s mana
ManaDrainAbility should be a passive dummy ability that does really nothing (can be a 0% chance critical strike)
Watch for brackets in the multiplying, the order they're placed is important.
 
Last edited:
...

Firstly, never seen "unit deals damage" event and i doubt it exists.
And, yes i realize this is a very dodgy way to achieve what i want, but i don't see any other way, oh and the fact that my earlier post didn't make much sense is prolly because i was very tired, sorry about that.

Now if anyone have an answer/solution, i'll still love to hear it, since the Hero using this is somewhat depending on this spell :)
 
I dont have w3 right now on my computer, and i dont remember all the events Blizzard made in WE =/

Anyway, i'd love to help you, but you've read what Poot wrote - it can be easly made, but in JASS, at which i'm lame... Try waiting for somebody who knows it or post at JASS section :P
 
Instead of A unit takes damage, use A unit is attacked.

  • Untitled Trigger 001
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Drainperattack for (Attacking unit)) Greater than 0
    • Actions
      • Unit - Create 1 Dummy for (Owner of (Attacking unit)) at (Position of (Attacking unit)) facing Default building facing degrees
      • Unit - Set level of Feedback for (Last created unit) to (Level of Drainperattack for (Attacking unit))
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Attack (Last created unit)
The dummy should have a 1 damage attack enabled, with an attack cooldown of at most 10 seconds, at least 5 seconds, to ensure it doesn't attack twice. (overkill, I know...) it should have the feedback ability.

Or why bother triggering, if you could just add the feedback ability to the main attacking unit?

BTW... I know, A unit is attacked isn't so efficient, since it triggers before the damage is dealt, but what the heck. Unless you do it in JASS, then you're forced to use it.
 
Last edited:
What I would to is have a trigger which fired whenever that unit attacks, then create a local trigger or add an event to a GUI trigger that already has conditions/actions saying that the attacked unit takes damage. Then, get the damage dealt and multiply it by .10 or whatever and add it to the unit's mana. I'd post the JASS for it, but I'm not sure if it'd help any.
 
Status
Not open for further replies.
Back
Top