コード例 #1
0
ファイル: PoisonResistance.cs プロジェクト: Ravenwolfe/xrunuo
        public static double GetTemporaryResistChance( Mobile m, Poison poison )
        {
            if ( !m_Table.ContainsKey( m ) )
                return 0.0;

            int resistLevel = GetTemporaryResistLevel( m );
            double factor = 15.0 / ( poison.Level + 1 );

            double chance = factor * resistLevel / 100.0;

            return chance / 100.0;
        }
コード例 #2
0
ファイル: Poison.cs プロジェクト: greeduomacro/UO-Forever
		public static void Register( Poison reg )
		{
			string regName = reg.Name.ToLower();

			for ( int i = 0; i < m_Poisons.Count; i++ )
			{
				if ( reg.Level == m_Poisons[i].Level )
					throw new Exception( "A poison with that level already exists." );
				else if ( regName == m_Poisons[i].Name.ToLower() )
					throw new Exception( "A poison with that name already exists." );
			}

			m_Poisons.Add( reg );
		}
コード例 #3
0
ファイル: PoisonResistance.cs プロジェクト: Ravenwolfe/xrunuo
        public static double GetNaturalResistChance( Mobile m, Poison poison )
        {
            double poisoning = m.Skills.Poisoning.Value;

            Resilience song = Spellsong.GetEffectSpellsong<Resilience>( m );

            if ( song != null )
                poisoning += song.CurseReduction; // Guessing here.

            double factor = 80.0 / ( poison.Level + 1 );

            double chance = factor * poisoning / 100.0;

            return chance / 100.0;
        }
コード例 #4
0
ファイル: Fukiya.cs プロジェクト: Godkong/RunUO
        public void ConsumeUse()
        {
            if ( m_UsesRemaining < 1 )
                return;

            --m_UsesRemaining;

            if ( m_PoisonCharges > 0 )
            {
                --m_PoisonCharges;

                if ( m_PoisonCharges == 0 )
                    m_Poison = null;
            }

            InvalidateProperties();
        }
コード例 #5
0
ファイル: FukiyaDarts.cs プロジェクト: Godkong/Origins
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 0:
                {
                    m_UsesRemaining = reader.ReadInt();

                    m_Poison = Poison.Deserialize( reader );
                    m_PoisonCharges = reader.ReadInt();

                    break;
                }
            }
        }
コード例 #6
0
ファイル: Fukiya.cs プロジェクト: PepeBiondi/runsa
		public void Reload( Mobile from, FukiyaDarts darts )
		{
			int need = ( MaxUses - m_UsesRemaining );

			if ( need <= 0 )
			{
				// You cannot add anymore fukiya darts
				from.SendLocalizedMessage( 1063330 );
			}
			else if ( darts.UsesRemaining > 0 )
			{
				if ( need > darts.UsesRemaining )
					need = darts.UsesRemaining;

				if ( darts.Poison != null && darts.PoisonCharges > 0 )
				{
					#region Mondain's Legacy mod
					if ( m_PoisonCharges <= 0 || m_Poison == null || m_Poison.RealLevel <= darts.Poison.RealLevel )
					{
						if ( m_Poison != null && m_Poison.RealLevel < darts.Poison.RealLevel )
							Unload( from );

						if ( need > darts.PoisonCharges )
							need = darts.PoisonCharges;

						if ( m_Poison == null || m_PoisonCharges <= 0 )
							m_PoisonCharges = need;
						else
							m_PoisonCharges += need;

						m_Poison = darts.Poison;

						darts.PoisonCharges -= need;

						if ( darts.PoisonCharges <= 0 )
							darts.Poison = null;

						m_UsesRemaining += need;
						darts.UsesRemaining -= need;
					}
					#endregion
					else
					{
						from.SendLocalizedMessage( 1070767 ); // Loaded projectile is stronger, unload it first
					}
				}
				else
				{
					m_UsesRemaining += need;
					darts.UsesRemaining -= need;
				}

				if ( darts.UsesRemaining <= 0 )
					darts.Delete();

				InvalidateProperties();
			}
		}
コード例 #7
0
 public PoisonCuredEventArgs(Mobile mobile, Poison poison)
 {
     Mobile = mobile;
     Poison = poison;
 }
