Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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.
             * }*/
        }
Exemplo n.º 3
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.
            }
        }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
            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;
                }
            }
Exemplo n.º 6
0
        public override void OnDoubleClick( Mobile from )
        {
            BankBox box = from.BankBox;

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

                int deposited = 0;

                int toAdd = m_Worth;

                Copper gold;

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

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

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

                        break;
                    }
                }

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

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

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

                // Gold was deposited in your account:
                from.SendMessage( "A total of " + deposited + " copper coins was deposited in your account." );

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