Example #1
0
		public override bool Use( Mobile from ) {
			if ( from.BeginAction( typeof( ClarityPotion ) ) ) {
				int amount = Utility.Dice( 3, 3, 3 );
				int time = Utility.RandomMinMax( 5, 30 );

				from.PlaySound( 0x2D6 );

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

				from.FixedParticles( 0x375A, 10, 15, 5011, EffectLayer.Head );
				from.PlaySound( 0x1EB );

				StatMod mod = from.GetStatMod( "Concussion" );

				if ( mod != null ) {
					from.RemoveStatMod( "Concussion" );
					from.Mana -= mod.Offset;
				}

				from.PlaySound( 0x1EE );
				from.AddStatMod( new StatMod( StatType.Int, "clarity-potion", amount, TimeSpan.FromMinutes( time ) ) );

				Timer.DelayCall( TimeSpan.FromMinutes( time ), delegate() {
					from.EndAction( typeof( ClarityPotion ) );
				} );

				return true;
			}

			return false;
		}
Example #2
0
		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 );

				StatMod mod;

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

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

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

				from.Paralyzed = false;
				from.Sleep = false; // SA Mysticism Edit

				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;
		}
Example #3
0
        public static int GetCursePower( Mobile m )
        {
            int power = 0;

            // 1st circle debuffs
            foreach ( string statModName in StatModNames )
            {
                if ( m.GetStatMod( statModName ) != null )
                    power += 1;
            }

            // 3rd circle debuffs
            if ( EvilOmenSpell.UnderEffect( m ) )
                power += 3;

            if ( BloodOathSpell.UnderEffect( m ) )
                power += 3;

            if ( CorpseSkinSpell.UnderEffect( m ) )
                power += 3;

            if ( MindRotSpell.HasMindRotScalar( m ) )
                power += 3;

            if ( SleepSpell.IsSlept( m ) )
                power += 3;

            // 4th circle debuffs
            if ( CurseSpell.UnderEffect( m ) )
                power += 4;

            // 6th circle debuffs
            if ( StrangleSpell.UnderEffect( m ) )
                power += 6;

            // 7th circle debuffs
            if ( SpellPlagueSpell.UnderEffect( m ) )
                power += 7;

            if ( MortalStrike.IsWounded( m ) )
                power += 7;

            return power;
        }
Example #4
0
        public static bool AddStatBonus( Mobile caster, Mobile target, StatType type, int bonus, TimeSpan duration )
        {
            int offset = bonus;
            string name = String.Format( "[Magic] {0} Offset", type );

            StatMod mod = target.GetStatMod( name );

            if ( mod != null && mod.Offset < 0 )
            {
                target.AddStatMod( new StatMod( type, name, mod.Offset + offset, duration ) );
                return true;
            }
            else if ( mod == null || mod.Offset < offset )
            {
                target.AddStatMod( new StatMod( type, name, offset, duration ) );
                return true;
            }

            return false;
        }
Example #5
0
		public override bool Use( Mobile from ) {
			if ( from.GetStatMod( "blood-rose" ) == null ) {
				from.PlaySound( Utility.Random( 0x3A, 3 ) );

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

				int amount = Utility.Dice( 3, 3, 3 );
				int time = Utility.RandomMinMax( 5, 30 );

				from.FixedParticles( 0x373A, 10, 15, 5018, EffectLayer.Waist );

				from.PlaySound( 0x1EE );
				from.AddStatMod( new StatMod( StatType.All, "blood-rose", amount, TimeSpan.FromMinutes( time ) ) );

				return true;
			} else {
				from.SendLocalizedMessage( 1062927 ); // You have eaten one of these recently and eating another would provide no benefit.

				return false;
			}
		}
        public override void OnDoubleClick( Mobile from )
        {
            if ( !IsChildOf( from.Backpack ) )
            {
                from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it.
            }
            else if ( from.GetStatMod( "RoseOfTrinsicPetal" ) != null )
            {
                from.SendLocalizedMessage( 1062927 ); // You have eaten one of these recently and eating another would provide no benefit.
            }
            else
            {
                from.PlaySound( 0x1EE );
                from.AddStatMod( new StatMod( StatType.Str, "RoseOfTrinsicPetal", 5, TimeSpan.FromMinutes( 5.0 ) ) );

                Consume();
            }
        }
