Inheritance: Server.Items.Item
 public override void OnDoubleClick(Mobile from)
 {
     if (!from.InRange(this.GetWorldLocation(), 1))
     {
         from.LocalOverheadMessage(MessageType.Regular, 906, 1019045); // I can't reach that.
     }
     else
     {
         Silver money = new Silver();
         money.Amount = 10;
         from.AddToBackpack(money);
         from.SendMessage("You cache in the cheque for 10 silver coins.");
         this.Delete();
     }
 }
        public void PayDay(int work, Mobile m)
        {
            int    totalpay = GetResourceAmount(typeof(Gold));
            int    Gamount  = 0;
            int    Samount  = 0;
            int    expTotal = 0;
            double dif      = (double)(work / TotalPointsRequired);
            double payout   = dif * totalpay;

            if (totalpay >= 1)
            {
                Gamount = totalpay / 1;
                Gold g = new Gold(Gamount);
                m.AddToBackpack(g);
                totalpay -= Gamount;
                totalpay *= 10;
                ConsumeTotal(typeof(Gold), Gamount);

                if (totalpay >= 1)
                {
                    Samount = totalpay / 1;
                    Silver s = new Silver(Samount);
                    m.AddToBackpack(g);
                    ConsumeTotal(typeof(Gold), 1);
                }

                m.SendMessage("You recieve {0} gold and {1} silver for your work.", Gamount, Samount);
            }

            expTotal = (int)(Gamount * (SkillLevel / 10) * (ResourcesRequired / 4));
            if (expTotal > 1)
            {
                TeiravonMobile tav = m as TeiravonMobile;
                if (Misc.Titles.AwardExp(tav, expTotal))
                {
                    tav.SendMessage("You have gained {0} experience.", expTotal);
                }
            }
        }
 public override bool OnDragDrop(Mobile from, Item dropped)
 {
     if (!(dropped is FactionSilver))
     {
         from.SendMessage("You can only drop old faction silver here.");
         return(false);
     }
     else
     {
         if (from.Backpack != null)
         {
             Silver silver = new Silver(((FactionSilver)dropped).Amount);
             from.Backpack.DropItem(silver);
             dropped.Delete();
             from.SendMessage("You successfully converted the old silver to new silver!");
         }
         else
         {
             from.SendMessage("Where is your backpack?!");
         }
         return(true);
     }
 }
Exemple #4
0
        public void Carve(Mobile from, Item item)
        {
            Effects.PlaySound(GetWorldLocation(), Map, 0x48F);
            Effects.SendLocationEffect(GetWorldLocation(), Map, 0x3728, 10, 10, 0, 0);

            if (0.3 > Utility.RandomDouble())
            {
                if (ItemID == 0xF7E)
                {
                    from.SendMessage("You destroy the bone.");
                }
                else
                {
                    from.SendMessage("You destroy the bone pile.");
                }

                Silver silver = new Silver(5, 25);

                silver.MoveToWorld(GetWorldLocation(), Map);

                Delete();

                m_Timer.Stop();
            }
            else
            {
                if (ItemID == 0xF7E)
                {
                    from.SendMessage("You damage the bone.");
                }
                else
                {
                    from.SendMessage("You damage the bone pile.");
                }
            }
        }
Exemple #5
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                base.OnTarget(from, targeted);

                if (from.GetDistanceToSqrt(m_KinSigil.Location) > 3)
                {
                    from.SendMessage("You are too far away to do that.");
                    return;
                }

                if (!(targeted != null && targeted is Silver))
                {
                    from.SendMessage("You may only pay with silver");
                    return;
                }

                Silver silver = (Silver)targeted;

                if (silver.Amount < 499)
                {
                    from.SendMessage("You need at least 500 silver for a scouting report.");
                    return;
                }

                int totalAmount = silver.Amount;

                silver.Delete();

                int newAmount = totalAmount - 500;
                int modifier  = (int)Math.Round((double)(newAmount / 100), 0.0);

                //75% chance for correct results with 0 mod
                // add 5% for each whole mod point
                if (modifier > 5)
                {
                    modifier = 5;                                //25% max  (1k silver)
                }
                string scoutReport = string.Empty;
                int    days        = GetDaysUntilSpawn();

                if (!Utility.RandomChance(75 + (5 * modifier)))
                {
                    //25% chance to be two days off
                    if (Utility.RandomChance(25))
                    {
                        days += (Utility.RandomBool() ? 2 : -2);
                    }
                    else                     //otherwise one day
                    {
                        days += (Utility.RandomBool() ? 1 : -1);
                    }

                    if (days < 0)
                    {
                        days = 0;
                    }
                    if (days < 10)
                    {
                        days = 10;
                    }
                }

                scoutReport = string.Format("Your scouts report that in its current standing, the City of {0} has about {1} days before it falls.", m_KinSigil.FactionCity.ToString(), days);

                if (Utility.RandomChance(5))
                {
                    scoutReport = "Your scout party did not make it back alive.";
                }

                from.SendMessage("Your scouts will report back within a few minutes.");
                ScoutTimer timer = new ScoutTimer(from, scoutReport);

                timer.Start();
            }