Пример #1
0
        /// <summary>
        /// Execution de la gifle
        /// </summary>
        public static void Gifle_Callback(Mobile mJoueur, object objCible)
        {
            if (objCible is Mobile)
            {
                Mobile mCible = objCible as Mobile;

                // si le joueur s'est ciblé lui même
                if (mJoueur == mCible)
                {
                    mJoueur.Emote("*{0} se gifle*", mJoueur.Name);
                }
                // si il reussi a donner la gifle
                else if (Utility.Random(10) > 3)    // Scriptiz : pas besoin de stocker le booléen
                {
                    mJoueur.Emote("*{0} gifle {1}*", mJoueur.Name, mCible.Name);
                    mCible.Emote("*{0} se prend une gifle de {1}*", mCible.Name, mJoueur.Name);
                }
                else // quel looseur il s'est manqué
                {
                    mJoueur.Emote("*{0} gifle {1}, mais ratte*", mJoueur.Name, mCible.Name);
                    mCible.Emote("*{0} esquive une gifle de {1}*", mCible.Name, mJoueur.Name);
                }

                // animation
                mCible.Animate(20, 1, 1, true, false, 2);
                mJoueur.Animate(33, 1, 1, true, false, 2);

                // Scriptiz : son
                mCible.PlaySound(0x135);
            }
        }
Пример #2
0
 public void wakeUp()
 {
     m_AFK.Remove(who.Serial.Value);
     who.Emote("*is no longer AFK*");
     who.SendMessage("AFK deactivated.");
     this.Stop();
 }
Пример #3
0
 public void wakeUp()
 {
     m_AFK.Remove(who.Serial.Value);
     who.Emote("*ya no esta en AFK*");
     who.SendMessage("AFK desactivado.");
     this.Stop();
 }
Пример #4
0
        public override void OnGotMeleeAttack(Mobile attacker)
        {
            if (this.Map != null && attacker != this && 0.75 > Utility.RandomDouble())
            {
                if (attacker is BaseCreature)
                {
                    BaseCreature pet = (BaseCreature)attacker;
                    if (pet.ControlMaster != null && (attacker is BaseCreature))//Dragon || attacker is GreaterDragon || attacker is SkeletalDragon || attacker is WhiteWyrm || attacker is Drake))
                    {
                        this.Combatant    = null;
                        pet.Combatant     = null;
                        this.Combatant    = null;
                        pet.ControlMaster = null;
                        pet.Controlled    = false;
                        attacker.Emote(String.Format("* {0} decided to go wild *", attacker.Name));
                    }

                    if (pet.ControlMaster != null && 0.9 > Utility.RandomDouble())
                    {
                        this.Combatant = null;
                        pet.Combatant  = pet.ControlMaster;
                        this.Combatant = null;
                        attacker.Emote(String.Format("* {0} is being angered *", attacker.Name));
                    }
                }
            }

            base.OnGotMeleeAttack(attacker);
        }
Пример #5
0
        /// <summary>
        /// Execution de la gifle
        /// </summary>
        public static void Gifle_Callback(Mobile mJoueur, object objCible)
        {
            if (objCible is Mobile)
            {
                Mobile mCible = objCible as Mobile;

                // si le joueur s'est ciblé lui même
                if (mJoueur == mCible)
                    mJoueur.Emote("*{0} se gifle*", mJoueur.Name);
                // si il reussi a donner la gifle
                else if (Utility.Random(10) > 3)    // Scriptiz : pas besoin de stocker le booléen
                {
                    mJoueur.Emote("*{0} gifle {1}*", mJoueur.Name, mCible.Name);
                    mCible.Emote("*{0} se prend une gifle de {1}*", mCible.Name, mJoueur.Name);
                }
                else // quel looseur il s'est manqué
                {
                    mJoueur.Emote("*{0} gifle {1}, mais ratte*", mJoueur.Name, mCible.Name );
                    mCible.Emote("*{0} esquive une gifle de {1}*", mCible.Name, mJoueur.Name);
                }

                // animation
                mCible.Animate(20, 1, 1, true, false, 2);
                mJoueur.Animate(33, 1, 1, true, false, 2);

                // Scriptiz : son
                mCible.PlaySound(0x135);
            }
        }
Пример #6
0
        public override void OnDoubleClick(Mobile from)
        {

            if (Parent != from)
                if (from.AccessLevel < AccessLevel.GameMaster)
                    from.SendMessage("When you touch, it vanishes without trace...");
            if (from.AccessLevel < AccessLevel.GameMaster)
                this.Consume();
            if (from.AccessLevel < AccessLevel.GameMaster)
                return;
            {
                if (!IsChildOf(from.Backpack))
                {
                    from.Say("That must be in your pack for you to use it");
                    return;
                }
                if (!from.Hidden == true)
                {
                    from.Emote("*" + from.Name + " goes to ethereal world*");
                    from.BoltEffect(0);
                    from.Hidden = true;

                }
                else
                {
                    from.Hidden = false;
                    from.Emote("*" + from.Name + " strikes the earth*");
                    from.BoltEffect(0);

                }
            }
        }
Пример #7
0
        public override bool OnEquip(Mobile from)
        {
            if (DefSerUss == 0)
            {
                DefSerUss = from.Serial;
                from.Emote("* " + from.Name + " feels as if he is no longer Mortal *");


                base.OnEquip(from);

                return(true);
            }
            else if (DefSerUss == from.Serial)
            {
                from.Emote("* " + from.Name + " draws uppon the Frozen Sword of the Gods *");


                base.OnEquip(from);

                return(true);
            }
            else
            {
                from.Emote("* You are Disallowed to Equipt MY swords! *");

                return(false);
            }
        }
Пример #8
0
        public void Colhe(Mobile from, Point3D loc, Map map)
        {
            this.ItemID = 0x1014;
            Item spawn = this.GetCropObject();

            var Skill = (int)from.Skills[SkillName.Herding].Value;
            var amt   = new Random().Next(5) + Skill / 5;

            spawn.Amount = amt;

            var check = from.CheckSkill(SkillName.Herding, GetMinSkill(), GetMaxSkill());

            var faiou = false;

            if (!check)
            {
                if (Utility.Random(3) == 1)
                {
                    from.Emote("* tentou colher e estragou tudo *");
                    Effects.PlaySound(this.Location, this.Map, 0x12E);
                    this.m_Picked = true;
                    this.Unlink();
                    Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerCallback(Delete));
                }
                else
                {
                    faiou        = true;
                    spawn.Amount = 1;
                }
            }

            from.Emote("* colheu a planta *");
            ((PlayerMobile)from).HarvestAnimation(0);
            if (Skill < 35 || faiou)
            {
                from.SendMessage("Por ser inexperiente voce retirou a planta de forma errada");
                spawn.MoveToWorld(loc, map);
            }
            else
            {
                var seed = GetSeed();
                if (seed != null && Utility.Random(2) == 1)
                {
                    from.AddToBackpack(seed);
                }
                from.AddToBackpack(spawn);
            }

            SendoColhida = false;
            Effects.PlaySound(this.Location, this.Map, 0x12E);
            this.m_Picked = true;
            this.Unlink();
            Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerCallback(Delete));
        }
Пример #9
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m.LegsArmor != null && m.LegsArmor is PlateLegs)
            {
                m.SendMessage("The caltrops have no effect on you...");
            }
            else if (m.Mounted)
            {
                if (Utility.RandomBool())
                {
                    BaseMount.Dismount(m);
                    if (m is TeiravonMobile)
                    {
                        TeiravonMobile tm = (TeiravonMobile)m;
                        tm.Dismounted();
                    }

                    m.Emote("*You see {0} is thrown from {1} mount!*", m.Name, m.Female ? "her" : "his");
                    m.SendMessage("Your mount stumbles over the caltrops!");

                    m.Freeze(TimeSpan.FromSeconds(3.0));
                }
                else if (Utility.RandomBool())
                {
                    m.Emote("*You see {0}'s mount stumble, but keep its footing.*", m.Name);

                    m.Freeze(TimeSpan.FromSeconds(1.0));
                }
                else
                {
                    m.Emote("The caltrops have no effect on your mount.");
                }
            }
            else
            {
                if (Utility.RandomBool())
                {
                    m.Freeze(TimeSpan.FromSeconds(1.0));
                }

                m.Stam = (int)(m.Stam * .25);

                m.Emote("*You see {0} stumble over the caltrops!*", m.Name);
            }

            if (Utility.RandomBool())
            {
                Delete();
            }

            return(base.OnMoveOver(m));
        }
