• 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.

mana steal

Status
Not open for further replies.
Level 9
Joined
Aug 21, 2008
Messages
533
I m making a hero wich need to have mana steal which should be similar to vampirism aura(no orb effect,only meele,but dont have to have range)
I made up one but it wasnt good and cause it have 2 waits and doesnt really work while the the attackes unit is healed or attacked by a another unit shortly after the attack of the hero. pls help:spell_breaker:
 
Level 4
Joined
Feb 2, 2009
Messages
71
Events
Unit is attacked

Conditions
Level of ability <mana steal ability> of 'Attacking Unit' greater then 0
Mana of 'Attacked Unit' is greater then (x*level of <mana steal ability> of 'Attacking Unit').
Mana of 'Attacking Unit' is less then Max Mana of 'Attacking Unit'

Actions
Steal the mana...

It's ugly but I think you understand.

Note: (x * level of <mana steal ability> of 'Attacking Unit') This is a simple formula so the manasteal is increasing by level.

Will work this out properly in some hours... don't have time for this right now. Hope it helps.
 
Level 9
Joined
Aug 21, 2008
Messages
533
@Livirus-
The contitions are much easier and weren't the problem- the actions and the event is the problem

@all here is the trigger just found out how this works

  • Untitled Trigger 001
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Arcane warrior
    • Actions
      • Set real[1] = (Life of (Attacked unit))
      • Wait 0.40 game-time seconds
  • -------- This is the main problem. if the unit is attacked or healed during the wait the trigger gives the wrog amount --------
    • Set real[2] = (Life of (Attacked unit))
    • Set real[3] = (real[1] - real[2])
    • -------- The 3rd array isnt needed but maybe i can use it at other ability i m working for --------
    • Unit - Set mana of (Attacking unit) to ((Mana of (Attacking unit)) + ((real[3] / 100.00) x ((Real((Level of Manasteal for (Attacking unit))))
  • x 8.00)))
  • -------- This means it gives 8%per lvl. if the spell is lvl3 it gives 24%. --------
The mana steal should be equal to the mana steal from D2 LOD. It gives a percentage of the made damage. Cause it isnt a orb effect and should like work like a aura it stacks with orbs and a additional vampirism aura if aviable.
 
Level 4
Joined
Feb 2, 2009
Messages
71
Oh, I think I see what you want to do. You would like to convert a percentage of the damage taken into mana. Not stealing his mana, but converting his life into mana.

I belive I've seen a JASS tutorial here on hiveWorkshop which shows how to detect the exact damage taken.
But it was too advanced for me.

Maybe you could calculate his average DMG manually (probably a pain in the ass to do)...
BaseDmg + x*primaryAttribute...

Dmg-bonuses and Critical Strike's will not be taken in account though.
 
Level 9
Joined
Aug 21, 2008
Messages
533
This dont work cause if the enemy has armor or evasion it will give the false amount. Oo and dont forget about the the armor types.
Lol you remind me that i have to make somkething that the trigger dont fires if the attacked unit is mechanical/building or whatever shouldnt give mana leech.
But i will test something different.The ability gives mana and life leech and so i just make the trigger add the same amount of life.

Lol you helped also with making wrong posts :thumbs_up:
 
Status
Not open for further replies.
Top