Exemplo n.º 1
0
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( CheckHSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

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

                m.Paralyzed = false;

                if ( CheckResistedEasy( m ) )
                {
                    m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
                }
                else
                {
                    if ( Caster.Skills[SkillName.Magery].Value > Utility.Random( 1, 150 ) )
                        m.ApplyPoison( Caster, Poison.Greater );
                    else
                        m.ApplyPoison( Caster, Poison.Regular );
                    if ( m.Spell is Spell )
                        ((Spell)m.Spell).OnCasterHurt( 1 );
                }

                m.FixedParticles( 0x374A, 10, 15, 5021, EffectLayer.Waist );
                m.PlaySound( 0x474 );
            }

            FinishSequence();
        }
Exemplo n.º 2
0
        public override bool Eat(Mobile from)
        {

            if (!IsChildOf(from.Backpack))
            {
                from.SendMessage("Ceci doit être dans votre sac");
                return false;
            }

            // Fill the Mobile with FillFactor
            if (from is PlayerMobile)
            {
                CanEat = false;
                Timer.DelayCall(TimeSpan.FromSeconds(3), ChangeCanEat);
                // Play a random "eat" sound
                from.PlaySound(Utility.Random(0x3A, 3));

                if (from.Body.IsHuman && !from.Mounted)
                    from.Animate(34, 5, 1, true, false, 0);

                if (Poison != null)
                    from.ApplyPoison(Poisoner, Poison);

                if (from.Hunger < 20)
                    from.Hunger += Utility.Random(FillFactor);

                DoEffect(from);

                return true;
            }
            return false;
        }
Exemplo n.º 3
0
        public override bool Eat(Mobile from)
        {
            if (CheckHunger(from))
            {
                from.PlaySound(Utility.Random(0x3A, 3));

                if (from.Body.IsHuman && !from.Mounted)
                    from.Animate(34, 5, 1, true, false, 0);

                if (from is PlayerMobile || !from.IsHallucinated)
                {
                    PlayerMobile junkie = from as PlayerMobile;
                    junkie.Hallucinating = true;
                    junkie.IncAddiction(new HallucinogenPotion());
                    Timer.DelayCall(TimeSpan.FromMinutes(5), HallucinogenPotion.StopHallucinate, junkie);
                }
                else if (Poison != null)
                    from.ApplyPoison(Poisoner, Poison);

                Consume();

                return true;
            }

            return false;
        }
Exemplo n.º 4
0
        public override void OnHit( Mobile attacker, Mobile defender, int damage )
        {
            if ( !Validate( attacker ) )
                return;

            ClearCurrentAbility( attacker );

            BaseWeapon weapon = attacker.Weapon as BaseWeapon;

            if ( weapon == null )
                return;

            if ( !CheckMana( attacker, true ) )
                return;

            int level = attacker.Skills[SkillName.Poisoning].Fixed / 250;
            Poison p = Poison.GetPoison( level );

            defender.PlaySound( 0xDD );
            defender.FixedParticles( 0x3728, 244, 25, 9941, 1266, 0, EffectLayer.Waist );

            if ( defender.ApplyPoison( attacker, p ) != ApplyPoisonResult.Immune )
            {
                attacker.SendLocalizedMessage( 1008096, true, defender.Name ); // You have poisoned your target :
                defender.SendLocalizedMessage( 1008097, false, attacker.Name ); //  : poisoned you!

                Titles.AwardKarma( attacker, -10, true );
            }
        }
Exemplo n.º 5
0
		public override void OnGaveMeleeAttack( Mobile defender )
		{
			base.OnGaveMeleeAttack( defender );

			defender.ApplyPoison( this, Poison.Deadly );
			defender.FixedParticles( 0x374A, 10, 15, 5021, EffectLayer.Waist );
			defender.PlaySound( 0x1CB );
		}
Exemplo n.º 6
0
        public override void OnHit( Mobile attacker, Mobile defender, int damage )
        {
            if ( !Validate( attacker ) )
                return;

            ClearCurrentAbility( attacker );

            BaseWeapon weapon = attacker.Weapon as BaseWeapon;

            if ( weapon == null )
                return;

            Poison p = weapon.Poison;

            if ( p == null || weapon.PoisonCharges <= 0 )
            {
                attacker.SendLocalizedMessage( 1061141 ); // Your weapon must have a dose of poison to perform an infectious strike!
                return;
            }

            if ( !CheckStam( attacker, true ) )
                return;

            // Infectious strike special move now uses poisoning skill to help determine potency
            int maxLevel = attacker.Skills[SkillName.Poisoning].Fixed / 200;
            if ( maxLevel < 0 ) maxLevel = 0;
            if ( p.Level > maxLevel ) p = Poison.GetPoison( maxLevel );

            if ( (attacker.Skills[SkillName.Poisoning].Value / 100.0) > Utility.RandomDouble() )
            {
                int level = p.Level + 1;
                Poison newPoison = Poison.GetPoison( level );

                if ( newPoison != null )
                {
                    p = newPoison;

                    attacker.SendLocalizedMessage( 1060080 ); // Your precise strike has increased the level of the poison by 1
                    defender.SendLocalizedMessage( 1060081 ); // The poison seems extra effective!

                    defender.PlaySound( 0xDD );
                    defender.FixedParticles( 0x3728, 244, 25, 9941, 1266, 0, EffectLayer.Waist );

                    --weapon.PoisonCharges;

                    if ( defender.ApplyPoison( attacker, p ) != ApplyPoisonResult.Immune )
                    {
                        attacker.SendLocalizedMessage( 1008096, true, defender.Name ); // You have poisoned your target :
                        defender.SendLocalizedMessage( 1008097, false, attacker.Name ); //  : poisoned you!
                    }
                }
            }
            else
            {
                attacker.SendMessage( "Your strike was not precise enough to enhance the poison." );
            }
        }
Exemplo n.º 7
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!this.Validate(attacker) || !this.CheckMana(attacker, true))
                return;

            ClearCurrentAbility(attacker);

            attacker.SendMessage("You poisoning target"); 
            defender.SendMessage("You are poisoned");

            int level;

            if (Core.AOS)
            {
                if (attacker.InRange(defender, 2))
                {
                    int total = (attacker.Skills.Poisoning.Fixed) / 2;

                    if (total >= 1000)
                        level = 3;
                    else if (total > 850)
                        level = 2;
                    else if (total > 650)
                        level = 1;
                    else
                        level = 0;
                }
                else
                {
                    level = 0;
                }
            }
            else
            {
                double total = attacker.Skills[SkillName.Poisoning].Value;

                double dist = attacker.GetDistanceToSqrt(defender);

                if (dist >= 3.0)
                    total -= (dist - 3.0) * 10.0;

                if (total >= 200.0 && 1 > Utility.Random(10))
                    level = 3;
                else if (total > (Core.AOS ? 170.1 : 170.0))
                    level = 2;
                else if (total > (Core.AOS ? 130.1 : 130.0))
                    level = 1;
                else
                    level = 0;
            }

            defender.ApplyPoison(attacker, Poison.GetPoison(level));

            defender.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
            defender.PlaySound(0x474);
        }
Exemplo n.º 8
0
 public override void OnGotMeleeAttack(Mobile attacker)
 {
     if (!attacker.Poisoned)
     {
         int poison = Utility.RandomMinMax(0, 1);
         base.OnGotMeleeAttack(attacker);
         attacker.ApplyPoison(attacker, Poison.GetPoison(poison));
         attacker.SendMessage("You got poisoned when striking in the poisonous slimy body");
     }
 }
Exemplo n.º 9
0
		public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
		{
			base.OnHit( attacker, defender, damageBonus );

			if ( !Core.AOS && Poison != null && PoisonCharges > 0 )
			{
				--PoisonCharges;

				if ( Utility.RandomDouble() >= 0.5 ) // 50% chance to poison
					defender.ApplyPoison( attacker, Poison );
			}
		}
Exemplo n.º 10
0
		public void Target( Mobile m )
		{
			if ( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( CheckHSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

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

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

				m.Paralyzed = false;

				if ( CheckResisted( m ) )
				{
					m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
				}
				else
				{
					int level;

                    double total = Caster.Skills[SkillName.Magery].Value;
                    total += Caster.Skills[SkillName.Poisoning].Value;

                    double dist = Caster.GetDistanceToSqrt(m);

                    if (dist >= 3.0)
                        total -= (dist - 3.0) * 10.0;

                    if (total >= 200.0 && 1 > Utility.Random(10))
                        level = 3;
                    else if (total > 170.0)
                        level = 2;
                    else if (total > 130.0)
                        level = 1;
                    else
                        level = 0;

                    m.ApplyPoison( Caster, Poison.GetPoison( level ) );
				}

				m.FixedParticles( 0x374A, 10, 15, 5021, EffectLayer.Waist );
				m.PlaySound( 0x205 );

				HarmfulSpell( m );
			}

			FinishSequence();
		}
Exemplo n.º 11
0
		public override void OnHit( Mobile attacker, Mobile defender )
		{
			base.OnHit( attacker, defender );

			if ( !Core.AOS && Poison != null && PoisonCharges > 0 && !(Layer == Layer.TwoHanded) )
			{
				--PoisonCharges;

				if ( Utility.RandomDouble() >= 0.5 ) // 50% chance to poison
					defender.ApplyPoison( attacker, Poison );
			}
		}
Exemplo n.º 12
0
		public override void OnTrigger( Mobile from )
		{
			if ( m_Poison == null || !from.Player || !from.Alive || from.AccessLevel > AccessLevel.Player )
				return;

			Effects.SendLocationEffect( Location, Map, GetBaseID( this.Type ) - 2, 16, 3, GetEffectHue(), 0 );
			Effects.PlaySound( Location, Map, 0x231 );

			from.ApplyPoison( from, m_Poison );

			from.LocalOverheadMessage( MessageType.Regular, 0x22, 500855 ); // You are enveloped by a noxious gas cloud!
		}
Exemplo n.º 13
0
		public override void OnMovement(Mobile m, Point3D oldLocation)
		{
			base.OnMovement(m, oldLocation);

			if (m == null || m.Deleted || m == Hydra || !m.Alive || !m.InRange3D(this, 1, -5, 5) ||
				(Hydra != null && !Hydra.CanBeHarmful(m)))
			{
				return;
			}

			if (Hydra != null)
			{
				Hydra.DoHarmful(m, true);
			}

			if (m is BaseCreature && m.IsControlled())
			{
				m.Damage(25);
			}
			else if (m is PlayerMobile)
			{
				m.Damage(1);
			}

			if (m.Poisoned)
			{
				return;
			}

			if (m is PlayerMobile)
			{
				m.ApplyPoison(Hydra ?? m, Poison.Lesser);
			}
			else if (m is BaseCreature)
			{
				m.ApplyPoison(Hydra ?? m, Poison.Lethal);
			}
		}
Exemplo n.º 14
0
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( CheckHSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

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

                m.Paralyzed = false;

                if ( CheckResisted( m ) )
                {
                    m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
                }
                else
                {
                    int level = 1;

                    if ( Caster.Skills[SkillName.Magery].Value < 75 )
                        level = 0;

                    if ( Utility.Random( 4 ) == 0 )
                        level = 2;

                    if ( m.ApplyPoison( Caster, Poison.GetPoison( level ) ) == ApplyPoisonResult.Poisoned )
                    {
                        if ( m.PoisonTimer != null && m.PoisonTimer.Running && m.PoisonTimer.Delay > PoisonTickDelay )
                        {
                            m.PoisonTimer.Stop();
                            m.PoisonTimer.Delay = PoisonTickDelay;
                            m.PoisonTimer.Start();
                        }
                    }

                    if ( m.Spell is MagerySpell && ((MagerySpell)m.Spell).State == SpellState.Casting )
                        m.Spell.OnCasterHurt( (level + 1)*5 );
                }

                m.FixedParticles( 0x374A, 10, 15, 5021, EffectLayer.Waist );
                m.PlaySound( 0x474 );
            }

            FinishSequence();
        }
Exemplo n.º 15
0
        public override void OnHit(Mobile attacker, Mobile defender)
        {
            CustomRegion cR = defender.Region as CustomRegion;

            if (cR == null || cR.Controller.AllowSpecialAttacks)
            {
                if (Utility.Random(20) <= 2) // 10% chance of scoring a critical hit
                {
                    attacker.SendAsciiMessage("You poison your target!");
                    defender.PublicOverheadMessage(MessageType.Emote, 34, false, string.Format("*{0} suddenly feels very ill*", defender.Name));
                    defender.ApplyPoison(attacker, Poison.GetPoison(0));
                    new InternalTimer(defender).Start();
                }
            }

            base.OnHit(attacker, defender);
        }
Exemplo n.º 16
0
		public override bool Eat(Mobile from)
		{
				from.PlaySound(Utility.Random(0x3A, 3));

				if (from.Body.IsHuman && !from.Mounted)
					from.Animate(34, 5, 1, true, false, 0);

				if (Poison != null)
					from.ApplyPoison(Poisoner, Poison);

				if (Utility.RandomDouble() < 0.05)
					GiveToothAche(from, 0);
				else
					from.SendLocalizedMessage(1077387);
				Consume();
				return true;
		}
Exemplo n.º 17
0
		public void Boire( Mobile from )
		{
			if ( soif( from, m_FillFactor ) )
			{
				from.PlaySound( Utility.Random( 0x30, 2 ) );

				if ( from.Body.IsHuman && !from.Mounted )
					from.Animate( 34, 5, 1, true, false, 0 );

				if ( m_Poison != null )
					from.ApplyPoison( m_Poisoner, m_Poison );

				this.Consume();

				Item item = EmptyItem;

				if ( item != null )
					from.AddToBackpack( item );
			}
		}
Exemplo n.º 18
0
		public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
		{
			base.OnHit( attacker, defender, damageBonus );

			if ( !Core.AOS && Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() && Engines.ConPVP.DuelContext.AllowSpecialAbility( attacker, "Paralyzing Blow", false ) )
			{
				defender.SendMessage( "You receive a paralyzing blow!" ); // Is this not localized?
				defender.Freeze( TimeSpan.FromSeconds( 2.0 ) );

				attacker.SendMessage( "You deliver a paralyzing blow!" ); // Is this not localized?
				attacker.PlaySound( 0x11C );
			}

			if ( !Core.AOS && Poison != null && PoisonCharges > 0 )
			{
				--PoisonCharges;

				if ( Utility.RandomDouble() >= 0.5 ) // 50% chance to poison
					defender.ApplyPoison( attacker, Poison );
			}
		}
Exemplo n.º 19
0
		public virtual bool Eat( Mobile from )
		{
			// Fill the Mobile with FillFactor
			if ( CheckHunger( from ) )
			{
				// Play a random "eat" sound
				from.PlaySound( Utility.Random( 0x3A, 3 ) );

				if ( from.Body.IsHuman && !from.Mounted )
					from.Animate( 34, 5, 1, true, false, 0 );

				if ( m_Poison != null )
					from.ApplyPoison( m_Poisoner, m_Poison );

				Consume();

				return true;
			}

			return false;
		}
Exemplo n.º 20
0
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendAsciiMessage( "Target can not be seen." ); // Target can not be seen.
            }
            else if ( CheckHSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

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

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

                m.Paralyzed = false;

                if (CheckResisted(m, 22))
                {
                    m.SendAsciiMessage("You feel yourself resisting magical energy."); // You feel yourself resisting magical energy.
                }
                else
                {
                    int level;

                    if (Utility.Random(1, 100) < Caster.Skills[SkillName.Magery].Value)
                        level = 1;
                    else
                        level = 3;

                    m.ApplyPoison(Caster, Poison.GetPoison(level));
                }

                m.FixedParticles( 0x374A, 10, 15, 5021, EffectLayer.Waist );
                m.PlaySound( 517 );
            }

            FinishSequence();
        }
Exemplo n.º 21
0
		public override void OnHit( Mobile attacker, Mobile defender, int damage )
		{
			ClearCurrentMove( attacker );

			if ( Utility.RandomDouble() > 0.15 ) //15% fail chance
			{
				int level;
				int total = (int)attacker.Skills[MoveSkill].Value;
				total += (int)attacker.Skills[SkillName.MagicResist].Value / 2;
				total /= 2;

				if ( total > 82 ) // 105 Forensics & 120 MagicResist or better
					level = 4; // Lethal
				else if ( total > 74 ) // GM Forensics & MagicResist
					level = 3; // Deadly
				else if ( total > 60 ) // 80 in Forensics & MagicResist
					level = 2; // Greater
				else if ( total > 36 ) // 50.0 in Forensics & MagicResist
					level = 1; // Regular
				else
					level = 0; // Lesser

				defender.ApplyPoison( attacker, Poison.GetPoison( level ) );
			}
			else
			{
				ClearCurrentMove( attacker );
				SetContext( attacker );
				attacker.SendMessage("Your claw attack failed. You prepare to strike again...");
				return;
			}

			BlueMageControl.CheckKnown( defender, this, CanTeach( attacker ) );
			CheckGain( attacker );

			attacker.SendMessage("You poison your opponent with a deadly claw attack.");
			defender.SendMessage("You were poisoned by your opponent's claws");
		}
Exemplo n.º 22
0
		public virtual bool Eat( Mobile from )
		{
			// Fill the Mobile with FillFactor
			if ( FillHunger( from, m_FillFactor ) )
			{
				// Play a random "eat" sound
				from.PlaySound( Utility.Random( 0x3A, 3 ) );

                from.PublicOverheadMessage(MessageType.Emote, 0x22, true, string.Format("*You see {0} eating some {1}*", from.Name, Name==null ? CliLoc.LocToString(LabelNumber) : Name));

				if ( from.Body.IsHuman && !from.Mounted )
					from.Animate( 34, 5, 1, true, false, 0 );

				if ( m_Poison != null )
					from.ApplyPoison( m_Poisoner, m_Poison );

				Consume();

				return true;
			}

			return false;
		}
Exemplo n.º 23
0
		public virtual bool Eat(Mobile from)
		{
			int oldHunger = from.Hunger;

			// Fill the Mobile with FillFactor
			if (CheckHunger(from))
			{
				// Play a random "eat" sound
				from.PlaySound(Utility.Random(0x3A, 3));

				if (from.Body.IsHuman && !from.Mounted)
				{
					from.Animate(34, 5, 1, true, false, 0);
				}

				if (m_Poison != null)
				{
					from.ApplyPoison(m_Poisoner, m_Poison);
				}

				//EventSink.InvokeOnConsume(new OnConsumeEventArgs(from, this, from.Hunger - oldHunger));

                if (from is PlayerMobile)
                {
                    Conquests.CheckProgress<ItemConquest>((PlayerMobile)from, this, from.Hunger - oldHunger);

                    //CheckProgress<ConsumeItemConquest>((PlayerMobile)e.Consumer, e);
                }

				Consume();

				return true;
			}

			return false;
		}
