Ejemplo n.º 1
0
        public bool TryArrest(Mobile m)
        {
            if (ControlMaster != null)
            {
                m.SendLocalizedMessage(1152247); // That person is already under arrest.
            }
            else if (m is PlayerMobile && ((PlayerMobile)m).AllFollowers.FirstOrDefault(mob => mob is Raider) != null)
            {
                m.SendLocalizedMessage(1152249); // You already have a prisoner.
            }
            else if (Hits > ((double)HitsMax / 10))
            {
                m.SendLocalizedMessage(1152229); // That person won't sit still for it! A more aggressive approach is in order.
                m.NonlocalOverheadMessage(MessageType.Regular, 0x3B2, 1152237, string.Format("{0}\t{1}", m.Name, Name, "raider"));
            }
            else
            {
                DeleteTime = DateTime.UtcNow + TimeSpan.FromHours(1);

                SetControlMaster(m);
                IsBonded      = false;
                ControlTarget = m;
                ControlOrder  = OrderType.Follow;

                m.SendLocalizedMessage(1152236, Name); // You arrest the ~1_name~. Take the criminal to the guard captain.
                m.NonlocalOverheadMessage(MessageType.Regular, 0x3B2, 1152238, string.Format("{0}\t{1}", m.Name, Name));

                return(true);
            }

            return(false);
        }
Ejemplo n.º 2
0
        public override void Drink(Mobile from)
        {
            if (from.Hits < from.HitsMax || from.Stam < from.StamMax)
            {
                if (from.BeginAction(typeof(BasePotion)))
                {
                    DoRestore(from);

                    BasePotion.PlayDrinkEffect(from);

                    if (!Server.Engines.ConPVP.DuelContext.IsFreeConsume(from))
                    {
                        this.Consume();
                    }

                    Timer.DelayCall(TimeSpan.FromSeconds(Delay), new TimerStateCallback(ReleaseManaLock), from);
                }
                else
                {
                    from.NonlocalOverheadMessage(MessageType.Regular, 0x22, true, "You must wait before using another restore potion.");
                    //from.LocalOverheadMessage(MessageType.Regular, 0x22, 500235); // You must wait 10 seconds before using another healing potion.
                }
            }
            else
            {
                from.NonlocalOverheadMessage(MessageType.Regular, 0x22, true, "You decide against drinking this potion, as you are already at full health and stamina.");
                //from.SendLocalizedMessage(1049547); //
            }
        }
Ejemplo n.º 3
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                from.RevealingAction();

                if (targeted is Mobile)
                {
                    if (((Mobile)targeted) != from)
                    {
                        if (targeted is PlayerMobile)
                        {
                            PlayerMobile player = targeted as PlayerMobile;
                            from.Direction = from.GetDirectionTo(player);

                            from.LocalOverheadMessage(MessageType.Emote, 0x59, true, String.Format("You begin to hypnotize {0}", player.Name));
                            player.LocalOverheadMessage(MessageType.Emote, 0x59, true, String.Format("{0} begins to hypnotize you!", from.Name));
                            from.NonlocalOverheadMessage(MessageType.Emote, 0x59, true, String.Format("* begins hypnotizing {0} *", player.Name));

                            new InternalTimer(from, player, Utility.Random(3, 3)).Start();

                            m_SetSkillTime = false;
                        }
                        else if (targeted is BaseCreature)
                        {
                            BaseCreature creature = targeted as BaseCreature;
                            from.Direction = from.GetDirectionTo(creature);

                            from.LocalOverheadMessage(MessageType.Emote, 0x59, true, String.Format("You begin to hypnotize {0}", creature.Name));
                            from.NonlocalOverheadMessage(MessageType.Emote, 0x59, true, String.Format("* begins hypnotizing {0} *", creature.Name));

                            new InternalTimer(from, creature, Utility.Random(2, 3)).Start();

                            m_SetSkillTime = false;
                        }
                        else if (targeted is BaseEscortable)
                        {
                            BaseEscortable escortable = targeted as BaseEscortable;
                            from.Direction = from.GetDirectionTo(escortable);

                            from.LocalOverheadMessage(MessageType.Emote, 0x59, true, String.Format("You begin to hypnotize {0}", escortable.Name));
                            from.NonlocalOverheadMessage(MessageType.Emote, 0x59, true, String.Format("* begins hypnotizing {0} *", escortable.Name));

                            new InternalTimer(from, escortable, Utility.Random(3, 3)).Start();

                            m_SetSkillTime = false;
                        }
                        else
                        {
                            from.SendMessage("That being will not be hypnotized.");
                        }
                    }
                    else
                    {
                        from.SendMessage("You cannot hypnotize yourself!");
                    }
                }
                else
                {
                    from.SendMessage("You can not hypnotize that!");
                }
            }
Ejemplo n.º 4
0
        public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item)
        {
            if (toolBroken)
            {
                from.SendAsciiMessage("You have worn out your tool!");
            }
            //from.SendLocalizedMessage( 1044038 ); // You have worn out your tool

            if (failed)
            {
                if (IsPotion(item.ItemType))
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x21, true, String.Format("*You toss the failed mixture from the mortar, unable to create a potion from it.*"));
                    from.NonlocalOverheadMessage(MessageType.Regular, 0x21, true, String.Format("*{0} tosses out the contents of the mortar.*", from.Name));
                    from.AddToBackpack(new Bottle());

                    /*int OldHue = from.SpeechHue;
                     * from.SpeechHue = 0x21;
                     * from.SayTo(from, true, String.Format("*You toss the failed mixture from the mortar, unable to create a potion from it.*"));
                     * from.SpeechHue = OldHue;*/
                    return(500287);                    // You fail to create a useful potion.
                }
                else
                {
                    return(1044043);                    // You failed to create the item, and some of your materials are lost.
                }
            }
            else
            {
                from.PlaySound(0x240);                   // Sound of a filling bottle

                if (IsPotion(item.ItemType))
                {
                    if (quality == -1)
                    {
                        return(1048136); // You create the potion and pour it into a keg.
                    }
                    else
                    {
                        from.LocalOverheadMessage(MessageType.Regular, 0x21, true, String.Format("*You pour the completed potion into a bottle.*"));
                        from.NonlocalOverheadMessage(MessageType.Regular, 0x21, true, String.Format("*{0} pours the completed potion into a bottle.*", from.Name));

                        /*int OldHue = from.SpeechHue;
                         * from.SpeechHue = 0x21;
                         * from.SayTo(from, true, String.Format("*You pour the completed potion into a bottle.*"));
                         * from.SpeechHue = OldHue;*/

                        return(500279); // You pour the potion into a bottle...
                    }
                }
                else
                {
                    return(1044154);                    // You create the item.
                }
            }
        }
Ejemplo n.º 5
0
		public override void OnHit( Mobile attacker, Mobile defender, int damage )
		{
			if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
				return;

			ClearCurrentAbility( attacker );

			// Necromancers under Lich or Wraith Form are immune to Bleed Attacks.
			TransformContext context = TransformationSpell.GetContext( defender );

			if ( (context != null && ( context.Type == typeof( LichFormSpell ) || context.Type == typeof( WraithFormSpell ))) ||
				(defender is BaseCreature && ((BaseCreature)defender).BleedImmune) )
			{
				attacker.SendLocalizedMessage( 1062052 ); // Your target is not affected by the bleed attack!
				return;
			}

			attacker.SendLocalizedMessage( 1060159 ); // Your target is bleeding!
			defender.SendLocalizedMessage( 1060160 ); // You are bleeding!

			if ( defender is PlayerMobile )
			{
				defender.LocalOverheadMessage( MessageType.Regular, 0x21, 1060757 ); // You are bleeding profusely
				defender.NonlocalOverheadMessage( MessageType.Regular, 0x21, 1060758, defender.Name ); // ~1_NAME~ is bleeding profusely
			}

			defender.PlaySound( 0x133 );
			defender.FixedParticles( 0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist );

			BeginBleed( defender, attacker );
		}
Ejemplo n.º 6
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1040019);                   // The bola must be in your pack to use it.
            }
            else if (!from.CanBeginAction(typeof(Bola)))
            {
                from.SendLocalizedMessage(1049624);                   // You have to wait a few moments before you can use another bola!
            }
            else if (from.Target is BolaTarget)
            {
                from.SendLocalizedMessage(1049631);                   // This bola is already being used.
            }
            else if (!BasePotion.HasFreeHand(from))
            {
                from.SendMessage("You need a free hand to throw this.");
            }
            else if (from.Mounted)
            {
                from.SendLocalizedMessage(1040016);                   // You cannot use this while riding a mount
            }
            else
            {
                EtherealMount.StopMounting(from);

                from.Target = new BolaTarget(this);
                from.LocalOverheadMessage(MessageType.Emote, 0x3B2, 1049632);                   // * You begin to swing the bola...*
                from.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, 1049633, from.Name);     // ~1_NAME~ begins to menacingly swing a bola...
            }
        }
