def doWhenPracticeFinsihed(self, attrs):
        '''当修炼结束时'''
        id = self._owner.baseInfo.id
        practiceRecord = dbaccess.getPlayerPracticeRecord(id)
        monsterId = practiceRecord[2]
        countHit = practiceRecord[3]
        finishTime = practiceRecord[5]
        now = datetime.datetime.now()

        if not finishTime or (finishTime - now).seconds < 0:
            return
        self._owner.level.setExp(attrs['exp'])
        if not self._owner.level.updateLevel():
            dbaccess.updatePlayerInfo(id, attrs)
        self._owner.baseInfo.setStatus(1)

        npc = loader.getById('npc', monsterId, '*')
        if npc:
#            item = None
            for i in range(0, countHit):
                self._owner.quest.onSuccessKillOneMonster(monsterId)
            
            self.placePracticeItems(countHit, npc)

        pushMessage(str(id), 'finish')
    def sellAllTempPackage(self):
        '''卖出临时包裹中所有物品'''
        id = self._owner.baseInfo.id
        coin = self._owner.finance.getCoin()
        cannotSellCount = 0
        itemSoldPosition = []
        items = self._tempPackage.getItems()
        if len(items) == 0:
            return {'result':False, 'reason':u'您的临时包裹中没有物品'}
        for item in items:
            itemComponent = item[1]
            trade = int(itemComponent.baseInfo.getItemTemplate()['trade'])
            if trade >= 4:
                cannotSellCount += 1
                continue
            sellPrice = itemComponent.finance.getPrice()
            coin += sellPrice
            dbaccess.deleteItemsInTemPackage(itemComponent.baseInfo.id, itemComponent.baseInfo.getIdInPackage(),id)
            itemSoldPosition.append(item[0])
#            items.remove(item)
        dbaccess.updatePlayerInfo(id, {'coin':coin})
        self.setTempPackage()
#        coin += self._owner.finance.getCoin()
        self._owner.finance.setCoin(coin)
        result = dbaccess.getPlayerItemsInTempPackage(self._owner.baseInfo.id)
        if not result:
            pushMessage(str(self._owner.baseInfo.id), 'closeTempPackage')
        return {'result':True, 'coin':coin, 'itemSoldPosition':itemSoldPosition, 'cannotSellCount':cannotSellCount}
Exemplo n.º 3
0
    def _finishActiveRewardQuest(self, templateId):
        '''在赏金组织内提交完成赏金任务'''
        id = self._owner.baseInfo.id

        questRecord = dbaccess.getQuestByTemplateId(id, templateId)
        if not questRecord:
            return
        questId = questRecord[0]
        dbaccess.operateForCommitQuest(questId,id)
        dbaccess.updateTempActiveRewardQuestByQuestTemplateId(templateId, id, {'isFinish':1, 'isLock':0})

        pushMessage(str(self._owner.baseInfo.id), 'questFinish');

        questBonus = loader.getById('quest_template', templateId, ['coinBonus', 'expBonus'])
        coin = self._owner.finance.getCoin() + questBonus['coinBonus']
        self._owner.finance.setCoin(coin)
        exp = self._owner.level.getExp() + questBonus['expBonus']
        self._owner.level.setExp(exp)
        self._owner.level.updateLevel()
        record = dbaccess.getQuestRecordById(questId)
        if record[6] <> -1:
            item = dbaccess.getItemInfo(record[6])
            self._owner.pack.putOneItemIntoTempPackage(item)
            pushMessage(str(self._owner.baseInfo.id), 'newTempPackage')
        self._owner.pack.setTempPackage()
        self._owner.pack.setPackage()
        self.setProgressingQuests()
