Example #1
1
        public void OnTarget(Mobile from, object obj)
        {
            if (!from.InRange(GetWorldLocation(), 5) || !from.InLOS(this))
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
            else if (obj is Corpse)
            {
                Corpse c = obj as Corpse;

                if (c.Carved)
                    return;

                if (c.Owner is PlayerMobile)
                {
                    ((ICarvable)obj).Carve(from, this);
                    c.PublicOverheadMessage(MessageType.Emote, 33, true, string.Format("*You see {0} steal the soul of {1}*", from.Name, c.Owner.Name));
                    from.PlaySound(0x19c);
                    from.PlaySound(20);
                    from.PlaySound(230);
                    Effects.SendLocationEffect(c.Location, c.Map, 0x37c4, 18, 15, 1);
                }
                else
                    ((ICarvable) obj).Carve(from, this);
            }
            else
                from.SendAsciiMessage("You cannot use this on that");
        }
Example #2
0
        public override void OnDoubleClick( Mobile from )
        {
            if ( !IsChildOf( from.Backpack ) )
            {
                from.SendAsciiMessage("You must have the object in your backpack to use it.");
                return;
            }

            if ( m_Uses > 0 )
            {
                from.PlaySound( 0x2D6 );
                from.SendAsciiMessage( "An awful taste fills your mouth." ); // An awful taste fills your mouth.

                if ( from.BAC > 0 )
                {
                    from.BAC = 0;
                    from.SendAsciiMessage( "You are now sober!" ); // You are now sober!
                }

                m_Uses--;
            }
            else
            {
                Delete();
                from.SendAsciiMessage( "There wasn't enough left to have any effect." ); // There wasn't enough left to have any effect.
            }
        }
Example #3
0
            protected override void OnTarget( Mobile from, object targeted )
            {
                from.RevealingAction();

                if ( targeted is BaseCreature && from.CanBeHarmful( (Mobile)targeted, true ) )
                {
                    BaseCreature creature = (BaseCreature)targeted;

                    if ( creature.Controled )
                    {
                        from.SendAsciiMessage( "They are too loyal to their master to be provoked." );
                    }
                    else if ( creature.IsParagon )
                    {
                        from.SendAsciiMessage( "You have no chance of provoking those creatures." );
                    }
                    else
                    {
                        from.RevealingAction();
                        m_Instrument.PlayInstrumentWell( from );
                        from.SendAsciiMessage( "You play your music and your target becomes angered.  Whom do you wish them to attack?" );
                        from.Target = new InternalSecondTarget( from, m_Instrument, creature );
                    }
                }
            }
        protected override void OnTarget(Mobile from, object target) 
        {
            if (m_Deed.Deleted || m_Deed.RootParent != from)
                return;

            if (target is BaseClothing)
            {
                BaseClothing item = (BaseClothing)target;

                if (item.Hue == 1) 
                {
                    from.SendAsciiMessage("That is already pure black");
                }
                else if (!item.Movable)
                {
                    from.SendAsciiMessage("You cannot dye an item that is locked down");
                }
                else if (item.RootParent != from)
                {
                    from.SendAsciiMessage("You cannot dye that");
                }
                else
                {
                    item.Hue = 1;
                    from.SendAsciiMessage("You dye the item");
                    m_Deed.Delete(); 
                }
            }
            else
            {
                from.SendAsciiMessage("You cannot dye that");
            }
        }
