client: AVA2 wolfman character (ENABLE_WOLFMAN_CHARACTER=1)

Race 8 claw motion mode, skill motions 170-175, claw weapon attach,
ANTI_WOLFMAN item flag; tools/server/wolfman/make_items.py writes the
server item rows. ENABLE_VIEW_TARGET_DECIMAL_HP back to 0: GC_TARGET only
carries bHPPercent, so the 4-argument root SetHPTargetBoard raised a
TypeError on every target. Version gate stays mt20261027 (no packet change).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-24 16:32:48 +09:00
co-authored by Claude Opus 5.5
parent 1a4d8295ff
commit fa6b8b68db
18 changed files with 197 additions and 8 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
enum
{
MAIN_RACE_MAX_NUM = 8,
MAIN_RACE_MAX_NUM = 9, // PORT: + wolfman (race 8)
};
void CActorInstance::INSTANCEBASE_Deform()
+2
View File
@@ -588,6 +588,8 @@ class CActorInstance : public IActorInstance, public IFlyTargetableObject
void ProcessMotionEventSound(const CRaceMotionData::TMotionEventData * c_pData);
void ProcessMotionEventFly(const CRaceMotionData::TMotionEventData * c_pData);
void ProcessMotionEventWarp(const CRaceMotionData::TMotionEventData * c_pData);
void ProcessMotionEventUnk11(DWORD dwcurFrame, int iIndex, const CRaceMotionData::TMotionEventData * c_pData);
void ProcessMotionEventUnk12(DWORD dwcurFrame, int iIndex, const CRaceMotionData::TMotionEventData * c_pData);
void AddMovement(float fx, float fy, float fz);
+4
View File
@@ -107,6 +107,8 @@ bool CActorInstance::__IsLeftHandWeapon(DWORD type)
return true;
else if (CItemData::WEAPON_BOW == type)
return true;
else if (CItemData::WEAPON_CLAW == type)
return true;
else
return false;
}
@@ -117,6 +119,8 @@ bool CActorInstance::__IsRightHandWeapon(DWORD type)
return true;
else if (CItemData::WEAPON_BOW == type)
return false;
else if (CItemData::WEAPON_CLAW == type)
return true;
else
return true;
}
+2
View File
@@ -444,10 +444,12 @@ BOOL CActorInstance::IsActEmotion()
case CRaceMotionData::NAME_FRENCH_KISS_START+1:
case CRaceMotionData::NAME_FRENCH_KISS_START+2:
case CRaceMotionData::NAME_FRENCH_KISS_START+3:
case CRaceMotionData::NAME_FRENCH_KISS_START+4:
case CRaceMotionData::NAME_KISS_START+0:
case CRaceMotionData::NAME_KISS_START+1:
case CRaceMotionData::NAME_KISS_START+2:
case CRaceMotionData::NAME_KISS_START+3:
case CRaceMotionData::NAME_KISS_START+4:
return TRUE;
break;
}
+7
View File
@@ -519,18 +519,22 @@ BOOL CActorInstance::isLock()
case CRaceMotionData::NAME_KISS_WITH_ASSASSIN:
case CRaceMotionData::NAME_KISS_WITH_SURA:
case CRaceMotionData::NAME_KISS_WITH_SHAMAN:
case CRaceMotionData::NAME_KISS_WITH_WOLFMAN:
case CRaceMotionData::NAME_FRENCH_KISS_WITH_WARRIOR:
case CRaceMotionData::NAME_FRENCH_KISS_WITH_ASSASSIN:
case CRaceMotionData::NAME_FRENCH_KISS_WITH_SURA:
case CRaceMotionData::NAME_FRENCH_KISS_WITH_SHAMAN:
case CRaceMotionData::NAME_FRENCH_KISS_WITH_WOLFMAN:
case CRaceMotionData::NAME_SLAP_HIT_WITH_WARRIOR:
case CRaceMotionData::NAME_SLAP_HIT_WITH_ASSASSIN:
case CRaceMotionData::NAME_SLAP_HIT_WITH_SURA:
case CRaceMotionData::NAME_SLAP_HIT_WITH_SHAMAN:
case CRaceMotionData::NAME_SLAP_HIT_WITH_WOLFMAN:
case CRaceMotionData::NAME_SLAP_HURT_WITH_WARRIOR:
case CRaceMotionData::NAME_SLAP_HURT_WITH_ASSASSIN:
case CRaceMotionData::NAME_SLAP_HURT_WITH_SURA:
case CRaceMotionData::NAME_SLAP_HURT_WITH_SHAMAN:
case CRaceMotionData::NAME_SLAP_HURT_WITH_WOLFMAN:
return TRUE;
break;
}
@@ -836,6 +840,9 @@ bool CActorInstance::__IsNeedFlyTargetMotion()
if (!m_pkCurRaceMotionData->GetMotionEventDataPointer(i, &c_pData))
continue;
if (c_pData->iType == CRaceMotionData::MOTION_EVENT_TYPE_UNK11)
return true;
if (c_pData->iType == CRaceMotionData::MOTION_EVENT_TYPE_WARP)
return true;
@@ -76,6 +76,17 @@ void CActorInstance::MotionEventProcess(DWORD dwcurFrame, int iIndex, const CRac
case CRaceMotionData::MOTION_EVENT_TYPE_WARP:
#ifndef WORLD_EDITOR
ProcessMotionEventWarp(c_pData);
#endif
break;
case CRaceMotionData::MOTION_EVENT_TYPE_UNK11:
#ifndef WORLD_EDITOR
ProcessMotionEventUnk11(dwcurFrame, iIndex, c_pData);
#endif
break;
case CRaceMotionData::MOTION_EVENT_TYPE_UNK12:
#ifndef WORLD_EDITOR
ProcessMotionEventUnk12(dwcurFrame, iIndex, c_pData);
#endif
break;
}
@@ -329,3 +340,35 @@ void CActorInstance::ProcessMotionEventWarp(const CRaceMotionData::TMotionEventD
//TraceError("ActorInstance::ProcessMotionEventFly No Target");
}
}
void CActorInstance::ProcessMotionEventUnk11(DWORD dwcurFrame, int iIndex, const CRaceMotionData::TMotionEventData * c_pData) // AniSpeed ON
{
if (CRaceMotionData::MOTION_EVENT_TYPE_UNK11 != c_pData->iType)
return;
const CRaceMotionData::TMotionUnk11EventData * c_pUnk11TargetData = (const CRaceMotionData::TMotionUnk11EventData *)c_pData;
static const float sc_fDistanceFromTarget = 270.0f;
if (m_kFlyTarget.IsValidTarget())
{
D3DXVECTOR3 v3MainPosition(m_x, m_y, m_z);
const D3DXVECTOR3 & c_rv3TargetPosition = __GetFlyTargetPosition();
D3DXVECTOR3 v3Distance = c_rv3TargetPosition - v3MainPosition;
D3DXVec3Normalize(&v3Distance, &v3Distance);
TPixelPosition DestPixelPosition = c_rv3TargetPosition - (v3Distance * (sc_fDistanceFromTarget+c_pUnk11TargetData->iAniSpeed));
IBackground& rkBG=GetBackground();
if (!rkBG.IsBlock(DestPixelPosition.x, -DestPixelPosition.y))
SetPixelPosition(DestPixelPosition);
LookAt(c_rv3TargetPosition.x, c_rv3TargetPosition.y);
__OnWarp();
}
}
void CActorInstance::ProcessMotionEventUnk12(DWORD dwcurFrame, int iIndex, const CRaceMotionData::TMotionEventData * c_pData) // AniSpeed OFF
{
}
+1 -1
View File
@@ -216,7 +216,7 @@ void CItemData::SetItemTableData(TItemTable * pItemTable)
}
// PORT: AVA2 ItemData.cpp SetItemScale/GetItemScale. The position columns are dropped: AVA2 feeds
// them to SetScalePosition, which its deform never reads. JOB_WOLFMAN rows are skipped (no wolfman).
// them to SetScalePosition, which its deform never reads.
void CItemData::SetItemScale(const std::string & strJob, const std::string & strSex, const std::string & strScaleX, const std::string & strScaleY, const std::string & strScaleZ)
{
DWORD dwPos;
+1
View File
@@ -132,6 +132,7 @@ BOOL CRaceData::GetMotionKey(WORD wMotionModeIndex, WORD wMotionIndex, MOTION_KE
case CRaceMotionData::MODE_HORSE_FAN:
case CRaceMotionData::MODE_HORSE_BELL:
case CRaceMotionData::MODE_HORSE_BOW:
case CRaceMotionData::MODE_HORSE_CLAW:
wGeneralMode=CRaceMotionData::MODE_HORSE;
break;
+10
View File
@@ -89,18 +89,22 @@ void CRaceMotionData::SetName(UINT eName)
case NAME_KISS_WITH_ASSASSIN:
case NAME_KISS_WITH_SURA:
case NAME_KISS_WITH_SHAMAN:
case NAME_KISS_WITH_WOLFMAN:
case NAME_FRENCH_KISS_WITH_WARRIOR:
case NAME_FRENCH_KISS_WITH_ASSASSIN:
case NAME_FRENCH_KISS_WITH_SURA:
case NAME_FRENCH_KISS_WITH_SHAMAN:
case NAME_FRENCH_KISS_WITH_WOLFMAN:
case NAME_SLAP_HIT_WITH_WARRIOR:
case NAME_SLAP_HIT_WITH_ASSASSIN:
case NAME_SLAP_HIT_WITH_SURA:
case NAME_SLAP_HIT_WITH_SHAMAN:
case NAME_SLAP_HIT_WITH_WOLFMAN:
case NAME_SLAP_HURT_WITH_WARRIOR:
case NAME_SLAP_HURT_WITH_ASSASSIN:
case NAME_SLAP_HURT_WITH_SURA:
case NAME_SLAP_HURT_WITH_SHAMAN:
case NAME_SLAP_HURT_WITH_WOLFMAN:
case NAME_DIG:
SetType(TYPE_EVENT);
break;
@@ -436,6 +440,12 @@ bool CRaceMotionData::LoadMotionData(const char * c_szFileName)
case MOTION_EVENT_TYPE_EFFECT_TO_TARGET:
pData = new TMotionEffectToTargetEventData;
break;
case MOTION_EVENT_TYPE_UNK11:
pData = new TMotionUnk11EventData;
break;
case MOTION_EVENT_TYPE_UNK12:
pData = new TMotionUnk12EventData;
break;
default:
assert(!" CRaceMotionData::LoadMotionData - Strange Event Type");
return false;
+4
View File
@@ -178,6 +178,8 @@ class CRaceMotionData
MOTION_EVENT_TYPE_CHARACTER_HIDE,
MOTION_EVENT_TYPE_WARP,
MOTION_EVENT_TYPE_EFFECT_TO_TARGET,
MOTION_EVENT_TYPE_UNK11, // wolfman: warp next to the fly target (BaseVelocity)
MOTION_EVENT_TYPE_UNK12,
MOTION_EVENT_TYPE_MAX_NUM,
};
@@ -200,6 +202,8 @@ class CRaceMotionData
typedef struct NMotionEvent::SMotionEventDataCharacterHide TMotionCharacterHideEventData;
typedef struct NMotionEvent::SMotionEventDataWarp TMotionWarpEventData;
typedef struct NMotionEvent::SMotionEventDataEffectToTarget TMotionEffectToTargetEventData;
typedef struct NMotionEvent::SMotionEventDataUnk11 TMotionUnk11EventData;
typedef struct NMotionEvent::SMotionEventDataUnk12 TMotionUnk12EventData;
typedef std::vector<TMotionEventData*> TMotionEventDataVector;
public:
+34
View File
@@ -287,4 +287,38 @@ namespace NMotionEvent
void Save(FILE * File, int iTabs) {}
void Load() {}
} TMotionWarpEventData;
// Unk11 AniSpeed (wolfman, type 11)
typedef struct SMotionEventDataUnk11 : public SMotionEventData
{
int iAniSpeed;
SMotionEventDataUnk11() {}
virtual ~SMotionEventDataUnk11() {}
void Save(FILE * File, int iTabs)
{
PrintfTabs(File, iTabs, "\n");
PrintfTabs(File, iTabs, "BaseVelocity \"%d\"\n", iAniSpeed);
}
bool Load(CTextFileLoader & rTextFileLoader)
{
if (!rTextFileLoader.GetTokenInteger("basevelocity", &iAniSpeed))
return false;
return true;
}
} TMotionEventDataUnk11;
// Unk12 (wolfman, type 12)
typedef struct SMotionEventDataUnk12 : public SMotionEventData
{
int iAniSpeed;
SMotionEventDataUnk12() {}
virtual ~SMotionEventDataUnk12() {}
void Save(FILE * File, int iTabs) {}
void Load() {}
} TMotionEventDataUnk12;
};
+13 -1
View File
@@ -2829,6 +2829,10 @@ UINT CInstanceBase::__GetRefinedEffect(CItemData* pItem)
case CItemData::WEAPON_BOW:
m_swordRefineEffectRight = EFFECT_REFINED+EFFECT_BOW_REFINED7+refine-7;
break;
case CItemData::WEAPON_CLAW:
m_swordRefineEffectRight = EFFECT_REFINED+EFFECT_SMALLSWORD_REFINED7+refine-7;
m_swordRefineEffectLeft = EFFECT_REFINED+EFFECT_SMALLSWORD_REFINED7_LEFT+refine-7;
break;
default:
m_swordRefineEffectRight = EFFECT_REFINED+EFFECT_SWORD_REFINED7+refine-7;
}
@@ -2845,7 +2849,7 @@ UINT CInstanceBase::__GetRefinedEffect(CItemData* pItem)
{
DWORD vnum = pItem->GetIndex();
if (12010 <= vnum && vnum <= 12049)
if ((12010 <= vnum && vnum <= 12049) || (21080 <= vnum && vnum <= 21089))
{
__AttachEffect(EFFECT_REFINED+EFFECT_BODYARMOR_SPECIAL);
__AttachEffect(EFFECT_REFINED+EFFECT_BODYARMOR_SPECIAL2);
@@ -3074,6 +3078,10 @@ void CInstanceBase::RefreshState(DWORD dwMotIndex, bool isLoop)
SetMotionMode(CRaceMotionData::MODE_HORSE_BOW); // Only Shaman
break;
case CItemData::WEAPON_CLAW:
SetMotionMode(CRaceMotionData::MODE_HORSE_CLAW); // Only Wolfman
break;
default:
SetMotionMode(CRaceMotionData::MODE_HORSE);
break;
@@ -3107,6 +3115,10 @@ void CInstanceBase::RefreshState(DWORD dwMotIndex, bool isLoop)
SetMotionMode(CRaceMotionData::MODE_BELL); // Only Shaman
break;
case CItemData::WEAPON_CLAW:
SetMotionMode(CRaceMotionData::MODE_CLAW); // Only Wolfman
break;
case CItemData::WEAPON_ARROW:
default:
SetMotionMode(CRaceMotionData::MODE_GENERAL);
@@ -1592,7 +1592,7 @@ void initapp()
PyModule_AddIntConstant(poModule, "ENABLE_SWITCHBOT", 1);
PyModule_AddIntConstant(poModule, "ENABLE_TARGET_INFORMATION_SYSTEM", 1);
PyModule_AddIntConstant(poModule, "ENABLE_USE_COSTUME_ATTR", 1);
PyModule_AddIntConstant(poModule, "ENABLE_VIEW_TARGET_DECIMAL_HP", 1);
PyModule_AddIntConstant(poModule, "ENABLE_VIEW_TARGET_DECIMAL_HP", 0); // GC_TARGET carries only bHPPercent
PyModule_AddIntConstant(poModule, "ENABLE_VIEW_TARGET_PLAYER_HP", 1);
PyModule_AddIntConstant(poModule, "ENABLE_WINDOW_SLIDE_EFFECT", 0);
// PORT: Won exchange window -> server /won_exchange (revision27).
@@ -1684,7 +1684,7 @@ void initapp()
PyModule_AddIntConstant(poModule, "ENABLE_CONQUEROR_LEVEL", 0);
PyModule_AddIntConstant(poModule, "ENABLE_CONQUEROR_UI", 0);
PyModule_AddIntConstant(poModule, "ENABLE_WOLFMAN_CHARACTER", 1);
PyModule_AddIntConstant(poModule, "DISABLE_WOLFMAN_ON_CREATE", 1);
PyModule_AddIntConstant(poModule, "DISABLE_WOLFMAN_ON_CREATE", 0);
#ifdef USE_OPENID
PyModule_AddIntConstant(poModule, "USE_OPENID", 1);
+6
View File
@@ -17,6 +17,7 @@ enum
MAIN_RACE_ASSASSIN_M,
MAIN_RACE_SURA_W,
MAIN_RACE_SHAMAN_M,
MAIN_RACE_WOLFMAN_M,
MAIN_RACE_MAX_NUM,
};
@@ -349,6 +350,9 @@ DWORD CPythonPlayer::__GetRaceStat()
case MAIN_RACE_SHAMAN_W:
return GetStatus(POINT_IQ);
break;
case MAIN_RACE_WOLFMAN_M:
return GetStatus(POINT_DX);
break;
}
return GetStatus(POINT_ST);
}
@@ -1865,6 +1869,8 @@ CPythonPlayer::CPythonPlayer(void) : m_ppyGameWindow(NULL)
m_kMap_dwAffectIndexToSkillIndex.insert(std::make_pair(int(CInstanceBase::AFFECT_GWIGEOM), 63));
m_kMap_dwAffectIndexToSkillIndex.insert(std::make_pair(int(CInstanceBase::AFFECT_MUYEONG), 78));
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_ppyGameWindow = NULL;
+4
View File
@@ -917,6 +917,7 @@ CPythonSkill::CPythonSkill()
m_SkillTypeIndexMap.insert(std::map<std::string, DWORD>::value_type("sura", SKILL_TYPE_ACTIVE));
m_SkillTypeIndexMap.insert(std::map<std::string, DWORD>::value_type("shaman", SKILL_TYPE_ACTIVE));
m_SkillTypeIndexMap.insert(std::map<std::string, DWORD>::value_type("passive", SKILL_TYPE_ACTIVE));
m_SkillTypeIndexMap.insert(std::map<std::string, DWORD>::value_type("wolfman", SKILL_TYPE_ACTIVE));
m_SkillAttributeIndexMap.insert(std::map<std::string, DWORD>::value_type("NEED_POISON_BOTTLE", SKILL_ATTRIBUTE_NEED_POISON_BOTTLE));
m_SkillAttributeIndexMap.insert(std::map<std::string, DWORD>::value_type("NEED_EMPTY_BOTTLE", SKILL_ATTRIBUTE_NEED_EMPTY_BOTTLE));
@@ -952,12 +953,14 @@ CPythonSkill::CPythonSkill()
m_SkillNeedWeaponIndexMap.insert(std::map<std::string, DWORD>::value_type("FAN", SKILL_NEED_WEAPON_FAN));
m_SkillNeedWeaponIndexMap.insert(std::map<std::string, DWORD>::value_type("ARROW", SKILL_NEED_WEAPON_ARROW));
m_SkillNeedWeaponIndexMap.insert(std::map<std::string, DWORD>::value_type("EMPTY_HAND", SKILL_NEED_WEAPON_EMPTY_HAND));
m_SkillNeedWeaponIndexMap.insert(std::map<std::string, DWORD>::value_type("CLAW", SKILL_NEED_WEAPON_CLAW));
m_SkillWeaponTypeIndexMap.insert(std::make_pair(std::string("SWORD"), CItemData::WEAPON_SWORD));
m_SkillWeaponTypeIndexMap.insert(std::make_pair(std::string("DAGGER"), CItemData::WEAPON_DAGGER));
m_SkillWeaponTypeIndexMap.insert(std::make_pair(std::string("BOW"), CItemData::WEAPON_BOW));
m_SkillWeaponTypeIndexMap.insert(std::make_pair(std::string("TWO_HANDED"), CItemData::WEAPON_TWO_HANDED));
m_SkillWeaponTypeIndexMap.insert(std::make_pair(std::string("DOUBLE_SWORD"), CItemData::WEAPON_DAGGER));
m_SkillWeaponTypeIndexMap.insert(std::make_pair(std::string("CLAW"), CItemData::WEAPON_CLAW));
m_SkillWeaponTypeIndexMap.insert(std::make_pair(std::string("BELL"), CItemData::WEAPON_BELL));
m_SkillWeaponTypeIndexMap.insert(std::make_pair(std::string("FAN"), CItemData::WEAPON_FAN));
m_SkillWeaponTypeIndexMap.insert(std::make_pair(std::string("ARROW"), CItemData::WEAPON_ARROW));
@@ -1037,6 +1040,7 @@ CPythonSkill::CPythonSkill()
m_PathNameMap.insert(std::make_pair(std::string("SURA"), std::string("sura")));
m_PathNameMap.insert(std::make_pair(std::string("SHAMAN"), std::string("shaman")));
m_PathNameMap.insert(std::make_pair(std::string("PASSIVE"), std::string("passive")));
m_PathNameMap.insert(std::make_pair(std::string("WOLFMAN"), std::string("wolfman")));
m_PathNameMap.insert(std::make_pair(std::string("SUPPORT"), std::string("common/support")));
m_PathNameMap.insert(std::make_pair(std::string("GUILD"), std::string("common/guild")));
m_PathNameMap.insert(std::make_pair(std::string("HORSE"), std::string("common/horse")));
+1
View File
@@ -125,6 +125,7 @@ class CPythonSkill : public CSingleton<CPythonSkill>
SKILL_NEED_WEAPON_BELL = (1 << CItemData::WEAPON_BELL),
SKILL_NEED_WEAPON_FAN = (1 << CItemData::WEAPON_FAN),
SKILL_NEED_WEAPON_ARROW = (1 << CItemData::WEAPON_ARROW),
SKILL_NEED_WEAPON_CLAW = (1 << CItemData::WEAPON_CLAW),
SKILL_NEED_WEAPON_EMPTY_HAND = (1 << CItemData::WEAPON_NONE),
};
+3 -3
View File
@@ -72,10 +72,10 @@ class ConvertTests(unittest.TestCase):
def test_weapon_kept_without_unknown_flags(self):
s,c,kept=m.convert(row(320,'ITEM_WEAPON','WEAPON_SWORD','ANTI_MUDANG | ANTI_WOLFMAN','ITEM_TUNABLE','WEAR_WEAPON',
('APPLY_ATT_SPEED','18','APPLY_ATTBONUS_BOSS','5','APPLY_NONE','0'),refine=('321','81')),self.E,{320})
self.assertTrue(kept);self.assertEqual(s[5],'ANTI_MUDANG');self.assertEqual(s[7],'WEAR_WEAPON')
self.assertTrue(kept);self.assertEqual(s[5],'ANTI_MUDANG | ANTI_WOLFMAN');self.assertEqual(s[7],'WEAR_WEAPON')
self.assertEqual(s[18:22],['APPLY_ATT_SPEED','18','APPLY_ATTBONUS_BOSS','5']) # ported apply kept
self.assertEqual(s[11:13],['0','0']) # the +1 item is not imported
self.assertEqual(c[1:3],[self.E['type'].index('ITEM_WEAPON'),0]);self.assertEqual(c[4],1<<self.E['anti'].index('ANTI_MUDANG'))
self.assertEqual(c[1:3],[self.E['type'].index('ITEM_WEAPON'),0]);self.assertEqual(c[4],1<<self.E['anti'].index('ANTI_MUDANG')|1<<self.E['anti'].index('ANTI_WOLFMAN'))
self.assertEqual(len(s),33);self.assertEqual(len(c),31)
def test_costume_enchant_kept_only_for_ported_targets(self):
for vnum,mask in ((54001,'2'),(54078,'4'),(54130,'16')): # body / hair / mount skin (port_costume_attr.cpp)
@@ -118,7 +118,7 @@ class ConvertTests(unittest.TestCase):
s,c,kept=m.convert(row(21210,'ITEM_ARMOR','ARMOR_BODY','ANTI_ASSASSIN | ANTI_SURA | ANTI_MUDANG | ANTI_WOLFMAN','ITEM_TUNABLE','WEAR_BODY',
('APPLY_MOV_SPEED','5','APPLY_RESIST_MAGIC','25','APPLY_MAX_HP_PCT','20'),('0','210','0','32','0','0'),('21211','81')),self.E,{21210,21211})
self.assertTrue(kept);self.assertEqual(s[3],'ARMOR_BODY');self.assertEqual(s[7],'WEAR_BODY');self.assertEqual(s[11:13],['21211','81'])
self.assertEqual(s[5],'ANTI_ASSASSIN | ANTI_SURA | ANTI_MUDANG');self.assertEqual(s[27],'32') # value3 = armor shape
self.assertEqual(s[5],'ANTI_ASSASSIN | ANTI_SURA | ANTI_MUDANG | ANTI_WOLFMAN');self.assertEqual(s[27],'32') # value3 = armor shape
models=m.shape_models()
self.assertIn('d:/ymir work/pc2/warrior/warrior_7_1_lod_03.gr2',models)
self.assertIn('d:/ymir work/pc2/warrior/warrior_salsa1.gr2',models)
+59
View File
@@ -0,0 +1,59 @@
#!/usr/bin/env python3
"""Server item rows for the wolfman (server ENABLE_WOLFMAN_CHARACTER), taken from the client item_proto.
The 40250 client proto already carries the whole wolfman set (claws, armor, helmets, costumes) and ANTI_WOLFMAN on
every other class's gear; the 203 server proto has neither. This writes items-server.tsv for
../ava2-items/install_items.py: the wolfman-only rows the server lacks, converted from the client's numeric fields,
plus every existing server row whose client twin is ANTI_WOLFMAN, with that flag added.
Client costume subtype 4 is COSTUME_WEAPON, our server's 4 is COSTUME_MOUNT_SKIN: those weapon skins are skipped.
usage: make_items.py <client item_proto> <server item_proto.txt> <ProtoReader.cpp> <out dir>
"""
import subprocess,sys
from pathlib import Path
HERE=Path(__file__).resolve().parent
sys.path.insert(0,str(HERE.parent/'ava2-items'))
from make_items import enums
ANTI_OTHER_CLASSES=0b111100 # ANTI_MUSA | ANTI_ASSASSIN | ANTI_SURA | ANTI_MUDANG
ANTI_WOLFMAN=1<<18
SKIP={(28,4)}
def client_rows(proto):
tool=HERE.parents[2]/'build/release/src/port/item_proto_patch'
out=subprocess.run([str(tool),'--dump',str(proto)],check=True,capture_output=True).stdout
rows={}
for line in out.splitlines():
fields,_,name=line.partition(b'\t')
f=list(map(int,fields.split()))
rows[f[0]]=(f,name)
return rows
def server_rows(path):
return {int(l.split(b'\t',1)[0]):l.rstrip(b'\r') for l in path.read_bytes().splitlines() if l.split(b'\t',1)[0].isdigit()}
def convert(f,name,E):
flags=lambda bits,k:' | '.join(n for i,n in enumerate(E[k]) if bits>>i&1) or 'NONE'
row=[str(f[0]),name.decode('gbk'),E['type'][f[1]],E['sub'][f[1]][f[2]] if E['sub'][f[1]] else str(f[2]),str(f[3]),
flags(f[4],'anti'),flags(f[5],'flag'),flags(f[6],'wear'),flags(f[7],'imm')]+[str(v) for v in f[8:13]]
for k in range(2):row+=[E['limit'][f[13+2*k]],str(f[14+2*k])]
for k in range(3):row+=[E['apply'][f[17+2*k]],str(f[18+2*k])]
return '\t'.join(row+[str(v) for v in f[23:31]]+['0']).encode('gbk')
def main():
client,server_path,reader,out=Path(sys.argv[1]),Path(sys.argv[2]),Path(sys.argv[3]),Path(sys.argv[4])
E=enums(reader);cli=client_rows(client);srv=server_rows(server_path)
assert E['anti'][18]=='ANTI_WOLFMAN',E['anti']
added=[convert(f,n,E) for v,(f,n) in sorted(cli.items()) if v not in srv and f[4]&ANTI_OTHER_CLASSES==ANTI_OTHER_CLASSES
and not f[4]&ANTI_WOLFMAN and (f[1],f[2]) not in SKIP]
flagged=[]
for v,line in sorted(srv.items()):
c=line.split(b'\t')
if v in cli and cli[v][0][4]&ANTI_WOLFMAN and b'ANTI_WOLFMAN' not in c[5]:
c[5]=b'ANTI_WOLFMAN' if c[5].strip() in (b'NONE',b'0',b'') else c[5]+b' | ANTI_WOLFMAN'
flagged.append(b'\t'.join(c))
out.mkdir(parents=True,exist_ok=True)
(out/'items-server.tsv').write_bytes(b'\n'.join(added+flagged)+b'\n')
print('wolfman rows added:',len(added),'ANTI_WOLFMAN added:',len(flagged))
main()