Exemplo n.º 24
0
        public void ChangeOpponent()
        {
            Mobile agro, best = null;
            double distance, random = Utility.RandomDouble();

            if (random < 0.75)
            {
                // find random target relatively close
                for (int i = 0; i < Aggressors.Count && best == null; i++)
                {
                    agro = Validate(Aggressors[i].Attacker);

                    if (agro == null)
                    {
                        continue;
                    }

                    distance = StrikingRange - GetDistanceToSqrt(agro);

                    if (distance > 0 && distance < StrikingRange - 2 && InLOS(agro.Location))
                    {
                        distance /= StrikingRange;

                        if (random < distance)
                        {
                            best = agro;
                        }
                    }
                }
            }
            else
            {
                int damage = 0;

                // find a player who dealt most damage
                for (int i = 0; i < DamageEntries.Count; i++)
                {
                    agro = Validate(DamageEntries[i].Damager);

                    if (agro == null)
                    {
                        continue;
                    }

                    distance = GetDistanceToSqrt(agro);

                    if (distance < StrikingRange && DamageEntries[i].DamageGiven > damage && InLOS(agro.Location))
                    {
                        best   = agro;
                        damage = DamageEntries[i].DamageGiven;
                    }
                }
            }

            if (best != null)
            {
                // teleport
                best.Location = BasePeerless.GetSpawnPosition(Location, Map, 1);
                best.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                best.PlaySound(0x1FE);

                Timer.DelayCall(TimeSpan.FromSeconds(1), new TimerCallback(delegate()
                {
                    // poison
                    best.ApplyPoison(this, HitPoison);
                    best.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
                    best.PlaySound(0x474);
                }));

                m_Change = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(5, 10));
            }
        }
Exemplo n.º 25
0
		public virtual void OnGaveMeleeAttack( Mobile defender )
		{
			Poison p = HitPoison;

			if ( m_Paragon )
				p = PoisonImpl.IncreaseLevel( p );

			if ( p != null && HitPoisonChance >= Utility.RandomDouble() ) {
				defender.ApplyPoison( this, p );
				if ( this.Controlled )
					this.CheckSkill(SkillName.Poisoning, 0, this.Skills[SkillName.Poisoning].Cap);
			}

			if( AutoDispel && defender is BaseCreature && ((BaseCreature)defender).IsDispellable && AutoDispelChance > Utility.RandomDouble() )
				Dispel( defender );
		}
Exemplo n.º 26
0
        public bool ExecuteTrap(Mobile from, bool bAutoReset)
        {
            Point3D loc   = this.GetWorldLocation();
            Map     facet = this.Map;

            if (m_TrapType != TrapType.None && m_Enabled && CanDetonate(from))
            {
                if (from.AccessLevel >= AccessLevel.GameMaster)
                {
                    SendMessageTo(from, "That is trapped, but you open it with your godly powers.", 0x3B2);
                    return(false);
                }

                switch (m_TrapType)
                {
                case TrapType.ExplosionTrap:
                {
                    SendMessageTo(from, 502999, 0x3B2);                                     // You set off a trap!

                    if (from.InRange(loc, 3))
                    {
                        int damage;

                        // RunUO says 10, 30, but stratics says 5, 15
                        // http://replay.waybackmachine.org/20020402172114/http://uo.stratics.com/content/guides/tinkertraps/trapessay.shtml
                        if (m_TrapLevel > 0)
                        {
                            damage = Utility.RandomMinMax(5, 15) * m_TrapLevel;
                        }
                        else
                        {
                            damage = m_TrapPower;
                        }

                        if (m_Trapper != null && !m_Trapper.Deleted)
                        {
                            from.Aggressors.Add(AggressorInfo.Create(m_Trapper, from, true));
                        }

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

                        // Your skin blisters from the heat!
                        from.LocalOverheadMessage(Network.MessageType.Regular, 0x2A, 503000);
                    }

                    Effects.SendLocationEffect(loc, facet, 0x36BD, 15, 10);
                    Effects.PlaySound(loc, facet, 0x307);

                    break;
                }

                case TrapType.MagicTrap:
                {
                    if (from.InRange(loc, 1))
                    {
                        from.Damage(m_TrapPower);
                    }
                    //AOS.Damage( from, m_TrapPower, 0, 100, 0, 0, 0 );

                    Effects.PlaySound(loc, Map, 0x307);

                    Effects.SendLocationEffect(new Point3D(loc.X - 1, loc.Y, loc.Z), Map, 0x36BD, 15);
                    Effects.SendLocationEffect(new Point3D(loc.X + 1, loc.Y, loc.Z), Map, 0x36BD, 15);

                    Effects.SendLocationEffect(new Point3D(loc.X, loc.Y - 1, loc.Z), Map, 0x36BD, 15);
                    Effects.SendLocationEffect(new Point3D(loc.X, loc.Y + 1, loc.Z), Map, 0x36BD, 15);

                    Effects.SendLocationEffect(new Point3D(loc.X + 1, loc.Y + 1, loc.Z + 11), Map, 0x36BD, 15);

                    break;
                }

                case TrapType.DartTrap:
                {
                    SendMessageTo(from, 502999, 0x3B2);                                     // You set off a trap!

                    if (from.InRange(loc, 3))
                    {
                        int damage;

                        if (m_TrapLevel > 0)
                        {
                            damage = Utility.RandomMinMax(5, 15) * m_TrapLevel;
                        }
                        else
                        {
                            damage = m_TrapPower;
                        }

                        if (m_Trapper != null && !m_Trapper.Deleted)
                        {
                            from.Aggressors.Add(AggressorInfo.Create(m_Trapper, from, true));
                        }

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

                        // A dart imbeds itself in your flesh!
                        from.LocalOverheadMessage(Network.MessageType.Regular, 0x62, 502998);
                    }

                    Effects.PlaySound(loc, facet, 0x223);

                    break;
                }

                case TrapType.PoisonTrap:
                {
                    SendMessageTo(from, 502999, 0x3B2);                                     // You set off a trap!

                    if (from.InRange(loc, 3))
                    {
                        Poison poison;

                        if (m_Trapper != null && !m_Trapper.Deleted)
                        {
                            from.Aggressors.Add(AggressorInfo.Create(m_Trapper, from, true));
                        }

                        if (m_TrapLevel > 0)
                        {
                            poison = Poison.GetPoison(Math.Max(0, Math.Min(4, m_TrapLevel - 1)));
                        }
                        else
                        {
                            AOS.Damage(from, m_TrapPower, 0, 0, 0, 100, 0);
                            poison = Poison.Greater;
                        }

                        from.ApplyPoison(from, poison);

                        // You are enveloped in a noxious green cloud!
                        from.LocalOverheadMessage(Network.MessageType.Regular, 0x44, 503004);
                    }

                    Effects.SendLocationEffect(loc, facet, 0x113A, 10, 20);
                    Effects.PlaySound(loc, facet, 0x231);

                    break;
                }
                }

                // new style tinker traps remain trapped (auto reset)
                if (!bAutoReset)
                {
                    m_TrapType = TrapType.None;
                }

                return(true);
            }

            return(false);
        }
Exemplo n.º 27
0
        public static void ApplyDamageEffect(Mobile defender, Mobile attacker, AmmoTypes typeAmmo)
        {
            double luck = attacker.Luck * .02;

            int physicaldamage = (int)((100 - defender.GetResistance(ResistanceType.Physical)) * .07 + luck);
            int colddamage     = (int)((100 - defender.GetResistance(ResistanceType.Cold)) * .07 + luck);
            int firedamage     = (int)((100 - defender.GetResistance(ResistanceType.Fire)) * .07 + luck);
            int poisondamage   = (int)((100 - defender.GetResistance(ResistanceType.Poison)) * .07 + luck);
            int energydamage   = (int)((100 - defender.GetResistance(ResistanceType.Energy)) * .07 + luck);

            if (physicaldamage < 1)
            {
                physicaldamage = 1;
            }
            if (colddamage < 1)
            {
                colddamage = 1;
            }
            if (firedamage < 1)
            {
                firedamage = 1;
            }
            if (poisondamage < 1)
            {
                poisondamage = 1;
            }
            if (energydamage < 1)
            {
                energydamage = 1;
            }

            switch (typeAmmo)
            {
            case AmmoTypes.Oak:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    defender.Damage(physicaldamage, attacker);
                }
                else
                {
                    AOS.Damage(defender, Utility.Random(1, 5), 100, 0, 0, 0, 0);
                }

                break;
            }

            case AmmoTypes.Yew:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    defender.Damage(physicaldamage + 3, attacker);
                }
                else
                {
                    AOS.Damage(defender, Utility.Random(3, 6), 100, 0, 0, 0, 0);
                }

                break;
            }

            case AmmoTypes.Ash:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    SpellHelper.Damage(new FireballSpell(attacker, null), defender, Utility.RandomMinMax(10, 30), 0, 100, 0, 0, 0);
                    attacker.MovingParticles(defender, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
                    attacker.PlaySound(Core.AOS ? 0x15E : 0x44B);
                }
                else
                {
                    AOS.Damage(defender, Utility.Random(1, 5), 0, 100, 0, 0, 0);
                }

                break;
            }

            case AmmoTypes.Bloodwood:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    defender.PlaySound(0x133);
                    defender.FixedParticles(0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist);
                    BleedAttack.BeginBleed(defender, attacker);
                }
                else
                {
                    AOS.Damage(defender, Utility.Random(1, 5), 100, 0, 0, 0, 0);
                }

                break;
            }

            case AmmoTypes.Heartwood:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    defender.PlaySound(0xDD);
                    defender.FixedParticles(0x3728, 244, 25, 9941, 1266, 0, EffectLayer.Waist);

                    if (attacker.Skills[SkillName.Poisoning].Value > Utility.RandomMinMax(50, 250))
                    {
                        defender.ApplyPoison(attacker, Poison.Deadly);
                    }
                    else
                    {
                        defender.ApplyPoison(attacker, Poison.Regular);
                    }
                }
                else
                {
                    AOS.Damage(defender, Utility.Random(1, 5), 0, 0, 0, 100, 0);
                }

                break;
            }

            case AmmoTypes.Frostwood:
            {
                if ((0.15 + luck) > Utility.RandomDouble())
                {
                    TimeSpan duration = defender.Player ? TimeSpan.FromSeconds(4) : TimeSpan.FromSeconds(8);
                    defender.Paralyze(duration);
                    ParalyzingBlow.BeginImmunity(defender, duration + TimeSpan.FromSeconds(4));
                    defender.FixedEffect(0x376A, 9, 32);
                    defender.PlaySound(0x204);
                }
                else
                {
                    AOS.Damage(defender, Utility.Random(1, 5), 0, 100, 15, 0, 0);
                }

                break;
            }

            case AmmoTypes.DullCopper:
            {
                if ((0.3 + luck) > Utility.RandomDouble())
                {
                    AOS.Damage(defender, Utility.RandomMinMax(8, 18), true, 100, 0, 0, 0, 0);
                    defender.FixedParticles(0x3728, 1, 26, 0x26D6, 0, 0, EffectLayer.Waist);
                    defender.PlaySound(0x56);
                }
                else
                {
                    AOS.Damage(defender, Utility.Random(1, 8), 100, 0, 0, 0, 0);
                }

                break;
            }

            case AmmoTypes.ShadowIron:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    defender.Damage(energydamage, attacker);
                    defender.PlaySound(0x56);
                }
                else
                {
                    AOS.Damage(defender, 5, 0, 0, 0, 0, 40);
                }
                break;
            }

            case AmmoTypes.Copper:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    defender.Damage(energydamage, attacker);
                    defender.Damage(poisondamage, attacker);
                    defender.PlaySound(0x56);
                }
                else
                {
                    AOS.Damage(defender, 5, 0, 0, 0, 30, 30);
                }
                break;
            }

            case AmmoTypes.Bronze:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    defender.Damage(physicaldamage, attacker);
                    defender.Damage(firedamage, attacker);
                    defender.PlaySound(0x56);
                }
                else
                {
                    AOS.Damage(defender, 5, 15, 40, 0, 0, 0);
                }
                break;
            }

            case AmmoTypes.Gold:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    defender.Damage(physicaldamage, attacker);
                    defender.Damage(firedamage, attacker);
                    defender.Damage(colddamage, attacker);
                    defender.PlaySound(0x56);
                }
                else
                {
                    AOS.Damage(defender, 5, 20, 15, 15, 0, 0);
                }
                break;
            }

            case AmmoTypes.Agapite:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    defender.Damage(physicaldamage, attacker);
                    defender.Damage(firedamage, attacker);
                    defender.Damage(energydamage, attacker);
                    defender.PlaySound(0x56);
                }
                else
                {
                    AOS.Damage(defender, 5, 25, 30, 0, 0, 20);
                }
                break;
            }

            case AmmoTypes.Verite:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    defender.Damage(physicaldamage, attacker);
                    defender.Damage(poisondamage, attacker);
                    defender.Damage(energydamage, attacker);
                    defender.PlaySound(0x56);
                }
                else
                {
                    AOS.Damage(defender, 5, 30, 0, 0, 40, 20);
                }
                break;
            }

            case AmmoTypes.Valorite:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    defender.Damage(physicaldamage, attacker);
                    defender.Damage(firedamage, attacker);
                    defender.Damage(colddamage, attacker);
                    defender.Damage(poisondamage, attacker);
                    defender.Damage(energydamage, attacker);
                    defender.PlaySound(0x56);
                }
                else
                {
                    AOS.Damage(defender, 5, 50, 10, 20, 10, 20);
                }
                break;
            }

            default: break;
            }
        }
Exemplo n.º 28
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_belt.Deleted)
                {
                    return;
                }
                else if (targeted is Mobile)
                {
                    if (!BasePotion.HasFreeHand(from) && !BasePotion.HasBalancedWeapon(from))
                    {
                        from.SendLocalizedMessage(1063299);                           // You must have a free hand to throw shuriken.
                        return;
                    }

                    Mobile m = (Mobile)targeted;

                    double dist = from.GetDistanceToSqrt(m.Location);

                    if (m.Map != from.Map || dist > 11)
                    {
                        from.SendLocalizedMessage(500446);                           // That is too far away.
                        return;
                    }
                    else if (from.InRange(m, 2))
                    {
                        from.SendLocalizedMessage(1063303);                           // Your target is too close!
                        return;
                    }

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

                        from.Direction = to;

                        from.RevealingAction();

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

                        if (Fukiya.CheckHitChance(from, m))
                        {
                            from.MovingEffect(m, 0x27AC, 7, 1, false, false, 0x23A, 0);

                            AOS.Damage(m, from, Utility.Random(3, 5), 100, 0, 0, 0, 0);

                            if (m_belt.Poison != null && m_belt.PoisonCharges > 0)
                            {
                                --m_belt.PoisonCharges;

                                Poison poison   = m_belt.Poison;
                                int    maxLevel = from.Skills[SkillName.Poisoning].Fixed / 200;
                                if (poison.Level > maxLevel)
                                {
                                    poison = Poison.GetPoison(maxLevel);
                                }

                                m.ApplyPoison(from, poison);
                            }
                        }
                        else
                        {
                            from.MovingEffect(new Shuriken(), 0x27AC, 7, 1, false, false, 0x23A, 0);

                            from.SendMessage("You miss.");
                        }

                        // Throwing a shuriken restarts you weapon's swing delay
                        from.NextCombatTime = DateTime.Now + from.Weapon.GetDelay(from);

                        m_belt.UsesRemaining--;
                    }
                }
            }
Exemplo n.º 29
0
        public static void ApplyPoisonToPlayers(string arglist, Mobile triggermob, object refobject, out string status_str)
        {
            status_str = null;
            Item refitem = null;
            Mobile refmob = null;

            if (refobject is Item)
            {
                refitem = (Item)refobject;
            }
            else if (refobject is Mobile)
            {
                refmob = (Mobile)refobject;
            }

            // look for the other args
            string[] str = ParseString(arglist, 4, ",");
            bool playeronly = false;
            int range = 0;
            if (str.Length < 2)
            {
                status_str = "missing poisontype in POISON";
            }
            if (str.Length > 2)
            {
                // get the range arg
                try
                {
                    range = int.Parse(str[2]);
                }
                catch
                {
                    status_str = "bad range arg in POISON";
                }
            }
            if (str.Length > 3)
            {
                if (str[3].ToLower() == "playeronly")
                    playeronly = true;
            }
            try
            {
                if ((range > 0) || (triggermob != null && !triggermob.Deleted))
                {
                    // apply the poison to all players within range if range is > 0
                    if (range > 0)
                    {
                        IPooledEnumerable rangelist = null;
                        if (refitem != null && !refitem.Deleted)
                        {
                            rangelist = refitem.GetMobilesInRange(range);
                        }
                        else if (refmob != null && !refmob.Deleted)
                        {
                            rangelist = refmob.GetMobilesInRange(range);
                        }

                        if (rangelist != null)
                        {
                            foreach (Mobile p in rangelist)
                            {
                                if (p is PlayerMobile || !playeronly)
                                    p.ApplyPoison(p, Poison.Parse(str[1]));
                            }
                            rangelist.Free();
                        }
                    }
                    else
                    {
                        // just apply it to the mob who triggered
                        triggermob.ApplyPoison(triggermob, Poison.Parse(str[1]));
                    }
                }
            }
            catch
            {
            }
        }