Пример #10
0
        public virtual void OnTarget(Mobile from, object o)
        {
            if (Deleted)
            {
                return;
            }

            if (o is Item)
            {
                if (o is BaseWeapon && ((BaseWeapon)o).Identified == false)
                {
                    ((BaseWeapon)o).Identified = true;
                    from.SendMessage("You identify the item.");
                    from.Emote("*Recites an identification scroll*");
                    this.Consume();
                }
                else if (o is BaseArmor && ((BaseArmor)o).Identified == false)
                {
                    ((BaseArmor)o).Identified = true;
                    from.SendMessage("You identify the item.");
                    from.Emote("*Recites an identification scroll*");
                    this.Consume();
                }
                else if (o is BaseClothing && ((BaseClothing)o).Identified == false)
                {
                    ((BaseClothing)o).Identified = true;
                    from.SendMessage("You identify the item.");
                    from.Emote("*Recites an identification scroll*");
                    this.Consume();
                }
                else if (o is BaseJewel && ((BaseJewel)o).Identified == false)
                {
                    ((BaseJewel)o).Identified = true;
                    from.SendMessage("You identify the item.");
                    from.Emote("*Recites an identification scroll*");
                    this.Consume();
                }
                else
                {
                    from.SendMessage("Are you sure this is the item you want to identify?");
                }
            }
            else if (o == null)
            {
                from.SendMessage("What do you think you're doing? You should target a item!");
            }
            else
            {
                from.SendMessage("Why would you want to identify that!?");
            }
        }
Пример #11
0
        public virtual void OnTarget(Mobile from, object obj)
        {
            Mobile mob;

            if (obj is Corpse)
            {
                Corpse corpse = obj as Corpse;
                mob = corpse.Owner;
            }
            else
            {
                mob = obj as Mobile;
            }

            if (mob == null)
            {
                from.SendMessage("This is not a living being!");
                return;
            }

            if (mob is BaseCreature && mob.IsDeadBondedPet)
            {
                BaseCreature bc = mob as BaseCreature;
                bc.PlaySound(0x214);
                bc.FixedEffect(0x376A, 10, 16);
                bc.ResurrectPet();

                this.Consume();
                from.Emote("*recites a scroll of resurrection*");
                from.SendMessage("The creature was brought back to life.");
            }

            if (mob is PlayerMobile)
            {
                if (mob.Alive)
                {
                    from.SendMessage("This creature is not dead!");
                    return;
                }
                else
                {
                    mob.PlaySound(0x214);
                    mob.FixedEffect(0x376A, 10, 16);
                    mob.Resurrect();
                }

                this.Consume();
                from.Emote("*recites a scroll of resurrection*");
                from.SendMessage("This person was brought back to life.");
            }
        }
Пример #12
0
        public virtual void OnTarget(Mobile from, object obj)
        {
            Mobile mob;

            if (obj is Corpse)
            {
                Corpse corpse = obj as Corpse;
                mob = corpse.Owner;
            }
            else
            {
                mob = obj as Mobile;
            }

            if (mob == null)
            {
                from.SendMessage("This is not a living being!");
                return;
            }

            if (mob is BaseCreature && mob.IsDeadBondedPet)
            {
                BaseCreature bc = mob as BaseCreature;
                bc.PlaySound(0x214);
                bc.FixedEffect(0x376A, 10, 16);
                bc.ResurrectPet();

                this.Consume();
                from.Emote("*recites a scroll of resurrection*");
                from.SendMessage("The creature was brought back to life.");
            }

            if (mob is PlayerMobile)
            {
                if (mob.Alive)
                {
                    from.SendMessage("This creature is not dead!");
                    return;
                }
                else
                {
                    mob.PlaySound(0x214);
                    mob.FixedEffect(0x376A, 10, 16);
                    mob.Resurrect();
                }

                this.Consume();
                from.Emote("*recites a scroll of resurrection*");
                from.SendMessage("This person was brought back to life.");
            }
        }
Пример #13
0
            protected override void OnTarget(Mobile from, object obj)
            {
                int itemID = 0;

                if (obj is Item)
                {
                    itemID = ((Item)obj).ItemID;
                }
                else if (obj is StaticTarget)
                {
                    itemID = ((StaticTarget)obj).ItemID & 0x3FFF;
                }

                bool canFonte = (itemID == 4017 || (itemID >= 6522 && itemID <= 6569));


                if (canFonte)
                {
                    from.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds(8.0);
                    from.Emote("*Fond du minerai*");
                    from.SendMessage("Vous commencez à fondre le métal");
                    new DelayFonte(m_owner, m_metal).Start();
                }
                else
                {
                    from.SendMessage("Ceci n'est pas adapté");
                }
            }
Пример #14
0
            protected override void OnTick()
            {
                if (m_Corpse.Deleted || m_Ghost.Deleted || m_Healer.Deleted)
                {
                    return;
                }

                if (!m_Healer.Alive)
                {
                    m_Healer.SendMessage("You were unable to finish your work before your died.");
                    return;
                }

                if (m_Healer.CheckSkill(SkillName.Healing, 40.0, 120.0))
                {
                    m_Ghost.Location = m_Corpse.Location;
                    m_Ghost.Resurrect();

                    if (m_Healer is TeiravonMobile && (((TeiravonMobile)m_Healer).IsCleric() || ((TeiravonMobile)m_Healer).IsDarkCleric() || ((TeiravonMobile)m_Healer).IsForester() || ((TeiravonMobile)m_Healer).IsPaladin()))
                    {
                        Titles.AwardExp((TeiravonMobile)(m_Healer), m_Ghost.Fame);
                    }
                    Titles.AwardFame(m_Ghost, -(m_Ghost.Fame / 15), true);
                    m_Corpse.Open(m_Ghost, true);
                    m_Ghost.Animate(m_Ghost.Body == 17 ? 2 : 21, 4, 1, false, false, 0);
                    m_Ghost.Emote("*Gasps back to life!*");
                    m_Ghost.PlaySound(m_Ghost.Female ? 0x319 : 0x429);
                    m_Healer.SendMessage("You revive the fallen!");
                    Titles.AwardFame(m_Healer, m_Ghost.Fame / 20, true);
                }
                else
                {
                    m_Healer.SendMessage("You were unable to revive the body.");
                }
            }
Пример #15
0
        public override bool OnEquip(Mobile from)
        {
            if (bond == 0)                                     //Check to see if bound to a serial.
            {
                bond      = from.Serial;                       //Bind to a serial on first time equiped.
                this.Name = from.Name.ToString() + "的" + Name; //Change item name and add who it is bound to. "Player's Soul Sword"
                from.Emote("*" + from.Name + " feels a weird energy overwhelming their body*");
                from.PlaySound(0x653);
                from.FixedParticles(0x375A, 1, 17, 0x7DA, 63, 0x3, EffectLayer.Waist);

                base.OnEquip(from);
                return(true);             //Allow it to bind to the first player to equip it after creation.
                                          //Will show in [props as ParentEntity and RootParentEntitty as [m] Serial, "Player Name"
            }
            else if (bond == from.Serial) //Check to see if sword is bound to who is equiping it.
            {
                from.FixedParticles(0x375A, 1, 17, 0x7DA, 60, 0x3, EffectLayer.Waist);
                base.OnEquip(from);
                return(true); //Allow player who had bound to sword to equip it.
            }
            else
            {
                from.SendMessage("The Halberd refuses your soul");
                return(false); //Disallow any one else from equiping the sword.
            }
        }
Пример #16
0
            protected override void OnTarget(Mobile from, object obj)
            {
                int itemID = 0;

                if (obj is Item)
                {
                    itemID = ((Item)obj).ItemID;
                }
                else if (obj is StaticTarget)
                {
                    itemID = ((StaticTarget)obj).ItemID & 0x3FFF;
                }

                bool canPlanche = ((itemID >= 4117 && itemID <= 4126) || (itemID >= 4191 && itemID <= 4198));


                if (canPlanche)
                {
                    //BaseCompetence.Wait( m_owner, 7.0 );
                    from.Emote("*Tisse*");
                    from.SendMessage("Vous commencez à tisser");
                    new DelayPlanche(m_owner, m_metal).Start();
                }
                else
                {
                    from.SendMessage("Ceci n'est pas adapté");
                }
            }
Пример #17
0
 static void Congratulate(Mobile m)
 {
     m.Emote("*donates an item*");
     m.PlaySound(m.Female ? 823 : 1097);
     m.PlaySound(1051);
     m.SendMessage(67, "Thanks for your donation!");
 }
Пример #18
0
 public void wakeUp()
 {
     m_AFK.Remove(who.Serial.Value);
     who.Emote("*n'est plus AFK*");
     who.SendMessage("AFK désactivé.");
     this.Stop();
 }
Пример #19
0
		public static bool CheckSpellEvasion( Mobile defender )
		{
			BaseWeapon weap = defender.FindItemOnLayer( Layer.OneHanded ) as BaseWeapon;

			if ( weap == null )
				weap = defender.FindItemOnLayer( Layer.TwoHanded ) as BaseWeapon;

			if ( Core.ML ) {
				if ( defender.Spell != null && defender.Spell.IsCasting ) {
					return false;
				}
				
				if ( weap != null ) {
					if ( defender.Skills[weap.Skill].Base < 50  ) {
						return false;
					}
				} else if ( !( defender.FindItemOnLayer( Layer.TwoHanded ) is BaseShield ) ) {
					return false;
				}
			}
			
			if ( IsEvading( defender ) && BaseWeapon.CheckParry( defender ) ) {
				defender.Emote( "*evades*" ); // Yes.  Eew.  Blame OSI.
				defender.FixedEffect( 0x37B9, 10, 16 );
				return true;
			}

			return false;
		}
Пример #20
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Mobile)
                {
                    from.CloseGump(typeof(DressingGump));
                    from.SendGump(new DressingCommand.DressingGump(from));
                    return;
                }

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

                    if (item != null && AllowThis(from, item) && Dressing.Method.ContainsKey(from))
                    {
                        Timer timer = new DressTimer(from, (Container)item);
                        timer.Start();
                        from.Emote("*equip up*");
                    }
                    else
                    {
                        from.CloseGump(typeof(DressingGump));
                        from.SendGump(new DressingCommand.DressingGump(from));
                    }
                }
            }
Пример #21
0
 private bool checkReflexe(Mobile m)
 {
     if (m is NubiaMobile)
     {
         NubiaMobile mob  = m as NubiaMobile;
         int         roll = DndHelper.rollDe(De.vingt);
         roll += mob.getBonusReflexe(SortEnergie.Piege);
         if (m is NubiaPlayer)
         {
             if (((NubiaPlayer)mob).hasDon(DonEnum.SensPieges))
             {
                 roll += ((NubiaPlayer)mob).getDonNiveau(DonEnum.SensPieges);
             }
         }
         if (roll >= mDD)
         {
             m.Emote("*Evite le piège*");
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
Пример #22
0
        public override void OnDoubleClick(Mobile from)
        {
            base.OnDoubleClick(from);
            if (from != null && from.Backpack != null)
            {
                Bandage b = null;
                foreach (Item item in from.Backpack.Items)
                {
                    if (item is Bandage)
                    {
                        b = item as Bandage;
                        break;
                    }
                }
                if (b != null)
                {
                    from.Emote("*impregne un bandage du baume*");

                    from.Backpack.AddItem(new BandageBaume());
                    b.Consume();
                    Delete();
                }
                from.SendMessage("Vous devez avoir un bandage propre pour l'utiliser");
            }
        }
Пример #23
0
            protected override void OnTarget(Mobile from, object obj)
            {
                int itemID = 0;

                if (obj is Item)
                {
                    itemID = ((Item)obj).ItemID;
                }
                else if (obj is StaticTarget)
                {
                    itemID = ((StaticTarget)obj).ItemID & 0x3FFF;
                }

                bool canPlanche = (itemID >= 6641 && itemID <= 6648);


                if (canPlanche)
                {
                    from.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds(8.0);
                    from.Emote("*Travail du bois*");
                    from.SendMessage("Vous commencez à travailler le bois");
                    new DelayPlanche(m_owner, m_bois).Start();
                }
                else
                {
                    from.SendMessage("Ceci n'est pas adapté");
                }
            }
Пример #24
0
        public static void OnPickedInstrument(Mobile from, BaseInstrument instrument)
        {
            XmlMusic xm = (XmlMusic)XmlAttach.FindAttachment(from, typeof(XmlMusic));

            if (xm == null)
            {
                XmlAttach.AttachTo(from, new XmlMusic());
                xm = (XmlMusic)XmlAttach.FindAttachment(from, typeof(XmlMusic));
            }

            if (!instrument.IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                 //This must be in your backpack
            }
            else if (instrument is Tambourine || instrument is TambourineTassel)
            {
                from.SendMessage("You cannot play a tune on that instrument.");
                BaseInstrument.SetInstrument(from, null);
            }
            else if (!xm.Playing)             // If this is a new tune, create a new timer and start it.
            {
                from.Emote("*plays a tune*"); // Player emotes to indicate they are playing
                xm.Playing = true;
                MobilePlayTimer pt = new MobilePlayTimer(from, instrument);
                pt.Start();
            }
        }
Пример #25
0
 public override void OnClick()
 {
     if (m_Entry == 1)
     {
         m_From.Emote("*knocks on the door*");
         m_From.PlaySound(0x36A);
     }
 }
Пример #26
0
        public void DoShackle(Mobile from, Mobile m)
        {
            TeiravonMobile m_Player = from as TeiravonMobile;

            from.Emote("*Tries to place heavy shackles on {0}*", m.Name);
            m_Apply = new ApplyTimer(m_Player, m, this);
            m_Apply.Start();
        }
 public BuildTimer(Mobile from, BallistaEastAddonDeed deed) : base(TimeSpan.FromSeconds(60.0))
 {
     m_Mobile = from;
     m_deed   = deed;
     m_Mobile.SendMessage("You begin assembling the ballista.");
     m_Mobile.Emote("{0} begins assembling a ballista", m_Mobile.Name);
     m_Mobile.Frozen = false;
 }
Пример #28
0
 public void Carve(Mobile from, Item item)
 {
     if (!this.Movable)
     {
         n_Timer = new CarveTimer(from, this);
         n_Timer.Start();
         from.Emote("*Starts to cut up the net*");
     }
 }
 public DestroyTimer(Mobile from, BallistaEastAddon ballista) : base(TimeSpan.FromSeconds(60.0))
 {
     m_Mobile        = from;
     weapon          = (BaseWeapon)ballista.Controller;
     m_ballista      = ballista;
     m_Mobile.Frozen = true;
     m_Mobile.SendMessage("You begin working to destroy the ballista!");
     m_Mobile.Emote("{0} begins destroying the ballista", m_Mobile.Name);
 }
Пример #30
0
 protected override void OnTarget(Mobile from, object o)
 {
     if (o is Mobile)
     {
         Mobile hurt = o as Mobile;
         hurt.ApplyPoison(source, Poison.GetPoison(3));
         hurt.Emote("You see {0} gets poisoned by {1}'s Whip", hurt.Name, source.Name);
     }
 }
Пример #31
0
 public override void OnDoubleClick(Mobile from)
 {
     if (Parent != from)
     {
         if (from.AccessLevel < AccessLevel.GameMaster)
         {
             from.SendMessage("When you touch, it vanishes without trace...");
         }
     }
     if (from.AccessLevel < AccessLevel.GameMaster)
     {
         this.Consume();
     }
     if (from.AccessLevel < AccessLevel.GameMaster)
     {
         return;
     }
     {
         if (!IsChildOf(from.Backpack))
         {
             from.Say("That must be in your pack for you to use it");
             return;
         }
         if (!from.Hidden == true)
         {
             from.Emote("*" + from.Name + " disapears in a rage of magical fury*");
             from.FixedParticles(0x376A, 1, 31, 9961, 1160, 0, EffectLayer.Waist);
             from.FixedParticles(0x37C4, 1, 31, 9502, 43, 2, EffectLayer.Waist);
             from.PlaySound(0x20F);
             from.PlaySound(0x338);
             from.Hidden = true;
         }
         else
         {
             from.Hidden = false;
             from.Emote("*" + from.Name + " apears in a rage of magical fury*");
             from.FixedParticles(0x376A, 1, 31, 9961, 1160, 0, EffectLayer.Waist);
             from.FixedParticles(0x37C4, 1, 31, 9502, 43, 2, EffectLayer.Waist);
             from.PlaySound(0x20F);
             from.PlaySound(0x338);
         }
     }
 }
Пример #32
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (!(targeted is Mobile))
                {
                    return;
                }
                Mobile pm = targeted as Mobile;

                pm.Emote("*" + m_textstring + "*");
            }
Пример #33
0
        public static bool CheckSpellEvasion( Mobile defender )
        {
            if( IsEvading( defender ) && VerifyCast( defender, false ) && BaseWeapon.CheckParry( defender ) ) //As per OSI, uses the exact same parry code
            {
                defender.Emote( "*evades*" );	//Yes.  Eew.  Blame OSI.
                defender.FixedEffect( 0x37B9, 10, 16 );
                return true;
            }

            return false;
        }
Пример #34
0
        public static bool CheckSpellEvasion(Mobile defender)
        {
            if (IsEvading(defender) && VerifyCast(defender, false) && BaseWeapon.CheckParry(defender))                     // As per OSI, uses the exact same parry code
            {
                defender.Emote("*evades*");
                defender.FixedEffect(0x37B9, 10, 16);
                return(true);
            }

            return(false);
        }
Пример #35
0
 public override void OnDoubleClick(Mobile from)
 {
     if (Parent != from)
     {
         if (from.AccessLevel < AccessLevel.GameMaster)
         {
             from.SendMessage("When you touch, it vanishes without trace...");
         }
     }
     if (from.AccessLevel < AccessLevel.GameMaster)
     {
         this.Consume();
     }
     if (from.AccessLevel < AccessLevel.GameMaster)
     {
         return;
     }
     {
         if (!IsChildOf(from.Backpack))
         {
             from.Say("That must be in your pack for you to use it");
             return;
         }
         if (!from.Hidden == true)
         {
             from.Emote("*" + from.Name + " withers away to nothing but the wind around you*");
             from.FixedParticles(0x37CC, 1, 40, 97, 3, 9917, EffectLayer.Waist);
             from.FixedParticles(0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255);
             from.PlaySound(0x1FB);
             from.Hidden = true;
         }
         else
         {
             from.Hidden = false;
             from.Emote("*" + from.Name + " steps out from a ice cold wirlwind*");
             from.FixedParticles(0x37CC, 1, 40, 97, 3, 9917, EffectLayer.Waist);
             from.FixedParticles(0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255);
             from.PlaySound(0x10B);
         }
     }
 }
Пример #36
0
		public override void OnDoubleClick( Mobile from ) 
      { 
      
      if ( Parent != from ) 
      if (from.AccessLevel < AccessLevel.GameMaster)
          from.SendMessage( "When you touch, it vanishes without trace..." );
      if (from.AccessLevel < AccessLevel.GameMaster)
      	  this.Consume() ;
      if (from.AccessLevel < AccessLevel.GameMaster)
      	  return ;
      {
         if ( !IsChildOf( from.Backpack ) )
			{
				from.Say ( "That must be in your pack for you to use it" );
				return;
			}           	 
      	 if ( !from.Hidden == true )
            { 
           from.Emote( "*" + from.Name + "* Disapears in a rage of magical fury *" );
           from.FixedParticles(0x376A, 1, 31, 9961, 1160, 0, EffectLayer.Waist );
           from.FixedParticles( 0x37C4, 1, 31, 9502, 43, 2, EffectLayer.Waist );
           from.PlaySound( 0x20F );
           from.PlaySound( 0x44A );
	       from.Hidden = true;
           
            } 
            else 
            { 
           from.Hidden=false;
           from.Emote( "*" + from.Name + "* Apears in a rage of magical fury  *");
             from.FixedParticles(0x376A, 1, 31, 9961, 1160, 0, EffectLayer.Waist );
           from.FixedParticles( 0x37C4, 1, 31, 9502, 43, 2, EffectLayer.Waist );
           from.PlaySound( 0x20F );
           from.PlaySound(0x44A );
                      
            } 
      } 

      
      } 
Пример #37
0
        public override void OnDoubleClick(Mobile from)
        {

            if (Parent != from)
                if (from.AccessLevel < AccessLevel.GameMaster)
                    from.SendMessage("When you touch, it vanishes without trace...");
            if (from.AccessLevel < AccessLevel.GameMaster)
                this.Consume();
            if (from.AccessLevel < AccessLevel.GameMaster)
                return;
            {
                if (!IsChildOf(from.Backpack))
                {
                    from.Say("That must be in your pack for you to use it");
                    return;
                }
                if (!from.Hidden == true)
                {
                    from.Emote("*" + from.Name + " expands into a mist a floats away*");
                    from.FixedParticles(0x375A, 1, 17, 9919, 33, 7, EffectLayer.Waist);
                    from.FixedParticles(0x3728, 1, 13, 9502, 33, 7, (EffectLayer)255);
                    from.PlaySound(0x175);
                    from.Hidden = true;

                }
                else
                {
                    from.Hidden = false;
                    from.Emote("*" + from.Name + " pulls together in front of you from the air*");
                    from.FixedParticles(0x375A, 1, 17, 9919, 33, 7, EffectLayer.Waist);
                    from.FixedParticles(0x3728, 1, 13, 9502, 33, 7, (EffectLayer)255);
                    from.PlaySound(0x175);

                }
            }


        }
Пример #38
0
        public override void OnDoubleClick(Mobile from)
        {

            if (Parent != from)
                if (from.AccessLevel < AccessLevel.GameMaster)
                    from.SendMessage("When you touch, it vanishes without trace...");
            if (from.AccessLevel < AccessLevel.GameMaster)
                this.Consume();
            if (from.AccessLevel < AccessLevel.GameMaster)
                return;
            {
                if (!IsChildOf(from.Backpack))
                {
                    from.Say("That must be in your pack for you to use it");
                    return;
                }
                if (!from.Hidden == true)
                {
                    from.Emote("*" + from.Name + " evaporates into a watery mist*");
                    from.FixedParticles(0x3709, 1, 30, 9965, 5, 7, EffectLayer.Waist);
                    from.FixedParticles(0x376A, 1, 30, 9502, 5, 3, EffectLayer.Waist);
                    from.PlaySound(0x244);
                    from.Hidden = true;

                }
                else
                {
                    from.Hidden = false;
                    from.Emote("*" + from.Name + " retakes shape from the magical watery mist*");
                    from.FixedParticles(0x3709, 1, 30, 9965, 5, 7, EffectLayer.Waist);
                    from.FixedParticles(0x376A, 1, 30, 9502, 5, 3, EffectLayer.Waist);
                    from.PlaySound(0x244);

                }
            }


        }
Пример #39
0
		public override void OnDoubleClick( Mobile from ) 
      { 
      
      if ( Parent != from ) 
      if (from.AccessLevel < AccessLevel.GameMaster)
          from.SendMessage( "When you touch, it vanishes without trace..." );
      if (from.AccessLevel < AccessLevel.GameMaster)
      	  this.Consume() ;
      if (from.AccessLevel < AccessLevel.GameMaster)
      	  return ;
      {
         if ( !IsChildOf( from.Backpack ) )
			{
				from.Say ( "That must be in your pack for you to use it" );
				return;
			}           	 
      	 if ( !from.Hidden == true )
            { 
           from.Emote( "*" + from.Name + "* Withers away to nothing But the wind around you *" );
           from.FixedParticles( 0x37CC, 1, 40, 97, 3, 9917, EffectLayer.Waist );
           from.FixedParticles( 0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255 );
           from.PlaySound( 0x1FB );
	       from.Hidden = true;
           
            } 
            else 
            { 
           from.Hidden=false;
           from.Emote( "*" + from.Name + "* Steps out From A Ice cold wirlwind  *");
           from.FixedParticles( 0x37CC, 1, 40, 97, 3, 9917,  EffectLayer.Waist );
           from.FixedParticles( 0x374A, 1, 15, 9502, 97, 3,  (EffectLayer)255 );
           from.PlaySound( 0x10B );
                      
            } 
      } 

      
      } 
Пример #40
0
        private static void GrabLoot(Mobile from, Container cont)
        {
            if (!from.Alive || cont == null)
                return;

            if (cont is Corpse && from == ((Corpse)cont).Owner)
            {
                Corpse corpse = (Corpse)cont;

                if (corpse.Killer == null || corpse.Killer is BaseCreature)
                    corpse.Open(from, true);
                else
                    corpse.Open(from, false);
            }
            else
            {
                bool fullPack = false;
                List<Item> items = new List<Item>(cont.Items);
                LootOptions options = LootGrab.GetOptions(from);

                for (int i = 0; !fullPack && i < items.Count; i++)
                {
                    Item item = items[i];

                    if (options.IsLootable(item))
                    {
                        Container dropCont = options.GetPlacementContainer(LootGrab.ParseType(item));

                        if (dropCont == null || dropCont.Deleted || !dropCont.IsChildOf(from.Backpack))
                            dropCont = from.Backpack;

                        if (!item.DropToItem(from, dropCont, new Point3D(-1, -1, 0)))
                            fullPack = true;

                        if (options.IsToken(item))
                            from.Emote("*loots a few shiny tokens*");
                    }
                }

                if (fullPack)
                    from.SendMessage("You looted as much as you could. The rest remain {0}.", (cont is Corpse ? "on the corpse" : "in the container"));
                else
                    from.SendMessage("You loot all you can from the {0}.", (cont is Corpse ? "corpse" : "container"));

                from.Animate(32, 5, 1, true, false, 0);
                from.PlaySound(79);
                from.RevealingAction();
            }
            UseDelaySystem.AddContext(from, DelayContextType.LootCommand, TimeSpan.FromSeconds(3.0)); //edit timer here, dont forget reference in usedelaysystem.cs!
        }
Пример #41
0
        public override void OnDoubleClick(Mobile from)
        {

            if (Parent != from)
                if (from.AccessLevel < AccessLevel.GameMaster)
                    from.SendMessage("When you touch, it vanishes without trace...");
            if (from.AccessLevel < AccessLevel.GameMaster)
                this.Consume();
            if (from.AccessLevel < AccessLevel.GameMaster)
                return;
            {
                if (!IsChildOf(from.Backpack))
                {
                    from.Say("That must be in your pack for you to use it");
                    return;
                }
                if (!from.Hidden == true)
                {
                    from.Emote("*" + from.Name + " burned itself*");
                    from.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot);
                    from.PlaySound(0x225);
                    from.Hidden = true;

                }
                else
                {
                    from.Hidden = false;
                    from.Emote("*" + from.Name + " showed up among flames*");
                    from.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot);
                    from.PlaySound(0x225);


                }
            }


        }