コード例 #8
0
ファイル: Fukiya.cs プロジェクト: PepeBiondi/runsa
		public void Unload( Mobile from )
		{
			if ( UsesRemaining < 1 )
				return;

			FukiyaDarts darts = new FukiyaDarts( UsesRemaining );

			darts.Poison = m_Poison;
			darts.PoisonCharges = m_PoisonCharges;

			from.AddToBackpack( darts );

			m_UsesRemaining = 0;
			m_PoisonCharges = 0;
			m_Poison = null;

			InvalidateProperties();
		}
コード例 #9
0
        public override ApplyPoisonResult ApplyPoison(Mobile from, Poison poison)
        {
            if (!Alive)
                return ApplyPoisonResult.Immune;

            if (Spells.Necromancy.EvilOmenSpell.CheckEffect(this))
                poison = PoisonImpl.IncreaseLevel(poison);

            ApplyPoisonResult result = base.ApplyPoison(from, poison);

            if (from != null && result == ApplyPoisonResult.Poisoned && PoisonTimer is PoisonImpl.PoisonTimer)
                (PoisonTimer as PoisonImpl.PoisonTimer).From = from;

            return result;
        }
コード例 #10
0
 public override void OnPoisonImmunity(Mobile from, Poison poison)
 {
     if (this.Young)
         SendLocalizedMessage(502808); // You would have been poisoned, were you not new to the land of Britannia. Be careful in the future.
     else
         base.OnPoisonImmunity(from, poison);
 }
コード例 #11
0
		public void Reload( Mobile from, Shuriken shuriken )
		{
			int need = ( MaxUses - m_UsesRemaining );

			if ( need <= 0 )
			{
				// You cannot add any more shuriken.
				from.SendLocalizedMessage( 1063302 );
			}
			else if ( shuriken.UsesRemaining > 0 )
			{
				if ( need > shuriken.UsesRemaining )
					need = shuriken.UsesRemaining;

				if ( shuriken.Poison != null && shuriken.PoisonCharges > 0 )
				{
					if ( m_PoisonCharges <= 0 || m_Poison == shuriken.Poison )
					{
						if ( m_Poison != null && m_Poison.Level < shuriken.Poison.Level )
							Unload( from );

						if ( need > shuriken.PoisonCharges )
							need = shuriken.PoisonCharges;

						if ( m_Poison == null || m_PoisonCharges <= 0 )
							m_PoisonCharges = need;
						else
							m_PoisonCharges += need;

						m_Poison = shuriken.Poison;

						shuriken.PoisonCharges -= need;

						if ( shuriken.PoisonCharges <= 0 )
							shuriken.Poison = null;

						m_UsesRemaining += need;
						shuriken.UsesRemaining -= need;
					}
					else
					{
						from.SendLocalizedMessage( 1070767 ); // Loaded projectile is stronger, unload it first
					}
				}
				else
				{
					m_UsesRemaining += need;
					shuriken.UsesRemaining -= need;
				}

				if ( shuriken.UsesRemaining <= 0 )
					shuriken.Delete();

				InvalidateProperties();
			}
		}
コード例 #12
0
ファイル: Poison.cs プロジェクト: greeduomacro/UO-Forever
		public static void Serialize( Poison p, GenericWriter writer )
		{
			if ( p == null )
				writer.Write( (byte)0 );
			else
			{
				writer.Write( (byte)1 );
				writer.Write( (byte)p.Level );
			}
		}
コード例 #13
0
ファイル: Abilities.cs プロジェクト: rokann/JustUO
        // Main Aura Method
        public static void Aura(Point3D location, Map map, Mobile from, int min, int max, ResistanceType type, int range,
            Poison poison, string text, bool scales, bool allownull, bool effects, int itemid, int hue)
        {
            if (from == null && !allownull)
                return;

            var targets = new List<Mobile>();

            foreach (var m in Map.AllMaps[map.MapID].GetMobilesInRange(location, range))
            {
                if (CanTarget(from, m, true, false, allownull))
                    targets.Add(m);
            }

            if (effects && from != null)
                from.Animate(12, 5, 1, true, false, 0);

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

                if (text != "")
                    m.SendMessage(text);

                var auradamage = Utility.RandomMinMax(min, max);

                if (scales)
                    auradamage = (int) ((auradamage/GetDist(location, m.Location))*range);

                if (poison != null)
                    m.ApplyPoison((from == null) ? m : from, poison);

                if (effects)
                    m.FixedParticles(itemid, 10, 15, 5030 /*what the hell does this number do?*/, hue, 0,
                        EffectLayer.Waist);

                switch (type)
                {
                    case ResistanceType.Physical:
                        AOS.Damage(m, (from == null) ? m : from, auradamage, 100, 0, 0, 0, 0);
                        break;
                    case ResistanceType.Fire:
                        AOS.Damage(m, (from == null) ? m : from, auradamage, 0, 100, 0, 0, 0);
                        break;
                    case ResistanceType.Cold:
                        AOS.Damage(m, (from == null) ? m : from, auradamage, 0, 0, 100, 0, 0);
                        break;
                    case ResistanceType.Poison:
                        AOS.Damage(m, (from == null) ? m : from, auradamage, 0, 0, 0, 100, 0);
                        break;
                    case ResistanceType.Energy:
                        AOS.Damage(m, (from == null) ? m : from, auradamage, 0, 0, 0, 0, 100);
                        break;
                }
            }

            targets.Clear();
        }
コード例 #14
0
        public override bool CheckPoisonImmunity( Mobile from, Poison poison )
        {
            if ( base.CheckPoisonImmunity( from, poison ) )
                return true;

            Poison p = this.PoisonImmune;

            return ( p != null && p.Level >= poison.Level );
        }
コード例 #15
0
        public override ApplyPoisonResult ApplyPoison( Mobile from, Poison poison )
        {
            if ( !Alive )
                return ApplyPoisonResult.Immune;

            return base.ApplyPoison( from, poison );
        }
コード例 #16
0
ファイル: Abilities.cs プロジェクト: rokann/JustUO
 // Null based Aura
 public static void Aura(Point3D location, Map map, Mobile from, int min, int max, ResistanceType type, int range,
     Poison poison, string text)
 {
     Aura(location, map, from, min, max, type, range, poison, text, true, false, false, 0, 0);
 }
コード例 #17
0
 // No Effects
 public static void Aura(Point3D location, Map map, Mobile from, int min, int max, ResistanceType type, int range, Poison poison, string text, bool scales, bool allownull)
 {
     Aura(location, map, from, min, max, type, range, poison, text, scales, allownull, false, 0, 0);
 }
