Port AVA2 native tracker and item-currency ticket shop

This commit is contained in:
shen
2026-10-18 10:41:51 -07:00
parent 83809631ed
commit 5decc93798
33 changed files with 1850 additions and 17 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ GM 测试:`/level 120`,`/item 25168`(或 25169、25170),再 `/warp`
- `lc_quest("KEY")` 和任务提示编号换成中文(203 的任务直接写字符串);`NO_CH2` 改成 203 的格式。
- `GetMissionInfo(level, seconds)` 换成 `cmdchat("RefreshDungeonTimer ...")`。客户端的 `mt_dungeon_timer`(`src/platform/ScriptLib/DungeonTimerScript.inc`)收到后,在小地图的位置显示 AVA2 的副本计时器:Boss 头像、第几层(船防是第几波)和倒计时。船防地图里还会显示 `gethydrahp` 发来的船桅血条。计时器图片在 `../ava2-maps` 打的 ava2maps 包里。
- 去掉 203 没有的战令任务(`do_battlepass_mission`)、地下城追踪(`d.track_update`)和 `DUNGEON_COOLDOWN_EVENT` 分支,普通冷却保留。
- 去掉 203 没有的战令任务(`do_battlepass_mission`)和 `DUNGEON_COOLDOWN_EVENT` 分支,普通冷却保留。2026-10-18 接入原生追踪后保留 `d.track_update`,三份任务已在 sbtest 单独重编译。
- 203 没有 `time_str`,改成秒数。
- 九头蛇地图从 AVA2 的 972800,153600 搬到了 3276800,0,入口 10049,1652 改成 33089,116。
- 修 AVA2 的两个 bug:冰雪任务 `nemere_full_timer` / `nemere_dead_timer` 里的 `index` 没有定义;赤龙 `6230.attack` 的 `set_meley_hp` 同样。
+4 -5
View File
@@ -5,7 +5,7 @@ The quests are AVA2's quest/Mazmorras/{snow,shipdefense,meleylair}.lua with asse
match, so a changed source fails loudly):
- lc_quest("KEY") and the mission notice numbers become zh text (the 203 quests carry their strings inline);
- GetMissionInfo(level, seconds) becomes d.command("RefreshDungeonTimer ...") (the client ignores it for now);
- the battle pass / dungeon tracker calls and the DUNGEON_COOLDOWN_EVENT branch go (203 has neither; the normal
- the battle pass calls and the DUNGEON_COOLDOWN_EVENT branch go (the normal
cooldown stays: snow 60 min, ship and Meley 3 h);
- time_str, which 203 lacks, becomes seconds;
- the hydra map entry moves with the map (AVA2 972800,153600 -> 203 3276800,0: entry 10049,1652 -> 33089,116);
@@ -53,7 +53,7 @@ FIXES=[
('MeleyDungeon','npc.set_meley_hp(index,6230,','npc.set_meley_hp(d.get_map_index(),6230,',8),
('MeleyDungeon','say("Bileti olmayan \xfcyeler: ")','say("以下玩家没有钥匙:")',1),
]
NEW_FUNCTIONS=['d.mission_notice','d.global_warp_all_to_base','d.new_kill_all','d.command','d.dungeon_remove_all',
NEW_FUNCTIONS=['d.track_update','d.mission_notice','d.global_warp_all_to_base','d.new_kill_all','d.command','d.dungeon_remove_all',
'd.kill_area','d.spawn_mob_new','npc.get_protect_time','npc.set_protect_time','npc.set_statu_affect',
'npc.set_statu_clear_aff','npc.show_statu','npc.set_meley_hp','npc.show_end_statu','npc.set_protect_flag2',
'npc.dead_by_vnum','npc.set_hp','npc.get_hp',
@@ -106,11 +106,10 @@ def convert(name,src):
t=re.sub(r'(d\.mission_notice\([^,()]+(?:\(\))?,)"(\d+ ?)"\)',notice,t)
t=re.sub(r'(d\.notice\()"(\d+)"\)',notice,t)
t=mission_info(t,name)
# AVA2 systems 203 does not have: battle pass missions, the dungeon tracker, DUNGEON_COOLDOWN_EVENT.
# AVA2 systems 203 does not have: battle pass missions and DUNGEON_COOLDOWN_EVENT (tracker callback is now native).
t=re.sub(r'[ \t]*do_battlepass_mission\([^\n]*\n','',t)
t=re.sub(r'[ \t]*d\.track_update\([^\n]*\n','',t)
t=re.sub(r'[ \t]*if game\.check_event\([^\n]*\n[^\n]*\n[ \t]*else[ \t]*\n([^\n]*\n)[ \t]*end[ \t]*\n',r'\1',t)
for bad in ('lc_quest','GetMissionInfo(','do_battlepass_mission','track_update','check_event','time_str'):
for bad in ('lc_quest','GetMissionInfo(','do_battlepass_mission','check_event','time_str'):
if bad in t.replace('--GetMissionInfo(','').replace('-- GetMissionInfo(',''):
raise SystemExit('%s: %s left'%(name,bad))
if not re.search(r'^quest %s begin'%re.escape(name),t,re.M):raise SystemExit(name+': quest name changed')