mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
Lootdrop level filtering adjustments
This commit is contained in:
+14
-12
@@ -5341,18 +5341,20 @@ struct MercenaryMerchantResponse_Struct {
|
||||
|
||||
struct ServerLootItem_Struct {
|
||||
uint32 item_id; // uint32 item_id;
|
||||
int16 equip_slot; // int16 equip_slot;
|
||||
uint16 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;
|
||||
uint32 aug_6; // uint32 aug_5;
|
||||
uint8 attuned;
|
||||
uint8 min_level;
|
||||
uint8 max_level;
|
||||
int16 equip_slot; // int16 equip_slot;
|
||||
uint16 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;
|
||||
uint32 aug_6; // uint32 aug_5;
|
||||
uint8 attuned;
|
||||
uint16 trivial_min_level;
|
||||
uint16 trivial_max_level;
|
||||
uint16 npc_min_level;
|
||||
uint16 npc_max_level;
|
||||
};
|
||||
|
||||
//Found in client near a ref to the string:
|
||||
|
||||
@@ -117,6 +117,7 @@ namespace Logs {
|
||||
HotReload,
|
||||
Merchants,
|
||||
ZonePoints,
|
||||
Loot,
|
||||
MaxCategoryID /* Don't Remove this */
|
||||
};
|
||||
|
||||
@@ -192,7 +193,8 @@ namespace Logs {
|
||||
"Aura",
|
||||
"HotReload",
|
||||
"Merchants",
|
||||
"ZonePoints"
|
||||
"ZonePoints",
|
||||
"Loot"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -591,6 +591,16 @@
|
||||
OutF(LogSys, Logs::Detail, Logs::ZonePoints, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogLoot(message, ...) do {\
|
||||
if (LogSys.log_settings[Logs::Loot].is_category_enabled == 1)\
|
||||
OutF(LogSys, Logs::General, Logs::Loot, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogLootDetail(message, ...) do {\
|
||||
if (LogSys.log_settings[Logs::Loot].is_category_enabled == 1)\
|
||||
OutF(LogSys, Logs::Detail, Logs::Loot, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define Log(debug_level, log_category, message, ...) do {\
|
||||
if (LogSys.log_settings[log_category].is_category_enabled == 1)\
|
||||
LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
|
||||
+9
-7
@@ -39,13 +39,15 @@ struct LootTable_Struct {
|
||||
};
|
||||
|
||||
struct LootDropEntries_Struct {
|
||||
uint32 item_id;
|
||||
int8 item_charges;
|
||||
uint8 equip_item;
|
||||
float chance;
|
||||
uint8 minlevel;
|
||||
uint8 maxlevel;
|
||||
uint8 multiplier;
|
||||
uint32 item_id;
|
||||
int8 item_charges;
|
||||
uint8 equip_item;
|
||||
float chance;
|
||||
uint16 trivial_min_level;
|
||||
uint16 trivial_max_level;
|
||||
uint16 npc_min_level;
|
||||
uint16 npc_max_level;
|
||||
uint8 multiplier;
|
||||
};
|
||||
|
||||
struct LootDrop_Struct {
|
||||
|
||||
+36
-27
@@ -2142,7 +2142,7 @@ void SharedDatabase::LoadLootDrops(void *data, uint32 size) {
|
||||
|
||||
EQ::FixedMemoryVariableHashSet<LootDrop_Struct> hash(reinterpret_cast<uint8*>(data), size);
|
||||
uint8 loot_drop[sizeof(LootDrop_Struct) + (sizeof(LootDropEntries_Struct) * 1260)];
|
||||
LootDrop_Struct *ld = reinterpret_cast<LootDrop_Struct*>(loot_drop);
|
||||
LootDrop_Struct *p_loot_drop_struct = reinterpret_cast<LootDrop_Struct*>(loot_drop);
|
||||
|
||||
const std::string query = fmt::format(
|
||||
SQL(
|
||||
@@ -2152,8 +2152,10 @@ void SharedDatabase::LoadLootDrops(void *data, uint32 size) {
|
||||
lootdrop_entries.item_charges,
|
||||
lootdrop_entries.equip_item,
|
||||
lootdrop_entries.chance,
|
||||
lootdrop_entries.minlevel,
|
||||
lootdrop_entries.maxlevel,
|
||||
lootdrop_entries.trivial_min_level,
|
||||
lootdrop_entries.trivial_max_level,
|
||||
lootdrop_entries.npc_min_level,
|
||||
lootdrop_entries.npc_max_level,
|
||||
lootdrop_entries.multiplier
|
||||
FROM
|
||||
lootdrop
|
||||
@@ -2171,37 +2173,44 @@ void SharedDatabase::LoadLootDrops(void *data, uint32 size) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 current_id = 0;
|
||||
uint32 current_entry = 0;
|
||||
uint32 current_id = 0;
|
||||
uint32 current_entry = 0;
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
uint32 id = static_cast<uint32>(atoul(row[0]));
|
||||
if(id != current_id) {
|
||||
if(current_id != 0)
|
||||
hash.insert(current_id, loot_drop, (sizeof(LootDrop_Struct) +(sizeof(LootDropEntries_Struct) * ld->NumEntries)));
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
auto id = static_cast<uint32>(atoul(row[0]));
|
||||
if (id != current_id) {
|
||||
if (current_id != 0) {
|
||||
hash.insert(
|
||||
current_id,
|
||||
loot_drop,
|
||||
(sizeof(LootDrop_Struct) + (sizeof(LootDropEntries_Struct) * p_loot_drop_struct->NumEntries)));
|
||||
}
|
||||
|
||||
memset(loot_drop, 0, sizeof(LootDrop_Struct) + (sizeof(LootDropEntries_Struct) * 1260));
|
||||
memset(loot_drop, 0, sizeof(LootDrop_Struct) + (sizeof(LootDropEntries_Struct) * 1260));
|
||||
current_entry = 0;
|
||||
current_id = id;
|
||||
}
|
||||
current_id = id;
|
||||
}
|
||||
|
||||
if(current_entry >= 1260)
|
||||
continue;
|
||||
if (current_entry >= 1260) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ld->Entries[current_entry].item_id = static_cast<uint32>(atoul(row[1]));
|
||||
ld->Entries[current_entry].item_charges = static_cast<int8>(atoi(row[2]));
|
||||
ld->Entries[current_entry].equip_item = static_cast<uint8>(atoi(row[3]));
|
||||
ld->Entries[current_entry].chance = static_cast<float>(atof(row[4]));
|
||||
ld->Entries[current_entry].minlevel = static_cast<uint8>(atoi(row[5]));
|
||||
ld->Entries[current_entry].maxlevel = static_cast<uint8>(atoi(row[6]));
|
||||
ld->Entries[current_entry].multiplier = static_cast<uint8>(atoi(row[7]));
|
||||
p_loot_drop_struct->Entries[current_entry].item_id = static_cast<uint32>(atoul(row[1]));
|
||||
p_loot_drop_struct->Entries[current_entry].item_charges = static_cast<int8>(atoi(row[2]));
|
||||
p_loot_drop_struct->Entries[current_entry].equip_item = static_cast<uint8>(atoi(row[3]));
|
||||
p_loot_drop_struct->Entries[current_entry].chance = static_cast<float>(atof(row[4]));
|
||||
p_loot_drop_struct->Entries[current_entry].trivial_min_level = static_cast<uint16>(atoi(row[5]));
|
||||
p_loot_drop_struct->Entries[current_entry].trivial_max_level = static_cast<uint16>(atoi(row[6]));
|
||||
p_loot_drop_struct->Entries[current_entry].npc_min_level = static_cast<uint16>(atoi(row[7]));
|
||||
p_loot_drop_struct->Entries[current_entry].npc_max_level = static_cast<uint16>(atoi(row[8]));
|
||||
p_loot_drop_struct->Entries[current_entry].multiplier = static_cast<uint8>(atoi(row[9]));
|
||||
|
||||
++(ld->NumEntries);
|
||||
++current_entry;
|
||||
}
|
||||
++(p_loot_drop_struct->NumEntries);
|
||||
++current_entry;
|
||||
}
|
||||
|
||||
if(current_id != 0)
|
||||
hash.insert(current_id, loot_drop, (sizeof(LootDrop_Struct) + (sizeof(LootDropEntries_Struct) * ld->NumEntries)));
|
||||
if(current_id != 0)
|
||||
hash.insert(current_id, loot_drop, (sizeof(LootDrop_Struct) + (sizeof(LootDropEntries_Struct) * p_loot_drop_struct->NumEntries)));
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
||||
*/
|
||||
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9154
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9155
|
||||
|
||||
#ifdef BOTS
|
||||
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9027
|
||||
|
||||
Reference in New Issue
Block a user