public virtual bool OnGoldGiven( Mobile from, Gold dropped ) { if ( CheckTeachingMatch( from ) ) { int goldtaken = Teach( m_Teaching, from, dropped.Amount / TeachScalar, true ) * TeachScalar; if ( goldtaken > 0 ) { dropped.Consume( goldtaken ); return dropped == null || dropped.Deleted || dropped.Amount <= 0; } } else if ( IsHumanInTown() ) { Direction = GetDirectionTo( from ); int oldSpeechHue = this.SpeechHue; this.SpeechHue = 0x23F; SayTo( from, "Thou art giving me gold?" ); if ( dropped.Amount >= 400 ) SayTo( from, "'Tis a noble gift." ); else SayTo( from, "Money is always welcome." ); from.Karma += Math.Max( dropped.Amount / 10, 100 ); this.SpeechHue = 0x3B2; SayTo( from, 501548 ); // I thank thee. this.SpeechHue = oldSpeechHue; dropped.Delete(); return true; } return false; }
public bool AddGoldPile(Gold gold) { if ( !GoldLedger ) return false; gold.Amount = (int)AddGoldAmount((ulong)gold.Amount); if (gold.Amount == 0) { gold.Consume(); return true; } return false; }