mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 13:28:25 +00:00
Eliminated the nested class design of recent EQEmu work; Some more inv2 convergence work
This commit is contained in:
+23
-23
@@ -328,7 +328,7 @@ Corpse::Corpse(Client* client, int32 in_rezexp) : Mob (
|
||||
// to go into the regular slots on the player, out of bags
|
||||
std::list<uint32> removed_list;
|
||||
|
||||
for(i = SLOT_BEGIN; i < EQEmu::Constants::TYPE_POSSESSIONS_SIZE; ++i) {
|
||||
for(i = SLOT_BEGIN; i < EQEmu::constants::TYPE_POSSESSIONS_SIZE; ++i) {
|
||||
if(i == SlotAmmo && client->GetClientVersion() >= ClientVersion::SoF) {
|
||||
item = client->GetInv().GetItem(SlotPowerSource);
|
||||
if (item != nullptr) {
|
||||
@@ -410,9 +410,9 @@ void Corpse::MoveItemToCorpse(Client *client, ItemInst *inst, int16 equipSlot, s
|
||||
|
||||
while (true) {
|
||||
if (!inst->IsType(ItemClassContainer)) { break; }
|
||||
if (equipSlot < EQEmu::Constants::GENERAL_BEGIN || equipSlot > SlotCursor) { break; }
|
||||
if (equipSlot < EQEmu::constants::GENERAL_BEGIN || equipSlot > SlotCursor) { break; }
|
||||
|
||||
for (auto sub_index = SUB_BEGIN; sub_index < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++sub_index) {
|
||||
for (auto sub_index = SUB_INDEX_BEGIN; sub_index < EQEmu::constants::ITEM_CONTAINER_SIZE; ++sub_index) {
|
||||
int16 real_bag_slot = Inventory::CalcSlotId(equipSlot, sub_index);
|
||||
auto bag_inst = client->GetInv().GetItem(real_bag_slot);
|
||||
if (bag_inst == nullptr) { continue; }
|
||||
@@ -693,7 +693,7 @@ ServerLootItem_Struct* Corpse::GetItem(uint16 lootslot, ServerLootItem_Struct**
|
||||
}
|
||||
|
||||
if (sitem && bag_item_data && Inventory::SupportsContainers(sitem->equip_slot)) {
|
||||
int16 bagstart = Inventory::CalcSlotId(sitem->equip_slot, SUB_BEGIN);
|
||||
int16 bagstart = Inventory::CalcSlotId(sitem->equip_slot, SUB_INDEX_BEGIN);
|
||||
|
||||
cur = itemlist.begin();
|
||||
end = itemlist.end();
|
||||
@@ -985,7 +985,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
|
||||
if(inst) {
|
||||
if (item->RecastDelay)
|
||||
inst->SetRecastTimestamp(timestamps.count(item->RecastType) ? timestamps.at(item->RecastType) : 0);
|
||||
client->SendItemPacket(EQEmu::Constants::CORPSE_BEGIN, inst, ItemPacketLoot);
|
||||
client->SendItemPacket(EQEmu::constants::CORPSE_BEGIN, inst, ItemPacketLoot);
|
||||
safe_delete(inst);
|
||||
}
|
||||
else { client->Message(13, "Could not find item number %i to send!!", GetPlayerKillItem()); }
|
||||
@@ -1000,7 +1000,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
|
||||
cur = itemlist.begin();
|
||||
end = itemlist.end();
|
||||
|
||||
int corpselootlimit = EQEmu::Limits::InventoryMapSize(TypeCorpse, client->GetClientVersion());
|
||||
int corpselootlimit = EQEmu::limits::InventoryMapSize(TypeCorpse, client->GetClientVersion());
|
||||
|
||||
for(; cur != end; ++cur) {
|
||||
ServerLootItem_Struct* item_data = *cur;
|
||||
@@ -1019,7 +1019,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
|
||||
if (item->RecastDelay)
|
||||
inst->SetRecastTimestamp(timestamps.count(item->RecastType) ? timestamps.at(item->RecastType) : 0);
|
||||
// SlotGeneral1 is the corpse inventory start offset for Ti(EMu) - CORPSE_END = SlotGeneral1 + SlotCursor
|
||||
client->SendItemPacket(i + EQEmu::Constants::CORPSE_BEGIN, inst, ItemPacketLoot);
|
||||
client->SendItemPacket(i + EQEmu::constants::CORPSE_BEGIN, inst, ItemPacketLoot);
|
||||
safe_delete(inst);
|
||||
}
|
||||
|
||||
@@ -1119,10 +1119,10 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
|
||||
item = database.GetItem(GetPlayerKillItem());
|
||||
}
|
||||
else if (GetPlayerKillItem() == -1 || GetPlayerKillItem() == 1){
|
||||
item_data = GetItem(lootitem->slot_id - EQEmu::Constants::CORPSE_BEGIN); //dont allow them to loot entire bags of items as pvp reward
|
||||
item_data = GetItem(lootitem->slot_id - EQEmu::constants::CORPSE_BEGIN); //dont allow them to loot entire bags of items as pvp reward
|
||||
}
|
||||
else{
|
||||
item_data = GetItem(lootitem->slot_id - EQEmu::Constants::CORPSE_BEGIN, bag_item_data);
|
||||
item_data = GetItem(lootitem->slot_id - EQEmu::constants::CORPSE_BEGIN, bag_item_data);
|
||||
}
|
||||
|
||||
if (GetPlayerKillItem()<=1 && item_data != 0) {
|
||||
@@ -1148,7 +1148,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
|
||||
}
|
||||
|
||||
if (inst->IsAugmented()) {
|
||||
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) {
|
||||
for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
|
||||
ItemInst *itm = inst->GetAugment(i);
|
||||
if (itm) {
|
||||
if (client->CheckLoreConflict(itm->GetItem())) {
|
||||
@@ -1210,7 +1210,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
|
||||
|
||||
/* Remove Bag Contents */
|
||||
if (item->ItemClass == ItemClassContainer && (GetPlayerKillItem() != -1 || GetPlayerKillItem() != 1)) {
|
||||
for (int i = SUB_BEGIN; i < EQEmu::Constants::ITEM_CONTAINER_SIZE; i++) {
|
||||
for (int i = SUB_INDEX_BEGIN; i < EQEmu::constants::ITEM_CONTAINER_SIZE; i++) {
|
||||
if (bag_item_data[i]) {
|
||||
/* Delete needs to be before RemoveItem because its deletes the pointer for item_data/bag_item_data */
|
||||
database.DeleteItemOffCharacterCorpse(this->corpse_db_id, bag_item_data[i]->equip_slot, bag_item_data[i]->item_id);
|
||||
@@ -1225,8 +1225,8 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
|
||||
}
|
||||
|
||||
/* Send message with item link to groups and such */
|
||||
EQEmu::SayLink::impl linker;
|
||||
linker.SetLinkType(EQEmu::SayLink::LinkItemInst);
|
||||
EQEmu::saylink::SayLinkEngine linker;
|
||||
linker.SetLinkType(linker.SayLinkItemInst);
|
||||
linker.SetItemInst(inst);
|
||||
|
||||
auto item_link = linker.GenerateLink();
|
||||
@@ -1294,13 +1294,13 @@ void Corpse::QueryLoot(Client* to) {
|
||||
cur = itemlist.begin();
|
||||
end = itemlist.end();
|
||||
|
||||
int corpselootlimit = EQEmu::Limits::InventoryMapSize(TypeCorpse, to->GetClientVersion());
|
||||
int corpselootlimit = EQEmu::limits::InventoryMapSize(TypeCorpse, to->GetClientVersion());
|
||||
|
||||
for(; cur != end; ++cur) {
|
||||
ServerLootItem_Struct* sitem = *cur;
|
||||
|
||||
if (IsPlayerCorpse()) {
|
||||
if (sitem->equip_slot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && sitem->equip_slot <= EQEmu::Constants::CURSOR_BAG_END)
|
||||
if (sitem->equip_slot >= EQEmu::constants::GENERAL_BAGS_BEGIN && sitem->equip_slot <= EQEmu::constants::CURSOR_BAG_END)
|
||||
sitem->lootslot = 0xFFFF;
|
||||
else
|
||||
x < corpselootlimit ? sitem->lootslot = x : sitem->lootslot = 0xFFFF;
|
||||
@@ -1402,7 +1402,7 @@ void Corpse::Spawn() {
|
||||
uint32 Corpse::GetEquipment(uint8 material_slot) const {
|
||||
int16 invslot;
|
||||
|
||||
if(material_slot > EQEmu::Constants::MATERIAL_END) {
|
||||
if(material_slot > EQEmu::constants::MATERIAL_END) {
|
||||
return NO_ITEM;
|
||||
}
|
||||
|
||||
@@ -1416,7 +1416,7 @@ uint32 Corpse::GetEquipment(uint8 material_slot) const {
|
||||
uint32 Corpse::GetEquipmentColor(uint8 material_slot) const {
|
||||
const Item_Struct *item;
|
||||
|
||||
if(material_slot > EQEmu::Constants::MATERIAL_END) {
|
||||
if(material_slot > EQEmu::constants::MATERIAL_END) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1436,19 +1436,19 @@ void Corpse::UpdateEquipmentLight()
|
||||
m_Light.Level.Equipment = 0;
|
||||
|
||||
for (auto iter = itemlist.begin(); iter != itemlist.end(); ++iter) {
|
||||
if (((*iter)->equip_slot < EQEmu::Constants::EQUIPMENT_BEGIN || (*iter)->equip_slot > EQEmu::Constants::EQUIPMENT_END) && (*iter)->equip_slot != SlotPowerSource) { continue; }
|
||||
if (((*iter)->equip_slot < EQEmu::constants::EQUIPMENT_BEGIN || (*iter)->equip_slot > EQEmu::constants::EQUIPMENT_END) && (*iter)->equip_slot != SlotPowerSource) { continue; }
|
||||
if ((*iter)->equip_slot == SlotAmmo) { continue; }
|
||||
|
||||
auto item = database.GetItem((*iter)->item_id);
|
||||
if (item == nullptr) { continue; }
|
||||
|
||||
if (EQEmu::LightSource::IsLevelGreater(item->Light, m_Light.Type.Equipment))
|
||||
if (EQEmu::lightsource::IsLevelGreater(item->Light, m_Light.Type.Equipment))
|
||||
m_Light.Type.Equipment = item->Light;
|
||||
}
|
||||
|
||||
uint8 general_light_type = 0;
|
||||
for (auto iter = itemlist.begin(); iter != itemlist.end(); ++iter) {
|
||||
if ((*iter)->equip_slot < EQEmu::Constants::GENERAL_BEGIN || (*iter)->equip_slot > EQEmu::Constants::GENERAL_END) { continue; }
|
||||
if ((*iter)->equip_slot < EQEmu::constants::GENERAL_BEGIN || (*iter)->equip_slot > EQEmu::constants::GENERAL_END) { continue; }
|
||||
|
||||
auto item = database.GetItem((*iter)->item_id);
|
||||
if (item == nullptr) { continue; }
|
||||
@@ -1456,14 +1456,14 @@ void Corpse::UpdateEquipmentLight()
|
||||
if (item->ItemClass != ItemClassCommon) { continue; }
|
||||
if (item->Light < 9 || item->Light > 13) { continue; }
|
||||
|
||||
if (EQEmu::LightSource::TypeToLevel(item->Light))
|
||||
if (EQEmu::lightsource::TypeToLevel(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.Equipment))
|
||||
m_Light.Type.Equipment = general_light_type;
|
||||
|
||||
m_Light.Level.Equipment = EQEmu::LightSource::TypeToLevel(m_Light.Type.Equipment);
|
||||
m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment);
|
||||
}
|
||||
|
||||
void Corpse::AddLooter(Mob* who) {
|
||||
|
||||
Reference in New Issue
Block a user