//TESH.scrollpos=0 //TESH.alwaysfold=0 function RespawnCreeps takes nothing returns nothing local unit u = GetTriggerUnit() local string st = I2S(H2I(u)) local real x = GetStoredReal(udg_CR,st,"RespawnX") local real y = GetStoredReal(udg_CR,st,"RespawnY") local real f = GetStoredReal(udg_CR,st,"RespawnFacing") local integer b = 0 local integer ul = GetUnitLevel(u) local real rt = 0 if GetUnitState(u,UNIT_STATE_MAX_LIFE) < 2200 and GetUnitTypeId(u) != 'uske' and GetUnitTypeId(u) != 'uskm' and GetUnitTypeId(u) != 'uske' and GetUnitTypeId(u) != 'uplg' then set b = GetUnitTypeId(u) if ul < 10 then set ul = 10 endif set rt = (ul+1) + ((ul * ul)/ (2 * ul)) + SquareRoot(ul) call TriggerSleepAction(rt) call RemoveUnit(u) set u = CreateUnit(Player(12),b,x,y,f) set st = I2S(H2I(u)) call StoreReal(udg_CR,st,"RespawnX",x) call StoreReal(udg_CR,st,"RespawnY",y) call StoreReal(udg_CR,st,"RespawnFacing",f) set u = null else set u = null endif endfunction
//=========================================================================== function InitTrig_CreepRespawn takes nothing returns nothing set udg_CR = InitGameCache("CR") set gg_trg_CreepRespawn = CreateTrigger() call TriggerRegisterPlayerUnitEvent(gg_trg_CreepRespawn, Player(12), EVENT_PLAYER_UNIT_DEATH, null) call TriggerAddAction(gg_trg_CreepRespawn, function RespawnCreeps) endfunction
function Trig_HeroRevive_Actions takes nothing returns nothing local integer j = 1 local integer rd = 0 loop exitwhen j > 12 if udg_ReviveTimer[j] == GetExpiredTimer() then loop set rd = GetRandomInt(1,15) exitwhen CountUnitsInGroup(GetUnitsInRectMatching(udg_CPlace[rd], Condition(function FilterHinRect))) == 0 endloop call ReviveHero(udg_DyingHero[j],GetRectCenterX(udg_CPlace[rd]),GetRectCenterY(udg_CPlace[rd]), true ) call SetUnitState(udg_DyingHero[j],UNIT_STATE_MANA,GetUnitState(udg_DyingHero[j],UNIT_STATE_MAX_MANA)) call SelectUnitForPlayerSingle( udg_DyingHero[j], GetOwningPlayer(udg_DyingHero[j]) ) call PanCameraToTimedLocForPlayer( GetOwningPlayer(udg_DyingHero[j]), GetUnitLoc(udg_DyingHero[j]), 1 ) call PauseUnit(udg_DyingHero[j],false) call SetUnitVertexColor(udg_DyingHero[j],255,255,255,255) if GetUnitTypeId(udg_DyingHero[j]) == 'O00C' then call SetUnitVertexColor(udg_DyingHero[j],255,255,255,255-R2I(38.25*GetUnitAbilityLevel(udg_DyingHero[j],'A049'))) endif set udg_DyingHero[j] = null endif set j = j + 1 endloop endfunction
//=========================================================================== function InitTrig_HeroRevive takes nothing returns nothing local integer i = 1 set gg_trg_HeroRevive = CreateTrigger( ) loop exitwhen i > 12 call TriggerRegisterTimerExpireEventBJ( gg_trg_HeroRevive, udg_ReviveTimer[i] ) set i = i + 1 endloop call TriggerAddAction( gg_trg_HeroRevive, function Trig_HeroRevive_Actions ) endfunction
Система name
//TESH.scrollpos=3 //TESH.alwaysfold=0 function Trig_NameGen_Actions takes nothing returns nothing local string array s local integer i = 1
set s[1] = "Smile!" set s[2] = "V3x" set s[3] = "Flar3on" set s[4] = "Lexx" set s[5] = "Sp1riT" set s[6] = "Z-Hum@n" set s[7] = "Wis3man" set s[8] = "Sph1nX" set s[9] = "2picca" set s[10] = "STEEL" set s[11] = "H.A.W.K"
loop exitwhen i>11 if GetPlayerController(Player(i)) == MAP_CONTROL_COMPUTER then call SetPlayerName( Player(i), s[i] ) set s[i]="" endif set i = i + 1 endloop endfunction
//=========================================================================== function InitTrig_NameGen takes nothing returns nothing set gg_trg_NameGen = CreateTrigger( ) call TriggerAddAction( gg_trg_NameGen, function Trig_NameGen_Actions ) endfunction