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

			ClearCurrentAbility( attacker );

			if( Server.Items.ParalyzingBlow.IsImmune( defender ) )	//After mana consumption intentional
			{
				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.PlaySound( 0x204 );
			defender.FixedEffect( 0x376A, 9, 32 );
			defender.FixedParticles( 0x37C4, 1, 8, 0x13AF, 0, 0, EffectLayer.Waist );

			AOS.Damage( defender, attacker, (int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 10), 100, 0, 0, 0, 0 );	//10-25

			defender.Freeze( TimeSpan.FromSeconds( 2.0 ) );
			Server.Items.ParalyzingBlow.BeginImmunity( defender, Server.Items.ParalyzingBlow.FreezeDelayDuration );
		}
Example #2
0
		public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
		{
			base.OnHit( attacker, defender, damageBonus );

			if ( !attacker.IsT2A && Layer == Layer.TwoHanded
                && (attacker.Skills[SkillName.Anatomy].Value / 100.0 * SpecialMovesController._SpearStunMaxChance) >= Utility.RandomDouble() 
                && Engines.ConPVP.DuelContext.AllowSpecialAbility( attacker, "Paralyzing Blow", false ) )
			{
				defender.SendLocalizedMessage( 1060164 ); // The attack has temporarily paralyzed you!
                defender.Freeze(TimeSpan.FromSeconds( SpecialMovesController._SpearStunDurationSeconds ));

				attacker.SendLocalizedMessage( 1060163 ); // You deliver a paralyzing blow!
				attacker.PlaySound( 0x11C );
			}

			if ( Poison != null && PoisonCharges > 0 && defender.Poison != Poison)
			{
			    bool chargeConsume = false;
                double chance = 
                    (attacker.Skills[SkillName.Tactics].Value + attacker.Skills[OldSkill].Value) / 200.0 * SpecialMovesController._PoisonChanceSpears
                    + (attacker.Skills[SkillName.Poisoning].Value / 100.0 * SpecialMovesController._PoisonSkillChanceMaxBonus);
				if ( chance > Utility.RandomDouble() ) // 50% chance to poison @ GM
				{
				    chargeConsume = true;
                    --PoisonCharges;
					defender.ApplyPoison( attacker, Poison );
				}
                if (!chargeConsume && 0.25 > Utility.RandomDouble())
                    --PoisonCharges;
			}
		}
		public override void OnHit( Mobile attacker, Mobile defender )
		{
			base.OnHit( attacker, defender );

			if ( !Core.AOS && Layer == Layer.TwoHanded && attacker.Followers < 2 && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() )
			{
				defender.SendMessage( "You receive a paralyzing blow!" ); // Is this not localized?
				defender.Freeze( TimeSpan.FromSeconds( 3.5 ) );

				attacker.SendMessage( "You deliver a paralyzing blow!" ); // Is this not localized?
				attacker.PlaySound( 0x11C );
			}
		}
		public override void OnGaveMeleeAttack(Mobile defender)
		{
			base.OnGaveMeleeAttack(defender);

			BaseCreature c = defender as BaseCreature;

			if ( c != null && c.SummonMaster != null )
			{
				c.ControlTarget = c.SummonMaster;
				c.ControlOrder = OrderType.Attack;
				c.Combatant = c.SummonMaster;
				this.Combatant = c.SummonMaster;
			}

			if ( defender.Player )
			{
				defender.Freeze( TimeSpan.FromSeconds( 3.0 ) );
				defender.SendMessage( "You feel completely numb!" );
			}
		}
Example #5
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker) || !CheckMana(attacker, true))
                return;

            ClearCurrentAbility(attacker);

            bool cantpara = Server.Items.ParalyzingBlow.IsImmune(defender);

            if (cantpara)
            {
                attacker.SendLocalizedMessage(1070804); // Your target resists paralysis.
                defender.SendLocalizedMessage(1070813); // You resist paralysis.
            }
            else
            {
                attacker.SendLocalizedMessage(1063356); // You cripple your target with a nerve strike!
                defender.SendLocalizedMessage(1063357); // Your attacker dealt a crippling nerve strike!
            }

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

            if (Core.ML)
            {
                AOS.Damage(defender, attacker, (int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + Utility.Random(10)), true, 100, 0, 0, 0, 0);	//0-25

                if (!cantpara && ((150.0 / 7.0 + (4.0 * attacker.Skills[SkillName.Bushido].Value) / 7.0) / 100.0) > Utility.RandomDouble())
                {
                    defender.Paralyze(TimeSpan.FromSeconds(2.0));
                    Server.Items.ParalyzingBlow.BeginImmunity(defender, Server.Items.ParalyzingBlow.FreezeDelayDuration);
                }
            }
            else if (!cantpara)
            {
                AOS.Damage(defender, attacker, (int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 10), true, 100, 0, 0, 0, 0); //10-25
                defender.Freeze(TimeSpan.FromSeconds(2.0));
                Server.Items.ParalyzingBlow.BeginImmunity(defender, Server.Items.ParalyzingBlow.FreezeDelayDuration);
            }
        }
