mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-04 18:46:37 +00:00
Implemented mob equipment light sources
This commit is contained in:
@@ -300,7 +300,7 @@ struct Spawn_Struct {
|
||||
/*0036*/ uint8 afk; // 0=no, 1=afk
|
||||
/*0238*/ uint32 guildID; // Current guild
|
||||
/*0242*/ char title[32]; // Title
|
||||
/*0274*/ uint8 unknown0274;
|
||||
/*0274*/ uint8 unknown0274; // non-zero prefixes name with '!'
|
||||
/*0275*/ uint8 set_to_0xFF[8]; // ***Placeholder (all ff)
|
||||
/*0283*/ uint8 helm; // Helm texture
|
||||
/*0284*/ uint32 race; // Spawn race
|
||||
|
||||
@@ -990,6 +990,35 @@ int Inventory::GetSlotByItemInst(ItemInst *inst) {
|
||||
return INVALID_INDEX;
|
||||
}
|
||||
|
||||
uint8 Inventory::FindHighestLightValue()
|
||||
{
|
||||
uint8 light_value = NOT_USED;
|
||||
|
||||
// NOTE: The client does not recognize augment light sources, applied or otherwise, and should not be parsed
|
||||
for (auto iter = m_worn.begin(); iter != m_worn.end(); ++iter) {
|
||||
if ((iter->first < EmuConstants::EQUIPMENT_BEGIN || iter->first > EmuConstants::EQUIPMENT_END) && iter->first != MainPowerSource) { continue; }
|
||||
auto inst = iter->second;
|
||||
if (inst == nullptr) { continue; }
|
||||
auto item = inst->GetItem();
|
||||
if (item == nullptr) { continue; }
|
||||
if (item->Light & 0xF0) { continue; }
|
||||
if (item->Light > light_value) { light_value = item->Light; }
|
||||
}
|
||||
|
||||
for (auto iter = m_inv.begin(); iter != m_inv.end(); ++iter) {
|
||||
if (iter->first < EmuConstants::GENERAL_BEGIN || iter->first > EmuConstants::GENERAL_END) { continue; }
|
||||
auto inst = iter->second;
|
||||
if (inst == nullptr) { continue; }
|
||||
auto item = inst->GetItem();
|
||||
if (item == nullptr) { continue; }
|
||||
if (item->ItemType != ItemTypeMisc && item->ItemType != ItemTypeLight) { continue; }
|
||||
if (item->Light & 0xF0) { continue; }
|
||||
if (item->Light > light_value) { light_value = item->Light; }
|
||||
}
|
||||
|
||||
return light_value;
|
||||
}
|
||||
|
||||
void Inventory::dumpEntireInventory() {
|
||||
|
||||
dumpWornItems();
|
||||
|
||||
@@ -207,6 +207,8 @@ public:
|
||||
|
||||
int GetSlotByItemInst(ItemInst *inst);
|
||||
|
||||
uint8 FindHighestLightValue();
|
||||
|
||||
void dumpEntireInventory();
|
||||
void dumpWornItems();
|
||||
void dumpInventory();
|
||||
|
||||
Reference in New Issue
Block a user