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 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-24 20:06:13 +09:00
co-authored by Claude Opus 5.5
parent fa6b8b68db
commit da26f52df5
23 changed files with 289 additions and 13 deletions
Binary file not shown.
Binary file not shown.
+12
View File
@@ -0,0 +1,12 @@
# AVA2 conqueror skills (ENABLE_CONQUEROR_LEVEL) for locale/newcibn/skilldesc.txt; build_xxf_item_overlay.py
# appends these rows in GB18030. Columns as AVA2 en skilldesc.txt; 183 (wolfman) has no AVA2 row and copies 176.
133 SUPPORT 统率力 把一部分统率加成转给队长。 PASSIVE role_proficiency
134 SUPPORT 洞察力 队长分配角色时提高统率加成。 PASSIVE insight
176 WARRIOR 地裂斩 强力地裂斩 究极地裂斩 引发地震的强力一击。 远距离攻击 前方直线范围 命中加成 ATTACK_SKILL|NEED_TARGET|WEAPON_LIMITATION SWORD|TWO_HANDED finish 9 4 攻击力 +%.0f-%.0f (3*minatk+(0.9*minatk+minmwep+1+str*5+dex*3+lv)*SkillPoint) (3*maxatk+(0.9*maxatk+maxmwep+1000+str*5+dex*3+lv)*SkillPoint) 命中加成 %.0f %% 0.4*k+(32*k/2)
177 ASSASSIN 闪光星 强力闪光星 究极闪光星 向敌人投掷耀眼的星光。 远距离攻击 目标周围范围 命中加成 ATTACK_SKILL|NEED_TARGET|WEAPON_LIMITATION DAGGER|DOUBLE_SWORD|SWORD ilgwangpyo 9 4 攻击力 +%.0f-%.0f (minatk+(1.7*minatk+minmwep+1+dex*6+lv*5)*SkillPoint) (maxatk+(1.7*maxatk+maxmwep+1000)+dex*6+lv*5)*SkillPoint) 命中加成 %.0f %% 0.4*k+(32*k/2)
178 ASSASSIN 风雷炮 强力风雷炮 究极风雷炮 造成重创的一箭。 远距离攻击 前方直线范围 命中加成 ATTACK_SKILL|NEED_TARGET|WEAPON_LIMITATION BOW pungloepo 24 4 攻击力 +%.0f-%.0f (1.9*minatk+(2.6*minatk+minmwep+1))*SkillPoint) (1.9*maxatk+(2.6*maxatk+maxmwep+1))*SkillPoint) 命中加成 %.0f %% 0.4*k+(32*k/2)
179 SURA 恶鬼斩 强力恶鬼斩 究极恶鬼斩 将魔力灌注于剑中的猛烈一击。 吸引周围敌人 命中加成 ATTACK_SKILL|WEAPON_LIMITATION|MELEE_ATTACK|NEED_TARGET SWORD geomaggwi 9 4 攻击力 +%.0f-%.0f (1.9*minatk+(2.6*minatk+minmwep+1))*SkillPoint) (1.9*maxatk+(2.6*maxatk+maxmwep+1))*SkillPoint) 命中加成 %.0f %% 0.4*k+(32*k/2)
180 SURA 魔鬼冥波 强力魔鬼冥波 究极魔鬼冥波 唤起对敌人的复仇之念。 远距离攻击 目标周围范围 命中加成 ATTACK_SKILL|NEED_TARGET mabeobaggwi 24 4 魔法攻击力 +%.0f-%.0f (120+6*lv+(5*con+5*dex+30*iq+minmwep+1+9*mwep)*ar*SkillPoint) (120+6*lv+(5*con+5*dex+30*iq+maxmwep+1000+9*mwep)*ar*SkillPoint) 命中加成 %.0f %% 0.4*k+(32*k/2)
181 SHAMAN 陨石术 强力陨石术 究极陨石术 召唤从天而降的陨石。 远距离攻击 目标周围范围 命中加成 ATTACK_SKILL|NEED_TARGET meteo 9 4 魔法攻击力 +%.0f-%.0f (120+6*lv+(5*con+5*dex+30*iq+minmwep+1+9*mwep)*ar*SkillPoint) (120+6*lv+(5*con+5*dex+30*iq+maxmwep+1000+9*mwep)*ar*SkillPoint) 命中加成 %.0f %% 0.4*k+(32*k/2)
182 SHAMAN 天运护盾 强力天运护盾 究极天运护盾 12秒内保护附近队员免受伤害。 作用于附近队员 免除伤害 STANDING_SKILL|CAN_USE_FOR_ME|NEED_TARGET|ONLY_FOR_ALLIANCE cheonun 24 4 护盾持续 %.0f 秒 4*k 保护几率 %.0f %% 0.4*k+(18*k)
183 WOLFMAN 风雨爪 强力风雨爪 究极风雨爪 以利爪掀起风雨的强力一击。 远距离攻击 前方直线范围 命中加成 ATTACK_SKILL|NEED_TARGET|WEAPON_LIMITATION CLAW ilipungu 9 4 攻击力 +%.0f-%.0f (3*minatk+(0.9*minatk+minmwep+1+str*5+dex*3+lv)*SkillPoint) (3*maxatk+(0.9*maxatk+maxmwep+1000+str*5+dex*3+lv)*SkillPoint) 命中加成 %.0f %% 0.4*k+(32*k/2)
+6
View File
@@ -15,6 +15,8 @@ first registered pack wins, so locale_zh hides them. This pack is registered bef
icons/models an added item_list row's files that no registered pack has, from --assets (AVA2 pack_maker)
locale_game_ex.txt data/zh_40250/locale_game_ex_zh_overlay.txt in GB18030; localeinfo.py loads it after
locale/common/locale_game_ex.txt, whose Won (cheque) strings are English or wrongly ordered
skilldesc.txt 喜相逢 rows + data/zh_40250/skilldesc_conqueror_zh.txt (AVA2 conqueror skills 133/134/176-183,
which the 喜相逢 skilldesc lacks) in GB18030
Usage: scripts/build_xxf_item_overlay.py [--build build/switchbot-check] [--pack Client/pack] [--ava2items DIR]
"""
@@ -211,6 +213,9 @@ def main() -> 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:")
+178
View File
@@ -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";
+2
View File
@@ -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);
+4
View File
@@ -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,
+3
View File
@@ -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,
+17
View File
@@ -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;
@@ -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);
@@ -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:
@@ -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);
@@ -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);
}
@@ -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 );
@@ -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();
@@ -114,6 +114,8 @@ class CPythonNetworkStream : public CNetworkStream, public CSingleton<CPythonNet
UINT GetAccountCharacterSlotDatau(UINT iSlot, UINT eType);
const char* GetAccountCharacterSlotDataz(UINT iSlot, UINT eType);
// PORT: AVA2 ENABLE_CONQUEROR_LEVEL: current map's sungma requirements (str, hp, move, inmune)
const BYTE* GetSungmaAttr() const { return m_abySungmaAttr; }
// SUPPORT_BGM
const char* GetFieldMusicFileName();
@@ -597,6 +599,7 @@ class CPythonNetworkStream : public CNetworkStream, public CSingleton<CPythonNet
// 서버에서 지정한 이팩트 발동 패킷.
bool RecvSpecificEffect();
bool RecvSungmaAttrUpdate(); // PORT: AVA2 ENABLE_CONQUEROR_LEVEL
// 용혼석 관련
bool RecvDragonSoulRefine();
@@ -684,6 +687,7 @@ class CPythonNetworkStream : public CNetworkStream, public CSingleton<CPythonNet
protected:
TPacketGCHandshake m_HandshakeData;
BYTE m_abySungmaAttr[4];
DWORD m_dwChangingPhaseTime;
DWORD m_dwBindupRetryCount;
DWORD m_dwMainActorVID;
@@ -169,6 +169,13 @@ PyObject* netIsSelectedEmpire(PyObject* poSelf, PyObject* poArgs)
}
// PORT: AVA2 ENABLE_CONQUEROR_LEVEL
PyObject* netGetSungmaAttr(PyObject* poSelf, PyObject* poArgs)
{
const BYTE* a = CPythonNetworkStream::Instance().GetSungmaAttr();
return Py_BuildValue("(iiii)", a[0], a[1], a[2], a[3]);
}
PyObject* netGetAccountCharacterSlotDataInteger(PyObject* poSelf, PyObject* poArgs)
{
int nIndex;
@@ -2009,6 +2016,7 @@ void initnet()
{ "GetMainActorEmpire", netGetMainActorEmpire, METH_VARARGS },
{ "GetMainActorSkillGroup", netGetMainActorSkillGroup, METH_VARARGS },
{ "GetAccountCharacterSlotDataInteger", netGetAccountCharacterSlotDataInteger, METH_VARARGS },
{ "GetSungmaAttr", netGetSungmaAttr, METH_VARARGS },
{ "GetAccountCharacterSlotDataString", netGetAccountCharacterSlotDataString, METH_VARARGS },
// FIELD_MUSIC
@@ -631,6 +631,10 @@ void CPythonNetworkStream::GamePhase()
ret = RecvSpecificEffect();
break;
case HEADER_GC_SUNGMA_ATTR_UPDATE: // PORT: AVA2 ENABLE_CONQUEROR_LEVEL
ret = RecvSungmaAttrUpdate();
break;
case HEADER_GC_DRAGON_SOUL_REFINE:
ret = RecvDragonSoulRefine();
break;
@@ -2553,8 +2557,13 @@ bool CPythonNetworkStream::RecvSkillLevelNew()
CPythonPlayer& rkPlayer=CPythonPlayer::Instance();
// PORT: AVA2 ENABLE_CONQUEROR_LEVEL: slot 7 also holds the 9th (conqueror) skill that mt_conqueror's RegisterSkill puts there;
// keep it unless one of 112-115 claims the slot below.
const int iNinthSkill = rkPlayer.GetSkillIndex(7);
rkPlayer.SetSkill(7, 0);
rkPlayer.SetSkill(8, 0);
if (iNinthSkill >= 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");
@@ -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;
@@ -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";
+1
View File
@@ -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;
+11 -7
View File
@@ -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<PLAYER_PER_ACCOUNT>; // header 32
using GCLoginSuccess3 = GCLoginSuccessT<PLAYER_PER_ACCOUNT3>; // 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
+2 -2
View File
@@ -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"