示例#1
1
        public void Target(Mobile m)
        {
            if (!this.Caster.CanSee(m))
            {
                this.Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (this.CheckHSequence(m))
            {
                SpellHelper.Turn(this.Caster, m);

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

                SpellHelper.AddStatCurse(this.Caster, m, StatType.Dex);

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

                m.Paralyzed = false;

                m.FixedParticles(0x3779, 10, 15, 5002, EffectLayer.Head);
                m.PlaySound(0x1DF);

                int percentage = (int)(SpellHelper.GetOffsetScalar(this.Caster, m, true) * 100);
                TimeSpan length = SpellHelper.GetDuration(this.Caster, m);

                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Clumsy, 1075831, length, m, percentage.ToString()));

                this.HarmfulSpell(m);
            }

            this.FinishSequence();
        }
示例#2
1
		public void Target( Mobile m )
		{
			if ( CheckHSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				/* Transmogrifies the flesh of the target creature or player to resemble rotted corpse flesh,
				 * making them more vulnerable to Fire and Poison damage,
				 * but increasing their resistance to Physical and Cold damage.
				 * 
				 * The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 25 ) + 40 seconds.
				 * 
				 * NOTE: Algorithm above is fixed point, should be:
				 * ((ss-mr)/2.5) + 40
				 * 
				 * NOTE: Resistance is not checked if targeting yourself
				 */

				ExpireTimer timer = (ExpireTimer)m_Table[m];

				if ( timer != null )
					timer.DoExpire();
				else
					m.SendLocalizedMessage( 1061689 ); // Your skin turns dry and corpselike.

				 if ( m.Spell != null )
					m.Spell.OnCasterHurt();
				
				m.FixedParticles( 0x373A, 1, 15, 9913, 67, 7, EffectLayer.Head );
				m.PlaySound( 0x1BB );

				double ss = GetDamageSkill( Caster );
				double mr = ( Caster == m ? 0.0 : GetResistSkill( m ) );
				m.CheckSkill( SkillName.MagicResist, 0.0, 120.0 );	//Skill check for gain

				TimeSpan duration = TimeSpan.FromSeconds( ((ss - mr) / 2.5) + 40.0 );

				ResistanceMod[] mods = new ResistanceMod[4]
					{
						new ResistanceMod( ResistanceType.Fire, -15 ),
						new ResistanceMod( ResistanceType.Poison, -15 ),
						new ResistanceMod( ResistanceType.Cold, +10 ),
						new ResistanceMod( ResistanceType.Physical, +10 )
					};

				timer = new ExpireTimer( m, mods, duration );
				timer.Start();

				BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.CorpseSkin, 1075663, duration, m ) );

				m_Table[m] = timer;

				for ( int i = 0; i < mods.Length; ++i )
					m.AddResistanceMod( mods[i] );

				HarmfulSpell( m );
			}

			FinishSequence();
		}
示例#3
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 ( !from.Hidden == true ) 
            { 
           from.FixedParticles( 0x36CB, 1, 9, 9911, 67, 5, EffectLayer.Head ); 
           from.FixedParticles( 0x374A, 1, 17, 9502, 1108, 4, (EffectLayer)255 ); 
         from.PlaySound( 0x22F ); 
          from.Hidden = true; 
            
            } 
            else 
            { 
           from.Hidden=false; 
           from.FixedParticles( 0x36CB, 1, 9, 9911, 67, 5, EffectLayer.Head ); 
           from.FixedParticles( 0x374A, 1, 17, 9502, 1108, 4, (EffectLayer)255 ); 
         from.PlaySound( 0x22F ); 

                      
            } 
      } 

      
      } 
示例#4
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 );

                if ( Core.AOS )
                {
                    m.FixedParticles( 0x374A, 10, 30, 5013, 1153, 2, EffectLayer.Waist );
                    m.PlaySound( 0x0FC );
                }
                else
                {
                    m.FixedParticles( 0x374A, 10, 15, 5013, EffectLayer.Waist );
                    m.PlaySound( 0x1F1 );
                }

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

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

			if ( m_Table.Contains( m ) )
			{
				Caster.LocalOverheadMessage( MessageType.Regular, 0x481, false, "That target already has this affect." );
			}

			else if ( CheckBSequence( m, false ) )
			{
				SpellHelper.Turn( Caster, m );

				Timer t = new InternalTimer( m, Caster );
				t.Start();
				m_Table[m] = t;
				m.PlaySound( 0x202 );
				m.FixedParticles( 0x376A, 1, 62, 9923, 3, 3, EffectLayer.Waist );
				m.FixedParticles( 0x3779, 1, 46, 9502, 5, 3, EffectLayer.Waist );
				m.SendMessage( "A magic aura surrounds you causing your wounds to heal faster." );
			}

			FinishSequence();
		}
示例#6
0
		public void Target( Mobile m )
		{
			if ( Caster == m || !(m is PlayerMobile || m is BaseCreature) ) // only PlayerMobile and BaseCreature implement blood oath checking
			{
				Caster.SendLocalizedMessage( 1060508 ); // You can't curse that.
			}
			else if ( m_OathTable.Contains( Caster ) )
			{
				Caster.SendLocalizedMessage( 1061607 ); // You are already bonded in a Blood Oath.
			}
			else if ( m_OathTable.Contains( m ) )
			{
				if ( m.Player )
					Caster.SendLocalizedMessage( 1061608 ); // That player is already bonded in a Blood Oath.
				else
					Caster.SendLocalizedMessage( 1061609 ); // That creature is already bonded in a Blood Oath.
			}
			else if ( CheckHSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				/* Temporarily creates a dark pact between the caster and the target.
				 * Any damage dealt by the target to the caster is increased, but the target receives the same amount of damage.
				 * The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 80 ) + 8 seconds.
				 * 
				 * NOTE: The above algorithm must be fixed point, it should be:
				 * ((ss-rm)/8)+8
				 */

				ExpireTimer timer = (ExpireTimer)m_Table[m];
				if ( timer != null )
				timer.DoExpire();

				m_OathTable[Caster] = Caster;
				m_OathTable[m] = Caster;

				Caster.PlaySound( 0x175 );

				Caster.FixedParticles( 0x375A, 1, 17, 9919, 33, 7, EffectLayer.Waist );
				Caster.FixedParticles( 0x3728, 1, 13, 9502, 33, 7, (EffectLayer)255 );

				m.FixedParticles( 0x375A, 1, 17, 9919, 33, 7, EffectLayer.Waist );
				m.FixedParticles( 0x3728, 1, 13, 9502, 33, 7, (EffectLayer)255 );

				TimeSpan duration = TimeSpan.FromSeconds( ((GetDamageSkill( Caster ) - GetResistSkill( m )) / 8) + 8 );
				m.CheckSkill( SkillName.MagicResist, 0.0, 120.0 );	//Skill check for gain

				timer = new ExpireTimer ( Caster, m, duration );
				timer.Start ();

				BuffInfo.AddBuff ( Caster, new BuffInfo ( BuffIcon.BloodOathCaster, 1075659, duration, Caster, m.Name.ToString () ) );
				BuffInfo.AddBuff ( m, new BuffInfo ( BuffIcon.BloodOathCurse, 1075661, duration, m, Caster.Name.ToString () ) );

				m_Table[m] = timer;

			}

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

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

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

				m.Paralyzed = false;

				int toDrain = 0;

				if ( Core.AOS )
				{
					toDrain = (int)(GetDamageSkill( Caster ) - GetResistSkill( m ));

					if ( toDrain < 0 )
						toDrain = 0;
					else if ( toDrain > m.Mana )
						toDrain = m.Mana;
				}
				else
				{
					if ( CheckResisted( m ) )
						m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
					else
						toDrain = m.Mana;
				}

				if ( toDrain > (Caster.ManaMax - Caster.Mana) )
					toDrain = Caster.ManaMax - Caster.Mana;

				m.Mana -= toDrain;
				Caster.Mana += toDrain;

				if ( Core.AOS )
				{
					m.FixedParticles( 0x374A, 1, 15, 5054, 23, 7, EffectLayer.Head );
					m.PlaySound( 0x1F9 );

					Caster.FixedParticles( 0x0000, 10, 5, 2054, EffectLayer.Head );
				}
				else
				{
					m.FixedParticles( 0x374A, 10, 15, 5054, EffectLayer.Head );
					m.PlaySound( 0x1F9 );
				}
			}

			FinishSequence();
		}
示例#8
0
        public void Target(Mobile m)
        {
            if (!this.Caster.CanSee(m))
            {
                this.Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (this.CheckHSequence(m))
            {
                SpellHelper.Turn(this.Caster, m);

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

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

                m.Paralyzed = false;

                if (Core.AOS)
                {
                    int toDrain = 40 + (int)(this.GetDamageSkill(this.Caster) - this.GetResistSkill(m));

                    if (toDrain < 0)
                        toDrain = 0;
                    else if (toDrain > m.Mana)
                        toDrain = m.Mana;

                    if (m_Table.ContainsKey(m))
                        toDrain = 0;

                    m.FixedParticles(0x3789, 10, 25, 5032, EffectLayer.Head);
                    m.PlaySound(0x1F8);

                    if (toDrain > 0)
                    {
                        m.Mana -= toDrain;

                        m_Table[m] = Timer.DelayCall(TimeSpan.FromSeconds(5.0), new TimerStateCallback(AosDelay_Callback), new object[] { m, toDrain });
                    }
                }
                else
                {
                    if (this.CheckResisted(m))
                        m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
                    else if (m.Mana >= 100)
                        m.Mana -= Utility.Random(1, 100);
                    else
                        m.Mana -= Utility.Random(1, m.Mana);

                    m.FixedParticles(0x374A, 10, 15, 5032, EffectLayer.Head);
                    m.PlaySound(0x1F8);
                }

                this.HarmfulSpell(m);
            }

            this.FinishSequence();
        }
示例#9
0
		public void Target( Mobile m )
		{
			if ( CheckHSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				//SpellHelper.CheckReflect( (int)this.Circle, Caster, ref m ); //Irrelevent asfter AoS

				/* Temporarily causes intense physical pain to the target, dealing direct damage.
				 * After 10 seconds the spell wears off, and if the target is still alive, 
				 * some of the Hit Points lost through Pain Spike are restored.
				 */

				m.FixedParticles( 0x37C4, 1, 8, 9916, 39, 3, EffectLayer.Head );
				m.FixedParticles( 0x37C4, 1, 8, 9502, 39, 4, EffectLayer.Head );
				m.PlaySound( 0x210 );

				double damage = ((GetDamageSkill( Caster ) - GetResistSkill( m )) / 10) + (m.Player ? 18 : 30);
				m.CheckSkill( SkillName.MagicResist, 0.0, 120.0 );	//Skill check for gain

				if ( damage < 1 )
					damage = 1;

				TimeSpan buffTime = TimeSpan.FromSeconds( 10.0 );

				if( m_Table.Contains( m ) )
				{
					damage = Utility.RandomMinMax( 3, 7 );
					Timer t = m_Table[m] as Timer;

					if( t != null )
					{
						t.Delay += TimeSpan.FromSeconds( 2.0 );

						buffTime = t.Next - DateTime.UtcNow;
					}
				}
				else
				{
					new InternalTimer( m, damage ).Start();
				}

				BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.PainSpike, 1075667, buffTime, m, Convert.ToString( (int)damage ) ) );

				Misc.WeightOverloading.DFA = Misc.DFAlgorithm.PainSpike;
				m.Damage( (int) damage, Caster );
				SpellHelper.DoLeech( (int)damage, Caster, m );
				Misc.WeightOverloading.DFA = Misc.DFAlgorithm.Standard;

				//SpellHelper.Damage( this, m, damage, 100, 0, 0, 0, 0, Misc.DFAlgorithm.PainSpike );
				HarmfulSpell( m );
			}

			FinishSequence();
		}