Exemplo n.º 30
0
        public override void OnLocationChanged(Mobile m, Point3D oldLocation)
        {
            base.OnLocationChanged(m, oldLocation);

            if (m.Player)
            {
                if (m_Maze.HasTrap(m.Location))
                {
                    switch (Utility.Random(5))
                    {
                    default:
                    case 0:
                    {
                        AOS.Damage(m, Utility.RandomMinMax(70, 90), 0, 100, 0, 0, 0);

                        Effects.SendPacket(m.Location, m.Map, new GraphicalEffect(EffectType.FixedXYZ, Serial.Zero, Serial.Zero, 0x3709, m.Location, m.Location, 10, 30, true, false));
                        Effects.PlaySound(m.Location, m.Map, 0x54);

                        m.LocalOverheadMessage(MessageType.Regular, 238, 1010524, "");                                           // Searing heat scorches thy skin.

                        break;
                    }

                    case 1:
                    {
                        AOS.Damage(m, Utility.RandomMinMax(60, 80), 0, 0, 100, 0, 0);

                        Effects.PlaySound(m.Location, m.Map, 0x223);

                        m.LocalOverheadMessage(MessageType.Regular, 98, 1010525, "");                                           // Pain lances through thee from a sharp metal blade.

                        break;
                    }

                    case 2:
                    {
                        AOS.Damage(m, Utility.RandomMinMax(55, 75), 0, 0, 0, 0, 100);

                        Effects.SendPacket(m.Location, m.Map, new GraphicalEffect(EffectType.Lightning, m.Serial, Serial.Zero, 0, m.Location, m.Location, 0, 0, false, false));
                        Effects.SendPacket(m.Location, m.Map, new ParticleEffect(EffectType.FixedFrom, m.Serial, Serial.Zero, 0, m.Location, m.Location, 0, 0, false, false, 0, 0, 0x13A7, 0, 0, m.Serial, (int)Layer.Shoes, 0));
                        Effects.PlaySound(m.Location, m.Map, 0x29);

                        m.LocalOverheadMessage(MessageType.Regular, 218, 1010526, "");                                           // Lightning arcs through thy body.

                        break;
                    }

                    case 3:
                    {
                        m.ApplyPoison(m, Poison.Deadly);

                        Effects.SendPacket(m.Location, m.Map, new GraphicalEffect(EffectType.FixedXYZ, Serial.Zero, Serial.Zero, 0x113A, m.Location, m.Location, 10, 20, true, false));
                        Effects.PlaySound(m.Location, m.Map, 0x231);

                        m.LocalOverheadMessage(MessageType.Regular, 68, 1010523, "");                                           // A toxic vapor envelops thee.

                        break;
                    }

                    case 4:
                    {
                        Point3D location1 = m.Location;
                        location1.Z = 49;

                        Point3D location2 = m.Location;
                        location2.Z = -1;

                        Effects.SendPacket(m, m.Map, new HuedEffect(EffectType.Moving, Serial.Zero, m.Serial, 0x11B7, location1, location2, 20, 0, true, true, 0, 0));
                        Effects.PlaySound(new Point3D(m.X, m.Y, -1), m.Map, m.Female ? 0x14B : 0x154);
                        Effects.PlaySound(new Point3D(m.X, m.Y, -1), m.Map, 0x307);

                        m.Send(new AsciiMessage(Serial.MinusOne, 0xFFFF, MessageType.Label, 0x66D, 3, "", "A speeding rock hits you in the head!"));

                        AOS.Damage(m, Utility.RandomMinMax(60, 80), 100, 0, 0, 0, 0);

                        m.SendLocalizedMessage(502382);                                           // You can move!

                        if (Utility.RandomBool())
                        {
                            Effects.SendPacket(m, m.Map, new GraphicalEffect(EffectType.FixedXYZ, Serial.Zero, Serial.Zero, 0x36BD, new Point3D(m.X, m.Y, 0), new Point3D(m.X, m.Y, 0), 20, 10, true, false));
                            Effects.SendPacket(m, m.Map, new GraphicalEffect(EffectType.FixedFrom, m.Serial, Serial.Zero, 0x36BD, new Point3D(m.X, m.Y, -1), new Point3D(m.X, m.Y, -1), 20, 10, true, false));

                            for (int k = 0; k < 5; k++)
                            {
                                Effects.SendPacket(m, m.Map, new GraphicalEffect(EffectType.Moving, Serial.Zero, Serial.Zero, 0x1363 + Utility.Random(0, 11), new Point3D(m.X, m.Y, 0), new Point3D(m.X, m.Y, 0), 5, 0, false, false));

                                Effects.PlaySound(new Point3D(m.X, m.Y, -1), m.Map, 0x13F);
                                Effects.PlaySound(new Point3D(m.X, m.Y, -1), m.Map, 0x154);
                            }

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

                            m.Say("OUCH!");
                            m.Send(new AsciiMessage(Serial.MinusOne, 0xFFFF, MessageType.Label, 0x66D, 3, "", "You are pinned down by the weight of the boulder!!!"));
                        }

                        break;
                    }
                    }
                }
                else if (m.Backpack.FindItemByType <GoldenCompass>(false) != null)
                {
                    m.CloseGump <CompassGump>();
                    m.SendGump(new CompassGump(m_Maze.GetCompassDirection(m.Location)));
                }
            }
        }
Exemplo n.º 31
0
 public override void BreathDealDamage(Mobile target)
 {
     target.ApplyPoison(this, Poison.Deadly);
 }
Exemplo n.º 32
0
        public virtual void Pour_OnTarget(Mobile from, object targ)
        {
            if (IsEmpty || !Pourable || !ValidateUse(from, false))
            {
                return;
            }

            if (targ is BaseBeverage)
            {
                BaseBeverage bev = (BaseBeverage)targ;

                if (!bev.ValidateUse(from, true))
                {
                    return;
                }

                if (bev.IsFull && bev.Content == this.Content)
                {
                    from.SendLocalizedMessage(500848);                       // Couldn't pour it there.  It was already full.
                }
                else if (!bev.IsEmpty)
                {
                    from.SendLocalizedMessage(500846);                       // Can't pour it there.
                }
                else
                {
                    bev.Content  = this.Content;
                    bev.Poison   = this.Poison;
                    bev.Poisoner = this.Poisoner;

                    if (this.Quantity > bev.MaxQuantity)
                    {
                        bev.Quantity   = bev.MaxQuantity;
                        this.Quantity -= bev.MaxQuantity;
                    }
                    else
                    {
                        bev.Quantity += this.Quantity;
                        this.Quantity = 0;
                    }

                    from.PlaySound(0x4E);
                }
            }
            else if (from == targ)
            {
                if (from.Thirst < 20)
                {
                    from.Thirst += 1;
                }

                if (ContainsAlchohol)
                {
                    int bac = 0;

                    switch (this.Content)
                    {
                    case BeverageType.Ale:
                        bac = 1;
                        break;

                    case BeverageType.Wine:
                        bac = 2;
                        break;

                    case BeverageType.Cider:
                        bac = 3;
                        break;

                    case BeverageType.Liquor:
                        bac = 4;
                        break;

                    case BeverageType.Champagne:
                        bac = 5;
                        break;

                    case BeverageType.Gluhwein:
                        bac = 6;
                        break;

                    case BeverageType.Eggnog:
                        bac = 7;
                        break;
                    }

                    from.BAC += bac;

                    if (from.BAC > 60)
                    {
                        from.BAC = 60;
                    }

                    CheckHeaveTimer(from);
                }

                from.PlaySound(Utility.RandomList(0x30, 0x2D6));

                if (m_Poison != null)
                {
                    from.ApplyPoison(m_Poisoner, m_Poison);
                }

                --Quantity;
            }
            else if (targ is PlantItem)
            {
                ((PlantItem)targ).Pour(from, this);
            }
            else if (targ is AddonComponent && (((AddonComponent)targ).Addon is WaterVatEast || ((AddonComponent)targ).Addon is WaterVatSouth) && this.Content == BeverageType.Water)
            {
                PlayerMobile player = from as PlayerMobile;

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

                    if (qs != null)
                    {
                        QuestObjective obj = qs.FindObjective(typeof(GatherWaterObjective));

                        if (obj != null && !obj.Completed)
                        {
                            BaseAddon vat = ((AddonComponent)targ).Addon;

                            if (vat.X > 5784 && vat.X < 5814 && vat.Y > 1903 && vat.Y < 1934 && ((qs.RedSolen && vat.Map == Map.Trammel) || (!qs.RedSolen && vat.Map == Map.Felucca)))
                            {
                                if (obj.CurProgress + Quantity > obj.MaxProgress)
                                {
                                    int delta = obj.MaxProgress - obj.CurProgress;

                                    Quantity       -= delta;
                                    obj.CurProgress = obj.MaxProgress;
                                }
                                else
                                {
                                    obj.CurProgress += Quantity;
                                    Quantity         = 0;
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(500846);                   // Can't pour it there.
            }
        }
Exemplo n.º 33
0
        private void DoCounter(Mobile attacker)
        {
            if (this.Map == null)
            {
                return;
            }

            if (attacker is BaseCreature && ((BaseCreature)attacker).BardProvoked)
            {
                return;
            }

            if (0.20 > Utility.RandomDouble())
            {
                Mobile target = null;

                if (attacker is BaseCreature)
                {
                    Mobile m = ((BaseCreature)attacker).GetMaster();

                    if (m != null)
                    {
                        target = m;
                    }
                }

                if (target == null || !target.InRange(this, 15))
                {
                    target = attacker;
                }

                this.Animate(10, 4, 1, true, false, 0);

                ArrayList targets = new ArrayList();

                foreach (Mobile m in target.GetMobilesInRange(8))
                {
                    if (m == this || !this.CanBeHarmful(m))
                    {
                        continue;
                    }

                    if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != this.Team))
                    {
                        targets.Add(m);
                    }
                    else if (m.Player && m.Alive)
                    {
                        targets.Add(m);
                    }
                }

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

                    this.DoHarmful(m);

                    AOS.Damage(m, this, Utility.RandomMinMax(35, 45), true, 0, 0, 100, 0, 0);

                    m.FixedParticles(0x36E4, 1, 10, 0x1F78, 0x47F, 0, (EffectLayer)255);
                    m.ApplyPoison(this, Poison.Lethal);
                }
            }
        }
Exemplo n.º 34
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!Movable)
            {
                from.SendMessage("That cannot move so you cannot identify it.");
                return;
            }
            else if (!from.InRange(this.GetWorldLocation(), 3))
            {
                from.SendMessage("You will need to get closer to identify that.");
                return;
            }
            else if (!IsChildOf(from.Backpack) && Server.Misc.MyServerSettings.IdentifyItemsOnlyInPack())
            {
                from.SendMessage("This must be in your backpack to identify.");
                return;
            }
            else
            {
                if (from.CheckSkill(SkillName.TasteID, -5, 125))
                {
                    int QtyBonus = 0;
                    if (from.Skills[SkillName.Cooking].Value >= 25.0)
                    {
                        QtyBonus = (int)(from.Skills[SkillName.Cooking].Value / 5);
                    }

                    from.PlaySound(Utility.Random(0x3A, 3));

                    if (from.Body.IsHuman && !from.Mounted)
                    {
                        from.Animate(34, 5, 1, true, false, 0);
                    }

                    int RegCount = this.RegAmount + QtyBonus;
                    if (RegCount < 1)
                    {
                        RegCount = 1;
                    }

                    Server.Items.UnknownReagent.GiveReagent(from, RegCount);
                }
                else
                {
                    int nReaction = Utility.RandomMinMax(0, 10);

                    if (nReaction < 3)
                    {
                        from.PlaySound(from.Female ? 813 : 1087);
                        from.Say("*vomits*");
                        if (!from.Mounted)
                        {
                            from.Animate(32, 5, 1, true, false, 0);
                        }
                        Vomit puke = new Vomit();
                        puke.Map      = from.Map;
                        puke.Location = from.Location;
                        from.SendMessage("Making you sick to your stomach, you toss it out.");
                    }
                    else if (nReaction > 6)
                    {
                        int nPoison = Utility.RandomMinMax(0, 10);
                        from.Say("Poison!");
                        from.PlaySound(Utility.Random(0x3A, 3));
                        if (nPoison > 9)
                        {
                            from.ApplyPoison(from, Poison.Deadly);
                        }
                        else if (nPoison > 7)
                        {
                            from.ApplyPoison(from, Poison.Greater);
                        }
                        else if (nPoison > 4)
                        {
                            from.ApplyPoison(from, Poison.Regular);
                        }
                        else
                        {
                            from.ApplyPoison(from, Poison.Lesser);
                        }
                        from.SendMessage("Poison!");
                    }
                    else
                    {
                        from.PlaySound(Utility.Random(0x3A, 3));
                        if (from.Body.IsHuman && !from.Mounted)
                        {
                            from.Animate(34, 5, 1, true, false, 0);
                        }
                        from.SendMessage("Failing to identify the reagent, you toss it out.");
                    }
                }

                this.Delete();
            }
        }
Exemplo n.º 35
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendMessage("This must be in your backpack to use.");
                return;
            }
            else
            {
                if (from.CheckSkill(SkillName.TasteID, -5, 125))
                {
                    if (from.Body.IsHuman && !from.Mounted)
                    {
                        from.Animate(34, 5, 1, true, false, 0);
                    }

                    from.PlaySound(0x2D6);

                    if (Server.Misc.IntelligentAction.TestForReagent(from, "undertaker") && Utility.RandomMinMax(1, 5) == 1)
                    {
                        Item jar = new BottleOfParts();
                        Server.Items.BottleOfParts.FillJar("", Utility.RandomMinMax(1, 90), jar);
                        from.AddToBackpack(jar);
                        from.SendMessage("This seems to be a " + jar.Name + ".");
                    }
                    else
                    {
                        int min    = 0;
                        int max    = 39;
                        int extras = 0;

                        if (from.Skills[SkillName.Forensics].Value >= 50 && from.Skills[SkillName.Necromancy].Value >= 50 && from.Skills[SkillName.SpiritSpeak].Value >= 50)
                        {
                            extras++;
                            max = 55;
                        }
                        if (from.Skills[SkillName.Cooking].Value >= 50 && from.Skills[SkillName.AnimalLore].Value >= 50 && from.Skills[SkillName.AnimalTaming].Value >= 50)
                        {
                            extras++;
                            extras++;
                            max = 55;
                        }

                        if (extras > 2)
                        {
                            extras = Utility.RandomMinMax(1, 2); max = 55;
                        }

                        int    potionType = Utility.RandomMinMax(min, max);
                        string potionName = "";

                        if (Utility.RandomMinMax(1, 125) <= from.Skills[SkillName.Cooking].Value)                             // COOKS CAN FIND A POTION 1 LEVEL HIGHER
                        {
                            if (potionType == 1)
                            {
                                potionType++;
                            }
                            else if (potionType == 2)
                            {
                                potionType++;
                            }
                            else if (potionType == 4)
                            {
                                potionType++;
                            }
                            else if (potionType == 6)
                            {
                                potionType++;
                            }
                            else if (potionType == 8)
                            {
                                potionType++;
                            }
                            else if (potionType == 9)
                            {
                                potionType++;
                            }
                            else if (potionType == 10)
                            {
                                potionType++;
                            }
                            else if (potionType == 11)
                            {
                                potionType = 38;
                            }
                            else if (potionType == 12)
                            {
                                potionType++;
                            }
                            else if (potionType == 14)
                            {
                                potionType++;
                            }
                            else if (potionType == 15)
                            {
                                potionType++;
                            }
                            else if (potionType == 17)
                            {
                                potionType++;
                            }
                            else if (potionType == 18)
                            {
                                potionType++;
                            }
                            else if (potionType == 20)
                            {
                                potionType++;
                            }
                            else if (potionType == 21)
                            {
                                potionType++;
                            }
                            else if (potionType == 23)
                            {
                                potionType++;
                            }
                            else if (potionType == 24)
                            {
                                potionType++;
                            }
                            else if (potionType == 26)
                            {
                                potionType++;
                            }
                            else if (potionType == 27)
                            {
                                potionType++;
                            }
                        }

                        if (potionType == 0)
                        {
                            from.AddToBackpack(new NightSightPotion()); potionName = "night sight potion";
                        }
                        else if (potionType == 1)
                        {
                            from.AddToBackpack(new LesserCurePotion()); potionName = "lesser cure potion";
                        }
                        else if (potionType == 2)
                        {
                            from.AddToBackpack(new CurePotion()); potionName = "cure potion";
                        }
                        else if (potionType == 3)
                        {
                            from.AddToBackpack(new GreaterCurePotion()); potionName = "greater cure potion";
                        }
                        else if (potionType == 4)
                        {
                            from.AddToBackpack(new AgilityPotion()); potionName = "agility potion";
                        }
                        else if (potionType == 5)
                        {
                            from.AddToBackpack(new GreaterAgilityPotion()); potionName = "greater agility potion";
                        }
                        else if (potionType == 6)
                        {
                            from.AddToBackpack(new StrengthPotion()); potionName = "strength";
                        }
                        else if (potionType == 7)
                        {
                            from.AddToBackpack(new GreaterStrengthPotion()); potionName = "greater strength potion";
                        }
                        else if (potionType == 8)
                        {
                            from.AddToBackpack(new LesserPoisonPotion()); potionName = "lesser poison";
                        }
                        else if (potionType == 9)
                        {
                            from.AddToBackpack(new PoisonPotion()); potionName = "poison";
                        }
                        else if (potionType == 10)
                        {
                            from.AddToBackpack(new GreaterPoisonPotion()); potionName = "greater poison";
                        }
                        else if (potionType == 11)
                        {
                            from.AddToBackpack(new DeadlyPoisonPotion()); potionName = "deadly poison";
                        }
                        else if (potionType == 12)
                        {
                            from.AddToBackpack(new RefreshPotion()); potionName = "refresh potion";
                        }
                        else if (potionType == 13)
                        {
                            from.AddToBackpack(new TotalRefreshPotion()); potionName = "total refresh potion";
                        }
                        else if (potionType == 14)
                        {
                            from.AddToBackpack(new LesserHealPotion()); potionName = "lesser heal potion";
                        }
                        else if (potionType == 15)
                        {
                            from.AddToBackpack(new HealPotion()); potionName = "heal potion";
                        }
                        else if (potionType == 16)
                        {
                            from.AddToBackpack(new GreaterHealPotion()); potionName = "greater heal potion";
                        }
                        else if (potionType == 17)
                        {
                            from.AddToBackpack(new LesserExplosionPotion()); potionName = "lesser explosion potion";
                        }
                        else if (potionType == 18)
                        {
                            from.AddToBackpack(new ExplosionPotion()); potionName = "explosion potion";
                        }
                        else if (potionType == 19)
                        {
                            from.AddToBackpack(new GreaterExplosionPotion()); potionName = "greater explosion potion";
                        }
                        else if (potionType == 20)
                        {
                            from.AddToBackpack(new LesserInvisibilityPotion()); potionName = "lesser invisibility potion";
                        }
                        else if (potionType == 21)
                        {
                            from.AddToBackpack(new InvisibilityPotion()); potionName = "invisibility potion";
                        }
                        else if (potionType == 22)
                        {
                            from.AddToBackpack(new GreaterInvisibilityPotion()); potionName = "greater invisibility potion";
                        }
                        else if (potionType == 23)
                        {
                            from.AddToBackpack(new LesserRejuvenatePotion()); potionName = "lesser rejuvenation potion";
                        }
                        else if (potionType == 24)
                        {
                            from.AddToBackpack(new RejuvenatePotion()); potionName = "rejuvenation potion";
                        }
                        else if (potionType == 25)
                        {
                            from.AddToBackpack(new GreaterRejuvenatePotion()); potionName = "greater rejuvenation potion";
                        }
                        else if (potionType == 26)
                        {
                            from.AddToBackpack(new LesserManaPotion()); potionName = "lesser mana potion";
                        }
                        else if (potionType == 27)
                        {
                            from.AddToBackpack(new ManaPotion()); potionName = "mana potion";
                        }
                        else if (potionType == 28)
                        {
                            from.AddToBackpack(new GreaterManaPotion()); potionName = "greater mana potion";
                        }
                        else if (potionType == 29)
                        {
                            from.AddToBackpack(new InvulnerabilityPotion()); potionName = "invulnerability potion";
                        }
                        else if (potionType == 30)
                        {
                            from.AddToBackpack(new AutoResPotion()); potionName = "resurrection potion";
                        }
                        else if (potionType == 31)
                        {
                            from.AddToBackpack(new OilMetal()); potionName = "metal enhancement oil";
                        }
                        else if (potionType == 32)
                        {
                            from.AddToBackpack(new OilLeather()); potionName = "leather enhancement oil";
                        }
                        else if (potionType == 33)
                        {
                            from.AddToBackpack(new BottleOfAcid()); potionName = "acid";
                        }
                        else if (potionType == 34)
                        {
                            from.AddToBackpack(new MagicalDyes()); potionName = "magical dye";
                        }
                        else if (potionType == 35)
                        {
                            from.AddToBackpack(new BeverageBottle(BeverageType.Ale)); potionName = "ale";
                        }
                        else if (potionType == 36)
                        {
                            from.AddToBackpack(new BeverageBottle(BeverageType.Wine)); potionName = "wine";
                        }
                        else if (potionType == 37)
                        {
                            from.AddToBackpack(new BeverageBottle(BeverageType.Liquor)); potionName = "liquor";
                        }
                        else if (potionType == 38)
                        {
                            from.AddToBackpack(new LethalPoisonPotion()); potionName = "lethal poison";
                        }
                        else if (potionType == 39)
                        {
                            from.AddToBackpack(new OilWood()); potionName = "wood enhancement oil";
                        }

                        if (extras == 1)
                        {
                            if (potionType == 40)
                            {
                                from.AddToBackpack(new HellsGateScroll()); potionName = "demonic fire ooze";
                            }
                            else if (potionType == 41)
                            {
                                from.AddToBackpack(new ManaLeechScroll()); potionName = "lich leech mixture";
                            }
                            else if (potionType == 42)
                            {
                                from.AddToBackpack(new NecroCurePoisonScroll()); potionName = "disease curing concoction";
                            }
                            else if (potionType == 43)
                            {
                                from.AddToBackpack(new NecroPoisonScroll()); potionName = "disease draught";
                            }
                            else if (potionType == 44)
                            {
                                from.AddToBackpack(new NecroUnlockScroll()); potionName = "tomb raiding concoction";
                            }
                            else if (potionType == 45)
                            {
                                from.AddToBackpack(new PhantasmScroll()); potionName = "phantasm elixir";
                            }
                            else if (potionType == 46)
                            {
                                from.AddToBackpack(new RetchedAirScroll()); potionName = "retched air elixir";
                            }
                            else if (potionType == 47)
                            {
                                from.AddToBackpack(new SpectreShadowScroll()); potionName = "spectre shadow elixir";
                            }
                            else if (potionType == 48)
                            {
                                from.AddToBackpack(new UndeadEyesScroll()); potionName = "eyes of the dead mixture";
                            }
                            else if (potionType == 49)
                            {
                                from.AddToBackpack(new VampireGiftScroll()); potionName = "vampire blood draught";
                            }
                            else if (potionType == 50)
                            {
                                from.AddToBackpack(new WallOfSpikesScroll()); potionName = "wall of spikes draught";
                            }
                            else if (potionType == 51)
                            {
                                from.AddToBackpack(new BloodPactScroll()); potionName = "blood pact elixir";
                            }
                            else if (potionType == 52)
                            {
                                from.AddToBackpack(new GhostlyImagesScroll()); potionName = "ghostly images draught";
                            }
                            else if (potionType == 53)
                            {
                                from.AddToBackpack(new GhostPhaseScroll()); potionName = "ghost phase concoction";
                            }
                            else if (potionType == 54)
                            {
                                from.AddToBackpack(new GraveyardGatewayScroll()); potionName = "black gate draught";
                            }
                            else if (potionType == 55)
                            {
                                from.AddToBackpack(new HellsBrandScroll()); potionName = "hellish branding ooze";
                            }
                        }

                        if (extras == 2)
                        {
                            if (potionType == 40)
                            {
                                from.AddToBackpack(new ShieldOfEarthPotion()); potionName = "shield of earth liquid";
                            }
                            else if (potionType == 41)
                            {
                                from.AddToBackpack(new WoodlandProtectionPotion()); potionName = "woodland protection oil";
                            }
                            else if (potionType == 42)
                            {
                                from.AddToBackpack(new ProtectiveFairyPotion()); potionName = "fairy in a bottle";
                            }
                            else if (potionType == 43)
                            {
                                from.AddToBackpack(new HerbalHealingPotion()); potionName = "herbal healing elixir";
                            }
                            else if (potionType == 44)
                            {
                                from.AddToBackpack(new GraspingRootsPotion()); potionName = "grasping roots mixture";
                            }
                            else if (potionType == 45)
                            {
                                from.AddToBackpack(new BlendWithForestPotion()); potionName = "forest blending oil";
                            }
                            else if (potionType == 46)
                            {
                                from.AddToBackpack(new SwarmOfInsectsPotion()); potionName = "bottle of insects";
                            }
                            else if (potionType == 47)
                            {
                                from.AddToBackpack(new VolcanicEruptionPotion()); potionName = "volcanic fluid";
                            }
                            else if (potionType == 48)
                            {
                                from.AddToBackpack(new TreefellowPotion()); potionName = "treant fertilizer";
                            }
                            else if (potionType == 49)
                            {
                                from.AddToBackpack(new StoneCirclePotion()); potionName = "stone rising concoction";
                            }
                            else if (potionType == 50)
                            {
                                from.AddToBackpack(new DruidicRunePotion()); potionName = "druidic marking oil";
                            }
                            else if (potionType == 51)
                            {
                                from.AddToBackpack(new LureStonePotion()); potionName = "stone in a bottle";
                            }
                            else if (potionType == 52)
                            {
                                from.AddToBackpack(new NaturesPassagePotion()); potionName = "nature passage mixture";
                            }
                            else if (potionType == 53)
                            {
                                from.AddToBackpack(new MushroomGatewayPotion()); potionName = "mushroom gateway growth";
                            }
                            else if (potionType == 54)
                            {
                                from.AddToBackpack(new RestorativeSoilPotion()); potionName = "bottle of magical mud";
                            }
                            else if (potionType == 55)
                            {
                                from.AddToBackpack(new FireflyPotion()); potionName = "bottle of fireflies";
                            }
                        }

                        if (potionName == "")
                        {
                            from.AddToBackpack(new BeverageBottle(BeverageType.Ale)); potionName = "ale";
                        }

                        from.SendMessage("This seems to be a bottle of " + potionName + ".");
                    }
                }
                else
                {
                    int nReaction = Utility.RandomMinMax(0, 10);

                    if (nReaction == 1)
                    {
                        from.PlaySound(from.Female ? 813 : 1087);
                        from.Say("*vomits*");
                        if (!from.Mounted)
                        {
                            from.Animate(32, 5, 1, true, false, 0);
                        }
                        Vomit puke = new Vomit();
                        puke.Map      = from.Map;
                        puke.Location = from.Location;
                        from.SendMessage("You fail to identify the liquid, convulsing and spilling the bottle.");
                    }
                    else if (nReaction == 2)
                    {
                        from.PlaySound(from.Female ? 798 : 1070);
                        from.Say("*hiccup!*");
                        from.SendMessage("You fail to identify the liquid, spasming and spilling the bottle.");
                    }
                    else if (nReaction == 3)
                    {
                        from.PlaySound(from.Female ? 792 : 1064);
                        from.Say("*farts*");
                        from.SendMessage("You fail to identify the liquid, feeling gassy...you dump it out.");
                    }
                    else if (nReaction == 4)
                    {
                        from.PlaySound(from.Female ? 785 : 1056);
                        from.Say("*cough!*");
                        if (!from.Mounted)
                        {
                            from.Animate(33, 5, 1, true, false, 0);
                        }
                        from.SendMessage("You fail to identify the liquid, coughing and spilling the bottle.");
                    }
                    else if (nReaction == 5)
                    {
                        from.PlaySound(from.Female ? 748 : 1055);
                        from.Say("*clears throat*");
                        if (!from.Mounted)
                        {
                            from.Animate(33, 5, 1, true, false, 0);
                        }
                        from.SendMessage("You fail to identify the liquid, hurting your throat...you dump out the bottle.");
                    }
                    else if (nReaction == 6)
                    {
                        from.PlaySound(from.Female ? 782 : 1053);
                        from.Say("*burp!*");
                        if (!from.Mounted)
                        {
                            from.Animate(33, 5, 1, true, false, 0);
                        }
                        from.SendMessage("You fail to identify the liquid, accidentally drinking the entire bottle.");
                    }
                    else if (nReaction > 6)
                    {
                        int nPoison = Utility.RandomMinMax(0, 10);
                        from.Say("Poison!");
                        Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 63, 7, 9915, 0);
                        from.PlaySound(Utility.RandomList(0x30, 0x2D6));
                        if (nPoison > 9)
                        {
                            from.ApplyPoison(from, Poison.Deadly);
                        }
                        else if (nPoison > 7)
                        {
                            from.ApplyPoison(from, Poison.Greater);
                        }
                        else if (nPoison > 4)
                        {
                            from.ApplyPoison(from, Poison.Regular);
                        }
                        else
                        {
                            from.ApplyPoison(from, Poison.Lesser);
                        }
                        from.SendMessage("Poison!");
                    }
                    else
                    {
                        from.PlaySound(from.Female ? 820 : 1094);
                        from.Say("*spits*");
                        if (!from.Mounted)
                        {
                            from.Animate(6, 5, 1, true, false, 0);
                        }
                        from.SendMessage("You fail to identify the liquid, spitting it out and dumping the bottle.");
                    }
                }

                this.Delete();
            }
        }