Example #6
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 );
			}
		}
Example #7
0
		public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
		{
			base.OnHit( attacker, defender, damageBonus );

            if ((attacker.Skills[SkillName.Anatomy].Value / 1000.0) >= Utility.RandomDouble()) // 10% chance to paralyze at 100 anatomy.
			{
				defender.SendMessage( "You receive a paralyzing blow!" );
				defender.Freeze( TimeSpan.FromSeconds( 2.0 ) );

				attacker.SendMessage( "You deliver a paralyzing blow!" ); 
				attacker.PlaySound( 0x11C );
			}

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

				if( Utility.RandomDouble() >= 0.5 ) // 50% chance to poison
					defender.ApplyPoison( attacker, Poison );
			}
		}
Example #8
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 #9
0
        public static void ShockAttack(BaseCreature from, Mobile target)
        {
            if (from.ShockAttack < 10 || from == null || target == null)
                return;

            int mindam = from.ShockAttack / 2;
            int maxdam = from.ShockAttack;

            from.Say("Shock Attack");
            target.SendMessage("Your body is paralyzed from the electrical current!");
            target.Freeze(TimeSpan.FromSeconds(3));
            AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 0, 0, 0, 0, 100);
        }
        //
        // carry out the special attacks
        //
        // If you add a new attack, you must add the code here to define what it actually does when it hits
        //
        public void DoSpecialAttack(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven, SpecialAttack special)
        {
            if(attacker == null || defender == null || weapon == null || special == null) return;

            attacker.SendMessage("you strike with {0}!", special.Name);

            // apply the special attack
            switch(special.AttackID)
            {
                case SpecialAttacks.TripleSlash:
                {
                    defender.Damage( weapon.MaxDamage*3, attacker );
                    break;
                }
                case SpecialAttacks.MindDrain:
                {
                    defender.Mana -= weapon.MaxDamage;
                    break;
                }
                case SpecialAttacks.VortexStrike:
                {
                    attacker.PlaySound( 0x217 );
                    BaseCreature m = new EnergyVortex();
                    m.Summoned = true;
                    m.SummonMaster = attacker;
                    m.Combatant = defender;
                    m.MoveToWorld(defender.Location, defender.Map);
                    break;
                }
                case SpecialAttacks.StamDrain:
                {
                    defender.Stam -= weapon.MaxDamage;
                    break;
                }
                case SpecialAttacks.PuffOfSmoke:
                {
                    attacker.Hidden = true;
                    break;
                }
                case SpecialAttacks.GiftOfHealth:
                {
                    attacker.FixedEffect( 0x376A, 9, 32 );
                    attacker.PlaySound( 0x202 );
                    attacker.Hits = attacker.HitsMax;
                    break;
                }
                case SpecialAttacks.ParalyzingFear:
                {
                    // lose target focus
                    defender.Combatant = null;
                    // flee
                    if(defender is BaseCreature)
                    {
                        ((BaseCreature)defender).BeginFlee(TimeSpan.FromSeconds(6));
                    }
                    // and become paralyzed
                    defender.Freeze( TimeSpan.FromSeconds(3) );
                    defender.FixedEffect( 0x376A, 9, 32 );
                    defender.PlaySound( 0x204 );
                    break;
                }
                default:
                    attacker.SendMessage("no effect");
                    break;
            }
        }
Example #11
0
		public static void Decapitate(Mobile from, Mobile target, Func<Mobile, Item> createHead = null)
		{
			if (from == null || target == null)
			{
				return;
			}

			Map map = target.Map;

			target.Freeze(TimeSpan.FromSeconds(1.0));

			int range = Utility.RandomMinMax(5, 7);
			int zOffset = target.Mounted ? 20 : 10;

			Point3D src = target.Location.Clone3D(0, 0, zOffset);
			var points = src.GetAllPointsInRange(map, range, range);

			Effects.PlaySound(target.Location, map, 0x19C);
			target.Send(VNScreenLightFlash.Instance);

			Timer.DelayCall(
				TimeSpan.FromMilliseconds(100),
				() =>
				{
					foreach (Point3D trg in points)
					{
						int bloodID = Utility.RandomMinMax(4650, 4655);

						new MovingEffectInfo(src, trg.Clone3D(0, 0, 2), from.Map, bloodID).MovingImpact(
							info =>
							{
								new Blood(bloodID).MoveToWorld(info.Target.Location, info.Map);
								Effects.PlaySound(info.Target, info.Map, 0x028);
							});
					}
				});

			target.Kill();

			Timer.DelayCall(
				TimeSpan.FromMilliseconds(100),
				() =>
				{
					var corpse = target.Corpse as Corpse;

					if (corpse != null && !corpse.Deleted)
					{
						corpse.TurnToBones();
					}
				});

			var head = createHead != null ? createHead(target) : null;

			int headID;
			int headHue;

			if (head != null)
			{
				headID = head.ItemID;
				headHue = head.Hue;
			}
			else
			{
				headID = 7393;
				headHue = target.SolidHueOverride >= 0 ? target.SolidHueOverride : target.Hue;
			}

			new MovingEffectInfo(src, src.Clone3D(0, 0, 40), map, headID, headHue).MovingImpact(
				info =>
				new MovingEffectInfo(
					info.Target,
					info.Source.Clone3D(Utility.RandomMinMax(-1, 1), Utility.RandomMinMax(-1, 1), 2),
					info.Map,
					headID,
					headHue).MovingImpact(
						hInfo =>
						{
							if (head != null && !head.Deleted)
							{
								head.MoveToWorld(hInfo.Target.Location, info.Map);
							}
						}));
		}
