def questObjMod(quests, object, av, repository):
    for currQuestInt in quests:
        currId = QuestDB.getQuestIdFromQuestInt(currQuestInt)
        if currId:
            containerDNA = QuestDB.QuestDict.get(currId)
        else:
            containerDNA = QuestLadderDB.getContainerFromQuestInt(currQuestInt)
        questModInfo = containerDNA.getQuestMod()
        questObjId = None
        if questModInfo:
            questObjId = questModInfo[0]
        
        if questObjId in [
            object.getUniqueId(),
            object.getSpawnPosIndex()]:
            questInterestId = av.hasQuestNPCInterest(object.getUniqueId())
            if QuestLadderDB.questIntInHistory(currQuestInt, av.getQuestLadderHistory()):
                return questModInfo[3]
            elif questInterestId:
                questObj = repository.doId2do.get(questInterestId)
                if questObj and questObj.isComplete():
                    return questModInfo[3]
                
                return questModInfo[2]
            else:
                return questModInfo[1]
        QuestLadderDB.questIntInHistory(currQuestInt, av.getQuestLadderHistory())
def questObjMod(quests, object, av, repository):
    for currQuestInt in quests:
        currId = QuestDB.getQuestIdFromQuestInt(currQuestInt)
        if currId:
            containerDNA = QuestDB.QuestDict.get(currId)
        else:
            containerDNA = QuestLadderDB.getContainerFromQuestInt(currQuestInt)
        questModInfo = containerDNA.getQuestMod()
        questObjId = None
        if questModInfo:
            questObjId = questModInfo[0]

        if questObjId in [object.getUniqueId(), object.getSpawnPosIndex()]:
            questInterestId = av.hasQuestNPCInterest(object.getUniqueId())
            if QuestLadderDB.questIntInHistory(currQuestInt,
                                               av.getQuestLadderHistory()):
                return questModInfo[3]
            elif questInterestId:
                questObj = repository.doId2do.get(questInterestId)
                if questObj and questObj.isComplete():
                    return questModInfo[3]

                return questModInfo[2]
            else:
                return questModInfo[1]
        QuestLadderDB.questIntInHistory(currQuestInt,
                                        av.getQuestLadderHistory())
示例#3
0
def decodeSCQuestMsgInt(questInt, msgType, taskNum, taskState=None):
    qId = QuestDB.getQuestIdFromQuestInt(questInt)
    questDna = QuestDB.QuestDict[qId]
    if questDna is None:
        return None

    if msgType == 0:
        return questDna.getSCSummaryText(taskNum, taskState)
    elif msgType == 1:
        return questDna.getSCWhereIsText(taskNum)
    elif msgType == 2:
        return questDna.getSCHowToText(taskNum)
    else:
        return None
def decodeSCQuestMsgInt(questInt, msgType, taskNum, taskState = None):
    qId = QuestDB.getQuestIdFromQuestInt(questInt)
    questDna = QuestDB.QuestDict[qId]
    if questDna is None:
        return None
    
    if msgType == 0:
        return questDna.getSCSummaryText(taskNum, taskState)
    elif msgType == 1:
        return questDna.getSCWhereIsText(taskNum)
    elif msgType == 2:
        return questDna.getSCHowToText(taskNum)
    else:
        return None