HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

i need help with a trigger

05-05-2003, 03:35 PM#1
a1strank
ok i have a trigger that if a hero kills a hero, add 1 lvl to killing hero,
i did this:
event - unit owned by p1 dies
condi- unit equal to (the hero i want)
action - hero - set killing hero lvl +1 to picked unit.

ok the problem is when a hero1 killed hero2, the lvl up thing worked the first time. but if hero1 killed hero2 again,(hero2 is revived), hero1 will not level up again. i think the problem is the revive, can anyone help me to solve this problem?
05-05-2003, 08:30 PM#2
Earth-Fury
set it to "killing unit" instaed of "picked unit" for the action, and add the condition:

triggering units level>10

i dont think you HAVE to, but i think it might help u wit the prob.
05-06-2003, 04:31 AM#3
Dead-Inside
How about a variable? That is a counter of the heros lvls. Being 1-10.
05-06-2003, 07:58 AM#4
rwxr-xr-x
If the hero that was killed is in fact reviving (by either an Ankh or the Ressurection ability), then the trigger will not fire because the hero never died as far as WC3 is concerned.

If the hero has an Ankh, try the following:

EVENTS
A unit owned by Player 1 dies
A unit owned by Player 1 Uses an item
CONDITIONS
OR - Dying unit equal to (hero) OR Item-type of manipulated item equal to Ankh
05-06-2003, 09:14 AM#5
a1strank
no none of the hero have ank, i have a trigger when any hero dies it will revive. also its wrong not hero1 revived its hero2, hero1 killed hero2, hero2 reivved, hero1 killed hero2 again, hero1 does not level up anymore.
05-06-2003, 10:01 AM#6
rwxr-xr-x
I'm taking a wild stab here, as I don't know how your map is setup, or exactly what you are doing to revive. It's possible that since your condition is checking for a specific unit, that however you are reviving, it is not that same unit anymore, which means the trigger won't execute the second time.

If you are wanting to enable this for all players, and have everything in one trigger, why not do the following? (maybe I misunderstood your purpose)

EVENTS
A unit owned by Player 1 dies
A unit owned by Player 2 dies
...
CONDITIONS
Dying unit is a hero equal to true
ACTIONS
revive dying hero
if ((Killing unit is a hero equal to true) AND (Hero level of killing unit less than 10)) then do (Hero - Set (killing unit) Hero level to (arithmatic)(Hero level of killing unit) + 1), Show level up graphics) else do nothing
05-06-2003, 09:59 PM#7
a1strank
rwxr this worked great thx alot!:ggani: