• 🏆 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!

Using unit's weapon damage in spells

Status
Not open for further replies.
Level 14
Joined
Nov 17, 2010
Messages
1,265
It's simple enough to get a hero's stats and base spell damage on them, but what about regular attack damage. I want to make a spell that uses the hero's attack damage + any bonuses from items when figuring the damage for a spell. For instance (Damage + bonuses) + (Strength) x (level of ability)

How can I get the damage the hero would do with a regular melee attack?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
The basic idea could be

Unit begins casting an ability

Create x number of dummies to attack target y
Record min & max damage

----

Unit starts the effect of an ability

Load min/max damage and deal damage based on that


I've coded such system but can't upload it right now.

Another method is to initialize a lot of data and then calculate the damage instantly.

A difficulty with both methods is how to factor in buffs.
 
Status
Not open for further replies.
Top