• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Capture Strategy Buildings

Status
Not open for further replies.
Level 28
Joined
Jan 26, 2007
Messages
4,789
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).
 
Status
Not open for further replies.
Top