02-05-2011, 06:27 PM
Вот триггер из карты DotA v6.32 извлеченный товарисчами:
DimonT, NETRAT and TheBloodiest
учите жасс...
ВОТ собственно и сама мапа...
DimonT, NETRAT and TheBloodiest
код на JASS
Код:
function Trig_HeroSelection_Random_Conditions takes nothing returns boolean
if(udg_bA_DTAX_player_randomed[GetPlayerId(GetTriggerPlayer())])then
return false
endif
if(udg_b_DTAX_select_game_mode_time_elapsed==false)then
return false
endif
if(udg_uA_DTAX_player_hero_unit[GetPlayerId(GetTriggerPlayer())]!=null)then
return false
endif
return true
endfunction
function Trig_HeroSelection_Random_Actions takes nothing returns nothing
local player e00=GetTriggerPlayer()
local integer I44
local integer I55
local location iii
local integer EEE
if(IsPlayerInRedForce(e00))then
set I44=udg_i_DTAX_sentinel_heroes_array_start_pointer
set I55=udg_i_DTAX_sentinel_heroes_array_end_pointer
set iii=GetRectCenter(gg_rct_SentinelTavernsRect)
else
set I44=udg_i_DTAX_scourge_heroes_array_start_pointer
set I55=udg_i_DTAX_scourge_heroes_array_end_pointer
set iii=GetRectCenter(gg_rct_ScourgeTavernsRect)
endif
if((udg_b_DTAX_is_allpick_mode) or (udg_b_DTAX_is_allrandom_mode))then
if(GetRandomInt(1,2)==1)then
set I44=udg_i_DTAX_sentinel_heroes_array_start_pointer
set I55=udg_i_DTAX_sentinel_heroes_array_end_pointer
else
set I44=udg_i_DTAX_scourge_heroes_array_start_pointer
set I55=udg_i_DTAX_scourge_heroes_array_end_pointer
endif
endif
set udg_bA_DTAX_player_randomed[GetPlayerId(e00)]=true
call DisableAllHeroTypesForPlayer(e00)
if(udg_uA_DTAX_player_hero_unit[GetPlayerId(e00)]==null)then
loop
call PolledWait(.01)
set EEE=GetRandomInt(I44,I55)
if((udg_bA_DTAX_used_hero_types_SAME1[EEE]==false) and udg_uA_DTAX_player_hero_unit[GetPlayerId(e00)]==null)then
call DisableHeroTypeForAllPlayers(udg_iA_DTAX_all_hero_types[EEE])
call PolledWait(.01)
if(udg_bA_DTAX_used_hero_types_SAME1[EEE]==false)then
set udg_bA_DTAX_used_hero_types_SAME1[EEE]=true
set udg_uA_DTAX_player_hero_unit[GetPlayerId(e00)]=CreateUnitAtLoc(e00,udg_iA_DTAX_all_hero_types[EEE],iii,bj_UNIT_FACING)
endif
endif
exitwhen udg_uA_DTAX_player_hero_unit[GetPlayerId(e00)]!=null
endloop
endif
call RemoveLocation(iii)
endfunction
function StartTrigger_HeroSelection_Random takes nothing returns nothing
set gg_trg_HeroSelection_Random=CreateTrigger()
call TriggerRegisterPlayerChatEvent(gg_trg_HeroSelection_Random,udg_pA_DTAX_RedPlayers[1],"-random",true)
call TriggerRegisterPlayerChatEvent(gg_trg_HeroSelection_Random,udg_pA_DTAX_RedPlayers[2],"-random",true)
call TriggerRegisterPlayerChatEvent(gg_trg_HeroSelection_Random,udg_pA_DTAX_RedPlayers[3],"-random",true)
call TriggerRegisterPlayerChatEvent(gg_trg_HeroSelection_Random,udg_pA_DTAX_RedPlayers[4],"-random",true)
call TriggerRegisterPlayerChatEvent(gg_trg_HeroSelection_Random,udg_pA_DTAX_RedPlayers[5],"-random",true)
call TriggerRegisterPlayerChatEvent(gg_trg_HeroSelection_Random,udg_pA_DTAX_BluePlayers[1],"-random",true)
call TriggerRegisterPlayerChatEvent(gg_trg_HeroSelection_Random,udg_pA_DTAX_BluePlayers[2],"-random",true)
call TriggerRegisterPlayerChatEvent(gg_trg_HeroSelection_Random,udg_pA_DTAX_BluePlayers[3],"-random",true)
call TriggerRegisterPlayerChatEvent(gg_trg_HeroSelection_Random,udg_pA_DTAX_BluePlayers[4],"-random",true)
call TriggerRegisterPlayerChatEvent(gg_trg_HeroSelection_Random,udg_pA_DTAX_BluePlayers[5],"-random",true)
call TriggerAddCondition(gg_trg_HeroSelection_Random,Condition(function Trig_HeroSelection_Random_Conditions))
call TriggerAddAction(gg_trg_HeroSelection_Random,function Trig_HeroSelection_Random_Actions)
endfunction
function InitTrig_HeroSelection_Random takes nothing returns nothing
endfunction
ВОТ собственно и сама мапа...