Ejemplo n.º 7
0
        public override void Drink(Mobile from)
        {
            if (TransformationSpellHelper.UnderTransformation(from, typeof(Spells.Necromancy.VampiricEmbraceSpell)))
            {
                from.SendLocalizedMessage(1061652);                   // The garlic in the potion would surely kill you.
            }
            else if (from.Poisoned)
            {
                if (from.BeginAction(typeof(BasePotion)))
                {
                    DoCure(from);

                    BasePotion.PlayDrinkEffect(from);

                    from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist);
                    from.PlaySound(0x1E0);

                    if (!Engines.ConPVP.DuelContext.IsFreeConsume(from))
                    {
                        this.Consume();
                    }
                    Timer.DelayCall(TimeSpan.FromSeconds(Delay), new TimerStateCallback(ReleaseLock), from);
                }
                else
                {
                    from.NonlocalOverheadMessage(MessageType.Regular, 0x22, true, "You must wait before using another mana potion.");
                    //from.LocalOverheadMessage(MessageType.Regular, 0x22, 500235); // You must wait 10 seconds before using another healing potion.
                }
            }
            else
            {
                from.SendLocalizedMessage(1042000);                   // You are not poisoned.
            }
        }
Ejemplo n.º 8
0
        public void ApplyShock(Mobile m, int tick)
        {
            if (m == null || !m.Alive || this.Deleted)
            {
                if (m_DamageTimer != null)
                {
                    m_DamageTimer.Stop();
                }
            }
            else
            {
                int damage = (int)(75 / Math.Max(1, tick - 1)) + Utility.RandomMinMax(1, 9);

                AOS.Damage(m, damage, 0, 0, 0, 0, 100);

                m.BoltEffect(0);

                m.FixedParticles(0x3818, 1, 11, 0x13A8, 0, 0, EffectLayer.CenterFeet);
                m.FixedParticles(0x3818, 1, 11, 0x13A8, 0, 0, EffectLayer.Waist);
                m.FixedParticles(0x3818, 1, 11, 0x13A8, 0, 0, EffectLayer.Head);
                m.PlaySound(0x1DC);

                m.LocalOverheadMessage(Server.Network.MessageType.Regular, 0x21, 1114443);            // * Your body convulses from electric shock *
                m.NonlocalOverheadMessage(Server.Network.MessageType.Regular, 0x21, 1114443, m.Name); //  * ~1_NAME~ spasms from electric shock *
            }
        }
Ejemplo n.º 9
0
        public override void OnDoubleClick(Mobile from)
        {
            from.RevealingAction();

            if (!Movable)
            {
                return;
            }

            if (from.InRange(this.GetWorldLocation(), 1))
            {
                from.Target = new ThrowTarget(this);

                if (m_Timer == null)
                {
                    from.LocalOverheadMessage(Network.MessageType.Emote, from.SpeechHue, true, "An ugly smell floats around along with a wierd ticker...");
                    from.NonlocalOverheadMessage(Network.MessageType.Emote, from.SpeechHue, true, String.Format("{0} uses the Krofin Bomb...", from.Name));

                    m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(0.75), TimeSpan.FromSeconds(1.0), 5, new TimerStateCallback(Detonate_OnTick), new object[] { from, 4 });
                }
            }
            else
            {
                from.SendLocalizedMessage(502138);
            }
        }
Ejemplo n.º 10
0
 public override void OnDoubleClick(Mobile from)
 {
     if (!IsChildOf(from.Backpack))
     {
         from.SendLocalizedMessage(1040019);                   // The bola must be in your pack to use it.
     }
     else if (!from.CanBeginAction(typeof(Bola)))
     {
         from.SendLocalizedMessage(1049624);                   // You have to wait a few moments before you can use another bola!
     }
     else if (from.Target is BolaTarget)
     {
         from.SendLocalizedMessage(1049631);                   // This bola is already being used.
     }
     else if (from.FindItemOnLayer(Layer.OneHanded) != null || from.FindItemOnLayer(Layer.TwoHanded) != null)
     {
         from.SendLocalizedMessage(1040015);                   // Your hands must be free to use this
     }
     else if (from.Mounted)
     {
         from.SendLocalizedMessage(1040016);                   // You cannot use this while riding a mount
     }
     else
     {
         from.Target = new BolaTarget(this);
         from.LocalOverheadMessage(MessageType.Emote, 0x3B2, 1049632);                   // * You begin to swing the bola...*
         from.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, 1049633, from.Name);     // ~1_NAME~ begins to menacingly swing a bola...
     }
 }
Ejemplo n.º 11
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker) || !CheckMana(attacker, true))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            // Necromancers under Lich or Wraith Form are immune to Bleed Attacks.
            TransformContext context = TransformationSpellHelper.GetContext(defender);

            if ((context != null && (context.Type == typeof(LichFormSpell) || context.Type == typeof(WraithFormSpell))) ||
                (defender is BaseCreature && ((BaseCreature)defender).BleedImmune))
            {
                attacker.SendLocalizedMessage(1062052); // Your target is not affected by the bleed attack!
                return;
            }

            attacker.SendLocalizedMessage(1060159); // Your target is bleeding!
            defender.SendLocalizedMessage(1060160); // You are bleeding!

            if (defender is PlayerMobile)
            {
                defender.LocalOverheadMessage(MessageType.Regular, 0x21, 1060757);                   // You are bleeding profusely
                defender.NonlocalOverheadMessage(MessageType.Regular, 0x21, 1060758, defender.Name); // ~1_NAME~ is bleeding profusely
            }

            bool blooddrinker = CheckBloodDrink(attacker);

            defender.PlaySound(0x133);
            defender.FixedParticles(0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist);

            BeginBleed(defender, attacker, blooddrinker);
        }
        private void DoDestroyEquipment(Mobile target)
        {
            if (target.AccessLevel == AccessLevel.Player && InRange(target, 1) && 0.25 > Utility.RandomDouble())                 //15% chance
            {
                List <Item> items = new List <Item>();

                for (int i = 0; i < target.Items.Count; i++)
                {
                    Item item = target.Items[i];
                    if (item is IDurability && ((IDurability)item).MaxHitPoints > 0 && item.LootType != LootType.Blessed && item.BlessedFor == null && !(Mobile.InsuranceEnabled && item.Insured))
                    {
                        items.Add(item);
                    }
                }

                if (items.Count > 0)
                {
                    Item   toDestroy = items[Utility.Random(items.Count)];
                    string name      = toDestroy.Name;
                    if (String.IsNullOrEmpty(name))
                    {
                        name = toDestroy.ItemData.Name;
                    }

                    toDestroy.Delete();

                    target.NonlocalOverheadMessage(MessageType.Regular, 0x3B2, 1080034, name);                    // Their ~1_NAME~ is destroyed by the attack.
                    target.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1080035, name);                       // Your ~1_NAME~ is destroyed by the attack.
                }
            }
        }
Ejemplo n.º 13
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker) || !CheckMana(attacker, true))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            if (defender is BaseCreature && ((BaseCreature)defender).BleedImmune)
            {
                attacker.SendLocalizedMessage(1062052);                   // Your target is not affected by the bleed attack!
                return;
            }

            attacker.SendLocalizedMessage(1060159);               // Your target is bleeding!
            defender.SendLocalizedMessage(1060160);               // You are bleeding!

            if (defender is PlayerMobile)
            {
                defender.LocalOverheadMessage(MessageType.Regular, 0x21, 1060757);                   // You are bleeding profusely
                defender.NonlocalOverheadMessage(MessageType.Regular, 0x21, 1060758, defender.Name); // ~1_NAME~ is bleeding profusely
            }

            defender.PlaySound(0x133);
            defender.FixedParticles(0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist);

            BeginBleed(defender, attacker);
        }
Ejemplo n.º 14
0
        public static void BeginBleed(Mobile m, Mobile from, bool splintering = false)
        {
            BleedTimer timer = null;

            if (m_BleedTable.ContainsKey(m))
            {
                if (splintering)
                {
                    timer = m_BleedTable[m];
                    timer.Stop();
                }
                else
                {
                    return;
                }
            }

            BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Bleed, 1075829, 1075830, TimeSpan.FromSeconds(10), m, string.Format("{0}\t{1}\t{2}", "1", "10", "2")));

            timer           = new BleedTimer(from, m, CheckBloodDrink(from));
            m_BleedTable[m] = timer;
            timer.Start();

            from.SendLocalizedMessage(1060159); // Your target is bleeding!
            m.SendLocalizedMessage(1060160);    // You are bleeding!

            if (m is PlayerMobile)
            {
                m.LocalOverheadMessage(MessageType.Regular, 0x21, 1060757);            // You are bleeding profusely
                m.NonlocalOverheadMessage(MessageType.Regular, 0x21, 1060758, m.Name); // ~1_NAME~ is bleeding profusely
            }

            m.PlaySound(0x133);
            m.FixedParticles(0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist);
        }
