Exemplo n.º 1
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();
			}
		}
Exemplo n.º 2
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;
        }
Exemplo n.º 3
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." );
			}
		}