Пример #42
0
        public static void FinalEffect( Mobile caster, Mobile target, int hold )
        {
            target.PlaySound( 0x204 );
            target.FixedParticles( 0x37C4, 1, 8, 9916, 39, 3, EffectLayer.Head );
            target.FixedParticles( 0x37C4, 1, 8, 9502, 39, 4, EffectLayer.Head );

            if( caster != null )
                target.Emote( "*was paralyzed by " + caster.Name + "*" );

            if (((IKhaerosMobile)target).StunnedTimer != null)
                ((IKhaerosMobile)target).StunnedTimer.Stop();

            ((IKhaerosMobile)target).StunnedTimer = new HoldPersonTimer(target, hold);
            ((IKhaerosMobile)target).StunnedTimer.Start();
        }
Пример #43
0
        public override void OnDoubleClick(Mobile from)
        {

            if (Parent != from)
                if (from.AccessLevel < AccessLevel.GameMaster)
                    from.SendMessage("When you touch, it vanishes without trace...");
            if (from.AccessLevel < AccessLevel.GameMaster)
                this.Consume();
            if (from.AccessLevel < AccessLevel.GameMaster)
                return;
            {
                if (!IsChildOf(from.Backpack))
                {
                    from.Say("That must be in your pack for you to use it");
                    return;
                }
                if (!from.Hidden == true)
                {
                    from.Emote("*" + from.Name + " explodes out*");
                    from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                    from.PlaySound(0x307);
                    from.Hidden = true;

                }
                else
                {
                    from.Hidden = false;
                    from.Emote("*" + from.Name + " explodes in*");
                    from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                    from.PlaySound(0x307);

                }
            }


        }
