public override bool CheckCast() { Container pack = Caster.Backpack; BaseInstrument ints = (BaseInstrument)pack.FindItemByType(typeof(BaseInstrument)); if (ints == null) { Caster.SendMessage("Need instrument in pack to play this."); return(false); } if (ints.UsesRemaining >= 2) { ints.UsesRemaining -= 1; } if (ints.UsesRemaining == 1) { ints.Delete(); } Caster.PlaySound(ints.SuccessSound); return(true); }
public override bool CheckCast() { BaseInstrument instrument = Caster.Weapon as BaseInstrument; BaseInstrument ints = Caster.FindItemOnLayer(Layer.OneHanded) as BaseInstrument; if (ints == null) { Caster.SendMessage("Need instrument equipped to play this."); return(false); } if (ints.UsesRemaining >= 2) { ints.UsesRemaining -= 1; } if (ints.UsesRemaining == 1) { ints.Delete(); } Caster.PlaySound(ints.SuccessSound); return(true); }