From 96c0ba31f74064e59c746921fcd1386cddf78d42 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 12 六月 2025 18:26:49 +0800
Subject: [PATCH] 121 【武将】武将系统-服务端(武将锁定、解锁;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHero.py |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHero.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHero.py
index 6801516..0a0aee9 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHero.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHero.py
@@ -281,6 +281,9 @@
     if heroID != useHeroID:
         GameWorld.DebugLog("武将材料非本体,无法升星!", playerID)
         return
+    if useItem.GetIsLocked():
+        GameWorld.DebugLog("材料卡锁定中,无法升星! useItemIndex=%s,heroID=%s" % (useItemIndex, heroID), playerID)
+        return
     washIDCnt = heroItem.GetUserAttrCount(ShareDefine.Def_IudetHeroTalentWashID)
     if washIDCnt:
         GameWorld.ErrLog("武将洗炼结果未处理,无法升星! itemIndex=%s,heroID=%s" % (itemIndex, heroID), playerID)
@@ -969,6 +972,24 @@
     
     return
 
+#// B2 38 武将锁定 #tagCSHeroLock
+#
+#struct    tagCSHeroLock
+#{
+#    tagHead        Head;
+#    WORD        ItemIndex;    //武将物品所在武将背包位置索引
+#    BYTE        IsLock;        //0-解锁;1-锁定
+#};
+def OnHeroLock(index, clientData, tick):
+    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+    itemIndex = clientData.ItemIndex
+    isLock = clientData.IsLock
+    heroItem = GetHeroItem(curPlayer, itemIndex)
+    if not heroItem:
+        return
+    heroItem.SetIsLocked(1 if isLock else 0)
+    return
+
 #// B4 12 战斗阵型保存 #tagCSHeroBattlePosSave
 #
 #struct    tagCSHeroBattlePos

--
Gitblit v1.8.0