public static bool CheckLoot(Corpse corpse, PlayerMobile player) { #if RunUO2_2 return(corpse.CheckLoot(player, null)); #else return(corpse.CheckLoot(player)); #endif }
public override void HandleButtonResponse(NetState sender, int adjustedButton, ItemTileButtonInfo buttonInfo) { PlayerMobile m = sender.Mobile as PlayerMobile; Item item = ((ItemTileButtonInfo)buttonInfo).Item; if ((m != null) && !item.Deleted && m.Alive) { if (item.Parent == c && c.CheckLoot(m, item) && c.InLOS(m.Location)) { //m.Backpack.DropItem(item); m.AddToBackpack(item); m.SendSound(66); //m.SendSound(item.GetDropSound()); } if (Opencorpp.itemlist(c).Count > 0) { m.SendGump(new Opencorpp(c)); if (!item.InRange(m, 2) || !item.InLOS(m.Location)) { //item.SendLocalizedMessageTo(m, 501853); m.SendLocalizedMessage(500446); // That is too far away. //m.SendSound(Utility.RandomList(44,555,556,765,737,735,736)); m.SendSound(736); } } } //c.ProcessOpeners(m); //m.SendGump(new BaseItemTileButtonsGump("ss", itemlist(c))); }
private static bool CorpseIsLootable(Mobile from, Corpse corpse, bool notify) { if (null == corpse) { return(false); } bool result = false; string notification = ""; if (corpse.Owner == from) { notification = "You may not claim your own corpses."; } else if (corpse.Owner is PlayerMobile && !ClaimConfig.LootPlayers) { notification = "You may not loot player corpses."; } else { BaseCreature creature = corpse.Owner as BaseCreature; if (null != creature && creature.IsBonded) { notification = "You may not loot the corpses of bonded pets."; } else if (null != creature && creature.Fame <= ClaimConfig.FreelyLootableFame) { result = true; } else { result = corpse.CheckLoot(from, corpse) && !(corpse.IsCriminalAction(from)); } } if (false == result && notify) { from.PlaySound(1074); // no from.SendMessage(notification); } return(result); }