Example #1
0
        public override void OnDoubleClick(Mobile from)
        {

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

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

                }
            }
        }
Example #2
0
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( CheckHSequence( m ) )
            {
                m.BoltEffect( 0x480 );

                SpellHelper.Turn( Caster, m );

                double damage = Caster.Skills[SkillName.SpiritSpeak].Value * ClericDivineFocusSpell.GetScalar( Caster );

                if ( Core.AOS )
                {
                    SpellHelper.Damage( TimeSpan.Zero, m, Caster, damage, 0, 0, 0, 0, 100 );
                }
                else
                {
                    SpellHelper.Damage( TimeSpan.Zero, m, Caster, damage );
                }
            }

            FinishSequence();
        }
Example #3
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 );

				double damage = Utility.Random( 12, 9 );

                if (CheckResisted(m))
                {
                    damage *= 0.75;

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

                damage *= GetDamageScalar(m);

                m.BoltEffect( 0 );

				SpellHelper.Damage( this, m, damage, 0, 0, 0, 0, 100 );
			}

			FinishSequence();
		}
Example #4
0
		// note that this method will be called when attached to either a mobile or a weapon
		// when attached to a weapon, only that weapon will do additional damage
		// when attached to a mobile, any weapon the mobile wields will do additional damage
		public override void OnWeaponHit(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven)
		{
			// if it is still refractory then return
			if (DateTime.UtcNow < m_EndTime)
			{
				return;
			}

			int damage = 0;

			if (m_Damage > 0)
			{
				damage = Utility.Random(m_Damage);
			}

			if (defender != null && attacker != null && damage > 0)
			{
				defender.BoltEffect(0);

				//SpellHelper.Damage( TimeSpan.Zero, defender, attacker, damage, 0, 0, 0, 0, 100 );
				SpellHelper.Damage(TimeSpan.FromSeconds(1.0), defender, attacker, damage);

				m_EndTime = DateTime.UtcNow + Refractory;
			}
		}
Example #5
0
        private void ExplodeHorn( Mobile target )
        {
            target.SendMessage("One of the eryon's horns seems to glow, erupting violently in a flash!");

            this.FixedEffect(0x36B0, 10, 1);
            target.BoltEffect(0);
            target.BoltEffect(0);

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

            this.Direction = this.GetDirectionTo(target.Location);
            this.DoHarmful(target, true);
            target.Damage(Utility.RandomMinMax(15, 45), this);

            Item hornShard = new Item(0x9D1); //grape bunch itemID
            hornShard.Hue = 1109;
            hornShard.Name = "a piece of eryon horn";
            hornShard.MoveToWorld(target.Location, target.Map);
        }
        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 score a critical hit!");
                    defender.PublicOverheadMessage(MessageType.Emote, 34, false, string.Format("*Critical hit!*"));
                    defender.BoltEffect(0);
                    defender.Hits -= 10;
                }
            }

            base.OnHit(attacker, defender);
        }
Example #7
0
            protected override void OnTick()
            {
                Mobile  owner = m_Flag.RootParent as Mobile;
                CTFGame game  = m_Flag.Game;

                TimeSpan left = MaxFlagHoldTime - (DateTime.Now - m_Start);

                if (left >= TimeSpan.FromSeconds(1.0))
                {
                    if (left > TimeSpan.FromMinutes(1.0))
                    {
                        Interval = TimeSpan.FromSeconds(30.0);
                    }
                    else if (left > TimeSpan.FromSeconds(30.0))
                    {
                        Interval = TimeSpan.FromSeconds(15.0);
                    }
                    else if (left >= TimeSpan.FromSeconds(10.0))
                    {
                        Interval = TimeSpan.FromSeconds(5.0);
                    }
                    else
                    {
                        Interval = TimeSpan.FromSeconds(1.0);
                    }

                    if (owner != null)
                    {
                        owner.SendAsciiMessage("You must take the {0} flag to your flag in {1} seconds or be killed!", m_Flag.Team.Name, (int)left.TotalSeconds);
                    }
                }
                else
                {
                    if (owner != null)
                    {
                        owner.BoltEffect(0);
                        owner.PlaySound(0xDC);                          //snake hiss
                        owner.Kill();
                    }

                    m_Flag.Game.PlayerMessage("The {0} flag has been returned to base!", m_Flag.Team.Name);
                    m_Flag.ReturnToHome();
                    Stop();
                }
            }
Example #8
0
        public override void OnHit(Mobile attacker, Mobile defender, double damageBonus)
        {
/*
 *                      if ( defender is PlayerMobile )
 *                      {
 *                              AOS.Damage( attacker, 50, 0, 100, 0, 0, 0 );
 *                              Delete();
 *                              attacker.FixedParticles( 0x36BD, 20, 10, 5044, EffectLayer.Head );
 *                              attacker.PlaySound( 0x307 );
 *                      }
 */

            if (defender != null && !defender.Player && attacker.Alive && (m_Summon == null || !m_Summon.Alive))
            {
                if (damageBonus <= 1.0 && 0.1 > Utility.RandomDouble())
                {
                    switch (Utility.Random(7))
                    {
                    case 0: m_Summon = new GrizzlyBear(); break;

                    case 1: m_Summon = new BlackBear(); break;

                    case 2: m_Summon = new BrownBear(); break;

                    case 3: m_Summon = new Cougar(); break;

                    case 4: m_Summon = new DireWolf(); break;

                    case 5: m_Summon = new Panther(); break;

                    case 6: m_Summon = new TimberWolf(); break;
                    }

                    m_Summon.ControlSlots = 1;
                    SpellHelper.Summon(m_Summon, attacker, 0x215, TimeSpan.FromMinutes(2.0), false, false);
                    m_Summon.Combatant = defender;
                    attacker.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot);
                    attacker.BoltEffect(0);
                    attacker.PlaySound(1481);
                    attacker.SendMessage("A creature has been summoned to your aid!");
                }
            }

            base.OnHit(attacker, defender, damageBonus);
        }
Example #9
0
 protected override void OnTarget(Mobile from, object targeted)
 {
     if (targeted is Mobile)
     {
         Mobile targ = (Mobile)targeted;
         if (!from.CanSee(targ))
         {
             from.SendMessage("You Cannot See This Target");
         }
         else
         {
             targ.Emote("* Ohh-Rah! Get Vanqusihed by the Hands of The Ice-God *");
             targ.BoltEffect(0);
             targ.Damage(Utility.Random(5, 65));
             from.Emote("* In Rememberance of Old Man Ice-God!*");
         }
     }
 }
Example #10
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);

                double damage;

                if (Core.AOS)
                {
                    damage = GetNewAosDamage(23, 1, 4, m);
                }
                else
                {
                    damage = Utility.Random(12, 9);

                    if (CheckResisted(m))
                    {
                        damage *= 0.75;

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

                    damage *= GetDamageScalar(m);
                }

                m.BoltEffect(0);

                SpellHelper.Damage(this, m, damage, 0, 0, 0, 0, 100);
            }

            FinishSequence();
        }
Example #11
0
        //TODO - add ConsumeAmmo on weaponabilities
        // public override bool ConsumeAmmo => false;

        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            Map map = attacker.Map;

            if (map == null || attacker.Weapon is not BaseWeapon weapon || !CheckMana(attacker, true))
            {
                return;
            }

            List <Mobile>     targets = new List <Mobile>();
            IPooledEnumerable eable   = defender.GetMobilesInRange(5);

            foreach (Mobile m in eable)
            {
                if (m != defender && m != attacker && SpellHelper.ValidIndirectTarget(attacker, m) && m?.Deleted == false &&
                    m.Map == attacker.Map && m.Alive && attacker.CanSee(m) && attacker.CanBeHarmful(m) &&
                    attacker.InRange(m, weapon.MaxRange) && attacker.InLOS(m))
                {
                    targets.Add(m);
                }
            }

            eable.Free();
            defender.BoltEffect(0);

            var mobilesLeft = Math.Min(targets.Count, 2);

            while (mobilesLeft-- > 0)
            {
                var index = Utility.Random(targets.Count);
                var m     = targets[index];
                targets.RemoveAt(index);

                m.BoltEffect(0);
                AOS.Damage(m, attacker, Utility.RandomMinMax(29, 40), 0, 0, 0, 0, 100);
            }
        }
Example #12
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (!CheckLineOfSight(m))
            {
                this.DoFizzle();
                Caster.SendAsciiMessage("Target is not in line of sight");
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

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

                double damage;

                if (Core.AOS)
                {
                    damage = GetNewAosDamage(23, 1, 4, m);
                }
                else
                {
                    damage = Utility.Random(12, 9);

                    if (CheckResisted(m))
                    {
                        damage *= 0.75;

                        m.SendMessage("Voce sente seu corpo resistindo a magia");                         // You feel yourself resisting magical energy.
                    }

                    damage *= GetDamageScalar(m);
                }

                m.BoltEffect(0);

                SpellHelper.Damage(this, m, damage, 0, 0, 0, 0, 100);
            }

            FinishSequence();
        }
Example #13
0
        public override void Damage(Mobile m)
        {
            base.Damage(m);

            if (m.Alive)
            {
                Item item = m.FindItemOnLayer(Layer.OuterTorso);

                if (item is GMRobe)
                {
                    AOS.Damage(m, 0, 0, 0, 0, 0, 0);

                    if (Utility.RandomDouble() < 0.15)
                    {
                        m.PlaySound(Utility.RandomList(0x307, 0x308));
                    }
                }
                else
                {
                    // Wind
                    if (Utility.RandomDouble() < 0.09)
                    {
                        m.PlaySound(Utility.RandomList(0x014, 0x15, 0x016, 0x5C7));
                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                    }

                    // Thunderstorm
                    if (Utility.RandomDouble() < 0.06)
                    {
                        m.PlaySound(Utility.RandomList(0x028, 0x029, 0x206));
                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                    }

                    // Lightning Strike
                    if (Utility.RandomDouble() < 0.01)
                    {
                        m.PlaySound(Utility.RandomList(0x5CE));
                        m.BoltEffect(0x480);
                        AOS.Damage(m, Utility.RandomMinMax(12, 35), 0, 0, 0, 0, 100);
                    }
                }
            }
        }
Example #14
0
		public override bool DoMountAbility( int damage, Mobile attacker )
		{
			if( Rider == null || attacker == null )	//sanity
				return false;

			if( (Rider.Hits - damage) < 30 && Rider.Map == attacker.Map && Rider.InRange( attacker, 18 ) )	//Range and map checked here instead of other base fuction because of abiliites that don't need to check this
			{
				attacker.BoltEffect( 0 );
				// 35~100 damage, unresistable, by the Ki-rin.
				attacker.Damage( Utility.RandomMinMax( 35, 100 ), this, false );	//Don't inform mount about this damage, Still unsure wether or not it's flagged as the mount doing damage or the player.  If changed to player, without the extra bool it'd be an infinite loop

				Rider.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1042534 );	// Your mount calls down the forces of nature on your opponent.
				Rider.FixedParticles( 0, 0, 0, 0x13A7, EffectLayer.Waist );
				Rider.PlaySound( 0xA9 );	// Ki-rin's whinny.
				return true;
			}

			return false;
		}
        public override void TrapEffect(Mobile from)
        {
            from.PlaySound(0x4A);  // click sound

            from.BoltEffect(0);

            int damage = Utility.RandomMinMax(40, 60);

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

            bool m_TrapsLimit = Trapcrafting.Config.TrapsLimit;

            if ((m_TrapsLimit) && (((PlayerMobile)this.Owner).TrapsActive > 0))
            {
                ((PlayerMobile)this.Owner).TrapsActive -= 1;
            }

            this.Delete();
        }
