diff --git a/src/port/GameLib/ActorInstance.cpp b/src/port/GameLib/ActorInstance.cpp index 94015cba..4f599045 100644 --- a/src/port/GameLib/ActorInstance.cpp +++ b/src/port/GameLib/ActorInstance.cpp @@ -7,7 +7,7 @@ enum { - MAIN_RACE_MAX_NUM = 8, + MAIN_RACE_MAX_NUM = 9, // PORT: + wolfman (race 8) }; void CActorInstance::INSTANCEBASE_Deform() diff --git a/src/port/GameLib/ActorInstance.h b/src/port/GameLib/ActorInstance.h index adf163b9..700a4db4 100644 --- a/src/port/GameLib/ActorInstance.h +++ b/src/port/GameLib/ActorInstance.h @@ -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); diff --git a/src/port/GameLib/ActorInstanceAttach.cpp b/src/port/GameLib/ActorInstanceAttach.cpp index 976788d8..4d5b95c5 100644 --- a/src/port/GameLib/ActorInstanceAttach.cpp +++ b/src/port/GameLib/ActorInstanceAttach.cpp @@ -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; } diff --git a/src/port/GameLib/ActorInstanceBattle.cpp b/src/port/GameLib/ActorInstanceBattle.cpp index 225eebce..fbcfa183 100644 --- a/src/port/GameLib/ActorInstanceBattle.cpp +++ b/src/port/GameLib/ActorInstanceBattle.cpp @@ -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; } diff --git a/src/port/GameLib/ActorInstanceMotion.cpp b/src/port/GameLib/ActorInstanceMotion.cpp index d24a514f..a5befd8c 100644 --- a/src/port/GameLib/ActorInstanceMotion.cpp +++ b/src/port/GameLib/ActorInstanceMotion.cpp @@ -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; diff --git a/src/port/GameLib/ActorInstanceMotionEvent.cpp b/src/port/GameLib/ActorInstanceMotionEvent.cpp index ca9eb935..572dc29a 100644 --- a/src/port/GameLib/ActorInstanceMotionEvent.cpp +++ b/src/port/GameLib/ActorInstanceMotionEvent.cpp @@ -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 +{ +} diff --git a/src/port/GameLib/ItemData.cpp b/src/port/GameLib/ItemData.cpp index c52146e6..4d2cff67 100644 --- a/src/port/GameLib/ItemData.cpp +++ b/src/port/GameLib/ItemData.cpp @@ -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; diff --git a/src/port/GameLib/RaceData.cpp b/src/port/GameLib/RaceData.cpp index 25d3e9d0..c328b204 100644 --- a/src/port/GameLib/RaceData.cpp +++ b/src/port/GameLib/RaceData.cpp @@ -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; diff --git a/src/port/GameLib/RaceMotionData.cpp b/src/port/GameLib/RaceMotionData.cpp index e0e8c70b..b44bd25f 100644 --- a/src/port/GameLib/RaceMotionData.cpp +++ b/src/port/GameLib/RaceMotionData.cpp @@ -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; diff --git a/src/port/GameLib/RaceMotionData.h b/src/port/GameLib/RaceMotionData.h index 4456b23d..518ef166 100644 --- a/src/port/GameLib/RaceMotionData.h +++ b/src/port/GameLib/RaceMotionData.h @@ -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 TMotionEventDataVector; public: diff --git a/src/port/GameLib/RaceMotionDataEvent.h b/src/port/GameLib/RaceMotionDataEvent.h index 9e74a7c0..14d5300d 100644 --- a/src/port/GameLib/RaceMotionDataEvent.h +++ b/src/port/GameLib/RaceMotionDataEvent.h @@ -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; }; \ No newline at end of file diff --git a/src/port/UserInterface/InstanceBase.cpp b/src/port/UserInterface/InstanceBase.cpp index b7e180c7..5f3b92d7 100644 --- a/src/port/UserInterface/InstanceBase.cpp +++ b/src/port/UserInterface/InstanceBase.cpp @@ -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); diff --git a/src/port/UserInterface/PythonApplicationModule.cpp b/src/port/UserInterface/PythonApplicationModule.cpp index 0b3e27aa..68c6d9e7 100644 --- a/src/port/UserInterface/PythonApplicationModule.cpp +++ b/src/port/UserInterface/PythonApplicationModule.cpp @@ -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); diff --git a/src/port/UserInterface/PythonPlayer.cpp b/src/port/UserInterface/PythonPlayer.cpp index 809c7fb3..03877d4b 100644 --- a/src/port/UserInterface/PythonPlayer.cpp +++ b/src/port/UserInterface/PythonPlayer.cpp @@ -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; diff --git a/src/port/UserInterface/PythonSkill.cpp b/src/port/UserInterface/PythonSkill.cpp index 9e2d6f60..054a4c7b 100644 --- a/src/port/UserInterface/PythonSkill.cpp +++ b/src/port/UserInterface/PythonSkill.cpp @@ -917,6 +917,7 @@ CPythonSkill::CPythonSkill() m_SkillTypeIndexMap.insert(std::map::value_type("sura", SKILL_TYPE_ACTIVE)); m_SkillTypeIndexMap.insert(std::map::value_type("shaman", SKILL_TYPE_ACTIVE)); m_SkillTypeIndexMap.insert(std::map::value_type("passive", SKILL_TYPE_ACTIVE)); + m_SkillTypeIndexMap.insert(std::map::value_type("wolfman", SKILL_TYPE_ACTIVE)); m_SkillAttributeIndexMap.insert(std::map::value_type("NEED_POISON_BOTTLE", SKILL_ATTRIBUTE_NEED_POISON_BOTTLE)); m_SkillAttributeIndexMap.insert(std::map::value_type("NEED_EMPTY_BOTTLE", SKILL_ATTRIBUTE_NEED_EMPTY_BOTTLE)); @@ -952,12 +953,14 @@ CPythonSkill::CPythonSkill() m_SkillNeedWeaponIndexMap.insert(std::map::value_type("FAN", SKILL_NEED_WEAPON_FAN)); m_SkillNeedWeaponIndexMap.insert(std::map::value_type("ARROW", SKILL_NEED_WEAPON_ARROW)); m_SkillNeedWeaponIndexMap.insert(std::map::value_type("EMPTY_HAND", SKILL_NEED_WEAPON_EMPTY_HAND)); + m_SkillNeedWeaponIndexMap.insert(std::map::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"))); diff --git a/src/port/UserInterface/PythonSkill.h b/src/port/UserInterface/PythonSkill.h index d58a72c9..7cd2d372 100644 --- a/src/port/UserInterface/PythonSkill.h +++ b/src/port/UserInterface/PythonSkill.h @@ -125,6 +125,7 @@ class CPythonSkill : public CSingleton 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), }; diff --git a/tools/server/ava2-items/tests/test_items.py b/tools/server/ava2-items/tests/test_items.py index c299ccee..1b1a1ffd 100644 --- a/tools/server/ava2-items/tests/test_items.py +++ b/tools/server/ava2-items/tests/test_items.py @@ -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< +""" +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()