mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
[Quest API] Add EVENT_LOOT_ADDED to Perl/Lua (#3739)
* [Quest API] Add EVENT_ADDED_LOOT to Perl/Lua # Perl - Add `EVENT_ADDED_LOOT`. - Exports `$item`, `$item_id`, `$item_name`, `$item_charges`, `$augment_one`, `$augment_two`, `$augment_three`, `$augment_four`, `$augment_five`, and `$augment_six`. # Lua - Add `event_added_loot`. - Exports `e.item`, `e.item_id`, `e.item_name`, `e.item_charges`, `e.augment_one`, `e.augment_two`, `e.augment_three`, `e.augment_four`, `e.augment_five`, and `e.augment_six`. # Notes - Allows operators to perform events when loot is added to an NPC, such as removing the loot or keeping track of it. * Update lua_parser_events.cpp * Rename event. * loot_added * AddItem changese
This commit is contained in:
parent
9c238cd08d
commit
c1b07afae9
@ -186,6 +186,7 @@ const char *QuestEventSubroutines[_LargestEventID] = {
|
|||||||
"EVENT_UNMEMORIZE_SPELL",
|
"EVENT_UNMEMORIZE_SPELL",
|
||||||
"EVENT_SCRIBE_SPELL",
|
"EVENT_SCRIBE_SPELL",
|
||||||
"EVENT_UNSCRIBE_SPELL",
|
"EVENT_UNSCRIBE_SPELL",
|
||||||
|
"EVENT_LOOT_ADDED",
|
||||||
// Add new events before these or Lua crashes
|
// Add new events before these or Lua crashes
|
||||||
"EVENT_SPELL_EFFECT_BOT",
|
"EVENT_SPELL_EFFECT_BOT",
|
||||||
"EVENT_SPELL_EFFECT_BUFF_TIC_BOT"
|
"EVENT_SPELL_EFFECT_BUFF_TIC_BOT"
|
||||||
@ -2241,6 +2242,26 @@ void PerlembParser::ExportEventVariables(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case EVENT_LOOT_ADDED: {
|
||||||
|
if (extra_pointers && extra_pointers->size() == 1) {
|
||||||
|
auto *inst = std::any_cast<EQ::ItemInstance *>(extra_pointers->at(0));
|
||||||
|
if (inst) {
|
||||||
|
ExportVar(package_name.c_str(), "item", "QuestItem", inst);
|
||||||
|
ExportVar(package_name.c_str(), "item_id", inst->GetID());
|
||||||
|
ExportVar(package_name.c_str(), "item_name", inst->GetItem()->Name);
|
||||||
|
ExportVar(package_name.c_str(), "item_charges", inst->GetCharges());
|
||||||
|
ExportVar(package_name.c_str(), "augment_one", inst->GetAugmentItemID(EQ::invaug::SOCKET_BEGIN));
|
||||||
|
ExportVar(package_name.c_str(), "augment_two", inst->GetAugmentItemID(EQ::invaug::SOCKET_BEGIN + 1));
|
||||||
|
ExportVar(package_name.c_str(), "augment_three", inst->GetAugmentItemID(EQ::invaug::SOCKET_BEGIN + 2));
|
||||||
|
ExportVar(package_name.c_str(), "augment_four", inst->GetAugmentItemID(EQ::invaug::SOCKET_BEGIN + 3));
|
||||||
|
ExportVar(package_name.c_str(), "augment_five", inst->GetAugmentItemID(EQ::invaug::SOCKET_BEGIN + 4));
|
||||||
|
ExportVar(package_name.c_str(), "augment_six", inst->GetAugmentItemID(EQ::invaug::SOCKET_END));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -128,6 +128,7 @@ typedef enum {
|
|||||||
EVENT_UNMEMORIZE_SPELL,
|
EVENT_UNMEMORIZE_SPELL,
|
||||||
EVENT_SCRIBE_SPELL,
|
EVENT_SCRIBE_SPELL,
|
||||||
EVENT_UNSCRIBE_SPELL,
|
EVENT_UNSCRIBE_SPELL,
|
||||||
|
EVENT_LOOT_ADDED,
|
||||||
// Add new events before these or Lua crashes
|
// Add new events before these or Lua crashes
|
||||||
EVENT_SPELL_EFFECT_BOT,
|
EVENT_SPELL_EFFECT_BOT,
|
||||||
EVENT_SPELL_EFFECT_BUFF_TIC_BOT,
|
EVENT_SPELL_EFFECT_BUFF_TIC_BOT,
|
||||||
|
|||||||
@ -27,24 +27,37 @@
|
|||||||
#include "zonedb.h"
|
#include "zonedb.h"
|
||||||
#include "global_loot_manager.h"
|
#include "global_loot_manager.h"
|
||||||
#include "../common/repositories/criteria/content_filter_criteria.h"
|
#include "../common/repositories/criteria/content_filter_criteria.h"
|
||||||
|
#include "quest_parser_collection.h"
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Queries the loottable: adds item & coin to the npc
|
// Queries the loottable: adds item & coin to the npc
|
||||||
void ZoneDatabase::AddLootTableToNPC(NPC* npc, uint32 loottable_id, ItemList* itemlist, uint32* copper, uint32* silver, uint32* gold, uint32* plat) {
|
void ZoneDatabase::AddLootTableToNPC(
|
||||||
const LootTable_Struct* lts = nullptr;
|
NPC *npc,
|
||||||
// global loot passes nullptr for these
|
uint32 loottable_id,
|
||||||
bool bGlobal = copper == nullptr && silver == nullptr && gold == nullptr && plat == nullptr;
|
ItemList *itemlist,
|
||||||
if (!bGlobal) {
|
uint32 *copper,
|
||||||
|
uint32 *silver,
|
||||||
|
uint32 *gold,
|
||||||
|
uint32 *plat
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const bool is_global = (
|
||||||
|
copper == nullptr &&
|
||||||
|
silver == nullptr &&
|
||||||
|
gold == nullptr &&
|
||||||
|
plat == nullptr
|
||||||
|
);
|
||||||
|
if (!is_global) {
|
||||||
*copper = 0;
|
*copper = 0;
|
||||||
*silver = 0;
|
*silver = 0;
|
||||||
*gold = 0;
|
*gold = 0;
|
||||||
*plat = 0;
|
*plat = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
lts = database.GetLootTable(loottable_id);
|
const auto *lts = database.GetLootTable(loottable_id);
|
||||||
if (!lts) {
|
if (!lts) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -55,19 +68,23 @@ void ZoneDatabase::AddLootTableToNPC(NPC* npc, uint32 loottable_id, ItemList* it
|
|||||||
|
|
||||||
uint32 min_cash = lts->mincash;
|
uint32 min_cash = lts->mincash;
|
||||||
uint32 max_cash = lts->maxcash;
|
uint32 max_cash = lts->maxcash;
|
||||||
if(min_cash > max_cash) {
|
if (min_cash > max_cash) {
|
||||||
uint32 t = min_cash;
|
const uint32 t = min_cash;
|
||||||
min_cash = max_cash;
|
min_cash = max_cash;
|
||||||
max_cash = t;
|
max_cash = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 cash = 0;
|
uint32 cash = 0;
|
||||||
if (!bGlobal) {
|
if (!is_global) {
|
||||||
if(max_cash > 0 && lts->avgcoin > 0 && EQ::ValueWithin(lts->avgcoin, min_cash, max_cash)) {
|
if (
|
||||||
float upper_chance = (float)(lts->avgcoin - min_cash) / (float)(max_cash - min_cash);
|
max_cash > 0 &&
|
||||||
float avg_cash_roll = (float)zone->random.Real(0.0, 1.0);
|
lts->avgcoin > 0 &&
|
||||||
|
EQ::ValueWithin(lts->avgcoin, min_cash, max_cash)
|
||||||
|
) {
|
||||||
|
const float upper_chance = static_cast<float>(lts->avgcoin - min_cash) / static_cast<float>(max_cash - min_cash);
|
||||||
|
const float avg_cash_roll = static_cast<float>(zone->random.Real(0.0, 1.0));
|
||||||
|
|
||||||
if(avg_cash_roll < upper_chance) {
|
if (avg_cash_roll < upper_chance) {
|
||||||
cash = zone->random.Int(lts->avgcoin, max_cash);
|
cash = zone->random.Int(lts->avgcoin, max_cash);
|
||||||
} else {
|
} else {
|
||||||
cash = zone->random.Int(min_cash, lts->avgcoin);
|
cash = zone->random.Int(min_cash, lts->avgcoin);
|
||||||
@ -77,7 +94,7 @@ void ZoneDatabase::AddLootTableToNPC(NPC* npc, uint32 loottable_id, ItemList* it
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(cash != 0) {
|
if (cash != 0) {
|
||||||
*plat = cash / 1000;
|
*plat = cash / 1000;
|
||||||
cash -= *plat * 1000;
|
cash -= *plat * 1000;
|
||||||
|
|
||||||
@ -90,25 +107,23 @@ void ZoneDatabase::AddLootTableToNPC(NPC* npc, uint32 loottable_id, ItemList* it
|
|||||||
*copper = cash;
|
*copper = cash;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 global_loot_multiplier = RuleI(Zone, GlobalLootMultiplier);
|
const uint32 global_loot_multiplier = RuleI(Zone, GlobalLootMultiplier);
|
||||||
|
|
||||||
// Do items
|
for (uint32 i = 0; i < lts->NumEntries; i++) {
|
||||||
for (uint32 i=0; i<lts->NumEntries; i++) {
|
|
||||||
for (uint32 k = 1; k <= (lts->Entries[i].multiplier * global_loot_multiplier); k++) {
|
for (uint32 k = 1; k <= (lts->Entries[i].multiplier * global_loot_multiplier); k++) {
|
||||||
uint8 droplimit = lts->Entries[i].droplimit;
|
const uint8 drop_limit = lts->Entries[i].droplimit;
|
||||||
uint8 mindrop = lts->Entries[i].mindrop;
|
const uint8 minimum_drop = lts->Entries[i].mindrop;
|
||||||
|
|
||||||
//LootTable Entry probability
|
//LootTable Entry probability
|
||||||
float ltchance = 0.0f;
|
const float probability = lts->Entries[i].probability;
|
||||||
ltchance = lts->Entries[i].probability;
|
|
||||||
|
|
||||||
float drop_chance = 0.0f;
|
float drop_chance = 0.0f;
|
||||||
if(ltchance > 0.0 && ltchance < 100.0) {
|
if (EQ::ValueWithin(probability, 0.0f, 100.0f)) {
|
||||||
drop_chance = (float)zone->random.Real(0.0, 100.0);
|
drop_chance = static_cast<float>(zone->random.Real(0.0, 100.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ltchance != 0.0 && (ltchance == 100.0 || drop_chance <= ltchance)) {
|
if (probability != 0.0 && (probability == 100.0 || drop_chance <= probability)) {
|
||||||
AddLootDropToNPC(npc, lts->Entries[i].lootdrop_id, itemlist, droplimit, mindrop);
|
AddLootDropToNPC(npc, lts->Entries[i].lootdrop_id, itemlist, drop_limit, minimum_drop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -118,31 +133,29 @@ void ZoneDatabase::AddLootTableToNPC(NPC* npc, uint32 loottable_id, ItemList* it
|
|||||||
// maxdrops = size of the array npcd
|
// maxdrops = size of the array npcd
|
||||||
void ZoneDatabase::AddLootDropToNPC(NPC *npc, uint32 lootdrop_id, ItemList *item_list, uint8 droplimit, uint8 mindrop)
|
void ZoneDatabase::AddLootDropToNPC(NPC *npc, uint32 lootdrop_id, ItemList *item_list, uint8 droplimit, uint8 mindrop)
|
||||||
{
|
{
|
||||||
const LootDrop_Struct *loot_drop = GetLootDrop(lootdrop_id);
|
const auto *lds = GetLootDrop(lootdrop_id);
|
||||||
if (!loot_drop) {
|
if (
|
||||||
return;
|
!lds ||
|
||||||
}
|
lds->NumEntries == 0 ||
|
||||||
|
!content_service.DoesPassContentFiltering(lds->content_flags)
|
||||||
if (loot_drop->NumEntries == 0) {
|
) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!content_service.DoesPassContentFiltering(loot_drop->content_flags)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if this lootdrop is droplimit=0 and mindrop 0, scan list once and return
|
// if this lootdrop is droplimit=0 and mindrop 0, scan list once and return
|
||||||
if (droplimit == 0 && mindrop == 0) {
|
if (droplimit == 0 && mindrop == 0) {
|
||||||
for (uint32 i = 0; i < loot_drop->NumEntries; ++i) {
|
for (uint32 i = 0; i < lds->NumEntries; ++i) {
|
||||||
int charges = loot_drop->Entries[i].multiplier;
|
const uint8 charges = lds->Entries[i].multiplier;
|
||||||
for (int j = 0; j < charges; ++j) {
|
for (int j = 0; j < charges; ++j) {
|
||||||
if (zone->random.Real(0.0, 100.0) <= loot_drop->Entries[i].chance &&
|
if (
|
||||||
npc->MeetsLootDropLevelRequirements(loot_drop->Entries[i], true)) {
|
zone->random.Real(0.0, 100.0) <= lds->Entries[i].chance &&
|
||||||
const EQ::ItemData *database_item = GetItem(loot_drop->Entries[i].item_id);
|
npc->MeetsLootDropLevelRequirements(lds->Entries[i], true)
|
||||||
|
) {
|
||||||
|
const EQ::ItemData *database_item = GetItem(lds->Entries[i].item_id);
|
||||||
npc->AddLootDrop(
|
npc->AddLootDrop(
|
||||||
database_item,
|
database_item,
|
||||||
item_list,
|
item_list,
|
||||||
loot_drop->Entries[i]
|
lds->Entries[i]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -150,7 +163,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC *npc, uint32 lootdrop_id, ItemList *item
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loot_drop->NumEntries > 100 && droplimit == 0) {
|
if (lds->NumEntries > 100 && droplimit == 0) {
|
||||||
droplimit = 10;
|
droplimit = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,16 +176,17 @@ void ZoneDatabase::AddLootDropToNPC(NPC *npc, uint32 lootdrop_id, ItemList *item
|
|||||||
bool roll_table_chance_bypass = false;
|
bool roll_table_chance_bypass = false;
|
||||||
bool active_item_list = false;
|
bool active_item_list = false;
|
||||||
|
|
||||||
for (uint32 i = 0; i < loot_drop->NumEntries; ++i) {
|
for (uint32 i = 0; i < lds->NumEntries; ++i) {
|
||||||
const EQ::ItemData *db_item = GetItem(loot_drop->Entries[i].item_id);
|
const EQ::ItemData *db_item = GetItem(lds->Entries[i].item_id);
|
||||||
if (db_item && npc->MeetsLootDropLevelRequirements(loot_drop->Entries[i])) {
|
if (db_item && npc->MeetsLootDropLevelRequirements(lds->Entries[i])) {
|
||||||
roll_t += loot_drop->Entries[i].chance;
|
roll_t += lds->Entries[i].chance;
|
||||||
if (loot_drop->Entries[i].chance >= 100) {
|
|
||||||
|
if (lds->Entries[i].chance >= 100) {
|
||||||
roll_table_chance_bypass = true;
|
roll_table_chance_bypass = true;
|
||||||
|
} else {
|
||||||
|
no_loot_prob *= (100 - lds->Entries[i].chance) / 100.0f;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
no_loot_prob *= (100 - loot_drop->Entries[i].chance) / 100.0f;
|
|
||||||
}
|
|
||||||
active_item_list = true;
|
active_item_list = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -191,41 +205,40 @@ void ZoneDatabase::AddLootDropToNPC(NPC *npc, uint32 lootdrop_id, ItemList *item
|
|||||||
for (int i = 0; i < droplimit; ++i) {
|
for (int i = 0; i < droplimit; ++i) {
|
||||||
if (drops < mindrop || roll_table_chance_bypass || (float) zone->random.Real(0.0, 1.0) >= no_loot_prob) {
|
if (drops < mindrop || roll_table_chance_bypass || (float) zone->random.Real(0.0, 1.0) >= no_loot_prob) {
|
||||||
float roll = (float) zone->random.Real(0.0, roll_t);
|
float roll = (float) zone->random.Real(0.0, roll_t);
|
||||||
for (uint32 j = 0; j < loot_drop->NumEntries; ++j) {
|
for (uint32 j = 0; j < lds->NumEntries; ++j) {
|
||||||
const EQ::ItemData *db_item = GetItem(loot_drop->Entries[j].item_id);
|
const auto *db_item = GetItem(lds->Entries[j].item_id);
|
||||||
if (db_item) {
|
if (db_item) {
|
||||||
// if it doesn't meet the requirements do nothing
|
// if it doesn't meet the requirements do nothing
|
||||||
if (!npc->MeetsLootDropLevelRequirements(loot_drop->Entries[j])) {
|
if (!npc->MeetsLootDropLevelRequirements(lds->Entries[j])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (roll < loot_drop->Entries[j].chance) {
|
if (roll < lds->Entries[j].chance) {
|
||||||
npc->AddLootDrop(
|
npc->AddLootDrop(
|
||||||
db_item,
|
db_item,
|
||||||
item_list,
|
item_list,
|
||||||
loot_drop->Entries[j]
|
lds->Entries[j]
|
||||||
);
|
);
|
||||||
drops++;
|
drops++;
|
||||||
|
|
||||||
int charges = (int) loot_drop->Entries[i].multiplier;
|
uint8 charges = lds->Entries[i].multiplier;
|
||||||
charges = EQ::ClampLower(charges, 1);
|
charges = EQ::ClampLower(charges, static_cast<uint8>(1));
|
||||||
|
|
||||||
for (int k = 1; k < charges; ++k) {
|
for (int k = 1; k < charges; ++k) {
|
||||||
float c_roll = (float) zone->random.Real(0.0, 100.0);
|
float c_roll = static_cast<float>(zone->random.Real(0.0, 100.0));
|
||||||
if (c_roll <= loot_drop->Entries[i].chance) {
|
if (c_roll <= lds->Entries[i].chance) {
|
||||||
npc->AddLootDrop(
|
npc->AddLootDrop(
|
||||||
db_item,
|
db_item,
|
||||||
item_list,
|
item_list,
|
||||||
loot_drop->Entries[i]
|
lds->Entries[i]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
j = loot_drop->NumEntries;
|
j = lds->NumEntries;
|
||||||
break;
|
break;
|
||||||
}
|
} else {
|
||||||
else {
|
roll -= lds->Entries[j].chance;
|
||||||
roll -= loot_drop->Entries[j].chance;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -291,19 +304,18 @@ void NPC::AddLootDrop(
|
|||||||
ItemList *itemlist,
|
ItemList *itemlist,
|
||||||
LootDropEntries_Struct loot_drop,
|
LootDropEntries_Struct loot_drop,
|
||||||
bool wear_change,
|
bool wear_change,
|
||||||
uint32 aug1,
|
uint32 augment_one,
|
||||||
uint32 aug2,
|
uint32 augment_two,
|
||||||
uint32 aug3,
|
uint32 augment_three,
|
||||||
uint32 aug4,
|
uint32 augment_four,
|
||||||
uint32 aug5,
|
uint32 augment_five,
|
||||||
uint32 aug6
|
uint32 augment_six
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (!item2) {
|
if (!item2) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//make sure we are doing something...
|
|
||||||
if (!itemlist && !wear_change) {
|
if (!itemlist && !wear_change) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -340,18 +352,17 @@ void NPC::AddLootDrop(
|
|||||||
|
|
||||||
item->item_id = item2->ID;
|
item->item_id = item2->ID;
|
||||||
item->charges = loot_drop.item_charges;
|
item->charges = loot_drop.item_charges;
|
||||||
item->aug_1 = aug1;
|
item->aug_1 = augment_one;
|
||||||
item->aug_2 = aug2;
|
item->aug_2 = augment_two;
|
||||||
item->aug_3 = aug3;
|
item->aug_3 = augment_three;
|
||||||
item->aug_4 = aug4;
|
item->aug_4 = augment_four;
|
||||||
item->aug_5 = aug5;
|
item->aug_5 = augment_five;
|
||||||
item->aug_6 = aug6;
|
item->aug_6 = augment_six;
|
||||||
item->attuned = 0;
|
item->attuned = false;
|
||||||
item->trivial_min_level = loot_drop.trivial_min_level;
|
item->trivial_min_level = loot_drop.trivial_min_level;
|
||||||
item->trivial_max_level = loot_drop.trivial_max_level;
|
item->trivial_max_level = loot_drop.trivial_max_level;
|
||||||
item->equip_slot = EQ::invslot::SLOT_INVALID;
|
item->equip_slot = EQ::invslot::SLOT_INVALID;
|
||||||
|
|
||||||
|
|
||||||
// unsure if required to equip, YOLO for now
|
// unsure if required to equip, YOLO for now
|
||||||
if (item2->ItemType == EQ::item::ItemTypeBow) {
|
if (item2->ItemType == EQ::item::ItemTypeBow) {
|
||||||
SetBowEquipped(true);
|
SetBowEquipped(true);
|
||||||
@ -363,17 +374,17 @@ void NPC::AddLootDrop(
|
|||||||
|
|
||||||
bool found = false; // track if we found an empty slot we fit into
|
bool found = false; // track if we found an empty slot we fit into
|
||||||
|
|
||||||
int foundslot = INVALID_INDEX; // for multi-slot items
|
int found_slot = INVALID_INDEX; // for multi-slot items
|
||||||
|
|
||||||
const auto* inst = database.CreateItem(
|
auto *inst = database.CreateItem(
|
||||||
item2->ID,
|
item2->ID,
|
||||||
loot_drop.item_charges,
|
loot_drop.item_charges,
|
||||||
aug1,
|
augment_one,
|
||||||
aug2,
|
augment_two,
|
||||||
aug3,
|
augment_three,
|
||||||
aug4,
|
augment_four,
|
||||||
aug5,
|
augment_five,
|
||||||
aug6
|
augment_six
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!inst) {
|
if (!inst) {
|
||||||
@ -381,9 +392,8 @@ void NPC::AddLootDrop(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (loot_drop.equip_item > 0) {
|
if (loot_drop.equip_item > 0) {
|
||||||
uint8 eslot = 0xFF;
|
uint8 equipment_slot = UINT8_MAX;
|
||||||
char newid[20];
|
const EQ::ItemData *compitem = nullptr;
|
||||||
const EQ::ItemData* compitem = nullptr;
|
|
||||||
|
|
||||||
// Equip rules are as follows:
|
// Equip rules are as follows:
|
||||||
// If the item has the NoPet flag set it will not be equipped.
|
// If the item has the NoPet flag set it will not be equipped.
|
||||||
@ -395,141 +405,136 @@ void NPC::AddLootDrop(
|
|||||||
// it is an improvement.
|
// it is an improvement.
|
||||||
|
|
||||||
if (!item2->NoPet) {
|
if (!item2->NoPet) {
|
||||||
for (int i = EQ::invslot::EQUIPMENT_BEGIN; !found && i <= EQ::invslot::EQUIPMENT_END; i++) {
|
for (
|
||||||
uint32 slots = (1 << i);
|
int i = EQ::invslot::EQUIPMENT_BEGIN;
|
||||||
|
!found && i <= EQ::invslot::EQUIPMENT_END;
|
||||||
|
i++
|
||||||
|
) {
|
||||||
|
const uint32 slots = (1 << i);
|
||||||
if (item2->Slots & slots) {
|
if (item2->Slots & slots) {
|
||||||
if(equipment[i])
|
if (equipment[i]) {
|
||||||
{
|
|
||||||
compitem = database.GetItem(equipment[i]);
|
compitem = database.GetItem(equipment[i]);
|
||||||
if (item2->AC > compitem->AC ||
|
if (
|
||||||
(item2->AC == compitem->AC && item2->HP > compitem->HP))
|
item2->AC > compitem->AC ||
|
||||||
{
|
(item2->AC == compitem->AC && item2->HP > compitem->HP)
|
||||||
|
) {
|
||||||
// item would be an upgrade
|
// item would be an upgrade
|
||||||
// check if we're multi-slot, if yes then we have to keep
|
// check if we're multi-slot, if yes then we have to keep
|
||||||
// looking in case any of the other slots we can fit into are empty.
|
// looking in case any of the other slots we can fit into are empty.
|
||||||
if (item2->Slots != slots) {
|
if (item2->Slots != slots) {
|
||||||
foundslot = i;
|
found_slot = i;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Unequip old item
|
// Unequip old item
|
||||||
auto* olditem = GetItem(i);
|
auto *old_item = GetItem(i);
|
||||||
|
|
||||||
olditem->equip_slot = EQ::invslot::SLOT_INVALID;
|
old_item->equip_slot = EQ::invslot::SLOT_INVALID;
|
||||||
|
|
||||||
equipment[i] = item2->ID;
|
equipment[i] = item2->ID;
|
||||||
|
|
||||||
foundslot = i;
|
found_slot = i;
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
} // end if ac
|
|
||||||
}
|
}
|
||||||
else
|
} else {
|
||||||
{
|
|
||||||
equipment[i] = item2->ID;
|
equipment[i] = item2->ID;
|
||||||
foundslot = i;
|
|
||||||
|
found_slot = i;
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
} // end if (slots)
|
}
|
||||||
} // end for
|
}
|
||||||
} // end if NoPet
|
}
|
||||||
|
|
||||||
// Possible slot was found but not selected. Pick it now.
|
// Possible slot was found but not selected. Pick it now.
|
||||||
if (!found && foundslot >= 0) {
|
if (!found && found_slot >= 0) {
|
||||||
equipment[foundslot] = item2->ID;
|
equipment[found_slot] = item2->ID;
|
||||||
|
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @merth: IDFile size has been increased, this needs to change
|
uint32 equipment_material;
|
||||||
uint16 emat;
|
if (
|
||||||
if(item2->Material <= 0
|
item2->Material <= 0 ||
|
||||||
|| (item2->Slots & ((1 << EQ::invslot::slotPrimary) | (1 << EQ::invslot::slotSecondary)))) {
|
(
|
||||||
memset(newid, 0, sizeof(newid));
|
item2->Slots & (
|
||||||
for(int i=0;i<7;i++){
|
(1 << EQ::invslot::slotPrimary) |
|
||||||
if (!isalpha(item2->IDFile[i])){
|
(1 << EQ::invslot::slotSecondary)
|
||||||
strn0cpy(newid, &item2->IDFile[i],6);
|
)
|
||||||
i=8;
|
)
|
||||||
}
|
) {
|
||||||
}
|
equipment_material = Strings::ToUnsignedInt(&item2->IDFile[2]);
|
||||||
|
|
||||||
emat = Strings::ToInt(newid);
|
|
||||||
} else {
|
} else {
|
||||||
emat = item2->Material;
|
equipment_material = item2->Material;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (foundslot == EQ::invslot::slotPrimary) {
|
if (found_slot == EQ::invslot::slotPrimary) {
|
||||||
|
equipment_slot = EQ::textures::weaponPrimary;
|
||||||
|
|
||||||
eslot = EQ::textures::weaponPrimary;
|
|
||||||
if (item2->Damage > 0) {
|
if (item2->Damage > 0) {
|
||||||
SendAddPlayerState(PlayerState::PrimaryWeaponEquipped);
|
SendAddPlayerState(PlayerState::PrimaryWeaponEquipped);
|
||||||
if (!RuleB(Combat, ClassicNPCBackstab))
|
|
||||||
|
if (!RuleB(Combat, ClassicNPCBackstab)) {
|
||||||
SetFacestab(true);
|
SetFacestab(true);
|
||||||
}
|
}
|
||||||
if (item2->IsType2HWeapon())
|
}
|
||||||
|
|
||||||
|
if (item2->IsType2HWeapon()) {
|
||||||
SetTwoHanderEquipped(true);
|
SetTwoHanderEquipped(true);
|
||||||
}
|
}
|
||||||
else if (foundslot == EQ::invslot::slotSecondary
|
} else if (
|
||||||
&& (GetOwner() != nullptr || (CanThisClassDualWield() && zone->random.Roll(NPC_DW_CHANCE)) || (item2->Damage==0)) &&
|
found_slot == EQ::invslot::slotSecondary &&
|
||||||
(item2->IsType1HWeapon() || item2->ItemType == EQ::item::ItemTypeShield || item2->ItemType == EQ::item::ItemTypeLight))
|
(
|
||||||
{
|
GetOwner() ||
|
||||||
|
(CanThisClassDualWield() && zone->random.Roll(NPC_DW_CHANCE)) ||
|
||||||
|
item2->Damage == 0
|
||||||
|
) &&
|
||||||
|
(
|
||||||
|
item2->IsType1HWeapon() ||
|
||||||
|
item2->ItemType == EQ::item::ItemTypeShield ||
|
||||||
|
item2->ItemType == EQ::item::ItemTypeLight
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
equipment_slot = EQ::textures::weaponSecondary;
|
||||||
|
|
||||||
eslot = EQ::textures::weaponSecondary;
|
if (item2->Damage > 0) {
|
||||||
if (item2->Damage > 0)
|
|
||||||
SendAddPlayerState(PlayerState::SecondaryWeaponEquipped);
|
SendAddPlayerState(PlayerState::SecondaryWeaponEquipped);
|
||||||
}
|
}
|
||||||
else if (foundslot == EQ::invslot::slotHead) {
|
} else if (found_slot == EQ::invslot::slotHead) {
|
||||||
eslot = EQ::textures::armorHead;
|
equipment_slot = EQ::textures::armorHead;
|
||||||
}
|
} else if (found_slot == EQ::invslot::slotChest) {
|
||||||
else if (foundslot == EQ::invslot::slotChest) {
|
equipment_slot = EQ::textures::armorChest;
|
||||||
eslot = EQ::textures::armorChest;
|
} else if (found_slot == EQ::invslot::slotArms) {
|
||||||
}
|
equipment_slot = EQ::textures::armorArms;
|
||||||
else if (foundslot == EQ::invslot::slotArms) {
|
} else if (EQ::ValueWithin(found_slot, EQ::invslot::slotWrist1, EQ::invslot::slotWrist2)) {
|
||||||
eslot = EQ::textures::armorArms;
|
equipment_slot = EQ::textures::armorWrist;
|
||||||
}
|
} else if (found_slot == EQ::invslot::slotHands) {
|
||||||
else if (foundslot == EQ::invslot::slotWrist1 || foundslot == EQ::invslot::slotWrist2) {
|
equipment_slot = EQ::textures::armorHands;
|
||||||
eslot = EQ::textures::armorWrist;
|
} else if (found_slot == EQ::invslot::slotLegs) {
|
||||||
}
|
equipment_slot = EQ::textures::armorLegs;
|
||||||
else if (foundslot == EQ::invslot::slotHands) {
|
} else if (found_slot == EQ::invslot::slotFeet) {
|
||||||
eslot = EQ::textures::armorHands;
|
equipment_slot = EQ::textures::armorFeet;
|
||||||
}
|
|
||||||
else if (foundslot == EQ::invslot::slotLegs) {
|
|
||||||
eslot = EQ::textures::armorLegs;
|
|
||||||
}
|
|
||||||
else if (foundslot == EQ::invslot::slotFeet) {
|
|
||||||
eslot = EQ::textures::armorFeet;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
if (equipment_slot != UINT8_MAX) {
|
||||||
what was this about???
|
if (wear_change) {
|
||||||
|
p_wear_change_struct->wear_slot_id = equipment_slot;
|
||||||
if (((npc->GetRace()==127) && (npc->CastToMob()->GetOwnerID()!=0)) && (item2->Slots==24576) || (item2->Slots==8192) || (item2->Slots==16384)){
|
p_wear_change_struct->material = equipment_material;
|
||||||
npc->d_melee_texture2=Strings::ToInt(newid);
|
|
||||||
wc->wear_slot_id=8;
|
|
||||||
if (item2->Material >0)
|
|
||||||
wc->material=item2->Material;
|
|
||||||
else
|
|
||||||
wc->material=Strings::ToInt(newid);
|
|
||||||
npc->AC+=item2->AC;
|
|
||||||
npc->STR+=item2->STR;
|
|
||||||
npc->INT+=item2->INT;
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
//if we found an open slot it goes in...
|
|
||||||
if(eslot != 0xFF) {
|
|
||||||
if(wear_change) {
|
|
||||||
p_wear_change_struct->wear_slot_id = eslot;
|
|
||||||
p_wear_change_struct->material = emat;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
if (found) {
|
if (found) {
|
||||||
item->equip_slot = foundslot;
|
item->equip_slot = found_slot;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemlist) {
|
if (itemlist) {
|
||||||
if (foundslot != INVALID_INDEX) {
|
if (found_slot != INVALID_INDEX) {
|
||||||
GetInv().PutItem(foundslot, *inst);
|
GetInv().PutItem(found_slot, *inst);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parse->HasQuestSub(GetNPCTypeID(), EVENT_LOOT_ADDED)) {
|
||||||
|
std::vector<std::any> args = { inst };
|
||||||
|
parse->EventNPC(EVENT_LOOT_ADDED, this, nullptr, "", 0, &args);
|
||||||
}
|
}
|
||||||
|
|
||||||
itemlist->push_back(item);
|
itemlist->push_back(item);
|
||||||
@ -551,55 +556,69 @@ void NPC::AddLootDrop(
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateEquipmentLight();
|
UpdateEquipmentLight();
|
||||||
|
|
||||||
if (UpdateActiveLight()) {
|
if (UpdateActiveLight()) {
|
||||||
SendAppearancePacket(AT_Light, GetActiveLightType());
|
SendAppearancePacket(AT_Light, GetActiveLightType());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NPC::AddItem(const EQ::ItemData *item, uint16 charges, bool equipitem)
|
void NPC::AddItem(const EQ::ItemData *item, uint16 charges, bool equip_item)
|
||||||
{
|
{
|
||||||
//slot isnt needed, its determined from the item.
|
|
||||||
auto loot_drop_entry = NPC::NewLootDropEntry();
|
auto loot_drop_entry = NPC::NewLootDropEntry();
|
||||||
loot_drop_entry.equip_item = static_cast<uint8>(equipitem ? 1 : 0);
|
|
||||||
|
loot_drop_entry.equip_item = static_cast<uint8>(equip_item ? 1 : 0);
|
||||||
loot_drop_entry.item_charges = charges;
|
loot_drop_entry.item_charges = charges;
|
||||||
|
|
||||||
AddLootDrop(item, &itemlist, loot_drop_entry, true);
|
AddLootDrop(item, &itemlist, loot_drop_entry, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NPC::AddItem(
|
void NPC::AddItem(
|
||||||
uint32 itemid,
|
uint32 item_id,
|
||||||
uint16 charges,
|
uint16 charges,
|
||||||
bool equipitem,
|
bool equip_item,
|
||||||
uint32 aug1,
|
uint32 augment_one,
|
||||||
uint32 aug2,
|
uint32 augment_two,
|
||||||
uint32 aug3,
|
uint32 augment_three,
|
||||||
uint32 aug4,
|
uint32 augment_four,
|
||||||
uint32 aug5,
|
uint32 augment_five,
|
||||||
uint32 aug6
|
uint32 augment_six
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//slot isnt needed, its determined from the item.
|
const auto *item = database.GetItem(item_id);
|
||||||
const EQ::ItemData *i = database.GetItem(itemid);
|
if (!item) {
|
||||||
if (i == nullptr) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto loot_drop_entry = NPC::NewLootDropEntry();
|
auto loot_drop_entry = NPC::NewLootDropEntry();
|
||||||
loot_drop_entry.equip_item = static_cast<uint8>(equipitem ? 1 : 0);
|
|
||||||
|
loot_drop_entry.equip_item = static_cast<uint8>(equip_item ? 1 : 0);
|
||||||
loot_drop_entry.item_charges = charges;
|
loot_drop_entry.item_charges = charges;
|
||||||
|
|
||||||
AddLootDrop(i, &itemlist, loot_drop_entry, true, aug1, aug2, aug3, aug4, aug5, aug6);
|
AddLootDrop(
|
||||||
|
item,
|
||||||
|
&itemlist,
|
||||||
|
loot_drop_entry,
|
||||||
|
true,
|
||||||
|
augment_one,
|
||||||
|
augment_two,
|
||||||
|
augment_three,
|
||||||
|
augment_four,
|
||||||
|
augment_five,
|
||||||
|
augment_six
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NPC::AddLootTable() {
|
void NPC::AddLootTable()
|
||||||
|
{
|
||||||
if (npctype_id != 0) { // check if it's a GM spawn
|
if (npctype_id != 0) { // check if it's a GM spawn
|
||||||
database.AddLootTableToNPC(this,loottable_id, &itemlist, &copper, &silver, &gold, &platinum);
|
database.AddLootTableToNPC(this, loottable_id, &itemlist, &copper, &silver, &gold, &platinum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NPC::AddLootTable(uint32 ldid) {
|
void NPC::AddLootTable(uint32 loottable_id)
|
||||||
|
{
|
||||||
if (npctype_id != 0) { // check if it's a GM spawn
|
if (npctype_id != 0) { // check if it's a GM spawn
|
||||||
database.AddLootTableToNPC(this,ldid, &itemlist, &copper, &silver, &gold, &platinum);
|
database.AddLootTableToNPC(this, loottable_id, &itemlist, &copper, &silver, &gold, &platinum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6609,7 +6609,8 @@ luabind::scope lua_register_events() {
|
|||||||
luabind::value("memorize_spell", static_cast<int>(EVENT_MEMORIZE_SPELL)),
|
luabind::value("memorize_spell", static_cast<int>(EVENT_MEMORIZE_SPELL)),
|
||||||
luabind::value("unmemorize_spell", static_cast<int>(EVENT_UNMEMORIZE_SPELL)),
|
luabind::value("unmemorize_spell", static_cast<int>(EVENT_UNMEMORIZE_SPELL)),
|
||||||
luabind::value("scribe_spell", static_cast<int>(EVENT_SCRIBE_SPELL)),
|
luabind::value("scribe_spell", static_cast<int>(EVENT_SCRIBE_SPELL)),
|
||||||
luabind::value("unscribe_spell", static_cast<int>(EVENT_UNSCRIBE_SPELL))
|
luabind::value("unscribe_spell", static_cast<int>(EVENT_UNSCRIBE_SPELL)),
|
||||||
|
luabind::value("loot_added", static_cast<int>(EVENT_LOOT_ADDED))
|
||||||
)];
|
)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -168,7 +168,8 @@ const char *LuaEvents[_LargestEventID] = {
|
|||||||
"event_memorize_spell",
|
"event_memorize_spell",
|
||||||
"event_unmemorize_spell",
|
"event_unmemorize_spell",
|
||||||
"event_scribe_spell",
|
"event_scribe_spell",
|
||||||
"event_unscribe_spell"
|
"event_unscribe_spell",
|
||||||
|
"event_loot_added"
|
||||||
};
|
};
|
||||||
|
|
||||||
extern Zone *zone;
|
extern Zone *zone;
|
||||||
@ -226,6 +227,7 @@ LuaParser::LuaParser() {
|
|||||||
NPCArgumentDispatch[EVENT_DESPAWN_ZONE] = handle_npc_despawn_zone;
|
NPCArgumentDispatch[EVENT_DESPAWN_ZONE] = handle_npc_despawn_zone;
|
||||||
NPCArgumentDispatch[EVENT_DAMAGE_GIVEN] = handle_npc_damage;
|
NPCArgumentDispatch[EVENT_DAMAGE_GIVEN] = handle_npc_damage;
|
||||||
NPCArgumentDispatch[EVENT_DAMAGE_TAKEN] = handle_npc_damage;
|
NPCArgumentDispatch[EVENT_DAMAGE_TAKEN] = handle_npc_damage;
|
||||||
|
NPCArgumentDispatch[EVENT_LOOT_ADDED] = handle_npc_loot_added;
|
||||||
|
|
||||||
PlayerArgumentDispatch[EVENT_SAY] = handle_player_say;
|
PlayerArgumentDispatch[EVENT_SAY] = handle_player_say;
|
||||||
PlayerArgumentDispatch[EVENT_ENVIRONMENTAL_DAMAGE] = handle_player_environmental_damage;
|
PlayerArgumentDispatch[EVENT_ENVIRONMENTAL_DAMAGE] = handle_player_environmental_damage;
|
||||||
|
|||||||
@ -492,6 +492,63 @@ void handle_npc_damage(
|
|||||||
lua_setfield(L, -2, "other");
|
lua_setfield(L, -2, "other");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void handle_npc_loot_added(
|
||||||
|
QuestInterface *parse,
|
||||||
|
lua_State* L,
|
||||||
|
NPC* npc,
|
||||||
|
Mob* init,
|
||||||
|
std::string data,
|
||||||
|
uint32 extra_data,
|
||||||
|
std::vector<std::any> *extra_pointers
|
||||||
|
) {
|
||||||
|
if (extra_pointers && extra_pointers->size() == 1) {
|
||||||
|
auto *inst = std::any_cast<EQ::ItemInstance *>(extra_pointers->at(0));
|
||||||
|
auto *item = database.GetItem(inst->GetID());
|
||||||
|
|
||||||
|
if (item) {
|
||||||
|
Lua_Item l_item(item);
|
||||||
|
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
|
||||||
|
l_item_o.push(L);
|
||||||
|
lua_setfield(L, -2, "item");
|
||||||
|
} else {
|
||||||
|
Lua_Item l_item(nullptr);
|
||||||
|
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
|
||||||
|
l_item_o.push(L);
|
||||||
|
lua_setfield(L, -2, "item");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (inst) {
|
||||||
|
lua_pushinteger(L, inst->GetID());
|
||||||
|
lua_setfield(L, -2, "item_id");
|
||||||
|
|
||||||
|
lua_pushstring(L, inst->GetItem()->Name);
|
||||||
|
lua_setfield(L, -2, "item_name");
|
||||||
|
|
||||||
|
lua_pushinteger(L, inst->GetCharges());
|
||||||
|
lua_setfield(L, -2, "item_charges");
|
||||||
|
|
||||||
|
lua_pushinteger(L, inst->GetAugmentItemID(EQ::invaug::SOCKET_BEGIN));
|
||||||
|
lua_setfield(L, -2, "augment_one");
|
||||||
|
|
||||||
|
lua_pushinteger(L, inst->GetAugmentItemID(EQ::invaug::SOCKET_BEGIN + 1));
|
||||||
|
lua_setfield(L, -2, "augment_two");
|
||||||
|
|
||||||
|
lua_pushinteger(L, inst->GetAugmentItemID(EQ::invaug::SOCKET_BEGIN + 2));
|
||||||
|
lua_setfield(L, -2, "augment_three");
|
||||||
|
|
||||||
|
lua_pushinteger(L, inst->GetAugmentItemID(EQ::invaug::SOCKET_BEGIN + 3));
|
||||||
|
lua_setfield(L, -2, "augment_four");
|
||||||
|
|
||||||
|
lua_pushinteger(L, inst->GetAugmentItemID(EQ::invaug::SOCKET_BEGIN + 4));
|
||||||
|
lua_setfield(L, -2, "augment_five");
|
||||||
|
|
||||||
|
lua_pushinteger(L, inst->GetAugmentItemID(EQ::invaug::SOCKET_END));
|
||||||
|
lua_setfield(L, -2, "augment_six");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Player
|
// Player
|
||||||
void handle_player_say(
|
void handle_player_say(
|
||||||
QuestInterface *parse,
|
QuestInterface *parse,
|
||||||
|
|||||||
@ -210,6 +210,16 @@ void handle_npc_damage(
|
|||||||
std::vector<std::any> *extra_pointers
|
std::vector<std::any> *extra_pointers
|
||||||
);
|
);
|
||||||
|
|
||||||
|
void handle_npc_loot_added(
|
||||||
|
QuestInterface *parse,
|
||||||
|
lua_State* L,
|
||||||
|
NPC* npc,
|
||||||
|
Mob *init,
|
||||||
|
std::string data,
|
||||||
|
uint32 extra_data,
|
||||||
|
std::vector<std::any> *extra_pointers
|
||||||
|
);
|
||||||
|
|
||||||
// Player
|
// Player
|
||||||
void handle_player_say(
|
void handle_player_say(
|
||||||
QuestInterface *parse,
|
QuestInterface *parse,
|
||||||
|
|||||||
28
zone/npc.h
28
zone/npc.h
@ -192,10 +192,20 @@ public:
|
|||||||
virtual void SpellProcess();
|
virtual void SpellProcess();
|
||||||
virtual void FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho);
|
virtual void FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho);
|
||||||
|
|
||||||
void AddItem(const EQ::ItemData* item, uint16 charges, bool equipitem = true);
|
void AddItem(const EQ::ItemData *item, uint16 charges, bool equip_item = true);
|
||||||
void AddItem(uint32 itemid, uint16 charges, bool equipitem = true, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0);
|
void AddItem(
|
||||||
|
uint32 item_id,
|
||||||
|
uint16 charges,
|
||||||
|
bool equip_item = true,
|
||||||
|
uint32 augment_one = 0,
|
||||||
|
uint32 augment_two = 0,
|
||||||
|
uint32 augment_three = 0,
|
||||||
|
uint32 augment_four = 0,
|
||||||
|
uint32 augment_five = 0,
|
||||||
|
uint32 augment_six = 0
|
||||||
|
);
|
||||||
void AddLootTable();
|
void AddLootTable();
|
||||||
void AddLootTable(uint32 ldid);
|
void AddLootTable(uint32 loottable_id);
|
||||||
void CheckGlobalLootTables();
|
void CheckGlobalLootTables();
|
||||||
void DescribeAggro(Client *to_who, Mob *mob, bool verbose);
|
void DescribeAggro(Client *to_who, Mob *mob, bool verbose);
|
||||||
void RemoveItem(uint32 item_id, uint16 quantity = 0, uint16 slot = 0);
|
void RemoveItem(uint32 item_id, uint16 quantity = 0, uint16 slot = 0);
|
||||||
@ -314,12 +324,12 @@ public:
|
|||||||
ItemList *itemlist,
|
ItemList *itemlist,
|
||||||
LootDropEntries_Struct loot_drop,
|
LootDropEntries_Struct loot_drop,
|
||||||
bool wear_change = false,
|
bool wear_change = false,
|
||||||
uint32 aug1 = 0,
|
uint32 augment_one = 0,
|
||||||
uint32 aug2 = 0,
|
uint32 augment_two = 0,
|
||||||
uint32 aug3 = 0,
|
uint32 augment_three = 0,
|
||||||
uint32 aug4 = 0,
|
uint32 augment_four = 0,
|
||||||
uint32 aug5 = 0,
|
uint32 augment_five = 0,
|
||||||
uint32 aug6 = 0
|
uint32 augment_six = 0
|
||||||
);
|
);
|
||||||
|
|
||||||
bool MeetsLootDropLevelRequirements(LootDropEntries_Struct loot_drop, bool verbose=false);
|
bool MeetsLootDropLevelRequirements(LootDropEntries_Struct loot_drop, bool verbose=false);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user