示例#10
0
        public override void OnDeath( Mobile m )
        {
             

            if ( m != null && !m.Deleted)
            {

                if (m is PlayerMobile && m_Controller.NoPlayerItemDrop)
                {
                    if (m.Female)
                    {
                        m.FixedParticles(0x374A, 10, 30, 5013, 1153, 2, EffectLayer.Waist);
                        m.Body = 403;
                        m.Hidden = true;
                    }
                    else
                    {
                        m.FixedParticles(0x374A, 10, 30, 5013, 1153, 2, EffectLayer.Waist);
                        m.Body = 402;
                        m.Hidden = true;
                    }
                    m.Hidden = false;
                    
                }
                else if ( !(m is PlayerMobile) && m_Controller.NoNPCItemDrop)
                {
                    if (m.Female)
                    {
                        m.FixedParticles(0x374A, 10, 30, 5013, 1153, 2, EffectLayer.Waist);
                        m.Body = 403;
                        m.Hidden = true;
                    }
                    else
                    {
                        m.FixedParticles(0x374A, 10, 30, 5013, 1153, 2, EffectLayer.Waist);
                        m.Body = 402;
                        m.Hidden = true;
                    }
                    m.Hidden = false;
                    
                }
                else
                   

                // Start a 1 second timer
                // The Timer will check if they need moving, corpse deleting etc.
                m_Timer = new MovePlayerTimer(m, m_Controller);
                m_Timer.Start();

                return;
            }

            return;

        }
示例#11
0
		public void Target( Mobile m )
		{
			if ( !Caster.InRange( m, 2 ) )
			{
				Caster.SendLocalizedMessage( 1060178 ); // You are too far away to perform that action!
			}
			else if ( m is BaseCreature && ((BaseCreature)m).IsAnimatedDead )
			{
				Caster.SendLocalizedMessage( 1061654 ); // You cannot heal that which is not alive.
			}
			else if ( m.IsDeadBondedPet )
			{
				Caster.SendLocalizedMessage( 1060177 ); // You cannot heal a creature that is already dead!
			}
			else if ( m.Hits >= m.HitsMax )
			{
				Caster.SendLocalizedMessage( 500955 ); // That being is not damaged!
			}
			else if ( m.Poisoned || Server.Items.MortalStrike.IsWounded( m ) )
			{
				Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, (Caster == m) ? 1005000 : 1010398 );
			}
			else if ( CheckBSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				/* Heals the target for 7 to 39 points of damage.
				 * The caster's Karma affects the amount of damage healed.
				 */

				int toHeal = ComputePowerValue( 6 ) + Utility.RandomMinMax( 0, 2 );

				// TODO: Should caps be applied?
				if ( toHeal < 7 )
					toHeal = 7;
				else if ( toHeal > 39 )
					toHeal = 39;

				if ( (m.Hits + toHeal) > m.HitsMax )
					toHeal = m.HitsMax - m.Hits;

				//m.Hits += toHeal;	//Was previosuly due to the message
				//m.Heal( toHeal, Caster, false );
				SpellHelper.Heal( toHeal, m, Caster, false );

				m.SendLocalizedMessage( 1060203, toHeal.ToString() ); // You have had ~1_HEALED_AMOUNT~ hit points of damage healed.

				m.PlaySound( 0x202 );
				m.FixedParticles( 0x376A, 1, 62, 9923, 3, 3, EffectLayer.Waist );
				m.FixedParticles( 0x3779, 1, 46, 9502, 5, 3, EffectLayer.Waist );
			}

			FinishSequence();
		}
示例#12
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( 17, 1, 5, m );
				}
				else
				{
					damage = Utility.Random( 1, 15 );

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

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

					damage *= GetDamageScalar( m );
				}

				if ( !m.InRange( Caster, 2 ) )
					damage *= 0.25; // 1/4 damage at > 2 tile range
				else if ( !m.InRange( Caster, 1 ) )
					damage *= 0.50; // 1/2 damage at 2 tile range

				if ( Core.AOS )
				{
					m.FixedParticles( 0x374A, 10, 30, 5013, 1153, 2, EffectLayer.Waist );
					m.PlaySound( 0x0FC );
				}
				else
				{
					m.FixedParticles( 0x374A, 10, 15, 5013, EffectLayer.Waist );
					m.PlaySound( 0x1F1 );
				}

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

			FinishSequence();
		}
示例#13
0
		public void Target( Mobile m )
		{
			BaseCreature bc = m as BaseCreature;

			if( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if( m.IsDeadBondedPet || !m.Alive )
			{
				// As per Osi: Nothing happens.
			}
			else if( m != Caster && (bc == null || !bc.IsBonded || bc.ControlMaster != Caster) )
			{
				Caster.SendLocalizedMessage( 1072077 ); // You may only cast this spell on yourself or a bonded pet.
			}
			else if( m_Table.ContainsKey( m ) )
			{
				Caster.SendLocalizedMessage( 501775 ); // This spell is already in effect.
			}
			else if( CheckBSequence( m ) )
			{
				if( Caster == m )
				{
					Caster.SendLocalizedMessage( 1074774 ); // You weave powerful magic, protecting yourself from death.
				}
				else
				{
					Caster.SendLocalizedMessage( 1074775 ); // You weave powerful magic, protecting your pet from death.
					SpellHelper.Turn( Caster, m );
				}


				m.PlaySound( 0x244 );
				m.FixedParticles( 0x3709, 1, 30, 0x26ED, 5, 2, EffectLayer.Waist );
				m.FixedParticles( 0x376A, 1, 30, 0x251E, 5, 3, EffectLayer.Waist );

				double skill = Caster.Skills[SkillName.Spellweaving].Value;

				TimeSpan duration = TimeSpan.FromMinutes( ((int)(skill / 24))* 2 + FocusLevel );

				ExpireTimer t = new ExpireTimer( m, duration, this );
				t.Start();

				m_Table[m] = t;

				BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.GiftOfLife, 1031615, 1075807, duration, m, null, true ) );
			}

			FinishSequence();
		}
示例#14
0
		public static void Toggle( Mobile caster, Mobile target )
		{
			/* Players under the protection spell effect can no longer have their spells "disrupted" when hit.
			 * Players under the protection spell have decreased physical resistance stat value (-15 + (Inscription/20),
			 * a decreased "resisting spells" skill value by -35 + (Inscription/20),
			 * and a slower casting speed modifier (technically, a negative "faster cast speed") of 2 points.
			 * The protection spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
			 * Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out,
			 * even after dying—until you “turn them off” by casting them again.
			 */

			object[] mods = (object[])m_Table[target];

			if ( mods == null )
			{
				target.PlaySound( 0x1E9 );
				target.FixedParticles( 0x375A, 9, 20, 5016, EffectLayer.Waist );

				mods = new object[2]
					{
						new ResistanceMod( ResistanceType.Physical, -15 + Math.Min( (int)(caster.Skills[SkillName.Inscribe].Value / 20), 15 ) ),
						new DefaultSkillMod( SkillName.MagicResist, true, -35 + Math.Min( (int)(caster.Skills[SkillName.Inscribe].Value / 20), 35 ) )
					};

				m_Table[target] = mods;
				Registry[target] = 100.0;

				target.AddResistanceMod( (ResistanceMod)mods[0] );
				target.AddSkillMod( (SkillMod)mods[1] );

				int physloss = -15 + (int) (caster.Skills[SkillName.Inscribe].Value / 20);
				int resistloss = -35 + (int) (caster.Skills[SkillName.Inscribe].Value / 20);
				string args = String.Format("{0}\t{1}", physloss, resistloss);
				BuffInfo.AddBuff(target, new BuffInfo(BuffIcon.Protection, 1075814, 1075815, args.ToString()));
			}
			else
			{
				target.PlaySound( 0x1ED );
				target.FixedParticles( 0x375A, 9, 20, 5016, EffectLayer.Waist );

				m_Table.Remove( target );
				Registry.Remove( target );

				target.RemoveResistanceMod( (ResistanceMod)mods[0] );
				target.RemoveSkillMod( (SkillMod)mods[1] );

				BuffInfo.RemoveBuff(target, BuffIcon.Protection);
			}
		}
		public override void HideEffects(Mobile from)
		{
			from.Hidden = !from.Hidden;
			if (from.Hidden)
			{
				Effects.SendLocationParticles( (IEntity)from, 0x36CB, 1, 9, 67, 5, 9911, 0 );
				Effects.SendLocationParticles( (IEntity)from, 0x374A, 1, 17, 1108, 4, 9502, 0 );
			}
			else
			{
				from.FixedParticles( 0x36CB, 1, 9, 9911, 67, 5, EffectLayer.Waist );
				from.FixedParticles( 0x374A, 1, 17, 9502, 1108, 4, (EffectLayer)255 );
			}
			from.PlaySound( 0x22F );
		}
 public override void HideEffects(Mobile from)
 {
     from.Hidden = !from.Hidden;
     if (from.Hidden)
     {
         Effects.SendLocationParticles( (IEntity)from, 0x37CC, 1, 40, 3, 9917, 97, 0 );
         Effects.SendLocationParticles( (IEntity)from, 0x374A, 1, 15, 97, 3, 9502, 0 );
     }
     else
     {
         from.FixedParticles( 0x37CC, 1, 40, 97, 3, 9917, EffectLayer.Waist );
         from.FixedParticles( 0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255 );
     }
     from.PlaySound( 0x10B );
 }
示例#17
0
        public static void FinalEffect( Mobile caster, Mobile target, int hold )
        {
            target.PlaySound( 0x204 );
            target.FixedParticles( 0x37C4, 1, 8, 9916, 39, 3, EffectLayer.Head );
            target.FixedParticles( 0x37C4, 1, 8, 9502, 39, 4, EffectLayer.Head );

            if( caster != null )
                target.Emote( "*was paralyzed by " + caster.Name + "*" );

            if (((IKhaerosMobile)target).StunnedTimer != null)
                ((IKhaerosMobile)target).StunnedTimer.Stop();

            ((IKhaerosMobile)target).StunnedTimer = new HoldPersonTimer(target, hold);
            ((IKhaerosMobile)target).StunnedTimer.Start();
        }
 public override void HideEffects(Mobile from)
 {
     from.Hidden = !from.Hidden;
     if (from.Hidden)
     {
         Effects.SendLocationParticles( (IEntity)from, 0x375A, 1, 17, 33, 7, 9919, 0 );
         Effects.SendLocationParticles( (IEntity)from, 0x3728, 1, 13, 33, 7, 9502, 0 );
     }
     else
     {
         from.FixedParticles( 0x375A, 1, 17, 9919, 33, 7, EffectLayer.Waist );
         from.FixedParticles( 0x3728, 1, 13, 9502, 33, 7, (EffectLayer)255 );
     }
     from.PlaySound( 0x175 );
 }
