mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-28 11:32:33 +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 "doors.h"
|
||||||
#include "quest_parser_collection.h"
|
#include "quest_parser_collection.h"
|
||||||
#include "../common/string_util.h"
|
#include "../common/string_util.h"
|
||||||
|
#include "../common/item.h"
|
||||||
|
|
||||||
extern volatile bool ZoneLoaded;
|
extern volatile bool ZoneLoaded;
|
||||||
|
|
||||||
@ -9006,7 +9007,7 @@ void Bot::AddItemBonuses(const ItemInst *inst, StatBonuses* newbon, bool isAug,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Item_Struct *item = inst->GetItem();
|
const ItemData *item = inst->GetItem();
|
||||||
|
|
||||||
if(!isTribute && !inst->IsEquipable(GetBaseRace(),GetClass()))
|
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)
|
void Client::DisenchantSummonedBags(bool client_update)
|
||||||
{
|
{
|
||||||
for (auto slot_id = EmuConstants::GENERAL_BEGIN; slot_id <= EmuConstants::GENERAL_END; ++slot_id) {
|
//Inv2 todo: uh fix this
|
||||||
auto inst = m_inv[slot_id];
|
//for (auto slot_id = EmuConstants::GENERAL_BEGIN; slot_id <= EmuConstants::GENERAL_END; ++slot_id) {
|
||||||
if (!inst) { continue; }
|
// auto inst = m_inv[slot_id];
|
||||||
if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
|
// if (!inst) { continue; }
|
||||||
if (inst->GetItem()->ItemClass != ItemClassContainer) { continue; }
|
// if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
|
||||||
if (inst->GetTotalItemCount() == 1) { 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_id = GetDisenchantedBagID(inst->GetItem()->BagSlots);
|
||||||
auto new_item = database.GetItem(new_id);
|
// if (!new_id) { continue; }
|
||||||
if (!new_item) { continue; }
|
// auto new_item = database.GetItem(new_id);
|
||||||
auto new_inst = database.CreateBaseItem(new_item);
|
// if (!new_item) { continue; }
|
||||||
if (!new_inst) { 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);
|
// if (CopyBagContents(new_inst, inst)) {
|
||||||
PutItemInInventory(slot_id, *new_inst, client_update);
|
// 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);
|
// }
|
||||||
}
|
// safe_delete(new_inst);
|
||||||
|
//}
|
||||||
for (auto slot_id = EmuConstants::BANK_BEGIN; slot_id <= EmuConstants::BANK_END; ++slot_id) {
|
//
|
||||||
auto inst = m_inv[slot_id];
|
//for (auto slot_id = EmuConstants::BANK_BEGIN; slot_id <= EmuConstants::BANK_END; ++slot_id) {
|
||||||
if (!inst) { continue; }
|
// auto inst = m_inv[slot_id];
|
||||||
if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
|
// if (!inst) { continue; }
|
||||||
if (inst->GetItem()->ItemClass != ItemClassContainer) { continue; }
|
// if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
|
||||||
if (inst->GetTotalItemCount() == 1) { 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_id = GetDisenchantedBagID(inst->GetItem()->BagSlots);
|
||||||
auto new_item = database.GetItem(new_id);
|
// if (!new_id) { continue; }
|
||||||
if (!new_item) { continue; }
|
// auto new_item = database.GetItem(new_id);
|
||||||
auto new_inst = database.CreateBaseItem(new_item);
|
// if (!new_item) { continue; }
|
||||||
if (!new_inst) { 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);
|
// if (CopyBagContents(new_inst, inst)) {
|
||||||
PutItemInInventory(slot_id, *new_inst, client_update);
|
// 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);
|
// }
|
||||||
}
|
// 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];
|
//for (auto slot_id = EmuConstants::SHARED_BANK_BEGIN; slot_id <= EmuConstants::SHARED_BANK_END; ++slot_id) {
|
||||||
if (!inst) { continue; }
|
// auto inst = m_inv[slot_id];
|
||||||
if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
|
// if (!inst) { continue; }
|
||||||
if (inst->GetItem()->ItemClass != ItemClassContainer) { continue; }
|
// if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
|
||||||
if (inst->GetTotalItemCount() == 1) { 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_id = GetDisenchantedBagID(inst->GetItem()->BagSlots);
|
||||||
auto new_item = database.GetItem(new_id);
|
// if (!new_id) { continue; }
|
||||||
if (!new_item) { continue; }
|
// auto new_item = database.GetItem(new_id);
|
||||||
auto new_inst = database.CreateBaseItem(new_item);
|
// if (!new_item) { continue; }
|
||||||
if (!new_inst) { 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);
|
// if (CopyBagContents(new_inst, inst)) {
|
||||||
PutItemInInventory(slot_id, *new_inst, client_update);
|
// 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);
|
// }
|
||||||
}
|
// safe_delete(new_inst);
|
||||||
|
//}
|
||||||
while (!m_inv.CursorEmpty()) {
|
//
|
||||||
auto inst = m_inv[MainCursor];
|
//while (!m_inv.CursorEmpty()) {
|
||||||
if (!inst) { break; }
|
// auto inst = m_inv[MainCursor];
|
||||||
if (!IsSummonedBagID(inst->GetItem()->ID)) { break; }
|
// if (!inst) { break; }
|
||||||
if (inst->GetItem()->ItemClass != ItemClassContainer) { break; }
|
// if (!IsSummonedBagID(inst->GetItem()->ID)) { break; }
|
||||||
if (inst->GetTotalItemCount() == 1) { 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_id = GetDisenchantedBagID(inst->GetItem()->BagSlots);
|
||||||
auto new_item = database.GetItem(new_id);
|
// if (!new_id) { break; }
|
||||||
if (!new_item) { break; }
|
// auto new_item = database.GetItem(new_id);
|
||||||
auto new_inst = database.CreateBaseItem(new_item);
|
// if (!new_item) { break; }
|
||||||
if (!new_inst) { 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);
|
// if (CopyBagContents(new_inst, inst)) {
|
||||||
std::list<ItemInst*> local;
|
// Log.Out(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, MainCursor);
|
||||||
local.push_front(new_inst);
|
// std::list<ItemInst*> local;
|
||||||
m_inv.PopItem(MainCursor);
|
// local.push_front(new_inst);
|
||||||
safe_delete(inst);
|
// m_inv.PopItem(MainCursor);
|
||||||
|
// safe_delete(inst);
|
||||||
while (!m_inv.CursorEmpty()) {
|
//
|
||||||
auto limbo_inst = m_inv.PopItem(MainCursor);
|
// while (!m_inv.CursorEmpty()) {
|
||||||
if (limbo_inst == nullptr) { continue; }
|
// auto limbo_inst = m_inv.PopItem(MainCursor);
|
||||||
local.push_back(limbo_inst);
|
// if (limbo_inst == nullptr) { continue; }
|
||||||
}
|
// local.push_back(limbo_inst);
|
||||||
|
// }
|
||||||
for (auto iter = local.begin(); iter != local.end(); ++iter) {
|
//
|
||||||
auto cur_inst = *iter;
|
// for (auto iter = local.begin(); iter != local.end(); ++iter) {
|
||||||
if (cur_inst == nullptr) { continue; }
|
// auto cur_inst = *iter;
|
||||||
m_inv.PushCursor(*cur_inst);
|
// if (cur_inst == nullptr) { continue; }
|
||||||
safe_delete(cur_inst);
|
// m_inv.PushCursor(*cur_inst);
|
||||||
}
|
// safe_delete(cur_inst);
|
||||||
local.clear();
|
// }
|
||||||
|
// local.clear();
|
||||||
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
|
//
|
||||||
database.SaveCursor(this->CharacterID(), s, e);
|
// 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
|
// else {
|
||||||
}
|
// safe_delete(new_inst); // deletes disenchanted bag if not used
|
||||||
|
// }
|
||||||
break;
|
//
|
||||||
}
|
// break;
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::RemoveNoRent(bool client_update)
|
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) {
|
for(int i = 0; i < mindrop; ++i) {
|
||||||
float roll = (float)zone->random.Real(0.0, roll_t_min);
|
float roll = (float)zone->random.Real(0.0, roll_t_min);
|
||||||
for(uint32 j = 0; j < lds->NumEntries; ++j) {
|
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(db_item) {
|
||||||
if(roll < lds->Entries[j].chance) {
|
if(roll < lds->Entries[j].chance) {
|
||||||
npc->AddLootDrop(db_item, itemlist, lds->Entries[j].item_charges, lds->Entries[j].minlevel,
|
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())
|
if (!IsClient())
|
||||||
{
|
{
|
||||||
const Item_Struct *item;
|
const ItemData *item;
|
||||||
for (int i=0; i< 7 ; ++i)
|
for (int i=0; i< 7 ; ++i)
|
||||||
{
|
{
|
||||||
item=database.GetItem(GetEquipment(i));
|
item=database.GetItem(GetEquipment(i));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user