Files
mtgodot-poc/tools/server/shop-item-time/README.md
T
shenleiandClaude Opus 5.5 3aa4c482e9 tools/server: shop-item-time patch — NPC shop items carry a new item's time sockets
40250 game zeroes alSockets for NPC (shop.cpp) and extended (shopEx.cpp) shop items, so
uitooltip shows 'remaining 0 min' for mounts and item-mall time items. MT_GetNewItemSockets
fills them with ITEM_MANAGER::CreateItem's rules (UNIQUE remain time, auto potions,
LIMIT_REAL_TIME, LIMIT_TIMER_BASED_ON_WEAR). Deployed on 203; mount shop 20368 verified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 17:55:36 +09:00

14 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# NPC 商店物品显示剩余时间(203 服务端)
40250 服务端发商店物品列表时,NPC 商店(`shop.cpp` 的 `StartShop`/`UpdateItem`)和扩展多页商店
(`shopEx.cpp`,如百店老板娘 9010)把物品的 socket 全部清零。客户端 `uitooltip.py` 用 socket 算剩余时间
(UNIQUE 取 `socket[2]` 分钟数,LIMIT_REAL_TIME 取 `socket[0]` 到期时间戳),于是坐骑、百货店的限时物品
在商店里都显示「剩余时间 : 0分」,买下后才正常。
`server.patch` 在 `shop.cpp` 加 `MT_GetNewItemSockets(vnum, alSockets)`:按 `ITEM_MANAGER::CreateItem`
给新物品设 socket 的同一套规则(UNIQUE 剩余时间、自动药水、LIMIT_REAL_TIME、LIMIT_TIMER_BASED_ON_WEAR)
填商店包里的 socket。玩家个人商店(有实际物品)不变,仍发物品自身的 socket。只影响显示,买到的物品照旧由
`CreateItem` 生成。
在 hunt-set 之后打(`shopEx.cpp` 上下文依赖它)。`sh rebuild.sh build` 自动打补丁并编译。