Example #1
0
		public override bool OnEquip( Mobile m )
		{
			base.OnEquip( m );
			m_SkillMod1 = new DefaultSkillMod( SkillName.Archery, true, 10 );
			m.AddSkillMod(m_SkillMod1 );
			m_SkillMod2 = new DefaultSkillMod( SkillName.Tactics, true, 10 );
			m.AddSkillMod(m_SkillMod2 );
			m_SkillMod3 = new DefaultSkillMod( SkillName.Anatomy, true, 10 );
			m.AddSkillMod(m_SkillMod3 );
			return true;
			
			/// <summary>
	 	/// i with to make a gm clothing packet for my gm's ingame
	 	/// </summary>
	 	
	 	if ( m.AccessLevel <= AccessLevel.GameMaster )
		    {
	 			m.SendMessage( "You are not granted to wear this item" );
		    	this.Delete();
		    	return false;
	 		}
	 		else
	 		{
	 			m.SendMessage( "Access Granted mighty one" );
	 			return true;
	 		}
	 				
		}
		private void SetMods( Mobile wearer )
		{			
			wearer.AddSkillMod( m_SkillMod0 ); 
			wearer.AddSkillMod( m_SkillMod1 ); 
			wearer.AddSkillMod( m_SkillMod2 ); 
			wearer.AddStatMod( m_StatMod0 ); 
		}
Example #3
0
		public void AddMods( Mobile from )
		{
			if ( m_SkillMod0 == null )
				m_SkillMod0 = new DefaultSkillMod( SkillName.EvalInt, true, 100 );

			if ( m_SkillMod1 == null )
				m_SkillMod1 = new DefaultSkillMod( SkillName.Tactics, true, 100 );

			from.AddSkillMod( m_SkillMod0 );
			from.AddSkillMod( m_SkillMod1 );
		}
		public override bool OnEquip( Mobile m )
		{
			base.OnEquip( m );
			m_SkillMod = new DefaultSkillMod( SkillName.Fishing, true, 60 ); 
			m.AddSkillMod(m_SkillMod );
			return true;
		}
		// Karmic Strike
		// The attack is automatically a critical threat, but then next strike on you 
		// for 3 seconds will also be a critical. Unknown if Fortification applies. 
		public static void DarkFireCombo( Mobile from, Mobile target, ref int damage )
		{
			from.SendMessage( 2075, "You execute the maneuver: Karmic Strike" );
			damage = (int)(damage * 1.5 );

			object[] objs =
			{
				AosWeaponAttribute.ResistPhysicalBonus, -100,
				AosWeaponAttribute.ResistFireBonus, -100,
				AosWeaponAttribute.ResistColdBonus, -100,
				AosWeaponAttribute.ResistPoisonBonus, -100,
				AosWeaponAttribute.ResistEnergyBonus, -100
			};

			new EnhancementTimer( from, 5, "monk", objs ).Start();
			from.AddSkillMod( new TimedSkillMod( SkillName.MagicResist, true, -100, TimeSpan.FromSeconds( 5 ) ) );
			target.SendMessage( 2075, "Your opponent's blow hits a vital area maximizing their damage but leaves them wide open." );
			target.PlaySound( 0x234 );
		}
		public override void OnDoubleClick( Mobile mob )
		{
			SkillGainContext context = (SkillGainContext)m_SkillGain[mob];

			if ( context != null )
				return;

			context = new SkillGainContext();
			m_SkillGain[mob] = context;

			ArrayList mods = context.m_Mods = new ArrayList();

			for ( int i = 0; i < mob.Skills.Length; ++i )
			{
				Skill sk = mob.Skills[i];
				double baseValue = sk.Base;
				
				if ( mob.InRange( this.GetWorldLocation(), 2 ) )
				{
					Container pack = mob.Backpack;
					int m_Amount = mob.Backpack.GetAmount( typeof( BabyPowder ) );
					
					if ( pack != null && pack.ConsumeTotal( typeof( BabyPowder ), m_Amount) )
					{	
						if( m_Amount != 1 )
						{
							mob.AddToBackpack( new BabyPowder( m_Amount-1 ));
						}
						
						
						if ( baseValue > 0 )
						{
						SkillMod mod = new DefaultSkillMod( SkillName.Fencing, true, +(baseValue * SkillGainFactor) );
						SkillMod mod1 = new DefaultSkillMod( SkillName.Parry, true, +(baseValue * SkillGainFactor) );
						SkillMod mod2 = new DefaultSkillMod( SkillName.Swords, true, +(baseValue * SkillGainFactor) );
						SkillMod mod3 = new DefaultSkillMod( SkillName.Archery, true, +(baseValue * SkillGainFactor) );
						SkillMod mod4 = new DefaultSkillMod( SkillName.Macing, true, +(baseValue * SkillGainFactor) );
						SkillMod mod5 = new DefaultSkillMod( SkillName.Tactics, true, +(baseValue * SkillGainFactor) );
						SkillMod mod6 = new DefaultSkillMod( SkillName.Wrestling, true, +(baseValue * SkillGainFactor) );

						mods.Add( mod );
						mods.Add( mod1 );
						mods.Add( mod2 );
						mods.Add( mod3 );
						mods.Add( mod4 );
						mods.Add( mod5 );
						mods.Add( mod6 );
						mob.AddSkillMod( mod );
						mob.AddSkillMod( mod1 );
						mob.AddSkillMod( mod2 );
						mob.AddSkillMod( mod3 );
						mob.AddSkillMod( mod4 );
						mob.AddSkillMod( mod5 );
						mob.AddSkillMod( mod6 );
						
						mob.SendMessage("You sprinkle some baby powder on your body and it makes your skin more resistant in combat.");
						}
						else
						{
						mob.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
						}
						}
				}
			}

			context.m_Timer = Timer.DelayCall( SkillGainPeriod, new TimerStateCallback( ClearSkillGain_Callback ), mob );
		}
