Implemented mob equipment light sources

This commit is contained in:
Uleat
2015-01-24 22:00:06 -05:00
parent 7e980e1e7c
commit cc1d7d54c2
23 changed files with 286 additions and 35 deletions
+1 -1
View File
@@ -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
+29
View File
@@ -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();
+2
View File
@@ -207,6 +207,8 @@ public:
int GetSlotByItemInst(ItemInst *inst);
uint8 FindHighestLightValue();
void dumpEntireInventory();
void dumpWornItems();
void dumpInventory();