Ability that deals damage based on hero's current mana, but with a max

BoterhaM

New Member
Reaction score
2
Hi guys

Code:
thunderbolt
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Thunderbolt 
    Actions
        Set TriggerUnit = (Triggering unit)
        Set TargetUnit = (Target unit of ability being cast)
        Sound - Play LightningShieldTarget <gen> at 100.00% volume, located at (Position of (Casting unit)) with Z offset 0.00
        Wait 0.20 seconds
        [I]Unit - Cause TriggerUnit to damage TargetUnit, dealing ((Mana of TriggerUnit) - (Max(800.00, (Min(150.00, 150.00))))) damage of attack type Spells and damage type Normal
        Unit - Set mana of TriggerUnit to ((Mana of TriggerUnit) - (Max(800.00, (Min(150.00, 150.00)))))[/I]
        Special Effect - Create a special effect attached to the origin of TargetUnit using war3mapImported\LightStrikeArray.mdx
        Sound - Play LightningBolt <gen> at 100.00% volume, located at (Position of TargetUnit) with Z offset 0.00
        Wait 0.80 seconds
        Special Effect - Destroy (Last created special effect)

>i was fooling around with the italic lines, i cant figure out how to do this:

It needs to deal damage based on the hero’s current mana, but with a max.
25% mana reserved (max damage: 75% of hero’s current mana)

Like: Hero has 1000 mana, uses ability on level 1: 750 damage, 750 mana used.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
how about this:
Code:
Unit - Cause TriggerUnit to damage TargetUnit, dealing ((Mana of TriggerUnit) x 0.75) damage of attack type Spells and damage type Normal
if you want 75% just multiply it with 0.75
 

The Undaddy

Creating with the power of rage
Reaction score
55
I'll freehand this since I'm lazy :D

Deal damage = Min(0.75*Hero's max mana,Heros' current mana)
Remove the same as the damage dealt.
So if the hero has more than 75% mana it'll deal 75%,and if it has less it'll deal less.

EDIT:I seem to have misunderstood you o_O.Go with Accname's way.
 

BoterhaM

New Member
Reaction score
2
how about this:
Code:
Unit - Cause TriggerUnit to damage TargetUnit, dealing ((Mana of TriggerUnit) x 0.75) damage of attack type Spells and damage type Normal
if you want 75% just multiply it with 0.75

i see, but that wont extract 75% of the mana used.

would this work?:

Set mana of TriggerUnit to ((Mana of TriggerUnit) x 0.25 ) ?

thanks anyways :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top