Spell % damage

xericho

New Member
Reaction score
0
I'm trying to make a spell based on stormbolt that deals a percentage of the targets max life, currently, im not that good at the arithmethic part of triggering, though i know this is what im suppose to do, i just cant find the options for percentage minus.

guns
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Spell
Actions
Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing (((Max life of (Target unit of ability being cast)) - ??? for (Triggering unit)))))) damage of attack type Chaos and damage type Normal
 

Tom Jones

N/A
Reaction score
437
First of all change your event to Unit - A Unit Starts The Effect Of An Ability.
Secondly just multiply the units maximum life with the percentage you want, etc.:
(((Max life of (Target unit of ability being cast)) *0.1

That would give you 10% of a units maximum hp.
 

Sooda

Diversity enchants
Reaction score
318
Code:
Custom Storm Bolt
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Storm Bolt
    Actions
        -------- 1.00 equals 100% and 0.01 equals 1% --------
        Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing ((Max life of (Target unit of ability being cast)) x 0.10) damage of attack type Spells and damage type Normal
Though target will be damaged before Strom Bolt missile hits it. It will get more complicated if you want to deal damage when unit is hit by missile.
It' s under 'function - arithmetic' if you wonder how that '* 0.10' got there.
 

Baltazhar

Active Member
Reaction score
55
It's simple to fix the "dmg before stormbolt hits" thing. Just find out how long time it approximately it takes it to reach the target, then insert a "Wait" action before it runs the damage trigger.
 

darkRae

Ueki Fan (Ueki is watching you)
Reaction score
173
Which should be (Distance/Missile Speed)
But if the target is moving, this can get messy.
 

Baltazhar

Active Member
Reaction score
55
I was just thinking to make a "Wait - .5 seconds" just to make it an 'nearly perfect, and very simple solution' :)
Didn't wanna involve fancy arithmatics based to distance or speed :D
 

darkRae

Ueki Fan (Ueki is watching you)
Reaction score
173
0.5 second is fixed, thus not accurate and reliable.

Imagine if you're casting that Storm Bolt from close distance, then 0.5 second Wait could be too late.
Or if you're casting that Storm Bolt from long range, then 0.5 second Wait could be too early.
 

xericho

New Member
Reaction score
0
stupid me... i should have listened to my math teacher.
yeah, i just added a wait 1 second so it happens when the bolt hits. was just a little tweeking with the projectile speed.
thanks guys!
 
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