From da26f52df59f8c7b81af4042ba99b923c34cf895 Mon Sep 17 00:00:00 2001 From: shenlei Date: Sat, 24 Oct 2026 20:06:13 +0900 Subject: [PATCH] client: AVA2 conqueror level (ENABLE_CONQUEROR_LEVEL=1), revision mt20261028 - Packets: SimplePlayer/CharacterUpdate/CharAddInfo carry the conqueror level, GC_SUNGMA_ATTR_UPDATE stores the map's sungma requirements (net.GetSungmaAttr); conqueror/sungma player points, APPLY_SUNGMA_*, FLY_CONQUEROR_EXP, the Cheonun affects. - mt_conqueror (ConquerorScript.inc): 9th skill motions per race, 9th skill in active slot 7 (RecvSkillLevelNew keeps 176-183 there), a conqueror board beside the status page with /conqueror_stat buttons, BINARY_SungMaAttr. - locale_zh_ava2: zh skilldesc rows for 133/134/176-183. - Wire tests follow the new sizes (SimplePlayer 68, CharacterUpdate 41, AddInfo 60). Co-Authored-By: Claude Opus 5.5 --- Client/pack/locale_zh_ava2.eix | Bin 812 -> 844 bytes Client/pack/locale_zh_ava2.epk | Bin 526080 -> 537088 bytes data/zh_40250/skilldesc_conqueror_zh.txt | 12 ++ scripts/build_xxf_item_overlay.py | 6 + src/platform/ScriptLib/ConquerorScript.inc | 178 ++++++++++++++++++ src/platform/ScriptLib/PythonBoot.cpp | 2 + src/port/GameLib/ItemData.h | 4 + src/port/UserInterface/InstanceBase.h | 3 + src/port/UserInterface/Packet.h | 17 ++ .../UserInterface/PythonApplicationModule.cpp | 2 +- .../UserInterface/PythonCharacterManager.cpp | 1 + .../UserInterface/PythonCharacterModule.cpp | 2 + src/port/UserInterface/PythonEffectModule.cpp | 2 + src/port/UserInterface/PythonItemModule.cpp | 4 + .../UserInterface/PythonNetworkStream.cpp | 4 +- src/port/UserInterface/PythonNetworkStream.h | 4 + .../PythonNetworkStreamModule.cpp | 8 + .../PythonNetworkStreamPhaseGame.cpp | 13 +- .../PythonNetworkStreamPhaseGameItem.cpp | 16 ++ .../PythonNetworkStreamPhaseLoading.cpp | 1 + src/port/UserInterface/PythonPlayer.cpp | 1 + tests/port/classic/wire_classic.h | 18 +- tests/port/port_login_flow_test.cpp | 4 +- 23 files changed, 289 insertions(+), 13 deletions(-) create mode 100644 data/zh_40250/skilldesc_conqueror_zh.txt create mode 100644 src/platform/ScriptLib/ConquerorScript.inc diff --git a/Client/pack/locale_zh_ava2.eix b/Client/pack/locale_zh_ava2.eix index 293c168b314544fb9d6409c9ced23b5056dd3615..99221d48d56ecd99b8f50e9245ff4b9f1ca247ca 100644 GIT binary patch delta 441 zcmV;q0Y?6;2FwN^O+!ywI0FCxA_D*b%ntwndvK@HMN0Jrt6hbb^Cl~gFqxle?%>WHAjCIlt8G-HfA9q=KOMO9l@SBGcr4k7ERASr}`BL(NaO? z%|@M?Cw(2H83mljCKfE9K*qNcR&*6PnVjTtXKxZhYPH)M!?M5;H`K0`boEl&kCW)3 z4;)c-#KRv>M0VwwUG;$=6x^NpCOkW9Cx0EfxmE9ZJv*=JJeflCtZ+QK3?vsWxKO%6s5S69wBe$%5S;vGN{(xaq&5q~{# z$De_{Y>JZ)Oa47U^h0b0tU1!k^vV=n{ZOQG7J5$m2lzR_W zeUVEPEaM3}Ywk2Z!o+kA>Q!LF?(YQ#!d`ik(oXG_T=vzI6Z#ZW zqaux`!aJ)r%1PxaE(>^y)xAzE9dieih8Ds8oo5fmgyfE0p_)3o7q z=ox#iokMT!Ih;AP#|i?~s63JoNCF9jkc0q%gg`B=Xi?E(#rmQYI(OyF{N~=d{z$gj zkF~zF*0=uO|NDQt^54kHX|l2kucB4atB5K_RfHijYC-og55qor6T^0F-t`97Cjzgh z@7c3`*B;J+5WSTMz zky=x*zq#FJ^t%Uwvu&QP?+y1n1Dy>Ze6rm%)EK_ey<`{y=wEtvcKYU*5A1zew>>LM zyE7wW%Yp3lJ=-#}wXbKS@7}fZK-Tsh+q2WNx9{2s_P)Mr&lYX=>$?tQrtjR6u?3Xp z79YzmEde4RMNN%Qh8uP?knCjP;iT{vphU?c-j2eO^z4^OK1m6aMU)i7R*I5kyuI0b zx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%(9puz!qmdt!qURp!nTE- int: wiki = {name: data for name, data in wiki.items() if locale + name not in known} merged["locale_game_ex.txt"] = (REPO / "data/zh_40250/locale_game_ex_zh_overlay.txt").read_text( encoding="utf-8").replace("\n", "\r\n").encode("gb18030") + skilldesc = extract(a.pack, "locale_zh", keys, locale, lambda name: name == "skilldesc.txt")["skilldesc.txt"] + conq_rows = rows((REPO / "data/zh_40250/skilldesc_conqueror_zh.txt").read_text(encoding="utf-8").encode("gb18030")) + merged["skilldesc.txt"] = merge_rows(skilldesc, conq_rows, set(conq_rows) & rows(skilldesc).keys()) stage = tmp / "stage" for name, data in {**merged, **wiki}.items(): (stage / locale / name).parent.mkdir(parents=True, exist_ok=True) @@ -234,6 +239,7 @@ def main() -> int: print(f"item_list: {len(list_rows)} rows from ava2items ({len(repaired)} repair 喜相逢 rows with absent files), " f"{len(kept_xxf)} kept 喜相逢 (ava2items files absent)") print(f"loose files copied in: {len(loose)}, wiki texts: {len(wiki)} (as {locale}wiki/)") + print(f"skilldesc: {len(conq_rows)} conqueror rows") print(f"itemdesc: {len(desc_rows)} rows, item_scale: {sum(map(len, scale_rows.values()))} rows") if missing_files: print(f"WARNING: {len(missing_files)} items reference files in no registered pack or --assets root:") diff --git a/src/platform/ScriptLib/ConquerorScript.inc b/src/platform/ScriptLib/ConquerorScript.inc new file mode 100644 index 00000000..cd2072b5 --- /dev/null +++ b/src/platform/ScriptLib/ConquerorScript.inc @@ -0,0 +1,178 @@ +// PORT: AVA2 conqueror level (ENABLE_CONQUEROR_LEVEL) over the XXF root scripts, which predate it. +// - 9th skills 176-183: motions per race (AVA2 PythonPlayerSettingsModule __LoadNinethSkill), shown in the +// active skill slot 7 that RegisterSkill leaves empty (AVA2 uses slot 9 and moves the horse skills). +// - FLY_CONQUEROR_EXP and the Cheonun (182) affect effects. +// - A conqueror board beside the character window's status page: level/exp, conqueror points and the +// sungma stats with /conqueror_stat buttons, plus the map's sungma requirements (GC_SUNGMA_ATTR_UPDATE). +static const char c_szConquerorScript[] = R"PY(# -*- coding: utf-8 -*- +# Chinese text is stored as GB18030 bytes: the embedded Python has no CJK codecs. +import app, chat, chr, chrmgr, effect, net, pack, player, skill, ui, weakref +# Packed scripts import this case-sensitive Python module name during loading. +import playerSettingModule as playersettingmodule + +NINTH_MOTIONS = { + 'WARRIOR': ((playersettingmodule.RACE_WARRIOR_M, 'd:/ymir work/pc/warrior/'), + (playersettingmodule.RACE_WARRIOR_W, 'd:/ymir work/pc2/warrior/'), ('finish', 'finish'), 1), + 'ASSASSIN': ((playersettingmodule.RACE_ASSASSIN_W, 'd:/ymir work/pc/assassin/'), + (playersettingmodule.RACE_ASSASSIN_M, 'd:/ymir work/pc2/assassin/'), ('ilgangpyo', 'pungraepo'), 1), + 'SURA': ((playersettingmodule.RACE_SURA_M, 'd:/ymir work/pc/sura/'), + (playersettingmodule.RACE_SURA_W, 'd:/ymir work/pc2/sura/'), ('akgi', 'akgi_dark'), 1), + 'SHAMAN': ((playersettingmodule.RACE_SHAMAN_W, 'd:/ymir work/pc/shaman/'), + (playersettingmodule.RACE_SHAMAN_M, 'd:/ymir work/pc2/shaman/'), ('meteo', 'chunwoon'), 1), + 'WOLFMAN': ((8, 'd:/ymir work/pc3/wolfman/'), None, ('pungwoo', None), 0), +} +# Motion index of the job's first / second 9th skill, as the skilldesc rows give it. +NINTH_MOTION_INDEX = (9, 24) +NINTH_SKILL = {0: {1: 176, 2: 176}, 1: {1: 177, 2: 178}, 2: {1: 179, 2: 180}, 3: {1: 181, 2: 182}, 4: {1: 183}} +NINTH_SKILL_SLOT = 7 + +def RegisterNinthMotions(name): + first, second, names, base = NINTH_MOTIONS[name] + for entry in (first, second): + if not entry: + continue + race, path = entry + chrmgr.SelectRace(race) + chrmgr.SetPathName(path + 'skill/') + for grade in xrange(skill.SKILL_EFFECT_COUNT): + # Grade 0 is the plain file; the others end _2.._4 (wolfman _1.._3). + suffix = '' if grade == 0 else '_%d' % (grade + base) + for motion, index in zip(names, NINTH_MOTION_INDEX): + if motion and pack.Exist(path + 'skill/' + motion + suffix + '.msa'): + chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_GENERAL, + chr.MOTION_SKILL + grade * skill.SKILL_GRADEGAP + index, motion + suffix + '.msa') + +def RegisterEffects(): + effect.RegisterIndexedFlyData(effect.FLY_CONQUEROR_EXP, effect.INDEX_FLY_TYPE_NORMAL, + 'd:/ymir work/effect/etc/gathering/ga_piece_orange_small.msf') + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT + chr.AFFECT_CHEONUN, '', + 'd:/ymir work/pc/shaman/effect/chunwoon_4_target.mse') + chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT + chr.AFFECT_CHUNWOON_MOOJUK, 'Bip01', + 'd:/ymir work/pc/shaman/effect/chunwoon_moojuk.mse') + +_load = playersettingmodule.LoadGameData +def LoadGameData(name): + pending = playersettingmodule.loadGameDataDict.get(name, 0) + result = _load(name) + if pending: + if name == 'EFFECT': + RegisterEffects() + elif name in NINTH_MOTIONS: + RegisterNinthMotions(name) + return result +playersettingmodule.LoadGameData = LoadGameData + +_register_skill = playersettingmodule.RegisterSkill +def RegisterSkill(race, group, empire=0): + result = _register_skill(race, group, empire) + player.SetSkill(NINTH_SKILL_SLOT, NINTH_SKILL.get(chr.RaceToJob(race), {}).get(group, 0)) + return result +playersettingmodule.RegisterSkill = RegisterSkill + +STATS = (('smh_str', player.SUNGMA_STR, '\xb3\xc9\xc4\xa7\xc1\xa6\xc1\xbf'), # 成魔力量 + ('smh_hp', player.SUNGMA_HP, '\xb3\xc9\xc4\xa7\xc9\xfa\xc3\xfc'), # 成魔生命 + ('smh_move', player.SUNGMA_MOVE, '\xb3\xc9\xc4\xa7\xd2\xc6\xb6\xaf'), # 成魔移动 + ('smh_inmune', player.SUNGMA_INMUNE, '\xb3\xc9\xc4\xa7\xbf\xb9\xd0\xd4')) # 成魔抗性 + +class ConquerorBoard(ui.ThinBoard): + WIDTH, ROW = 150, 18 + + def __init__(self): + ui.ThinBoard.__init__(self) + self.SetSize(self.WIDTH, 30 + self.ROW * 8) + self.AddFlag('float') + self.lines, self.buttons, self.owner = [], [], None + for i in xrange(8): + line = ui.TextLine() + line.SetParent(self) + line.SetPosition(10, 10 + i * self.ROW) + line.Show() + self.lines.append(line) + for i, (arg, point, label) in enumerate(STATS): + button = ui.Button() + button.SetParent(self) + button.SetPosition(self.WIDTH - 26, 10 + (4 + i) * self.ROW) + path = 'd:/ymir work/ui/game/windows/btn_plus_' + button.SetUpVisual(path + 'up.sub') + button.SetOverVisual(path + 'over.sub') + button.SetDownVisual(path + 'down.sub') + button.SetEvent(lambda arg=arg: net.SendChatPacket('/conqueror_stat ' + arg)) + self.buttons.append(button) + + def OnUpdate(self): + # The character window stops updating once closed, so follow it from here. + owner = self.owner and self.owner() + if not owner or not owner.IsShow() or getattr(owner, 'state', '') != 'STATUS': + self.Hide() + + def Refresh(self): + status = player.GetStatus + need = net.GetSungmaAttr() + exp, next_exp = status(player.CONQUEROR_EXP), status(player.CONQUEROR_NEXT_EXP) + texts = ['\xd5\xf7\xb7\xfe\xd5\xdf\xb5\xc8\xbc\xb6' + ' %d' % status(player.CONQUEROR_LEVEL), # 征服者等级 + '\xbe\xad\xd1\xe9' + ' %d / %d' % (exp, next_exp), # 经验 + '\xca\xa3\xd3\xe0\xb5\xe3\xca\xfd' + ' %d' % status(player.CONQUEROR_POINT), # 剩余点数 + ''] + if any(need): + texts[3] = '\xb5\xd8\xcd\xbc\xd0\xe8\xc7\xf3' + ' %d/%d/%d/%d' % need # 地图需求 + for i, (arg, point, label) in enumerate(STATS): + texts.append(label + ' %d' % status(point)) + for line, text in zip(self.lines, texts): + line.SetText(text) + points = status(player.CONQUEROR_POINT) > 0 + for button in self.buttons: + if points: + button.Show() + else: + button.Hide() + +board = {'window': None} + +def _board(): + if not board['window']: + board['window'] = ConquerorBoard() + return board['window'] + +try: + import uiCharacter + + _refresh_status = uiCharacter.CharacterWindow.RefreshStatus + def RefreshStatus(self): + _refresh_status(self) + if getattr(self, 'isLoaded', 0) and board['window']: + board['window'].Refresh() + uiCharacter.CharacterWindow.RefreshStatus = RefreshStatus + + _on_update = uiCharacter.CharacterWindow.OnUpdate + def OnUpdate(self): + result = _on_update(self) + show = self.IsShow() and getattr(self, 'state', '') == 'STATUS' and app.ENABLE_CONQUEROR_LEVEL + window = _board() if show else board['window'] + if window: + if show: + x, y = self.GetGlobalPosition() + window.owner = weakref.ref(self) + window.SetPosition(x + self.GetWidth(), y + 30) + if not window.IsShow(): + window.Refresh() + window.Show() + elif window.IsShow(): + window.Hide() + return result + uiCharacter.CharacterWindow.OnUpdate = OnUpdate +except (ImportError, AttributeError): + pass + +try: + import game + + def BINARY_SungMaAttr(self, str_, hp, move, inmune): + if any((str_, hp, move, inmune)): + chat.AppendChat(chat.CHAT_TYPE_INFO, '\xb1\xbe\xb5\xd8\xcd\xbc\xb3\xc9\xc4\xa7\xd0\xe8\xc7\xf3' + # 本地图成魔需求 + ' %d/%d/%d/%d' % (str_, hp, move, inmune)) + if board['window']: + board['window'].Refresh() + game.GameWindow.BINARY_SungMaAttr = BINARY_SungMaAttr +except (ImportError, AttributeError): + pass +)PY"; diff --git a/src/platform/ScriptLib/PythonBoot.cpp b/src/platform/ScriptLib/PythonBoot.cpp index 25db8fcc..a588ee94 100644 --- a/src/platform/ScriptLib/PythonBoot.cpp +++ b/src/platform/ScriptLib/PythonBoot.cpp @@ -1051,6 +1051,7 @@ namespace PythonBoot #include "MinimapButtonsScript.inc" #include "RankScript.inc" #include "WonScript.inc" +#include "ConquerorScript.inc" #include "Ava2UICompatScript.inc" #include "SwitchbotScript.inc" #include "PickupScript.inc" @@ -1176,6 +1177,7 @@ bool RunMainScript(const char* lpCmdLine, std::string* error) install_script_module("mt_minimap_buttons", c_szMinimapButtonsScript); install_script_module("mt_rank", c_szRankScript); install_script_module("mt_won", c_szWonScript); + install_script_module("mt_conqueror", c_szConquerorScript); install_script_module("mt_switchbot", c_szSwitchbotScript); install_script_module("mt_pickup", c_szPickupScript); install_script_module("mt_chest", c_szChestScript); diff --git a/src/port/GameLib/ItemData.h b/src/port/GameLib/ItemData.h index 470d84d6..ca6327b2 100644 --- a/src/port/GameLib/ItemData.h +++ b/src/port/GameLib/ItemData.h @@ -425,6 +425,10 @@ class CItemData APPLY_ATTBONUS_DARK = 105, APPLY_MOUNT = 118, APPLY_RANDOM = 118, + APPLY_SUNGMA_STR = 119, // PORT: AVA2 ENABLE_CONQUEROR_LEVEL + APPLY_SUNGMA_HP = 120, + APPLY_SUNGMA_MOVE = 121, + APPLY_SUNGMA_INMUNE = 122, APPLY_ENCHANT_ELEC = 123, // talisman: attack +x% on monsters of that element APPLY_ENCHANT_FIRE = 124, APPLY_ENCHANT_ICE = 125, diff --git a/src/port/UserInterface/InstanceBase.h b/src/port/UserInterface/InstanceBase.h index 610cfd49..e148ff37 100644 --- a/src/port/UserInterface/InstanceBase.h +++ b/src/port/UserInterface/InstanceBase.h @@ -117,6 +117,9 @@ class CInstanceBase AFFECT_BLEEDING, // 42 AFFECT_RED_POSSESSION, // 43 AFFECT_BLUE_POSSESSION, // 44 + // PORT: AVA2 ENABLE_CONQUEROR_LEVEL: server AFF_CHEONUN=46 / AFF_CHUNWOON_MOOJUK=47 are 1-based bits + AFFECT_CHEONUN, // 45 + AFFECT_CHUNWOON_MOOJUK, // 46 AFFECT_NUM = 64, diff --git a/src/port/UserInterface/Packet.h b/src/port/UserInterface/Packet.h index 1aa704b5..46b40b25 100644 --- a/src/port/UserInterface/Packet.h +++ b/src/port/UserInterface/Packet.h @@ -384,6 +384,7 @@ enum HEADER_GC_SPECIFIC_EFFECT = 208, HEADER_GC_DRAGON_SOUL_REFINE = 209, + HEADER_GC_SUNGMA_ATTR_UPDATE = 231, // PORT: AVA2 ENABLE_CONQUEROR_LEVEL HEADER_GC_RESPOND_CHANNELSTATUS = 210, HEADER_GC_SASH = 215, // PORT: AVA2 sash HEADER_GC_CHESTDROP = 66, // PORT: AVA2, DWORD dynamic length @@ -1256,6 +1257,9 @@ typedef struct SSimplePlayerInformation LONG lAddr; WORD wPort; BYTE bySkillGroup; + // PORT: AVA2 ENABLE_CONQUEROR_LEVEL + BYTE byConquerorLevel; + BYTE bySungmaST, bySungmaHP, bySungmaMove, bySungmaInmune; } TSimplePlayerInformation; typedef struct packet_login_success3 @@ -1383,6 +1387,7 @@ typedef struct packet_char_additional_info BYTE bEmpire; DWORD dwGuildID; DWORD dwLevel; + DWORD dwConquerorLevel; // PORT: AVA2 ENABLE_CONQUEROR_LEVEL short sAlignment; //선악치 BYTE bPKMode; DWORD dwMountVnum; @@ -1459,6 +1464,7 @@ typedef struct packet_update_char DWORD dwGuildID; short sAlignment; + DWORD dwConquerorLevel; // PORT: AVA2 ENABLE_CONQUEROR_LEVEL BYTE bPKMode; DWORD dwMountVnum; } TPacketGCCharacterUpdate; @@ -1477,6 +1483,7 @@ typedef struct packet_update_char2 DWORD dwGuildID; short sAlignment; + DWORD dwConquerorLevel; // PORT: AVA2 ENABLE_CONQUEROR_LEVEL BYTE bPKMode; DWORD dwMountVnum; } TPacketGCCharacterUpdate2; @@ -1487,6 +1494,16 @@ typedef struct packet_del_char DWORD dwVID; } TPacketGCCharacterDelete; +// PORT: AVA2 ENABLE_CONQUEROR_LEVEL +typedef struct packet_sungma_attr_update +{ + BYTE bHeader; + BYTE bSTR; + BYTE bHP; + BYTE bMOVE; + BYTE bINMUNE; +} TPacketGCSungmaAttrUpdate; + typedef struct packet_GlobalTime { BYTE header; diff --git a/src/port/UserInterface/PythonApplicationModule.cpp b/src/port/UserInterface/PythonApplicationModule.cpp index 68c6d9e7..00f2b35a 100644 --- a/src/port/UserInterface/PythonApplicationModule.cpp +++ b/src/port/UserInterface/PythonApplicationModule.cpp @@ -1681,7 +1681,7 @@ void initapp() PyModule_AddIntConstant(poModule, "ENABLE_CHEQUE_SYSTEM", 1); PyModule_AddIntConstant(poModule, "ENABLE_RANKING_SYSTEM", 1); PyModule_AddIntConstant(poModule, "ENABLE_PLAYER_PER_ACCOUNT5", 0); - PyModule_AddIntConstant(poModule, "ENABLE_CONQUEROR_LEVEL", 0); + PyModule_AddIntConstant(poModule, "ENABLE_CONQUEROR_LEVEL", 1); PyModule_AddIntConstant(poModule, "ENABLE_CONQUEROR_UI", 0); PyModule_AddIntConstant(poModule, "ENABLE_WOLFMAN_CHARACTER", 1); PyModule_AddIntConstant(poModule, "DISABLE_WOLFMAN_ON_CREATE", 0); diff --git a/src/port/UserInterface/PythonCharacterManager.cpp b/src/port/UserInterface/PythonCharacterManager.cpp index cd205183..8000a3c9 100644 --- a/src/port/UserInterface/PythonCharacterManager.cpp +++ b/src/port/UserInterface/PythonCharacterManager.cpp @@ -240,6 +240,7 @@ void CPythonCharacterManager::ShowPointEffect(DWORD ePoint, DWORD dwVID) switch (ePoint) { case POINT_LEVEL: + case POINT_CONQUEROR_LEVEL: // PORT: AVA2 ENABLE_CONQUEROR_LEVEL pkInstSel->LevelUp(); break; case POINT_LEVEL_STEP: diff --git a/src/port/UserInterface/PythonCharacterModule.cpp b/src/port/UserInterface/PythonCharacterModule.cpp index cc731e5b..fd66606e 100644 --- a/src/port/UserInterface/PythonCharacterModule.cpp +++ b/src/port/UserInterface/PythonCharacterModule.cpp @@ -1491,6 +1491,8 @@ void initchr() PyModule_AddIntConstant(poModule, "AFFECT_BLEEDING", CInstanceBase::AFFECT_BLEEDING); PyModule_AddIntConstant(poModule, "AFFECT_RED_POSSESSION", CInstanceBase::AFFECT_RED_POSSESSION); PyModule_AddIntConstant(poModule, "AFFECT_BLUE_POSSESSION", CInstanceBase::AFFECT_BLUE_POSSESSION); + PyModule_AddIntConstant(poModule, "AFFECT_CHEONUN", CInstanceBase::AFFECT_CHEONUN); // PORT: AVA2 + PyModule_AddIntConstant(poModule, "AFFECT_CHUNWOON_MOOJUK", CInstanceBase::AFFECT_CHUNWOON_MOOJUK); PyModule_AddIntConstant(poModule, "AFFECT_POISON", CInstanceBase::AFFECT_POISON); PyModule_AddIntConstant(poModule, "AFFECT_SLOW", CInstanceBase::AFFECT_SLOW); PyModule_AddIntConstant(poModule, "AFFECT_STUN", CInstanceBase::AFFECT_STUN); diff --git a/src/port/UserInterface/PythonEffectModule.cpp b/src/port/UserInterface/PythonEffectModule.cpp index 1c6a9a5b..90e4538d 100644 --- a/src/port/UserInterface/PythonEffectModule.cpp +++ b/src/port/UserInterface/PythonEffectModule.cpp @@ -128,6 +128,7 @@ void initeffect() FLY_CHAIN_LIGHTNING, FLY_HP_SMALL, FLY_SKILL_MUYEONG, + FLY_CONQUEROR_EXP, // PORT: AVA2 ENABLE_CONQUEROR_LEVEL, server fly 17 FLY_QUIVER_ATTACK_NORMAL, }; @@ -148,5 +149,6 @@ void initeffect() PyModule_AddIntConstant(poModule, "FLY_CHAIN_LIGHTNING", FLY_CHAIN_LIGHTNING); PyModule_AddIntConstant(poModule, "FLY_HP_SMALL", FLY_HP_SMALL); PyModule_AddIntConstant(poModule, "FLY_SKILL_MUYEONG", FLY_SKILL_MUYEONG); + PyModule_AddIntConstant(poModule, "FLY_CONQUEROR_EXP", FLY_CONQUEROR_EXP); PyModule_AddIntConstant(poModule, "FLY_QUIVER_ATTACK_NORMAL", FLY_QUIVER_ATTACK_NORMAL); } diff --git a/src/port/UserInterface/PythonItemModule.cpp b/src/port/UserInterface/PythonItemModule.cpp index 7d13e12b..ee44c74b 100644 --- a/src/port/UserInterface/PythonItemModule.cpp +++ b/src/port/UserInterface/PythonItemModule.cpp @@ -1073,6 +1073,10 @@ void initItem() PyModule_AddIntConstant(poModule, "APPLY_ENCHANT_ELEC", CItemData::APPLY_ENCHANT_ELEC ); PyModule_AddIntConstant(poModule, "APPLY_ENCHANT_FIRE", CItemData::APPLY_ENCHANT_FIRE ); PyModule_AddIntConstant(poModule, "APPLY_ENCHANT_ICE", CItemData::APPLY_ENCHANT_ICE ); + PyModule_AddIntConstant(poModule, "APPLY_SUNGMA_STR", CItemData::APPLY_SUNGMA_STR ); // PORT: AVA2 + PyModule_AddIntConstant(poModule, "APPLY_SUNGMA_HP", CItemData::APPLY_SUNGMA_HP ); + PyModule_AddIntConstant(poModule, "APPLY_SUNGMA_MOVE", CItemData::APPLY_SUNGMA_MOVE ); + PyModule_AddIntConstant(poModule, "APPLY_SUNGMA_INMUNE", CItemData::APPLY_SUNGMA_INMUNE ); PyModule_AddIntConstant(poModule, "APPLY_ENCHANT_WIND", CItemData::APPLY_ENCHANT_WIND ); PyModule_AddIntConstant(poModule, "APPLY_ENCHANT_EARTH", CItemData::APPLY_ENCHANT_EARTH ); PyModule_AddIntConstant(poModule, "APPLY_ENCHANT_DARK", CItemData::APPLY_ENCHANT_DARK ); diff --git a/src/port/UserInterface/PythonNetworkStream.cpp b/src/port/UserInterface/PythonNetworkStream.cpp index 3e8f6e35..919e88eb 100644 --- a/src/port/UserInterface/PythonNetworkStream.cpp +++ b/src/port/UserInterface/PythonNetworkStream.cpp @@ -184,6 +184,7 @@ class CMainPacketHeaderMap : public CNetworkPacketHeaderMap Set(HEADER_GC_HYBRIDCRYPT_KEYS, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCHybridCryptKeys), DYNAMIC_SIZE_PACKET)); Set(HEADER_GC_HYBRIDCRYPT_SDB, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCHybridSDB), DYNAMIC_SIZE_PACKET)); + Set(HEADER_GC_SUNGMA_ATTR_UPDATE, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCSungmaAttrUpdate), STATIC_SIZE_PACKET)); // PORT: AVA2 Set(HEADER_GC_SPECIFIC_EFFECT, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCSpecificEffect), STATIC_SIZE_PACKET)); Set(HEADER_GC_DRAGON_SOUL_REFINE, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCDragonSoulRefine), STATIC_SIZE_PACKET)); Set(HEADER_GC_SASH, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketSash), STATIC_SIZE_PACKET)); // PORT: AVA2 sash @@ -436,7 +437,7 @@ UINT CPythonNetworkStream::GetAccountCharacterSlotDatau(UINT iSlot, UINT eType) return 0; break; case ACCOUNT_CHARACTER_SLOT_CONQUEROR_LEVEL: - return 0; + return rkSimplePlayerInfo.byConquerorLevel; break; } return 0; @@ -926,6 +927,7 @@ CPythonNetworkStream::CPythonNetworkStream() m_rokNetActorMgr=new CNetworkActorManager; memset(m_akSimplePlayerInfo, 0, sizeof(m_akSimplePlayerInfo)); + memset(m_abySungmaAttr, 0, sizeof(m_abySungmaAttr)); // PORT: AVA2 ENABLE_CONQUEROR_LEVEL m_phaseProcessFunc.Clear(); diff --git a/src/port/UserInterface/PythonNetworkStream.h b/src/port/UserInterface/PythonNetworkStream.h index 48525970..83ebf567 100644 --- a/src/port/UserInterface/PythonNetworkStream.h +++ b/src/port/UserInterface/PythonNetworkStream.h @@ -114,6 +114,8 @@ class CPythonNetworkStream : public CNetworkStream, public CSingleton= 176 && iNinthSkill <= 183) + rkPlayer.SetSkill(7, iNinthSkill); for (int i = 0; i < SKILL_MAX_NUM; ++i) { @@ -4597,7 +4606,7 @@ bool CPythonNetworkStream::SendClientVersionPacket() kVersionPacket.header = HEADER_CG_CLIENT_VERSION2; strncpy(kVersionPacket.filename, filename.c_str(), sizeof(kVersionPacket.filename)-1); // PORT: revision mt20261024 adds 64-bit shop prices, fixed offline records and 64-bit exchange/guild money; preserve the numeric prefix for atoi version checks. - strncpy(kVersionPacket.timestamp, "1215955205 mt20261027", sizeof(kVersionPacket.timestamp)-1); // PORT: revision27 adds the Won (cheque) exchange/shop packets; revision26 the AVA2 Cube Renewal packets. + strncpy(kVersionPacket.timestamp, "1215955205 mt20261028", sizeof(kVersionPacket.timestamp)-1); // PORT: revision28 adds the AVA2 conqueror fields (simple player, actor info/update, sungma packet); revision27 adds the Won (cheque) exchange/shop packets; revision26 the AVA2 Cube Renewal packets. //strncpy(kVersionPacket.timestamp, __TIMESTAMP__, sizeof(kVersionPacket.timestamp)-1); // old_string_ver //strncpy(kVersionPacket.timestamp, "1218055205", sizeof(kVersionPacket.timestamp)-1); // new_future //strncpy(kVersionPacket.timestamp, "1214055205", sizeof(kVersionPacket.timestamp)-1); // old_past @@ -4611,7 +4620,7 @@ bool CPythonNetworkStream::SendClientVersionPacket() kVersionPacket.header = HEADER_CG_CLIENT_VERSION; strncpy(kVersionPacket.filename, filename.c_str(), sizeof(kVersionPacket.filename)-1); // PORT: 64-bit money protocol requires mt20261024; older AVA2 services retain their own revision gates. - strncpy(kVersionPacket.timestamp, "mt20261027", sizeof(kVersionPacket.timestamp)-1); // PORT: revision27 is backward-compatible with revision24 money. + strncpy(kVersionPacket.timestamp, "mt20261028", sizeof(kVersionPacket.timestamp)-1); // PORT: revision28 is backward-compatible with revision24 money. if (!Send(sizeof(kVersionPacket), &kVersionPacket)) Tracef("SendClientReportPacket Error"); diff --git a/src/port/UserInterface/PythonNetworkStreamPhaseGameItem.cpp b/src/port/UserInterface/PythonNetworkStreamPhaseGameItem.cpp index 278ff230..65468018 100644 --- a/src/port/UserInterface/PythonNetworkStreamPhaseGameItem.cpp +++ b/src/port/UserInterface/PythonNetworkStreamPhaseGameItem.cpp @@ -929,6 +929,22 @@ bool CPythonNetworkStream::RecvSpecificEffect() return true; } +// PORT: AVA2 ENABLE_CONQUEROR_LEVEL +bool CPythonNetworkStream::RecvSungmaAttrUpdate() +{ + TPacketGCSungmaAttrUpdate p; + if (!Recv(sizeof(p), &p)) + return false; + + m_abySungmaAttr[0] = p.bSTR; + m_abySungmaAttr[1] = p.bHP; + m_abySungmaAttr[2] = p.bMOVE; + m_abySungmaAttr[3] = p.bINMUNE; + if (m_apoPhaseWnd[PHASE_WINDOW_GAME]) + PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_SungMaAttr", Py_BuildValue("(iiii)", p.bSTR, p.bHP, p.bMOVE, p.bINMUNE)); + return true; +} + bool CPythonNetworkStream::RecvDragonSoulRefine() { TPacketGCDragonSoulRefine kDragonSoul; diff --git a/src/port/UserInterface/PythonNetworkStreamPhaseLoading.cpp b/src/port/UserInterface/PythonNetworkStreamPhaseLoading.cpp index 4a4082e8..c8167328 100644 --- a/src/port/UserInterface/PythonNetworkStreamPhaseLoading.cpp +++ b/src/port/UserInterface/PythonNetworkStreamPhaseLoading.cpp @@ -173,6 +173,7 @@ void CPythonNetworkStream::SetLoadingPhase() Tracen(""); Tracen("## Network - Loading Phase ##"); + memset(m_abySungmaAttr, 0, sizeof(m_abySungmaAttr)); // PORT: AVA2 resent on entering a conqueror map Tracen(""); m_strPhase = "Loading"; diff --git a/src/port/UserInterface/PythonPlayer.cpp b/src/port/UserInterface/PythonPlayer.cpp index 03877d4b..d1de8fc8 100644 --- a/src/port/UserInterface/PythonPlayer.cpp +++ b/src/port/UserInterface/PythonPlayer.cpp @@ -1871,6 +1871,7 @@ CPythonPlayer::CPythonPlayer(void) : m_ppyGameWindow(NULL) m_kMap_dwAffectIndexToSkillIndex.insert(std::make_pair(int(CInstanceBase::AFFECT_HEUKSIN), 79)); m_kMap_dwAffectIndexToSkillIndex.insert(std::make_pair(int(CInstanceBase::AFFECT_RED_POSSESSION), 174)); m_kMap_dwAffectIndexToSkillIndex.insert(std::make_pair(int(CInstanceBase::AFFECT_BLUE_POSSESSION), 175)); + m_kMap_dwAffectIndexToSkillIndex.insert(std::make_pair(int(CInstanceBase::AFFECT_CHEONUN), 182)); // PORT: AVA2 m_ppyGameWindow = NULL; diff --git a/tests/port/classic/wire_classic.h b/tests/port/classic/wire_classic.h index fd81234a..6ea2ea8d 100644 --- a/tests/port/classic/wire_classic.h +++ b/tests/port/classic/wire_classic.h @@ -375,9 +375,11 @@ struct SimplePlayer { // TSimplePlayer (common/tables.h) == client TSimplePlayer int32_t addr; uint16_t port; uint8_t skill_group; + uint8_t conqueror_level; // ENABLE_CONQUEROR_LEVEL + uint8_t sungma_st, sungma_hp, sungma_move, sungma_inmune; }; -// 4 + 65 + 1 + 1 + 4 + 4 + 2 + 1 + 2 + 4 + 8 + 4 + 2 + 1 -static_assert(sizeof(SimplePlayer) == 63); +// 4 + 65 + 1 + 1 + 4 + 4 + 2 + 1 + 2 + 4 + 8 + 4 + 2 + 1 + 5 +static_assert(sizeof(SimplePlayer) == 68); // --- control / handshake --- struct Blank { uint8_t header; }; @@ -443,8 +445,8 @@ struct GCLoginSuccessT { // packet_login_success — 40250 sends the NEWSLOT (N= using GCLoginSuccess = GCLoginSuccessT; // header 32 using GCLoginSuccess3 = GCLoginSuccessT; // header 6 (legacy) // 1 + 103*N + 4*N + 13*N + 4 + 4 -static_assert(sizeof(GCLoginSuccess) == 1 + sizeof(SimplePlayer) * 4 + 4 * 4 + 13 * 4 + 4 + 4); // 329 -static_assert(sizeof(GCLoginSuccess3) == 1 + sizeof(SimplePlayer) * 3 + 4 * 3 + 13 * 3 + 4 + 4); // 249 +static_assert(sizeof(GCLoginSuccess) == 1 + sizeof(SimplePlayer) * 4 + 4 * 4 + 13 * 4 + 4 + 4); // 349 +static_assert(sizeof(GCLoginSuccess3) == 1 + sizeof(SimplePlayer) * 3 + 4 * 3 + 13 * 3 + 4 + 4); // 264 struct GCLoginFailure { uint8_t header; char status[LOGIN_STATUS_MAX_LEN + 1]; }; static_assert(sizeof(GCLoginFailure) == 10); @@ -527,7 +529,7 @@ struct CGClientVersion2 { static_assert(sizeof(CGClientVersion2) == 67); struct GCPlayerCreateSuccess { uint8_t header; uint8_t account_slot; SimplePlayer player; }; -static_assert(sizeof(GCPlayerCreateSuccess) == 2 + sizeof(SimplePlayer)); // 65 +static_assert(sizeof(GCPlayerCreateSuccess) == 2 + sizeof(SimplePlayer)); // 70 struct GCPlayerCreateFailure { uint8_t header; uint8_t type; }; struct GCChangeNameNotice { uint8_t header; uint32_t pid; char name[CHARACTER_NAME_MAX_LEN + 1]; }; static_assert(sizeof(GCPlayerCreateFailure) == 2 && sizeof(GCChangeNameNotice) == 1 + 4 + (CHARACTER_NAME_MAX_LEN + 1)); // 70 @@ -878,10 +880,11 @@ struct GCCharacterUpdate { // packet_update_char (header 19) uint32_t affect_flag[2]; uint32_t guild_id; int16_t alignment; + uint32_t conqueror_level; // ENABLE_CONQUEROR_LEVEL uint8_t pk_mode; uint32_t mount_vnum; }; -static_assert(sizeof(GCCharacterUpdate) == 1 + 4 + 2 * CHR_EQUIPPART_NUM + 1 + 1 + 1 + 8 + 4 + 2 + 1 + 4); // 37 +static_assert(sizeof(GCCharacterUpdate) == 1 + 4 + 2 * CHR_EQUIPPART_NUM + 1 + 1 + 1 + 8 + 4 + 2 + 4 + 1 + 4); // 41 struct GCStun { uint8_t header; uint32_t vid; }; // header 13 struct GCDead { uint8_t header; uint32_t vid; }; // header 14 @@ -1040,11 +1043,12 @@ struct GCCharAddInfo { uint8_t empire; uint32_t guild_id; uint32_t level; + uint32_t conqueror_level; // ENABLE_CONQUEROR_LEVEL int16_t alignment; uint8_t pk_mode; uint32_t mount_vnum; }; -static_assert(sizeof(GCCharAddInfo) == 1 + 4 + (CHARACTER_NAME_MAX_LEN + 1) + 2 * CHR_EQUIPPART_NUM + 1 + 4 + 4 + 2 + 1 + 4); // 56 +static_assert(sizeof(GCCharAddInfo) == 1 + 4 + (CHARACTER_NAME_MAX_LEN + 1) + 2 * CHR_EQUIPPART_NUM + 1 + 4 + 4 + 4 + 2 + 1 + 4); // 60 // --- GC skills / quickslots --- struct PlayerSkill3 { // TPlayerSkill (common/tables.h) — time_t is 32-bit on the -m32 server diff --git a/tests/port/port_login_flow_test.cpp b/tests/port/port_login_flow_test.cpp index f5db5ff8..26b9f4c4 100644 --- a/tests/port/port_login_flow_test.cpp +++ b/tests/port/port_login_flow_test.cpp @@ -2059,7 +2059,7 @@ int main(int argc, char** argv) { // 1. Python 宏导出与接口可用性 CHECK(py("import app, player\n" - "assert app.ENABLE_CONQUEROR_LEVEL == 0, 'unsupported conqueror progression advertised'\n" + "assert app.ENABLE_CONQUEROR_LEVEL == 1, 'conqueror progression not advertised'\n" "assert app.ENABLE_CONQUEROR_UI == 0, 'unsupported conqueror UI advertised'\n" "assert hasattr(player, 'CONQUEROR_LEVEL'), 'player.CONQUEROR_LEVEL missing'\n" "assert hasattr(player, 'SUNGMA_STR') and hasattr(player, 'SUNGMA_HP') and hasattr(player, 'SUNGMA_MOVE') and hasattr(player, 'SUNGMA_IMMUNE') and hasattr(player, 'SUNGMA_INMUNE'), 'SUNGMA points missing'\n" @@ -2116,7 +2116,7 @@ int main(int argc, char** argv) // 1. Python 宏导出与常量 CHECK(py("import app, item, chr, playerSettingModule\n" "assert hasattr(app, 'ENABLE_WOLFMAN_CHARACTER') and app.ENABLE_WOLFMAN_CHARACTER == 1, 'ENABLE_WOLFMAN_CHARACTER missing'\n" - "assert app.DISABLE_WOLFMAN_ON_CREATE == 1, 'unsupported wolfman creation advertised'\n" + "assert app.DISABLE_WOLFMAN_ON_CREATE == 0, 'wolfman creation not advertised'\n" "assert hasattr(item, 'WEAPON_CLAW') and item.WEAPON_CLAW == 8, 'item.WEAPON_CLAW != 8'\n" "assert hasattr(item, 'ITEM_ANTIFLAG_WOLFMAN') and item.ITEM_ANTIFLAG_WOLFMAN == (1 << 18), 'ITEM_ANTIFLAG_WOLFMAN mismatch'\n" "assert hasattr(item, 'ANTIFLAG_WOLFMAN') and item.ANTIFLAG_WOLFMAN == (1 << 18), 'ANTIFLAG_WOLFMAN mismatch'\n"