Ejemplo n.º 15
0
            protected override void OnTarget(Mobile from, object target)
            {
                //from.RevealingAction();

                Item   stolen = null;
                object root   = null;
                bool   caught = false;

                if (target is Item)
                {
                    root   = ((Item)target).RootParent;
                    stolen = TryStealItem((Item)target, ref caught);
                }
                else if (target is Mobile)
                {
                    Container pack = ((Mobile)target).Backpack;

                    if (pack != null && pack.Items.Count > 0)
                    {
                        int randomIndex = Utility.Random(pack.Items.Count);

                        root   = target;
                        stolen = TryStealItem(pack.Items[randomIndex], ref caught);
                    }
                }
                else
                {
                    m_Thief.SendLocalizedMessage(502710);                       // You can't steal that!
                }

                if (stolen != null)
                {
                    from.AddToBackpack(stolen);

                    StolenItem.Add(stolen, m_Thief, root as Mobile);
                }

                if (caught)
                {
                    if (root is Mobile)
                    {
                        Mobile mobRoot = (Mobile)root;

                        string message = String.Format("Vous appercevez un personnage tenter d'en voler un autre.");

                        from.RevealingAction();

                        from.NonlocalOverheadMessage(MessageType.Emote, 0, true, message);

                        /*foreach ( NetState ns in m_Thief.GetClientsInRange( 8 ) )
                         * {
                         *      if ( ns.Mobile != m_Thief )
                         *              ns.Mobile.SendMessage( message );
                         * }*/
                    }
                }

                CommandLogging.WriteLine(from, "{4} {2} à voler {0} appartenant à {1} en étant {3}",
                                         target, root, stolen != null ? "réussit" : "échoue", from.Hidden ? "caché" : "à découvert", from);
            }
Ejemplo n.º 16
0
        public void DoDamage(Mobile to)
        {
            to.Send(new AsciiMessage(Serial, ItemID, MessageType.Regular, 0x3B2, 3, "", "The generator shoots an arc of electricity at you!"));
            //to.Send(new UnicodeMessage(Serial, ItemID, MessageType.Regular, 0x3B2, 3, "", "", "The generator shoots an arc of electricity at you!"));
            to.BoltEffect(0);
            to.LocalOverheadMessage(MessageType.Regular, 0xC9, true, "* Your body convulses from electric shock *");
            to.NonlocalOverheadMessage(MessageType.Regular, 0xC9, true, string.Format("* {0} spasms from electric shock *", to.Name));

            AOS.Damage(to, to, 60, 0, 0, 0, 0, 100);

            if (!to.Alive)
            {
                return;
            }

            if (m_DamageTable[to] == null)
            {
                to.Frozen = true;

                DamageTimer timer = new DamageTimer(this, to);
                m_DamageTable[to] = timer;

                timer.Start();
            }
        }
Ejemplo n.º 17
0
        private static bool CheckHit(Mobile to, Mobile from)
        {
            if (!Core.TOL)
            {
                return(true);
            }

            double toChance   = Math.Min(45 + BaseArmor.GetRefinedDefenseChance(to), AosAttributes.GetValue(to, AosAttribute.DefendChance)) + 1;
            double fromChance = AosAttributes.GetValue(from, AosAttribute.AttackChance) + 1;

            double hitChance = toChance / (fromChance * 2);

            if (Utility.RandomDouble() < hitChance)
            {
                if (BaseWeapon.CheckParry(to))
                {
                    to.FixedEffect(0x37B9, 10, 16);
                    to.Animate(AnimationType.Parry, 0);
                    return(false);
                }

                return(true);
            }

            to.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, false, "*miss*");
            return(false);
        }
Ejemplo n.º 18
0
Archivo: Bola.cs Proyecto: jaedan/runuo
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1040019); // The bola must be in your pack to use it.
            }
            else if (!from.CanBeginAction(typeof(Bola)))
            {
                from.SendLocalizedMessage(1049624); // You have to wait a few moments before you can use another bola!
            }
            else if (from.Target is BolaTarget)
            {
                from.SendLocalizedMessage(1049631); // This bola is already being used.
            }
            else if (!HasFreeHands(from))
            {
                from.SendLocalizedMessage(1040015); // Your hands must be free to use this
            }
            else if (from.Mounted)
            {
                from.SendLocalizedMessage(1040016); // You cannot use this while riding a mount
            }
            else if (Server.Spells.Ninjitsu.AnimalForm.UnderTransformation(from))
            {
                from.SendLocalizedMessage(1070902); // You can't use this while in an animal form!
            }
            else
            {
                EtherealMount.StopMounting(from);

                from.Target = new BolaTarget(this);
                from.LocalOverheadMessage(MessageType.Emote, 0x3B2, 1049632);               // * You begin to swing the bola...*
                from.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, 1049633, from.Name); // ~1_NAME~ begins to menacingly swing a bola...
            }
        }
Ejemplo n.º 19
0
        public override void OnHit( Mobile attacker, Mobile defender, int damage )
        {
            if( !Validate(attacker) || !CheckStam(attacker, true) )
                return;

            ClearCurrentAbility(attacker);

            if( (defender is BaseCreature && ((BaseCreature)defender).BleedImmune) )
            {
                attacker.SendLocalizedMessage(1062052); // Your target is not affected by the bleed attack!
                return;
            }

            attacker.SendLocalizedMessage(1060159); // Your target is bleeding!
            defender.SendLocalizedMessage(1060160); // You are bleeding!

            if( defender is PlayerMobile )
            {
                defender.LocalOverheadMessage(MessageType.Regular, 0x21, 1060757); // You are bleeding profusely
                defender.NonlocalOverheadMessage(MessageType.Regular, 0x21, 1060758, defender.Name); // ~1_NAME~ is bleeding profusely
            }

            defender.PlaySound(0x133);
            defender.FixedParticles(0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist);

            BeginBleed(defender, attacker);
        }
Ejemplo n.º 20
0
        public override void OnDoubleClick(Mobile from)
        {
            from.RevealingAction();

            if (!Movable)
            {
                return;
            }

            if (from.InRange(this.GetWorldLocation(), 1))
            {
                from.Target = new ThrowTarget(this);

                if (m_Timer == null)
                {
                    from.LocalOverheadMessage(Network.MessageType.Emote, from.SpeechHue, true, "You begin to prepare the Holy Hand Grenade...");
                    from.NonlocalOverheadMessage(Network.MessageType.Emote, from.SpeechHue, true, String.Format("{0} begins to prepare a Holy Hand Grenade...", from.Name));

                    m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(0.75), TimeSpan.FromSeconds(1.0), 5, new TimerStateCallback(Detonate_OnTick), new object[] { from, 4 });
                }
            }
            else
            {
                from.SendLocalizedMessage(502138);
            }
        }
Ejemplo n.º 21
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1040019 ); // The bola must be in your pack to use it.
			}
			else if ( !from.CanBeginAction( typeof( Bola ) ) )
			{
				from.SendLocalizedMessage( 1049624 ); // You have to wait a few moments before you can use another bola!
			}
			else if ( from.Target is BolaTarget )
			{
				from.SendLocalizedMessage( 1049631 ); // This bola is already being used.
			}
			else if ( !HasFreeHands( from ) )
			{
				from.SendLocalizedMessage( 1040015 ); // Your hands must be free to use this
			}
			else if ( from.Mounted )
			{
				from.SendLocalizedMessage( 1040016 ); // You cannot use this while riding a mount
			}
			else if ( Server.Spells.Ninjitsu.AnimalForm.UnderTransformation( from ) )
			{
				from.SendLocalizedMessage( 1070902 ); // You can't use this while in an animal form!
			}
			else
			{
				EtherealMount.StopMounting( from );

				from.Target = new BolaTarget( this );
				from.LocalOverheadMessage( MessageType.Emote, 0x3B2, 1049632 ); // * You begin to swing the bola...*
				from.NonlocalOverheadMessage( MessageType.Emote, 0x3B2, 1049633, from.Name ); // ~1_NAME~ begins to menacingly swing a bola...
			}
		}
Ejemplo n.º 22
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!this.IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1040019); // The bola must be in your pack to use it.
            }
            else if (!from.CanBeginAction(typeof(Bola)))
            {
                from.SendLocalizedMessage(1049624); // You have to wait a few moments before you can use another bola!
            }
            else if (from.Target is BolaTarget)
            {
                from.SendLocalizedMessage(1049631); // This bola is already being used.
            }
            else if (!Core.AOS && (from.FindItemOnLayer(Layer.OneHanded) != null || from.FindItemOnLayer(Layer.TwoHanded) != null))
            {
                from.SendLocalizedMessage(1040015); // Your hands must be free to use this
            }
            else if (from.Mounted)
            {
                from.SendLocalizedMessage(1040016); // You cannot use this while riding a mount
            }
            else if (Server.Spells.Ninjitsu.AnimalForm.UnderTransformation(from))
            {
                from.SendLocalizedMessage(1070902); // You can't use this while in an animal form!
            }
            else if (from.Flying)
            {
                from.SendLocalizedMessage(1113414);                 // You cannot use this while flying!
            }
            else
            {
                EtherealMount.StopMounting(from);

                if (Core.AOS)
                {
                    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.Target = new BolaTarget(this);
                from.LocalOverheadMessage(MessageType.Emote, 0x3B2, 1049632);               // * You begin to swing the bola...*
                from.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, 1049633, from.Name); // ~1_NAME~ begins to menacingly swing a bola...
            }
        }
