Exemplo n.º 1
0
		public Gremlin() : base( AIType.AI_Archer, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			Name = "a gremlin";
			Body = 724; 

			SetStr( 106 );
			SetDex( 130 );
			SetInt( 36 );

			SetHits( 70 );

			SetDamage( 5, 7 );

			SetDamageType( ResistanceType.Physical, 100 );

			SetResistance( ResistanceType.Physical, 26 );
			SetResistance( ResistanceType.Fire, 36 );
			SetResistance( ResistanceType.Cold, 22 );
			SetResistance( ResistanceType.Poison, 17 );
			SetResistance( ResistanceType.Energy, 30 );

			SetSkill( SkillName.Anatomy, 78.5 );
			SetSkill( SkillName.MagicResist, 82.5 );
			SetSkill( SkillName.Tactics, 65.3 );

			AddItem( new Bow() );
			PackItem( new Arrow( Utility.RandomMinMax( 60, 80 ) ) );

            Apple fruit = new Apple(5);
            if (Utility.RandomDouble() <= 0.15)
                fruit.Poison = Poison.Regular;
            PackItem( fruit);

		}
Exemplo n.º 2
0
		public OrcScout() : base( AIType.AI_OrcScout, FightMode.Closest, 10, 7, 0.2, 0.4 )
		{
			Name = "an orc scout";
			Body = 0xB5;
			BaseSoundID = 0x45A;

			SetStr( 96, 120 );
			SetDex( 101, 130 );
			SetInt( 36, 60 );

			SetHits( 58, 72 );
			SetMana( 30, 60 );

			SetDamage( 5, 7 );

			SetDamageType( ResistanceType.Physical, 100 );

			SetResistance( ResistanceType.Physical, 25, 35 );
			SetResistance( ResistanceType.Fire, 30, 40 );
			SetResistance( ResistanceType.Cold, 15, 25 );
			SetResistance( ResistanceType.Poison, 15, 20 );
			SetResistance( ResistanceType.Energy, 25, 30 );

			SetSkill( SkillName.MagicResist, 50.1, 75.0 );
			SetSkill( SkillName.Tactics, 55.1, 80.0 );

			SetSkill( SkillName.Fencing, 50.1, 70.0 );
			SetSkill( SkillName.Archery, 80.1, 120.0 );
			SetSkill( SkillName.Parry, 40.1, 60.0 );
			SetSkill( SkillName.Healing, 80.1, 100.0 );
			SetSkill( SkillName.Anatomy, 50.1, 90.0 );
			SetSkill( SkillName.DetectHidden, 100.1, 120.0 );
                   	SetSkill( SkillName.Hiding, 100.0, 120.0 );
			SetSkill( SkillName.Stealth, 80.1, 120.0 );

			Fame = 1500;
			Karma = -1500;

            Apple fruit = new Apple(Utility.RandomMinMax(3, 5));
            if (Utility.RandomDouble() <= 0.15)
                fruit.Poison = Poison.Regular;

			PackItem( fruit );
			PackItem( new Arrow( Utility.RandomMinMax( 60, 70 ) ) );
			PackItem( new Bandage( Utility.RandomMinMax( 1, 15 ) ) );

			if ( 0.1 > Utility.RandomDouble() )
				AddItem( new OrcishBow() );
			else
				AddItem( new Bow() );
		}
Exemplo n.º 3
0
        public override void OnDeath(Container c)
        {
            // No loot !
            foreach (Item i in c.Items)
            {
                i.Delete();
            }

            // fun?
            if (Utility.Random(25) == 10)
            {
                Item apple = new Apple();
                apple.Name = "Pomme qui tua Blanche-Neige";
                c.AddItem(apple);
            }

            base.OnDeath(c);
        }
Exemplo n.º 4
0
        public override void OnCast()
        {
            if ( CheckSequence() ) {

                Item comida = new Carrot();
                Item comida1 = new Apple();

                Caster.AddToBackpack( comida );
                Caster.AddToBackpack( comida1 );

                Caster.SendMessage( "A refeiчуo foi criada e colocada na sua mochila." );

                Caster.PlaySound( 0x212 );
                Caster.PlaySound( 0x206 );

                Effects.SendLocationParticles( EffectItem.Create( Caster.Location, Caster.Map, EffectItem.DefaultDuration ), 0x376A, 1, 29, 0x47D, 2, 9962, 0 );
                Effects.SendLocationParticles( EffectItem.Create( new Point3D( Caster.X, Caster.Y, Caster.Z - 7 ), Caster.Map, EffectItem.DefaultDuration ), 0x37C4, 1, 29, 0x47D, 2, 9502, 0 );

            }

            FinishSequence();
        }
Exemplo n.º 5
0
        public override void OnDoubleClick( Mobile from )
        {
            if ( from.Mounted && !TreeHelper.CanPickMounted )
            {
                from.SendMessage( "You cannot pick fruit while mounted." );
                return;
            }

            if ( DateTime.Now > lastpicked.AddSeconds(3) ) // 3 seconds between picking
            {
                lastpicked = DateTime.Now;

                int lumberValue = (int)from.Skills[SkillName.Lumberjacking].Value / 20;
                if ( from.Mounted )
                    ++lumberValue;

                if ( lumberValue == 0 )
                {
                    from.SendMessage( "You have no idea how to pick this fruit." );
                    return;
                }

                if ( from.InRange( this.GetWorldLocation(), 2 ) )
                {
                    if ( m_yield < 1 )
                    {
                        from.SendMessage( "There is nothing here to harvest." );
                    }
                    else //check skill
                    {
                        from.Direction = from.GetDirectionTo( this );

                        from.Animate( from.Mounted ? 26:17, 7, 1, true, false, 0 );

                        if ( lumberValue > m_yield )
                            lumberValue = m_yield + 1;

                        int pick = Utility.Random( lumberValue );
                        if ( pick == 0 )
                        {
                            from.SendMessage( "You do not manage to gather any fruit." );
                            return;
                        }

                        m_yield -= pick;
                        from.SendMessage( "You pick {0} apple{1}!", pick, ( pick == 1 ? "" : "s" ) );

                        //PublicOverheadMessage( MessageType.Regular, 0x3BD, false, string.Format( "{0}", m_yield ));

                        Apple crop = new Apple( pick );
                        from.AddToBackpack( crop );

                        if ( !regrowTimer.Running )
                        {
                            regrowTimer.Start();
                        }
                    }
                }
                else
                {
                    from.SendLocalizedMessage( 500446 ); // That is too far away.
                }
            }
        }
Exemplo n.º 6
0
        public void Chop( Mobile from )
        {
            if ( from.InRange( this.GetWorldLocation(), 1 ) )
            {
                if ( ( chopTimer == null ) || ( !chopTimer.Running ) )
                {
                    if ( ( TreeHelper.TreeOrdinance ) && ( from.AccessLevel == AccessLevel.Player ) )
                    {
                        if ( from.Region is Regions.GuardedRegion )
                            from.CriminalAction( true );
                    }

                    chopTimer = new TreeHelper.ChopAction( from );

                    Point3D pnt = this.Location;
                    Map map =  this.Map;

                    from.Direction = from.GetDirectionTo( this );
                    chopTimer.Start();

                    double lumberValue = from.Skills[SkillName.Lumberjacking].Value / 100;
                    if ( ( lumberValue > .5 ) && ( Utility.RandomDouble() <= lumberValue ) )
                    {
                        Apple fruit = new Apple( (int)Utility.Random( 13 ) + m_yield );
                        from.AddToBackpack( fruit );

                        int cnt = Utility.Random( (int)( lumberValue * 10 ) + 1 );
                        Log logs = new Log( cnt ); // Fruitwood Logs ??
                        from.AddToBackpack( logs );

                        FruitTreeStump i_stump = new FruitTreeStump( typeof( AppleTree ) );
                        Timer poof = new StumpTimer( this, i_stump, from );
                        poof.Start();
                    }
                    else from.SendLocalizedMessage( 500495 ); // You hack at the tree for a while, but fail to produce any useable wood.
                    //PublicOverheadMessage( MessageType.Regular, 0x3BD, false, string.Format( "{0}", lumberValue ));
                }
            }
            else from.SendLocalizedMessage( 500446 );  // That is too far away.
        }