Example #7
0
		public override void OnTrigger(object activator, Mobile m)
		{
			if(m == null || (RequireIdentification && !m_Identified)) return;

			if((AttachedTo is BaseArmor || AttachedTo is BaseWeapon) && (((Item)AttachedTo).Layer != Layer.Invalid))
			{
				// when activated via speech will apply mod when equipped by the speaker
				SkillMod sm = new EquippedSkillMod( m_Skill, true, m_Value, (Item)AttachedTo, m );
				m.AddSkillMod( sm );
				// and then remove the attachment
				Delete();
			} 
			else
			{
				// when activated it will apply the skill mod that will last for the specified duration
				SkillMod sm = new TimedSkillMod( m_Skill, true, m_Value, m_Duration );
				m.AddSkillMod( sm );
				// and then remove the attachment
				Delete();
			}
		}
Example #8
0
        public static void ApplySkillLoss( Mobile mob )
        {
            SkillLossContext context = (SkillLossContext) m_SkillLoss[mob];

            if ( context != null )
                return;

            context = new SkillLossContext();
            m_SkillLoss[mob] = context;

            ArrayList mods = context.m_Mods = new ArrayList();

            for ( int i = 0; i < mob.Skills.Length; ++i )
            {
                Skill sk = mob.Skills[i];
                double baseValue = sk.Base;

                if ( baseValue > 0 )
                {
                    SkillMod mod = new DefaultSkillMod( sk.SkillName, true, -( baseValue * SkillLossFactor ) );

                    mods.Add( mod );
                    mob.AddSkillMod( mod );
                }
            }

            context.m_Timer = Timer.DelayCall( SkillLossPeriod, new TimerStateCallback( ClearSkillLoss_Callback ), mob );

            // Stat Loss / All of your skills have been reduced by one third.
            mob.AddBuff( new BuffInfo( BuffIcon.FactionStatLoss, 1153800, 1153826, SkillLossPeriod, mob, true ) );
        }
        public void Discord(Mobile target)
        {
            if (Utility.RandomDouble() < 0.9)
            {
                target.AddSkillMod(new TimedSkillMod(SkillName.Fencing, true, Combatant.Skills.Fencing.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Wrestling, true, Combatant.Skills.Wrestling.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Tactics, true, Combatant.Skills.Tactics.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Swords, true, Combatant.Skills.Swords.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Macing, true, Combatant.Skills.Macing.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Focus, true, Combatant.Skills.Focus.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Archery, true, Combatant.Skills.Archery.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Magery, true, Combatant.Skills.Magery.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));

                Timer.DelayCall(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1), (int)DiscordDuration, new TimerStateCallback(Animate), target);

                target.SendLocalizedMessage(1072061); // You hear jarring music, suppressing your strength.
                target.PlaySound(0x58B);
            }
            else
            {
                target.SendLocalizedMessage(1072064); // You hear jarring music, but it fails to disrupt you.
                target.PlaySound(0x58C);
            }

            m_NextDiscordTime = DateTime.Now + TimeSpan.FromSeconds(DiscordMinDelay + Utility.RandomDouble() * DiscordMaxDelay);
        }
        public void Discord(Mobile target)
        {
            if (Utility.RandomDouble() < 0.9)
            {
                target.AddSkillMod(new TimedSkillMod(SkillName.Magery, true, Combatant.Skills.Magery.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Necromancy, true, Combatant.Skills.Necromancy.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Tactics, true, Combatant.Skills.Tactics.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Swords, true, Combatant.Skills.Swords.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Meditation, true, Combatant.Skills.Meditation.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Focus, true, Combatant.Skills.Focus.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Chivalry, true, Combatant.Skills.Chivalry.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Wrestling, true, Combatant.Skills.Wrestling.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Spellweaving, true, Combatant.Skills.Spellweaving.Base * DiscordModifier * -1, TimeSpan.FromSeconds(DiscordDuration)));


                Timer.DelayCall(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1), (int)DiscordDuration, new TimerStateCallback(Animate), target);

                target.SendMessage("The Lich's touch weakens all of your fighting skills!");
                target.PlaySound(0x458);////
            }
            else
            {
                target.SendMessage("The Lich barely misses touching you, saving you from harm!"); 
                target.PlaySound(0x458);/////
            }

            m_NextDiscordTime = DateTime.Now + TimeSpan.FromSeconds(DiscordMinDelay + Utility.RandomDouble() * DiscordMaxDelay);
        }
Example #11
0
        public static void ApplySkillLoss( Mobile mob )
        {
            SkillLossContext context = (SkillLossContext)m_SkillLoss[mob];

            if ( context != null )
                return;

            context = new SkillLossContext();
            m_SkillLoss[mob] = context;

            ArrayList mods = context.m_Mods = new ArrayList();

            int ShortsLost = mob.ShortTermMurders/2;
            double SkillLossFactor = Math.Min(ShortsLost*0.01,0.5); //1 percent per short. Max 50%.
            TimeSpan SkillLossPeriod = TimeSpan.FromMinutes(10 + Math.Min(50, ShortsLost)); //10 to 60 minutes.
            //mob.ShortTermMurders -= ShortsLost; //Lose half your shorts. Disable till title system set up.

            for ( int i = 0; i < mob.Skills.Length; ++i )
            {
                Skill sk = mob.Skills[i];
                double baseValue = sk.Base;

                if ( baseValue > 0 )
                {
                    SkillMod mod = new DefaultSkillMod( sk.SkillName, true, -(baseValue * SkillLossFactor) );

                    mods.Add( mod );
                    mob.AddSkillMod( mod );
                }
            }

            mob.SendMessage(String.Format("You have lost {0}% of your skill for {1} minutes for being a criminal.", (int)(SkillLossFactor*100), 10 + Math.Min(50, ShortsLost)));

            context.m_Timer = Timer.DelayCall( SkillLossPeriod, new TimerStateCallback( ClearSkillLoss_Callback ), mob );
        }
Example #12
0
        public override void OnDoubleClick( Mobile from )
        {
            if ( IsLockedDown )
            {
                if ( !from.InRange( this.Location, 2 ) )
                {
                    from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
                    return;
                }

                IHouse house = HousingHelper.FindHouseAt( from );

                if ( house != null )
                {
                    from.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1071131 ); // Praying…

                    if ( m_CooldownList.Contains( from ) )
                    {
                        from.SendLocalizedMessage( 1071145 ); // In order to summon an undead again, you have to wait for at least 90 minutes.
                    }
                    else
                    {
                        Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerCallback(
                            delegate
                            {
                                // Add the skill mod
                                SkillMod mod = new DefaultSkillMod( SkillName.SpiritSpeak, true, 5.0 );
                                mod.ObeyCap = true;
                                from.AddSkillMod( mod );
                                m_Table[from] = new BonusContext( Timer.DelayCall( Duration, new TimerStateCallback<Mobile>( RemoveEffect ), from ), mod );

                                // Set the cooldown
                                m_CooldownList.Add( from );
                                Timer.DelayCall( Cooldown, new TimerCallback( delegate { m_CooldownList.Remove( from ); } ) );

                                // Spawn our undead friend :)
                                SummonUndead( from );

                                from.SendLocalizedMessage( 1071148 ); // You feel a greater sense.
                            } ) );
                    }
                }
                else
                    from.SendLocalizedMessage( 502436 ); // That is not accessible.
            }
            else
                from.SendLocalizedMessage( 502692 ); // This must be in a house and be locked down to work.
        }
