private bool isCorpseLootable(PlayerMobile player, Corpse corpse) { if (corpse.Owner == null || corpse.Deleted || corpse.Owner is PlayerMobile || (corpse.Owner is BaseCreature && ((BaseCreature)corpse.Owner).IsBonded) || !corpse.CheckLoot(player) || corpse.IsCriminalAction(player) ) { return(false); } return(true); }
public static bool CheckLoot(Corpse corpse, PlayerMobile player) { #if RunUO2_2 return corpse.CheckLoot(player, null); #else return corpse.CheckLoot(player); #endif }
// determine if the corpse is ok to loot 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 && !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 <= FreelyLootableFame ) result = true; else result = corpse.CheckLoot( from, null ) && !( corpse.IsCriminalAction( from ) ); } if ( false == result && notify ) { from.PlaySound( 1074 ); // no from.SendMessage( notification ); } return result; }