server: support skills at max level on a character's first login
support_skills_max.quest sets 121/122/124/126-129/131 to their skill_proto max, the horse to level 30 (skill 130) and the horse skills 137-139 (140 for assassins), once per character. install.sh adds it to locale_list and pc.set_skill_level to quest_functions (qc rejects it otherwise), then make.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
42e4cf1a9f
commit
f8bbfc7fb3
@@ -0,0 +1,20 @@
|
||||
# 辅助技能满级(203 服务端)
|
||||
|
||||
任务 `support_skills_max`:每个角色第一次登录时(新建角色第一次进游戏,已有角色下次登录),把辅助技能直接设到
|
||||
最高等级,只执行一次(之后任务状态是 `done`)。`pc.set_skill_level` 不消耗技能点,也不检查学习条件。
|
||||
|
||||
| 技能 | 等级 |
|
||||
|---|---|
|
||||
| 121 统御、124 采矿、129 幻化 | 40 |
|
||||
| 122 连击 | 2 |
|
||||
| 126 / 127 / 128 盛唐语 / 秦皇语 / 汉武语 | 20 |
|
||||
| 131 召唤马匹 | 10 |
|
||||
| 130 骑马 | 马的等级:`horse.set_level(30)`(`HORSE_MAX_LEVEL`) |
|
||||
| 137 乱舞、138 突击、139 脱出;140 乱舞(弓)只给刺客 | 1 |
|
||||
|
||||
钓鱼不是技能;123(制作物品)、125、141、142 在 203 的 skill_proto 里没有,不设。
|
||||
|
||||
sh install.sh # 在服务器上,从本目录运行;然后重启 game
|
||||
|
||||
备份在 `/root/backup-support-skills/<时间>`(`locale_list`、`quest_functions`)。qc 只认 `quest_functions` 里列出的函数,
|
||||
`pc.set_skill_level` 在 game 里有(`questlua_pc.cpp`)但清单里没有,install.sh 会补上。
|
||||
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
# Installs quest support_skills_max (README.md): run on the server from this directory, then restart game.
|
||||
# Adds the quest (GBK) to the locale's quest directory and locale_list, pc.set_skill_level to quest_functions,
|
||||
# and recompiles all quests.
|
||||
set -eu
|
||||
|
||||
SERVER=${SERVER:-/usr/metin2/server}
|
||||
LOCALE=${LOCALE:-newcibn}
|
||||
QUEST="$SERVER/share/locale/$LOCALE/quest"
|
||||
HERE=$(cd "$(dirname "$0")" && pwd)
|
||||
BACKUP=/root/backup-support-skills/$(date +%Y%m%d-%H%M%S)
|
||||
export LC_ALL=C
|
||||
|
||||
mkdir -p "$BACKUP"
|
||||
cp -p "$QUEST/locale_list" "$QUEST/quest_functions" "$BACKUP/"
|
||||
echo "backup: $BACKUP"
|
||||
|
||||
iconv -f UTF-8 -t GBK "$HERE/support_skills_max.quest" > "$BACKUP/support_skills_max.gbk"
|
||||
# A GBK trail byte 0x5C would be a backslash to qc.
|
||||
if grep -q '\\' "$BACKUP/support_skills_max.gbk"; then echo "backslash byte in GBK" >&2; exit 1; fi
|
||||
cat "$BACKUP/support_skills_max.gbk" > "$QUEST/support_skills_max.quest"
|
||||
|
||||
# qc only accepts functions listed in quest_functions; game registers pc.set_skill_level (questlua_pc.cpp)
|
||||
# but the list does not have it.
|
||||
grep -qx pc.set_skill_level "$QUEST/quest_functions" || echo pc.set_skill_level >> "$QUEST/quest_functions"
|
||||
|
||||
# make.py strips only the LF of a locale_list line (203's has no newline after the last line).
|
||||
sed -i '' '/^support_skills_max\.quest/d' "$QUEST/locale_list"
|
||||
[ -z "$(tail -c 1 "$QUEST/locale_list")" ] || echo >> "$QUEST/locale_list"
|
||||
echo support_skills_max.quest >> "$QUEST/locale_list"
|
||||
|
||||
# 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; }
|
||||
ls object/notarget/login 2>/dev/null | grep support_skills_max || ls -R object | grep support_skills_max
|
||||
echo "done; restart game"
|
||||
@@ -0,0 +1,36 @@
|
||||
-- Every character gets the support skills at their highest level on its first login (install.sh).
|
||||
-- UTF-8 here; install.sh converts it to GBK for qc. Levels are the max_level of skill_proto on 203.
|
||||
quest support_skills_max begin
|
||||
state start begin
|
||||
when login begin
|
||||
local skills = {
|
||||
{ 121, 40 }, -- 统御
|
||||
{ 122, 2 }, -- 连击
|
||||
{ 124, 40 }, -- 采矿
|
||||
{ 126, 20 }, -- 盛唐语
|
||||
{ 127, 20 }, -- 秦皇语
|
||||
{ 128, 20 }, -- 汉武语
|
||||
{ 129, 40 }, -- 幻化
|
||||
{ 131, 10 }, -- 召唤马匹
|
||||
{ 137, 1 }, -- 乱舞
|
||||
{ 138, 1 }, -- 突击
|
||||
{ 139, 1 }, -- 脱出
|
||||
}
|
||||
for i = 1, table.getn(skills) do
|
||||
pc.set_skill_level(skills[i][1], skills[i][2])
|
||||
end
|
||||
-- 乱舞(弓) is the assassin's (char_skill.cpp: SKILL_HORSE_WILDATTACK_RANGE).
|
||||
if pc.get_job() == 1 then
|
||||
pc.set_skill_level(140, 1)
|
||||
end
|
||||
-- 骑马 (130) is the horse level (CHARACTER::SetHorseLevel), at most HORSE_MAX_LEVEL 30.
|
||||
if horse.get_level() < 30 then
|
||||
horse.set_level(30)
|
||||
end
|
||||
syschat("辅助技能已全部提升到最高等级,马匹已升到30级。")
|
||||
set_state("done")
|
||||
end
|
||||
end
|
||||
state done begin
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user