Exemplo n.º 4
0
    def doWhenPracticeFinsihed(self, attrs):
        '''当修炼结束时'''
        id = self._owner.baseInfo.id
        practiceRecord = dbaccess.getPlayerPracticeRecord(id)
        monsterId = practiceRecord[2]
        countHit = practiceRecord[3]
        finishTime = practiceRecord[5]
        now = datetime.datetime.now()

        if not finishTime or (finishTime - now).seconds < 0:
            return
        self._owner.level.setExp(attrs['exp'])
        if not self._owner.level.updateLevel():
            dbaccess.updatePlayerInfo(id, attrs)
        self._owner.baseInfo.setStatus(1)

        npc = loader.getById('npc', monsterId, '*')
        if npc:
            #            item = None
            for i in range(0, countHit):
                self._owner.quest.onSuccessKillOneMonster(monsterId)

            self.placePracticeItems(countHit, npc)

        pushMessage(str(id), 'finish')
 def addMail(self, senderId, receiverId, type, content, systemType, reference):
     sendTime = datetime.datetime.now()
     props = [0, senderId, receiverId, type, content, 0, str(sendTime), systemType, reference]
     result = dbaccess.insertMail(props);
     if result:
         pushMessage(str(receiverId), 'newMail')
     return True
Exemplo n.º 6
0
    def refreshActiveRewardQuestList(self, npcId,type):
        '''刷新赏金任务'''  
        self._callBol = True
        id = self._owner.baseInfo.id

        templateIdList, sequenceList = dbaccess.deleteUnLockedActiveRewardQuests(id)
        recievableList = list(self.getAllRecievableRewardQuestList(npcId))

        import random
        count = self.TEMPACTIVEQUESTCOUNT - len(templateIdList)
        i = 0
        while(True):
            if i == count:
                break
            r = random.randint(0, len(recievableList) - 1)
            if recievableList[r]['id'] in templateIdList:
                continue
            insertProps = [0, id, recievableList[r]['id'], 0, str(datetime.datetime.now()), 0, sequenceList[i]]
            dbaccess.insertActiveRewardQuest(insertProps)
            templateIdList.append(recievableList[r]['id'])
            i += 1

#        dbaccess.updatePlayerEnterQuestRoomTime(id, (datetime.datetime.now()))
        if type:
            pushMessage(str(self._owner.baseInfo.id), 'restFinish')

        currentList = self.getFixedRewardQuestList(npcId)
        progressingList = self.getProgressingQuestsGroupByType()

        return currentList, progressingList
 def getItemsInPackage(self):
     '''获取玩家包裹栏中所有物品详细信息'''
     items = self._package.getItems()
     result = dbaccess.getPlayerItemsInTempPackage(self._owner.baseInfo.id)
     if result:
         pushMessage(str(self._owner.baseInfo.id), 'tempPackage')
     else:
         pushMessage(str(self._owner.baseInfo.id), 'closeTempPackage')
     return self.getPackageItemDetails(items)
Exemplo n.º 8
0
 def addMail(self, senderId, receiverId, type, content, systemType,
             reference):
     sendTime = datetime.datetime.now()
     props = [
         0, senderId, receiverId, type, content, 0,
         str(sendTime), systemType, reference
     ]
     result = dbaccess.insertMail(props)
     if result:
         pushMessage(str(receiverId), 'newMail')
     return True
Exemplo n.º 9
0
    def onSuccessKillOneMonster(self, monsterId, type = 'battle'):
        '''当成功杀死怪物,计算任务目标结果'''
        id = self._owner.baseInfo.id
        item = None
        self._owner.pack.setTempPackage()
        self._owner.pack.setPackage()
        progressingQuestList = self.getProgressingRecordList()
        for quest in progressingQuestList:
            for details in quest['progressesDetails']:
                if details['npcInfo']['id'] == monsterId:
                    if details['killCount'] > 0:#杀怪
                        details['currentKillCount'] += 1
                        if details['currentKillCount'] > details['killCount']:
                            details['currentKillCount'] = details['killCount']
                        dbaccess.updateQuestgoalProgress(quest['id'], details['questgoalId'], \
                                                          {'killMonsterCount':details['currentKillCount']})

                    if details['itemCount'] > 0:#收集
                        if type == 'battle':
                            itemTemplateId = loader.getById('questgoal', details['questgoalId'], ['itemId'])['itemId']
                            if itemTemplateId <> -1:
                                queryResult = dbaccess.getItemInfoByTemplateId(itemTemplateId, id)
                                if queryResult and len(queryResult) > 0:#玩家身上有该物品,为了后面的叠加
                                    item = queryResult[0]
                                    packageInfo = dbaccess.getItemInPackageByItemId(id, item[0])
                                    if packageInfo:#物品在包裹栏中
                                        dbaccess.updateItemAttrsInPackages('package', packageInfo[0], {'stack':packageInfo[4] + 1})
                                        self._owner.pack.setPackage()
                                    else:
                                        packageInfo = dbaccess.getItemInTempPackageByItemId(id, item[0])
                                        if packageInfo:
                                            dbaccess.updateItemAttrsInPackages('temporary_package', packageInfo[0], {'stack':packageInfo[4] + 1})
                                    self._owner.pack.setTempPackage()
#                                    details['currentCollectCount'] += 1
                                else:
                                    ret = self._owner.pack._tempPackage.isTempPackageFull()
                                    if not ret[0]:
                                        dbaccess.insertItemRecord([0, id, itemTemplateId, '-1', '-1', 0, 1])
                                        item = dbaccess.getLastInsertItemInfo()
                                        if item and len(item) > 0:
                                            self._owner.pack.putOneItemIntoTempPackage(item)
                                            pushMessage(str(self._owner.baseInfo.id), 'newTempPackage')
                                            self._owner.pack.setTempPackage()
                        else:
                            pass

#                        if details['currentCollectCount']>details['itemCount']:
#                            details['currentCollectCount']=details['itemCount']
#                        dbaccess.updateQuestgoalProgress(quest['id'], details['questgoalId'],\
#                                                          {'collectItemCount':details['currentCollectCount']})

        self.setProgressingQuests()
        return item
Exemplo n.º 10
0
 def placePracticeItems(self, countHit, monster):
     '''放置修炼掉落的物品'''
     #        self._owner.pack.setTempPackage()
     #        ret = self._owner.pack._tempPackage.isTempPackageFull()
     #        if not ret[0]:
     for i in range(0, countHit):
         dropConfigId = self._owner.dropping.getDropConfigOnNpc(monster)
         item = self._owner.dropping.getItemByDropping(dropConfigId)[0]
         if item:
             self._owner.pack.putOneItemIntoTempPackage(item)
             pushMessage(str(self._owner.baseInfo.id), 'newTempPackage')
             self._owner.pack.setTempPackage()
    def placePracticeItems(self, countHit, monster):
        '''放置修炼掉落的物品'''
#        self._owner.pack.setTempPackage()
#        ret = self._owner.pack._tempPackage.isTempPackageFull()
#        if not ret[0]:
        for i in range(0, countHit):
            dropConfigId = self._owner.dropping.getDropConfigOnNpc(monster)
            item = self._owner.dropping.getItemByDropping(dropConfigId)[0]
            if item:
                self._owner.pack.putOneItemIntoTempPackage(item)
                pushMessage(str(self._owner.baseInfo.id),'newTempPackage')
                self._owner.pack.setTempPackage()
Exemplo n.º 12
0
    def commitQuest(self, questId):
        '''提交任务'''
        id = self._owner.baseInfo.id

        questTemlateId = dbaccess.getQuestTemplateByQuestId(questId)
        result = self.isSatifyProgressingQuestGoals(questTemlateId)
        if not result:
            return {'result':result, 'reason':u'该任务尚未达到目标,不能完成'}
        #收集型删除任务物品
        questgoals = loader.get('questgoal', 'questId', questTemlateId, ['itemId', 'itemCount'])
        for questgoal in questgoals:
            if questgoal['itemCount'] > 0:
                dbaccess.deleteCollectionQuestItems(questgoal['itemId'], id, questgoal['itemCount'])

        dbaccess.operateForCommitQuest(questId,id)

        record = dbaccess.getQuestRecordById(questId)
        templateInfo = loader.getById('quest_template', record[1], ['coinBonus', 'type', 'expBonus'])
        coin = self._owner.finance.getCoin() + templateInfo['coinBonus']
        exp = self._owner.level.getExp() + templateInfo['expBonus']
        self._owner.finance.setCoin(coin)
        self._owner.level.setExp(exp)
        professionStage = int(self._owner.profession.getProfessionStage())
        attrs = {'coin':coin, 'exp':exp}
        if templateInfo['type'] == 2:
            #对active_reward_quest表的修改;赏金任务物品奖励持久化
            dbaccess.updateTempActiveRewardQuestByQuestTemplateId(questTemlateId, id, {'isFinish':1, 'isLock':0})
        elif templateInfo['type'] == 4:
            #转职任务
            professionStage += 1
            attrs['professionStage'] = professionStage
        dbaccess.updatePlayerInfo(self._owner.baseInfo.id, attrs)
        self._owner.profession.setProfessionStage(professionStage)
        currentProfessionStageIndex = int(self._owner.profession.getProfessionStage()) - 1
        #奖励任务奖励物品,放入玩家临时包裹蓝中
        if record[6] <> -1:
            item = dbaccess.getItemInfo(record[6])
            self._owner.pack.putOneItemIntoTempPackage(item)
            pushMessage(str(self._owner.baseInfo.id), 'newTempPackage')
            
        self._owner.pack.setTempPackage()
        self._owner.pack.setPackage()

        self.setProgressingQuests()
        if templateInfo['type'] == 2:
            pushMessage(str(self._owner.baseInfo.id), 'questFinish');
        self._owner.level.updateLevel()
        exp = self._owner.level.getExp()
        maxExp = self._owner.level.getMaxExp()
        return {'result':True, 'data':{'exp':exp,'maxExp':maxExp, 'coin':coin, \
                                      'currentProfessionStageIndex':currentProfessionStageIndex}}
Exemplo n.º 13
0
    def immediateFinishActiveRewardQuest(self, questRecordId, payType, payNum):
        '''立即完成赏金任务'''
        id = self._owner.baseInfo.id

        templateId = dbaccess.getQuestTemplateByQuestId(questRecordId)
        gold = self._owner.finance.getGold()
        coupon = self._owner.finance.getCoupon()
        if payType == 'gold':
            gold -= payNum
            if gold < 0:
                return {'result':False, 'reason':u'您的黄金量不足'}
            dbaccess.updatePlayerInfo(id, {'gold':gold})
            self._owner.finance.setGold(gold)
        else:
            coupon -= payNum
            if coupon < 0:
                return {'result':False, 'reason':u'您的礼券量不足'}
            dbaccess.updatePlayerInfo(id, {'coupon':coupon})
            self._owner.finance.setCoupon(coupon)
        dbaccess.operateForCommitQuest(questRecordId,id)
        dbaccess.updateTempActiveRewardQuestByQuestTemplateId(templateId, id, {'isFinish':1, 'isLock':0})

        self.setProgressingQuests()

        recordList = list(dbaccess.getPlayerTempActiveRewardQuests(id))
        recordList = self.wrapFixedRewardQuestListForClient(recordList)
        progressingList = self.getProgressingQuestsGroupByType()

        questBonus = loader.getById('quest_template', templateId, ['coinBonus', 'expBonus'])
        coin = self._owner.finance.getCoin() + questBonus['coinBonus']
        self._owner.finance.setCoin(coin)
        exp = self._owner.level.getExp() + questBonus['expBonus']
        self._owner.level.setExp(exp)
        self._owner.level.updateLevel()
        record = dbaccess.getQuestRecordById(questRecordId)
        
        if record[6] <> -1:
            item = dbaccess.getItemInfo(record[6])
            self._owner.pack.putOneItemIntoTempPackage(item)
            pushMessage(str(self._owner.baseInfo.id), 'newTempPackage')
        
        self._oneQuestCallLater.cancel()
        
        return {'result':True, 'data':{'questRecordId':questRecordId, 'coupon':coupon, 'gold':gold, \
                                      'coin':coin, 'exp':exp, \
                                      'activeRewardQuestList':recordList, \
                                      'progressQuestList':progressingList}}
Exemplo n.º 14
0
    def updateLevel(self):
        '''根据经验值更新等级'''
        if self._level >= self.MAXLEVEL:
            dbaccess.updatePlayerInfo(self._owner.baseInfo.id, {'exp': 0})
            self._exp = 0
            return False

        id = self._owner.baseInfo.id
        sparePoint = self._owner.attribute.getSparePoint()
        baseStr = self._owner.attribute.getBaseStr()
        baseVit = self._owner.attribute.getBaseVit()
        baseDex = self._owner.attribute.getBaseDex()
        professionId = self._owner.profession.getProfession()
        maxExp = self.getMaxExp()
        if (self._exp >= maxExp):
            self._level += 1
            self._exp -= maxExp
            sparePoint += 1

            profession = loader.getById('profession', professionId, '*')
            baseStr += profession["perLevelStr"]
            baseVit += profession["perLevelVit"]
            baseDex += profession["perLevelDex"]
            maxHp = self._owner.attribute.getMaxHp(professionId, id,
                                                   self._level)
            maxMp = self._owner.attribute.getMaxMp(professionId, id,
                                                   self._level)
            dbaccess.updatePlayerInfo(
                id, {
                    'level': self._level,
                    'exp': self._exp,
                    'sparepoint': sparePoint,
                    'baseStr': baseStr,
                    'baseDex': baseDex,
                    'baseVit': baseVit,
                    'hp': maxHp,
                    'mp': maxMp
                })
            self._owner.attribute.setSparePoint(sparePoint)
            self._owner.attribute.setBaseStr(baseStr)
            self._owner.attribute.setBaseVit(baseVit)
            self._owner.attribute.setBaseDex(baseDex)
            pushMessage(str(self._owner.baseInfo.id), 'updataLevel')
            return True
        else:
            return False
    def launchAddTeamMember(self, member, memberType = 1):
        '''发起组队邀请'''
#        myTeamID = self._team.getID()
#        myLeaderID = self._team.getTeamLeaderID()
        if self.amITeamMember(): #该玩家在某个已经存在的队伍中
            #assert(myLeaderID != None) 
            #队伍必定有队长(断言)
            if not self.amITeamLeader():#队长不是自己
                return {'result':False, 'reason':"您不是队长,无权邀请"}
            else:
                if self._team.isFullCommission():
                    return {'result':False, 'reason':"队伍人数已满"}
                else:
                    if self._team.hasMember(member.baseInfo.id, member.getType()):
                        return {'result':False, 'reason':'该玩家已经在队伍中'}
                    #else:
        if member.teamcom.amITeamMember():
            return {"result":False, 'reason':"对方已经在另外一个队伍中了"}
        pushMessage(str(member.baseInfo.id), self._owner.baseInfo.getNickName() + "向您发起组队邀请")
        return {"result":True, 'reason':None}
Exemplo n.º 16
0
 def launchAddTeamMember(self, member, memberType=1):
     '''发起组队邀请'''
     #        myTeamID = self._team.getID()
     #        myLeaderID = self._team.getTeamLeaderID()
     if self.amITeamMember():  #该玩家在某个已经存在的队伍中
         #assert(myLeaderID != None)
         #队伍必定有队长(断言)
         if not self.amITeamLeader():  #队长不是自己
             return {'result': False, 'reason': "您不是队长,无权邀请"}
         else:
             if self._team.isFullCommission():
                 return {'result': False, 'reason': "队伍人数已满"}
             else:
                 if self._team.hasMember(member.baseInfo.id,
                                         member.getType()):
                     return {'result': False, 'reason': '该玩家已经在队伍中'}
                 #else:
     if member.teamcom.amITeamMember():
         return {"result": False, 'reason': "对方已经在另外一个队伍中了"}
     pushMessage(str(member.baseInfo.id),
                 self._owner.baseInfo.getNickName() + "向您发起组队邀请")
     return {"result": True, 'reason': None}
    def updateLevel(self):
        '''根据经验值更新等级'''
        if self._level >= self.MAXLEVEL:
            dbaccess.updatePlayerInfo(self._owner.baseInfo.id, {'exp' : 0})
            self._exp = 0
            return False

        id = self._owner.baseInfo.id
        sparePoint = self._owner.attribute.getSparePoint()
        baseStr = self._owner.attribute.getBaseStr()
        baseVit = self._owner.attribute.getBaseVit()
        baseDex = self._owner.attribute.getBaseDex()
        professionId = self._owner.profession.getProfession()
        maxExp = self.getMaxExp()
        if(self._exp >= maxExp):
            self._level += 1
            self._exp -= maxExp
            sparePoint += 1

            profession = loader.getById('profession', professionId, '*')
            baseStr += profession["perLevelStr"]
            baseVit += profession["perLevelVit"]
            baseDex += profession["perLevelDex"]
            maxHp = self._owner.attribute.getMaxHp(professionId, id, self._level)
            maxMp = self._owner.attribute.getMaxMp(professionId, id, self._level)
            dbaccess.updatePlayerInfo(id, {'level' : self._level, 'exp' : self._exp,
                                           'sparepoint' : sparePoint, 'baseStr' : baseStr,
                                           'baseDex' : baseDex, 'baseVit' : baseVit,
                                           'hp' : maxHp, 'mp' : maxMp})
            self._owner.attribute.setSparePoint(sparePoint)
            self._owner.attribute.setBaseStr(baseStr)
            self._owner.attribute.setBaseVit(baseVit)
            self._owner.attribute.setBaseDex(baseDex)
            pushMessage(str(self._owner.baseInfo.id), 'updataLevel')
            return True
        else:
            return False
Exemplo n.º 18
0
 def refreshShopItems(self, placeId):
     ''''''
     id = self._owner.baseInfo.id
     pushMessage(str(id), 'refresh shop items')
Exemplo n.º 19
0
 def isNewMail(self, id):
     result = dbaccess.isNewMail(id)
     if result:
         pushMessage(str(id), 'newMail')
 def isNewMail(self, id):
     result = dbaccess.isNewMail(id)
     if result:
         pushMessage(str(id), 'newMail')
Exemplo n.º 21
0
 def getNewQusets(self, id, level):
     result = self.getReceiveableQuests()
     if result:
         pushMessage(str(id), 'newQuest')
