How to make a skill dealing damage base on hero's damage

Yamuraiha

Member
Reaction score
1
I wanna make many skills dealing damage base on hero's damage. Example: Throw a bolt at enemy dealing damage equal to 150% hero damage, or Mana Drain - Drain enemy's mana, x mana point drain per sec with x = hero's intelligence.
 

vypur85

Hibernate
Reaction score
803
You can't detect unit raw damage value using triggers. There is no possible way of doing what you intend to do.

As for Intelligence, Strength and Agility, you can reference these values in 'Hero - Unit Attribute' in the trigger.

Example:
Code:
Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Real((Strength of (Triggering unit) (Exclude bonuses)))) damage of attack type Spells and damage type Normal
Since damage is usually a Real variable, you need to convert it into Integer variable.
1. Conversion - Convert Integer into Variable
2. Select: Hero - Hero Attribute
3. There is also 'Arithmetic'. This is do whatever mathematical equations you need with your skill.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Not easily possible. You can not get the attack power of a hero, but there are a few ways around it:
1). You can try to calculate the heroes attack yourself, keep track of the heroes basic attack, attributes and items.
2). Use game-cache to make a perfect copy of the hero, let the copy attack a dummy unit and get the damage.
3). Every time the hero attacks save the last damage the hero has dealt.

The game cache trick might not work anymore, I am not sure, I havent used it recently.
 

Yamuraiha

Member
Reaction score
1
@@ thanks both of you but I think I'll come up another idea >.< I've just begun using WE for a week :confused: I'll study more bout those complicated things when my skill get better. Tks anyway :D
 

Yamuraiha

Member
Reaction score
1
Not easily possible. You can not get the attack power of a hero, but there are a few ways around it:
1). You can try to calculate the heroes attack yourself, keep track of the heroes basic attack, attributes and items.
2). Use game-cache to make a perfect copy of the hero, let the copy attack a dummy unit and get the damage.
3). Every time the hero attacks save the last damage the hero has dealt.

The game cache trick might not work anymore, I am not sure, I havent used it recently.
ah, Could you tell me more about the third way please ? I would appreciate it a lot.
 

vypur85

Hibernate
Reaction score
803
That would be the damage detection method as posted in Post#5. Then again, it's not entirely possible if you plan to do a target ability. It's more suitable for a physical damage spell.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
The third way is easy to exploit for the players if they know how it works. Basically you use a damage detection system like the one Kaerf linked.
Then you have a trigger which detects any damage taken by a unit, and you also need a way to find out if it was physical damage or not. That one is a bit tricky and the best way of doing it veries from map to map.
Then you can start recording how much damage a hero does with every attack. You should then probably keep track of a number of attacks the hero did, like the last 10 for example. And when you want his actual attack power you take those last 10 attacks and calculate the average.
Or something like that.

Its a bit tricky either way.
 

afisakov

You can change this now in User CP.
Reaction score
37
Then you can start recording how much damage a hero does with every attack. You should then probably keep track of a number of attacks the hero did, like the last 10 for example. And when you want his actual attack power you take those last 10 attacks and calculate the average.
Or something like that.
Would this give an accurate value for atk power? or would the average be reduced by armor an influenced by crit? If so it may not be the most reliable way to do ability damage.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Its impossible to get the attack damage accurately. If you use the game cache method you also get effects from armor and critical but buffs will be removed.
If you calculate the damage then you can get it fairly accurate, but its a lot of work and makes the developement process much slower and harder. Everytime you implement a new item or buff you have to keep in mind how it will change the attack damage.
 

vypur85

Hibernate
Reaction score
803
Its impossible to get the attack damage accurately. If you use the game cache method you also get effects from armor and critical but buffs will be removed.
If you calculate the damage then you can get it fairly accurate, but its a lot of work and makes the developement process much slower and harder. Everytime you implement a new item or buff you have to keep in mind how it will change the attack damage.

Just to reiterate Acc. It's just impossible. Don't waste time trying to get unit's damage value.

Furthermore, it's even harder for a person who has just started triggering. Go for something simpler. You'll lead a happier life that way.
 

Yamuraiha

Member
Reaction score
1
Can I ask a question? Is that true we can't get unit's damage value due to "Damage number of dice" & "Damage side per dice"? If that's true then if I put 1 on each of them, which mean hero's damage now is 50-50 for example. Can I get unit's damage value now ? I just ask for knowledge :D cause I gived up and come up with another idea :)
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Can I ask a question? Is that true we can't get unit's damage value due to "Damage number of dice" & "Damage side per dice"? If that's true then if I put 1 on each of them, which mean hero's damage now is 50-50 for example. Can I get unit's damage value now ? I just ask for knowledge :D cause I gived up and come up with another idea :)

Base damage 49 and both dice fields at 1 would make it a flat 50, yes.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
What is with bonuses from items?
What is with bonuses from buffs? (Keep in mind, that buffs dont show a level)
What is with bonuses from upgrades?

Its a lot of things to keep in mind, but you can calculate it if you feel like doing that.
 

vypur85

Hibernate
Reaction score
803
> Is that true we can't get unit's damage value due to....
If I understand you correctly. No, it's not because of those reasons. It's the limitation of WE. Just as simple as that. :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top