mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
Reworked EQDictionary into namespace EQEmu
This commit is contained in:
+1
-2
@@ -23,7 +23,6 @@ Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||
#include "../common/races.h"
|
||||
#include "../common/spdat.h"
|
||||
#include "../common/string_util.h"
|
||||
#include "../common/deity.h"
|
||||
#include "aa.h"
|
||||
#include "client.h"
|
||||
#include "corpse.h"
|
||||
@@ -1434,7 +1433,7 @@ bool Mob::CanUseAlternateAdvancementRank(AA::Rank *rank) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto deity = ConvertDeityToBitDeity((DeityTypes)GetDeity());
|
||||
auto deity = GetDeityBit();
|
||||
if(!(ability->deities & deity)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
+3
-3
@@ -93,7 +93,7 @@ Bot::Bot(NPCType npcTypeData, Client* botOwner) : NPC(&npcTypeData, nullptr, glm
|
||||
timers[i] = 0;
|
||||
|
||||
strcpy(this->name, this->GetCleanName());
|
||||
memset(&m_Light, 0, sizeof(LightProfile_Struct));
|
||||
memset(&m_Light, 0, sizeof(EQEmu::LightSource::impl));
|
||||
memset(&_botInspectMessage, 0, sizeof(InspectMessage_Struct));
|
||||
}
|
||||
|
||||
@@ -8469,8 +8469,8 @@ std::string Bot::CreateSayLink(Client* c, const char* message, const char* name)
|
||||
uint32 saylink_id = database.LoadSaylinkID(escaped_string);
|
||||
safe_delete_array(escaped_string);
|
||||
|
||||
Client::TextLink linker;
|
||||
linker.SetLinkType(linker.linkItemData);
|
||||
EQEmu::SayLink::impl linker;
|
||||
linker.SetLinkType(EQEmu::SayLink::LinkItemData);
|
||||
linker.SetProxyItemID(SAYLINK_ITEM_ID);
|
||||
linker.SetProxyAugment1ID(saylink_id);
|
||||
linker.SetProxyText(name);
|
||||
|
||||
+1
-1
@@ -386,7 +386,7 @@ public:
|
||||
void BotTradeAddItem(uint32 id, const ItemInst* inst, int16 charges, uint32 equipableSlots, uint16 lootSlot, std::string* errorMessage, bool addToDb = true);
|
||||
void EquipBot(std::string* errorMessage);
|
||||
bool CheckLoreConflict(const Item_Struct* item);
|
||||
virtual void UpdateEquipmentLight() { m_Light.Type.Equipment = m_inv.FindBrightestLightType(); m_Light.Level.Equipment = m_Light.TypeToLevel(m_Light.Type.Equipment); }
|
||||
virtual void UpdateEquipmentLight() { m_Light.Type.Equipment = m_inv.FindBrightestLightType(); m_Light.Level.Equipment = EQEmu::LightSource::TypeToLevel(m_Light.Type.Equipment); }
|
||||
|
||||
// Static Class Methods
|
||||
//static void DestroyBotRaidObjects(Client* client); // Can be removed after bot raids are dumped
|
||||
|
||||
@@ -7066,8 +7066,8 @@ void bot_subcommand_inventory_list(Client *c, const Seperator *sep)
|
||||
bool is2Hweapon = false;
|
||||
|
||||
std::string item_link;
|
||||
Client::TextLink linker;
|
||||
linker.SetLinkType(linker.linkItemInst);
|
||||
EQEmu::SayLink::impl linker;
|
||||
linker.SetLinkType(EQEmu::SayLink::LinkItemInst);
|
||||
|
||||
uint32 inventory_count = 0;
|
||||
for (int i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= (EQEmu::Constants::EQUIPMENT_END + 1); ++i) {
|
||||
|
||||
-246
@@ -8416,252 +8416,6 @@ void Client::SendColoredText(uint32 color, std::string message)
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// class Client::TextLink
|
||||
//
|
||||
std::string Client::TextLink::GenerateLink()
|
||||
{
|
||||
m_Link.clear();
|
||||
m_LinkBody.clear();
|
||||
m_LinkText.clear();
|
||||
|
||||
generate_body();
|
||||
generate_text();
|
||||
|
||||
if ((m_LinkBody.length() == EQEmu::Constants::TEXT_LINK_BODY_LENGTH) && (m_LinkText.length() > 0)) {
|
||||
m_Link.push_back(0x12);
|
||||
m_Link.append(m_LinkBody);
|
||||
m_Link.append(m_LinkText);
|
||||
m_Link.push_back(0x12);
|
||||
}
|
||||
|
||||
if ((m_Link.length() == 0) || (m_Link.length() > 250)) {
|
||||
m_Error = true;
|
||||
m_Link = "<LINKER ERROR>";
|
||||
Log.Out(Logs::General, Logs::Error, "TextLink::GenerateLink() failed to generate a useable text link (LinkType: %i, Lengths: {link: %u, body: %u, text: %u})",
|
||||
m_LinkType, m_Link.length(), m_LinkBody.length(), m_LinkText.length());
|
||||
Log.Out(Logs::General, Logs::Error, ">> LinkBody: %s", m_LinkBody.c_str());
|
||||
Log.Out(Logs::General, Logs::Error, ">> LinkText: %s", m_LinkText.c_str());
|
||||
}
|
||||
|
||||
return m_Link;
|
||||
}
|
||||
|
||||
void Client::TextLink::Reset()
|
||||
{
|
||||
m_LinkType = linkBlank;
|
||||
m_ItemData = nullptr;
|
||||
m_LootData = nullptr;
|
||||
m_ItemInst = nullptr;
|
||||
m_Proxy_unknown_1 = NOT_USED;
|
||||
m_ProxyItemID = NOT_USED;
|
||||
m_ProxyAugment1ID = NOT_USED;
|
||||
m_ProxyAugment2ID = NOT_USED;
|
||||
m_ProxyAugment3ID = NOT_USED;
|
||||
m_ProxyAugment4ID = NOT_USED;
|
||||
m_ProxyAugment5ID = NOT_USED;
|
||||
m_ProxyAugment6ID = NOT_USED;
|
||||
m_ProxyIsEvolving = NOT_USED;
|
||||
m_ProxyEvolveGroup = NOT_USED;
|
||||
m_ProxyEvolveLevel = NOT_USED;
|
||||
m_ProxyOrnamentIcon = NOT_USED;
|
||||
m_ProxyHash = NOT_USED;
|
||||
m_ProxyText = nullptr;
|
||||
m_TaskUse = false;
|
||||
m_Link.clear();
|
||||
m_LinkBody.clear();
|
||||
m_LinkText.clear();
|
||||
m_Error = false;
|
||||
}
|
||||
|
||||
void Client::TextLink::generate_body()
|
||||
{
|
||||
/*
|
||||
Current server mask: EQClientRoF2
|
||||
|
||||
RoF2: "%1X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%1X" "%04X" "%02X" "%05X" "%08X" (56)
|
||||
RoF: "%1X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%1X" "%04X" "%1X" "%05X" "%08X" (55)
|
||||
SoF: "%1X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%1X" "%04X" "%1X" "%05X" "%08X" (50)
|
||||
6.2: "%1X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%1X" "%04X" "%1X" "%08X" (45)
|
||||
*/
|
||||
|
||||
memset(&m_LinkBodyStruct, 0, sizeof(TextLinkBody_Struct));
|
||||
|
||||
const Item_Struct* item_data = nullptr;
|
||||
|
||||
switch (m_LinkType) {
|
||||
case linkBlank:
|
||||
break;
|
||||
case linkItemData:
|
||||
if (m_ItemData == nullptr) { break; }
|
||||
m_LinkBodyStruct.item_id = m_ItemData->ID;
|
||||
m_LinkBodyStruct.evolve_group = m_ItemData->LoreGroup; // this probably won't work for all items
|
||||
//m_LinkBodyStruct.evolve_level = m_ItemData->EvolvingLevel;
|
||||
// TODO: add hash call
|
||||
break;
|
||||
case linkLootItem:
|
||||
if (m_LootData == nullptr) { break; }
|
||||
item_data = database.GetItem(m_LootData->item_id);
|
||||
if (item_data == nullptr) { break; }
|
||||
m_LinkBodyStruct.item_id = item_data->ID;
|
||||
m_LinkBodyStruct.augment_1 = m_LootData->aug_1;
|
||||
m_LinkBodyStruct.augment_2 = m_LootData->aug_2;
|
||||
m_LinkBodyStruct.augment_3 = m_LootData->aug_3;
|
||||
m_LinkBodyStruct.augment_4 = m_LootData->aug_4;
|
||||
m_LinkBodyStruct.augment_5 = m_LootData->aug_5;
|
||||
m_LinkBodyStruct.augment_6 = m_LootData->aug_6;
|
||||
m_LinkBodyStruct.evolve_group = item_data->LoreGroup; // see note above
|
||||
//m_LinkBodyStruct.evolve_level = item_data->EvolvingLevel;
|
||||
// TODO: add hash call
|
||||
break;
|
||||
case linkItemInst:
|
||||
if (m_ItemInst == nullptr) { break; }
|
||||
if (m_ItemInst->GetItem() == nullptr) { break; }
|
||||
m_LinkBodyStruct.item_id = m_ItemInst->GetItem()->ID;
|
||||
m_LinkBodyStruct.augment_1 = m_ItemInst->GetAugmentItemID(0);
|
||||
m_LinkBodyStruct.augment_2 = m_ItemInst->GetAugmentItemID(1);
|
||||
m_LinkBodyStruct.augment_3 = m_ItemInst->GetAugmentItemID(2);
|
||||
m_LinkBodyStruct.augment_4 = m_ItemInst->GetAugmentItemID(3);
|
||||
m_LinkBodyStruct.augment_5 = m_ItemInst->GetAugmentItemID(4);
|
||||
m_LinkBodyStruct.augment_6 = m_ItemInst->GetAugmentItemID(5);
|
||||
m_LinkBodyStruct.is_evolving = (m_ItemInst->IsEvolving() ? 1 : 0);
|
||||
m_LinkBodyStruct.evolve_group = m_ItemInst->GetItem()->LoreGroup; // see note above
|
||||
m_LinkBodyStruct.evolve_level = m_ItemInst->GetEvolveLvl();
|
||||
m_LinkBodyStruct.ornament_icon = m_ItemInst->GetOrnamentationIcon();
|
||||
// TODO: add hash call
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (m_Proxy_unknown_1)
|
||||
m_LinkBodyStruct.unknown_1 = m_Proxy_unknown_1;
|
||||
if (m_ProxyItemID)
|
||||
m_LinkBodyStruct.item_id = m_ProxyItemID;
|
||||
if (m_ProxyAugment1ID)
|
||||
m_LinkBodyStruct.augment_1 = m_ProxyAugment1ID;
|
||||
if (m_ProxyAugment2ID)
|
||||
m_LinkBodyStruct.augment_2 = m_ProxyAugment2ID;
|
||||
if (m_ProxyAugment3ID)
|
||||
m_LinkBodyStruct.augment_3 = m_ProxyAugment3ID;
|
||||
if (m_ProxyAugment4ID)
|
||||
m_LinkBodyStruct.augment_4 = m_ProxyAugment4ID;
|
||||
if (m_ProxyAugment5ID)
|
||||
m_LinkBodyStruct.augment_5 = m_ProxyAugment5ID;
|
||||
if (m_ProxyAugment6ID)
|
||||
m_LinkBodyStruct.augment_6 = m_ProxyAugment6ID;
|
||||
if (m_ProxyIsEvolving)
|
||||
m_LinkBodyStruct.is_evolving = m_ProxyIsEvolving;
|
||||
if (m_ProxyEvolveGroup)
|
||||
m_LinkBodyStruct.evolve_group = m_ProxyEvolveGroup;
|
||||
if (m_ProxyEvolveLevel)
|
||||
m_LinkBodyStruct.evolve_level = m_ProxyEvolveLevel;
|
||||
if (m_ProxyOrnamentIcon)
|
||||
m_LinkBodyStruct.ornament_icon = m_ProxyOrnamentIcon;
|
||||
if (m_ProxyHash)
|
||||
m_LinkBodyStruct.hash = m_ProxyHash;
|
||||
|
||||
|
||||
if (m_TaskUse)
|
||||
m_LinkBodyStruct.hash = 0x14505DC2;
|
||||
|
||||
m_LinkBody = StringFormat(
|
||||
"%1X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%1X" "%04X" "%02X" "%05X" "%08X",
|
||||
(0x0F & m_LinkBodyStruct.unknown_1),
|
||||
(0x000FFFFF & m_LinkBodyStruct.item_id),
|
||||
(0x000FFFFF & m_LinkBodyStruct.augment_1),
|
||||
(0x000FFFFF & m_LinkBodyStruct.augment_2),
|
||||
(0x000FFFFF & m_LinkBodyStruct.augment_3),
|
||||
(0x000FFFFF & m_LinkBodyStruct.augment_4),
|
||||
(0x000FFFFF & m_LinkBodyStruct.augment_5),
|
||||
(0x000FFFFF & m_LinkBodyStruct.augment_6),
|
||||
(0x0F & m_LinkBodyStruct.is_evolving),
|
||||
(0x0000FFFF & m_LinkBodyStruct.evolve_group),
|
||||
(0xFF & m_LinkBodyStruct.evolve_level),
|
||||
(0x000FFFFF & m_LinkBodyStruct.ornament_icon),
|
||||
(0xFFFFFFFF & m_LinkBodyStruct.hash)
|
||||
);
|
||||
}
|
||||
|
||||
void Client::TextLink::generate_text()
|
||||
{
|
||||
if (m_ProxyText != nullptr) {
|
||||
m_LinkText = m_ProxyText;
|
||||
return;
|
||||
}
|
||||
|
||||
const Item_Struct* item_data = nullptr;
|
||||
|
||||
switch (m_LinkType) {
|
||||
case linkBlank:
|
||||
break;
|
||||
case linkItemData:
|
||||
if (m_ItemData == nullptr) { break; }
|
||||
m_LinkText = m_ItemData->Name;
|
||||
return;
|
||||
case linkLootItem:
|
||||
if (m_LootData == nullptr) { break; }
|
||||
item_data = database.GetItem(m_LootData->item_id);
|
||||
if (item_data == nullptr) { break; }
|
||||
m_LinkText = item_data->Name;
|
||||
return;
|
||||
case linkItemInst:
|
||||
if (m_ItemInst == nullptr) { break; }
|
||||
if (m_ItemInst->GetItem() == nullptr) { break; }
|
||||
m_LinkText = m_ItemInst->GetItem()->Name;
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
m_LinkText = "null";
|
||||
}
|
||||
|
||||
bool Client::TextLink::DegenerateLinkBody(TextLinkBody_Struct& textLinkBodyStruct, const std::string& textLinkBody)
|
||||
{
|
||||
memset(&textLinkBodyStruct, 0, sizeof(TextLinkBody_Struct));
|
||||
if (textLinkBody.length() != EQEmu::Constants::TEXT_LINK_BODY_LENGTH) { return false; }
|
||||
|
||||
textLinkBodyStruct.unknown_1 = (uint8)strtol(textLinkBody.substr(0, 1).c_str(), nullptr, 16);
|
||||
textLinkBodyStruct.item_id = (uint32)strtol(textLinkBody.substr(1, 5).c_str(), nullptr, 16);
|
||||
textLinkBodyStruct.augment_1 = (uint32)strtol(textLinkBody.substr(6, 5).c_str(), nullptr, 16);
|
||||
textLinkBodyStruct.augment_2 = (uint32)strtol(textLinkBody.substr(11, 5).c_str(), nullptr, 16);
|
||||
textLinkBodyStruct.augment_3 = (uint32)strtol(textLinkBody.substr(16, 5).c_str(), nullptr, 16);
|
||||
textLinkBodyStruct.augment_4 = (uint32)strtol(textLinkBody.substr(21, 5).c_str(), nullptr, 16);
|
||||
textLinkBodyStruct.augment_5 = (uint32)strtol(textLinkBody.substr(26, 5).c_str(), nullptr, 16);
|
||||
textLinkBodyStruct.augment_6 = (uint32)strtol(textLinkBody.substr(31, 5).c_str(), nullptr, 16);
|
||||
textLinkBodyStruct.is_evolving = (uint8)strtol(textLinkBody.substr(36, 1).c_str(), nullptr, 16);
|
||||
textLinkBodyStruct.evolve_group = (uint32)strtol(textLinkBody.substr(37, 4).c_str(), nullptr, 16);
|
||||
textLinkBodyStruct.evolve_level = (uint8)strtol(textLinkBody.substr(41, 2).c_str(), nullptr, 16);
|
||||
textLinkBodyStruct.ornament_icon = (uint32)strtol(textLinkBody.substr(43, 5).c_str(), nullptr, 16);
|
||||
textLinkBodyStruct.hash = (int)strtol(textLinkBody.substr(48, 8).c_str(), nullptr, 16);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Client::TextLink::GenerateLinkBody(std::string& textLinkBody, const TextLinkBody_Struct& textLinkBodyStruct)
|
||||
{
|
||||
textLinkBody = StringFormat(
|
||||
"%1X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%1X" "%04X" "%02X" "%05X" "%08X",
|
||||
(0x0F & textLinkBodyStruct.unknown_1),
|
||||
(0x000FFFFF & textLinkBodyStruct.item_id),
|
||||
(0x000FFFFF & textLinkBodyStruct.augment_1),
|
||||
(0x000FFFFF & textLinkBodyStruct.augment_2),
|
||||
(0x000FFFFF & textLinkBodyStruct.augment_3),
|
||||
(0x000FFFFF & textLinkBodyStruct.augment_4),
|
||||
(0x000FFFFF & textLinkBodyStruct.augment_5),
|
||||
(0x000FFFFF & textLinkBodyStruct.augment_6),
|
||||
(0x0F & textLinkBodyStruct.is_evolving),
|
||||
(0x0000FFFF & textLinkBodyStruct.evolve_group),
|
||||
(0xFF & textLinkBodyStruct.evolve_level),
|
||||
(0x000FFFFF & textLinkBodyStruct.ornament_icon),
|
||||
(0xFFFFFFFF & textLinkBodyStruct.hash)
|
||||
);
|
||||
|
||||
if (textLinkBody.length() != EQEmu::Constants::TEXT_LINK_BODY_LENGTH) { return false; }
|
||||
return true;
|
||||
}
|
||||
|
||||
void Client::QuestReward(Mob* target, uint32 copper, uint32 silver, uint32 gold, uint32 platinum, uint32 itemid, uint32 exp, bool faction) {
|
||||
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_Sound, sizeof(QuestReward_Struct));
|
||||
|
||||
+1
-76
@@ -736,7 +736,7 @@ public:
|
||||
#endif
|
||||
uint32 GetEquipment(uint8 material_slot) const; // returns item id
|
||||
uint32 GetEquipmentColor(uint8 material_slot) const;
|
||||
virtual void UpdateEquipmentLight() { m_Light.Type.Equipment = m_inv.FindBrightestLightType(); m_Light.Level.Equipment = m_Light.TypeToLevel(m_Light.Type.Equipment); }
|
||||
virtual void UpdateEquipmentLight() { m_Light.Type.Equipment = m_inv.FindBrightestLightType(); m_Light.Level.Equipment = EQEmu::LightSource::TypeToLevel(m_Light.Type.Equipment); }
|
||||
|
||||
inline bool AutoSplitEnabled() { return m_pp.autosplit != 0; }
|
||||
|
||||
@@ -818,81 +818,6 @@ public:
|
||||
void IncStats(uint8 type,int16 increase_val);
|
||||
void DropItem(int16 slot_id);
|
||||
|
||||
//
|
||||
// class Client::TextLink
|
||||
//
|
||||
class TextLink {
|
||||
public:
|
||||
enum LinkType { linkBlank = 0, linkItemData, linkLootItem, linkItemInst };
|
||||
|
||||
TextLink() { Reset(); }
|
||||
|
||||
void SetLinkType(LinkType linkType) { m_LinkType = linkType; }
|
||||
void SetItemData(const Item_Struct* itemData) { m_ItemData = itemData; }
|
||||
void SetLootData(const ServerLootItem_Struct* lootData) { m_LootData = lootData; }
|
||||
void SetItemInst(const ItemInst* itemInst) { m_ItemInst = itemInst; }
|
||||
|
||||
// mainly for saylinks..but, not limited to
|
||||
void SetProxyUnknown1(uint8 proxyUnknown1) { m_Proxy_unknown_1 = proxyUnknown1; }
|
||||
void SetProxyItemID(uint32 proxyItemID) { m_ProxyItemID = proxyItemID; }
|
||||
void SetProxyAugment1ID(uint32 proxyAugmentID) { m_ProxyAugment1ID = proxyAugmentID; }
|
||||
void SetProxyAugment2ID(uint32 proxyAugmentID) { m_ProxyAugment2ID = proxyAugmentID; }
|
||||
void SetProxyAugment3ID(uint32 proxyAugmentID) { m_ProxyAugment3ID = proxyAugmentID; }
|
||||
void SetProxyAugment4ID(uint32 proxyAugmentID) { m_ProxyAugment4ID = proxyAugmentID; }
|
||||
void SetProxyAugment5ID(uint32 proxyAugmentID) { m_ProxyAugment5ID = proxyAugmentID; }
|
||||
void SetProxyAugment6ID(uint32 proxyAugmentID) { m_ProxyAugment6ID = proxyAugmentID; }
|
||||
void SetProxyIsEvolving(uint8 proxyIsEvolving) { m_ProxyIsEvolving = proxyIsEvolving; }
|
||||
void SetProxyEvolveGroup(uint32 proxyEvolveGroup) { m_ProxyEvolveGroup = proxyEvolveGroup; }
|
||||
void SetProxyEvolveLevel(uint8 proxyEvolveLevel) { m_ProxyEvolveLevel = proxyEvolveLevel; }
|
||||
void SetProxyOrnamentIcon(uint32 proxyOrnamentIcon) { m_ProxyOrnamentIcon = proxyOrnamentIcon; }
|
||||
void SetProxyHash(int proxyHash) { m_ProxyHash = proxyHash; }
|
||||
|
||||
void SetProxyText(const char* proxyText) { m_ProxyText = proxyText; } // overrides standard text use
|
||||
void SetTaskUse() { m_TaskUse = true; }
|
||||
|
||||
std::string GenerateLink();
|
||||
bool LinkError() { return m_Error; }
|
||||
|
||||
std::string GetLink() { return m_Link; } // contains full string format: '/12x' '<LinkBody>' '<LinkText>' '/12x'
|
||||
std::string GetLinkBody() { return m_LinkBody; } // contains string format: '<LinkBody>'
|
||||
std::string GetLinkText() { return m_LinkText; } // contains string format: '<LinkText>'
|
||||
|
||||
void Reset();
|
||||
|
||||
static bool DegenerateLinkBody(TextLinkBody_Struct& textLinkBodyStruct, const std::string& textLinkBody);
|
||||
static bool GenerateLinkBody(std::string& textLinkBody, const TextLinkBody_Struct& textLinkBodyStruct);
|
||||
|
||||
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;
|
||||
TextLinkBody_Struct m_LinkBodyStruct;
|
||||
std::string m_Link;
|
||||
std::string m_LinkBody;
|
||||
std::string m_LinkText;
|
||||
bool m_Error;
|
||||
};
|
||||
|
||||
int GetItemLinkHash(const ItemInst* inst); // move to Item_Struct..or make use of the pre-calculated database field
|
||||
|
||||
void SendItemLink(const ItemInst* inst, bool sendtoall=false);
|
||||
|
||||
+8
-8
@@ -2545,8 +2545,8 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
const ItemInst* inst_sub = nullptr;
|
||||
const Item_Struct* item_data = nullptr;
|
||||
std::string item_link;
|
||||
Client::TextLink linker;
|
||||
linker.SetLinkType(linker.linkItemInst);
|
||||
EQEmu::SayLink::impl linker;
|
||||
linker.SetLinkType(EQEmu::SayLink::LinkItemInst);
|
||||
|
||||
c->Message(0, "Displaying inventory for %s...", targetClient->GetName());
|
||||
|
||||
@@ -4341,8 +4341,8 @@ void command_iteminfo(Client *c, const Seperator *sep)
|
||||
c->Message(13, "Error: This item has no data reference");
|
||||
}
|
||||
|
||||
Client::TextLink linker;
|
||||
linker.SetLinkType(linker.linkItemInst);
|
||||
EQEmu::SayLink::impl linker;
|
||||
linker.SetLinkType(EQEmu::SayLink::LinkItemInst);
|
||||
linker.SetItemInst(inst);
|
||||
|
||||
auto item_link = linker.GenerateLink();
|
||||
@@ -5492,8 +5492,8 @@ void command_summonitem(Client *c, const Seperator *sep)
|
||||
size_t link_open = cmd_msg.find('\x12');
|
||||
size_t link_close = cmd_msg.find_last_of('\x12');
|
||||
if (link_open != link_close && (cmd_msg.length() - link_open) > EQEmu::Constants::TEXT_LINK_BODY_LENGTH) {
|
||||
TextLinkBody_Struct link_body;
|
||||
Client::TextLink::DegenerateLinkBody(link_body, cmd_msg.substr(link_open + 1, EQEmu::Constants::TEXT_LINK_BODY_LENGTH));
|
||||
EQEmu::SayLink::SayLinkBody_Struct link_body;
|
||||
EQEmu::SayLink::DegenerateLinkBody(link_body, cmd_msg.substr(link_open + 1, EQEmu::Constants::TEXT_LINK_BODY_LENGTH));
|
||||
itemid = link_body.item_id;
|
||||
}
|
||||
else if (!sep->IsNumber(1)) {
|
||||
@@ -5603,8 +5603,8 @@ void command_itemsearch(Client *c, const Seperator *sep)
|
||||
|
||||
const Item_Struct* item = nullptr;
|
||||
std::string item_link;
|
||||
Client::TextLink linker;
|
||||
linker.SetLinkType(linker.linkItemData);
|
||||
EQEmu::SayLink::impl linker;
|
||||
linker.SetLinkType(EQEmu::SayLink::LinkItemData);
|
||||
|
||||
if (Seperator::IsNumber(search_criteria)) {
|
||||
item = database.GetItem(atoi(search_criteria));
|
||||
|
||||
+6
-6
@@ -1225,8 +1225,8 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
|
||||
}
|
||||
|
||||
/* Send message with item link to groups and such */
|
||||
Client::TextLink linker;
|
||||
linker.SetLinkType(linker.linkItemInst);
|
||||
EQEmu::SayLink::impl linker;
|
||||
linker.SetLinkType(EQEmu::SayLink::LinkItemInst);
|
||||
linker.SetItemInst(inst);
|
||||
|
||||
auto item_link = linker.GenerateLink();
|
||||
@@ -1442,7 +1442,7 @@ void Corpse::UpdateEquipmentLight()
|
||||
auto item = database.GetItem((*iter)->item_id);
|
||||
if (item == nullptr) { continue; }
|
||||
|
||||
if (m_Light.IsLevelGreater(item->Light, m_Light.Type.Equipment))
|
||||
if (EQEmu::LightSource::IsLevelGreater(item->Light, m_Light.Type.Equipment))
|
||||
m_Light.Type.Equipment = item->Light;
|
||||
}
|
||||
|
||||
@@ -1456,14 +1456,14 @@ void Corpse::UpdateEquipmentLight()
|
||||
if (item->ItemClass != ItemClassCommon) { continue; }
|
||||
if (item->Light < 9 || item->Light > 13) { continue; }
|
||||
|
||||
if (m_Light.TypeToLevel(item->Light))
|
||||
if (EQEmu::LightSource::TypeToLevel(item->Light))
|
||||
general_light_type = item->Light;
|
||||
}
|
||||
|
||||
if (m_Light.IsLevelGreater(general_light_type, m_Light.Type.Equipment))
|
||||
if (EQEmu::LightSource::IsLevelGreater(general_light_type, m_Light.Type.Equipment))
|
||||
m_Light.Type.Equipment = general_light_type;
|
||||
|
||||
m_Light.Level.Equipment = m_Light.TypeToLevel(m_Light.Type.Equipment);
|
||||
m_Light.Level.Equipment = EQEmu::LightSource::TypeToLevel(m_Light.Type.Equipment);
|
||||
}
|
||||
|
||||
void Corpse::AddLooter(Mob* who) {
|
||||
|
||||
@@ -1799,8 +1799,8 @@ luabind::scope lua_register_slot() {
|
||||
luabind::value("PersonalEnd", static_cast<int>(EQEmu::Constants::GENERAL_END)), // deprecated
|
||||
luabind::value("GeneralEnd", static_cast<int>(EQEmu::Constants::GENERAL_END)),
|
||||
luabind::value("CursorEnd", 0xFFFE), // deprecated
|
||||
luabind::value("Tradeskill", static_cast<int>(legacy::SLOT_TRADESKILL)), // deprecated
|
||||
luabind::value("Augment", static_cast<int>(legacy::SLOT_AUGMENT)), // deprecated
|
||||
luabind::value("Tradeskill", static_cast<int>(EQEmu::Legacy::SLOT_TRADESKILL)), // deprecated
|
||||
luabind::value("Augment", static_cast<int>(EQEmu::Legacy::SLOT_AUGMENT)), // deprecated
|
||||
luabind::value("Invalid", INVALID_INDEX)
|
||||
];
|
||||
}
|
||||
|
||||
+5
-5
@@ -5050,9 +5050,9 @@ void Merc::UpdateEquipmentLight()
|
||||
auto item = database.GetItem(equipment[index]);
|
||||
if (item == nullptr) { continue; }
|
||||
|
||||
if (m_Light.IsLevelGreater(item->Light, m_Light.Type.Equipment)) {
|
||||
if (EQEmu::LightSource::IsLevelGreater(item->Light, m_Light.Type.Equipment)) {
|
||||
m_Light.Type.Equipment = item->Light;
|
||||
m_Light.Level.Equipment = m_Light.TypeToLevel(m_Light.Type.Equipment);
|
||||
m_Light.Level.Equipment = EQEmu::LightSource::TypeToLevel(m_Light.Type.Equipment);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5064,14 +5064,14 @@ void Merc::UpdateEquipmentLight()
|
||||
if (item->ItemClass != ItemClassCommon) { continue; }
|
||||
if (item->Light < 9 || item->Light > 13) { continue; }
|
||||
|
||||
if (m_Light.TypeToLevel(item->Light))
|
||||
if (EQEmu::LightSource::TypeToLevel(item->Light))
|
||||
general_light_type = item->Light;
|
||||
}
|
||||
|
||||
if (m_Light.IsLevelGreater(general_light_type, m_Light.Type.Equipment))
|
||||
if (EQEmu::LightSource::IsLevelGreater(general_light_type, m_Light.Type.Equipment))
|
||||
m_Light.Type.Equipment = general_light_type;
|
||||
|
||||
m_Light.Level.Equipment = m_Light.TypeToLevel(m_Light.Type.Equipment);
|
||||
m_Light.Level.Equipment = EQEmu::LightSource::TypeToLevel(m_Light.Type.Equipment);
|
||||
}
|
||||
|
||||
void Merc::AddItem(uint8 slot, uint32 item_id) {
|
||||
|
||||
+3
-3
@@ -179,7 +179,7 @@ Mob::Mob(const char* in_name,
|
||||
runspeed = 1.25f;
|
||||
|
||||
m_Light.Type.Innate = in_light;
|
||||
m_Light.Level.Innate = m_Light.TypeToLevel(m_Light.Type.Innate);
|
||||
m_Light.Level.Innate = EQEmu::LightSource::TypeToLevel(m_Light.Type.Innate);
|
||||
m_Light.Level.Equipment = m_Light.Type.Equipment = 0;
|
||||
m_Light.Level.Spell = m_Light.Type.Spell = 0;
|
||||
m_Light.Type.Active = m_Light.Type.Innate;
|
||||
@@ -2232,11 +2232,11 @@ bool Mob::UpdateActiveLight()
|
||||
m_Light.Type.Active = 0;
|
||||
m_Light.Level.Active = 0;
|
||||
|
||||
if (m_Light.IsLevelGreater((m_Light.Type.Innate & 0x0F), m_Light.Type.Active)) { m_Light.Type.Active = m_Light.Type.Innate; }
|
||||
if (EQEmu::LightSource::IsLevelGreater((m_Light.Type.Innate & 0x0F), m_Light.Type.Active)) { m_Light.Type.Active = m_Light.Type.Innate; }
|
||||
if (m_Light.Level.Equipment > m_Light.Level.Active) { m_Light.Type.Active = m_Light.Type.Equipment; } // limiter in property handler
|
||||
if (m_Light.Level.Spell > m_Light.Level.Active) { m_Light.Type.Active = m_Light.Type.Spell; } // limiter in property handler
|
||||
|
||||
m_Light.Level.Active = m_Light.TypeToLevel(m_Light.Type.Active);
|
||||
m_Light.Level.Active = EQEmu::LightSource::TypeToLevel(m_Light.Type.Active);
|
||||
|
||||
return (m_Light.Level.Active != old_light_level);
|
||||
}
|
||||
|
||||
+4
-3
@@ -364,6 +364,7 @@ public:
|
||||
virtual inline uint16 GetBaseRace() const { return base_race; }
|
||||
virtual inline uint8 GetBaseGender() const { return base_gender; }
|
||||
virtual inline uint16 GetDeity() const { return deity; }
|
||||
virtual inline EQEmu::Deity::TypeBits GetDeityBit() { return EQEmu::Deity::ConvertDeityToDeityBit((EQEmu::Deity::Types)deity); }
|
||||
inline uint16 GetRace() const { return race; }
|
||||
inline uint8 GetGender() const { return gender; }
|
||||
inline uint8 GetTexture() const { return texture; }
|
||||
@@ -707,12 +708,12 @@ public:
|
||||
inline uint8 GetSpellLightType() { return m_Light.Type.Spell; }
|
||||
|
||||
virtual void UpdateEquipmentLight() { m_Light.Type.Equipment = 0; m_Light.Level.Equipment = 0; }
|
||||
inline void SetSpellLightType(uint8 lightType) { m_Light.Type.Spell = (lightType & 0x0F); m_Light.Level.Spell = m_Light.TypeToLevel(m_Light.Type.Spell); }
|
||||
inline void SetSpellLightType(uint8 light_type) { m_Light.Type.Spell = (light_type & 0x0F); m_Light.Level.Spell = EQEmu::LightSource::TypeToLevel(m_Light.Type.Spell); }
|
||||
|
||||
inline uint8 GetActiveLightType() { return m_Light.Type.Active; }
|
||||
bool UpdateActiveLight(); // returns true if change, false if no change
|
||||
|
||||
LightProfile_Struct* GetLightProfile() { return &m_Light; }
|
||||
EQEmu::LightSource::impl* GetLightProfile() { return &m_Light; }
|
||||
|
||||
Mob* GetPet();
|
||||
void SetPet(Mob* newpet);
|
||||
@@ -1184,7 +1185,7 @@ protected:
|
||||
|
||||
glm::vec4 m_Delta;
|
||||
|
||||
LightProfile_Struct m_Light;
|
||||
EQEmu::LightSource::impl m_Light;
|
||||
|
||||
float fixedZ;
|
||||
EmuAppearance _appearance;
|
||||
|
||||
+7
-7
@@ -529,8 +529,8 @@ void NPC::QueryLoot(Client* to)
|
||||
continue;
|
||||
}
|
||||
|
||||
Client::TextLink linker;
|
||||
linker.SetLinkType(linker.linkItemData);
|
||||
EQEmu::SayLink::impl linker;
|
||||
linker.SetLinkType(EQEmu::SayLink::LinkItemData);
|
||||
linker.SetItemData(item);
|
||||
|
||||
auto item_link = linker.GenerateLink();
|
||||
@@ -754,9 +754,9 @@ void NPC::UpdateEquipmentLight()
|
||||
auto item = database.GetItem(equipment[index]);
|
||||
if (item == nullptr) { continue; }
|
||||
|
||||
if (m_Light.IsLevelGreater(item->Light, m_Light.Type.Equipment)) {
|
||||
if (EQEmu::LightSource::IsLevelGreater(item->Light, m_Light.Type.Equipment)) {
|
||||
m_Light.Type.Equipment = item->Light;
|
||||
m_Light.Level.Equipment = m_Light.TypeToLevel(m_Light.Type.Equipment);
|
||||
m_Light.Level.Equipment = EQEmu::LightSource::TypeToLevel(m_Light.Type.Equipment);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -768,14 +768,14 @@ void NPC::UpdateEquipmentLight()
|
||||
if (item->ItemClass != ItemClassCommon) { continue; }
|
||||
if (item->Light < 9 || item->Light > 13) { continue; }
|
||||
|
||||
if (m_Light.TypeToLevel(item->Light))
|
||||
if (EQEmu::LightSource::TypeToLevel(item->Light))
|
||||
general_light_type = item->Light;
|
||||
}
|
||||
|
||||
if (m_Light.IsLevelGreater(general_light_type, m_Light.Type.Equipment))
|
||||
if (EQEmu::LightSource::IsLevelGreater(general_light_type, m_Light.Type.Equipment))
|
||||
m_Light.Type.Equipment = general_light_type;
|
||||
|
||||
m_Light.Level.Equipment = m_Light.TypeToLevel(m_Light.Type.Equipment);
|
||||
m_Light.Level.Equipment = EQEmu::LightSource::TypeToLevel(m_Light.Type.Equipment);
|
||||
}
|
||||
|
||||
void NPC::Depop(bool StartSpawnTimer) {
|
||||
|
||||
+5
-5
@@ -1307,8 +1307,8 @@ void QuestManager::itemlink(int item_id) {
|
||||
if (item == nullptr)
|
||||
return;
|
||||
|
||||
Client::TextLink linker;
|
||||
linker.SetLinkType(linker.linkItemData);
|
||||
EQEmu::SayLink::impl linker;
|
||||
linker.SetLinkType(EQEmu::SayLink::LinkItemData);
|
||||
linker.SetItemData(item);
|
||||
|
||||
auto item_link = linker.GenerateLink();
|
||||
@@ -2535,8 +2535,8 @@ const char* QuestManager::varlink(char* perltext, int item_id) {
|
||||
if (!item)
|
||||
return "INVALID ITEM ID IN VARLINK";
|
||||
|
||||
Client::TextLink linker;
|
||||
linker.SetLinkType(linker.linkItemData);
|
||||
EQEmu::SayLink::impl linker;
|
||||
linker.SetLinkType(EQEmu::SayLink::LinkItemData);
|
||||
linker.SetItemData(item);
|
||||
|
||||
auto item_link = linker.GenerateLink();
|
||||
@@ -2761,7 +2761,7 @@ const char* QuestManager::saylink(char* Phrase, bool silent, const char* LinkNam
|
||||
safe_delete_array(escaped_string);
|
||||
|
||||
//Create the say link as an item link hash
|
||||
Client::TextLink linker;
|
||||
EQEmu::SayLink::impl linker;
|
||||
linker.SetProxyItemID(SAYLINK_ITEM_ID);
|
||||
if (silent)
|
||||
linker.SetProxyAugment2ID(sayid);
|
||||
|
||||
+2
-2
@@ -2779,8 +2779,8 @@ void TaskManager::SendActiveTaskDescription(Client *c, int TaskID, int SequenceN
|
||||
if(ItemID) {
|
||||
const Item_Struct* reward_item = database.GetItem(ItemID);
|
||||
|
||||
Client::TextLink linker;
|
||||
linker.SetLinkType(linker.linkItemData);
|
||||
EQEmu::SayLink::impl linker;
|
||||
linker.SetLinkType(EQEmu::SayLink::LinkItemData);
|
||||
linker.SetItemData(reward_item);
|
||||
linker.SetTaskUse();
|
||||
if (strlen(Tasks[TaskID]->Reward) != 0)
|
||||
|
||||
@@ -264,7 +264,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
|
||||
uint32 some_id = 0;
|
||||
bool worldcontainer=false;
|
||||
|
||||
if (in_combine->container_slot == legacy::SLOT_TRADESKILL) {
|
||||
if (in_combine->container_slot == EQEmu::Legacy::SLOT_TRADESKILL) {
|
||||
if(!worldo) {
|
||||
user->Message(13, "Error: Server is not aware of the tradeskill container you are attempting to use");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user