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

View file

@ -450,6 +450,7 @@ void Sapphire::Entity::BNpc::update( int64_t currTime )
setHp( getMaxHp() ); setHp( getMaxHp() );
m_state = BNpcState::Idle; m_state = BNpcState::Idle;
setOwner( nullptr );
} }
} }
break; break;
@ -515,7 +516,7 @@ void Sapphire::Entity::BNpc::update( int64_t currTime )
hateListClear(); hateListClear();
changeTarget( INVALID_GAME_OBJECT_ID64 ); changeTarget( INVALID_GAME_OBJECT_ID64 );
setStance( Stance::Passive ); setStance( Stance::Passive );
//setOwner( nullptr ); setOwner( nullptr );
m_state = BNpcState::Retreat; m_state = BNpcState::Retreat;
break; break;
} }
@ -568,8 +569,8 @@ void Sapphire::Entity::BNpc::onActionHostile( Sapphire::Entity::CharaPtr pSource
if( !hateListGetHighest() ) if( !hateListGetHighest() )
aggro( pSource ); aggro( pSource );
//if( !getClaimer() ) if( !m_pOwner )
// setOwner( pSource->getAsPlayer() ); setOwner( pSource );
} }
void Sapphire::Entity::BNpc::onDeath() void Sapphire::Entity::BNpc::onDeath()
@ -578,6 +579,7 @@ void Sapphire::Entity::BNpc::onDeath()
m_currentStance = Stance::Passive; m_currentStance = Stance::Passive;
m_state = BNpcState::Dead; m_state = BNpcState::Dead;
m_timeOfDeath = Util::getTimeSeconds(); m_timeOfDeath = Util::getTimeSeconds();
setOwner( nullptr );
for( auto& pHateEntry : m_hateList ) for( auto& pHateEntry : m_hateList )
{ {
@ -666,3 +668,22 @@ void Sapphire::Entity::BNpc::pushNearbyBNpcs()
// m_pos.z + ( zBase * -pushDistance ) ); // 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 pushNearbyBNpcs();
void setOwner( CharaPtr m_pChara );
private: private:
uint32_t m_bNpcBaseId; uint32_t m_bNpcBaseId;
uint32_t m_bNpcNameId; uint32_t m_bNpcNameId;
@ -130,6 +132,8 @@ namespace Sapphire::Entity
uint8_t m_naviPathStep; uint8_t m_naviPathStep;
Common::FFXIVARR_POSITION3 m_naviTarget; 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 ); auto note = pExdData->get< Sapphire::Data::MonsterNote >( monsterNoteId );
for( auto x = 0; x < 4; ++x ) 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 ] ); auto note1 = pExdData->get< Sapphire::Data::MonsterNoteTarget >( note->monsterNoteTarget[ x ] );
if( note1->bNpcName == id && logEntry.entries[ i - 1 ][ x ] < note->count[ x ] ) if( note1->bNpcName == id && logEntry.entries[ i - 1 ][ x ] < note->count[ x ] )
{ {
logEntry.entries[ i - 1 ][ x ]++; logEntry.entries[ i - 1 ][ x ]++;
queuePacket( makeActorControl143( getId(), HuntingLogEntryUpdate, monsterNoteId, x, logEntry.entries[ i - 1 ][ x ] ) ); queuePacket( makeActorControl143( getId(), HuntingLogEntryUpdate, monsterNoteId, x, logEntry.entries[ i - 1 ][ x ] ) );
Logger::debug( "Kill counts!" );
logChanged = true; logChanged = true;
sectionChanged = true; sectionChanged = true;
} }