- Joined
- Sep 19, 2006
- Messages
- 152
I've been testing this map for a little while now, and I've noticed that my friend usually gets disconnected right around 10-15 seconds after the game begins. As close as I can tell, this trigger might be somehow involved:
Does anything stick out as obvious?
JASS:
function Every15Seconds_EnumAction01 takes nothing returns nothing
local item i = GetEnumItem ()
//
if GetItemUserData (i) == 200 then
call SetItemInvulnerable (i, true)
else
call SetWidgetLife (i, (GetWidgetLife (i) - 10.00))
endif
set i = null
endfunction
function Every15Seconds_Action02 takes nothing returns nothing
local timer t = GetExpiredTimer ()
local integer tJ = GetHandleId (t)
local hashtable tH = udg_MasterHash
local unit merc_unit = LoadUnitHandle (tH, tJ, 0)
local integer n = LoadInteger (tH, tJ, 1)
//
if n == 11 then
call PauseTimer (t)
call DestroyTimer (t)
call FlushChildHashtable (tH, tJ)
elseif (n / 2) * 2 == n then
call SetUnitVertexColor (merc_unit, 255, 255, 255, 255)
set n = n + 1
call SaveInteger (tH, tJ, 1, n)
else
call SetUnitVertexColor (merc_unit, 255, 0, 0, 255)
set n = n + 1
call SaveInteger (tH, tJ, 1, n)
endif
set merc_unit = null
set t = null
set tH = null
endfunction
function Every15Seconds_Action01 takes nothing returns nothing
local rect r = GetEntireMapRect()
local integer q = 1
local integer n
local integer n_2297 = bj_randDistID [2297]
local integer n_2298 = bj_randDistID [2298]
local integer n_1180
local unit hero_unit
local real hero_unitX
local real hero_unitY
local integer hero_unitD
local integer hero_unitZ
local unit merc_unit
local integer x
local timer t
local integer tJ
local hashtable tH
//
call EnumItemsInRect (r, null, function Every15Seconds_EnumAction01)
set r = null
loop
exitwhen q > 11
set hero_unit = bj_ghoul [q + 1000]
set hero_unitD = GetUnitUserData (hero_unit)
if n_2297 == q then
if bj_randDistID [q + 1180] == 1 and bj_randDistID [q + 1160] == 0 then
set hero_unitX = GetUnitX (hero_unit)
set hero_unitY = GetUnitY (hero_unit)
set merc_unit = CreateUnit (Player (q), 'nlv1', hero_unitX, hero_unitY, 0.00)
call UnitApplyTimedLife (merc_unit, 'BTLF', 30.00)
set merc_unit = null
endif
endif
set n_1180 = bj_randDistID [q + 1180]
if bj_randDistID [q + 1300] > 140000 and n_1180 == 1 then
call PingMinimapEx (GetUnitX (hero_unit), GetUnitY (hero_unit), 5.00, 0, 255, 0, false)
endif
if bj_randDistID [q + 2800] == 1 then
if bj_randDistID [q + 920] == 1 then
call IssueTargetOrder (hero_unit, "smart", gg_unit_nmra_0393)
endif
else
if GetRandomInt (1, 6) == 6 and bj_randDistID [q + 1620] > 0 and n_1180 == 1 then
set hero_unitZ = 0
loop
exitwhen hero_unitZ > 5
if GetItemTypeId (UnitItemInSlot (hero_unit, hero_unitZ)) == 'tst2' then // Gump's Footwear
call UnitRemoveItemFromSlot (hero_unit, hero_unitZ)
set hero_unitZ = 6
else
set hero_unitZ = hero_unitZ + 1
endif
endloop
endif
set n = bj_randDistID [q + 980]
if n > 0 then
set x = GetPlayerState (Player (q), PLAYER_STATE_RESOURCE_GOLD) - n
if x > -1 then
call SetPlayerState (Player (q), PLAYER_STATE_RESOURCE_GOLD, x)
else
set n = bj_randDistID [q + 1040] - 1
set bj_randDistID [q + 1040] = n
if n == 0 then
set bj_randDistID [q + 980] = -3
set merc_unit = bj_ghoul [q + 1020]
call AddUnitToStock (gg_unit_ntav_0199, GetUnitTypeId (merc_unit), 0, 1)
call RemoveUnit (merc_unit)
set merc_unit = null
set bj_ghoul [q + 1020] = null
set udg_UnitTypeHired [q] = 0
call DisplayTimedTextToPlayer (Player (q), 0.0, 0.0, 1.50, " |cffffcc00Your mercenary has abandoned you.|r")
else
set merc_unit = bj_ghoul [q + 1020]
set t = CreateTimer ()
set tJ = GetHandleId (t)
set tH = udg_MasterHash
call SaveUnitHandle (tH, tJ, 0, merc_unit)
call SaveInteger (tH, tJ, 1, 1)
call TimerStart (t, 0.50, true, function Every15Seconds_Action02)
set t = null
set tH = null
endif
endif
endif
endif
set q = q + 1
endloop
set hero_unit = null
set merc_unit = null
endfunction
function InitTrig_Every15Seconds takes nothing returns nothing
set gg_trg_Every15Seconds = CreateTrigger ()
call TriggerAddAction (gg_trg_Every15Seconds, function Every15Seconds_Action01)
endfunction
Does anything stick out as obvious?
Last edited by a moderator: