Ejemplo n.º 1
0
def tiaozhuan(dynamicId,characterid,csz):
    '''场景间的跳转或者进入副本
    '''
    player = PlayersManager().getPlayerByID(characterid)
    if not player:
        return {'result':False,'message':Lg().g(18)}
    doorinfo = dbMap.ALL_DOOR_INFO.get(csz)#获取传送门的信息
    lastscene = MapManager().getMapId(player.baseInfo.getTown())
    if doorinfo.get('functionType')==1:#跳转场景
        placeId = doorinfo.get('nextmap')
        position = (doorinfo.get('init_x'),doorinfo.get('init_y'))
        player.baseInfo.setTown( placeId)
        player.baseInfo.setState(0)
        PlayersManager().addPlayer(player)
        defencelog_app.isReward(player.baseInfo.id, player.getDynamicId())
        scene = MapManager().getMapId(placeId)
        scenename = scene.getSceneName()
        chatnoderemote.callRemote('JoinRoom',characterid,placeId,scenename)
        scene.addPlayer(characterid)
        player.quest.setNpcList(scene._npclist)
        player.baseInfo.initPosition(position)
        scene.pushEnterPlace([dynamicId])
        result = {'result':True}
    else:
        instanceId = doorinfo.get('famID')
        result = instance_app.enterInstance1(player,dynamicId, characterid, instanceId,0)
    if result.get('result'):
        lastscene.dropPlayer(characterid)
Ejemplo n.º 2
0
def enterInstance_1501(player,dynamicId,characterId,instanceId,famId):
    '''进入副本
    ''' 
    data=instance_app.enterInstance1(player,dynamicId, characterId, instanceId,famId) #进入副本
    if data.get('result'):
        pass
#        publicnoderemote.callRemote('updatePCharacterNodeId',characterId,getNodeId())
    return data
Ejemplo n.º 3
0
def enterInstance_1501(player, dynamicId, characterId, instanceId, famId):
    '''进入副本
    '''
    data = instance_app.enterInstance1(player, dynamicId, characterId,
                                       instanceId, famId)  #进入副本
    if data.get('result'):
        pass


#        publicnoderemote.callRemote('updatePCharacterNodeId',characterId,getNodeId())
    return data
Ejemplo n.º 4
0
    def startCopyScene(self, characterId, vipMatrix):
        '''开始副本
        @param chracterId: 角色的ID
        '''
        if characterId != self.roomowner:
            return {'result': False, 'message': u'只有房主有权限'}
        if not self.areAllReady():
            return {'result': False, 'message': u'还有玩家没有准备好'}
        player = PlayersManager().getPlayerByID(characterId)

        if vipMatrix == 1:
            if player.finance.getCoin() >= 5000:
                self.matrix.setNowEffect(vipMatrix)
                player.finance.updateCoin(player.finance.getCoin() - 5000)
        elif vipMatrix == 2:
            if player.finance.getGold() >= 10:
                self.matrix.setNowEffect(vipMatrix)
                player.finance.updateGold(player.finance.getGold() - 10)
        elif vipMatrix == 3:
            if player.finance.getGold() >= 50:
                self.matrix.setNowEffect(vipMatrix)
                player.finance.updateGold(player.finance.getGold() - 50)

        sendList = []
        if len([member for member in self.members.values() if member]) > 1:
            team = TeamManager().creatTeam(characterId)
            team.setMatrix(self.matrix)
            for member in self.members.values():
                if member:
                    pp = PlayersManager().getPlayerByID(member['id'])
                    if pp:
                        sendList.append(pp.getDynamicId())
                    team.addMember(member['id'])
        data = enterInstance1(0, characterId, self.copySceneId)
        if data['result']:
            player = PlayersManager().getPlayerByID(characterId)
            dynamicId = player.getDynamicId()
            pushQuitHallMessage(sendList)
            pushEnterPlace(data['data'].get('placeId'), [dynamicId])
        return data
Ejemplo n.º 5
0
 def startCopyScene(self,characterId,vipMatrix):
     '''开始副本
     @param chracterId: 角色的ID
     '''
     if characterId != self.roomowner:
         return {'result':False,'message':u'只有房主有权限'}
     if not self.areAllReady():
         return {'result':False,'message':u'还有玩家没有准备好'}
     player = PlayersManager().getPlayerByID(characterId)
     
     if vipMatrix ==1:
         if player.finance.getCoin()>=5000:
             self.matrix.setNowEffect(vipMatrix)
             player.finance.updateCoin(player.finance.getCoin() -5000)
     elif vipMatrix ==2:
         if player.finance.getGold()>=10:
             self.matrix.setNowEffect(vipMatrix)
             player.finance.updateGold(player.finance.getGold() -10)
     elif vipMatrix ==3 :
         if player.finance.getGold()>=50:
             self.matrix.setNowEffect(vipMatrix)
             player.finance.updateGold(player.finance.getGold() -50)
     
     sendList = []
     if len([member for member in self.members.values() if member])>1:
         team = TeamManager().creatTeam(characterId)
         team.setMatrix(self.matrix)
         for member in self.members.values():
             if member:
                 pp = PlayersManager().getPlayerByID(member['id'])
                 if pp:
                     sendList.append(pp.getDynamicId())
                 team.addMember(member['id'])
     data = enterInstance1(0, characterId, self.copySceneId)
     if data['result']:
         player = PlayersManager().getPlayerByID(characterId)
         dynamicId = player.getDynamicId()
         pushQuitHallMessage(sendList)
         pushEnterPlace(data['data'].get('placeId'), [dynamicId])
     return data