Example #13
0
        public virtual bool Apply(Mobile from)
        {
            if (TryAddBuff(from, Effect))
            {
                switch (Effect)
                {
                    default:
                    case FishPieEffect.None: break;
                    case FishPieEffect.MedBoost:
                        TimedSkillMod mod1 = new TimedSkillMod(SkillName.Meditation, true, 10.0, Duration);
                        mod1.ObeyCap = true;
                        from.AddSkillMod(mod1);
                        break;
                    case FishPieEffect.FocusBoost:
                        TimedSkillMod mod2 = new TimedSkillMod(SkillName.Focus, true, 10.0, Duration);
                        mod2.ObeyCap = true;
                        from.AddSkillMod(mod2);
                        break;
                    case FishPieEffect.ColdSoak: break;
                    case FishPieEffect.EnergySoak: break;
                    case FishPieEffect.PoisonSoak: break;
                    case FishPieEffect.FireSoak: break;
                    case FishPieEffect.PhysicalSoak: break;
                    case FishPieEffect.WeaponDam: break;
                    case FishPieEffect.HitChance: break;
                    case FishPieEffect.DefChance: break;
                    case FishPieEffect.SpellDamage: break;
                    case FishPieEffect.ManaRegen: break;
                    case FishPieEffect.StamRegen: break;
                    case FishPieEffect.HitsRegen: break;
                    case FishPieEffect.SoulCharge: break;
                    case FishPieEffect.CastFocus: break;
                }

                if (Effect != FishPieEffect.None)
                {
                    new InternalTimer(Duration, from, Effect);

                    BuffInfo.AddBuff(from, new BuffInfo(BuffIcon.FishPie, 1116340, LabelNumber));
                }

                return true;
            }
            else
                from.SendLocalizedMessage(502173); // You are already under a similar effect.
            return false;
        }
Example #14
0
		public void AddTo( Mobile m )
		{
			Remove();

			for( int i = 0; i < 5; ++i )
			{
				SkillName skill;
				double bonus;

				if( !GetValues( i, out skill, out bonus ) )
					continue;

				if( m_Mods == null )
					m_Mods = new List<SkillMod>();

				SkillMod sk = new DefaultSkillMod( skill, true, bonus );
				sk.ObeyCap = true;
				m.AddSkillMod( sk );
				m_Mods.Add( sk );
			}
		}
