Inheritance: Item
Beispiel #1
0
        public void Target(Gold weapon)
        {
            if (!Caster.CanSee(weapon))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }

            else if (CheckSequence())
            {
                if (Caster.BeginAction(typeof(AncientFalseCoinSpell)))
                {
                    if (this.Scroll != null)
                        Scroll.Consume();
                    FakeGold fake = new FakeGold();
                    fake.m_Amount = weapon.Amount * 5;
                    fake.Name = "" + (weapon.Amount * 5) + " Gold Coins";
                    m_Fake = fake;
                    Caster.AddToBackpack(fake);
                    Caster.PlaySound(0x2E6);

                    IEntity from = new Entity(Serial.Zero, new Point3D(Caster.X, Caster.Y, Caster.Z + 50), Caster.Map);
                    IEntity to = new Entity(Serial.Zero, new Point3D(Caster.X, Caster.Y, Caster.Z), Caster.Map);
                    Effects.SendMovingParticles(from, to, 0x1EC6, 1, 0, false, false, 33, 3, 9501, 1, 0, EffectLayer.Head, 0x100);
                    StopTimer(Caster);

                    Timer t = new InternalTimer(Caster, m_Fake);

                    m_Timers[Caster] = t;

                    t.Start();
                }
            }

            FinishSequence();
        }
public override void OnDoubleClick( Mobile from )
{

if( m_Placer == null || m_Placer.Deleted )
m_Placer = from;

if( from.InRange( this.GetWorldLocation(), 10 ) )
{
if( m_Placer == null || from == m_Placer || from.AccessLevel >= AccessLevel.GameMaster )
{
Container c = m_Placer.Backpack;
Gold t = new Gold( m_Value );
if( c.TryDropItem( m_Placer, t, true ) )
{
this.Delete();
m_Placer.SendMessage( "The item disolves and gives you a refund" );
}
else
{
t.Delete();
m_Placer.SendMessage("For some reason, the refund didn't work! Please page a GM");
}
}
else
{
from.SendMessage( "Stay out of my yard!" );
}
}
else
{
from.SendMessage( "The item is too far away" );
}
}
Beispiel #3
0
			protected override void OnTick()
			{
				if(m_PilesDone >= m_PilesMax)
				{
					Stop();
					return;
				}

				Point3D p = FindGoldLocation(m_Map, m_Location, m_PilesMax / 8);
				Gold g = new Gold(m_MinAmount, m_MaxAmount);
				g.DropToWorld(p, this.m_Map);

				switch (Utility.Random(3))
				{
					case 0: // Fire column
						Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);
						Effects.PlaySound(g, g.Map, 0x208);
						break;
					case 1: // Explosion
						Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36BD, 20, 10, 5044);
						Effects.PlaySound(g, g.Map, 0x307);
						break;
					case 2: // Ball of fire
						Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36FE, 10, 10, 5052);
						break;
				}
				++m_PilesDone;
			}
            protected override void OnTick()
            {
                if (cycles == 15)
                {
                    new MovingEffectInfo(new Point3D(corpse.X, corpse.Y, 100), corpse, corpse.Map, 3823, 0, 10,
                        EffectRender.Lighten)
                        .MovingImpact(
                            e =>
                            {
                                int amount = Utility.RandomMinMax(200, 400);

                                if (amount <= 0)
                                {
                                    return;
                                }

                                var g = new Gold(amount);
                                g.MoveToWorld(e.Target.Location, e.Map);

                                new EffectInfo(e.Target, e.Map, 14202, 51, 10, 40, EffectRender.Lighten).Send();
                                Effects.PlaySound(e.Target, e.Map, g.GetDropSound());
                            });
                    Stop();
                    return;
                }
                if (count == 9)
                {
                    count = 1;
                    cycles++;
                }
                corpse.Hue = Utility.RandomBrightHue();
                corpse.Direction = (Direction) count;
                count++;
            }
Beispiel #5
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." );

				Gold gold = new Gold( 25, 100 );

				gold.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." );
			}
		}
        public void Carve( Mobile from, Item item )
        {
            Effects.PlaySound( GetWorldLocation(), Map, 0x48F );
            Effects.SendLocationEffect( GetWorldLocation(), Map, 0x3728, 10, 10, 0, 0 );

            if ( breakChance > Utility.RandomDouble() )
            {
                from.SendMessage( "You destroy the skull." );

                if( Utility.RandomDouble() < 0.1 )
                {
                    Gold gold = new Gold( 750, 1000 );
                    gold.MoveToWorld( GetWorldLocation(), Map );
                }

                Delete();

                m_Timer.Stop();
            }
            else
            {
                from.SendMessage( "You damage the skull." );
                breakChance += Utility.RandomDouble() * 0.15 + 0.15;
            }
        }
Beispiel #7
0
 public override void GenerateLoot()
 {
     AddLoot(LootPack.Food);
     AddLoot(LootPack.UtilityItems);
     AddLoot(LootPack.LeatherAr);
     Server.Items.Gold Gold = new Server.Items.Gold(12);
     AddToBackpack(Gold);
 }
Beispiel #8
0
		public override bool OnBeforeDeath()
		{
			Gold gold = new Gold( Utility.RandomMinMax( 190, 230 ) );
			gold.MoveToWorld( Location, Map );

			Effects.SendLocationEffect( Location, Map, 0x376A, 10, 1 );
			return true;
		}
Beispiel #9
0
        public static bool Deposit(Mobile from, int amount)
        {
            // If for whatever reason the TOL checks fail, we should still try old methods for depositing currency.
            if (AccountGold.Enabled && from.Account != null && from.Account.DepositGold(amount))
            {
                return true;
            }

            var box = from.FindBankNoCreate();

            if (box == null)
            {
                return false;
            }

            var items = new List<Item>();

            while (amount > 0)
            {
                Item item;
                if (amount < 5000)
                {
                    item = new Gold(amount);
                    amount = 0;
                }
                else if (amount <= 1000000)
                {
                    item = new BankCheck(amount);
                    amount = 0;
                }
                else
                {
                    item = new BankCheck(1000000);
                    amount -= 1000000;
                }

                if (box.TryDropItem(from, item, false))
                {
                    items.Add(item);
                }
                else
                {
                    item.Delete();
                    foreach (var curItem in items)
                    {
                        curItem.Delete();
                    }

                    return false;
                }
            }

            return true;
        }
		public override bool OnBeforeDeath()
		{
			if ( !base.OnBeforeDeath() )
				return false;

			Gold gold = new Gold( Utility.RandomMinMax( 240, 375 ) );
			gold.MoveToWorld( Location, Map );

			Effects.SendLocationEffect( Location, Map, 0x376A, 10, 1 );
			return true;
		}
Beispiel #11
0
		public override bool OnBeforeDeath()
		{
			Gold gold = new Gold( Utility.RandomMinMax( 190, 230 ) );
			gold.MoveToWorld( Location, Map );

			if ( Utility.Random( 3 ) == 0 )
			{
				BaseBook journal = Loot.RandomTavarasJournal();
				journal.MoveToWorld( Location, Map );
			}

			Effects.SendLocationEffect( Location, Map, 0x376A, 10, 1 );
			return true;
		}
		public override void OnClick()
		{
			Container c = m_From.Backpack;
			Gold t = new Gold( value );
			if( c.TryDropItem( m_From, t, true ) )
			{
				m_Stair.Delete();
				m_From.SendMessage( "The item disolves and gives you a refund" );
			}
			else
			{
				t.Delete();
				m_From.SendMessage("For some reason, the refund didn't work!  Please page a GM");
			}
		}
		public override bool OnBeforeDeath()
		{
			Gold gold = new Gold(150, 250);
			gold.Map = this.Map;
			gold.Location = this.Location;

			Scimitar weapon = new Scimitar();
			weapon.DamageLevel = (WeaponDamageLevel)Utility.Random( 1, 5 );
			weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random( 0, 5 );
			weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random( 0, 5 );
			weapon.Map = this.Map;
			weapon.Location = this.Location;

			this.Delete();
			return false;
		}
Beispiel #14
0
		public override bool OnGoldGiven( Mobile from, Gold 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.OnGoldGiven( from, dropped );
		}
Beispiel #15
0
        public static bool Deposit( Mobile from, int amount )
        {
            BankBox box = from.FindBankNoCreate();
            if ( box == null )
                return false;

            List<Item> items = new List<Item>();

            while ( amount > 0 )
            {
                Item item;
                if ( amount < 5000 )
                {
                    item = new Gold( amount );
                    amount = 0;
                }
                else if ( amount <= 1000000 )
                {
                    item = new BankCheck( amount );
                    amount = 0;
                }
                else
                {
                    item = new BankCheck( 1000000 );
                    amount -= 1000000;
                }

                if ( box.TryDropItem( from, item, false ) )
                {
                    items.Add( item );
                }
                else
                {
                    item.Delete();
                    foreach ( Item curItem in items )
                    {
                        curItem.Delete();
                    }

                    return false;
                }
            }

            return true;
        }
Beispiel #16
0
        public override bool OnBeforeDeath()
        {
            if (Utility.RandomDouble() < 0.05)
            {
                if (!base.OnBeforeDeath())
                    return false;

                //VileTentacles VT = new VileTentacles();
                //VT.MoveToWorld(Location, Map);
            }

            if (!base.OnBeforeDeath())
                return false;

            var gold = new Gold(Utility.RandomMinMax(1767, 1800));
            gold.MoveToWorld(Location, Map);

            Effects.SendLocationEffect(Location, Map, 0x376A, 10, 1);
            return true;
        }
		public void OnDoubleClick( Mobile from, Item item )
		{
			Effects.PlaySound( GetWorldLocation(), Map, 0x25B );
			Effects.SendLocationEffect( GetWorldLocation(), Map, 0x3728, 10, 10, 0, 0 );

			if ( 0.3 > Utility.RandomDouble() )
			{

				from.SendMessage( "You destroy the egg sac." );

				Gold gold = new Gold( 25, 100 );

				gold.MoveToWorld( GetWorldLocation(), Map );

				Delete();

				m_Timer.Stop();
			}
			else
			{
					from.SendMessage( "You damage the egg sac." );
			}
		}