コード例 #18
0
        public static void Trick(BaseCreature creature, PlayerMobile player)
        {
            if (creature == null || player == null)
            {
                return;
            }

            int trickTextHue = 0x22;

            creature.PublicOverheadMessage(MessageType.Regular, trickTextHue, false, "Trick it is then!");
            creature.PlaySound(0x246);

            double damageAmount = 0;
            int    duration     = 0;

            switch (Utility.RandomMinMax(1, 15))
            {
            case 1:
                SpecialAbilities.BacklashSpecialAbility(1.0, null, player, .75, 60, -1, true, "", "");

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Ack! A curse! Causing your spellcasting proficiency to suffer!", player.NetState);
                }
                break;

            case 2:
                double bleedAmount = (double)player.HitsMax * .66;

                for (int a = 0; a < 5; a++)
                {
                    Point3D newLocation = new Point3D(player.Location.X + Utility.RandomList(-1, 1), player.Location.Y + Utility.RandomList(-1, 1), player.Location.Z);

                    new Blood().MoveToWorld(newLocation, player.Map);
                }

                SpecialAbilities.BleedSpecialAbility(1.0, null, player, bleedAmount, 8, -1, true, "", "", "-1");

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Curses! A dagger hidden in an apple!", player.NetState);
                }
                break;

            case 3:
                Point3D creatureLocation = creature.Location;
                Point3D playerLocation   = player.Location;

                int projectiles   = 15;
                int particleSpeed = 8;

                for (int a = 0; a < projectiles; a++)
                {
                    Point3D newLocation = new Point3D(player.X + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), player.Y + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), player.Z);
                    SpellHelper.AdjustField(ref newLocation, player.Map, 12, false);

                    IEntity effectStartLocation = new Entity(Serial.Zero, new Point3D(newLocation.X, newLocation.Y, newLocation.Z + 10), player.Map);
                    IEntity effectEndLocation   = new Entity(Serial.Zero, new Point3D(player.X, player.Y, player.Z + 10), player.Map);

                    Effects.SendMovingParticles(effectStartLocation, effectEndLocation, 0x3818, particleSpeed, 0, false, false, 2603, 0, 9501, 0, 0, 0x100);
                }

                player.FixedParticles(0x3967, 10, 40, 5036, 2603, 0, EffectLayer.CenterFeet);

                int damage = (int)(Math.Round((double)player.HitsMax * .33));

                duration = 5;

                SpecialAbilities.HinderSpecialAbility(1.0, null, player, 1.0, duration, false, -1, false, "", "", "-1");

                new Blood().MoveToWorld(player.Location, player.Map);
                AOS.Damage(player, damage, 0, 100, 0, 0, 0);

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Electric candy! What an age we live in!", player.NetState);
                }
                break;

            case 4:
                SpecialAbilities.DiseaseSpecialAbility(1.0, null, player, 3, 60, -1, true, "", "");

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Blast! Expired candy!", player.NetState);
                }
                break;

            case 5:
                TimedStatic glue = new TimedStatic(4650, 30);
                glue.Name = "glue";
                glue.Hue  = 2067;
                glue.MoveToWorld(player.Location, player.Map);

                SpecialAbilities.EntangleSpecialAbility(1.0, null, player, 1.0, 30, -1, true, "", "", "-1");

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Your feet have been glued to the floor!", player.NetState);
                }
                break;

            case 6:
                damageAmount = (double)player.HitsMax * .5;
                SpecialAbilities.FlamestrikeSpecialAbility(1.0, null, player, damageAmount, 1, -1, true, "", "Spicy candy! So hot!");

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Spicy candy! So hot!", player.NetState);
                }
                break;

            case 7:
                damageAmount = (double)player.HitsMax * .5;

                Direction direction = Utility.GetDirection(creature.Location, player.Location);

                int windItemId = 8099;

                switch (direction)
                {
                case Direction.North: windItemId = 8099; break;

                case Direction.Right: windItemId = 8099; break;

                case Direction.West: windItemId = 8104; break;

                case Direction.Up: windItemId = 8104; break;

                case Direction.East: windItemId = 8109; break;

                case Direction.Down: windItemId = 8109; break;

                case Direction.South: windItemId = 8114; break;

                case Direction.Left: windItemId = 8114; break;
                }

                creature.MovingEffect(player, windItemId, 5, 1, false, false, 0, 0);
                player.PlaySound(0x64C);

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "This candy totally blows...", player.NetState);
                }

                SpecialAbilities.KnockbackSpecialAbility(1.0, creature.Location, null, player, damageAmount, 20, -1, "", "");
                break;

            case 8:
                SpecialAbilities.PetrifySpecialAbility(1.0, null, player, 1.0, 15, -1, true, "", "", "-1");

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Rock candy!", player.NetState);
                }
                break;

            case 9:
                if (player.Poison == null)
                {
                    Poison poison = Poison.GetPoison(2);
                    player.ApplyPoison(null, poison);
                }

                player.FixedEffect(0x372A, 10, 30, 2208, 0);
                Effects.PlaySound(player.Location, player.Map, 0x22F);

                int residueCount = Utility.RandomMinMax(3, 4);

                for (int a = 0; a < residueCount; a++)
                {
                    Point3D poisonPoint = new Point3D(player.Location.X + Utility.RandomList(-1, 1), player.Location.Y + Utility.RandomList(-1, 1), player.Location.Z);
                    SpellHelper.AdjustField(ref poisonPoint, player.Map, 12, false);

                    TimedStatic poisonResidue = new TimedStatic(Utility.RandomList(0x1645, 0x122A, 0x122B, 0x122C, 0x122D, 0x122E, 0x122F), 5);
                    poisonResidue.Hue  = 2208;
                    poisonResidue.Name = "poison residue";
                    poisonResidue.MoveToWorld(poisonPoint, player.Map);
                }

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Poisoned candy! Who would do such a thing!", player.NetState);
                }
                break;

            case 10:
                bool canPolymorph = true;

                if (!player.CanBeginAction(typeof(PolymorphSpell)))
                {
                    canPolymorph = false;
                }

                if (!player.CanBeginAction(typeof(PolymorphPotion)))
                {
                    canPolymorph = false;
                }

                if (!player.CanBeginAction(typeof(IncognitoSpell)) || player.IsBodyMod)
                {
                    canPolymorph = false;
                }

                if (DisguiseTimers.IsDisguised(player))
                {
                    canPolymorph = false;
                }

                if (KinPaint.IsWearingKinPaint(player))
                {
                    canPolymorph = false;
                }

                if (!canPolymorph)
                {
                    player.SendMessage("Hmm...Nothing seems to have happened. Or did it?");
                    return;
                }

                player.FixedParticles(0x373A, 10, 15, 5036, EffectLayer.Head);

                List <int> m_PossibleBodyValues = new List <int>();

                m_PossibleBodyValues.Add(3);     //Zombie
                m_PossibleBodyValues.Add(50);    //Skeleton
                m_PossibleBodyValues.Add(56);    //Skeleton
                m_PossibleBodyValues.Add(153);   //Ghoul
                m_PossibleBodyValues.Add(302);   //Skeletal Critter
                m_PossibleBodyValues.Add(309);   //Patchwork Skeleton
                m_PossibleBodyValues.Add(148);   //Necromancer
                m_PossibleBodyValues.Add(793);   //Skeletal Horse
                m_PossibleBodyValues.Add(317);   //Giant Bat
                m_PossibleBodyValues.Add(252);   //Corpse Bride
                m_PossibleBodyValues.Add(57);    //Skeletal Knight
                m_PossibleBodyValues.Add(116);   //Nightmare
                m_PossibleBodyValues.Add(24);    //Lich
                m_PossibleBodyValues.Add(154);   //Mummy
                m_PossibleBodyValues.Add(104);   //Skeletal Drake
                m_PossibleBodyValues.Add(740);   //Skeletal Drake
                m_PossibleBodyValues.Add(308);   //Giant Skeleton

                player.BodyMod = m_PossibleBodyValues[Utility.RandomMinMax(0, m_PossibleBodyValues.Count - 1)];
                player.HueMod  = 0;

                player.PlaySound(0x3BD);

                BaseArmor.ValidateMobile(player);

                duration = 120;

                player.BeginAction(typeof(PolymorphPotion));
                Timer.DelayCall(TimeSpan.FromSeconds(duration), delegate
                {
                    if (player == null)
                    {
                        return;
                    }

                    player.EndAction(typeof(PolymorphPotion));
                });

                player.BeginAction(typeof(PolymorphSpell));
                Timer.DelayCall(TimeSpan.FromSeconds(duration), delegate
                {
                    if (player == null)
                    {
                        return;
                    }

                    player.BodyMod = 0;
                    player.HueMod  = -1;
                    player.EndAction(typeof(PolymorphSpell));

                    BaseArmor.ValidateMobile(player);
                });

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Hmm, something tastes odd about this candy.", player.NetState);
                }
                break;

            case 11:
                Item innerLegs = player.FindItemOnLayer(Layer.InnerLegs);
                Item outerLegs = player.FindItemOnLayer(Layer.OuterLegs);
                Item pants     = player.FindItemOnLayer(Layer.Pants);

                int layersFound = 0;

                if (innerLegs != null)
                {
                    player.Backpack.DropItem(innerLegs);
                    layersFound++;
                }

                if (outerLegs != null)
                {
                    player.Backpack.DropItem(outerLegs);
                    layersFound++;
                }

                if (pants != null)
                {
                    player.Backpack.DropItem(pants);
                    layersFound++;
                }

                if (layersFound > 0)
                {
                    player.PlaySound(0x503);

                    if (player.NetState != null)
                    {
                        player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Your pants appear to have fallen down. How embarrassing!", player.NetState);
                    }
                }

                else
                {
                    player.SendMessage("Nothing seems to have happened. Or did it?...");
                }
                break;

            case 12:

                player.FixedParticles(0x374A, 10, 15, 5028, 2604, 0, EffectLayer.Waist);
                player.PlaySound(0x5DA);

                player.Animate(22, 6, 1, true, false, 0);     //Fall Forward

                player.Stam = 0;

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "You feel drowsy and fall on your face!", player.NetState);
                }
                break;

            case 13:
                player.BAC = 60;
                player.PlaySound(0x5A9);

                BaseBeverage.CheckHeaveTimer(player);

                player.Animate(34, 5, 1, true, false, 0);

                if (player.NetState != null)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, 0, false, "What was in that candy??? *hic*", player.NetState);
                }
                break;

            case 14:
                Warp(creature, player);
                break;

            case 15:
                Warp(creature, player);
                break;
            }
        }