Example #15
0
		public static void ApplySkillLoss( Mobile mob )
		{
			PlayerMobile Killer = mob as PlayerMobile;
			if ( mob.ShortTermMurders >= 5 && Killer.MurderBounty <= 0)
			{
				double loss = (100.0 - (19.0 + (mob.ShortTermMurders / 5.0))) / 100.0; // 20 to 30% loss

				if( loss < 0.75 )
					loss = 0.60;// changed to .80 from .95
				else if( loss > 0.95 )
					loss = 0.60; // changed to .80 from /95

				TimeSpan lossperiod = TimeSpan.FromMinutes( 240.0 );

				loss = 1.0 - loss;

				ClearSkillLoss( mob );

				SkillLossContext context = new SkillLossContext();
				m_SkillLoss[mob] = context;

				List<SkillMod> mods = context.m_SkillMods = new List<SkillMod>();

				for ( int i = 0; i < mob.Skills.Length; ++i )
				{
					Skill sk = mob.Skills[i];
					double baseValue = sk.Base;

					if ( baseValue > 0 )
					{
						SkillMod mod = new DefaultSkillMod( sk.SkillName, true, -(baseValue * loss) );

						mods.Add( mod );
						mob.AddSkillMod( mod );
					}
				}

				mob.AddStatMod( new StatMod( StatType.Str, "Murder Penalty Str", -(int)(mob.RawStr * loss), lossperiod ) );
				mob.AddStatMod( new StatMod( StatType.Dex, "Murder Penalty Dex", -(int)(mob.RawDex * loss), lossperiod ) );
				mob.AddStatMod( new StatMod( StatType.Int, "Murder Penalty Int", -(int)(mob.RawInt * loss), lossperiod ) );

				context.m_Timer = Timer.DelayCall<Mobile>( lossperiod, new TimerStateCallback<Mobile>( ClearSkillLoss_Callback ), mob );
			}
			else  ///Removed short term statloss. 
			if ( mob.ShortTermMurders < 5 && Killer.MurderBounty > 0 )
			{
				double loss = (100.0 - (19.0 + (Killer.MurderBounty / 10000.0))) / 100.0; // 20 to 30% loss
				if( loss < 0.75 )
					loss = 0.60;// changed to .80 from .95
				else if( loss > 0.95 )
					loss = 0.60; // changed to .80 from /95
				mob.SendMessage( "Current MurderBounty: " + Killer.MurderBounty);
				double timeloss = (double)Killer.MurderBounty/33.3;
				TimeSpan lossperiod = TimeSpan.FromMinutes( timeloss );
				
				int m = (int)Math.Round( timeloss );
				mob.SendMessage( "You have entered a bounty statloss for: " + m + " minutes.");

				loss = 1.0 - loss;

				ClearSkillLoss( mob );

				SkillLossContext context = new SkillLossContext();
				m_SkillLoss[mob] = context;

				List<SkillMod> mods = context.m_SkillMods = new List<SkillMod>();

				for ( int i = 0; i < mob.Skills.Length; ++i )
				{
					Skill sk = mob.Skills[i];
					double baseValue = sk.Base;

					if ( baseValue > 0 )
					{
						SkillMod mod = new DefaultSkillMod( sk.SkillName, true, -(baseValue * loss) );

						mods.Add( mod );
						mob.AddSkillMod( mod );
					}
				}

				mob.AddStatMod( new StatMod( StatType.Str, "Murder Penalty Str", -(int)(mob.RawStr * loss), lossperiod ) );
				mob.AddStatMod( new StatMod( StatType.Dex, "Murder Penalty Dex", -(int)(mob.RawDex * loss), lossperiod ) );
				mob.AddStatMod( new StatMod( StatType.Int, "Murder Penalty Int", -(int)(mob.RawInt * loss), lossperiod ) );

				context.m_Timer = Timer.DelayCall<Mobile>( lossperiod, new TimerStateCallback<Mobile>( ClearSkillLoss_Callback ), mob );
			}
			else if ( mob.ShortTermMurders >= 5 && Killer.MurderBounty > 0 )
			{
				double loss = (100.0 - (19.0 + (mob.ShortTermMurders / 5.0))) / 100.0; // 20 to 30% loss
				if( loss < 0.75 )
					loss = 0.60;// changed to .80 from .95
				else if( loss > 0.95 )
					loss = 0.60; // changed to .80 from /95
				mob.SendMessage( "Current MurderBounty: " + Killer.MurderBounty);
				double timeloss = (double)Killer.MurderBounty/33.3;
				TimeSpan lossperiod = TimeSpan.FromMinutes( timeloss + 240.0);
				
				Killer.MurderBounty = 0;
				
				int m = (int)Math.Round( timeloss + 240.0);
				mob.SendMessage( "You have entered statloss for: " + m + " minutes.");

				loss = 1.0 - loss;

				ClearSkillLoss( mob );

				SkillLossContext context = new SkillLossContext();
				m_SkillLoss[mob] = context;

				List<SkillMod> mods = context.m_SkillMods = new List<SkillMod>();

				for ( int i = 0; i < mob.Skills.Length; ++i )
				{
					Skill sk = mob.Skills[i];
					double baseValue = sk.Base;

					if ( baseValue > 0 )
					{
						SkillMod mod = new DefaultSkillMod( sk.SkillName, true, -(baseValue * loss) );

						mods.Add( mod );
						mob.AddSkillMod( mod );
					}
				}

				mob.AddStatMod( new StatMod( StatType.Str, "Murder Penalty Str", -(int)(mob.RawStr * loss), lossperiod ) );
				mob.AddStatMod( new StatMod( StatType.Dex, "Murder Penalty Dex", -(int)(mob.RawDex * loss), lossperiod ) );
				mob.AddStatMod( new StatMod( StatType.Int, "Murder Penalty Int", -(int)(mob.RawInt * loss), lossperiod ) );

				context.m_Timer = Timer.DelayCall<Mobile>( lossperiod, new TimerStateCallback<Mobile>( ClearSkillLoss_Callback ), mob );
			}
		}