Пример #44
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( !from.InRange( GetWorldLocation(), 2 ) )
				from.SendLocalizedMessage( 500446 );
			else if ( Apply( from ) )
			{
				from.FixedEffect( 0x3728, 10, 15 );
				from.PlaySound( 1002 );

				from.SendMessage(1276, "You feel AMAZING!");
				new PowerTimer( from, this ).Start();

				from.Emote( String.Format( "* {0} FLARES IN POWER *" , from.Name ) );
				Delete();
			}
		}
Пример #45
0
        public virtual bool AvoidedDamage( Mobile attacker, Mobile defender, ref double damageBonus  )
        {
            PlayerMobile attplayer = attacker as PlayerMobile;
            PlayerMobile defplayer = defender as PlayerMobile;

            if( ((IKhaerosMobile)defender).CanDodge &&  ( !defender.Mounted || Utility.RandomMinMax(1,100) < GetRacialMountAbility(defender, typeof(ForestStrider))))
            {
                if( ((IKhaerosMobile)defender).Dodged() )
                {
                    defender.Emote( "*skillfully dodged a blow from {0}*", attacker.Name );
                    return true;
                }

                if( attacker.Weapon is BaseRanged && ((IKhaerosMobile)defender).Snatched() )
                {
                    defender.Emote( "*snatched a projectile shot at {0} by {1}*", defender.Female == true ? "her" : "him", attacker.Name );
                    return true;
                }
            }

            if (attacker.Weapon is BaseRanged && Utility.RandomMinMax(1, 100) < GetRacialMountAbility(defender, typeof(Ridgeraptor)))
            {
                defender.Emote("*uses {0} ridgeraptor's ridge to deflect a projectile shot at {1} by {2}*", defender.Female == true ? "her" : "his", defender.Female == true ? "her" : "him", attacker.Name);
                return true;
            }

            if( attacker.Weapon is BaseRanged && ((IKhaerosMobile)defender).DeflectedProjectile() )
            {
                defender.Emote( "*uses {0} shield to deflect a projectile shot at {1} by {2}*", defender.Female == true ? "her" : "his", defender.Female == true ? "her" : "him", attacker.Name );
                return true;
            }

            if( defender is PlayerMobile )
            {
                if( Utility.Random( 1, 100 ) == defplayer.GetBackgroundLevel(BackgroundList.Lucky) )
                    return true;

                if( Utility.Random( 1, 100 ) == defplayer.GetBackgroundLevel(BackgroundList.Unlucky) )
                    damageBonus += 1.0;
            }

            if( attacker is PlayerMobile )
            {
                if( Utility.Random( 1, 100 ) == attplayer.GetBackgroundLevel(BackgroundList.Lucky) )
                    damageBonus += 1.0;

                if( Utility.Random( 1, 100 ) == attplayer.GetBackgroundLevel(BackgroundList.Unlucky) )
                    return true;
            }

            return false;
        }
Пример #46
0
        public void CheckForInvalidStance( Mobile attacker )
        {
            IKhaerosMobile featuser = attacker as IKhaerosMobile;
            bool disable = false;

            if( !(this is BaseRanged) && !featuser.Stance.Melee )
                disable = true;

            if( this is BaseRanged && !featuser.Stance.Ranged )
                disable = true;

            if( !featuser.Stance.Armour && !featuser.CanUseMartialStance )
                disable = true;

            if( disable )
            {
                if( attacker is PlayerMobile )
                    attacker.Emote( featuser.Stance.TurnedOffEmote );

                featuser.Stance = null;
            }
        }
