HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

trigger problem

11-08-2003, 12:28 PM#1
ferda
I want to do this trigger:
Events
Conditions
(Unit-type of (Attacking unit)) Equal to Peon
Actions
Player - Add (Integer((Damage taken))) to (Owner of (Attacking unit)) Current gold

but I do not know how to do this part:
(Integer((Damage taken)))
11-08-2003, 02:23 PM#2
Roland of Gilead
The closest I got to what you want. Its not exactly but its close i think. Just need to figure out a way to make it so instead of doing subtract units max life have it subtract from units current life but no trigger for that. Without varibles.

Events
Unit - A unit Is attacked
Conditions
(Unit-type of (Attacking unit)) Equal to Peon
Actions
Player - Add ((Integer((Max life of (Attacked unit)))) - (Integer((Life of (Attacked unit))))) to (Owner of (Attacking unit)) Current gold
11-08-2003, 02:30 PM#3
Kolibri
The Damage Taken Event Response only works with the Specific Unit Event - Unit Takes damage Event.

So you'd have to use the Add New Event Action every time a unit is created.

Ie.

Trigger #1 that gives the gold:

Events:
Conditions:
(Unit-type of (Attacking unit)) Equal to Peon
Actions:
Player - Add (Integer((Damage taken))) to (Owner of (Attacking unit)) Current gold

Trigger #2 whenever a unit enters the map:

Events:
Unit - A unit enters (Entire Map)
Condtions:
Actions:
Trigger - Add to Trigger #1 <gen> the event (Unit - (Triggering unit) Takes damage)

I hope this helps. :)

EDIT: Oh yes, units that are inserted with the WE instead of by triggers should be added to Trigger #1 Events, ie.

Unit - [UNIT] Takes damage