From 2638c8b67d1dcac1c774f942ac144579c6f82ec1 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 11 九月 2018 21:41:11 +0800
Subject: [PATCH] 3479 【后端】【主干】【1.0.15】助战发送喊话时新增逻辑(自动加入匹配中的队伍);
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py | 70 +++++++++++++++++++++++++----------
1 files changed, 50 insertions(+), 20 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
index 9544906..cdb2f21 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
@@ -1009,7 +1009,7 @@
# 小心, 小心, 小心, 小心, 小心
# eggxp
#===============================================================================
- def __PutItemInVPack(self, packIndex, tagItem, event):
+ def PutItemInVPack(self, packIndex, tagItem, event=["", False, {}]):
# 虚拟背包, 默认不做叠加
curPlayer = self.__Player
canPutInCnt = 1
@@ -1044,7 +1044,7 @@
Sync_VPackItem_Refresh(curPlayer, packIndex, refreshPlaceList)
if tagItem and not tagItem.IsEmpty():
- tagItem.Clear()
+ #tagItem.Clear()
return False
return True
@@ -1094,13 +1094,8 @@
if not curItemData:
return False
- vPackItemDict = ChConfig.Def_VPackItem_Dict
+ packIndex = ChConfig.GetItemPackType(curItemData.GetType(), packIndex)
- for pack, itemTypeList in vPackItemDict.items():
- if curItemData.GetType() in itemTypeList:
- packIndex = pack
- break
-
if not self.CanPutInItem(packIndex, tagItem.GetItemTypeID(), tagItem.GetCount(), tagItem.GetIsBind(), defaultPile):
GameWorld.DebugLog("背包满,不能放入物品 count = %d"%tagItem.GetCount())
tagItem.Clear()
@@ -1108,7 +1103,7 @@
# 虚拟背包, 默认不做叠加
if packIndex in ShareDefine.Def_VPack_TypeList:
- return self.__PutItemInVPack(packIndex, tagItem, event)
+ return self.PutItemInVPack(packIndex, tagItem, event)
eventName, isForceEvent, addDict = event
@@ -1365,7 +1360,7 @@
DropItemToOtherPack(curPlayer, clientData.SrcBackpack, clientData.DesBackPack, clientData.SrcIndex, clientData.IsAll)
return
-def DropItemToOtherPack(curPlayer, fromPackIndex, toPackIndex, index, isAll=False):
+def DropItemToOtherPack(curPlayer, fromPackIndex, desPackIndex, index, isAll=False):
'''拖动某个背包物品到玩家物品背包
'''
movePack = curPlayer.GetItemManager().GetPack(fromPackIndex)
@@ -1376,18 +1371,27 @@
#整个背包转移
if isAll:
+ fullPackList = []
for itemIndex in xrange(movePack.GetCount()):
curItem = movePack.GetAt(itemIndex)
if not curItem or curItem.IsEmpty():
continue
+ toPackIndex = ChConfig.GetItemPackType(curItem.GetType(), desPackIndex)
+ if toPackIndex in fullPackList:
+ continue
if not __DoDropItemToOtherPack(curPlayer, itemControl, fromPackIndex, toPackIndex, itemIndex, curItem):
- return
+ if toPackIndex not in fullPackList:
+ fullPackList.append(toPackIndex)
+
+ for fullPackIndex in fullPackList:
+ PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_676165", [fullPackIndex])
#单个物品转移
else:
curItem = movePack.GetAt(index)
if not curItem or curItem.IsEmpty():
return
+ toPackIndex = ChConfig.GetItemPackType(curItem.GetType(), desPackIndex)
__DoDropItemToOtherPack(curPlayer, itemControl, fromPackIndex, toPackIndex, index, curItem)
return
@@ -1396,6 +1400,14 @@
#curItemGUID = curItem.GetGUID()
curItemCount = curItem.GetCount()
curItemIsBind = curItem.GetIsBind()
+ #toPackIndex = ChConfig.GetItemPackType(curItem.GetType(), toPackIndex)
+
+ # 常规物品转移到虚拟符印背包
+ if toPackIndex == ShareDefine.rptRune:
+ if not ItemCommon.CheckPackHasSpace(curPlayer, toPackIndex, True):
+ return False
+ return itemControl.PutItemInVPack(toPackIndex, curItem)
+
checkRet, putIndex = itemControl.CanPutInItemEx(toPackIndex, curItemTypeID, curItemCount, curItemIsBind)
if not checkRet:
return False
@@ -1576,6 +1588,8 @@
itemList = [] # 非装备普通物品
equipGSGreaterList = [] # 属于本职业的高评分装备
equipGSLesserList = [] # 低评分装备和非本职业
+ runeItemList = [] # 符印
+
#EquipGSTypeForSort
equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
#组合列表
@@ -1596,7 +1610,9 @@
equipGS = 1
cmpEquipGS = 2
- if equipGS == 0:
+ if tmpItem.GetType() in [ChConfig.Def_ItemType_Rune, ChConfig.Def_ItemType_RuneExp]:
+ runeItemList.append(tmpItem)
+ elif equipGS == 0:
itemList.append(tmpItem)
elif equipGS > cmpEquipGS:
equipGSGreaterList.append(tmpItem)
@@ -1606,7 +1622,8 @@
equipGSGreaterList.sort(__CmpRolePack)
itemList.sort(__CmpRolePack)
equipGSLesserList.sort(__CmpRolePack)
-
+ runeItemList.sort(__CmpRolePack)
+
#===========================================================================
# GameWorld.DebugLog("equipGSGreaterList")
# for item in equipGSGreaterList:
@@ -1641,6 +1658,11 @@
for item in equipGSLesserList:
curPack.GetAt(putPlace).AssignItem(item, False)
putPlace += 1
+
+ for item in runeItemList:
+ curPack.GetAt(putPlace).AssignItem(item, False)
+ putPlace += 1
+
return
@@ -1882,11 +1904,10 @@
PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_GetSpecialItem, 1, [itemID])
return True
- vPackItemDict = ChConfig.Def_VPackItem_Dict
- for pack, itemTypeList in vPackItemDict.items():
- if curItemData.GetType() in itemTypeList:
- packIndexList = [pack]
- break
+ defaultPack = IPY_GameWorld.rptItem if not packIndexList else packIndexList[0]
+ packIndex = ChConfig.GetItemPackType(curItemData.GetType(), defaultPack)
+ if packIndex != defaultPack or not packIndexList:
+ packIndexList = [packIndex]
if not __Check_CanPutItemInPack(curPlayer, itemID, itemCount, itemIsBind, packIndexList, defaultPile):
#不可放入
@@ -2210,8 +2231,13 @@
itemClassLV = ItemCommon.GetItemClassLV(curItem)
itemQuality = curItem.GetItemQuality()
key = (itemColor, itemQuality)
+ isDogzEquip = ItemCommon.GetIsDogzEquip(curItem)
# {(颜色,星级):[一般属性条数, 追求属性条数, 固定属性条数], ...}
- legAttrCntDict = IpyGameDataPY.GetFuncEvalCfg("LegendAttrCount")
+ if isDogzEquip:
+ #神兽装备条数不一样
+ legAttrCntDict = IpyGameDataPY.GetFuncEvalCfg("LegendAttrCount", 2)
+ else:
+ legAttrCntDict = IpyGameDataPY.GetFuncEvalCfg("LegendAttrCount")
if key not in legAttrCntDict:
#GameWorld.DebugLog("该装备品质没有传奇属性: itemColor=%s,itemQuality=%s" % (itemColor, itemQuality))
return
@@ -2240,7 +2266,11 @@
curLegAttrIDList = []
curLegAttrValueList = []
# {属性ID:{颜色:数值, ...}, ...}
- legAttrValueColorDict = IpyGameDataPY.GetFuncEvalCfg("LegendAttrValueByColor")
+ if isDogzEquip:
+ # 神兽装备数值不一样
+ legAttrValueColorDict = IpyGameDataPY.GetFuncEvalCfg("LegendAttrValueByColor2")
+ else:
+ legAttrValueColorDict = IpyGameDataPY.GetFuncEvalCfg("LegendAttrValueByColor")
legAttrValueClassLVDict = IpyGameDataPY.GetFuncEvalCfg("LegendAttrValueByClassLV")
for attrID in randAttrIDList:
if attrID in legAttrValueColorDict:
--
Gitblit v1.8.0