Example #5
0
        public void BeginLaunch( Mobile from, bool useCharges )
        {
            Map map = from.Map;

            if ( map == null || map == Map.Internal )
                return;

            if ( useCharges )
            {
                if ( Charges > 0 )
                {
                    --Charges;
                }
                else
                {
                    from.SendAsciiMessage( "There are no charges left on that item." );
                    return;
                }
            }

            from.SendAsciiMessage( "You launch a firework!" );

            Point3D ourLoc = GetWorldLocation();

            Point3D startLoc = new Point3D( ourLoc.X, ourLoc.Y, ourLoc.Z + 10 );
            Point3D endLoc = new Point3D( startLoc.X + Utility.RandomMinMax( -2, 2 ), startLoc.Y + Utility.RandomMinMax( -2, 2 ), startLoc.Z + 32 );

            Effects.SendMovingEffect( new Entity( Serial.Zero, startLoc, map ), new Entity( Serial.Zero, endLoc, map ),
                0x36E4, 5, 0, false, false );

            Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( FinishLaunch ), new object[]{ from, endLoc, map } );
        }
Example #6
0
        public void Carve(Mobile from, Item item)
        {
            if (from.BeginAction(typeof(IAction)))
            {
                bool releaseLock;

                if (Summoned)
                {
                    from.SendAsciiMessage("You cannot sheer summoned sheep.");
                    return;
                }

                if (Utility.Random(1000) <= 2)
                    AntiMacro.AntiMacroGump.SendGumpThreaded((PlayerMobile)from);

                if (DateTime.Now < m_NextWoolTime)
                {
                    //This sheep is not yet ready to be shorn.
                    PrivateOverheadMessage(MessageType.Regular, 0x3b2, 500449, from.NetState);
                    releaseLock = true;
                    return;
                }

                from.SendAsciiMessage("You begin sheering the sheep...");
                new InternalTimer(from, this).Start();
                releaseLock = false;

                if (releaseLock && from is PlayerMobile)
                    ((PlayerMobile)from).EndPlayerAction();
            }
            else
                from.SendAsciiMessage("You must wait to perform another action.");
        }
		public override bool OnMoveOver( Mobile m )
		{
			if( m.SolidHueOverride != -1 )
				return true;
			else if( m.Player && !m.Alive ) // mobile is dead
			{
				m.SolidHueOverride = -1;

				if( m_TargetMap != null && m_TargetMap != Map.Internal )
				{
					m.MoveToWorld( m_Target, m_TargetMap );
					BaseCreature.TeleportPets( m, m_Target, m_TargetMap );
				}
				else
					m.SendAsciiMessage( "This has not yet been activated" );

				m.Combatant = null;
				m.Warmode = false;
				m.Resurrect();
				return false;
			}
			else if( ( m.Player ) && ( m.Hits < m.HitsMax ) )
				m.LocalOverheadMessage( MessageType.Regular, 906, true, "For liablity issues, we require all visitors to be in perfect health!" );
			else if( m.Player && m.SolidHueOverride != 2544 )
			{
                m_CasinoTimer = new CasinoTimer(this, m);
                m_CasinoTimer.Start();				
				m.SolidHueOverride = 2544;
				m.SendAsciiMessage( "You are about to enter the Casino!" );
			}

			return true;
		}
		protected override void OnTarget( Mobile from, object o )
		{
			if ( !BaseCommand.IsAccessible( from, o ) )
			{
				from.SendMessage( "That is not accessible." );
				return;
			}

            if (o is Item)
            {
                from.SendAsciiMessage("Where would you like to move the item?");
                from.Target = new MoveTarget(o);
            }
            else if (o is Mobile)
            {
                Mobile m = (Mobile)o;

                if (string.IsNullOrEmpty(m.Name))
                    from.SendAsciiMessage(string.Format("Where would you like to move {0}?", m.Name));
                else
                    from.SendAsciiMessage(string.Format("Where would you like to move {0}?", m));

                from.Target = new MoveTarget(o);
            }
            else
                from.SendAsciiMessage("You cannot move that.");
		}