Beispiel #18
0
        public void Carve(Mobile from, Item item)
        {
            Effects.PlaySound(GetWorldLocation(), Map, 0x48F);
            Effects.SendLocationEffect(GetWorldLocation(), Map, 0x3728, 10, 10, 0, 0);

            //Change to 50/50 chance you can disarm the egg.
            if (0.5 > Utility.RandomDouble())
            {

                from.SendMessage("You destroy the BonBon egg.");

                Gold gold = new Gold(25, 100);

                gold.MoveToWorld(GetWorldLocation(), Map);

                Delete();

                m_Timer.Stop();
            }
            else
            {
                from.SendMessage("You fail to break the BonBon egg.");
            }
        }
            public override void OnClick()
            {
                if (m_From.InRange(m_Fountain.GetWorldLocation(), 4))
                {
                    if (m_From.Backpack.ConsumeTotal(typeof(Gold), 1))
                    {
                        m_Fountain.Jackpot++;

                        switch (m_Fountain.MessageNum)
                        {
                        case MagicFountainAddon.FountainMessage.Cool: {
                            if (0.001 > Utility.RandomDouble())
                            {
                                Gold gold = new Gold();
                                gold.Amount = m_Fountain.Jackpot;                                         // no need to test, it's always at least 1

                                if (!m_From.AddToBackpack(gold))
                                {
                                    m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain! But you can't hold it! You accidentally drop it back in the fountain, where it vanishes.");
                                    gold.Delete();
                                }
                                else
                                {
                                    m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain!");
                                    m_Fountain.Jackpot = 0;
                                }
                            }
                            else if (0.001 > Utility.RandomDouble())
                            {
                                Gold gold = new Gold();
                                gold.Amount = m_Fountain.Jackpot;                                         // no need to test, it's always at least 1

                                if (!m_From.AddToBackpack(gold))
                                {
                                    m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain! But you can't hold it! You accidentally drop it back in the fountain, where it vanishes.");
                                    gold.Delete();
                                }
                                else
                                {
                                    m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain!");
                                    m_Fountain.Jackpot = 0;
                                }
                            }
                            else
                            {
                                m_From.SendMessage("You toss a coin in ... but nothing happens.");

                                if (Utility.RandomBool() && Utility.RandomBool())
                                {
                                    m_Fountain.Jackpot--;
                                }
                            }

                            break;
                        }


                        case MagicFountainAddon.FountainMessage.Warm: {
                            if (0.01 > Utility.RandomDouble())
                            {
                                Item item = null;

                                switch (Utility.RandomMinMax(1, 10))
                                {
                                case 1:  item = new TinkerTools();                              break;

                                case 2:  item = new Lockpick(3);                                break;

                                case 3:  item = new Pitchfork();                                break;

                                case 4:  item = new Dagger();                                   break;

                                case 5:  item = new Emerald();                                  break;

                                case 6:  item = new Ruby();                                     break;

                                case 7:  item = new Amber();                                    break;

                                case 8:  item = new Server.Engines.Mahjong.MahjongGame();       break;

                                case 9:  item = new SewingKit();                                break;

                                case 10: item = new SmithHammer();                              break;
                                }

                                if (!m_From.AddToBackpack(item))
                                {
                                    m_From.SendMessage("You toss a coin in ... and an item appears! But you can't hold it! You accidentally drop it back in the fountain, where it vanishes.");
                                    item.Delete();
                                }
                                else
                                {
                                    m_From.SendMessage("You toss a coin in ... and an item appears!");

                                    if (m_Fountain.Jackpot > 10)
                                    {
                                        m_Fountain.Jackpot -= 10;
                                    }
                                    else
                                    {
                                        m_Fountain.Jackpot = 0;
                                    }
                                }
                            }
                            else if (0.001 > Utility.RandomDouble())
                            {
                                Gold gold = new Gold();
                                gold.Amount = m_Fountain.Jackpot;                                         // no need to test, it's always at least 1

                                if (!m_From.AddToBackpack(gold))
                                {
                                    m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain! But you can't hold it! You accidentally drop it back in the fountain, where it vanishes.");
                                    gold.Delete();
                                }
                                else
                                {
                                    m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain!");
                                    m_Fountain.Jackpot = 0;
                                }
                            }
                            else
                            {
                                m_From.SendMessage("You toss a coin in ... but nothing happens.");

                                if (Utility.RandomBool() && Utility.RandomBool())
                                {
                                    m_Fountain.Jackpot--;
                                }
                            }

                            break;
                        }


                        case MagicFountainAddon.FountainMessage.Clean: {
                            if (0.05 > Utility.RandomDouble())
                            {
                                Item food = null;

                                switch (Utility.RandomMinMax(1, 7))
                                {
                                //case 1:  food = new BaconSlab();	break;
                                case 2:  food = new CookedBird();       break;

                                case 3:  food = new Ham();                      break;

                                case 4:  food = new Ribs();                     break;

                                case 5:  food = new Sausage();          break;

                                case 6:  food = new Cookies();          break;

                                case 7:  food = new Muffins(3);         break;

                                case 8:  food = new ApplePie();         break;
                                    //case 9:  food = new PeachCobbler();		break;
                                    //case 10: food = new KeyLimePie();	break;
                                }

                                if (!m_From.AddToBackpack(food))
                                {
                                    m_From.SendMessage("You toss a coin in ... and food appears! But you can't hold it! You accidentally drop it back in the fountain, where it vanishes.");
                                    food.Delete();
                                }
                                else
                                {
                                    m_From.SendMessage("You toss a coin in ... and food appears!");

                                    if (m_Fountain.Jackpot > 10)
                                    {
                                        m_Fountain.Jackpot -= 10;
                                    }
                                    else
                                    {
                                        m_Fountain.Jackpot = 0;
                                    }
                                }
                            }
                            else if (0.001 > Utility.RandomDouble())
                            {
                                Gold gold = new Gold();
                                gold.Amount = m_Fountain.Jackpot;                                         // no need to test, it's always at least 1

                                if (!m_From.AddToBackpack(gold))
                                {
                                    m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain! But you can't hold it! You accidentally drop it back in the fountain, where it vanishes.");
                                    gold.Delete();
                                }
                                else
                                {
                                    m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain!");
                                    m_Fountain.Jackpot = 0;
                                }
                            }
                            else
                            {
                                m_From.SendMessage("You toss a coin in ... but nothing happens.");

                                if (Utility.RandomBool() && Utility.RandomBool())
                                {
                                    m_Fountain.Jackpot--;
                                }
                            }

                            break;
                        }

                        case MagicFountainAddon.FountainMessage.Calm: {
                            if (0.01 > Utility.RandomDouble())
                            {
                                Horse horse = new Horse();

                                horse.Map      = m_From.Map;
                                horse.Location = m_From.Location;

                                if ((m_From.Followers + horse.ControlSlots) <= m_From.FollowersMax)
                                {
                                    horse.Controlled = true;

                                    horse.ControlMaster = m_From;

                                    m_From.SendMessage("You toss a coin in ... and a horse appears!");
                                }
                                else
                                {
                                    m_From.SendMessage("You toss a coin in ... and a horse appears! But you have too many pets to control this one too. The horse runs off!");
                                    horse.Delete();
                                }


                                if (m_Fountain.Jackpot > 50)
                                {
                                    m_Fountain.Jackpot -= 50;
                                }
                                else
                                {
                                    m_Fountain.Jackpot = 0;
                                }
                            }
                            else if (0.001 > Utility.RandomDouble())
                            {
                                Gold gold = new Gold();
                                gold.Amount = m_Fountain.Jackpot;                                         // no need to test, it's always at least 1

                                if (!m_From.AddToBackpack(gold))
                                {
                                    m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain! But you can't hold it! You accidentally drop it back in the fountain, where it vanishes.");
                                    gold.Delete();
                                }
                                else
                                {
                                    m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain!");
                                    m_Fountain.Jackpot = 0;
                                }
                            }
                            else
                            {
                                m_From.SendMessage("You toss a coin in ... but nothing happens.");

                                if (Utility.RandomBool() && Utility.RandomBool())
                                {
                                    m_Fountain.Jackpot--;
                                }
                            }

                            break;
                        }


                        case MagicFountainAddon.FountainMessage.Fruit: {
                            if (0.05 > Utility.RandomDouble())
                            {
                                Item fruit = null;

                                switch (Utility.RandomMinMax(1, 10))
                                {
                                case 1:  fruit = new Watermelon();      break;

                                case 2:  fruit = new Apple();           break;

                                case 3:  fruit = new Pear();            break;

                                case 4:  fruit = new Peach();           break;

                                case 5:  fruit = new Lime();            break;

                                case 6:  fruit = new Lemon();           break;

                                case 7:  fruit = new Coconut();         break;

                                case 8:  fruit = new Grapes();          break;

                                case 9:  fruit = new Bananas();         break;

                                case 10: fruit = new Cantaloupe();      break;
                                }

                                if (!m_From.AddToBackpack(fruit))
                                {
                                    m_From.SendMessage("You toss a coin in ... and fruit appears! But you can't hold it! You accidentally drop it back in the fountain, where it vanishes.");
                                    fruit.Delete();
                                }
                                else
                                {
                                    m_From.SendMessage("You toss a coin in ... and fruit appears!");

                                    if (m_Fountain.Jackpot > 10)
                                    {
                                        m_Fountain.Jackpot -= 10;
                                    }
                                    else
                                    {
                                        m_Fountain.Jackpot = 0;
                                    }
                                }
                            }
                            else if (0.001 > Utility.RandomDouble())
                            {
                                Gold gold = new Gold();
                                gold.Amount = m_Fountain.Jackpot;                                         // no need to test, it's always at least 1

                                if (!m_From.AddToBackpack(gold))
                                {
                                    m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain! But you can't hold it! You accidentally drop it back in the fountain, where it vanishes.");
                                    gold.Delete();
                                }
                                else
                                {
                                    m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain!");
                                    m_Fountain.Jackpot = 0;
                                }
                            }
                            else
                            {
                                m_From.SendMessage("You toss a coin in ... but nothing happens.");

                                if (Utility.RandomBool() && Utility.RandomBool())
                                {
                                    m_Fountain.Jackpot--;
                                }
                            }

                            break;
                        }
                        }
                    }
                    else
                    {
                        m_From.SendMessage("You don't have a coin to toss.");
                    }
                }
                else
                {
                    m_From.SendMessage("Get closer.");
                }
            }
        public static bool GiveRewardTo( PlayerMobile player )
        {
            Gold gold = new Gold( Utility.RandomMinMax( 250, 350 ) );

            if ( player.PlaceInBackpack( gold ) )
            {
                player.SendLocalizedMessage( 1054076 ); // You have been given some gold.
                return true;
            }
            else
            {
                gold.Delete();
                return false;
            }
        }
Beispiel #21
0
		public virtual bool OnGoldGiven( Mobile from, Gold 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 gold?" );

				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 virtual bool CheckAtDestination()
        {
            EDI dest = GetDestination();

            if ( dest == null )
                return false;

            Mobile escorter = GetEscorter();

            if ( escorter == null )
                return false;

            if ( dest.Contains( Location ) )
            {
                Say( 1042809, escorter.Name ); // We have arrived! I thank thee, ~1_PLAYER_NAME~! I have no further need of thy services. Here is thy pay.

                // not going anywhere
                m_Destination = null;
                m_DestinationString = null;

                Container cont = escorter.Backpack;

                if ( cont == null )
                    cont = escorter.BankBox;

                Gold gold = new Gold( 500, 1000 );

                if ( cont == null || !cont.TryDropItem( escorter, gold, false ) )
                    gold.MoveToWorld( escorter.Location, escorter.Map );

                StopFollow();
                SetControlMaster( null );
                m_EscortTable.Remove( escorter );
                BeginDelete();

                Misc.Titles.AwardFame( escorter, 10, true );

                bool gainedPath = false;

                PlayerMobile pm = escorter as PlayerMobile;

                if ( pm != null )
                {
                    if ( pm.CompassionGains > 0 && DateTime.Now > pm.NextCompassionDay )
                    {
                        pm.NextCompassionDay = DateTime.MinValue;
                        pm.CompassionGains = 0;
                    }

                    if ( pm.CompassionGains >= 5 ) // have already gained 5 points in one day, can gain no more
                    {
                        pm.SendLocalizedMessage( 1053004 ); // You must wait about a day before you can gain in compassion again.
                    }
                    else if ( VirtueHelper.Award( pm, VirtueName.Compassion, 1, ref gainedPath ) )
                    {
                        if ( gainedPath )
                            pm.SendLocalizedMessage( 1053005 ); // You have achieved a path in compassion!
                        else
                            pm.SendLocalizedMessage( 1053002 ); // You have gained in compassion.

                        pm.NextCompassionDay = DateTime.Now + TimeSpan.FromDays( 1.0 ); // in one day CompassionGains gets reset to 0
                        ++pm.CompassionGains;
                    }
                    else
                    {
                        pm.SendLocalizedMessage( 1053003 ); // You have achieved the highest path of compassion and can no longer gain any further.
                    }
                }

                return true;
            }

            return false;
        }
Beispiel #23
0
        private void FillChest()
        {
            int RaresDropped = 0;
            LogHelper Logger = new LogHelper("PirateChampChest.log", false);

            // 25 piles * 1200 = 30K gold
            for (int ix = 0; ix < 25; ix++)
            {   // force the separate piles
                Gold gold = new Gold(800, 1200);
                gold.Stackable = false;
                m_MetalChest.DropItem(gold);
                gold.Stackable = true;
            }

            // "a smelly old mackerel"
            if (Utility.RandomChance(10))
            {
                Item ii;
                ii = new BigFish();
                ii.Name = "a smelly old mackerel";
                ii.Weight = 5;
                m_MetalChest.DropItem(ii);
                RaresDropped++;
                Logger.Log(LogType.Item, ii);
            }

            // single gold ingot weight 12
            if (Utility.RandomChance(10 * 2))
            {
                Item ii;
                if (Utility.RandomBool())
                    ii = new Item(7145);
                else
                    ii = new Item(7148);

                ii.Weight = 12;
                m_MetalChest.DropItem(ii);
                RaresDropped++;
                Logger.Log(LogType.Item, ii);
            }

            // 3 gold ingots 12*3
            if (Utility.RandomChance(5 * 2))
            {
                Item ii;
                if (Utility.RandomBool())
                    ii = new Item(7146);
                else
                    ii = new Item(7149);

                ii.Weight = 12 * 3;
                m_MetalChest.DropItem(ii);
                RaresDropped++;
                Logger.Log(LogType.Item, ii);
            }

            // 5 gold ingots 12*5
            if (Utility.RandomChance(1 * 2))
            {
                Item ii;
                if (Utility.RandomBool())
                    ii = new Item(7147);
                else
                    ii = new Item(7150);

                ii.Weight = 12 * 5;
                m_MetalChest.DropItem(ii);
                RaresDropped++;
                Logger.Log(LogType.Item, ii);
            }

            // single silver ingot weight 6
            if (Utility.RandomChance(10 * 2))
            {
                Item ii;
                if (Utility.RandomBool())
                    ii = new Item(7157);
                else
                    ii = new Item(7160);

                ii.Weight = 6;
                m_MetalChest.DropItem(ii);
                RaresDropped++;
                Logger.Log(LogType.Item, ii);
            }

            // 3 silver ingots 6*3
            if (Utility.RandomChance(5 * 2))
            {
                Item ii;
                if (Utility.RandomBool())
                    ii = new Item(7158);
                else
                    ii = new Item(7161);

                ii.Weight = 6 * 3;
                m_MetalChest.DropItem(ii);
                RaresDropped++;
                Logger.Log(LogType.Item, ii);
            }

            // 5 silver ingots 6*5
            if (Utility.RandomChance(1 * 2))
            {
                Item ii;
                if (Utility.RandomBool())
                    ii = new Item(7159);
                else
                    ii = new Item(7162);

                ii.Weight = 6 * 5;
                m_MetalChest.DropItem(ii);
                RaresDropped++;
                Logger.Log(LogType.Item, ii);
            }

            // rolled map w1
            if (Utility.RandomChance(20 * 2))
            {
                Item ii;
                if (Utility.RandomBool())
                    ii = new Item(5357);
                else
                    ii = new Item(5358);

                ii.Weight = 1;
                m_MetalChest.DropItem(ii);
                RaresDropped++;
                Logger.Log(LogType.Item, ii);
            }

            // ship plans
            if (Utility.RandomChance(10 * 2))
            {
                Item ii;
                if (Utility.RandomBool())
                    ii = new Item(5361);
                else
                    ii = new Item(5362);

                ii.Weight = 1;
                m_MetalChest.DropItem(ii);
                RaresDropped++;
                Logger.Log(LogType.Item, ii);
            }

            // ship model
            if (Utility.RandomChance(5 * 2))
            {
                Item ii;
                if (Utility.RandomBool())
                    ii = new Item(5363);
                else
                    ii = new Item(5364);

                ii.Weight = 3;
                m_MetalChest.DropItem(ii);
                RaresDropped++;
                Logger.Log(LogType.Item, ii);
            }

            // "scale shield" w6
            if (Utility.RandomChance(1))
            {
                Item ii;
                if (Utility.RandomBool())
                    ii = new Item(7110);
                else
                    ii = new Item(7111);

                ii.Name = "scale shield";
                ii.Weight = 6;
                m_MetalChest.DropItem(ii);
                RaresDropped++;
                Logger.Log(LogType.Item, ii);
            }

            // level 5 chest regs & gems
            TreasureMapChest.PackRegs(m_MetalChest, 5 * 10);
            TreasureMapChest.PackGems(m_MetalChest, 5 * 5);

            // level 5 magic items
            DungeonTreasureChest.PackMagicItem(m_MetalChest, 3, 3, 0.20);
            DungeonTreasureChest.PackMagicItem(m_MetalChest, 3, 3, 0.10);
            DungeonTreasureChest.PackMagicItem(m_MetalChest, 3, 3, 0.05);

            // an a level 5 treasure map
            m_MetalChest.DropItem(new TreasureMap(5, Map.Felucca));

            Logger.Finish();
        }
        public void SetBuyIn(PlayerMobile pm, int amount)
        {
            Item i = CheckForGoldSources(pm, amount);

            if (i is Gold)
            {
                i.Amount -= amount;
                Handeling.BuyIn += amount;
            }
            else
            {
                BankCheck check = (BankCheck)i;

                check.Worth -= amount;
                Handeling.BuyIn += amount;
            }

            if (i.Amount <= 0)
            {
                i.Delete();
                return;
            }

            if (i is BankCheck)
            {
                BankCheck check = (BankCheck)i;

                if (check.Worth > 0)
                {
                    if (check.Worth < 5000)
                    {
                        if (check.Parent is BankBox)
                        {
                            BankBox box = (BankBox)check.Parent;

                            Gold g = new Gold(check.Worth);
                            box.DropItem(g);

                            check.Delete();
                        }

                        if (check.Parent is Backpack)
                        {
                            Backpack pack = (Backpack)check.Parent;

                            Gold g = new Gold(check.Worth);
                            pack.DropItem(g);

                            check.Delete();
                        }
                    }
                }
                else
                    check.Delete();
            }

            pm.SendMessage("The funds have been gathered.");
        }
Beispiel #25
0
        public override void Open(Mobile from)
        {
            if (this.Weight > 10.0)
            {
                int nStolen = Utility.RandomMinMax(1, 3);

                if (nStolen == 1)
                {
                    Item i = Loot.RandomArty();
                    DropItem(i);
                    BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                }
                else if (nStolen == 2)
                {
                    Item i = DungeonLoot.RandomSlayer();
                    DropItem(i);
                    BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                }
                else if (nStolen < 5)
                {
                    Item i = Loot.RandomSArty();
                    DropItem(i);
                    BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                }
                else if (nStolen < 9)
                {
                    Item i = Loot.RandomRelic();
                    DropItem(i);
                    BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                }
                else
                {
                    Item idropped = DungeonLoot.RandomRare();
                    if (idropped is OilLeather || idropped is OilMetal)
                    {
                        idropped.Amount = Utility.RandomMinMax(1, 8);
                    }
                    else if (idropped is MagicalDyes)
                    {
                        idropped.Amount = Utility.RandomMinMax(3, 10);
                    }
                    else if (idropped.Stackable == true)
                    {
                        idropped.Amount = Utility.RandomMinMax(5, 20);
                    }
                    DropItem(idropped);
                    BaseContainer.DropItemFix(idropped, from, ItemID, GumpID);
                }

                int money = Utility.RandomMinMax(1000, 4000);

                double w = money * (MyServerSettings.GetGoldCutRate() * .01);
                money = (int)w;
                Item g = new Gold(money);
                DropItem(g);
                BaseContainer.DropItemFix(g, from, ItemID, GumpID);

                this.Weight = 10.0;
            }

            base.Open(from);
        }
Beispiel #26
0
        public override bool OnGoldGiven( Mobile from, Gold 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.UtcNow )
                {
                    SayTo( from, 501048 ); // You are too young to join my guild...
                }
                else if ( CheckCustomReqs( pm ) )
                {
                    SayWelcomeTo( from );

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

                    dropped.Delete();
                    return true;
                }

                return false;
            }

            return base.OnGoldGiven( from, dropped );
        }
