• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How Do You Create A Trigger That Turns Over Control After A Building Is Taken

Status
Not open for further replies.
Level 3
Joined
Nov 28, 2009
Messages
28
I need a hand wth the trigger that would allow me to do this. Ive checked the Tutorials but i could not find one that was relavent to this. What i mean by it is that after the building has gotten to under 1000 health it will become the attackers WITH full health. Ive figured out how to do individual buildings but I do not want to have to do this for every building.
 
Level 5
Joined
Oct 5, 2009
Messages
80
Well... let me think.
If the buildings are owned by a single player (Player 12, say) and Player 12 will never have any other units, then;
EVENTS
A unit owned by Player 12 is attacked
CONDITIONS
Life of attacked unit is less than 1000
ACTIONS
Set life of attacked unit to max health of attacked unit
Set ownership of attacked unit to owner of attacking unit

If you want players to be able to capture other player's buildings, then;

EVENTS
A unit is attacked
CONDITIONS
Life of attacked unit is less than 1000
Any of the following conditions are true:
Type of attacked unit equal to BuildingA
Type of attacked unit equal to BuildingB
etc.
ACTIONS
Set life of attacked unit to max life of attacked unit
Set ownership of attacked unit to owner of attacking unit

I'm pretty sure that will work. I don't have World Editor available right now, so I don't know if those are the exact Events/Conditions/Actions. But anyway, good luck.
 
Last edited:
Level 14
Joined
Aug 31, 2009
Messages
775
As simple as
  • Events
    • Unit - A unit is attacked
  • Conditions
    • Unit Type of (Triggering Unit) = <Your Building>
    • Life of (Attacked Unit) Less than or equal to 1000.00
  • Actions
    • Unit - Change Ownership of (Triggering Unit) to (Owner of (Attacking Unit))
    • Unit - Set life of (Triggering Unit) to (Max Life of (Triggering Unit))
 
Status
Not open for further replies.
Top