def add_potapovquest(): debugs('Статус обратотки: %s' % (BigWorld.PQPotapovCalled)) QuestInProgressed = None if BigWorld.PQPotapovCalled == 'Start': for season in g_eventsCache.potapov.getSeasons(): for quest in g_eventsCache.potapov.getSeasons()[season].getTiles( ).itervalues(): for k in quest.getInProgressQuests(): QuestInProgressed = True break if QuestInProgressed == True: BigWorld.PQPotapovCalled == 'DeletePotapovQuest' debugs('0 Статус обратотки: %s' % (BigWorld.PQPotapovCalled)) if g_eventsCache.questsProgress.getPotapovQuestsFreeSlots( ) > 0 and BigWorld.PQPotapovCalled != 'DeletePotapovQuest': if (len(BigWorld.PQActivedQuest) + len(BigWorld.PQNewQuest)) > 0: BigWorld.PQPotapovCalled = 'ActivateNewPotapovQuest' debugs('1 Статус обратотки: %s' % (BigWorld.PQPotapovCalled)) else: debugs('Лист задач полон!') if BigWorld.PQPotapovCalled == 'DeletePotapovQuest': myProcessor = Processor() BigWorld.player().selectPotapovQuests( [], lambda code, errStr: myProcessor._response( code, debugs, errStr=errStr)) debugs('Старые задачи Очищены') BigWorld.PQPotapovCalled = 'PotapovQuestDeleted' debugs('Статус обратотки: %s' % (BigWorld.PQPotapovCalled)) BigWorld.callback(0.2, add_potapovquest) if BigWorld.PQPotapovCalled == 'PotapovQuestDeleted': if g_eventsCache.questsProgress.getPotapovQuestsFreeSlots() > 0: if (len(BigWorld.PQActivedQuest) + len(BigWorld.PQNewQuest)) > 0: BigWorld.PQPotapovCalled = 'ActivateNewPotapovQuest' debugs('Статус обратотки: %s' % (BigWorld.PQPotapovCalled)) if BigWorld.PQPotapovCalled == 'ActivateNewPotapovQuest': myProcessor = Processor() BigWorld.player().selectPotapovQuests( BigWorld.PQActiveList, lambda code, errStr: myProcessor._response( code, debugs, errStr=errStr)) debugs('Активированы задачи:%s' % (BigWorld.PQActiveList)) BigWorld.PQPotapovCalled = 'Done' debugs('Статус обратотки: %s' % (BigWorld.PQPotapovCalled)) BigWorld.callback(0.2, add_potapovquest) if BigWorld.PQPotapovCalled == 'Done': if g_currentVehicle.isPresent(): try: if BigWorld.vehicle_exp_extended_settings[ 'TankopytParamsself']: vDescr = g_currentVehicle.item.descriptor BigWorld.vehicle_exp_extended_settings[ 'TankopytParamsself']._update(vDescr) g_currentVehicle.onChanged() except: debugs('Ошибка TankopytParamsself: ') g_currentVehicle.onChanged()
def add_potapovquest(): debugs('Статус обратотки: %s' %( BigWorld.PQPotapovCalled)) QuestInProgressed = None if BigWorld.PQPotapovCalled == 'Start': for season in g_eventsCache.potapov.getSeasons(): for quest in g_eventsCache.potapov.getSeasons()[season].getTiles().itervalues(): for k in quest.getInProgressQuests(): QuestInProgressed = True break if QuestInProgressed == True: BigWorld.PQPotapovCalled == 'DeletePotapovQuest' debugs('0 Статус обратотки: %s' %( BigWorld.PQPotapovCalled)) if g_eventsCache.questsProgress.getPotapovQuestsFreeSlots()>0 and BigWorld.PQPotapovCalled != 'DeletePotapovQuest': if (len(BigWorld.PQActivedQuest) + len(BigWorld.PQNewQuest)) > 0: BigWorld.PQPotapovCalled = 'ActivateNewPotapovQuest' debugs('1 Статус обратотки: %s' %( BigWorld.PQPotapovCalled)) else: debugs('Лист задач полон!') if BigWorld.PQPotapovCalled == 'DeletePotapovQuest': myProcessor = Processor() BigWorld.player().selectPotapovQuests([], lambda code, errStr: myProcessor._response(code, debugs, errStr=errStr)) debugs('Старые задачи Очищены') BigWorld.PQPotapovCalled = 'PotapovQuestDeleted' debugs('Статус обратотки: %s' %( BigWorld.PQPotapovCalled)) BigWorld.callback(0.2, add_potapovquest) if BigWorld.PQPotapovCalled == 'PotapovQuestDeleted': if g_eventsCache.questsProgress.getPotapovQuestsFreeSlots()>0: if (len(BigWorld.PQActivedQuest) + len(BigWorld.PQNewQuest)) > 0: BigWorld.PQPotapovCalled = 'ActivateNewPotapovQuest' debugs('Статус обратотки: %s' %( BigWorld.PQPotapovCalled)) if BigWorld.PQPotapovCalled == 'ActivateNewPotapovQuest': myProcessor = Processor() BigWorld.player().selectPotapovQuests(BigWorld.PQActiveList, lambda code, errStr: myProcessor._response(code, debugs, errStr=errStr)) debugs('Активированы задачи:%s' %( BigWorld.PQActiveList)) BigWorld.PQPotapovCalled = 'Done' debugs('Статус обратотки: %s' %( BigWorld.PQPotapovCalled)) BigWorld.callback(0.2, add_potapovquest) if BigWorld.PQPotapovCalled == 'Done': if g_currentVehicle.isPresent(): try: if BigWorld.vehicle_exp_extended_settings['TankopytParamsself']: vDescr = g_currentVehicle.item.descriptor BigWorld.vehicle_exp_extended_settings['TankopytParamsself']._update(vDescr) g_currentVehicle.onChanged() except: debugs('Ошибка TankopytParamsself: ') g_currentVehicle.onChanged()
def doChanges_ignore_mode(): if g_currentVehicle.isPresent(): XML = ResMgr.openSection('scripts/client/mods/quests_extended.xml', True) if BigWorld.PQtilesQuestEnded == True: BigWorld.PQtilesQuestEnded = False XML['setup'].writeBool('IgnoringFinishedSeries' , False) XML.save() else: BigWorld.PQtilesQuestEnded = True XML['setup'].writeBool('IgnoringFinishedSeries' , True) XML.save() try: if BigWorld.vehicle_exp_extended_settings['TankopytParamsself']: vDescr = g_currentVehicle.item.descriptor BigWorld.vehicle_exp_extended_settings['TankopytParamsself']._update(vDescr) g_currentVehicle.onChanged() except: debugs('Ошибка 1 TankopytParamsself: ')
def doChanges_ignore_mode(): if g_currentVehicle.isPresent(): XML = ResMgr.openSection('scripts/client/mods/quests_extended.xml', True) if BigWorld.PQtilesQuestEnded == True: BigWorld.PQtilesQuestEnded = False XML['setup'].writeBool('IgnoringFinishedSeries', False) XML.save() else: BigWorld.PQtilesQuestEnded = True XML['setup'].writeBool('IgnoringFinishedSeries', True) XML.save() try: if BigWorld.vehicle_exp_extended_settings['TankopytParamsself']: vDescr = g_currentVehicle.item.descriptor BigWorld.vehicle_exp_extended_settings[ 'TankopytParamsself']._update(vDescr) g_currentVehicle.onChanged() except: debugs('Ошибка 1 TankopytParamsself: ')