public override void OnTrigger(object activator, Mobile m)
        {
            if (m == null || (this.RequireIdentification && !this.m_Identified))
            {
                return;
            }

            if ((this.AttachedTo is BaseArmor || this.AttachedTo is BaseWeapon) && (((Item)this.AttachedTo).Layer != Layer.Invalid))
            {
                // when activated via speech will apply mod when equipped by the speaker
                SkillMod sm = new EquipedSkillMod(this.m_Skill, true, this.m_Value, (Item)this.AttachedTo, m);
                m.AddSkillMod(sm);
                // and then remove the attachment
                this.Delete();
            }
            else
            {
                // when activated it will apply the skill mod that will last for the specified duration
                SkillMod sm = new TimedSkillMod(this.m_Skill, true, this.m_Value, this.m_Duration);
                m.AddSkillMod(sm);
                // and then remove the attachment
                this.Delete();
            }
        }
Esempio n. 2
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 EquipedSkillMod( 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();
			}
		}