Ejemplo n.º 23
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!IsBladeweaveAttack)
            {
                if (!Validate(attacker))
                {
                    return;
                }
                if (!CheckMana(attacker, true))
                {
                    return;
                }
            }

            ClearCurrentAbility(attacker);

            if (defender is BaseCreature)
            {
                if (defender != null && ((BaseCreature)defender).BleedImmune)
                {
                    attacker.SendLocalizedMessage(1062052);                       // Your target is not affected by the bleed attack!

                    return;
                }
            }

            TransformContext context = TransformationSpell.GetContext(defender);

            // Necromancers under Lich Form or Wraith Form are immune to Bleed Attacks.
            if (context == null || (context.Type != typeof(LichFormSpell) && context.Type != typeof(WraithFormSpell)))
            {
                attacker.SendLocalizedMessage(1060159);                   // Your target is bleeding!
                defender.SendLocalizedMessage(1060160);                   // You are bleeding!

                if (defender is PlayerMobile)
                {
                    defender.LocalOverheadMessage(MessageType.Regular, 0x21, 1060757);                       // You are bleeding profusely
                    defender.NonlocalOverheadMessage(MessageType.Regular, 0x21, 1060758, defender.Name);     // ~1_NAME~ is bleeding profusely
                }

                defender.PlaySound(0x133);
                defender.FixedParticles(0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist);

                TimeSpan duration = ComputeDuration(defender);

                BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.Bleed, 1075829, duration, defender, String.Format("{0}\t{1}\t{2}", 5, 10, 2)));

                BeginBleed(defender, attacker, duration);
            }
            else
            {
                attacker.SendLocalizedMessage(1062052);                   // Your target is not affected by the bleed attack!
            }
        }
Ejemplo n.º 24
0
        protected virtual void OnBeginTarget(Mobile m, bool message)
        {
            if (m == null || m.Deleted || !message || Silent)
            {
                return;
            }

            m.LocalOverheadMessage(
                MessageType.Emote, 0x55, true, String.Format("You begin to swing the {0}...", this.ResolveName(m)));
            m.NonlocalOverheadMessage(
                MessageType.Emote, 0x55, true, String.Format("{0} begins to swing the {1}...", m.Name, this.ResolveName(m)));
        }
Ejemplo n.º 25
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Thorn.Deleted)
                {
                    return;
                }

                if (!m_Thorn.IsChildOf(from.Backpack))
                {
                    from.SendLocalizedMessage(1042664); // You must have the object in your backpack to use it.
                    return;
                }

                if (!from.CanBeginAction(typeof(GreenThorns)))
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1061908); // * You must wait a while before planting another thorn. *
                    return;
                }

                if (from.Map != Map.Trammel && from.Map != Map.Felucca)
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x2B2, true, "No solen lairs exist on this facet.  Try again in Trammel or Felucca.");
                    return;
                }

                LandTarget land = targeted as LandTarget;

                if (land == null)
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1061912); // * You cannot plant a green thorn there! *
                }
                else
                {
                    GreenThornsEffect effect = GreenThornsEffect.Create(from, land);

                    if (effect == null)
                    {
                        from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1061913); // * You sense it would be useless to plant a green thorn there. *
                    }
                    else
                    {
                        m_Thorn.Consume();

                        from.LocalOverheadMessage(MessageType.Emote, 0x961, 1061914);               // * You push the strange green thorn into the ground *
                        from.NonlocalOverheadMessage(MessageType.Emote, 0x961, 1061915, from.Name); // * ~1_PLAYER_NAME~ pushes a strange green thorn into the ground. *

                        from.BeginAction(typeof(GreenThorns));
                        new GreenThorns.EndActionTimer(from).Start();

                        effect.Start();
                    }
                }
            }
Ejemplo n.º 26
0
        public void DoEffect(object state)
        {
            object[] states = (object[])state;

            Mobile m     = (Mobile)states[0];
            int    count = (int)states[1];

            if (!m.Alive)
            {
                StopEffect(m, false);
            }
            else
            {
                if ((count % 4) == 0)
                {
                    m.LocalOverheadMessage(Network.MessageType.Emote, m.SpeechHue, true, "* The icy wind whips your flesh! *");
                    m.NonlocalOverheadMessage(Network.MessageType.Emote, m.SpeechHue, true, String.Format("* {0} is whiped by an icy wind! *", m.Name));
                }

                m.FixedParticles(0x91C, 10, 180, 9539, 1, 1154, EffectLayer.Waist);
                m.PlaySound(22);
                m.PlaySound(21);

                AOS.Damage(m, this, Utility.RandomMinMax(30, 40) - (Core.AOS ? 0 : 10), 100, 0, 0, 0, 0);

                states[1] = count + 1;

                if (!m.Alive)
                {
                    StopEffect(m, false);
                }
            }

            if (m is BaseCreature)
            {
                BaseCreature bc = (BaseCreature)m;

                if (bc.Controlled && m.Hits == 0)
                {
                    StopEffect(m, true);
                    Say("Haha One Slave is Defeated!");
                }
            }
            else
            {
                Torch torch = m.FindItemOnLayer(Layer.TwoHanded) as Torch;

                if (torch != null && torch.Burning)
                {
                    StopEffect(m, true);
                }
            }
        }
Ejemplo n.º 27
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!this.IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1040019); // The bola must be in your pack to use it.
            }
            else if (!from.CanBeginAction(typeof(Bola)))
            {
                from.SendLocalizedMessage(1049624); // You have to wait a few moments before you can use another bola!
            }
            else if (from.Target is BolaTarget)
            {
                from.SendLocalizedMessage(1049631); // This bola is already being used.
            }
            else if (!Core.AOS && (from.FindItemOnLayer(Layer.OneHanded) != null || from.FindItemOnLayer(Layer.TwoHanded) != null))
            {
                from.SendLocalizedMessage(1040015); // Your hands must be free to use this
            }
            else if (from.Mounted)
            {
                from.SendLocalizedMessage(1040016); // You cannot use this while riding a mount
            }
            else if (Server.Spells.Ninjitsu.AnimalForm.UnderTransformation(from))
            {
                from.SendLocalizedMessage(1070902); // You can't use this while in an animal form!
            }
			else if (from.Flying)
			{
				from.SendLocalizedMessage(1113414); // You cannot use this while flying!
			}
            else
            {
                EtherealMount.StopMounting(from);

                if (Core.AOS)
                {
                    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.Target = new BolaTarget(this);
                from.LocalOverheadMessage(MessageType.Emote, 0x3B2, 1049632); // * You begin to swing the bola...*
                from.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, 1049633, from.Name); // ~1_NAME~ begins to menacingly swing a bola...
            }
        }
Ejemplo n.º 28
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                PrivateOverheadMessage(MessageType.Regular, 946, 1040019, from.NetState); // The bola must be in your pack to use it.
            }
            else if (!from.CanBeginAction(typeof(Bola)))
            {
                PrivateOverheadMessage(MessageType.Regular, 946, 1049624, from.NetState); // // You have to wait a few moments before you can use another bola!
            }
            else if (from.Target is BolaTarget)
            {
                PrivateOverheadMessage(MessageType.Regular, 946, 1049631, from.NetState); // This bola is already being used.
            }
            else if (from.Mounted)
            {
                PrivateOverheadMessage(MessageType.Regular, 946, 1042053, from.NetState); // You can't use this while on a mount!
            }
            else if (from.Flying)
            {
                PrivateOverheadMessage(MessageType.Regular, 946, 1113414, from.NetState); // You can't use this while flying!
            }
            else if (AnimalForm.UnderTransformation(from))
            {
                PrivateOverheadMessage(MessageType.Regular, 946, 1070902, from.NetState); // You can't use this while in an animal form!
            }
            else
            {
                EtherealMount.StopMounting(from);

                if (Core.AOS)
                {
                    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.Target = new BolaTarget(this);
                from.LocalOverheadMessage(MessageType.Emote, 201, 1049632);               // * You begin to swing the bola...*
                from.NonlocalOverheadMessage(MessageType.Emote, 201, 1049633, from.Name); // ~1_NAME~ begins to menacingly swing a bola...
            }
        }
Ejemplo n.º 29
0
        public override void OnHit(Mobile attacker, Mobile defender, double damageBonus)
        {
            base.OnHit(attacker, defender, damageBonus);

            if (attacker != null && defender != null)
            {
                // No special effects 90% of the time for players
                if (attacker.Player && attacker.AccessLevel == AccessLevel.Player && Utility.RandomDouble() < 0.90)
                {
                    return;
                }

                // Always bleed.
                if (!BleedAttack.IsBleeding(defender))
                {
                    // Necromancers under Lich or Wraith Form are immune to Bleed Attacks.
                    TransformContext context = TransformationSpellHelper.GetContext(defender);

                    if ((context != null && (context.Type == typeof(LichFormSpell) || context.Type == typeof(WraithFormSpell))) ||
                        (defender is BaseCreature && ((BaseCreature)defender).BleedImmune))
                    {
                        return;
                    }
                    else if (defender is PlayerMobile)
                    {
                        defender.LocalOverheadMessage(MessageType.Regular, 0x21, 1060757);                           // You are bleeding profusely
                        defender.NonlocalOverheadMessage(MessageType.Regular, 0x21, 1060758, defender.Name);         // ~1_NAME~ is bleeding profusely
                    }

                    defender.PlaySound(0x133);
                    defender.FixedParticles(0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist);

                    BleedAttack.BeginBleed(defender, attacker, true);
                }

                // 20% chance of Mortal Strike, costs 10 stam each use but cannot be used if you have < 80 stam.
                if (Utility.RandomDouble() > 0.80 && attacker.Stam > 79 && !MortalStrike.IsWounded(defender))
                {
                    MortalStrike.BeginWound(defender, TimeSpan.FromSeconds(6.0));

                    attacker.SendLocalizedMessage(1060086);                       // You deliver a mortal wound!
                    defender.SendLocalizedMessage(1060087);                       // You have been mortally wounded!

                    defender.PlaySound(0x1E1);
                    defender.FixedParticles(0x37B9, 244, 25, 9944, 31, 0, EffectLayer.Waist);

                    attacker.Stam -= 15;
                }
            }
        }
