HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How to switch control of a building to another player when it gets to X hp!!

07-19-2005, 06:01 PM#1
Optional
I'm working on a sort of risk type map, and I need to know how to.. say


Brown attacks Reds main building, when reds main building gets to 500 hp, it switches to browns control and its hp is put back to full..

How can i do this? Help would be AWSOME!
07-19-2005, 06:25 PM#2
Guest
Event
A unit is attacked
Conditions
unit type of attacked unit = to (your unit)
actions
if health of attacked unit is less than or equal to 500 then give attacked unit to owned of attaced unit else do nothing
07-19-2005, 08:34 PM#3
IAMZIM
This worked:
Code:
Events:
  Unit - A unit Is attacked
Conditions:
  (Attacked unit) Equal to Orc Burrow 0013 <gen> //(any unit whatsoever)
Actions:
  If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
          (Life of (Attacked unit)) Less than or equal to 500.00
      Then - Actions
          Unit - Change ownership of (Attacked unit) to (Owner of (Attacking unit)) and Change color
          Unit - Set life of (Attacked unit) to 100.00%
      Else - Actions
07-21-2005, 09:55 PM#4
Optional
Thanks guys. :)