Example #16
0
		public override void OnDoubleClick( Mobile from )
		{
            if (IsChildOf(from.Backpack))
            {
                if (from.Kills != 0)
                {
                    from.BoltEffect(0);
                    --from.Kills;
                    from.SendAsciiMessage("A killcount has been removed!");
                    from.SendMessage("Your new killcount is: {0}", from.Kills);
                    Consume();

                }
                else
                    from.SendMessage("You are already at 0 kills!");
            }
            else
                from.SendLocalizedMessage(1060640); // "This item must be in your backpack to use it"
		}
Example #17
0
        public override void OnDoubleClick(Mobile m)
        {
            if (IsChildOf(m.Backpack))
            {
                if (m.Karma != 0)
                {
                    m.BoltEffect(0);
                    m.Karma = 0;
                    m.SendAsciiMessage("Your karma has been reset!");
                    m.SendMessage("Your new karma is: {0}", m.Karma);
                    Consume();

                }
                else
                    m.SendMessage("You already have 0 karma!");
            }
            else
                m.SendLocalizedMessage(1060640); // "This item must be in your backpack to use it"
        }
Example #18
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                Mobile source = Caster;

                SpellHelper.Turn(source, m);

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

                double damage;

                if (Core.AOS)
                {
                    damage = GetNewAosDamage(80, 8, 18, m);
                }
                else
                {
                    damage = Utility.Random(48, 36);

                    if (CheckResisted(m))
                    {
                        damage *= 0.75;

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

                    damage *= GetDamageScalar(m);
                }

                source.BoltEffect(0);
                Effects.SendMovingEffect(Caster, m, 0x379F, 7, 0, false, true, 0x47e, 3);
                source.PlaySound(0x20A);

                SpellHelper.Damage(this, m, damage, 0, 0, 0, 0, 100);
            }

            FinishSequence();
        }
Example #19
0
        public void SpringTrap(Mobile from)
        {
            if (from == null || !from.Alive)
            {
                return;
            }

            int cliloc;
            int damage = Utility.RandomMinMax(75, 150);

            switch (Utility.Random(4))
            {
            default:
            case 0:
                Effects.SendLocationEffect(from, from.Map, 0x3709, 30);
                from.PlaySound(0x54);
                cliloc = 1010524;     // Searing heat scorches thy skin.
                AOS.Damage(from, damage, 0, 100, 0, 0, 0);
                break;

            case 1:
                from.PlaySound(0x223);
                cliloc = 1010525;     // Pain lances through thee from a sharp metal blade.
                AOS.Damage(from, damage, 100, 0, 0, 0, 0);
                break;

            case 2:
                from.BoltEffect(0);
                cliloc = 1010526;     // Lightning arcs through thy body.
                AOS.Damage(from, damage, 0, 0, 0, 0, 100);
                break;

            case 3:
                Effects.SendLocationEffect(from, from.Map, 0x113A, 20, 10);
                from.PlaySound(0x231);
                from.ApplyPoison(from, Poison.Deadly);
                cliloc = 1010523;     // A toxic vapor envelops thee.
                AOS.Damage(from, damage, 0, 0, 0, 100, 0);
                break;
            }

            from.LocalOverheadMessage(MessageType.Regular, 0xEE, cliloc);
        }
Example #20
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            double chanceofspecialmove = .30;
            double random = Utility.RandomDouble();

            if (chanceofspecialmove > random)
            {
                defender.SendLocalizedMessage(1060085);           // Your attacker strikes with lightning speed!

                defender.PlaySound(40);
                defender.BoltEffect(0);

                // Swing again:

                // If no combatant, wrong map, one of us is a ghost, or cannot see, or deleted, then stop combat
                if (defender == null || defender.Deleted || this.Deleted || defender.Map != this.Map || !defender.Alive || !this.Alive || !this.CanSee(defender))
                {
                    this.Combatant = null;
                    return;
                }

                IWeapon weapon = this.Weapon;

                if (weapon == null)
                {
                    return;
                }

                if (!this.InRange(defender, weapon.MaxRange))
                {
                    return;
                }

                if (this.InLOS(defender))
                {
                    BaseWeapon.InDoubleStrike = true;
                    this.RevealingAction();
                    this.NextCombatTime       = DateTime.Now + weapon.OnSwing(this, defender);
                    BaseWeapon.InDoubleStrike = false;
                }
            }
        }
Example #21
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);

                double damage;

                if (Core.AOS)
                {
                    damage = GetNewAosDamage(23, 1, 4, m);
                }
                else
                {
                    //damage = Utility.Random( 12, 9 );
                    damage = (((3 * Utility.Random(1, 8)) + 5) * (50 + Caster.Skills[SkillName.Magery].Value)) / 100;

                    if (CheckResisted(m, damage))
                    {
                        //damage *= 0.75;
                        damage = (damage + 1) / 2;

                        m.SendAsciiMessage("You feel yourself resisting magical energy.");                           // You feel yourself resisting magical energy.
                    }

                    damage *= GetDamageScalar(m);
                }

                m.BoltEffect(0);

                SpellHelper.Damage(this, m, damage, 0, 0, 0, 0, 100);
            }

            FinishSequence();
        }
Example #22
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 );

                double damage;

                if ( Core.AOS )
                {
                    damage = GetNewAosDamage( 23, 1, 4, m );
                }
                else
                {
                    //damage = Utility.Random( 12, 9 );
                    damage = (((3 * Utility.Random(1, 8)) + 5) * (50 + Caster.Skills[SkillName.Magery].Value)) / 100;

                    if ( CheckResisted( m, damage ) )
                    {
                        //damage *= 0.75;
                        damage = (damage + 1) / 2;

                        m.SendAsciiMessage( "You feel yourself resisting magical energy." ); // You feel yourself resisting magical energy.
                    }

                    damage *= GetDamageScalar( m );
                }

                m.BoltEffect( 0 );

                SpellHelper.Damage( this, m, damage, 0, 0, 0, 0, 100 );
            }

            FinishSequence();
        }