Exemplo n.º 7
0
		public override void OnDoubleClick( Mobile from )
		{
			// Make sure is in pack
			if(from.Backpack == null || !IsChildOf(from.Backpack)) 
			{
				from.SendLocalizedMessage(1042001);  // Must be in pack to use!!
				return;
			}

			//generate all the crap
            Basket basket = new Basket();
			basket.Hue = Utility.RandomList(44,167);
			basket.Name = "basket" + " - " + m_Signature;

			// skull
			CandleSkull skull = new CandleSkull();
			skull.Name = "skull candle" + " - " + m_Signature;
					
			// apple 1
			Item apple1 = new Apple();
			apple1.Hue = 134;
			apple1.Name = "candied apple" + " - " + m_Signature;

			// apple 2
			Item apple2 = new Apple();
			apple2.Hue = 47;
			apple2.Name = "caramel apple" + " - " + m_Signature;

			// apple 3
			if(Utility.RandomDouble() < 0.25)
			{
				Item apple3 = new Apple();
				((Apple)apple3).Poison = Poison.Lesser;
				apple3.Hue = 63;
				apple3.Name = "poisoned apple" + " - " + m_Signature;
				basket.DropItem(apple3);
			}

			// add them
			basket.DropItem(skull);
			basket.DropItem(apple1);
			basket.DropItem(apple2);
		
			if(m_Place == 1)
			{
				Item HangingSkeleton = new Item(Utility.RandomList(6657,6658,6659,6660));
				HangingSkeleton.Hue = 0;
				HangingSkeleton.Light = LightType.Circle225;
				HangingSkeleton.Weight = 6;
				HangingSkeleton.Name = "hanging skeleton" + " - " + m_Signature;
				basket.DropItem(HangingSkeleton);
			}

			if(m_Place == 2)
			{
				Item web = new Item(Utility.RandomList(4306,4307,4308,4309));
				web.Hue = 0;
				web.Light = LightType.Circle225;
				web.Weight = 1;
				web.Name = "spider web" + " - " + m_Signature;
				basket.DropItem(web);
			}
			
			if(m_Place == 3)
			{
				Item skeleton = new MonsterStatuette(MonsterStatuetteType.Skeleton);
				skeleton.Hue = 44;
				skeleton.Light = LightType.Circle225;
				skeleton.Name = "Happy Halloween" + " - " + m_Signature;
				basket.DropItem(skeleton);
			}

			// finish it up
			from.Backpack.DropItem(basket);
			this.Delete();
			from.SendMessage("Your Halloween gift has been placed into your backpack.");
		}
Exemplo n.º 8
0
            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.");
                            }

                            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 = m_Fountain.Jackpot - 5;
                                    }
                                }
                            }
                            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.");
                            }

                            break;
                        }


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

                                switch (Utility.RandomMinMax(1, 10))
                                {
                                case 1:  food = new Bacon();            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 Lime();             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 = m_Fountain.Jackpot - 5;
                                    }
                                }
                            }
                            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.");
                            }

                            break;
                        }

                        case MagicFountainAddon.FountainMessage.Calm: {
                            if (0.005 > 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)
                                {
                                    // set up the horse... =P
                                    horse.Controlled    = true;
                                    horse.ControlMaster = m_From;

                                    horse.OwnerAbandonTime = DateTime.MinValue;
                                    horse.BondingBegin     = DateTime.MinValue;

                                    horse.ControlOrder  = OrderType.Follow;
                                    horse.ControlTarget = m_From;
                                    horse.Owners.Add(m_From);                                                // seems to be new in 2.0
                                    // horse.Loyalty = PetLoyalty.WonderfullyHappy;  // doesn't work in 2.0 but seems unnecessary

                                    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 > 20)
                                {
                                    m_Fountain.Jackpot = m_Fountain.Jackpot - 10;
                                }
                            }
                            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.");
                            }

                            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 = m_Fountain.Jackpot - 5;
                                    }
                                    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.");
                            }

                            break;
                        }
                        }
                    }
                    else
                    {
                        m_From.SendMessage("You don't have a coin to toss in.");
                    }
                }
                else
                {
                    m_From.SendMessage("Get closer.");
                }
            }
