• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Using unit's weapon damage in spells

Status
Not open for further replies.
Level 14
Joined
Nov 17, 2010
Messages
1,266
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,243
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