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

Damage Increase against certain types of enemies

Status
Not open for further replies.
Level 3
Joined
Oct 21, 2007
Messages
35
Is there a way to increase the amount of damage you do if you attack a certain type of monster, outside of the siege-vs-fortified type system?

For example, if a hero specializes in slaying zombies, is there a way to make the hero do extra damage to this type of unit and no other? Kind of like what holy light does to undead units, but it'll occur with every normal attack (not by using magic) that the hero deals to the zombies.

And somewhat along the same question, is there a way to make a bandit/thief type of hero gain even more bounty from monsters with each kill?

Thx for the help :grin:
 
Level 11
Joined
Aug 25, 2006
Messages
971
Just use the event 'Generic unit is attacked'
Make a condition to check that the attacker is a zombieslayer and that the attacked unit it a zombie. Then make the zombieslayer do some more damage to the zombie.
Use this function to do the damage.
JASS:
native UnitDamageTarget             takes unit whichUnit, widget target, real amount, boolean attack, boolean ranged, attacktype attackType, damagetype damageType, weapontype weaponType returns boolean

First:
JASS:
takes unit whichUnit
This specifies the unit which does the damage.
JASS:
widget target
This specifies the target, a widget can be a unit/item/destructable.
JASS:
real amount
This specifies damage
JASS:
boolean attack
I'm pretty sure this specifies whether or not this will run the 'unit is attacked' event
JASS:
boolean ranged
True for ranged type damage false for melee type damage
JASS:
attacktype attackType
Valid attacktypes are ATTACK_TYPE_CHAOS
ATTACK_TYPE_HERO
ATTACK_TYPE_MAGIC
ATTACK_TYPE_MELEE
ATTACK_TYPE_NORMAL
ATTACK_TYPE_PIERCE
ATTACK_TYPE_SIEGE
JASS:
damagetype damageType
There are a lot of damagetypes so just go with DAMAGE_TYPE_NORMAL
JASS:
weapontype weaponType
Weapon type specifies the sound (I think) so just go with WEAPON_TYPE_WHOKNOWS
I'm pretty sure that has no sound.
 
Level 3
Joined
Oct 21, 2007
Messages
35
Is that function JASS (I don't know any programming language besides VB)? Is there another way to do it using solely triggers or is it very highly recommended I learn JASS first before doing anything?
 
Level 11
Joined
Aug 25, 2006
Messages
971
If you have WEU theres a trigger it adds under the 'Unit' Category, its near the bottom. Use that to do damage. And yes, thats JASS. If you know VB it shouldn't be too incredibly hard to learn JASS.
 
Level 3
Joined
Oct 21, 2007
Messages
35
Ok, thanks for the help. I'll pretty much go learn JASS ASAP...it seems all the cool stuff needs that.

In terms of WEU, if you use extra triggers from WEU can people with normal WE play it (not through the WE but from actually playing it from the CD)?
 
Level 11
Joined
Aug 25, 2006
Messages
971
Of course. What editor you use to make the game won't limit who can play the game. However people with normal WE won't be able to open the map.
 
Status
Not open for further replies.
Top