public override int AbsorbDamage( Mobile attacker, Mobile defender, int damage )
		{
			damage = base.AbsorbDamage( attacker, defender, damage );

			int absorb = defender.MeleeDamageAbsorb;

			if ( absorb > 0 )
			{
				if ( absorb > damage )
				{
					int react = damage / 5;

					if ( react <= 0 )
						react = 1;

					defender.MeleeDamageAbsorb -= damage;
					damage = 0;

					attacker.Damage( react, defender );

					attacker.PlaySound( 0x1F1 );
					attacker.FixedEffect( 0x374A, 10, 16 );
				}
				else
				{
					defender.MeleeDamageAbsorb = 0;
					defender.SendLocalizedMessage( 1005556 ); // Your reactive armor spell has been nullified.
					DefensiveSpell.Nullify( defender );
				}
			}

			return damage;
		}
		public override void OnDamage( int amount, Mobile from, bool willKill )
		{
			base.OnDamage( amount, from, willKill );

			if ( kReflectDamagePercent > 0 && null != from && !(from.Deleted))
				from.Damage( (int)(Math.Round( amount / kReflectDamagePercent )), this );
		}
 public override void DoAttackEffect( Mobile m )
 {
     //m.Damage( Utility.Dice( 6, 10, 40 ), m );
     //Damage reduced by Blady.
     int dmg = Utility.Dice( 10, 6, 20 );
     m.Damage( dmg * (100 - m.FireResistance / 2) / 100, m);
 }
        public override void ApplyPoison( Mobile to, Mobile source, int intensity )
        {
            int amount = (int)( intensity * Divisor );
            if ( amount == 0 )
                amount = 1;
            switch ( (int)Stat )
            {
                case (int)Stat.Health:
                {
                    to.Damage( amount, source );
                    break;
                }

                case (int)Stat.Stamina:
                {
                    to.Stam-=amount;
                    break;
                }

                case (int)Stat.Mana:
                {
                    to.Mana-=amount;
                    break;
                }
            }
        }
Example #5
0
		public override void OnDoubleClick( Mobile from )
		{
			if( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); //That must be in your pack to use it.
			}
			else
			{
				if( from.Skills.Magery.Base < 85 )
				{
					from.SendMessage( "The scroll bursts into flame in your hands!" );
					from.FixedParticles( 0x36BD, 20, 10, 5044, EffectLayer.Waist );
					from.Damage( Utility.RandomMinMax( 40, 55 ) );
					
					this.Delete();
				}
				else
				{
					from.Frozen = true;
					from.PublicOverheadMessage( MessageType.Spell, from.SpeechHue, true, "In Kal Quas", false );
					
					if( !from.Mounted && from.Body.IsHuman )
						from.Animate( 206, 7, 1, true, false, 0 );
					
					from.BeginTarget( 10, false, TargetFlags.None, new TargetCallback( BlessingOfKhopesh_OnTarget ) );
				}
			}
		}
