function Trig_Te_mato_Conditions takes nothing returns boolean
set udg_Temp_Player=GetOwningPlayer(GetKillingUnit())
set udg_Temp_Player2=GetOwningPlayer(GetDyingUnit())
if IsPlayerEnemy(udg_Temp_Player,udg_Temp_Player2)==false then
return false
elseif IsUnitType(GetDyingUnit(),UNIT_TYPE_HERO)==false then
return false
endif
return true
endfunction
function NoEsEl takes nothing returns boolean
return (GetFilterPlayer()!=udg_Temp_Player)
endfunction
function AddAssist takes nothing returns nothing
if LoadInteger(udg_Assists,CircleNumber(GetEnumPlayer()),CircleNumber(udg_Temp_Player2))>0 then
call ForceAddPlayer(udg_Asistencias,GetEnumPlayer())
endif
endfunction
function AssistActions takes nothing returns nothing
local location l
local integer Akill=CircleNumber(GetEnumPlayer())
local unit u
set udg_Los_que_asistieron=(udg_Los_que_asistieron+(udg_Nombre_Jugador[Akill]+"/"))
set udg_assists[Akill]=(udg_assists[Akill]+1)
call MultiboardSetItemValueMejor(udg_Tabla,5,udg_Row[Akill],I2S(udg_assists[Akill]))
if udg_Modo[3]!="Only consummibles." then
call AdjustPlayerStateBJ(GetRandomInt(0,1),GetEnumPlayer(),PLAYER_STATE_RESOURCE_LUMBER)
endif
if udg_Hero[Akill]==null then
set l=GetUnitLoc(udg_Circle[Akill])
set u=CreateUnitAtLoc(Player(PLAYER_NEUTRAL_AGGRESSIVE),'hfoo',l,bj_UNIT_FACING)
call RemoveLocation(l)
call UnitDamageTargetBJ(udg_Circle[Akill],u,9999.00,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
call RemoveUnit(u)
else
set l=GetUnitLoc(udg_Hero[Akill])
set u=CreateUnitAtLoc(Player(PLAYER_NEUTRAL_AGGRESSIVE),'hfoo',l,bj_UNIT_FACING)
call RemoveLocation(l)
call UnitDamageTargetBJ(udg_Hero[Akill],u,9999.00,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
call RemoveUnit(u)
endif
set u=null
set l=null
endfunction
function Trig_Te_mato_Actions takes nothing returns nothing
local integer k=CircleNumber(udg_Temp_Player)
local integer d=CircleNumber(udg_Temp_Player2)
local integer extra
local force f
local boolean fk
local boolean dk
local boolean tk
local boolean uk
if udg_Modo[3]!="Only consummibles." then
call AdjustPlayerStateBJ(GetRandomInt(1,2),udg_Temp_Player,PLAYER_STATE_RESOURCE_LUMBER)
endif
call SetPlayerState(udg_Temp_Player2,PLAYER_STATE_GOLD_GATHERED,R2I(I2R(GetPlayerState(udg_Temp_Player2,PLAYER_STATE_RESOURCE_GOLD))*GetRandomReal(0.75,0.90)))
set udg_spree[k]=udg_spree[k]+1
set udg_kills[k]=udg_kills[k]+1
call MultiboardSetItemValueMejor(udg_Tabla,3,udg_Row[k],I2S(udg_kills[k]))
set udg_deaths[d]=udg_deaths[d]+1
set udg_Sin_repick[d]=0
call MultiboardSetItemValueMejor(udg_Tabla,4,udg_Row[d],I2S(udg_deaths[d]))
if udg_Temp_Player==Player(0) then
set k=11
elseif udg_Temp_Player==Player(6) then
set k=12
endif
if udg_Temp_Player==Player(PLAYER_NEUTRAL_AGGRESSIVE) then
if GetKillingUnit()==udg_Golem_de_carne then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,4.00,udg_Nombre_Jugador[d]+" was killed by The Monster")
else
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,4.00,udg_Nombre_Jugador[d]+" was killed by the Neutral Creeps")
endif
else
if udg_spree[d]>=3 then
set extra=GetRandomInt(udg_spree[d]*40,udg_spree[d]*60)
set udg_Asesinato_mensaje=udg_Nombre_Jugador[k]+" has ended the spree of |cffffcc00"+I2S(udg_spree[d])+"|r of "+udg_Nombre_Jugador[d]+" |cffffcc00(+"+I2S(extra)+")|r"
call AdjustPlayerStateBJ(extra,udg_Temp_Player,PLAYER_STATE_RESOURCE_GOLD)
else
set udg_Asesinato_mensaje=udg_Nombre_Jugador[k]+" killed "+udg_Nombre_Jugador[d]
endif
set udg_spree[d]=0
set f=GetPlayersMatching(Condition(function NoEsEl))
call ForForce(f,function AddAssist)
call DestroyForce(f)
if CountPlayersInForceBJ(udg_Asistencias)>0 then
call ForForce(udg_Asistencias,function AssistActions)
set udg_Los_que_asistieron=SubString(udg_Los_que_asistieron,0,StringLength(udg_Los_que_asistieron)-1)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,4.00,(udg_Asesinato_mensaje+(". Assists: "+udg_Los_que_asistieron)))
set udg_Los_que_asistieron=""
call ForceClear(udg_Asistencias)
else
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,4.00,udg_Asesinato_mensaje)
endif
endif
if udg_Temp_Player!=Player(0) and udg_Temp_Player!=Player(6) then
if udg_spree[k]>=3 then
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,udg_Nombre_Jugador[k]+" has a spree of |cffffcc00"+I2S(udg_spree[k])+"|r")
endif
set fk=udg_first_kill[k]==0
set dk=udg_double_kill[k]==0
set tk=udg_triple_kill[k]==0
set uk=udg_Ultra_kill[k]==0
if fk and dk and tk and uk then
set udg_first_kill[k]=10
return
elseif not fk and dk and tk and uk then
set udg_double_kill[k]=10
set udg_first_kill[k]=0
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,udg_Nombre_Jugador[k]+" just got a |cff00ffffDouble kill|r!")
return
elseif fk and not dk and tk and uk then
set udg_triple_kill[k]=10
set udg_double_kill[k]=0
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,udg_Nombre_Jugador[k]+" just got a |cff00ffffTriple kill|r!")
return
elseif fk and dk and not tk and uk then
set udg_Ultra_kill[k]=10
set udg_triple_kill[k]=0
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,udg_Nombre_Jugador[k]+" just got a |cff00ffffUltra kill|r!")
return
elseif fk and dk and tk and not uk then
set udg_Ultra_kill[k]=10
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,udg_Nombre_Jugador[k]+" is on a |cff00ffffRampage|r!")
return
endif
endif
set f=null
endfunction
//===========================================================================
function InitTrig_Te_mato takes nothing returns nothing
set gg_trg_Te_mato=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Te_mato,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(gg_trg_Te_mato,Condition(function Trig_Te_mato_Conditions))
call TriggerAddAction(gg_trg_Te_mato,function Trig_Te_mato_Actions)
endfunction