Example #7
0
        public BuffType GetRandomBuff(Mobile target)
        {
            List<BuffType> buffs = new List<BuffType>();

            if (MagicReflectSpell.HasReflect(target))
                buffs.Add(BuffType.MagicReflect);

            if (ReactiveArmorSpell.HasArmor(target))
                buffs.Add(BuffType.ReactiveArmor);

            if (ProtectionSpell.HasProtection(target))
                buffs.Add(BuffType.Protection);

            TransformContext context = TransformationSpellHelper.GetContext(target);

            if (context != null && context.Type != typeof(AnimalForm))
                buffs.Add(BuffType.Transformation);

            StatMod mod = target.GetStatMod("[Magic] Str Offset");
            if (mod != null && mod.Offset > 0)
                buffs.Add(BuffType.StrBonus);

            mod = target.GetStatMod("[Magic] Dex Offset");
            if (mod != null && mod.Offset > 0)
                buffs.Add(BuffType.DexBonus);

            mod = target.GetStatMod("[Magic] Int Offset");
            if (mod != null && mod.Offset > 0)
                buffs.Add(BuffType.IntBonus);

            if (buffs.Count == 0)
                return BuffType.None;

            BuffType type = buffs[Utility.Random(buffs.Count)];
            buffs.Clear();

            return type;
        }