Example #6
0
		public override bool OnBeforeDamage( Mobile attacker, Mobile defender )
		{
			if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
				return false;

			ClearCurrentAbility( attacker );

			attacker.SendMessage( "You become one with you weapon, allowing it to guide you hand. The effects of this attack are unpredictable, but effective." );
			defender.SendMessage( "You enemie become one with their weapon and the effects of his attack are unpredictable" );

				attacker.PlaySound( 0x20C );
				attacker.PlaySound( 0x56 );
				attacker.FixedParticles( 0x3779, 1, 30, 9964, 3, 3, EffectLayer.Waist );

				IEntity from = new Entity( Serial.Zero, new Point3D( attacker.X, attacker.Y, attacker.Z ), attacker.Map );
				IEntity to = new Entity( Serial.Zero, new Point3D( attacker.X, attacker.Y, attacker.Z + 50 ), attacker.Map );
				Effects.SendMovingParticles( from, to, 0xF5F, 1, 0, false, false, 33, 3, 9501, 1, 0, EffectLayer.Head, 0x100 );

			int damage = 10; 

			damage += Math.Min( 5, (int)(Math.Abs( attacker.Skills[SkillName.Anatomy].Value + attacker.Skills[SkillName.ArmsLore].Value ) / 8));

			defender.Damage( damage, attacker );

			return true;
		}
		public override void OnGotMeleeAttack( Mobile attacker )
		{
			base.OnGotMeleeAttack( attacker );

			attacker.Damage( Utility.Random( 10, 10 ), this );
			attacker.Stam -= Utility.Random( 10, 10 );
			attacker.Mana -= Utility.Random( 10, 10 );
		}
		public override void OnGaveMeleeAttack( Mobile defender )
		{
			base.OnGaveMeleeAttack( defender );

			defender.Damage( Utility.Random( 10, 10 ), this );
			defender.Stam -= Utility.Random( 10, 10 );
			defender.Mana -= Utility.Random( 10, 10 );
		}
Example #9
0
 public void Damage( Mobile m )
 {
     int damage = Utility.RandomMinMax( m_MinDamage, m_MaxDamage );
     if ( Core.AOS )
         AOS.Damage( m, damage, 0, 0, 0, 100, 0 );
     else
         m.Damage( damage );
 }
Example #10
0
		public override void ExecuteTrap( Mobile from )
		{
			base.ExecuteTrap( from );

			from.Damage( Utility.RandomMinMax( 45, 60 ), this.Owner );

			Effects.PlaySound( from.Location, from.Map, 0x207 );
			Effects.SendLocationEffect( this.Door.Location, this.Door.Map, Utility.RandomList( 0x36B0, 0x36BD, 0x36CA ), 20 );
		}
		public override bool OnMoveOver( Mobile m )
		{
			if( m.Alive && !(IsDeadPet(m)) && !(IsAnt(m)) )
			{
				m.Damage( Utility.Random( 10, 15 ) );
				m.PlaySound(0x1dE);
				BurnTimer = new m_Timer( m );
				BurnTimer.Start();
			}
			return true;
		}
		public override void OnGaveMeleeAttack( Mobile defender )
		{
			base.OnGaveMeleeAttack( defender );
			{
				DoHarmful( defender );
				Effects.SendMovingEffect( this, defender, 0x36E4, 7, 0, false, true, 0x480, 0 );
				defender.SendMessage( "You are hurt by the coldness of the attack!" );
				int toDrain = Utility.RandomMinMax( 20, 25 );
				defender.Damage( toDrain );
			}
		}
Example #13
0
        protected void OnDamage( Mobile m, int amount )
        {
            if ( !m_Damaging && m_DamageChance > Utility.Random( 100 ) )
            {
                m_Damaging = true;

                amount = (int) ( amount * m_DamageFactor / 100 );
                m.Damage( amount, Caster );

                m_Damaging = false;
            }
        }
Example #14
0
 public void SurpriseAttack(Mobile defender, int damage)
 {
     if (Level >= PerkLevel.Fifth)
     {
         if (Player.Hidden)
         {
             Player.SendMessage("You catch your opponent off-guard!");
             defender.SendMessage("Your opponent catches you off-guard!");
             defender.Damage(damage, Player);
         }
     }
 }
Example #15
0
        public override void Damage(int amount, Mobile from)
        {
            MobileObject mo = Support.GetMobileObject(from);

            if (mo != null && !mo.CanBeAttackedByEvilSpirit) // If can't be attacked, dish damage back to attacker.
            {
                from.Damage(amount);

                amount = 0;
            }

            base.Damage(amount, from);
        }