コード例 #19
0
ファイル: Poison.cs プロジェクト: nogu3ira/xrunuo
        public static Poison IncreaseLevel(Poison oldPoison)
        {
            Poison newPoison = (oldPoison == null ? null : GetPoison(oldPoison.Level + 1));

            return(newPoison == null ? oldPoison : newPoison);
        }
コード例 #20
0
        // Main Aura Method
        public static void Aura(Point3D location, Map map, Mobile from, int min, int max, ResistanceType type, int range, Poison poison, string text, bool scales, bool allownull, bool effects, int itemid, int hue)
        {
            if (from == null && !allownull)
            {
                return;
            }

            List <Mobile> targets = new List <Mobile>();

            foreach (Mobile m in Map.AllMaps[map.MapID].GetMobilesInRange(location, range))
            {
                if (CanTarget(from, m, true, false, allownull))
                {
                    targets.Add(m);
                }
            }

            if (effects && from != null)
            {
                from.Animate(12, 5, 1, true, false, 0);
            }

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

                if (text != "")
                {
                    m.SendMessage(text);
                }

                int auradamage = Utility.RandomMinMax(min, max);

                if (scales)
                {
                    auradamage = (int)((auradamage / GetDist(location, m.Location)) * range);
                }

                if (poison != null)
                {
                    m.ApplyPoison((from == null) ? m : from, poison);
                }

                if (effects)
                {
                    m.FixedParticles(itemid, 10, 15, 5030 /*what the hell does this number do?*/, hue, 0, EffectLayer.Waist);
                }

                switch (type)
                {
                case ResistanceType.Physical:
                    AOS.Damage(m, (from == null) ? m : from, auradamage, 100, 0, 0, 0, 0);
                    break;

                case ResistanceType.Fire:
                    AOS.Damage(m, (from == null) ? m : from, auradamage, 0, 100, 0, 0, 0);
                    break;

                case ResistanceType.Cold:
                    AOS.Damage(m, (from == null) ? m : from, auradamage, 0, 0, 100, 0, 0);
                    break;

                case ResistanceType.Poison:
                    AOS.Damage(m, (from == null) ? m : from, auradamage, 0, 0, 0, 100, 0);
                    break;

                case ResistanceType.Energy:
                    AOS.Damage(m, (from == null) ? m : from, auradamage, 0, 0, 0, 0, 100);
                    break;
                }
            }

            targets.Clear();
        }
コード例 #21
0
 // Mobile based Aura
 public static void Aura(Mobile from, int min, int max, ResistanceType type, int range, Poison poison, string text)
 {
     Aura(from.Location, from.Map, from, min, max, type, range, poison, text, true, false, false, 0, 0);
 }
コード例 #22
0
 public override bool CheckHigherPoison(Mobile from, Poison poison)
 {
     return this.Poison != null;
 }
コード例 #23
0
ファイル: Mobile.cs プロジェクト: BackupTheBerlios/sunuo-svn
 /// <summary>
 /// Overridable. Virtual event invoked when a call to <see cref="CurePoison" /> succeeded.
 /// <seealso cref="CurePoison" />
 /// <seealso cref="CheckCure" />
 /// <seealso cref="Poison" />
 /// </summary>
 public virtual void OnCured( Mobile from, Poison oldPoison )
 {
 }
コード例 #24
0
ファイル: Abilities.cs プロジェクト: rokann/JustUO
 // No Effects
 public static void Aura(Point3D location, Map map, Mobile from, int min, int max, ResistanceType type, int range,
     Poison poison, string text, bool scales, bool allownull)
 {
     Aura(location, map, from, min, max, type, range, poison, text, scales, allownull, false, 0, 0);
 }
コード例 #25
0
ファイル: Mobile.cs プロジェクト: BackupTheBerlios/sunuo-svn
 /// <summary>
 /// Overridable. Virtual event invoked when a call to <see cref="ApplyPoison" /> failed because <see cref="CheckHigherPoison" /> returned false: the Mobile was already poisoned by an equal or greater strength poison.
 /// <seealso cref="CheckHigherPoison" />
 /// <seealso cref="ApplyPoison" />
 /// <seealso cref="Poison" />
 /// </summary>
 public virtual void OnHigherPoison( Mobile from, Poison poison )
 {
 }