Example #16
0
            public InternalTimer(Mobile owner, int body, Souless m_Fake, AncientPeerSpell spell)
                : base(TimeSpan.FromSeconds(0))
            {
                m_Owner = owner;
                m_OldBody = body;
                fake = m_Fake;
                m_spell = spell;

                int val = (int)owner.Skills[SkillName.Magery].Value;

                if (val > 100)
                    val = 100;
                double loss2 = (0 - m_Owner.Skills[SkillName.Magery].Base);
                SkillMod sk2 = new DefaultSkillMod(SkillName.Magery, true, loss2);
                m_Owner.AddSkillMod(sk2);
                m_spell.m_PeerMod.Add(sk2);

                Delay = TimeSpan.FromSeconds(val);
                Priority = TimerPriority.TwoFiftyMS;
            }
        public static void ApplySkillLoss( Mobile mob )
        {
            SkillLossContext context;
            m_SkillLoss.TryGetValue( mob, out context );

            if ( context == null )
            {
                context = new SkillLossContext();
                m_SkillLoss[mob] = context;

                List<SkillMod> mods = context.m_Mods = new List<SkillMod>();

                for ( int i = 0; i < mob.Skills.Length; ++i )
                {
                    Skill sk = mob.Skills[i];
                    double baseValue = sk.Base;

                    if ( baseValue > 0 )
                    {
                        SkillMod mod = new DefaultSkillMod( sk.SkillName, true, -(baseValue * SkillLossFactor) );

                        mods.Add( mod );
                        mob.AddSkillMod( mod );
                    }
                }

                // Added by Silver: Skill Loss Reduction
                Faction faction = Faction.Find( mob );
                int towns = faction.OwnedTowns;

                TimeSpan lossReduction = TimeSpan.FromMinutes( 0.25 - ( 0.025 * towns ) );

                //PlayerState ps = PlayerState.Find( mob );

                context.m_Timer = Timer.DelayCall( SkillLossPeriod - lossReduction, new TimerStateCallback( ClearSkillLoss_Callback ), mob );
            }
        }
Example #18
0
		public static void ApplySkillLoss( Mobile mob )
		{
			SkillLossContext context = (SkillLossContext)m_SkillLoss[mob];

			if ( context != null )
				return;

			context = new SkillLossContext();
			m_SkillLoss[mob] = context;

			ArrayList mods = context.m_Mods = new ArrayList();

			for ( int i = 0; i < mob.Skills.Length; ++i )
			{
				Skill sk = mob.Skills[i];
				double baseValue = sk.Base;

				if ( baseValue > 0 )
				{
					SkillMod mod = new DefaultSkillMod( sk.SkillName, true, -(baseValue * SkillLossFactor) );

					mods.Add( mod );
					mob.AddSkillMod( mod );
				}
			}

			context.m_Timer = Timer.DelayCall( SkillLossPeriod, new TimerStateCallback( ClearSkillLoss_Callback ), mob );
		}
		public static void ApplySkillLoss( Mobile mob )
		{
			SkillLossContext context = (SkillLossContext)m_SkillLoss[mob];

			if ( context != null )
				return;

			context = new SkillLossContext();
			m_SkillLoss[mob] = context;

			ArrayList mods = context.m_Mods = new ArrayList();

			for ( int i = 0; i < mob.Skills.Length; ++i )
			{
				Skill sk = mob.Skills[i];
				double baseValue = sk.Base;

				if ( baseValue > 0 )
				{
					SkillMod mod = new DefaultSkillMod( sk.SkillName, true, -(baseValue * SkillLossFactor) );

					mods.Add( mod );
					mob.AddSkillMod( mod );
				}
			}


			// jakob, added this to shorten skillloss timer by 1 minute per owned town
			int ownedTowns = 0;
			PlayerState ps = PlayerState.Find( mob );
			if ( ps != null )
				foreach ( Town town in Town.Towns )
				{
					if ( town.Owner == ps.Faction )
						ownedTowns++;
				}

			context.m_Timer = Timer.DelayCall( SkillLossPeriod - TimeSpan.FromMinutes( (double)ownedTowns ), new TimerStateCallback( ClearSkillLoss_Callback ), mob );
			// end
		}
Example #20
0
        public static MorphResult Morph( Mobile m, int entryID )
        {
            if ( entryID < 0 || entryID >= m_Entries.Length )
                return MorphResult.Fail;

            AnimalFormEntry entry = m_Entries[entryID];

            m_LastAnimalForms[m] = entryID;	// On OSI, it's the last /attempted/ one not the last succeeded one

            if ( m.Skills.Ninjitsu.Value < entry.ReqSkill )
            {
                string args = String.Format( "{0}\t{1}\t ", entry.ReqSkill.ToString( "F1" ), SkillName.Ninjitsu );
                m.SendLocalizedMessage( 1063013, args ); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
                return MorphResult.NoSkill;
            }

            double minSkill = entry.ReqSkill - 12.5;
            double maxSkill = entry.ReqSkill + 37.5;

            if ( !m.CheckSkill( SkillName.Ninjitsu, minSkill, maxSkill ) )
                return MorphResult.Fail;

            BaseMount.Dismount( m );

            m.BodyMod = entry.BodyMod;

            if ( entry.HueMod >= 0 )
                m.HueMod = entry.HueMod;

            if ( entry.SpeedBoost )
                m.ForcedRun = true;

            SkillMod mod = null;

            if ( entry.StealthBonus )
            {
                mod = new DefaultSkillMod( SkillName.Stealth, true, 20.0 );
                mod.ObeyCap = true;
                m.AddSkillMod( mod );
            }

            #region Heritage Items
            /*
            else if ( entry.StealingBonus )
            {
                mod = new DefaultSkillMod( SkillName.Stealing, true, 10.0 );
                mod.ObeyCap = true;
                m.AddSkillMod( mod );
            }
            */
            #endregion

            Timer timer = new AnimalFormTimer( m, entry.BodyMod, m.HueMod );
            timer.Start();

            AddContext( m, new AnimalFormContext( timer, mod, entry.SpeedBoost, entry.Type ) );

            Effects.SendLocationParticles( EffectItem.Create( m.Location, m.Map, EffectItem.DefaultDuration ), 0x3728, 1, 13, 0x7F3 );

            BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.AnimalForm, 1075822, 1075823, String.Format( "{0}\t{1}", entry.ArticleCliloc, entry.FormCliloc ) ) );

            m.Target = null;

            return MorphResult.Success;
        }
Example #21
0
		public virtual void BladeBlessing_OnTarget( Mobile from, object target )
		{
			if( !from.CanSee( target ) )
			{
				from.SendLocalizedMessage( 500237 ); //Target cannot be seen.
			}
			else if( target is BaseWeapon )
			{
				BaseWeapon wep = (BaseWeapon)target;
				
				wep.MaxHitPoints += Utility.RandomMinMax( 80, 120 );
				wep.HitPoints = wep.MaxHitPoints;
				wep.LootType = LootType.Blessed;
				
				from.FixedParticles( 0x373A, 10, 15, 5018, EffectLayer.Waist );
				from.PlaySound( 0x1EA );
				
				this.Delete();
			}
			else if( target is Mobile )
			{
				Mobile m = (Mobile)target;
				PlayerMobile pm = (PlayerMobile)m;
				
				if( pm.Karma >= 1500 )
				{
					m_StatMod0 = new StatMod( StatType.All, "statbonus", 15, TimeSpan.FromMinutes( 5 ) );
					pm.AddStatMod( m_StatMod0 );
					
					m_TimedSkillMod0 = new TimedSkillMod( SkillName.Tactics, true, 10, dateTime );
					from.AddSkillMod( m_TimedSkillMod0 );
					
					this.Delete();
				}
				else
				{
					from.SendMessage( "You are not worthy of this blessing." );
				}
			}
			else
			{
				from.SendMessage( "This spell would not work on that." );
			}
		}
Example #22
0
        public static MorphResult Morph( Mobile m, int entryID )
        {
            if ( entryID < 0 || entryID >= m_Entries.Length )
                return MorphResult.Fail;

            AnimalFormEntry entry = m_Entries[entryID];

            m_LastAnimalForms[m] = entryID;	//On OSI, it's the last /attempted/ one not the last succeeded one

            if ( m.Skills.Ninjitsu.Value < entry.ReqSkill )
            {
                string args = String.Format( "{0}\t{1}\t ", entry.ReqSkill.ToString( "F1" ), SkillName.Ninjitsu );
                m.SendLocalizedMessage( 1063013, args ); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
                return MorphResult.NoSkill;
            }

            /*
            if( !m.CheckSkill( SkillName.Ninjitsu, entry.ReqSkill, entry.ReqSkill + 37.5 ) )
                return MorphResult.Fail;
             *
             * On OSI,it seems you can only gain starting at '0' using Animal form.
            */

            double ninjitsu = m.Skills.Ninjitsu.Value;

            if ( ninjitsu < entry.ReqSkill + 37.5 )
            {
                double chance = (ninjitsu - entry.ReqSkill) / 37.5;

                if ( chance < Utility.RandomDouble() )
                    return MorphResult.Fail;
            }

            m.CheckSkill( SkillName.Ninjitsu, 0.0, 37.5 );

            BaseMount.Dismount( m );

            m.BodyMod = entry.BodyMod;

            if ( entry.HueMod > 0 )
                m.HueMod = entry.HueMod;

            if ( entry.SpeedBoost )
                m.Send( SpeedControl.MountSpeed );

            SkillMod mod = null;

            if ( entry.StealthBonus )
            {
                mod = new DefaultSkillMod( SkillName.Stealth, true, 20.0 );
                mod.ObeyCap = true;
                m.AddSkillMod( mod );
            }

            Timer timer = new AnimalFormTimer( m, entry.BodyMod, entry.HueMod );
            timer.Start();

            AddContext( m, new AnimalFormContext( timer, mod, entry.SpeedBoost, entry.Type ) );
            return MorphResult.Success;
        }