Exemplo n.º 9
0
        public override void OnDoubleClick(Mobile from)
        {
            // Make sure is in pack
            if (from.Backpack == null || !IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                  // Must be in pack to use!!
                return;
            }

            //generate all the crap
            Basket basket = new Basket();

            basket.Hue  = Utility.RandomList(44, 167);
            basket.Name = "basket" + " - " + m_Signature;

            // skull
            CandleSkull skull = new CandleSkull();

            skull.Name = "skull candle" + " - " + m_Signature;

            // apple 1
            Item apple1 = new Apple();

            apple1.Hue  = 134;
            apple1.Name = "candied apple" + " - " + m_Signature;

            // apple 2
            Item apple2 = new Apple();

            apple2.Hue  = 47;
            apple2.Name = "caramel apple" + " - " + m_Signature;

            // apple 3
            if (Utility.RandomDouble() < 0.25)
            {
                Item apple3 = new Apple();
                ((Apple)apple3).Poison = Poison.Lesser;
                apple3.Hue             = 63;
                apple3.Name            = "poisoned apple" + " - " + m_Signature;
                basket.DropItem(apple3);
            }

            // add them
            basket.DropItem(skull);
            basket.DropItem(apple1);
            basket.DropItem(apple2);

            if (m_Place == 1)
            {
                Item HangingSkeleton = new Item(Utility.RandomList(6657, 6658, 6659, 6660));
                HangingSkeleton.Hue    = 0;
                HangingSkeleton.Light  = LightType.Circle225;
                HangingSkeleton.Weight = 6;
                HangingSkeleton.Name   = "hanging skeleton" + " - " + m_Signature;
                basket.DropItem(HangingSkeleton);
            }

            if (m_Place == 2)
            {
                Item web = new Item(Utility.RandomList(4306, 4307, 4308, 4309));
                web.Hue    = 0;
                web.Light  = LightType.Circle225;
                web.Weight = 1;
                web.Name   = "spider web" + " - " + m_Signature;
                basket.DropItem(web);
            }

            if (m_Place == 3)
            {
                Item skeleton = new MonsterStatuette(MonsterStatuetteType.Skeleton);
                skeleton.Hue   = 44;
                skeleton.Light = LightType.Circle225;
                skeleton.Name  = "Happy Halloween" + " - " + m_Signature;
                basket.DropItem(skeleton);
            }

            // finish it up
            from.Backpack.DropItem(basket);
            this.Delete();
            from.SendMessage("Your Halloween gift has been placed into your backpack.");
        }