Пример #47
0
        public virtual void OnHit( Mobile attacker, Mobile defender, double damageBonus, bool splashAttack )
        {
            if (defender is IKhaerosMobile)
            {
                if (((IKhaerosMobile)defender).ShieldValue <= 0)
                {
                    ((IKhaerosMobile)defender).RemoveShieldOfSacrifice();
                }
                else if (((IKhaerosMobile)defender).ShieldingMobile != null && !((IKhaerosMobile)defender).ShieldingMobile.Deleted && ((IKhaerosMobile)defender).ShieldingMobile.Alive)
                {
                    ((IKhaerosMobile)defender).ShieldValue--;
                    defender = ((IKhaerosMobile)defender).ShieldingMobile;
                }
            }

            BaseWeapon atkWeapon = attacker.Weapon as BaseWeapon;
            BaseWeapon defWeapon = defender.Weapon as BaseWeapon;

            Skill atkSkill = attacker.Skills[atkWeapon.Skill];
            Skill defSkill = defender.Skills[defWeapon.Skill];
            bool thrown = (((IKhaerosMobile)attacker).OffensiveFeat == FeatList.ThrowingMastery );

            //PlaySwingAnimation( attacker );

            if(  ( atkWeapon is BaseRanged || ((IKhaerosMobile)attacker).OffensiveFeat == FeatList.ThrowingMastery ) && AvoidedDamage( attacker, defender, ref damageBonus ) )
                return;

            //PlayHurtAnimation( defender );

            /*if( ((IKhaerosMobile)attacker).OffensiveFeat == FeatList.ShieldBash )
                attacker.PlaySound( 0x3AC );

            else
                attacker.PlaySound( GetHitAttackSound( attacker, defender ) );

            defender.PlaySound( GetHitDefendSound( attacker, defender ) );*/

            if ( !splashAttack && ((IKhaerosMobile)attacker).OffensiveFeat != FeatList.ShieldBash )
                CombatSystemAttachment.PlayHitSound( attacker, defender );

            int damage = (int)((splashAttack ? 0.4 : 1.0)*(damageBonus*ComputeDamage( attacker, defender )));

            if ( attacker is BaseCreature )
                ((BaseCreature)attacker).AlterMeleeDamageTo( defender, ref damage );

            if ( defender is BaseCreature )
                ((BaseCreature)defender).AlterMeleeDamageFrom( attacker, ref damage );

            damage = AbsorbDamage( attacker, defender, damage );

            if ( damage < 0 )
                damage = 0;

            if ( damage > 0 && !splashAttack )
            {
                if ( attacker.Weapon != null )
                {
                    OilAttachment attachment = XmlAttach.FindAttachment( attacker.Weapon, typeof( OilAttachment ) ) as OilAttachment;
                    if ( attachment != null )
                        attachment.OnWeaponHit( defender, attacker );
                }
            }

            if ( !splashAttack )
                AddBlood( attacker, defender, damage );

            bool shieldbash = (((IKhaerosMobile)attacker).OffensiveFeat == FeatList.ShieldBash);
            int phys, fire, cold, pois, nrgy, blut, slax, pirc;

            GetDamageTypes( attacker, out phys, out fire, out cold, out pois, out nrgy, out blut, out slax, out pirc );

            //Technique Mod: changing the damage type to slashing or piercing and lowering blunt damage based on that.
            if( attacker is PlayerMobile && ( (PlayerMobile)attacker ).Claws != null )
            {
                blut = 0;
                slax = 80;
                pirc = 20;
            }

            if( attacker.Weapon is Fists && attacker is IKhaerosMobile && ((IKhaerosMobile)attacker).TechniqueLevel > 0 )
            {
                if( ((IKhaerosMobile)attacker).Technique == "slashing" )
                    slax = ((IKhaerosMobile)attacker).TechniqueLevel;
                else if( ((IKhaerosMobile)attacker).Technique == "piercing" )
                    pirc = ((IKhaerosMobile)attacker).TechniqueLevel;

                blut -= ((IKhaerosMobile)attacker).TechniqueLevel;
            }
            //End Technique Mod

            int damageGiven = damage;
            bool ignoreArmor = false;

            if ( !splashAttack )
            {
                if( ((IKhaerosMobile)attacker).OffensiveFeat != FeatList.None )
                {
                    if( defender is BaseCreature && ( (BaseCreature)defender ).ManeuverResistance > Utility.RandomMinMax( 1, 100 ) )
                        attacker.SendMessage( defender.Name + " resisted your attack." );

                    else
                        ((IKhaerosMobile)attacker).CombatManeuver.OnHit( attacker, defender );

                    ((IKhaerosMobile)attacker).OffensiveFeat = FeatList.None;
                }
            }

            int damageignore = 0;

            if( defender is PlayerMobile )
            {
                damageignore += ( (PlayerMobile)defender ).Feats.GetFeatLevel(FeatList.DamageIgnore);
                damageignore += ( (PlayerMobile)defender ).Martyrs;
                damageignore += ( (PlayerMobile)defender ).BloodOfXorgoth == null ? 0 : 3;
                int plateMastery = ( (PlayerMobile)defender ).Feats.GetFeatLevel(FeatList.PlateMastery);

                if( plateMastery > 0 )
                    damageignore += (int)(( (PlayerMobile)defender ).HeavyPieces * ( 0.5 + ( 0.25 * plateMastery ) ));

                int rangedDefense = ( (PlayerMobile)defender ).Feats.GetFeatLevel(FeatList.RangedDefense);

                if (this is BaseRanged && rangedDefense > 0)
                    if (Utility.RandomMinMax(1, 100) < (3 * rangedDefense * (defender as PlayerMobile).MediumPieces))
                        damageignore += ((defender as PlayerMobile).MediumPieces * (rangedDefense * Utility.RandomMinMax(1, 10)));

                if (defender.FindItemOnLayer(Layer.TwoHanded) is BaseShield &&
                    (defender.FindItemOnLayer(Layer.TwoHanded) as BaseShield).ArmourType == ArmourWeight.Heavy &&
                    this is BaseRanged)
                    damageignore += (defender.ShieldArmor as BaseShield).BasePiercingResistance / 10;

                if( ((IKhaerosMobile)attacker).RageFeatLevel > 3 )
                    damageignore += ((IKhaerosMobile)attacker).RageFeatLevel - 3;

                damageignore += GetRacialMountFeatBonus(defender, typeof(WarHorse));
            }

            IKhaerosMobile defkm = defender as IKhaerosMobile;

            if ( defender.Mounted )
            {
                if ( defkm.Feats.GetFeatLevel(FeatList.MountedDefence) > 0 )
                {
                    Mobile mount = defender.Mount as Mobile;
                    if ( mount != null && (((double)mount.Hits)/((double)mount.HitsMax)) >= ((double)(15+defkm.Feats.GetFeatLevel(FeatList.MountedDefence)*20))/100.0)
                    {
                        int amt = (int)(damage*0.05*defkm.Feats.GetFeatLevel(FeatList.MountedDefence));
                        damageignore += amt;
                        mount.Hits -= amt;
                        if ( defender is PlayerMobile )
                            ((PlayerMobile)defender).MountedDefenceIconRefresh();
                    }
                }
            }

            int finaldamage = Math.Max( damage - damageignore, 0 );

            if ( finaldamage < 0 )
                finaldamage = 0;

            if ( attacker is PlayerMobile && ((PlayerMobile)attacker).Spar && !(this is BaseRanged) &&
                !thrown )
            {
                finaldamage = 1;
                ignoreArmor = true;
            }

            if ( shieldbash )
                damageGiven = AOS.Damage( defender, attacker, finaldamage, ignoreArmor, 0, 0, 0, 0, 0, 100, 0, 0 ); // blunt all the way
            else if ( !splashAttack )
                damageGiven = AOS.Damage( defender, attacker, finaldamage, ignoreArmor, 0, fire, cold, pois, nrgy, blut, slax, pirc );
            else
            {
                damageGiven = AOS.Damage( defender, attacker, finaldamage, ignoreArmor, 0, 0, 0, 0, 0, 100, 0, 0 ); // blunt all the way
                return; // we're done here for splash attacks
            }

            if (splashAttack)
            {
                if (Utility.RandomMinMax(1,100) < GetRacialMountAbility(attacker, typeof(DireBear)))
                {
                    damageGiven += (int) (damageGiven * (double)(0.01 * GetRacialMountAbility(attacker, typeof(DireBear))));
                }
            }

            if (!splashAttack)
            {

                if (defender is PlayerMobile && Utility.RandomMinMax(1, 200) < GetRacialMountAbility(defender, typeof(WarHorse)))
                    if ((defender as PlayerMobile).Feats.GetFeatLevel(FeatList.PlateMastery) > 0)
                        if ((defender.Mount as BaseMount).BodyValue == 284)
                        {
                            damageGiven -= (int)(damageGiven * ((0.01 * GetRacialMountAbility(defender, typeof(WarHorse)))));
                            defender.Emote(attacker.Name + "'s attack glances off " + (defender.Female ? "her" : "his") + " horse's barding*");
                        }
            }

            if (splashAttack)
            {
                if (Utility.RandomMinMax(1, 100) < GetRacialMountAbility(defender, typeof(GiantScarab)))
                {
                    damageGiven = 0;
                    defender.Emote("*defends " + (defender.Female ? "herself" : "himself") + " using the scarab's plated wings*");
                }
            }

            XmlOnWeaponHit( attacker, defender, damageGiven );

            if (HealthAttachment.HasHealthAttachment(defender) && HealthAttachment.GetHA(defender).HasInjury(Injury.Bruised))
                HealthAttachment.GetHA(defender).DoInjury(Injury.Bruised);

            if( defender.Alive && ((defender is PlayerMobile && ((PlayerMobile)defender).IsVampire) ||
                                   (defender is BaseCreature && defender is IUndead)) && HolyWaterPower > 0 )
                SpellHelper.Damage( TimeSpan.Zero, defender, attacker, HolyWaterPower, 100, 0, 0, 0, 0 );

            if( !defender.CheckSkill( SkillName.Concentration, ((defender.Skills[SkillName.Concentration].Base - finaldamage) * 0.01) ) )
                ((IKhaerosMobile)defender).Fizzled = true;

            if(Utility.RandomBool())
                DegradeWeapon();

            if (this.Type == WeaponType.Bashing && Utility.RandomBool())
            {
                if (defender.FindItemOnLayer(Layer.TwoHanded) != null &&
                    !defender.FindItemOnLayer(Layer.TwoHanded).Deleted &&
                    defender.FindItemOnLayer(Layer.TwoHanded) is BaseShield &&
                    (defender.FindItemOnLayer(Layer.TwoHanded) as BaseShield).ArmourType == ArmourWeight.Heavy)
                        (defender.FindItemOnLayer(Layer.TwoHanded) as BaseShield).DegradeArmor(1);
                else
                {
                    int armor = Utility.RandomMinMax(1, 9);
                    BaseArmor ar = null;

                    switch (armor)
                    {
                        case 1: if (defender.FindItemOnLayer(Layer.Helm) != null) ar = (defender.FindItemOnLayer(Layer.Helm) as BaseArmor); break;
                        case 2: if (defender.FindItemOnLayer(Layer.Neck) != null) ar = (defender.FindItemOnLayer(Layer.Neck) as BaseArmor); break;
                        case 3: if (defender.FindItemOnLayer(Layer.Arms) != null) ar = (defender.FindItemOnLayer(Layer.Arms) as BaseArmor); break;
                        case 4: if (defender.FindItemOnLayer(Layer.InnerTorso) != null) ar = (defender.FindItemOnLayer(Layer.InnerTorso) as BaseArmor); break;
                        case 5: if (defender.FindItemOnLayer(Layer.MiddleTorso) != null) ar = (defender.FindItemOnLayer(Layer.MiddleTorso) as BaseArmor); break;
                        case 6: if (defender.FindItemOnLayer(Layer.OuterTorso) != null) ar = (defender.FindItemOnLayer(Layer.OuterTorso) as BaseArmor); break;
                        case 7: if (defender.FindItemOnLayer(Layer.InnerLegs) != null) ar = (defender.FindItemOnLayer(Layer.InnerLegs) as BaseArmor); break;
                        case 8: if (defender.FindItemOnLayer(Layer.OuterLegs) != null) ar = (defender.FindItemOnLayer(Layer.OuterLegs) as BaseArmor); break;
                        case 9: if (defender.FindItemOnLayer(Layer.Gloves) != null) ar = (defender.FindItemOnLayer(Layer.Gloves) as BaseArmor); break;
                    }

                    if ( ar != null && !ar.Deleted && ar.ArmourType == ArmourWeight.Heavy)
                        ar.DegradeArmor(1);
                }
            }

            if( attacker is BlackPudding || attacker is GelatinousBlob || attacker is JellyOoze || attacker is BoaConstrictor || attacker is ConstrictingVine || attacker is Wortling )
                if( Utility.Random( 100 ) > 30 )
                    Misc.CripplingBlow.Effect( attacker, defender, 3 );

            if ( attacker is BaseCreature )
                ((BaseCreature)attacker).OnGaveMeleeAttack( defender );

            if ( defender is BaseCreature )
                ((BaseCreature)defender).OnGotMeleeAttack( attacker );

            if( attacker is PlayerMobile && ((PlayerMobile)attacker).TouchSpell != null && defender.Alive )
            {
                ((PlayerMobile)attacker).TouchSpell.TargetMobile = defender;
                ((PlayerMobile)attacker).TouchSpell.HandleEffect( true );
                ((PlayerMobile)attacker).TouchSpell = null;
            }
        }
