mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
LightSourceProfile relocation and some more formatting changes
This commit is contained in:
parent
04f47f1e32
commit
ebe6f95e6e
@ -1,4 +1,4 @@
|
|||||||
/* EQEMu: Everquest Server Emulator
|
/* EQEMu: Everquest Server Emulator
|
||||||
|
|
||||||
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
/* EQEMu: Everquest Server Emulator
|
/* EQEMu: Everquest Server Emulator
|
||||||
|
|
||||||
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||||
|
|
||||||
@ -70,7 +70,9 @@ namespace EQEmu
|
|||||||
extern uint32 ConvertClientVersionToClientVersionBit(ClientVersion client_version);
|
extern uint32 ConvertClientVersionToClientVersionBit(ClientVersion client_version);
|
||||||
extern ClientVersion ConvertClientVersionBitToClientVersion(uint32 client_version_bit);
|
extern ClientVersion ConvertClientVersionBitToClientVersion(uint32 client_version_bit);
|
||||||
extern uint32 ConvertClientVersionToExpansion(ClientVersion client_version);
|
extern uint32 ConvertClientVersionToExpansion(ClientVersion client_version);
|
||||||
}
|
|
||||||
}
|
} /*versions*/
|
||||||
|
|
||||||
#endif /* COMMON_CLIENT_VERSION_H */
|
} /*EQEmu*/
|
||||||
|
|
||||||
|
#endif /*COMMON_CLIENT_VERSION_H*/
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
/* EQEMu: Everquest Server Emulator
|
/* EQEMu: Everquest Server Emulator
|
||||||
|
|
||||||
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
/* EQEMu: Everquest Server Emulator
|
/* EQEMu: Everquest Server Emulator
|
||||||
|
|
||||||
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||||
|
|
||||||
@ -55,7 +55,9 @@ namespace EQEmu
|
|||||||
extern const char* InventoryVersionName(InventoryVersion inventory_version);
|
extern const char* InventoryVersionName(InventoryVersion inventory_version);
|
||||||
extern ClientVersion ConvertInventoryVersionToClientVersion(InventoryVersion inventory_version);
|
extern ClientVersion ConvertInventoryVersionToClientVersion(InventoryVersion inventory_version);
|
||||||
extern InventoryVersion ConvertClientVersionToInventoryVersion(ClientVersion client_version);
|
extern InventoryVersion ConvertClientVersionToInventoryVersion(ClientVersion client_version);
|
||||||
}
|
|
||||||
}
|
} /*versions*/
|
||||||
|
|
||||||
#endif /* COMMON_INVENTORY_VERSION_H */
|
} /*EQEmu*/
|
||||||
|
|
||||||
|
#endif /*COMMON_INVENTORY_VERSION_H*/
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
/* EQEMu: Everquest Server Emulator
|
/* EQEMu: Everquest Server Emulator
|
||||||
|
|
||||||
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||||
|
|
||||||
@ -19,24 +19,8 @@
|
|||||||
|
|
||||||
#include "light_source.h"
|
#include "light_source.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
EQEmu::lightsource::LightSourceProfile::LightSourceProfile()
|
|
||||||
{
|
|
||||||
Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
void EQEmu::lightsource::LightSourceProfile::Clear()
|
|
||||||
{
|
|
||||||
Type.Innate = 0;
|
|
||||||
Type.Equipment = 0;
|
|
||||||
Type.Spell = 0;
|
|
||||||
Type.Active = 0;
|
|
||||||
|
|
||||||
Level.Innate = 0;
|
|
||||||
Level.Equipment = 0;
|
|
||||||
Level.Spell = 0;
|
|
||||||
Level.Active = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8 EQEmu::lightsource::TypeToLevel(uint8 light_type)
|
uint8 EQEmu::lightsource::TypeToLevel(uint8 light_type)
|
||||||
{
|
{
|
||||||
@ -97,3 +81,19 @@ bool EQEmu::lightsource::IsLevelGreater(uint8 left_type, uint8 right_type)
|
|||||||
|
|
||||||
return (light_levels[left_type] > light_levels[right_type]);
|
return (light_levels[left_type] > light_levels[right_type]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EQEmu::lightsource::Light_Struct::Light_Struct()
|
||||||
|
{
|
||||||
|
Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void EQEmu::lightsource::Light_Struct::Clear()
|
||||||
|
{
|
||||||
|
memset(&Slot, 0, (sizeof(uint8) * sizeof(Slot)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void EQEmu::LightSourceProfile::Clear()
|
||||||
|
{
|
||||||
|
Type.Clear();
|
||||||
|
Level.Clear();
|
||||||
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
/* EQEMu: Everquest Server Emulator
|
/* EQEMu: Everquest Server Emulator
|
||||||
|
|
||||||
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||||
|
|
||||||
@ -26,6 +26,15 @@
|
|||||||
namespace EQEmu
|
namespace EQEmu
|
||||||
{
|
{
|
||||||
namespace lightsource {
|
namespace lightsource {
|
||||||
|
enum LightSlot {
|
||||||
|
LightInnate = 0, // Defined by db field `npc_types`.`light` - where appropriate
|
||||||
|
LightEquipment, // Item_Struct::light value of worn/carried equipment
|
||||||
|
LightSpell, // Set value of any light-producing spell (can be modded to mimic equip_light behavior)
|
||||||
|
LightActive, // Highest value of all light sources
|
||||||
|
LightCount
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
enum LightType {
|
enum LightType {
|
||||||
LightTypeNone = 0,
|
LightTypeNone = 0,
|
||||||
LightTypeCandle,
|
LightTypeCandle,
|
||||||
@ -61,47 +70,47 @@ namespace EQEmu
|
|||||||
LightLevelCount
|
LightLevelCount
|
||||||
};
|
};
|
||||||
|
|
||||||
struct LightSourceProfile {
|
struct Light_Struct {
|
||||||
/*
|
uint8 Slot[LightCount];
|
||||||
Current criteria (light types):
|
|
||||||
Equipment: { 0 .. 15 }
|
|
||||||
General: { 9 .. 13 }
|
|
||||||
|
|
||||||
Notes:
|
Light_Struct();
|
||||||
- Initial character load and item movement updates use different light source update behaviors
|
|
||||||
-- Server procedure matches the item movement behavior since most updates occur post-character load
|
|
||||||
- MainAmmo is not considered when determining light sources
|
|
||||||
- No 'Sub' or 'Aug' items are recognized as light sources
|
|
||||||
- Light types '< 9' and '> 13' are not considered for general (carried) light sources
|
|
||||||
- If values > 0x0F are valid, then assignment limiters will need to be removed
|
|
||||||
- MainCursor 'appears' to be a valid light source update slot..but, have not experienced updates during debug sessions
|
|
||||||
- All clients have a bug regarding stackable items (light and sound updates are not processed when picking up an item)
|
|
||||||
-- The timer-based update cancels out the invalid light source
|
|
||||||
*/
|
|
||||||
LightSourceProfile();
|
|
||||||
|
|
||||||
void Clear();
|
void Clear();
|
||||||
|
|
||||||
// Light types (classifications)
|
inline uint8& operator[](LightSlot index) { return Slot[index]; }
|
||||||
struct {
|
|
||||||
uint8 Innate; // Defined by db field `npc_types`.`light` - where appropriate
|
|
||||||
uint8 Equipment; // Item_Struct::light value of worn/carried equipment
|
|
||||||
uint8 Spell; // Set value of any light-producing spell (can be modded to mimic equip_light behavior)
|
|
||||||
uint8 Active; // Highest value of all light sources
|
|
||||||
} Type;
|
|
||||||
|
|
||||||
// Light levels (intensities) - used to determine which light source should be active
|
|
||||||
struct {
|
|
||||||
uint8 Innate;
|
|
||||||
uint8 Equipment;
|
|
||||||
uint8 Spell;
|
|
||||||
uint8 Active;
|
|
||||||
} Level;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern uint8 TypeToLevel(uint8 light_type);
|
extern uint8 TypeToLevel(uint8 light_type);
|
||||||
extern bool IsLevelGreater(uint8 left_type, uint8 right_type);
|
extern bool IsLevelGreater(uint8 left_type, uint8 right_type);
|
||||||
};
|
|
||||||
}
|
}; /*lightsource*/
|
||||||
|
|
||||||
#endif /* COMMON_LIGHT_SOURCE_H */
|
struct LightSourceProfile {
|
||||||
|
/*
|
||||||
|
Current criteria (light types):
|
||||||
|
Equipment: { 0 .. 15 }
|
||||||
|
General: { 9 .. 13 }
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
- Initial character load and item movement updates use different light source update behaviors
|
||||||
|
-- Server procedure matches the item movement behavior since most updates occur post-character load
|
||||||
|
- MainAmmo is not considered when determining light sources
|
||||||
|
- No 'Sub' or 'Aug' items are recognized as light sources
|
||||||
|
- Light types '< 9' and '> 13' are not considered for general (carried) light sources
|
||||||
|
- If values > 0x0F are valid, then assignment limiters will need to be removed
|
||||||
|
- MainCursor 'appears' to be a valid light source update slot..but, have not experienced updates during debug sessions
|
||||||
|
- All clients have a bug regarding stackable items (light and sound updates are not processed when picking up an item)
|
||||||
|
-- The timer-based update cancels out the invalid light source
|
||||||
|
*/
|
||||||
|
|
||||||
|
lightsource::Light_Struct Type; // Light types (classifications)
|
||||||
|
lightsource::Light_Struct Level; // Light levels (intensities) - used to determine which light source should be active
|
||||||
|
|
||||||
|
LightSourceProfile() { }
|
||||||
|
|
||||||
|
void Clear();
|
||||||
|
};
|
||||||
|
|
||||||
|
} /*EQEmu*/
|
||||||
|
|
||||||
|
#endif /*COMMON_LIGHT_SOURCE_H*/
|
||||||
|
|||||||
@ -93,7 +93,6 @@ Bot::Bot(NPCType npcTypeData, Client* botOwner) : NPC(&npcTypeData, nullptr, glm
|
|||||||
timers[i] = 0;
|
timers[i] = 0;
|
||||||
|
|
||||||
strcpy(this->name, this->GetCleanName());
|
strcpy(this->name, this->GetCleanName());
|
||||||
memset(&m_Light, 0, sizeof(EQEmu::lightsource::LightSourceProfile));
|
|
||||||
memset(&_botInspectMessage, 0, sizeof(InspectMessage_Struct));
|
memset(&_botInspectMessage, 0, sizeof(InspectMessage_Struct));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2955,7 +2954,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
|||||||
ns->spawn.size = 0;
|
ns->spawn.size = 0;
|
||||||
ns->spawn.NPC = 0; // 0=player,1=npc,2=pc corpse,3=npc corpse
|
ns->spawn.NPC = 0; // 0=player,1=npc,2=pc corpse,3=npc corpse
|
||||||
UpdateActiveLight();
|
UpdateActiveLight();
|
||||||
ns->spawn.light = m_Light.Type.Active;
|
ns->spawn.light = m_Light.Type[EQEmu::lightsource::LightActive];
|
||||||
ns->spawn.helm = helmtexture; //(GetShowHelm() ? helmtexture : 0); //0xFF;
|
ns->spawn.helm = helmtexture; //(GetShowHelm() ? helmtexture : 0); //0xFF;
|
||||||
ns->spawn.equip_chest2 = texture; //0xFF;
|
ns->spawn.equip_chest2 = texture; //0xFF;
|
||||||
const Item_Struct* item = 0;
|
const Item_Struct* item = 0;
|
||||||
|
|||||||
@ -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 BotTradeAddItem(uint32 id, const ItemInst* inst, int16 charges, uint32 equipableSlots, uint16 lootSlot, std::string* errorMessage, bool addToDb = true);
|
||||||
void EquipBot(std::string* errorMessage);
|
void EquipBot(std::string* errorMessage);
|
||||||
bool CheckLoreConflict(const Item_Struct* item);
|
bool CheckLoreConflict(const Item_Struct* item);
|
||||||
virtual void UpdateEquipmentLight() { m_Light.Type.Equipment = m_inv.FindBrightestLightType(); m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment); }
|
virtual void UpdateEquipmentLight() { m_Light.Type[EQEmu::lightsource::LightEquipment] = m_inv.FindBrightestLightType(); m_Light.Level[EQEmu::lightsource::LightEquipment] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightEquipment]); }
|
||||||
|
|
||||||
// Static Class Methods
|
// Static Class Methods
|
||||||
//static void DestroyBotRaidObjects(Client* client); // Can be removed after bot raids are dumped
|
//static void DestroyBotRaidObjects(Client* client); // Can be removed after bot raids are dumped
|
||||||
|
|||||||
@ -1902,7 +1902,7 @@ void Client::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
|
|||||||
|
|
||||||
UpdateEquipmentLight();
|
UpdateEquipmentLight();
|
||||||
UpdateActiveLight();
|
UpdateActiveLight();
|
||||||
ns->spawn.light = m_Light.Type.Active;
|
ns->spawn.light = m_Light.Type[EQEmu::lightsource::LightActive];
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Client::GMHideMe(Client* client) {
|
bool Client::GMHideMe(Client* client) {
|
||||||
|
|||||||
@ -737,7 +737,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
uint32 GetEquipment(uint8 material_slot) const; // returns item id
|
uint32 GetEquipment(uint8 material_slot) const; // returns item id
|
||||||
uint32 GetEquipmentColor(uint8 material_slot) const;
|
uint32 GetEquipmentColor(uint8 material_slot) const;
|
||||||
virtual void UpdateEquipmentLight() { m_Light.Type.Equipment = m_inv.FindBrightestLightType(); m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment); }
|
virtual void UpdateEquipmentLight() { m_Light.Type[EQEmu::lightsource::LightEquipment] = m_inv.FindBrightestLightType(); m_Light.Level[EQEmu::lightsource::LightEquipment] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightEquipment]); }
|
||||||
|
|
||||||
inline bool AutoSplitEnabled() { return m_pp.autosplit != 0; }
|
inline bool AutoSplitEnabled() { return m_pp.autosplit != 0; }
|
||||||
|
|
||||||
|
|||||||
@ -139,10 +139,8 @@ Corpse* Corpse::LoadCharacterCorpseEntity(uint32 in_dbid, uint32 in_charid, std:
|
|||||||
pc->IsRezzed(rezzed);
|
pc->IsRezzed(rezzed);
|
||||||
pc->become_npc = false;
|
pc->become_npc = false;
|
||||||
|
|
||||||
pc->m_Light.Level.Innate = pc->m_Light.Type.Innate = 0;
|
|
||||||
pc->UpdateEquipmentLight(); // itemlist populated above..need to determine actual values
|
pc->UpdateEquipmentLight(); // itemlist populated above..need to determine actual values
|
||||||
pc->m_Light.Level.Spell = pc->m_Light.Type.Spell = 0;
|
|
||||||
|
|
||||||
safe_delete_array(pcs);
|
safe_delete_array(pcs);
|
||||||
|
|
||||||
return pc;
|
return pc;
|
||||||
@ -531,7 +529,6 @@ in_helmtexture,
|
|||||||
SetPlayerKillItemID(0);
|
SetPlayerKillItemID(0);
|
||||||
|
|
||||||
UpdateEquipmentLight();
|
UpdateEquipmentLight();
|
||||||
m_Light.Level.Spell = m_Light.Type.Spell = 0;
|
|
||||||
UpdateActiveLight();
|
UpdateActiveLight();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1283,7 +1280,7 @@ void Corpse::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
|||||||
ns->spawn.NPC = 2;
|
ns->spawn.NPC = 2;
|
||||||
|
|
||||||
UpdateActiveLight();
|
UpdateActiveLight();
|
||||||
ns->spawn.light = m_Light.Type.Active;
|
ns->spawn.light = m_Light.Type[EQEmu::lightsource::LightActive];
|
||||||
}
|
}
|
||||||
|
|
||||||
void Corpse::QueryLoot(Client* to) {
|
void Corpse::QueryLoot(Client* to) {
|
||||||
@ -1432,8 +1429,8 @@ uint32 Corpse::GetEquipmentColor(uint8 material_slot) const {
|
|||||||
|
|
||||||
void Corpse::UpdateEquipmentLight()
|
void Corpse::UpdateEquipmentLight()
|
||||||
{
|
{
|
||||||
m_Light.Type.Equipment = 0;
|
m_Light.Type[EQEmu::lightsource::LightEquipment] = 0;
|
||||||
m_Light.Level.Equipment = 0;
|
m_Light.Level[EQEmu::lightsource::LightEquipment] = 0;
|
||||||
|
|
||||||
for (auto iter = itemlist.begin(); iter != itemlist.end(); ++iter) {
|
for (auto iter = itemlist.begin(); iter != itemlist.end(); ++iter) {
|
||||||
if (((*iter)->equip_slot < EQEmu::legacy::EQUIPMENT_BEGIN || (*iter)->equip_slot > EQEmu::legacy::EQUIPMENT_END) && (*iter)->equip_slot != EQEmu::legacy::SlotPowerSource) { continue; }
|
if (((*iter)->equip_slot < EQEmu::legacy::EQUIPMENT_BEGIN || (*iter)->equip_slot > EQEmu::legacy::EQUIPMENT_END) && (*iter)->equip_slot != EQEmu::legacy::SlotPowerSource) { continue; }
|
||||||
@ -1442,8 +1439,8 @@ void Corpse::UpdateEquipmentLight()
|
|||||||
auto item = database.GetItem((*iter)->item_id);
|
auto item = database.GetItem((*iter)->item_id);
|
||||||
if (item == nullptr) { continue; }
|
if (item == nullptr) { continue; }
|
||||||
|
|
||||||
if (EQEmu::lightsource::IsLevelGreater(item->Light, m_Light.Type.Equipment))
|
if (EQEmu::lightsource::IsLevelGreater(item->Light, m_Light.Type[EQEmu::lightsource::LightEquipment]))
|
||||||
m_Light.Type.Equipment = item->Light;
|
m_Light.Type[EQEmu::lightsource::LightEquipment] = item->Light;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 general_light_type = 0;
|
uint8 general_light_type = 0;
|
||||||
@ -1460,10 +1457,10 @@ void Corpse::UpdateEquipmentLight()
|
|||||||
general_light_type = item->Light;
|
general_light_type = item->Light;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EQEmu::lightsource::IsLevelGreater(general_light_type, m_Light.Type.Equipment))
|
if (EQEmu::lightsource::IsLevelGreater(general_light_type, m_Light.Type[EQEmu::lightsource::LightEquipment]))
|
||||||
m_Light.Type.Equipment = general_light_type;
|
m_Light.Type[EQEmu::lightsource::LightEquipment] = general_light_type;
|
||||||
|
|
||||||
m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment);
|
m_Light.Level[EQEmu::lightsource::LightEquipment] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightEquipment]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Corpse::AddLooter(Mob* who) {
|
void Corpse::AddLooter(Mob* who) {
|
||||||
|
|||||||
@ -1210,7 +1210,7 @@ void Merc::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
|||||||
ns->spawn.IsMercenary = 1;
|
ns->spawn.IsMercenary = 1;
|
||||||
|
|
||||||
UpdateActiveLight();
|
UpdateActiveLight();
|
||||||
ns->spawn.light = m_Light.Type.Active;
|
ns->spawn.light = m_Light.Type[EQEmu::lightsource::LightActive];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Wear Slots are not setup for Mercs yet
|
// Wear Slots are not setup for Mercs yet
|
||||||
@ -5041,8 +5041,8 @@ void Merc::UpdateMercAppearance() {
|
|||||||
|
|
||||||
void Merc::UpdateEquipmentLight()
|
void Merc::UpdateEquipmentLight()
|
||||||
{
|
{
|
||||||
m_Light.Type.Equipment = 0;
|
m_Light.Type[EQEmu::lightsource::LightEquipment] = 0;
|
||||||
m_Light.Level.Equipment = 0;
|
m_Light.Level[EQEmu::lightsource::LightEquipment] = 0;
|
||||||
|
|
||||||
for (int index = SLOT_BEGIN; index < EQEmu::legacy::EQUIPMENT_SIZE; ++index) {
|
for (int index = SLOT_BEGIN; index < EQEmu::legacy::EQUIPMENT_SIZE; ++index) {
|
||||||
if (index == EQEmu::legacy::SlotAmmo) { continue; }
|
if (index == EQEmu::legacy::SlotAmmo) { continue; }
|
||||||
@ -5050,9 +5050,9 @@ void Merc::UpdateEquipmentLight()
|
|||||||
auto item = database.GetItem(equipment[index]);
|
auto item = database.GetItem(equipment[index]);
|
||||||
if (item == nullptr) { continue; }
|
if (item == nullptr) { continue; }
|
||||||
|
|
||||||
if (EQEmu::lightsource::IsLevelGreater(item->Light, m_Light.Type.Equipment)) {
|
if (EQEmu::lightsource::IsLevelGreater(item->Light, m_Light.Type[EQEmu::lightsource::LightEquipment])) {
|
||||||
m_Light.Type.Equipment = item->Light;
|
m_Light.Type[EQEmu::lightsource::LightEquipment] = item->Light;
|
||||||
m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment);
|
m_Light.Level[EQEmu::lightsource::LightEquipment] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightEquipment]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5068,10 +5068,10 @@ void Merc::UpdateEquipmentLight()
|
|||||||
general_light_type = item->Light;
|
general_light_type = item->Light;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EQEmu::lightsource::IsLevelGreater(general_light_type, m_Light.Type.Equipment))
|
if (EQEmu::lightsource::IsLevelGreater(general_light_type, m_Light.Type[EQEmu::lightsource::LightEquipment]))
|
||||||
m_Light.Type.Equipment = general_light_type;
|
m_Light.Type[EQEmu::lightsource::LightEquipment] = general_light_type;
|
||||||
|
|
||||||
m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment);
|
m_Light.Level[EQEmu::lightsource::LightEquipment] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightEquipment]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Merc::AddItem(uint8 slot, uint32 item_id) {
|
void Merc::AddItem(uint8 slot, uint32 item_id) {
|
||||||
|
|||||||
28
zone/mob.cpp
28
zone/mob.cpp
@ -178,12 +178,10 @@ Mob::Mob(const char* in_name,
|
|||||||
if (runspeed < 0 || runspeed > 20)
|
if (runspeed < 0 || runspeed > 20)
|
||||||
runspeed = 1.25f;
|
runspeed = 1.25f;
|
||||||
|
|
||||||
m_Light.Type.Innate = in_light;
|
m_Light.Type[EQEmu::lightsource::LightInnate] = in_light;
|
||||||
m_Light.Level.Innate = EQEmu::lightsource::TypeToLevel(m_Light.Type.Innate);
|
m_Light.Level[EQEmu::lightsource::LightInnate] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightInnate]);
|
||||||
m_Light.Level.Equipment = m_Light.Type.Equipment = 0;
|
m_Light.Type[EQEmu::lightsource::LightActive] = m_Light.Type[EQEmu::lightsource::LightInnate];
|
||||||
m_Light.Level.Spell = m_Light.Type.Spell = 0;
|
m_Light.Level[EQEmu::lightsource::LightActive] = m_Light.Level[EQEmu::lightsource::LightInnate];
|
||||||
m_Light.Type.Active = m_Light.Type.Innate;
|
|
||||||
m_Light.Level.Active = m_Light.Level.Innate;
|
|
||||||
|
|
||||||
texture = in_texture;
|
texture = in_texture;
|
||||||
helmtexture = in_helmtexture;
|
helmtexture = in_helmtexture;
|
||||||
@ -1100,7 +1098,7 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
|
|||||||
ns->spawn.findable = findable?1:0;
|
ns->spawn.findable = findable?1:0;
|
||||||
|
|
||||||
UpdateActiveLight();
|
UpdateActiveLight();
|
||||||
ns->spawn.light = m_Light.Type.Active;
|
ns->spawn.light = m_Light.Type[EQEmu::lightsource::LightActive];
|
||||||
|
|
||||||
ns->spawn.showhelm = (helmtexture && helmtexture != 0xFF) ? 1 : 0;
|
ns->spawn.showhelm = (helmtexture && helmtexture != 0xFF) ? 1 : 0;
|
||||||
|
|
||||||
@ -2227,18 +2225,18 @@ void Mob::SetAppearance(EmuAppearance app, bool iIgnoreSelf) {
|
|||||||
|
|
||||||
bool Mob::UpdateActiveLight()
|
bool Mob::UpdateActiveLight()
|
||||||
{
|
{
|
||||||
uint8 old_light_level = m_Light.Level.Active;
|
uint8 old_light_level = m_Light.Level[EQEmu::lightsource::LightActive];
|
||||||
|
|
||||||
m_Light.Type.Active = 0;
|
m_Light.Type[EQEmu::lightsource::LightActive] = 0;
|
||||||
m_Light.Level.Active = 0;
|
m_Light.Level[EQEmu::lightsource::LightActive] = 0;
|
||||||
|
|
||||||
if (EQEmu::lightsource::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[EQEmu::lightsource::LightInnate] & 0x0F), m_Light.Type[EQEmu::lightsource::LightActive])) { m_Light.Type[EQEmu::lightsource::LightActive] = m_Light.Type[EQEmu::lightsource::LightInnate]; }
|
||||||
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[EQEmu::lightsource::LightEquipment] > m_Light.Level[EQEmu::lightsource::LightActive]) { m_Light.Type[EQEmu::lightsource::LightActive] = m_Light.Type[EQEmu::lightsource::LightEquipment]; } // 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
|
if (m_Light.Level[EQEmu::lightsource::LightSpell] > m_Light.Level[EQEmu::lightsource::LightActive]) { m_Light.Type[EQEmu::lightsource::LightActive] = m_Light.Type[EQEmu::lightsource::LightSpell]; } // limiter in property handler
|
||||||
|
|
||||||
m_Light.Level.Active = EQEmu::lightsource::TypeToLevel(m_Light.Type.Active);
|
m_Light.Level[EQEmu::lightsource::LightActive] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightActive]);
|
||||||
|
|
||||||
return (m_Light.Level.Active != old_light_level);
|
return (m_Light.Level[EQEmu::lightsource::LightActive] != old_light_level);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mob::ChangeSize(float in_size = 0, bool bNoRestriction) {
|
void Mob::ChangeSize(float in_size = 0, bool bNoRestriction) {
|
||||||
|
|||||||
16
zone/mob.h
16
zone/mob.h
@ -703,17 +703,17 @@ public:
|
|||||||
bool IsDestructibleObject() { return destructibleobject; }
|
bool IsDestructibleObject() { return destructibleobject; }
|
||||||
void SetDestructibleObject(bool in) { destructibleobject = in; }
|
void SetDestructibleObject(bool in) { destructibleobject = in; }
|
||||||
|
|
||||||
inline uint8 GetInnateLightType() { return m_Light.Type.Innate; }
|
inline uint8 GetInnateLightType() { return m_Light.Type[EQEmu::lightsource::LightInnate]; }
|
||||||
inline uint8 GetEquipmentLightType() { return m_Light.Type.Equipment; }
|
inline uint8 GetEquipmentLightType() { return m_Light.Type[EQEmu::lightsource::LightEquipment]; }
|
||||||
inline uint8 GetSpellLightType() { return m_Light.Type.Spell; }
|
inline uint8 GetSpellLightType() { return m_Light.Type[EQEmu::lightsource::LightSpell]; }
|
||||||
|
|
||||||
virtual void UpdateEquipmentLight() { m_Light.Type.Equipment = 0; m_Light.Level.Equipment = 0; }
|
virtual void UpdateEquipmentLight() { m_Light.Type[EQEmu::lightsource::LightEquipment] = 0; m_Light.Level[EQEmu::lightsource::LightEquipment] = 0; }
|
||||||
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 void SetSpellLightType(uint8 light_type) { m_Light.Type[EQEmu::lightsource::LightSpell] = (light_type & 0x0F); m_Light.Level[EQEmu::lightsource::LightSpell] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightSpell]); }
|
||||||
|
|
||||||
inline uint8 GetActiveLightType() { return m_Light.Type.Active; }
|
inline uint8 GetActiveLightType() { return m_Light.Type[EQEmu::lightsource::LightActive]; }
|
||||||
bool UpdateActiveLight(); // returns true if change, false if no change
|
bool UpdateActiveLight(); // returns true if change, false if no change
|
||||||
|
|
||||||
EQEmu::lightsource::LightSourceProfile* GetLightProfile() { return &m_Light; }
|
EQEmu::LightSourceProfile* GetLightProfile() { return &m_Light; }
|
||||||
|
|
||||||
Mob* GetPet();
|
Mob* GetPet();
|
||||||
void SetPet(Mob* newpet);
|
void SetPet(Mob* newpet);
|
||||||
@ -1185,7 +1185,7 @@ protected:
|
|||||||
|
|
||||||
glm::vec4 m_Delta;
|
glm::vec4 m_Delta;
|
||||||
|
|
||||||
EQEmu::lightsource::LightSourceProfile m_Light;
|
EQEmu::LightSourceProfile m_Light;
|
||||||
|
|
||||||
float fixedZ;
|
float fixedZ;
|
||||||
EmuAppearance _appearance;
|
EmuAppearance _appearance;
|
||||||
|
|||||||
16
zone/npc.cpp
16
zone/npc.cpp
@ -745,8 +745,8 @@ uint32 NPC::CountLoot() {
|
|||||||
|
|
||||||
void NPC::UpdateEquipmentLight()
|
void NPC::UpdateEquipmentLight()
|
||||||
{
|
{
|
||||||
m_Light.Type.Equipment = 0;
|
m_Light.Type[EQEmu::lightsource::LightEquipment] = 0;
|
||||||
m_Light.Level.Equipment = 0;
|
m_Light.Level[EQEmu::lightsource::LightEquipment] = 0;
|
||||||
|
|
||||||
for (int index = SLOT_BEGIN; index < EQEmu::legacy::EQUIPMENT_SIZE; ++index) {
|
for (int index = SLOT_BEGIN; index < EQEmu::legacy::EQUIPMENT_SIZE; ++index) {
|
||||||
if (index == EQEmu::legacy::SlotAmmo) { continue; }
|
if (index == EQEmu::legacy::SlotAmmo) { continue; }
|
||||||
@ -754,9 +754,9 @@ void NPC::UpdateEquipmentLight()
|
|||||||
auto item = database.GetItem(equipment[index]);
|
auto item = database.GetItem(equipment[index]);
|
||||||
if (item == nullptr) { continue; }
|
if (item == nullptr) { continue; }
|
||||||
|
|
||||||
if (EQEmu::lightsource::IsLevelGreater(item->Light, m_Light.Type.Equipment)) {
|
if (EQEmu::lightsource::IsLevelGreater(item->Light, m_Light.Type[EQEmu::lightsource::LightEquipment])) {
|
||||||
m_Light.Type.Equipment = item->Light;
|
m_Light.Type[EQEmu::lightsource::LightEquipment] = item->Light;
|
||||||
m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment);
|
m_Light.Level[EQEmu::lightsource::LightEquipment] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightEquipment]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -772,10 +772,10 @@ void NPC::UpdateEquipmentLight()
|
|||||||
general_light_type = item->Light;
|
general_light_type = item->Light;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EQEmu::lightsource::IsLevelGreater(general_light_type, m_Light.Type.Equipment))
|
if (EQEmu::lightsource::IsLevelGreater(general_light_type, m_Light.Type[EQEmu::lightsource::LightEquipment]))
|
||||||
m_Light.Type.Equipment = general_light_type;
|
m_Light.Type[EQEmu::lightsource::LightEquipment] = general_light_type;
|
||||||
|
|
||||||
m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment);
|
m_Light.Level[EQEmu::lightsource::LightEquipment] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightEquipment]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NPC::Depop(bool StartSpawnTimer) {
|
void NPC::Depop(bool StartSpawnTimer) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user