Exemplo n.º 36
0
        //public void OnAttack(Mobile from)
        public override void OnDoubleClick(Mobile from)
        //public override void OnDoubleClick(Mobile from) I'd rather had this work, oh well.
        {
            if (!from.InRange(GetWorldLocation(), 2))
            {
                from.SendLocalizedMessage(500446); // That is too far away. 
            }
            else
            {
                Effects.SendLocationEffect(Location, Map, 0x3728, 20, 10); //smoke or dust
                Effects.PlaySound(Location, Map, 0x11C);

                switch (Utility.Random(10))  //picks one of the following
                {
                    case 0:
                        Effects.SendLocationEffect(from, from.Map, 0x113A, 20, 10); //Posion Player
                        from.PlaySound(0x231);
                        from.ApplyPoison(from, Poison.Regular);
                        break;
                    case 1:
                        Effects.SendLocationEffect(from, from.Map, 0x3709, 30);//Burn Player
                        from.PlaySound(0x54);
                        AOS.Damage(from, from, Utility.RandomMinMax(10, 40), 0, 100, 0, 0, 0);
                        break;
                    case 2:
                        new BarrelLid().MoveToWorld(Location, Map);
                        break;
                    case 3:
                        new BarrelHoops().MoveToWorld(Location, Map);
                        break;
                    case 4:
                        new BarrelStaves().MoveToWorld(Location, Map);
                        break;
                    case 5:
                        Gold g = new Gold(Utility.Random(500)); //Random amount of gold 0 - 500
                        g.MoveToWorld(Location, Map);
                        break;
                    case 6:
                        new CurePotion().MoveToWorld(Location, Map);
                        break;
                    case 7:
                        new GreaterCurePotion().MoveToWorld(Location, Map);
                        break;
                    case 8:
                        new HealPotion().MoveToWorld(Location, Map);
                        break;
                    case 9:
                        new GreaterHealPotion().MoveToWorld(Location, Map);
                        break;
                }
                Destroy();
            }
        }
Exemplo n.º 37
0
        public override void OnHit(Mobile defender, ref int damage)
        {
            BaseWeapon weapon = GetWeapon();

            if (!CheckWeapon())
            {
                return;
            }

            Poison p = weapon.Poison;

            if (p == null || weapon.PoisonCharges <= 0)
            {
                Caster.SendLocalizedMessage(1061141); // Your weapon must have a dose of poison to perform an infectious strike!
                return;
            }

            // Skill Masteries
            int noChargeChance = MasteryInfo.NonPoisonConsumeChance(Caster);

            if (noChargeChance == 0 || noChargeChance < Utility.Random(100))
            {
                --weapon.PoisonCharges;
            }
            else
            {
                Caster.SendLocalizedMessage(1156095); // Your mastery of poisoning allows you to use your poison charge without consuming it.
            }
            int maxLevel = Caster.Skills[SkillName.Poisoning].Fixed / 200;

            if (maxLevel < 0)
            {
                maxLevel = 0;
            }

            #region Mondain's Legacy
            if (p == Poison.DarkGlow)
            {
                p = Poison.GetPoison(10 + Math.Min(maxLevel, 2));
            }
            else if (p == Poison.Parasitic)
            {
                p = Poison.GetPoison(14 + Math.Min(maxLevel, 3));
            }
            else if (p.Level > maxLevel)
            {
                p = Poison.GetPoison(maxLevel);
            }
            #endregion

            if ((Caster.Skills[SkillName.Poisoning].Value / 100.0) > Utility.RandomDouble() && p.Level < 3)
            {
                int    level     = p.Level + 1;
                Poison newPoison = Poison.GetPoison(level);

                if (newPoison != null)
                {
                    p = newPoison;

                    Caster.SendLocalizedMessage(1060080);   // Your precise strike has increased the level of the poison by 1
                    defender.SendLocalizedMessage(1060081); // The poison seems extra effective!
                }
            }

            defender.PlaySound(0xDD);
            defender.FixedParticles(0x3728, 244, 25, 9941, 1266, 0, EffectLayer.Waist);

            if (defender.ApplyPoison(Caster, p) != ApplyPoisonResult.Immune)
            {
                Caster.SendLocalizedMessage(1008096, true, defender.Name);  // You have poisoned your target :
                defender.SendLocalizedMessage(1008097, false, Caster.Name); //  : poisoned you!
            }

            int malus = 30;

            if (defender is PlayerMobile)
            {
                malus /= 2;
            }

            if (weapon is BaseRanged)
            {
                malus /= 2;
            }

            ResistanceMod mod = new ResistanceMod(ResistanceType.Poison, -malus);
            defender.AddResistanceMod(mod);

            // ~2_NAME~ reduces your poison resistance by ~1_VAL~.
            BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.InjectedStrikeDebuff, 1155927, 1156133, TimeSpan.FromSeconds(7), defender, string.Format("{0}\t{1}", malus, Caster.Name)));

            Server.Timer.DelayCall(TimeSpan.FromSeconds(7), () =>
            {
                defender.RemoveResistanceMod(mod);
            });

            Expire();
        }
Exemplo n.º 38
0
        public override bool OnFailDisarm(Mobile from)
        {
            bool bExploded = false;

            double rtskill = from.Skills[SkillName.RemoveTrap].Value;

            double chance = (TrapPower - rtskill) / 800;

            //make sure there's some chance to trip
            if (chance <= 0)
            {
                chance = .005;                           //minimum of 1/200 trip
            }
            if (chance >= 1)
            {
                chance = .995;
            }
            chance *= TrapSensitivity;

            //debug message only available to non-Player level
            if (from.AccessLevel > AccessLevel.Player)
            {
                from.SendMessage("Chance to trip trap: " + chance);
            }

            if (Utility.RandomDouble() < chance)
            {             //trap is tripped, effect disarmer
                int damage   = TrapPower / 2 + (Utility.Random(4, 12) * TrapPower / 25) - (int)rtskill / 5;
                int traptype = 0;
                traptype = Utility.Random(0, 3);

                switch (traptype)
                {
                case 0:                                //explosion
                {
                    from.SendLocalizedMessage(502999); // You set off a trap!

                    if (from.InRange(GetWorldLocation(), 2))
                    {
                        AOS.Damage(from, damage, 0, 100, 0, 0, 0);
                        from.SendLocalizedMessage(503000);                                   // Your skin blisters from the heat!
                    }

                    Point3D loc = GetWorldLocation();

                    Effects.PlaySound(loc, Map, 0x307);
                    Effects.SendLocationEffect(new Point3D(loc.X + 1, loc.Y + 1, loc.Z - 11), Map, 0x36BD, 15);

                    break;
                }

                case 1:                                //dart
                {
                    from.SendLocalizedMessage(502999); // You set off a trap!

                    if (from.InRange(GetWorldLocation(), 2))
                    {
                        AOS.Damage(from, damage / 2, 100, 0, 0, 0, 0);
                        from.SendLocalizedMessage(502380);                                   // A dart embeds...
                    }

                    Point3D loc = GetWorldLocation();

                    Effects.PlaySound(loc, Map, 0x223);
                    //What effect?!?
                    //Effects.SendLocationEffect( new Point3D( loc.X + 1, loc.Y + 1, loc.Z - 11 ), Map, 0x36BD, 15 );
                    break;
                }

                case 2:                                //poison
                {
                    from.SendLocalizedMessage(502999); // You set off a trap!

                    if (from.InRange(GetWorldLocation(), 2))
                    {
                        Poison p = Poison.Lesser;
                        if (damage >= 30)
                        {
                            p = Poison.Regular;
                        }
                        if (damage >= 60)
                        {
                            p = Poison.Greater;
                        }
                        if (damage >= 90)
                        {
                            p = Poison.Deadly;
                        }
                        if (damage >= 100)
                        {
                            p = Poison.Lethal;
                        }

                        from.ApplyPoison(from, p);
                        from.SendLocalizedMessage(503004);                                   // You are enveloped...
                    }

                    Point3D loc = GetWorldLocation();

                    Effects.PlaySound(loc, Map, 0x231);
                    Effects.SendLocationEffect(new Point3D(loc.X + 1, loc.Y + 1, loc.Z - 11), Map, 0x11A6, 20);
                    break;
                }
                }
                from.RevealingAction();
                bExploded = true;
            }

            return(bExploded);
        }
Exemplo n.º 39
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

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

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

                m.Paralyzed = false;

                if (CheckResisted(m) || Mysticism.StoneFormSpell.CheckImmunity(m))
                {
                    m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
                }
                else
                {
                    int level;

                    int total = (Caster.Skills.Magery.Fixed + Caster.Skills.Poisoning.Fixed) / 2;

                    if (Caster.InRange(m, 8))
                    {
                        int range = (int)Caster.GetDistanceToSqrt(m.Location);

                        if (total >= 1000)
                        {
                            level = Utility.RandomDouble() <= .1 ? 4 : 3;
                        }
                        else if (total > 850)
                        {
                            level = 2;
                        }
                        else if (total > 650)
                        {
                            level = 1;
                        }
                        else
                        {
                            level = 0;
                        }

                        if (!Caster.InRange(m, 2))
                        {
                            level -= range / 2;
                        }

                        if (level < 0)
                        {
                            level = 0;
                        }
                    }
                    else if (Caster.InRange(m, 2))
                    {
                        if (total >= 1000)
                        {
                            level = 3;
                        }
                        else if (total > 850)
                        {
                            level = 2;
                        }
                        else if (total > 650)
                        {
                            level = 1;
                        }
                        else
                        {
                            level = 0;
                        }
                    }
                    else
                    {
                        level = 0;
                    }

                    m.ApplyPoison(Caster, Poison.GetPoison(level));
                }

                m.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
                m.PlaySound(0x205);

                HarmfulSpell(m);
            }

            FinishSequence();
        }