Ejemplo n.º 30
0
 public override void OnSingleClick(Mobile from)
 {
     if (IsLockedDown && Utility.InRange(from.Location, this.Location, 1))
     {
         if (25 > Utility.Random(100))
         {
             Effects.PlaySound(this.Location, this.Map, 221);
             from.LocalOverheadMessage(Network.MessageType.Emote, from.SpeechHue, true, "*You are bitten by the worm!*");
             from.NonlocalOverheadMessage(Network.MessageType.Emote, from.SpeechHue, true, String.Format("*{0} is bitten by the worm!*", from.Name));
             from.Poison = Poison.Deadly;
         }
     }
     base.OnSingleClick(from);
 }
Ejemplo n.º 31
0
        public void DoEffect(object state)
        {
            if (!Alive)
            {
                return;
            }
            object[] states = (object[])state;

            Mobile m     = (Mobile)states[0];
            int    count = (int)states[1];

            if (!m.Alive)
            {
                StopEffect(m, false);
            }
            else
            {
                if (m.Hits < 50)
                {
                    StopEffect(m, true);
                }
                else
                {
                    if ((count % 4) == 0)
                    {
                        m.LocalOverheadMessage(Network.MessageType.Emote, m.SpeechHue, true, "* You are burned alive! *");
                        m.NonlocalOverheadMessage(Network.MessageType.Emote, m.SpeechHue, true, String.Format("* {0} is burned alive! *", m.Name));
                    }

                    m.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot);
                    m.PlaySound(0x54);
                    m.Freeze(TimeSpan.FromSeconds(2.0));
                    m.SendMessage("You are terrified to the very core of your being!");
                    m.RevealingAction();
                    m.SendLocalizedMessage(500814);                     // You have been revealed!

                    AOS.Damage(m, this, Utility.RandomMinMax(15, 20) - (Core.AOS ? 0 : 10), 100, 0, 0, 0, 0);

                    states[1] = count + 1;

                    if (!m.Alive)
                    {
                        StopEffect(m, false);
                    }
                }
            }
        }
Ejemplo n.º 32
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendAsciiMessage("The bola must be in your pack to use it.");
            }
            else if (!from.CanBeginAction(typeof(Bola)))
            {
                from.SendAsciiMessage("You have to wait a few moments before you can use another bola!");
            }
            else if (from.Target is BolaTarget)
            {
                from.SendAsciiMessage("This bola is already being used.");
            }
            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
            {
                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.Target = new BolaTarget(this);
                from.LocalOverheadMessage(MessageType.Emote, 0x3B2, 1049632);                   // * You begin to swing the bola...*
                from.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, 1049633, from.Name);     // ~1_NAME~ begins to menacingly swing a bola...
            }
        }
        public void DoEffect(object state)
        {
            object[] states = (object[])state;

            Mobile m     = (Mobile)states[0];
            int    count = (int)states[1];

            if (!m.Alive)
            {
                StopEffect(m, false);
            }
            else
            {
                Torch torch = m.FindItemOnLayer(Layer.TwoHanded) as Torch;

                if (torch != null && torch.Burning)
                {
                    StopEffect(m, true);
                }
                else
                {
                    if ((count % 4) == 0)
                    {
                        m.LocalOverheadMessage(Network.MessageType.Emote, m.SpeechHue, true, "* The wasps sting viciously at your flesh! *");
                        m.NonlocalOverheadMessage(Network.MessageType.Emote, m.SpeechHue, true, String.Format("* {0} is stung viciously by asshole wasps *", m.Name));
                    }

                    m.FixedParticles(0x91C, 10, 180, 9539, EffectLayer.Waist);
                    m.PlaySound(m.Female ? 792 : 1064);
                    m.PlaySound(0x00E);
                    m.PlaySound(0x1BC);

                    AOS.Damage(m, this, Utility.RandomMinMax(2, 10) - (Core.AOS ? 0 : 10), 100, 0, 0, 0, 0);

                    states[1] = count + 1;

                    if (!m.Alive)
                    {
                        StopEffect(m, false);
                    }
                }
            }
        }
Ejemplo n.º 34
0
        public void DoEffect(object state)
        {
            object[] states = (object[])state;

            Mobile m     = (Mobile)states[0];
            int    count = (int)states[1];

            if (!m.Alive)
            {
                StopEffect(m, false);
            }
            else
            {
                Torch torch = m.FindItemOnLayer(Layer.TwoHanded) as Torch;

                if (torch != null && torch.Burning)
                {
                    StopEffect(m, true);
                }
                else
                {
                    if (count % 4 == 0)
                    {
                        m.LocalOverheadMessage(Network.MessageType.Emote, m.SpeechHue, true, "* The swarm of insects bites and stings your flesh! *");
                        m.NonlocalOverheadMessage(Network.MessageType.Emote, m.SpeechHue, true, string.Format("* {0} is stung by a swarm of insects *", m.Name));
                    }

                    m.FixedParticles(0x91C, 10, 180, 9539, EffectLayer.Waist);
                    m.PlaySound(0x00E);
                    m.PlaySound(0x1BC);

                    AOS.Damage(m, this, Utility.RandomMinMax(30, 40), 100, 0, 0, 0, 0);

                    states[1] = count + 1;

                    if (!m.Alive)
                    {
                        StopEffect(m, false);
                    }
                }
            }
        }
Ejemplo n.º 35
0
        public override int PlayEndingEffect( Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item )
        {
            if (toolBroken)
                from.SendAsciiMessage("You have worn out your tool!");
                //from.SendLocalizedMessage( 1044038 ); // You have worn out your tool

            if ( failed )
            {
                if ( IsPotion( item.ItemType ) )
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x21, true, String.Format("*You toss the failed mixture from the mortar, unable to create a potion from it.*"));
                    from.NonlocalOverheadMessage(MessageType.Regular, 0x21, true, String.Format("*{0} tosses out the contents of the mortar.*", from.Name));
                    from.AddToBackpack( new Bottle() );
                    /*int OldHue = from.SpeechHue;
                    from.SpeechHue = 0x21;
                    from.SayTo(from, true, String.Format("*You toss the failed mixture from the mortar, unable to create a potion from it.*"));
                    from.SpeechHue = OldHue;*/
                    return 500287; // You fail to create a useful potion.
                }
                else
                {
                    return 1044043; // You failed to create the item, and some of your materials are lost.
                }
            }
            else
            {
                from.PlaySound( 0x240 ); // Sound of a filling bottle

                if ( IsPotion( item.ItemType ) )
                {
                    if (quality == -1)
                        return 1048136; // You create the potion and pour it into a keg.
                    else
                    {
                        from.LocalOverheadMessage(MessageType.Regular, 0x21, true, String.Format("*You pour the completed potion into a bottle.*"));
                        from.NonlocalOverheadMessage(MessageType.Regular, 0x21, true, String.Format("*{0} pours the completed potion into a bottle.*", from.Name));
                        /*int OldHue = from.SpeechHue;
                        from.SpeechHue = 0x21;
                        from.SayTo(from, true, String.Format("*You pour the completed potion into a bottle.*"));
                        from.SpeechHue = OldHue;*/

                        return 500279; // You pour the potion into a bottle...
                    }
                }
                else
                {
                    return 1044154; // You create the item.
                }
            }
        }
Ejemplo n.º 36
0
		public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
		{
			base.OnHit( attacker, defender, damageBonus );

			if ( attacker != null && defender != null )
			{
				// No special effects 90% of the time for players
				if ( attacker.Player && attacker.AccessLevel == AccessLevel.Player && Utility.RandomDouble() < 0.90 )
					return;

				// Always bleed.
				if ( !BleedAttack.IsBleeding( defender ) )
				{
					// Necromancers under Lich or Wraith Form are immune to Bleed Attacks.
					TransformContext context = TransformationSpellHelper.GetContext( defender );

					if ( (context != null && ( context.Type == typeof( LichFormSpell ) || context.Type == typeof( WraithFormSpell ))) ||
						(defender is BaseCreature && ((BaseCreature)defender).BleedImmune) )
					{
						return;
					}
					else if ( defender is PlayerMobile )
					{
						defender.LocalOverheadMessage( MessageType.Regular, 0x21, 1060757 ); // You are bleeding profusely
						defender.NonlocalOverheadMessage( MessageType.Regular, 0x21, 1060758, defender.Name ); // ~1_NAME~ is bleeding profusely
					}

					defender.PlaySound( 0x133 );
					defender.FixedParticles( 0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist );

					BleedAttack.BeginBleed( defender, attacker, true );
				}

				// 20% chance of Mortal Strike, costs 10 stam each use but cannot be used if you have < 80 stam.
				if ( Utility.RandomDouble() > 0.80 && attacker.Stam > 79 && !MortalStrike.IsWounded( defender ) )
				{
					MortalStrike.BeginWound( defender, TimeSpan.FromSeconds( 6.0 ) );

					attacker.SendLocalizedMessage( 1060086 ); // You deliver a mortal wound!
					defender.SendLocalizedMessage( 1060087 ); // You have been mortally wounded!

					defender.PlaySound( 0x1E1 );
					defender.FixedParticles( 0x37B9, 244, 25, 9944, 31, 0, EffectLayer.Waist );

					attacker.Stam -= 15;
				}
			}
		}
