• 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.

Ability - Damage Based on Weapon Damage?

Status
Not open for further replies.
Level 2
Joined
Apr 11, 2010
Messages
9
Been looking through the editor for quite some time, but I can't find anything regarding to my question.

I'm currently trying to make an ability similar to those you find in World of Warcraft or Diablo 2, where some cause damage based on your own weapon damage (which in turn, scales with the character). For example...

- Your unit has 200 base damage.
- The unit uses Ability A, which causes 75% weapon damage.
- Ability A then causes 150 damage.

Or...

- Your unit has 200 base damage.
- The unit uses Ability B, which causes 150% weapon damage.
- Ability B then causes 300 damage.


At the moment, I can only see that abilities cause fixed damage, which doesn't scale one bit. Help is greatly appreciated.
 
Level 9
Joined
Nov 4, 2007
Messages
933
This can be tricky but it is doable, try to follow along, this will require the following:
1 Behavior
3 Effects
Now lets begin, you will understand the logic behind this once you've done all the steps:
First duplicate your weapons damage effect exactly as it appears on your unit, and call it Ability A (Damage). Next, create a Behavior of type Buff and name it Ability A (Damage Reponse) and modify the Combat - Damage Reponse+ field to match the following:
Chance: 1
Count Minimum: 1
Count Maximum: 1
Count Start: 1
Hide Count: Enabled
Location: Defender
Modify Fraction: 0.75
then click OK and set its Flag to Hidden.
Next create an Effect of type Apply Behavior and name it Ability A (Apply Behavior) and modify the following:
Behavior - Behavior: Ability A (Damage Reponse)
Unit - Unit+: Target
Next step is to create another Effect of type Set and name it Ability A (Set) and modify the following (the order in which you add the effects is crucial):
Effect - Effects: Ability A (Apply Behavior)
Ability A (Damage)
Effect - Maximum Count: 2
Effect - Minimum Count: 2
Finally add the Set effect to your Abilities Effect - Effect field and what this will essentially do is when the ability is used on a target it will cause the first Effect in your Set effect to initiate and apply the behavior Ability A (Damage Response) to the target unit. The behavior has a charge of 1 that activates the second that the unit with the behavior is damaged, and when the damage is caused it will be modified down to 75% damage. Immediately after, the second effect of the Set Effect is applied causing damage to the target which will trigger the behavior and cause 75% damage to the unit and disappear. Hope that helped.
 
Level 9
Joined
Nov 4, 2007
Messages
933
That wouldn't be a problem, if it changes via an Attribute or buff that adds % or base damage to the unit, the damage kind that the attribute adds to will apply to all damage effects of said kind that are on the unit that has the behavior. If the unit has a buff that adds 5 to ranged damage, this will add 5 to both his weapon damage and the damage effect of Ability A because it is also of the Ranged effect kind. If done via upgrade, then the upgrade needs to simply be modified to accomodate the ability as well as the original weapon damage effect.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
As the above poster mentioned, use the same weapon damage effect and try messing with buffs to give the right modifier for the damage.

The only thing that defines weather damage is an attack or a spell is the actual damage type and not if it is attached to a weapon or not. Infact the stats a weapon show are a proxy link that has nothing to do with the effects it carriers out (livithan).

You could have a ghost with the thor's weapon description which gets modified to say over 9000 damage yet all it does is create infested terrans on attacking (no damage at all). In SC2 the interface and the actual mechanics are separate.
 
Level 9
Joined
Nov 4, 2007
Messages
933
I guess, I'm just used to doing it that way since it allows for greater customization of effects (randomization, bonus vs., death effect type) but either way works.
 
Level 3
Joined
Apr 28, 2010
Messages
48
Well, if you want separate effects, you'd do it through triggers.

CatalogFieldValueGet the original damage effect set to a variable.
CatalogFieldValueSet to that variable, for the effect damage of the ability you want.


If you want a more difficult, but, more efficient approach. You could custom script CatalogFieldValueSet in one go without the variables and Get.

Remember though, catalogs only effect that which you can upgrade.
 
Status
Not open for further replies.
Top