Added 3 new rules for pvp item looting

This commit is contained in:
Xackery 2018-03-23 18:19:57 -07:00
parent a8669726db
commit 0bab351eab
2 changed files with 36 additions and 0 deletions

View file

@ -728,6 +728,9 @@ RULE_BOOL(Inventory, EnforceAugmentWear, true) // Forces augment wear slot valid
RULE_BOOL(Inventory, DeleteTransformationMold, true) //False if you want mold to last forever
RULE_BOOL(Inventory, AllowAnyWeaponTransformation, false) //Weapons can use any weapon transformation
RULE_BOOL(Inventory, TransformSummonedBags, false) //Transforms summoned bags into disenchanted ones instead of deleting
RULE_INT(Inventory, PVPLootableEquipSlots, 0) //When looting a player's corpse, equipped items in slots listed here are lootable.
RULE_BOOL(Inventory, PVPCanLootNoTrade, false) //Can players loot no trade items from player corpses?
RULE_BOOL(Inventory, PVPCanLootContainer, false) //Can players loot bags/containers from player corpses?
RULE_CATEGORY_END()
RULE_CATEGORY(Client)

View file

@ -1146,6 +1146,39 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app)
}
if (client && inst) {
if (GetCharID() != client->CharacterID()) { //PVP Looting
if (inst->GetItem()->NoDrop == 0 && !RuleB(Inventory, PVPCanLootNoTrade)) {
client->Message(13, "You may not loot NO DROP items from this corpse.");
client->QueuePacket(app);
SendEndLootErrorPacket(client);
ResetLooter();
delete inst;
return;
}
if (inst->GetItem()->BagSlots > 0 && !RuleB(Inventory, PVPCanLootContainer)) {
client->Message(13, "You may not loot containers from this corpse.");
client->QueuePacket(app);
SendEndLootErrorPacket(client);
ResetLooter();
delete inst;
return;
}
if (RuleI(Inventory, PVPLootableEquipSlots) > 0 && item_data->equip_slot < 23) {
int bit = 1 << item_data->equip_slot;
if (RuleI(Inventory, PVPLootableEquipSlots) & bit != 1) {
client->Message(13, "This item is equipped in a slot you cannot loot from.");
client->QueuePacket(app);
SendEndLootErrorPacket(client);
ResetLooter();
delete inst;
return;
}
}
}
if (client->CheckLoreConflict(item)) {
client->Message_StringID(0, LOOT_LORE_ERROR);
client->QueuePacket(app);