Files
mtgodot-poc/tools/server/hunt-set/README.md
T
shenleiandClaude Opus 5.5 d163aab949 hunt-set: 小狩猎套装礼包 is free in the item mall
CShopEx::Buy rejected price 0 as a hack; allow it like CShop::Buy already does.
Rebuilt and deployed game on 203; buying the box for 0 verified.

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

57 lines
3.4 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.
# 小狩猎套装礼包(203 服务端)
物品 50307(40250 里没被用到的 `任务执行书(初级)`,类型 ITEM_QUEST,使用即触发 `when 50307.use`)改名为
**小狩猎套装礼包**,在百店老板娘「道具」页免费领取(售价 0)(`../npc-shops/item-mall/items.tsv`)。
打开后按职业给一套 1 级可穿的 +9 装备,每件 5 条满值属性(第 6、7 条为空):
| 部位 | 武士 | 刺客 | 修罗 | 法师 |
|---|---|---|---|---|
| 武器(选择) | 19 武士刀 / 3009 混铁斩 | 1009 白铁双刀 / 2009 藤竹弓(附 8000 木箭 ×200)/ 19 武士刀 | 19 武士刀 | 7009 纸折扇 |
| 盔甲 | 11209 | 11409 | 11609 | 11809 |
| 头盔 | 12209 | 12349 | 12489 | 12629 |
盾牌 13009、手镯 14009、鞋子 15009、项链 16009、耳环 17009 各职业相同。法师的铃 5009 要 10 级,不给。
| 部位 | 属性 |
|---|---|
| 武器 | 暴击 10%、贯穿 10%、主属性 +12(武士力量、刺客敏捷、修罗/法师智力)、对恶魔 20%、对不死 20% |
| 盔甲 | 生命 +2000、吸血 10%、攻击力 +50、近身反弹 10%、施法速度 20% |
| 头盔 | 攻速 8%、对动物/兽人/秘教/不死 各 20% |
| 盾牌 | 经验 20%、金钱 20%、免疫晕眩、免疫减速、对恶魔 20% |
| 手镯 | 掉宝 20%、生命 +2000、贯穿 10%、吸血 10%、对动物 20% |
| 鞋子 | 移速 20%、攻速 8%、暴击 10%、经验 20%、金钱 20% |
| 项链 | 生命 +2000、暴击 10%、贯穿 10%、经验 20%、金钱 20% |
| 耳环 | 移速 20%、掉宝 20%、对兽人/秘教/不死 各 20% |
属性都是 `item_attr` 表里该部位允许的类型、5 级的值。背包空格(`CountEmptyInventory`,按格数算)少于 15
时不打开;确认前可以取消,礼包不消耗。
## 文件
- `server.patch`:40250 的任务函数不能写物品属性,补丁在 `questlua_item.cpp` 加
`item.set_attribute(index, apply, value)`(`CItem::SetForceAttribute`,写库并记 ItemLog;apply 0 清空);
另外 `shopEx.cpp` 的 `CShopEx::Buy` 把价格 ≤0 当作弊拒绝,改成 `< 0`(同 `shop.cpp` 里已有的 Fix),
多页商店里售价 0 的物品才能买。
- `hunt_set.quest`:礼包任务(UTF-8,install.sh 转 GBK)。
- `install.sh`:装任务、往 `quest_functions` 补 `item.set_attribute`、`pc.get_empty_inventory_count`、
`pc.count_item`,服务端改名 50307(`item_names.txt` + `item_proto.locale_name`),重新编译任务。
客户端:名称 `data/zh_40250/item_names_zh_overlay.txt`,图标(用 50035 的礼盒图标)和说明
`item_list_zh_overlay.txt`、`itemdesc_zh_overlay.txt`,由 `scripts/build_zh_locale.py` 打进 locale_zh。
## 构建与部署
```sh
cd /usr/metin2/src && patch -p1 < server.patch
cd server/game/src && gmake -j2 GAMEDIR=/root/hunt-out/new # 不覆盖线上 share/bin/game
cd /usr/metin2/server && sh close.sh
cp share/bin/game <备份>; cp /root/hunt-out/new/game share/bin/game
sh install.sh # 本目录
sh ../npc-shops/install.sh ../npc-shops/item-mall
echo 1 | sh start.sh
```
2026-09-30 已在 203 部署。备份在 `/root/backup-hunt-set/`:`questlua_item.cpp.orig`、`bin-<时间>/game`
(旧二进制)、`<时间>/`(locale_list、quest_functions、item_names.txt)。用 GM 角色(武士)实测:礼包打开后
8 件装备属性与上表一致,重新登录后仍在,礼包已扣除;从百店老板娘处以 0 两买到礼包,金钱不变。