From 023ae1bd821375ccf7b422b1ba913e75f03f7b62 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 17 九月 2018 17:05:05 +0800
Subject: [PATCH] 2303 【后端】限时特惠提前通知前端开启 2302 【后端】限时礼包开启提前通知前端
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py | 54 +++++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 45 insertions(+), 9 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 18205d2..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
@@ -1103,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
@@ -1360,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)
@@ -1371,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
@@ -1391,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
@@ -1571,6 +1588,8 @@
itemList = [] # 非装备普通物品
equipGSGreaterList = [] # 属于本职业的高评分装备
equipGSLesserList = [] # 低评分装备和非本职业
+ runeItemList = [] # 符印
+
#EquipGSTypeForSort
equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
#组合列表
@@ -1591,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)
@@ -1601,7 +1622,8 @@
equipGSGreaterList.sort(__CmpRolePack)
itemList.sort(__CmpRolePack)
equipGSLesserList.sort(__CmpRolePack)
-
+ runeItemList.sort(__CmpRolePack)
+
#===========================================================================
# GameWorld.DebugLog("equipGSGreaterList")
# for item in equipGSGreaterList:
@@ -1636,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
@@ -2204,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
@@ -2234,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