Example #16
0
		public override void ExecuteTrap( Mobile from )
		{
			base.ExecuteTrap( from );

			from.Damage( Utility.RandomMinMax( 20, 30 ), this.Owner );

			Effects.SendMovingEffect( this.Door, from, 0xF42, 18, 1, false, false );
			from.PlaySound( 0x234 );

			Blood bl = new Blood();
			bl.ItemID = Utility.Random( 0x122A, 5 );
			bl.MoveToWorld( from.Location, from.Map );
		}
 public static void DoBleed( Mobile m, Mobile from, int level )
 {
     if ( m.Alive )
     {
         m.PlaySound( 0x133 );
         m.Damage( level, from );
         Blood blood = new Blood();
         blood.ItemID = Utility.Random( 0x122A, 5 );
         blood.MoveToWorld( m.Location, m.Map );
     }
     else
         EndBleed( m, false );
 }
Example #18
0
        public static void DoTalon( Mobile m, Mobile from, int level )
        {
            if ( m.Alive )
            {
                int damage = (int) ( level * 0.2 );

                m.Damage( damage, from );
            }
            else
            {
                EndTalon( m, false );
            }
        }
Example #19
0
		/* TODO: Repel Magic
		 * 10% chance of repelling a melee attack (why did they call it repel magic anyway?)
		 * Cliloc: 1070844
		 * Effect: damage is dealt to the attacker, no damage is taken by the fan dancer
		 */

		public override void OnDamagedBySpell( Mobile attacker )
		{
			base.OnDamagedBySpell( attacker );

			if ( 0.8 > Utility.RandomDouble() && !attacker.InRange( this, 1 ) )
			{
				/* Fan Throw
				 * Effect: - To: "0x57D4F5B" - ItemId: "0x27A3" - ItemIdName: "Tessen" - FromLocation: "(992 299, 24)" - ToLocation: "(992 308, 22)" - Speed: "10" - Duration: "0" - FixedDirection: "False" - Explode: "False" - Hue: "0x0" - Render: "0x0"
				 * Damage: 50-65
				 */
				Effects.SendPacket( attacker, attacker.Map, new HuedEffect( EffectType.Moving, Serial.Zero, Serial.Zero, 0x27A3, this.Location, attacker.Location, 10, 0, false, false, 0, 0 ) );
				attacker.Damage( Utility.RandomMinMax( 50, 65 ), this);
			}
		}
Example #20
0
		public static void HungerDecay( Mobile m )
		{         
            if ( m != null && m is Player) 
            {
                Adventurer adv = Perk.GetByType<Adventurer>((Player)m);

                if (adv != null) 

                    if (Utility.RandomDouble() < 0.33 && m.Hunger < 20)
                    {
                        m.Hunger += adv.HungerThirstBonus();
                    }                                  
            }

            if ((m != null && m.Alive && m.Hunger >= 1 && m.AccessLevel == AccessLevel.Player) &&
                ((Player)m).Race != Race.Liche && ((Player)m).Race != Race.Elemental)
                m.Hunger --;

			if( m != null && m.Alive )
			{
				if( m.Hunger > 14 )
					return;

				else if( m.Hunger >= 10 && m.Hunger <= 14 )
					m.SendMessage( "You feel somewhat hungry." );

				else if( m.Hunger >= 5 && m.Hunger < 10 )
					m.SendMessage( "You feel quite hungry." );

				else if( m.Hunger > 0 && m.Hunger < 5 )
					m.SendMessage( "You are very hungry, and should find something to eat." );

				else
				{
					m.SendMessage( "Your lack of food is wasting away at your body!" );
					m.Damage( Utility.RandomMinMax(25, 45 ) );
                    m.Stam -= Utility.RandomMinMax(20, 30);
                    m.Mana -= Utility.RandomMinMax(20, 30);
				}

				if( m.Hunger < 10 )
				{
					m.PublicOverheadMessage( MessageType.Regular, m.EmoteHue, true, String.Format( "*{0} stomach growls softly*", m.Female ? "her" : "his" ) );

					if( m.Hidden )
						m.RevealingAction();
				}
			}
		}
