fix: Adds FindItemOnLayer generic (#1223)
This commit is contained in:
parent
053dbcbad0
commit
fd6f4239e2
20 changed files with 112 additions and 169 deletions
|
|
@ -530,20 +530,13 @@ namespace Server.Items
|
|||
return list;
|
||||
}
|
||||
|
||||
public static Spellbook FindEquippedSpellbook(Mobile from) => from.FindItemOnLayer(Layer.OneHanded) as Spellbook;
|
||||
public static Spellbook FindEquippedSpellbook(Mobile from) => from.FindItemOnLayer<Spellbook>(Layer.OneHanded);
|
||||
|
||||
public static bool ValidateSpellbook(Spellbook book, int spellID, SpellbookType type) =>
|
||||
book.SpellbookType == type && (spellID == -1 || book.HasSpell(spellID));
|
||||
|
||||
public override bool AllowSecureTrade(Mobile from, Mobile to, Mobile newOwner, bool accepted)
|
||||
{
|
||||
if (!Ethic.CheckTrade(from, to, newOwner, this))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.AllowSecureTrade(from, to, newOwner, accepted);
|
||||
}
|
||||
public override bool AllowSecureTrade(Mobile from, Mobile to, Mobile newOwner, bool accepted) =>
|
||||
Ethic.CheckTrade(from, to, newOwner, this) && base.AllowSecureTrade(from, to, newOwner, accepted);
|
||||
|
||||
public override bool CanEquip(Mobile from)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue