Thats my first try to make a hero revive.....unit type of hero are set within the int!
when a hero die team 1-6 go to 1 spot and 6-12 but atm wanted at least to be able to revive a unit @_@ and i failed this!!!
plz apologize my noob skill and help me hihi lol
when a hero die team 1-6 go to 1 spot and 6-12 but atm wanted at least to be able to revive a unit @_@ and i failed this!!!
plz apologize my noob skill and help me hihi lol
JASS:
function Trig_Revive_hero takes nothing returns boolean
local unit u = GetTriggerUnit()
// player 0 = player 1 in game & player 6 = player 7 in game
// Note player start from 0 to 16 in jass!!
//in GUI converted text(jass) you will see player 1in gui was 1 in jass its 0
//Here i use preset hero becuz in some map hero can unally other hero
//if not you can use Boolean Player as condition :)
local boolean ok = IsUnitType(u,UNIT_TYPE_HERO) and (GetUnitTypeId(u) == udg_temp_UnitTypes[1]) or (GetUnitTypeId(GetTriggerUnit()) == udg_temp_UnitTypes[2]) or (GetUnitTypeId(GetTriggerUnit()) == udg_temp_UnitTypes[3]) or (GetUnitTypeId(GetTriggerUnit()) == udg_temp_UnitTypes[4]) or (GetUnitTypeId(GetTriggerUnit()) == udg_temp_UnitTypes[5]) or (GetUnitTypeId(GetTriggerUnit()) == udg_temp_UnitTypes[6])
set u = null
return ok
endfunction
function Trig_Revive_hero_Actions takes nothing returns nothing
// here is good hero revive for spell template
local unit Tunit = GetTriggerUnit()
// since the point of revive is mostly static i used a premade region
// i think it would be useless to create a region than destroy it!
// if you feel confident you can try :P
local location Loc = GetRectCenter(gg_rct_ReviveRegion)
local real Time = 10
// Here we will Loop a Global variable premade in the initialization
// Please take on look on it so you can understand more the reason of my Loop
// its way faster and its econimize some line
// p.s you can correct my comments if they arent true!!
call PolledWait(Time)
call ReviveHeroLoc(Tunit, Loc, true)
set Tunit = null
call RemoveLocation(Loc)
endfunction
//===========================================================================
function InitTrig_Revive_hero takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( t, function Trig_Revive_hero_Actions )
endfunction
Last edited: