• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

ability scaling

Status
Not open for further replies.
Level 10
Joined
Feb 27, 2016
Messages
617
i wonder how to let abilities scale like in Gaias Retaliation ORPG i know there have being threads made of this topic but i just want to ask how to make for example if an ability cleave deals the amount of damage you have X4 is that possible with triggers?
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
Yes it is possible. Take the "Channel" ability and change it so it would work like how you want your cleave to work (in regards of targeting, mana cost, cooldown, etc.). The ability will do nothing of course, you will have to trigger the damage part.

It's easy to calculate the damage of a hero, but you need to know a few things beforehand.
What you need to know are these fields from Object editor:
- Which one is primary stat of a hero
- Combat - Attack 1 (or Attack 2, whichever your hero uses) - Damage Base
- Combat - Attack 1 / 2 - Damage Number of Dice
- Combat - Attack 1 / 2 - Damage Side per Die

Hero's damage value looks like this: (lower_boundary up to upper_boundary) ... e.g. (10 - 20)
Hero's damage is calculated as follows:
Lower boundary: Primary_stat_amount * attack_bonus_constant + damage_base + number_of_dice
Upper boundary: Primary_stat_amount * attack_bonus_constant + damage_base + (number_of_dice * sides_per_dice)

The attack_bonus_constant is a constant found in gameplay constants (top bar menu in the editor -> Advanced -> Gameplay Constants -> Hero Attributes - Attack bonus per Primary Att. Point) and has default value 1.00 (so it can be omitted in the calculation unless you changed the value).


For example take the Paladin hero without doing any changes to him. He has these object editor values:
- Primary stat: Strength
- Combat - Attack 1 - Damage Base: 0
- Combat - Attack 1 - Damage Number of Dice: 2
- Combat - Attack 1 - Damage Sides per Die: 6

At level 1 the Paladin has 22 Strength. So the calculation is as follows:
Lower boundary: 22 * 1.00 + 0 + 2 = 24
Upper boundary: 22 * 1.00 + 0 + (2 * 6) = 34
So the damage for Paladin at level 1 is 24 - 34.

The same formula is used for all heroes.

Now you can get the value of a hero attribute via triggers, but you have no way to detect which attribute is primary attribute and also you have no way to detect the Combat - Attack fields I wrote about above, that's why you need to set them in variables beforehand. Below is the action for getting hero's attribute amount (including or excluding bonuses from items and abilities):
  • -------- These are "INTEGER" variables --------
  • Set agi = (Agility of some_unit (Include bonuses))
  • Set int = (Intelligence of some_unit (Exclude bonuses))
  • Set str = (Strength of some_unit (Exclude bonuses))
The only other problem here is that you need to manually detect when hero picks any items that increases his damage - for example Claws of Attack and other similar items.
 
Last edited:
Level 24
Joined
Aug 1, 2013
Messages
4,657
Attack Damage is almost impossible to get though.
You have to find the base values, yes, but that is not everything.
You also have to add
- Items
- Abilities
- Buffs
- Powerups
- Triggered bonusses
- Hero Stats

So, I would say, pick an easy one like Int/Str/Agi (something you can actually load from a unit).
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
You create a global variable of type real (integers are round numbers and reals are decimal numbers).
Then you set that real to (4 x (Strength of <unit>))
There is one catch, the strength is an integer, so you have to do (4 x (Convert Integer To Real(Strength of <unit>)))
Then you can use that real variable as damage in the Unit - Damage Target action.
 
Status
Not open for further replies.
Top