Exemplo n.º 40
0
        public virtual bool Eat(Mobile from)
        {
            if (AttemptEat(from))
            {
                //Player Enhancement Customization: Mouthy
                bool mouthy = PlayerEnhancementPersistance.IsCustomizationEntryActive(from, CustomizationType.Mouthy);

                if (from.Body.IsHuman && !from.Mounted)
                {
                    from.Animate(34, 5, 1, true, false, 0);
                }

                Point3D location = from.Location;
                Map     map      = from.Map;

                if (mouthy)
                {
                    //Chomp
                    from.PlaySound(Utility.RandomList(0x5DA));
                    from.PublicOverheadMessage(MessageType.Regular, 0, false, "*chomps*");

                    for (int a = 1; a < 3; a++)
                    {
                        Timer.DelayCall(TimeSpan.FromSeconds(a * 1), delegate
                        {
                            if (from == null)
                            {
                                return;
                            }
                            if (!from.Alive)
                            {
                                return;
                            }

                            if (from.Body.IsHuman && !from.Mounted)
                            {
                                from.Animate(34, 5, 1, true, false, 0);
                            }

                            //Chew
                            if (Utility.RandomDouble() <= .75)
                            {
                                from.PlaySound(Utility.RandomList(0x5A9, 0x5AB, 0x03A, 0x03B, 0x03C));
                                from.PublicOverheadMessage(MessageType.Regular, 0, false, "*chews noisily*");
                            }

                            //Spill
                            else
                            {
                                from.PlaySound(Utility.RandomList(0x5D8, 0x5D9, 0x5DB, 0x5A2, 0x580, 0x581));

                                TimedStatic droppedFood = new TimedStatic(2482, 5);

                                switch (Utility.RandomMinMax(1, 3))
                                {
                                case 1:
                                    droppedFood.Name   = "food mush";
                                    droppedFood.ItemID = 2484;
                                    droppedFood.Hue    = 2313;
                                    break;

                                case 2:
                                    droppedFood.Name   = "food mush";
                                    droppedFood.ItemID = 2485;
                                    droppedFood.Hue    = 2313;
                                    break;

                                case 3:
                                    droppedFood.Name   = "food mush";
                                    droppedFood.ItemID = 2486;
                                    droppedFood.Hue    = 2313;
                                    break;
                                }

                                from.PublicOverheadMessage(MessageType.Regular, 0, false, "*spills*");

                                Point3D foodLocation = new Point3D(location.X + Utility.RandomList(-1, 1), location.Y + Utility.RandomList(-1, 1), location.Z);
                                SpellHelper.AdjustField(ref foodLocation, map, 12, false);

                                droppedFood.MoveToWorld(foodLocation, map);
                            }
                        });
                    }
                }

                else
                {
                    from.PlaySound(Utility.Random(0x3A, 3));
                }

                if (m_Poison != null)
                {
                    from.ApplyPoison(m_Poisoner, m_Poison);
                }

                if (Stackable)
                {
                    Consume();
                }

                else if (m_Charges > 1)
                {
                    m_Charges--;
                }

                else
                {
                    Delete();
                }

                return(true);
            }

            return(false);
        }
Exemplo n.º 41
0
        /// <summary>
        /// Executes the trap of this container, if any.
        /// </summary>
        /// <param name="from">The mobile who triggered the trap.</param>
        public virtual void ExecuteTrap(Mobile from)
        {
            Point3D loc   = this.GetWorldLocation();
            Map     facet = this.Map;

            switch (m_TrapType)
            {
            case TrapType.ExplosionTrap:
            {
                if (from.InRange(loc, 3))
                {
                    int damage;

                    if (m_TrapLevel > 0)
                    {
                        damage = Utility.RandomMinMax(10, 30) * m_TrapLevel;
                    }
                    else
                    {
                        damage = m_TrapPower;
                    }

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

                    // Your skin blisters from the heat!
                    from.LocalOverheadMessage(Network.MessageType.Regular, 0x2A, 503000);
                }

                Effects.SendLocationEffect(loc, facet, 0x36BD, 15, 10);
                Effects.PlaySound(loc, facet, 0x307);

                break;
            }

            case TrapType.MagicTrap:
            {
                if (from.InRange(loc, 1))
                {
                    from.Damage(m_TrapPower);
                }

                Effects.PlaySound(loc, Map, 0x307);

                Effects.SendLocationEffect(new Point3D(loc.X - 1, loc.Y, loc.Z), Map, 0x36BD, 15);
                Effects.SendLocationEffect(new Point3D(loc.X + 1, loc.Y, loc.Z), Map, 0x36BD, 15);

                Effects.SendLocationEffect(new Point3D(loc.X, loc.Y - 1, loc.Z), Map, 0x36BD, 15);
                Effects.SendLocationEffect(new Point3D(loc.X, loc.Y + 1, loc.Z), Map, 0x36BD, 15);

                Effects.SendLocationEffect(new Point3D(loc.X + 1, loc.Y + 1, loc.Z + 11), Map, 0x36BD, 15);

                break;
            }

            case TrapType.DartTrap:
            {
                if (from.InRange(loc, 3))
                {
                    int damage;

                    if (m_TrapLevel > 0)
                    {
                        damage = Utility.RandomMinMax(5, 15) * m_TrapLevel;
                    }
                    else
                    {
                        damage = m_TrapPower;
                    }

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

                    // A dart imbeds itself in your flesh!
                    from.LocalOverheadMessage(Network.MessageType.Regular, 0x62, 502998);
                }

                Effects.PlaySound(loc, facet, 0x223);

                break;
            }

            case TrapType.PoisonTrap:
            {
                if (from.InRange(loc, 3))
                {
                    Poison poison;

                    if (m_TrapLevel > 0)
                    {
                        poison = Poison.GetPoison(Math.Max(0, Math.Min(4, m_TrapLevel - 1)));
                    }
                    else
                    {
                        AOS.Damage(from, m_TrapPower, 0, 0, 0, 100, 0);
                        poison = Poison.Greater;
                    }

                    from.ApplyPoison(from, poison);
                }

                Effects.SendLocationEffect(loc, facet, 0x113A, 10, 20);
                Effects.PlaySound(loc, facet, 0x231);

                break;
            }
            }
        }
Exemplo n.º 42
0
        public override bool OnMoveOver(Mobile m)
        {
            if (owner != m)
            {
                int StrMax = power;
                int StrMin = (int)(power / 2);

                if (m is PlayerMobile && Spells.Research.ResearchAirWalk.UnderEffect(m))
                {
                    Point3D air = new Point3D((m.X + 1), (m.Y + 1), (m.Z + 5));
                    Effects.SendLocationParticles(EffectItem.Create(air, m.Map, EffectItem.DefaultDuration), 0x2007, 9, 32, Server.Items.CharacterDatabase.GetMySpellHue(m, 0), 0, 5022, 0);
                    m.PlaySound(0x014);
                }
                else if (
                    (m is PlayerMobile && m.Blessed == false && m.Alive && m.AccessLevel == AccessLevel.Player && Server.Misc.SeeIfGemInBag.GemInPocket(m) == false && Server.Misc.SeeIfJewelInBag.JewelInPocket(m) == false)
                    ||
                    (m is BaseCreature && m.Blessed == false && !(m is PlayerMobile))
                    )
                {
                    int Sprung = 1;

                    if (m is PlayerMobile)
                    {
                        Sprung = Server.Items.HiddenTrap.CheckTrapAvoidance(m, this);
                    }

                    if (Sprung > 0)
                    {
                        if (m.CheckSkill(SkillName.EvalInt, 0, 125))
                        {
                            if (m is PlayerMobile)
                            {
                                m.LocalOverheadMessage(Network.MessageType.Emote, 0x3B2, false, "You got near a magical trap, but you were too intelligent to suffer the effects.");
                            }
                            Sprung = 0;
                        }
                    }

                    if (Sprung > 0)
                    {
                        if (this.Hue == 0x48F)                           // POISON TRAP
                        {
                            int itHurts = m.PoisonResistance;
                            int itSicks = 0;

                            if (itHurts >= 70)
                            {
                                itSicks = 1;
                            }
                            else if (itHurts >= 50)
                            {
                                itSicks = 2;
                            }
                            else if (itHurts >= 30)
                            {
                                itSicks = 3;
                            }
                            else if (itHurts >= 10)
                            {
                                itSicks = 4;
                            }
                            else
                            {
                                itSicks = 5;
                            }

                            switch (Utility.RandomMinMax(1, itSicks))
                            {
                            case 1: m.ApplyPoison(m, Poison.Lesser);      break;

                            case 2: m.ApplyPoison(m, Poison.Regular);     break;

                            case 3: m.ApplyPoison(m, Poison.Greater);     break;

                            case 4: m.ApplyPoison(m, Poison.Deadly);      break;

                            case 5: m.ApplyPoison(m, Poison.Lethal);      break;
                            }

                            Effects.SendLocationEffect(this.Location, this.Map, 0x11A8 - 2, 16, 3, 0, 0);
                            Effects.PlaySound(this.Location, this.Map, 0x231);
                            if (m is PlayerMobile)
                            {
                                m.LocalOverheadMessage(MessageType.Emote, 0xB1F, true, "You triggered a magical trap!");
                            }
                            itHurts = (int)((Utility.RandomMinMax(StrMin, StrMax) * (100 - m.PoisonResistance)) / 100);
                            m.Damage(itHurts, m);
                        }
                        else if (this.Hue == 0x489)                           // FLAME TRAP
                        {
                            Effects.SendLocationParticles(EffectItem.Create(this.Location, this.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);
                            Effects.PlaySound(this.Location, this.Map, 0x225);
                            if (m is PlayerMobile)
                            {
                                m.LocalOverheadMessage(MessageType.Emote, 0xB1F, true, "You triggered a magical trap!");
                            }
                            int itHurts = (int)((Utility.RandomMinMax(StrMin, StrMax) * (100 - m.FireResistance)) / 100);
                            m.Damage(itHurts, m);
                        }
                        else if (this.Hue == 0x48E)                           // EXPLOSION TRAP
                        {
                            m.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                            m.PlaySound(0x307);
                            if (m is PlayerMobile)
                            {
                                m.LocalOverheadMessage(MessageType.Emote, 0xB1F, true, "You triggered a magical trap!");
                            }
                            int itHurts = (int)((Utility.RandomMinMax(StrMin, StrMax) * (100 - m.PhysicalResistance)) / 100);
                            m.Damage(itHurts, m);
                        }
                        else if (this.Hue == 0x490)                           // ELECTRICAL TRAP
                        {
                            m.BoltEffect(0);
                            if (m is PlayerMobile)
                            {
                                m.LocalOverheadMessage(MessageType.Emote, 0xB1F, true, "You triggered a magical trap!");
                            }
                            int itHurts = (int)((Utility.RandomMinMax(StrMin, StrMax) * (100 - m.EnergyResistance)) / 100);
                            m.Damage(itHurts, m);
                        }
                        else if (this.Hue == 0x480)                           // BLIZZARD TRAP
                        {
                            Point3D blast = new Point3D((m.X), (m.Y), m.Z);
                            Effects.SendLocationEffect(blast, m.Map, 0x375A, 30, 10, 0x481, 0);
                            m.PlaySound(0x10B);
                            if (m is PlayerMobile)
                            {
                                m.LocalOverheadMessage(MessageType.Emote, 0xB1F, true, "You triggered a magical trap!");
                            }
                            int itHurts = (int)((Utility.RandomMinMax(StrMin, StrMax) * (100 - m.ColdResistance)) / 100);
                            m.Damage(itHurts, m);
                        }
                    }
                    this.Delete();
                }
            }
            return(true);
        }
Exemplo n.º 43
0
        public void Target(Mobile m)
        {
            if (m == null)
            {
                return;
            }

            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

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

                m.Spell?.OnCasterHurt();

                m.Paralyzed = false;

                if (CheckResisted(m))
                {
                    m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
                }
                else
                {
                    int level;

                    if (Core.AOS)
                    {
                        if (Caster.InRange(m, 2))
                        {
                            int total = (Caster.Skills.Magery.Fixed + Caster.Skills.Poisoning.Fixed) / 2;

                            if (total >= 1000)
                            {
                                level = 3;
                            }
                            else if (total > 850)
                            {
                                level = 2;
                            }
                            else if (total > 650)
                            {
                                level = 1;
                            }
                            else
                            {
                                level = 0;
                            }
                        }
                        else
                        {
                            level = 0;
                        }
                    }
                    else
                    {
                        // double total = Caster.Skills.Magery.Value + Caster.Skills.Poisoning.Value;

                        double total = Caster.Skills.Magery.Value;

                        if (Caster is PlayerMobile pm)
                        {
                            if (pm.DuelContext?.Started != true || pm.DuelContext.Finished || pm.DuelContext.Ruleset.GetOption("Skills", "Poisoning"))
                            {
                                total += pm.Skills.Poisoning.Value;
                            }
                        }
                        else
                        {
                            total += Caster.Skills.Poisoning.Value;
                        }

                        double dist = Caster.GetDistanceToSqrt(m);

                        if (dist >= 3.0)
                        {
                            total -= (dist - 3.0) * 10.0;
                        }

                        if (total >= 200.0 && Utility.Random(10) < 1)
                        {
                            level = 3;
                        }
                        else if (total > (Core.AOS ? 170.1 : 170.0))
                        {
                            level = 2;
                        }
                        else if (total > (Core.AOS ? 130.1 : 130.0))
                        {
                            level = 1;
                        }
                        else
                        {
                            level = 0;
                        }
                    }

                    m.ApplyPoison(Caster, Poison.GetPoison(level));
                }

                m.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
                m.PlaySound(0x205);

                HarmfulSpell(m);
            }

            FinishSequence();
        }
Exemplo n.º 44
0
		public void Drink( Mobile from )
		{
			if ( Thirsty( from, m_FillFactor ) )
			{
				// Play a random drinking sound
				from.PlaySound( Utility.Random( 0x30, 2 ) );

				if ( from.Body.IsHuman && !from.Mounted )
					from.Animate( 34, 5, 1, true, false, 0 );

				if ( m_Poison != null )
					from.ApplyPoison( m_Poisoner, m_Poison );

				int bac = 5;
				from.BAC += bac;
				if ( from.BAC > 60 )
					from.BAC = 60;

				BaseBeverage.CheckHeaveTimer( from );

				this.Consume();

				Item item = EmptyItem;

				if ( item != null )
					from.AddToBackpack( item );
			}
		}