Пример #48
0
        public virtual void OnChew(Mobile from)
        {
            if (m_Chewable == Chewable.Qat)
                ChewTimer.BeginChew(from as PlayerMobile, 15);

            from.Emote("*chews*");

            int chewSound = Utility.RandomMinMax(58, 60);
            from.PlaySound(chewSound);

            from.SendMessage("You feel a narcotic rush.");
        }
Пример #49
0
            public static void TryFeed( Mobile from, Mobile targeted, bool forced )
            {
                if( from == null || targeted == null || !(from is PlayerMobile) || !(targeted.BodyValue == 400 || targeted.BodyValue == 401) || !from.InRange(targeted, 1) )
                    return;

                PlayerMobile m = from as PlayerMobile;

                if( !m.CanFeed )
                    return;

                if( targeted.Paralyzed && !targeted.Blessed )
                {
                    from.Emote( "*feeds on {0}*", targeted.Name );
                    from.PlaySound( 49 );
                    targeted.FixedParticles( 0x377A, 244, 25, 9950, 31, 0, EffectLayer.Head );
                    ((PlayerMobile)from).BPs += 2;
                    ((PlayerMobile)from).NextFeedingAllowed = DateTime.Now + TimeSpan.FromSeconds( 5 );

                    int damage = (1 - m.Feats.GetFeatLevel( FeatList.Feeding )) * 5;

                    if( damage > 0 )
                        targeted.Damage( damage, from );

                    foreach (DiseaseTimer timer in HealthAttachment.GetHA(targeted).CurrentDiseases)
                    {
                        if (!HealthAttachment.GetHA(m).HasDisease(timer.Disease))
                        {
                            DiseaseTimer newDis = new DiseaseTimer(m, timer.Disease);
                            HealthAttachment.GetHA(m).CurrentDiseases.Add(newDis);
                            newDis.Start();
                        }
                    }
                }

                else if( targeted is PlayerMobile && !((PlayerMobile)targeted).IsVampire && !forced )
                {
                    targeted.CloseGump( typeof(Gumps.AllowFeedingGump) );
                    targeted.SendGump( new Gumps.AllowFeedingGump(from, targeted) );
                }
            }
Пример #50
0
		public virtual void CheckBAC(Mobile from, int qty)
		{
			if (!ContainsAlchohol)
			{
				return;
			}

			int bac = 0;
			int kick = 0;
			ComputeBAC(ref bac, ref kick, qty);

			if (kick > 0)
			{
				bac += kick;

				from.SendMessage("The alcohol has a kick, making it more potent.");

				Timer.DelayCall(TimeSpan.FromSeconds(1.5), from.PlaySound, 1055);
			}

			bac = Math.Max(0, Math.Min(100, bac));

			from.BAC = Math.Max(from.BAC, Math.Min(100, from.BAC + bac));

			if (from.BAC <= 60)
			{
				return;
			}

			from.Emote("{0} looks completely smashed from the {1}", from.Name, this.ResolveName(from));

			if (ApplyPoison(from, true) == ApplyPoisonResult.Poisoned)
			{
				from.SendMessage("Your blood alcohol content is too high and you poison yourself.");
			}
		}
Пример #51
0
 public StoneTimer( Mobile m )
     : base(TimeSpan.FromSeconds( 6 ))
 {
     m_m = m;
     m.Emote( "*got temporarily petrified*" );
 }
Пример #52
0
        public override void OnGaveMeleeAttack( Mobile defender )
        {
            base.OnGaveMeleeAttack( defender );

            if( this.Hue == 12345678 )
            {
                defender.Mana -= Utility.Random( 20, 10 );
                this.ManaLeeched += 20;
                base.OnGaveMeleeAttack( defender );

                if( this.ManaLeeched >= 100 )
                {
                    defender.Emote( "*shudders as the wraith becomes corporeal*" );
                    this.Hue = 2989;
                    this.SetDamage( 25, 30 );
                }
            }

            if( this.Hue != 12345678 )
            {
                this.ManaLeeched -= 2;

                if( this.ManaLeeched <= 0 )
                {
                    defender.Emote( "*notices that the wraith became incorporeal again*" );
                    this.Hue = 12345678;
                    this.SetDamage( 4, 5 );
                }
            }
        }
Пример #53
0
        public void ExplodeItself(Mobile target)
        {
            Point3D loc = this.Location;
            Map map = this.Map;

            if (map == null)
                return;

            BombPotion pot = new BombPotion(1);

            pot.InstantExplosion = true;
            pot.ExplosionRange = 2;
            pot.AddEffect(CustomEffect.Explosion, 15);
            pot.AddEffect(CustomEffect.Fire, 3);
            pot.AddEffect(CustomEffect.Shrapnel, 10);
            pot.HeldBy = this;
            pot.PotionEffect = PotionEffect.ExplosionLesser;

            this.Say("Uh oh!");
            target.Emote("*You have triggered " + this.Name + "'s explosives!");
            this.PlaySound(519);

            pot.Explode(this, false, loc, map);
        }
Пример #54
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            if (this.GetConstrict())
            {
                int constrictChance = Utility.Random(100);
                TimeSpan constrictDuration = TimeSpan.FromSeconds(XPScale);
                double defenderConstrictResistance = (defender.RawDex / 100);
                int constrictCheck = 80;

                if (this.Level >= 50)
                    constrictCheck -= 20;
                else if (this.Level >= 40)
                    constrictCheck -= 10;
                else if (this.Level >= 30)
                    constrictCheck -= 5;

                if (constrictChance > constrictCheck && !defender.Paralyzed && this.CanUseSpecial)
                {
                    this.Emote("*attempts to coil itself around " + defender.Name + "!*");

                    if (this.Combatant is PlayerMobile && ((PlayerMobile)this.Combatant).Evaded())
                        return;
                    else if ((defenderConstrictResistance >= this.XPScale) && (constrictChance < 100))
                    {
                        defender.Emote("*escapes being constricted by " + this.Name + "!*");
                        return;
                    }
                    else
                    {
                        this.Emote("*constricts " + defender.Name + "!*");

                        if (defender is PlayerMobile)
                            ((PlayerMobile)defender).Paralyze(constrictDuration);

                        if (defender is BaseCreature)
                            ((BaseCreature)defender).Paralyze(constrictDuration);
                    }
                }
            }

            base.OnGaveMeleeAttack(defender);
        }
Пример #55
0
        public void OnSmoke( Mobile from )
        {
            if ( ContentType == ContentType.Swampweed )
                HallucinationEffect.BeginHallucinating( from as PlayerMobile, 60 );
            else if (ContentType == ContentType.Opium)
                HealthAttachment.TryTreatDisease(from, Disease.Consumption, 5);

            from.Emote( "*puffs*" );
            from.PlaySound( 1208 );
        }
Пример #56
0
			public static void DEVOURCORPSES(TriggerObject trigObject, Mobile devourer, int range, bool emote)
			{
				if (devourer == null || devourer.Deleted || devourer.Backpack == null || devourer.Map == null ||
					devourer.Map == Map.Internal)
				{
					return;
				}

				foreach (var corpse in
					devourer.GetEntitiesInRange<Corpse>(devourer.Map, range)
						.Where(
							c => c != null && !c.Deleted && !c.IsDecoContainer && !c.DoesNotDecay && !c.IsBones && c.Owner is PlayerMobile))
				{
					if (emote)
					{
						devourer.Emote("*You see {0} completely devour a corpse and its contents*", devourer.RawName);
					}

					foreach (var item in
						corpse.Items.Where(item => item != null && !item.Deleted && item.Movable && item.Visible).ToArray())
					{
						devourer.Backpack.DropItem(item);
					}

					corpse.TurnToBones();
				}
			}
