Page 1 of 1

Unit give control and reset health trigger

Posted: Tue May 10, 2011 12:35 pm
by Loopsnhoops
Hey,

I need help making a trigger in which a unit attacks the structure and when the structure reaches a certain health it transfers control of the structure to the attacking player and resets the structure's health points to normal. Example: Broken Alliances bases if captured...

Thanks, loopsnhoops

Re: Unit give control and reset health trigger

Posted: Tue May 10, 2011 1:31 pm
by 3ICE
Event - Castle 0001 Takes damage
Condition: Castle Life less than 20% of Castle max life
Action: Unit - Change owner of Castle to Owner of Attacking unit
Action: Unit - Set HP of Castle fo Max HP of Castle.

gg :)

Re: Unit give control and reset health trigger

Posted: Tue May 10, 2011 1:37 pm
by Loopsnhoops
This is good code but can I do the same thing for unit types?

Thanks, loopsnhoops

Re: Unit give control and reset health trigger

Posted: Tue May 10, 2011 1:42 pm
by 3ICE
Yes.

Switch to Any unit takes damage and pray to (whatever deity you believe in) your map doesn't lag too bad from that lazy approach.

And of course swap every instance of "Castle 0001" to "Triggering unit".