Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
I have a problem with a trigger. The trigger should do: When a player destroys a building, for an example a castle, to gain control of that building. Any ideas are appreciated. Thanks in advance!
There are multiple ways to go about this.
One solution would be to use a damage detection system and see when a killing blow would be dealt.
1) Download and import Bribe's Damage Engine.
2) This trigger:
On Damage
Events
Game - DamageModifierEvent becomes Equal to 1.00
Conditions
(Unit-type of DamageEventTarget) Equal to Castle
((Life of DamageEventTarget) - DamageEventAmount) Less than 0.41
Actions
Set DamageEventAmount = 0.00
Unit - Set life of DamageEventTarget to 100.00%
Unit - Change ownership of DamageEventTarget to (Owner of DamageEventSource) and Change color
The other solution is to use "A unit is attacked".
On Attack
Events
Unit - A unit Is attacked
Conditions
(Unit-type of (Triggering unit)) Equal to Castle
(Life of (Triggering unit)) Less than 100.00
Actions
Unit - Order (Attacking unit) to Stop
Unit - Set life of (Triggering unit) to 100.00%
Unit - Change ownership of (Triggering unit) to (Owner of (Attacking unit)) and Change color
With this method, the unit might still be able to die (if so, you should change the condition so the trigger activates earlier - when the Castle has less than 150 HP for example).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.