Example #23
0
 public override void OnDoubleClick(Mobile from)
 {
     if (DateTime.UtcNow >= LastUsed)
     {
         LastUsed = DateTime.UtcNow + TimeSpan.FromMinutes(20);
         Effects.SendIndividualFlashEffect(from, (FlashType)2);
         from.SolidHueOverride = 2498;
         Timer.DelayCall(TimeSpan.FromSeconds(1), () =>
         {
             from.BoltEffect(2049);
             from.Say("I HAVE THE POWER!");
             Timer.DelayCall(TimeSpan.FromSeconds(3), () => { from.SolidHueOverride = -1; });
         });
     }
     else
     {
         TimeSpan nextuse = LastUsed - DateTime.UtcNow;
         from.SendMessage("You cannot use this again for another " + nextuse.Minutes + " minutes.");
     }
     base.OnDoubleClick(from);
 }
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InRange(this.GetWorldLocation(), 2))
            {
                return;
            }

            int firstOne  = Utility.Random(1, 6);
            int secondOne = Utility.Random(1, 6);

            if ((firstOne + secondOne) <= 5)
            {
                this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} is dead!", from.Name, firstOne, secondOne));
                from.BoltEffect(0);
                from.Kill();
            }
            else
            {
                this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} survives!", from.Name, firstOne, secondOne));
            }
        }
 public override void OnDoubleClick(Mobile from)
 {
     if (DateTime.UtcNow >= LastUsed)
     {
         LastUsed = DateTime.UtcNow + TimeSpan.FromMinutes(20);
         Effects.SendIndividualFlashEffect(from, (FlashType) 2);
         from.SolidHueOverride = 2498;
         Timer.DelayCall(TimeSpan.FromSeconds(1), () =>
         {
             from.BoltEffect(2049);
             from.Say("I HAVE THE POWER!");
             Timer.DelayCall(TimeSpan.FromSeconds(3), () => { from.SolidHueOverride = -1; });
         });
     }
     else
     {
         TimeSpan nextuse = LastUsed - DateTime.UtcNow;
         from.SendMessage("You cannot use this again for another " + nextuse.Minutes + " minutes.");
     }
     base.OnDoubleClick(from);
 }
Example #26
0
        public override bool DoMountAbility(int damage, Mobile attacker)
        {
            if (Rider == null || attacker == null)              //sanity
            {
                return(false);
            }

            if ((Rider.Hits - damage) < 30 && Rider.Map == attacker.Map && Rider.InRange(attacker, 18))                 //Range and map checked here instead of other base fuction because of abiliites that don't need to check this
            {
                attacker.BoltEffect(0);
                // 35~100 damage, unresistable, by the Ki-rin.
                attacker.Damage(Utility.RandomMinMax(35, 100), this, false);     //Don't inform mount about this damage, Still unsure wether or not it's flagged as the mount doing damage or the player.  If changed to player, without the extra bool it'd be an infinite loop

                Rider.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1042534); // Your mount calls down the forces of nature on your opponent.
                Rider.FixedParticles(0, 0, 0, 0x13A7, EffectLayer.Waist);
                Rider.PlaySound(0xA9);                                           // Ki-rin's whinny.
                return(true);
            }

            return(false);
        }
Example #27
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);

                double damage = GetDamage(m);

                m.BoltEffect(0);

                SpellHelper.Damage(this, m, damage, 0, 0, 0, 0, 100);
            }

            FinishSequence();
        }
Example #28
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 );

                double damage = GetDamage( m );

                m.BoltEffect( 0 );

                SpellHelper.Damage( this, m, damage, 0, 0, 0, 0, 100 );
            }

            FinishSequence();
        }
Example #29
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);

                double damage;

                if (Core.AOS)
                {
                    damage = GetNewAosDamage(22, 1, 4);
                }
                else
                {
                    damage = Utility.Random(MinDamage, MaxDamage);

                    if (CheckResisted(m))
                    {
                        damage *= 0.75;

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

                    damage *= GetDamageScalar(m);
                }

                m.BoltEffect(0);

                //Pixie: 7/4/04: added caster to this so corpse wouldn't stay blue to this caster
                SpellHelper.Damage(TimeSpan.FromSeconds(0.35), m, Caster, damage, 0, 0, 0, 0, 100);
            }

            FinishSequence();
        }
Example #30
0
        public override void OnDoubleClick(Mobile from)
        {
            var pm  = from as PlayerMobile;
            var acc = from.Account as Account;

            if (pm != null && acc != null && !String.IsNullOrEmpty(pm.FactionName) &&
                !string.IsNullOrEmpty(OwningFaction))
            {
                Faction     faction = Faction.Find(pm);
                PlayerState state   = PlayerState.Find(pm);
                if (faction != null && state != null && OwningFaction == faction.Definition.Name &&
                    !ObeliskUsers.ContainsKey(acc))
                {
                    if (DateTime.UtcNow <= state.LastKill + TimeSpan.FromHours(2) ||
                        from.AccessLevel > AccessLevel.Player)
                    {
                        Effects.SendIndividualFlashEffect(from, (FlashType)2);
                        from.SendMessage(61, "The obelisk fills you with great power.");
                        from.BoltEffect(2049);
                        from.HueMod = faction.Definition.HuePrimary;
                        ObeliskUsers.Add(acc, DateTime.UtcNow + TimeSpan.FromHours(2));
                    }
                    else
                    {
                        from.SendMessage(61,
                                         "You must honor thy faction with blood. Seek out an enemy faction member and slay them.  Only then will you be worthy of the focal point's power.");
                    }
                }
                else
                {
                    from.SendMessage(61, "You already wield the power of this focal point.");
                }
            }
            else
            {
                from.SendMessage(61,
                                 "You must be a part of factions and your faction must have control of this focal point in order for you to use it.");
            }
            base.OnDoubleClick(from);
        }
Example #31
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }

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

                double damage = 20 + ((int)(GetDamageSkill(Caster) - GetResistSkill(m)) / 12);

                m.BoltEffect(0);

                SpellHelper.Damage(this, m, damage, 0, 0, 0, 0, 100);
                m.PlaySound(m.GetHurtSound());
                m.Animate(!m.Mounted ? 20 : 29, 5, 1, true, false, 0);
            }

            FinishSequence();
        }
Example #32
0
 public override void OnDoubleClick(Mobile m)
 {
     if (IsChildOf(m.Backpack))
     {
         if (m.Karma != 0)
         {
             m.BoltEffect(0);
             m.Karma = 0;
             m.SendAsciiMessage("Your karma has been reset!");
             m.SendMessage("Your new karma is: {0}", m.Karma);
             Consume();
         }
         else
         {
             m.SendMessage("You already have 0 karma!");
         }
     }
     else
     {
         m.SendLocalizedMessage(1060640); // "This item must be in your backpack to use it"
     }
 }
Example #33
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendAsciiMessage("Target can not be seen.");
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

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

                double damage;

                if (Core.AOS)
                {
                    damage = GetNewAosDamage(22, 1, 4, Caster.Player && m.Player);
                }
                else
                {
                    damage = Utility.Random(10, 8);

                    if (CheckResisted(m))
                    {
                        damage *= 0.75;

                        m.SendAsciiMessage("You feel yourself resisting magical energy.");
                    }

                    damage *= GetDamageScalar(m);
                }

                m.BoltEffect(0);

                SpellHelper.Damage(this, m, damage, 0, 0, 0, 0, 100);
            }

            FinishSequence();
        }
Example #34
0
        // note that this method will be called when attached to either a mobile or a weapon
        // when attached to a weapon, only that weapon will do additional damage
        // when attached to a mobile, any weapon the mobile wields will do additional damage
        public override void OnWeaponHit(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven)
        {
            // if it is still refractory then return
            if (DateTime.Now < m_EndTime)
            {
                return;
            }

            int damage = 0;

            if (m_Damage > 0)
            {
                damage = Utility.Random(m_Damage);
            }

            if (defender != null && attacker != null && damage > 0)
            {
                defender.BoltEffect(0);

                m_EndTime = DateTime.Now + Refractory;
            }
        }
        public virtual void Bolt_Callback(object state)
        {
            Mobile to = state as Mobile;

            if (to == null)
            {
                return;
            }

            DoHarmful(to);

            to.BoltEffect(0);

            int damage = Utility.RandomMinMax(23, 29);

            AOS.Damage(to, this, damage, false, 0, 0, 0, 0, 100);

            if (++Bolts == 3 && damage > 0)
            {
                to.SendMessage("You get shocked and dazed!");
            }
        }
        public override void OnDoubleClick(Mobile from)
        {

            if (Parent != from)
            {
                from.SendMessage("The Sword must be eqquiped to use.");
            }
            else if (from.Title != "Merlin's Apprentance")
            {
                from.Title = "Merlin's Apprentance";

                from.BoltEffect(0);
                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);

                m_StatMod0 = new StatMod(StatType.Str, "MOD0", 10, TimeSpan.Zero);
                m_StatMod1 = new StatMod(StatType.Int, "MOD1", 10, TimeSpan.Zero);

                from.AddStatMod(m_StatMod0);
                from.AddStatMod(m_StatMod1);

                this.WeaponAttributes.HitLeechHits = 65;
                this.WeaponAttributes.HitLeechMana = 45;
                this.Attributes.WeaponSpeed = 30;
            }
            else
            {
                from.BoltEffect(0);
                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);

                from.Title = null;

                from.RemoveStatMod("MOD0");
                from.RemoveStatMod("MOD1");

                this.WeaponAttributes.HitLeechHits = 25;
                this.WeaponAttributes.HitLeechMana = 25;
                this.Attributes.WeaponSpeed = 15;
            }
        }
Example #37
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Amulet == null || m_Amulet.Deleted)
                {
                    return;
                }

                if (targeted is Mobile)
                {
                    Mobile target = (Mobile)targeted;

                    if (m_Amulet.UsesRemaining <= 0)
                    {
                        from.SendLocalizedMessage(1042544); // This item is out of charges.
                        return;
                    }

                    target.BoltEffect(0);
                    m_Amulet.UsesRemaining -= 1;
                    m_Amulet.InvalidateProperties();
                }
            }
Example #38
0
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendAsciiMessage( "Target can not be seen." );
            }
            else if ( CheckHSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

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

                double damage;

                if ( Core.AOS )
                {
                    damage = GetNewAosDamage( 22, 1, 4, Caster.Player && m.Player );
                }
                else
                {
                    damage = Utility.Random( 10, 8 );

                    if ( CheckResisted( m ) )
                    {
                        damage *= 0.75;

                        m.SendAsciiMessage( "You feel yourself resisting magical energy." );
                    }

                    damage *= GetDamageScalar( m );
                }

                m.BoltEffect( 0 );

                SpellHelper.Damage( this, m, damage, 0, 0, 0, 0, 100 );
            }

            FinishSequence();
        }
Example #39
0
		public void Target( Mobile m )
		{
			if ( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}

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

			    double damage = 20 + ((int)(GetDamageSkill(Caster) - GetResistSkill(m)) / 12);

				m.BoltEffect( 0 );

				SpellHelper.Damage( this, m, damage, 0, 0, 0, 0, 100 );
			    m.PlaySound(m.GetHurtSound());
			    m.Animate(!m.Mounted ? 20 : 29, 5, 1, true, false, 0);
			}

			FinishSequence();
		}
