From c26f44a3d2d8debf560f46fb09e23761516ab7b4 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 28 十月 2025 16:36:28 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(王元姬、张宝技能;增加释放方式5-弹射攻击,9-弹射治疗,1002-持续治疗;增加效果6015-增加弹射次数;效果7004-随机弹射次数;效果5005-按类型清除buff;增加技能类型15-清除净化buff类;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Mail.py | 71 ++++++++++++++++++++++++++++++++---
1 files changed, 64 insertions(+), 7 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Mail.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Mail.py
index 78412de..e4848fb 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Mail.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Mail.py
@@ -19,7 +19,10 @@
import PlayerMail
import ShareDefine
import DataRecordPack
+import IpyGameDataPY
import DBDataMgr
+import ItemCommon
+import CommFunc
import random
## 执行逻辑
@@ -33,6 +36,8 @@
GameWorld.DebugAnswer(curPlayer, "发送邮件: Mail 几封 物品数 [模板key 参数1 ...]")
GameWorld.DebugAnswer(curPlayer, "输出邮件: Mail p")
GameWorld.DebugAnswer(curPlayer, "发送全服: Mail s 物品数 [天数]")
+ GameWorld.DebugAnswer(curPlayer, "发送邮件: Mail pw 天数 物品ID 个数 [ID 个数 ...]")
+ GameWorld.DebugAnswer(curPlayer, "个数:如果是装备则个数默认1个,个数参数改为定制属性ID")
return
value = gmList[0]
@@ -49,10 +54,46 @@
SendServerMail(curPlayer, gmList)
return
+ if value == "pw":
+ SendPlayerMailItem(curPlayer, gmList)
+ return
+
if value > 0:
SendPlayerMail(curPlayer, gmList)
return
+ return
+
+def SendPlayerMailItem(curPlayer, gmList):
+ playerID = curPlayer.GetPlayerID()
+ limitDays = gmList[1] if len(gmList) > 1 else 1
+ itemList = gmList[2:]
+
+ mailItemList = []
+ while len(itemList) >= 2:
+ itemID = itemList.pop(0)
+ itemCount = itemList.pop(0)
+
+ itemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
+ if not itemData:
+ GameWorld.DebugAnswer(curPlayer, "物品ID不存在! %s" % itemID)
+ continue
+
+ if ItemCommon.GetIsEquip(itemData):
+ appointID = itemCount
+ ipyData = IpyGameDataPY.GetIpyGameData("AppointItem", appointID)
+ if not ipyData:
+ GameWorld.DebugAnswer(curPlayer, "定制属性ID不存在! %s" % appointID)
+ continue
+ userData = CommFunc.JsonDump({ShareDefine.Def_CItemKey_AppointID:appointID})
+ itemInfo = [itemID, 1, 0, userData] # 装备默认1个
+ else:
+ itemInfo = [itemID, itemCount]
+
+ mailItemList.append(itemInfo)
+
+ PlayerMail.SendMailByKey("", playerID, mailItemList, limitDays=limitDays)
+ GameWorld.DebugAnswer(curPlayer, "发送个人邮件物品OK")
return
def SendPlayerMail(curPlayer, gmList):
@@ -66,7 +107,7 @@
mailCntBef = mailMgr.GetPersonalMailCount(playerID)
for _ in range(sendCnt):
itemList = __randMailItem(mailItemCnt)
- PlayerMail.SendMailByKey(mailTypeKey, playerID, itemList, paramList)
+ PlayerMail.SendMailByKey(mailTypeKey, playerID, itemList, paramList, limitDays=random.randint(1, 7))
mailCntAft = mailMgr.GetPersonalMailCount(playerID)
GameWorld.DebugAnswer(curPlayer, "发送个人邮件OK:%s, %s~%s" % (sendCnt, mailCntBef, mailCntAft))
@@ -90,8 +131,10 @@
return
def __randMailItem(mailItemCnt):
- itemIDList = range(3501, 3530 + 1)
- moneyIDList = [20, 30]
+ moneyIDList = [1, 2, 3]
+ equipIDList = range(100501, 100512)
+ heroIDList = range(510001, 510016)
+ itemIDList = [4, 5, 7, 8, 9, 10, 11, 12, 13, 1000, 1001, 1002] #range(3501, 3530 + 1)
isBind = 0
itemList = []
@@ -99,6 +142,22 @@
for moneyID in moneyIDList:
itemCount = random.choice([100, 1000, 10000, 20000, 50000, 100000, 200000, 300000, 500000])
itemList.append([moneyID, itemCount, isBind])
+ if len(itemList) >= mailItemCnt:
+ break
+
+ random.shuffle(equipIDList)
+ for i in range(3):
+ itemID = equipIDList[i%len(equipIDList)]
+ itemCount = 1
+ itemList.append([itemID, itemCount, isBind])
+ if len(itemList) >= mailItemCnt:
+ break
+
+ random.shuffle(heroIDList)
+ for i in range(3):
+ itemID = heroIDList[i%len(heroIDList)]
+ itemCount = 1
+ itemList.append([itemID, itemCount, isBind])
if len(itemList) >= mailItemCnt:
break
@@ -122,15 +181,13 @@
DataRecordPack.DR_MailDel(playerID, guid, "GMDel")
notifyGUIDState[guid] = ShareDefine.MailState_Del
GameWorld.DebugAnswer(curPlayer, "删除个人邮件:%s" % len(guidList))
+ PlayerMail.Sync_PlayerMailState(curPlayer, notifyGUIDState)
guidList = mailMgr.GetServerMailGuids()
for guid in guidList:
- playerStateDict = mailMgr.DelServerMail(guid)
- if playerID in playerStateDict and playerStateDict[playerID] < ShareDefine.MailState_Del:
- notifyGUIDState[guid] = ShareDefine.MailState_Del
+ PlayerMail.DelServerMail(guid, "GMDel")
if len(guidList):
GameWorld.DebugAnswer(curPlayer, "删除全服邮件:%s" % len(guidList))
- PlayerMail.Sync_PlayerMailState(curPlayer, notifyGUIDState)
return
def PrintPlayerMail(curPlayer):
--
Gitblit v1.8.0