package GameConditions import Entity import EndBoss import PlayerData import UnitSpawnSystem import EndGame import ClosureTimers public constant gameTime = getTimer() function endGameTimer() print("|cffFFCC00>> The Magic Treasure has been destroyed.|r\nYou failed!") gameTime.pause() doAfter(1., () -> loseGame()) stopSpawn() class Treasure extends UnitEntity construct(unit existing) super(existing) public function initConds() gameTime.doAfter(16.*60. + 20., () -> startEndBoss()) let td = CreateTimerDialog(gameTime) TimerDialogSetTitle( td, "Until Finale: " ) TimerDialogDisplay( td, true ) print( "|cffFFCC00>> Visit our discord server: discord.gg/yr3ZyYQ") print( "|cffFFCC00>> You have one minute to build up defenses..") let tr = CreateTrigger() if bigArena TriggerRegisterUnitEvent( tr, gg_unit_h00E_0007 , EVENT_UNIT_DEATH ) new Treasure(gg_unit_h00E_0007) gg_unit_h00E_0008.remove() else TriggerRegisterUnitEvent( tr, gg_unit_h00E_0008 , EVENT_UNIT_DEATH ) new Treasure(gg_unit_h00E_0008) gg_unit_h00E_0007.remove() TriggerAddAction( tr, function endGameTimer )