chango
New Member
- Reaction score
- 1
Hi, sorry for my bad english but i m from chile
well, this is the problem:
my map is a very simple hero arena, and i have a trigger to check the kills of every player but computer doesn't win only the user players do :s.
I m new in world editor and jass so maybe there is a stupid mistake.
here is the trigger:
Thanks.
well, this is the problem:
my map is a very simple hero arena, and i have a trigger to check the kills of every player but computer doesn't win only the user players do :s.
I m new in world editor and jass so maybe there is a stupid mistake.
here is the trigger:
JASS:
function Trig_CheckeandoMuertes_Conditions takes nothing returns boolean
return GetOwningPlayer(GetTriggerUnit()) != GetOwningPlayer(GetKillingUnitBJ())
return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO)
return true
endfunction
function Trig_CheckeandoMuertes_Func004Func001Func004A takes nothing returns nothing
if ( GetEnumPlayer() != udg_ganador ) then
call CustomDefeatBJ( GetEnumPlayer(), "TRIGSTR_039" )
endif
endfunction
function Trig_CheckeandoMuertes_Actions takes nothing returns nothing
local force jugadores = GetPlayersAll()
set udg_kills[GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))] = ( udg_kills[GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))] + 1 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 12
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( udg_kills[GetForLoopIndexA()] >= 2 ) then
set udg_ganador = ConvertedPlayer(GetForLoopIndexA())
call CustomVictoryBJ( udg_ganador, true, true )
call ForForce( jugadores, function Trig_CheckeandoMuertes_Func004Func001Func004A )
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call DestroyForce(jugadores)
endfunction
//===========================================================================
function InitTrig_CheckeandoMuertes takes nothing returns nothing
set gg_trg_CheckeandoMuertes = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_CheckeandoMuertes, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_CheckeandoMuertes, Condition( function Trig_CheckeandoMuertes_Conditions ) )
call TriggerAddAction( gg_trg_CheckeandoMuertes, function Trig_CheckeandoMuertes_Actions )
endfunction
Thanks.