Add VIP cards and the VIP panel (mt_vip)
Cards 38001 (7 days) and 38002 (30 days) extend all seven original premium services of the account; the server side is metin2-server port_premium.h (docs/FEATURE-VIP.md). - mt_vip: /mt_vip 1 status, VIP button by the minimap, remaining time per service, chat line on card use. - tools/server/vip-card: 40250 ships both cards with size 0 (two share a cell, neither moves); give them one cell, stacking, a log and no NPC sale, and name them on the server. - locale_proto_patch: optional item shape table (size, flags, anti flags) so the client proto matches; data/zh_40250/item_shapes_server.tsv. - Item mall (9010): 7 days 5,000,000, 30 days 18,000,000 gold. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
b14fb2ffe9
commit
5dcac9cbd4
@@ -46,6 +46,7 @@
|
||||
| +6 镶嵌石(28700~28713,全部 14 种,宝石页) | 各 1 |
|
||||
| 移动戒指(不限次数、无冷却,见 `../ring-warp`) | 1 |
|
||||
| 追加物品属性秘籍、龙神的祝福书 | 各 100 万 |
|
||||
| VIP 会员卡 7 天 / 30 天(7 项会员特权全部延长,见 `../vip-card`) | 500 万 / 1800 万 |
|
||||
|
||||
## 坐骑(mount)
|
||||
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
71032 1 1000000 龙神的祝福书
|
||||
70058 1 1 移动戒指 不限次数、无冷却(../../ring-warp)
|
||||
50307 1 0 小狩猎套装礼包 1级+9全套、满属性(../../hunt-set)
|
||||
38001 1 5000000 VIP会员卡 7天,7项会员特权全部延长(../../vip-card)
|
||||
38002 1 18000000 VIP会员卡 30天(../../vip-card)
|
||||
71052 1 1 超级属性转换秘籍
|
||||
71051 1 1 超级属性追加秘籍
|
||||
[宝石]
|
||||
|
||||
|
@@ -106,6 +106,7 @@ data)
|
||||
sh "$HERE/ring-warp/install.sh"
|
||||
sh "$HERE/support-skills/install.sh"
|
||||
sh "$HERE/hunt-set/install.sh"
|
||||
sh "$HERE/vip-card/install.sh"
|
||||
sh "$HERE/npc-shops/install.sh" "$HERE/npc-shops/item-mall"
|
||||
sh "$HERE/npc-shops/install.sh" "$HERE/npc-shops/mount"
|
||||
start_server
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
# VIP 会员卡(203 服务端)
|
||||
|
||||
服务端原有 7 种会员特权(`account.account` 的 `*_expire` 列,登录时读入,左上角图标 affect 500~506):
|
||||
|
||||
| 序号 | 特权 | 列 |
|
||||
|---|---|---|
|
||||
| 0 | 经验加成 | `silver_expire` |
|
||||
| 1 | 物品掉落翻倍 | `gold_expire` |
|
||||
| 2 | 仓库扩展到 3 页 | `safebox_expire` |
|
||||
| 3 | 金币直接进背包 | `autoloot_expire` |
|
||||
| 4 | 钓鱼成功率提升 | `fish_mind_expire` |
|
||||
| 5 | 结婚亲密度加快 | `marriage_fast_expire` |
|
||||
| 6 | 金币掉落翻倍 | `money_drop_rate_expire` |
|
||||
|
||||
40250 里没有游戏内开通的途径。VIP 卡用 40250 没用到的两个物品:
|
||||
|
||||
| 物品 | 名称 | 时长 | 百店老板娘「道具」页价格 |
|
||||
|---|---|---|---|
|
||||
| 38001 | VIP会员卡(7天) | 7 天 | 500 万金币 |
|
||||
| 38002 | VIP会员卡(30天) | 30 天 | 1800 万金币 |
|
||||
|
||||
价格在 `../npc-shops/item-mall/items.tsv`,改完重跑 npc-shops 的 install.sh 即可。
|
||||
|
||||
右键使用:7 项特权同时从「现在」和「当前到期时间」中较晚的那个往后延长,立即生效(图标、自动拾取、仓库页数)。
|
||||
剩余时间加上卡的时长超过 400 天时拒绝,卡不扣。两次使用至少间隔 1 秒。客户端小地图旁的「VIP」按钮打开面板,
|
||||
显示每项剩余时间。协议见 metin2-server `docs/FEATURE-VIP.md`。
|
||||
|
||||
## 经验加成 +100%
|
||||
|
||||
newcibn 的会员经验在 `char_battle.cpp` 里固定 ×1.2,之后再乘 `GetMobExpRate` 返回的事件标记
|
||||
`mob_exp_buyer`(默认 100)。`/e mob_exp_buyer 167` 后 1.2 × 1.67 ≈ 2.0,即 +100%。事件标记存在
|
||||
`player.quest`(pid 0),所有核心共享,部署时用 GM 角色设一次即可,重启后仍在。
|
||||
|
||||
## 文件
|
||||
|
||||
- `install.sh`:`item_proto.txt` 里 38001/38002 改为占 1 格、可堆叠、记日志、不能卖给 NPC(40250 原来是
|
||||
size 0,两张卡会叠在同一格、无法移动),服务端改名(`item_names.txt` + `item_proto.locale_name`,GB2312)。
|
||||
需要重启 db 和 game。备份在 `/root/backup-vip-card/<时间>/`。
|
||||
- 游戏端代码在 metin2-server(`port_premium.h`,分支 feature/vip-card)。
|
||||
|
||||
客户端:名称 `data/zh_40250/item_names_zh_overlay.txt`;占格和堆叠 `item_shapes_server.tsv`(由
|
||||
`locale_proto_patch` 写进客户端 item_proto,与服务端一致),由 `scripts/build_zh_locale.py` 打进 locale_zh。
|
||||
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
# Installs the VIP cards (README.md): run on the server from this directory with a game built from
|
||||
# metin2-server feature/vip-card (port_premium.h), then restart db + game. 40250 ships 38001/38002 as unused
|
||||
# ITEM_NONE rows of size 0, which the inventory cannot hold (two of them share a cell, neither can move): this
|
||||
# gives them one cell, stacking, an item log and no NPC sale, and names them on the server (item_names.txt and
|
||||
# item_proto.locale_name; the client has its own names and the same size/flags, data/zh_40250).
|
||||
set -eu
|
||||
|
||||
SERVER=${SERVER:-/usr/metin2/server}
|
||||
PROTO="$SERVER/share/conf/item_proto.txt"
|
||||
NAMES="$SERVER/share/conf/item_names.txt"
|
||||
BACKUP=/root/backup-vip-card/$(date +%Y%m%d-%H%M%S)
|
||||
export LC_ALL=C
|
||||
|
||||
mkdir -p "$BACKUP"
|
||||
cp -p "$PROTO" "$NAMES" "$BACKUP/"
|
||||
mysqldump -uroot player item_proto --where="vnum in (38001,38002)" > "$BACKUP/item_proto-rows.sql"
|
||||
echo "backup: $BACKUP"
|
||||
|
||||
# item_proto.txt: column 5 size, 6 anti flags, 7 flags.
|
||||
awk -F'\t' -v OFS='\t' '$1 == 38001 || $1 == 38002 { $5 = 1; $6 = "ANTI_SELL"; $7 = "ITEM_STACKABLE | LOG"; n++ } { print }
|
||||
END { if (n != 2) { print "item_proto.txt: " n " of 2 cards found" > "/dev/stderr"; exit 1 } }' \
|
||||
"$PROTO" > "$BACKUP/item_proto.new"
|
||||
cat "$BACKUP/item_proto.new" > "$PROTO"
|
||||
|
||||
week=$(printf 'VIP会员卡(7天)' | iconv -f UTF-8 -t GB2312)
|
||||
month=$(printf 'VIP会员卡(30天)' | iconv -f UTF-8 -t GB2312)
|
||||
awk -F'\t' -v OFS='\t' -v week="$week" -v month="$month" '$1 == 38001 { $2 = week; n++ } $1 == 38002 { $2 = month; n++ } { print }
|
||||
END { if (n != 2) { print "item_names.txt: " n " of 2 cards found" > "/dev/stderr"; exit 1 } }' \
|
||||
"$NAMES" > "$BACKUP/item_names.new"
|
||||
cat "$BACKUP/item_names.new" > "$NAMES"
|
||||
|
||||
# ITEM_STACKABLE | ITEM_LOG = 4 | 8192, ITEM_ANTIFLAG_SELL = 256.
|
||||
mysql -uroot player -e "UPDATE item_proto SET size = 1, flag = 8196, antiflag = 256, locale_name = '$week' WHERE vnum = 38001;
|
||||
UPDATE item_proto SET size = 1, flag = 8196, antiflag = 256, locale_name = '$month' WHERE vnum = 38002"
|
||||
echo "done; restart db and game"
|
||||
Reference in New Issue
Block a user