1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 06:47:45 +00:00

Re-added setOwner method to BNpc, not working yet though

This commit is contained in:
Mordred 2019-03-28 23:57:58 +01:00
parent c2ca32592c
commit 3f22f0de18
4 changed files with 1804 additions and 1867 deletions

View file

@ -10,17 +10,14 @@
#include <Common.h>
#include <Network/CommonNetwork.h>
namespace Sapphire {
namespace Network {
namespace Packets {
namespace Server {
namespace Sapphire::Network::Packets::Server
{
/**
* Structural representation of the packet sent by the server as response
* to a ping packet
*/
struct FFXIVIpcPing :
FFXIVIpcBasePacket< Ping >
struct FFXIVIpcPing : FFXIVIpcBasePacket< Ping >
{
/* 0000 */ uint64_t timeInMilliseconds;
/* 0008 */ uint8_t unknown_8[0x38];
@ -30,8 +27,7 @@ struct FFXIVIpcPing :
* Structural representation of the packet sent by the server as response
* to a ping packet
*/
struct FFXIVIpcInit :
FFXIVIpcBasePacket< Init >
struct FFXIVIpcInit : FFXIVIpcBasePacket< Init >
{
uint64_t unknown;
uint32_t charId;
@ -42,8 +38,7 @@ struct FFXIVIpcInit :
* Structural representation of the packet sent by the server
* carrying chat messages
*/
struct FFXIVIpcChat :
FFXIVIpcBasePacket< Chat >
struct FFXIVIpcChat : FFXIVIpcBasePacket< Chat >
{
/* 0000 */ uint8_t padding[14]; //Maybe this is SubCode, or some kind of talker ID...
Common::ChatType chatType;
@ -51,8 +46,7 @@ struct FFXIVIpcChat :
char msg[1012];
};
struct FFXIVIpcChatBanned :
FFXIVIpcBasePacket< ChatBanned >
struct FFXIVIpcChatBanned : FFXIVIpcBasePacket< ChatBanned >
{
uint8_t padding[4]; // I was not sure reinterpreting ZST is valid behavior in C++.
// client doesn't care about the data (zero sized) for this opcode anyway.
@ -62,8 +56,7 @@ struct FFXIVIpcChatBanned :
* Structural representation of the packet sent by the server
* carrying chat messages
*/
struct FFXIVIpcLogout :
FFXIVIpcBasePacket< Logout >
struct FFXIVIpcLogout : FFXIVIpcBasePacket< Logout >
{
uint32_t flags1;
uint32_t flags2;
@ -73,8 +66,7 @@ struct FFXIVIpcLogout :
* Structural representation of the packet sent by the server
* sent to show the play time
*/
struct FFXIVIpcPlayTime :
FFXIVIpcBasePacket< Playtime >
struct FFXIVIpcPlayTime : FFXIVIpcBasePacket< Playtime >
{
uint32_t playTimeInMinutes;
uint32_t padding;
@ -103,8 +95,7 @@ struct PlayerEntry
char fcTag[9];
};
struct FFXIVIpcSocialList :
FFXIVIpcBasePacket< SocialList >
struct FFXIVIpcSocialList : FFXIVIpcBasePacket< SocialList >
{
uint32_t padding;
uint32_t padding1;
@ -117,8 +108,7 @@ struct FFXIVIpcSocialList :
};
struct FFXIVIpcSetSearchInfo :
FFXIVIpcBasePacket< UpdateSearchInfo >
struct FFXIVIpcSetSearchInfo : FFXIVIpcBasePacket< UpdateSearchInfo >
{
uint64_t onlineStatusFlags;
uint64_t unknown;
@ -129,8 +119,7 @@ struct FFXIVIpcSetSearchInfo :
uint8_t padding2;
};
struct FFXIVIpcInitSearchInfo :
FFXIVIpcBasePacket< InitSearchInfo >
struct FFXIVIpcInitSearchInfo : FFXIVIpcBasePacket< InitSearchInfo >
{
uint64_t onlineStatusFlags;
uint64_t unknown;
@ -140,8 +129,7 @@ struct FFXIVIpcInitSearchInfo :
char padding[5];
};
struct FFXIVIpcExamineSearchComment :
FFXIVIpcBasePacket< ExamineSearchComment >
struct FFXIVIpcExamineSearchComment : FFXIVIpcBasePacket< ExamineSearchComment >
{
uint32_t charId;
// packet only has 196 bytes after the charid
@ -154,21 +142,18 @@ struct FFXIVIpcExamineSearchComment :
* Structural representation of the packet sent by the server
* to display a server notice message
*/
struct FFXIVIpcServerNotice :
FFXIVIpcBasePacket< ServerNotice >
struct FFXIVIpcServerNotice : FFXIVIpcBasePacket< ServerNotice >
{
/* 0000 */ uint8_t padding;
char message[775];
};
struct FFXIVIpcSetOnlineStatus :
FFXIVIpcBasePacket< SetOnlineStatus >
struct FFXIVIpcSetOnlineStatus : FFXIVIpcBasePacket< SetOnlineStatus >
{
uint64_t onlineStatusFlags;
};
struct FFXIVIpcBlackList :
FFXIVIpcBasePacket< BlackList >
struct FFXIVIpcBlackList : FFXIVIpcBasePacket< BlackList >
{
struct BlEntry
{
@ -181,8 +166,7 @@ struct FFXIVIpcBlackList :
uint32_t padding2;
};
struct FFXIVIpcLogMessage :
FFXIVIpcBasePacket< LogMessage >
struct FFXIVIpcLogMessage : FFXIVIpcBasePacket< LogMessage >
{
uint32_t field_0;
uint32_t field_4;
@ -196,8 +180,7 @@ struct FFXIVIpcLogMessage :
uint32_t field_58;
};
struct FFXIVIpcLinkshellList :
FFXIVIpcBasePacket< LinkshellList >
struct FFXIVIpcLinkshellList : FFXIVIpcBasePacket< LinkshellList >
{
struct LsEntry
{
@ -214,8 +197,7 @@ struct FFXIVIpcLinkshellList :
* Structural representation of the packet sent by the server
* to send a list of mail the player has
*/
struct FFXIVIpcReqMoogleMailList :
FFXIVIpcBasePacket< ReqMoogleMailList >
struct FFXIVIpcReqMoogleMailList : FFXIVIpcBasePacket< ReqMoogleMailList >
{
struct letterEntry
{
@ -236,8 +218,7 @@ struct FFXIVIpcReqMoogleMailList :
* Structural representation of the packet sent by the server
* to show the mail delivery notification
*/
struct FFXIVIpcMailLetterNotificationt :
FFXIVIpcBasePacket< MailLetterNotification >
struct FFXIVIpcMailLetterNotificationt : FFXIVIpcBasePacket< MailLetterNotification >
{
uint32_t sendbackCount; // The amount of letters sent back since you ran out of room (moogle dialog changes based on this)
uint16_t friendLetters; // The amount of letters in the friends section of the letterbox
@ -248,8 +229,7 @@ struct FFXIVIpcMailLetterNotificationt :
char unk2[0x4]; // This has probs something to do with the support desk (inquiry id?)
};
struct FFXIVIpcExamineFreeCompanyInfo :
FFXIVIpcBasePacket< ExamineFreeCompanyInfo >
struct FFXIVIpcExamineFreeCompanyInfo : FFXIVIpcBasePacket< ExamineFreeCompanyInfo >
{
char unknown[0x20]; // likely fc allegiance/icon/housing info etc
uint32_t charId;
@ -267,8 +247,7 @@ struct FFXIVIpcExamineFreeCompanyInfo :
uint32_t padding4;
};
struct FFXIVIpcStatusEffectList :
FFXIVIpcBasePacket< StatusEffectList >
struct FFXIVIpcStatusEffectList : FFXIVIpcBasePacket< StatusEffectList >
{
uint8_t classId;
uint8_t level1;
@ -283,8 +262,7 @@ struct FFXIVIpcStatusEffectList :
uint32_t padding;
};
struct FFXIVGCAffiliation :
FFXIVIpcBasePacket< GCAffiliation >
struct FFXIVGCAffiliation : FFXIVIpcBasePacket< GCAffiliation >
{
uint8_t gcId;
uint8_t gcRank[3];
@ -294,8 +272,7 @@ struct FFXIVGCAffiliation :
* Structural representation of the packet sent by the server
* add a status effect
*/
struct FFXIVIpcAddStatusEffect :
FFXIVIpcBasePacket< AddStatusEffect >
struct FFXIVIpcAddStatusEffect : FFXIVIpcBasePacket< AddStatusEffect >
{
uint32_t unknown;
uint32_t actor_id;
@ -322,8 +299,7 @@ struct FFXIVIpcAddStatusEffect :
* Structural representation of the packet sent by the server
* to update certain player details / status
*/
struct FFXIVIpcActorControl142 :
FFXIVIpcBasePacket< ActorControl142 >
struct FFXIVIpcActorControl142 : FFXIVIpcBasePacket< ActorControl142 >
{
/* 0000 */ uint16_t category;
/* 0002 */ uint16_t padding;
@ -338,8 +314,7 @@ struct FFXIVIpcActorControl142 :
* Structural representation of the packet sent by the server
* to update certain player details / status
*/
struct FFXIVIpcActorControl143 :
FFXIVIpcBasePacket< ActorControl143 >
struct FFXIVIpcActorControl143 : FFXIVIpcBasePacket< ActorControl143 >
{
/* 0000 */ uint16_t category;
/* 0002 */ uint16_t padding;
@ -356,8 +331,7 @@ struct FFXIVIpcActorControl143 :
* Structural representation of the packet sent by the server
* to update certain player details / status
*/
struct FFXIVIpcActorControl144 :
FFXIVIpcBasePacket< ActorControl144 >
struct FFXIVIpcActorControl144 : FFXIVIpcBasePacket< ActorControl144 >
{
/* 0000 */ uint16_t category;
/* 0002 */ uint16_t padding;
@ -373,8 +347,7 @@ struct FFXIVIpcActorControl144 :
* Structural representation of the packet sent by the server
* to update HP / MP / TP
*/
struct FFXIVIpcUpdateHpMpTp :
FFXIVIpcBasePacket< UpdateHpMpTp >
struct FFXIVIpcUpdateHpMpTp : FFXIVIpcBasePacket< UpdateHpMpTp >
{
/* 0000 */ uint32_t hp;
/* 0004 */ uint16_t mp;
@ -480,8 +453,7 @@ struct FFXIVIpcAoeEffect32 :
* Structural representation of the packet sent by the server
* to spawn an actor
*/
struct FFXIVIpcPlayerSpawn :
FFXIVIpcBasePacket< PlayerSpawn >
struct FFXIVIpcPlayerSpawn : FFXIVIpcBasePacket< PlayerSpawn >
{
uint16_t title;
uint16_t u1b;
@ -558,8 +530,7 @@ struct FFXIVIpcPlayerSpawn :
* Structural representation of the packet sent by the server
* to spawn an actor
*/
struct FFXIVIpcNpcSpawn :
FFXIVIpcBasePacket< NpcSpawn >
struct FFXIVIpcNpcSpawn : FFXIVIpcBasePacket< NpcSpawn >
{
uint32_t gimmickId; // needs to be existing in the map, mob will snap to it
uint8_t u2b;
@ -639,8 +610,7 @@ struct FFXIVIpcNpcSpawn :
* Structural representation of the packet sent by the server
* to show player movement
*/
struct FFXIVIpcActorFreeSpawn :
FFXIVIpcBasePacket< ActorFreeSpawn >
struct FFXIVIpcActorFreeSpawn : FFXIVIpcBasePacket< ActorFreeSpawn >
{
uint32_t spawnId;
uint32_t actorId;
@ -650,8 +620,7 @@ struct FFXIVIpcActorFreeSpawn :
* Structural representation of the packet sent by the server
* to show player movement
*/
struct FFXIVIpcActorMove :
FFXIVIpcBasePacket< ActorMove >
struct FFXIVIpcActorMove : FFXIVIpcBasePacket< ActorMove >
{
/* 0000 */ uint8_t rotation;
/* 0001 */ uint8_t headRotation;
@ -669,8 +638,7 @@ struct FFXIVIpcActorMove :
* Structural representation of the packet sent by the server
* to set an actors position
*/
struct FFXIVIpcActorSetPos :
FFXIVIpcBasePacket< ActorSetPos >
struct FFXIVIpcActorSetPos : FFXIVIpcBasePacket< ActorSetPos >
{
uint16_t r16;
uint8_t waitForLoad;
@ -974,8 +942,7 @@ struct FFXIVIpcPlayerStats : FFXIVIpcBasePacket< PlayerStats >
* Structural representation of the packet sent by the server
* to set an actors current owner
*/
struct FFXIVIpcActorOwner :
FFXIVIpcBasePacket< ActorOwner >
struct FFXIVIpcActorOwner : FFXIVIpcBasePacket< ActorOwner >
{
uint8_t type;
uint8_t padding[7];
@ -987,8 +954,7 @@ struct FFXIVIpcActorOwner :
* Structural representation of the packet sent by the server
* to set a players state
*/
struct FFXIVIpcPlayerStateFlags :
FFXIVIpcBasePacket< PlayerStateFlags >
struct FFXIVIpcPlayerStateFlags : FFXIVIpcBasePacket< PlayerStateFlags >
{
uint8_t flags[12];
uint32_t padding;
@ -998,8 +964,7 @@ struct FFXIVIpcPlayerStateFlags :
* Structural representation of the packet sent by the server
* containing current class information
*/
struct FFXIVIpcPlayerClassInfo :
FFXIVIpcBasePacket< PlayerClassInfo >
struct FFXIVIpcPlayerClassInfo : FFXIVIpcBasePacket< PlayerClassInfo >
{
uint16_t classId;
uint8_t unknown;
@ -1013,8 +978,7 @@ struct FFXIVIpcPlayerClassInfo :
* Structural representation of the packet sent by the server
* to update a players appearance
*/
struct FFXIVIpcModelEquip :
FFXIVIpcBasePacket< ModelEquip >
struct FFXIVIpcModelEquip : FFXIVIpcBasePacket< ModelEquip >
{
/* 0000 */ uint64_t mainWeapon;
/* 0008 */ uint64_t offWeapon;
@ -1026,8 +990,7 @@ struct FFXIVIpcModelEquip :
/* 003C */ uint32_t padding2;
};
struct FFXIVIpcExamine :
FFXIVIpcBasePacket< Examine >
struct FFXIVIpcExamine : FFXIVIpcBasePacket< Examine >
{
uint8_t unkFlag1;
uint8_t unkFlag2;
@ -1067,8 +1030,7 @@ struct FFXIVIpcExamine :
char unknown4[200];
};
struct FFXIVIpcCharaNameReq :
FFXIVIpcBasePacket< CharaNameReq >
struct FFXIVIpcCharaNameReq : FFXIVIpcBasePacket< CharaNameReq >
{
uint64_t contentId;
char name[32];
@ -1078,8 +1040,7 @@ struct FFXIVIpcCharaNameReq :
* Structural representation of the packet sent by the server
* to update a players appearance
*/
struct FFXIVIpcItemInfo :
FFXIVIpcBasePacket< ItemInfo >
struct FFXIVIpcItemInfo : FFXIVIpcBasePacket< ItemInfo >
{
uint32_t containerSequence;
uint32_t unknown;
@ -1113,8 +1074,7 @@ struct FFXIVIpcItemInfo :
* Structural representation of the packet sent by the server
* to update a players appearance
*/
struct FFXIVIpcContainerInfo :
FFXIVIpcBasePacket< ContainerInfo >
struct FFXIVIpcContainerInfo : FFXIVIpcBasePacket< ContainerInfo >
{
uint32_t containerSequence;
uint32_t numItems;
@ -1126,8 +1086,7 @@ struct FFXIVIpcContainerInfo :
* Structural representation of the packet sent by the server
* to update a players appearance
*/
struct FFXIVIpcCurrencyCrystalInfo :
FFXIVIpcBasePacket< CurrencyCrystalInfo >
struct FFXIVIpcCurrencyCrystalInfo : FFXIVIpcBasePacket< CurrencyCrystalInfo >
{
uint32_t containerSequence;
uint16_t containerId;
@ -1140,16 +1099,14 @@ struct FFXIVIpcCurrencyCrystalInfo :
uint32_t unknown3;
};
struct FFXIVIpcInventoryTransactionFinish :
FFXIVIpcBasePacket< InventoryTransactionFinish >
struct FFXIVIpcInventoryTransactionFinish : FFXIVIpcBasePacket< InventoryTransactionFinish >
{
uint32_t sequenceId;
uint32_t sequenceId1;
uint64_t padding;
};
struct FFXIVIpcInventoryTransaction :
FFXIVIpcBasePacket< InventoryTransaction >
struct FFXIVIpcInventoryTransaction : FFXIVIpcBasePacket< InventoryTransaction >
{
uint32_t sequence;
uint8_t type;
@ -1167,8 +1124,7 @@ struct FFXIVIpcInventoryTransaction :
};
struct FFXIVIpcInventoryActionAck :
FFXIVIpcBasePacket< InventoryActionAck >
struct FFXIVIpcInventoryActionAck : FFXIVIpcBasePacket< InventoryActionAck >
{
uint32_t sequence;
uint16_t type;
@ -1182,8 +1138,7 @@ struct FFXIVIpcInventoryActionAck :
* Structural representation of the packet sent by the server
* to update a slot in the inventory
*/
struct FFXIVIpcUpdateInventorySlot :
FFXIVIpcBasePacket< UpdateInventorySlot >
struct FFXIVIpcUpdateInventorySlot : FFXIVIpcBasePacket< UpdateInventorySlot >
{
uint32_t sequence;
uint32_t unknown;
@ -1216,8 +1171,7 @@ struct FFXIVIpcUpdateInventorySlot :
* Structural representation of the packet sent by the server
* to start an event, not actually playing it, but registering
*/
struct FFXIVIpcEventStart :
FFXIVIpcBasePacket< EventStart >
struct FFXIVIpcEventStart : FFXIVIpcBasePacket< EventStart >
{
/* 0000 */ uint64_t actorId;
/* 0008 */ uint32_t eventId;
@ -1247,8 +1201,7 @@ struct FFXIVIpcHuntingLogEntry : FFXIVIpcBasePacket< HuntingLogEntry >
* Structural representation of the packet sent by the server
* to play an event
*/
struct FFXIVIpcEventPlay :
FFXIVIpcBasePacket< EventPlay >
struct FFXIVIpcEventPlay : FFXIVIpcBasePacket< EventPlay >
{
uint64_t actorId;
uint32_t eventId;
@ -1266,8 +1219,7 @@ struct FFXIVIpcEventPlay :
* Structural representation of the packet sent by the server
* to play an event
*/
struct FFXIVIpcDirectorPlayScene :
FFXIVIpcBasePacket< DirectorPlayScene >
struct FFXIVIpcDirectorPlayScene : FFXIVIpcBasePacket< DirectorPlayScene >
{
uint64_t actorId;
uint32_t eventId;
@ -1286,8 +1238,7 @@ struct FFXIVIpcDirectorPlayScene :
* Structural representation of the packet sent by the server
* to finish an event
*/
struct FFXIVIpcEventFinish :
FFXIVIpcBasePacket< EventFinish >
struct FFXIVIpcEventFinish : FFXIVIpcBasePacket< EventFinish >
{
/* 0000 */ uint32_t eventId;
/* 0004 */ uint8_t param1;
@ -1297,8 +1248,7 @@ struct FFXIVIpcEventFinish :
/* 000C */ uint32_t padding1;
};
struct FFXIVIpcEventOpenGilShop :
FFXIVIpcBasePacket< EventOpenGilShop >
struct FFXIVIpcEventOpenGilShop : FFXIVIpcBasePacket< EventOpenGilShop >
{
uint64_t actorId;
uint32_t eventId;
@ -1314,8 +1264,7 @@ struct FFXIVIpcEventOpenGilShop :
* Structural representation of the packet sent by the server
* to respond to a linkshell creation event
*/
struct FFXIVIpcEventLinkshell :
FFXIVIpcBasePacket< EventLinkshell >
struct FFXIVIpcEventLinkshell : FFXIVIpcBasePacket< EventLinkshell >
{
uint32_t eventId;
uint8_t scene;
@ -1332,8 +1281,7 @@ struct FFXIVIpcEventLinkshell :
* Structural representation of the packet sent by the server
* to send the active quests
*/
struct FFXIVIpcQuestActiveList :
FFXIVIpcBasePacket< QuestActiveList >
struct FFXIVIpcQuestActiveList : FFXIVIpcBasePacket< QuestActiveList >
{
Common::QuestActive activeQuests[30];
};
@ -1342,8 +1290,7 @@ struct FFXIVIpcQuestActiveList :
* Structural representation of the packet sent by the server
* to send update a quest slot
*/
struct FFXIVIpcQuestUpdate :
FFXIVIpcBasePacket< QuestUpdate >
struct FFXIVIpcQuestUpdate : FFXIVIpcBasePacket< QuestUpdate >
{
uint16_t slot;
uint16_t padding;
@ -1354,8 +1301,7 @@ struct FFXIVIpcQuestUpdate :
* Structural representation of the packet sent by the server
* to send the completed quests mask
*/
struct FFXIVIpcQuestCompleteList :
FFXIVIpcBasePacket< QuestCompleteList >
struct FFXIVIpcQuestCompleteList : FFXIVIpcBasePacket< QuestCompleteList >
{
uint8_t questCompleteMask[480];
uint8_t unknownCompleteMask[32];
@ -1365,8 +1311,7 @@ struct FFXIVIpcQuestCompleteList :
* Structural representation of the packet sent by the server
* to finish a quest
*/
struct FFXIVIpcQuestFinish :
FFXIVIpcBasePacket< QuestFinish >
struct FFXIVIpcQuestFinish : FFXIVIpcBasePacket< QuestFinish >
{
uint16_t questId;
uint8_t flag1;
@ -1381,8 +1326,7 @@ struct FFXIVIpcQuestFinish :
* type 1 icon
* type 5 status
*/
struct FFXIVIpcQuestMessage :
FFXIVIpcBasePacket< QuestMessage >
struct FFXIVIpcQuestMessage : FFXIVIpcBasePacket< QuestMessage >
{
/* 0000 */ uint32_t questId;
/* 0000 */ uint8_t msgId;
@ -1392,8 +1336,7 @@ struct FFXIVIpcQuestMessage :
/* 0000 */ uint32_t var2;
};
struct FFXIVIpcQuestTracker :
FFXIVIpcBasePacket< QuestTracker >
struct FFXIVIpcQuestTracker : FFXIVIpcBasePacket< QuestTracker >
{
struct TrackerEntry
{
@ -1404,8 +1347,7 @@ struct FFXIVIpcQuestTracker :
};
struct FFXIVIpcWeatherChange :
FFXIVIpcBasePacket< WeatherChange >
struct FFXIVIpcWeatherChange : FFXIVIpcBasePacket< WeatherChange >
{
uint32_t weatherId;
float delay;
@ -1415,8 +1357,7 @@ struct FFXIVIpcWeatherChange :
* Structural representation of the packet sent by the server
* to send a unviel a map
*/
struct FFXIVIpcDiscovery :
FFXIVIpcBasePacket< Discovery >
struct FFXIVIpcDiscovery : FFXIVIpcBasePacket< Discovery >
{
/* 0000 */ uint32_t map_part_id;
/* 0004 */ uint32_t map_id;
@ -1426,8 +1367,7 @@ struct FFXIVIpcDiscovery :
/**
* UNKOWN TYPE
*/
struct FFXIVARR_IPC_UNK322 :
FFXIVIpcBasePacket< IPCTYPE_UNK_322 >
struct FFXIVARR_IPC_UNK322 : FFXIVIpcBasePacket< IPCTYPE_UNK_322 >
{
/* 0000 */ uint8_t unk[8];
};
@ -1435,8 +1375,7 @@ struct FFXIVARR_IPC_UNK322 :
/**
* UNKOWN TYPE
*/
struct FFXIVARR_IPC_UNK320 :
FFXIVIpcBasePacket< IPCTYPE_UNK_320 >
struct FFXIVARR_IPC_UNK320 : FFXIVIpcBasePacket< IPCTYPE_UNK_320 >
{
/* 0000 */ uint8_t unk[0x38];
};
@ -1445,8 +1384,7 @@ struct FFXIVARR_IPC_UNK320 :
* Structural representation of the packet sent by the server
* prepare zoning, showing screenmessage
*/
struct FFXIVIpcPrepareZoning :
FFXIVIpcBasePacket< PrepareZoning >
struct FFXIVIpcPrepareZoning : FFXIVIpcBasePacket< PrepareZoning >
{
uint32_t logMessage;
uint16_t targetZone;
@ -1466,8 +1404,7 @@ struct FFXIVIpcPrepareZoning :
*
* See https://gist.github.com/Minoost/c35843c4c8a7a931f31fdaac9bce64c2
*/
struct FFXIVIpcCFNotify :
FFXIVIpcBasePacket< CFNotify >
struct FFXIVIpcCFNotify : FFXIVIpcBasePacket< CFNotify >
{
uint32_t state1; // 3 = cancelled, 4 = duty ready
uint32_t state2; // if state1 == 3, state2 is cancelled reason
@ -1487,8 +1424,7 @@ struct FFXIVIpcCFNotify :
* Do note that this packet has to come early in login phase (around initui packet)
* or it won't be applied until you reconnect
*/
struct FFXIVIpcCFAvailableContents :
FFXIVIpcBasePacket< CFAvailableContents >
struct FFXIVIpcCFAvailableContents : FFXIVIpcBasePacket< CFAvailableContents >
{
uint8_t contents[0x48];
};
@ -1497,8 +1433,7 @@ struct FFXIVIpcCFAvailableContents :
* Structural representation of the packet sent by the server
* to update adventure in needs in duty roulette
*/
struct FFXIVIpcCFPlayerInNeed :
FFXIVIpcBasePacket< CFPlayerInNeed >
struct FFXIVIpcCFPlayerInNeed : FFXIVIpcBasePacket< CFPlayerInNeed >
{
// Ordered by roulette id
uint8_t inNeeds[0x10];
@ -1508,15 +1443,13 @@ struct FFXIVIpcCFPlayerInNeed :
* Structural representation of the packet sent by the server
* to update duty info in general
*/
struct FFXIVIpcCFDutyInfo :
FFXIVIpcBasePacket< CFDutyInfo >
struct FFXIVIpcCFDutyInfo : FFXIVIpcBasePacket< CFDutyInfo >
{
uint8_t penaltyTime;
uint8_t unknown[7];
};
struct FFXIVIpcCFRegisterDuty :
FFXIVIpcBasePacket< CFRegisterDuty >
struct FFXIVIpcCFRegisterDuty : FFXIVIpcBasePacket< CFRegisterDuty >
{
uint32_t unknown0; // 0x301
uint8_t rouletteId; // if it's a daily roulette
@ -1525,8 +1458,7 @@ struct FFXIVIpcCFRegisterDuty :
};
struct FFXIVIpcCFMemberStatus :
FFXIVIpcBasePacket< CFMemberStatus >
struct FFXIVIpcCFMemberStatus : FFXIVIpcBasePacket< CFMemberStatus >
{
uint16_t contentId;
uint16_t unknown1;
@ -1539,8 +1471,7 @@ struct FFXIVIpcCFMemberStatus :
uint32_t unknown3;
};
struct FFXIVIpcEorzeaTimeOffset :
FFXIVIpcBasePacket< EorzeaTimeOffset >
struct FFXIVIpcEorzeaTimeOffset : FFXIVIpcBasePacket< EorzeaTimeOffset >
{
uint64_t timestamp;
};
@ -1549,8 +1480,7 @@ struct FFXIVIpcEorzeaTimeOffset :
* Structural representation of the packet sent by the server
* to set the gear show/hide status of a character
*/
struct FFXIVIpcEquipDisplayFlags :
FFXIVIpcBasePacket< EquipDisplayFlags >
struct FFXIVIpcEquipDisplayFlags : FFXIVIpcBasePacket< EquipDisplayFlags >
{
uint8_t bitmask;
};
@ -1773,8 +1703,7 @@ struct FFXIVIpcHousingEstateGreeting : FFXIVIpcBasePacket< HousingEstateGreeting
char message[200];
};
struct FFXIVIpcHousingShowEstateGuestAccess :
FFXIVIpcBasePacket< HousingShowEstateGuestAccess >
struct FFXIVIpcHousingShowEstateGuestAccess : FFXIVIpcBasePacket< HousingShowEstateGuestAccess >
{
uint32_t unknown[2];
Common::LandIdent ident;
@ -1784,8 +1713,7 @@ struct FFXIVIpcHousingShowEstateGuestAccess :
* Structural representation of the packet sent by the server
* to show the current shared estate settings
*/
struct FFXIVIpcSharedEstateSettingsResponse :
FFXIVIpcBasePacket< SharedEstateSettingsResponse >
struct FFXIVIpcSharedEstateSettingsResponse : FFXIVIpcBasePacket< SharedEstateSettingsResponse >
{
struct playerEntry
{
@ -1796,15 +1724,13 @@ struct FFXIVIpcSharedEstateSettingsResponse :
} entry[3];
};
struct FFXIVIpcMSQTrackerProgress :
FFXIVIpcBasePacket< MSQTrackerProgress >
struct FFXIVIpcMSQTrackerProgress : FFXIVIpcBasePacket< MSQTrackerProgress >
{
uint32_t id;
uint32_t padding;
};
struct FFXIVIpcMSQTrackerComplete :
FFXIVIpcBasePacket< MSQTrackerComplete >
struct FFXIVIpcMSQTrackerComplete : FFXIVIpcBasePacket< MSQTrackerComplete >
{
uint32_t id;
uint32_t padding1;
@ -1813,8 +1739,7 @@ struct FFXIVIpcMSQTrackerComplete :
uint64_t padding4; // last 4 bytes is uint32_t but who cares
};
struct FFXIVIpcObjectSpawn :
FFXIVIpcBasePacket< ObjectSpawn >
struct FFXIVIpcObjectSpawn : FFXIVIpcBasePacket< ObjectSpawn >
{
uint8_t spawnIndex;
uint8_t objKind;
@ -1839,15 +1764,13 @@ struct FFXIVIpcObjectSpawn :
int16_t unknown3E;
};
struct FFXIVIpcObjectDespawn :
FFXIVIpcBasePacket< ObjectDespawn >
struct FFXIVIpcObjectDespawn : FFXIVIpcBasePacket< ObjectDespawn >
{
uint8_t spawnIndex;
uint8_t padding[7];
};
struct FFXIVIpcDuelChallenge :
FFXIVIpcBasePacket< DuelChallenge >
struct FFXIVIpcDuelChallenge : FFXIVIpcBasePacket< DuelChallenge >
{
uint8_t otherClassJobId;
uint8_t otherLevel; // class job level
@ -1859,8 +1782,7 @@ struct FFXIVIpcDuelChallenge :
char otherName[32];
};
struct FFXIVIpcMarketBoardSearchResult :
FFXIVIpcBasePacket< MarketBoardSearchResult >
struct FFXIVIpcMarketBoardSearchResult : FFXIVIpcBasePacket< MarketBoardSearchResult >
{
struct MarketBoardItem
{
@ -1875,8 +1797,7 @@ struct FFXIVIpcMarketBoardSearchResult :
uint32_t requestId;
};
struct FFFXIVIpcMarketBoardItemListingCount :
FFXIVIpcBasePacket< MarketBoardItemListingCount >
struct FFFXIVIpcMarketBoardItemListingCount : FFXIVIpcBasePacket< MarketBoardItemListingCount >
{
uint32_t itemCatalogId;
uint32_t unknown1; // does some shit if nonzero
@ -1885,8 +1806,7 @@ struct FFFXIVIpcMarketBoardItemListingCount :
uint32_t unknown3;
};
struct FFXIVIpcMarketBoardItemListingHistory :
FFXIVIpcBasePacket< MarketBoardItemListingHistory >
struct FFXIVIpcMarketBoardItemListingHistory : FFXIVIpcBasePacket< MarketBoardItemListingHistory >
{
uint32_t itemCatalogId;
uint32_t itemCatalogId2;
@ -1906,12 +1826,6 @@ struct FFXIVIpcMarketBoardItemListingHistory :
} listing[20];
};
} /* Server */
} /* Packets */
} /* Network */
} /* Sapphire */
}
#endif /*_CORE_NETWORK_PACKETS_SERVER_IPC_H*/

View file

@ -450,6 +450,7 @@ void Sapphire::Entity::BNpc::update( int64_t currTime )
setHp( getMaxHp() );
m_state = BNpcState::Idle;
setOwner( nullptr );
}
}
break;
@ -515,7 +516,7 @@ void Sapphire::Entity::BNpc::update( int64_t currTime )
hateListClear();
changeTarget( INVALID_GAME_OBJECT_ID64 );
setStance( Stance::Passive );
//setOwner( nullptr );
setOwner( nullptr );
m_state = BNpcState::Retreat;
break;
}
@ -568,8 +569,8 @@ void Sapphire::Entity::BNpc::onActionHostile( Sapphire::Entity::CharaPtr pSource
if( !hateListGetHighest() )
aggro( pSource );
//if( !getClaimer() )
// setOwner( pSource->getAsPlayer() );
if( !m_pOwner )
setOwner( pSource );
}
void Sapphire::Entity::BNpc::onDeath()
@ -578,6 +579,7 @@ void Sapphire::Entity::BNpc::onDeath()
m_currentStance = Stance::Passive;
m_state = BNpcState::Dead;
m_timeOfDeath = Util::getTimeSeconds();
setOwner( nullptr );
for( auto& pHateEntry : m_hateList )
{
@ -666,3 +668,22 @@ void Sapphire::Entity::BNpc::pushNearbyBNpcs()
// m_pos.z + ( zBase * -pushDistance ) );
}
}
void Sapphire::Entity::BNpc::setOwner( Sapphire::Entity::CharaPtr m_pChara )
{
m_pOwner = m_pChara;
if( m_pChara != nullptr )
{
auto setOwnerPacket = makeZonePacket< FFXIVIpcActorOwner >( m_pChara->getId() );
setOwnerPacket->data().type = 0x01;
setOwnerPacket->data().actorId2 = m_pChara->getId();
sendToInRangeSet( setOwnerPacket );
}
else
{
auto setOwnerPacket = makeZonePacket< FFXIVIpcActorOwner >( m_pChara->getId() );
setOwnerPacket->data().type = 0x01;
setOwnerPacket->data().actorId2 = INVALID_GAME_OBJECT_ID;
sendToInRangeSet( setOwnerPacket );
}
}

View file

@ -100,6 +100,8 @@ namespace Sapphire::Entity
void pushNearbyBNpcs();
void setOwner( CharaPtr m_pChara );
private:
uint32_t m_bNpcBaseId;
uint32_t m_bNpcNameId;
@ -130,6 +132,8 @@ namespace Sapphire::Entity
uint8_t m_naviPathStep;
Common::FFXIVARR_POSITION3 m_naviTarget;
CharaPtr m_pOwner;
};
}

View file

@ -2054,13 +2054,11 @@ void Sapphire::Entity::Player::updateHuntingLog( uint16_t id )
auto note = pExdData->get< Sapphire::Data::MonsterNote >( monsterNoteId );
for( auto x = 0; x < 4; ++x )
{
Logger::debug( "checking monsterNoteId#{}, monsternoteTarget#{}", monsterNoteId, note->monsterNoteTarget[ x ] );
auto note1 = pExdData->get< Sapphire::Data::MonsterNoteTarget >( note->monsterNoteTarget[ x ] );
if( note1->bNpcName == id && logEntry.entries[ i - 1 ][ x ] < note->count[ x ] )
{
logEntry.entries[ i - 1 ][ x ]++;
queuePacket( makeActorControl143( getId(), HuntingLogEntryUpdate, monsterNoteId, x, logEntry.entries[ i - 1 ][ x ] ) );
Logger::debug( "Kill counts!" );
logChanged = true;
sectionChanged = true;
}