Spoiler:
Code: Select all
function Trig_Killing_Spree_Func005Func004A takes nothing returns nothing
call SetPlayerState(GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD)+GetHeroLevel(GetTriggerUnit())*20)
endfunction
function Trig_Killing_Spree_Actions takes nothing returns nothing
local player p0=GetOwningPlayer(GetTriggerUnit())
local player p1=GetOwningPlayer(GetKillingUnit())
local string s0=GetPlayerName(p0)
local string s1=GetPlayerName(p1)
local location l=GetUnitLoc(GetKillingUnit())
local integer i0=GetPlayerId(p0)
local integer i1=GetPlayerId(p1)
local integer ti=GetHeroLevel(GetDyingUnit())
if IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO)then
if udg_KillSpree[i0]>=5then
call SetPlayerState(p1,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(p1,PLAYER_STATE_RESOURCE_GOLD)+500)
call DisplayTextToPlayer(GetLocalPlayer(),0,0,s0+" has ended "+s1+" |cffff0000Killing Spree|r")
endif
set udg_KillSpree[i0]=0
call DisplayTextToPlayer(GetLocalPlayer(),0,0,"|cffffff00"+s1+" has killed "+s0+"|r")
if p1!=Player(0)and p1!=Player(1)and p1!=Player(12)then
set udg_KillSpree[i1]=udg_KillSpree[i1]+1
call SetPlayerState(p1,PLAYER_STATE_RESOURCE_GOLD,GetHeroLevel(GetTriggerUnit())*50)
call DisplayTextToPlayer(p1,0,0,"|cff00ccccYou receive:|r |cff00ffff"+I2S(ti*50)+"|r |cff00ffffgold|r")
call UnitRemoveItemFromSlot(GetTriggerUnit(),GetRandomInt(2,5))
if udg_KillSpree[i1]==5then
call SetPlayerState(p1,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(p1,PLAYER_STATE_RESOURCE_GOLD)+500)
call DisplayTextToPlayer(GetLocalPlayer(),0,0,s0+" is on a |cffff0000KILLING SPREE!!|r")
call DisplayTextToPlayer(p1,0,0,"|cff00ccccYou receive 500gold|r")
call StartSound(gg_snd_KillingSpree)
call AddSpecialEffectLoc("Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl",l)
elseif udg_KillSpree[i1]==10then
call StartSound(gg_snd_Dom)
call SetPlayerState(p1,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(p1,PLAYER_STATE_RESOURCE_GOLD)+750)
call DisplayTextToPlayer(GetLocalPlayer(),0,0,s1+" is |cffff0000DOMINATING|r")
call DisplayTextToPlayer(p1,0,0,"|cff00ccccYou receive 750gold|r")
call AddSpecialEffectLoc("Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl",l)
endif
endif
if p1==Player(0)then
call DisplayTextToForce(fhumans,"|cff33ff33An Orc Hero has Died|r")
call DisplayTextToForce(fhumans,"|cff00ccccYou receive:|r |cff00ffff"+I2S(ti*20)+"|r |cff0000ccgold|r" )
call ForForce(fhumans,function Trig_Killing_Spree_Func005Func004A)
elseif p1==Player(1)then
call DisplayTextToForce(forcs,"|cff33ff33A Human Hero has Died|r")
call DisplayTextToForce(forcs,"|cff00ccccYou receive:|r |cff00ffff"+I2S(ti*20)+"|r |cff0000ccgold|r" )
call ForForce(forcs,function Trig_Killing_Spree_Func005Func004A)
endif
endif
call RemoveLocation(l)
set l=null
set p1=null
set p0=null
set s1=""
set s0=""
endfunction
Well I've never really messed with timers so I hope this works rite and is all good? Something i'm wondering on though is whats the deal with the timerdialogdisplay to force and to player, player=show force all = dont show... should I maybe just change timerdialogdisplay(td,true) to false and take out the for force? Also the timer is being registered in a getexpiredtimerevent so am I destroying it too soon for that or is the wait time all good?
Spoiler:
Code: Select all
function Trig_Start_Timer_Func002Func004A takes nothing returns nothing
call TimerDialogDisplayForPlayerBJ(false,GetLastCreatedTimerDialogBJ(),GetEnumPlayer())
endfunction
function Trig_Start_Timer_Actions takes nothing returns nothing
local player p=GetOwningPlayer(GetTriggerUnit())
local integer i=GetPlayerId(p)
local timerdialog td=CreateTimerDialog(bj_crippledTimer[i+100])
if IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO)and p!=Player(0)and p!=Player(1)then
set udg_DeadHero[i]=GetTriggerUnit()
call TimerDialogSetTitle(td,"Revive:")
call TimerDialogDisplay(td,true)
call TimerStart(bj_crippledTimer[i+100],I2R(GetUnitLevel(GetTriggerUnit()))*5,false,null)
call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Start_Timer_Func002Func004A)
call TimerDialogDisplayForPlayerBJ(true,td,p)
set udg_Window[i]=td
endif
call TriggerSleepAction(I2R(GetUnitLevel(GetTriggerUnit()))*5+3)
call DestroyTimerDialog(td)
call DestroyTimer(bj_crippledTimer[i+100])
set td=null
set bj_crippledTimer[i+100]=null
set p=null
endfunction
function InitTrig_Start_Timer takes nothing returns nothing
set gg_trg_Start_Timer = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Start_Timer,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddAction(gg_trg_Start_Timer,function Trig_Start_Timer_Actions)
endfunction
function Trig_Revive3_Actions takes nothing returns nothing
local integer i=2
local location l=GetRectCenter(gg_rct_Dungeon)
local player p
loop
exitwhen i>11
set p=Player(i)
if GetExpiredTimer()==bj_crippledTimer[i+100]then
if IsPlayerInForce(p,fhumans)then
if GetUnitState(gg_unit_hcas_0000,UNIT_STATE_LIFE)>0then
call PanCameraToTimedLocForPlayer(p,human_city_center,0)
call ReviveHeroLoc(udg_DeadHero[i],human_city_center,true)
else
call PanCameraToTimedLocForPlayer(p,l,0)
call ReviveHeroLoc(udg_DeadHero[i],l,true)
endif
elseif IsPlayerInForce(p,forcs)then
if GetUnitState(gg_unit_ofrt_0001,UNIT_STATE_LIFE)>0then
call PanCameraToTimedLocForPlayer(p,orc_city_center,0)
call ReviveHeroLoc(udg_DeadHero[i],orc_city_center,true)
else
call PanCameraToTimedLocForPlayer(p,l,0)
call ReviveHeroLoc(udg_DeadHero[i],l,true)
endif
endif
call DestroyTimerDialog(udg_Window[i])
call SelectUnitForPlayerSingle(GetLastCreatedUnit(),p)
endif
set i=i+1
endloop
call RemoveLocation(l)
set l=null
endfunction
function InitTrig_Revive3 takes nothing returns nothing
local integer i=2
set gg_trg_Revive3=CreateTrigger()
loop
exitwhen i>11
call TriggerRegisterTimerExpireEvent(gg_trg_Revive3,bj_crippledTimer[i+100])
set i=i+1
endloop
call TriggerAddAction(gg_trg_Revive3,function Trig_Revive3_Actions)
endfunction