示例#19
0
文件: Bless.cs 项目: Crome696/ServUO
        public void Target(Mobile m)
        {
            if (!this.Caster.CanSee(m))
            {
                this.Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (this.CheckBSequence(m))
            {
                SpellHelper.Turn(this.Caster, m);

                SpellHelper.AddStatBonus(this.Caster, m, StatType.Str);
                SpellHelper.DisableSkillCheck = true;
				SpellHelper.AddStatBonus(this.Caster, m, StatType.Dex);
				SpellHelper.AddStatBonus(this.Caster, m, StatType.Int);
                SpellHelper.DisableSkillCheck = false;

				int percentage = (int)(SpellHelper.GetOffsetScalar(this.Caster, m, false) * 100);
				TimeSpan length = SpellHelper.GetDuration(this.Caster, m);
				string args = String.Format("{0}\t{1}\t{2}", percentage, percentage, percentage);
				BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Bless, 1075847, 1075848, length, m, args.ToString()));

				m.FixedParticles(0x373A, 10, 15, 5018, EffectLayer.Waist);
                m.PlaySound(0x1EA);
            }

            this.FinishSequence();
        }
示例#20
0
		public override void OnHit( Mobile attacker, Mobile defender, int damage )
		{
			if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
				return;

			ClearCurrentAbility( attacker );

			// Necromancers under Lich or Wraith Form are immune to Bleed Attacks.
			TransformContext context = TransformationSpell.GetContext( defender );

			if ( (context != null && ( context.Type == typeof( LichFormSpell ) || context.Type == typeof( WraithFormSpell ))) ||
				(defender is BaseCreature && ((BaseCreature)defender).BleedImmune) )
			{
				attacker.SendLocalizedMessage( 1062052 ); // Your target is not affected by the bleed attack!
				return;
			}

			attacker.SendLocalizedMessage( 1060159 ); // Your target is bleeding!
			defender.SendLocalizedMessage( 1060160 ); // You are bleeding!

			if ( defender is PlayerMobile )
			{
				defender.LocalOverheadMessage( MessageType.Regular, 0x21, 1060757 ); // You are bleeding profusely
				defender.NonlocalOverheadMessage( MessageType.Regular, 0x21, 1060758, defender.Name ); // ~1_NAME~ is bleeding profusely
			}

			defender.PlaySound( 0x133 );
			defender.FixedParticles( 0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist );

			BeginBleed( defender, attacker );
		}
示例#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 ( CheckBSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

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

                SpellHelper.AddStatBonus( Caster, m, StatType.Str );

                m.FixedParticles( 0x375A, 10, 15, 5017, EffectLayer.Waist );
                m.PlaySound( 0x1EE );

                //int percentage = (int)(SpellHelper.GetOffsetScalar( Caster, m, false )*100);
                //TimeSpan length = SpellHelper.GetDuration( Caster, m );
                int percentage = (int)((Caster.Skills[SkillName.Magery].Value / 10) + 1);
                TimeSpan length = TimeSpan.FromSeconds((6 * Caster.Skills[SkillName.Magery].Value / 5) + 1);

                BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.Strength, 1075845, length, m, percentage.ToString() ) );
            }

            FinishSequence();
        }
示例#22
0
        }// A tasty bite of the enchanted apple lifts all curses from your soul.
        public override bool Eat(Mobile from)
        {
            if (base.Eat(from))
            {
                from.PlaySound(0xF6);
                from.PlaySound(0x1F7);
                from.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                IEntity mfrom = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z - 10), from.Map);
                IEntity mto = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z + 50), from.Map);
                Effects.SendMovingParticles(mfrom, mto, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

                from.RemoveStatMod("[Magic] Str Curse");
				from.RemoveStatMod("[Magic] Dex Curse");
				from.RemoveStatMod("[Magic] Int Curse");

                from.Paralyzed = false;
                from.Asleep = false;

                EvilOmenSpell.TryEndEffect(from);
                StrangleSpell.RemoveCurse(from);
                CorpseSkinSpell.RemoveCurse(from);
                CurseSpell.RemoveEffect(from);

                BuffInfo.RemoveBuff(from, BuffIcon.Clumsy);
                BuffInfo.RemoveBuff(from, BuffIcon.FeebleMind);
                BuffInfo.RemoveBuff(from, BuffIcon.Weaken);
                BuffInfo.RemoveBuff(from, BuffIcon.MassCurse);	
				
                return true;
            }
			
            return false;
        }
示例#23
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 );

                m.FixedParticles( 0x374A, 10, 30, 5013, 0x238, 2, EffectLayer.Waist );

                int amount = (int)( Caster.Skills[SkillName.Musicianship].Base * 0.17 );
                TimeSpan duration = TimeSpan.FromSeconds( Caster.Skills[SkillName.Musicianship].Base * 0.15 );

                m.SendMessage( "Your poison resistance has decreased." );
                ResistanceMod mod1 = new ResistanceMod( ResistanceType.Cold, - amount );

                m.AddResistanceMod( mod1 );

                ExpireTimer timer1 = new ExpireTimer( m, mod1, duration );
                timer1.Start();
            }

            FinishSequence();
        }
示例#24
0
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( CheckHSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

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

                m.Paralyzed = false;

                if ( CheckResistedEasy( m ) )
                {
                    m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
                }
                else
                {
                    if ( m.Spell is Spells.Spell )
                        ((Spells.Spell)m.Spell).OnCasterHurt( m.Mana );
                    m.Mana = 0;
                }

                m.FixedParticles( 0x374A, 10, 15, 5032, EffectLayer.Head );
                m.PlaySound( 0x1F8 );
            }

            FinishSequence();
        }
示例#25
0
文件: Disarm.cs 项目: Crome696/ServUO
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!this.Validate(attacker))
                return;

            ClearCurrentAbility(attacker);

            Item toDisarm = defender.FindItemOnLayer(Layer.OneHanded);

            if (toDisarm == null || !toDisarm.Movable)
                toDisarm = defender.FindItemOnLayer(Layer.TwoHanded);

            Container pack = defender.Backpack;

            if (pack == null || (toDisarm != null && !toDisarm.Movable))
            {
                attacker.SendLocalizedMessage(1004001); // You cannot disarm your opponent.
            }
            else if (toDisarm == null || toDisarm is BaseShield || toDisarm is Spellbook && !Core.ML)
            {
                attacker.SendLocalizedMessage(1060849); // Your target is already unarmed!
            }
            else if (this.CheckMana(attacker, true))
            {
                attacker.SendLocalizedMessage(1060092); // You disarm their weapon!
                defender.SendLocalizedMessage(1060093); // Your weapon has been disarmed!

                defender.PlaySound(0x3B9);
                defender.FixedParticles(0x37BE, 232, 25, 9948, EffectLayer.LeftHand);

                pack.DropItem(toDisarm);

                BaseWeapon.BlockEquip(defender, BlockEquipDuration);
            }
        }
示例#26
0
        public override bool OnBeforeDamage(Mobile attacker, Mobile defender)
        {
            if (!this.Validate(attacker) || !this.CheckMana(attacker, true))
                return false;

            ClearCurrentAbility(attacker);

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

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

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

            int damage = 10; 

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

            defender.Damage(damage, attacker);

            return true;
        }
示例#27
0
		public override bool OnBeforeDamage( Mobile attacker, Mobile defender )
		{
			if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
				return false;

			ClearCurrentAbility( attacker );

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

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

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

			int damage = 10; // Base damage is 10.

			if ( defender.HitsMax > 0 ) 
			{
				double hitsPercent = ( (double)defender.Hits / (double)defender.HitsMax ) * 100.0;

				double manaPercent = 0;

				if ( defender.ManaMax > 0 )
					manaPercent = ( (double)defender.Mana / (double)defender.ManaMax ) * 100.0;

				damage += Math.Min( (int)(Math.Abs( hitsPercent - manaPercent ) / 4), 20 );
			}

			// Total damage is 10 + (0~20) = 10~30, physical, non-resistable.

			defender.Damage( damage, attacker );

			return true;
		}
示例#28
0
文件: Clumsy.cs 项目: Godkong/RunUO
        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 );

                SpellHelper.AddStatCurse( Caster, m, StatType.Dex );

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

                m.Paralyzed = false;

                m.FixedParticles( 0x3779, 10, 15, 5002, EffectLayer.Head );
                m.PlaySound( 0x1DF );

                int percentage = (int)((Caster.Skills[SkillName.Magery].Value / 10) + 1);
                TimeSpan length = TimeSpan.FromSeconds((6 * Caster.Skills[SkillName.Magery].Value / 5) + 1);

                BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.Clumsy, 1075831, length, m, percentage.ToString() ) );
            }

            FinishSequence();
        }
示例#29
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!this.Validate(attacker) || !this.CheckMana(attacker, true))
                return;

            ClearCurrentAbility(attacker);

            attacker.SendLocalizedMessage(1063353); // You perform a masterful defense!

            attacker.FixedParticles(0x375A, 1, 17, 0x7F2, 0x3E8, 0x3, EffectLayer.Waist);

            int modifier = (int)(30.0 * ((Math.Max(attacker.Skills[SkillName.Bushido].Value, attacker.Skills[SkillName.Ninjitsu].Value) - 50.0) / 70.0));

            DefenseMasteryInfo info = m_Table[attacker] as DefenseMasteryInfo;

            if (info != null)
                EndDefense((object)info);

            ResistanceMod mod = new ResistanceMod(ResistanceType.Physical, 50 + modifier);
            attacker.AddResistanceMod(mod);

            info = new DefenseMasteryInfo(attacker, 80 - modifier, mod);
            info.m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(3.0), new TimerStateCallback(EndDefense), info);

            m_Table[attacker] = info;

            attacker.Delta(MobileDelta.WeaponDamage);
        }
      public void Target( Mobile m )
      {
         if ( CheckHSequence( m ) )
         {
            SpellHelper.Turn( Caster, m );
            
            SpellHelper.CheckReflect( (int)this.Circle, Caster, ref m );
            //SpellHelper.CheckReflect( (int)this.Circle, Caster, ref m );

            CheckResisted( m ); // Check magic resist for skill, but do not use return value

            m.FixedParticles( 0x91B, 1, 240, 9916, 0, 3, EffectLayer.Head );
            m.PlaySound( 0x1E5 );

            double damage = ((Caster.Skills[CastSkill].Value - m.Skills[SkillName.AnimalLore].Value) / 10) + 30;

            if ( damage < 1 )
               damage = 1;

            if ( m_Table.Contains( m ) )
               damage /= 10;
            else
               new InternalTimer( m, damage * 0.5 ).Start();

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

         FinishSequence();
      }
示例#31
0
        protected override void OnTarget(object o)
        {
            BaseWeapon weapon = GetWeapon();

            if (weapon is BaseRanged ranged && !(ranged is BaseThrown) && o is IPoint3D p && SpellHelper.CheckTown(p, Caster) && CheckSequence())
            {
                List <Mobile> targets = new List <Mobile>();

                foreach (IDamageable target in AcquireIndirectTargets(p, 5))
                {
                    if (target is Mobile mobile)
                    {
                        targets.Add(mobile);
                    }
                }

                int count = targets.Count;

                for (var index = 0; index < targets.Count; index++)
                {
                    Mobile mob = targets[index];

                    Caster.MovingEffect(mob, ranged.EffectID, 18, 1, false, false);

                    if (ranged.CheckHit(Caster, mob))
                    {
                        double damage = GetNewAosDamage(40, 1, 5, mob);

                        if (count > 2)
                        {
                            damage = damage / count;
                        }

                        damage *= GetDamageScalar(mob);
                        Caster.DoHarmful(mob);

                        SpellHelper.Damage(this, mob, damage, 0, 100, 0, 0, 0);

                        Server.Timer.DelayCall(TimeSpan.FromMilliseconds(800), obj =>
                        {
                            Mobile mobile = obj;

                            mobile?.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                        }, mob);

                        mob.PlaySound(0x1DD);
                    }
                }

                ColUtility.Free(targets);

                ranged.PlaySwingAnimation(Caster);
                Caster.PlaySound(0x101);
            }
        }
示例#32
0
        protected override void OnTarget(object o)
        {
            BaseWeapon weapon = GetWeapon();

            if (weapon is BaseRanged ranged && !(ranged is BaseThrown))
            {
                IPoint3D p = o as IPoint3D;

                if (p != null && SpellHelper.CheckTown(p, Caster) && CheckSequence())
                {
                    System.Collections.Generic.List <Mobile> targets = AcquireIndirectTargets(p, 5).OfType <Mobile>().ToList();
                    int count = targets.Count;

                    foreach (Mobile mob in targets)
                    {
                        Caster.MovingEffect(mob, ranged.EffectID, 18, 1, false, false);

                        if (ranged.CheckHit(Caster, mob))
                        {
                            double damage = GetNewAosDamage(40, 1, 5, mob);

                            if (count > 2)
                            {
                                damage = damage / count;
                            }

                            damage *= GetDamageScalar(mob);
                            Caster.DoHarmful(mob);
                            SpellHelper.Damage(this, mob, damage, 0, 100, 0, 0, 0);

                            Server.Timer.DelayCall(TimeSpan.FromMilliseconds(800), obj =>
                            {
                                Mobile mobile = obj;

                                mobile?.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                            }, mob);

                            mob.PlaySound(0x1DD);
                        }
                    }

                    ColUtility.Free(targets);

                    ranged.PlaySwingAnimation(Caster);
                    Caster.PlaySound(0x101);
                }
            }
        }
示例#33
0
        public void Target(Mobile m)
        {
            if (m == null)
            {
                return;
            }

            if (!m.Poisoned)
            {
                Caster.SendLocalizedMessage(1060176); // That creature is not poisoned!
            }
            else if (CheckBSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                /* Cures the target of poisons, but causes the caster to be burned by fire damage for 13-55 hit points.
                 * The amount of fire damage is lessened if the caster has high Karma.
                 */

                Poison p = m.Poison;

                if (p != null)
                {
                    // Cleanse by fire is now difficulty based
                    int chanceToCure = 10000 + (int)(Caster.Skills.Chivalry.Value * 75) - (p.Level + 1) * 2000;
                    chanceToCure /= 100;

                    if (chanceToCure > Utility.Random(100))
                    {
                        if (m.CurePoison(Caster))
                        {
                            if (Caster != m)
                            {
                                Caster.SendLocalizedMessage(1010058); // You have cured the target of all poisons!
                            }
                            m.SendLocalizedMessage(1010059);          // You have been cured of all poisons.
                        }
                    }
                    else
                    {
                        m.SendLocalizedMessage(1010060); // You have failed to cure your target!
                    }
                }

                m.PlaySound(0x1E0);
                m.FixedParticles(0x373A, 1, 15, 5012, 3, 2, EffectLayer.Waist);

                IEntity from = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z - 5), m.Map);
                IEntity to   = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + 45), m.Map);
                Effects.SendMovingParticles(from, to, 0x374B, 1, 0, false, false, 63, 2, 9501, 1, 0, EffectLayer.Head,
                                            0x100);

                Caster.PlaySound(0x208);
                Caster.FixedParticles(0x3709, 1, 30, 9934, 0, 7, EffectLayer.Waist);

                int damage = 50 - ComputePowerValue(4);

                // TODO: Should caps be applied?
                if (damage < 13)
                {
                    damage = 13;
                }
                else if (damage > 55)
                {
                    damage = 55;
                }

                AOS.Damage(Caster, Caster, damage, 0, 100, 0, 0, 0, true);
            }

            FinishSequence();
        }
示例#34
0
 public override void DoEffect(Mobile m)
 {
     m.PlaySound(0x19C);
     m.FixedParticles(0x3709, 1, 30, 9904, 1108, 6, EffectLayer.RightFoot);
 }
示例#35
0
        public override void OnHit(Mobile defender, ref int damage)
        {
            BaseWeapon weapon = GetWeapon();

            if (!CheckWeapon())
            {
                return;
            }

            Poison p = weapon.Poison;

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

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

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

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

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

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

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

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

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

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

            int malus = 30;

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

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

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

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

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

            Expire();
        }
示例#36
0
        public override void OnCast()
        {
            if (this.CheckSequence())
            {
                /* Creates a withering frost around the Caster,
                 * which deals Cold Damage to all valid targets in a radius of 5 tiles.
                 */
                Map map = this.Caster.Map;

                if (map != null)
                {
                    List <IDamageable> targets = new List <IDamageable>();

                    BaseCreature cbc       = this.Caster as BaseCreature;
                    bool         isMonster = (cbc != null && !cbc.Controlled && !cbc.Summoned);

                    IPooledEnumerable eable = this.Caster.GetObjectsInRange(Core.ML ? 4 : 5);

                    foreach (object o in eable)
                    {
                        IDamageable id = o as IDamageable;

                        if (id == null || id is Mobile && (Mobile)id == this.Caster)
                        {
                            continue;
                        }

                        if (this.Caster.InLOS(id) && (!(id is Mobile) || isMonster || SpellHelper.ValidIndirectTarget(this.Caster, (Mobile)id)) && this.Caster.CanBeHarmful(id, false))
                        {
                            if (isMonster)
                            {
                                if (id is BaseCreature)
                                {
                                    BaseCreature bc = (BaseCreature)id;

                                    if (!bc.Controlled && !bc.Summoned && bc.Team == cbc.Team)
                                    {
                                        continue;
                                    }
                                }
                                else if (!(id is PlayerMobile))
                                {
                                    continue;
                                }
                            }

                            targets.Add(id);
                        }
                    }

                    eable.Free();

                    Effects.PlaySound(this.Caster.Location, map, 0x1FB);
                    Effects.PlaySound(this.Caster.Location, map, 0x10B);
                    Effects.SendLocationParticles(EffectItem.Create(this.Caster.Location, map, EffectItem.DefaultDuration), 0x37CC, 1, 40, 97, 3, 9917, 0);

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

                        this.Caster.DoHarmful(id);

                        if (m != null)
                        {
                            m.FixedParticles(0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255);
                        }
                        else
                        {
                            Effects.SendLocationParticles(id, 0x374A, 1, 30, 97, 3, 9502, 0);
                        }

                        double damage = Utility.RandomMinMax(30, 35);
                        int    karma  = m != null ? m.Karma / 100 : 0;

                        damage *= 300 + karma + (this.GetDamageSkill(this.Caster) * 10);
                        damage /= 1000;

                        int sdiBonus = AosAttributes.GetValue(this.Caster, AosAttribute.SpellDamage);

                        // PvP spell damage increase cap of 15% from an item’s magic property in Publish 33(SE)
                        if (Core.SE && id is PlayerMobile && this.Caster.Player && sdiBonus > 15)
                        {
                            sdiBonus = 15;
                        }

                        damage *= (100 + sdiBonus);
                        damage /= 100;

                        // TODO: cap?
                        //if ( damage > 40 )
                        //	damage = 40;

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

            this.FinishSequence();
        }
示例#37
0
        public static void MakeEffect(NubiaPlayer caster, Mobile cible, SortNubia SortNubia, bool move, bool explose)
        {
            //COULEUR
            int color  = 0;
            int render = (int)SortNubia.render;

            switch (SortNubia.couleur)
            {
            case MagieColor.Chakra: color = caster.ChakraColor; break;
                // case MagieColor.Connaissance: color = KonohaCompHelper.getCompColor(SortNubia.competence); Console.WriteLine("Connaissance dans MakeEffect:" + SortNubia.competence.ToString()); break;
            }

            int effet        = 0x36D4;
            int exploseEffet = 4019;
            int sound        = 0x15E;


            switch (Utility.RandomMinMax(0, 2))
            {
            case 0: exploseEffet = 0x36B0; break;

            case 1: exploseEffet = 0x36BD; break;

            case 2: exploseEffet = 0x36CA; break;
            }

            switch (SortNubia.effect)
            {
            case SortNubiaEffect.Bee: effet = 0x923; break;

            case SortNubiaEffect.BladeSpirit: effet = 0x37EB; break;

            case SortNubiaEffect.BlueSparkle: effet = 0x373A; break;

            case SortNubiaEffect.BlueGoldSparkle1: effet = 0x375A; break;

            case SortNubiaEffect.BlueGoldSparkle2: effet = 0x376A; break;

            case SortNubiaEffect.BluePurpleSparkle: effet = 0x3779; break;

            case SortNubiaEffect.RedSparkle: effet = 0x374A; break;

            case SortNubiaEffect.Energy: effet = 0x3819; break;

            case SortNubiaEffect.Vortex: effet = 0x3789; break;

            case SortNubiaEffect.ExplosionBall: effet = 0x36FE; break;

            case SortNubiaEffect.FireSnake: effet = 0x36F4; break;

            case SortNubiaEffect.Glow1: effet = 0x37B9; break;

            case SortNubiaEffect.Glow2: effet = 0x37BE; break;

            case SortNubiaEffect.Glow3: effet = 0x37C4; break;

            case SortNubiaEffect.Visage: effet = 0x1ED9; break;

            case SortNubiaEffect.SmallFireBall: effet = 0x36E4; break;

            case SortNubiaEffect.Smoke: effet = 0x3728; break;

            case SortNubiaEffect.DoubleHead: effet = 0x1F1F; break;

            case SortNubiaEffect.Rock: effet = Utility.RandomMinMax(0x1363, 0x123D); break;

            case SortNubiaEffect.Crane: effet = 0x1456; break;

            case SortNubiaEffect.Trait: effet = 0x1BFE; break;
            }

            if (move)
            {
                caster.MovingParticles(cible, effet, 7, 0, false, explose, color - 1, render, 9502, exploseEffet, 0x160, 0);
            }
            else             //( int itemID, int speed, int duration, int effect, int hue, int renderMode, EffectLayer layer )
            {
                cible.FixedParticles(effet, 9, 32, 5030, color - 1, render, EffectLayer.Waist);
            }
            cible.PlaySound(sound);
        }
示例#38
0
        public void ChangeOpponent()
        {
            Mobile agro, best = null;
            double distance, random = Utility.RandomDouble();

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

                    if (agro == null)
                    {
                        continue;
                    }

                    distance = StrikingRange - GetDistanceToSqrt(agro);

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

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

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

                    if (agro == null)
                    {
                        continue;
                    }

                    distance = GetDistanceToSqrt(agro);

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

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

                Timer.DelayCall(TimeSpan.FromSeconds(1), () =>
                {
                    best.ApplyPoison(this, HitPoison);
                    best.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
                    best.PlaySound(0x474);
                });

                m_Change = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(5, 10));
            }
        }
示例#39
0
        public void Target(Mobile m)
        {
            if (m == null)
            {
                Caster.SendLocalizedMessage(1060508); // You can't curse that.
            }
            // only PlayerMobile and BaseCreature implement blood oath checking
            else if (Caster == m || !(m is PlayerMobile || m is BaseCreature))
            {
                Caster.SendLocalizedMessage(1060508); // You can't curse that.
            }
            else if (m_OathTable.ContainsKey(Caster))
            {
                Caster.SendLocalizedMessage(1061607); // You are already bonded in a Blood Oath.
            }
            else if (m_OathTable.ContainsKey(m))
            {
                if (m.Player)
                {
                    Caster.SendLocalizedMessage(1061608); // That player is already bonded in a Blood Oath.
                }
                else
                {
                    Caster.SendLocalizedMessage(1061609); // That creature is already bonded in a Blood Oath.
                }
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                /* Temporarily creates a dark pact between the caster and the target.
                 * Any damage dealt by the target to the caster is increased, but the target receives the same amount of damage.
                 * The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 80 ) + 8 seconds.
                 *
                 * NOTE: The above algorithm must be fixed point, it should be:
                 * ((ss-rm)/8)+8
                 */

                m_Table.TryGetValue(m, out ExpireTimer timer);
                timer?.DoExpire();

                m_OathTable[Caster] = Caster;
                m_OathTable[m]      = Caster;

                m.Spell?.OnCasterHurt();

                Caster.PlaySound(0x175);

                Caster.FixedParticles(0x375A, 1, 17, 9919, 33, 7, EffectLayer.Waist);
                Caster.FixedParticles(0x3728, 1, 13, 9502, 33, 7, (EffectLayer)255);

                m.FixedParticles(0x375A, 1, 17, 9919, 33, 7, EffectLayer.Waist);
                m.FixedParticles(0x3728, 1, 13, 9502, 33, 7, (EffectLayer)255);

                TimeSpan duration = TimeSpan.FromSeconds((GetDamageSkill(Caster) - GetResistSkill(m)) / 8 + 8);
                m.CheckSkill(SkillName.MagicResist, 0.0, 120.0); // Skill check for gain

                timer = new ExpireTimer(Caster, m, duration);
                timer.Start();

                BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.BloodOathCaster, 1075659, duration, Caster, m.Name));
                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.BloodOathCurse, 1075661, duration, m, Caster.Name));

                m_Table[m] = timer;
                HarmfulSpell(m);
            }

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

            ClearCurrentAbility(attacker);


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

            int level;

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

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

                double dist = attacker.GetDistanceToSqrt(defender);

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

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

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

            defender.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
            defender.PlaySound(0x474);
        }
示例#41
0
        public override void OnCast()
        {
            if (Core.AOS)
            {
                /* The magic reflection spell decreases the caster's physical resistance, while increasing the caster's elemental resistances.
                 * Physical decrease = 25 - (Inscription/20).
                 * Elemental resistance = +10 (-20 physical, +10 elemental at GM Inscription)
                 * The magic reflection spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
                 * Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out, even after dying—until you “turn them off” by casting them again.
                 */

                if (CheckSequence())
                {
                    Mobile targ = Caster;

                    ResistanceMod[] mods = (ResistanceMod[])m_Table[targ];

                    if (mods == null)
                    {
                        targ.PlaySound(0x1E9);
                        targ.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist);

                        int physiMod = -25 + (int)(targ.Skills[SkillName.Inscribe].Value / 20);
                        int otherMod = 10;

                        mods = new ResistanceMod[5]
                        {
                            new ResistanceMod(ResistanceType.Physical, physiMod),
                            new ResistanceMod(ResistanceType.Fire, otherMod),
                            new ResistanceMod(ResistanceType.Cold, otherMod),
                            new ResistanceMod(ResistanceType.Poison, otherMod),
                            new ResistanceMod(ResistanceType.Energy, otherMod)
                        };

                        m_Table[targ] = mods;

                        for (int i = 0; i < mods.Length; ++i)
                        {
                            targ.AddResistanceMod(mods[i]);
                        }

                        string buffFormat = String.Format("{0}\t+{1}\t+{1}\t+{1}\t+{1}", physiMod, otherMod);

                        BuffInfo.AddBuff(targ, new BuffInfo(BuffIcon.MagicReflection, 1075817, buffFormat, true));
                    }
                    else
                    {
                        targ.PlaySound(0x1ED);
                        targ.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist);

                        m_Table.Remove(targ);

                        for (int i = 0; i < mods.Length; ++i)
                        {
                            targ.RemoveResistanceMod(mods[i]);
                        }

                        BuffInfo.RemoveBuff(targ, BuffIcon.MagicReflection);
                    }
                }

                FinishSequence();
            }
            else
            {
                if (Caster.MagicDamageAbsorb > 0)
                {
                    Caster.SendLocalizedMessage(1005559);                       // This spell is already in effect.
                }
                else if (!Caster.CanBeginAction(typeof(DefensiveSpell)))
                {
                    Caster.SendLocalizedMessage(1005385);                       // The spell will not adhere to you at this time.
                }
                else if (CheckSequence())
                {
                    if (Caster.BeginAction(typeof(DefensiveSpell)))
                    {
                        int value = (int)(Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.Inscribe].Value);
                        value = (int)(8 + (value / 200) * 7.0);                    //absorb from 8 to 15 "circles"

                        Caster.MagicDamageAbsorb = value;

                        Caster.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist);
                        Caster.PlaySound(0x1E9);
                    }
                    else
                    {
                        Caster.SendLocalizedMessage(1005385);                           // The spell will not adhere to you at this time.
                    }
                }

                FinishSequence();
            }
        }
示例#42
0
                protected override void OnTick()
                {
                    bool orcs   = IsOrc(m_Target);
                    bool savage = IsSavage(m_Target);

                    var badKarmaChance  = 0.5 - ((double)m_From.Karma / 8570);         //Lower your Karma Less chance you get
                    var goodKarmaChance = 0.5 + ((double)m_From.Karma / 8570);         //Higher Karma less chance for Monsters

                    m_From.NextSkillTime = Core.TickCount + 10000;                     //Set next skill use 10 seconds
                    if (!orcs && !savage && m_From.Karma < 0 && badKarmaChance > Utility.RandomDouble())
                    {
                        if (!orcs && m_From.CheckTargetSkill(SkillName.Begging, m_Target, 0, 100))
                        {
                            m_Target.PublicOverheadMessage(MessageType.Regular, m_Target.SpeechHue, 500406);
                        }
                        else
                        {
                            m_Target.PublicOverheadMessage(MessageType.Regular, m_Target.SpeechHue, 500406);
                        }
                        // Thou dost not look trustworthy... no gold for thee today!
                    }
                    else if (orcs)
                    {
                        if (m_From.Karma > 0 && goodKarmaChance > Utility.RandomDouble())
                        {
                            m_From.SendMessage("You seem to notable to beg");
                        }
                        else
                        {
                            //Console.WriteLine("Orc Begged");
                            if (m_From.CheckTargetSkill(SkillName.Begging, m_Target, 80, 100)) //Need 80+ Skill to Attempt to Beg Orc
                            {
                                int begchance = Utility.Random(100);                           //Lets see if you have bad accident
                                if (begchance <= 10)                                           //10% chance to blow up mask
                                {
                                    Item item = m_From.FindItemOnLayer(Layer.Helm);

                                    if (item is OrcishKinMask)
                                    {
                                        m_From.SendMessage("{0} alerts the other orcs that you are a fake", m_Target);                                         //Orcs dont beg
                                        AOS.Damage(m_From, 50, 0, 100, 0, 0, 0);
                                        item.Delete();
                                        m_From.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                        m_From.PlaySound(0x307);
                                    }
                                }
                                else if (begchance <= 30)                                 //30% to just attack player
                                {
                                    m_Target.Attack(m_From);
                                    m_From.SendMessage("{0} seems upset", m_Target);                                     //Well they dont like beggers
                                }
                                else
                                {
                                    BegChance(m_From, m_Target, true, false);                                     //What is your chance to beg?
                                }
                            }
                            else
                            {
                                m_From.SendMessage("They don't seem to have noticed you");
                            }
                        }
                    }
                    else if (savage)
                    {
                        //Console.WriteLine("Savage Beg");
                        if (m_From.CheckTargetSkill(SkillName.Begging, m_Target, 80, 100))                         //Need 80+ Skill to Attempt to beg from Savages
                        {
                            int begchance = Utility.Random(100);
                            if (begchance <= 10)                             //10% chance to blow up paint, Pride Tribesman/Women!
                            {
                                if (m_From.BodyMod == 183 || m_From.BodyMod == 184)
                                {
                                    AOS.Damage(m_From, 50, 0, 100, 0, 0, 0);
                                    m_From.BodyMod = 0;
                                    m_From.HueMod  = -1;
                                    m_From.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                    m_From.PlaySound(0x307);
                                    m_From.SendLocalizedMessage(1040008);                                     // Your skin is scorched as the tribal paint burns away!
                                    ((PlayerMobile)m_From).SavagePaintExpiration = TimeSpan.Zero;
                                }
                            }
                            else if (begchance <= 30)                             //30% to just attack player
                            {
                                m_Target.Attack(m_From);
                                m_From.SendMessage("{0} seems upset", m_Target);
                            }
                            else
                            {
                                BegChance(m_From, m_Target, false, true);                                 //Whats your Beg Chance?
                            }
                        }
                    }
                    else if (m_From.CheckTargetSkill(SkillName.Begging, m_Target, 0, 100))
                    {
                        //Console.WriteLine("Human Beg");
                        BegChance(m_From, m_Target, false, false);                         //Not a Savage or Orc? Human than!
                    }
                    else
                    {
                        //Console.WriteLine("Fail Beg");
                        m_Target.SendLocalizedMessage(500404);                         // They seem unwilling to give you any money.
                    }
                }
示例#43
0
        public void Target(IPoint3D p)
        {
            IPoint3D orig = p;
            Map      map  = Caster.Map;

            SpellHelper.GetSurfaceTop(ref p);

            Point3D from = Caster.Location;
            Point3D to   = new Point3D(p);

            if (Factions.Sigil.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1061632);                   // You can't do that while carrying the sigil.
            }
            else if (Server.Misc.WeightOverloading.IsOverloaded(Caster))
            {
                Caster.SendLocalizedMessage(502359, "", 0x22);                   // Thou art too encumbered to move.
            }
            else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.TeleportFrom))
            {
            }
            else if (!SpellHelper.CheckTravel(Caster, map, to, TravelCheckType.TeleportTo))
            {
            }
            else if (map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if (SpellHelper.CheckMulti(to, map))
            {
                Caster.SendLocalizedMessage(502831);                   // Cannot teleport to that spot.
            }
            else if (Region.Find(to, map).GetRegion(typeof(HouseRegion)) != null)
            {
                Caster.SendLocalizedMessage(502829);                   // Cannot teleport to that spot.
            }
            else if (CheckSequence())
            {
                SpellHelper.Turn(Caster, orig);

                Mobile m = Caster;

                m.Location = to;
                m.ProcessDelta();

                if (m.Player)
                {
                    Effects.SendLocationParticles(EffectItem.Create(from, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                    Effects.SendLocationParticles(EffectItem.Create(to, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);
                }
                else
                {
                    m.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                }

                m.PlaySound(0x1FE);

                IPooledEnumerable eable = m.GetItemsInRange(0);

                foreach (Item item in eable)
                {
                    if (item is Server.Spells.Sixth.ParalyzeFieldSpell.InternalItem || item is Server.Spells.Fifth.PoisonFieldSpell.InternalItem || item is Server.Spells.Fourth.FireFieldSpell.FireFieldItem)
                    {
                        item.OnMoveOver(m);
                    }
                }

                eable.Free();
            }

            FinishSequence();
        }
示例#44
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

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

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

                m.Paralyzed = false;

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

                    double total = Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.Poisoning].Value;
                    double dist  = Caster.GetDistanceToSqrt(m);

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

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


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

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

            FinishSequence();
        }
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile m = state.Mobile;

            switch (info.ButtonID)
            {
            case 0:
            {
                Item a = m.Backpack.FindItemByType(typeof(GMBuffStatue));
                if (a != null)
                {
                    a.Delete();
                }

                m.Str = 100;
                m.Dex = 100;
                m.Int = 100;

                m.Hits = 500;
                m.Stam = 500;
                m.Mana = 500;

                m.Skills.Alchemy.Base       = 500;
                m.Skills.Anatomy.Base       = 500;
                m.Skills.AnimalLore.Base    = 500;
                m.Skills.AnimalTaming.Base  = 500;
                m.Skills.Archery.Base       = 500;
                m.Skills.ArmsLore.Base      = 500;
                m.Skills.Begging.Base       = 500;
                m.Skills.Blacksmith.Base    = 500;
                m.Skills.Camping.Base       = 500;
                m.Skills.Carpentry.Base     = 500;
                m.Skills.Cartography.Base   = 500;
                m.Skills.Cooking.Base       = 500;
                m.Skills.DetectHidden.Base  = 500;
                m.Skills.Discordance.Base   = 500;
                m.Skills.EvalInt.Base       = 500;
                m.Skills.Fishing.Base       = 500;
                m.Skills.Fencing.Base       = 500;
                m.Skills.Fletching.Base     = 500;
                m.Skills.Focus.Base         = 500;
                m.Skills.Forensics.Base     = 500;
                m.Skills.Healing.Base       = 500;
                m.Skills.Herding.Base       = 500;
                m.Skills.Hiding.Base        = 500;
                m.Skills.Inscribe.Base      = 500;
                m.Skills.ItemID.Base        = 500;
                m.Skills.Lockpicking.Base   = 500;
                m.Skills.Lumberjacking.Base = 500;
                m.Skills.Macing.Base        = 500;
                m.Skills.Magery.Base        = 500;
                m.Skills.MagicResist.Base   = 500;
                m.Skills.Meditation.Base    = 500;
                m.Skills.Mining.Base        = 500;
                m.Skills.Musicianship.Base  = 500;
                m.Skills.Parry.Base         = 500;
                m.Skills.Peacemaking.Base   = 500;
                m.Skills.Poisoning.Base     = 500;
                m.Skills.Provocation.Base   = 500;
                m.Skills.RemoveTrap.Base    = 500;
                m.Skills.Snooping.Base      = 500;
                m.Skills.SpiritSpeak.Base   = 500;
                m.Skills.Stealing.Base      = 500;
                m.Skills.Stealth.Base       = 500;
                m.Skills.Swords.Base        = 500;
                m.Skills.Tactics.Base       = 500;
                m.Skills.Tailoring.Base     = 500;
                m.Skills.TasteID.Base       = 500;
                m.Skills.Tinkering.Base     = 500;
                m.Skills.Tracking.Base      = 500;
                m.Skills.Veterinary.Base    = 500;
                m.Skills.Wrestling.Base     = 500;
                m.Skills.Chivalry.Base      = 500;
                m.Skills.Necromancy.Base    = 500;
                m.Skills.Bushido.Base       = 500;
                m.Skills.Ninjitsu.Base      = 500;
                m.Skills.Spellweaving.Base  = 500;

                m.AddToBackpack(new Spellbook(UInt64.MaxValue));
                m.AddToBackpack(new NecromancerSpellbook((UInt64)0xFFFF));
                m.AddToBackpack(new BookOfChivalry((UInt64)0x3FF));
                m.AddToBackpack(new BookOfBushido());                           //Default ctor = full
                m.AddToBackpack(new BookOfNinjitsu());                          //Default ctor = full
                m.AddToBackpack(new BagOfAllReagents(5000));

                m.FixedParticles(0x373A, 10, 15, 5036, EffectLayer.Head);
                m.PlaySound(521);
                m.SendMessage("You summon a my little pony.");
                m.CloseGump(typeof(GMBuffStatueWarningGump));

                break;
            }

            case 1:
            {
                m.SendMessage("You decide that you'd rather forgo getting a my little pony.");
                m.CloseGump(typeof(GMBuffStatueWarningGump));

                break;
            }
            }
        }
示例#46
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendAsciiMessage("Target can not be seen.");
            }
            else if (Core.AOS)
            {
                if (Caster.CanBeHarmful(m) && CheckSequence())
                {
                    Mobile from = Caster, target = m;

                    SpellHelper.Turn(from, target);

                    SpellHelper.CheckReflect((int)this.Circle, ref from, ref target);

                    int damage = (int)((Caster.Skills[SkillName.Magery].Value + Caster.Int) / 5);

                    if (damage > 60)
                    {
                        damage = 60;
                    }

                    Timer.DelayCall(TimeSpan.FromSeconds(1.0),
                                    new TimerStateCallback(AosDelay_Callback),
                                    new object[] { Caster, target, m, damage });
                }
            }
            else if (CheckHSequence(m))
            {
                Mobile from = Caster, target = m;

                SpellHelper.Turn(from, target);

                SpellHelper.CheckReflect((int)this.Circle, ref from, ref target);

                // Algorithm: (highestStat - lowestStat) / 2 [- 50% if resisted]

                int highestStat = target.Str, lowestStat = target.Str;

                if (target.Dex > highestStat)
                {
                    highestStat = target.Dex;
                }

                if (target.Dex < lowestStat)
                {
                    lowestStat = target.Dex;
                }

                if (target.Int > highestStat)
                {
                    highestStat = target.Int;
                }

                if (target.Int < lowestStat)
                {
                    lowestStat = target.Int;
                }

                if (highestStat > 150)
                {
                    highestStat = 150;
                }

                if (lowestStat > 150)
                {
                    lowestStat = 150;
                }

                int damage = (highestStat - lowestStat) / 4;                //less damage

                if (damage > 45)
                {
                    damage = 45;
                }

                if (CheckResisted(target))
                {
                    damage /= 2;
                    target.SendAsciiMessage("You feel yourself resisting magical energy.");
                }

                from.FixedParticles(0x374A, 10, 15, 2038, EffectLayer.Head);

                target.FixedParticles(0x374A, 10, 15, 5038, EffectLayer.Head);
                target.PlaySound(0x213);

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

            FinishSequence();
        }
示例#47
0
        public void Target(Mobile m)
        {
            if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                /* Transmogrifies the flesh of the target creature or player to resemble rotted corpse flesh,
                 * making them more vulnerable to Fire and Poison damage,
                 * but increasing their resistance to Physical and Cold damage.
                 *
                 * The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 25 ) + 40 seconds.
                 *
                 * NOTE: Algorithm above is fixed point, should be:
                 * ((ss-mr)/2.5) + 40
                 *
                 * NOTE: Resistance is not checked if targeting yourself
                 */

                ExpireTimer timer = (ExpireTimer)m_Table[m];

                if (timer != null)
                {
                    timer.DoExpire();
                }
                else
                {
                    m.SendLocalizedMessage(1061689);                       // Your skin turns dry and corpselike.
                }
                if (m.Spell != null)
                {
                    m.Spell.OnCasterHurt();
                }

                m.FixedParticles(0x373A, 1, 15, 9913, 67, 7, EffectLayer.Head);
                m.PlaySound(0x1BB);

                double ss = GetDamageSkill(Caster);
                double mr = (Caster == m ? 0.0 : GetResistSkill(m));
                m.CheckSkill(SkillName.MagicResist, 0.0, 120.0);                        //Skill check for gain

                TimeSpan duration = TimeSpan.FromSeconds(((ss - mr) / 2.5) + 40.0);

                int nBenefit1 = 0;
                int nBenefit2 = 0;
                if (Caster is PlayerMobile)                   // WIZARD
                {
                    nBenefit1 = (int)(Caster.Skills[SkillName.Necromancy].Value / 10);
                    nBenefit2 = (int)(Caster.Skills[SkillName.Necromancy].Value / 5);
                }

                ResistanceMod[] mods = new ResistanceMod[4]
                {
                    new ResistanceMod(ResistanceType.Fire, (-15 + nBenefit1)),
                    new ResistanceMod(ResistanceType.Poison, (-15 + nBenefit1)),
                    new ResistanceMod(ResistanceType.Cold, (10 + nBenefit2)),
                    new ResistanceMod(ResistanceType.Physical, (10 + nBenefit2))
                };

                timer = new ExpireTimer(m, mods, duration);
                timer.Start();

                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.CorpseSkin, 1075663, duration, m));

                m_Table[m] = timer;

                for (int i = 0; i < mods.Length; ++i)
                {
                    m.AddResistanceMod(mods[i]);
                }

                HarmfulSpell(m);
            }

            FinishSequence();
        }