Exemplo n.º 10
0
        public override void OnDoubleClick( Mobile from )
        {
            if ( from.Mounted && !TreeHelper.CanPickMounted )
            {
                from.SendMessage( "You cannot pick fruit while mounted." );
                return;
            }

            if ( DateTime.Now > lastpicked.AddSeconds(3) ) // 3 seconds between picking
            {
                lastpicked = DateTime.Now;

                int lumberValue = (int)(from.Skills[SkillName.Peacemaking].Base * 0.1);
                if ( from.Mounted )
                    ++lumberValue;

                if ( lumberValue < 0 ) 								//Changed lumberValue == 0 to lv < 0
                {
                    from.SendMessage( "You have no idea how to pick this fruit." );
                    return;
                }

                if ( from.InRange( this.GetWorldLocation(), 2 ) )
                {
                    if ( m_yield < 1 )
                    {
                        from.SendMessage( "There is nothing here to harvest." );
                    }
                    else //check skill
                    {
                        from.Direction = from.GetDirectionTo( this );

                        from.Animate( from.Mounted ? 26:17, 7, 1, true, false, 0 );

                        if ( lumberValue < m_yield ) 									//Changed lumberValue > to lv < 0
                            lumberValue = m_yield + 1;

                        int pick = Utility.Random( lumberValue );
                        if ( pick == 0 || ((PlayerMobile)from).Feats.GetFeatLevel(FeatList.Farming) < 1 )
                        {
                            from.SendMessage( "You do not manage to gather any fruit." );
                            return;
                        }

                        m_yield -= pick;
                        from.SendMessage( "You pick {0} apple{1}!", pick, ( pick == 1 ? "" : "s" ) );
                        Seed.PickCropSeed(from, "AppleTree");

                        if( from is PlayerMobile )
                        {
                            ( (PlayerMobile)from ).Crafting = true;
                            Misc.LevelSystem.AwardMinimumXP( (PlayerMobile)from, 1 );
                            ( (PlayerMobile)from ).Crafting = false;
                        }

                        //PublicOverheadMessage( MessageType.Regular, 0x3BD, false, string.Format( "{0}", m_yield ));

                        Apple crop = new Apple( pick );
                        from.AddToBackpack( crop );

                        if ( !regrowTimer.Running )
                        {
                            regrowTimer.Start();
                        }
                    }
                }
                else
                {
                    from.SendLocalizedMessage( 500446 ); // That is too far away.
                }
            }
        }
Exemplo n.º 11
0
        private void Restock_Callback()
        {
            if ( TotalItems < ItemsMax )
            {
                for ( int i = TotalItems; i < ItemsMax; i++ )
                {
                    Item item = null;

                    switch ( Utility.RandomMinMax( 1, 11 ) )
                    {
                        default:
                        case 1: item = new Grapes(); break;
                        case 2: item = new Ham(); break;
                        case 3: item = new CheeseWedge(); break;
                        case 4: item = new Muffins(); break;
                        case 5: item = new FishSteak(); break;
                        case 6: item = new Ribs(); break;
                        case 7: item = new CookedBird(); break;
                        case 8: item = new Sausage(); break;
                        case 9: item = new Apple(); break;
                        case 10: item = new Peach(); break;
                        case 11: item = new Bandage(); break;
                    }

                    if ( item != null )
                        DropItem( item );
                }
            }
        }
Exemplo n.º 12
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from.Mounted && !TreeHelper.CanPickMounted)
            {
                from.SendMessage(AgriTxt.CannotWorkMounted);
                return;
            }

            if (DateTime.Now > lastpicked.AddSeconds(3)) // 3 seconds between picking
            {
                lastpicked = DateTime.Now;

                int lumberValue = (int)from.Skills[SkillName.Lumberjacking].Value / 5;

                if (from.Mounted)
                    ++lumberValue;

                if (lumberValue < 3)
                {
                    from.SendMessage(AgriTxt.DunnoHowTo);
                    return;
                }

                if (from.InRange(this.GetWorldLocation(), 2))
                {
                    if (m_yield < 1)
                    {
                        from.SendMessage(AgriTxt.NoCrop);
                    }
                    else //check skill
                    {
                        from.Direction = from.GetDirectionTo(this);

                        from.Animate(from.Mounted ? 26 : 17, 7, 1, true, false, 0);

                        if (lumberValue > m_yield)
                            lumberValue = m_yield + 1;

                        int pick = Utility.Random(lumberValue);
                        if (pick == 0)
                        {
                            from.SendMessage(AgriTxt.ZeroPicked);
                            return;
                        }

                        m_yield -= pick;
                        from.SendMessage(AgriTxt.YouPick + " {0} pomme{1}!", pick, (pick == 1 ? "" : "s"));

                        //PublicOverheadMessage( MessageType.Regular, 0x3BD, false, string.Format( "{0}", m_yield )); 

                        Apple crop = new Apple(pick);
                        from.AddToBackpack(crop);

                        if (!regrowTimer.Running)
                        {
                            regrowTimer.Start();
                        }
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500446); // That is too far away. 
                }
            }
        }