Example #21
0
		public virtual void BonusAction( PlayerMobile player, Mobile attacker )
		{
			if( attacker != null )
			{
				this.Animate( 9, 1, 1, true, false, 0 );

				this.Say( "*its tail whips the ground hard, sending a boulder through the air*" );
				Effects.SendMovingEffect( this, attacker, 0x11B6, 8, 0, false, false, 0, 0 );

				int dmg = (int)(attacker.Hits * 0.33);

				attacker.Damage( dmg, this );
				attacker.SendMessage( "You have been hit by a boulder!" );
			}
		}
		public override void AggressiveAction( Mobile aggressor, bool criminal )
		{
			base.AggressiveAction( aggressor, criminal );

			Item item = aggressor.FindItemOnLayer( Layer.Helm );

			if ( item is NecromaticMask )
			{
                aggressor.Damage(30);
				item.Delete();
				aggressor.FixedParticles( 0x36BD, 20, 10, 5044, EffectLayer.Head );
				aggressor.PlaySound( 0x365 );
				aggressor.SendMessage( "The necromancer destroyed your mask!" );
			}
		}
		public override bool OnMoveOver( Mobile m )
		{
			if ( m != null )
			{
				if ( m is BlueKaysa || m is BlueTreeGuardian || m.AccessLevel != AccessLevel.Player )
					return true;

				Slow.SlowWalk( m, 15 );
				m.SendMessage( "The thorns pierce your shoes and injure your feet." );
				m.Damage( Utility.RandomMinMax( 1, 4 ) );
				
			}

			return true;
		}
Example #24
0
		public override void AggressiveAction( Mobile aggressor, bool criminal )
		{
			base.AggressiveAction( aggressor, criminal );

			if ( aggressor.BodyMod == 183 || aggressor.BodyMod == 184 )
			{
				aggressor.Damage(50);
				aggressor.BodyMod = 0;
				aggressor.HueMod = -1;
				aggressor.FixedParticles( 0x36BD, 20, 10, 5044, EffectLayer.Head );
				aggressor.PlaySound( 0x307 );
				aggressor.SendLocalizedMessage( 1040008 ); // Your skin is scorched as the tribal paint burns away!

				if ( aggressor is PlayerMobile )
					((PlayerMobile)aggressor).SavagePaintExpiration = TimeSpan.Zero;
			}
		}
Example #25
0
        public void ComboAttack(Mobile attacker, Mobile defender, BaseWeapon weapon)
        {
            if (Level >= PerkLevel.Fifth)
            {
                if (weapon is Fists)
                {
                    int hitChance = (attacker.Dex / 8);
                    if (hitChance > Utility.RandomMinMax(0, 100))
                    {
                        int hits = Utility.RandomMinMax(1, 2);
                        int damage = Utility.RandomMinMax(1, 3) + (attacker.Str / 10);

                        for (int i = 1; i <= hits; i++)
                        {
                            attacker.DoHarmful(defender);
                            defender.Damage(damage);

                            int sound = Utility.RandomMinMax(1, 3);

                            switch (sound)
                            {
                                case 1:
                                    {
                                        attacker.PlaySound(0x13E);
                                        break;
                                    }
                                case 2:
                                    {
                                        attacker.PlaySound(0x145);
                                        break;
                                    }
                                case 3:
                                    {
                                        attacker.PlaySound(0x142);
                                        break;
                                    }
                            }
                        }

                        attacker.SendMessage("You strike your opponent multiple times in a combination-attack!");
                    }
                }
            }
        }
