How to make an ability do damage plus XXX?

Gracus

New Member
Reaction score
0
I'm trying to make an ability for a hero that will do say, 100 base damage + 15% of the heroes health.

Also, is it possible for units to 'resist' part of an ability? (A unit casts an ability that does 500 damage - the unit hit by this ability resists some of the damage only doing 200 damage.

Thank you :)
 

Gracus

New Member
Reaction score
0
Hmm, I'll try and explain it better, (a bit tired today I apologize :()

The hero I have will have 1000 health. He has an ability which will do 100 damage plus 15% of his max health in damage, so it would be 100 + 150 in this case. I would like this ability to scale as well. So lets say the champion gained an extra 1000 health. then it would be 100 damage plus 15% (300).
 

Accname

2D-Graphics enthusiast
Reaction score
1,465
is your ability an instant target ability? if yes this will be pretty easy.
does it fire a projectile? in this case it will become a little more complicated but still not that hard.

in the first case you need to get some instant unit target ability. channel could be used here since its an ability which does absolutely nothing and has only been created in the first place as a base for triggered abilities.
next you need some trigger like this:
Trigger:
  • Events
    • Unit starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to MyCustomAbility
    • Actions
      • Unit - Make (Casting Unit) deal (100 + (Max hitpoints of (casting unit))) damage of type Chaos damage type Unknown to (Target Unit of ability being cast)


something like this, its handwritten, but it will do.

in the case you are using a projectile for it you would need to get a unit target dummy ability which does nothing, channel could be used again.
then you create a dummy unit and give it a projectile ability, like stormbolt for example if you dont mind the stun, and finally a trigger like this:
Trigger:
  • Events
    • Unit starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to MyDummyAbility
    • Actions
      • set Temp_Point = (Position of (Triggering Unit))
      • Unit - Create a Dummy for (Owner of (Triggering Unit)) at Temp_Point facing 270°
      • unit - order (last created unit) to Stormbolt (Target unit of ability being cast)
      • custom script: call RemoveLocation (udg_Temp_Point)


now you need a damage detection system, i suggest using Weeps GDD (you can find it in the turtorials and resources sub-forum) and a trigger like this:
Trigger:
  • Events
    • GDD_Timer becomes Equal to 0.00
    • Conditions
      • (Unit type of GDD_Damage_Souce) Equal to MyDummyUnit
    • Actions
      • Unit - Make GDD_Damage_Souce deal (100 + (Max hitpoints of GDD_Damage_Souce)) damage of type Chaos damage type Unknown to (Triggering Unit)

or something like this, its handwritten again, the actual function names might differ.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top