Ejemplo n.º 37
0
		public void OnDeath( Mobile mob, Container corpse )
		{
			if ( !m_Registered || !m_Started )
				return;

			DuelPlayer pl = Find( mob );

			if ( pl != null && !pl.Eliminated )
			{
				if ( m_EventGame != null && !m_EventGame.OnDeath( mob, corpse ) )
					return;

				pl.Eliminated = true;

				if ( mob.Poison != null )
					mob.Poison = null;

				Requip( mob, corpse );
				DelayBounce( TimeSpan.FromSeconds( 4.0 ), mob, corpse );

				Participant winner = CheckCompletion();

				if ( winner != null )
				{
					Finish( winner );
				}
				else if ( !m_Yielding )
				{
					mob.LocalOverheadMessage( MessageType.Regular, 0x22, false, "You have been defeated." );
					mob.NonlocalOverheadMessage( MessageType.Regular, 0x22, false, String.Format( "{0} has been defeated.", mob.Name ) );
				}
			}
		}
Ejemplo n.º 38
0
		public void OnLocationChanged( Mobile mob )
		{
			if ( !m_Registered || !m_StartedBeginCountdown || m_Finished )
				return;

			Arena arena = m_Arena;

			if ( arena == null )
				return;

			if ( mob.Map == arena.Facet && arena.Bounds.Contains( mob.Location ) )
				return;

			DuelPlayer pl = Find( mob );

			if ( pl == null || pl.Eliminated )
				return;

			if ( mob.Map == Map.Internal ) {
				// they've logged out

				if ( mob.LogoutMap == arena.Facet && arena.Bounds.Contains( mob.LogoutLocation ) ) {
					// they logged out inside the arena.. set them to eject on login

					mob.LogoutLocation = arena.Outside;
				}
			}

			pl.Eliminated = true;

			mob.LocalOverheadMessage( MessageType.Regular, 0x22, false, "You have forfeited your position in the duel." );
			mob.NonlocalOverheadMessage( MessageType.Regular, 0x22, false, String.Format( "{0} has forfeited by leaving the dueling arena.", mob.Name ) );

			Participant winner = CheckCompletion();

			if ( winner != null )
				Finish( winner );
		}
Ejemplo n.º 39
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                from.RevealingAction();

                if (targeted is Mobile)
                {
                    if (targeted is BaseCreature)
                    {
                        BaseCreature creature = (BaseCreature)targeted;

                        if (!creature.Tamable)
                        {
                            creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1049655, from.NetState); // That creature cannot be tamed.
                        }
                        else if (creature.Controlled)
                        {
                            creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502804, from.NetState); // That animal looks tame already.
                        }
                        else if (from.Female && !creature.AllowFemaleTamer)
                        {
                            creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1049653, from.NetState); // That creature can only be tamed by males.
                        }
                        else if (!from.Female && !creature.AllowMaleTamer)
                        {
                            creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1049652, from.NetState); // That creature can only be tamed by females.
                        }
                        else if (creature is CuSidhe && from.Race != Race.Elf)
                        {
                            creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502801, from.NetState); // You can't tame that!
                        }
                        else if (from.Followers + creature.ControlSlots > from.FollowersMax)
                        {
                            from.SendLocalizedMessage(1049611); // You have too many followers to tame that creature.
                        }
                        else if (creature.Owners.Count >= BaseCreature.MaxOwners && !creature.Owners.Contains(from))
                        {
                            creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1005615, from.NetState); // This animal has had too many owners and is too upset for you to tame.
                        }
                        else if (MustBeSubdued(creature))
                        {
                            creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1054025, from.NetState); // You must subdue this creature before you can tame it!
                        }
                        else if (CheckMastery(from, creature) || from.Skills[SkillName.AnimalTaming].Value >= creature.MinTameSkill)
                        {
                            FactionWarHorse warHorse = creature as FactionWarHorse;

                            if (warHorse != null)
                            {
                                Faction faction = Faction.Find(from);

                                if (faction == null || faction != warHorse.Faction)
                                {
                                    creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1042590, from.NetState); // You cannot tame this creature.
                                    return;
                                }
                            }

                            if (m_BeingTamed.Contains(targeted))
                            {
                                creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502802, from.NetState); // Someone else is already taming this.
                            }
                            else if (creature.CanAngerOnTame && 0.95 >= Utility.RandomDouble())
                            {
                                creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502805, from.NetState); // You seem to anger the beast!
                                creature.PlaySound(creature.GetAngerSound());
                                creature.Direction = creature.GetDirectionTo(from);

                                if (creature.BardPacified && Utility.RandomDouble() > .24)
                                {
                                    Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(ResetPacify), creature);
                                }
                                else
                                {
                                    creature.BardEndTime = DateTime.Now;
                                }

                                creature.BardPacified = false;

                                if (creature.AIObject != null)
                                    creature.AIObject.DoMove(creature.Direction);

                                if (from is PlayerMobile && !(((PlayerMobile)from).HonorActive || TransformationSpellHelper.UnderTransformation(from, typeof(EtherealVoyageSpell))))
                                    creature.Combatant = from;
                            }
                            else
                            {
                                m_BeingTamed[targeted] = from;

                                from.LocalOverheadMessage(MessageType.Emote, 0x59, 1010597); // You start to tame the creature.
                                from.NonlocalOverheadMessage(MessageType.Emote, 0x59, 1010598); // *begins taming a creature.*

                                new InternalTimer(from, creature, Utility.Random(3, 2)).Start();

                                this.m_SetSkillTime = false;
                            }
                        }
                        else
                        {
                            creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502806, from.NetState); // You have no chance of taming this creature.
                        }
                    }
                    else
                    {
                        ((Mobile)targeted).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502469, from.NetState); // That being cannot be tamed.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502801); // You can't tame that!
                }
            }
Ejemplo n.º 40
0
			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( m_Thorn.Deleted )
					return;

				if ( !m_Thorn.IsChildOf( from.Backpack ) )
				{
					from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
					return;
				}

				if ( !from.CanBeginAction( typeof( GreenThorns ) ) )
				{
					from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061908 ); // * You must wait a while before planting another thorn. *
					return;
				}

				if ( from.Map != Map.Trammel && from.Map != Map.Felucca )
				{
					from.LocalOverheadMessage( MessageType.Regular, 0x2B2, true, "No solen lairs exist on this facet.  Try again in Trammel or Felucca." );
					return;
				}

				LandTarget land = targeted as LandTarget;

				if ( land == null )
				{
					from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061912 ); // * You cannot plant a green thorn there! *
				}
				else
				{
					GreenThornsEffect effect = GreenThornsEffect.Create( from, land );

					if ( effect == null )
					{
						from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061913 ); // * You sense it would be useless to plant a green thorn there. *
					}
					else
					{
						m_Thorn.Consume();

						from.LocalOverheadMessage( MessageType.Emote, 0x961, 1061914 ); // * You push the strange green thorn into the ground *
						from.NonlocalOverheadMessage( MessageType.Emote, 0x961, 1061915, from.Name ); // * ~1_PLAYER_NAME~ pushes a strange green thorn into the ground. *

						from.BeginAction( typeof( GreenThorns ) );
						new GreenThorns.EndActionTimer( from ).Start();

						effect.Start();
					}
				}
			}