示例#48
0
        public void ApplyEffects(Mobile m, double strength = 1.0)
        {
            /* Transmogrifies the flesh of the target creature or player to resemble rotted corpse flesh,
             * making them more vulnerable to Fire and Poison damage,
             * but increasing their resistance to Physical and Cold damage.
             *
             * The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 25 ) + 40 seconds.
             *
             * NOTE: Algorithm above is fixed point, should be:
             * ((ss-mr)/2.5) + 40
             *
             * NOTE: Resistance is not checked if targeting yourself
             */

            if (m_Table.ContainsKey(m))
            {
                m_Table[m].DoExpire(false);
            }

            m.SendLocalizedMessage(1061689); // Your skin turns dry and corpselike.

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

            m.FixedParticles(0x373A, 1, 15, 9913, 67, 7, EffectLayer.Head);
            m.PlaySound(0x1BB);

            double ss = GetDamageSkill(Caster);
            double mr = GetResistSkill(m);

            m.CheckSkill(SkillName.MagicResist, 0.0, m.Skills[SkillName.MagicResist].Cap);      //Skill check for gain

            TimeSpan duration = TimeSpan.FromSeconds((((ss - mr) / 2.5) + 40.0) * strength);

            int malus = (int)Math.Min(15, (Caster.Skills[CastSkill].Value + Caster.Skills[DamageSkill].Value) * 0.075);

            ResistanceMod[] mods = new ResistanceMod[4]
            {
                new ResistanceMod(ResistanceType.Fire, (int)(-malus * strength)),
                new ResistanceMod(ResistanceType.Poison, (int)(-malus * strength)),
                new ResistanceMod(ResistanceType.Cold, (int)(+10.0 * strength)),
                new ResistanceMod(ResistanceType.Physical, (int)(+10.0 * strength))
            };

            ExpireTimer timer = new ExpireTimer(m, mods, malus, duration);

            timer.Start();

            BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.CorpseSkin, 1075663, duration, m));

            m_Table[m] = timer;

            m.UpdateResistances();

            for (int i = 0; i < mods.Length; ++i)
            {
                m.AddResistanceMod(mods[i]);
            }

            HarmfulSpell(m);
        }
示例#49
0
        public virtual void Exit(Mobile fighter)
        {
            if (fighter == null)
            {
                return;
            }

            // teleport fighter
            if (fighter.NetState == null && MobileIsInBossArea(fighter.LogoutLocation))
            {
                fighter.LogoutMap      = this is CitadelAltar ? Map.Tokuno : Map;
                fighter.LogoutLocation = ExitDest;
            }
            else if (MobileIsInBossArea(fighter) && fighter.Map == Map)
            {
                fighter.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                fighter.PlaySound(0x1FE);

                if (this is CitadelAltar)
                {
                    fighter.MoveToWorld(ExitDest, Map.Tokuno);
                }
                else
                {
                    fighter.MoveToWorld(ExitDest, Map);
                }
            }

            // teleport his pets
            if (fighter is PlayerMobile)
            {
                foreach (BaseCreature pet in ((PlayerMobile)fighter).AllFollowers.OfType <BaseCreature>())
                {
                    if (pet != null && (pet.Alive || pet.IsBonded) && pet.Map != Map.Internal && MobileIsInBossArea(pet))
                    {
                        if (pet is BaseMount)
                        {
                            BaseMount mount = (BaseMount)pet;

                            if (mount.Rider != null && mount.Rider != fighter)
                            {
                                mount.Rider.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                                mount.Rider.PlaySound(0x1FE);

                                if (this is CitadelAltar)
                                {
                                    mount.Rider.MoveToWorld(ExitDest, Map.Tokuno);
                                }
                                else
                                {
                                    mount.Rider.MoveToWorld(ExitDest, Map);
                                }

                                continue;
                            }
                            else if (mount.Rider != null)
                            {
                                continue;
                            }
                        }

                        pet.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                        pet.PlaySound(0x1FE);

                        if (this is CitadelAltar)
                        {
                            pet.MoveToWorld(ExitDest, Map.Tokuno);
                        }
                        else
                        {
                            pet.MoveToWorld(ExitDest, Map);
                        }
                    }
                }
            }

            Fighters.Remove(fighter);
            fighter.SendLocalizedMessage(1072677); // You have been transported out of this room.

            if (MasterKeys.Count == 0 && Fighters.Count == 0 && Owner != null)
            {
                StopTimers();

                Owner = null;

                if (Peerless != null)
                {
                    if (Peerless.Corpse != null && !Peerless.Corpse.Deleted)
                    {
                        Peerless.Corpse.Delete();
                    }

                    if (!Peerless.Deleted)
                    {
                        Peerless.Delete();
                    }
                }

                CleanupHelpers();

                // reset summoner, boss
                Peerless = null;

                Deadline = DateTime.MinValue;
            }
        }
        private void DoCounter(Mobile attacker)
        {
            if (this.Map == null)
            {
                return;
            }

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

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

                Mobile target = null;

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

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

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

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

                ArrayList targets = new ArrayList();

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

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

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

                    DoHarmful(m);

                    AOS.Damage(m, this, Utility.RandomMinMax(50, 55), true, 0, 0, 0, 100, 0);

                    m.FixedParticles(0x36BD, 1, 10, 0x1F78, 0xA6, 0, (EffectLayer)255);
                    m.ApplyPoison(this, Poison.Lethal);
                }
            }
        }
示例#51
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))
            {
                var loc = m.Location;
                loc.Z += 50;

                m.PlaySound(0x211);
                m.FixedParticles(0x3779, 1, 30, 0x26EC, 0x3, 0x3, EffectLayer.Waist);

                Effects.SendMovingParticles(
                    new Entity(Serial.Zero, loc, m.Map),
                    new Entity(Serial.Zero, m.Location, m.Map),
                    0xF5F,
                    1,
                    0,
                    true,
                    false,
                    0x21,
                    0x3F,
                    0x251D,
                    0,
                    0,
                    EffectLayer.Head,
                    0
                    );

                var percentage = 0.05 * FocusLevel;

                int damage;

                if (!m.Player && m.Hits / (double)m.HitsMax < percentage)
                {
                    damage = 300;
                }
                else
                {
                    var minDamage = (int)Caster.Skills.Spellweaving.Value / 5;
                    var maxDamage = (int)Caster.Skills.Spellweaving.Value / 3;
                    damage = Utility.RandomMinMax(minDamage, maxDamage);
                    var damageBonus = AosAttributes.GetValue(Caster, AosAttribute.SpellDamage);
                    if (m.Player && damageBonus > 15)
                    {
                        damageBonus = 15;
                    }

                    damage *= damageBonus + 100;
                    damage /= 100;
                }

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

            FinishSequence();
        }
        public virtual void Exit(Mobile fighter)
        {
            // teleport fighter
            if (fighter.NetState == null && MobileIsInBossArea(fighter.LogoutLocation))
            {
                fighter.LogoutMap      = this is CitadelAltar ? Map.Tokuno : this.Map;
                fighter.LogoutLocation = m_ExitDest;
            }
            else if (MobileIsInBossArea(fighter) && fighter.Map == this.Map)
            {
                fighter.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                fighter.PlaySound(0x1FE);

                if (this is CitadelAltar)
                {
                    fighter.MoveToWorld(m_ExitDest, Map.Tokuno);
                }
                else
                {
                    fighter.MoveToWorld(m_ExitDest, Map);
                }
            }

            // teleport his pets
            if (m_Pets.ContainsKey(fighter))
            {
                for (int i = 0; i < m_Pets[fighter].Count; i++)
                {
                    BaseCreature pet = m_Pets[fighter][i] as BaseCreature;

                    if (pet != null && (pet.Alive || pet.IsBonded) && pet.Map != Map.Internal && MobileIsInBossArea(pet))
                    {
                        if (pet is BaseMount)
                        {
                            BaseMount mount = (BaseMount)pet;

                            if (mount.Rider != null && mount.Rider != fighter)
                            {
                                mount.Rider.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                                mount.Rider.PlaySound(0x1FE);

                                if (this is CitadelAltar)
                                {
                                    mount.Rider.MoveToWorld(m_ExitDest, Map.Tokuno);
                                }
                                else
                                {
                                    mount.Rider.MoveToWorld(m_ExitDest, Map);
                                }

                                continue;
                            }
                            else if (mount.Rider != null)
                            {
                                continue;
                            }
                        }

                        pet.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                        pet.PlaySound(0x1FE);

                        if (this is CitadelAltar)
                        {
                            pet.MoveToWorld(m_ExitDest, Map.Tokuno);
                        }
                        else
                        {
                            pet.MoveToWorld(m_ExitDest, Map);
                        }
                    }
                }

                m_Pets.Remove(fighter);
            }

            m_Fighters.Remove(fighter);
            fighter.SendLocalizedMessage(1072677); // You have been transported out of this room.
        }
示例#53
0
 public void AreaDamageEffect(Mobile m)
 {
     m.FixedParticles(0x374A, 10, 15, 5038, 1181, 2, EffectLayer.Head);
     m.PlaySound(0x213);
 }
示例#54
0
        public void Target(Mobile m)
        {
            if (m == null)
            {
                return;
            }

            if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                // SpellHelper.CheckReflect( (int)this.Circle, Caster, ref m );
                // Irrelevent after AoS

                /* Temporarily chokes off the air suply of the target with poisonous fumes.
                 * The target is inflicted with poison damage over time.
                 * The amount of damage dealt each "hit" is based off of the caster's Spirit Speak skill and the Target's current Stamina.
                 * The less Stamina the target has, the more damage is done by Strangle.
                 * Duration of the effect is Spirit Speak skill level / 10 rounds, with a minimum number of 4 rounds.
                 * The first round of damage is dealt after 5 seconds, and every next round after that comes 1 second sooner than the one before, until there is only 1 second between rounds.
                 * The base damage of the effect lies between (Spirit Speak skill level / 10) - 2 and (Spirit Speak skill level / 10) + 1.
                 * Base damage is multiplied by the following formula: (3 - (target's current Stamina / target's maximum Stamina) * 2).
                 * Example:
                 * For a target at full Stamina the damage multiplier is 1,
                 * for a target at 50% Stamina the damage multiplier is 2 and
                 * for a target at 20% Stamina the damage multiplier is 2.6
                 */

                m.Spell?.OnCasterHurt();

                m.PlaySound(0x22F);
                m.FixedParticles(0x36CB, 1, 9, 9911, 67, 5, EffectLayer.Head);
                m.FixedParticles(0x374A, 1, 17, 9502, 1108, 4, (EffectLayer)255);

                if (!m_Table.TryGetValue(m, out var timer))
                {
                    m_Table[m] = timer = new InternalTimer(m, Caster);
                    timer.Start();
                }

                HarmfulSpell(m);
            }

            // Calculations for the buff bar
            var spiritlevel = Caster.Skills.SpiritSpeak.Value / 10;

            if (spiritlevel < 4)
            {
                spiritlevel = 4;
            }

            var d_MinDamage = 4;
            var d_MaxDamage = ((int)spiritlevel + 1) * 3;
            var args        = $"{d_MinDamage}\t{d_MaxDamage}";

            var i_Count    = (int)spiritlevel;
            var i_MaxCount = i_Count;
            var i_HitDelay = 5;
            var i_Length   = i_HitDelay;

            while (i_Count > 1)
            {
                --i_Count;
                if (i_HitDelay > 1)
                {
                    if (i_MaxCount < 5)
                    {
                        --i_HitDelay;
                    }
                    else
                    {
                        var delay = (int)Math.Ceiling((1.0 + 5 * i_Count) / i_MaxCount);

                        i_HitDelay = delay <= 5 ? delay : 5;
                    }
                }

                i_Length += i_HitDelay;
            }

            var t_Duration = TimeSpan.FromSeconds(i_Length);

            BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Strangle, 1075794, 1075795, t_Duration, m, args));

            FinishSequence();
        }
