| | |
| | | PlayerControl.NotifyCode(curPlayer, "CreatSuccess")
|
| | | return
|
| | |
|
| | | if CheckIsServerCreateRoleLimit(curPlayer):
|
| | | PlayerControl.NotifyCode(curPlayer, "ServerCreateRoleLimit")
|
| | | return
|
| | | |
| | | # CD保护
|
| | | createSafeTick = 3000
|
| | | accID = curPlayer.GetAccID()
|
| | |
| | | #GameWorld.DebugLog("SendToDBPlayerCreate dataMapID=%s,lineID=%s,posX=%s,posY=%s,mapID=%s,copyMapID=%s"
|
| | | # % (dataMapID, lineID, posX, posY, mapID, copyMapID))
|
| | | #根据职业获得默认的属性, #STR//力量 ,PNE//智力,PHY//敏捷,CON//体力
|
| | | baseSTR, basePNE, basePHY, baseCON = __GetPlayerBasePoint(sendPack_Job)
|
| | | baseSTR, basePNE, basePHY, baseCON = 0, 0, 0, 0
|
| | |
|
| | | curPlayer.SendToDBPlayerCreate(
|
| | | curPlayerID, #PlayerID,
|
| | |
| | | IPY_GameServer.TYPE_Price_Gold_Paper, #默认使用金票 (金子/金票)
|
| | | IPY_GameServer.TYPE_Price_Silver_Money, #默认使用银子 (银子/银票)
|
| | | 80, #默认自动回血设定 inputHPRestoreSetting
|
| | | 80 #默认自动回魔设定 inputMPRestoreSetting
|
| | | 80, #默认自动回魔设定 inputMPRestoreSetting
|
| | | 0, #roleType
|
| | | 0 #modelMark
|
| | | )
|
| | |
|
| | | # 创角流向
|
| | | #DataRecordPack.DR_CreateRole(curPlayer.GetAccID(), sendPack_Name, sendPack_Job)
|
| | | return
|
| | | #---------------------------------------------------------------------
|
| | | def CheckIsServerCreateRoleLimit(curPlayer):
|
| | | ## 服务器是否创角限制
|
| | | groupID = GameWorld.GetServerGroupID()
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for i in xrange(ipyDataMgr.GetCreateRoleLimitServerCount()):
|
| | | ipyData = ipyDataMgr.GetCreateRoleLimitServerByIndex(i)
|
| | | if groupID in ipyData.GetLimitServerGroupIDList():
|
| | | return True
|
| | | for idA, idB in ipyData.GetLimitServerGroupIDRangeList():
|
| | | if idA <= groupID <= idB:
|
| | | return True
|
| | | return False
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ## 获取玩家基础属性点
|
| | | # @param sendPack_Job 职业类型
|
| | | # @return baseSTR, basePNE, basePHY, baseCON
|
| | | # @remarks 函数详细说明.
|
| | | def __GetPlayerBasePoint(sendPack_Job):
|
| | | baseSTR, basePNE, basePHY, baseCON = (0, 0, 0, 0)
|
| | | #{ ְҵ : { key : value } }
|
| | | |
| | | jobDict = IpyGameDataPY.GetFuncEvalCfg("CreatRolePoint%s" % sendPack_Job, 1)
|
| | | |
| | | if not jobDict:
|
| | | GameWorld.ErrLog('CreatRoleErr RoleBasePoint, job = %s' % (sendPack_Job))
|
| | | return baseSTR, basePNE, basePHY, baseCON
|
| | | |
| | | for key, value in jobDict.items():
|
| | | |
| | | if type(key) == str:
|
| | | key = key.upper()
|
| | | |
| | | if key in ['STR', ShareDefine.Def_Effect_STR]:
|
| | | baseSTR = value
|
| | | |
| | | elif key in ['PNE', ShareDefine.Def_Effect_PNE]:
|
| | | basePNE = value
|
| | | |
| | | elif key in ['PHY', ShareDefine.Def_Effect_PHY]:
|
| | | basePHY = value
|
| | | |
| | | elif key in ['CON', ShareDefine.Def_Effect_CON]:
|
| | | baseCON = value
|
| | | |
| | | else:
|
| | | GameWorld.ErrLog('CreatRoleErr RoleBasePoint, key = %s' % (key))
|
| | | |
| | | return baseSTR, basePNE, basePHY, baseCON
|
| | | #---------------------------------------------------------------------
|
| | | ## 检查玩家名字是否合法(这里的PlayerName为过滤完空格的名字)
|
| | | # @param curPlayer 当前玩家
|
| | | # @param playerName 玩家名称
|