Пример #57
0
        public static void PickRandomEmote( Mobile attacker, Mobile defender, int index )
        {
            if( !(attacker.Weapon is Fists) )
                return;

            IKhaerosMobile aggressor = attacker as IKhaerosMobile;
            IKhaerosMobile aggressed = defender as IKhaerosMobile;

            int number = Utility.Dice( 1, 6, 0 );

            switch( index )
            {
                case 1:
                {
                    switch( number )
                    {
                        case 1: attacker.Emote( "*grabs {0} by the head, leans back, and thrusts a devastating knee into the side of {1} ribcage*", defender.Name, aggressed.GetPossessivePronoun() ); break;
                        case 2: attacker.Emote( "*launches a series of short punches as {0} wades in, then elbows {1} in the side of {2} head*", aggressor.GetPersonalPronoun(), aggressed.GetPossessivePronoun() ); break;
                        case 3: attacker.Emote( "*switches {0} stance then fires a crippling side kick into {1}{2} thigh*", aggressor.GetPossessivePronoun(), defender.Name, aggressed.GetPossessive() ); break;
                        case 4: attacker.Emote( "*attacks with a powerful roundhouse kick to the side {0}{1} head*", defender.Name, aggressed.GetPossessive() ); break;
                        case 5: attacker.Emote( "*accepts {0}{1} blow to {2} abdomen, instead holding {3} torso down and kneeing {4} chest*", defender.Name, aggressed.GetPossessive(), aggressor.GetPossessivePronoun(), aggressed.GetPossessivePronoun(), aggressed.GetPossessivePronoun() ); break;
                        case 6: attacker.Emote( "*fires a pair of devastating crosses, then follows it up with a solid front kick to {0}{1} chest*", defender.Name, aggressed.GetPossessive() ); break;
                    }
                    break;
                }

                case 2:
                {
                    switch( number )
                    {
                        case 1: attacker.Emote( "*spins around, lashing out with {0} foot*", aggressor.GetPossessivePronoun() ); break;
                        case 2: attacker.Emote( "*steps into {0} and unleashes a high side kick at {1} chin*", defender.Name, aggressed.GetPossessivePronoun() ); break;
                        case 3: attacker.Emote( "*drops low and spins on {0} hands, sweeping {1} {2} legs*", aggressor.GetPossessivePronoun(), defender.Name, aggressor.GetPossessivePronoun() ); break;
                        case 4: attacker.Emote( "*tumbles backward onto {0} hands, unleashing a double upward kick*", aggressor.GetPossessivePronoun() ); break;
                        case 5: attacker.Emote( "*tumbles to the side onto one hand, spins around, swinging {0} heel swiftly at {1}*", aggressor.GetPossessivePronoun(), defender.Name ); break;
                        case 6: attacker.Emote( "*spins around, tripping {0} with a low kick*", defender.Name ); break;
                    }
                    break;
                }

                case 3:
                {
                    switch( number )
                    {
                        case 1: attacker.Emote( "*knees {0} in the groin*", defender.Name ); break;
                        case 2: attacker.Emote( "*launches a lumbering, devastatingly powerful hook*" ); break;
                        case 3: attacker.Emote( "*jerks forward, smashing {0} forehead into {1}{2} face*", aggressor.GetPossessivePronoun(), defender.Name, aggressed.GetPossessive() ); break;
                        case 4: attacker.Emote( "*attacks with a series of  furious blows {0}{1} lower abdomen*", defender.Name, aggressed.GetPossessive() ); break;
                        case 5: attacker.Emote( "*thrusts a forearm across {0}{1} face*", defender.Name, aggressed.GetPossessive() ); break;
                        case 6: attacker.Emote( "*fires a series of powerful, frantic jabs*" ); break;
                    }
                    break;
                }

                case 4:
                {
                    switch( number )
                    {
                        case 1: attacker.Emote( "*launches a series of straight, solid strikes to {0}{1} face and chest*", defender.Name, aggressed.GetPossessive() ); break;
                        case 2: attacker.Emote( "*widens {0} stance and pummels {1} amid a storm of circular feints*", aggressor.GetPossessivePronoun(), defender.Name ); break;
                        case 3: attacker.Emote( "*steps forward with one foot and launches a swift front kick at {0}{1} abdomen*", defender.Name, aggressed.GetPossessive() ); break;
                        case 4: attacker.Emote( "*attacks with a pair of quick jabs, then drops low, spinning into a sweep*" ); break;
                        case 5: attacker.Emote( "*attacks {0} with a hook, then reverses the momentum of the strike for a backhand blow*", defender.Name ); break;
                        case 6: attacker.Emote( "*kicks at {0}{1} head, then spins on that foot, firing a roundhouse kick with the other*", defender.Name, aggressed.GetPossessive() ); break;
                    }
                    break;
                }

                case 5:
                {
                    switch( number )
                    {
                        case 1: attacker.Emote( "*launches a series of light, calculated jabs*" ); break;
                        case 2: attacker.Emote( "*jabs {0} a few times, then follows it up with a solid cross*", defender.Name ); break;
                        case 3: attacker.Emote( "*blocks an attack with {0} curled arm and counters with a powerful hook*", aggressor.GetPossessivePronoun() ); break;
                        case 4: attacker.Emote( "*steadily paces into {0} and launches a series of furious blows to {1} abdomen*", defender.Name, aggressed.GetPossessivePronoun() ); break;
                        case 5: attacker.Emote( "*attacks with a cross, turns in to deliver a hook, then rotates his torso up for a brutal uppercut*" ); break;
                        case 6: attacker.Emote( "*launches a light jab at {0}{1} face, strikes at the abdomen, and then fires a hook*", defender.Name, aggressed.GetPossessive() ); break;
                    }
                    break;
                }

                case 6:
                {
                    switch( number )
                    {
                        case 1: attacker.Emote( "*launches a fast pair of punches at {0} and follows it with a front kick to the groin*", defender.Name ); break;
                        case 2: attacker.Emote( "*kicks {0} in the stomach, doubling {1} over, then elbows {2} in the back of the head*", defender.Name, aggressed.GetReflexivePronoun(), aggressed.GetReflexivePronoun() ); break;
                        case 3: attacker.Emote( "*sidesteps {0}{1} attack and elbows {2} in the side of the head*", defender.Name, aggressed.GetPossessive(), aggressed.GetReflexivePronoun() ); break;
                        case 4: attacker.Emote( "*grabs {0} by the shoulders, jerking {1} down and thrusting a knee into {2} chest*", defender.Name, aggressed.GetReflexivePronoun(), aggressed.GetPossessivePronoun() ); break;
                        case 5: attacker.Emote( "*leans around {0}{1} attack and thrusts an open palm into {1} face*", defender.Name, aggressed.GetPossessive(), aggressed.GetPossessivePronoun() ); break;
                        case 6: attacker.Emote( "*steps into {0} and launches an elbow at {1} face*", defender.Name, aggressed.GetPossessivePronoun() ); break;
                    }
                    break;
                }
            }
        }
Пример #58
0
            protected override void OnTarget( Mobile from, object targeted )
            {
                if( from == null || targeted == null || !(from is PlayerMobile) )
                    return;

                if( !((PlayerMobile)from).CanFeed )
                    return;

                if ( targeted is Corpse )
                {
                    Corpse corpse = targeted as Corpse;

                    if( !corpse.Channeled && corpse.Owner != null && (corpse.Owner.BodyValue == 400 || corpse.Owner.BodyValue == 401 || corpse.Owner.BodyValue == 402) )
                    {
                        from.Emote( "*sinks {0} fangs into the fallen body's neck and drains its blood*", ((PlayerMobile)from).GetPossessivePronoun() );
                        from.PlaySound( 49 );
                        ((PlayerMobile)from).BPs += 2;
                        corpse.Hue = 0;
                        ((PlayerMobile)from).NextFeedingAllowed = DateTime.Now + TimeSpan.FromSeconds( 5 );
                        Server.Spells.SpellHelper.Turn( from, corpse );
                        from.Animate( 32, 5, 1, true, false, 0 );
                        corpse.Channeled = true;
                        Effects.SendLocationParticles( corpse, 0x377A, 244, 25, 31, 0, 9550, 0 );

                        foreach(DiseaseTimer timer in HealthAttachment.GetHA(corpse.Owner).CurrentDiseases)
                        {
                            if(!HealthAttachment.GetHA(from).HasDisease(timer.Disease))
                            {
                                DiseaseTimer newDis = new DiseaseTimer(from, timer.Disease);
                                HealthAttachment.GetHA(from).CurrentDiseases.Add(newDis);
                                newDis.Start();
                            }
                        }
                    }
                }

                else if( targeted is Mobile )
                    TryFeed( from, (Mobile)targeted, false );
            }
Пример #59
0
        public override void OnGotMeleeAttack(Mobile attacker)
        {
            if (this.Map != null && attacker != this && 0.1 > Utility.RandomDouble())
            {
                if (attacker is BaseCreature)
                {
                    BaseCreature pet = (BaseCreature)attacker;
                    if (pet.ControlMaster != null && (attacker is Dragon || attacker is GreaterDragon || attacker is SkeletalDragon || attacker is WhiteWyrm || attacker is Drake))
                    {
                        this.Combatant = null;
                        pet.Combatant = null;
                        this.Combatant = null;
                        pet.ControlMaster = null;
                        pet.Controlled = false;
                        attacker.Emote(String.Format("* {0} decided to go wild *", attacker.Name));
                    }

                    if (pet.ControlMaster != null && 0.1 > Utility.RandomDouble())
                    {
                        this.Combatant = null;
                        pet.Combatant = pet.ControlMaster;
                        this.Combatant = null;
                        attacker.Emote(String.Format("* {0} is being angered *", attacker.Name));
                    }
                }
            }

            base.OnGotMeleeAttack(attacker);
        }
Пример #60
0
        public virtual void OnSnort( Mobile from )
        {
            if ( m_ContentType2 == ContentType2.Banestone )
                HallucinationEffect.BeginHallucinating( from as PlayerMobile, 120 );

            from.Emote( "*snorts*" );
            from.SendMessage ("A feeling of great euphoria overcomes you!");
            from.PlaySound( 1208 );
            if ( from.Body.IsHuman )
                from.Animate( 34, 5, 1, true, false, 0 );
        }