Example #23
0
		public override void OnTrigger(object activator, Mobile m)
		{
			if(m == null || Word == null || (RequireIdentification && !m_Identified)) return;

			if(DateTime.Now < m_EndTime) return;

			string msgstr = "Activating the power of " + Word;

			// assign powers to certain words
			switch ( Word )
			{
				case "Shoda":
					m.AddStatMod( new StatMod( StatType.Int, "Shoda", 20, Duration ) );
					m.SendMessage("Your mind expands!");
					break;
				case "Malik":
					m.AddStatMod( new StatMod( StatType.Str, "Malik", 20, Duration ) );
					m.SendMessage("Your strength surges!");
					break;
				case "Lepto":
					m.AddStatMod( new StatMod( StatType.Dex, "Lepto", 20, Duration ) );
					m.SendMessage("You are more nimble!");
					break;
				case "Velas":
					Timer.DelayCall( TimeSpan.Zero, new TimerStateCallback( Hide_Callback ), new object[]{ m } );
					m.SendMessage("You disappear!");
					break;
				case "Tarda":
					m.AddSkillMod( new TimedSkillMod( SkillName.Tactics, true, 20, Duration ) );
					m.SendMessage("You are more skillful warrior!");
					break;
				case "Marda":
					m.AddSkillMod( new TimedSkillMod( SkillName.Magery, true, 20, Duration ) );
					m.SendMessage("You are more skillful mage!");
					break;
				case "Vas Malik":
					m.AddStatMod( new StatMod( StatType.Str, "Vas Malik", 40, Duration ) );
					m.SendMessage("You are exceptionally strong!");
					break;
				case "Nartor":
					BaseCreature b = new Drake();
					b.MoveToWorld(m.Location, m.Map);
					b.Owners.Add( m );
					b.SetControlMaster( m );
					if(b.Controlled)
						m.SendMessage("You master the beast!");
					break;
				case "Santor":
					b = new Horse();
					b.MoveToWorld(m.Location, m.Map);
					b.Owners.Add( m );
					b.SetControlMaster( m );
					if(b.Controlled)
						m.SendMessage("You master the beast!");
					break;
				default:
					m.SendMessage("There is no effect.");
					break;
			}
            
			// display activation effects
			Effects.SendLocationParticles( EffectItem.Create( m.Location, m.Map, EffectItem.DefaultDuration ), 0x3728, 8, 20, 5042 );
			Effects.PlaySound( m, m.Map, 0x201 );

			// display a message over the item it was attached to
			if(AttachedTo is Item )
			{
				((Item)AttachedTo).PublicOverheadMessage( MessageType.Regular, 0x3B2, true, msgstr );
			}
            
			Charges--;

			// remove the attachment after the charges run out
			if(Charges == 0)
			{
				Delete();
			} 
			else
			{
				m_EndTime = DateTime.Now + Refractory;
			}
		}
Example #24
0
        public static void EnergyDrain(Mobile from, Mobile target, int amount, int duration, bool skills)
        {
            if (amount < 0)
                amount = 1;

            target.AddStatMod(new StatMod(StatType.Str, "Energy Drain Str: " + EnergyDrainCount, -amount,
                TimeSpan.FromMinutes(5)));
            target.AddStatMod(new StatMod(StatType.Dex, "Energy Drain Dex: " + EnergyDrainCount, -amount,
                TimeSpan.FromMinutes(5)));
            target.AddStatMod(new StatMod(StatType.Int, "Energy Drain Int: " + EnergyDrainCount, -amount,
                TimeSpan.FromMinutes(5)));

            if (skills)
                for (var i = 0; i < target.Skills.Length; ++i)
                    target.AddSkillMod(new TimedSkillMod((SkillName) i, true, -amount, TimeSpan.FromMinutes(duration)));

            if (from != null)
                from.Hits += 5*amount;

            EnergyDrainCount++;

            if (EnergyDrainCount > 65535)
                EnergyDrainCount = 0;
        }
Example #25
0
        private static void ApplyMods( Mobile from, ArrayList mods )
        {
            for ( int i = 0; i < mods.Count; ++i )
            {
                object mod = mods[i];

                if ( mod is ResistanceMod )
                    from.AddResistanceMod( (ResistanceMod) mod );
                else if ( mod is StatMod )
                    from.AddStatMod( (StatMod) mod );
                else if ( mod is SkillMod )
                    from.AddSkillMod( (SkillMod) mod );
            }
        }