• 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.

Changing ownership of a castle when near death

Status
Not open for further replies.
Level 3
Joined
Mar 5, 2008
Messages
20
I had a trigger which re spawned a dying townhall type unit as rescuable.

I know it can be done with a unit already on the map, but i was trying to do it with one built during games.

If a castle dies, the unit gets replaced with another one, rescuable by whoever is attacking it.

  • event: unit dies
  • condition: dying unit is equal to a town hall type unit
  • action: replace unit with unit of same type of unit
  • set last created unit as rescuable.
is there another way of doing this?
 
Level 8
Joined
Nov 21, 2008
Messages
316
Im assuming all townhalls r on map
Not sure if u want burn capture options but here they r
  • make buttons
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Dialog - Change the title of baseOptions to What would you like...
      • Dialog - Create a dialog button for baseOptions labelled Burn
      • Set button1 = (Last created dialog Button)
      • Dialog - Create a dialog button for baseOptions labelled Capture
      • Set button2 = (Last created dialog Button)
  • button clicked
    • Events
      • Dialog - A dialog button is clicked for baseOptions
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to button1
        • Then - Actions
          • Unit - Explode currentBase
          • Set randomGold = (Random integer number between 200 and 500)
          • Player - Add randomGold to currentPlayer Current gold
          • Game - Display to (All allies of currentPlayer) the text: ((You gained + ((String(randomGold)) + gold)) + <Empty String>)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to button2
        • Then - Actions
          • Unit - Change ownership of currentBase to currentPlayer and Change color
          • Unit - Set life of currentBase to 100.00%
          • Unit - Make currentBase Vulnerable
        • Else - Actions


  • That Base
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Triggering unit) Equal to That Base 0075 <gen>
      • (Life of (Triggering unit)) Less than or equal to 500.00
    • Actions
      • Unit - Make (Triggering unit) Invulnerable
      • Dialog - Show baseOptions for (Owner of (Attacking unit))
      • Set currentBase = That Base 0075 <gen>
      • Set currentPlayer = (Owner of (Attacking unit))
 
Level 3
Joined
Mar 5, 2008
Messages
20
hey thank you for the quick response.

the town halls are not on the map. Im trying to make it transfer control of townhall type units that players have built in game, after they are weakened significantly.
 
Status
Not open for further replies.
Top