feat(parity): implement skill cooldown end, server emotions, target packets and render target parity (pass31)

This commit is contained in:
shen
2026-10-07 23:31:17 -07:00
parent 6b8d40f894
commit b70e9aa2d7
15 changed files with 356 additions and 29 deletions
+1 -1
View File
@@ -54,7 +54,7 @@
{70, 10, 0, 1, 1},
{71, 17, 0, 1, 1},
{72, 256, 0, 1, 1},
{73, 2, 0, 1, 0},
{73, 2, 0, 1, 1},
{74, 4, 1, 1, 1},
{75, 4, 1, 1, 1},
{76, 1531, 0, 1, 1},
+16 -2
View File
@@ -152,6 +152,11 @@ enum EPacketGC {
HEADER_GC_CHARACTER_CREATE_SUCCESS = 8,
HEADER_GC_CHARACTER_CREATE_FAILURE = 9,
HEADER_GC_CHARACTER_DELETE_SUCCESS = 10,
HEADER_GC_PLAYER_CREATE_SUCCESS = 8,
HEADER_GC_PLAYER_CREATE_FAILURE = 9,
HEADER_GC_PLAYER_DELETE_SUCCESS = 10,
HEADER_GC_PLAYER_DELETE_WRONG_SOCIAL_ID = 11,
HEADER_GC_LOGIN_SUCCESS4 = 32,
HEADER_GC_STUN = 13,
HEADER_GC_DEAD = 14,
HEADER_GC_MAIN_CHARACTER = 15,
@@ -197,8 +202,10 @@ enum EPacketGC {
HEADER_GC_AFFECT_ADD=126,
HEADER_GC_AFFECT_REMOVE=127,
HEADER_GC_SKILL_LEVEL=72,
HEADER_GC_SKILL_COOLTIME_END = 73,
HEADER_GC_SKILL_LEVEL_NEW=76,
HEADER_GC_TIME = 106,
HEADER_GC_CHANGE_NAME = 107,
HEADER_GC_EVENT_MANAGER = 39,
HEADER_GC_PVP = 41,
HEADER_GC_CHARACTER_POSITION = 43,
@@ -488,6 +495,11 @@ struct TPacketGCObserverRemove {
uint32_t vid = 0;
};
struct TPacketGCSkillCoolTimeEnd {
uint8_t header = HEADER_GC_SKILL_COOLTIME_END;
uint8_t bSkill = 0;
};
struct TPacketGCTime { uint8_t bHeader;int32_t time; };
struct TPacketGCPoints { uint8_t header;int64_t points[255]; };
@@ -974,11 +986,13 @@ struct TNPCPosition { uint8_t bType; uint32_t name; int32_t x, y, regenTime; };
struct TPacketGCChannel { uint8_t header, channel, anti_exp; };
struct TPacketGCTargetUpdate { uint8_t bHeader; int32_t lID, lX, lY; uint8_t bType; };
struct TPacketGCTargetDelete { uint8_t bHeader; int32_t lID; };
struct TPacketGCTargetCreate { uint8_t bHeader; int32_t lID; char szTargetName[QUEST_NAME_MAX_LEN+1]; };
struct TPacketGCTargetCreateNew { uint8_t bHeader; int32_t lID; char szTargetName[QUEST_NAME_MAX_LEN+1]; uint32_t dwVID; uint8_t byType; };
struct TPacketGCLandList { uint8_t header; uint16_t size; };
struct TLandPacketElement { uint32_t dwID; int32_t x, y, width, height; uint32_t dwGuildID; };
struct TPacketGCLoverInfo { uint8_t header; char name[CHARACTER_NAME_MAX_LEN+1]; uint8_t love_point; };
struct TPacketGCLovePointUpdate { uint8_t header, love_point; };
struct TPacketGCChangeName { uint8_t header; uint32_t pid; char name[CHARACTER_NAME_MAX_LEN+1]; };
struct TPacketGCDigMotion { uint8_t header; uint32_t vid, target_vid; uint8_t count; };
struct TAccountBank { int32_t action; int64_t money; char datetime[20], ip[30], recvmoney[17]; };
struct TPacketGCBank { uint8_t header; TAccountBank logs[ACCOUNT_BANK_LOG_MAX_NUM]; };
@@ -1151,9 +1165,9 @@ AVA2_PACKET_SIZE(TRefineTable,63);AVA2_PACKET_SIZE(TPacketGCRefineInformation,65
AVA2_PACKET_SIZE(TEquipmentItemSet,106);AVA2_PACKET_SIZE(TPacketGCViewEquip,3397);AVA2_PACKET_SIZE(TPacketGCDungeon,4);
AVA2_PACKET_SIZE(TPacketGCWalkMode,6);AVA2_PACKET_SIZE(TPacketGCChangeSkillGroup,2);AVA2_PACKET_SIZE(TPacketGCNPCPosition,5);
AVA2_PACKET_SIZE(TNPCPosition,17);AVA2_PACKET_SIZE(TPacketGCChannel,3);AVA2_PACKET_SIZE(TPacketGCTargetUpdate,14);
AVA2_PACKET_SIZE(TPacketGCTargetDelete,5);AVA2_PACKET_SIZE(TPacketGCTargetCreateNew,43);AVA2_PACKET_SIZE(TPacketGCLandList,3);
AVA2_PACKET_SIZE(TPacketGCTargetDelete,5);AVA2_PACKET_SIZE(TPacketGCTargetCreate,38);AVA2_PACKET_SIZE(TPacketGCTargetCreateNew,43);AVA2_PACKET_SIZE(TPacketGCLandList,3);
AVA2_PACKET_SIZE(TLandPacketElement,24);AVA2_PACKET_SIZE(TPacketGCLoverInfo,27);AVA2_PACKET_SIZE(TPacketGCLovePointUpdate,2);
AVA2_PACKET_SIZE(TPacketGCDigMotion,10);AVA2_PACKET_SIZE(TAccountBank,79);AVA2_PACKET_SIZE(TPacketGCBank,79001);
AVA2_PACKET_SIZE(TPacketGCChangeName,30);AVA2_PACKET_SIZE(TPacketGCDigMotion,10);AVA2_PACKET_SIZE(TAccountBank,79);AVA2_PACKET_SIZE(TPacketGCBank,79001);
AVA2_PACKET_SIZE(TPacketGCHybridCryptKeys,7);AVA2_PACKET_SIZE(TPacketHSCheck,403);AVA2_PACKET_SIZE(TPacketXTrapCSVerify,129);
AVA2_PACKET_SIZE(TPacketGCSpecificEffect,133);AVA2_PACKET_SIZE(TPacketGCDragonSoulRefine,5);AVA2_PACKET_SIZE(TPacketGCUnk213,2);
AVA2_PACKET_SIZE(TPacketGCCalendarReceive,411);AVA2_PACKET_SIZE(TPacketGCCalendarReceiveADM,206);AVA2_PACKET_SIZE(TPacketSash,23);
+10 -2
View File
@@ -282,6 +282,7 @@ bool PythonNetworkStream::DispatchPortedGamePhasePacket(uint8_t header) {
case HEADER_GC_AFFECT_REMOVE: return RecvAffectRemovePacket();
case HEADER_GC_SKILL_LEVEL: return RecvSkillLevel();
case HEADER_GC_SKILL_LEVEL_NEW: return RecvSkillLevelNew();
case HEADER_GC_SKILL_COOLTIME_END: return RecvSkillCoolTimeEnd();
case HEADER_GC_PLAYER_POINTS:
return RecvPlayerPoints();
case HEADER_GC_CHARACTER_ADD:
@@ -385,8 +386,8 @@ bool PythonNetworkStream::DispatchPortedGamePhasePacket(uint8_t header) {
case HEADER_GC_TARGET: return RecvTargetPacket();
case HEADER_GC_CHESTDROP: return RecvChestDrop();
case HEADER_GC_KILL_LOG: return RecvKillLOG();
case HEADER_GC_ADD_FLY_TARGETING: return RecvFlyTargetingPacket(true);
case HEADER_GC_FLY_TARGETING: return RecvFlyTargetingPacket(false);
case HEADER_GC_ADD_FLY_TARGETING: return RecvAddFlyTargetingPacket();
case HEADER_GC_FLY_TARGETING: return RecvFlyTargetingPacket();
case HEADER_GC_PARTY_INVITE: return RecvPartyInvite();
case HEADER_GC_PARTY_ADD: return RecvPartyAdd();
case HEADER_GC_PARTY_UPDATE: return RecvPartyUpdate();
@@ -545,6 +546,13 @@ bool PythonNetworkStream::RecvSkillLevelNew() {
m_refreshSkill=m_refreshStatus=true;return true;
}
bool PythonNetworkStream::RecvSkillCoolTimeEnd() {
TPacketGCSkillCoolTimeEnd p;
if (!Read(sizeof(p), &p)) return false;
EndSkillCoolTime(p.bSkill);
return true;
}
bool PythonNetworkStream::RecvCharacterAppendPacket() {
TPacketGCCharacterAdd p;
if (!Read(sizeof(p), &p)) return false;
+4
View File
@@ -212,6 +212,7 @@ private:
bool RecvAffectRemovePacket();
bool RecvSkillLevel();
bool RecvSkillLevelNew();
bool RecvSkillCoolTimeEnd();
void MainCharacterLoaded(int32_t x,int32_t y,int32_t z);
bool RecvCharacterAppendPacket();
bool RecvCharacterAdditionalInfo();
@@ -296,6 +297,8 @@ private:
bool RecvTargetPacket();
bool RecvChestDrop();
bool RecvKillLOG();
bool RecvFlyTargetingPacket();
bool RecvAddFlyTargetingPacket();
bool RecvFlyTargetingPacket(bool add);
bool RecvPartyInvite();
bool RecvPartyAdd();
@@ -319,6 +322,7 @@ private:
bool RecvChannelPacket();
bool RecvTargetUpdatePacket();
bool RecvTargetDeletePacket();
bool RecvTargetCreatePacket();
bool RecvTargetCreatePacketNew();
bool RecvLandPacket();
bool RecvLoverInfoPacket();
+104 -15
View File
@@ -6,6 +6,8 @@
#include "PythonNetworkStream.h"
#include "ava2_text_file.h"
#include "shared/common/PythonUtils.h"
#include "NetworkActorManager.h"
#include "eter_render/RaceData.h"
#include <cstdlib>
#include <cstring>
#include <iostream>
@@ -186,22 +188,109 @@ void PythonNetworkStream::ServerCommand(const std::string& command) {
m_bComboSkillFlag = atoi(arg(1)) != 0;
} else if (!strcasecmp(szCmd, "setblockmode")) {
call("OnBlockMode", Py_BuildValue("(i)", atoi(arg(1))));
// Emotion Start
} else if (!strcasecmp(szCmd, "french_kiss")) {
if (TokenVector.size() >= 3) {
int iVID1 = atoi(TokenVector[1].c_str());
int iVID2 = atoi(TokenVector[2].c_str());
auto pInstance1 = NetworkActorManager::Instance().GetActorInstance(iVID1);
auto pInstance2 = NetworkActorManager::Instance().GetActorInstance(iVID2);
if (pInstance1 && pInstance2)
pInstance1->ActDualEmotion(*pInstance2, CRaceMotionData::NAME_FRENCH_KISS_START, CRaceMotionData::NAME_FRENCH_KISS_START);
}
} else if (!strcasecmp(szCmd, "kiss")) {
if (TokenVector.size() >= 3) {
int iVID1 = atoi(TokenVector[1].c_str());
int iVID2 = atoi(TokenVector[2].c_str());
auto pInstance1 = NetworkActorManager::Instance().GetActorInstance(iVID1);
auto pInstance2 = NetworkActorManager::Instance().GetActorInstance(iVID2);
if (pInstance1 && pInstance2)
pInstance1->ActDualEmotion(*pInstance2, CRaceMotionData::NAME_KISS_START, CRaceMotionData::NAME_KISS_START);
}
} else if (!strcasecmp(szCmd, "slap")) {
if (TokenVector.size() >= 3) {
int iVID1 = atoi(TokenVector[1].c_str());
int iVID2 = atoi(TokenVector[2].c_str());
auto pInstance1 = NetworkActorManager::Instance().GetActorInstance(iVID1);
auto pInstance2 = NetworkActorManager::Instance().GetActorInstance(iVID2);
if (pInstance1 && pInstance2)
pInstance1->ActDualEmotion(*pInstance2, CRaceMotionData::NAME_SLAP_HURT_START, CRaceMotionData::NAME_SLAP_HIT_START);
}
} else if (!strcasecmp(szCmd, "clap")) {
if (TokenVector.size() >= 2) {
int iVID = atoi(TokenVector[1].c_str());
auto pInstance = NetworkActorManager::Instance().GetActorInstance(iVID);
if (pInstance)
pInstance->ActEmotion(CRaceMotionData::NAME_CLAP);
}
} else if (!strcasecmp(szCmd, "cheer1")) {
if (TokenVector.size() >= 2) {
int iVID = atoi(TokenVector[1].c_str());
auto pInstance = NetworkActorManager::Instance().GetActorInstance(iVID);
if (pInstance)
pInstance->ActEmotion(CRaceMotionData::NAME_CHEERS_1);
}
} else if (!strcasecmp(szCmd, "cheer2")) {
if (TokenVector.size() >= 2) {
int iVID = atoi(TokenVector[1].c_str());
auto pInstance = NetworkActorManager::Instance().GetActorInstance(iVID);
if (pInstance)
pInstance->ActEmotion(CRaceMotionData::NAME_CHEERS_2);
}
} else if (!strcasecmp(szCmd, "dance1")) {
if (TokenVector.size() >= 2) {
int iVID = atoi(TokenVector[1].c_str());
auto pInstance = NetworkActorManager::Instance().GetActorInstance(iVID);
if (pInstance)
pInstance->ActEmotion(CRaceMotionData::NAME_DANCE_1);
}
} else if (!strcasecmp(szCmd, "dance2")) {
if (TokenVector.size() >= 2) {
int iVID = atoi(TokenVector[1].c_str());
auto pInstance = NetworkActorManager::Instance().GetActorInstance(iVID);
if (pInstance)
pInstance->ActEmotion(CRaceMotionData::NAME_DANCE_2);
}
} else if (!strcasecmp(szCmd, "dig_motion")) {
if (TokenVector.size() >= 2) {
int iVID = atoi(TokenVector[1].c_str());
auto pInstance = NetworkActorManager::Instance().GetActorInstance(iVID);
if (pInstance)
pInstance->ActEmotion(CRaceMotionData::NAME_DIG);
}
// Emotion End
} else {
// french_kiss..dig_motion are strcmpi branches; the rest is s_emotionDict (case sensitive).
static const char* const namedEmotions[] = {
"french_kiss", "kiss", "slap", "clap", "cheer1", "cheer2", "dance1", "dance2", "dig_motion",
};
static const char* const dictEmotions[] = {
"dance3", "dance4", "dance5", "dance6", "congratulation", "forgive", "angry", "attractive",
"sad", "shy", "cheerup", "banter", "joy",
};
bool isEmotion = false;
for (const char* emotion : namedEmotions) isEmotion = isEmotion || !strcasecmp(szCmd, emotion);
for (const char* emotion : dictEmotions) isEmotion = isEmotion || TokenVector[0] == emotion;
if (isEmotion)
TraceError("ServerCommand emotion not ported (CInstanceBase::ActEmotion): " + command);
else
TraceError("Unknown Server Command " + command + " | " + TokenVector[0]);
static std::map<std::string, int> s_emotionDict;
static bool s_isFirst = true;
if (s_isFirst) {
s_isFirst = false;
s_emotionDict["dance3"] = CRaceMotionData::NAME_DANCE_3;
s_emotionDict["dance4"] = CRaceMotionData::NAME_DANCE_4;
s_emotionDict["dance5"] = CRaceMotionData::NAME_DANCE_5;
s_emotionDict["dance6"] = CRaceMotionData::NAME_DANCE_6;
s_emotionDict["congratulation"] = CRaceMotionData::NAME_CONGRATULATION;
s_emotionDict["forgive"] = CRaceMotionData::NAME_FORGIVE;
s_emotionDict["angry"] = CRaceMotionData::NAME_ANGRY;
s_emotionDict["attractive"] = CRaceMotionData::NAME_ATTRACTIVE;
s_emotionDict["sad"] = CRaceMotionData::NAME_SAD;
s_emotionDict["shy"] = CRaceMotionData::NAME_SHY;
s_emotionDict["cheerup"] = CRaceMotionData::NAME_CHEERUP;
s_emotionDict["banter"] = CRaceMotionData::NAME_BANTER;
s_emotionDict["joy"] = CRaceMotionData::NAME_JOY;
}
auto f = s_emotionDict.find(szCmd);
if (f == s_emotionDict.end()) {
TraceError("Unknown Server Command " + command + " | " + szCmd);
} else {
int emotionIndex = f->second;
if (TokenVector.size() >= 2) {
int iVID = atoi(TokenVector[1].c_str());
auto pInstance = NetworkActorManager::Instance().GetActorInstance(iVID);
if (pInstance)
pInstance->ActEmotion(emotionIndex);
}
}
}
}
@@ -673,6 +673,14 @@ bool PythonNetworkStream::RecvFlyTargetingPacket(bool add) {
return true;
}
bool PythonNetworkStream::RecvFlyTargetingPacket() {
return RecvFlyTargetingPacket(false);
}
bool PythonNetworkStream::RecvAddFlyTargetingPacket() {
return RecvFlyTargetingPacket(true);
}
bool PythonNetworkStream::RecvPartyInvite() {
TPacketGCPartyInvite p;
if(!Read(sizeof(p),&p)) return false;
@@ -902,6 +910,14 @@ bool PythonNetworkStream::RecvTargetDeletePacket() {
return true; // background DeleteTargetEffect: not ported.
}
bool PythonNetworkStream::RecvTargetCreatePacket() {
TPacketGCTargetCreate p;
if(!Read(sizeof(p),&p)) return false;
CPythonMiniMap::Instance().CreateTarget(p.lID,text(p.szTargetName).c_str());
PyCallClassMemberFunc(m_phaseWindows[5],"BINARY_OpenAtlasWindow",Py_BuildValue("()"));
return true;
}
bool PythonNetworkStream::RecvTargetCreatePacketNew() {
TPacketGCTargetCreateNew p;
if(!Read(sizeof(p),&p)) return false;