Exemplo n.º 45
0
        public override bool OnMoveOver(Mobile m)
        {
            bool hurts = true;

            if (m.Blessed)
            {
                hurts = false;
            }

            if (!m.Alive)
            {
                hurts = false;
            }

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

                if (!bc.Controlled)
                {
                    hurts = false;
                }
            }

            if (hurts)
            {
                SlayerEntry SilverSlayer   = SlayerGroup.GetEntryByName(SlayerName.Silver);
                SlayerEntry ExorcismSlayer = SlayerGroup.GetEntryByName(SlayerName.Exorcism);

                if (m is PlayerMobile && Spells.Research.ResearchAirWalk.UnderEffect(m))
                {
                    Point3D air = new Point3D((m.X + 1), (m.Y + 1), (m.Z + 5));
                    Effects.SendLocationParticles(EffectItem.Create(air, m.Map, EffectItem.DefaultDuration), 0x2007, 9, 32, Server.Items.CharacterDatabase.GetMySpellHue(m, 0), 0, 5022, 0);
                    m.PlaySound(0x014);
                }
                else if (this.Name == "hot magma" && !(m is MagmaElemental))
                {
                    owner.DoHarmful(m);
                    Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);
                    Effects.PlaySound(m.Location, m.Map, 0x225);
                    AOS.Damage(m, owner, Hurt(owner, 24, 48), 0, 100, 0, 0, 0);
                    //												Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "quick silver")
                {
                    owner.DoHarmful(m);
                    Effects.PlaySound(m.Location, m.Map, 0x4D1);
                    AOS.Damage(m, owner, Hurt(owner, 24, 48), 50, 0, 0, 0, 50);
                    //												Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "holy water" && (SilverSlayer.Slays(m) || ExorcismSlayer.Slays(m)))
                {
                    owner.DoHarmful(m);
                    Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);
                    Effects.PlaySound(m.Location, m.Map, 0x225);
                    AOS.Damage(m, owner, Hurt(owner, 40, 60), 20, 20, 20, 20, 20);
                    //												Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "glowing goo" && !(m is GlowBeetle) && !(m is GlowBeetleRiding))
                {
                    owner.DoHarmful(m);
                    Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 63, 7, 9915, 0);
                    int eSound = 0x229;
                    if (m.Body == 0x190 && m is PlayerMobile)
                    {
                        eSound = 0x43F;
                    }
                    else if (m.Body == 0x191 && m is PlayerMobile)
                    {
                        eSound = 0x32D;
                    }
                    Effects.PlaySound(m.Location, m.Map, eSound);
                    AOS.Damage(m, owner, Hurt(owner, 24, 48), 0, 0, 0, 50, 50);
                    //												Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "scorching ooze" && !(m is Lavapede))
                {
                    owner.DoHarmful(m);
                    Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 63, 7, 9915, 0);
                    int eSound = 0x229;
                    if (m.Body == 0x190 && m is PlayerMobile)
                    {
                        eSound = 0x43F;
                    }
                    else if (m.Body == 0x191 && m is PlayerMobile)
                    {
                        eSound = 0x32D;
                    }
                    Effects.PlaySound(m.Location, m.Map, eSound);
                    AOS.Damage(m, owner, Hurt(owner, 24, 48), 0, 100, 0, 0, 0);
                    //												Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "blue slime" && !(m is SlimeDevil))
                {
                    owner.DoHarmful(m);
                    Effects.PlaySound(m.Location, m.Map, 0x4D1);
                    AOS.Damage(m, owner, Hurt(owner, 24, 48), 0, 0, 100, 0, 0);
                    //												Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "swamp muck" && !(m is SwampThing))
                {
                    owner.DoHarmful(m);
                    Effects.PlaySound(m.Location, m.Map, 0x4D1);
                    AOS.Damage(m, owner, Hurt(owner, 24, 48), 50, 0, 0, 50, 0);
                    //												Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "poisonous slime" && !(m is AbyssCrawler))
                {
                    owner.DoHarmful(m);
                    Effects.PlaySound(m.Location, m.Map, 0x4D1);
                    AOS.Damage(m, owner, Hurt(owner, 24, 48), 0, 0, 0, 100, 0);
                    //												Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "poison spit" && !(m is Neptar) && !(m is NeptarWizard))
                {
                    owner.DoHarmful(m);
                    Effects.PlaySound(m.Location, m.Map, 0x4D1);
                    AOS.Damage(m, owner, Hurt(owner, 24, 48), 0, 0, 0, 100, 0);
                    //												Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "poison spittle" && !(m is Lurker))
                {
                    owner.DoHarmful(m);
                    Effects.PlaySound(m.Location, m.Map, 0x4D1);
                    AOS.Damage(m, owner, Hurt(owner, 24, 48), 0, 0, 0, 100, 0);
                    //												Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "fungal slime" && !(m is Fungal) && !(m is FungalMage) && !(m is CreepingFungus))
                {
                    owner.DoHarmful(m);
                    Effects.PlaySound(m.Location, m.Map, 0x4D1);
                    AOS.Damage(m, owner, Hurt(owner, 24, 48), 50, 0, 0, 50, 0);
                    //												Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "spider ooze" && !(m is ZombieSpider))
                {
                    owner.DoHarmful(m);
                    Effects.PlaySound(m.Location, m.Map, 0x4D1);
                    AOS.Damage(m, owner, Hurt(owner, 24, 48), 50, 0, 0, 50, 0);
                    //												Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "acidic slime" && !(m is ToxicElemental))
                {
                    owner.DoHarmful(m);
                    Effects.PlaySound(m.Location, m.Map, 0x231);
                    AOS.Damage(m, owner, Hurt(owner, 24, 48), 50, 0, 0, 50, 0);
                    //												Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "acidic ichor" && !(m is AntaurKing) && !(m is AntaurProgenitor) && !(m is AntaurSoldier) && !(m is AntaurWorker))
                {
                    owner.DoHarmful(m);
                    Effects.PlaySound(m.Location, m.Map, 0x231);
                    AOS.Damage(m, owner, Hurt(owner, 24, 48), 50, 0, 0, 50, 0);
                    //												Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "thick blood" && !(m is BloodElemental) && !(m is BloodDemon))
                {
                    owner.DoHarmful(m);
                    Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 0x25, 7, 9915, 0);
                    int eSound = 0x229;
                    if (m.Body == 0x190 && m is PlayerMobile)
                    {
                        eSound = 0x43F;
                    }
                    else if (m.Body == 0x191 && m is PlayerMobile)
                    {
                        eSound = 0x32D;
                    }
                    Effects.PlaySound(m.Location, m.Map, eSound);
                    AOS.Damage(m, owner, Hurt(owner, 24, 48), 0, 0, 0, 100, 0);
                    //												Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "infected blood" && !(m is Infected))
                {
                    owner.DoHarmful(m);
                    Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 0x25, 7, 9915, 0);
                    int eSound = 0x229;
                    if (m.Body == 0x190 && m is PlayerMobile)
                    {
                        eSound = 0x43F;
                    }
                    else if (m.Body == 0x191 && m is PlayerMobile)
                    {
                        eSound = 0x32D;
                    }
                    Effects.PlaySound(m.Location, m.Map, eSound);
                    AOS.Damage(m, owner, Hurt(owner, 24, 48), 0, 0, 0, 100, 0);
                    //												Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "alien blood" && !(m is Xenomorph) && !(m is Xenomutant))
                {
                    owner.DoHarmful(m);
                    Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 0x25, 7, 9915, 0);
                    int eSound = 0x229;
                    if (m.Body == 0x190 && m is PlayerMobile)
                    {
                        eSound = 0x43F;
                    }
                    else if (m.Body == 0x191 && m is PlayerMobile)
                    {
                        eSound = 0x32D;
                    }
                    Effects.PlaySound(m.Location, m.Map, eSound);
                    AOS.Damage(m, owner, Hurt(owner, 24, 48), 20, 20, 20, 20, 20);
                    //												Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "green blood" && !(m is ZombieGiant))
                {
                    owner.DoHarmful(m);
                    Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 0x25, 7, 9915, 0);
                    int eSound = 0x229;
                    if (m.Body == 0x190 && m is PlayerMobile)
                    {
                        eSound = 0x43F;
                    }
                    else if (m.Body == 0x191 && m is PlayerMobile)
                    {
                        eSound = 0x32D;
                    }
                    Effects.PlaySound(m.Location, m.Map, eSound);
                    AOS.Damage(m, owner, Hurt(owner, 24, 48), 20, 0, 0, 80, 0);
                    //												Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "toxic blood" && !(m is Mutant))
                {
                    owner.DoHarmful(m);
                    Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 0x25, 7, 9915, 0);
                    int eSound = 0x229;
                    if (m.Body == 0x190 && m is PlayerMobile)
                    {
                        eSound = 0x43F;
                    }
                    else if (m.Body == 0x191 && m is PlayerMobile)
                    {
                        eSound = 0x32D;
                    }
                    Effects.PlaySound(m.Location, m.Map, eSound);
                    AOS.Damage(m, owner, Hurt(owner, 24, 48), 0, 0, 0, 100, 0);
                    //												Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "freezing water" && !(m is WaterElemental) && !(m is WaterWeird) && !(m is DeepWaterElemental) && !(m is Dagon))
                {
                    owner.DoHarmful(m);
                    Effects.PlaySound(m.Location, m.Map, 0x4D1);
                    AOS.Damage(m, owner, Hurt(owner, 20, 40), 0, 0, 100, 0, 0);
                    //												Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "deep water" && !(m is WaterElemental) && !(m is WaterWeird) && !(m is DeepWaterElemental) && !(m is Dagon))
                {
                    owner.DoHarmful(m);
                    Effects.PlaySound(m.Location, m.Map, 0x4D1);
                    AOS.Damage(m, owner, Hurt(owner, 40, 60), 0, 0, 100, 0, 0);
                    //												Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "lesser poison potion" || this.Name == "poison potion" || this.Name == "greater poison potion" | this.Name == "deadly poison potion" || this.Name == "lethal poison potion")
                {
                    int pSkill = (int)(owner.Skills[SkillName.Poisoning].Value / 50);
                    int tSkill = (int)(owner.Skills[SkillName.TasteID].Value / 33);
                    int aSkill = (int)(owner.Skills[SkillName.Alchemy].Value / 33);

                    int    pMin = pSkill + tSkill + aSkill;
                    int    pMax = pMin * 2;
                    Poison pois = Poison.Lesser;

                    if (this.Name == "poison potion")
                    {
                        pMin = pMin + 2;  pMax = pMax + 2;  pois = Poison.Regular;
                    }
                    else if (this.Name == "greater poison potion")
                    {
                        pMin = pMin + 3;  pMax = pMax + 3;  pois = Poison.Greater;
                    }
                    else if (this.Name == "deadly poison potion")
                    {
                        pMin = pMin + 4;  pMax = pMax + 4;  pois = Poison.Deadly;
                    }
                    else if (this.Name == "lethal poison potion")
                    {
                        pMin = pMin + 5;  pMax = pMax + 5;  pois = Poison.Lethal;
                    }

                    if (pMin >= Utility.RandomMinMax(1, 16))
                    {
                        m.ApplyPoison(owner, pois);
                    }

                    owner.DoHarmful(m);
                    Effects.PlaySound(m.Location, m.Map, 0x4D1);
                    AOS.Damage(m, owner, Hurt(owner, pMin, pMax), 0, 0, 0, 100, 0);
                    //													Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "liquid fire")
                {
                    int liqMin = Server.Items.BaseLiquid.GetLiquidBonus(owner);
                    int liqMax = liqMin * 2;
                    owner.DoHarmful(m);
                    Effects.SendLocationEffect(m.Location, m.Map, 0x3709, 30, 10);
                    m.PlaySound(0x208);
                    AOS.Damage(m, owner, Hurt(owner, liqMin, liqMax), 20, 80, 0, 0, 0);
                    //														Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "liquid goo")
                {
                    int liqMin = Server.Items.BaseLiquid.GetLiquidBonus(owner);
                    int liqMax = liqMin * 2;
                    owner.DoHarmful(m);
                    Effects.SendLocationEffect(m.Location, m.Map, Utility.RandomList(0x3967, 0x3979), 30, 10);
                    m.PlaySound(0x5C3);
                    AOS.Damage(m, owner, Hurt(owner, liqMin, liqMax), 20, 0, 0, 0, 80);
                    //														Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "liquid ice")
                {
                    int liqMin = Server.Items.BaseLiquid.GetLiquidBonus(owner);
                    int liqMax = liqMin * 2;
                    owner.DoHarmful(m);
                    Effects.SendLocationEffect(m.Location, m.Map, 0x1A84, 30, 10, 0x9C1, 0);
                    m.PlaySound(0x10B);
                    AOS.Damage(m, owner, Hurt(owner, liqMin, liqMax), 20, 0, 80, 0, 0);
                    //														Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "liquid rot")
                {
                    int liqMin = Server.Items.BaseLiquid.GetLiquidBonus(owner);
                    int liqMax = liqMin * 2;
                    owner.DoHarmful(m);
                    Effects.SendLocationEffect(m.Location, m.Map, 0x3400, 60);
                    Effects.PlaySound(m.Location, m.Map, 0x108);
                    AOS.Damage(m, owner, Hurt(owner, liqMin, liqMax), 20, 0, 0, 80, 0);
                    //														Ph,		Fr,		Cd,		Ps,		Eg
                }
                else if (this.Name == "liquid pain")
                {
                    int liqMin = Server.Items.BaseLiquid.GetLiquidBonus(owner);
                    int liqMax = liqMin * 2;
                    owner.DoHarmful(m);
                    m.FixedParticles(0x37C4, 1, 8, 9916, 39, 3, EffectLayer.Head);
                    m.FixedParticles(0x37C4, 1, 8, 9502, 39, 4, EffectLayer.Head);
                    m.PlaySound(0x210);
                    AOS.Damage(m, owner, Hurt(owner, liqMin, liqMax), 80, 5, 5, 5, 5);
                    //														Ph,		Fr,		Cd,		Ps,		Eg
                }
            }
            return(true);
        }
Exemplo n.º 46
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            BaseWeapon weapon = attacker.Weapon as BaseWeapon;

            if (weapon == null)
            {
                return;
            }

            Poison p = weapon.Poison;

            if (p == null || weapon.PoisonCharges <= 0)
            {
                attacker.SendLocalizedMessage(1061141);                   // Your weapon must have a dose of poison to perform an infectious strike!
                return;
            }

            if (!CheckMana(attacker, true))
            {
                return;
            }

            --weapon.PoisonCharges;

            // Infectious strike special move now uses poisoning skill to help determine potency
            int maxLevel = attacker.Skills[SkillName.Poisoning].Fixed / 200;

            if (maxLevel < 0)
            {
                maxLevel = 0;
            }
            if (p.Level > maxLevel)
            {
                p = Poison.GetPoison(maxLevel);
            }

            if ((attacker.Skills[SkillName.Poisoning].Value / 100.0) > Utility.RandomDouble())
            {
                int    level     = p.Level + 1;
                Poison newPoison = Poison.GetPoison(level);

                if (newPoison != null)
                {
                    p = newPoison;

                    attacker.SendLocalizedMessage(1060080);                       // Your precise strike has increased the level of the poison by 1
                    defender.SendLocalizedMessage(1060081);                       // The poison seems extra effective!
                }
            }

            defender.PlaySound(0xDD);
            defender.FixedParticles(0x3728, 244, 25, 9941, 1266, 0, EffectLayer.Waist);

            if (defender.ApplyPoison(attacker, p) != ApplyPoisonResult.Immune)
            {
                attacker.SendLocalizedMessage(1008096, true, defender.Name);                   // You have poisoned your target :
                defender.SendLocalizedMessage(1008097, false, attacker.Name);                  //  : poisoned you!
            }
        }
Exemplo n.º 47
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                // Seems like this should be responsibility of the targetting system.  --daleron
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
                goto Return;
            }

            if (!CheckSequence())
            {
                goto Return;
            }

            SpellHelper.Turn(Caster, m);

            m.FixedParticles(0x3709, 10, 15, 5021, EffectLayer.Waist);
            m.PlaySound(0x1e2);

            Caster.DoHarmful(m);

            var level = 0;
            var pStr  = Caster.Skills[CastSkill].Value;

            if (pStr > 100)
            {
                level = 1;
            }
            else if (pStr > 110)
            {
                level = 2;
            }
            else if (pStr > 130)
            {
                level = 3;
            }
            else if (pStr > 140)
            {
                level = 4;
            }
            else
            {
                level = 0;
            }

            var ss    = Caster.Skills[DamageSkill].Value;
            var bonus = (int)ss / 4;

            var dmg = (double)Utility.Dice(3, 5, bonus);

            dmg /= 2; //necessary?

            //sith: change this, see issue tracker on gitlab
            if (CheckResisted(m))
            {
                dmg *= 0.75;

                m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
            }

            //m.Damage((int)dmg, m, ElementalType.Necro);
            SpellHelper.Damage(dmg, m, Caster, this, TimeSpan.Zero);
            m.ApplyPoison(Caster, Poison.GetPoison(level));

Return:
            FinishSequence();
        }
Exemplo n.º 48
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!this.Validate(attacker) || !this.CheckMana(attacker, true))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            defender.SendLocalizedMessage(1112369);             //  You have been poisoned by a lethal arrow!

            int level;

            if (Core.AOS)
            {
                if (attacker.InRange(defender, 2))
                {
                    int total = (attacker.Skills.Poisoning.Fixed) / 2;

                    if (total >= 1000)
                    {
                        level = 3;
                    }
                    else if (total > 850)
                    {
                        level = 2;
                    }
                    else if (total > 650)
                    {
                        level = 1;
                    }
                    else
                    {
                        level = 0;
                    }
                }
                else
                {
                    level = 0;
                }
            }
            else
            {
                double total = attacker.Skills[SkillName.Poisoning].Value;

                double dist = attacker.GetDistanceToSqrt(defender);

                if (dist >= 3.0)
                {
                    total -= (dist - 3.0) * 10.0;
                }

                if (total >= 200.0 && 1 > Utility.Random(10))
                {
                    level = 3;
                }
                else if (total > (Core.AOS ? 170.1 : 170.0))
                {
                    level = 2;
                }
                else if (total > (Core.AOS ? 130.1 : 130.0))
                {
                    level = 1;
                }
                else
                {
                    level = 0;
                }
            }

            defender.ApplyPoison(attacker, Poison.GetPoison(level));

            defender.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
            defender.PlaySound(0x474);
        }
Exemplo n.º 49
0
        public virtual bool ExecuteTrap(Mobile from)
        {
            if (m_TrapType != TrapType.None)
            {
                Point3D loc   = GetWorldLocation();
                Map     facet = Map;

                if (from.AccessLevel >= AccessLevel.GameMaster)
                {
                    SendMessageTo(from, "That is trapped, but you open it with your godly powers.", 0x3B2);
                    return(false);
                }

                switch (m_TrapType)
                {
                case TrapType.ExplosionTrap:
                {
                    SendMessageTo(from, 502999, 0x3B2);                               // You set off a trap!

                    if (from.InRange(loc, 3))
                    {
                        int damage;

                        if (m_TrapLevel > 0)
                        {
                            damage = Utility.RandomMinMax(10, 30) * m_TrapLevel;
                        }
                        else
                        {
                            damage = m_TrapPower;
                        }

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

                        // Your skin blisters from the heat!
                        from.LocalOverheadMessage(MessageType.Regular, 0x2A, 503000);
                    }

                    Effects.SendLocationEffect(loc, facet, 0x36BD, 15, 10);
                    Effects.PlaySound(loc, facet, 0x307);

                    break;
                }

                case TrapType.MagicTrap:
                {
                    if (from.InRange(loc, 1))
                    {
                        from.Damage(m_TrapPower);
                    }
                    //AOS.Damage( from, m_TrapPower, 0, 100, 0, 0, 0 );

                    Effects.PlaySound(loc, Map, 0x307);

                    Effects.SendLocationEffect(new Point3D(loc.X - 1, loc.Y, loc.Z), Map, 0x36BD, 15);
                    Effects.SendLocationEffect(new Point3D(loc.X + 1, loc.Y, loc.Z), Map, 0x36BD, 15);

                    Effects.SendLocationEffect(new Point3D(loc.X, loc.Y - 1, loc.Z), Map, 0x36BD, 15);
                    Effects.SendLocationEffect(new Point3D(loc.X, loc.Y + 1, loc.Z), Map, 0x36BD, 15);

                    Effects.SendLocationEffect(new Point3D(loc.X + 1, loc.Y + 1, loc.Z + 11), Map, 0x36BD, 15);

                    break;
                }

                case TrapType.DartTrap:
                {
                    SendMessageTo(from, 502999, 0x3B2);                               // You set off a trap!

                    if (from.InRange(loc, 3))
                    {
                        int damage;

                        if (m_TrapLevel > 0)
                        {
                            damage = Utility.RandomMinMax(5, 15) * m_TrapLevel;
                        }
                        else
                        {
                            damage = m_TrapPower;
                        }

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

                        // A dart imbeds itself in your flesh!
                        from.LocalOverheadMessage(MessageType.Regular, 0x62, 502998);
                    }

                    Effects.PlaySound(loc, facet, 0x223);

                    break;
                }

                case TrapType.PoisonTrap:
                {
                    SendMessageTo(from, 502999, 0x3B2);                               // You set off a trap!

                    if (from.InRange(loc, 3))
                    {
                        Poison poison;

                        if (m_TrapLevel > 0)
                        {
                            poison = Poison.GetPoison(Math.Max(0, Math.Min(4, m_TrapLevel - 1)));
                        }
                        else
                        {
                            AOS.Damage(from, m_TrapPower, 0, 0, 0, 100, 0);
                            poison = Poison.Greater;
                        }

                        from.ApplyPoison(from, poison);

                        // You are enveloped in a noxious green cloud!
                        from.LocalOverheadMessage(MessageType.Regular, 0x44, 503004);
                    }

                    Effects.SendLocationEffect(loc, facet, 0x113A, 10, 20);
                    Effects.PlaySound(loc, facet, 0x231);

                    break;
                }
                }

                m_TrapType  = TrapType.None;
                m_TrapPower = 0;
                m_TrapLevel = 0;
                return(true);
            }

            return(false);
        }
Exemplo n.º 50
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!Movable)
            {
                from.SendMessage("That cannot move so you cannot identify it.");
                return;
            }
            else if (!from.InRange(this.GetWorldLocation(), 3))
            {
                from.SendMessage("You will need to get closer to identify that.");
                return;
            }
            else if (!IsChildOf(from.Backpack) && Server.Misc.MyServerSettings.IdentifyItemsOnlyInPack())
            {
                from.SendMessage("This must be in your backpack to identify.");
                return;
            }
            else if (from.InRange(this.GetWorldLocation(), 1))
            {
                if (from.CheckSkill(SkillName.TasteID, -5, 125))
                {
                    if (from.Body.IsHuman && !from.Mounted)
                    {
                        from.Animate(34, 5, 1, true, false, 0);
                    }

                    from.PlaySound(0x2D6);

                    Server.Items.UnknownKeg.GiveKeg(from, this);
                }
                else
                {
                    int nReaction = Utility.RandomMinMax(0, 10);

                    if (nReaction == 1)
                    {
                        from.PlaySound(from.Female ? 813 : 1087);
                        from.Say("*vomits*");
                        if (!from.Mounted)
                        {
                            from.Animate(32, 5, 1, true, false, 0);
                        }
                        Throwup puke = new Throwup();
                        puke.Map      = from.Map;
                        puke.Location = from.Location;
                        from.SendMessage("You fail to identify the liquid, convulsing and spilling the keg.");
                    }
                    else if (nReaction == 2)
                    {
                        from.PlaySound(from.Female ? 798 : 1070);
                        from.Say("*hiccup!*");
                        from.SendMessage("You fail to identify the liquid, spasming and spilling the keg.");
                    }
                    else if (nReaction == 3)
                    {
                        from.PlaySound(from.Female ? 792 : 1064);
                        from.Say("*farts*");
                        from.SendMessage("You fail to identify the liquid, feeling gassy...you dump it out.");
                    }
                    else if (nReaction == 4)
                    {
                        from.PlaySound(from.Female ? 785 : 1056);
                        from.Say("*cough!*");
                        if (!from.Mounted)
                        {
                            from.Animate(33, 5, 1, true, false, 0);
                        }
                        from.SendMessage("You fail to identify the liquid, coughing and spilling the keg.");
                    }
                    else if (nReaction == 5)
                    {
                        from.PlaySound(from.Female ? 784 : 1055);
                        from.Say("*clears throat*");
                        if (!from.Mounted)
                        {
                            from.Animate(33, 5, 1, true, false, 0);
                        }
                        from.SendMessage("You fail to identify the liquid, hurting your throat...you dump out the keg.");
                    }
                    else if (nReaction == 6)
                    {
                        from.PlaySound(from.Female ? 782 : 1053);
                        from.Say("*burp!*");
                        if (!from.Mounted)
                        {
                            from.Animate(33, 5, 1, true, false, 0);
                        }
                        from.SendMessage("You fail to identify the liquid, accidentally drinking the entire keg.");
                    }
                    else if (nReaction > 6)
                    {
                        int nPoison = Utility.RandomMinMax(0, 10);
                        from.Say("Poison!");
                        Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 63, 7, 9915, 0);
                        from.PlaySound(Utility.RandomList(0x30, 0x2D6));
                        if (nPoison > 9)
                        {
                            from.ApplyPoison(from, Poison.Deadly);
                        }
                        else if (nPoison > 7)
                        {
                            from.ApplyPoison(from, Poison.Greater);
                        }
                        else if (nPoison > 4)
                        {
                            from.ApplyPoison(from, Poison.Regular);
                        }
                        else
                        {
                            from.ApplyPoison(from, Poison.Lesser);
                        }
                        from.SendMessage("Poison!");
                    }
                    else
                    {
                        from.PlaySound(from.Female ? 820 : 1094);
                        from.Say("*spits*");
                        if (!from.Mounted)
                        {
                            from.Animate(6, 5, 1, true, false, 0);
                        }
                        from.SendMessage("You fail to identify the liquid, spitting it out and dumping the keg.");
                    }

                    from.AddToBackpack(new Keg());
                }

                this.Delete();
            }
            else
            {
                from.SendLocalizedMessage(502138);                   // That is too far away for you to use
            }
        }
Exemplo n.º 51
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

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

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

                m.Paralyzed = false;

                if (CheckResisted(m))
                {
                    m.SendLocalizedMessage(501783);                       // You feel yourself resisting magical energy.
                }
                else
                {
                    int level;

                    double total = Caster.Skills[SkillName.Magery].Value;
                    total += Caster.Skills[SkillName.Poisoning].Value;

                    double dist = Caster.GetDistanceToSqrt(m);

                    if (dist >= 3.0)
                    {
                        total -= (dist - 3.0) * 10.0;
                    }

                    if (total >= 200.0 && 1 > Utility.Random(10))
                    {
                        level = 3;
                    }
                    else if (total > 170.0)
                    {
                        level = 2;
                    }
                    else if (total > 130.0)
                    {
                        level = 1;
                    }
                    else
                    {
                        level = 0;
                    }

                    m.ApplyPoison(Caster, Poison.GetPoison(level));
                }

                m.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
                m.PlaySound(0x205);

                HarmfulSpell(m);
            }

            FinishSequence();
        }
        public virtual void Pour_OnTarget(Mobile from, object targ)
        {
            if (IsEmpty || !Pourable || !ValidateUse(from, false))
            {
                return;
            }

            if (targ is BaseBeverage)
            {
                BaseBeverage bev = (BaseBeverage)targ;

                if (!bev.ValidateUse(from, true))
                {
                    return;
                }

                if (bev.IsFull && bev.Content == this.Content)
                {
                    from.SendLocalizedMessage(500848);                       // Couldn't pour it there.  It was already full.
                }
                else if (!bev.IsEmpty)
                {
                    from.SendLocalizedMessage(500846);                       // Can't pour it there.
                }
                else
                {
                    bev.Content  = this.Content;
                    bev.Poison   = this.Poison;
                    bev.Poisoner = this.Poisoner;

                    if (this.Quantity > bev.MaxQuantity)
                    {
                        bev.Quantity   = bev.MaxQuantity;
                        this.Quantity -= bev.MaxQuantity;
                    }
                    else
                    {
                        bev.Quantity += this.Quantity;
                        this.Quantity = 0;
                    }

                    from.PlaySound(0x4E);
                }
            }
            else if (from == targ)
            {
                // increase characters thirst value based on type of drink
                if (from.Thirst < 20)
                {
                    switch (this.Content)
                    {
                    case BeverageType.Water: from.Thirst += 5; break;

                    case BeverageType.Milk: from.Thirst += 4; break;

                    case BeverageType.Ale: from.Thirst += 3; break;

                    case BeverageType.Wine: from.Thirst += 2; break;

                    case BeverageType.Cider: from.Thirst += 3; break;

                    case BeverageType.Liquor: from.Thirst += 1; break;
                    }
                    // Send message to character about their current thirst value
                    int iThirst = from.Thirst;
                    if (iThirst < 5)
                    {
                        from.SendMessage("You take a drink but are still extremely thirsty");
                    }
                    else if (iThirst < 10)
                    {
                        from.SendMessage("You take a drink and feel less thirsty");
                    }
                    else if (iThirst < 15)
                    {
                        from.SendMessage("You take a drink and feel much less thirsty");
                    }
                    else
                    {
                        from.SendMessage("You take a drink and are no longer thirsty");
                    }
                }
                else
                {
                    from.Thirst = 20;
                }

                if (ContainsAlchohol)
                {
                    int bac = 0;

                    switch (this.Content)
                    {
                    case BeverageType.Ale: bac = 1; break;

                    case BeverageType.Wine: bac = 2; break;

                    case BeverageType.Cider: bac = 3; break;

                    case BeverageType.Liquor: bac = 4; break;
                    }

                    from.BAC += bac;

                    if (from.BAC > 60)
                    {
                        from.BAC = 60;
                    }

                    CheckHeaveTimer(from);
                }

                from.PlaySound(Utility.RandomList(0x30, 0x2D6));

                if (m_Poison != null)
                {
                    from.ApplyPoison(m_Poisoner, m_Poison);
                }

                --Quantity;
            }
            else if (targ is BaseWaterContainer)
            {
                BaseWaterContainer bwc = targ as BaseWaterContainer;

                if ((!this.IsEmpty || this.Content == BeverageType.Water) && bwc.Items.Count == 0)
                {
                    int It_Needs = Math.Min((bwc.MaxQuantity - bwc.Quantity), Quantity);

                    if (It_Needs > 0 && (!IsEmpty && !bwc.IsFull))
                    {
                        bwc.Quantity += It_Needs;
                        Quantity     -= It_Needs;

                        from.PlaySound(0x4E);
                    }
                }
            }
            else if (targ is PlantItem)
            {
                ((PlantItem)targ).Pour(from, this);
            }
            else if (targ is AddonComponent &&
                     (((AddonComponent)targ).Addon is WaterVatEast || ((AddonComponent)targ).Addon is WaterVatSouth) &&
                     this.Content == BeverageType.Water)
            {
                PlayerMobile player = from as PlayerMobile;

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

                    if (qs != null)
                    {
                        QuestObjective obj = qs.FindObjective(typeof(GatherWaterObjective));

                        if (obj != null && !obj.Completed)
                        {
                            BaseAddon vat = ((AddonComponent)targ).Addon;

                            if (vat.X > 5784 && vat.X < 5814 && vat.Y > 1903 && vat.Y < 1934 &&
                                ((qs.RedSolen && vat.Map == Map.Trammel) || (!qs.RedSolen && vat.Map == Map.Felucca)))
                            {
                                if (obj.CurProgress + Quantity > obj.MaxProgress)
                                {
                                    int delta = obj.MaxProgress - obj.CurProgress;

                                    Quantity       -= delta;
                                    obj.CurProgress = obj.MaxProgress;
                                }
                                else
                                {
                                    obj.CurProgress += Quantity;
                                    Quantity         = 0;
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(500846);                   // Can't pour it there.
            }
        }
Exemplo n.º 53
0
            public void ApplyPoisonTo(Mobile m)
            {
                if (m_Caster == null)
                    return;

                Poison p;

                if (Core.AOS)
                {
                    int total = (m_Caster.Skills.Magery.Fixed + m_Caster.Skills.Poisoning.Fixed) / 2;

                    if (total >= 1000)
                        p = Poison.Deadly;
                    else if (total > 850)
                        p = Poison.Greater;
                    else if (total > 650)
                        p = Poison.Regular;
                    else
                        p = Poison.Lesser;
                }
                else
                {
                    p = Poison.Regular;
                }

                m.ApplyPoison(m_Caster, p);
                //    if (SpellHelper.CanRevealCaster(m))
                //        m_Caster.RevealingAction();

                if (m is BaseCreature)
                    ((BaseCreature)m).OnHarmfulSpell(m_Caster);
            }
Exemplo n.º 54
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);
                Caster.DoHarmful(m);

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

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

                m.Paralyzed = false;

                if (CheckResisted(m) || CheckSlayerResist(m))
                {
                    m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
                }
                else
                {
                    int level = 0;

                    if (Caster.EraAOS)
                    {
                        //double total = Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.Poisoning].Value;

                        #region Dueling

                        double total = Caster.Skills[SkillName.Magery].Value;

                        if (Caster is PlayerMobile)
                        {
                            var pm = (PlayerMobile)Caster;

                            if (pm.DuelContext == null || !pm.DuelContext.Started || pm.DuelContext.Finished ||
                                pm.DuelContext.Ruleset.GetOption("Skills", "Poisoning"))
                            {
                                total += Caster.Skills[SkillName.Poisoning].Value;
                            }
                        }
                        else
                        {
                            total += Caster.Skills[SkillName.Poisoning].Value;
                        }

                        #endregion

                        double dist = Caster.GetDistanceToSqrt(m);

                        if (dist >= 3.0)
                        {
                            total -= (dist - 3.0) * 10.0;
                        }

                        if (total >= 200.0 && 1 > Utility.Random(15))
                        {
                            level = 3;
                        }
                        else if (total > (Caster.EraAOS ? 170.1 : 170.0))
                        {
                            level = 2;
                        }
                        else if (total > (Caster.EraAOS ? 130.1 : 130.0))
                        {
                            level = 1;
                        }
                    }
                    else if (!Caster.IsT2A)
                    {
                        #region Dueling
                        double total = Caster.Skills[SkillName.Magery].Value;
                        if (Caster is PlayerMobile)
                        {
                            var pm = (PlayerMobile)Caster;
                            if (pm.DuelContext != null && pm.DuelContext.Started && !pm.DuelContext.Finished &&
                                !pm.DuelContext.Ruleset.GetOption("Skills", "Poisoning"))
                            {
                            }
                            else
                            {
                                total += Caster.Skills[SkillName.Poisoning].Value;
                            }
                        }
                        else
                        {
                            total += Caster.Skills[SkillName.Poisoning].Value;
                        }

                        #endregion

                        double dist = Caster.GetDistanceToSqrt(m);
                        if (dist >= 3.0)
                        {
                            total -= (dist - 3.0) * 10.0;
                        }
                        if (total >= 200.0 && 1 > Utility.Random(10))
                        {
                            level = 3;
                        }
                        else if (total > 170.0)
                        {
                            level = 2;
                        }
                        else if (total > 130.0)
                        {
                            level = 1;
                        }
                        else
                        {
                            level = 0;
                        }
                    }

                    m.ApplyPoison(Caster, Poison.GetPoison(level));
                }

                m.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
                m.PlaySound(0x205);

                HarmfulSpell(m);
            }

            FinishSequence();
        }
Exemplo n.º 55
0
        public void Poisons(Mobile targ)
        {
            int level = 0;

            switch (Ability_Power)
            {
            case 0:
            case 5:
                level = 0;
                break;

            case 10:
            case 15:
                if (Utility.RandomDouble() > 0.5)
                {
                    level = 0;
                }
                else
                {
                    level = 1;
                }
                break;

            case 20:
                level = 1;
                break;

            case 25:
            case 30:
                if (Utility.RandomDouble() > 0.5)
                {
                    level = 1;
                }
                else
                {
                    level = 2;
                }
                break;

            case 35:
                level = 2;
                break;

            case 40:
            case 45:
                if (Utility.RandomDouble() > 0.5)
                {
                    level = 2;
                }
                else
                {
                    level = 3;
                }
                break;

            case 60:
                level = 3;
                break;

            case 70:
                if (Utility.RandomDouble() > 0.1)
                {
                    level = 3;
                }
                else
                {
                    level = 4;
                }
                break;

            case 80:
                if (Utility.RandomDouble() > 0.3)
                {
                    level = 3;
                }
                else
                {
                    level = 4;
                }
                break;

            case 90:
                if (Utility.RandomDouble() > 0.5)
                {
                    level = 3;
                }
                else
                {
                    level = 4;
                }
                break;

            case 100:
                if (Utility.RandomDouble() > 0.7)
                {
                    level = 3;
                }
                else
                {
                    level = 4;
                }
                break;
            }
            targ.ApplyPoison(this, Poison.GetPoison(level));
            //	public override Poison PoisonImmune{ get{ return Poison.GetPoison( level ); } }
            //PoisonImmune = Poison.GetPoison( level );
        }
Exemplo n.º 56
0
        public virtual void NoxStrike(Mobile attacker)
        {
            /* Counterattack with Hit Poison Area
             * 20-25 damage, unresistable
             * Lethal poison, 100% of the time
             * Particle effect: Type: "2" From: "0x4061A107" To: "0x0" ItemId: "0x36BD" ItemIdName: "explosion" FromLocation: "(296 615, 17)" ToLocation: "(296 615, 17)" Speed: "1" Duration: "10" FixedDirection: "True" Explode: "False" Hue: "0xA6" RenderMode: "0x0" Effect: "0x1F78" ExplodeEffect: "0x1" ExplodeSound: "0x0" Serial: "0x4061A107" Layer: "255" Unknown: "0x0"
             * Doesn't work on provoked monsters
             */

            if (attacker is BaseCreature && ((BaseCreature)attacker).BardProvoked)
            {
                return;
            }

            Mobile target = null;

            if (attacker is BaseCreature)
            {
                Mobile m = ((BaseCreature)attacker).GetMaster();

                if (m != null)
                {
                    target = m;
                }
            }

            if (target == null || !target.InRange(this, 18))
            {
                target = attacker;
            }

            this.Animate(10, 4, 1, true, false, 0);

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

            foreach (Mobile m in target.GetMobilesInRange(8))
            {
                if (m == this || !CanBeHarmful(m) || m.AccessLevel >= AccessLevel.Counselor)
                {
                    continue;
                }

                if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != this.Team))
                {
                    targets.Add(m);
                }
                else if (m.Player && m.Alive)
                {
                    targets.Add(m);
                }
            }

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

                DoHarmful(m);

                AOS.Damage(m, this, Utility.RandomMinMax(20, 25), true, 0, 0, 0, 100, 0);

                m.FixedParticles(0x36BD, 1, 10, 0x1F78, 0xA6, 0, (EffectLayer)255);
                m.ApplyPoison(this, Poison.Lethal);
            }
        }
Exemplo n.º 57
0
		public virtual void OnHit(Mobile attacker, Mobile defender, double damageBonus)
		{
			if (MirrorImage.HasClone(defender) && (defender.Skills.Ninjitsu.Value / 150.0) > Utility.RandomDouble())
			{
				Clone bc;

				foreach (Mobile m in defender.GetMobilesInRange(4))
				{
					bc = m as Clone;

					if (bc != null && bc.Summoned && bc.SummonMaster == defender)
					{
						attacker.SendLocalizedMessage(1063141); // Your attack has been diverted to a nearby mirror image of your target!
						defender.SendLocalizedMessage(1063140); // You manage to divert the attack onto one of your nearby mirror images.

						/*
                        * TODO: What happens if the Clone parries a blow?
                        * And what about if the attacker is using Honorable Execution
                        * and kills it?
                        */

						defender = m;
						break;
					}
				}
			}

			PlaySwingAnimation(attacker);
			PlayHurtAnimation(defender);

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

			int damage = ComputeDamage(attacker, defender);

			#region Damage Multipliers
			/*
            * The following damage bonuses multiply damage by a factor.
            * Capped at x3 (300%).
            */
			int percentageBonus = 0;

			WeaponAbility a = WeaponAbility.GetCurrentAbility(attacker);
			SpecialMove move = SpecialMove.GetCurrentMove(attacker);

			if (a != null)
			{
				percentageBonus += (int)(a.DamageScalar * 100) - 100;
			}

			if (move != null)
			{
				percentageBonus += (int)(move.GetDamageScalar(attacker, defender) * 100) - 100;
			}

			percentageBonus += (int)(damageBonus * 100) - 100;

			CheckSlayerResult cs = CheckSlayers(attacker, defender);

			if (cs != CheckSlayerResult.None)
			{
				if (cs == CheckSlayerResult.Slayer)
				{
					defender.FixedEffect(0x37B9, 10, 5);
				}

				percentageBonus += 100;
			}

			if (!attacker.Player)
			{
				if (defender is PlayerMobile)
				{
					PlayerMobile pm = (PlayerMobile)defender;

					if (pm.EnemyOfOneType != null && pm.EnemyOfOneType != attacker.GetType())
					{
						percentageBonus += 100;
					}
				}
			}
			else if (!defender.Player)
			{
				if (attacker is PlayerMobile)
				{
					PlayerMobile pm = (PlayerMobile)attacker;

					if (pm.WaitingForEnemy)
					{
						pm.EnemyOfOneType = defender.GetType();
						pm.WaitingForEnemy = false;
					}

					if (pm.EnemyOfOneType == defender.GetType())
					{
						defender.FixedEffect(0x37B9, 10, 5, 1160, 0);

						percentageBonus += 50;
					}
				}
			}

			int packInstinctBonus = GetPackInstinctBonus(attacker, defender);

			if (packInstinctBonus != 0)
			{
				percentageBonus += packInstinctBonus;
			}

			if (m_InDoubleStrike)
			{
				percentageBonus -= 10;
			}

			TransformContext context = TransformationSpellHelper.GetContext(defender);

			if ((m_Slayer == SlayerName.Silver || m_Slayer2 == SlayerName.Silver) && context != null &&
				context.Spell is NecromancerSpell && context.Type != typeof(HorrificBeastSpell))
			{
				// Every necromancer transformation other than horrific beast takes an additional 25% damage
				percentageBonus += 25;
			}

			if (attacker is PlayerMobile && !(Core.ML && defender is PlayerMobile))
			{
				PlayerMobile pmAttacker = (PlayerMobile)attacker;

				if (pmAttacker.HonorActive && pmAttacker.InRange(defender, 1))
				{
					percentageBonus += 25;
				}

				if (pmAttacker.SentHonorContext != null && pmAttacker.SentHonorContext.Target == defender)
				{
					percentageBonus += pmAttacker.SentHonorContext.PerfectionDamageBonus;
				}
			}

			#region Stygian Abyss
			percentageBonus += BattleLust.GetBonus(attacker, defender);

            if (this is BaseThrown)
            {
                double dist = attacker.GetDistanceToSqrt(defender);
                int max = ((BaseThrown)this).MaxThrowRange;

                if (dist > max)
                    percentageBonus -= 47;
            }

            if (attacker.Race == Race.Gargoyle)
            {
                double perc = ((double)attacker.Hits / (double)attacker.HitsMax) * 100;

                perc = 100 - perc;
                perc /= 20;

                if (perc > 4)
                    percentageBonus += 60;
                else if (perc >= 3)
                    percentageBonus += 45;
                else if (perc >= 2)
                    percentageBonus += 30;
                else if (perc >= 1)
                    percentageBonus += 15;
            }
			#endregion

			#region Mondain's Legacy
			if (Core.ML)
			{
				BaseTalisman talisman = attacker.Talisman as BaseTalisman;

				if (talisman != null && talisman.Killer != null)
				{
					percentageBonus += talisman.Killer.DamageBonus(defender);
				}

				if (this is ButchersWarCleaver)
				{
					if (defender is Bull || defender is Cow || defender is Gaman)
					{
						percentageBonus += 100;
					}
				}
			}
			#endregion

			percentageBonus = Math.Min(percentageBonus, 300);

			damage = AOS.Scale(damage, 100 + percentageBonus);
			#endregion

			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 (!Core.AOS && damage < 1)
			{
				damage = 1;
			}
			else if (Core.AOS && damage == 0) // parried
			{
				if (a != null && a.Validate(attacker) /*&& a.CheckMana( attacker, true )*/)
					// Parried special moves have no mana cost 
				{
					a = null;
					WeaponAbility.ClearCurrentAbility(attacker);

					attacker.SendLocalizedMessage(1061140); // Your attack was parried!
				}
			}

			#region Mondain's Legacy
			if (m_Immolating)
			{
				int d = ImmolatingWeaponSpell.GetImmolatingDamage(this);
				d = AOS.Damage(defender, attacker, d, 0, 100, 0, 0, 0);

				AttuneWeaponSpell.TryAbsorb(defender, ref d);

				if (d > 0)
				{
					defender.Damage(d);
				}
			}
			#endregion

            #region SA
            if (m_SearingWeapon && attacker.Mana > 0)
            {
                int d = SearingWeaponContext.Damage;

                if ((this is BaseRanged && 10 > Utility.Random(100)) || 20 > Utility.Random(100))
                {
                    AOS.Damage(defender, attacker, d, 0, 100, 0, 0, 0);
                    AOS.Damage(attacker, null, 4, false, 0, 0, 0, 0, 0, 0, 100, false, false, false);

                    defender.FixedParticles(0x36F4, 1, 11, 0x13A8, 0, 0, EffectLayer.Waist);

                    SearingWeaponContext.CheckHit(defender);
                    attacker.Mana--;
                }
            }

            bool splintering = false;
            if (m_AosWeaponAttributes.SplinteringWeapon > 0 && m_AosWeaponAttributes.SplinteringWeapon > Utility.Random(100))
            {
                if (SplinteringWeaponContext.CheckHit(attacker, defender, this))
                    splintering = true;
            }
            #endregion

			AddBlood(attacker, defender, damage);

			int phys, fire, cold, pois, nrgy, chaos, direct;

			GetDamageTypes(attacker, out phys, out fire, out cold, out pois, out nrgy, out chaos, out direct);

			if (Core.ML && this is BaseRanged)
			{
				BaseQuiver quiver = attacker.FindItemOnLayer(Layer.Cloak) as BaseQuiver;

				if (quiver != null)
				{
					quiver.AlterBowDamage(ref phys, ref fire, ref cold, ref pois, ref nrgy, ref chaos, ref direct);
				}
			}

			if (m_Consecrated)
			{
				phys = defender.PhysicalResistance;
				fire = defender.FireResistance;
				cold = defender.ColdResistance;
				pois = defender.PoisonResistance;
				nrgy = defender.EnergyResistance;

				int low = phys, type = 0;

				if (fire < low)
				{
					low = fire;
					type = 1;
				}
				if (cold < low)
				{
					low = cold;
					type = 2;
				}
				if (pois < low)
				{
					low = pois;
					type = 3;
				}
				if (nrgy < low)
				{
					low = nrgy;
					type = 4;
				}

				phys = fire = cold = pois = nrgy = chaos = direct = 0;

				if (type == 0)
				{
					phys = 100;
				}
				else if (type == 1)
				{
					fire = 100;
				}
				else if (type == 2)
				{
					cold = 100;
				}
				else if (type == 3)
				{
					pois = 100;
				}
				else if (type == 4)
				{
					nrgy = 100;
				}
			}

			// TODO: Scale damage, alongside the leech effects below, to weapon speed.
			if (ImmolatingWeaponSpell.IsImmolating(this) && damage > 0)
			{
				ImmolatingWeaponSpell.DoEffect(this, defender);
			}

			int damageGiven = damage;

			if (a != null && !a.OnBeforeDamage(attacker, defender))
			{
				WeaponAbility.ClearCurrentAbility(attacker);
				a = null;
			}

			if (move != null && !move.OnBeforeDamage(attacker, defender))
			{
				SpecialMove.ClearCurrentMove(attacker);
				move = null;
			}

			bool ignoreArmor = (a is ArmorIgnore || (move != null && move.IgnoreArmor(attacker)));

			damageGiven = AOS.Damage(
				defender,
				attacker,
				damage,
				ignoreArmor,
				phys,
				fire,
				cold,
				pois,
				nrgy,
				chaos,
				direct,
				false,
				this is BaseRanged,
				false);

            #region Stygian Abyss
            SoulChargeContext.CheckHit(attacker, defender, damageGiven);
            #endregion

			double propertyBonus = (move == null) ? 1.0 : move.GetPropertyBonus(attacker);

			if (Core.AOS)
			{
				int lifeLeech = 0;
				int stamLeech = 0;
				int manaLeech = 0;
				int wraithLeech = 0;

                if ((int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitLeechHits) * propertyBonus) >
					Utility.Random(100))
				{
					lifeLeech += 30; // HitLeechHits% chance to leech 30% of damage as hit points
				}

                if ((int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitLeechStam) * propertyBonus) >
					Utility.Random(100))
				{
					stamLeech += 100; // HitLeechStam% chance to leech 100% of damage as stamina
				}

				if ((int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitLeechMana) * propertyBonus) >
					Utility.Random(100))
				{
					manaLeech += 40; // HitLeechMana% chance to leech 40% of damage as mana
				}

				if (m_Cursed)
				{
					lifeLeech += 50; // Additional 50% life leech for cursed weapons (necro spell)
				}

				context = TransformationSpellHelper.GetContext(attacker);

				if (context != null && context.Type == typeof(VampiricEmbraceSpell))
				{
					lifeLeech += 20; // Vampiric embrace gives an additional 20% life leech
				}

				if (context != null && context.Type == typeof(WraithFormSpell))
				{
					wraithLeech = (5 + (int)((15 * attacker.Skills.SpiritSpeak.Value) / 100));
						// Wraith form gives an additional 5-20% mana leech

					// Mana leeched by the Wraith Form spell is actually stolen, not just leeched.
					defender.Mana -= AOS.Scale(damageGiven, wraithLeech);

					manaLeech += wraithLeech;
				}

				if (lifeLeech != 0)
				{
                    int toHeal = AOS.Scale(damageGiven, lifeLeech);
                    #region High Seas
                    if (defender is BaseCreature && ((BaseCreature)defender).TaintedLifeAura)
                    {
                        AOS.Damage(attacker, defender, toHeal, false, 0, 0, 0, 0, 0, 0, 100, false, false, false);
                        attacker.SendLocalizedMessage(1116778); //The tainted life force energy damages you as your body tries to absorb it.
                    }
                    else
                        attacker.Hits += toHeal;
                    #endregion
				}

				if (stamLeech != 0)
				{
					attacker.Stam += AOS.Scale(damageGiven, stamLeech);
				}

				if (manaLeech != 0)
				{
					attacker.Mana += AOS.Scale(damageGiven, manaLeech);
				}

				if (lifeLeech != 0 || stamLeech != 0 || manaLeech != 0)
				{
					attacker.PlaySound(0x44D);
				}
			}

			if (m_MaxHits > 0 &&
				((MaxRange <= 1 && (defender is Slime || defender is ToxicElemental || defender is CorrosiveSlime)) || splintering ||
				 Utility.Random(25) == 0)) // Stratics says 50% chance, seems more like 4%..
			{
				if (MaxRange <= 1 && (defender is Slime || defender is ToxicElemental || defender is CorrosiveSlime))
				{
					attacker.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500263); // *Acid blood scars your weapon!*
				}

				if (Core.AOS &&
					m_AosWeaponAttributes.SelfRepair + (IsSetItem && m_SetEquipped ? m_SetSelfRepair : 0) > Utility.Random(10))
				{
					HitPoints += 2;
				}
				else
				{
					if (m_Hits > 0)
					{
						--HitPoints;
					}
					else if (m_MaxHits > 1)
					{
						--MaxHitPoints;

						if (Parent is Mobile)
						{
							((Mobile)Parent).LocalOverheadMessage(MessageType.Regular, 0x3B2, 1061121);
								// Your equipment is severely damaged.
						}
					}
					else
					{
						Delete();
					}
				}
			}

			if (attacker is VampireBatFamiliar)
			{
				BaseCreature bc = (BaseCreature)attacker;
				Mobile caster = bc.ControlMaster;

				if (caster == null)
				{
					caster = bc.SummonMaster;
				}

				if (caster != null && caster.Map == bc.Map && caster.InRange(bc, 2))
				{
					caster.Hits += damage;
				}
				else
				{
					bc.Hits += damage;
				}
			}

			if (Core.AOS)
			{
				int physChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitPhysicalArea) * propertyBonus);
				int fireChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitFireArea) * propertyBonus);
				int coldChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitColdArea) * propertyBonus);
				int poisChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitPoisonArea) * propertyBonus);
				int nrgyChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitEnergyArea) * propertyBonus);

				if (physChance != 0 && physChance > Utility.Random(100))
				{
					DoAreaAttack(attacker, defender, 0x10E, 50, 100, 0, 0, 0, 0);
				}

				if (fireChance != 0 && fireChance > Utility.Random(100))
				{
					DoAreaAttack(attacker, defender, 0x11D, 1160, 0, 100, 0, 0, 0);
				}

				if (coldChance != 0 && coldChance > Utility.Random(100))
				{
					DoAreaAttack(attacker, defender, 0x0FC, 2100, 0, 0, 100, 0, 0);
				}

				if (poisChance != 0 && poisChance > Utility.Random(100))
				{
					DoAreaAttack(attacker, defender, 0x205, 1166, 0, 0, 0, 100, 0);
				}

				if (nrgyChance != 0 && nrgyChance > Utility.Random(100))
				{
					DoAreaAttack(attacker, defender, 0x1F1, 120, 0, 0, 0, 0, 100);
				}

				int maChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitMagicArrow) * propertyBonus);
				int harmChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitHarm) * propertyBonus);
				int fireballChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitFireball) * propertyBonus);
				int lightningChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitLightning) * propertyBonus);
				int dispelChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitDispel) * propertyBonus);

				#region Stygian Abyss
				int curseChance = (int)(m_AosWeaponAttributes.HitCurse * propertyBonus);
				int fatigueChance = (int)(m_AosWeaponAttributes.HitFatigue * propertyBonus);
				int manadrainChance = (int)(m_AosWeaponAttributes.HitManaDrain * propertyBonus);
				#endregion

				if (maChance != 0 && maChance > Utility.Random(100))
				{
					DoMagicArrow(attacker, defender);
				}

				if (harmChance != 0 && harmChance > Utility.Random(100))
				{
					DoHarm(attacker, defender);
				}

				if (fireballChance != 0 && fireballChance > Utility.Random(100))
				{
					DoFireball(attacker, defender);
				}

				if (lightningChance != 0 && lightningChance > Utility.Random(100))
				{
					DoLightning(attacker, defender);
				}

				if (dispelChance != 0 && dispelChance > Utility.Random(100))
				{
					DoDispel(attacker, defender);
				}

				#region Stygian Abyss
				if (curseChance != 0 && curseChance > Utility.Random(100))
				{
					DoCurse(attacker, defender);
				}

				if (fatigueChance != 0 && fatigueChance > Utility.Random(100))
				{
					DoFatigue(attacker, defender, damageGiven);
				}

				if (manadrainChance != 0 && manadrainChance > Utility.Random(100))
				{
					DoManaDrain(attacker, defender, damageGiven);
				}
				#endregion

				int laChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitLowerAttack) * propertyBonus);
				int ldChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitLowerDefend) * propertyBonus);

				if (laChance != 0 && laChance > Utility.Random(100))
				{
					DoLowerAttack(attacker, defender);
				}

				if (ldChance != 0 && ldChance > Utility.Random(100))
				{
					DoLowerDefense(attacker, defender);
				}
			}

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

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

			if (a != null)
			{
				a.OnHit(attacker, defender, damage);
			}

			if (move != null)
			{
				move.OnHit(attacker, defender, damage);
			}

			if (defender is IHonorTarget && ((IHonorTarget)defender).ReceivedHonorContext != null)
			{
				((IHonorTarget)defender).ReceivedHonorContext.OnTargetHit(attacker);
			}

			if (!(this is BaseRanged))
			{
				if (AnimalForm.UnderTransformation(attacker, typeof(GiantSerpent)))
				{
					defender.ApplyPoison(attacker, Poison.Lesser);
				}

				if (AnimalForm.UnderTransformation(defender, typeof(BullFrog)))
				{
					attacker.ApplyPoison(defender, Poison.Regular);
				}
			}

			XmlAttach.OnWeaponHit(this, attacker, defender, damageGiven);
		}