コード例 #26
0
        public override ApplyPoisonResult ApplyPoison( Mobile from, Poison poison )
        {
            if ( !Alive || IsDeadPet )
                return ApplyPoisonResult.Immune;

            if ( Spells.Necromancy.EvilOmenSpell.CheckEffect( this ) )
                return base.ApplyPoison( from, PoisonImpl.IncreaseLevel( poison ) );

            return base.ApplyPoison( from, poison );
        }
コード例 #27
0
ファイル: Mobile.cs プロジェクト: BackupTheBerlios/sunuo-svn
 /// <summary>
 /// Overridable. Event invoked when a call to <see cref="ApplyPoison" /> succeeded. By default, this broadcasts an overhead message varying by the level of the poison. Example: * Zippy begins to spasm uncontrollably. *
 /// <seealso cref="ApplyPoison" />
 /// <seealso cref="Poison" />
 /// </summary>
 public virtual void OnPoisoned( Mobile from, Poison poison, Poison oldPoison )
 {
     if (poison != null && poison.Level >= 0 && poison.Level <= 4)
     {
         this.LocalOverheadMessage( MessageType.Regular, 0x22, 1042857 + (poison.Level * 2) );
         this.NonlocalOverheadMessage( MessageType.Regular, 0x22, 1042858 + (poison.Level * 2), Name );
     }
 }
コード例 #28
0
		public void Unload( Mobile from )
		{
			if ( UsesRemaining < 1 )
				return;

			Shuriken shuriken = new Shuriken( UsesRemaining );

			shuriken.Poison = m_Poison;
			shuriken.PoisonCharges = m_PoisonCharges;

			from.AddToBackpack( shuriken );

			m_UsesRemaining = 0;
			m_PoisonCharges = 0;
			m_Poison = null;

			InvalidateProperties();
		}
コード例 #29
0
ファイル: Mobile.cs プロジェクト: BackupTheBerlios/sunuo-svn
 /// <summary>
 /// Overridable. Event invoked when a call to <see cref="ApplyPoison" /> failed because <see cref="CheckPoisonImmunity" /> returned false: the Mobile was resistant to the poison. By default, this broadcasts an overhead message: * The poison seems to have no effect. *
 /// <seealso cref="CheckPoisonImmunity" />
 /// <seealso cref="ApplyPoison" />
 /// <seealso cref="Poison" />
 /// </summary>
 public virtual void OnPoisonImmunity( Mobile from, Poison poison )
 {
     this.PublicOverheadMessage( MessageType.Emote, 0x3B2, 1005534 ); // * The poison seems to have no effect. *
 }
コード例 #30
0
		public void Deserialize( GenericReader reader, bool read )
		{
			base.Deserialize( reader );

			if ( !read )
				return;

			int version = reader.ReadInt();

			switch ( version )
			{
				case 1:
				{
					m_Poisoner = reader.ReadMobile();
					goto case 0;
				}
				case 0:
				{
					m_Poison = Poison.Deserialize( reader );
					m_Content = (BeverageType)reader.ReadInt();
					m_Quantity = reader.ReadInt();
					break;
				}
			}
		}
コード例 #31
0
ファイル: PoisonRoom.cs プロジェクト: evildude807/kaltar
 public virtual void OnPoison( Poison poison, int tick )
 {
 }
