mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-05 08:23:52 +00:00
Compiles again, had to disable a new piece of code though
This commit is contained in:
parent
5995afa1b8
commit
bbc3733c3a
@ -5,6 +5,7 @@
|
||||
#include "doors.h"
|
||||
#include "quest_parser_collection.h"
|
||||
#include "../common/string_util.h"
|
||||
#include "../common/item.h"
|
||||
|
||||
extern volatile bool ZoneLoaded;
|
||||
|
||||
@ -9006,7 +9007,7 @@ void Bot::AddItemBonuses(const ItemInst *inst, StatBonuses* newbon, bool isAug,
|
||||
return;
|
||||
}
|
||||
|
||||
const Item_Struct *item = inst->GetItem();
|
||||
const ItemData *item = inst->GetItem();
|
||||
|
||||
if(!isTribute && !inst->IsEquipable(GetBaseRace(),GetClass()))
|
||||
{
|
||||
|
||||
@ -2271,113 +2271,114 @@ static bool CopyBagContents(ItemInst* new_bag, const ItemInst* old_bag)
|
||||
|
||||
void Client::DisenchantSummonedBags(bool client_update)
|
||||
{
|
||||
for (auto slot_id = EmuConstants::GENERAL_BEGIN; slot_id <= EmuConstants::GENERAL_END; ++slot_id) {
|
||||
auto inst = m_inv[slot_id];
|
||||
if (!inst) { continue; }
|
||||
if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
|
||||
if (inst->GetItem()->ItemClass != ItemClassContainer) { continue; }
|
||||
if (inst->GetTotalItemCount() == 1) { continue; }
|
||||
|
||||
auto new_id = GetDisenchantedBagID(inst->GetItem()->BagSlots);
|
||||
if (!new_id) { continue; }
|
||||
auto new_item = database.GetItem(new_id);
|
||||
if (!new_item) { continue; }
|
||||
auto new_inst = database.CreateBaseItem(new_item);
|
||||
if (!new_inst) { continue; }
|
||||
|
||||
if (CopyBagContents(new_inst, inst)) {
|
||||
Log.Out(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, slot_id);
|
||||
PutItemInInventory(slot_id, *new_inst, client_update);
|
||||
}
|
||||
safe_delete(new_inst);
|
||||
}
|
||||
|
||||
for (auto slot_id = EmuConstants::BANK_BEGIN; slot_id <= EmuConstants::BANK_END; ++slot_id) {
|
||||
auto inst = m_inv[slot_id];
|
||||
if (!inst) { continue; }
|
||||
if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
|
||||
if (inst->GetItem()->ItemClass != ItemClassContainer) { continue; }
|
||||
if (inst->GetTotalItemCount() == 1) { continue; }
|
||||
|
||||
auto new_id = GetDisenchantedBagID(inst->GetItem()->BagSlots);
|
||||
if (!new_id) { continue; }
|
||||
auto new_item = database.GetItem(new_id);
|
||||
if (!new_item) { continue; }
|
||||
auto new_inst = database.CreateBaseItem(new_item);
|
||||
if (!new_inst) { continue; }
|
||||
|
||||
if (CopyBagContents(new_inst, inst)) {
|
||||
Log.Out(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, slot_id);
|
||||
PutItemInInventory(slot_id, *new_inst, client_update);
|
||||
}
|
||||
safe_delete(new_inst);
|
||||
}
|
||||
|
||||
for (auto slot_id = EmuConstants::SHARED_BANK_BEGIN; slot_id <= EmuConstants::SHARED_BANK_END; ++slot_id) {
|
||||
auto inst = m_inv[slot_id];
|
||||
if (!inst) { continue; }
|
||||
if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
|
||||
if (inst->GetItem()->ItemClass != ItemClassContainer) { continue; }
|
||||
if (inst->GetTotalItemCount() == 1) { continue; }
|
||||
|
||||
auto new_id = GetDisenchantedBagID(inst->GetItem()->BagSlots);
|
||||
if (!new_id) { continue; }
|
||||
auto new_item = database.GetItem(new_id);
|
||||
if (!new_item) { continue; }
|
||||
auto new_inst = database.CreateBaseItem(new_item);
|
||||
if (!new_inst) { continue; }
|
||||
|
||||
if (CopyBagContents(new_inst, inst)) {
|
||||
Log.Out(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, slot_id);
|
||||
PutItemInInventory(slot_id, *new_inst, client_update);
|
||||
}
|
||||
safe_delete(new_inst);
|
||||
}
|
||||
|
||||
while (!m_inv.CursorEmpty()) {
|
||||
auto inst = m_inv[MainCursor];
|
||||
if (!inst) { break; }
|
||||
if (!IsSummonedBagID(inst->GetItem()->ID)) { break; }
|
||||
if (inst->GetItem()->ItemClass != ItemClassContainer) { break; }
|
||||
if (inst->GetTotalItemCount() == 1) { break; }
|
||||
|
||||
auto new_id = GetDisenchantedBagID(inst->GetItem()->BagSlots);
|
||||
if (!new_id) { break; }
|
||||
auto new_item = database.GetItem(new_id);
|
||||
if (!new_item) { break; }
|
||||
auto new_inst = database.CreateBaseItem(new_item);
|
||||
if (!new_inst) { break; }
|
||||
|
||||
if (CopyBagContents(new_inst, inst)) {
|
||||
Log.Out(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, MainCursor);
|
||||
std::list<ItemInst*> local;
|
||||
local.push_front(new_inst);
|
||||
m_inv.PopItem(MainCursor);
|
||||
safe_delete(inst);
|
||||
|
||||
while (!m_inv.CursorEmpty()) {
|
||||
auto limbo_inst = m_inv.PopItem(MainCursor);
|
||||
if (limbo_inst == nullptr) { continue; }
|
||||
local.push_back(limbo_inst);
|
||||
}
|
||||
|
||||
for (auto iter = local.begin(); iter != local.end(); ++iter) {
|
||||
auto cur_inst = *iter;
|
||||
if (cur_inst == nullptr) { continue; }
|
||||
m_inv.PushCursor(*cur_inst);
|
||||
safe_delete(cur_inst);
|
||||
}
|
||||
local.clear();
|
||||
|
||||
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
|
||||
database.SaveCursor(this->CharacterID(), s, e);
|
||||
}
|
||||
else {
|
||||
safe_delete(new_inst); // deletes disenchanted bag if not used
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
//Inv2 todo: uh fix this
|
||||
//for (auto slot_id = EmuConstants::GENERAL_BEGIN; slot_id <= EmuConstants::GENERAL_END; ++slot_id) {
|
||||
// auto inst = m_inv[slot_id];
|
||||
// if (!inst) { continue; }
|
||||
// if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
|
||||
// if (inst->GetItem()->ItemClass != ItemClassContainer) { continue; }
|
||||
// if (inst->GetTotalItemCount() == 1) { continue; }
|
||||
//
|
||||
// auto new_id = GetDisenchantedBagID(inst->GetItem()->BagSlots);
|
||||
// if (!new_id) { continue; }
|
||||
// auto new_item = database.GetItem(new_id);
|
||||
// if (!new_item) { continue; }
|
||||
// auto new_inst = database.CreateBaseItem(new_item);
|
||||
// if (!new_inst) { continue; }
|
||||
//
|
||||
// if (CopyBagContents(new_inst, inst)) {
|
||||
// Log.Out(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, slot_id);
|
||||
// PutItemInInventory(slot_id, *new_inst, client_update);
|
||||
// }
|
||||
// safe_delete(new_inst);
|
||||
//}
|
||||
//
|
||||
//for (auto slot_id = EmuConstants::BANK_BEGIN; slot_id <= EmuConstants::BANK_END; ++slot_id) {
|
||||
// auto inst = m_inv[slot_id];
|
||||
// if (!inst) { continue; }
|
||||
// if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
|
||||
// if (inst->GetItem()->ItemClass != ItemClassContainer) { continue; }
|
||||
// if (inst->GetTotalItemCount() == 1) { continue; }
|
||||
//
|
||||
// auto new_id = GetDisenchantedBagID(inst->GetItem()->BagSlots);
|
||||
// if (!new_id) { continue; }
|
||||
// auto new_item = database.GetItem(new_id);
|
||||
// if (!new_item) { continue; }
|
||||
// auto new_inst = database.CreateBaseItem(new_item);
|
||||
// if (!new_inst) { continue; }
|
||||
//
|
||||
// if (CopyBagContents(new_inst, inst)) {
|
||||
// Log.Out(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, slot_id);
|
||||
// PutItemInInventory(slot_id, *new_inst, client_update);
|
||||
// }
|
||||
// safe_delete(new_inst);
|
||||
//}
|
||||
//
|
||||
//for (auto slot_id = EmuConstants::SHARED_BANK_BEGIN; slot_id <= EmuConstants::SHARED_BANK_END; ++slot_id) {
|
||||
// auto inst = m_inv[slot_id];
|
||||
// if (!inst) { continue; }
|
||||
// if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
|
||||
// if (inst->GetItem()->ItemClass != ItemClassContainer) { continue; }
|
||||
// if (inst->GetTotalItemCount() == 1) { continue; }
|
||||
//
|
||||
// auto new_id = GetDisenchantedBagID(inst->GetItem()->BagSlots);
|
||||
// if (!new_id) { continue; }
|
||||
// auto new_item = database.GetItem(new_id);
|
||||
// if (!new_item) { continue; }
|
||||
// auto new_inst = database.CreateBaseItem(new_item);
|
||||
// if (!new_inst) { continue; }
|
||||
//
|
||||
// if (CopyBagContents(new_inst, inst)) {
|
||||
// Log.Out(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, slot_id);
|
||||
// PutItemInInventory(slot_id, *new_inst, client_update);
|
||||
// }
|
||||
// safe_delete(new_inst);
|
||||
//}
|
||||
//
|
||||
//while (!m_inv.CursorEmpty()) {
|
||||
// auto inst = m_inv[MainCursor];
|
||||
// if (!inst) { break; }
|
||||
// if (!IsSummonedBagID(inst->GetItem()->ID)) { break; }
|
||||
// if (inst->GetItem()->ItemClass != ItemClassContainer) { break; }
|
||||
// if (inst->GetTotalItemCount() == 1) { break; }
|
||||
//
|
||||
// auto new_id = GetDisenchantedBagID(inst->GetItem()->BagSlots);
|
||||
// if (!new_id) { break; }
|
||||
// auto new_item = database.GetItem(new_id);
|
||||
// if (!new_item) { break; }
|
||||
// auto new_inst = database.CreateBaseItem(new_item);
|
||||
// if (!new_inst) { break; }
|
||||
//
|
||||
// if (CopyBagContents(new_inst, inst)) {
|
||||
// Log.Out(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, MainCursor);
|
||||
// std::list<ItemInst*> local;
|
||||
// local.push_front(new_inst);
|
||||
// m_inv.PopItem(MainCursor);
|
||||
// safe_delete(inst);
|
||||
//
|
||||
// while (!m_inv.CursorEmpty()) {
|
||||
// auto limbo_inst = m_inv.PopItem(MainCursor);
|
||||
// if (limbo_inst == nullptr) { continue; }
|
||||
// local.push_back(limbo_inst);
|
||||
// }
|
||||
//
|
||||
// for (auto iter = local.begin(); iter != local.end(); ++iter) {
|
||||
// auto cur_inst = *iter;
|
||||
// if (cur_inst == nullptr) { continue; }
|
||||
// m_inv.PushCursor(*cur_inst);
|
||||
// safe_delete(cur_inst);
|
||||
// }
|
||||
// local.clear();
|
||||
//
|
||||
// auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
|
||||
// database.SaveCursor(this->CharacterID(), s, e);
|
||||
// }
|
||||
// else {
|
||||
// safe_delete(new_inst); // deletes disenchanted bag if not used
|
||||
// }
|
||||
//
|
||||
// break;
|
||||
//}
|
||||
}
|
||||
|
||||
void Client::RemoveNoRent(bool client_update)
|
||||
|
||||
@ -157,7 +157,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml
|
||||
for(int i = 0; i < mindrop; ++i) {
|
||||
float roll = (float)zone->random.Real(0.0, roll_t_min);
|
||||
for(uint32 j = 0; j < lds->NumEntries; ++j) {
|
||||
const Item_Struct* db_item = GetItem(lds->Entries[j].item_id);
|
||||
const ItemData* db_item = GetItem(lds->Entries[j].item_id);
|
||||
if(db_item) {
|
||||
if(roll < lds->Entries[j].chance) {
|
||||
npc->AddLootDrop(db_item, itemlist, lds->Entries[j].item_charges, lds->Entries[j].minlevel,
|
||||
|
||||
@ -2729,7 +2729,7 @@ void Mob::SendArmorAppearance(Client *one_client)
|
||||
{
|
||||
if (!IsClient())
|
||||
{
|
||||
const Item_Struct *item;
|
||||
const ItemData *item;
|
||||
for (int i=0; i< 7 ; ++i)
|
||||
{
|
||||
item=database.GetItem(GetEquipment(i));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user