mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-06 13:33:52 +00:00
[Bug Fix] Fix NPC Item Stat Bonuses (#3444)
* [Bug Fix] Fix NPC Item Stat Bonuses # Notes - Due to https://github.com/EQEmu/Server/pull/3136 NPCs/Mercs were not receiving stat bonuses from their items, this fixes that. * Update npc.h * Changes. * Cleanup * Cleanup * Update loottables.cpp * Update npc.cpp * Update loottables.cpp
This commit is contained in:
parent
8d986c95cd
commit
a004924112
@ -146,7 +146,8 @@ void Mob::CalcItemBonuses(StatBonuses* b) {
|
||||
int16 i;
|
||||
|
||||
for (i = EQ::invslot::BONUS_BEGIN; i <= EQ::invslot::BONUS_SKILL_END; i++) {
|
||||
const EQ::ItemInstance* inst = GetInv().GetItem(i);
|
||||
const auto* inst = GetInv().GetItem(i);
|
||||
|
||||
if (!inst) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -363,11 +363,23 @@ void NPC::AddLootDrop(
|
||||
|
||||
bool found = false; // track if we found an empty slot we fit into
|
||||
|
||||
int foundslot = -1; // for multi-slot items
|
||||
|
||||
const auto* inst = database.CreateItem(
|
||||
item2->ID,
|
||||
loot_drop.item_charges,
|
||||
aug1,
|
||||
aug2,
|
||||
aug3,
|
||||
aug4,
|
||||
aug5,
|
||||
aug6
|
||||
);
|
||||
|
||||
if (loot_drop.equip_item > 0) {
|
||||
uint8 eslot = 0xFF;
|
||||
char newid[20];
|
||||
const EQ::ItemData* compitem = nullptr;
|
||||
int32 foundslot = -1; // for multi-slot items
|
||||
|
||||
// Equip rules are as follows:
|
||||
// If the item has the NoPet flag set it will not be equipped.
|
||||
@ -511,10 +523,12 @@ void NPC::AddLootDrop(
|
||||
}
|
||||
}
|
||||
|
||||
if (itemlist != nullptr) {
|
||||
if (itemlist) {
|
||||
GetInv().PutItem(foundslot, *inst);
|
||||
itemlist->push_back(item);
|
||||
} else {
|
||||
safe_delete(item);
|
||||
}
|
||||
else safe_delete(item);
|
||||
|
||||
if (found) {
|
||||
CalcBonuses();
|
||||
|
||||
@ -441,6 +441,8 @@ NPC::NPC(const NPCType *npc_type_data, Spawn2 *in_respawn, const glm::vec4 &posi
|
||||
m_can_open_doors = false;
|
||||
}
|
||||
|
||||
GetInv().SetInventoryVersion(EQ::versions::MobVersion::RoF2);
|
||||
GetInv().SetGMInventory(false);
|
||||
}
|
||||
|
||||
float NPC::GetRoamboxMaxX() const
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user