Exemplo n.º 1
0
		public override void OnRemoved( object parent )
		{
/*
			if ( Core.AOS && parent is Mobile )
			{
				Mobile from = (Mobile)parent;

				m_AosSkillBonuses.Remove();

				string modName = this.Serial.ToString();

				from.RemoveStatMod( modName + "Str" );
				from.RemoveStatMod( modName + "Dex" );
				from.RemoveStatMod( modName + "Int" );

				from.CheckStatTimers();
			}
			else*/ if (m_ChargedAbility != JewelChargedAbility.Regular && m_ChargedAbility != JewelChargedAbility.Teleport && parent is Mobile)
			{
				Mobile from = (Mobile)parent;

				if (m_ChargedAbility == JewelChargedAbility.Invisibility)
					from.Hidden = false;
				else
				{
					string modName = this.Serial.ToString();

					from.RemoveStatMod(modName + "Str");
					from.RemoveStatMod(modName + "Dex");
					from.RemoveStatMod(modName + "Int");
				}

				if (m_EatChargesTimer != null)
					m_EatChargesTimer.Stop();
				m_EatChargesTimer = null;
			}
		}
Exemplo n.º 2
0
		public override void OnAdded( object parent )
		{
			/*if ( Core.AOS && parent is Mobile )
			{
				Mobile from = (Mobile)parent;

				m_AosSkillBonuses.AddTo( from );

				int strBonus = m_AosAttributes.BonusStr;
				int dexBonus = m_AosAttributes.BonusDex;
				int intBonus = m_AosAttributes.BonusInt;

				if ( strBonus != 0 || dexBonus != 0 || intBonus != 0 )
				{
					string modName = this.Serial.ToString();

					if ( strBonus != 0 )
						from.AddStatMod( new StatMod( StatType.Str, modName + "Str", strBonus, TimeSpan.Zero ) );

					if ( dexBonus != 0 )
						from.AddStatMod( new StatMod( StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero ) );

					if ( intBonus != 0 )
						from.AddStatMod( new StatMod( StatType.Int, modName + "Int", intBonus, TimeSpan.Zero ) );
				}
				from.CheckStatTimers();
			}
			else*/ if (m_ChargedAbility != JewelChargedAbility.Regular && m_ChargedAbility != JewelChargedAbility.Teleport && m_AbilityCharges > 0 && parent is Mobile)
			{
				Mobile from = (Mobile)parent;

				if ( m_ChargedAbility == JewelChargedAbility.Invisibility )
					from.Hidden = true;
				else
				{
					int strBonus = 0;
					int dexBonus = 0;
					int intBonus = 0;

					switch (m_ChargedAbility)
					{
						case JewelChargedAbility.Cunning: intBonus = 10; break;
						case JewelChargedAbility.Strength: strBonus = 10; break;
						case JewelChargedAbility.Agility: dexBonus = 10; break;
						case JewelChargedAbility.Bless: intBonus = strBonus = dexBonus = 10; break;
					}

					if (strBonus != 0 || dexBonus != 0 || intBonus != 0)
					{
						string modName = this.Serial.ToString();

						if (strBonus != 0)
							from.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));

						if (dexBonus != 0)
							from.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));

						if (intBonus != 0)
							from.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
					}
				}

				m_AbilityCharges--;

				m_EatChargesTimer = new EatChargesTimer(this);
			}
		}