Example #26
0
        public static void DismountAttack( Mobile from, Mobile target )
        {
            target.Damage( 1, from );

            IMount mt = target.Mount;

            if ( mt != null )
            {
                mt.Rider = null;
            }

            if ( target.IsPlayer )
            {
                target.BeginAction( typeof( BaseMount ) );

                target.SendLocalizedMessage( 1040023 ); // You have been knocked off of your mount!

                target.EndAction( typeof( BaseMount ) );
            }

            from.DoHarmful( target );
        }
        public override int AbsorbDamage( Mobile attacker, Mobile defender, int damage )
        {
            damage = base.AbsorbDamage( attacker, defender, damage );

            if ( defender.MeleeDamageAbsorb > 0 && attacker.GetDistanceToSqrt( defender ) <= 1 )
            {
                double absorb = (double)(damage * defender.MeleeDamageAbsorb) / 100.0;
                if ( absorb > damage )
                    absorb = damage;

                attacker.PlaySound( 0x1F1 );
                attacker.FixedEffect( 0x374A, 10, 16 );

                if ( absorb >= 1 )
                {
                    attacker.Damage( ((int)absorb + 1) / 2 ); // since damage is havled before its applied... halve it here too
                    damage -= (int)absorb;
                }
            }

            return damage;
        }
Example #28
0
        public override void OnHit( Mobile attacker, Mobile defender, int damage )
        {
            if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
                return;

            ClearCurrentAbility( attacker );

            defender.Damage( (int) ( 15.0 * ( attacker.Skills[SkillName.Bushido].Value - 50.0 ) / 70.0 + Utility.RandomMinMax( 1, 10 ) ), attacker );

            double chance = (double) ( ( ( 4 * attacker.Skills[SkillName.Bushido].Value ) + 150 ) / 700 );

            if ( chance < Utility.RandomDouble() )
            {
                attacker.SendLocalizedMessage( 1070804 ); // Your target resists paralysis.
                return;
            }

            if ( Server.Items.ParalyzingBlow.IsInmune( defender ) )
            {
                attacker.SendLocalizedMessage( 1070804 ); // Your target resists paralysis.
                defender.SendLocalizedMessage( 1070813 ); // You resist paralysis.

                return;
            }

            attacker.SendLocalizedMessage( 1063356 ); // You cripple your target with a nerve strike!
            defender.SendLocalizedMessage( 1063357 ); // Your attacker dealt a crippling nerve strike!

            attacker.FixedParticles( 0x37C4, 1, 8, 0x13AF, 0, 0, EffectLayer.Waist );
            defender.FixedEffect( 0x376A, 9, 32 );
            defender.PlaySound( 0x204 );

            defender.Freeze( TimeSpan.FromSeconds( 2.0 ) );

            Server.Items.ParalyzingBlow.BeginInmunity( defender, TimeSpan.FromSeconds( 10.0 ) );
        }
Example #29
0
        public override void OnHit( Mobile attacker, Mobile defender, int damage )
        {
            if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
                return;

            ClearCurrentAbility( attacker );

            attacker.SendLocalizedMessage( 1060165 ); // You have delivered a concussion!
            defender.SendLocalizedMessage( 1060166 ); // You feel disoriented!

            defender.PlaySound( 0x213 );
            defender.FixedParticles( 0x377A, 1, 32, 9949, 1153, 0, EffectLayer.Head );

            Effects.SendMovingParticles( new DummyEntity( Serial.Zero, new Point3D( defender.X, defender.Y, defender.Z + 10 ), defender.Map ), new DummyEntity( Serial.Zero, new Point3D( defender.X, defender.Y, defender.Z + 20 ), defender.Map ), 0x36FE, 1, 0, false, false, 1133, 3, 9501, 1, 0, EffectLayer.Waist, 0x100 );

            defender.Damage( 10, attacker );

            InternalTimer timer;
            int mana;

            if ( m_Table.ContainsKey( defender ) )
            {
                timer = m_Table[defender];
                timer.Stop();

                mana = timer.Mana;
            }
            else
            {
                mana = defender.Mana / 2;
                defender.Mana -= mana;
            }

            timer = m_Table[defender] = new InternalTimer( defender, mana );
            timer.Start();
        }
Example #30
0
 public override void DoAttackEffect( Mobile m )
 {
     m.Damage( Utility.Dice( 6, 10, 40 ), this.Placer );
 }