示例#55
0
            protected override void OnTarget(Mobile from, object o)
            {
                if (this.m_Talisman == null || this.m_Talisman.Deleted)
                {
                    return;
                }

                Mobile target = o as Mobile;

                if (from.Talisman != this.m_Talisman)
                {
                    from.SendLocalizedMessage(502641); // You must equip this item to use it.
                }
                else if (target == null)
                {
                    from.SendLocalizedMessage(1046439); // That is not a valid target.
                }
                else if (this.m_Talisman.ChargeTime > 0)
                {
                    from.SendLocalizedMessage(1074882, this.m_Talisman.ChargeTime.ToString()); // You must wait ~1_val~ seconds for this to recharge.
                }
                else if (this.m_Talisman.Charges == 0 && this.m_Talisman.MaxCharges > 0)
                {
                    from.SendLocalizedMessage(1042544); // This item is out of charges.
                }
                else
                {
                    switch (this.m_Talisman.Removal)
                    {
                    case TalismanRemoval.Curse:
                        target.PlaySound(0xF6);
                        target.PlaySound(0x1F7);
                        target.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                        IEntity mfrom = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z - 10), from.Map);
                        IEntity mto   = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z + 50), from.Map);
                        Effects.SendMovingParticles(mfrom, mto, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

                        target.RemoveStatMod("[Magic] Str Curse");
                        target.RemoveStatMod("[Magic] Dex Curse");
                        target.RemoveStatMod("[Magic] Int Curse");

                        target.Paralyzed = false;

                        EvilOmenSpell.TryEndEffect(target);
                        StrangleSpell.RemoveCurse(target);
                        CorpseSkinSpell.RemoveCurse(target);
                        CurseSpell.RemoveEffect(target);

                        BuffInfo.RemoveBuff(target, BuffIcon.Clumsy);
                        BuffInfo.RemoveBuff(target, BuffIcon.FeebleMind);
                        BuffInfo.RemoveBuff(target, BuffIcon.Weaken);
                        BuffInfo.RemoveBuff(target, BuffIcon.MassCurse);

                        target.SendLocalizedMessage(1072408);     // Any curses on you have been lifted

                        if (target != from)
                        {
                            from.SendLocalizedMessage(1072409);     // Your targets curses have been lifted
                        }
                        break;

                    case TalismanRemoval.Damage:
                        target.PlaySound(0x201);
                        Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0);

                        BleedAttack.EndBleed(target, true);
                        MortalStrike.EndWound(target);

                        BuffInfo.RemoveBuff(target, BuffIcon.Bleed);
                        BuffInfo.RemoveBuff(target, BuffIcon.MortalStrike);

                        target.SendLocalizedMessage(1072405);     // Your lasting damage effects have been removed!

                        if (target != from)
                        {
                            from.SendLocalizedMessage(1072406);     // Your Targets lasting damage effects have been removed!
                        }
                        break;

                    case TalismanRemoval.Ward:
                        target.PlaySound(0x201);
                        Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0);

                        MagicReflectSpell.EndReflect(target);
                        ReactiveArmorSpell.EndArmor(target);
                        ProtectionSpell.EndProtection(target);

                        target.SendLocalizedMessage(1072402);     // Your wards have been removed!

                        if (target != from)
                        {
                            from.SendLocalizedMessage(1072403);     // Your target's wards have been removed!
                        }
                        break;

                    case TalismanRemoval.Wildfire:
                        // TODO
                        break;
                    }

                    this.m_Talisman.OnAfterUse(from);
                }
            }
示例#56
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

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

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

                m.Paralyzed = false;

                int toDrain = 0;

                if (Core.AOS)
                {
                    toDrain = (int)(GetDamageSkill(Caster) - GetResistSkill(m));

                    if (!m.Player)
                    {
                        toDrain /= 2;
                    }

                    if (toDrain < 0)
                    {
                        toDrain = 0;
                    }
                    else if (toDrain > m.Mana)
                    {
                        toDrain = m.Mana;
                    }
                }
                else
                {
                    if (CheckResisted(m))
                    {
                        m.SendLocalizedMessage(501783);                           // You feel yourself resisting magical energy.
                    }
                    else
                    {
                        toDrain = m.Mana;
                    }
                }

                if (toDrain > (Caster.ManaMax - Caster.Mana))
                {
                    toDrain = Caster.ManaMax - Caster.Mana;
                }

                m.Mana      -= toDrain;
                Caster.Mana += toDrain;

                if (Core.AOS)
                {
                    m.FixedParticles(0x374A, 1, 15, 5054, 23, 7, EffectLayer.Head);
                    m.PlaySound(0x1F9);

                    Caster.FixedParticles(0x0000, 10, 5, 2054, EffectLayer.Head);
                }
                else
                {
                    m.FixedParticles(0x374A, 10, 15, 5054, EffectLayer.Head);
                    m.PlaySound(0x1F9);
                }
            }

            FinishSequence();
        }
示例#57
0
        protected override void OnTarget(Mobile from, object target)
        {
            if (!from.CanSee(target))
            {
                from.SendMessage("Target cannot be seen.");
            }
            else if (!from.Alive)
            {
                from.SendMessage("You cannot transform out of your current state.");
            }
            else if (target is Mobile && ((Mobile)target).Alive)
            {
                Mobile t = (Mobile)target;

                if (t == from)
                {
                    from.HueMod = -1;

                    ((Player)from).RawStr -= ((Player)from).StrMod;
                    ((Player)from).RawDex -= ((Player)from).DexMod;
                    ((Player)from).RawInt -= ((Player)from).IntMod;

                    ((Player)from).RaceBody = 58;
                    ((Player)from).AdjustBody();

                    ((Player)from).StrMod = 0;
                    ((Player)from).DexMod = 0;
                    ((Player)from).IntMod = 0;

                    ((Player)from).BodyDamageBonus = 0;
                }

                else if (from.Mounted && !t.Body.IsHuman)
                {
                    from.SendMessage("You cannot transform while mounted.");
                }

                else
                {
                    from.FixedParticles(14089, 0, 30, 0, 1155, 7, EffectLayer.CenterFeet);

                    ((Player)from).RaceBody = t.Body;
                    ((Player)from).AdjustBody();

                    from.HueMod = t.Hue;

                    ((Player)from).RawStr -= ((Player)from).StrMod;
                    ((Player)from).RawDex -= ((Player)from).DexMod;
                    ((Player)from).RawInt -= ((Player)from).IntMod;

                    ((Player)from).StrMod = (int)(t.RawStr / 10);
                    ((Player)from).DexMod = (int)(t.RawDex / 10);
                    ((Player)from).IntMod = (int)(t.RawInt / 10);

                    from.RawStr += ((Player)from).StrMod;
                    from.RawDex += ((Player)from).DexMod;
                    from.RawInt += ((Player)from).IntMod;

                    if (t.Body.IsHuman == false)
                    {
                        ((Player)from).BodyDamageBonus = (int)(t.RawStr / 15);
                    }

                    if (t.Body.IsHuman)
                    {
                        from.HairItemID       = t.HairItemID;
                        from.FacialHairItemID = t.FacialHairItemID;
                        from.HairHue          = t.HairHue;
                        from.FacialHairHue    = t.FacialHairHue;
                    }

                    from.PublicOverheadMessage(MessageType.Regular, from.EmoteHue, false, String.Format("*transforms into the shape of {0}*", t.RawName));

                    hasChanged = true;

                    for (int x = 1; x <= 2; x++)
                    {
                        Item toDisarm = from.FindItemOnLayer(Layer.OneHanded);

                        if (toDisarm == null || !toDisarm.Movable)
                        {
                            toDisarm = from.FindItemOnLayer(Layer.TwoHanded);
                        }

                        Container pack = from.Backpack;
                        pack.DropItem(toDisarm);
                    }
                }
            }

            else
            {
                from.SendMessage("You cannot take that form.");
            }
        }
示例#58
0
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckSequence())
            {
                SpellHelper.Turn(Caster, p);

                SpellHelper.GetSurfaceTop(ref p);

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

                Map map = Caster.Map;

                if (map != null)
                {
                    IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), Core.AOS ? 2 : 3);

                    foreach (Mobile m in eable)
                    {
                        if (Caster.CanBeBeneficial(m, false))
                        {
                            targets.Add(m);
                        }
                    }

                    eable.Free();
                }

                if (Core.AOS)
                {
                    Party party = Party.Get(Caster);

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

                        if (m == Caster || (party != null && party.Contains(m)))
                        {
                            Caster.DoBeneficial(m);
                            Spells.Second.ProtectionSpell.Toggle(Caster, m);
                        }
                    }
                }
                else
                {
                    Effects.PlaySound(p, Caster.Map, 0x299);

                    int val = (int)(Caster.Skills[SkillName.Magery].Value / 10.0 + 1);

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

                            if (m.BeginAction(typeof(ArchProtectionSpell)))
                            {
                                Caster.DoBeneficial(m);
                                m.VirtualArmorMod += val;

                                AddEntry(m, val);
                                new InternalTimer(m, Caster).Start();

                                m.FixedParticles(0x375A, 9, 20, 5027, EffectLayer.Waist);
                                m.PlaySound(0x1F7);
                            }
                        }
                    }
                }
            }

            FinishSequence();
        }
示例#59
0
        public void Target(Mobile m)
        {
            if (CheckBSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                /* Attempts to remove all Curse effects from Target.
                 * Curses include Mage spells such as Clumsy, Weaken, Feeblemind and Paralyze
                 * as well as all Necromancer curses.
                 * Chance of removing curse is affected by Caster's Karma.
                 */

                int chance = 0;

                if (Caster.Karma < -5000)
                {
                    chance = 0;
                }
                else if (Caster.Karma < 0)
                {
                    chance = (int)Math.Sqrt(20000 + Caster.Karma) - 122;
                }
                else if (Caster.Karma < 5625)
                {
                    chance = (int)Math.Sqrt(Caster.Karma) + 25;
                }
                else
                {
                    chance = 100;
                }

                if (chance > Utility.Random(100))
                {
                    m.PlaySound(0xF6);
                    m.PlaySound(0x1F7);
                    m.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                    IEntity from = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z - 10), Caster.Map);
                    IEntity to   = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + 50), Caster.Map);
                    Effects.SendMovingParticles(from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

                    StatMod mod;

                    mod = m.GetStatMod("[Magic] Str Offset");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Str Offset");
                    }

                    mod = m.GetStatMod("[Magic] Dex Offset");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Dex Offset");
                    }

                    mod = m.GetStatMod("[Magic] Int Offset");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Int Offset");
                    }

                    m.Paralyzed = false;

                    EvilOmenSpell.CheckEffect(m);
                    StrangleSpell.RemoveCurse(m);
                    CorpseSkinSpell.RemoveCurse(m);
                    CurseSpell.RemoveEffect(m);
                    MortalStrike.EndWound(m);

                    BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
                    BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
                    BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
                    BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
                    BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);

                    // TODO: Should this remove blood oath? Pain spike?
                }
                else
                {
                    m.PlaySound(0x1DF);
                }
            }

            FinishSequence();
        }
示例#60
0
        public override bool OnMoveOver(Mobile m)
        {
            m.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist);

            return(true);
        }