Esempio 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();
            }
        }
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 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();
			}
		}