• 🏆 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 Strike??

Status
Not open for further replies.
Level 9
Joined
May 27, 2006
Messages
498
I wanted to make a Mana Strike ability, which hits the target. The damage would be equal to actual mana of the caster, and after casting the mana of the caster wil be equal to 0. It looks easy, but I tried to make it, and it doesn`t work :/
  • Mana Strike
  • Events:
    • Unit - A unit is casting spell
  • Conditions:
    • Ability being cast = Mana Strike
  • Actions:
    • Special Effect - Create a special effect at position of (target of ability being cast) (special effect here)
    • Wait 1 second
    • Special Effect - Destroy last created special effect
    • Set mana_v to (mana of casting unit)
    • Unit - Set life of (target of ability being cast) to (life of target of ability being cast - (mana_v x level of Mana Strike for (casting unit)))
    • Unit - Set mana of (casting unit) to 0
    • Set mana_v to 0
Now, when I was writing, i changed this trigger and made it shorter (about 2 times shorter ^^). But I want to ask - will this spell work?
 
Last edited:
Level 8
Joined
Sep 13, 2006
Messages
431
I wanted to make a Mana Strike ability, which hits the target. The damage would be equal to actual mana of the caster, and after casting the mana of the caster wil be equal to 0. It looks easy, but I tried to make it, and it doesn`t work :/

Now, when I was writing, i changed this trigger and made it shorter (about 2 times shorter ^^). But I want to ask - will this spell work?


Well, no, it won't but it can be made to do so very easily.

I would use "a unit starts the effect of an ability" first of all. Secondly, the value for casting unit is discarded during your wait time, so you will have to use mana of triggering unit (which isn't discarded until the end of the trigger). Also, the target unit value is discarded during wait time, so you will need to use a variable to store the unit value before the wait. That should do it for ya...
 
Level 8
Joined
Sep 13, 2006
Messages
431
Unit - Set life of (target of ability being cast) to (life of target of ability being cast - (mana_v x level of Mana Strike for (casting unit)))

He does not have to store the unit, just use Triggering Unit everywhere instead of Casting Unit.
Variables would make it non-MUI...

Uhhh..... no, he does have to store the unit. He is referencing two units, not just one...
 
Level 11
Joined
Jul 12, 2005
Messages
764
Well, start using 'Damage target' instead of 'Set life' if you're going to create spells. If you kill a unit by setting its life below 0, noone will be the Killing Unit, noone will get bounty and such. But if you damage the unit and it dies, the unit that dealt the damage will be the killer.
 
Status
Not open for further replies.
Top