Expand movement ring to all 65 registered maps with paged categories

This commit is contained in:
shen
2026-09-30 17:33:13 -07:00
parent cf9ed052b1
commit 059ceadec2
8 changed files with 2049 additions and 77 deletions
+19 -3
View File
@@ -1,9 +1,11 @@
#!/bin/sh
# Installs the unlimited 移动戒指 (README.md): run on the server from this directory, then restart db + game.
# Replaces quest ring_warp with ./ring_warp.quest (GBK), recompiles all quests with make.py, and names
# Replaces quest ring_warp with ./ring_warp.quest (GBK), compiles only ring_warp in an isolated staging directory, and names
# item 70058 移动戒指 on the server (item_names.txt and item_proto.locale_name; the client has its own name), and
# drops its level 30 limit in item_proto.txt (CHARACTER::CanUseItem refuses it to lower characters).
set -eu
MODE=${1:-full}
case "$MODE" in full|--quest-only) ;; *) echo "usage: $0 [--quest-only]" >&2; exit 2 ;; esac
SERVER=${SERVER:-/usr/metin2/server}
LOCALE=${LOCALE:-newcibn}
@@ -21,7 +23,22 @@ echo "backup: $BACKUP"
# A GBK trail byte 0x5C would be a backslash to qc.
iconv -f UTF-8 -t GBK "$HERE/ring_warp.quest" > "$BACKUP/ring_warp.gbk"
if grep -q '\\' "$BACKUP/ring_warp.gbk"; then echo "ring_warp.quest: backslash byte in GBK" >&2; exit 1; fi
# Compile in isolation before touching any live quest objects.
mkdir -p "$BACKUP/stage" "$BACKUP/object/state" "$BACKUP/object/10031/sig_use"
cp -p "$QUEST/object/state/ring_warp" "$BACKUP/object/state/"
cp -p "$QUEST/object/10031/sig_use/ring_warp.start" "$BACKUP/object/10031/sig_use/"
cp "$QUEST/quest_functions" "$BACKUP/stage/"
cp "$BACKUP/ring_warp.gbk" "$BACKUP/stage/ring_warp.quest"
(cd "$BACKUP/stage" && "$QUEST/qc" ring_warp.quest) > "$BACKUP/qc.log" 2>&1 || { cat "$BACKUP/qc.log" >&2; exit 1; }
test -s "$BACKUP/stage/object/state/ring_warp"
test -s "$BACKUP/stage/object/10031/sig_use/ring_warp.start"
cat "$BACKUP/ring_warp.gbk" > "$QUEST/ring_warp.quest"
cp "$BACKUP/stage/object/state/ring_warp" "$QUEST/object/state/ring_warp"
cp "$BACKUP/stage/object/10031/sig_use/ring_warp.start" "$QUEST/object/10031/sig_use/ring_warp.start"
if [ "$MODE" = "--quest-only" ]; then
echo "done; reload quests on every game core, or restart game cores (db/auth need no restart)"
exit 0
fi
name=$(printf '移动戒指' | iconv -f UTF-8 -t GB2312)
awk -F'\t' -v OFS='\t' -v name="$name" '$1 == 70058 { $2 = name; n++ } { print }
@@ -38,7 +55,6 @@ awk -F'\t' -v OFS='\t' '$1 == 70058 { if ($15 == "LEVEL") { $15 = "LIMIT_NONE";
cat "$BACKUP/item_proto.new" > "$PROTO"
mysql -uroot player -e "UPDATE item_proto SET limittype0 = 0, limitvalue0 = 0 WHERE vnum = 70058 AND limittype0 = 1"
# make.py's shebang (/usr/local/bin/python) does not exist on 203.
cd "$QUEST" && /usr/local/bin/python2.7 make.py > "$BACKUP/make.log" 2>&1 || { tail "$BACKUP/make.log" >&2; exit 1; }
# Only ring_warp is compiled; other quest objects are preserved.
ls "$QUEST/object/10031/sig_use"
echo "done; restart db and game"