HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Custom damadge issue.

08-12-2007, 03:16 PM#1
cohadar
I am making a spell that does damadge over time
and was just thinking if target of the spell has resistance of 50% to magic
and I do 7 damadge to it for 6 seconds will it calculate the dmg properly

i.e will it do 3.5 * 6 = 21 dmg or it will round it to 3 * 5 = 15 dmg

This is a huge difference in performance.


Also what are those attack types used for? (plant, death, force, acid ..)
Do they have any effect on the damadge ?

Is there a tutorial on this?
08-12-2007, 06:24 PM#2
TaintedReality
Quote:
Also what are those attack types used for? (plant, death, force, acid ..)
Do they have any effect on the damadge ?

Everything but Normal and Universal are of type Magic. Normal is normal/physical, and Universal bypasses everything. These types are just for the purpose of resistances and immunity (not armor). And, since they're basically all Magic they're kind of pointless =\.

Edit: Oh and to your first question - I'm pretty sure it will deal damage properly. Haven't actually tried it, but health is kept track of with reals so it shouldn't round it off.
08-12-2007, 06:58 PM#3
cohadar
Are you saying that if I do triggered dmg with type Magic and unit is magic immune it will not be dmged, and if I do it with universal it will get pwned no matter what?
And what if it is invulnerable?
08-12-2007, 07:47 PM#4
TaintedReality
Yes to the first part. I'm not sure if Universal damage bypasses invulnerability or not. I'm thinking no, but you'd have to try it. Actually, I'm almost positive that no damage type will deal damage to an invulnerable unit, since invulnerability modifies armor, not resistances/immunities.
08-12-2007, 08:06 PM#5
Alexander244
Quote:
Originally Posted by jass.sourceforge.net

Damagetype is used by the damage functions to determine if the damage will be magical (doesn't affect magic immune), physical (doesn't affect ethereal) or universal (affects magic immune and ethereal).

Using null instead of the preset variables defaults to the DAMAGE_TYPE_UNKNOWN which is actually able to damage invulnerable units.

Damage Types:
Name:Info:

DAMAGE_TYPE_ACID
magical
DAMAGE_TYPE_COLD magical
DAMAGE_TYPE_DEATH magical
DAMAGE_TYPE_DEFENSIVE magical
DAMAGE_TYPE_DEMOLITION phisical
DAMAGE_TYPE_DISEASE magical
DAMAGE_TYPE_DIVINE magical
DAMAGE_TYPE_ENHANCED phisical
DAMAGE_TYPE_FIRE magical
DAMAGE_TYPE_FORCE phisical
DAMAGE_TYPE_LIGHTNING magical
DAMAGE_TYPE_MAGIC magical
DAMAGE_TYPE_MIND magical
DAMAGE_TYPE_NORMAL magical
DAMAGE_TYPE_PLANT magical
DAMAGE_TYPE_POISON magical
DAMAGE_TYPE_SHADOW_STRIKE magical
DAMAGE_TYPE_SLOW_POISON phisical
DAMAGE_TYPE_SONIC magical
DAMAGE_TYPE_SPIRIT_LINK magical
DAMAGE_TYPE_UNIVERSAL universal
DAMAGE_TYPE_UNKNOWN also affects invulnerable

Attacktype is used by the damage functions to determine how the damage will act against units with different armor types, this behaviour depends on the gameplay constants related with attack type and armor type.

ATTACK_TYPE_UNKNOWN or null seems to ignore the unit's armor.

Attack Types:
Name:Info:

ATTACK_TYPE_CHAOS
ATTACK_TYPE_HERO
ATTACK_TYPE_MAGIC
ATTACK_TYPE_MELEE
ATTACK_TYPE_NORMAL is actually spell damage
ATTACK_TYPE_PIERCE
ATTACK_TYPE_SIEGE

Edit: To answer your other question - damage does not get rounded to the closest integer.
08-12-2007, 08:51 PM#6
cohadar
+rep and bookmarking this page.
08-13-2007, 07:12 AM#7
Pheonix-IV
Hitpoints are actually reals with decimal places (i think 2?) they're only displayed as integers. Damage is also real, so decimal values for damage and life are used, WCIII -looks- like it rounds them off, but it doesn't.
05-18-2008, 12:06 AM#8
Themerion
For everybody who has bookmarked this page (like me), I would like to warn that the table does not seem to be correct altogether.