Example #8
0
        public void Target( BaseTalisman talis, Mobile owner, Mobile m )
        {
            if ( this.Parent == owner )
            {
                //Curse Removal
                if ( talis.m_TalismanType == TalismanType.CurseRemoval )
                {
                    m.PlaySound( 0xF6 );
                    m.PlaySound( 0x1F7 );
                    m.FixedParticles( 0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head );

                    StatMod mod;

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

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

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

                    m.Paralyzed = false;

                    EvilOmenSpell.CheckEffect( m );
                    StrangleSpell.RemoveCurse( m );
                    CorpseSkinSpell.RemoveCurse( m );
                    CurseSpell.RemoveEffect( 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.Curse );
                    BuffInfo.RemoveBuff( m, BuffIcon.EvilOmen );
                    StrangleSpell.RemoveCurse( m );
                    CorpseSkinSpell.RemoveCurse( m );

                    if ( owner != m )
                        owner.SendLocalizedMessage( 1072409 ); // Your targets curses have been lifted
                    m.SendLocalizedMessage( 1072408 ); // Any curses on you have been lifted

                }

                //Damage Removal
                if ( talis.m_TalismanType == TalismanType.DamageRemoval )
                {
                    Effects.SendLocationEffect( m.Location, m.Map, 0x3728, 8 );
                    Effects.PlaySound( m, m.Map, 0x201 );
                    BleedAttack.EndBleed( m, false );
                    MortalStrike.EndWound( m );
                    m.CurePoison( m );

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

                    if ( owner != m )
                        owner.SendLocalizedMessage( 1072406 ); // Your Targets lasting damage effects have been removed!

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

                //Ward Removal
                if ( talis.m_TalismanType == TalismanType.WardRemoval )
                {
                    Effects.SendLocationEffect( m.Location, m.Map, 0x3728, 8 );
                    Effects.PlaySound( m, m.Map, 0x201 );

                    ProtectionSpell.RemoveWard( m );
                    ReactiveArmorSpell.RemoveWard( m );
                    MagicReflectSpell.RemoveWard( m );
                    TransformationSpell.RemoveContext( m, true );
                    ReaperFormSpell.RemoveEffects( m );
                    if ( StoneFormSpell.UnderEffect( m ) )
                        StoneFormSpell.RemoveEffects( m );

                    if ( owner != m )
                        owner.SendLocalizedMessage( 1072403 ); // Your target's wards have been removed!

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

                //Wildfire Removal
                if ( talis.m_TalismanType == TalismanType.WildfireRemoval )
                    owner.SendLocalizedMessage( 1042753, "Wildfire Removal" ); // ~1_SOMETHING~ has been temporarily disabled.

                //CARGE TIMER
                ChargeTimeLeft = 1200;
                m_ChargeTimer = new ChargeTimeLeftTimer( this );
                m_ChargeTimer.Start();
                m_ChargeTimeLeft3 = DateTime.Now;

            }
            else if ( m_TalismanType != 0 )
                m.SendLocalizedMessage( 502641 ); // You must equip this item to use it.
        }
        public void StompAttack( Mobile target )
        {
            if ( target.GetStatMod( "StompAttack" ) == null )
            {
                StatType type;

                switch( Utility.Random(3) )
                {
                    default:
                    case 0: type = StatType.Str; break;
                    case 1: type = StatType.Dex; break;
                    case 2: type = StatType.Int; break;
                }

                target.AddStatMod( new StatMod( type, "StompAttack", -( 10 + Utility.Random( 10 ) ), TimeSpan.FromSeconds( 60 + Utility.Random( 60 ) ) ) );
            }
        }
        public bool DoPrayerEffect(PlayerMobile from, Mobile target)
        {
            if (target == null || target.Deleted || !target.Alive || target.IsDeadBondedPet)
                return false;
            if (from == null || from.Deleted)
                return false;

            if (!String.IsNullOrEmpty(m_Message))
                target.SendMessage(m_Message);
            target.SendSound(SoundID);
            int offset = m_Intensity + PowerBonus(from);
            switch (m_Effect)
            {
                case PrayerEffect.Strength:
                    {
                        #region Strength

                        string name = String.Format("[Prayer] {0} Offset", m_Effect);

                        StatMod mod = target.GetStatMod(name);

                        //one is negative and the other is positive, so adding up
                        if (mod != null && ((mod.Offset <= 0 && offset > 0) || (offset < 0 && mod.Offset >= 0)))
                        {
                            target.RemoveStatMod(name);
                            target.AddStatMod(new StatMod(StatType.Str, name, mod.Offset + offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }
                        //nothing to replace, just adding
                        else if (mod == null)
                        {
                            target.AddStatMod(new StatMod(StatType.Str, name, offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }
                        //replacing the current mod with a larger one
                        else if (mod != null && ((mod.Offset <= 0 && offset < mod.Offset) || (mod.Offset >= 0 && mod.Offset < offset)))
                        {
                            target.RemoveStatMod(name);
                            target.AddStatMod(new StatMod(StatType.Str, name, offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }

                        return false;
                        #endregion
                    }
                case PrayerEffect.Dexterity:
                    {
                        #region Dexterity
                        string name = String.Format("[Prayer] {0} Offset", m_Effect);

                        StatMod mod = target.GetStatMod(name);

                        //one is negative and the other is positive, so adding up
                        if (mod != null && ((mod.Offset <= 0 && offset > 0) || (offset < 0 && mod.Offset >= 0)))
                        {
                            target.RemoveStatMod(name);
                            target.AddStatMod(new StatMod(StatType.Dex, name, mod.Offset + offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }
                        //nothing to replace, just adding
                        else if (mod == null)
                        {
                            target.AddStatMod(new StatMod(StatType.Dex, name, offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }
                        //replacing the current mod with a larger one
                        else if (mod != null && ((mod.Offset <= 0 && offset < mod.Offset) || (mod.Offset >= 0 && mod.Offset < offset)))
                        {
                            target.RemoveStatMod(name);
                            target.AddStatMod(new StatMod(StatType.Dex, name, offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }

                        return false;
                        #endregion
                    }
                case PrayerEffect.Intelligence:
                    {
                        #region Intelligence

                        string name = String.Format("[Prayer] {0} Offset", m_Effect);

                        StatMod mod = target.GetStatMod(name);

                        //one is negative and the other is positive, so adding up
                        if (mod != null && ((mod.Offset <= 0 && offset > 0) || (offset < 0 && mod.Offset >= 0)))
                        {
                            target.RemoveStatMod(name);
                            target.AddStatMod(new StatMod(StatType.Int, name, mod.Offset + offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }
                        //nothing to replace, just adding
                        else if (mod == null)
                        {
                            target.AddStatMod(new StatMod(StatType.Int, name, offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }
                        //replacing the current mod with a larger one
                        else if (mod != null && ((mod.Offset <= 0 && offset < mod.Offset) || (mod.Offset >= 0 && mod.Offset < offset)))
                        {
                            target.RemoveStatMod(name);
                            target.AddStatMod(new StatMod(StatType.Int, name, offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }

                        return false;

                        #endregion
                    }
                case PrayerEffect.RawHitPoints:
                    {
                        #region RawHits

                        string name = String.Format("[Prayer] {0} Offset", m_Effect);

                        StatMod mod = target.GetStatMod(name);

                        //one is negative and the other is positive, so adding up
                        if (mod != null && ((mod.Offset <= 0 && offset > 0) || (offset < 0 && mod.Offset >= 0)))
                        {
                            target.RemoveStatMod(name);
                            target.AddStatMod(new StatMod(StatType.HitsMax, name, mod.Offset + offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }
                        //nothing to replace, just adding
                        else if (mod == null)
                        {
                            target.AddStatMod(new StatMod(StatType.HitsMax, name, offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }
                        //replacing the current mod with a larger one
                        else if (mod != null && ((mod.Offset <= 0 && offset < mod.Offset) || (mod.Offset >= 0 && mod.Offset < offset)))
                        {
                            target.RemoveStatMod(name);
                            target.AddStatMod(new StatMod(StatType.HitsMax, name, offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }

                        return false;

                        #endregion
                    }
                case PrayerEffect.CurrentHitPoints:
                    {
                        target.Hits += offset;
                        return true;
                    }
                case PrayerEffect.RawStamina:
                    {
                        #region RawStam

                        string name = String.Format("[Prayer] {0} Offset", m_Effect);

                        StatMod mod = target.GetStatMod(name);

                        //one is negative and the other is positive, so adding up
                        if (mod != null && ((mod.Offset <= 0 && offset > 0) || (offset < 0 && mod.Offset >= 0)))
                        {
                            target.RemoveStatMod(name);
                            target.AddStatMod(new StatMod(StatType.StamMax, name, mod.Offset + offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }
                        //nothing to replace, just adding
                        else if (mod == null)
                        {
                            target.AddStatMod(new StatMod(StatType.StamMax, name, offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }
                        //replacing the current mod with a larger one
                        else if (mod != null && ((mod.Offset <= 0 && offset < mod.Offset) || (mod.Offset >= 0 && mod.Offset < offset)))
                        {
                            target.RemoveStatMod(name);
                            target.AddStatMod(new StatMod(StatType.StamMax, name, offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }

                        return false;

                        #endregion
                    }
                case PrayerEffect.CurrentStamina:
                    {
                        target.Stam += offset;
                        return true;
                    }
                case PrayerEffect.RawMana:
                    {
                        #region RawMana

                        string name = String.Format("[Prayer] {0} Offset", m_Effect);

                        StatMod mod = target.GetStatMod(name);

                        //one is negative and the other is positive, so adding up
                        if (mod != null && ((mod.Offset <= 0 && offset > 0) || (offset < 0 && mod.Offset >= 0)))
                        {
                            target.RemoveStatMod(name);
                            target.AddStatMod(new StatMod(StatType.ManaMax, name, mod.Offset + offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }
                        //nothing to replace, just adding
                        else if (mod == null)
                        {
                            target.AddStatMod(new StatMod(StatType.ManaMax, name, offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }
                        //replacing the current mod with a larger one
                        else if (mod != null && ((mod.Offset <= 0 && offset < mod.Offset) || (mod.Offset >= 0 && mod.Offset < offset)))
                        {
                            target.RemoveStatMod(name);
                            target.AddStatMod(new StatMod(StatType.ManaMax, name, offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }

                        return false;

                        #endregion
                    }
                case PrayerEffect.CurrentMana:
                    {
                        target.Mana += offset;
                        return true;
                    }
                case PrayerEffect.BluntResistance:
                    {
                        ResistancePrayerTimer timer = new ResistancePrayerTimer(target, ResistanceType.Blunt, offset, m_Duration);
                        timer.Start();
                        return true;
                    }
                case PrayerEffect.PiercingResistance:
                    {
                        ResistancePrayerTimer timer = new ResistancePrayerTimer(target, ResistanceType.Piercing, offset, m_Duration);
                        timer.Start();
                        return true;
                    }
                case PrayerEffect.SlashingResistance:
                    {
                        ResistancePrayerTimer timer = new ResistancePrayerTimer(target, ResistanceType.Slashing, offset, m_Duration);
                        timer.Start();
                        return true;
                    }
                case PrayerEffect.ColdResistance:
                    {
                        ResistancePrayerTimer timer = new ResistancePrayerTimer(target, ResistanceType.Cold, offset, m_Duration);
                        timer.Start();
                        return true;
                    }
                case PrayerEffect.FireResistance:
                    {
                        ResistancePrayerTimer timer = new ResistancePrayerTimer(target, ResistanceType.Fire, offset, m_Duration);
                        timer.Start();
                        return true;
                    }
                case PrayerEffect.PoisonResistance:
                    {
                        ResistancePrayerTimer timer = new ResistancePrayerTimer(target, ResistanceType.Poison, offset, m_Duration);
                        timer.Start();
                        return true;
                    }
                case PrayerEffect.EnergyResistance:
                    {
                        ResistancePrayerTimer timer = new ResistancePrayerTimer(target, ResistanceType.Energy, offset, m_Duration);
                        timer.Start();
                        return true;
                    }
                case PrayerEffect.AttackChance:
                    {
                        XmlAosAttribute att = new XmlAosAttribute(AosAttribute.AttackChance, offset, m_Duration);
                        att.Name = String.Format("[Prayer] {0} Offset", m_Effect);
                        XmlAttach.AttachTo(target, att);
                        return true;
                    }
                case PrayerEffect.DefendChance:
                    {
                        XmlAosAttribute att = new XmlAosAttribute(AosAttribute.DefendChance, offset, m_Duration);
                        att.Name = String.Format("[Prayer] {0} Offset", m_Effect);
                        XmlAttach.AttachTo(target, att);
                        return true;
                    }
                default: return false;
            }
        }
Example #11
0
        public static void WipeMods(Mobile m)
        {
            PlayerMobile pm = m as PlayerMobile;

            m.DisruptiveAction();

            foreach (StatType Stat in Enum.GetValues(typeof(StatType)))
            {
                string name = String.Format("[Magic] {0} Offset", Stat);
                if (m.GetStatMod(name) != null)
                    m.RemoveStatMod(name);
            }

            if (TransformationSpellHelper.UnderTransformation(m))
                TransformationSpellHelper.RemoveContext(m, true);

            m.HueMod = -1;
            m.NameMod = null;

            PolymorphSpell.StopTimer(m);
            IncognitoSpell.StopTimer(m);
            DisguiseGump.StopTimer(m);

            foreach (Type T in DispelActions)
                m.EndAction(T);

            m.BodyMod = 0;
            m.HueMod = -1;

            if (pm != null)
            {
                if (pm.BuffTable != null)
                {
                    List<BuffInfo> list = new List<BuffInfo>();

                    foreach (BuffInfo buff in pm.BuffTable.Values)
                    {
                        if (!buff.RetainThroughDeath)
                        {
                            list.Add(buff);
                        }
                    }

                    for (int i = 0; i < list.Count; i++)
                    {
                        pm.RemoveBuff(list[i]);
                    }
                }

                pm.SavagePaintExpiration = TimeSpan.Zero;
                pm.SetHairMods(-1, -1);

                pm.ResendBuffs();

            }

            m.VirtualArmorMod = 0;

            BaseArmor.ValidateMobile(m);
            BaseClothing.ValidateMobile(m);
        }
Example #12
0
        public override void OnGaveMeleeAttack( Mobile defender )
        {
            base.OnGaveMeleeAttack( defender );

            if ( 0.2 > Utility.RandomDouble() )
            {
                if ( defender.GetStatMod( "Niporailem Str Curse" ) == null )
                    defender.AddStatMod( new StatMod( StatType.Str, "Niporailem Str Curse", -30, TimeSpan.FromSeconds( 15.0 ) ) );
            }
        }
Example #13
0
        public static bool HasStatEffect( Mobile target, StatType type )
        {
            if ( type == StatType.All )
            {
                return HasStatEffect( target, StatType.Dex ) && HasStatEffect( target, StatType.Int ) && HasStatEffect( target, StatType.Str ) ;
            }
            else
            {
                StatMod mod = target.GetStatMod( String.Format( "[Magic] {0} Offset", type ) );

                return mod != null;
            }
        }
Example #14
0
        public static void RemoveCurses( Mobile m )
        {
            // play the sound
            m.PlaySound( 0xF6 );
            m.PlaySound( 0x1F7 );

            // do the effects
            m.FixedParticles( 0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head );

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

            // remove stat mods
            StatMod mod;

            foreach ( string statModName in StatModNames )
            {
                mod = m.GetStatMod( statModName );
                if ( mod != null && mod.Offset < 0 )
                    m.RemoveStatMod( statModName );
            }

            m.Paralyzed = false;

            EvilOmenSpell.CheckEffect( m );
            StrangleSpell.RemoveCurse( m );
            CorpseSkinSpell.RemoveCurse( m );
            CurseSpell.RemoveEffect( m );
            MortalStrike.EndWound( m );
            BloodOathSpell.EndEffect( m );
            SpellPlagueSpell.RemoveEffect( m );
            SleepSpell.RemoveEffect( m );
            MindRotSpell.ClearMindRotScalar( 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.Curse );
            BuffInfo.RemoveBuff( m, BuffIcon.EvilOmen );
            BuffInfo.RemoveBuff( m, BuffIcon.MortalStrike );
            BuffInfo.RemoveBuff( m, BuffIcon.Sleep );
            BuffInfo.RemoveBuff( m, BuffIcon.MassSleep );
            BuffInfo.RemoveBuff( m, BuffIcon.Mindrot );
        }
Example #15
0
        /// <summary>
        /// Fully refreshes the targetted player.
        /// Prevents any type of pre-casting or other advantages.
        /// </summary>
        /// <param name="targ"> The target to be refreshed</param>
        private void Refresh(Mobile targ)
        {
            try
            {
                targ.Mana = targ.ManaMax;
                targ.Hits = targ.HitsMax;
                targ.Stam = targ.StamMax;
                targ.Poison = null;

                targ.Say("*Refreshed!*");
                targ.Say("*Debuffed!*");

                Server.Targeting.Target.Cancel(targ);

                if (targ.MeleeDamageAbsorb > 0)
                {
                    targ.MeleeDamageAbsorb = 0;

                    //targ.EndAction(typeof(RechargeSpell));
                    //ReactiveArmorSpell.EndArmor(targ);

                    targ.SendMessage("Reactive armor has been nullified.");
                }

                if (targ.MagicDamageAbsorb > 0)
                {
                    targ.MagicDamageAbsorb = 0;
                    targ.SendMessage("Magic Reflection has been nullified.");
                }

                StatMod mod;
                mod = targ.GetStatMod("[Magic] Str Offset");
                if (mod != null)
                    targ.RemoveStatMod("[Magic] Str Offset");

                mod = targ.GetStatMod("[Magic] Dex Offset");
                if (mod != null)
                    targ.RemoveStatMod("[Magic] Dex Offset");

                mod = targ.GetStatMod("[Magic] Int Offset");
                if (mod != null)
                    targ.RemoveStatMod("[Magic] Int Offset");

                targ.Paralyzed = false;

                BuffInfo.RemoveBuff(targ, BuffIcon.Clumsy);
                BuffInfo.RemoveBuff(targ, BuffIcon.FeebleMind);
                BuffInfo.RemoveBuff(targ, BuffIcon.Weaken);
                BuffInfo.RemoveBuff(targ, BuffIcon.MassCurse);
                BuffInfo.RemoveBuff(targ, BuffIcon.Agility);
                BuffInfo.RemoveBuff(targ, BuffIcon.Cunning);
                BuffInfo.RemoveBuff(targ, BuffIcon.Strength);
                BuffInfo.RemoveBuff(targ, BuffIcon.Bless);
            }
            catch (Exception e)
            {
                Console.WriteLine("Error : " + e.Message);
                Console.WriteLine("Location : " + e.InnerException);
            }
        }
Example #16
0
		public int GetStatMod( Mobile mob, StatType type )
		{
			StatMod mod = mob.GetStatMod( String.Format( "[Magic] {0} Offset", type ) );

			if ( mod == null )
				return 0;

			return mod.Offset;
		}
Example #17
0
		public bool AddStatBonus(Mobile target, int offset, StatType type, TimeSpan duration)
		{
			if (target == null)
				return false;

			string name = String.Format("[Magic] {0} Offset:item-{1}", type, this.Serial);
			string itemtypename = String.Format("[Magic] {0} Offset:item-", type);

			StatMod mod = target.GetStatMod( name );

			for (int i = 0; i < target.StatMods.Count; i++)
			{
				StatMod sm = target.StatMods[i] as StatMod;
				if (sm != null)
				{
					if (sm.Name.IndexOf(itemtypename) == 0)
					{
						//found this item statmod type already - don't apply
						return false;
					}
				}
			}

			// If they have a negative effect on them, replace the effect with
			// the negative effect plus the new positive effect
			if ( mod != null && mod.Offset < 0 )
			{
				target.AddStatMod( new StatMod( type, name, mod.Offset + offset, duration ) );
				return true;
			}
			// If they have no effect or the current effect is weaker than the new effect
			// Apply the new effect
			else if ( mod == null || mod.Offset < offset )
			{
				target.AddStatMod( new StatMod( type, name, offset, duration ) );
				return true;
			}
			// They already have an effect equal to or greater than the new effect
			// do nothing.
			return false;
		}
Example #18
0
 public static bool IsAnemic( Mobile m )
 {
     return m.GetStatMod( "[Bloodworm] Str Malus" ) != null;
 }
Example #19
0
		public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
		{
			base.OnHit( attacker, defender, damageBonus );

			if ((attacker.Player || attacker.Body.IsHuman) && !attacker.IsT2A && Layer == Layer.TwoHanded
                && (attacker.Skills[SkillName.Anatomy].Value / 100.0 * SpecialMovesController._ConcussionPoleArmMaxChance) >= Utility.RandomDouble()
                && Engines.ConPVP.DuelContext.AllowSpecialAbility( attacker, "Concussion Blow", false ) )
			{
				StatMod mod = defender.GetStatMod( "Concussion" );

				if ( mod == null )
				{
					defender.SendLocalizedMessage( 1060165 ); // You have delivered a concussion!
					defender.AddStatMod( new StatMod( StatType.Int, "Concussion", -(defender.RawInt / 2), TimeSpan.FromSeconds( SpecialMovesController._ConcussionDurationSeconds ) ) );

					attacker.SendLocalizedMessage( 1060165 ); // You have delivered a concussion!
					attacker.PlaySound( 0x11C );
				}
			}
		}
Example #20
0
		public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
		{
			base.OnHit( attacker, defender, damageBonus );

			if (!Core.AOS && (attacker.Player || attacker.Body.IsHuman) && Layer == Layer.TwoHanded && attacker.Skills[SkillName.Anatomy].Value >= 80 && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() && Engines.ConPVP.DuelContext.AllowSpecialAbility(attacker, "Concussion Blow", false))
			{
				StatMod mod = defender.GetStatMod( "Concussion" );

				if ( mod == null )
				{
					defender.SendMessage( "You receive a concussion blow!" );
					defender.AddStatMod( new StatMod( StatType.Int, "Concussion", -(defender.RawInt / 2), TimeSpan.FromSeconds( 30.0 ) ) );

					attacker.SendMessage( "You deliver a concussion blow!" );
					attacker.PlaySound( 0x11C );
				}
			}
		}
Example #21
0
		public void ApplyStatBonuses(Mobile wearer, StatType stat)
		{
			// BE CAREFUL! This function is an event handler for Mobile.StatChange. AddStatMod invokes StatChange - ie, the potential here for an
			// infinite recursion loop is VERY real. Make sure that you do not make stats interdependant on bonuses!!!
			// ie when calculating DexBonus, you can use Str or Int but using Dex will cause a loop.
			// using Str in calc'ing DexBonus and ALSO using Dex in calc'ing StrBonus will also cause a loop.
			// See examples.
			wearer.CheckStatTimers();

			string modName = this.Serial.ToString();

			/* EXAMPLES
			 * 
			 * if ((stat & StatType.Dex) != 0)
			 * {
			 *	   Here I can add statmods for Str and Int but not Dex.
			 * }
			 * if ((stat & StatType.Int) != 0 && (stat & StatType.Str) != 0)
			 * {
			 *     Here I can only add statmods for Dex, because the calculation is using Int and Str
			 * }
			 */
			
			if ((stat & StatType.Str) != 0) // since we're handling Str, we're not allowed to modify it
			{
				double dexBonus = ComputeStatBonus( StatType.Dex, wearer );
				if (dexBonus != 0  && (wearer.GetStatMod(modName + "Dex") == null || wearer.GetStatMod(modName + "Dex").Offset != dexBonus))
					wearer.AddStatMod( new StatMod( StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero ) );
				if (dexBonus == 0)
					wearer.RemoveStatMod(modName + "Dex");
			}
		}
		public override void OnHit( Mobile attacker, Mobile defender )
		{
			base.OnHit( attacker, defender );

			if ( !Core.AOS && (attacker.Player || attacker.Body.IsHuman) && Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() )
			{
				StatMod mod = defender.GetStatMod( "Concussion" );

				if ( mod == null )
				{
					defender.SendMessage( "You receive a concussion blow!" );
					defender.AddStatMod( new StatMod( StatType.Int, "Concussion", -(defender.RawInt / 2), TimeSpan.FromSeconds( 30.0 ) ) );

					attacker.SendMessage( "You deliver a concussion blow!" );
					attacker.PlaySound( 0x308 );
				}
			}
		}
Example #23
0
        private void RemoveCurses( Mobile m )
        {
            StatMod mod;

            foreach ( string statModName in StatModNames )
            {
                mod = m.GetStatMod( statModName );
                if ( mod != null && mod.Offset < 0 )
                    m.RemoveStatMod( statModName );
            }

            m.Paralyzed = false;

            EvilOmenSpell.CheckEffect( m );
            StrangleSpell.RemoveCurse( m );
            CorpseSkinSpell.RemoveCurse( m );
            CurseSpell.RemoveEffect( m );
            MortalStrike.EndWound( m );
            BloodOathSpell.EndEffect( m );
            SpellPlagueSpell.RemoveEffect( m );
            SleepSpell.RemoveEffect( m );
            MindRotSpell.ClearMindRotScalar( 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.Curse );
            BuffInfo.RemoveBuff( m, BuffIcon.EvilOmen );
            BuffInfo.RemoveBuff( m, BuffIcon.MortalStrike );
            BuffInfo.RemoveBuff( m, BuffIcon.Sleep );
            BuffInfo.RemoveBuff( m, BuffIcon.MassSleep );
            BuffInfo.RemoveBuff( m, BuffIcon.Mindrot );
        }
Example #24
0
        public static void LowerStat(Mobile target, int minloss, int maxloss, int mintime, int maxtime, int type)
        {
            if (target.GetStatMod("LowerStats") != null)
                return;

            var stattype = StatType.Str;
            var offset = Utility.Random(minloss, maxloss);

            if (type <= 0 || type >= 4)
                type = Utility.RandomMinMax(1, 3);

            switch (type)
            {
                case 1:
                    stattype = StatType.Str;
                    break;
                case 2:
                    stattype = StatType.Dex;
                    break;
                case 3:
                    stattype = StatType.Int;
                    break;
            }

            target.AddStatMod(new StatMod(stattype, "LowerStats", -offset,
                TimeSpan.FromSeconds(Utility.Random(mintime, maxtime))));
        }
		public override void SpellEffect( Mobile target )
		{
			if ( Caster.Backpack == null || !(Caster.Backpack is Container) )
			{
				Caster.SendMessage( "You need a backpack to use this spell." );
				return;
			}

			if ( AosAttributes.GetValue( Caster, AosAttribute.LowerRegCost ) < 100 ) // Nothing less than 100% will do
			{
				Item item = Caster.Backpack.FindItemByType( typeof( RefreshPotion ) );

				if ( item == null )
				{
					Caster.SendMessage( "You do not have enough Refresh Potions" );
					return;
				}

				item = Caster.Backpack.FindItemByType( typeof( LesserHealPotion ) );

				if ( item == null )
				{
					Caster.SendMessage( "You do not have enough Heal Potions" );
					return;
				}

				item = Caster.Backpack.FindItemByType( typeof( LesserCurePotion ) );

				if ( item == null )
				{
					Caster.SendMessage( "You do not have enough Cure Potions" );
					return;
				}

				// We just checked for the items.
				Caster.Backpack.ConsumeTotal( typeof( RefreshPotion ), 1 );
				Caster.Backpack.ConsumeTotal( typeof( LesserHealPotion ), 1 );
				Caster.Backpack.ConsumeTotal( typeof( LesserCurePotion ), 1 );
			}

			StatMod mod;

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

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

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

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

			target.Paralyzed = false;

			 // Don't cure others of Lethal Poison
			if ( target.Poison != Poison.Lethal || target == Caster )
				target.CurePoison( Caster );

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

			// Cure Status aliments (is the system being used?)
			BlindSpell.EndBlind( target );
			SilenceSpell.EndSilence( target );
			SlowSpell.EndSlow( target );
			StillSpell.EndStill( target );

			Effects.SendLocationParticles(
				EffectItem.Create( new Point3D( target.X, target.Y, target.Z ), target.Map, EffectItem.DefaultDuration ),
				0x376A, 9, 32, 5020 );

			// Play a random eating sound
			target.PlaySound( Utility.Random( 0x3A, 3 ) );

			int bonus = AosAttributes.GetValue( Caster, AosAttribute.EnhancePotions ) / 2;

			if ( bonus > 20 )
				bonus = 20;

			target.Hits += bonus;
			target.Stam += bonus;

			target.SendMessage( "You have been cured of all ailments" );
			Caster.SendMessage( "You have cured " + target.Name + " of all alignments." );

			// It is a party effect, no way to ever get hit by it.
			// BlueMageControl.CheckKnown( target, this, CanTeach( target ) );
		}