Warcraft III resources & community, 2003–2006 · archived

Hero Experience per Hit?

6 posts
#1

Hero Experience per Hit?

Ok this might have been asked about 21421 times but.
When a hero attacks a unit or another hero, i want it to gain exp but i just can't get it working.

Can anyone help?

Cheers,
M4pster
#2
Make this trigger:

Event: A unit takes damage

Condition attacking unit equal to a hero

Actions: give 10 exp to attacking unit
#3
"Takes Damage" is only for specific unit event. Maybe you'll need two triggers and custom values for each hero... But I'm not sure about it.
#4
Better yet, do this:

Attack Give EXP
Events
Unit - A unit Is attacked
Conditions
Actions
Hero - Add X experience to (Attacking unit), Show level-up graphics

X can be a number you want, a mathematical function (Level of (Attacked Unit) x 10), or many more things.
--donut3.5--
#5
You should try to code this on JASS since many heroes attacking might cause the trigger to generate slow code and mess up, but this is just a theory, I think it happened to me once. :roll:
JASS might help a bit if this issue comes to existence.
#6
Event: A unit takes damage

Condition attacking unit equal to a hero

Actions: give 10 exp to attacking unit


try Damage Source? Attacking Unit is for A Unit Is Attacked