• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Solved] Keep gold mine-based building after depleted? how?

Status
Not open for further replies.
I have a building that is made to have gold like the gold mine and workers to go inside and mine it.

Upon depletion usually the building destroyed itself instantly, but I WANT TO KEEP IT ALIVE.

So i thought about it and one idea is the spawn ability upon death, that will spawn a copy of the building but without gold ability and load+cargo ability. Problem is - what if enemy destroys it instead of getting depleted?

How to detect the difference?
 
I made it with pr114's solution.


  • Plantation check and replace when iits depleted
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Plantation
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Killing unit) Equal to No unit
        • Then - Actions
          • Unit - Replace (Dying unit) with a Plantation (Depleted) using The new unit's max life and mana
        • Else - Actions
 
Last edited:
Status
Not open for further replies.
Back
Top