Buildings changing ownership
Moderator: Cheaters
-
- Newcomer
- Posts: 1
- Joined: June 19th, 2007, 11:42 pm
- Location: Canada
Buildings changing ownership
How would i make an event so that a building would change ownership when it hits, for example, 1000 health.
-
- Honorary wc3edit.net Traitor
- Posts: 2507
- Joined: February 1st, 2007, 4:11 pm
- Location: NEVADA
In gui theres quite a few ways, in fact, its not even necessary for a event you could just use a wait, but you asked for a event, so we'll do that.
Events -
Unit - A unit Starts the effect of an ability
Unit - A unit Finishes casting an ability
Unit - A unit Is issued an order targeting an object
Unit - A unit Is attacked
(four just to make sure we get to it in time)
Conditions -
(Life of (Triggering unit)) Less than or equal to 1000.00
(Triggering unit) Equal to (No Unit) <--- fill with your unit
Actions -
Unit - Change ownership of (Triggering unit) to (Picked player) and Change color
^^^^^^^^^^-- change picked player to the player you'd like it to change to.
Enjoy.
Events -
Unit - A unit Starts the effect of an ability
Unit - A unit Finishes casting an ability
Unit - A unit Is issued an order targeting an object
Unit - A unit Is attacked
(four just to make sure we get to it in time)
Conditions -
(Life of (Triggering unit)) Less than or equal to 1000.00
(Triggering unit) Equal to (No Unit) <--- fill with your unit
Actions -
Unit - Change ownership of (Triggering unit) to (Picked player) and Change color
^^^^^^^^^^-- change picked player to the player you'd like it to change to.
Enjoy.
-
- Senior Member
- Posts: 133
- Joined: June 18th, 2007, 3:05 pm
- Location: Azeroth
-
- Forum Staff
- Posts: 829
- Joined: January 28th, 2007, 8:10 pm
- Title: JASS Programmer
- Location: Canada
In JASS you could just do
This is basically
"A unit's hp becomes less than or equal to 1000"
Code: Select all
call TriggerRegisterUnitStateEvent(whichTrigger,whichUnit,UNIT_STATE_LIFE,ConvertLimitOp(1),1000)
"A unit's hp becomes less than or equal to 1000"