NightFighter
offline
Опыт:
81Активность: |
SaveLoad
Кто сделает Load к моему Save,то получил выбранный приз ОоОоОоОо
function PlayerCharacter takes player p returns unit function RecalcHouses_f takes nothing returns nothing
set udg_RollItem=GetEnumItem() endfunction function RollPrepare takes nothing returns nothing
local integer i=1 set udg_RollItem=null call EnumItemsInRect(gg_rct_RollItems,null,function RecalcHouses_f) if udg_RollItem==null then return endif loop exitwhen i>12 if not IsPlayerOwnesItemType(Player(i-1),GetItemTypeId(udg_RollItem)) then call UnitAddAbility(udg_RollHouse[i],'A01D') else call UnitRemoveAbility(udg_RollHouse[i],'A01D') endif set i=i+1 endloop call DisplayTextToPlayer(GetLocalPlayer(),0,0,"Разыгрывается "+GetItemName(udg_RollItem)+".") endfunction function CreateRollItems_f takes nothing returns nothing
call CreateItemLoc(GetRandomItem(udg_LevelCompleted),GetRandomLocInRect(gg_rct_CreateItemsForRoll)) endfunction function CreateRollItems_t takes nothing returns nothing
local integer i=1 local integer maxroll=0 local integer pid=0 loop exitwhen i>12 if maxroll<udg_RollNumber[i] then set maxroll=udg_RollNumber[i] endif set i=i+1 endloop if maxroll>0 then set i=1 loop exitwhen i>12 if maxroll==udg_RollNumber[i] then if pid==0 then set pid=i else set i=1 loop exitwhen i>12 if maxroll==udg_RollNumber[i] then set udg_RollNumber[i]=GetRandomInt(maxroll+1,maxroll+100) endif set i=i+1 endloop call CreateRollItems_t() return endif endif set udg_RollNumber[i]=0 set i=i+1 endloop call DisplayTextToPlayer(GetLocalPlayer(),0,0,udg_ColoredName[pid]+" выигрывает "+GetItemName(udg_RollItem)+".") call SetItemPosition(udg_RollItem,GetRectCenterX(udg_ItemsRegion[pid]),GetRectCenterY(udg_ItemsRegion[pid])) else call RemoveItem(udg_RollItem) endif set udg_RollItem=null call RollPrepare() if udg_RollItem==null then set i=1 loop exitwhen i>12 call ShowUnitHide(udg_RollHouse[i]) set i=i+1 endloop call DestroyTimer(GetExpiredTimer()) endif endfunction function CreateRollItems takes nothing returns nothing
local timer t=CreateTimer() local integer i=1 call ForGroup(udg_Characters,function CreateRollItems_f) call PanCameraTo(GetRectCenterX(gg_rct_RollItems),GetRectCenterY(gg_rct_RollItems)) call PolledWait(20.) loop exitwhen i>12 call SetUnitOwner(udg_RollHouse[i],Player(i-1),true) if udg_FreshRunnerSymbol[i]==0 then call ShowUnitHide(udg_RollHouse[i]) endif set i=i+1 endloop call RollPrepare() if udg_RollItem==null then set i=1 loop exitwhen i>12 call ShowUnitHide(udg_RollHouse[i]) set i=i+1 endloop call DestroyTimer(t) else call TimerStart(t,10.,true,function CreateRollItems_t) endif set t=null endfunction function GetRunnerSymbols takes player p returns integer
local unit u=PlayerCharacter(p) local integer lvl=udg_LevelCompleted local integer i=GetHeroLevel(u)-4-4*lvl local real chance local integer ans=0 if i<0 then set i=0 endif set chance=100./(1.+I2R(R2I(i/4))) if GetRandomReal(0.,100.)<=chance then set ans=ans+1 endif if GetRandomReal(0.,100.)<=chance then set ans=ans+1 endif if GetRandomReal(0.,100.)<=chance then set ans=ans+1 endif if GetRandomReal(0.,100.)<=chance then set ans=ans+1 endif set u=null return ans endfunction function SymbolMessage takes string name,integer i returns nothing
if i==0 then return elseif i==1 then call DisplayTextToPlayer(GetLocalPlayer(),0.,0.,name+" получает 1 символ беглеца") elseif i==2 then call DisplayTextToPlayer(GetLocalPlayer(),0.,0.,name+" получает 2 символа беглеца") elseif i==3 then call DisplayTextToPlayer(GetLocalPlayer(),0.,0.,name+" получает 3 символа беглеца") elseif i==4 then call DisplayTextToPlayer(GetLocalPlayer(),0.,0.,name+" получает 4 символа беглеца") endif endfunction function Trig_EndRewards_Func001Func001A takes nothing returns nothing
if GetHeroLevel(PlayerCharacter(GetEnumPlayer())) == 1 then call DisplayTextToForce( GetForceOfPlayer(GetEnumPlayer()), "TRIGSTR_2024" ) endif endfunction function Trig_EndRewards_Func005A takes nothing returns nothing
call SetUnitPositionLoc( PlayerCharacter(GetEnumPlayer()), GetRectCenter(udg_ItemsRegion[GetConvertedPlayerId(GetEnumPlayer())]) ) call SetPlayerTechResearched(GetEnumPlayer(),'Rhgb',1) endfunction function Trig_EndRewards_Func006Func001A takes nothing returns nothing
if GetHeroLevel(PlayerCharacter(GetEnumPlayer()))<=2 then call DisplayTextToForce( GetForceOfPlayer(GetEnumPlayer()), "TRIGSTR_2025" ) endif endfunction function Trig_EndRewards_Actions takes nothing returns nothing
local unit u local integer i=1 local string name local player p local integer temp local integer s set i=1 loop exitwhen i>5 call ForForce(udg_Players, function Trig_EndRewards_Func001Func001A ) set i=i+1 endloop call DoNotSaveReplay() call TriggerSleepAction(10.) set i=1 loop exitwhen i>12 if IsUnitInGroup(PlayerCharacter(Player(i-1)),udg_Characters) then set u=PlayerCharacter(Player(i-1)) set name=udg_ColoredName[i] set p=Player(i-1) call SuspendHeroXP(u,false) call TriggerSleepAction(3.) if udg_QuestLevel[i]==udg_LevelCompleted-1 then set udg_QuestLevel[i]=udg_QuestLevel[i]+1 call DisplayTextToPlayer(GetLocalPlayer(),0.,0.,name+" не получает предмет.") call TriggerSleepAction(2.) call DisplayTextToPlayer(GetLocalPlayer(),0.,0.,name+" успешно прошел "+I2S(udg_LevelCompleted)+" уровень. Он сможет получить предметы на "+I2S(udg_LevelCompleted)+" уровне со следующей игры.") set udg_RunnerSymbol[i]=udg_RunnerSymbol[i]+10 call DisplayTextToPlayer(GetLocalPlayer(),0.,0.,name+" получает 10 символов беглеца") set udg_FreshRunnerSymbol[i]=10 else if udg_QuestLevel[i]>=udg_LevelCompleted then set temp=GetRandomReward(udg_LevelCompleted,p) call DisplayTextToForce(GetPlayersAll(),name+" получает "+GetItemName(CreateItem(temp,GetRectCenterX(udg_ItemsRegion[i]),GetRectCenterY(udg_ItemsRegion[i])))+".") set s=GetRunnerSymbols(p) call SymbolMessage(name,s) set udg_RunnerSymbol[i]=udg_RunnerSymbol[i]+s set udg_FreshRunnerSymbol[i]=s else call DisplayTextToPlayer(GetLocalPlayer(),0.,0., ( name + " даже не дошел до этого уровня." ) ) if GetRandomReal(0, 100.00)<=20.00 then call DisplayTextToPlayer(GetLocalPlayer(),0.,0., ( name + " не получает предмет." ) ) set udg_QuestLevel[i]=udg_QuestLevel[i]+1 call TriggerSleepAction(2.) call DisplayTextToPlayer(GetLocalPlayer(),0.,0., ( name + " - везунчик, и получил повышение своего квестового уровня." ) ) set udg_RunnerSymbol[i]=udg_RunnerSymbol[i]+10 call DisplayTextToPlayer(GetLocalPlayer(),0.,0.,name+" получает 10 символов беглеца") else set temp=GetRandomReward(udg_QuestLevel[i]+1,p) set udg_TempItem=CreateItem(temp,GetRectCenterX(udg_ItemsRegion[i]),GetRectCenterY(udg_ItemsRegion[i])) call DisplayTextToForce(GetPlayersAll(),name+" получает "+GetItemName(udg_TempItem)+" в виде компенсации.") set s=GetRunnerSymbols(p) call SymbolMessage(name,s) set udg_RunnerSymbol[i]=udg_RunnerSymbol[i]+s endif endif endif call SaveInteger(udg_h,GetHandleId(u),90,GetExpirienceAtLevel(GetHeroLevel(u),udg_LevelCompleted)) call TriggerSleepAction(2.) if GetHeroLevel(PlayerCharacter(p)) < udg_Const_CurMaxLevel then set temp=GetExpirienceAtLevel(GetHeroLevel(u),udg_LevelCompleted) call AddHeroXP(u,temp,true) call DisplayTextToPlayer(GetLocalPlayer(),0.,0.,name+" получает "+I2S(temp)+" единиц опыта.") else call DisplayTextToPlayer(GetLocalPlayer(),0.,0.,name+" достиг максимального уровня и не получает опыт.") endif if GetUnitAbilityLevel(u,UnbindSpell('A00O',1))>0 then call TriggerSleepAction(2.) if udg_Spell1[i]=='A00O' then set udg_Spell1LVL[i]=udg_Spell1LVL[i]-1 if udg_Spell1LVL[i] == 0 then set udg_Spell1[i] = 0 call UnitRemoveAbility(u,UnbindSpell('A00O',1)) call DisplayTextToPlayer(GetLocalPlayer(),0.,0.,name+" успешно что-то забыл.") else call SetUnitAbilityLevel(u,UnbindSpell('A00O',1),udg_Spell1LVL[i]) call DisplayTextToPlayer(GetLocalPlayer(),0.,0.,name+" еще будет что-то забывать в течение "+I2S(udg_Spell1LVL[i])+" игр.") endif elseif udg_Spell2[i] == UnbindSpell('A00O',2) then set udg_Spell2LVL[i]=udg_Spell2LVL[i]-1 if udg_Spell2LVL[i] == 0 then set udg_Spell2[i] = 0 call UnitRemoveAbility(u,UnbindSpell('A00O',2)) call DisplayTextToPlayer(GetLocalPlayer(),0.,0.,name+" успешно что-то забыл.") else call SetUnitAbilityLevel(u,UnbindSpell('A00O',2),udg_Spell2LVL[i]) call DisplayTextToPlayer(GetLocalPlayer(),0.,0.,name+" еще будет что-то забывать в течение "+I2S(udg_Spell2LVL[i])+" игр.") endif elseif udg_Spell3[i] == UnbindSpell('A00O',3) then set udg_Spell3LVL[i]=udg_Spell3LVL[i]-1 if udg_Spell3LVL[i]==0 then set udg_Spell3[i]=0 call UnitRemoveAbility(u,UnbindSpell('A00O',3)) call DisplayTextToPlayer(GetLocalPlayer(),0.,0.,name+" успешно что-то забыл.") else call SetUnitAbilityLevel(u,UnbindSpell('A00O',3),udg_Spell3LVL[i]) call DisplayTextToPlayer(GetLocalPlayer(),0.,0.,name+" еще будет что-то забывать в течение "+I2S(udg_Spell3LVL[i])+" игр.") endif elseif udg_Spell4[i]==UnbindSpell('A00O',4) then set udg_Spell4LVL[i]=udg_Spell4LVL[i]-1 if udg_Spell4LVL[i]==0 then set udg_Spell4[i]=0 call UnitRemoveAbility(u,UnbindSpell('A00O',4)) call DisplayTextToPlayer(GetLocalPlayer(),0.,0.,name+" успешно что-то забыл.") else call SetUnitAbilityLevel(u,UnbindSpell('A00O',4),udg_Spell4LVL[i]) call DisplayTextToPlayer(GetLocalPlayer(),0.,0.,name+" еще будет что-то забывать в течение "+I2S(udg_Spell4LVL[i])+" игр.") endif endif endif endif set i=i+1 endloop call ForForce( udg_Players, function Trig_EndRewards_Func005A ) set udg_LoopA=1 loop exitwhen udg_LoopA>5 call ForForce( udg_Players, function Trig_EndRewards_Func006Func001A ) set udg_LoopA=udg_LoopA+1 endloop call EnableTrigger( gg_trg_Dont_go_away ) call CreateRollItems() endfunction =========================================================================== function InitTrig_EndRewards takes nothing returns nothing set gg_trg_EndRewards = CreateTrigger( ) call TriggerAddAction( gg_trg_EndRewards, function Trig_EndRewards_Actions ) endfunction |
15.08.2010, 17:31 | #1
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
RazArt
offline
Опыт:
11,197Активность: |
А список призов узнать можно? + используем code...
|
15.08.2010, 17:54 | #2
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|