|
楼主 |
发表于 2009-7-9 12:01:36
|
显示全部楼层
囧了..我新建了张新地图随机数就米问题的说...
但是原来的地图还是8行...
代码在这:
function Trig_PlayerHeros_Actions takes nothing returns nothing
local boolean array b
local integer i = 0
local integer j = 0
local integer r = 0
local unit lu = null
local player p
set udg_HeroList[1] = 'H002'
set udg_HeroList[2] = 'H00F'
set udg_HeroList[3] = 'H005'
set udg_HeroList[4] = 'H00I'
set udg_HeroList[5] = 'H00K'
set udg_HeroList[6] = 'H00N'
set udg_HeroList[7] = 'H00O'
set udg_HeroList[8] = 'H00R'
set udg_HeroList[9] = 'H00T'
set udg_HeroList[10] = 'H00V'
set udg_HeroList[11] = 'H00X'
set udg_HeroList[12] = 'H006'
set i = 1
loop
exitwhen i > udg_Max_Player
set p = NToP(i)
// if GetPlayerSlotState(p)==PLAYER_SLOT_STATE_PLAYING then
call AdjustPlayerStateBJ(GetRandomInt(200, 275), p,PLAYER_STATE_RESOURCE_GOLD)
// loop
set r = GetRandomInt(1,12)
// call Debug("R:"+I2S(r),5)
// exitwhen b[r]==false
// endloop
// set b[r] = true
call Debug("R="+I2S(r),5)
set lu = CreateUnit(p,udg_HeroList[r],GetLocationX(GetPlayerStartLocationLoc(p)),GetLocationY(GetPlayerStartLocationLoc(p)) ,90)
set udg_Heros = lu
call TriggerRegisterUnitEvent( gg_trg_Select_Unit2,lu, EVENT_UNIT_TARGET_IN_RANGE )
call SelectUnitForPlayerSingle(lu, p)
call StoreIntegerInUnit(lu,"SkillPoint",5)
call AdjustPlayerStateBJ( 15,p, PLAYER_STATE_RESOURCE_LUMBER )
set j = 1
loop
exitwhen j > 20
call ModifyHeroStat( GetRandomInt(0,2),lu,bj_MODIFYMETHOD_ADD,1)
set j = j + 1
endloop
// endif
set i = i + 1
endloop
endfunction
这触发是在地图初始化时执行的
R = RandomInt(1,12)
不管在什么情况下都是一样的序列...
囧了.. |
|