コード例 #32
0
ファイル: PoisonRoom.cs プロジェクト: evildude807/kaltar
        public virtual void PoisonPlayers( Poison poison )
        {
            List<Mobile> list = GetPoisonableMobiles( null );

            foreach ( Mobile m in list )
            {
                if ( ( m.Poison == null || m.Poison.Level < poison.Level ) )
                    m.ApplyPoison( null, poison );
            }
        }
コード例 #33
0
ファイル: Poison.cs プロジェクト: rokann/JustUO
		public static Poison IncreaseLevel(Poison oldPoison)
		{
			Poison newPoison = oldPoison == null ? null : GetPoison(oldPoison.Level + 1);

			return newPoison ?? oldPoison;
		}
コード例 #34
0
        public override bool CheckPoisonImmunity(Mobile from, Poison poison)
        {
            if (this.Young)
                return true;

            return base.CheckPoisonImmunity(from, poison);
        }
コード例 #35
0
ファイル: Poison.cs プロジェクト: jackuoll/Pre-AOS-RunUO
		public static Poison IncreaseLevel( Poison oldPoison )
		{
			Poison newPoison = ( oldPoison == null ? null : GetPoison( oldPoison.Level + 1 ) );

			return ( newPoison == null ? oldPoison : newPoison );
		}
コード例 #36
0
ファイル: BaseCurePotion.cs プロジェクト: Godkong/Origins
 public CureLevelInfo( Poison poison, double chance )
 {
     m_Poison = poison;
     m_Chance = chance;
 }
コード例 #37
0
ファイル: PetMoves.cs プロジェクト: Orion321/unknown-shard
        public static void DoMoves(BaseCreature from, Mobile target)
        {
            switch (Utility.Random(3))
            {
            case 0:

                if (Utility.Random(500) <= from.RoarAttack)
                {
                    int power;
                    int mindam;
                    int maxdam;

                    if (from.RoarAttack > 3)
                    {
                        mindam = from.RoarAttack / 3;
                        maxdam = from.RoarAttack / 2;
                    }
                    else
                    {
                        mindam = 1;
                        maxdam = 3;
                    }

                    if (from.RoarAttack > 10)
                    {
                        power = from.RoarAttack / 10;
                    }
                    else
                    {
                        power = 1;
                    }

                    ArrayList targets = new ArrayList();

                    foreach (Mobile m in from.GetMobilesInRange(power))
                    {
                        if (m != from)
                        {
                            targets.Add(m);
                        }
                    }

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

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

                            bc.BeginFlee(TimeSpan.FromSeconds(30.0));
                            AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 20, 20, 20, 20, 20);
                        }
                    }
                }

                break;

            case 1:

                if (Utility.Random(500) <= from.PetPoisonAttack)
                {
                    Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 63, 7, 9915, 0);
                    Effects.PlaySound(target.Location, target.Map, 0x229);

                    int mindam;
                    int maxdam;

                    if (from.PetPoisonAttack > 3)
                    {
                        mindam = from.PetPoisonAttack / 3;
                        maxdam = from.PetPoisonAttack / 2;
                    }
                    else
                    {
                        mindam = 1;
                        maxdam = 3;
                    }

                    int level = from.PetPoisonAttack / 20;

                    if (level > 5)
                    {
                        level = 5;
                    }

                    target.ApplyPoison(from.ControlMaster, Poison.GetPoison(level));
                    AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 0, 0, 0, 0, 100);
                }

                break;

            case 2:

                if (Utility.Random(500) <= from.FireBreathAttack)
                {
                    int mindam;
                    int maxdam;

                    if (from.PetPoisonAttack > 3)
                    {
                        mindam = from.PetPoisonAttack / 3;
                        maxdam = from.PetPoisonAttack / 2;
                    }
                    else
                    {
                        mindam = 1;
                        maxdam = 3;
                    }

                    from.MovingParticles(target, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
                    from.PlaySound(Core.AOS ? 0x15E : 0x44B);
                    target.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot);
                    target.PlaySound(0x208);

                    AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 0, 0, 0, 0, 100);

                    Timer t = new FireBreathDOT(target, from, from.FireBreathAttack);
                    t.Start();
                }

                break;
            }
        }