Beispiel #1
0
        public virtual bool OnCopperGiven( Mobile from, Copper dropped )
        {
            if( CheckTeachingMatch(from) )
            {
                if( Teach(m_Teaching, from, dropped.Amount, true) )
                {
                    dropped.Delete();
                    return true;
                }
            }
            else if( IsHumanInTown() )
            {
                Direction = GetDirectionTo(from);

                int oldSpeechHue = this.SpeechHue;

                this.SpeechHue = 0x23F;
                SayTo(from, "Thou art giving me coin?");

                if( dropped.Amount >= 400 )
                    SayTo(from, "'Tis a noble gift.");
                else
                    SayTo(from, "Money is always welcome.");

                this.SpeechHue = 0x3B2;
                SayTo(from, 501548); // I thank thee.

                this.SpeechHue = oldSpeechHue;

                dropped.Delete();
                return true;
            }

            return false;
        }
			public void ExpireContract()
			{
				BankBox box = m_Issuer.BankBox;

				if ( box != null )
				{
					Delete();

					int deposited = 0;

					int toAdd = m_Copper;

					Copper copper;

					while ( toAdd > 60000 )
					{
						copper = new Copper( 60000 );

						if ( box.TryDropItem( m_Issuer, copper, false ) )
						{
							toAdd -= 60000;
							deposited += 60000;
						}
						else
						{
							copper.Delete();

							m_Issuer.AddToBackpack( new BankCheck( toAdd ) );
							toAdd = 0;

							break;
						}
					}

					if ( toAdd > 0 )
					{
						copper = new Copper( toAdd );

						if ( box.TryDropItem( m_Issuer, copper, false ) )
						{
							deposited += toAdd;
						}
						else
						{
							copper.Delete();

							m_Issuer.AddToBackpack( new BankCheck( toAdd ) );
						}
					}

					// Gold was deposited in your account:
					m_Issuer.SendLocalizedMessage( 1042672, true, " " + deposited.ToString() );

				}
				/*else
				{
					//from.SendLocalizedMessage( 1047026 ); // That must be in your bank box to use it.
				}*/
			}
			protected override void OnTick()
			{
				m_AContract.m_TimeLeft = m_AContract.m_TimeLeft - 1;

				if ( m_AContract.m_TimeLeft > 0 )
				{
					if ( m_AContract.m_Debug == true ) m_ContractTimer = new ExpireContractDebugTimer(m_AContract.m_TimeLeft, m_AContract);
					else  m_ContractTimer = new ExpireContractTimer(m_AContract.m_TimeLeft, m_AContract);
					m_ContractTimer.Start();
					
				}
				else
				{
					if (m_AContract.m_Issuer != null ) 
					{
						BankBox box = m_AContract.m_Issuer.BankBox;
						if ( box != null )
						{

							int deposited = 0;

							int toAdd = m_AContract.m_Copper;

							Copper copper;

							while ( toAdd > 60000 )
							{
								copper = new Copper( 60000 );

								if ( box.TryDropItem( m_AContract.m_Issuer, copper, false ) )
								{
									toAdd -= 60000;
									deposited += 60000;
								}
								else
								{
									copper.Delete();

									m_AContract.m_Issuer.AddToBackpack( new BankCheck( toAdd) );
									toAdd = 0;

									break;
								}
							}

							if ( toAdd > 0 )
							{
								copper = new Copper( toAdd );

								if ( box.TryDropItem( m_AContract.m_Issuer, copper, false ) )
								{
									deposited += toAdd;
								}
								else
								{
									copper.Delete();

									m_AContract.m_Issuer.AddToBackpack( new BankCheck( toAdd ) );
								}
							}

							// Gold was deposited in your account:
							m_AContract.m_Issuer.SendLocalizedMessage( 1042672, true, " " + deposited.ToString() );

						}
						/*else
						{
							//from.SendLocalizedMessage( 1047026 ); // That must be in your bank box to use it.
						}*/
		

					}

					m_AContract.m_Expired = true;
				}
			}
Beispiel #4
0
		public override void OnDoubleClick( Mobile from )
		{
			BankBox box = from.FindBankNoCreate();

			if ( box != null && IsChildOf( box ) )
			{
				Delete();

				int deposited = 0;

				int toAdd = m_Worth;

				Copper copper;

				while ( toAdd > 60000 )
				{
					copper = new Copper( 60000 );

					if ( box.TryDropItem( from, copper, false ) )
					{
						toAdd -= 60000;
						deposited += 60000;
					}
					else
					{
						copper.Delete();

						from.AddToBackpack( new BankCheck( toAdd ) );
						toAdd = 0;

						break;
					}
				}

				if ( toAdd > 0 )
				{
					copper = new Copper( toAdd );

					if ( box.TryDropItem( from, copper, false ) )
					{
						deposited += toAdd;
					}
					else
					{
						copper.Delete();

						from.AddToBackpack( new BankCheck( toAdd ) );
					}
				}

				// Gold was deposited in your account:
				from.SendLocalizedMessage( 1042672, true, " " + deposited.ToString() );
			}
			else
			{
				from.SendLocalizedMessage( 1047026 ); // That must be in your bank box to use it.
			}
		}
		public override bool OnCopperGiven( Mobile from, Copper dropped )
		{
			if( from is PlayerMobile && dropped.Amount == 700 )
			{
				PlayerMobile pm = (PlayerMobile)from;

				if( pm.NpcGuild == NpcGuild.ThievesGuild )
				{
					from.AddToBackpack( new DisguiseKit() );

					dropped.Delete();
					return true;
				}
			}

			return base.OnCopperGiven( from, dropped );
		}
        public override bool OnCopperGiven( Mobile from, Copper dropped )
        {
            if( from is PlayerMobile && dropped.Amount == JoinCost )
            {
                PlayerMobile pm = (PlayerMobile)from;

                if( pm.NpcGuild == this.NpcGuild )
                {
                    SayTo(from, 501047); // Thou art already a member of our guild.
                }
                else if( pm.NpcGuild != NpcGuild.None )
                {
                    SayTo(from, 501046); // Thou must resign from thy other guild first.
                }
                else if( pm.GameTime < JoinGameAge || (pm.CreationTime + JoinAge) > DateTime.Now )
                {
                    SayTo(from, 501048); // You are too young to join my guild...
                }
                else if( CheckCustomReqs(pm) )
                {
                    SayWelcomeTo(from);

                    pm.NpcGuild = this.NpcGuild;
                    pm.NpcGuildJoinTime = DateTime.Now;
                    pm.NpcGuildGameTime = pm.GameTime;

                    dropped.Delete();
                    return true;
                }

                return false;
            }

            return base.OnCopperGiven(from, dropped);
        }