Ejemplo n.º 41
0
        public override int PlayEndingEffect( Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item )
        {
            if ( toolBroken )
                from.SendAsciiMessage("You have worn out your tool.");
                //from.SendLocalizedMessage( 1044038 ); // You have worn out your tool

            if ( failed )
            {
                int OldHue = from.SpeechHue;
                from.SpeechHue = from.EmoteHue;

                if (lostMaterial)
                {
                    from.LocalOverheadMessage(MessageType.Regular, from.EmoteHue, true, String.Format("*You carve the wood away but are left with nothing.*"));
                    from.NonlocalOverheadMessage(MessageType.Regular, from.EmoteHue, true, String.Format("*{0} stops carving, but is left with nothing useful.*", from.Name));
                    //from.Say(true, "*stops carving, but is left with nothing useful.*");
                }
                //from.SendAsciiMessage("You failed to create the item, and some of your materials are lost.");
                //return 1044043; // You failed to create the item, and some of your materials are lost.
                else
                {
                    from.LocalOverheadMessage(MessageType.Regular, from.EmoteHue, true, String.Format("*You carve the wood away but are left with nothing.*"));
                    from.NonlocalOverheadMessage(MessageType.Regular, from.EmoteHue, true, String.Format("*{0} stops carving, but is left with nothing useful.*", from.Name));
                    //from.Say(true, "*stops carving, but is left with nothing useful.*");
                }
                    //from.SendAsciiMessage("You failed to create the item, but no materials were lost.");
                    //return 1044157; // You failed to create the item, but no materials were lost.

                from.SpeechHue = OldHue;
            }
            else
            {
                if (item.ItemType == typeof(Arrow))
                    from.SendAsciiMessage("You make some arrows and put them in your backpack.");
                else if (item.ItemType == typeof(Bolt))
                    from.SendAsciiMessage("You make some bolts and put them in your backpack.");
                else if (item.ItemType == typeof(Kindling))
                    from.SendAsciiMessage("You make kindling and put it in your backpack.");
                else if (item.ItemType == typeof(Shaft))
                        from.SendAsciiMessage("You make some shafts and put them in your backpack.");
                else if (item.ItemType == typeof(Bow))
                    from.SendAsciiMessage("You make a bow and put it in your backpack.");
                else if (item.ItemType == typeof(Crossbow))
                    from.SendAsciiMessage("You make a crossbow and put it in your backpack.");
                else if (item.ItemType == typeof(HeavyCrossbow))
                    from.SendAsciiMessage("You make a heavy crossbow and put it in your backpack.");
                else
                    from.SendAsciiMessage("You create the item and put it in your backpack.");

                /*if ( quality == 0 )
                    from.SendAsciiMessage("You were barely able to make this item.  It's quality is below average.");
                    //return 502785; // You were barely able to make this item.  It's quality is below average.
                else if ( makersMark && quality == 2 )
                    from.SendAsciiMessage("You create an exceptional quality item and affix your maker's mark.");
                    //return 1044156; // You create an exceptional quality item and affix your maker's mark.
                else if ( quality == 2 )
                    from.SendAsciiMessage("You create an exceptional quality item.");
                    //return 1044155; // You create an exceptional quality item.
                else
                    from.SendAsciiMessage("You create the item.");
                    return 1044154; // You create the item.*/
            }
            return 500638;
        }
			protected override void OnTarget( Mobile from, object o )
			{
				int itemID = 0;
				if (o is LandTarget)
				{
				if (from.Map == Map.Malas || from.Map == Map.Ilshenar)
					{
					from.PrivateOverheadMessage( MessageType.Regular, 0x2B2, true, "No solen lairs exist on this facet.  Try again in Trammel or Felucca.", from.NetState);
					return;
					}
				Point3D p = new Point3D( o as IPoint3D );
				itemID = from.Map.Tiles.GetLandTile( ((LandTarget)o).X, ((LandTarget)o).Y ).ID & 0x3FFF;
				bool goodspot = false;
				int effect = 0;
				for ( int i = 0; i < m_DirtIDs.Length; i += 2 )
					{
					if ( itemID >= m_DirtIDs[i] && itemID <= m_DirtIDs[i + 1] )
						{
						goodspot = true;
						effect = 1;
						}
					}
				for ( int i = 0; i < m_SwampIDs.Length; i += 2 )
					{
					if ( itemID >= m_SwampIDs[i] && itemID <= m_SwampIDs[i + 1] )
						{
						goodspot = true;
						effect = 2;
						}
					}
				for ( int i = 0; i < m_SandIDs.Length; i += 2 )
					{
					if ( itemID >= m_SandIDs[i] && itemID <= m_SandIDs[i + 1] )
						{
						goodspot = true;
						effect = 3;
						}
					}
				for ( int i = 0; i < m_SnowIDs.Length; i += 2 )
					{
					if ( itemID >= m_SnowIDs[i] && itemID <= m_SnowIDs[i + 1] )
						{
						goodspot = true;
						effect = 4;
						}
					}
				for ( int i = 0; i < m_FurrowsIDs.Length; i += 2 )
					{
					if ( itemID >= m_FurrowsIDs[i] && itemID <= m_FurrowsIDs[i + 1] )
						{
						goodspot = true;
						effect = 5;
						}
					}
				if ( goodspot )
					{
					m_GreenThorn.Consume();
					from.LocalOverheadMessage( MessageType.Emote, 0x2B2, 1061914 ); // * You push the strange green thorn into the ground *
					from.NonlocalOverheadMessage( MessageType.Emote, 0x2B2, 1061915, from.Name ); // * ~1_PLAYER_NAME~ pushes a strange green thorn into the ground. *
					from.PlaySound(0x106);
					Effects.SendLocationParticles( EffectItem.Create( p, from.Map, EffectItem.DefaultDuration ), 0x3735, 1, 182, 0xBE3 );
					new ThornEffectTimer( from, p, effect ).Start();
					new DelayTimer(from).Start();
					}
				else
					{
					from.SendLocalizedMessage( 1061913 ); // * You sense it would be useless to plant a green thorn there. *
					from.EndAction( typeof( GreenThorn ) );
					}
				}
				else
					{
					from.SendLocalizedMessage( 1061912 ); // * You cannot plant a green thorn there! *
					from.EndAction( typeof( GreenThorn ) );
					}
			}
Ejemplo n.º 43
0
			protected override void OnTarget( Mobile from, object targeted )
			{
				from.RevealingAction();

				if ( targeted is Mobile )
				{
					if ( targeted is BaseCreature )
					{
						BaseCreature creature = (BaseCreature)targeted;

						if ( !creature.Tamable )
						{
							from.SendLocalizedMessage( 502469 ); // That being can not be tamed.
						}
						else if ( creature.Controlled )
						{
							from.SendLocalizedMessage( 502467 ); // That animal looks tame already.
						}
						else if ( from.Female ? !creature.AllowFemaleTamer : !creature.AllowMaleTamer )
						{
							from.SendLocalizedMessage( 502801 ); // You can't tame that!
						}
						else if ( from.Followers + creature.ControlSlots > from.FollowersMax )
						{
							from.SendLocalizedMessage( 1049611 ); // You have too many followers to tame that creature.
						}
						else if ( creature.Owners.Count >= BaseCreature.MaxOwners && !creature.Owners.Contains( from ) )
						{
							from.SendLocalizedMessage( 1005615 ); // This animal has had too many owners and is too upset for you to tame.
						}
						else if ( MustBeSubdued( creature ) )
						{
							from.SendLocalizedMessage( 1054025 ); // You must subdue this creature before you can tame it!
						}
						else if ( creature.BardProvoked )
						{
							from.SendMessage("That creature is too angry to tame.");
						}
						else if ( CheckMastery( from, creature ) || from.Skills[SkillName.AnimalTaming].Value >= creature.MinTameSkill )
						{
							if ( m_BeingTamed.Contains( targeted ) )
							{
								from.SendLocalizedMessage( 502802 ); // Someone else is already taming this.
							}
							else if ( (creature is Dragon || creature is Nightmare || creature is SwampDragon || creature is WhiteWyrm) && 0.95 >= Utility.RandomDouble() )
							{
								from.SendLocalizedMessage( 502805 ); // You seem to anger the beast!
								creature.PlaySound( creature.GetAngerSound() );
								creature.Direction = creature.GetDirectionTo( from );
								creature.Combatant = from;
							}
							else
							{
								m_BeingTamed[targeted] = from;

								from.LocalOverheadMessage( MessageType.Emote, 0x59, 1010597 ); // You start to tame the creature.
								from.NonlocalOverheadMessage( MessageType.Emote, 0x59, 1010598 ); // *begins taming a creature.*

								new InternalTimer( from, creature, Utility.Random( 3, 2 ) ).Start();

								m_SetSkillTime = false;
							}
						}
						else
						{
							from.SendLocalizedMessage( 502806 ); // You have no chance of taming this creature.
						}
					}
					else
					{
						from.SendLocalizedMessage( 502469 ); // That being can not be tamed.
					}
				}
				else
				{
					from.SendLocalizedMessage( 502801 ); // You can't tame that!
				}
			}