Example #9
0
			protected override void OnTarget( Mobile from, object targeted )
			{
                bool releaseLock = true;

                SpellHelper.Turn(from, targeted);

                if (targeted is PlayerMobile)
                {
                    releaseLock = false;
                    new TextTimer(from, targeted).Start();
                }

                else if (targeted is BaseCreature)
                {
                    BaseCreature m = (BaseCreature) targeted;
                    if (m.BodyValue == 0x190 || m.BodyValue == 0x191)
                    {
                        releaseLock = false;

                        if (from.Skills[SkillName.Anatomy].Base < 100.0)
                            new TextTimer(from, targeted).Start();
                        else
                            new GumpTimer(from, targeted).Start();
                    }
                    else
                        from.SendAsciiMessage("You can only use anatomy on humanoids");
                }

                else
                    from.SendAsciiMessage("You can only use anatomy on humanoids");

                if (releaseLock && from is PlayerMobile)
                    ((PlayerMobile)from).EndPlayerAction();
            }
Example #10
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from.FindItemOnLayer(Layer.OneHanded) is SmithHammer)
            {
                bool hasForge, hasAnvil;
                DefBlacksmithy.CheckAnvilAndForge(from, 4, out hasAnvil, out hasForge);

                if (hasForge && hasAnvil)
                {
                    CraftSubRes subRes = CustomCraftMenu.GetSubRes(DefBlacksmithy.CraftSystem, GetType(), null);
                    int num = CraftResources.GetIndex(m_Resource);

                    if (subRes == null || !CustomCraftMenu.ResourceInfoList.ContainsKey(subRes))
                    {
                        from.SendAsciiMessage("You can't use that.");
                        return;
                    }

                    if (from.Skills[DefBlacksmithy.CraftSystem.MainSkill].Base < subRes.RequiredSkill)
                    {
                        from.SendAsciiMessage("You cannot work this strange and unusual metal.");
                        return;
                    }

                    from.SendGump(new CraftGump(from, DefBlacksmithy.CraftSystem, (BaseTool)from.FindItemOnLayer(Layer.OneHanded), null, num));
                }
                else
                    from.SendAsciiMessage("You need to be close to a forge and anvil.");
            }
            else
                from.SendAsciiMessage("You need to equip a smith's hammer.");

            base.OnDoubleClick(from);
        }
Example #11
0
		public override void OnDoubleClick( Mobile from )
		{
            if (Mobiles.BaseVendor.ConsumeBackpackAndBankGold(from, m_Price))
            {
                Bag regBag = new Bag();
                regBag.Hue = 1159;

                regBag.DropItem(new Bottle(12));
                regBag.DropItem(new EyesOfNewt(30));
                regBag.DropItem(new BlackPearl(50));
                regBag.DropItem(new Bloodmoss(50));
                regBag.DropItem(new Nightshade(50));
                regBag.DropItem(new Bandage(50));
                regBag.DropItem(new SulfurousAsh(60));
                regBag.DropItem(new Garlic(70));
                regBag.DropItem(new Ginseng(70));
                regBag.DropItem(new SpidersSilk(75));
                regBag.DropItem(new MandrakeRoot(85));

                from.Backpack.DropItem(regBag);
                from.SendAsciiMessage("You've bought a bag of reagents.");
                from.PlaySound(247);
            }
            else
                from.SendAsciiMessage("You do not have enough money!");
		}
        private static void CheckArray(Mobile from, Container cont, Type[] regs, string[] regsName)
        {
            string sOverLimit = "";
            string sUnderLimit = "";

            for (int i = 0; i < regs.Length; i++)
            {
                int count = cont.GetAmount(regs[i], true);
                string text = string.Format("{0}:{1}", regsName[i], count.ToString());

                if (count > ReagentWarningLimit)
                {
                    if ((sOverLimit.Length != 0) && (i < regs.Length)) sOverLimit += ", ";
                    sOverLimit += text;
                }
                else
                {
                    if ((sUnderLimit.Length != 0) && (i < regs.Length)) sUnderLimit += ", ";
                    sUnderLimit += text;
                }
            }

            if (sOverLimit.Length == 0 && sUnderLimit.Length == 0)
            {
                from.SendAsciiMessage(40, "No regs was found !");
            }
            else
            {
                if (sOverLimit.Length != 0) from.SendAsciiMessage(76, sOverLimit);
                if (sUnderLimit.Length != 0) from.SendAsciiMessage(40, sUnderLimit);
            }
        }
Example #13
0
		public void Target( Mobile m )
		{
			if ( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( CheckBSequence( m ) )
			{
                if ((m.Player && m.Dex <= 120) || (!m.Player))
                {
                    if (CurseSpell.UnderEffect(m))
                    {
                        if (m.Dex < m.RawDex)
                            m.RemoveStatMod(String.Format("[Magic] {0} Offset", StatType.Dex));
                        else
                            m.SendAsciiMessage("You are under the effect of a curse spell and cannot get any stat bonuses");
                    }
                    else
                        SpellHelper.AddStatBonus(Caster, m, StatType.Dex);
                }
                else
                {
                    m.SendAsciiMessage(33, "You are too fast to benefit from that!");
                    return;
                }

				m.FixedParticles( 0x373A, 10, 15, 5010, EffectLayer.Waist );
				m.PlaySound( Sound );
			}

			FinishSequence();
		}
Example #14
0
        public override void OnDoubleClick(Mobile from)
        {
            if (Filled)
            {
                if (from.InRange(this, 3) && from.InLOS(this))
                {
                    from.SendAsciiMessage("You look at the Tombstone");
                    from.PlaySound(47);
                    from.SendGump(new GraveGump());
                }
                else if (IsChildOf(from.Backpack))
                {
                    from.SendAsciiMessage("You look at the Tombstone");
                    from.PlaySound(47);
                    from.SendGump(new GraveGump());
                }
                else
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                }
            }

            if (!(Filled))
            {
                if (!IsChildOf(from.Backpack))
                    from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
                else
                {
                    from.Target = new InternalTarget(this);
                    from.SendAsciiMessage("This tombstone is blank!");
                    from.SendAsciiMessage("Target a players head to bury them.");
                }
            }
        }
Example #15
0
 protected override void OnTarget( Mobile from, object targeted )
 {
     if ( targeted is BasePoisonPotion )
     {
         from.SendAsciiMessage( "To what do you wish to apply the poison?" ); // To what do you wish to apply the poison?
         from.Target = new InternalTarget( (BasePoisonPotion)targeted );
     }
     else // Not a Poison Potion
     {
         from.SendAsciiMessage( "That is not a poison potion." ); //
     }
 }
Example #16
0
 // Override double click of the deed to call our target
 public override void OnDoubleClick( Mobile from )
 {
     if ( !IsChildOf( from.Backpack ) ) // Make sure its in their pack
     {
          from.SendAsciiMessage( "That must be in your pack for you to use it." ); // That must be in your pack for you to use it.
     }
     else
     {
         from.SendAsciiMessage( "What would you like to bless? (Clothes Only)" ); // What would you like to bless? (Clothes Only)
         from.Target = new ClothingBlessTarget( this ); // Call our target
      }
 }
Example #17
0
        public override void OnDoubleClick(Mobile from)
        {
            if (Mobiles.BaseVendor.ConsumeBackpackAndBankGold(from, m_Price))
            {
                from.SendAsciiMessage("You've bought some arrows.");
                from.PlaySound(247);

                from.AddToBackpack(new Arrow(m_Amount));
            }
            else
                from.SendAsciiMessage("You do not have enough money!");
        }
Example #18
0
 public override void OnDoubleClick( Mobile from )
 {
     if ( IsChildOf( from.Backpack ) )
     {
         from.SendAsciiMessage( "What spinning wheel do you wish to spin this on?" ); // What spinning wheel do you wish to spin this on?
         from.Target = new PickWheelTarget( this );
     }
     else
     {
         from.SendAsciiMessage( "That must be in your pack for you to use it." ); // That must be in your pack for you to use it.
     }
 }
Example #19
0
 public override void OnDoubleClick( Mobile from )
 {
     if ( IsChildOf( from.Backpack ) )
     {
         from.SendAsciiMessage( "Select a loom to use that on." );
         from.Target = new PickLoomTarget( this );
     }
     else
     {
         from.SendAsciiMessage( "That must be in your pack for you to use it." );
     }
 }
Example #20
0
		public static TimeSpan OnUse(Mobile m)
		{
            if (m.BeginAction(typeof(IAction)))
            {
                m.RevealingAction();
                m.SendAsciiMessage("What would you like to evaluate?");
                m.Target = new InternalTarget();
            }
            else
                m.SendAsciiMessage("You must wait to perform another action.");

            return TimeSpan.Zero;
		}
Example #21
0
 // Override double click of the deed to call our target
 public override void OnDoubleClick(Mobile from)
 {
     if (!IsChildOf(from.Backpack)) // Make sure its in their pack
     {
         //from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
         from.SendAsciiMessage("That must be in your pack for you to use it.");
     }
     else
     {
         from.SendAsciiMessage("Select the shafts you wish to use this on.");
         //from.SendLocalizedMessage(1005018); // What would you like to bless? (Clothes Only)
         from.Target = new FeatherTarget(this); // Call our target
     }
 }
Example #22
0
        public static TimeSpan OnUse(Mobile m)
        {
            bool releaseLock = true;

            if (m.BeginAction(typeof(IAction)))
            {
                int range = Math.Min((int)((100 - m.Skills[SkillName.Meditation].Value) / 2) + 8, 18);
                bool badCombat = (m.Combatant != null && m.InRange(m.Combatant.Location, range) && m.Combatant.InLOS(m));

                foreach (Mobile check in m.GetMobilesInRange(range))
                {
                    if (check.InLOS(m) && check.Combatant == m)
                    {
                        badCombat = true;
                        break;
                    }
                }

                if (m.Mana >= m.ManaMax)
                    m.SendLocalizedMessage(501846); // You are at peace.

                else if (badCombat || m.Warmode || (m is PlayerMobile && (((PlayerMobile)m).LastAttackTime + TimeSpan.FromSeconds(5.0)) >= DateTime.Now))
                    m.SendAsciiMessage("You are preoccupied with thoughts of battle.");

                else
                {
                    new InternalTimer(m).Start();

                    m.RevealingAction();
                    m.SendAsciiMessage("You begin meditating...");
                    //m.SendLocalizedMessage(501851); // You enter a meditative trance.
                    releaseLock = false;

                    if (m.Player)
                        m.PlaySound(0xF9);
                }
            }

            else
            {
                m.SendAsciiMessage("You must wait to perform another action.");
                releaseLock = false;    
            }

            if (m is PlayerMobile && releaseLock)
                ((PlayerMobile)m).EndPlayerAction();

            return TimeSpan.Zero;
        }
Example #23
0
 private void OnTargShafts( Mobile from, object target )
 {
     if ( target is Shaft )
     {
         Shaft shaft = (Shaft)target;
         if ( shaft.IsChildOf( from.Backpack ) )
             new Engines.Craft.FletchingSystem( this, shaft ).Begin( from, null );
         else
             from.SendAsciiMessage( "That belongs to someone else." );
     }
     else
     {
         from.SendAsciiMessage( "You can't use feathers on that." );
     }
 }
Example #24
0
 private void OnTargFeathers( Mobile from, object target )
 {
     if ( target is Feather )
     {
         Feather feather = (Feather)target;
         if ( feather.IsChildOf( from.Backpack ) )
             new Engines.Craft.FletchingSystem( feather, this ).Begin( from, null );
         else
             from.SendAsciiMessage( "That belongs to someone else." );
     }
     else
     {
         from.SendAsciiMessage( "You can't use shafts on that." );
     }
 }
Example #25
0
        public override void OnDoubleClick(Mobile from)
        {
            CustomRegion cR = from.Region as CustomRegion;

            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1060640); // "This item must be in your backpack to use it"
                return;
            }

            if (PointDest == Point3D.Zero || MapDest == null || MapDest == Map.Internal)
            {
                from.SendAsciiMessage("This waystone does not lead anywhere");
                return;
            }

            if (m_TeleportTimer != null && m_TeleportTimer.Running)
            {
                from.SendAsciiMessage("You stop the timer");
                m_TeleportTimer.Stop();
                return;
            }

            if (cR != null && !cR.Controller.CanUseStuckMenu)
            {
                from.SendAsciiMessage("You cannot use a waystone in this region");
                return;
            }

            if (from.Region.IsPartOf(typeof(Jail)))
            {
                from.SendLocalizedMessage(1114345, "", 0x35); // You'll need a better jailbreak plan than that!
                return;
            }

            if (from.Hits < from.HitsMax)
            {
                from.SendAsciiMessage("You must be fully healed to use this");
                return;
            }

            m_Origin = from.Location;
            from.SendAsciiMessage(string.Format("You will be teleported in {0} seconds", Delay));

            m_TeleportTimer = new TeleportTimer(this, from);
            m_TeleportTimer.Start();

        }
 public override void OnDoubleClick( Mobile from )
 {
     if ( !from.InRange( this.GetWorldLocation(), 3 ))
         from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
     else
         from.SendAsciiMessage( "This looks like part of a larger contraption." );
 }
Example #27
0
 public static void OnPickedInstrument( Mobile from, BaseInstrument instrument )
 {
     from.RevealingAction();
     //from.SendLocalizedMessage( 501587 ); // Whom do you wish to incite?
     from.SendAsciiMessage("Whom do you wish to incite?");
     from.Target = new InternalFirstTarget( from, instrument );
 }
            protected override void OnTarget( Mobile from, object targeted )
            {
                if ( targeted is Spellbook )
                {
                    if ( from.CheckAlive() && !m_Scroll.Deleted && m_Scroll.Movable && m_Scroll.Amount >= 1 )
                    {
                        Spellbook book = (Spellbook)targeted;

                        SpellbookType type = Spellbook.GetTypeForSpell( m_Scroll.SpellID );

                        if ( type != book.SpellbookType )
                        {
                        }
                        else if ( book.HasSpell( m_Scroll.SpellID ) )
                        {
                            from.SendAsciiMessage( "That spell is already present in that spellbook." ); // That spell is already present in that spellbook.
                        }
                        else
                        {
                            int val = m_Scroll.SpellID - book.BookOffset;

                            if ( val >= 0 && val < book.BookCount )
                            {
                                book.Content |= (ulong)1 << val;

                                m_Scroll.Consume();

                                from.Send( new Network.PlaySound( 0x249, book.GetWorldLocation() ) );
                            }
                        }
                    }
                }
            }
Example #29
0
 public void OnChop(Mobile from)
 {
     if ( this.IsChildOf( from.Backpack ) )
         new Engines.Craft.BowcraftSystem( this ).Begin( from, null );
     else
         from.SendAsciiMessage( "That belongs to someone else." );
 }
Example #30
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendAsciiMessage("Target can not be seen."); // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                SpellHelper.CheckReflect((int)this.Circle, Caster, ref m);

                if (m.Spell != null)
                    m.Spell.OnCasterHurt();

                m.Paralyzed = false;

                if (CheckResisted(m, 4))
                    m.SendAsciiMessage("You feel yourself resisting magical energy."); // You feel yourself resisting magical energy.
                else if (m.Mana >= 100)
                    m.Mana -= Utility.Random(1, 100);
                else
                    m.Mana -= Utility.Random(1, m.Mana);

                m.FixedParticles(0x374A, 10, 15, 5032, EffectLayer.Head);
                m.PlaySound(0x1F8);

            }

            FinishSequence();
        }