Beispiel #27
0
        public static void Fill(LockableContainer cont, int level)
        {
            cont.Movable = false;
            cont.Locked  = true;

            if (level == 0)
            {
                cont.LockLevel = 0;                 // Can't be unlocked

                cont.DropItem(new Gold(Utility.RandomMinMax(200, 300)));

                if (Utility.RandomDouble() < 0.75)
                {
                    cont.DropItem(new TreasureMap(0, Map.Felucca));
                }
            }
            else
            {
                cont.TrapType  = TrapType.ExplosionTrap;
                cont.TrapPower = level * 25;
                cont.TrapLevel = level;

                switch (level)
                {
                case 1: cont.RequiredSkill = 35; break;

                case 2: cont.RequiredSkill = 50; break;

                case 3: cont.RequiredSkill = 75; break;

                case 4: cont.RequiredSkill = 90; break;

                case 5: cont.RequiredSkill = 98; break;

                case 6: cont.RequiredSkill = 100; break;
                }

                cont.LockLevel    = cont.RequiredSkill - 10;
                cont.MaxLockLevel = cont.RequiredSkill + 40;

                var gold = new Gold(level * 500);
                if (level == 6)
                {
                    gold.Amount = 5000;
                }

                cont.DropItem(gold);

                int reagents = level == 0 ? 4 : 8;

                for (int i = 0; i < reagents; i++)
                {
                    Item item = Loot.RandomPossibleReagent();
                    item.Amount = RegsPerLevel[level];
                    cont.DropItem(item);
                }

                for (int i = 0; i < level * 3; ++i)
                {
                    cont.DropItem(Loot.RandomScroll(0, Math.Min(47, (level + 1) * 8 - 1), SpellbookType.Regular));
                }

                int minimumMod = 1;
                int maximumMod = MaxModPerLevel[level];

                //Luthius Expansion
                double craftingComponentLoops = 4;
                double prestigeScrollLoops    = 3;
                double spellHueDeedLoops      = 1;

                double craftingComponentChance = .02;
                double prestigeScrollChance    = .1;
                double spellHueDeedChance      = .005;

                switch (level)
                {
                case 1:
                    craftingComponentChance = .10;
                    prestigeScrollChance    = .1;
                    spellHueDeedChance      = .005;
                    break;

                case 2:
                    craftingComponentChance = .15;
                    prestigeScrollChance    = .2;
                    spellHueDeedChance      = .01;
                    break;

                case 3:
                    craftingComponentChance = .20;
                    prestigeScrollChance    = .3;
                    spellHueDeedChance      = .015;
                    break;

                case 4:
                    craftingComponentChance = .25;
                    prestigeScrollChance    = .4;
                    spellHueDeedChance      = .02;
                    break;

                case 5:
                    craftingComponentChance = .30;
                    prestigeScrollChance    = .5;
                    spellHueDeedChance      = .025;
                    break;

                case 6:
                    craftingComponentChance = .40;
                    prestigeScrollChance    = .6;
                    spellHueDeedChance      = .03;
                    break;
                }

                for (int a = 0; a < craftingComponentLoops; a++)
                {
                    if (Utility.RandomDouble() <= craftingComponentChance)
                    {
                        cont.DropItem(CraftingComponent.GetRandomCraftingComponent(1));
                    }
                }

                for (int a = 0; a < prestigeScrollLoops; a++)
                {
                    if (Utility.RandomDouble() <= prestigeScrollChance)
                    {
                        cont.DropItem(new PrestigeScroll());
                    }
                }

                for (int a = 0; a < spellHueDeedLoops; a++)
                {
                    if (Utility.RandomDouble() <= spellHueDeedChance)
                    {
                        cont.DropItem(new SpellHueDeed());
                    }
                }

                for (int i = 0; i < ItemsPerLevel[level]; ++i)
                {
                    if (Utility.RandomDouble() < 0.30)
                    {
                        BaseWeapon weapon = Loot.RandomWeapon();
                        weapon.DamageLevel     = (WeaponDamageLevel)Utility.RandomMinMax(minimumMod, maximumMod);
                        weapon.AccuracyLevel   = (WeaponAccuracyLevel)Utility.RandomMinMax(minimumMod, maximumMod);
                        weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.RandomMinMax(minimumMod, maximumMod);

                        cont.DropItem(weapon);
                    }
                    else
                    {
                        BaseArmor armor = Loot.RandomArmorOrShield();
                        armor.ProtectionLevel = (ArmorProtectionLevel)Utility.RandomMinMax(minimumMod, maximumMod);
                        armor.DurabilityLevel = (ArmorDurabilityLevel)Utility.RandomMinMax(minimumMod, maximumMod);

                        cont.DropItem(armor);
                    }
                }
            }

            for (int i = 0; i < level; i++)
            {
                Item item = Loot.RandomGem();
                item.Amount = GemsPerLevel[level];
                cont.DropItem(item);
            }

            // rares
            if (level == 6 && Utility.Random(50) == 0)
            {
                cont.DropItem(new SpecialHairDye());
            }

            switch (level)
            {
            case 6:
                if (Utility.RandomDouble() < 0.09)
                {
                    cont.DropItem(PowerScroll.CreateRandom(5, 10));
                }
                break;

            case 5:
                if (Utility.RandomDouble() < 0.06)
                {
                    cont.DropItem(new RareSandals());
                }
                break;

            case 4:
                if (Utility.RandomDouble() < 0.03)
                {
                    cont.DropItem(new BossCloth());
                }
                break;

            default:
                if (Utility.RandomDouble() < RareChancePerLevel[level])
                {
                    int index = Utility.Random(LootPack.RareCraftingIngredients.Length);
                    var rare  = LootPack.RareCraftingIngredients[index].Construct();
                    cont.DropItem(rare);
                }
                break;
            }

            int chance = 610 - (100 * level);

            if (Utility.Random(chance) == 0)
            {
                cont.DropItem(new RareCloth());
            }
        }
Beispiel #28
0
        public void OnChop(Mobile from)
        {
            if (from.InRange(this.GetWorldLocation(), 2))
            {
                Effects.SendLocationEffect(Location, Map, 0x3728, 20, 10);  //smoke or dust
                Effects.PlaySound(Location, Map, 0x11C);

                switch (Utility.Random(12))
                {
                case 0:
                    Effects.SendLocationEffect(from, from.Map, 0x113A, 20, 10);       //Posion Player
                    from.PlaySound(0x231);
                    from.ApplyPoison(from, Poison.Regular);
                    break;

                case 1:
                    Effects.SendLocationEffect(from, from.Map, 0x3709, 30);     //Burn Player
                    from.PlaySound(0x54);
                    AOS.Damage(from, from, Utility.RandomMinMax(10, 40), 0, 100, 0, 0, 0);
                    break;

                case 2:
                    new BarrelLid().MoveToWorld(Location, Map);
                    new BarrelHoops().MoveToWorld(Location, Map);
                    break;

                case 3:
                    Bandage b = new Bandage(Utility.RandomMinMax(50, 100));
                    b.MoveToWorld(Location, Map);
                    break;

                case 4:
                    new BarrelStaves().MoveToWorld(Location, Map);
                    new BarrelHoops().MoveToWorld(Location, Map);
                    break;

                case 5:
                    Gold g = new Gold(Utility.RandomMinMax(100, 1000));
                    g.MoveToWorld(Location, Map);
                    break;

                case 6:
                    new CurePotion().MoveToWorld(Location, Map);
                    break;

                case 7:
                    new GreaterCurePotion().MoveToWorld(Location, Map);
                    break;

                case 8:
                    new HealPotion().MoveToWorld(Location, Map);
                    break;

                case 9:
                    new GreaterHealPotion().MoveToWorld(Location, Map);
                    break;

                case 10:
                    CoralSnake S1 = new CoralSnake();
                    CoralSnake S2 = new CoralSnake();
                    S1.MoveToWorld(new Point3D(((DungeonBarrel)this).X, ((DungeonBarrel)this).Y, ((DungeonBarrel)this).Z), ((DungeonBarrel)this).Map);
                    S2.MoveToWorld(new Point3D(((DungeonBarrel)this).X, ((DungeonBarrel)this).Y, ((DungeonBarrel)this).Z), ((DungeonBarrel)this).Map);
                    from.SendMessage("The barrel was infested with snakes!");
                    break;

                case 11:
                    RottingCorpse S3 = new RottingCorpse();
                    S3.MoveToWorld(new Point3D(((DungeonBarrel)this).X, ((DungeonBarrel)this).Y, ((DungeonBarrel)this).Z), ((DungeonBarrel)this).Map);
                    from.SendMessage("You have awakened a rotting corpse!");
                    break;
                }
                Destroy();
            }
            else
            {
                from.SendLocalizedMessage(500446);   // That is too far away.
            }
        }