Ejemplo n.º 44
0
			protected override void OnTarget(Mobile from, object targeted)
			{
				from.RevealingAction();

				var entity = targeted as IEntity;
				if (XmlScript.HasTrigger(entity, TriggerName.onTargeted) &&
					UberScriptTriggers.Trigger(
						entity,
						from,
						TriggerName.onTargeted,
						null,
						null,
						null,
						0,
						null,
						SkillName.AnimalTaming,
						from.Skills[SkillName.AnimalTaming].Value))
				{
					return;
				}

				if (targeted is Mobile)
				{
					if (targeted is BaseCreature)
					{
						var creature = (BaseCreature)targeted;
						var customRegion = creature.Region as CustomRegion;

						if (from.AccessLevel >= AccessLevel.GameMaster)
						{
							creature.Owners.Add(from);
							creature.SetControlMaster(from);
							creature.IsBonded = false;
							creature.PrivateOverheadMessage(
								MessageType.Regular,
								0x3B2,
								true,
								"Your godly powers allow you to force the creature to yield to your will.",
								from.NetState);
						}
						else if (customRegion != null && customRegion.Controller != null && customRegion.Controller.NoPets)
						{
							from.SendMessage("You cannot tame that creature here as pets are not allowed in this area.!");
						}
						else if (!creature.Tamable)
						{
							creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1049655, from.NetState);
								// That creature cannot be tamed.
						}
						else if (creature.Controlled)
						{
							creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502804, from.NetState);
								// That animal looks tame already.
						}
						else if (from.Female && !creature.AllowFemaleTamer)
						{
							creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1049653, from.NetState);
								// That creature can only be tamed by males.
						}
						else if (!from.Female && !creature.AllowMaleTamer)
						{
							creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1049652, from.NetState);
								// That creature can only be tamed by females.
						}
						else if (creature is CuSidhe && from.Race != Race.Elf)
						{
							creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502801, from.NetState); // You can't tame that!
						}
						else if (from.Followers + creature.ControlSlots > from.FollowersMax)
						{
							from.SendLocalizedMessage(1049611); // You have too many followers to tame that creature.
						}
						else if (creature.Owners.Count >= BaseCreature.MaxOwners && !creature.Owners.Contains(from))
						{
							creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1005615, from.NetState);
								// This animal has had too many owners and is too upset for you to tame.
						}
						else if (MustBeSubdued(creature))
						{
							creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1054025, from.NetState);
								// You must subdue this creature before you can tame it!
						}
						else if (CheckMastery(from, creature) || from.Skills[SkillName.AnimalTaming].Value >= creature.MinTameSkill)
						{
							var warHorse = creature as FactionWarHorse;

							if (warHorse != null)
							{
								Faction faction = Faction.Find(from);

								if (faction == null || faction != warHorse.Faction)
								{
									creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1042590, from.NetState);
										// You cannot tame this creature.
									return;
								}
							}

							if (m_BeingTamed.ContainsKey(creature))
							{
								creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502802, from.NetState);
									// Someone else is already taming this.
							}
							else if (creature.CanAngerOnTame && 0.95 >= Utility.RandomDouble())
							{
								creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502805, from.NetState);
									// You seem to anger the beast!
								creature.PlaySound(creature.GetAngerSound());
								creature.Direction = creature.GetDirectionTo(from);

								if (creature.BardPacified && 0.75 > Utility.RandomDouble())
								{
									Timer.DelayCall(TimeSpan.FromSeconds(2.0), ResetPacify, creature);
								}
								else
								{
									creature.BardEndTime = DateTime.UtcNow;
									creature.BardPacified = false;

									if (creature.AIObject != null)
									{
										creature.AIObject.DoMove(creature.Direction);
									}
								}
							}
							else
							{
								m_BeingTamed[creature] = from;

								from.LocalOverheadMessage(MessageType.Emote, 0x59, 1010597); // You start to tame the creature.
								from.NonlocalOverheadMessage(MessageType.Emote, 0x59, 1010598); // *begins taming a creature.*

								new InternalTimer(from, creature, Utility.Random(3, 2)).Start();

								m_SetSkillTime = false;
							}
						}
						else
						{
							creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502806, from.NetState);
								// You have no chance of taming this creature.
						}
					}
					else
					{
						((Mobile)targeted).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502469, from.NetState);
							// That being cannot be tamed.
					}
				}
				else
				{
					from.SendLocalizedMessage(502801); // You can't tame that!
				}
			}
Ejemplo n.º 45
0
            protected override void OnTarget( Mobile from, object targeted )
            {
                from.RevealingAction();

                if ( targeted is Mobile )
                {
                    if ( targeted is BaseCreature )
                    {
                        BaseCreature creature = (BaseCreature)targeted;

                        if ( !creature.Tamable || creature.MinTameSkill > 150 )
                        {
                            from.SendLocalizedMessage( 502469 ); // That being can not be tamed.
                        }
                        else if ( creature.Controled )
                        {
                            from.SendLocalizedMessage( 502467 ); // That animal looks tame already.
                        }
                        else if ( from.Female ? !creature.AllowFemaleTamer : !creature.AllowMaleTamer )
                        {
                            from.SendLocalizedMessage( 502801 ); // You can't tame that!
                        }
                        /*else if ( from.Followers + creature.ControlSlots > from.FollowersMax )
                        {
                            from.SendLocalizedMessage( 1049611 ); // You have too many followers to tame that creature.
                        }*/
                        /*else if ( creature.Owners.Count >= BaseCreature.MaxOwners && !creature.Owners.Contains( from ) )
                        {
                            from.SendLocalizedMessage( 1005615 ); // This animal has had too many owners and is too upset for you to tame.
                        }*/
                        else if ( MustBeSubdued( creature ) )
                        {
                            from.SendLocalizedMessage( 1054025 ); // You must subdue this creature before you can tame it!
                        }
                        else if ( CheckMastery( from, creature ) || from.Skills[SkillName.AnimalTaming].Value >= creature.MinTameSkill*1.2 - 25.0 )
                        {
                            if ( m_BeingTamed.Contains( targeted ) )
                            {
                                from.SendLocalizedMessage( 502802 ); // Someone else is already taming this.
                            }
                            else
                            {
                                m_BeingTamed[targeted] = from;

                                // Face the creature
                                from.Direction = from.GetDirectionTo( creature );

                                from.LocalOverheadMessage( MessageType.Emote, 0x59, 1010597 ); // You start to tame the creature.
                                from.NonlocalOverheadMessage( MessageType.Emote, 0x59, 1010598 ); // *begins taming a creature.*

                                new InternalTimer( from, creature, Utility.Random( 3, 2 ) ).Start();
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage( 502806 ); // You have no chance of taming this creature.
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage( 502469 ); // That being can not be tamed.
                    }
                }
                else
                {
                    from.SendLocalizedMessage( 502801 ); // You can't tame that!
                }
            }
Ejemplo n.º 46
0
        private void DoDestroyEquipment(Mobile target)
        {
            if (target.AccessLevel == AccessLevel.Player && InRange(target, 1) && 0.25 > Utility.RandomDouble())
                //15% chance
            {
                var items = new List<Item>();

                for (int i = 0; i < target.Items.Count; i++)
                {
                    Item item = target.Items[i];
                    if (item is IDurability && ((IDurability) item).MaxHitPoints > 0 &&
                        item.LootType != LootType.Blessed && item.BlessedFor == null &&
                        !(InsuranceEnabled && item.Insured))
                    {
                        items.Add(item);
                    }
                }

                if (items.Count > 0)
                {
                    Item toDestroy = items[Utility.Random(items.Count)];
                    string name = toDestroy.Name;
                    if (String.IsNullOrEmpty(name))
                    {
                        name = toDestroy.ItemData.Name;
                    }

                    toDestroy.Delete();

                    target.NonlocalOverheadMessage(MessageType.Regular, 0x3B2, 1080034, name);
                        // Their ~1_NAME~ is destroyed by the attack.
                    target.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1080035, name);
                        // Your ~1_NAME~ is destroyed by the attack.
                }
            }
        }
Ejemplo n.º 47
0
        public override void OnHit( Mobile attacker, Mobile defender, int damage )
        {
            if ( !IsBladeweaveAttack )
            {
                if ( !Validate( attacker ) )
                    return;
                if ( !CheckMana( attacker, true ) )
                    return;
            }

            ClearCurrentAbility( attacker );

            if ( defender is BaseCreature )
            {
                if ( defender != null && ( (BaseCreature) defender ).BleedImmune )
                {
                    attacker.SendLocalizedMessage( 1062052 ); // Your target is not affected by the bleed attack!

                    return;
                }
            }

            TransformContext context = TransformationSpell.GetContext( defender );

            // Necromancers under Lich Form or Wraith Form are immune to Bleed Attacks.
            if ( context == null || ( context.Type != typeof( LichFormSpell ) && context.Type != typeof( WraithFormSpell ) ) )
            {
                attacker.SendLocalizedMessage( 1060159 ); // Your target is bleeding!
                defender.SendLocalizedMessage( 1060160 ); // You are bleeding!

                if ( defender is PlayerMobile )
                {
                    defender.LocalOverheadMessage( MessageType.Regular, 0x21, 1060757 ); // You are bleeding profusely
                    defender.NonlocalOverheadMessage( MessageType.Regular, 0x21, 1060758, defender.Name ); // ~1_NAME~ is bleeding profusely
                }

                defender.PlaySound( 0x133 );
                defender.FixedParticles( 0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist );

                TimeSpan duration = ComputeDuration( defender );

                BuffInfo.AddBuff( defender, new BuffInfo( BuffIcon.Bleed, 1075829, duration, defender, String.Format( "{0}\t{1}\t{2}", 5, 10, 2 ) ) );

                BeginBleed( defender, attacker, duration );
            }
            else
            {
                attacker.SendLocalizedMessage( 1062052 ); // Your target is not affected by the bleed attack!
            }
        }
Ejemplo n.º 48
0
        public void DoDamage(Mobile to)
        {
            to.Send(new UnicodeMessage(this.Serial, this.ItemID, MessageType.Regular, 0x3B2, 3, "", "", "The generator shoots an arc of electricity at you!"));
            to.BoltEffect(0);
            to.LocalOverheadMessage(MessageType.Regular, 0xC9, true, "* Your body convulses from electric shock *");
            to.NonlocalOverheadMessage(MessageType.Regular, 0xC9, true, string.Format("* {0} spasms from electric shock *", to.Name));

            AOS.Damage(to, to, 60, 0, 0, 0, 0, 100);

            if (!to.Alive)
                return;

            if (this.m_DamageTable[to] == null)
            {
                to.Frozen = true;

                DamageTimer timer = new DamageTimer(this, to);
                this.m_DamageTable[to] = timer;

                timer.Start();
            }
        }