Example #12
0
        public override void OnGaveMeleeAttack( Mobile defender )
        {
            base.OnGaveMeleeAttack( defender );

            if ( 0.1 > Utility.RandomDouble() )
            {
                defender.FixedParticles( 0x374A, 1, 17, 0x15B6, 0, 0, EffectLayer.Waist );
                defender.PlaySound( 0x233 );

                defender.Damage( 10, this );

                switch ( Utility.Random( 3 ) )
                {
                    case 0:
                        {
                            defender.SendLocalizedMessage( 1112391 ); // The creature's tail smashes into you!

                            break;
                        }
                    case 1:
                        {
                            defender.Freeze( TimeSpan.FromSeconds( 3.0 ) );

                            defender.SendLocalizedMessage( 1112554 ); // You're stunned as the creature's tail knocks the wind out of you.

                            break;
                        }
                    case 2:
                        {
                            defender.SendLocalizedMessage( 1112555 ); // You're left confused as the creature's tail catches you right in the face!
                            defender.PublicOverheadMessage( MessageType.Regular, 946, 502039 ); // *looks confused*

                            defender.AddStatMod( new StatMod( StatType.Dex, "Boura Dex Malus", -20, TimeSpan.FromSeconds( 5.0 ) ) );
                            defender.AddStatMod( new StatMod( StatType.Int, "Boura Int Malus", -20, TimeSpan.FromSeconds( 5.0 ) ) );

                            defender.FixedParticles( 0x37B9, 1, 10, 0x232A, 5, 0, EffectLayer.Head );
                            defender.PlaySound( 0xF9 );

                            break;
                        }
                }
            }
        }
        //
        // carry out the combo attacks
        //
        // If you add a new combo, you must add the code here to define what it actually does when it is activated
        //
        public void DoComboAttack(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven, ComboAttack combo)
        {
            if(attacker == null || defender == null || weapon == null || combo == null) return;

            attacker.SendMessage("You unleash the combo attack {0}!",combo.Name);

            // apply the combo attack
            switch(combo.AttackID)
            {
                case ComboAttacks.ThunderStrike:
                {
                    defender.FixedEffect( 0x376A, 9, 32 );
                    defender.PlaySound( 0x28 );
                    // 5x damage
                    defender.Damage( weapon.MaxDamage*5, attacker );
                    // mana and stam drain
                    defender.Mana -= weapon.MaxDamage*3;
                    defender.Stam -= weapon.MaxDamage*3;
                    // full self heal
                    attacker.FixedEffect( 0x376A, 9, 32 );
                    attacker.Hits = attacker.HitsMax;
                    break;
                }
                case ComboAttacks.LightningRain:
                {
                    defender.Damage( weapon.MaxDamage*3, attacker );
                    defender.Mana -= weapon.MaxDamage*7;
                    defender.Stam -= weapon.MaxDamage*4;
                    break;
                }
                case ComboAttacks.SqueezingFist:
                {
                    // 5 sec paralyze
                    defender.FixedEffect( 0x376A, 9, 32 );
                    defender.PlaySound( 0x204 );
                    defender.Freeze( TimeSpan.FromSeconds(5) );
                    // 7x stam drain
                    defender.Stam -= weapon.MaxDamage*7;
                    break;
                }
            }
        }