Beispiel #29
0
        public override void OnDoubleClick(Mobile from)
        {
            BankBox box = from.BankBox;

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

                int deposited = 0;

                int toAdd = m_Worth;

                Gold gold;

                while (toAdd > 60000)
                {
                    gold = new Gold(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 Gold(toAdd);

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

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

                from.SendAsciiMessage("Gold was deposited in your account: " + deposited.ToString());

                PlayerMobile pm = from as PlayerMobile;

                if (pm != null)
                {
                    QuestSystem qs = pm.Quest;

                    if (qs is Necro.DarkTidesQuest)
                    {
                        QuestObjective obj = qs.FindObjective(typeof(Necro.CashBankCheckObjective));

                        if (obj != null && !obj.Completed)
                        {
                            obj.Complete();
                        }
                    }

                    if (qs is Haven.UzeraanTurmoilQuest)
                    {
                        QuestObjective obj = qs.FindObjective(typeof(Haven.CashBankCheckObjective));

                        if (obj != null && !obj.Completed)
                        {
                            obj.Complete();
                        }
                    }
                }
            }
            else
            {
                from.SendAsciiMessage("That must be in your bank box to use it.");
            }
        }
Beispiel #30
0
        public override void OnDoubleClick(Mobile from)
        {
            // This probably isn't OSI accurate, but we can't just make the quests redundant.
            // Double-clicking the BankCheck in your pack will now credit your account.

            var box = AccountGold.Enabled ? from.Backpack : from.FindBankNoCreate();

            if (box == null || !IsChildOf(box))
            {
                from.SendLocalizedMessage(AccountGold.Enabled ? 1080058 : 1047026);
                // This must be in your backpack to use it. : That must be in your bank box to use it.
                return;
            }

            Delete();

            var deposited = 0;
            var toAdd     = m_Worth;

            if (AccountGold.Enabled && from.Account != null && from.Account.DepositGold(toAdd))
            {
                deposited = toAdd;
                toAdd     = 0;
            }

            if (toAdd > 0)
            {
                Gold gold;

                while (toAdd > 60000)
                {
                    gold = new Gold(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 Gold(toAdd);

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

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

            // Gold was deposited in your account:
            from.SendLocalizedMessage(1042672, true, deposited.ToString("#,0"));
        }
Beispiel #31
0
        public override void OnDoubleClick(Mobile from)
        {
            // This probably isn't OSI accurate, but we can't just make the quests redundant.
            // Double-clicking the BankCheck in your pack will now credit your account.

            var box = AccountGold.Enabled ? from.Backpack : from.FindBankNoCreate();

            if (box == null || !IsChildOf(box))
            {
                from.SendLocalizedMessage(AccountGold.Enabled ? 1080058 : 1047026);
                // This must be in your backpack to use it. : That must be in your bank box to use it.
                return;
            }

            Delete();

            var deposited = 0;
            var toAdd     = m_Worth;

            if (AccountGold.Enabled && from.Account != null && from.Account.DepositGold(toAdd))
            {
                deposited = toAdd;
                toAdd     = 0;
            }

            if (toAdd > 0)
            {
                Gold gold;

                while (toAdd > 60000)
                {
                    gold = new Gold(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 Gold(toAdd);

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

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

            // Gold was deposited in your account:
            from.SendLocalizedMessage(1042672, true, deposited.ToString("#,0"));

            var pm = from as PlayerMobile;

            if (pm != null)
            {
                var qs = pm.Quest;

                if (qs is Necro.DarkTidesQuest)
                {
                    var obj = qs.FindObjective(typeof(Necro.CashBankCheckObjective));

                    if (obj != null && !obj.Completed)
                    {
                        obj.Complete();
                    }
                }

                if (qs is Haven.UzeraanTurmoilQuest)
                {
                    var obj = qs.FindObjective(typeof(Engines.Quests.Haven.CashBankCheckObjective));

                    if (obj != null && !obj.Completed)
                    {
                        obj.Complete();
                    }
                }
            }
        }
                protected override void OnTick()
                {
                    Container theirPack = m_Target.Backpack;

                    double badKarmaChance = 0.5 - ((double)m_From.Karma / 8570);

                    if ( theirPack == null )
                    {
                        m_From.SendLocalizedMessage( 500404 ); // They seem unwilling to give you any money.
                    }
                    else if ( m_From.Karma < 0 && badKarmaChance > Utility.RandomDouble() )
                    {
                        m_Target.PublicOverheadMessage( MessageType.Regular, m_Target.SpeechHue, 500406 ); // Thou dost not look trustworthy... no gold for thee today!
                    }
                    else if ( m_From.CheckTargetSkill( SkillName.Begging, m_Target, 0.0, 100.0 ) )
                    {
                        int toConsume = theirPack.GetAmount( typeof( Gold ) ) / 10;
                        int max = 10 + (m_From.Fame / 2500);

                        if ( max > 14 )
                            max = 14;
                        else if ( max < 10 )
                            max = 10;

                        if ( toConsume > max )
                            toConsume = max;

                        if ( toConsume > 0 )
                        {
                            int consumed = theirPack.ConsumeUpTo( typeof( Gold ), toConsume );

                            if ( consumed > 0 )
                            {
                                m_Target.PublicOverheadMessage( MessageType.Regular, m_Target.SpeechHue, 500405 ); // I feel sorry for thee...

                                Gold gold = new Gold( consumed );

                                m_From.AddToBackpack( gold );
                                m_From.PlaySound( gold.GetDropSound() );

                                if ( m_From.Karma > -3000 )
                                {
                                    int toLose = m_From.Karma + 3000;

                                    if ( toLose > 40 )
                                        toLose = 40;

                                    Titles.AwardKarma( m_From, -toLose, true );
                                }
                            }
                            else
                            {
                                m_Target.PublicOverheadMessage( MessageType.Regular, m_Target.SpeechHue, 500407 ); // I have not enough money to give thee any!
                            }
                        }
                        else
                        {
                            m_Target.PublicOverheadMessage( MessageType.Regular, m_Target.SpeechHue, 500407 ); // I have not enough money to give thee any!
                        }
                    }
                    else
                    {
                        m_Target.SendLocalizedMessage( 500404 ); // They seem unwilling to give you any money.
                    }

                    m_From.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds( 10.0 );
                }
Beispiel #33
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            if (!Ledger.IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
                return;
            }

            switch (info.ButtonID)
            {
            case 0:     //Close
            {
                int[] switches = info.Switches;

                for (int i = 0; i < switches.Length; i++)
                {
                    if (switches[i] == 2)
                    {
                        Ledger.i_Selection = 0;
                    }
                    if (switches[i] == 3)
                    {
                        Ledger.i_Selection = 1;
                    }
                }

                Ledger.b_open = false;
                from.SendMessage(2125, "You close your gold ledger.");
                break;
            }

            case 1:     //Withdraw Currency
            {
                string WithdrawString = info.GetTextEntry(4).Text.Replace(",", "");

                if (WithdrawString != null)
                {
                    int WithdrawAmount = 0;

                    try
                    {
                        WithdrawAmount = Convert.ToInt32(WithdrawString, 10);
                    }
                    catch
                    {
                        //from.SendGump(new GoldLedgerGump(Ledger));  // Commented out to keep from getting multiple gumps.
                        from.SendMessage(2125, "You can't withdraw letters, silly! Only numbers!");
                    }

                    int[] switches = info.Switches;

                    for (int i = 0; i < switches.Length; i++)
                    {
                        if (switches[i] == 2)
                        {
                            Ledger.i_Selection = 0;
                        }
                        if (switches[i] == 3)
                        {
                            Ledger.i_Selection = 1;
                        }
                    }

                    if (WithdrawAmount < 0)
                    {
                        from.SendGump(new GoldLedgerGump(Ledger));
                        from.SendMessage(2125, "You can't withdraw negative gold, silly!");
                        return;
                    }

                    if (WithdrawAmount == 0)
                    {
                        from.SendGump(new GoldLedgerGump(Ledger));
                        return;
                    }

                    if (WithdrawAmount > Ledger.Gold)
                    {
                        WithdrawAmount = Ledger.Gold;
                    }

                    if (Ledger.i_Selection == 0)
                    {
                        double maxWeight       = (WeightOverloading.GetMaxWeight(from));
                        double newledgerweight = ((Ledger.Gold - WithdrawAmount) * Ledger.d_WeightScale);
                        double curWeight       = ((Mobile.BodyWeight + from.TotalWeight) - (Ledger.Weight - newledgerweight));

                        double maxGold = ((maxWeight - (Mobile.BodyWeight + from.TotalWeight)) / (((GoldLedger.GoldWeight > Ledger.d_WeightScale) ? GoldLedger.GoldWeight : Ledger.d_WeightScale) - ((GoldLedger.GoldWeight > Ledger.d_WeightScale) ? Ledger.d_WeightScale : GoldLedger.GoldWeight)));

                        if ((int)maxGold < 1)
                        {
                            from.SendGump(new GoldLedgerGump(Ledger));
                            from.SendMessage(2125, "You can't carry that many stones.");
                        }
                        else
                        {
                            if (WithdrawAmount > (int)maxGold)
                            {
                                WithdrawAmount = (int)maxGold;
                                from.SendMessage(2125, "You can only withdraw {0} stones' worth of gold.", (int)Math.Ceiling((int)maxGold * GoldLedger.GoldWeight));
                            }

                            Ledger.Gold -= WithdrawAmount;
                            from.SendGump(new GoldLedgerGump(Ledger));
                            Ledger.AppendWeight();

                            int toAdd = WithdrawAmount;

                            Gold gold;
                            int  sixtyk = 60000;

                            while (toAdd > sixtyk)
                            {
                                gold = new Gold(sixtyk);

                                toAdd -= sixtyk;
                                from.Backpack.AddItem(gold);
                                from.SendMessage(2125, "You withdraw {0} gold from your gold ledger.", sixtyk.ToString("#,0"));
                            }

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

                                from.Backpack.AddItem(gold);
                                from.SendMessage(2125, "You withdraw {0} gold from your gold ledger.", toAdd.ToString("#,0"));
                            }

                            from.PlaySound(0x2E6);
                        }
                    }
                    else if (Ledger.i_Selection == 1)
                    {
                        BankCheck check = new BankCheck(WithdrawAmount);

                        Ledger.Gold -= WithdrawAmount;
                        Ledger.AppendWeight();
                        from.Backpack.AddItem(check);
                        from.SendGump(new GoldLedgerGump(Ledger));
                        from.PlaySound(0x42);
                        from.SendMessage(2125, "You withdraw a bank check worth {0} gold from your gold ledger.", WithdrawAmount.ToString("#,0"));
                    }
                }

                break;
            }

            case 5:     //Deposit Currency
            {
                int[] switches = info.Switches;

                for (int i = 0; i < switches.Length; i++)
                {
                    if (switches[i] == 2)
                    {
                        Ledger.i_Selection = 0;
                    }
                    if (switches[i] == 3)
                    {
                        Ledger.i_Selection = 1;
                    }
                }

                from.SendGump(new GoldLedgerGump(Ledger));
                Ledger.BeginAddGold(from);

                break;
            }

            case 6:     //Gold Sweeper
            {
                int[] switches = info.Switches;

                for (int i = 0; i < switches.Length; i++)
                {
                    if (switches[i] == 2)
                    {
                        Ledger.i_Selection = 0;
                    }
                    if (switches[i] == 3)
                    {
                        Ledger.i_Selection = 1;
                    }
                }

                if (Ledger.GoldSweeper)
                {
                    Ledger.GoldSweeper = false;
                    from.SendGump(new GoldLedgerGump(Ledger));
                    from.SendMessage(2125, "Gold Sweeper: Disabled");
                }
                else
                {
                    Ledger.GoldSweeper = true;
                    from.SendGump(new GoldLedgerGump(Ledger));
                    from.SendMessage(2125, "Gold Sweeper: Enabled");
                }

                break;
            }

            case 7:     //Auto-Loot
            {
                int[] switches = info.Switches;

                for (int i = 0; i < switches.Length; i++)
                {
                    if (switches[i] == 2)
                    {
                        Ledger.i_Selection = 0;
                    }
                    if (switches[i] == 3)
                    {
                        Ledger.i_Selection = 1;
                    }
                }

                if (Ledger.GoldAutoLoot)
                {
                    Ledger.GoldAutoLoot = false;
                    from.SendGump(new GoldLedgerGump(Ledger));
                    from.SendMessage(2125, "Gold Looting: Manual");
                }
                else
                {
                    Ledger.GoldAutoLoot = true;
                    from.SendGump(new GoldLedgerGump(Ledger));
                    from.SendMessage(2125, "Gold Looting: Automatic");
                }

                break;
            }

            case 8:     //Help
            {
                from.SendGump(new GoldLedgerGump(Ledger));
                from.CloseGump(typeof(GoldLedgerHelp));
                from.SendGump(new GoldLedgerHelp());

                break;
            }
            }
        }
Beispiel #34
0
        public void OnChop(Mobile from)
        //public override void OnDoubleClick(Mobile from) I'd rather had this work, oh well.
        {
            Effects.SendLocationEffect(Location, Map, 0x3728, 20, 10);      //smoke or dust
            Effects.PlaySound(Location, Map, 573);

            switch (Utility.Random(76))      //picks one of the following
            {
            case 0:
                Effects.SendLocationEffect(from, from.Map, 0x113A, 20, 10);
                from.PlaySound(0x231);
                from.LocalOverheadMessage(MessageType.Regular, 0x44, 1010523);           // A toxic vapor envelops thee.
                from.ApplyPoison(from, Poison.Greater);
                break;

            case 1:
                Effects.SendLocationEffect(from, from.Map, 0x3709, 30);
                from.PlaySound(0x54);
                from.LocalOverheadMessage(MessageType.Regular, 0xEE, 1010524);           // Searing heat scorches thy skin.
                AOS.Damage(from, from, Utility.RandomMinMax(70, 90), 0, 100, 0, 0, 0);
                break;

            case 2:
                new BarrelLid().MoveToWorld(Location, Map);
                break;

            case 3:
                new BarrelHoops().MoveToWorld(Location, Map);
                break;

            case 4:
                new BarrelStaves().MoveToWorld(Location, Map);
                break;

            case 5:
                Gold g = new Gold(Utility.Random(500));         //Random amount of gold 0 - 500
                g.MoveToWorld(Location, Map);
                break;

            case 6:
                new NightSightPotion().MoveToWorld(Location, Map);
                break;

            case 7:
                new GreaterCurePotion().MoveToWorld(Location, Map);
                break;

            case 8:
                new TotalRefreshPotion().MoveToWorld(Location, Map);
                break;

            case 9:
                new GreaterHealPotion().MoveToWorld(Location, Map);
                break;

            case 10:
                new DarkIronWire().MoveToWorld(Location, Map);
                break;

            case 11:
                new EnergyVortexScroll().MoveToWorld(Location, Map);
                break;

            case 12:
                new SummonCreatureScroll().MoveToWorld(Location, Map);
                break;

            case 13:
                new CreateFoodScroll().MoveToWorld(Location, Map);
                break;

            case 14:
                new RecallScroll().MoveToWorld(Location, Map);
                break;

            case 15:
                new CureScroll().MoveToWorld(Location, Map);
                break;

            case 16:
                new GateTravelScroll().MoveToWorld(Location, Map);
                break;

            case 17:
                new InvisibilityScroll().MoveToWorld(Location, Map);
                break;

            case 18:
                new BlessScroll().MoveToWorld(Location, Map);
                break;

            case 19:
                new PotionKeg().MoveToWorld(Location, Map);
                break;

            case 20:
                new Bedroll().MoveToWorld(Location, Map);
                break;

            case 21:
                new SturdyShovel().MoveToWorld(Location, Map);
                break;

            case 22:
                new Slime().MoveToWorld(Location, Map);
                break;

            case 23:
                new IDWand().MoveToWorld(Location, Map);
                break;

            case 24:
                new SpecialHairDye().MoveToWorld(Location, Map);
                break;

            case 25:
                new Torch().MoveToWorld(Location, Map);
                break;

            case 26:
                new NameChangeDeed().MoveToWorld(Location, Map);
                break;

            case 27:
                new Torso().MoveToWorld(Location, Map);
                break;

            case 28:
                Gold n = new Gold(Utility.Random(5000));         //Random amount of gold 0 - 5000
                n.MoveToWorld(Location, Map);
                break;

            case 29:
                Gold m = new Gold(Utility.Random(300));         //Random amount of gold 0 - 3000
                m.MoveToWorld(Location, Map);
                break;

            case 30:
                Gold i = new Gold(Utility.Random(10000));         //Random amount of gold 0 - 10000
                i.MoveToWorld(Location, Map);
                break;

            case 31:
                from.PlaySound(0x223);
                from.LocalOverheadMessage(MessageType.Regular, 0x62, 1010525);           // Pain lances through thee from a sharp metal blade.
                AOS.Damage(from, from, Utility.RandomMinMax(40, 70), 100, 0, 0, 0, 0);
                break;

            case 32:
                from.BoltEffect(0);
                from.LocalOverheadMessage(MessageType.Regular, 0xDA, 1010526);           // Lightning arcs through thy body.
                AOS.Damage(from, from, Utility.RandomMinMax(60, 80), 0, 0, 0, 0, 100);
                break;

            case 33:
                Effects.SendLocationEffect(from, from.Map, 0x113A, 20, 10);
                from.PlaySound(0x231);
                from.LocalOverheadMessage(MessageType.Regular, 0x44, 1010523);           // A toxic vapor envelops thee.
                from.ApplyPoison(from, Poison.Greater);
                break;

            case 34:
                Effects.SendLocationEffect(from, from.Map, 0x113A, 20, 10);
                from.PlaySound(0x231);
                from.LocalOverheadMessage(MessageType.Regular, 0x44, 1010523);           // A toxic vapor envelops thee.
                from.ApplyPoison(from, Poison.Greater);
                break;

            case 35:
                new BarrelLid().MoveToWorld(Location, Map);
                break;

            case 36:
                new BarrelStaves().MoveToWorld(Location, Map);
                break;

            case 37:
                new BarrelLid().MoveToWorld(Location, Map);
                break;

            case 38:
                new Slime().MoveToWorld(Location, Map);
                break;

            case 39:
                new Slime().MoveToWorld(Location, Map);
                break;

            case 40:
                new Zombie().MoveToWorld(Location, Map);
                break;

            case 41:
                from.BoltEffect(0);
                from.LocalOverheadMessage(MessageType.Regular, 0xDA, 1010526);           // Lightning arcs through thy body.
                AOS.Damage(from, from, Utility.RandomMinMax(60, 80), 0, 0, 0, 0, 100);
                break;

            case 42:
                from.BoltEffect(0);
                from.LocalOverheadMessage(MessageType.Regular, 0xDA, 1010526);           // Lightning arcs through thy body.
                AOS.Damage(from, from, Utility.RandomMinMax(60, 80), 0, 0, 0, 0, 100);
                break;

            case 43:
                new ContainerBones().MoveToWorld(Location, Map);
                break;

            case 44:
                new FameIounStone().MoveToWorld(Location, Map);
                break;

            case 45:
                new KarmaIounStone().MoveToWorld(Location, Map);
                break;

            case 46:
                new AcidPool().MoveToWorld(Location, Map);
                break;

            case 47:
                new DaemonGate().MoveToWorld(Location, Map);
                break;

            case 48:
                new Diamond().MoveToWorld(Location, Map);
                break;

            case 49:
                new Sapphire().MoveToWorld(Location, Map);
                break;

            case 50:
                new Ruby().MoveToWorld(Location, Map);
                break;

            case 51:
                new Amber().MoveToWorld(Location, Map);
                break;

            case 52:
                new StarSapphire().MoveToWorld(Location, Map);
                break;

            case 53:
                new Emerald().MoveToWorld(Location, Map);
                break;

            case 54:
                new Amethyst().MoveToWorld(Location, Map);
                break;

            case 55:
                new Tourmaline().MoveToWorld(Location, Map);
                break;

            case 56:
                new Citrine().MoveToWorld(Location, Map);
                break;

            case 57:
                new MessageInABottle().MoveToWorld(Location, Map);
                break;

            case 58:
                from.PlaySound(0x223);
                from.LocalOverheadMessage(MessageType.Regular, 0x62, 1010525);           // Pain lances through thee from a sharp metal blade.
                AOS.Damage(from, from, Utility.RandomMinMax(40, 90), 100, 0, 0, 0, 0);
                break;

            case 59:
                from.PlaySound(0x223);
                from.LocalOverheadMessage(MessageType.Regular, 0x62, 1010525);           // Pain lances through thee from a sharp metal blade.
                AOS.Damage(from, from, Utility.RandomMinMax(10, 90), 100, 0, 0, 0, 0);
                break;

            case 60:
                Effects.SendLocationEffect(from, from.Map, 0x3709, 30);
                from.PlaySound(0x54);
                from.LocalOverheadMessage(MessageType.Regular, 0xEE, 1010524);           // Searing heat scorches thy skin.
                AOS.Damage(from, from, Utility.RandomMinMax(70, 90), 0, 100, 0, 0, 0);
                break;

            case 61:
                Effects.SendLocationEffect(from, from.Map, 0x3709, 30);
                from.PlaySound(0x54);
                from.LocalOverheadMessage(MessageType.Regular, 0xEE, 1010524);           // Searing heat scorches thy skin.
                AOS.Damage(from, from, Utility.RandomMinMax(70, 90), 0, 100, 0, 0, 0);
                break;

            case 62:
                new Jwilson().MoveToWorld(Location, Map);
                break;

            case 63:
                new Jwilson().MoveToWorld(Location, Map);
                break;

            case 64:
                new Jwilson().MoveToWorld(Location, Map);
                break;

            case 65:
                new Jwilson().MoveToWorld(Location, Map);
                break;

            case 66:
                new Jwilson().MoveToWorld(Location, Map);
                break;

            case 67:
                new Jwilson().MoveToWorld(Location, Map);
                break;

            case 68:
                new Jwilson().MoveToWorld(Location, Map);
                break;

            case 69:
                new Jwilson().MoveToWorld(Location, Map);
                break;

            case 70:
                new Zombie().MoveToWorld(Location, Map);
                break;

            case 71:
                new TreasureMap(1, Map.Felucca).MoveToWorld(Location, Map);
                break;

            case 72:
                new TreasureMap(2, Map.Felucca).MoveToWorld(Location, Map);
                break;

            case 73:
                new TreasureMap(3, Map.Felucca).MoveToWorld(Location, Map);
                break;

            case 74:
                new TreasureMap(4, Map.Felucca).MoveToWorld(Location, Map);
                break;

            case 75:
                new TreasureMap(5, Map.Felucca).MoveToWorld(Location, Map);
                break;
            }
            Destroy();
        }
Beispiel #35
0
        public static void TransferGold(Mobile m, Container c, GoldLedger ledger, string nametitle)
        {
            Item[] items = c.FindItemsByType(typeof(Gold));

            foreach (Gold ngold in items)
            {
                Gold gold = ngold as Gold;

                if (gold != null)
                {
                    if (ledger.Gold < 999999999)
                    {
                        double maxWeight = (WeightOverloading.GetMaxWeight(m));
                        if ((Mobile.BodyWeight + m.TotalWeight) < (maxWeight))
                        {
                            int golda = gold.Amount;
                            if ((gold.Amount + ledger.Gold) > 999999999)
                            {
                                golda = (999999999 - ledger.Gold);
                            }
                            double maxgold = golda;
                            if (ledger.d_WeightScale > 0)
                            {
                                maxgold = ((maxWeight - ((double)Mobile.BodyWeight + (double)m.TotalWeight)) / ledger.d_WeightScale);
                            }
                            if (golda > maxgold)
                            {
                                golda = (int)maxgold;
                            }
                            int GoldID = 0;
                            if (golda == 1)
                            {
                                GoldID = gold.ItemID;
                            }
                            else if (golda > 1 && golda < 6)
                            {
                                GoldID = gold.ItemID + 1;
                            }
                            else if (golda >= 6)
                            {
                                GoldID = gold.ItemID + 2;
                            }
                            if (golda < gold.Amount)
                            {
                                gold.Amount -= golda;
                            }
                            else
                            {
                                gold.Delete();
                            }
                            ledger.Gold += golda;
                            if (ledger.b_open && golda > 0)
                            {
                                m.CloseGump(typeof(GoldLedgerGump));
                                m.SendGump(new GoldLedgerGump(ledger));
                            }

                            if (golda > 4999)
                            {
                                m.SendMessage(2125, "You loot {0} gold from {1} and deposit it into your gold ledger.", golda.ToString("#,0"), nametitle);
                                Effects.SendMovingEffect(c, m, GoldID, 5, 50, true, false);
                                m.PlaySound(0x2E6);
                            }
                        }
                    }
                }
            }
        }
Beispiel #36
0
        //public void OnAttack(Mobile from)
        public override void OnDoubleClick(Mobile from)
        //public override void OnDoubleClick(Mobile from) I'd rather had this work, oh well.
        {
            if (!from.InRange(GetWorldLocation(), 2))
            {
                from.SendLocalizedMessage(500446); // That is too far away.
            }
            else
            {
                Effects.SendLocationEffect(Location, Map, 0x3728, 20, 10); //smoke or dust
                Effects.PlaySound(Location, Map, 0x11C);

                switch (Utility.Random(10))  //picks one of the following
                {
                case 0:
                    Effects.SendLocationEffect(from, from.Map, 0x113A, 20, 10);     //Posion Player
                    from.PlaySound(0x231);
                    from.ApplyPoison(from, Poison.Regular);
                    break;

                case 1:
                    Effects.SendLocationEffect(from, from.Map, 0x3709, 30);    //Burn Player
                    from.PlaySound(0x54);
                    AOS.Damage(from, from, Utility.RandomMinMax(10, 40), 0, 100, 0, 0, 0);
                    break;

                case 2:
                    new BarrelLid().MoveToWorld(Location, Map);
                    break;

                case 3:
                    new BarrelHoops().MoveToWorld(Location, Map);
                    break;

                case 4:
                    new BarrelStaves().MoveToWorld(Location, Map);
                    break;

                case 5:
                    Gold g = new Gold(Utility.Random(500));     //Random amount of gold 0 - 500
                    g.MoveToWorld(Location, Map);
                    break;

                case 6:
                    new CurePotion().MoveToWorld(Location, Map);
                    break;

                case 7:
                    new GreaterCurePotion().MoveToWorld(Location, Map);
                    break;

                case 8:
                    new HealPotion().MoveToWorld(Location, Map);
                    break;

                case 9:
                    new GreaterHealPotion().MoveToWorld(Location, Map);
                    break;
                }
                Destroy();
            }
        }
        public void RefundBuyIn(PlayerMobile pm, int amount)
        {
            BankBox box = (BankBox)pm.BankBox;

            if (amount >= 5000)
            {
                BankCheck check = new BankCheck(amount);
                box.DropItem(check);
            }
            else
            {
                Gold gold = new Gold(amount);
                box.DropItem(gold);
            }

            Handeling.BuyIn = 0;
            pm.SendMessage("The buy in has been refunded.");
        }
Beispiel #38
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m is PlayerMobile && m.AccessLevel == AccessLevel.Player && !m.Blessed)
            {
                if (m.Alive && m.CheckSkill(SkillName.DetectHidden, 0, 100))
                {
                    m.LocalOverheadMessage(Network.MessageType.Emote, 0x3B2, false, "Your eye catches something nearby.");
                    Map map = m.Map;
                    string where = Server.Misc.Worlds.GetRegionName(m.Map, m.Location);

                    int money = Utility.RandomMinMax(100, 200);

                    int level = (int)(m.Skills[SkillName.DetectHidden].Value / 10);
                    if (level < 1)
                    {
                        level = 1;
                    }
                    if (level > 10)
                    {
                        level = 10;
                    }

                    switch (Utility.RandomMinMax(1, level))
                    {
                    case 1: level = 1; break;

                    case 2: level = 2; break;

                    case 3: level = 3; break;

                    case 4: level = 4; break;

                    case 5: level = 5; break;

                    case 6: level = 6; break;

                    case 7: level = 7; break;

                    case 8: level = 8; break;

                    case 9: level = 9; break;

                    case 10: level = 10; break;
                    }

                    if (Utility.RandomMinMax(1, 3) > 1)
                    {
                        Gold coins = new Gold((money * level));

                        bool    validLocation = false;
                        Point3D loc           = this.Location;

                        for (int j = 0; !validLocation && j < 10; ++j)
                        {
                            int x = X + Utility.Random(3) - 1;
                            int y = Y + Utility.Random(3) - 1;
                            int z = map.GetAverageZ(x, y);

                            if (validLocation = map.CanFit(x, y, this.Z, 16, false, false))
                            {
                                loc = new Point3D(x, y, Z);
                            }
                            else if (validLocation = map.CanFit(x, y, z, 16, false, false))
                            {
                                loc = new Point3D(x, y, z);
                            }
                        }

                        coins.MoveToWorld(loc, map);
                        Effects.SendLocationParticles(EffectItem.Create(coins.Location, coins.Map, EffectItem.DefaultDuration), 0x376A, 9, 32, 5024);
                        Effects.PlaySound(coins.Location, coins.Map, 0x1FA);
                    }
                    else
                    {
                        HiddenBox mBox = new HiddenBox(level, where, m);

                        bool    validLocation = false;
                        Point3D loc           = this.Location;

                        for (int j = 0; !validLocation && j < 10; ++j)
                        {
                            int x = X + Utility.Random(3) - 1;
                            int y = Y + Utility.Random(3) - 1;
                            int z = map.GetAverageZ(x, y);

                            if (validLocation = map.CanFit(x, y, this.Z, 16, false, false))
                            {
                                loc = new Point3D(x, y, Z);
                            }
                            else if (validLocation = map.CanFit(x, y, z, 16, false, false))
                            {
                                loc = new Point3D(x, y, z);
                            }
                        }

                        mBox.MoveToWorld(loc, map);
                        Effects.SendLocationParticles(EffectItem.Create(mBox.Location, mBox.Map, EffectItem.DefaultDuration), 0x376A, 9, 32, 5024);
                        Effects.PlaySound(mBox.Location, mBox.Map, 0x1FA);
                    }
                }
            }

            this.Delete();
            return(true);
        }
Beispiel #39
0
        public bool ReceivePrize(Mobile from, int seed)
        {
            Item   i    = null;
            string text = "";

            /*              Rewards
             * Sandals ~ Hued [2651, 2662]  :::: 0.5%
             * Spellbook ~ Hued [2651, 2662]  :::: 0.5%
             * UncutCloth ~ Hued [2651, 2662]  :::: 1%
             * Stuffed Easter Bunny Statue Hued [1150] :::: 1.5%
             * Dragon Coin ~ Amount [10-25] :::: 3%
             * Magic Weapon (Might + random others) 5%
             * RabbitBomb ~ 5%
             * Random Skill Manual ~ 5%
             * Another Easter Egg 10%
             *
             * Explosion ~ (5-15 damage) :::: 25.5%
             * Gold ~ Amount [50-199] :::: 43%
             *
             */

            if (seed <= 25)
            {
                text = "You receive Easter Sandals!";

                i      = new Sandals();
                i.Hue  = Utility.RandomList(2651, 2662);
                i.Name = "Easter Sandals";
            }

            else if (seed <= 75)
            {
                text = "You receive an Easter Spellbook!";

                i      = new Spellbook();
                i.Hue  = Utility.RandomList(2651, 2662);
                i.Name = "Easter Spellbook";
            }

            else if (seed <= 125)
            {
                text = "You receive some Easter Cloth!";

                i        = new UncutCloth();
                i.Hue    = Utility.RandomList(2651, 2662);
                i.Amount = 8;
            }

            else if (seed <= 225)
            {
                text = "You receive a stuffed Easter Bunny!";
                i    = new StuffedEasterBunny();
            }

            else if (seed <= 600)
            {
                text     = "You receive some Dragon Coins!";
                i        = new DragonCoin();
                i.Amount = Utility.Random(25, 50);
            }

            else if (seed <= 850)
            {
                text = "You receive a magical weapon!";

                BaseWeapon wep = Loot.RandomWeapon();

                if (wep != null)
                {
                    wep.AccuracyLevel   = (WeaponAccuracyLevel)Utility.RandomMinMax(1, 5);
                    wep.DamageLevel     = (WeaponDamageLevel)Utility.RandomMinMax(1, 5);
                    wep.DurabilityLevel = (WeaponDurabilityLevel)Utility.RandomMinMax(1, 5);
                }

                i = wep;
            }

            else if (seed <= 3150)
            {
                text = "You receive more easter eggs!";
                i    = new EasterEgg();
            }

            else if (seed <= 5750)
            {
                Point3D loc   = this.GetWorldLocation();
                Map     facet = this.Map;

                text = "You receive remorse!";

                if (from.CanBeDamaged())
                {
                    Effects.SendLocationEffect(loc, facet, 0x36BD, 15, 10);
                    Effects.PlaySound(from.Location, from.Map, 0x246);

                    from.PublicOverheadMessage(MessageType.Regular, 0, false, "*Looks remorseful*");

                    AOS.Damage(from, Utility.Random(10, 20), 0, 100, 0, 0, 0);

                    Blood blood = new Blood();
                    blood.MoveToWorld(from.Location, from.Map);
                }
            }

            else if (seed <= 6000)
            {
                text     = "You receive a large amount of gold.";
                i        = new Gold();
                i.Amount = Utility.RandomMinMax(750, 1250);

                from.SendSound(0x2e6);
            }

            else if (seed <= 6500)
            {
                text     = "You receive a moderate amount of gold.";
                i        = new Gold();
                i.Amount = Utility.RandomMinMax(400, 600);

                from.SendSound(0x2e5);
            }

            else
            {
                text     = "You receive a small amount of gold.";
                i        = new Gold();
                i.Amount = Utility.RandomMinMax(200, 300);

                from.SendSound(0x2e4);
            }

            if (text.Length > 0)
            {
                from.SendMessage(text);
            }

            if (i != null)
            {
                if (!from.AddToBackpack(i))
                {
                    i.Delete();
                    from.SendMessage("You don't have enough room in your backpack. Please make room and try again.");

                    return(false);
                }
            }

            return(true);
        }
Beispiel #40
0
        public void ReceiveReward(Mobile from)
        {
            int TotalValues = 0;

            Item   item        = null;
            string rewardText  = "";
            int    rewardSound = 0x5AA;

            Dictionary <string, int> DictTemp = new Dictionary <string, int>();

            //Used to Determine Chance of Last Reward Item (GoldSmallAmount)
            int maxRandomValue = 1000;

            int ultraRareValue = 2;
            int rareValue      = 7;
            int uncommonValue  = 20;
            int commonValue    = 150;

            //Ultra Rares
            DictTemp.Add("PlayerCustomizationDeed", ultraRareValue);
            DictTemp.Add("AntiqueStandingClock", ultraRareValue);
            DictTemp.Add("CityLampPost", ultraRareValue);
            DictTemp.Add("LuniteIngots", ultraRareValue);
            DictTemp.Add("AquariumDeed", ultraRareValue);
            DictTemp.Add("LuxuriousFurniture", ultraRareValue);
            DictTemp.Add("MiniatureTownPiece", ultraRareValue);
            DictTemp.Add("UltraRareCloth", ultraRareValue);
            DictTemp.Add("DisplayCaseLargeAddon", ultraRareValue);
            DictTemp.Add("DisplayCaseMediumAddon", ultraRareValue);
            DictTemp.Add("LargeBenchAddon", ultraRareValue);
            DictTemp.Add("BarTopGlassMugs", ultraRareValue);
            DictTemp.Add("BarTopGoblets", ultraRareValue);
            DictTemp.Add("ExplodingBullvore", ultraRareValue);

            //Rares
            DictTemp.Add("UnfinishedFurniture", rareValue);
            DictTemp.Add("SpellHueDeed", rareValue);
            DictTemp.Add("MiniatureHome", rareValue);
            DictTemp.Add("CraftingComponentsLargeAmount", rareValue);
            DictTemp.Add("GoldHugeAmount", rareValue);
            DictTemp.Add("TableWithRunner", rareValue);
            DictTemp.Add("ExplodingLlama", rareValue);
            DictTemp.Add("MagicalWeapon", rareValue);
            DictTemp.Add("MagicalArmor", rareValue);
            DictTemp.Add("RareCloth", rareValue);
            DictTemp.Add("HideRack", rareValue);
            DictTemp.Add("HideRackLargeAddon", rareValue);
            DictTemp.Add("DisplayCaseSmall", rareValue);

            //Uncommon
            DictTemp.Add("CraftingComponentsMediumAmount", uncommonValue);
            DictTemp.Add("SpiderSilkFishingNet", uncommonValue);
            DictTemp.Add("CampingFirepit", uncommonValue);
            DictTemp.Add("GoldLargeAmount", uncommonValue);
            DictTemp.Add("ParagonWand", uncommonValue);
            DictTemp.Add("Lure", uncommonValue);
            DictTemp.Add("ResearchMaterials", uncommonValue);
            DictTemp.Add("AncientMysteryScroll", uncommonValue);
            DictTemp.Add("LavishPillow", uncommonValue);
            DictTemp.Add("VeterinarySalts", uncommonValue);
            DictTemp.Add("ExplodingSheep", uncommonValue);
            DictTemp.Add("DiamondHarvestingTool", uncommonValue);

            //Common
            DictTemp.Add("PrestigeScroll", commonValue);
            DictTemp.Add("GoldMediumAmount", commonValue);
            DictTemp.Add("CraftingComponentsSmallAmount", (int)Math.Round((double)commonValue / 2));
            DictTemp.Add("Reagents", commonValue);

            foreach (KeyValuePair <string, int> pair in DictTemp)
            {
                TotalValues += pair.Value;
            }

            int remainderItemChance = maxRandomValue - TotalValues;

            if (remainderItemChance < 1)
            {
                remainderItemChance = 1;
            }

            //Last Reward Item (Chance = maxRandomValue - Sum of All Item Values Combined)
            DictTemp.Add("GoldSmallAmount", remainderItemChance);

            TotalValues += remainderItemChance;

            double ItemCheck = Utility.RandomDouble();

            double CumulativeAmount = 0.0;
            double AdditionalAmount = 0.0;

            //Determine Reward
            foreach (KeyValuePair <string, int> pair in DictTemp)
            {
                AdditionalAmount = (double)pair.Value / (double)TotalValues;

                if (ItemCheck >= CumulativeAmount && ItemCheck < (CumulativeAmount + AdditionalAmount))
                {
                    Bag bag;

                    switch (pair.Key)
                    {
                    //Ultra Rares
                    case "PlayerCustomizationDeed":
                        item       = new Custom.PlayerCustomizationDeed();
                        rewardText = "You receive a player customization deed.";
                        break;

                    case "AntiqueStandingClock":
                        item       = new AntiqueStandingClock();
                        rewardText = "You receive an antique standing clock.";
                        break;

                    case "CityLampPost":
                        item       = new CityLampPost();
                        rewardText = "You receive a city lamp post.";
                        break;

                    case "LuniteIngots":
                        item       = new LuniteIngot(Utility.RandomMinMax(25, 50));
                        rewardText = "You receive some lunite ingots.";
                        break;

                    case "AquariumDeed":
                        if (Utility.RandomDouble() <= .5)
                        {
                            item = new AquariumEastDeed();
                        }
                        else
                        {
                            item = new AquariumNorthDeed();
                        }

                        rewardText = "You receive an aquarium deed";
                        break;

                    case "LuxuriousFurniture":
                        switch (Utility.RandomMinMax(1, 12))
                        {
                        case 1: item = new LuxuriousBookstand(); break;

                        case 2: item = new LuxuriousCouch(); break;

                        case 3: item = new LuxuriousOvalTable(); break;

                        case 4: item = new LuxuriousChair(); break;

                        case 5: item = new LuxuriousTable(); break;

                        case 6: item = new LargeLuxuriousChest(); break;

                        case 7: item = new LargeLuxuriousChair(); break;

                        case 8: item = new LuxuriousBookshelf(); break;

                        case 9: item = new LuxuriousChest(); break;

                        case 10: item = new LuxuriousStorageBox(); break;

                        case 11: item = new LuxuriousReadingDesk(); break;

                        case 12: item = new LuxuriousAlchemyTable(); break;
                        }

                        rewardText = "You receive some luxurious furniture.";
                        break;

                    case "MiniatureTownPiece":
                        item       = new MiniatureTownPiece();
                        rewardText = "You receive a miniature town piece.";
                        break;

                    case "UltraRareCloth":
                        item       = new UltraRareCloth();
                        rewardText = "You receive some ultra rare cloth.";
                        break;

                    case "DisplayCaseLargeAddon":
                        switch (Utility.RandomMinMax(1, 2))
                        {
                        case 1: item = new DisplayCaseLargeEastAddonDeed(); break;

                        case 2: item = new DisplayCaseLargeNorthAddonDeed(); break;
                        }

                        rewardText = "You receive a large display case.";
                        break;

                    case "DisplayCaseMediumAddon":
                        switch (Utility.RandomMinMax(1, 2))
                        {
                        case 1: item = new DisplayCaseMediumEastAddonDeed(); break;

                        case 2: item = new DisplayCaseMediumNorthAddonDeed(); break;
                        }

                        rewardText = "You receive a medium display case.";
                        break;

                    case "LargeBenchAddon":
                        switch (Utility.RandomMinMax(1, 2))
                        {
                        case 1: item = new LargeBenchEastAddonDeed(); break;

                        case 2: item = new LargeBenchNorthAddonDeed(); break;
                        }

                        rewardText = "You receive a large bench.";
                        break;

                    case "BarTopGlassMugs":
                        item       = new BarTopGlassMugs();
                        rewardText = "You receive bar top glass mugs.";
                        break;

                    case "BarTopGoblets":
                        item       = new BarTopGoblets();
                        rewardText = "You receive bar top goblets.";
                        break;

                    case "ExplodingBullvore":
                        item       = new ExplodingBullvore();
                        rewardText = "You receive an exploding bullvore.";
                        break;

                    //Rares
                    case "UnfinishedFurniture":
                        switch (Utility.RandomMinMax(1, 5))
                        {
                        case 1: item = new UnfinishedWoodenChair(); break;

                        case 2: item = new UnfinishedDresser(); break;

                        case 3: item = new UnfinishedTableLegs(); break;

                        case 4: item = new UnfinishedTablePieces(); break;

                        case 5: item = new UnfinishedBookshelf(); break;
                        }

                        rewardText = "You receive some unfinished furniture.";
                        break;

                    case "SpellHueDeed":
                        item       = new Custom.SpellHueDeed();
                        rewardText = "You receive a spell hue deed.";
                        break;

                    case "MiniatureHome":
                        item       = new MiniatureHome();
                        rewardText = "You receive a miniature home.";
                        break;

                    case "CraftingComponentsLargeAmount":
                        item       = CraftingComponent.GetRandomCraftingComponent(10);
                        rewardText = "You receive a large number of crafting components.";
                        break;

                    case "GoldHugeAmount":
                        item       = new Gold(Utility.RandomMinMax(2500, 10000));
                        rewardText = "You receive a very large amount of gold.";
                        break;

                    case "TableWithRunner":
                        item       = new TableWithRunner();
                        rewardText = "You receive a small table with runner.";
                        break;

                    case "ExplodingLlama":
                        item       = new ExplodingLlama();
                        rewardText = "You receive an exploding llama.";
                        break;

                    case "MagicalWeapon":
                        BaseWeapon weapon = Loot.RandomWeapon();

                        if (weapon != null)
                        {
                            weapon.AccuracyLevel   = (WeaponAccuracyLevel)Utility.RandomMinMax(3, 5);
                            weapon.DamageLevel     = (WeaponDamageLevel)Utility.RandomMinMax(3, 5);
                            weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.RandomMinMax(3, 5);
                        }

                        item       = weapon;
                        rewardText = "You receive a magical weapon.";
                        break;

                    case "MagicalArmor":
                        BaseArmor armor = Loot.RandomArmor();

                        if (armor != null)
                        {
                            armor.ProtectionLevel = (ArmorProtectionLevel)Utility.RandomMinMax(4, 5);
                            armor.DurabilityLevel = (ArmorDurabilityLevel)Utility.RandomMinMax(4, 5);
                        }

                        item       = armor;
                        rewardText = "You receive some magical armor.";
                        break;

                    case "RareCloth":
                        item       = new RareCloth();
                        rewardText = "You receive some rare cloth.";
                        break;

                    case "HideRack":
                        item       = new HideRack();
                        rewardText = "You receive a hide rack.";
                        break;

                    case "HideRackLargeAddon":
                        switch (Utility.RandomMinMax(1, 2))
                        {
                        case 1: item = new HideRackLargeEastAddonDeed(); break;

                        case 2: item = new HideRackLargeNorthAddonDeed(); break;
                        }

                        rewardText = "You receive a large hide rack.";
                        break;

                    case "DisplayCaseSmall":
                        item       = new DisplayCaseSmall();
                        rewardText = "You receive a small display case.";
                        break;

                    //Uncommon
                    case "CraftingComponentsMediumAmount":
                        item       = CraftingComponent.GetRandomCraftingComponent(6);
                        rewardText = "You receive a moderate number of crafting components.";
                        break;

                    case "SpiderSilkFishingNet":
                        item       = new Custom.SpidersilkFishingNet();
                        rewardText = "You receive a spidersilk fishing net.";
                        break;

                    case "CampingFirepit":
                        item       = new Custom.CampingFirepit();
                        rewardText = "You receive a camping firepit.";
                        break;

                    case "GoldLargeAmount":
                        item       = new Gold(Utility.RandomMinMax(1000, 2500));
                        rewardText = "You receive a large amount of gold.";
                        break;

                    case "ParagonWand":
                        item       = new ParagonWand();
                        rewardText = "You receive a paragon wand.";
                        break;

                    case "Lure":
                        if (Utility.RandomDouble() <= .66)
                        {
                            item = new Custom.FaintLure();
                        }
                        else
                        {
                            item = new Custom.PotentLure();
                        }

                        rewardText = "You receive a lure.";
                        break;

                    case "ResearchMaterials":
                        item       = new Custom.ResearchMaterials();
                        rewardText = "You receive some research materials.";
                        break;

                    case "AncientMysteryScroll":
                        item       = new Custom.AncientMystery.AncientMysteryScroll();
                        rewardText = "You receive an ancient mystery scroll.";
                        break;

                    case "LavishPillow":
                        item       = new LavishPillow();
                        rewardText = "You receive a lavish pillow.";
                        break;

                    case "VeterinarySalts":
                        item       = new Custom.Items.VeterinarySalts();
                        rewardText = "You receive some veterinary salts.";
                        break;

                    case "ExplodingSheep":
                        item       = new ExplodingSheep();
                        rewardText = "You receive an exploding sheep.";
                        break;

                    case "DiamondHarvestingTool":
                        switch (Utility.RandomMinMax(1, 2))
                        {
                        case 1: item = new DiamondPickaxe(); break;

                        case 2: item = new DiamondShovel(); break;
                        }

                        rewardText = "You receive a diamond-coated harvesting tool.";
                        break;

                    //Common
                    case "PrestigeScroll":
                        item       = new PrestigeScroll();
                        rewardText = "You receive a prestige scroll.";
                        break;

                    case "GoldMediumAmount":
                        item       = new Gold(Utility.RandomMinMax(500, 1000));
                        rewardText = "You receive a moderate amount of gold.";
                        break;

                    case "CraftingComponentsSmallAmount":
                        item       = CraftingComponent.GetRandomCraftingComponent(3);
                        rewardText = "You receive a small number of crafting components.";
                        break;

                    case "Reagents":
                        int reagentsAmount = Utility.RandomMinMax(150, 250);

                        switch (Utility.RandomMinMax(1, 8))
                        {
                        case 1: item = new BlackPearl(reagentsAmount); break;

                        case 2: item = new Bloodmoss(reagentsAmount); break;

                        case 3: item = new MandrakeRoot(reagentsAmount); break;

                        case 4: item = new Garlic(reagentsAmount); break;

                        case 5: item = new Ginseng(reagentsAmount); break;

                        case 6: item = new SpidersSilk(reagentsAmount); break;

                        case 7: item = new SulfurousAsh(reagentsAmount); break;

                        case 8: item = new Nightshade(reagentsAmount); break;
                        }

                        rewardText = "You receive some reagents.";
                        break;

                    //Remainder
                    case "GoldSmallAmount":
                        item       = new Gold(Utility.RandomMinMax(250, 500));
                        rewardText = "You receive a small amount of gold.";
                        break;
                    }

                    break;
                }

                CumulativeAmount += AdditionalAmount;
            }

            if (item != null)
            {
                if (from.TotalWeight >= 390 && from.AccessLevel == AccessLevel.Player)
                {
                    item.Delete();
                    from.SendMessage("You are carrying too much weight to be able to accept any rewards.");

                    inUse = false;

                    return;
                }

                if (!from.AddToBackpack(item))
                {
                    item.Delete();
                    from.SendMessage("You don't have enough room in your backpack. Please make room and try again.");

                    inUse = false;

                    return;
                }

                else
                {
                    if (from.NetState != null)
                    {
                        from.PrivateOverheadMessage(MessageType.Regular, 0, false, rewardText, from.NetState);
                    }

                    if (rewardSound != -1)
                    {
                        from.SendSound(rewardSound);
                    }

                    Delete();
                }
            }

            else
            {
                inUse = false;
            }
        }
Beispiel #41
0
		public override void OnDoubleClick( Mobile from )
		{
			BankBox box = from.FindBankNoCreate();

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

				int deposited = 0;

				int toAdd = m_Worth;

				Gold gold;

				while ( toAdd > 60000 )
				{
					gold = new Gold( 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 Gold( toAdd );

					if ( box.TryDropItem( from, gold, false ) )
					{
						deposited += toAdd;
					}
					else
					{
						gold.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.
			}
		}
Beispiel #42
0
        public static void GoldSweep(Mobile m, Gold gold)
        {
            Item item = m.Backpack.FindItemByType(typeof(GoldLedger));

            GoldLedger ledger = item as GoldLedger;

            if (ledger == null)
            {
                return;
            }

            if (!ledger.GoldSweeper || !GoldLedger.GoldSweeperAvailable || !gold.Movable)
            {
                return;
            }

            if (gold != null)
            {
                if (ledger.Gold < 999999999)
                {
                    double maxWeight = (WeightOverloading.GetMaxWeight(m));
                    if ((Mobile.BodyWeight + m.TotalWeight) < (maxWeight))
                    {
                        int golda = gold.Amount;
                        if ((gold.Amount + ledger.Gold) > 999999999)
                        {
                            golda = (999999999 - ledger.Gold);
                        }
                        double maxgold = golda;
                        if (ledger.d_WeightScale > 0)
                        {
                            maxgold = ((maxWeight - ((double)Mobile.BodyWeight + (double)m.TotalWeight)) / ledger.d_WeightScale);
                        }
                        if (golda > maxgold)
                        {
                            golda = (int)maxgold;
                        }
                        int GoldID = 0;
                        if (golda == 1)
                        {
                            GoldID = gold.ItemID;
                        }
                        else if (golda > 1 && golda < 6)
                        {
                            GoldID = gold.ItemID + 1;
                        }
                        else if (golda >= 6)
                        {
                            GoldID = gold.ItemID + 2;
                        }
                        if (golda < gold.Amount)
                        {
                            gold.Amount -= golda;
                        }
                        else
                        {
                            gold.Delete();
                        }
                        ledger.Gold += golda;
                        if (ledger.b_open && golda > 0)
                        {
                            m.CloseGump(typeof(GoldLedgerGump));
                            m.SendGump(new GoldLedgerGump(ledger));
                        }

                        if (golda > 4999)
                        {
                            m.SendMessage(2125, "You deposit {0} gold into your gold ledger.", golda.ToString("#,0"));
                            if (!m.Mounted)
                            {
                                m.Animate(32, 5, 1, true, false, 0);
                            }
                            Effects.SendMovingEffect(gold, m, GoldID, 5, 50, true, false);
                            m.PlaySound(0x2E6);
                        }
                    }
                }
            }
        }
Beispiel #43
0
			protected override void OnTick()
			{
				int z = m_Map.GetAverageZ( m_X, m_Y );
				bool canFit = m_Map.CanFit( m_X, m_Y, z, 6, false, false );

				for ( int i = -3; !canFit && i <= 3; ++i )
				{
					canFit = m_Map.CanFit( m_X, m_Y, z + i, 6, false, false );

					if ( canFit )
						z += i;
				}

				if ( !canFit )
					return;

				Gold g = new Gold( 500, 1000 );
				
				g.MoveToWorld( new Point3D( m_X, m_Y, z ), m_Map );

				if ( 0.5 >= Utility.RandomDouble() )
				{
					switch ( Utility.Random( 3 ) )
					{
						case 0: // Fire column
						{
							Effects.SendLocationParticles( EffectItem.Create( g.Location, g.Map, EffectItem.DefaultDuration ), 0x3709, 10, 30, 5052 );
							Effects.PlaySound( g, g.Map, 0x208 );

							break;
						}
						case 1: // Explosion
						{
							Effects.SendLocationParticles( EffectItem.Create( g.Location, g.Map, EffectItem.DefaultDuration ), 0x36BD, 20, 10, 5044 );
							Effects.PlaySound( g, g.Map, 0x307 );

							break;
						}
						case 2: // Ball of fire
						{
							Effects.SendLocationParticles( EffectItem.Create( g.Location, g.Map, EffectItem.DefaultDuration ), 0x36FE, 10, 10, 5052 );

							break;
						}
					}
				}
			}
Beispiel #44
0
        public override void OnDoubleClick(Mobile from)
        {
            if (this.Parent != null)
            {
                return;
            }

            // check the range between the player and weapon
            if (!from.InRange(this.Location, this.MinFiringRange) || from.Map != this.Map)
            {
                from.SendLocalizedMessage(500446); // That is too far away.
                return;
            }

            if (this.Storing)
            {
                from.SendMessage("{0} being stored", this.Name);
                return;
            }

            if (this.Projectile == null || this.Projectile.Deleted)
            {
                from.SendMessage("{0} empty", this.Name);
                return;
            }

            // check if the cannon is cool enough to fire
            if (this.NextFiring.Seconds > 0)
            {
                from.SendMessage("Not ready yet.");
                return;
            }

            //new way to fire
            Map map = Map;

            if (map == null)
            {
                return;
            }

            int rx = 0, ry = 0;

            if (Facing == 0)
            {
                rx = -1;
            }
            else if (Facing == 1)
            {
                ry = -1;
            }
            else if (Facing == 2)
            {
                rx = 1;
            }
            else if (Facing == 3)
            {
                ry = 1;
            }

            for (int i = 1; i <= 15; ++i)
            {
                int x = X + (i * rx);
                int y = Y + (i * ry);
                int z;

                for (int j = -16; j <= 16; ++j)
                {
                    z = from.Z + j;

                    Point3D currentLocation = new Point3D(x, y, z);
                    Item    goldToken       = new Gold(100);
                    goldToken.Visible  = false;
                    goldToken.Map      = Map;
                    goldToken.Location = currentLocation;

                    foreach (Item item in goldToken.GetItemsInRange(10))
                    {
                        if (item is BaseShip)
                        {
                            BaseShip target = (BaseShip)item;


                            //Console.WriteLine("attacking {0} at {1}:{2}", multiitem, tileloc, ((StaticTarget)targeted).Location);
                            // may have to reconsider the use tileloc vs target loc
                            //m_cannon.AttackTarget(from, multiitem, ((StaticTarget)targeted).Location);
                            if (target != this.Transport)
                            {
                                goldToken.Delete();
                                return;
                            }
                        }
                    }

                    goldToken.Delete();
                }

                z = map.GetAverageZ(x, y);


                Point3D currentLocation2 = new Point3D(x, y, z);
                Item    goldToken2       = new Gold(100);
                goldToken2.Visible  = false;
                goldToken2.Map      = Map;
                goldToken2.Location = currentLocation2;
                foreach (Item item in goldToken2.GetItemsInRange(10))
                {
                    if (item is BaseShip)
                    {
                        BaseShip target = (BaseShip)item;


                        //Console.WriteLine("attacking {0} at {1}:{2}", multiitem, tileloc, ((StaticTarget)targeted).Location);
                        // may have to reconsider the use tileloc vs target loc
                        //m_cannon.AttackTarget(from, multiitem, ((StaticTarget)targeted).Location);
                        if (target != this.Transport)
                        {
                            goldToken2.Delete();
                            return;
                        }
                    }
                }

                goldToken2.Delete();
            }
        }
Beispiel #45
0
        //public void OnAttack(Mobile from)
        public override void OnDoubleClick(Mobile from)
        //public override void OnDoubleClick(Mobile from) I'd rather had this work, oh well.
        {
            if (!from.InRange(GetWorldLocation(), 2))
            {
                from.SendLocalizedMessage(500446); // That is too far away. 
            }
            else
            {
                Effects.SendLocationEffect(Location, Map, 0x3728, 20, 10); //smoke or dust
                Effects.PlaySound(Location, Map, 0x11C);

                switch (Utility.Random(10))  //picks one of the following
                {
                    case 0:
                        Effects.SendLocationEffect(from, from.Map, 0x113A, 20, 10); //Posion Player
                        from.PlaySound(0x231);
                        from.ApplyPoison(from, Poison.Regular);
                        break;
                    case 1:
                        Effects.SendLocationEffect(from, from.Map, 0x3709, 30);//Burn Player
                        from.PlaySound(0x54);
                        AOS.Damage(from, from, Utility.RandomMinMax(10, 40), 0, 100, 0, 0, 0);
                        break;
                    case 2:
                        new BarrelLid().MoveToWorld(Location, Map);
                        break;
                    case 3:
                        new BarrelHoops().MoveToWorld(Location, Map);
                        break;
                    case 4:
                        new BarrelStaves().MoveToWorld(Location, Map);
                        break;
                    case 5:
                        Gold g = new Gold(Utility.Random(500)); //Random amount of gold 0 - 500
                        g.MoveToWorld(Location, Map);
                        break;
                    case 6:
                        new CurePotion().MoveToWorld(Location, Map);
                        break;
                    case 7:
                        new GreaterCurePotion().MoveToWorld(Location, Map);
                        break;
                    case 8:
                        new HealPotion().MoveToWorld(Location, Map);
                        break;
                    case 9:
                        new GreaterHealPotion().MoveToWorld(Location, Map);
                        break;
                }
                Destroy();
            }
        }
Beispiel #46
0
            internal Item Construct()
            {
                try
                {
                    Item item;

                    if (Type == typeof(Gold))
                    {
                        item = new Gold(Amount);
                    }
                    else if (Type == typeof(ImagineNickel))
                    {
                        item = new ImagineNickel(Amount);
                    }
                    else if (Type == typeof(BaseWeapon))
                    {
                        BaseWeapon w = Loot.RandomWeapon();
                        w.DamageLevel = WeaponDamageLevel.Vanq;
                        int accuracyRoll = Utility.Random(99);
                        if (accuracyRoll < 31) // 30% to get Accurate
                        {
                            w.AccuracyLevel = WeaponAccuracyLevel.Accurate;
                        }
                        else if (accuracyRoll < 56) // 25% to get Surpassingly
                        {
                            w.AccuracyLevel = WeaponAccuracyLevel.Surpassingly;
                        }
                        else if (accuracyRoll < 76) // 20% to get Eminently
                        {
                            w.AccuracyLevel = WeaponAccuracyLevel.Eminently;
                        }
                        else if (accuracyRoll < 91) // 15% to get Exceedingly
                        {
                            w.AccuracyLevel = WeaponAccuracyLevel.Exceedingly;
                        }
                        else if (accuracyRoll < 100) // 10% to get Supremely
                        {
                            w.AccuracyLevel = WeaponAccuracyLevel.Supremely;
                        }
                        item = w;
                    }
                    else if (Type == typeof(BaseArmor))
                    {
                        BaseArmor armor = Loot.RandomArmorOrShield();
                        armor.ProtectionLevel = ArmorProtectionLevel.Invulnerability;
                        armor.Durability      = (ArmorDurabilityLevel)Utility.Random(6);
                        item = armor;
                    }
                    else if (Type == typeof(BaseClothing))
                    {
                        item          = Loot.RandomClothing();
                        item.LootType = LootType.Blessed;
                        item.Hue      = Utility.RandomList(Sphere.RareHues);
                    }
                    else if (Type == typeof(BaseJewel))
                    {
                        item          = Loot.RandomJewelry();
                        item.LootType = LootType.Blessed;
                        item.Hue      = Utility.RandomList(Sphere.RareHues);
                    }
                    else if (Type == typeof(Mustang))
                    {
                        Mustang m = new Mustang();
                        MustangCollection.Randomize().ApplyTo(m);
                        item = new ShrinkItem(m);
                    }
                    else
                    {
                        item = Activator.CreateInstance(Type) as Item;
                    }
                    return(item);
                }
                catch
                {
                }
                return(null);
            }
Beispiel #47
0
		public override bool OnBeforeDeath()
		{
			Gold gold = new Gold( Utility.RandomMinMax( 190, 230 ) );
			gold.MoveToWorld( Location, Map );

			Container pack = this.Backpack;
			if ( pack != null )
			{
				pack.Movable = true;
				pack.MoveToWorld( Location, Map );
			}

			Effects.SendLocationEffect( Location, Map, 0x376A, 10, 1 );
			return true;
		}
Beispiel #48
0
        public override void OnDoubleClick(Mobile from)
        {
            BankBox box = from.FindBankNoCreate();

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

                int deposited = 0;

                int toAdd = m_Worth;

                Gold gold;

                while (toAdd > 60000)
                {
                    gold = new Gold(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 Gold(toAdd);

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

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

                // Gold was deposited in your account
                from.SendAsciiMessage(string.Format("{0} gold was deposited in your account", deposited));
                PlayerMobile pm = from as PlayerMobile;

                if (pm != null)
                {
                    QuestSystem qs = pm.Quest;

                    if (qs is DarkTidesQuest)
                    {
                        QuestObjective obj = qs.FindObjective(typeof(CashBankCheckObjective));

                        if (obj != null && !obj.Completed)
                        {
                            obj.Complete();
                        }
                    }

                    if (qs is UzeraanTurmoilQuest)
                    {
                        QuestObjective obj = qs.FindObjective(typeof(Engines.Quests.Haven.CashBankCheckObjective));

                        if (obj != null && !obj.Completed)
                        {
                            obj.Complete();
                        }
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(1047026);                   // That must be in your bank box to use it.
            }
        }
Beispiel #49
0
        public override void OnDoubleClick(Mobile from)
        {
            BankBox box = from.FindBankNoCreate();

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

                int deposited = 0;

                int toAdd = this.m_Worth;

                Gold gold;

                while (toAdd > 60000)
                {
                    gold = new Gold(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 Gold(toAdd);

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

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

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

                PlayerMobile pm = from as PlayerMobile;

                if (pm != null)
                {
                    QuestSystem qs = pm.Quest;

                    if (qs is Necro.DarkTidesQuest)
                    {
                        QuestObjective obj = qs.FindObjective(typeof(Necro.CashBankCheckObjective));

                        if (obj != null && !obj.Completed)
                            obj.Complete();
                    }

                    if (qs is Haven.UzeraanTurmoilQuest)
                    {
                        QuestObjective obj = qs.FindObjective(typeof(Haven.CashBankCheckObjective));

                        if (obj != null && !obj.Completed)
                            obj.Complete();
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(1047026); // That must be in your bank box to use it.
            }
        }
Beispiel #50
0
        public void EndAddGold(Mobile from, object obj)
        {
            from.CloseGump(typeof(GoldLedgerGump));

            if (obj is Item)
            {
                Item   item      = obj as Item;
                double maxWeight = (WeightOverloading.GetMaxWeight(from));
                int    golda     = 0;

                if (!this.IsChildOf(from.Backpack))
                {
                    from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
                    return;
                }
                if (!item.IsAccessibleTo(from))
                {
                    from.SendGump(new GoldLedgerGump(this));
                    from.SendLocalizedMessage(3000270); // That is not accessible.
                    return;
                }

                if (obj is Gold)
                {
                    Gold gold = obj as Gold;

                    golda = gold.Amount;
                    if ((gold.Amount + this.Gold) > 999999999)
                    {
                        golda = (999999999 - this.Gold);
                    }
                    double maxgold = golda;
                    if (this.d_WeightScale > 0 && gold.RootParent != from)
                    {
                        maxgold = ((maxWeight - ((double)Mobile.BodyWeight + (double)from.TotalWeight)) / this.d_WeightScale);
                    }
                    if (golda > maxgold)
                    {
                        golda = (int)maxgold;
                    }
                    if (golda < gold.Amount)
                    {
                        gold.Amount -= golda;
                    }
                    else
                    {
                        gold.Delete();
                    }

                    this.Gold += golda;

                    from.SendGump(new GoldLedgerGump(this));
                    from.SendMessage(2125, String.Format("You deposit {0} gold into your gold ledger.", golda.ToString("#,0")));
                    from.PlaySound(0x249);
                }
                else if (obj is BankCheck)
                {
                    BankCheck check = obj as BankCheck;

                    golda = check.Worth;
                    if ((check.Worth + this.Gold) > 999999999)
                    {
                        golda = (999999999 - this.Gold);
                    }
                    double maxgold = golda;
                    if (this.d_WeightScale > 0)
                    {
                        maxgold = ((maxWeight - ((double)Mobile.BodyWeight + (double)from.TotalWeight)) / this.d_WeightScale);
                    }
                    if (golda > maxgold)
                    {
                        golda = (int)maxgold;
                    }
                    if (golda < check.Worth)
                    {
                        check.Worth -= golda;
                    }
                    else
                    {
                        check.Delete();
                    }

                    this.Gold += golda;

                    from.SendGump(new GoldLedgerGump(this));
                    from.SendMessage(2125, String.Format("You deposit a bank check worth {0} gold into your gold ledger.", golda.ToString("#,0")));
                    from.PlaySound(0x249);
                }
                else if (obj is GoldLedger && obj != this)
                {
                    GoldLedger gledger = obj as GoldLedger;

                    golda = gledger.Gold;
                    if ((gledger.Gold + this.Gold) > 999999999)
                    {
                        golda = (999999999 - this.Gold);
                    }
                    double maxgold = golda;
                    if (this.d_WeightScale > 0)
                    {
                        maxgold = ((maxWeight - ((double)Mobile.BodyWeight + (double)from.TotalWeight)) / this.d_WeightScale);
                    }
                    if (golda > maxgold)
                    {
                        golda = (int)maxgold;
                    }
                    gledger.Gold -= golda;

                    this.Gold += golda;

                    from.SendGump(new GoldLedgerGump(this));
                    from.SendMessage(2125, String.Format("You transfer {0} gold into your gold ledger.", golda.ToString("#,0")));
                    from.PlaySound(0x249);
                }
                else
                {
                    from.SendGump(new GoldLedgerGump(this));
                    from.SendMessage(2125, "You can only deposit gold or bank checks into your gold ledger.");
                }
            }
            else
            {
                from.SendGump(new GoldLedgerGump(this));
                from.SendMessage(2125, "You can only deposit gold or bank checks into your gold ledger.");
            }

            from.SendMessage(2125, "Do you want to deposit anything else? (ESC to cancel)");
            from.Target = new AddGoldTarget(this);
        }