Example #40
0
 public override void OnDoubleClick(Mobile from)
 {
     if (IsChildOf(from.Backpack))
     {
         if (from.Kills != 0)
         {
             from.BoltEffect(0);
             --from.Kills;
             from.SendAsciiMessage("A killcount has been removed!");
             from.SendMessage("Your new killcount is: {0}", from.Kills);
             Consume();
         }
         else
         {
             from.SendMessage("You are already at 0 kills!");
         }
     }
     else
     {
         from.SendLocalizedMessage(1060640); // "This item must be in your backpack to use it"
     }
 }
Example #41
0
        public override void AggressiveAction(Mobile aggressor, bool criminal)
        {
            base.AggressiveAction(aggressor, criminal);

            if (m_Game != null && m_Game.Running && aggressor != null)
            {
                Item item = aggressor.FindItemOnLayer(Layer.OuterTorso);

                if (item is CTFRobe)
                {
                    CTFTeam team = m_Game.GetTeam(aggressor);

                    if (team != null && team.Name == m_Team.Name)
                    {
                        AOS.Damage(aggressor, 200, 0, 100, 0, 0, 0);
                        this.Game.PlayerMessage("{0} ({1}) was killed for betraying his orc!", aggressor.Name, team.Name);
                        aggressor.BoltEffect(0);
                        aggressor.PlaySound(0x307);
                    }
                }
            }
        }
        public override void OnCast()
        {
            if (CheckSequence())
            {
                if (this.Scroll != null)
                {
                    Scroll.Consume();
                }

                ArrayList targets = new ArrayList();

                IPooledEnumerable eable = base.Caster.Map.GetMobilesInRange(Caster.Location, 7000);

                foreach (Mobile m in eable)
                {
                    if (Caster != m)
                    {
                        targets.Add(m);
                    }
                }

                eable.Free();

                Caster.PlaySound(0x2F3);

                for (int i = 0; i < targets.Count; ++i)
                {
                    Mobile m = (Mobile)targets[i];
                    m.BoltEffect(0);
                    double damage = Core.AOS ? m.Hits - (m.Hits / 3.0) : m.Hits * 0.6;

                    damage = 20000.0;

                    Caster.DoHarmful(m);
                    SpellHelper.Damage(TimeSpan.Zero, m, Caster, (double)damage, 20, 20, 20, 20, 20);
                }
            }
        }
        private static async void Cast(Mobile caster, Mobile defender)
        {
            var damage = SpellHelper.CalcSpellDamage(caster, defender, SpellCircle.Third);

            caster.MovingParticles(defender, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
            caster.PlaySound(0x44B);

            await Timer.Pause(250);

            damage += SpellHelper.CalcSpellDamage(caster, defender, SpellCircle.Third);

            defender.BoltEffect(0);

            await Timer.Pause(250);

            damage += SpellHelper.CalcSpellDamage(caster, defender, SpellCircle.Third);

            defender.FixedParticles(0x3789, 30, 30, 5028, EffectLayer.Waist);
            defender.PlaySound(0x0116);
            defender.PlaySound(0x0117);

            SpellHelper.Damage(damage, defender, caster, null, TimeSpan.Zero, ElementalType.None);
        }
Example #44
0
        public void DoDamage(Mobile to)
        {
            to.SendLocalizedMessage(1152372);                                                       // The Nexus shoots an arc of energy at you!
            to.BoltEffect(0);
            to.LocalOverheadMessage(Server.Network.MessageType.Regular, 0x21, 1114443);             // * Your body convulses from electric shock *
            to.NonlocalOverheadMessage(Server.Network.MessageType.Regular, 0x21, 1114443, to.Name); //  * ~1_NAME~ spasms from electric shock *

            AOS.Damage(to, to, 60, 0, 0, 0, 0, 100);

            if (!to.Alive)
            {
                return;
            }

            if (!DamageTable.ContainsKey(to))
            {
                DamageTimer timer = new DamageTimer(this, to);

                to.Frozen       = true;
                DamageTable[to] = timer;
                timer.Start();
            }
        }
Example #45
0
        public void DoDamage(Mobile to)
        {
            to.Send(new UnicodeMessage(Serial, ItemID, MessageType.Regular, 0x3B2, 3, "", "", "The generator shoots an arc of electricity at you!"));
            to.BoltEffect(0);
            to.LocalOverheadMessage(MessageType.Regular, 0xC9, true, "* Your body convulses from electric shock *");
            to.NonlocalOverheadMessage(MessageType.Regular, 0xC9, true, string.Format("* {0} spasms from electric shock *", to.Name));

            to.Damage(60, to);

            if (!to.Alive)
            {
                return;
            }

            if (m_DamageTable[to] == null)
            {
                to.Frozen = true;

                DamageTimer timer = new DamageTimer(this, to);
                m_DamageTable[to] = timer;

                timer.Start();
            }
        }
		public override void OnTarget( Mobile target )
		{
			if ( CheckHSequence( target ) )
			{
				if ( !(target is BaseChampion || target.HitsMax >= 500) )
				{
					int oldmana = target.Mana;
					int oldhits = target.Hits;

					target.Hits = oldmana;
					target.Mana = oldhits;
				}

				//0xF62 = spear, 0x37B9 = glow, 0x13A7 = pillow
				target.FixedParticles( 0x37B9, 10, 19, 0, 0x501, 0, EffectLayer.LeftFoot );
				target.FixedParticles( 0x37B9, 10, 19, 0, 0x501, 0, EffectLayer.Head );
				target.BoltEffect( 0x35 );
				target.PlaySound( 0x5AA );

				BlueMageControl.CheckKnown( target, this, CanTeach( target ) );
			}

			FinishSequence();
		}
Example #47
0
        // note that this method will be called when attached to either a mobile or a weapon
        // when attached to a weapon, only that weapon will do additional damage
        // when attached to a mobile, any weapon the mobile wields will do additional damage
        public override void OnWeaponHit(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven)
        {
            // if it is still refractory then return
            if (DateTime.UtcNow < this.m_EndTime)
                return;

            int damage = 0;

            if (this.m_Damage > 0)
                damage = Utility.Random(this.m_Damage);

            if (defender != null && attacker != null && damage > 0)
            {
                defender.BoltEffect(0);

                SpellHelper.Damage(TimeSpan.Zero, defender, attacker, damage, 0, 0, 0, 0, 100);

                this.m_EndTime = DateTime.UtcNow + this.Refractory;
            }
        }
		public override void OnHit( Mobile attacker, Mobile defender )
		{
			if ( defender is PlayerMobile )
			{
				AOS.Damage( attacker, 50, 0, 100, 0, 0, 0 );
				Delete();
				attacker.FixedParticles( 0x36BD, 20, 10, 5044, EffectLayer.Head );
				attacker.PlaySound( 0x307 );
			}

			if ( attacker.Alive )
			{
				if ( 0.1 > Utility.RandomDouble() )
				{
						BaseCreature creature = (BaseCreature)Activator.CreateInstance( m_Types[Utility.Random( m_Types.Length )] );
						creature.ControlSlots = 1;
						TimeSpan duration = TimeSpan.FromMinutes( 2.0 );
						SpellHelper.Summon( creature, attacker, 0x215, duration, false, false );
						creature.Combatant = defender;
						attacker.FixedParticles( 0x3709, 10, 30, 5052, EffectLayer.LeftFoot );
						attacker.BoltEffect( 0 );
						attacker.PlaySound( 1481 );
						attacker.SendMessage("A creature has been summoned to your aid!");
				}
				base.OnHit( attacker, defender );
			}
		}
Example #49
0
		public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
		{
/*
			if ( defender is PlayerMobile )
			{
				AOS.Damage( attacker, 50, 0, 100, 0, 0, 0 );
				Delete();
				attacker.FixedParticles( 0x36BD, 20, 10, 5044, EffectLayer.Head );
				attacker.PlaySound( 0x307 );
			}
*/

			if ( defender != null && !defender.Player && attacker.Alive && ( m_Summon == null || !m_Summon.Alive ) )
			{
				if ( damageBonus <= 1.0 && 0.1 > Utility.RandomDouble() )
				{
						switch ( Utility.Random( 7 ) )
						{
							case 0: m_Summon = new GrizzlyBear(); break;
							case 1: m_Summon = new BlackBear(); break;
							case 2: m_Summon = new BrownBear(); break;
							case 3: m_Summon = new Cougar(); break;
							case 4: m_Summon = new DireWolf(); break;
							case 5: m_Summon = new Panther(); break;
							case 6: m_Summon = new TimberWolf(); break;
						}

						m_Summon.ControlSlots = 1;
						SpellHelper.Summon( m_Summon, attacker, 0x215, TimeSpan.FromMinutes( 2.0 ), false, false );
						m_Summon.Combatant = defender;
						attacker.FixedParticles( 0x3709, 10, 30, 5052, EffectLayer.LeftFoot );
						attacker.BoltEffect( 0 );
						attacker.PlaySound( 1481 );
						attacker.SendMessage( "A creature has been summoned to your aid!" );
				}
			}

			base.OnHit( attacker, defender, damageBonus );
		}
Example #50
0
		public void DoDamage( Mobile to )
		{
			switch ( Utility.Random( 4 ) )
			{
				case 0:
				{
					Effects.SendLocationEffect( to, to.Map, 0x113A, 20, 10 );
					to.PlaySound( 0x231 );
					to.LocalOverheadMessage( MessageType.Regular, 0x44, 1010523 ); // A toxic vapor envelops thee.

					to.ApplyPoison( to, Poison.Regular );

					break;
				}
				case 1:
				{
					Effects.SendLocationEffect( to, to.Map, 0x3709, 30 );
					to.PlaySound( 0x54 );
					to.LocalOverheadMessage( MessageType.Regular, 0xEE, 1010524 ); // Searing heat scorches thy skin.

					AOS.Damage( to, to, Utility.RandomMinMax( 10, 40 ), 0, 100, 0, 0, 0 );

					break;
				}
				case 2:
				{
					to.PlaySound( 0x223 );
					to.LocalOverheadMessage( MessageType.Regular, 0x62, 1010525 ); // Pain lances through thee from a sharp metal blade.

					AOS.Damage( to, to, Utility.RandomMinMax( 10, 40 ), 100, 0, 0, 0, 0 );

					break;
				}
				default:
				{
					to.BoltEffect( 0 );
					to.LocalOverheadMessage( MessageType.Regular, 0xDA, 1010526 ); // Lightning arcs through thy body.

					AOS.Damage( to, to, Utility.RandomMinMax( 10, 40 ), 0, 0, 0, 0, 100 );

					break;
				}
			}
		}
Example #51
0
 public override void OnDoubleClick(Mobile from)
 {
     var pm = from as PlayerMobile;
     var acc = from.Account as Account;
     if (pm != null && acc != null && !String.IsNullOrEmpty(pm.FactionName) &&
         !string.IsNullOrEmpty(OwningFaction))
     {
         Faction faction = Faction.Find(pm);
         PlayerState state = PlayerState.Find(pm);
         if (faction != null && state != null && OwningFaction == faction.Definition.Name &&
             !ObeliskUsers.ContainsKey(acc))
         {
             if (DateTime.UtcNow <= state.LastKill + TimeSpan.FromHours(2) ||
                 from.AccessLevel > AccessLevel.Player)
             {
                 Effects.SendIndividualFlashEffect(from, (FlashType) 2);
                 from.SendMessage(61, "The obelisk fills you with great power.");
                 from.BoltEffect(2049);
                 from.HueMod = faction.Definition.HuePrimary;
                 ObeliskUsers.Add(acc, DateTime.UtcNow + TimeSpan.FromHours(2));
             }
             else
             {
                 from.SendMessage(61,
                     "You must honor thy faction with blood. Seek out an enemy faction member and slay them.  Only then will you be worthy of the focal point's power.");
             }
         }
         else
         {
             from.SendMessage(61, "You already wield the power of this focal point.");
         }
     }
     else
     {
         from.SendMessage(61,
             "You must be a part of factions and your faction must have control of this focal point in order for you to use it.");
     }
     base.OnDoubleClick(from);
 }
Example #52
0
        public void DoDamage(Mobile to)
        {
            to.Send(new UnicodeMessage(this.Serial, this.ItemID, MessageType.Regular, 0x3B2, 3, "", "", "The generator shoots an arc of electricity at you!"));
            to.BoltEffect(0);
            to.LocalOverheadMessage(MessageType.Regular, 0xC9, true, "* Your body convulses from electric shock *");
            to.NonlocalOverheadMessage(MessageType.Regular, 0xC9, true, string.Format("* {0} spasms from electric shock *", to.Name));

            AOS.Damage(to, to, 60, 0, 0, 0, 0, 100);

            if (!to.Alive)
                return;

            if (this.m_DamageTable[to] == null)
            {
                to.Frozen = true;

                DamageTimer timer = new DamageTimer(this, to);
                this.m_DamageTable[to] = timer;

                timer.Start();
            }
        }
 private void Emoo( Mobile from )
 {
     from.BoltEffect( 0 );
     from.Animate( 22, 5, 1, true, false, 0 );
     //from.Emote( "*" + from.Name + " was banned to hell for doing the moonwalk...*" );
 }
		public override void OnHit( Mobile caster, Mobile target )
		{
			double damage;

			damage = Utility.Random( 10, 7 );

			if ( CheckResisted( target ) )
			{
				damage *= 0.75;

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

			damage *= GetDamageScalar( target );

			target.BoltEffect( 0 );

			SpellHelper.Damage( this, target, damage, 0, 0, 0, 0, 100 );
		}
Example #55
0
		public override void OnTrigger(object activator, Mobile m)
		{
			if (m == null)
			{
				return;
			}

			// if it is still refractory then return
			if (DateTime.UtcNow < m_EndTime)
			{
				return;
			}

			int damage = 0;

			if (m_Damage > 0)
			{
				damage = Utility.Random(m_Damage);
			}

			if (damage > 0)
			{
				m.BoltEffect(0);

				//SpellHelper.Damage( TimeSpan.Zero, m, damage, 0, 100, 0, 0, 0 );
				SpellHelper.Damage(TimeSpan.FromSeconds(1.0), m, damage);
			}

			m_EndTime = DateTime.UtcNow + Refractory;
		}
		public virtual void DoLightning(Mobile attacker, Mobile defender)
		{
			if (!attacker.CanBeHarmful(defender, false))
			{
				return;
			}

			attacker.DoHarmful(defender);

			double damage = GetAosDamage(attacker, 23, 1, 4);

			defender.BoltEffect(0);

			SpellHelper.Damage(TimeSpan.Zero, defender, attacker, damage, 0, 0, 0, 0, 100);
		}
Example #57
0
        public override void OnTrigger(object activator, Mobile m)
        {
            if (m == null)
                return;

            // if it is still refractory then return
            if (DateTime.UtcNow < this.m_EndTime)
                return;

            int damage = 0;

            if (this.m_Damage > 0)
                damage = Utility.Random(this.m_Damage);

            if (damage > 0)
            {
                m.BoltEffect(0);

                SpellHelper.Damage(TimeSpan.Zero, m, damage, 0, 0, 0, 0, 100);
            }

            this.m_EndTime = DateTime.UtcNow + this.Refractory;
        }
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if (!CheckLineOfSight(m))
            {
                this.DoFizzle();
                Caster.SendAsciiMessage("Target is not in line of sight");
            }
            else if ( CheckHSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

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

                double damage;

                if ( Core.AOS )
                {
                    damage = GetNewAosDamage( 23, 1, 4, m );
                }
                else
                {
                    damage = Utility.Random( 12, 9 );

                    if ( CheckResisted( m ) )
                    {
                        damage *= 0.75;

                        m.SendMessage("Voce sente seu corpo resistindo a magia"); // You feel yourself resisting magical energy.
                    }

                    damage *= GetDamageScalar( m );
                }

                m.BoltEffect( 0 );

                SpellHelper.Damage( this, m, damage, 0, 0, 0, 0, 100 );
            }

            FinishSequence();
        }
 public override void HideEffects(Mobile from)
 {
     from.Hidden = !from.Hidden;
     from.BoltEffect( 0 );
 }
Example #60
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!this.Validate(attacker))
                return;

            ClearCurrentAbility(attacker);

            Map map = attacker.Map;

            if (map == null)
                return;

            BaseWeapon weapon = attacker.Weapon as BaseWeapon;

            if (weapon == null)
                return;

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

            ArrayList list = new ArrayList();
					
            defender.PlaySound(1471);
            defender.BoltEffect(0);
            attacker.SendMessage("The Lighting Arrow strikes a target");

            foreach (Mobile m in defender.GetMobilesInRange(1))
                list.Add(m);

            ArrayList targets = new ArrayList();

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

                if (m != defender && m != attacker && SpellHelper.ValidIndirectTarget(attacker, m))
                {
                    if (m == null || m.Deleted || m.Map != attacker.Map || !m.Alive || !attacker.CanSee(m) || !attacker.CanBeHarmful(m))
                        continue;

                    if (!attacker.InRange(m, weapon.MaxRange))
                        continue;

                    if (attacker.InLOS(m))
                        targets.Add(m);
                }
            }

            if (targets.Count > 0)
            {
                double damageBonus = 1.0 + Math.Pow(1, 2) / 100;

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

                    attacker.SendMessage("The Lighting Arrow strikes around a target");
                    m.PlaySound(1471);
                    m.BoltEffect(0);
                    weapon.OnHit(attacker, m, damageBonus);
                }
            }
        }