Exemplo n.º 58
0
        private void DoCounter(Mobile attacker)
        {
            if (Map == null || (attacker is BaseCreature && ((BaseCreature)attacker).BardProvoked))
            {
                return;
            }

            if (0.2 > Utility.RandomDouble())
            {
                /* Counterattack with Hit Poison Area
                 * 20-25 damage, unresistable
                 * Lethal poison, 100% of the time
                 * Particle effect: Type: "2" From: "0x4061A107" To: "0x0" ItemId: "0x36BD" ItemIdName: "explosion" FromLocation: "(296 615, 17)" ToLocation: "(296 615, 17)" Speed: "1" Duration: "10" FixedDirection: "True" Explode: "False" Hue: "0xA6" RenderMode: "0x0" Effect: "0x1F78" ExplodeEffect: "0x1" ExplodeSound: "0x0" Serial: "0x4061A107" Layer: "255" Unknown: "0x0"
                 * Doesn't work on provoked monsters
                 */
                Mobile target = null;

                if (attacker is BaseCreature)
                {
                    Mobile m = ((BaseCreature)attacker).GetMaster();

                    if (m != null)
                    {
                        target = m;
                    }
                }

                if (target == null || !target.InRange(this, 25))
                {
                    target = attacker;
                }

                Animate(10, 4, 1, true, false, 0);

                ArrayList         targets = new ArrayList();
                IPooledEnumerable eable   = target.GetMobilesInRange(8);

                foreach (Mobile m in eable)
                {
                    if (m == this || !CanBeHarmful(m))
                    {
                        continue;
                    }

                    if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != Team))
                    {
                        targets.Add(m);
                    }
                    else if (m.Player)
                    {
                        targets.Add(m);
                    }
                }
                eable.Free();
                for (int i = 0; i < targets.Count; ++i)
                {
                    Mobile m = (Mobile)targets[i];

                    DoHarmful(m);

                    AOS.Damage(m, this, Utility.RandomMinMax(20, 25), true, 0, 0, 0, 100, 0);

                    m.FixedParticles(0x36BD, 1, 10, 0x1F78, 0xA6, 0, (EffectLayer)255);
                    m.ApplyPoison(this, Poison.Lethal);
                }
            }
        }
