mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
Update to EQEmu::saylink function linkage
This commit is contained in:
parent
e87e4d07f0
commit
6bc60391fb
@ -25,108 +25,114 @@
|
||||
#include <string>
|
||||
|
||||
|
||||
class ItemInst;
|
||||
struct Item_Struct;
|
||||
struct ServerLootItem_Struct;
|
||||
class ItemInst;
|
||||
|
||||
|
||||
namespace EQEmu
|
||||
{
|
||||
namespace saylink {
|
||||
// Current server mask: EQClientRoF2
|
||||
struct SayLinkBody_Struct {
|
||||
uint8 unknown_1; /* %1X */
|
||||
uint32 item_id; /* %05X */
|
||||
uint32 augment_1; /* %05X */
|
||||
uint32 augment_2; /* %05X */
|
||||
uint32 augment_3; /* %05X */
|
||||
uint32 augment_4; /* %05X */
|
||||
uint32 augment_5; /* %05X */
|
||||
uint32 augment_6; /* %05X */
|
||||
uint8 is_evolving; /* %1X */
|
||||
uint32 evolve_group; /* %05X */
|
||||
uint8 evolve_level; /* %02X */
|
||||
uint32 ornament_icon; /* %05X */
|
||||
int hash; /* %08X */
|
||||
};
|
||||
struct SayLinkBody_Struct; // Current server mask: EQClientRoF2
|
||||
|
||||
class SayLinkEngine {
|
||||
public:
|
||||
enum SayLinkType {
|
||||
SayLinkBlank = 0,
|
||||
SayLinkItemData,
|
||||
SayLinkLootItem,
|
||||
SayLinkItemInst
|
||||
};
|
||||
class SayLinkEngine;
|
||||
|
||||
SayLinkEngine();
|
||||
|
||||
void SetLinkType(SayLinkType link_type) { m_LinkType = link_type; }
|
||||
void SetItemData(const Item_Struct* item_data) { m_ItemData = item_data; }
|
||||
void SetLootData(const ServerLootItem_Struct* loot_data) { m_LootData = loot_data; }
|
||||
void SetItemInst(const ItemInst* item_inst) { m_ItemInst = item_inst; }
|
||||
|
||||
// mainly for saylinks..but, not limited to
|
||||
void SetProxyUnknown1(uint8 proxy_unknown_1) { m_Proxy_unknown_1 = proxy_unknown_1; }
|
||||
void SetProxyItemID(uint32 proxy_item_id) { m_ProxyItemID = proxy_item_id; }
|
||||
void SetProxyAugment1ID(uint32 proxy_augment_id) { m_ProxyAugment1ID = proxy_augment_id; }
|
||||
void SetProxyAugment2ID(uint32 proxy_augment_id) { m_ProxyAugment2ID = proxy_augment_id; }
|
||||
void SetProxyAugment3ID(uint32 proxy_augment_id) { m_ProxyAugment3ID = proxy_augment_id; }
|
||||
void SetProxyAugment4ID(uint32 proxy_augment_id) { m_ProxyAugment4ID = proxy_augment_id; }
|
||||
void SetProxyAugment5ID(uint32 proxy_augment_id) { m_ProxyAugment5ID = proxy_augment_id; }
|
||||
void SetProxyAugment6ID(uint32 proxy_augment_id) { m_ProxyAugment6ID = proxy_augment_id; }
|
||||
void SetProxyIsEvolving(uint8 proxy_is_evolving) { m_ProxyIsEvolving = proxy_is_evolving; }
|
||||
void SetProxyEvolveGroup(uint32 proxy_evolve_group) { m_ProxyEvolveGroup = proxy_evolve_group; }
|
||||
void SetProxyEvolveLevel(uint8 proxy_evolve_level) { m_ProxyEvolveLevel = proxy_evolve_level; }
|
||||
void SetProxyOrnamentIcon(uint32 proxy_ornament_icon) { m_ProxyOrnamentIcon = proxy_ornament_icon; }
|
||||
void SetProxyHash(int proxy_hash) { m_ProxyHash = proxy_hash; }
|
||||
|
||||
void SetProxyText(const char* proxy_text) { m_ProxyText = proxy_text; } // overrides standard text use
|
||||
void SetTaskUse() { m_TaskUse = true; }
|
||||
|
||||
std::string GenerateLink();
|
||||
bool LinkError() { return m_Error; }
|
||||
|
||||
std::string Link() { return m_Link; } // contains full string format: '/12x' '<LinkBody>' '<LinkText>' '/12x'
|
||||
std::string LinkBody() { return m_LinkBody; } // contains string format: '<LinkBody>'
|
||||
std::string LinkText() { return m_LinkText; } // contains string format: '<LinkText>'
|
||||
|
||||
void Reset();
|
||||
|
||||
private:
|
||||
void generate_body();
|
||||
void generate_text();
|
||||
|
||||
int m_LinkType;
|
||||
const Item_Struct* m_ItemData;
|
||||
const ServerLootItem_Struct* m_LootData;
|
||||
const ItemInst* m_ItemInst;
|
||||
|
||||
uint8 m_Proxy_unknown_1;
|
||||
uint32 m_ProxyItemID;
|
||||
uint32 m_ProxyAugment1ID;
|
||||
uint32 m_ProxyAugment2ID;
|
||||
uint32 m_ProxyAugment3ID;
|
||||
uint32 m_ProxyAugment4ID;
|
||||
uint32 m_ProxyAugment5ID;
|
||||
uint32 m_ProxyAugment6ID;
|
||||
uint8 m_ProxyIsEvolving;
|
||||
uint32 m_ProxyEvolveGroup;
|
||||
uint8 m_ProxyEvolveLevel;
|
||||
uint32 m_ProxyOrnamentIcon;
|
||||
int m_ProxyHash;
|
||||
const char* m_ProxyText;
|
||||
bool m_TaskUse;
|
||||
SayLinkBody_Struct m_LinkBodyStruct;
|
||||
std::string m_Link;
|
||||
std::string m_LinkBody;
|
||||
std::string m_LinkText;
|
||||
bool m_Error;
|
||||
};
|
||||
|
||||
bool DegenerateLinkBody(SayLinkBody_Struct& say_Link_body_struct, const std::string& say_link_body);
|
||||
bool GenerateLinkBody(std::string& say_link_body, const SayLinkBody_Struct& say_link_body_struct);
|
||||
extern bool DegenerateLinkBody(SayLinkBody_Struct& say_Link_body_struct, const std::string& say_link_body);
|
||||
extern bool GenerateLinkBody(std::string& say_link_body, const SayLinkBody_Struct& say_link_body_struct);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
struct EQEmu::saylink::SayLinkBody_Struct
|
||||
{
|
||||
uint8 unknown_1; /* %1X */
|
||||
uint32 item_id; /* %05X */
|
||||
uint32 augment_1; /* %05X */
|
||||
uint32 augment_2; /* %05X */
|
||||
uint32 augment_3; /* %05X */
|
||||
uint32 augment_4; /* %05X */
|
||||
uint32 augment_5; /* %05X */
|
||||
uint32 augment_6; /* %05X */
|
||||
uint8 is_evolving; /* %1X */
|
||||
uint32 evolve_group; /* %05X */
|
||||
uint8 evolve_level; /* %02X */
|
||||
uint32 ornament_icon; /* %05X */
|
||||
int hash; /* %08X */
|
||||
};
|
||||
|
||||
class EQEmu::saylink::SayLinkEngine
|
||||
{
|
||||
public:
|
||||
enum SayLinkType {
|
||||
SayLinkBlank = 0,
|
||||
SayLinkItemData,
|
||||
SayLinkLootItem,
|
||||
SayLinkItemInst
|
||||
};
|
||||
|
||||
SayLinkEngine();
|
||||
|
||||
void SetLinkType(SayLinkType link_type) { m_LinkType = link_type; }
|
||||
void SetItemData(const Item_Struct* item_data) { m_ItemData = item_data; }
|
||||
void SetLootData(const ServerLootItem_Struct* loot_data) { m_LootData = loot_data; }
|
||||
void SetItemInst(const ItemInst* item_inst) { m_ItemInst = item_inst; }
|
||||
|
||||
// mainly for saylinks..but, not limited to
|
||||
void SetProxyUnknown1(uint8 proxy_unknown_1) { m_Proxy_unknown_1 = proxy_unknown_1; }
|
||||
void SetProxyItemID(uint32 proxy_item_id) { m_ProxyItemID = proxy_item_id; }
|
||||
void SetProxyAugment1ID(uint32 proxy_augment_id) { m_ProxyAugment1ID = proxy_augment_id; }
|
||||
void SetProxyAugment2ID(uint32 proxy_augment_id) { m_ProxyAugment2ID = proxy_augment_id; }
|
||||
void SetProxyAugment3ID(uint32 proxy_augment_id) { m_ProxyAugment3ID = proxy_augment_id; }
|
||||
void SetProxyAugment4ID(uint32 proxy_augment_id) { m_ProxyAugment4ID = proxy_augment_id; }
|
||||
void SetProxyAugment5ID(uint32 proxy_augment_id) { m_ProxyAugment5ID = proxy_augment_id; }
|
||||
void SetProxyAugment6ID(uint32 proxy_augment_id) { m_ProxyAugment6ID = proxy_augment_id; }
|
||||
void SetProxyIsEvolving(uint8 proxy_is_evolving) { m_ProxyIsEvolving = proxy_is_evolving; }
|
||||
void SetProxyEvolveGroup(uint32 proxy_evolve_group) { m_ProxyEvolveGroup = proxy_evolve_group; }
|
||||
void SetProxyEvolveLevel(uint8 proxy_evolve_level) { m_ProxyEvolveLevel = proxy_evolve_level; }
|
||||
void SetProxyOrnamentIcon(uint32 proxy_ornament_icon) { m_ProxyOrnamentIcon = proxy_ornament_icon; }
|
||||
void SetProxyHash(int proxy_hash) { m_ProxyHash = proxy_hash; }
|
||||
|
||||
void SetProxyText(const char* proxy_text) { m_ProxyText = proxy_text; } // overrides standard text use
|
||||
void SetTaskUse() { m_TaskUse = true; }
|
||||
|
||||
std::string GenerateLink();
|
||||
bool LinkError() { return m_Error; }
|
||||
|
||||
std::string Link() { return m_Link; } // contains full string format: '/12x' '<LinkBody>' '<LinkText>' '/12x'
|
||||
std::string LinkBody() { return m_LinkBody; } // contains string format: '<LinkBody>'
|
||||
std::string LinkText() { return m_LinkText; } // contains string format: '<LinkText>'
|
||||
|
||||
void Reset();
|
||||
|
||||
private:
|
||||
void generate_body();
|
||||
void generate_text();
|
||||
|
||||
int m_LinkType;
|
||||
const Item_Struct* m_ItemData;
|
||||
const ServerLootItem_Struct* m_LootData;
|
||||
const ItemInst* m_ItemInst;
|
||||
|
||||
uint8 m_Proxy_unknown_1;
|
||||
uint32 m_ProxyItemID;
|
||||
uint32 m_ProxyAugment1ID;
|
||||
uint32 m_ProxyAugment2ID;
|
||||
uint32 m_ProxyAugment3ID;
|
||||
uint32 m_ProxyAugment4ID;
|
||||
uint32 m_ProxyAugment5ID;
|
||||
uint32 m_ProxyAugment6ID;
|
||||
uint8 m_ProxyIsEvolving;
|
||||
uint32 m_ProxyEvolveGroup;
|
||||
uint8 m_ProxyEvolveLevel;
|
||||
uint32 m_ProxyOrnamentIcon;
|
||||
int m_ProxyHash;
|
||||
const char* m_ProxyText;
|
||||
bool m_TaskUse;
|
||||
SayLinkBody_Struct m_LinkBodyStruct;
|
||||
std::string m_Link;
|
||||
std::string m_LinkBody;
|
||||
std::string m_LinkText;
|
||||
bool m_Error;
|
||||
};
|
||||
|
||||
#endif /* COMMON_SAY_LINK_H */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user