mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-04 03:13:52 +00:00
More restructures, non-working state
This commit is contained in:
parent
d1b0564698
commit
f328853251
@ -5209,17 +5209,17 @@ struct MercenaryMerchantResponse_Struct {
|
||||
};
|
||||
|
||||
struct ServerLootItem_Struct {
|
||||
uint32 item_id;
|
||||
int16 equipSlot;
|
||||
uint8 charges;
|
||||
uint16 lootslot;
|
||||
uint32 aug1;
|
||||
uint32 aug2;
|
||||
uint32 aug3;
|
||||
uint32 aug4;
|
||||
uint32 aug5;
|
||||
uint8 minlevel;
|
||||
uint8 maxlevel;
|
||||
uint32 item_id; // uint32 item_id;
|
||||
int16 equip_slot; // int16 equip_slot;
|
||||
uint8 charges; // uint8 charges;
|
||||
uint16 lootslot; // uint16 lootslot;
|
||||
uint32 aug_1; // uint32 aug_1;
|
||||
uint32 aug_2; // uint32 aug_2;
|
||||
uint32 aug_3; // uint32 aug_3;
|
||||
uint32 aug_4; // uint32 aug_4;
|
||||
uint32 aug_5; // uint32 aug_5;
|
||||
uint8 min_level; //
|
||||
uint8 max_level; //
|
||||
};
|
||||
|
||||
//Found in client near a ref to the string:
|
||||
|
||||
226
zone/corpse.cpp
226
zone/corpse.cpp
@ -73,35 +73,35 @@ Corpse* Corpse::LoadFromDBData(uint32 in_dbid, uint32 in_charid, char* in_charna
|
||||
for (unsigned int i = 0; i < pcs.itemcount; i++) {
|
||||
tmp = new ServerLootItem_Struct;
|
||||
memcpy(tmp, &pcs.items[i], sizeof(player_lootitem::ServerLootItem_Struct));
|
||||
tmp->equipSlot = CorpseToServerSlot(tmp->equipSlot);
|
||||
tmp->equip_slot = CorpseToServerSlot(tmp->equip_slot);
|
||||
itemlist.push_back(tmp);
|
||||
}
|
||||
|
||||
/* Create Corpse Entity */
|
||||
Corpse* pc = new Corpse(
|
||||
in_dbid,
|
||||
in_charid,
|
||||
in_charname,
|
||||
&itemlist,
|
||||
pcs.copper,
|
||||
pcs.silver,
|
||||
pcs.gold,
|
||||
pcs.plat,
|
||||
in_x,
|
||||
in_y,
|
||||
in_z,
|
||||
in_heading,
|
||||
pcs.size,
|
||||
pcs.gender,
|
||||
pcs.race,
|
||||
pcs.class_,
|
||||
pcs.deity,
|
||||
pcs.level,
|
||||
pcs.texture,
|
||||
pcs.helmtexture,
|
||||
pcs.exp,
|
||||
was_at_graveyard
|
||||
);
|
||||
in_dbid, // uint32 in_dbid
|
||||
in_charid, // uint32 in_charid
|
||||
in_charname, // char* in_charname
|
||||
&itemlist, // ItemList* in_itemlist
|
||||
pcs.copper, // uint32 in_copper
|
||||
pcs.silver, // uint32 in_silver
|
||||
pcs.gold, // uint32 in_gold
|
||||
pcs.plat, // uint32 in_plat
|
||||
in_x, // float in_x
|
||||
in_y, // float in_y
|
||||
in_z, // float in_z
|
||||
in_heading, // float in_heading
|
||||
pcs.size, // float in_size
|
||||
pcs.gender, // uint8 in_gender
|
||||
pcs.race, // uint16 in_race
|
||||
pcs.class_, // uint8 in_class
|
||||
pcs.deity, // uint8 in_deity
|
||||
pcs.level, // uint8 in_level
|
||||
pcs.texture, // uint8 in_texture
|
||||
pcs.helmtexture, // uint8 in_helmtexture
|
||||
pcs.exp, // uint32 in_rezexp
|
||||
was_at_graveyard // bool wasAtGraveyard
|
||||
);
|
||||
if (pcs.locked)
|
||||
pc->Lock();
|
||||
|
||||
@ -184,70 +184,66 @@ Corpse::Corpse(NPC* in_npc, ItemList* in_itemlist, uint32 in_npctypeid, const NP
|
||||
this->rezzexp = 0;
|
||||
}
|
||||
|
||||
// To be used on PC death
|
||||
// Mongrel: added see_invis and see_invis_undead
|
||||
Corpse::Corpse(Client* client, int32 in_rezexp)
|
||||
// vesuvias - appearence fix
|
||||
: Mob
|
||||
(
|
||||
"Unnamed_Corpse",
|
||||
"",
|
||||
0,
|
||||
0,
|
||||
client->GetGender(),
|
||||
client->GetRace(),
|
||||
client->GetClass(),
|
||||
BT_Humanoid, // bodytype added
|
||||
client->GetDeity(),
|
||||
client->GetLevel(),
|
||||
0,
|
||||
client->GetSize(),
|
||||
0,
|
||||
client->GetHeading(), // heading
|
||||
client->GetX(),
|
||||
client->GetY(),
|
||||
client->GetZ(),
|
||||
0,
|
||||
client->GetTexture(),
|
||||
client->GetHelmTexture(),
|
||||
0, // AC
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0, // CHA
|
||||
client->GetPP().haircolor,
|
||||
client->GetPP().beardcolor,
|
||||
client->GetPP().eyecolor1,
|
||||
client->GetPP().eyecolor2,
|
||||
client->GetPP().hairstyle,
|
||||
client->GetPP().face,
|
||||
client->GetPP().beard,
|
||||
client->GetPP().drakkin_heritage,
|
||||
client->GetPP().drakkin_tattoo,
|
||||
client->GetPP().drakkin_details,
|
||||
0,
|
||||
0xff, // aa title
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0, // qglobal
|
||||
0, // maxlevel
|
||||
0 // scalerate
|
||||
),
|
||||
Corpse::Corpse(Client* client, int32 in_rezexp) : Mob (
|
||||
"Unnamed_Corpse", // const char* in_name,
|
||||
"", // const char* in_lastname,
|
||||
0, // int32 in_cur_hp,
|
||||
0, // int32 in_max_hp,
|
||||
client->GetGender(), // uint8 in_gender,
|
||||
client->GetRace(), // uint16 in_race,
|
||||
client->GetClass(), // uint8 in_class,
|
||||
BT_Humanoid, // bodyType in_bodytype,
|
||||
client->GetDeity(), // uint8 in_deity,
|
||||
client->GetLevel(), // uint8 in_level,
|
||||
0, // uint32 in_npctype_id,
|
||||
client->GetSize(), // float in_size,
|
||||
0, // float in_runspeed,
|
||||
client->GetHeading(), // float in_heading,
|
||||
client->GetX(), // float in_x_pos,
|
||||
client->GetY(), // float in_y_pos,
|
||||
client->GetZ(), // float in_z_pos,
|
||||
0, // uint8 in_light,
|
||||
client->GetTexture(), // uint8 in_texture,
|
||||
client->GetHelmTexture(), // uint8 in_helmtexture,
|
||||
0, // uint16 in_ac,
|
||||
0, // uint16 in_atk,
|
||||
0, // uint16 in_str,
|
||||
0, // uint16 in_sta,
|
||||
0, // uint16 in_dex,
|
||||
0, // uint16 in_agi,
|
||||
0, // uint16 in_int,
|
||||
0, // uint16 in_wis,
|
||||
0, // uint16 in_cha,
|
||||
client->GetPP().haircolor, // uint8 in_haircolor,
|
||||
client->GetPP().beardcolor, // uint8 in_beardcolor,
|
||||
client->GetPP().eyecolor1, // uint8 in_eyecolor1, // the eyecolors always seem to be the same, maybe left and right eye?
|
||||
client->GetPP().eyecolor2, // uint8 in_eyecolor2,
|
||||
client->GetPP().hairstyle, // uint8 in_hairstyle,
|
||||
client->GetPP().face, // uint8 in_luclinface,
|
||||
client->GetPP().beard, // uint8 in_beard,
|
||||
client->GetPP().drakkin_heritage, // uint32 in_drakkin_heritage,
|
||||
client->GetPP().drakkin_tattoo, // uint32 in_drakkin_tattoo,
|
||||
client->GetPP().drakkin_details, // uint32 in_drakkin_details,
|
||||
0, // uint32 in_armor_tint[_MaterialCount],
|
||||
0xff, // uint8 in_aa_title,
|
||||
0, // uint8 in_see_invis, // see through invis
|
||||
0, // uint8 in_see_invis_undead, // see through invis vs. undead
|
||||
0, // uint8 in_see_hide,
|
||||
0, // uint8 in_see_improved_hide,
|
||||
0, // int32 in_hp_regen,
|
||||
0, // int32 in_mana_regen,
|
||||
0, // uint8 in_qglobal,
|
||||
0, // uint8 in_maxlevel,
|
||||
0 // uint32 in_scalerate
|
||||
),
|
||||
corpse_decay_timer(RuleI(Character, CorpseDecayTimeMS)),
|
||||
corpse_res_timer(RuleI(Character, CorpseResTimeMS)),
|
||||
corpse_delay_timer(RuleI(NPC, CorpseUnlockTimer)),
|
||||
corpse_graveyard_timer(RuleI(Zone, GraveyardTimeMS)),
|
||||
loot_cooldown_timer(10)
|
||||
loot_cooldown_timer(10)
|
||||
{
|
||||
int i;
|
||||
|
||||
PlayerProfile_Struct *pp = &client->GetPP();
|
||||
ItemInst *item;
|
||||
|
||||
@ -256,7 +252,7 @@ Corpse::Corpse(Client* client, int32 in_rezexp)
|
||||
}
|
||||
|
||||
memset(item_tint, 0, sizeof(item_tint));
|
||||
for (i=0; i<MAX_LOOTERS; i++)
|
||||
for (i=0; i < MAX_LOOTERS; i++)
|
||||
looters[i] = 0;
|
||||
|
||||
pIsChanged = true;
|
||||
@ -266,21 +262,23 @@ Corpse::Corpse(Client* client, int32 in_rezexp)
|
||||
pLocked = false;
|
||||
BeingLootedBy = 0xFFFFFFFF;
|
||||
charid = client->CharacterID();
|
||||
corpse_db_id = 0;
|
||||
corpse_db_id = 0;
|
||||
p_depop = false;
|
||||
copper = 0;
|
||||
silver = 0;
|
||||
gold = 0;
|
||||
platinum = 0;
|
||||
strcpy(orgname, pp->name);
|
||||
strcpy(name, pp->name);
|
||||
strcpy(name, pp->name);
|
||||
|
||||
//become_npc was not being initialized which led to some pretty funky things with newly created corpses
|
||||
become_npc = false;
|
||||
|
||||
SetPKItem(0);
|
||||
|
||||
if(!RuleB(Character, LeaveNakedCorpses) || RuleB(Character, LeaveCorpses) && GetLevel() >= RuleI(Character, DeathItemLossLevel)) {
|
||||
if(!RuleB(Character, LeaveNakedCorpses) ||
|
||||
RuleB(Character, LeaveCorpses) &&
|
||||
GetLevel() >= RuleI(Character, DeathItemLossLevel)) {
|
||||
// cash
|
||||
// Let's not move the cash when 'RespawnFromHover = true' && 'client->GetClientVersion() < EQClientSoF' since the client doesn't.
|
||||
// (change to first client that supports 'death hover' mode, if not SoF.)
|
||||
@ -301,8 +299,7 @@ Corpse::Corpse(Client* client, int32 in_rezexp)
|
||||
// worn + inventory + cursor
|
||||
std::list<uint32> removed_list;
|
||||
bool cursor = false;
|
||||
for(i = MAIN_BEGIN; i < EmuConstants::MAP_POSSESSIONS_SIZE; i++)
|
||||
{
|
||||
for(i = MAIN_BEGIN; i < EmuConstants::MAP_POSSESSIONS_SIZE; i++) {
|
||||
if(i == MainAmmo && client->GetClientVersion() >= EQClientSoF) {
|
||||
item = client->GetInv().GetItem(MainPowerSource);
|
||||
if((item && (!client->IsBecomeNPC())) || (item && client->IsBecomeNPC() && !item->GetItem()->NoRent)) {
|
||||
@ -492,7 +489,11 @@ bool Corpse::Save() {
|
||||
return true;
|
||||
|
||||
uint32 tmp = this->CountItems();
|
||||
uint32 tmpsize = sizeof(PlayerCorpse_Struct)+(tmp * sizeof(player_lootitem::ServerLootItem_Struct));
|
||||
uint32 tmpsize = sizeof(PlayerCorpse_Struct) + (tmp * sizeof(player_lootitem::ServerLootItem_Struct));
|
||||
|
||||
std::cout << "tmp: " << tmp << std::endl;
|
||||
std::cout << "tmpsize: " << tmpsize << std::endl;
|
||||
|
||||
PlayerCorpse_Struct* dbpc = (PlayerCorpse_Struct*) new uchar[tmpsize];
|
||||
memset(dbpc, 0, tmpsize);
|
||||
dbpc->itemcount = tmp;
|
||||
@ -522,14 +523,17 @@ bool Corpse::Save() {
|
||||
dbpc->drakkin_tattoo = drakkin_tattoo;
|
||||
dbpc->drakkin_details = drakkin_details;
|
||||
|
||||
std::cout << "SLI1: " << sizeof(player_lootitem::ServerLootItem_Struct) << std::endl;
|
||||
std::cout << "SLI2: " << sizeof(ServerLootItem_Struct) << std::endl;
|
||||
|
||||
uint32 x = 0;
|
||||
ItemList::iterator cur, end;
|
||||
cur = itemlist.begin();
|
||||
end = itemlist.end();
|
||||
for (; cur != end; ++cur) {
|
||||
for (; cur != end; ++cur) {
|
||||
ServerLootItem_Struct* item = *cur;
|
||||
item->equipSlot = ServerToCorpseSlot(item->equipSlot); // temp hack until corpse blobs are removed
|
||||
memcpy((char*)&dbpc->items[x++], (char*)item, sizeof(player_lootitem::ServerLootItem_Struct));
|
||||
item->equip_slot = ServerToCorpseSlot(item->equip_slot); // temp hack until corpse blobs are removed
|
||||
memcpy((char*)&dbpc->items[x++], (char*)item, sizeof(ServerLootItem_Struct));
|
||||
}
|
||||
|
||||
if (corpse_db_id == 0) {
|
||||
@ -539,6 +543,8 @@ bool Corpse::Save() {
|
||||
corpse_db_id = database.UpdateCharacterCorpse(corpse_db_id, charid, orgname, zone->GetZoneID(), zone->GetInstanceID(), dbpc, x_pos, y_pos, z_pos, heading, IsRezzed());
|
||||
}
|
||||
|
||||
safe_delete_array(dbpc);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -579,12 +585,12 @@ void Corpse::AddItem(uint32 itemnum, uint16 charges, int16 slot, uint32 aug1, ui
|
||||
memset(item, 0, sizeof(ServerLootItem_Struct));
|
||||
item->item_id = itemnum;
|
||||
item->charges = charges;
|
||||
item->equipSlot = slot;
|
||||
item->aug1=aug1;
|
||||
item->aug2=aug2;
|
||||
item->aug3=aug3;
|
||||
item->aug4=aug4;
|
||||
item->aug5=aug5;
|
||||
item->equip_slot = slot;
|
||||
item->aug_1=aug1;
|
||||
item->aug_2=aug2;
|
||||
item->aug_3=aug3;
|
||||
item->aug_4=aug4;
|
||||
item->aug_5=aug5;
|
||||
itemlist.push_back(item);
|
||||
}
|
||||
|
||||
@ -603,17 +609,17 @@ ServerLootItem_Struct* Corpse::GetItem(uint16 lootslot, ServerLootItem_Struct**
|
||||
}
|
||||
}
|
||||
|
||||
if (sitem && bag_item_data && Inventory::SupportsContainers(sitem->equipSlot))
|
||||
if (sitem && bag_item_data && Inventory::SupportsContainers(sitem->equip_slot))
|
||||
{
|
||||
int16 bagstart = Inventory::CalcSlotId(sitem->equipSlot, SUB_BEGIN);
|
||||
int16 bagstart = Inventory::CalcSlotId(sitem->equip_slot, SUB_BEGIN);
|
||||
|
||||
cur = itemlist.begin();
|
||||
end = itemlist.end();
|
||||
for(; cur != end; ++cur) {
|
||||
sitem2 = *cur;
|
||||
if(sitem2->equipSlot >= bagstart && sitem2->equipSlot < bagstart + 10)
|
||||
if(sitem2->equip_slot >= bagstart && sitem2->equip_slot < bagstart + 10)
|
||||
{
|
||||
bag_item_data[sitem2->equipSlot - bagstart] = sitem2;
|
||||
bag_item_data[sitem2->equip_slot - bagstart] = sitem2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -627,7 +633,7 @@ uint32 Corpse::GetWornItem(int16 equipSlot) const {
|
||||
end = itemlist.end();
|
||||
for(; cur != end; ++cur) {
|
||||
ServerLootItem_Struct* item = *cur;
|
||||
if (item->equipSlot == equipSlot)
|
||||
if (item->equip_slot == equipSlot)
|
||||
{
|
||||
return item->item_id;
|
||||
}
|
||||
@ -665,7 +671,7 @@ void Corpse::RemoveItem(ServerLootItem_Struct* item_data){
|
||||
pIsChanged = true;
|
||||
itemlist.erase(cur);
|
||||
|
||||
material = Inventory::CalcMaterialFromSlot(sitem->equipSlot);
|
||||
material = Inventory::CalcMaterialFromSlot(sitem->equip_slot);
|
||||
if(material != _MaterialInvalid)
|
||||
SendWearChange(material);
|
||||
|
||||
@ -924,12 +930,12 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
|
||||
// Dont display the item if it's in a bag
|
||||
|
||||
// Added cursor queue slots to corpse item visibility list. Nothing else should be making it to corpse.
|
||||
if(!IsPlayerCorpse() || item_data->equipSlot <= MainCursor || item_data->equipSlot == MainPowerSource || tCanLoot>=3 ||
|
||||
(item_data->equipSlot >= 8000 && item_data->equipSlot <= 8999)) {
|
||||
if(!IsPlayerCorpse() || item_data->equip_slot <= MainCursor || item_data->equip_slot == MainPowerSource || tCanLoot>=3 ||
|
||||
(item_data->equip_slot >= 8000 && item_data->equip_slot <= 8999)) {
|
||||
if(i < corpselootlimit) {
|
||||
item = database.GetItem(item_data->item_id);
|
||||
if(client && item) {
|
||||
ItemInst* inst = database.CreateItem(item, item_data->charges, item_data->aug1, item_data->aug2, item_data->aug3, item_data->aug4, item_data->aug5);
|
||||
ItemInst* inst = database.CreateItem(item, item_data->charges, item_data->aug_1, item_data->aug_2, item_data->aug_3, item_data->aug_4, item_data->aug_5);
|
||||
if(inst) {
|
||||
// MainGeneral1 is the corpse inventory start offset for Ti(EMu) - CORPSE_END = MainGeneral1 + MainCursor
|
||||
client->SendItemPacket(i + EmuConstants::CORPSE_BEGIN, inst, ItemPacketLoot);
|
||||
@ -1046,7 +1052,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app)
|
||||
if (item != 0)
|
||||
{
|
||||
if(item_data)
|
||||
inst = database.CreateItem(item, item_data?item_data->charges:0, item_data->aug1, item_data->aug2, item_data->aug3, item_data->aug4, item_data->aug5);
|
||||
inst = database.CreateItem(item, item_data?item_data->charges:0, item_data->aug_1, item_data->aug_2, item_data->aug_3, item_data->aug_4, item_data->aug_5);
|
||||
else
|
||||
inst = database.CreateItem(item);
|
||||
}
|
||||
@ -1257,7 +1263,7 @@ void Corpse::QueryLoot(Client* to) {
|
||||
ServerLootItem_Struct* sitem = *cur;
|
||||
|
||||
if (IsPlayerCorpse()) {
|
||||
if (sitem->equipSlot >= EmuConstants::GENERAL_BAGS_BEGIN && sitem->equipSlot <= EmuConstants::CURSOR_BAG_END)
|
||||
if (sitem->equip_slot >= EmuConstants::GENERAL_BAGS_BEGIN && sitem->equip_slot <= EmuConstants::CURSOR_BAG_END)
|
||||
sitem->lootslot = 0xFFFF;
|
||||
else
|
||||
x < corpselootlimit ? sitem->lootslot = x : sitem->lootslot = 0xFFFF;
|
||||
@ -1265,7 +1271,7 @@ void Corpse::QueryLoot(Client* to) {
|
||||
const Item_Struct* item = database.GetItem(sitem->item_id);
|
||||
|
||||
if (item)
|
||||
to->Message((sitem->lootslot == 0xFFFF), "LootSlot: %i (EquipSlot: %i) Item: %s (%d), Count: %i", static_cast<int16>(sitem->lootslot), sitem->equipSlot, item->Name, item->ID, sitem->charges);
|
||||
to->Message((sitem->lootslot == 0xFFFF), "LootSlot: %i (EquipSlot: %i) Item: %s (%d), Count: %i", static_cast<int16>(sitem->lootslot), sitem->equip_slot, item->Name, item->ID, sitem->charges);
|
||||
else
|
||||
to->Message((sitem->lootslot == 0xFFFF), "Error: 0x%04x", sitem->item_id);
|
||||
|
||||
|
||||
@ -858,7 +858,7 @@ void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootI
|
||||
{
|
||||
if(bag_item_data[i] == nullptr)
|
||||
continue;
|
||||
const ItemInst *bagitem = database.CreateItem(bag_item_data[i]->item_id, bag_item_data[i]->charges, bag_item_data[i]->aug1, bag_item_data[i]->aug2, bag_item_data[i]->aug3, bag_item_data[i]->aug4, bag_item_data[i]->aug5);
|
||||
const ItemInst *bagitem = database.CreateItem(bag_item_data[i]->item_id, bag_item_data[i]->charges, bag_item_data[i]->aug_1, bag_item_data[i]->aug_2, bag_item_data[i]->aug_3, bag_item_data[i]->aug_4, bag_item_data[i]->aug_5);
|
||||
interior_slot = Inventory::CalcSlotId(slot_id, i);
|
||||
mlog(INVENTORY__SLOTS, "Putting bag loot item %s (%d) into slot %d (bag slot %d)", inst.GetItem()->Name, inst.GetItem()->ID, interior_slot, i);
|
||||
PutLootInInventory(interior_slot, *bagitem);
|
||||
|
||||
@ -195,13 +195,13 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
|
||||
|
||||
item->item_id = item2->ID;
|
||||
item->charges = charges;
|
||||
item->aug1 = 0;
|
||||
item->aug2 = 0;
|
||||
item->aug3 = 0;
|
||||
item->aug4 = 0;
|
||||
item->aug5 = 0;
|
||||
item->minlevel = minlevel;
|
||||
item->maxlevel = maxlevel;
|
||||
item->aug_1 = 0;
|
||||
item->aug_2 = 0;
|
||||
item->aug_3 = 0;
|
||||
item->aug_4 = 0;
|
||||
item->aug_5 = 0;
|
||||
item->min_level = minlevel;
|
||||
item->max_level = maxlevel;
|
||||
if (equipit) {
|
||||
uint8 eslot = 0xFF;
|
||||
char newid[20];
|
||||
@ -339,7 +339,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
|
||||
if (found) {
|
||||
CalcBonuses(); // This is less than ideal for bulk adding of items
|
||||
}
|
||||
item->equipSlot = item2->Slots;
|
||||
item->equip_slot = item2->Slots;
|
||||
}
|
||||
|
||||
if(itemlist != nullptr)
|
||||
|
||||
14
zone/npc.cpp
14
zone/npc.cpp
@ -429,7 +429,7 @@ ServerLootItem_Struct* NPC::GetItem(int slot_id) {
|
||||
end = itemlist.end();
|
||||
for(; cur != end; ++cur) {
|
||||
ServerLootItem_Struct* item = *cur;
|
||||
if (item->equipSlot == slot_id) {
|
||||
if (item->equip_slot == slot_id) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
@ -446,7 +446,7 @@ void NPC::RemoveItem(uint32 item_id, uint16 quantity, uint16 slot) {
|
||||
itemlist.erase(cur);
|
||||
return;
|
||||
}
|
||||
else if (item->item_id == item_id && item->equipSlot == slot && quantity >= 1) {
|
||||
else if (item->item_id == item_id && item->equip_slot == slot && quantity >= 1) {
|
||||
//std::cout<<"NPC::RemoveItem"<<" equipSlot:"<<iterator.GetData()->equipSlot<<" quantity:"<< quantity<<std::endl; // iterator undefined [CODEBUG]
|
||||
if (item->charges <= quantity)
|
||||
itemlist.erase(cur);
|
||||
@ -471,9 +471,9 @@ void NPC::CheckMinMaxLevel(Mob *them)
|
||||
if(!(*cur))
|
||||
return;
|
||||
|
||||
if(themlevel < (*cur)->minlevel || themlevel > (*cur)->maxlevel)
|
||||
if(themlevel < (*cur)->min_level || themlevel > (*cur)->max_level)
|
||||
{
|
||||
material = Inventory::CalcMaterialFromSlot((*cur)->equipSlot);
|
||||
material = Inventory::CalcMaterialFromSlot((*cur)->equip_slot);
|
||||
if(material != 0xFF)
|
||||
SendWearChange(material);
|
||||
|
||||
@ -508,15 +508,15 @@ void NPC::QueryLoot(Client* to) {
|
||||
if (item)
|
||||
if (to->GetClientVersion() >= EQClientRoF)
|
||||
{
|
||||
to->Message(0, "minlvl: %i maxlvl: %i %i: %c%06X0000000000000000000000000000000000000000000000000%s%c",(*cur)->minlevel, (*cur)->maxlevel, (int) item->ID,0x12, item->ID, item->Name, 0x12);
|
||||
to->Message(0, "minlvl: %i maxlvl: %i %i: %c%06X0000000000000000000000000000000000000000000000000%s%c",(*cur)->min_level, (*cur)->max_level, (int) item->ID,0x12, item->ID, item->Name, 0x12);
|
||||
}
|
||||
else if (to->GetClientVersion() >= EQClientSoF)
|
||||
{
|
||||
to->Message(0, "minlvl: %i maxlvl: %i %i: %c%06X00000000000000000000000000000000000000000000%s%c",(*cur)->minlevel, (*cur)->maxlevel, (int) item->ID,0x12, item->ID, item->Name, 0x12);
|
||||
to->Message(0, "minlvl: %i maxlvl: %i %i: %c%06X00000000000000000000000000000000000000000000%s%c",(*cur)->min_level, (*cur)->max_level, (int) item->ID,0x12, item->ID, item->Name, 0x12);
|
||||
}
|
||||
else
|
||||
{
|
||||
to->Message(0, "minlvl: %i maxlvl: %i %i: %c%06X000000000000000000000000000000000000000%s%c",(*cur)->minlevel, (*cur)->maxlevel, (int) item->ID,0x12, item->ID, item->Name, 0x12);
|
||||
to->Message(0, "minlvl: %i maxlvl: %i %i: %c%06X000000000000000000000000000000000000000%s%c",(*cur)->min_level, (*cur)->max_level, (int) item->ID,0x12, item->ID, item->Name, 0x12);
|
||||
}
|
||||
else
|
||||
LogFile->write(EQEMuLog::Error, "Database error, invalid item");
|
||||
|
||||
@ -3858,20 +3858,24 @@ bool ZoneDatabase::LoadCharacterCorpseData(uint32 corpse_id, PlayerCorpse_Struct
|
||||
);
|
||||
results = QueryDatabase(query);
|
||||
i = 0;
|
||||
|
||||
pcs->itemcount = results.RowCount();
|
||||
uint16 r = 0;
|
||||
// Allocate memory for items.
|
||||
pcs->items = reinterpret_cast<player_lootitem::ServerLootItem_Struct*>(new char[pcs->itemcount * sizeof(player_lootitem::ServerLootItem_Struct)]);
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
pcs->items[i].equip_slot = atoi(row[r]); r++; // equip_slot,
|
||||
pcs->items[i].item_id = atoi(row[r]); r++; // item_id,
|
||||
pcs->items[i].charges = atoi(row[r]); r++; // charges,
|
||||
pcs->items[i].aug_1 = atoi(row[r]); r++; // aug_1,
|
||||
pcs->items[i].aug_2 = atoi(row[r]); r++; // aug_2,
|
||||
pcs->items[i].aug_3 = atoi(row[r]); r++; // aug_3,
|
||||
pcs->items[i].aug_4 = atoi(row[r]); r++; // aug_4,
|
||||
pcs->items[i].aug_5 = atoi(row[r]); r++; // aug_5,
|
||||
r = 0;
|
||||
pcs->items[i].item_id = atoi(row[r]); r++; // item_id,
|
||||
pcs->items[i].charges = atoi(row[r]); r++; // charges,
|
||||
pcs->items[i].aug_1 = atoi(row[r]); r++; // aug_1,
|
||||
pcs->items[i].aug_2 = atoi(row[r]); r++; // aug_2,
|
||||
pcs->items[i].aug_3 = atoi(row[r]); r++; // aug_3,
|
||||
pcs->items[i].aug_4 = atoi(row[r]); r++; // aug_4,
|
||||
pcs->items[i].aug_5 = atoi(row[r]); r++; // aug_5,
|
||||
r = 0;
|
||||
i++;
|
||||
}
|
||||
pcs->itemcount = i;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -139,6 +139,8 @@ namespace player_lootitem {
|
||||
uint32 aug_3;
|
||||
uint32 aug_4;
|
||||
uint32 aug_5;
|
||||
uint8 min_level; //
|
||||
uint8 max_level; //
|
||||
};
|
||||
}
|
||||
|
||||
@ -170,7 +172,8 @@ struct PlayerCorpse_Struct {
|
||||
uint32 drakkin_heritage;
|
||||
uint32 drakkin_tattoo;
|
||||
uint32 drakkin_details;
|
||||
player_lootitem::ServerLootItem_Struct items[0];
|
||||
player_lootitem::ServerLootItem_Struct* items[0];
|
||||
//std::list<player_lootitem::ServerLootItem_Struct*> items;
|
||||
};
|
||||
|
||||
struct Door {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user