示例#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");
        }
示例#2
0
		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;
		}
示例#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 );
                    }
                }
            }
        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);
            }
        }
示例#5
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.");
        }
        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");
            }
        }
示例#7
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 } );
        }
示例#8
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();
		}
示例#9
0
		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.");
		}
示例#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);
        }
示例#11
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.
            }
        }
示例#12
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!");
		}
示例#13
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();
            }
示例#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.");
                }
            }
        }
示例#15
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
      }
 }
示例#16
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." );
     }
 }
示例#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!");
        }
示例#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.
     }
 }
示例#19
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." ); //
     }
 }
示例#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;
		}
示例#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
     }
 }
示例#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;
        }
示例#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." );
     }
 }
示例#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." );
     }
 }
示例#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();

        }
示例#26
0
 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." );
 }
示例#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() ) );
                            }
                        }
                    }
                }
            }
示例#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." );
 }
示例#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();
        }
示例#31
0
            protected override void OnTarget(Mobile from, object obj)
            {
                if (m_Bola.Deleted)
                {
                    return;
                }

                if (obj is Mobile)
                {
                    Mobile to = (Mobile)obj;

                    if (!m_Bola.IsChildOf(from.Backpack))
                    {
                        from.SendAsciiMessage("The bola must be in your pack to use it.");
                    }
                    else if (!Core.AOS && (from.FindItemOnLayer(Layer.OneHanded) != null || from.FindItemOnLayer(Layer.TwoHanded) != null))
                    {
                        from.SendAsciiMessage("Your hands must be free to use this.");
                    }
                    else if (from.Mounted)
                    {
                        from.SendAsciiMessage("You cannot use this while riding a mount.");
                    }
                    else if (!to.Mounted)
                    {
                        from.SendAsciiMessage("You have no reason to throw a bola at that.");
                    }
                    else if (!from.CanBeHarmful(to))
                    {
                    }
                    else if (from.BeginAction(typeof(Bola)))
                    {
                        EtherealMount.StopMounting(from);

                        Item one = from.FindItemOnLayer(Layer.OneHanded);
                        Item two = from.FindItemOnLayer(Layer.TwoHanded);

                        if (one != null)
                        {
                            from.AddToBackpack(one);
                        }

                        if (two != null)
                        {
                            from.AddToBackpack(two);
                        }

                        from.DoHarmful(to);

                        if (Core.AOS)
                        {
                            Timer timer = new BolaTimer(from);
                            timer.Start();

                            AddContext(from, new BolaContext(timer));
                        }

                        m_Bola.Consume();

                        from.Direction = from.GetDirectionTo(to);
                        from.Animate(11, 5, 1, true, false, 0);
                        from.MovingEffect(to, 0x26AC, 10, 0, false, false);

                        Timer.DelayCall(TimeSpan.FromSeconds(0.5), new TimerStateCallback(FinishThrow), new object[] { from, to });
                    }
                    else
                    {
                        from.SendAsciiMessage("You have to wait a few moments before you can use another bola!");
                    }
                }
                else
                {
                    from.SendAsciiMessage("You cannot throw a bola at that.");
                }
            }
示例#32
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            int    count = m_Count;
            Mobile m     = sender.Mobile;

            for (int i = 0; i < 6 && count > 0; i++)
            {
                Item item = null;
                if (!m_Old && i >= 3)
                {
                    break;
                }

                if (!info.IsSwitched(i + 100))
                {
                    continue;
                }

                count--;

                switch (i)
                {
                case 0:
                    if (m_Abyss)
                    {
                        m.AddToBackpack(new BankCheck(5000));
                    }
                    else
                    {
                        m.AddToBackpack(new FireworksWand());
                    }
                    break;

                case 1:
                    if (m_Abyss)
                    {
                        m.AddToBackpack(new BagOfReagents(100));
                    }
                    else
                    {
                        m.AddToBackpack(item = new Spyglass());
                        item.LootType        = LootType.Newbied;
                    }
                    break;

                case 2:
                    m.AddToBackpack(new HairRestylingDeed());
                    break;

                case 3:
                    switch (Utility.Random(5))
                    {
                    case 0:
                        item = new RangerArms();
                        break;

                    case 1:
                        item = new RangerChest();
                        break;

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

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

                    case 4:
                        item = new RangerLegs();
                        break;
                    }

                    if (item != null)
                    {
                        m.AddToBackpack(item);
                    }
                    break;

                case 4:
                    if (m_Abyss)
                    {
                        item          = new BaseItem(Utility.Random(6) + 0xEf4);
                        item.Name     = "I survived the Abyss!";
                        item.LootType = LootType.Newbied;
                        m.AddToBackpack(item);
                    }
                    else
                    {
                        m.AddToBackpack(new ClothingBlessDeed());
                    }
                    break;

                case 5:
                    if (m_Abyss)
                    {
                        m.AddToBackpack(new Server.Multis.SmallDragonBoatDeed());
                    }
                    else
                    {
                        m.AddToBackpack(new StrongBoxDeed());
                    }
                    break;
                }
            }

            m.SendAsciiMessage("Enjoy!");
            if (count > 0)
            {
                ((Account)m.Account).SetTag("Rewards", count.ToString());
                m.SendAsciiMessage("You have {0} reward{1} left.", count, count == 1 ? "" : "s");
            }
            else
            {
                ((Account)m.Account).RemoveTag("Rewards");
                ((Account)m.Account).RemoveTag("GoodRewards");
            }
        }
示例#33
0
文件: Key.cs 项目: proxeeus/UORebirth
            protected override void OnTarget(Mobile from, object targeted)
            {
                int number = -1;

                if (targeted == m_Key)
                {
                    number = 501665;                     // Enter a description for this key.

                    from.Prompt = new RenamePrompt(m_Key);
                }
                else if (targeted is StrongBox)
                {
                    StrongBox sb = (StrongBox)targeted;

                    if (sb.Owner == null || sb.Owner.Deleted)
                    {
                        from.SendAsciiMessage("You can not recover that strong box.");
                        return;
                    }

                    if (sb.Owner == from || sb.Owner.Account == from.Account)
                    {
                        while (sb.Items.Count > 0)
                        {
                            ((Item)sb.Items[0]).MoveToWorld(sb.Location, sb.Map);
                        }
                        sb.Delete();
                        from.AddToBackpack(new StrongBoxDeed());
                    }
                    else
                    {
                        from.SendAsciiMessage("You do not own that strong box.");
                    }
                }
                else if (targeted is ILockable)
                {
                    ILockable o = (ILockable)targeted;

                    if (o.KeyValue == m_Key.KeyValue)
                    {
                        if (o is BaseDoor && !((BaseDoor)o).UseLocks())
                        {
                            number = 501668;                             // This key doesn't seem to unlock that.
                        }
                        else
                        {
                            o.Locked = !o.Locked;

                            if (targeted is Item)
                            {
                                Item item = (Item)targeted;

                                if (o.Locked)
                                {
                                    item.SendLocalizedMessageTo(from, 1048000);
                                }
                                else
                                {
                                    item.SendLocalizedMessageTo(from, 1048001);
                                }
                            }
                        }
                    }
                    else
                    {
                        number = 501668;                         // This key doesn't seem to unlock that.
                    }
                }
                else if (targeted is HouseSign)
                {
                    HouseSign sign = (HouseSign)targeted;
                    if (sign.Owner != null && sign.Owner.KeyValue == m_Key.KeyValue)
                    {
                        from.Prompt = new Prompts.HouseRenamePrompt(sign.Owner);
                        number      = 1060767;                    // Enter the new name of your house.
                    }
                }
                else
                {
                    number = 501666;                     // You can't unlock that!
                }

                if (number != -1)
                {
                    from.SendLocalizedMessage(number);
                }
            }
示例#34
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendAsciiMessage("Target can not be seen.");
                //Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if (m == Caster)
            {
                Caster.SendAsciiMessage("Thou can not resurrect thyself.");
                //Caster.SendLocalizedMessage( 501039 ); // Thou can not resurrect thyself.
            }
            else if (!Caster.Alive)
            {
                Caster.SendAsciiMessage("The resurrecter must be alive.");
                //Caster.SendLocalizedMessage( 501040 ); // The resurrecter must be alive.
            }
            else if (m.Alive)
            {
                Caster.SendAsciiMessage("Target is not dead.");
                //Caster.SendLocalizedMessage( 501041 ); // Target is not dead.
            }
            else if (!Caster.InRange(m, 1))
            {
                Caster.SendAsciiMessage("Target is not close enough.");
                //Caster.SendLocalizedMessage( 501042 ); // Target is not close enough.
            }
            else if (!m.Player)
            {
                Caster.SendAsciiMessage("Target is not a being.");
                //Caster.SendLocalizedMessage( 501043 ); // Target is not a being.
            }
            else if (m.Map == null || !m.Map.CanFit(m.Location, 16, false, false))
            {
                Caster.SendAsciiMessage("Target can not be resurrected at that location.");
                m.SendAsciiMessage("Thou can not be resurrected there!");
                //Caster.SendLocalizedMessage( 501042 ); // Target can not be resurrected at that location.
                //m.SendLocalizedMessage( 502391 ); // Thou can not be resurrected there!
            }
            else if (m.Region != null && m.Region.IsPartOf("Khaldun"))
            {
                Caster.SendLocalizedMessage(1010395);                   // The veil of death in this area is too strong and resists thy efforts to restore life.
            }
            else if (CheckBSequence(m, true))
            {
                SpellHelper.Turn(Caster, m);

                m.PlaySound(0x214);
                m.FixedEffect(0x376A, 10, 16);

                m.CantWalk = true;
                m.CloseGump(typeof(ResurrectGump));

                if (m is PlayerMobile && !((PlayerMobile)m).HasMenu)
                {
                    ((PlayerMobile)m).HasMenu = true;
                    m.SendMenu(new ResurrectGump(m, Caster));
                }
                //m.SendGump( new ResurrectGump( m, Caster ) );
            }

            FinishSequence();
        }
示例#35
0
 public void buildit(Mobile from, Mobile m, int id, ArrayList warnings, string aNote, bool tGo, bool showRelease)
 {
     try
     {
         displayReleases = showRelease;
         from.CloseGump(typeof(JailReviewGump));
         jailor   = from;
         badBoy   = m;
         m_id     = id;
         Closable = true;
         Dragable = true;
         AddPage(0);
         AddBackground(0, 0, 326, 230, 5054);
         AddLabel(12, 4, 200, "Reviewing: " + badBoy.Name + " (" + ((Account)badBoy.Account).Username + ")");
         if (tGo)
         {
             AddLabel(300, 17, 200, "GO");
             AddButton(280, 20, 2223, 2224, 2, GumpButtonType.Reply, 0);
         }
         AddLabel(12, 200, 200, "Note");
         AddBackground(42, 198, 268, 24, 0x2486);
         AddTextEntry(46, 200, 250, 20, 200, 0, aNote);
         //add button
         AddButton(70, 150, 2460, 2461, 1, GumpButtonType.Reply, 0);
         //previous button
         AddButton(120, 150, 2466, 2467, 20, GumpButtonType.Reply, 0);
         //next Button
         AddButton(200, 150, 2469, 2470, 21, GumpButtonType.Reply, 0);
         //release toggle
         AddButton(115, 167, displayReleases ? 2154 : 2151, displayReleases ? 2151 : 2154, 22, GumpButtonType.Reply, 0);
         AddLabel(147, 171, 200, "Show Releases");
         if (warnings == null)
         {
             m_warn = new ArrayList();
             foreach (AccountComment note in ((Account)m.Account).Comments)
             {
                 if ((note.AddedBy == JailSystem.JSName + "-warning") || (note.AddedBy == JailSystem.JSName + "-jailed") || (note.AddedBy == JailSystem.JSName + "-note") || ((displayReleases) && ((note.AddedBy == JailSystem.JSName))))
                 {
                     m_warn.Add(note);
                 }
             }
             m_id = m_warn.Count - 1;
         }
         else
         {
             m_warn = warnings;
         }
         AddImageTiled(9, 36, 308, 110, 2624);
         AddAlphaRegion(9, 36, 308, 110);
         string temp = "No prior warnings.";
         if (m_warn.Count > 0)
         {
             if (m_id < 0)
             {
                 m_id = m_warn.Count - 1;
             }
             if (m_id >= m_warn.Count)
             {
                 m_id = 0;
             }
             temp = ((AccountComment)m_warn[m_id]).Content;
             if (((AccountComment)m_warn[m_id]).AddedBy == JailSystem.JSName + "-warning")
             {
                 AddLabel(12, 40, 53, "Warned");
             }
             else if (((AccountComment)m_warn[m_id]).AddedBy == JailSystem.JSName + "-jailed")
             {
                 AddLabel(12, 40, 38, "Jailed");
             }
             else if (((AccountComment)m_warn[m_id]).AddedBy == JailSystem.JSName + "-note")
             {
                 AddLabel(12, 40, 2, "Note");
             }
             else
             {
                 AddLabel(12, 40, 2, "Release");
             }
             AddLabel(60, 40, 200, "Issued: " + ((AccountComment)m_warn[m_id]).LastModified);
         }
         else
         {
             //no prior warning
             m_id = -1;
         }
         AddLabel(12, 60, 200, "Event " + (m_id + 1) + " of " + m_warn.Count);
         //AddLabel( 12, 230, 200, temp );
         AddHtml(12, 80, 300, 62, temp, true, true);
     }
     catch (System.NullReferenceException)
     {
         // Malik: Couldn't find enough information on this in the crash logs to find out a reason why it crashed.
         // Need more information on this and on the conditions why it happens. Exception handler here until then.
         from.SendAsciiMessage("Error creating review gump. Please report this to devs and give as much details as possible on what you were doing!");
     }
 }
示例#36
0
 public virtual void SendPackFullTo(Mobile from, Item item, HarvestDefinition def, HarvestResource resource)
 {
     from.SendAsciiMessage(string.Format("You drop the {0} at your feet.", string.IsNullOrEmpty(item.Name) ? CliLoc.LocToString(item.LabelNumber) : item.Name));
     //def.SendMessageTo( from, def.PackFullMessage );
 }
示例#37
0
        public void OnTarget(Mobile from, object targeted)
        {
            if (this.Deleted || this.Amount <= 0)
            {
                return;
            }

            Mobile targ = targeted as Mobile;

            if (from.NextSkillTime > DateTime.Now)
            {
                from.SendSkillMessage();                 // You must wait...
            }
            else if (targ == null || targ.Deleted || !targ.Alive || !(targ.Body.IsHuman || targ.Body.IsAnimal || targ.Body.IsSea || (targ is BaseCreature && ((BaseCreature)targ).Controled && !((BaseCreature)targ).Summoned)))
            {
                // you can heal anything tamable... I guess.
                from.SendLocalizedMessage(500951);                   // You cannot heal that.
            }
            else if (!from.InRange(targ, 3))
            {
                from.SendLocalizedMessage(500295);                     // You are too far away to do that.
            }
            else if (Notoriety.Compute(from, targ) == Notoriety.Enemy) // || Server.Misc.NotorietyHandlers.CheckAggressor( from.Aggressors, targ ) || Server.Misc.NotorietyHandlers.CheckAggressed( from.Aggressed, targ ) )
            {
                from.SendAsciiMessage("You cannot heal them right now.");
            }
            else if (!from.CanSee(targ) || !from.InLOS(targ))
            {
                from.SendAsciiMessage("You can't see that.");
            }
            else if (targ.Hits >= targ.HitsMax)
            {
                from.SendLocalizedMessage(500955);                   // That being is not damaged!
            }
            else if (!targ.CanBeginAction(typeof(Bandage)) || !from.CanBeBeneficial(targ, true, true))
            {
                from.SendAsciiMessage("This being cannot be newly bandaged yet.");
            }
            else
            {
                from.DoBeneficial(targ);
                from.RevealingAction();

                this.Consume();

                int       damage = targ.HitsMax - targ.Hits;
                int       sk     = damage * 100 / targ.HitsMax;
                int       healed = 1;
                SkillName skill  = GetSkillFor(targ);
                if (from.CheckSkill(skill, sk - 25.0, sk + 25.0))
                {
                    targ.PlaySound(0x57);

                    double scale = (75.0 + from.Skills[skill].Value - sk) / 100.0;
                    if (scale > 1.0)
                    {
                        scale = 1.0;
                    }
                    else if (scale < 0.5)
                    {
                        scale = 0.5;
                    }
                    healed = (int)(damage * scale);

                    if (healed < 1)
                    {
                        healed = 1;
                    }
                    else if (healed > 100)
                    {
                        healed = 100;
                    }
                }

                targ.Hits += healed;
                if (healed > 1)
                {
                    from.SendAsciiMessage("You apply the bandages.");
                }
                else
                {
                    from.SendAsciiMessage("You apply the bandages, but they barely help.");
                }

                targ.BeginAction(typeof(Bandage));
                new BandageExpire(targ).Start();
            }
        }
示例#38
0
        public override void OnResponse(NetState state, int index)
        {
            if (GuildMenu.BadLeader(m_Mobile, m_Guild))
            {
                return;
            }

            switch (index)
            {
            case 9:     //guild protection
            {
                m_Mobile.SendMenu(new GuildProtectionMenu(m_Mobile, m_Guild));
                break;
            }

            case 10:     // Main menu
            {
                m_Mobile.SendMenu(new GuildMenu(m_Mobile, m_Guild));

                break;
            }

            case 0:                                                                     // Set guild name
            {
                m_Mobile.SendAsciiMessage("Enter new guild name (40 characters max):"); // Enter new guild name (40 characters max):
                m_Mobile.Prompt = new GuildNamePrompt(m_Mobile, m_Guild);

                break;
            }

            case 1:                                                                            // Set guild abbreviation
            {
                m_Mobile.SendAsciiMessage("Enter new guild abbreviation (3 characters max):"); // Enter new guild abbreviation (3 characters max):
                m_Mobile.Prompt = new GuildAbbrvPrompt(m_Mobile, m_Guild);

                break;
            }

            case 2:                                                                            // Set charter
            {
                m_Mobile.SendAsciiMessage("Enter the new guild charter (50 characters max):"); // Enter the new guild charter (50 characters max):
                m_Mobile.Prompt = new GuildCharterPrompt(m_Mobile, m_Guild);

                break;
            }

            case 3:     // Dismiss member
            {
                m_Mobile.SendMenu(new GuildDismissMenu(m_Mobile, m_Guild, 0));

                break;
            }

            case 4:     // War menu
            {
                m_Mobile.SendMenu(new GuildWarAdminMenu(m_Mobile, m_Guild));

                break;
            }

            case 5:     // Administer candidates
            {
                m_Mobile.SendMenu(new GuildAdminCandidatesMenu(m_Mobile, m_Guild, 0));

                break;
            }

            case 6:                                                                            // Set guildmaster's title
            {
                m_Mobile.SendAsciiMessage("Enter new guildmaster title (20 characters max):"); // Enter new guildmaster title (20 characters max):
                m_Mobile.Prompt = new GuildTitlePrompt(m_Mobile, m_Mobile, m_Guild);

                break;
            }

            case 7:     // Grant title
            {
                m_Mobile.SendMenu(new GrantGuildTitleMenu(m_Mobile, m_Guild, 0));

                break;
            }

            case 8:     // Move guildstone
            {
                if (m_Guild.Guildstone != null)
                {
                    GuildTeleporter item = new GuildTeleporter(m_Guild.Guildstone);

                    if (m_Guild.Teleporter != null)
                    {
                        m_Guild.Teleporter.Delete();
                    }

                    m_Mobile.SendAsciiMessage("Use the teleporting object placed in your backpack to move this guildstone.");           // Use the teleporting object placed in your backpack to move this guildstone.

                    m_Mobile.AddToBackpack(item);
                    m_Guild.Teleporter = item;
                }

                m_Mobile.SendMenu(new GuildmasterMenu(m_Mobile, m_Guild));

                break;
            }
            }
        }
示例#39
0
        protected override void OnTarget(Mobile from, object targeted)
        {
            if (m_System is Mining && targeted is StaticTarget)
            {
                int itemID = ((StaticTarget)targeted).ItemID;

                // grave
                if (itemID == 0xED3 || itemID == 0xEDF || itemID == 0xEE0 || itemID == 0xEE1 || itemID == 0xEE2 || itemID == 0xEE8)
                {
                    PlayerMobile player = from as PlayerMobile;

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

                        if (qs is WitchApprenticeQuest)
                        {
                            FindIngredientObjective obj = qs.FindObjective(typeof(FindIngredientObjective)) as FindIngredientObjective;

                            if (obj != null && !obj.Completed && obj.Ingredient == Ingredient.Bones)
                            {
                                player.SendLocalizedMessage(1055037);                                   // You finish your grim work, finding some of the specific bones listed in the Hag's recipe.
                                obj.Complete();

                                return;
                            }
                        }
                    }
                }
            }

            if (m_System is Lumberjacking && targeted is IChopable)
            {
                ((IChopable)targeted).OnChop(from);
            }
            else if (m_System is Lumberjacking && targeted is ICarvable)
            {
                ((ICarvable)targeted).Carve(from, m_Tool);
            }
            else if (m_System is Lumberjacking && FurnitureAttribute.Check(targeted as Item))
            {
                DestroyFurniture(from, (Item)targeted);
            }
            else if (m_System is Mining && targeted is TreasureMap)
            {
                ((TreasureMap)targeted).OnBeginDig(from);
            }
            else if (m_System is Lumberjacking && targeted is GuildContainer) //Taran: Turn guildcontainer into deed
            {
                Guild guild = from.Guild as Guild;
                if (guild != null && !guild.Disbanded)
                {
                    GuildContainer gc     = (GuildContainer)targeted;
                    Mobile         leader = guild.Leader;

                    if (from.Guild.Id == gc.GuildID && from == leader)
                    {
                        Container cont  = (Container)targeted;
                        Item[]    found = cont.FindItemsByType(typeof(Item), true);

                        if (found.Length > 0)
                        {
                            from.SendAsciiMessage("The container must be empty before you can re-deed it");
                        }
                        else
                        {
                            cont.Delete();
                            from.AddToBackpack(new GuildContainerDeed());
                            from.SendAsciiMessage("You put the guild container deed in your backpack");
                        }
                    }
                    else
                    {
                        from.SendAsciiMessage("You must be the leader of the guild to do that");
                    }
                }
                else
                {
                    from.SendAsciiMessage("You can't use an axe on that.");
                }
            }

            #region Turn logs into boards
            else if (m_System is Lumberjacking && targeted is BaseLog) //Turn logs into boards
            {
                BaseLog log = (BaseLog)targeted;

                if (log.IsChildOf(from.Backpack))
                {
                    CraftResource cr     = log.Resource;
                    int           amount = log.Amount;

                    log.Delete();

                    switch (cr)
                    {
                    case CraftResource.RegularWood:
                    {
                        Board board = new Board(amount);
                        from.AddToBackpack(board);
                        break;
                    }

                    case CraftResource.OakWood:
                    {
                        OakBoard board = new OakBoard(amount);
                        from.AddToBackpack(board);
                        break;
                    }

                    case CraftResource.AshWood:
                    {
                        AshBoard board = new AshBoard(amount);
                        from.AddToBackpack(board);
                        break;
                    }

                    case CraftResource.YewWood:
                    {
                        YewBoard board = new YewBoard(amount);
                        from.AddToBackpack(board);
                        break;
                    }

                    case CraftResource.Heartwood:
                    {
                        HeartwoodBoard board = new HeartwoodBoard(amount);
                        from.AddToBackpack(board);
                        break;
                    }

                    case CraftResource.Bloodwood:
                    {
                        BloodwoodBoard board = new BloodwoodBoard(amount);
                        from.AddToBackpack(board);
                        break;
                    }

                    case CraftResource.Frostwood:
                    {
                        FrostwoodBoard board = new FrostwoodBoard(amount);
                        from.AddToBackpack(board);
                        break;
                    }

                    case CraftResource.Mahoganywood:
                    {
                        MahoganyBoard board = new MahoganyBoard(amount);
                        from.AddToBackpack(board);
                        break;
                    }

                    case CraftResource.Cedarwood:
                    {
                        CedarBoard board = new CedarBoard(amount);
                        from.AddToBackpack(board);
                        break;
                    }

                    case CraftResource.Willowwood:
                    {
                        WillowBoard board = new WillowBoard(amount);
                        from.AddToBackpack(board);
                        break;
                    }

                    case CraftResource.Mystwood:
                    {
                        MystWoodBoard board = new MystWoodBoard(amount);
                        from.AddToBackpack(board);
                        break;
                    }

                    default:
                    {
                        from.SendAsciiMessage("Error, no check for that log is made.");
                        break;
                    }
                    }
                    if (from.Mounted)
                    {
                        from.Animate(26, 5, 1, true, false, 0);
                    }
                    else
                    {
                        from.Animate(9, 5, 1, true, false, 0);
                    }

                    from.PlaySound(573);
                    from.SendAsciiMessage("You chop the logs and turn them into boards");
                }
                else
                {
                    from.SendAsciiMessage("That must be in your backpack before you can chop it");
                }
            }
            #endregion
            else
            {
                if (!CheckAllowed(from))
                {
                    return;
                }
                m_System.StartHarvesting(from, m_Tool, targeted);
            }
        }
示例#40
0
        public override void OnDoubleClick(Mobile m)
        {
            Item RewardItem = null;

            if (IsChildOf(m.Backpack))
            {
                switch (Utility.Random(11))
                {
                case 0:
                {
                    RewardItem     = new GoldNecklace();
                    RewardItem.Hue = Utility.RandomList(Sphere.RareHues);
                    break;
                }

                case 1:
                {
                    RewardItem     = new GoldBeadNecklace();
                    RewardItem.Hue = Utility.RandomList(Sphere.RareHues);
                    break;
                }

                case 2:
                {
                    RewardItem     = new SilverNecklace();
                    RewardItem.Hue = Utility.RandomList(Sphere.RareHues);
                    break;
                }

                case 3:
                {
                    RewardItem     = new SilverBeadNecklace();
                    RewardItem.Hue = Utility.RandomList(Sphere.RareHues);
                    break;
                }

                case 4:
                {
                    RewardItem     = new GoldBracelet();
                    RewardItem.Hue = Utility.RandomList(Sphere.RareHues);
                    break;
                }

                case 5:
                {
                    RewardItem     = new SilverBracelet();
                    RewardItem.Hue = Utility.RandomList(Sphere.RareHues);
                    break;
                }

                case 6:
                {
                    RewardItem     = new GoldRing();
                    RewardItem.Hue = Utility.RandomList(Sphere.RareHues);
                    break;
                }

                case 7:
                {
                    RewardItem     = new SilverRing();
                    RewardItem.Hue = Utility.RandomList(Sphere.RareHues);
                    break;
                }

                case 8:
                {
                    RewardItem     = new SilverEarrings();
                    RewardItem.Hue = Utility.RandomList(Sphere.RareHues);
                    break;
                }

                case 9:
                {
                    RewardItem     = new GoldEarrings();
                    RewardItem.Hue = Utility.RandomList(Sphere.RareHues);
                    break;
                }

                case 10:
                {
                    RewardItem     = new Necklace();
                    RewardItem.Hue = Utility.RandomList(Sphere.RareHues);
                    break;
                }
                }

                m.AddToBackpack(RewardItem);
                Delete();
            }
            else
            {
                m.SendAsciiMessage("That must be in your pack for you to use it.");
            }
        }
示例#41
0
            protected override void OnTarget(Mobile from, object target)
            {
                if (target is Mobile)
                {
                    if (from.CheckTargetSkill(SkillName.Forensics, target, 40.0, 100.0))
                    {
                        PlayerMobile pm  = target as PlayerMobile;
                        bool         msg = false;

                        if (pm != null)
                        {
                            if (pm.NpcGuild == NpcGuild.ThievesGuild)
                            {
                                from.SendLocalizedMessage(501004);//That individual is a thief!
                                msg = true;
                            }

                            if (pm.HasTempStatLoss)
                            {
                                from.SendMessage("That individual will receive temporary skill and stat loss if they are killed.");
                                msg = true;
                            }
                        }

                        if (!msg)
                        {
                            from.SendLocalizedMessage(501003);//You notice nothing unusual.
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(501001);//You cannot determain anything useful.
                    }
                }
                else if (target is Corpse)
                {
                    if (from.CheckTargetSkill(SkillName.Forensics, target, 0.0, 100.0))
                    {
                        Corpse c = (Corpse)target;

                        if (((Body)c.Amount).IsHuman)
                        {
                            c.LabelTo(from, 1042751, (c.Killer == null ? "no one" : c.Killer.Name));//This person was killed by ~1_KILLER_NAME~
                        }
                        if (c.Looters.Count > 0)
                        {
                            StringBuilder sb = new StringBuilder();
                            for (int i = 0; i < c.Looters.Count; i++)
                            {
                                if (i > 0)
                                {
                                    sb.Append(", ");
                                }
                                sb.Append(((Mobile)c.Looters[i]).Name);
                            }

                            c.LabelTo(from, 1042752, sb.ToString());//This body has been distrubed by ~1_PLAYER_NAMES~
                        }
                        else
                        {
                            c.LabelTo(from, 501002);//The corpse has not be desecrated.
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(501001);//You cannot determain anything useful.
                    }
                }
                else if (target is TrapableContainer)
                {
                    if (from.CheckTargetSkill(SkillName.Forensics, target, 25.0, 100.0))
                    {
                        if (((TrapableContainer)target).Trapped)
                        {
                            from.SendAsciiMessage("That container looks very suspicious.");
                        }
                        else
                        {
                            from.SendLocalizedMessage(501003);//You notice nothing unusual.
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(501001);//You cannot determain anything useful.
                    }
                }

                if (target is ILockpickable)
                {
                    ILockpickable p = (ILockpickable)target;
                    if (p.Picker != null)
                    {
                        from.SendLocalizedMessage(1042749, p.Picker.Name);//This lock was opened by ~1_PICKER_NAME~
                    }
                    else
                    {
                        from.SendLocalizedMessage(501003);//You notice nothing unusual.
                    }
                }
            }
示例#42
0
        private void Make(Mobile from, int amount, Type type)
        {
            End();

            if (from.Deleted || !from.Alive)
            {
                return;
            }

            if (from.Backpack == null || !m_Shafts.IsChildOf(from) || !m_Feathers.IsChildOf(from))
            {
                from.SendAsciiMessage("Those resources do not belong to you.");
                return;
            }

            int resCost = amount;

            if (from.CheckSkill(SkillName.Fletching, -10.0, 50.0))
            {
                Item item = null;
                try
                {
                    ConstructorInfo ctor = type.GetConstructor(ctorTypes);
                    if (ctor != null)
                    {
                        ctorArgs[0] = amount;
                        item        = ctor.Invoke(ctorArgs) as Item;
                    }
                }
                catch
                {
                }

                if (item != null)
                {
                    from.AddToBackpack(item);
                    from.SendAsciiMessage("You create the item{0} and place {1} in your pack.", amount > 1 ? "s" : "", amount > 1 ? "them" : "it");
                }
                else
                {
                    from.SendAsciiMessage("Unable to create that.");
                    resCost = 0;
                }
            }
            else
            {
                from.SendAsciiMessage("You failed to create the item{0}.", amount > 1 ? "s" : "");
                resCost = (int)(amount * (100.0 - from.Skills[SkillName.Fletching].Value) / 100.0);
                if (resCost < amount * 0.05)
                {
                    resCost = (int)(amount * 0.05);
                }
                if (resCost < 1)
                {
                    resCost = 1;
                }
            }

            m_Shafts.Amount   -= resCost;
            m_Feathers.Amount -= resCost;

            if (m_Shafts.Amount <= 0)
            {
                m_Shafts.Delete();
            }
            if (m_Feathers.Amount <= 0)
            {
                m_Feathers.Delete();
            }
        }
示例#43
0
        protected override void OnTarget(Mobile from, object target)
        {
            ShrinkPotion pot  = null;
            HitchingPost post = null;

            if (m_ShrinkTool is ShrinkPotion)
            {
                pot = (ShrinkPotion)m_ShrinkTool;
            }
            else if (m_ShrinkTool is HitchingPost)
            {
                post = (HitchingPost)m_ShrinkTool;
            }


            if (!m_StaffCommand)
            {
                if (pot != null)
                {
                    if (!from.InRange(pot.GetWorldLocation(), 1))
                    {
                        from.SendAsciiMessage("You are too far away from the shrink potion");
                        return;
                    }
                }
                else if (post != null)
                {
                    if (!from.InRange(post.GetWorldLocation(), 1))
                    {
                        from.SendAsciiMessage("You are too far away from the hitching post");
                        return;
                    }
                }
            }

            BaseCreature pet = target as BaseCreature;

            if (target == from)
            {
                from.SendMessage("You cannot shrink yourself!");
            }

            else if (target is Item)
            {
                from.SendMessage("You cannot shrink that!");
            }

            else if (target is PlayerMobile)
            {
                from.SendMessage("That person gives you a dirty look!");
            }

            else if (SpellHelper.CheckCombat(from))
            {
                from.SendMessage("You cannot shrink your pet while you are fighting.");
            }

            else if (null == pet)
            {
                from.SendMessage("That is not a pet!");
            }

            else if ((pet.BodyValue == 400 || pet.BodyValue == 401) && pet.Controlled == false)
            {
                from.SendMessage("That person gives you a dirty look!");
            }

            else if (pet.IsDeadPet)
            {
                from.SendMessage("You cannot shrink the dead!");
            }

            else if (pet.Summoned)
            {
                from.SendMessage("You cannot shrink a summoned creature!");
            }

            else if (!m_StaffCommand && pet.Combatant != null && pet.InRange(pet.Combatant, 12) && pet.Map == pet.Combatant.Map)
            {
                from.SendMessage("Your pet is fighting; you cannot shrink it yet.");
            }

            else if (pet.BodyMod != 0)
            {
                from.SendMessage("You cannot shrink your pet while it is polymorphed.");
            }

            else if (!m_StaffCommand && pet.Controlled == false)
            {
                from.SendMessage("You cannot not shrink wild creatures.");
            }

            else if (!m_StaffCommand && pet.ControlMaster != from)
            {
                from.SendMessage("That is not your pet.");
            }

            else if (!m_StaffCommand && ShrinkItem.IsPackAnimal(pet) && (null != pet.Backpack && pet.Backpack.Items.Count > 0))
            {
                from.SendMessage("You must unload this pet's pack before it can be shrunk.");
            }
            //
            else if (target is YoungNightmare)
            {
                from.SendMessage("The creature refuses!");
            }
            //
            else
            {
                if (pet.ControlMaster != from && !pet.Controlled)
                {
                    ISpawner se = pet.Spawner;
                    if (se != null && se.UnlinkOnTaming)
                    {
                        pet.Spawner.Remove(pet);
                        pet.Spawner = null;
                    }

                    pet.CurrentWayPoint = null;
                    pet.ControlMaster   = from;
                    pet.Controlled      = true;
                    pet.ControlTarget   = null;
                    pet.ControlOrder    = OrderType.Come;
                    pet.Guild           = null;
                    pet.Delta(MobileDelta.Noto);
                }

                IEntity p1 = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z), from.Map);
                IEntity p2 = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z + 50), from.Map);

                Effects.SendMovingParticles(p2, p1, ShrinkTable.Lookup(pet), 1, 0, true, false, 0, 3, 1153, 1, 0, EffectLayer.Head, 0x100);
                from.PlaySound(492);
                from.AddToBackpack(new ShrinkItem(pet));

                if (!m_StaffCommand && m_ShrinkTool != null)
                {
                    if (m_ShrinkTool.ShrinkCharges > 0)
                    {
                        m_ShrinkTool.ShrinkCharges--;
                    }

                    if (m_ShrinkTool.ShrinkCharges <= 0 && m_ShrinkTool is ShrinkPotion)
                    {
                        ((ShrinkPotion)m_ShrinkTool).Consume(1);
                    }
                }
            }
        }
示例#44
0
 public static void OnPickedInstrument(Mobile from, BaseInstrument instrument)
 {
     from.RevealingAction();
     from.SendAsciiMessage(0x3B2, "Whom do you wish to entice?");//from.SendLocalizedMessage( 1049541 ); // Choose the target for your song of discordance.
     from.Target = new DiscordanceTarget(from, instrument);
 }
示例#45
0
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendAsciiMessage("Target can not be seen.");
            }
            else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
            {
                SpellHelper.Turn(Caster, p);

                if (p is Item)
                {
                    p = ((Item)p).GetWorldLocation();
                }

                ArrayList targets = new ArrayList();

                Map map = Caster.Map;

                bool playerVsPlayer = false;

                if (map != null)
                {
                    IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 2);

                    foreach (Mobile m in eable)
                    {
                        if (Caster != m && SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false))
                        {
                            targets.Add(m);

                            if (m.Player)
                            {
                                playerVsPlayer = true;
                            }
                        }
                    }

                    eable.Free();
                }

                double damage;

                if (Core.AOS)
                {
                    damage = GetNewAosDamage(48, 1, 5, Caster.Player && playerVsPlayer);
                }
                else
                {
                    damage = Utility.Random(27, 22);
                }

                if (targets.Count > 0)
                {
                    Effects.PlaySound(p, Caster.Map, 0x160);

                    if (Core.AOS && targets.Count > 1)
                    {
                        damage = (damage * 2) / targets.Count;
                    }
                    else if (!Core.AOS)
                    {
                        damage /= targets.Count;
                    }

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = (Mobile)targets[i];

                        double toDeal = damage;

                        if (!Core.AOS && CheckResisted(m))
                        {
                            toDeal *= 0.5;

                            m.SendAsciiMessage("You feel yourself resisting magical energy.");
                        }

                        Caster.DoHarmful(m);
                        SpellHelper.Damage(this, m, toDeal, 0, 100, 0, 0, 0);

                        Caster.MovingParticles(m, 0x36D4, 7, 0, false, true, 9501, 1, 0, 0x100);
                    }
                }
            }

            FinishSequence();
        }
示例#46
0
            protected override void OnTarget(Mobile from, object target)
            {
                from.RevealingAction();

                if (target is Mobile)
                {
                    Mobile targ = (Mobile)target;

                    if (targ is BaseCreature && ((BaseCreature)targ).BardImmune)
                    {
                        from.SendAsciiMessage("You cannot entice that!");
                    }
                    else if (targ == from)
                    {
                        from.SendAsciiMessage("You cannot entice yourself!");
                    }
                    else
                    {
                        if (!BaseInstrument.CheckMusicianship(from))
                        {
                            from.SayTo(from, 500612); // You play poorly, and there is no effect.
                            m_Instrument.PlayInstrumentBadly(from);
                            m_Instrument.ConsumeUse(from);
                        }
                        else if (from.CheckTargetSkill(SkillName.Discordance, target, 0, 100))
                        {
                            m_Instrument.PlayInstrumentWell(from);
                            m_Instrument.ConsumeUse(from);

                            if (targ.Player)
                            {
                                targ.SayTo(targ, "You hear lovely music, and are drawn towards it...");
                                targ.SayTo(from, "You might have better luck with sweet words.");
                                return;
                            }

                            if (targ.Body.IsHuman)
                            {
                                targ.Say("What am I hearing?");
                            }

                            if (targ is BaseGuard || targ is BaseVendor || targ is WanderingHealer || targ is Banker || targ is TownCrier || targ is BaseShieldGuard)
                            {
                                targ.Say("Oh, but I cannot wander too far from my work!");
                                targ.SayTo(from, true, "They look too dedicated to their job to be lured away.");
                            }
                            else
                            {
                                from.SayTo(from, true, "You play your hypnotic music, luring them near.");
                                if (targ is BaseCreature)
                                {
                                    ((BaseCreature)targ).TargetLocation = new Point2D(from.Location);
                                }
                            }
                        }
                        else
                        {
                            targ.SayTo(targ, true, "You hear lovely music, and for a moment are drawn towards it...");
                            targ.SayTo(from, true, "Your music fails to attract them.");
                            m_Instrument.PlayInstrumentBadly(from);
                            m_Instrument.ConsumeUse(from);
                        }
                    }
                }
                else
                {
                    m_Instrument.PlayInstrumentBadly(from);
                }
            }
示例#47
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            switch (info.ButtonID)
            {
            case 1:                     // continue
            {
                Guild guild = m_From.Guild as Guild;

                if (guild == null)
                {
                    PlayerState pl = PlayerState.Find(m_From);

                    if (pl != null)
                    {
                        pl.Leaving = DateTime.Now;

                        if (Faction.LeavePeriod == TimeSpan.FromDays(7.0))
                        {
                            m_From.SendAsciiMessage("You will be removed from the faction in 7 days.");
                        }
                        else
                        {
                            m_From.SendAsciiMessage("You will be removed from the faction in {0} days.", Faction.LeavePeriod.TotalDays);
                        }
                    }
                }
                else if (guild.Leader != m_From)
                {
                    m_From.SendAsciiMessage("You cannot quit the faction because you are not the guild master.");
                }
                else
                {
                    m_From.SendAsciiMessage("Your guild is now quitting the faction.");

                    for (int i = 0; i < guild.Members.Count; ++i)
                    {
                        Mobile      mob = (Mobile)guild.Members[i];
                        PlayerState pl  = PlayerState.Find(mob);

                        if (pl != null)
                        {
                            pl.Leaving = DateTime.Now;

                            if (Faction.LeavePeriod == TimeSpan.FromDays(7.0))
                            {
                                mob.SendAsciiMessage("Your guild will quit the faction in 7 days.");
                            }
                            else
                            {
                                mob.SendAsciiMessage("Your guild will quit the faction in {0} days.", Faction.LeavePeriod.TotalDays);
                            }
                        }
                    }
                }

                break;
            }

            case 2:                     // cancel
            {
                m_From.SendAsciiMessage("Canceled resignation.");
                break;
            }
            }
        }
示例#48
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m.SolidHueOverride != -1)
            {
                return(true);
            }

            if (m.IsInEvent && !AllowIsInEvent)
            {
                m.SendAsciiMessage("You cannot use this while in an event");
                return(true);
            }

            if (m is PlayerMobile && !m.Alive && !AllowDead)
            {
                m.SendAsciiMessage("You cannot use this while dead");
                return(true);
            }

            if (!AllowMounted && m.Player && m.Mounted)
            {
                m.SendAsciiMessage("You cannot use this while mounted");
                return(true);
            }

            if (m is PlayerMobile && ((!m.Alive && AllowDead && DeadTeleInstantly) || DelayWithCount <= 0))
            {
                if (!base.OnMoveOver(m))
                {
                    if (!m.Alive && ResurrectDead)
                    {
                        m.Resurrect();
                    }

                    return(false);
                }
                return(true);
            }

            if ((m is PlayerMobile) && (m.Hits < m.HitsMax) && MustBeFullyHealed && m.Alive)
            {
                m.LocalOverheadMessage(MessageType.Regular, 906, true, "You must be fully healed to use this!");
                return(true);
            }

            if (CombatCheck && SpellHelper.CheckCombat(m))
            {
                m.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
                return(true);
            }

            if (!AllowCriminals && (m.Criminal || Misc.NotorietyHandlers.IsGuardCandidate(m)))
            {
                m.SendAsciiMessage("Criminals or murderers can't use this teleporter!");
                return(true);
            }

            if (m is PlayerMobile && m.SolidHueOverride != OnMoveOverHue)
            {
                m_TeleportTimer = new TeleportTimer(this, m);
                m_TeleportTimer.Start();
                m.SolidHueOverride = OnMoveOverHue;
                if (!String.IsNullOrEmpty(OnMoveOverMessage))
                {
                    m.SendAsciiMessage(OnMoveOverMessage);
                }
                return(true);
            }

            return(true);
        }
示例#49
0
        protected override void OnTick()
        {
            m_State--;

            if (m_Mobile == null)
            {
                Stop();
            }

            else if (m_Teleporter.Deleted || m_Teleporter == null)
            {
                m_Mobile.SolidHueOverride = -1;
                Stop();
            }

            else if (!m_Teleporter.AllowIsInEvent && m_Mobile.IsInEvent)
            {
                m_Mobile.SendAsciiMessage("You cannot use this while in an event");
                m_Mobile.SolidHueOverride = -1;
                Stop();
            }

            else if (!m_Teleporter.AllowDead && !m_Mobile.Alive)
            {
                m_Mobile.SolidHueOverride = -1;
                Stop();
            }

            else if (m_Teleporter.CombatCheck && SpellHelper.CheckCombat(m_Mobile))
            {
                m_Mobile.LocalOverheadMessage(MessageType.Regular, 906, 1005564, ""); // Wouldst thou flee during the heat of battle??
                m_Mobile.SolidHueOverride = -1;
                Stop();
            }

            else if (!m_Teleporter.AllowCriminals && (m_Mobile.Criminal || Misc.NotorietyHandlers.IsGuardCandidate(m_Mobile)))
            {
                m_Mobile.LocalOverheadMessage(MessageType.Regular, 906, true, "Criminals or murderers can't use this teleporter!");
                m_Mobile.SolidHueOverride = -1;
                Stop();
            }

            else if (m_Teleporter.MustBeFullyHealed && m_Mobile.Alive && m_Mobile.Hits < m_Mobile.HitsMax) // Health Cancel
            {
                m_Mobile.LocalOverheadMessage(MessageType.Regular, 906, true, "You must be fully healed to use this!");
                m_Mobile.SolidHueOverride = -1;
                Stop();
            }

            else if (m_Teleporter.MustStandStill && (m_Mobile.Location.X != m_TeleLocX || m_Mobile.Location.Y != m_TeleLocY)) // Mobile changed location, most likely recalled
            {
                m_Mobile.LocalOverheadMessage(MessageType.Regular, 906, true, "You must stand still to use this!");
                m_Mobile.SolidHueOverride = -1;
                Stop();
            }

            else if (m_State <= 0) // Complete
            {
                m_Mobile.SolidHueOverride = -1;

                Map map = m_Teleporter.MapDest;

                if (map == null || map == Map.Internal)
                {
                    map = m_Mobile.Map;
                }

                Point3D p = m_Teleporter.PointDest;

                if (p == Point3D.Zero)
                {
                    p = m_Mobile.Location;
                }

                BaseCreature.TeleportPets(m_Mobile, p, map);

                bool sendEffect = (!m_Mobile.Hidden || m_Mobile.AccessLevel == AccessLevel.Player);

                if (m_Teleporter.SourceEffect && sendEffect)
                {
                    Effects.SendLocationEffect(m_Mobile.Location, m_Mobile.Map, 0x3728, 10, 10);
                }

                m_Mobile.MoveToWorld(p, map);

                if (m_Teleporter.DestEffect && sendEffect)
                {
                    Effects.SendLocationEffect(m_Mobile.Location, m_Mobile.Map, 0x3728, 10, 10);
                }

                if (m_Teleporter.SoundID > 0 && sendEffect)
                {
                    Effects.PlaySound(m_Mobile.Location, m_Mobile.Map, m_Teleporter.SoundID);
                }

                if (!m_Mobile.Alive && m_Teleporter.ResurrectDead)
                {
                    m_Mobile.Resurrect();
                }

                if (m_Teleporter.DeleteOnUse)
                {
                    m_Teleporter.Delete();
                }

                Stop();
            }

            else if (m_State >= 1)
            {
                m_Mobile.PublicOverheadMessage(MessageType.Spell, m_Mobile.SpeechHue, true, (m_State).ToString(), false);
            }
        }
示例#50
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.
            }
        }
示例#51
0
        private static bool TryStealItem(Item toSteal, object root, Mobile m_Thief)
        {
            PlayerMobile pm = null;

            if (root is PlayerMobile)
            {
                pm = (PlayerMobile)root;
            }

            if (m_Thief.AccessLevel == AccessLevel.Counselor)
            {
                m_Thief.SendAsciiMessage("Naughty counselor!");
            }
            else if (m_Thief.AccessLevel > AccessLevel.Counselor)
            {
                m_Thief.SendAsciiMessage("You don't need to steal anything, just take what you want!");
            }
            else if (m_Thief is PlayerMobile && ((PlayerMobile)m_Thief).Young)
            {
                m_Thief.SendAsciiMessage("You cannot steal anything as a young player.");
            }
            else if (!IsEmptyHanded(m_Thief))
            {
                m_Thief.SendLocalizedMessage(1005584); // Both hands must be free to steal.
            }
            else if (root is BaseVendor && ((BaseVendor)root).IsInvulnerable)
            {
                m_Thief.SendLocalizedMessage(1005598); // You can't steal from shopkeepers.
            }
            else if (root is PlayerVendor)
            {
                m_Thief.SendLocalizedMessage(502709); // You can't steal from vendors.
            }
            else if (!m_Thief.CanSee(toSteal))
            {
                m_Thief.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (m_Thief.Backpack == null || !m_Thief.Backpack.CheckHold(m_Thief, toSteal, false, true))
            {
                m_Thief.SendLocalizedMessage(1048147); // Your backpack can't hold anything else.
            }
            //ARTEGORDONMOD
            // allow stealing of STEALABLE items on the ground or in containers
            else if ((toSteal.Parent == null || !toSteal.Movable) && !ItemFlags.GetStealable(toSteal))
            {
                m_Thief.SendLocalizedMessage(502710); // You can't steal that!
            }
            else if (toSteal.LootType == LootType.Newbied || toSteal.CheckBlessed(root))
            {
                m_Thief.SendLocalizedMessage(502710); // You can't steal that!
            }
            else if (toSteal is Container)
            {
                m_Thief.SendLocalizedMessage(502710); // You can't steal that!
            }
            else if (!m_Thief.InRange(toSteal.GetWorldLocation(), 1))
            {
                m_Thief.SendLocalizedMessage(502703); // You must be standing next to an item to steal it.
            }
            else if (toSteal.Parent is Mobile)
            {
                m_Thief.SendLocalizedMessage(1005585); // You cannot steal items which are equiped.
            }
            else if (root == m_Thief)
            {
                m_Thief.SendLocalizedMessage(502704); // You catch yourself red-handed.
            }
            else if (root is Mobile && ((Mobile)root).AccessLevel > AccessLevel.Player)
            {
                m_Thief.SendLocalizedMessage(502710); // You can't steal that!
            }
            else if (root is Mobile && !m_Thief.CanBeHarmful((Mobile)root))
            {
                m_Thief.SendAsciiMessage("Something prevents you to steal from that mobile");
            }

            /*else if (root is Corpse)
             *  m_Thief.SendLocalizedMessage(502710); // You can't steal that!*/
            else if (pm != null && !pm.Snoopers.Contains(m_Thief))
            {
                m_Thief.SendAsciiMessage("You waited too long between snooping and stealing the item");
            }
            else if (m_Thief.SolidHueOverride == 2535)
            {
                m_Thief.SendAsciiMessage("You cannot steal while using the pitsrune");
            }
            else if (toSteal.UnStealable)
            {
                m_Thief.SendLocalizedMessage(502710); // You can't steal that!
            }
            else
            {
                double w = toSteal.Weight + toSteal.TotalWeight;

                if (w > 15)
                {
                    m_Thief.SendMessage("That is too heavy to steal.");
                }
                else
                {
                    return(true);
                }
            }

            return(false);
        }
示例#52
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            TextRelay entry0 = info.GetTextEntry(0);
            string    text0  = (entry0 == null ? "0" : entry0.Text.Trim());

            switch (info.ButtonID)
            {
            case 1:
            {
                Mobile killer = m_Killers[m_Idx];
                if (killer != null && !killer.Deleted)
                {
                    //add kills
                    killer.Kills++;
                    killer.ShortTermMurders++;

                    if (killer is PlayerMobile)
                    {
                        ((PlayerMobile)killer).ResetKillTime();

                        //is there a bounty being set?
                        if (balance >= Int32.Parse(text0) && Int32.Parse(text0) > 0)
                        {
                            //withdraw bounty from victims account
                            bank.ConsumeTotal(typeof(Gold), Int32.Parse(text0));

                            //set bounty
                            ((PlayerMobile)killer).Bounty = ((PlayerMobile)killer).Bounty + Int32.Parse(text0);

                            //make them dread lord
                            killer.Karma = -127;

                            //wipe bank
                            BankBox killerbank = killer.BankBox;
                            if (killerbank.Items.Count > 0)
                            {
                                //add killers gold to his bounty
                                killerbalance = 0;
                                Item[] killergold;

                                if (killerbank != null)
                                {
                                    killergold = killerbank.FindItemsByType(typeof(Gold));

                                    for (int i = 0; i < killergold.Length; ++i)
                                    {
                                        killerbalance += killergold[i].Amount;
                                    }

                                    killerbank.ConsumeTotal(typeof(Gold), killerbalance);
                                    ((PlayerMobile)killer).Bounty += killerbalance;

                                    killer.SendAsciiMessage("A bounty hath been issued for thee, and thy worldly goods are hereby confiscated!");

                                    //remove all items in the bank
                                    List <Item> list = new List <Item>();
                                    foreach (Item item in killerbank.Items)
                                    {
                                        list.Add(item);
                                    }

                                    foreach (Item i in list)
                                    {
                                        i.Delete();
                                    }
                                }
                            }

                            //make new bounty post
                            new BountyMessage(killer);
                        }
                    }
                }
                break;
            }

            case 2:
            {
                break;
            }
            }

            m_Idx++;
            if (m_Idx < m_Killers.Count)
            {
                from.SendGump(new ReportMurdererGump(from, m_Killers, m_Idx));
            }
        }
示例#53
0
        public override void OnDoubleClick(Mobile from)
        {
            PlayerMobile pl = (PlayerMobile)from;

            if (from.InLOS(this) && from.InRange(Location, 2))
            {
                if (m_XmasList > 0)
                {
                    if (!m_MobileList.ContainsKey(from.Serial))
                    {
                        GiftBox gb = new GiftBox();
                        gb.Hue  = 2881;
                        gb.Name = "Happy Holidays!";
                        switch (Utility.Random(5))

                        #region Gifts
                        {
                        case 0:

                            gb.DropItem(new GreenCandyCane());
                            gb.DropItem(new SnowCoveredTree());
                            gb.DropItem(new WhitePoinsettia());
                            gb.DropItem(new RandomReindeer());
                            gb.DropItem(new BlueSnowflake());
                            break;

                        case 1:

                            gb.DropItem(new HolidayWreath());
                            gb.DropItem(new WhiteSnowflake());
                            gb.DropItem(new Snowman());
                            gb.DropItem(new MiniXmasTree());
                            gb.DropItem(new RandomReindeer());
                            break;

                        case 2:

                            gb.DropItem(new HolidayCactus());
                            gb.DropItem(new GreenStocking());
                            gb.DropItem(new LumpOfCoal());
                            gb.DropItem(new RedCandyCane());
                            gb.DropItem(new RandomReindeer());
                            break;

                        case 3:

                            gb.DropItem(new GingerBreadMan());
                            gb.DropItem(new FestiveShrub());
                            gb.DropItem(new DecorativeMistletoe());
                            gb.DropItem(new HolidayCandle());
                            gb.DropItem(new RandomReindeer());
                            break;

                        case 4:
                            gb.DropItem(new RedStocking());
                            gb.DropItem(new RedPoinsettia());
                            gb.DropItem(new SnowGlobe());
                            gb.DropItem(new Snowball());
                            gb.DropItem(new RandomReindeer());
                            break;
                        }

                        #endregion

                        pl.Backpack.DropItem(gb);

                        m_MobileList.Add(from.Serial, from);
                        pl.SendAsciiMessage("Happy Holidays from Santa!");
                    }
                    else
                    {
                        pl.SendAsciiMessage("You already received the gift that Santa left for you!");
                    }
                }
                else
                {
                    pl.SendAsciiMessage("There are no gifts for you under the tree right now.");
                }
            }
            else
            {
                from.SendAsciiMessage("You can't reach that");
            }
        }
示例#54
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted == m_keyring)
                {
                    for (int i = 0; i < m_keyring.m_Keys.Count; i++)
                    {
                        KeyringEntry entry = m_keyring.m_Keys[i] as KeyringEntry;
                        Key          key   = new Key();
                        key.KeyValue    = entry.KeyValue;
                        key.Link        = entry.Link;
                        key.MaxRange    = entry.MaxRange;
                        key.ItemID      = entry.ItemID;
                        key.LootType    = entry.LootType;
                        key.Description = entry.Description;
                        from.AddToBackpack(key);
                        m_keyring.ItemID = 0x1011;
                        m_keyring.Weight = 1;
                    }
                    m_keyring.m_Keys.Clear();
                }
                else if (targeted is ILockable)
                {
                    ILockable o = (ILockable)targeted;

                    for (int i = 0; i < m_keyring.m_Keys.Count; i++)
                    {
                        KeyringEntry entry = m_keyring.m_Keys[i] as KeyringEntry;

                        if (o.KeyValue == entry.KeyValue)
                        {
                            if (o is BaseDoor && !((BaseDoor)o).UseLocks())
                            {
                                from.SendAsciiMessage("This key doesn't seem to unlock that.");
                            }
                            else
                            {
                                o.Locked = !o.Locked;
                                Didit    = true;

                                if (o is LockableContainer)
                                {
                                    LockableContainer cont = (LockableContainer)o;

                                    if (cont.LockLevel == -255)
                                    {
                                        cont.LockLevel = cont.RequiredSkill - 10;
                                    }
                                }

                                if (targeted is Item)
                                {
                                    Item item = (Item)targeted;

                                    if (o.Locked)
                                    {
                                        from.SendMessage("You lock it.");
                                    }
                                    else
                                    {
                                        from.SendMessage("You unlock it.");
                                    }
                                }
                            }
                        }
                    }

                    if (!Didit)
                    {
                        from.SendAsciiMessage("No key seems to unlock that.");
                    }
                }
                else
                {
                    from.SendAsciiMessage("You can't unlock that!");
                }
            }
示例#55
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Dagger.Deleted)
                {
                    return;
                }
                else if (!from.Items.Contains(m_Dagger))
                {
                    from.SendAsciiMessage("You must be holding that weapon to use it.");
                }
                else if (targeted is Mobile)
                {
                    Mobile m = (Mobile)targeted;

                    if (m != from && from.HarmfulCheck(m))
                    {
                        Direction to = from.GetDirectionTo(m);

                        from.Direction = to;

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

                        if (Utility.RandomDouble() >= (Math.Sqrt(m.Dex / 100.0) * 0.8))
                        {
                            from.MovingEffect(m, 0x1BFE, 7, 1, false, false, 0x481, 0);

                            AOS.Damage(m, from, Utility.Random(5, from.Str / 10), 100, 0, 0, 0, 0);

                            m_Dagger.MoveToWorld(m.Location, m.Map);
                        }
                        else
                        {
                            int x = 0, y = 0;

                            switch (to & Direction.Mask)
                            {
                            case Direction.North: --y; break;

                            case Direction.South: ++y; break;

                            case Direction.West: --x; break;

                            case Direction.East: ++x; break;

                            case Direction.Up: --x; --y; break;

                            case Direction.Down: ++x; ++y; break;

                            case Direction.Left: --x; ++y; break;

                            case Direction.Right: ++x; --y; break;
                            }

                            x += Utility.Random(-1, 3);
                            y += Utility.Random(-1, 3);

                            x += m.X;
                            y += m.Y;

                            m_Dagger.MoveToWorld(new Point3D(x, y, m.Z), m.Map);

                            from.MovingEffect(m_Dagger, 0x1BFE, 7, 1, false, false, 0x481, 0);

                            from.SendAsciiMessage("You miss.");
                        }
                    }
                }
            }
示例#56
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (dropped is Key)
            {
                if (m_Keys.Count < 16)
                {
                    Key key = (Key)dropped;

                    if (key.KeyValue != 0)
                    {
                        m_Keys.Add(new KeyringEntry(key.KeyValue, key.Link, key.MaxRange, key.ItemID, key.LootType, key.Description));

                        dropped.Delete();

                        //from.Send( new PlaySound( 0x42, GetWorldLocation() ) );

                        this.Weight = this.Weight + 1;

                        switch (m_Keys.Count)
                        {
                        case 0:
                        {
                            this.ItemID = 0x1011;
                            break;
                        }

                        case 1:
                        {
                            this.ItemID = 0x1769;
                            break;
                        }

                        case 3:
                        {
                            this.ItemID = 0x176A;
                            break;
                        }

                        case 5:
                        {
                            this.ItemID = 0x176B;
                            break;
                        }
                        }

                        return(true);
                    }
                    else
                    {
                        from.SendAsciiMessage("This key is blank.");
                        return(false);
                    }
                }
                else
                {
                    from.SendAsciiMessage("This key ring is full");
                    return(false);
                }
            }
            return(false);
        }
示例#57
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Item)
                {
                    Item item = (Item)targeted;

                    if (item is IDyable && m_Tub.AllowDyables)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendAsciiMessage("That is too far away.");
                        }
                        else if (item.Parent is Mobile)
                        {
                            from.SendAsciiMessage("Can't Dye clothing that is being worn.");
                        }
                        else if (((IDyable)item).Dye(from, m_Tub))
                        {
                            from.PlaySound(0x23E);
                        }
                    }
                    else if ((FurnitureAttribute.Check(item) || (item is PotionKeg)) && m_Tub.AllowFurniture)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendAsciiMessage("That is too far away.");
                        }
                        else
                        {
                            bool okay = (item.IsChildOf(from.Backpack));

                            if (!okay)
                            {
                                if (item.Parent == null)
                                {
                                    BaseHouse house = BaseHouse.FindHouseAt(item);

                                    if (house == null || !house.IsLockedDown(item))
                                    {
                                        from.SendAsciiMessage("Furniture must be locked down to paint it.");
                                    }
                                    else if (!house.IsCoOwner(from))
                                    {
                                        from.SendAsciiMessage("You must be the owner to use this item.");
                                    }
                                    else
                                    {
                                        okay = true;
                                    }
                                }
                                else
                                {
                                    from.SendAsciiMessage("The furniture must be in your backpack to be painted.");
                                }
                            }

                            if (okay)
                            {
                                item.Hue = m_Tub.DyedHue;
                                from.PlaySound(0x23E);
                            }
                        }
                    }
                    else if ((item is Runebook || item is RecallRune) && m_Tub.AllowRunebooks)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendAsciiMessage("That is too far away.");
                        }
                        else if (!item.Movable)
                        {
                            from.SendAsciiMessage("You cannot dye runes or runebooks that are locked down.");
                        }
                        else
                        {
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
                    else if (item is MonsterStatuette && m_Tub.AllowStatuettes)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendAsciiMessage("That is too far away.");
                        }
                        else if (!item.Movable)
                        {
                            from.SendAsciiMessage("You cannot dye statuettes that are locked down.");
                        }
                        else
                        {
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
                    else if ((item is BaseArmor && (((BaseArmor)item).MaterialType == ArmorMaterialType.Leather || ((BaseArmor)item).MaterialType == ArmorMaterialType.Studded)) && m_Tub.AllowLeather)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendAsciiMessage("That is too far away.");
                        }
                        else if (!item.Movable)
                        {
                            from.SendAsciiMessage("You may not dye leather items which are locked down.");
                        }
                        else if (item.Parent is Mobile)
                        {
                            from.SendAsciiMessage("Can't Dye clothing that is being worn.");
                        }
                        else
                        {
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
                    else
                    {
                        from.SendAsciiMessage(m_Tub.FailMessage);
                    }
                }
                else
                {
                    from.SendAsciiMessage(m_Tub.FailMessage);
                }
            }
示例#58
0
        public static void Container_Snoop(Container cont, Mobile from)
        {
            if (from.AccessLevel > AccessLevel.Player || from.InRange(cont.GetWorldLocation(), 1))
            {
                Mobile root = cont.RootParent as Mobile;

                if (root != null && !root.Alive)
                {
                    return;
                }

                if (root != null && root.AccessLevel > AccessLevel.Player && from.AccessLevel == AccessLevel.Player)
                {
                    from.SendAsciiMessage("You can not peek into the container.");
                    return;
                }

                if (root != null && from.AccessLevel == AccessLevel.Player && !CheckSnoopAllowed(from, root))
                {
                    from.SendAsciiMessage("You cannot perform negative acts on your target.");
                    return;
                }

                if (root != null && from.AccessLevel == AccessLevel.Player && from.Skills[SkillName.Snooping].Value < Utility.Random(100))
                {
                    Map map = from.Map;

                    if (map != null)
                    {
                        string message = String.Format("You notice {0} attempting to peek into {1}'s belongings.", from.Name, root.Name);

                        IPooledEnumerable eable = map.GetClientsInRange(from.Location, 8);

                        foreach (NetState ns in eable)
                        {
                            if (ns != from.NetState)
                            {
                                ns.Mobile.SendMessage(message);
                            }
                        }

                        eable.Free();
                    }
                }

                if (from.AccessLevel == AccessLevel.Player)
                {
                    Titles.AwardKarma(from, -4, true);
                }

                if (from.AccessLevel > AccessLevel.Player || from.CheckTargetSkill(SkillName.Snooping, cont, 0.0, 100.0))
                {
                    if (cont is TrapableContainer && ((TrapableContainer)cont).ExecuteTrap(from))
                    {
                        return;
                    }

                    cont.DisplayTo(from);
                }
                else
                {
                    from.SendAsciiMessage("You failed to peek into the container.");
                }
            }
            else
            {
                from.SendAsciiMessage("That is too far away.");
            }
        }
示例#59
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Map.Deleted)
                {
                    return;
                }

                Map map = m_Map.m_Map;

                if (m_Map.m_Completed)
                {
                    from.SendLocalizedMessage(503028);                       // The treasure for this map has already been found.
                }

                /*
                 * else if ( from != m_Map.m_Decoder )
                 * {
                 *      from.SendLocalizedMessage( 503016 ); // Only the person who decoded this map may actually dig up the treasure.
                 * }
                 */
                else if (m_Map.m_Decoder != from && !m_Map.HasRequiredSkill(from))
                {
                    from.SendLocalizedMessage(503031);                       // You did not decode this map and have no clue where to look for the treasure.
                    return;
                }
                else if (!from.CanBeginAction(typeof(TreasureMap)))
                {
                    from.SendLocalizedMessage(503020);                       // You are already digging treasure.
                }
                else if (!HasDiggingTool(from))
                {
                    from.SendMessage("You must have a digging tool to dig for treasure.");
                }
                else if (from.Map != map)
                {
                    from.SendLocalizedMessage(1010479);                       // You seem to be in the right place, but may be on the wrong facet!
                }
                else
                {
                    IPoint3D p = targeted as IPoint3D;

                    Point3D targ3D;
                    if (p is Item)
                    {
                        targ3D = ((Item)p).GetWorldLocation();
                    }
                    else
                    {
                        targ3D = new Point3D(p);
                    }

                    int    maxRange;
                    double skillValue = from.Skills[SkillName.Mining].Value;

                    if (skillValue >= 100.0)
                    {
                        maxRange = 4;
                    }
                    else if (skillValue >= 81.0)
                    {
                        maxRange = 3;
                    }
                    else if (skillValue >= 51.0)
                    {
                        maxRange = 2;
                    }
                    else
                    {
                        maxRange = 1;
                    }

                    Point2D loc = m_Map.m_Location;
                    int     x = loc.X, y = loc.Y;

                    Point3D chest3D0 = new Point3D(loc, 0);

                    if (Utility.InRange(targ3D, chest3D0, maxRange))
                    {
                        if (from.Location.X == x && from.Location.Y == y)
                        {
                            from.SendLocalizedMessage(503030);                               // The chest can't be dug up because you are standing on top of it.
                        }
                        else if (map != null)
                        {
                            int z = map.GetAverageZ(x, y);

                            if (!map.CanFit(x, y, z, 16, true, true))
                            {
                                from.SendLocalizedMessage(503021);                                   // You have found the treasure chest but something is keeping it from being dug up.
                            }
                            else if (from.BeginAction(typeof(TreasureMap)))
                            {
                                new DigTimer(from, m_Map, new Point3D(x, y, z), map).Start();
                            }
                            else
                            {
                                from.SendLocalizedMessage(503020);                                   // You are already digging treasure.
                            }
                        }
                    }
                    else if (m_Map.Level > 0)
                    {
                        if (Utility.InRange(targ3D, chest3D0, 8))                            // We're close, but not quite
                        {
                            from.SendLocalizedMessage(503032);                               // You dig and dig but no treasure seems to be here.
                        }
                        else
                        {
                            from.SendLocalizedMessage(503035);                               // You dig and dig but fail to find any treasure.
                        }
                    }
                    else
                    {
                        if (Utility.InRange(targ3D, chest3D0, 8))                             // We're close, but not quite
                        {
                            from.SendAsciiMessage(0x44, "The treasure chest is very close!");
                        }
                        else
                        {
                            Direction dir = Utility.GetDirection(targ3D, chest3D0);

                            string sDir;
                            switch (dir)
                            {
                            case Direction.North:   sDir = "north"; break;

                            case Direction.Right:   sDir = "northeast"; break;

                            case Direction.East:    sDir = "east"; break;

                            case Direction.Down:    sDir = "southeast"; break;

                            case Direction.South:   sDir = "south"; break;

                            case Direction.Left:    sDir = "southwest"; break;

                            case Direction.West:    sDir = "west"; break;

                            default:                                sDir = "northwest"; break;
                            }

                            from.SendAsciiMessage(0x44, "Try looking for the treasure chest more to the {0}.", sDir);
                        }
                    }
                }
            }
示例#60
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Bag.Deleted)
                {
                    return;
                }

                if (from.Region.IsPartOf(typeof(Regions.Jail)))
                {
                    from.SendMessage("You may not do that in jail.");
                }
                else if (!m_Bag.IsChildOf(from.Backpack))
                {
                    MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1062334, 0x59); // The bag of sending must be in your backpack. 1054107 is gone from client, using generic response
                }
                else if (m_Bag.Charges == 0)
                {
                    MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1042544, 0x59); // This item is out of charges.
                }
                else if (targeted is Item)
                {
                    Item item       = (Item)targeted;
                    int  reqCharges = (int)Math.Max(1, Math.Ceiling(item.TotalWeight / 10.0));

                    if (!item.IsChildOf(from.Backpack))
                    {
                        MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054152, 0x59); // You may only send items from your backpack to your bank box.
                    }
                    else if (item is BagOfSending || item is Container)
                    {
                        from.Send(new AsciiMessage(m_Bag.Serial, m_Bag.ItemID, MessageType.Regular, 0x3B2, 3, "", "You cannot send a container through the bag of sending."));
                    }
                    else if (item.LootType == LootType.Cursed)
                    {
                        MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054108, 0x59); // The bag of sending rejects the cursed item.
                    }
                    else if (!item.VerifyMove(from) || item is Server.Engines.Quests.QuestItem)
                    {
                        MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054109, 0x59); // The bag of sending rejects that item.
                    }
                    else if (Spells.SpellHelper.IsDoomGauntlet(from.Map, from.Location))
                    {
                        from.SendLocalizedMessage(1062089); // You cannot use that here.
                    }
                    else if (!from.BankBox.TryDropItem(from, item, false))
                    {
                        MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054110, 0x59); // Your bank box is full.
                    }
                    else if (Core.ML && reqCharges > m_Bag.Charges)
                    {
                        from.SendLocalizedMessage(1079932); //You don't have enough charges to send that much weight
                    }
                    else if (SpellHelper.CheckCombat(from))
                    {
                        from.SendAsciiMessage("You cannot use this while in combat");
                    }
                    else
                    {
                        m_Bag.Charges -= (Core.ML ? reqCharges : 1);

                        MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054150, 0x59); // The item was placed in your bank box.
                    }
                }
            }