Example #14
0
		public override bool OnMoveOver( Mobile m )
		{
			if ( m != null && m is PlayerMobile && m.AccessLevel == AccessLevel.Player ||  m != null && m is BaseCreature && ((BaseCreature)m).Controlled )
			{
				if ( m != null && m.Map == this.Map && m.Alive )
				{
					m.Freeze( m_ParaTime );
					m.SendMessage( "You become entangled in a ball of yarn!" );
				}
			}
			
			return base.OnMoveOver( m );
		}
        public override void OnGotMeleeAttack(Mobile attacker) //taken from ElementalChamp.cs
        {
            base.OnGotMeleeAttack(attacker);

            if (0.25 >= Utility.RandomDouble())
                DrainStam();

            if (Utility.Random(4) < 1)
            {
                Map map = this.Map;

                if (map != null)
                {
                    for (int i = 0; i < 10; ++i)
                    {
                        int x = X + (Utility.RandomMinMax(-15, 15));
                        int y = Y + (Utility.RandomMinMax(-15, 15));
                        int z = Z;

                        if (!map.CanFit(x, y, z, 16, false, false))
                            continue;

                        Point3D from = attacker.Location;
                        Point3D to = new Point3D(x, y, z);

                        if (!InLOS(to))
                            continue;

                        attacker.Location = to;
                        attacker.ProcessDelta();
                        attacker.Combatant = null;
                        attacker.Freeze(TimeSpan.FromSeconds(10.0));

                        Effects.SendLocationParticles(EffectItem.Create(from, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                        Effects.SendLocationParticles(EffectItem.Create(to, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);

                        Effects.PlaySound(to, map, 0x1FE);
                    }
                }
            }
        }
Example #16
0
		public override bool OnDragDrop( Mobile from, Item dropped )
		{
			bool IsQuestItem = false;

			if ( dropped is BloodKey && m_Type == BellType.DarkIron &&  Tallon.Active == false )
			{
				IsQuestItem = true;
			}
			if ( dropped is WoodenKey && m_Type == BellType.Wooden &&  Zirux.Active == false)
			{
				IsQuestItem = true;
			}
			if ( dropped is ShimmeringKey && m_Type == BellType.Blood &&  Krog.Active == false)
			{
				IsQuestItem = true;
			}
			if ( dropped is ClawKey && m_Type == BellType.Beast &&  Alfirix.Active == false)
			{
				IsQuestItem = true;
			}
			if ( dropped is VenomKey && m_Type == BellType.Noxious &&  Ignis.Active == false)
			{
				IsQuestItem = true;
			}
			if (
                dropped is BloodKey && m_Type != BellType.DarkIron
                || dropped is WoodenKey && m_Type != BellType.Wooden
                || dropped is ShimmeringKey && m_Type != BellType.Blood
                || dropped is ClawKey && m_Type != BellType.Beast
                || dropped is VenomKey && m_Type != BellType.Noxious
               )
               {
                SayTo(from, "This is not the key I desire you pathetic mortal!");
                from.Poison = Poison.Lethal;
                from.Freeze (TimeSpan.FromSeconds(15.0));
                return base.OnDragDrop( from, dropped );
               }

			if ( IsQuestItem )
			{
				dropped.Delete();

				BeginRemove( TimeSpan.FromSeconds( 4.0 ) );

				if ( m_AngryAt == from )
					m_AngryAt = null;

				switch ( m_Type )
				{
					case BellType.DarkIron: m_Boss = new Tallon(); break;
					case BellType.Wooden: m_Boss = new Zirux(); break;
					case BellType.Blood: m_Boss = new Krog(); break;
					case BellType.Beast: m_Boss = new Alfirix(); break;
					case BellType.Noxious: m_Boss = new Ignis(); break;
				}

				m_Boss.MoveToWorld( this.Location, this.Map );
				SayTo(from, "So mortal you bring me the correct item, now go slay the creature!");
				from.AddToBackpack( new ItemClaimer() );
				from.SendMessage( "You have recieved an item that is used to collect your reward, if there is one..." );
				return false;
			}
			else
			{
        		Atomic bomb = new Atomic();
        		bomb.MoveToWorld(from.Location, from.Map);
				return base.OnDragDrop( from, dropped );
			}
		}
Example #17
0
		public static void DDFear( Mobile from, Mobile target )
		{
			if ( target == null )
				return;
			else if ( BlueSpell.SavingThrow( target, DDSave.Will, 30 ) )
			{
				target.SendMessage( "You makes a successful save against a spell" );
				return;
			}

			target.SendMessage( "You are too afraid to move!" );
			target.Freeze( TimeSpan.FromSeconds( 30 ) );
		}
Example #18
0
        public void Entangle( Mobile m )
		{
			Point3D p = Location;

			if ( SpellHelper.FindValidSpawnLocation( Map, ref p, true ) )
			{
				TimeSpan delay = TimeSpan.FromSeconds( Utility.RandomMinMax( 3, 6 ) );
				m.MoveToWorld( p, Map );
				m.Freeze( delay );
				m.SendLocalizedMessage( 1042555 ); // You become entangled in the spider web.

				SpiderWeb web = new SpiderWeb( delay );
				p.Z += 2;
				web.MoveToWorld( p, Map );

				Combatant = m;
			}
		}
        public override void AOESpecialEffect(Mobile m)
        {
            int duration = 5;
            if (m.ColdResistance > Utility.Random(50) + 40)
                duration = 4;

            m.Freeze(TimeSpan.FromSeconds(duration));
            m.SendMessage("You are chilled to the bones.");
            m.HueMod = 2063;
            Timer.DelayCall(TimeSpan.FromSeconds(duration), new TimerStateCallback(m_RestoreHue), m);
        }
Example #20
0
		public static void Dismount( Mobile dismounter, Mobile dismounted, BlockMountType blockmounttype, TimeSpan delay, bool message )
		{
			if ( !dismounted.Mounted )
				return;

			if (  dismounted is ChaosDragoonElite )
			{
				dismounter.SendLocalizedMessage( 1042047 ); // You fail to knock the rider from its mount.
			}

			IMount mount = dismounted.Mount;

			if ( mount != null )
			{
				mount.Rider = null;
				BaseMount.SetMountPrevention( dismounted, blockmounttype, delay );

				if ( message )
					dismounted.SendLocalizedMessage( 1040023 ); // You have been knocked off of your mount!
		}
			else if ( dismounted.Flying )
			{
				if ( !OnFlightPath( dismounted ) )
				{
					dismounted.Flying = false;
					dismounted.Freeze( TimeSpan.FromSeconds( 1 ) );
					dismounted.Animate( 61, 10, 1, true, false, 0 );
				}
				else
				{
					// ...
				}
			}
		}
		//
        // carry out the combo defenses
        //
        // If you add a new combo, you must add the code here to define what it actually does when it is activated
        //
        public void DoComboDefense(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven, ComboDefense combo)
		{
		    if(attacker == null || defender == null || weapon == null || combo == null) return;

		    defender.SendMessage("You unleash the combo defense {0}!",combo.Name);

		    // apply the combo defense
            switch(combo.DefenseID)
            {
                case ComboDefenses.ColdWind:
                {
                    // 5 sec paralyze
                    attacker.FixedEffect( 0x376A, 9, 32 );
			        attacker.PlaySound( 0x204 );
                    attacker.Freeze( TimeSpan.FromSeconds(5) );
                    // 7x stam drain
                    attacker.Stam -= weapon.MaxDamage*7;
                    break;
                }
            }
		}
        //
        // carry out the special defenses
        //
        // If you add a new defense, you must add the code here to define what it actually does when it hits
        // can optionally return a value that will be used to reduce damage
        //
        public int DoSpecialDefense(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven, SpecialDefense special)
		{
		
		    if(attacker == null || defender == null || weapon == null || special == null) return 0;

            defender.SendMessage("you defend with {0}!", special.Name);

            // apply the special defense
            switch(special.DefenseID)
            {

                case SpecialDefenses.MindDrain:
                {
                    attacker.Mana -= damageGiven;
                    defender.FixedEffect( 0x375A, 10, 15 );
                    // absorb all of the damage you would have taken
                    return damageGiven;
                }
                case SpecialDefenses.StamDrain:
                {
                    attacker.Stam -= damageGiven;
                    defender.FixedEffect( 0x374A, 10, 15 );
                    // absorb all of the damage you would have taken
                    return damageGiven;
                }
                case SpecialDefenses.SpikeShield:
                {
                    // return the damage to attacker
                    attacker.Damage( damageGiven, defender );
                    defender.SendMessage("{0} damage reflected!", damageGiven);
                    // absorb all of the damage you would have taken
                    return damageGiven;
                }
                case SpecialDefenses.PuffOfSmoke:
                {
                    defender.Hidden = true;
                    break;
                }
                case SpecialDefenses.GiftOfHealth:
                {
                    defender.FixedEffect( 0x376A, 9, 32 );
                    defender.PlaySound( 0x202 );
                    defender.Hits += damageGiven;
                    defender.SendMessage("healed {0}!", damageGiven);
                    // absorb all of the damage you would have taken
                    return damageGiven;
                }
                case SpecialDefenses.ParalyzingFear:
                {
                    // lose target focus
                    attacker.Combatant = null;
                    // flee
                    if(attacker is BaseCreature)
                    {
                    	((BaseCreature)attacker).BeginFlee(TimeSpan.FromSeconds(6));
                    }
                    // and become paralyzed
                    attacker.Freeze( TimeSpan.FromSeconds(damageGiven/10) );
			        attacker.FixedEffect( 0x376A, 9, 32 );
			        attacker.PlaySound( 0x204 );
                    break;
                }
                default:
                    defender.SendMessage("no effect");
                    break;
            }
            return 0;
        }
Example #23
0
        public override void OnGaveMeleeAttack( Mobile defender )
        {
            base.OnGaveMeleeAttack( defender );

            if ( 0.2 < Utility.RandomDouble() )
                return;

            switch ( Utility.Random( 3 ) )
            {
                case 0:
                {
                    defender.SendLocalizedMessage( 1004014 ); // You have been stunned!
                    defender.Freeze( TimeSpan.FromSeconds( 4.0 ) );
                    break;
                }
                case 1:
                {
                    defender.SendAsciiMessage( "You have been hit by a paralyzing blow!" );
                    defender.Freeze( TimeSpan.FromSeconds( 3.0 ) );
                    break;
                }
                case 2:
                {
                    AOS.Damage( defender, this, Utility.Random( 10, 5 ), 100, 0, 0, 0, 0 );
                    defender.SendAsciiMessage( "You have been hit by a critical strike!" );
                    break;
                }
            }
        }
		public override void OnGaveMeleeAttack( Mobile defender )
		{
			base.OnGaveMeleeAttack( defender );

            if ( 0.25 >= Utility.RandomDouble() && m_DismountPlayer )
            {
                IMount mt = defender.Mount;
                if (mt != null)
                {
                    mt.Rider = null;
                    defender.SendMessage("The force of the attack knocks you off your mount!");
                }
            }

            if ( 0.80 >= Utility.RandomDouble() && m_Polymorph > 0 )
				Polymorph( defender );

			if ( 0.1 >= Utility.RandomDouble() && m_Earthquake )
				Earthquake();

			if ( 0.25 >= Utility.RandomDouble() && m_DrainLife )
				DrainLife();

			if ( 0.25 >= Utility.RandomDouble() && m_DrainMana )
				DrainMana();

			if ( 0.25 >= Utility.RandomDouble() && m_DrainStam )
				DrainStam();

			if ( 0.1 >= Utility.RandomDouble() && m_DetectHidden )
				DetectHidden();

			if ( 0.33 >= Utility.RandomDouble() && defender is BaseCreature && m_ProvoPets )
			{
				BaseCreature c = (BaseCreature)defender;

				if ( c.Controlled && c.ControlMaster != null )
				{
					c.ControlTarget = c.ControlMaster;
					c.ControlOrder = OrderType.Attack;
					c.Combatant = c.ControlMaster;
				}
			}

            if (m_GaveHitMessage != null && 0.01 >= Utility.RandomDouble())
                this.Say(m_GaveHitMessage);

            if (0.1 >= Utility.RandomDouble() && m_GiveSkillLoss)
                ApplySkillLoss(defender);

            if (m_DisarmPlayer && 0.25 >= Utility.RandomDouble() && defender is PlayerMobile)
            {
                Item toDisarm=null;
                if (defender.FindItemOnLayer(Layer.OneHanded) != null)
                    toDisarm = defender.FindItemOnLayer(Layer.OneHanded);
                else if (defender.FindItemOnLayer(Layer.TwoHanded) != null)
                    toDisarm = defender.FindItemOnLayer(Layer.TwoHanded);

                if (toDisarm != null && toDisarm.Movable && defender.Backpack != null )
                {
                    defender.Backpack.DropItem(toDisarm);
                    defender.SendMessage("The intensity of the attack disarms you!");
                }
            }

            if (m_StunPunch > 0 && 0.25 >= Utility.RandomDouble())
            {
                defender.Freeze(TimeSpan.FromSeconds(m_StunPunch));
                defender.SendMessage("You have been stunned!");
            }
		}
       		public void Teleport( Mobile caster )
        	{
          		Map map = this.Map;

			if ( map != null )
			{
	                   	for (int i = 0; i < 10; ++i)
                    		{
                	       		int x = X + (Utility.RandomMinMax(-1, 1));
        	              		int y = Y + (Utility.RandomMinMax(-1, 1));
	                      		int z = Z;

        	                	if (!map.CanFit(x, y, z, 16, false, false))
		                            continue;

		                        Point3D from = caster.Location;
	        	                Point3D to = new Point3D(x, y, z);

		                        if (!InLOS(to))
	        	                    continue;

		                        caster.Location = to;
        	                	caster.ProcessDelta();
                		        caster.Combatant = null;
					this.Combatant = caster;
		                        caster.Freeze(TimeSpan.FromSeconds(2.0));

		                        Effects.SendLocationParticles(EffectItem.Create(from, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
	        	                Effects.SendLocationParticles(EffectItem.Create(to, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);

	                	        Effects.PlaySound(to, map, 0x1FE);
        		        }
			}
                }
		public override void OnGaveMeleeAttack(Mobile defender)
		{
            		if (DoElementalChamp && Utility.Random(2) < 1)
            		{
            			Map map = this.Map;

				if ( map != null )
				{
					// try 10 times to find a teleport spot
                    			for (int i = 0; i < 10; ++i)
                    			{
                        			int x = X + (Utility.RandomMinMax(-10, 15));
                        			int y = Y + (Utility.RandomMinMax(-10, 15));
                        			int z = Z;

                        			if (!map.CanFit(x, y, z, 16, false, false))
                            			continue;

                        			Point3D from = defender.Location;
                        			Point3D to = new Point3D(x, y, z);

                        			if (!InLOS(to))
                            			continue;

                        			defender.Location = to;
                        			defender.ProcessDelta();
                        			defender.Combatant = null;
                        			defender.Freeze(TimeSpan.FromSeconds(5.0));

                        			Effects.SendLocationParticles(EffectItem.Create(from, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                        			Effects.SendLocationParticles(EffectItem.Create(to, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);

                        			Effects.PlaySound(to, map, 0x1FE);
                        			DoECTeleport(this);
                    			}
                		}
			}
			base.OnGaveMeleeAttack(defender);
		}
Example #27
0
		public static void DDCharmMonster( Mobile from, Mobile target )
		{
			if ( target == null )
				return;
			else if ( BlueSpell.SavingThrow( target, DDSave.Will, 20 ) )
			{
				target.SendMessage( "You makes a successful save against a spell" );
				return;
			}

			target.SendMessage( "You failed your save verses Charm!" );

			LichLord clone = new LichLord();
			Ability.MimicThem( clone, target, true, true );
			clone.Hidden = true;
			clone.MoveToWorld( target.Location, target.Map );

			if ( target is PlayerMobile )
			{
				target.Kill();

				if ( !AutoLifeSpell.HasAutoLife( (PlayerMobile)target ) && from.Map == Map.Ilshenar )
				{
					target.MoveToWorld( new Point3D( 1704, 591, 9 ), Map.Ilshenar );
					target.SendMessage( 33, "You have been charmed, a clone of you has taken your place and you have been moved to outside the cave." );

					if ( target.Corpse != null && target.Backpack != null )
					{
						List<Item> items = new List<Item>( target.Corpse.Items );

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

							if ( item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.Movable )
								target.Backpack.DropItem( item );
						}
					}
				}
			}
			else if ( target is BaseCreature && ((BaseCreature)target).Controlled )
			{
				target.Kill();

				if ( target == null )
					return;

				target.Freeze( TimeSpan.FromSeconds( 180 ) );
				((BaseCreature)target).ControlOrder = OrderType.Stop;
				target.Hidden = true;
			}
		}
Example #28
0
        public override void OnHit( Mobile attacker, Mobile defender, int damage )
        {
            if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
                return;

            ClearCurrentAbility( attacker );

            if ( AnimalForm.UnderTransformation( attacker ) )
            {
                attacker.SendLocalizedMessage( 1063024 ); // You cannot perform this special move right now.
                return;
            }

            if ( !attacker.Flying && ( defender.Mounted || defender.Flying || AnimalForm.UnderTransformation( defender ) ) )
            {
                attacker.SendLocalizedMessage( 1060082 ); // The force of your attack has dislodged them from their mount!
                defender.SendLocalizedMessage( 1060083 ); // You fall off of your mount and take damage!

                defender.PlaySound( 0x140 );
                defender.FixedParticles( 0x3728, 10, 15, 9955, EffectLayer.Waist );

                IMount mount = defender.Mount;

                if ( mount != null )
                    mount.Rider = null;
                else if ( defender.Flying )
                    defender.Flying = false;
                else
                    AnimalForm.RemoveContext( defender, true );

                BaseMount.SetMountPrevention( defender, BlockMountType.Dazed, DefenderRemountDelay );
                BaseMount.SetMountPrevention( attacker, BlockMountType.DismountRecovery, AttackerRemountDelay );

                AOS.Damage( defender, attacker, Utility.RandomMinMax( 15, 25 ), 100, 0, 0, 0, 0 );
            }
            else
            {
                if ( !Items.ParalyzingBlow.IsInmune( defender ) )
                {
                    attacker.SendLocalizedMessage( 1060163 ); // You deliver a paralyzing blow!
                    defender.SendLocalizedMessage( 1072221 ); // You have been hit by a paralyzing blow!

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

                    Items.ParalyzingBlow.BeginInmunity( defender );
                }
                else
                {
                    attacker.SendLocalizedMessage( 1070804 ); // Your target resists paralysis.
                    defender.SendLocalizedMessage( 1070813 ); // You resist paralysis.
                }

                defender.FixedEffect( 0x376A, 9, 32 );
                defender.PlaySound( 0x204 );
            }
        }
Example #29
0
		public void Teleport( Mobile caster ) // Taken from questboss.cs and values changed (note this.Combatant = caster; was added and i have emailed you this change to questboss.cs too
        	{
          		Map map = this.Map;

			if ( map != null )
			{

                    for (int i = 0; i < 12; ++i)
                    {
                        int x = X + (Utility.RandomMinMax(-1, 1));
                        int y = Y + (Utility.RandomMinMax(-1, 1));
                        int z = Z;

                        if (!map.CanFit(x, y, z, 16, false, false))
                            continue;

                        Point3D from = caster.Location;
                        Point3D to = new Point3D(x, y, z);

                        if (!InLOS(to))
                            continue;

                        caster.Location = to;
                        caster.ProcessDelta();
                        caster.Combatant = null;
			this.Combatant = caster;
                        caster.Freeze(TimeSpan.FromSeconds(1.5));

                        Effects.SendLocationParticles(EffectItem.Create(from, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                        Effects.SendLocationParticles(EffectItem.Create(to, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);

                        Effects.PlaySound(to, map, 0x1FE);
                    }
			}
                }
		// Breath of the Fire Dragon: A cone of searing flame shoots forth, 
		// damaging the targets in the area of the flames for 1d6 (1 to 6) damage 
		// each monk level. A successful Reflex save reduces the damage by half.
		public static void FireCombo( Mobile from )
		{
			from.SendMessage( 2075, "You execute the maneuver: Breath Of The Fire Dragon" );

			int x = from.X, y = from.Y, xoffset = 0, yoffset = 0;
			List<Mobile> mobiles = new List<Mobile>();
			List<Point3D> points = new List<Point3D>();

			foreach ( Mobile m in from.GetMobilesInRange( 4 ) )
			{
				if ( m != null )
					if ( SpellHelper.ValidIndirectTarget( from, m ) )
						mobiles.Add( m );
			}

			switch( from.Direction )
			{
				case (Direction)0x0: case (Direction)0x80: yoffset--; break; //North
				case (Direction)0x1: case (Direction)0x81: { xoffset++; yoffset--; break; } //Right
				case (Direction)0x2: case (Direction)0x82: xoffset++; break; //East
				case (Direction)0x3: case (Direction)0x83: { xoffset++; yoffset++; break; } //Down
				case (Direction)0x4: case (Direction)0x84: yoffset++; break; //South
				case (Direction)0x5: case (Direction)0x85: { xoffset--; yoffset++; break; } //Left
				case (Direction)0x6: case (Direction)0x86: xoffset--; break; //West
				case (Direction)0x7: case (Direction)0x87: { xoffset--; yoffset--; break; } //Up
				default: { break; }
			}

			for ( int i = 0; i < 4; i++ ) // goes to the sides
			{
				for ( int j = i + 1; j <= 4; j++ ) // j goes forward
				{
					if ( j >= i + 1 )
					{
						Point3D point = new Point3D( 0, 0, 0 );
						point.X = ( x + j * xoffset - i * yoffset );
						point.Y = ( y + j * yoffset + i * xoffset );
						point.Z = from.Map.GetAverageZ( point.X, point.Y );
						points.Add( point );

						if ( i > 0 )
						{
							point.X = ( x + j * xoffset + i * yoffset );
							point.Y = ( y + j * yoffset - i * xoffset );
							point.Z = from.Map.GetAverageZ( point.X, point.Y );
							points.Add( point );
						}
					}
				}
			}

			MonkFists mf = from.FindItemOnLayer( Layer.Gloves ) as MonkFists;
			int amount = 0;	

			if ( mf != null )
				amount = Utility.Dice( mf.Teir, 3, (3 * mf.Teir) );
			else
				amount = Utility.Dice( 2, 6, 0 );

			if ( from.FindItemOnLayer( Layer.Waist ) is MonksBelt )
				amount *= 2;

			from.Freeze( TimeSpan.FromSeconds( 1 ) );
			from.Animate( 17, 7, 1, true, false, 0 );
			from.PlaySound( 0x228 );

			for ( int i = 0; i < points.Count; i++ )
			{
				if ( mobiles.Count > 0 )
				{
					for ( int j = mobiles.Count - 1; j > -1; j-- )
					{
						if ( mobiles[j].X == points[i].X && mobiles[j].Y == points[i].Y )
						{
							AOS.Damage( mobiles[j], from, amount, 0, 100, 0, 0, 0 );

							if ( mobiles[j] != null )
								mobiles.Remove( mobiles[j] );
						}
					}
				}

				Effects.SendLocationParticles( EffectItem.Create( points[i], from.Map, EffectItem.DefaultDuration ), 0x36BD, 1, 20, 0/*Hue*/, 4, 0, 0 );
			}

			mobiles.Clear();
			points.Clear();

			MonkSystem.AddHit( from, MonkElement.FireCombo );

			if ( from.HasGump( typeof( MonkStrikeGump ) ) )
				from.CloseGump( typeof( MonkStrikeGump ) );

			from.SendGump( new MonkStrikeGump( from ) );
		}