Exemplo n.º 22
0
 def effectDie(self, effectId):
     '''效果生命周期结束'''
     dbaccess.deleteEffectInstance(self._owner.baseInfo.id, effectId)
     self.setEffectsList()
     pushMessage(str(self._owner.baseInfo.id), 'effectOver')
    def fightTo(self, enemyNPC, battleType = 1, timeLimit = 360):
        self.isdamage = False
        result = self.initBattleInfo(enemyNPC, battleType)
        HPMPDelta = []
        overTime = 0
        for second in range(timeLimit):
            stepResult, hpmpdelta, isBattleFinished = self.battleStep(second)
            result += stepResult
            HPMPDelta += hpmpdelta
            if isBattleFinished:
                overTime = second
                break
        ''' 计算战果    '''
        battleResult = {}
        if isBattleFinished is False:
            battleResult['winner'] = [int(self.fighter_enemy["id"])]
            battleResult['loser'] = [int(self.fighter_owner["id"])]
            self.fighter_owner['status'] = 1
            self.fighter_enemy['status'] = 1
            self.fighter_enemy['_win_battle_'] = True
            overTime = timeLimit
        else:
            if int(self.fighter_enemy['hp']) <= 0:
                battleResult['winner'] = [int(self.fighter_owner["id"])]
                battleResult['loser'] = [int(self.fighter_enemy["id"])]
                self.fighter_enemy['status'] = 5
                self.fighter_owner['status'] = 1
                self.fighter_owner['_win_battle_'] = True
            else:
                battleResult['winner'] = [int(self.fighter_enemy["id"])]
                battleResult['loser'] = [int(self.fighter_owner["id"])]
                self.fighter_owner['status'] = 5
                self.fighter_enemy['status'] = 1
                self.fighter_enemy['_win_battle_'] = True

        if self.fighter_owner['id'] in battleResult['winner']:
            respondEffects(EFFECT_START_AT_END_BATTLE, self.fighter_owner, self.fighter_enemy, overTime)
        else:
            respondEffects(EFFECT_START_AT_END_BATTLE, self.fighter_enemy, self.fighter_owner, overTime)

        if self.fighter_owner['id'] in battleResult['winner']:
            self.fighter_owner['exp'] = self.fighter_owner['exp'] + int(self.fighter_enemy['expBonus'])
            battleResult['scoreBonus'] = self.fighter_enemy['scoreBonus']
            battleResult['expBonus'] = int(self.fighter_enemy['expBonus'] * self._owner.level.getTwiceExp())
            battleResult['coinBonus'] = self.fighter_enemy['coinBonus']
            battleResult['goldBonus'] = self.fighter_enemy['goldBonus']
        else:
            self.fighter_enemy['exp'] = self.fighter_enemy['exp'] + int(self.fighter_owner['expBonus'])
            battleResult['scoreBonus'] = self.fighter_owner['scoreBonus']
            battleResult['expBonus'] = int(self.fighter_owner['expBonus'] * self._owner.level.getTwiceExp())
            battleResult['coinBonus'] = self.fighter_owner['coinBonus']
            battleResult['goldBonus'] = self.fighter_owner['goldBonus']

        itemBonuses = []
        if battleResult['loser'][0] == self.fighter_enemy['id']:
            #更新当前任务目标进度(收集、杀怪),增加任务目标物品
            questItem = self._owner.quest.onSuccessKillOneMonster(int(self.fighter_enemy['id']))
            if questItem:
                itemTemplate = loader.getById('item_template', questItem[2], '*')
                bonusItem = {'itemName':itemTemplate['name'], 'amount':1, 'partyId':self.fighter_owner["id"]}
                itemBonuses.append(bonusItem)
            #增加战斗掉落物品
            self._owner.pack.setTempPackage()
#            ret = self._owner.pack._tempPackage.isTempPackageFull()
#            if not ret[0]:
            ret = self._owner.dropping.getItemByDropping(self.fighter_enemy["dropItemId"])
            if ret is not None:
                item = ret[0]
                if item:
                    itemTemplate = ret[1]
                    self._owner.pack.putOneItemIntoTempPackage(item)
                    pushMessage(str(self._owner.baseInfo.id), 'newTempPackage')
                    bonusItem = {'itemName':itemTemplate['name'], 'amount':1, 'partyId':self.fighter_owner['id']}
                    itemBonuses.append(bonusItem)
        battleResult['itemBonuses'] = itemBonuses

        '''保存战斗结束事件记录'''#如果有组队时,给每个加id
        content = [{'id':self.fighter_owner['id'], 'battleResult':battleResult}]
        result.append([overTime, CharacterBattleComponent.BATTLE_FINISH, -1, content])

        reactor.callLater(
            math.ceil(overTime / 3),
            updateCharacterAttr,
            self.fighter_owner.copy(),
            self.fighter_enemy.copy(),
            battleType,
            battleResult,
        )

        data = {}
        data['battleType'] = battleType
        data['maxTime'] = timeLimit
        data['timeLimit'] = timeLimit
        data['battleEventProcessList'] = result
        data['MPHPDelta'] = HPMPDelta#记录每秒玩家双方hp/mp增量
        data['overTime'] = overTime
        data['winner'] = self.fighter_owner['_win_battle_'] and self.fighter_owner["id"] or self.fighter_enemy["id"]

        data_bak = data.copy()
        data_bak['owner_status'] = {'fighter':self.fighter_owner.copy(), 'enemy':self.fighter_enemy.copy(), 'battleType':battleType, 'battleResult':battleResult.copy()}

        if self.__SAVEDATA2DB__:
            reactor.callLater(0, dbaccess.saveBattleRecord, self._owner.baseInfo.id, data_bak)
        self.fighter_owner = None
        self.fighter_enemy = None

        return data