Exemplo n.º 59
0
        public virtual bool ExecuteTrap( Mobile from )
        {
            if ( m_TrapType != TrapType.None )
            {
                Point3D loc = this.GetWorldLocation();
                Map facet = this.Map;

                if ( from.AccessLevel >= AccessLevel.GameMaster )
                {
                    SendMessageTo( from, "That is trapped, but you open it with your godly powers.", 0x3B2 );
                    return false;
                }

                switch ( m_TrapType )
                {
                    case TrapType.ExplosionTrap:
                    {
                        SendMessageTo( from, 502999, 0x3B2 ); // You set off a trap!

                        if ( from.InRange( loc, 3 ) )
                        {
                            int damage;

                            if ( m_TrapLevel > 0 )
                                damage = Utility.RandomMinMax( 10, 30 ) * m_TrapLevel;
                            else
                                damage = m_TrapPower;

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

                            // Your skin blisters from the heat!
                            from.LocalOverheadMessage( Network.MessageType.Regular, 0x2A, 503000 );
                        }

                        Effects.SendLocationEffect( loc, facet, 0x36BD, 15, 10 );
                        Effects.PlaySound( loc, facet, 0x307 );

                        break;
                    }
                    case TrapType.MagicTrap:
                    {
                        if ( from.InRange( loc, 1 ) )
                            from.Damage( m_TrapPower );
                            //AOS.Damage( from, m_TrapPower, 0, 100, 0, 0, 0 );

                        Effects.PlaySound( loc, Map, 0x307 );

                        Effects.SendLocationEffect( new Point3D( loc.X - 1, loc.Y, loc.Z ), Map, 0x36BD, 15 );
                        Effects.SendLocationEffect( new Point3D( loc.X + 1, loc.Y, loc.Z ), Map, 0x36BD, 15 );

                        Effects.SendLocationEffect( new Point3D( loc.X, loc.Y - 1, loc.Z ), Map, 0x36BD, 15 );
                        Effects.SendLocationEffect( new Point3D( loc.X, loc.Y + 1, loc.Z ), Map, 0x36BD, 15 );

                        Effects.SendLocationEffect( new Point3D( loc.X + 1, loc.Y + 1, loc.Z + 11 ), Map, 0x36BD, 15 );

                        break;
                    }
                    case TrapType.DartTrap:
                    {
                        SendMessageTo( from, 502999, 0x3B2 ); // You set off a trap!

                        if ( from.InRange( loc, 3 ) )
                        {
                            int damage;

                            if ( m_TrapLevel > 0 )
                                damage = Utility.RandomMinMax( 5, 15 ) * m_TrapLevel;
                            else
                                damage = m_TrapPower;

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

                            // A dart imbeds itself in your flesh!
                            from.LocalOverheadMessage( Network.MessageType.Regular, 0x62, 502998 );
                        }

                        Effects.PlaySound( loc, facet, 0x223 );

                        break;
                    }
                    case TrapType.PoisonTrap:
                    {
                        SendMessageTo( from, 502999, 0x3B2 ); // You set off a trap!

                        if ( from.InRange( loc, 3 ) )
                        {
                            Poison poison;

                            if ( m_TrapLevel > 0 )
                            {
                                poison = Poison.GetPoison( Math.Max( 0, Math.Min( 4, m_TrapLevel - 1 ) ) );
                            }
                            else
                            {
                                AOS.Damage( from, m_TrapPower, 0, 0, 0, 100, 0 );
                                poison = Poison.Greater;
                            }

                            from.ApplyPoison( from, poison );

                            // You are enveloped in a noxious green cloud!
                            from.LocalOverheadMessage( Network.MessageType.Regular, 0x44, 503004 );
                        }

                        Effects.SendLocationEffect( loc, facet, 0x113A, 10, 20 );
                        Effects.PlaySound( loc, facet, 0x231 );

                        break;
                    }
                    case TrapType.DyeTrap:
                    {
                        from.SendMessage( "A dye pack explodes, covering your face and hair." );
                        from.HueMod = 298;
                        from.HairHue = 298;
                        break;
                    }
                }

                m_TrapType = TrapType.None;
                m_TrapPower = 0;
                m_TrapLevel = 0;
                return true;
            }

            return false;
        }
Exemplo n.º 60
0
 public void DoPoison(Mobile from)
 {
     from.ApplyPoison(from, Poison);
 }