public override Item GetCropObject() { Carrot carrot = new Carrot(); carrot.ItemID = Utility.Random(3191, 2); return(carrot); }
public override Item GetCropObject() { Carrot carrot = new Carrot(); carrot.ItemID = Utility.Random( 3191, 2 ); return carrot; }
public override void OnDoubleClick( Mobile from ) { if ( from.InRange( this.GetWorldLocation(), 2 ) ) { int pick = Utility.Random( 1,3 ); Carrot crop = new Carrot( pick ); from.AddToBackpack( crop ); this.Delete(); } else { from.SendMessage( "You are too far away to harvest anything." ); } }
public override bool LootItem(Mobile from) { if (Utility.RandomDouble() <= .05) { CarrotSeed item = new CarrotSeed(); from.AddToBackpack(item); from.SendMessage("You manage to gather 1 carrot seed."); } Carrot c = new Carrot(); c.ItemID = 3191; from.AddToBackpack(c); from.SendMessage("You manage to gather 1 carrot."); return true; }
public override void OnDoubleClick(Mobile from) { if (from.InRange(this.GetWorldLocation(), 2)) { int pick = Utility.Random(1, 3); Carrot crop = new Carrot(pick); from.AddToBackpack(crop); this.Delete(); } else { from.SendMessage("You are too far away to harvest anything."); } }
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(); }
public override void OnDoubleClick( Mobile from ) { if ( m_sower == null || m_sower.Deleted ) m_sower = from; if ( from.Mounted && !CropHelper.CanWorkMounted ) { from.SendMessage( "You cannot harvest a crop while mounted." ); return; } if ( DateTime.Now > lastpicked.AddSeconds(1) ) // 3 seconds between picking changed to 1 sec { lastpicked = DateTime.Now; int cookingValue = (int)from.Skills[SkillName.Cooking].Value / 20; if ( cookingValue == 0 ) { from.SendMessage( "You have no idea how to harvest this crop." ); return; } if ( from.InRange( this.GetWorldLocation(), 1 ) ) { if ( m_yield < 1 ) { from.SendMessage( "There is nothing here to harvest." ); if ( PlayerCanDestroy && !( m_sower.AccessLevel > AccessLevel.Counselor ) ) { UpRootGump g = new UpRootGump( from, this ); from.SendGump( g ); } } else //check skill and sower { from.Direction = from.GetDirectionTo( this ); from.Animate( from.Mounted ? 29:32, 5, 1, true, false, 0 ); if ( from == m_sower ) { cookingValue *= 2; m_lastvisit = DateTime.Now; } if ( cookingValue > m_yield ) cookingValue = m_yield + 1; int pick = Utility.Random( cookingValue ); if ( pick == 0 ) { from.SendMessage( "You do not manage to harvest any crops." ); return; } m_yield -= pick; from.SendMessage( "You harvest {0} crop{1}!", pick, ( pick == 1 ? "" : "s" ) ); //PublicOverheadMessage( MessageType.Regular, 0x3BD, false, string.Format( "{0}", m_yield )); ((Item)this).ItemID = pickedGraphic; Carrot crop = new Carrot( pick ); from.AddToBackpack( crop ); if ( SowerPickTime != TimeSpan.Zero && m_lastvisit + SowerPickTime < DateTime.Now && !( m_sower.AccessLevel > AccessLevel.Counselor ) ) { this.UpRoot( from ); return; } if ( !regrowTimer.Running ) { regrowTimer.Start(); } } } else { from.SendMessage( "You are too far away to harvest anything." ); } } }
public override void OnDoubleClick(Mobile from) { if (m_sower == null || m_sower.Deleted) m_sower = from; if (from.Mounted && !CropHelper.CanWorkMounted) { 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 (lumberValue == 0) { from.SendMessage(AgriTxt.DunnoHowTo); return; } if (from.InRange(this.GetWorldLocation(), 2)) { if (m_yield < 1) { from.SendMessage(AgriTxt.NoCrop); if (PlayerCanDestroy && !(m_sower.AccessLevel > AccessLevel.Counselor)) { UpRootGump g = new UpRootGump(from, this); from.SendGump(g); } } else //check skill and sower { from.Direction = from.GetDirectionTo(this); from.Animate(from.Mounted ? 29 : 32, 5, 1, true, false, 0); if (from == m_sower) { lumberValue *= 2; m_lastvisit = DateTime.Now; } 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} carotte{1}!", pick, (pick == 1 ? "" : "s")); //PublicOverheadMessage( MessageType.Regular, 0x3BD, false, string.Format( "{0}", m_yield )); ((Item)this).ItemID = pickedGraphic; Carrot crop = new Carrot(pick); from.AddToBackpack(crop); if (SowerPickTime != TimeSpan.Zero && m_lastvisit + SowerPickTime < DateTime.Now && !(m_sower.AccessLevel > AccessLevel.Counselor)) { this.UpRoot(from); return; } if (!regrowTimer.Running) { regrowTimer.Start(); } } } else { from.SendMessage(AgriTxt.TooFar); } } }
public override Item GetCropObject() { Carrot carrot = new Carrot(); return(carrot); }