Files
mtgodot-poc/tools/server/item-mall-shop/README.md
T
shenleiandClaude Opus 5.5 cc18db5dd1 商城 NPC 商店:9010 百店老板娘在三个村卖商城物品(服务端安装脚本)
203 没有网页商城,系统菜单的商城窗口是空的。把 40 件商城物品放进商店 14,
挂在 a1/b1/c1 杂货店旁的 NPC 9010 上,按 item_proto gold 金币出售(红龙/蓝龙 1 金币)。
9010 的 mob_proto on_click 原为 2(无处理),改为 1(ON_CLICK_SHOP)才能打开商店。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 23:37:15 +09:00

57 lines
2.9 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 系统菜单里的「商城」按钮发 `/in_game_mall`,服务端回 `mall <url>`,客户端用网页窗口打开这个地址。203 没有网页商城,
URL 指向 google.com,所以窗口是空的。这里的做法是:把商城物品放进一个普通 NPC 商店,按金币卖。
- 商店 vnum 14(`shop` / `shop_item` 表),挂在 NPC 9010「百店老板娘」上(客户端模型 goods_02)。
- 9010 放在三个村(a1 / b1 / c1)的杂货店 9003 旁边,位置写在 `install.sh` 的 `VILLAGES` 里。
- 9010 在 mob_proto 里的 `on_click` 原本是 2,点击后没有任何处理。脚本把它改成 1(ON_CLICK_SHOP,见 game `trigger.cpp`),
点击才会打开商店。`item_mall.quest` 只在测试服下给 9010 加对话选项,正式服不影响。
- 售价写在 item_proto 的 `gold` 列(`item_proto.txt` 第 10 列 / DB `item_proto.gold`)。这 40 件物品的
`shop_buy_price`(卖给 NPC 的价格)是 0,所以不能低买高卖。
- `items.tsv`:vnum、数量、价格、名称,一行一件,最多 40 件(`SHOP_HOST_ITEM_MAX_NUM`,5×8 格)。
## 定价
| 物品 | 价格(金币) |
|---|---|
| 红龙 / 蓝龙的祝福(全部 8 种) | 1 |
| 经验戒指、小偷的手套、幸运金币 30 分 / 3 小时 / 10 小时 | 5 万 / 25 万 / 70 万 |
| 丝绸包囊 30 分 / 3 小时 / 10 小时 | 3 万 / 15 万 / 40 万 |
| 第三只手、兵法六统 15 分 / 30 分 / 3 小时 | 2 万 / 4 万 / 20 万 |
| 仓库扩张卷 15 分 / 30 分 / 3 小时 | 1 万 / 2 万 / 10 万 |
| 龙神的攻击 / 防御 / 生命 / 智力 | 各 10 万 |
| 双倍伤害丸、无视防御丸 | 各 15 万 |
| 经验药水、夺宝手套 | 各 20 万 |
| 物品属性转换秘籍 | 50 万 |
| 追加物品属性秘籍、龙神的祝福书 | 各 100 万 |
价格按时长大致线性递增,长时长的略有折扣。改价格时编辑 `items.tsv`,然后重新安装。
## 安装
```sh
scp -r tools/server/item-mall-shop root@<server>:/root/
ssh root@<server> 'sh /root/item-mall-shop/install.sh'
ssh root@<server> 'cd /usr/metin2/server && sh close.sh; sleep 8; echo 1 | sh start.sh'
```
db 只在启动时读取 item_proto、mob_proto 和商店表,game 只在启动时读取 npc.txt,所以装完必须重启。脚本可以重复运行:
价格和商店每次都按 `items.tsv` 重写;某个村如果已经有 9010,就不会再加一个。
## 回滚
每次运行都会备份到 `/root/backup-itemmall/<时间>/`:
```sh
B=/root/backup-itemmall/<时间>
cp $B/item_proto.txt $B/mob_proto.txt /usr/metin2/server/share/conf/
for m in metin2_map_a1 metin2_map_b1 metin2_map_c1; do
cp $B/$m.npc.txt /usr/metin2/server/share/locale/newcibn/map/$m/npc.txt
done
mysql -uroot player < $B/player-shop.sql
```
回滚后同样要重启。203 上最早的备份(改动之前)在 `/root/backup-itemmall/20260929-162714`,但这份备份里还没有 mob_proto;
9010 原来的 on_click 是 2。