Like TaintedReality said, DAMAGE_TYPE_NORMAL is physical (doesn't work on banished units).
05-18-2008, 12:14 AM#9
Vexorian
I made that table, and just noticed physical is the right word...

Should update that site more often...

anyways when I made that table I tested manually against banish and spell immune, it would have been a little lame if blizzard changed normal to make it physical, or could that have been a mistake from my end? Err, time to do tests...
05-18-2008, 06:00 AM#10
DioD
invulnerable units cannot be damaged in any way.
05-18-2008, 08:17 AM#11
Alexander244
Quote:
Originally Posted by divo
Attack Types:
Trigger Editor ConstantWorld Editor ConstantClassificationNotes
ATTACK_TYPE_CHAOSCombat - Damage Bonus Table - ChaosNormal Attack Type
ATTACK_TYPE_HEROCombat - Damage Bonus Table - HeroNormal Attack Type
ATTACK_TYPE_MAGICCombat - Damage Bonus Table - MagicMagic Attack Type
ATTACK_TYPE_NORMALCombat - Damage Bonus Table - SpellsMagic Attack TypeNote the naming difference.
ATTACK_TYPE_MELEECombat - Damage Bonus Table - NormalNormal Attack TypeNote the naming difference.
ATTACK_TYPE_PIERCECombat - Damage Bonus Table - PierceNormal Attack Type
ATTACK_TYPE_SIEGECombat - Damage Bonus Table - SiegeNormal Attack Type

Damage Types:
Trigger Editor ConstantDamage TypeUsed with a Normal Attack TypeUsed with a Magic Attack TypeNotes
DAMAGE_TYPE_ACID Magic Ignores armor and magic resistance Takes magic resistance into consideration
DAMAGE_TYPE_COLD Magic Ignores armor and magic resistance Takes magic resistance into consideration
DAMAGE_TYPE_DEATH Magic Ignores armor and magic resistance Takes magic resistance into consideration
DAMAGE_TYPE_DEFENSIVE Magic Ignores armor and magic resistance Takes magic resistance into consideration
DAMAGE_TYPE_DEMOLITION Magic Ignores armor and magic resistance Takes magic resistance into consideration
DAMAGE_TYPE_DISEASE Magic Ignores armor and magic resistance Takes magic resistance into consideration
DAMAGE_TYPE_DIVINE Magic Ignores armor and magic resistance Takes magic resistance into consideration
DAMAGE_TYPE_ENHANCED Magic Ignores armor and magic resistance Takes magic resistance into consideration
DAMAGE_TYPE_FIRE Magic Ignores armor and magic resistance Takes magic resistance into consideration
DAMAGE_TYPE_FORCE Magic Ignores armor and magic resistance Takes magic resistance into consideration
DAMAGE_TYPE_LIGHTNING Magic Ignores armor and magic resistance Takes magic resistance into consideration
DAMAGE_TYPE_MAGIC Magic Ignores armor and magic resistance Takes magic resistance into consideration Just use this one for magic damage.
DAMAGE_TYPE_MIND Magic Ignores armor and magic resistance Takes magic resistance into consideration
DAMAGE_TYPE_NORMAL Physical Takes armor into consideration Takes armor and magic resistance into consideration Physical as in melee and ranged attacks
DAMAGE_TYPE_PLANT Magic Ignores armor and magic resistance Takes magic resistance into consideration
DAMAGE_TYPE_POISON Magic Ignores armor and magic resistance Takes magic resistance into consideration
DAMAGE_TYPE_SHADOW_STRIKE Magic Ignores armor and magic resistance Takes magic resistance into consideration
DAMAGE_TYPE_SLOW_POISON Magic Ignores armor and magic resistance Takes magic resistance into consideration
DAMAGE_TYPE_SONIC Magic Ignores armor and magic resistance Takes magic resistance into consideration
DAMAGE_TYPE_SPIRIT_LINK Magic Ignores armor and magic resistance Takes magic resistance into consideration
DAMAGE_TYPE_UNIVERSAL Universal Ignores armor and magic resistance Takes magic resistance into consideration Used with ultimates.
DAMAGE_TYPE_UNKNOWN Unknown Ignores armor and magic resistance Ignores armor and magic resistance Ignores both armor and magic resistance.
05-18-2008, 03:22 PM#12
darkwulfv
Quote:
Originally Posted by DioD
invulnerable units cannot be damaged in any way.
Wrong, I do it all the time (usually on accident). With the right DAMAGE_TYPE variable (or null), it can bypass invulnerability and hit them anyways. I think UNIVERSAL might as well, but I know UNKNOWN does.
05-18-2008, 04:17 PM#13
Vexorian
It is lame that they aren't independent, a blizzard post said damagetype is the one dealing with magic resistance while attacktype deals with armor, now it looks like they are all mixed.