| | |
| | | import ShareDefine
|
| | | import IpyGameDataPY
|
| | | import PlayerControl
|
| | | import PlayerActivity
|
| | | import ChPyNetSendPack
|
| | | import ItemControler
|
| | | import IPY_GameWorld
|
| | | import NetPackCommon
|
| | | import PlayerArena
|
| | | import PlayerLLMJ
|
| | | import ItemCommon
|
| | | import PlayerTask
|
| | | import NPCCommon
|
| | |
| | | if unXiantaoCntExp:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntExp, 0)
|
| | | perExp = IpyGameDataPY.GetFuncCfg("Mainline", 1) # 每个战锤增加经验
|
| | | totalExp = unXiantaoCntExp * perExp
|
| | | GameWorld.DebugLog("增加经验: totalExp=%s,unXiantaoCntExp=%s" % (totalExp, unXiantaoCntExp))
|
| | | PlayerControl.PlayerControl(curPlayer).AddExp(totalExp, ShareDefine.Def_ViewExpType_KillNPC)
|
| | | |
| | | baseExp = unXiantaoCntExp * perExp
|
| | | mjExPer, exRemain = PlayerLLMJ.GetAddExpPerInfo(curPlayer)
|
| | | mjEx = min(int(baseExp * mjExPer / 100.0), exRemain)
|
| | | totalExp = baseExp + mjEx
|
| | | GameWorld.DebugLog("增加经验: totalExp=%s,unXiantaoCntExp=%s,baseExp=%s,mjEx=%s,mjExPer=%s,exRemain=%s" |
| | | % (totalExp, unXiantaoCntExp, baseExp, mjEx, mjExPer, exRemain))
|
| | | finalAddExp = PlayerControl.PlayerControl(curPlayer).AddExp(totalExp, ShareDefine.Def_ViewExpType_KillNPC)
|
| | | if mjEx and finalAddExp:
|
| | | PlayerLLMJ.AddExpEx(curPlayer, mjEx)
|
| | | |
| | | __doMainDrop(curPlayer, killObjList)
|
| | | return
|
| | |
|
| | |
| | | if dropBootyCnt <= 0:
|
| | | continue
|
| | |
|
| | | itemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
|
| | | if not itemData:
|
| | | continue
|
| | | |
| | | # 判断挑战券
|
| | | if itemData.GetType() == ChConfig.Def_ItemType_AutoUseMoney:
|
| | | curEff = itemData.GetEffectByIndex(0)
|
| | | effID = curEff.GetEffectID()
|
| | | moneyType = curEff.GetEffectValue(1)
|
| | | if effID == ChConfig.Def_Effect_ItemGiveMoney and moneyType == ShareDefine.TYPE_Price_ArenaTicket:
|
| | | curMoney = PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_ArenaTicket)
|
| | | storeMax = PlayerArena.GetArenaTicketStoreMax(curPlayer)
|
| | | if curMoney >= storeMax:
|
| | | GameWorld.DebugLog("挑战券已达存储上限! itemID=%s,curMoney=%s >= %s" % (itemID, curMoney, storeMax), playerID)
|
| | | continue
|
| | | |
| | | dropCntRange = bootyDropCntDict[itemID]
|
| | | if not isinstance(dropCntRange, (list, tuple)) or len(dropCntRange) != 2:
|
| | | continue
|
| | |
| | | return
|
| | | GameWorld.DebugLog("主线掉落装备: unXiantaoCntEquip=%s,dropEquipCnt=%s,treeLV=%s,objDropCntDict=%s"
|
| | | % (unXiantaoCntEquip, dropEquipCnt, treeLV, objDropCntDict), playerID)
|
| | | dropAppointEquipDict = IpyGameDataPY.GetFuncEvalCfg("MainDropAppoint", 1, {})
|
| | | appointDropCntMax = max(dropAppointEquipDict) if dropAppointEquipDict else 0
|
| | |
|
| | | for tagID, dropInfo in objDropCntDict.items():
|
| | | tagObj, dropCnt, bossType = dropInfo
|
| | |
| | | for _ in range(dropCnt):
|
| | | if dropEquipCnt <= 0:
|
| | | break
|
| | | itemColor = GameWorld.GetResultByRandomList(colorRateList)
|
| | | if not itemColor:
|
| | | continue
|
| | | equipIDList = NPCCommon.__GetEquipIDList(0, color=itemColor, placeList=ChConfig.Def_MainEquipPlaces, findType="MainEquipDrop")
|
| | | if not equipIDList:
|
| | | continue
|
| | | randEquipID = random.choice(equipIDList)
|
| | |
|
| | | curItem = ItemControler.GetOutPutItemObj(randEquipID, 1, False, curPlayer=curPlayer)
|
| | | setAttrDict = None
|
| | | appointDropEquipCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AppointDropEquipCnt) + 1
|
| | | if appointDropEquipCnt in dropAppointEquipDict:
|
| | | appointInfo = dropAppointEquipDict[appointDropEquipCnt]
|
| | | randEquipID = appointInfo[0]
|
| | | equipLV = appointInfo[1] if len(appointInfo) > 1 else 0
|
| | | appointID = appointInfo[2] if len(appointInfo) > 2 else 0
|
| | | setAttrDict = {}
|
| | | if equipLV > 0:
|
| | | setAttrDict["%s" % ShareDefine.Def_IudetItemLV] = equipLV
|
| | | if appointID:
|
| | | setAttrDict[ShareDefine.Def_CItemKey_AppointID] = appointID
|
| | | GameWorld.DebugLog("定制掉落第%s次: equipID=%s,setAttrDict=%s" % (appointDropEquipCnt, randEquipID, setAttrDict))
|
| | | else:
|
| | | itemColor = GameWorld.GetResultByRandomList(colorRateList)
|
| | | if not itemColor:
|
| | | continue
|
| | | equipIDList = NPCCommon.__GetEquipIDList(0, color=itemColor, placeList=ChConfig.Def_MainEquipPlaces, findType="MainEquipDrop")
|
| | | if not equipIDList:
|
| | | continue
|
| | | randEquipID = random.choice(equipIDList)
|
| | | |
| | | curItem = ItemControler.GetOutPutItemObj(randEquipID, 1, False, curPlayer=curPlayer, setAttrDict=setAttrDict)
|
| | | if curItem == None:
|
| | | continue
|
| | | curItem.SetIsBind(1) # 为1时代表是掉落
|
| | |
| | |
|
| | | dropEquipCnt -= 1
|
| | |
|
| | | if appointDropEquipCnt <= appointDropCntMax:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_AppointDropEquipCnt, appointDropEquipCnt)
|
| | | return
|
| | |
|
| | | def GMTestKill(curPlayer, useXiantao):
|
| | |
| | |
|
| | | equipCnt = len(equipDict)
|
| | | unXiantaoCntEquip = PlayerControl.GetUnXiantaoCntEquip(curPlayer)
|
| | | perEquipXiantao = unXiantaoCntEquip / float(equipCnt) if equipCnt > 1 else unXiantaoCntEquip
|
| | | perEquipXiantao = unXiantaoCntEquip / float(equipCnt) if equipCnt > 1 else unXiantaoCntEquip # 均分支持小数
|
| | | decomposeMoney = max(1, moneyBase * perEquipXiantao) # 至少1个
|
| | | mjExPer, exRemain = PlayerLLMJ.GetAddDecomposePer(curPlayer)
|
| | | mjEx = int(decomposeMoney * mjExPer / 100.0)
|
| | | GameWorld.DebugLog("unXiantaoCntEquip=%s,equipCnt=%s,perEquipXiantao=%s,equipIndexList=%s"
|
| | | % (unXiantaoCntEquip, equipCnt, perEquipXiantao, equipDict.keys()), playerID)
|
| | | GameWorld.DebugLog("moneyBase=%s,decomposeMoney=%s" % (moneyBase, decomposeMoney), playerID)
|
| | | GameWorld.DebugLog("moneyBase=%s,decomposeMoney=%s,mjExPer=%s,exRemain=%s,mjEx=%s" % (moneyBase, decomposeMoney, mjExPer, exRemain, mjEx), playerID)
|
| | |
|
| | | moneyTotal = 0
|
| | | |
| | | mjExTotal = 0
|
| | | decomposeCnt = 0
|
| | | decomposeIndexList = []
|
| | | for itemIndex in itemIndexList:
|
| | |
| | | curEquip = equipDict[itemIndex]
|
| | |
|
| | | moneyTotal += decomposeMoney
|
| | | GameWorld.DebugLog(" itemIndex=%s,moneyBase=%s,perEquipXiantao=%s,decomposeMoney=%s,总:%s" |
| | | % (itemIndex, moneyBase, perEquipXiantao, decomposeMoney, moneyTotal), playerID)
|
| | | if mjEx > 0:
|
| | | mjEx = min(mjEx, exRemain)
|
| | | exRemain -= mjEx
|
| | | moneyTotal += mjEx
|
| | | mjExTotal += mjEx
|
| | | GameWorld.DebugLog(" itemIndex=%s,moneyBase=%s,perEquipXiantao=%s,decomposeMoney=%s,mjEx=%s,exRemain=%s,总:%s" |
| | | % (itemIndex, moneyBase, perEquipXiantao, decomposeMoney, mjEx, exRemain, moneyTotal), playerID)
|
| | |
|
| | | ItemCommon.DelItem(curPlayer, curEquip, curEquip.GetCount(), True, ChConfig.ItemDel_EquipDecompose)
|
| | | decomposeIndexList.append(itemIndex)
|
| | |
| | |
|
| | | moneyTotal = int(round(moneyTotal)) # 四舍五入取整
|
| | | unXiantaoCntEquip = PlayerControl.SetUnXiantaoCntEquip(curPlayer, unXiantaoCntEquip)
|
| | | GameWorld.DebugLog("moneyTotal=%s,unXiantaoCntEquip=%s" % (moneyTotal, unXiantaoCntEquip), playerID)
|
| | | |
| | | GameWorld.DebugLog("moneyTotal=%s,mjExTotal=%s,unXiantaoCntEquip=%s" % (moneyTotal, mjExTotal, unXiantaoCntEquip), playerID)
|
| | | |
| | | PlayerControl.GiveMoney(curPlayer, moneyType, moneyTotal, "DecomposeMainEquip", isSysHint=False)
|
| | | PlayerLLMJ.AddExpDecompose(curPlayer, mjExTotal)
|
| | | PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_EquipDecompose, decomposeCnt)
|
| | | PlayerActivity.AddDailyTaskValue(curPlayer, ChConfig.DailyTask_EquipDecompose, decomposeCnt)
|
| | | return
|
| | |
|
| | | def __doPickupMainItem(curPlayer, itemIndexList):
|