Впервые здесь? Я Роха — провести быструю экскурсию?
Ошибка соединенияНеверный запросСтраница устарелаСессия истеклаТребуется входЗапрещеноНе найденоСлишком много запросовВнутренняя ошибка сервераПлохой шлюзСервис недоступенТайм-аут шлюзаВерсия HTTP не поддерживается
Сессия истекла
Ваша сессия истекла. Пожалуйста, войдите снова.
Требуется вход
Для этого нужна учётная запись. Войдите или создайте её — это займёт минуту.
Страница устарела
Токен безопасности отклонён — обычно потому, что страница была открыта слишком долго или вы вошли в систему в другом месте. Ничего не сохранено. Обновите страницу и повторите.
Запрос не выполнен
При обработке вашего запроса возникла проблема.
Проверьте подключение к интернету и попробуйте снова.
Доброго времени суток! Облазил форум, но такой проблемы не нашел: На двух разных мощных ноутах в случае, когда компьютерный союзник проигрывает (по прошествии 7 дней после потери им всех замков), игра виснет наглухо. То есть я завершаю ход, ходят соперники-ИИ и на последнем сопернике игра виснет. Иногда доходит до состояния "Идёт сохранение" Win7, Core i5, AMD Radeon 330. Повелители Орды.
MapScript.lua--Two Brothers version 1.0 by ****** -- --commented strings aren't work ='( -- path = GetMapDataPath() diff = GetDifficulty() enemy={PLAYER_3,PLAYER_4,PLAYER_5,PLAYER_6} enemy_town={} enemy_town[PLAYER_3]="p3town" enemy_town[PLAYER_4]="p4town" enemy_town[PLAYER_5]="p5town" enemy_town[PLAYER_6]="p6town"
doFile(path.."creature_table.lua")
--------------------------------------------- --Adventure Spells--------------------------- --------------------------------------------- function call_way(hero,object) local current=GetObjectOwner(hero) current=GetPlayerFilter (current) if know_call[hero]==1 then MessageBoxForPlayers(current,path.."adv_magic/known_refuse.txt") elseif GetHeroStat(hero,STAT_EXPERIENCE)>34141 then currenthero=hero if object=="light_way_teacher" then QuestionBoxForPlayers(current,path.."adv_magic/a_question.txt","give_light_ability",nil) elseif object=="dark_way_teacher" then QuestionBoxForPlayers(current,path.."adv_magic/d_question.txt","give_dark_ability",nil) end else MessageBoxForPlayers(current,path.."adv_magic/pitty_refuse.txt") end end
function haste_way(hero,object) local current=GetObjectOwner(hero) current=GetPlayerFilter (current) if know_haste[hero]==1 then MessageBoxForPlayers(current,path.."adv_magic/haste_refuse.txt") elseif GetHeroStat(hero,STAT_EXPERIENCE)>81977 then currenthero=hero QuestionBoxForPlayers(current,path.."adv_magic/haste_question.txt","give_haste",nil) else MessageBoxForPlayers(current,path.."adv_magic/haste_refuse.txt") end end
function give_light_ability() PlayVisualEffect("/Effects/_(Effect)/Spells/Bless.xdb#xpointer(/Effect)",currenthero) x,y,z=GetObjectPosition(currenthero) Play3DSound("/Sounds/_(Sound)/Spells/bless.xdb#xpointer(/Sound)", x,y,z) PlayObjectAnimation("light_way_teacher","happy",ONESHOT) ControlHeroCustomAbility(currenthero, CUSTOM_ABILITY_1, CUSTOM_ABILITY_ENABLED); know_call[currenthero]=1 MarkObjectAsVisited("light_way_teacher",currenthero) currenthero="" end
function give_dark_ability() PlayVisualEffect("/Effects/_(Effect)/Spells/DisruptingRay.xdb#xpointer(/Effect)",currenthero) local x,y,z=GetObjectPosition(currenthero) Play3DSound("/Sounds/_(Sound)/Spells/DisruptingRay.xdb#xpointer(/Sound)", x,y,z) PlayObjectAnimation("dark_way_teacher","speech_orator",ONESHOT) ControlHeroCustomAbility(currenthero, CUSTOM_ABILITY_2, CUSTOM_ABILITY_ENABLED); know_call[currenthero]=1 MarkObjectAsVisited("dark_way_teacher",currenthero) currenthero="" end
function give_haste() PlayVisualEffect("/Effects/_(Effect)/Spells/Haste.xdb#xpointer(/Effect)",currenthero) local x,y,z=GetObjectPosition(currenthero) Play3DSound("/Sounds/_(Sound)/Spells/Haste.xdb#xpointer(/Sound)", x,y,z) ControlHeroCustomAbility(currenthero, CUSTOM_ABILITY_3, CUSTOM_ABILITY_ENABLED); know_haste[currenthero]=1 MarkObjectAsVisited("dancer",currenthero) currenthero="" end
function call(hero, ability) if ability==CUSTOM_ABILITY_1 then SetObjectPosition(hero,4,62,0,3) temp=GetHeroStat(hero,STAT_MOVE_POINTS) ChangeHeroStat(hero,STAT_MOVE_POINTS,-temp) temp=GetHeroStat(hero,STAT_MANA_POINTS) ChangeHeroStat(hero,STAT_MANA_POINTS,-temp) for i=1,4 do AddResource(PLAYER_3) AddCreatures(3) AddExp(3) end elseif ability==CUSTOM_ABILITY_2 then SetObjectPosition(hero,113,48,1,3) SetStoppingRegions() elseif ability==CUSTOM_ABILITY_3 then temp=GetHeroStat(hero,STAT_MANA_POINTS) ChangeHeroStat(hero,STAT_MANA_POINTS,-temp) ChangeHeroStat(hero,STAT_MOVE_POINTS,10*temp) --elseif ability==CUSTOM_ABILITY_4 then -- RMP[hero]=GetHeroStat(hero,STAT_MOVE_POINTS)+RMP[hero] -- ChangeHeroStat(hero,STAT_MOVE_POINTS,-RMP[hero]) end end
--for i=1,2 do -- Heroes=GetPlayerHeroes(i) -- for j,hero in Heroes do -- give_wait(hero) -- end -- Trigger(PLAYER_ADD_HERO_TRIGGER, i, "give_wait") --end
Trigger(CUSTOM_ABILITY_TRIGGER, "call"); --------------------------------------------- --End Adventure Spells----------------------- --------------------------------------------- --Custom Temples----------------------------- --------------------------------------------- function imp_ask(hero,object) currenthero=hero local current=GetObjectOwner(hero) QuestionBoxForPlayers(current,path.."temples/imp_ask.txt","imp_battle",nil) end;
function imp_battle() local count={} for i=1,5 do count=(random(5)+1)*GetDate(DAY) end StartCombat(currenthero,nil,5,CREATURE_IMP,count[1],CREATURE_FAMILIAR,count[2],CREATURE_QUASIT,count[3],CREATURE_FAMILIAR,count[4],CREATURE_IMP,count[5],nil,"imp_result","/Scenes/CombatArenas/Lava_Citadel.(AdventureFlybyScene).xdb#xpointer(/AdventureFlybyScene)",nil) end
function imp_result(hero,isWin) if isWin then local count=(random(5)+1)*GetDate(DAY) count=sqrt(count) count=round(count) local side=GetObjectOwner(hero) count=GetPlayerResource(side,MERCURY)+count ShowFlyingSign(path.."temples/imp_fs.txt",hero,side,3) SetPlayerResource(side,MERCURY,count,hero) MarkObjectAsVisited("imp_temple",hero) Trigger(OBJECT_TOUCH_TRIGGER,"imp_temple","imp_refuse") end end
function imp_refuse(hero,object) local current=GetObjectOwner(hero) MessageBoxForPlayers(current,path.."temples/imp_refuse.txt") end
function cemetry_ask(hero,object) currenthero=hero local current=GetObjectOwner(hero) QuestionBoxForPlayers(current,path.."temples/cemetry_ask.txt","cemetry_battle",nil) end;
function cemetry_battle() local count=(random(5)+5)*10 StartCombat(currenthero,nil,2,CREATURE_SKELETON,co unt,CREATURE_SKELETON_ARCHER,count,nil,"cemetry_result",nil,nil) end
function cemetry_result(hero,isWin) if isWin then local count=(random(10)+1)*100 local side=GetObjectOwner(hero) count=GetPlayerResource(side,GOLD)+count ShowFlyingSign(path.."temples/cemetry_fs.txt",hero,side,3) SetPlayerResource(side,GOLD,count,hero) MarkObjectAsVisited("cemetry_temple",hero) Trigger(OBJECT_TOUCH_TRIGGER,"cemetry_temple","cemetry_refuse") end end
function cemetry_refuse(hero,object) local current=GetObjectOwner(hero) MessageBoxForPlayers(current,path.."temples/cemetry_refuse.txt") end
function arc_ask(hero,object) currenthero=hero local current=GetObjectOwner(hero) QuestionBoxForPlayers(current,path.."temples/arc_ask.txt","arc_battle",nil) end;
function arc_battle() local count={} for i=1,3 do count=(random(3)+2)*GetDate(DAY) end StartCombat(currenthero,nil,3,CREATURE_MARKSMAN,co unt[1],CREATURE_ARCHER,count[2],CREATURE_LONGBOWMAN,count[3],nil,"arc_result",nil,nil) end
function arc_result(hero,isWin) if isWin then local count=(random(3)+2)*100*GetDate(DAY) local side=GetObjectOwner(hero) count=GetPlayerResource(side,GOLD)+count ShowFlyingSign(path.."temples/arc_fs.txt",hero,side,3) SetPlayerResource(side,GOLD,count,hero) MarkObjectAsVisited("arc_tower",hero) Trigger(OBJECT_TOUCH_TRIGGER,"arc_tower","arc_refuse") end end
function arc_refuse(hero,object) local current=GetObjectOwner(hero) MessageBoxForPlayers(current,path.."temples/arc_refuse.txt") end
function cry_ask(hero,object) currenthero=hero local current=GetObjectOwner(hero) QuestionBoxForPlayers(current,path.."temples/cry_ask.txt","cry_battle",nil) end;
function cry_battle() local count={} for i=1,3 do count=(random(6)+2)+7*GetDate(WEEK) end StartCombat(currenthero,nil,3,CREATURE_POLTERGEIST ,count[1],CREATURE_POLTERGEIST,count[2],CREATURE_POLTERGEIST,count[3],nil,"cry_result",nil,nil) end
function cry_result(hero,isWin) if isWin then local count=(random(9)+2)+4*GetDate(WEEK) local side=GetObjectOwner(hero) count=GetPlayerResource(side,CRYSTAL)+count ShowFlyingSign(path.."temples/cry_fs.txt",hero,side,3) SetPlayerResource(side,CRYSTAL,count,hero) MarkObjectAsVisited("crystal",hero) Trigger(OBJECT_TOUCH_TRIGGER,"crystal","cry_refuse") end end
function cry_refuse(hero,object) local current=GetObjectOwner(hero) MessageBoxForPlayers(current,path.."temples/cry_refuse.txt") end
SetObjectEnabled("crystal",nil) Trigger(OBJECT_TOUCH_TRIGGER,"crystal","cry_ask") --------------------------------------------- --End Custom Temples------------------------- --------------------------------------------- --Gift Column-------------------------------- --------------------------------------------- function ask_gift(hero,object) currenthero=hero temp=GetObjectOwner(hero) current=temp if temp==PLAYER_1 then temp=PLAYER_2 elseif temp==PLAYER_2 then temp=PLAYER_1 end QuestionBoxForPlayers(current,path.."clons/gift_ask.txt","do_gift",nil) --twn="p"..temp.."town" --twn=enemy_town[temp] --print(temp) --print(twn) --local owner=GetObjectOwner(twn) --print(owner) --if owner==current then -- QuestionBoxForPlayers(current,path.."clons/return_ask.txt","return_town",nil) --end end
function do_gift() PlayVisualEffect("/Effects/_(Effect)/Spells/LightningBolt.xdb#xpointer(/Effect)","gift_col") local x,y,z=GetObjectPosition("gift_col") Play3DSound("/Sounds/_(Sound)/Spells/LightningBolt.xdb#xpointer(/Sound)", x,y,z) SetObjectOwner(currenthero,temp) end
--------------------------------------------- --End Gift Column---------------------------- --------------------------------------------- --Computer's help---------------------------- --------------------------------------------- function AddResource(player) if GetPlayerState(player)==PLAYER_ACTIVE then local temp=0 for i=0,1 do temp=GetPlayerResource(player,i) SetPlayerResource(player,i,temp+diff*20) end for i=2,5 do temp=GetPlayerResource(player,i) SetPlayerResource(player,i,temp+diff*10) end temp=GetPlayerResource(player,6) SetPlayerResource(player,6,temp+diff*10000) end end
function AddExp(player) if GetPlayerState(player)==PLAYER_ACTIVE then local heroes=GetPlayerHeroes(player) local count=GetDate(MONTH)*1000 for i,h in heroes do GiveExp(h,count) end end end
function AddCreatures(player) local owner=GetObjectOwner(enemy_town[player]) if owner==player then for i=1,7 do local bl=GetTownBuildingLevel(enemy_town[player],6+i) if bl~=0 then local race=GetPlayerRace(player) local creature=GetCreatureByData(race,i,1) local count=GetObjectDwellingCreatures(enemy_town[player],creature) SetObjectDwellingCreatures(enemy_town[player],creature,count+diff*(8-i)) end end end end
--------------------------------------------- --End Computer's help------------------------ --------------------------------------------- --New Day------------------------------------ --------------------------------------------- function NewDayF() for i=1,4 do AddExp(enemy) end local temp=GetDate(DAY_OF_WEEK) if temp==1 then for i=1,4 do AddResource(enemy) AddCreatures(enemy) end end temp=GetDate(DAY) if temp==2 then --do_test() end for i=1,6 do if temp==52-diff*12+5*i then object="entrance2"..i player=floor((12-i)/2) SetObjectEnabled(object,not nil) if GetPlayerState(player)==PLAYER_ACTIVE then SetAIPlayerAttractor(object,player,1) local x,y,f=GetObjectPosition(object) OpenCircleFog(x,y,f,5,player) end end end end
for i=1,6 do object="entrance2"..i SetObjectEnabled(object,nil) end
for i=3,6 do if GetPlayerState(i)==PLAYER_ACTIVE then SetAIPlayerAttractor("p1town",i,2) SetAIPlayerAttractor("p2town",i,2) end end
Trigger(NEW_DAY_TRIGGER,"NewDayF")
function Lost_check(player) while not nil do local state=GetPlayerState(player) if state==PLAYER_NOT_IN_GAME or state==PLAYER_LOST then local temp=player if temp==PLAYER_1 then temp=PLAYER_2 elseif temp==PLAYER_2 then temp=PLAYER_1 end Loose(temp) else sleep(1) end end end
for i=0,n_regions do reg="unnamed "..i Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER,reg,"DarkWayTrouble") region_free[reg]=not nil end
function SetStoppingRegions() local num=diff*2+2+random(5) print(num) for i=1,num do repeat reg="unnamed "..random(n_regions) until region_free[reg] region_free[reg]=nil print(reg) Trigger(REGION_ENTER_AND_STOP_TRIGGER,reg,"DarkWayPig") Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER,reg,nil) end for i=84,n_regions do local rnd=random(100)+1 if rnd<3 then reg="unnamed "..i region_free[reg]=nil Trigger(REGION_ENTER_AND_STOP_TRIGGER,reg,"GhostTrouble") Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER,reg,nil) end end end
function DarkWayTrouble(hero,region) local rnd=random(100)+1 if rnd<15 then local r1,r2=random(battle_length)+1,random(5)+1 GiveHeroBattleBonus(hero,battle_bonuses[r1],-r2) end end
function GhostTrouble(hero,region) local rnd=random(100)+1 reg=region if rnd<40 then temp=GetHeroStat(hero,STAT_MOVE_POINTS) ChangeHeroStat(hero,STAT_MOVE_POINTS,-temp) local side=GetObjectOwner(hero) ShowFlyingSign(path.."clons/mp_end.txt",hero,side,3) DarkWayBattleFinish(hero,nil) elseif rnd<70 then temp=GetHeroStat(hero,STAT_MANA_POINTS) ChangeHeroStat(hero,STAT_MANA_POINTS,-temp) local side=GetObjectOwner(hero) ShowFlyingSign(path.."clons/mana_end.txt",hero,side,3) DarkWayBattleFinish(hero,nil) else for k=1,7 do local r1,r2=random(3)+1,random(5)+11 creature[k]=GetCreatureByData(4,3,r1) count[k]=GetDate(WEEK)*r2 end StartCombat(hero,nil,7,creature[1],count[1],creature[2],count[2],creature[3],count[3],creature[4],count[4],creature[5],count[5],creature[6],count[6],creature[7],count[7],nil,"DarkWayBattleFinish",nil,nil) end end
function DarkWayPig(hero,region) local rnd=(random(100)+1) if rnd<95 then local creature={} local count={} for k=1,7 do local r1,r2=random(7)+1,random(3)+1 creature[k]=GetCreatureByData(4,r1,r2) count[k]=(15-r1*2)*GetDate(WEEK)*r2 end reg=region StartCombat(hero,nil,7,creature[1],count[1],creature[2],count[2],creature[3],count[3],creature[4],count[4],creature[5],count[5],creature[6],count[6],creature[7],count[7],nil,"DarkWayBattleFinish",nil,nil) else reg=region call(hero,CUSTOM_ABILITY_2) DarkWayBattleFinish(hero,nil) end end
function DarkWayBattleFinish(hero,isWin) region_free[reg]=not nil Trigger(REGION_ENTER_AND_STOP_TRIGGER ,reg,nil) Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER,reg,"DarkWayTrouble") end --------------------------------------------- --End Dark Way------------------------------- --------------------------------------------- --Portals------------------------------------ --------------------------------------------- Portal={} P_name={} for i=1,5 do Portal="portal"..i sleep(1) P_name=path.."portals/"..Portal..".txt" OverrideObjectTooltipNameAndDescription(Portal,P_name,"/Text/Game/Buildings/Monoliths/TwoWay-Description.txt") SetObjectEnabled(Portal,nil) Trigger(OBJECT_TOUCH_TRIGGER,Portal,"teleport_q") end
function teleport_q(hero,object) local side=GetObjectOwner(hero) currenthero=hero if (IsAIPlayer(side)==0) then TalkBoxForPlayers(side, "/Textures/SpellBook______2618/Spells/Spell_Teleport.xdb#xpointer(/Texture)", path.."portals/"..object..".txt", path.."portals/dialog.txt", path.."portals/down_message.txt", "teleport", 1, path.."portals/"..object..".txt", path.."portals/up_message.txt", 0, P_name[1], P_name[2], P_name[3], P_name[4], P_name[5]) else local n=1+random(5) teleport(side,n) end end
function teleport(player,choice) if choice>0 then local x,y,f=GetObjectPosition(Portal[choice]) SetObjectPosition(currenthero,x,y,f) end end --------------------------------------------- --End Portals-------------------------------- ---------------------------------------------
function do_test() enemy_town[PLAYER_1]="p1town" enemy_town[PLAYER_2]="p2town" local x,y,f=GetObjectPosition("gift_col") OpenCircleFog(x,y,f,100,1) OpenCircleFog(x,y,f,100,2) local x,y,f=GetObjectPosition("portal5") OpenCircleFog(x,y,f,100,1) OpenCircleFog(x,y,f,100,2)
for i=1,6 do print(i.." player testing") AddExp(i) AddResource(i) AddCreatures(i) end
for temp=1,60 do for i=1,6 do if temp==52-diff*12+5*i then object="entrance2"..i player=floor((12-i)/2) SetObjectEnabled(object,not nil) if GetPlayerState(player)==PLAYER_ACTIVE then SetAIPlayerAttractor(object,player,1) local x,y,f=GetObjectPosition(object) OpenCircleFog(x,y,f,5,player) end end end end end
function GetCreatureData(creature) for i=0,7 do for j=1,7 do for k=1,3 do if CreatureTable[j][k]==creature then return i,j,k end end end end end
function GetCreatureByData(race,level,update) if race~=nil then if level~=nil then if update~=nil then return CreatureTable[race][level][update] else return CreatureTable[race][level] end else return CreatureTable[race] end else return CreatureTable end end
function GetCreatureRace(creature) local x1,x2,x3=GetCreatureData(creature) return x1 end
function GetCreatureLevel(creature) local x1,x2,x3=GetCreatureData(creature) return x2 end
function GetCreatureUpdate(creature) local x1,x2,x3=GetCreatureData(creature) return x3 end
Я так понимаю, союзный игрок - PLAYER_2, и после его гибели цикл while работает вечно вхолостую... А это приводит как раз к той оишбке, что у вас! Хотя судя по скрипту, после этого игрок проигрывает...