|
为什么我这个多人使用的多面板一旦数据改变就会让其他人掉线?!
[codes=jass]function Trig_Hero_Multiboard_Actions takes unit u returns nothing
local multiboard mb = CreateMultiboard()
local integer i = 0
call MultiboardSetTitleText(mb, "属性面板")
call MultiboardSetTitleTextColor(mb, 55, 204, 251, 255)
call MultiboardSetRowCount(mb, 14)
call MultiboardSetColumnCount(mb, 4)
call MultiboardSetItemValue( MultiboardGetItem(mb, 0, 0), "|cffffcc00除掉怪物数|r" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 1, 0), "普通树精" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 1, 1), "0")
call MultiboardSetItemValue( MultiboardGetItem(mb, 1, 2), "荣誉击杀")
call MultiboardSetItemValue( MultiboardGetItem(mb, 1, 3), "0")
call MultiboardSetItemValue( MultiboardGetItem(mb, 2, 0), "精英树精" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 2, 1), "0" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 2, 2), "荣誉击杀" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 2, 3), "0" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 3, 0), "树人领主" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 3, 1), "0" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 4, 0), "古树领主" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 4, 1), "0" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 4, 2), "|cffffcc00物品爆率|r" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 4, 3), "0.00%" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 6, 0), "|cffffcc00获得称号|r" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 7, 0), "-未获得" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 7, 1), "-未获得" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 7, 2), "-未获得" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 7, 3), "-未获得" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 8, 0), "-未获得" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 8, 1), "-未获得" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 8, 2), "-未获得" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 8, 3), "-未获得" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 9, 0), "-未获得" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 9, 1), "-未获得" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 9, 2), "-未获得" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 9, 3), "-未获得" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 11, 0), "|cffffcc00开启宝箱数|r" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 11, 1), "0" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 13, 0), "|cffff0000荣誉点|r" )
call MultiboardSetItemValue( MultiboardGetItem(mb, 13, 1), "0" )
call MultiboardSetItemsStyle(mb, true, false)
loop
exitwhen i > 13
call MultiboardSetItemWidth( MultiboardGetItem(mb, i, 0), 0.04 )
call MultiboardSetItemWidth( MultiboardGetItem(mb, i, 1), 0.04 )
call MultiboardSetItemWidth( MultiboardGetItem(mb, i, 2), 0.04 )
call MultiboardSetItemWidth( MultiboardGetItem(mb, i, 3), 0.04 )
set i = i + 1
endloop
if GetOwningPlayer(u) == GetLocalPlayer() then
call MultiboardDisplay(mb, true)
call StoreInteger(udg_GC, I2S(H2I(u)), "multiboard", H2I(mb))
endif
endfunction[/codes]
这里一变化数据之后马上就全部都掉线了 除了主机
[codes=jass]function Trig_Multiboard_Conditions takes nothing returns boolean
return IsUnitType(GetDyingUnit(), UNIT_TYPE_ANCIENT) == false
endfunction
function Trig_Multiboard_Actions takes nothing returns nothing
local unit ut = GetKillingUnit()
local unit us = GetDyingUnit()
local multiboard mb = null
local integer trunk
local integer kill_com
local integer kill_imp
local integer kill_boss_com
local integer kill_boss_imp
local integer i = 0
loop
exitwhen i > 4
if GetUnitTypeId(us) == udg_Item_AllTrunk_UnitsType then
if GetOwningPlayer(ut) == GetLocalPlayer() then
set mb = I2Mb(GetStoredInteger(udg_GC, I2S(H2I(ut)), "multiboard"))
set trunk = GetStoredInteger(udg_GC, I2S(H2I(ut)), "trunk") + 1
call MultiboardSetItemValue( MultiboardGetItem(mb, 11, 1), I2S(trunk))
call StoreInteger(udg_GC, I2S(H2I(ut)), "trunk", trunk)
endif
endif
set i = i + 1
endloop
set i = 0
loop
exitwhen i > 2
if GetUnitTypeId(us) == udg_Multiboard_Units then
if GetOwningPlayer(ut) == GetLocalPlayer() then
set mb = I2Mb(GetStoredInteger(udg_GC, I2S(H2I(ut)), "multiboard"))
set kill_com = GetStoredInteger(udg_GC, I2S(H2I(ut)), "kill_com") + 1
call MultiboardSetItemValue( MultiboardGetItem(mb, 1, 1), I2S(kill_com))
call StoreInteger(udg_GC, I2S(H2I(ut)), "kill_com", kill_com)
endif
endif
set i = i + 1
endloop
set i = 3
loop
exitwhen i > 6
if GetUnitTypeId(us) == udg_Multiboard_Units then
if GetOwningPlayer(ut) == GetLocalPlayer() then
set mb = I2Mb(GetStoredInteger(udg_GC, I2S(H2I(ut)), "multiboard"))
set kill_imp = GetStoredInteger(udg_GC, I2S(H2I(ut)), "kill_imp") + 1
call MultiboardSetItemValue( MultiboardGetItem(mb, 2, 1), I2S(kill_imp))
call StoreInteger(udg_GC, I2S(H2I(ut)), "kill_imp", kill_imp)
endif
endif
set i = i + 1
endloop
set i = 7
loop
exitwhen i > 10
if GetUnitTypeId(us) == udg_Multiboard_Units then
if GetOwningPlayer(ut) == GetLocalPlayer() then
set mb = I2Mb(GetStoredInteger(udg_GC, I2S(H2I(ut)), "multiboard"))
set kill_boss_com = GetStoredInteger(udg_GC, I2S(H2I(ut)), "kill_boss_com") + 1
call MultiboardSetItemValue( MultiboardGetItem(mb, 3, 1), I2S(kill_boss_com))
call StoreInteger(udg_GC, I2S(H2I(ut)), "kill_boss_com", kill_boss_com)
endif
endif
set i = i + 1
endloop
set i = 11
loop
exitwhen i > 16
if GetUnitTypeId(us) == udg_Multiboard_Units then
if GetOwningPlayer(ut) == GetLocalPlayer() then
set mb = I2Mb(GetStoredInteger(udg_GC, I2S(H2I(ut)), "multiboard"))
set kill_boss_imp = GetStoredInteger(udg_GC, I2S(H2I(ut)), "kill_boss_imp") + 1
call MultiboardSetItemValue( MultiboardGetItem(mb, 4, 1), I2S(kill_boss_imp))
call StoreInteger(udg_GC, I2S(H2I(ut)), "kill_boss_imp", kill_boss_imp)
endif
endif
set i = i + 1
endloop
set mb = null
set ut = null
set us = null
endfunction
//===========================================================================
function InitTrig_Hero_Multiboard takes nothing returns nothing
set gg_trg_Hero_Multiboard = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hero_Multiboard, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Hero_Multiboard, Condition( function Trig_Multiboard_Conditions ) )
call TriggerAddAction( gg_trg_Hero_Multiboard, function Trig_Multiboard_Actions )
endfunction[/codes] |
|