Add support for kicking epic loot locks

Returning non-0 (no return in a lua/perl function = return 0 so this is best)
will prevent the client from looting the item

I still need to figure out how to make it so we don't have to kick
the player from the corpse, but maybe that's just a difference on live
This commit is contained in:
Michael Cook (mackal)
2016-12-15 18:31:08 -05:00
parent 3cc7d0db63
commit c1fbfc0f44
2 changed files with 10 additions and 1 deletions
+9 -1
View File
@@ -1170,7 +1170,15 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
std::vector<EQEmu::Any> args;
args.push_back(inst);
args.push_back(this);
parse->EventPlayer(EVENT_LOOT, client, buf, 0, &args);
if (parse->EventPlayer(EVENT_LOOT, client, buf, 0, &args) != 0) {
lootitem->auto_loot = 0xFFFFFFFF;
client->Message_StringID(CC_Red, LOOT_NOT_ALLOWED, inst->GetItem()->Name);
client->QueuePacket(app);
SendEndLootErrorPacket(client); // shouldn't need this, but it will work for now
being_looted_by = 0;
delete inst;
return;
}
parse->EventItem(EVENT_LOOT, client, inst, this, buf, 0);
if (!IsPlayerCorpse() && RuleB(Character, EnableDiscoveredItems)) {