public override void OnHit( Mobile attacker, Mobile defender, int damage )
		{
			if( !Validate( attacker ) || !CheckMana( attacker, true ) )
				return;

			ClearCurrentAbility( attacker );

			attacker.SendLocalizedMessage( 1063353 ); // You perform a masterful defense!

			attacker.FixedParticles( 0x375A, 1, 17, 0x7F2, 0x3E8, 0x3, EffectLayer.Waist );

			int modifier = (int)(30.0 * ((Math.Max( attacker.Skills[SkillName.Bushido].Value, attacker.Skills[SkillName.Ninjitsu].Value ) - 50.0) / 70.0));

			DefenseMasteryInfo info = m_Table[attacker] as DefenseMasteryInfo;

			if( info != null )
				EndDefense( (object)info );

			ResistanceMod mod = new ResistanceMod( ResistanceType.Physical, 50 + modifier );
			attacker.AddResistanceMod( mod );

			info = new DefenseMasteryInfo( attacker, 80 - modifier, mod );
			info.m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 3.0 ), new TimerStateCallback( EndDefense ), info );

			m_Table[attacker] = info;

			attacker.Delta( MobileDelta.WeaponDamage );
		}
        public static void AddContext( Mobile m, TransformContext context )
        {
            m_Table[m] = context;

            if ( context.Type == typeof( HorrificBeastSpell ) )
                m.Delta( MobileDelta.WeaponDamage );
        }
示例#3
0
        public override void OnEnter(Mobile m)
        {
            if (!Controller.InUse)
                return;

            m.Delta(MobileDelta.Noto);
            m.InvalidateProperties();
        }
示例#4
0
 public static void Cure( Mobile who )
 {
     if ( who == null )
         return;
     PoisonAttachment attachment = XmlAttach.FindAttachment( who, typeof( PoisonAttachment ) ) as PoisonAttachment;
     if ( attachment != null )
     {
         attachment.Delete();
         who.SendMessage( 83, "You have been cured of poison." );
         who.Delta( MobileDelta.Flags ); // update bar
     }
 }
示例#5
0
        public static void RemoveBuff(Mobile from, FishPieEffect type)
        {
            if(!m_EffectsList.ContainsKey(from))
                return;

            if (m_EffectsList[from] != null && m_EffectsList[from].Contains(type))
                m_EffectsList[from].Remove(type);

            if (m_EffectsList[from] == null || m_EffectsList[from].Count == 0)
                m_EffectsList.Remove(from);

            BuffInfo.RemoveBuff(from, BuffIcon.FishPie);
            from.Delta(MobileDelta.WeaponDamage);
        }
        public override void OnEnter(Mobile m)
        {
        	if (!Controller.InUse)
                return;
                
			m.SendMessage("Your mana is being regenerated faster!");
			
            if (m is PlayerMobile) 
            { 
            	HealManaTimer timer = new HealManaTimer( m );
            	PlayerTimers.Add(timer);
          		timer.Start();
            }

            m.Delta(MobileDelta.Noto);
            m.InvalidateProperties();
        }
示例#7
0
        public override void OnEnter(Mobile m)
        {
            if (!Controller.InUse)
                return;
                
            if (m is EnergyVortex)
            {
            	EnergyVortex ev = (EnergyVortex) m;
            	Controller.EVsAndBSsAdd(ev);
            }
            else if( m is BladeSpirits )
            {
            	BladeSpirits bs = (BladeSpirits) m;
            	Controller.EVsAndBSsAdd(bs);
            }

            m.Delta(MobileDelta.Noto);
            m.InvalidateProperties();
        }
        public static void SetValue(Mobile m, AosAttribute att, int value, string title)
        {
            if (!EnhancementList.ContainsKey(m))
            {
                AddMobile(m);
            }

            if (att == AosAttribute.BonusStr)
            {
                m.RemoveStatMod("MagicalEnhancementStr");
                m.AddStatMod(new StatMod(StatType.Str, "MagicalEnhancementStr", value, TimeSpan.Zero));
            }
            else if (att == AosAttribute.BonusDex)
            {
                m.RemoveStatMod("MagicalEnhancementDex");
                m.AddStatMod(new StatMod(StatType.Dex, "MagicalEnhancementDex", value, TimeSpan.Zero));
            }
            else if (att == AosAttribute.BonusInt)
            {
                m.RemoveStatMod("MagicalEnhancementInt");
                m.AddStatMod(new StatMod(StatType.Int, "MagicalEnhancementInt", value, TimeSpan.Zero));
            }

            EnhancementAttributes match = EnhancementList[m].FirstOrDefault(attrs => attrs.Title == title);

            if (match != null)
            {
                match.Attributes[att] = value;
            }
            else
            {
                match = new EnhancementAttributes(title);
                match.Attributes[att] = value;

                EnhancementList[m].Add(match);
            }

            m.CheckStatTimers();
            m.UpdateResistances();
            m.Delta(MobileDelta.Stat | MobileDelta.WeaponDamage | MobileDelta.Hits | MobileDelta.Stam | MobileDelta.Mana);
        }
示例#9
0
        public void OnSkillChange(Skill skill)
        {
            if (skill == m_Highest)             // could be downgrading the skill, force a recalc
            {
                m_Highest = null;
            }
            else if (m_Highest != null && skill.BaseFixedPoint > m_Highest.BaseFixedPoint)
            {
                m_Highest = skill;
            }

            m_Owner.OnSkillInvalidated(skill);

            NetState ns = m_Owner.NetState;

            if (ns != null)
            {
                ns.Send(new SkillChange(skill));

                m_Owner.Delta(MobileDelta.Skills);
                m_Owner.ProcessDelta();
            }
        }
示例#10
0
        public static void SetValue(Mobile m, ExtendedWeaponAttribute att, int value, string title)
        {
            if (!EnhancementList.ContainsKey(m))
            {
                AddMobile(m);
            }

            EnhancementAttributes match = null;

            for (var index = 0; index < EnhancementList[m].Count; index++)
            {
                var attrs = EnhancementList[m][index];

                if (attrs.Title == title)
                {
                    match = attrs;
                    break;
                }
            }

            if (match != null)
            {
                match.ExtendedWeaponAttributes[att] = value;
            }
            else
            {
                match = new EnhancementAttributes(title);
                match.ExtendedWeaponAttributes[att] = value;

                EnhancementList[m].Add(match);
            }

            m.CheckStatTimers();
            m.UpdateResistances();
            m.Delta(MobileDelta.Stat | MobileDelta.WeaponDamage | MobileDelta.Hits | MobileDelta.Stam | MobileDelta.Mana);
        }
示例#11
0
        public void RemoveMember( Mobile mob )
        {
            PlayerState pl = PlayerState.Find( mob );

            if ( pl == null || !Members.Contains( pl ) )
                return;

            Members.Remove( pl );

            if ( mob is PlayerMobile )
                ((PlayerMobile)mob).FactionPlayerState = null;

            mob.InvalidateProperties();
            mob.Delta( MobileDelta.Noto );

            if ( Election.IsCandidate( mob ) )
                Election.RemoveCandidate( mob );

            Election.RemoveVoter( mob );

            if ( pl.Finance != null )
                pl.Finance.Finance = null;

            if ( pl.Sheriff != null )
                pl.Sheriff.Sheriff = null;

            if ( Commander == mob )
                Commander = null;

            if ( mob is PlayerMobile )
                ((PlayerMobile)mob).ValidateEquipment();
        }
示例#12
0
        public void AddMember( Mobile mob )
        {
            Members.Add( new PlayerState( mob, this, Members ) );
            Item item = mob.FindItemOnLayer( Layer.OuterTorso ) as Item;
            if( item != null )
            {
                if ( item.Movable == false )
                {
                    mob.AddToBackpack( FactionItem.Imbue( new Robe(), this, false, Definition.HuePrimary ) );
                    mob.SendAsciiMessage( "You have been granted a robe which signifies your faction." );
                }

                if ( item.Movable == true )
                {
                    mob.AddToBackpack( item );
                    mob.EquipItem( FactionItem.Imbue( new Robe(), this, false, Definition.HuePrimary ) );
                    mob.SendAsciiMessage( "You have been granted a robe which signifies your faction." );
                }
            }
            else
            {
                mob.EquipItem( FactionItem.Imbue( new Robe(), this, false, Definition.HuePrimary ) );
                mob.SendAsciiMessage( "You have been granted a robe which signifies your faction." );
            }

            mob.InvalidateProperties();
            mob.Delta( MobileDelta.Noto );
        }
示例#13
0
        public void SetValue(int bitmask, int value)
        {
            if ((bitmask == (int)AosWeaponAttribute.DurabilityBonus) && (this is AosWeaponAttributes))
            {
                if (m_Owner is BaseWeapon)
                {
                    ((BaseWeapon)m_Owner).UnscaleDurability();
                }
            }
            else if ((bitmask == (int)AosArmorAttribute.DurabilityBonus) && (this is AosArmorAttributes))
            {
                if (m_Owner is BaseArmor)
                {
                    ((BaseArmor)m_Owner).UnscaleDurability();
                }
                else if (m_Owner is BaseClothing)
                {
                    ((BaseClothing)m_Owner).UnscaleDurability();
                }
            }

            uint mask = (uint)bitmask;

            if (value != 0)
            {
                if ((m_Names & mask) != 0)
                {
                    int index = GetIndex(mask);

                    if (index >= 0 && index < m_Values.Length)
                    {
                        m_Values[index] = value;
                    }
                }
                else
                {
                    int index = GetIndex(mask);

                    if (index >= 0 && index <= m_Values.Length)
                    {
                        int[] old = m_Values;
                        m_Values = new int[old.Length + 1];

                        for (int i = 0; i < index; ++i)
                        {
                            m_Values[i] = old[i];
                        }

                        m_Values[index] = value;

                        for (int i = index; i < old.Length; ++i)
                        {
                            m_Values[i + 1] = old[i];
                        }

                        m_Names |= mask;
                    }
                }
            }
            else if ((m_Names & mask) != 0)
            {
                int index = GetIndex(mask);

                if (index >= 0 && index < m_Values.Length)
                {
                    m_Names &= ~mask;

                    if (m_Values.Length == 1)
                    {
                        m_Values = m_Empty;
                    }
                    else
                    {
                        int[] old = m_Values;
                        m_Values = new int[old.Length - 1];

                        for (int i = 0; i < index; ++i)
                        {
                            m_Values[i] = old[i];
                        }

                        for (int i = index + 1; i < old.Length; ++i)
                        {
                            m_Values[i - 1] = old[i];
                        }
                    }
                }
            }

            if ((bitmask == (int)AosWeaponAttribute.DurabilityBonus) && (this is AosWeaponAttributes))
            {
                if (m_Owner is BaseWeapon)
                {
                    ((BaseWeapon)m_Owner).ScaleDurability();
                }
            }
            else if ((bitmask == (int)AosArmorAttribute.DurabilityBonus) && (this is AosArmorAttributes))
            {
                if (m_Owner is BaseArmor)
                {
                    ((BaseArmor)m_Owner).ScaleDurability();
                }
                else if (m_Owner is BaseClothing)
                {
                    ((BaseClothing)m_Owner).ScaleDurability();
                }
            }

            if (m_Owner.Parent is Mobile)
            {
                Mobile m = (Mobile)m_Owner.Parent;

                m.CheckStatTimers();
                m.UpdateResistances();
                m.Delta(MobileDelta.Stat | MobileDelta.WeaponDamage | MobileDelta.Hits | MobileDelta.Stam | MobileDelta.Mana);

                if (this is AosSkillBonuses)
                {
                    ((AosSkillBonuses)this).Remove();
                    ((AosSkillBonuses)this).AddTo(m);
                }
            }

            m_Owner.InvalidateProperties();
        }
示例#14
0
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		public void LeaveGame( Mobile m )
		{
                        m.MoveToWorld( new Point3D( 1563, 1739, 15 ), Map.Felucca );
			CTFTeam t = GetTeam( m );
			if ( t != null )
				t.RemoveMember( m );
                        m.SolidHueOverride = -1;
			
			Item robe = m.FindItemOnLayer( Layer.OuterTorso );
			if ( robe is CTFRobe )
				robe.Delete();
			if ( m.Backpack != null )
			{
				Item[] robes = m.Backpack.FindItemsByType( typeof( CTFRobe ) );
				for(int i=0;i<robes.Length;i++)
					robes[i].Delete();
			}

			m.Delta( MobileDelta.Noto );

				
		}
示例#15
0
		public void SwitchTeams( Mobile from, CTFTeam team )
		{
			CTFTeam old = GetTeam( from );
			if ( old == team )
				return;
			else if ( old != null )
				old.RemoveMember( from );

			team.AddMember( from );
			from.Delta( MobileDelta.Noto );
                        from.Blessed = true;

			Item robe = from.FindItemOnLayer( Layer.OuterTorso );
			if ( robe is CTFRobe )
			{
				robe.Name = "Game Robe";
				robe.Hue = 0;
			}
			else
			{
				if ( robe != null )
				{
					if ( robe.Movable )
						from.AddToBackpack( robe );
					else
						robe.Delete();
				}
				
				robe = new CTFRobe( team );
				from.EquipItem( robe );
			}
		}
示例#16
0
		public virtual void OnExit(PvPRegion region, Mobile m)
		{
			if (region == null || m == null || m.Deleted)
			{
				return;
			}

			var pm = m as PlayerMobile;

			if (pm != null)
			{
				if (region.IsPartOf(BattleRegion))
				{
					if (IsParticipant(pm))
					{
						Eject(pm, false);
					}

					pm.SendMessage("You have left {0}", Name);
				}
				else if (region.IsPartOf(SpectateRegion))
				{
					pm.SendMessage("You have left {0} spectator area", Name);

					if (IsSpectator(pm))
					{
						RemoveSpectator(pm, false);
					}
				}
			}

			m.Delta(MobileDelta.Noto);
		}
        public void SetHue( Mobile m, int id )
        {
            if( m is PlayerMobile && !m_IgnoreChecks && !m_HairDressing )
                ( (PlayerMobile)m ).Disguise.Hue = id;
            else
                m.Hue = id;

            m.Delta( MobileDelta.Hue );
            m.Delta( MobileDelta.Hair );
            m.Delta( MobileDelta.FacialHair );
        }
示例#18
0
        public override bool IsHarmfulCriminal(Mobile target)
        {
            if (SkillHandlers.Stealing.ClassicMode && target is PlayerMobile && ((PlayerMobile)target).m_PermaFlags.Count > 0)
            {
                int noto = Notoriety.Compute(this, target);

                if (noto == Notoriety.Innocent)
                    target.Delta(MobileDelta.Noto);

                return false;
            }

            if (target is BaseCreature && ((BaseCreature)target).InitialInnocent && !((BaseCreature)target).Controlled)
                return false;

            return base.IsHarmfulCriminal(target);
        }
示例#19
0
        /// <summary>
        /// Removes the mobile and/or attributes from the dictionary
        /// </summary>
        /// <param name="m"></param>
        /// <param name="title">null or default value will remove the entire entry. Add the title arg to remove only that element from the list.</param>
        /// <returns></returns>
        public static bool RemoveMobile(Mobile m, string title = null)
        {
            if (EnhancementList.ContainsKey(m))
            {
                if (title != null)
                {
                    EnhancementAttributes match = null;

                    for (var index = 0; index < EnhancementList[m].Count; index++)
                    {
                        var attrs = EnhancementList[m][index];

                        if (attrs.Title == title)
                        {
                            match = attrs;
                            break;
                        }
                    }

                    if (match != null && EnhancementList[m].Contains(match))
                    {
                        if (match.Attributes.BonusStr > 0)
                        {
                            m.RemoveStatMod("MagicalEnhancementStr");
                        }

                        if (match.Attributes.BonusDex > 0)
                        {
                            m.RemoveStatMod("MagicalEnhancementDex");
                        }

                        if (match.Attributes.BonusInt > 0)
                        {
                            m.RemoveStatMod("MagicalEnhancementInt");
                        }

                        EnhancementList[m].Remove(match);
                    }
                }

                if (EnhancementList[m].Count == 0 || title == null)
                {
                    EnhancementList.Remove(m);
                }

                m.CheckStatTimers();
                m.UpdateResistances();
                m.Delta(MobileDelta.Stat | MobileDelta.WeaponDamage | MobileDelta.Hits | MobileDelta.Stam | MobileDelta.Mana);

                for (var index = 0; index < m.Items.Count; index++)
                {
                    var i = m.Items[index];

                    i.InvalidateProperties();
                }

                return(true);
            }

            return(false);
        }
示例#20
0
		public void AddCoOwner( Mobile from, Mobile targ )
		{
			if ( !IsOwner( from ) || m_CoOwners == null || m_Friends == null )
				return;

			if ( IsOwner( targ ) )
			{
				from.SendLocalizedMessage( 501360 ); // This person is already the house owner!
			}
			else if ( m_Friends.Contains( targ ) )
			{
				from.SendLocalizedMessage( 501361 ); // This person is a friend of the house. Remove them first.
			}
			else if ( !targ.Player )
			{
				from.SendLocalizedMessage( 501362 ); // That can't be a co-owner of the house.
			}
			else if ( HasAccountHouse( targ ) )
			{
				from.SendLocalizedMessage( 501364 ); // That person is already a house owner.
			}
			else if ( IsBanned( targ ) )
			{
				from.SendLocalizedMessage( 501367 ); // This person is banned!  Unban them first.
			}
			else if ( m_CoOwners.Count >= MaxCoOwners )
			{
				from.SendLocalizedMessage( 501368 ); // Your co-owner list is full!
			}
			else if ( m_CoOwners.Contains( targ ) )
			{
				from.SendLocalizedMessage( 501369 ); // This person is already on your co-owner list!
			}
			else
			{
				m_CoOwners.Add( targ );

				targ.Delta( MobileDelta.Noto );
				targ.SendLocalizedMessage( 501343 ); // You have been made a co-owner of this house.
			}
		}
示例#21
0
		public void AddFriend( Mobile from, Mobile targ )
		{
			if ( !IsCoOwner( from ) || m_Friends == null || m_CoOwners == null )
				return;

			if ( IsOwner( targ ) )
			{
				from.SendLocalizedMessage( 501370 ); // This person is already an owner of the house!
			}
			else if ( m_CoOwners.Contains( targ ) )
			{
				from.SendLocalizedMessage( 501369 ); // This person is already on your co-owner list!
			}
			else if ( !targ.Player )
			{
				from.SendLocalizedMessage( 501371 ); // That can't be a friend of the house.
			}
			else if ( IsBanned( targ ) )
			{
				from.SendLocalizedMessage( 501374 ); // This person is banned!  Unban them first.
			}
			else if ( m_Friends.Count >= MaxFriends )
			{
				from.SendLocalizedMessage( 501375 ); // Your friends list is full!
			}
			else if ( m_Friends.Contains( targ ) )
			{
				from.SendLocalizedMessage( 501376 ); // This person is already on your friends list!
			}
			else
			{
				m_Friends.Add( targ );

				targ.Delta( MobileDelta.Noto );
				targ.SendLocalizedMessage( 501337 ); // You have been made a friend of this house.
			}
		}
示例#22
0
        public static void EndEffects(Mobile from)
        {
            if (IsUnderEffects(from))
            {
                Table.Remove(from);
                from.SendLocalizedMessage(1150887); // You are no longer slowed and encrusted.

                from.Send(SpeedControl.Disable);

                from.Delta(MobileDelta.WeaponDamage);
            }
        }
示例#23
0
        public void AddMember( Mobile mob )
        {
            Members.Add( new PlayerState( mob, this, Members ) );

            mob.AddToBackpack( FactionItem.Imbue( new Robe(), this, false, Definition.HuePrimary ) );
            mob.SendLocalizedMessage( 1010374 ); // You have been granted a robe which signifies your faction

            mob.InvalidateProperties();
            mob.Delta( MobileDelta.Noto );

            var followers = World.Instance.Mobiles
                .OfType<BaseCreature>()
                .Where( bc => bc.Controlled && bc.ControlMaster == mob );

            foreach ( Mobile follower in followers )
            {
                follower.InvalidateProperties();
                follower.Delta( MobileDelta.Noto );
            }

            mob.FixedEffect( 0x373A, 10, 30 );
            mob.PlaySound( 0x209 );
        }
示例#24
0
        public void RemoveMember( Mobile mob )
        {
            PlayerState pl = PlayerState.Find( mob );

            if ( pl == null || !Members.Contains( pl ) )
                return;

            Members.Remove( pl );

            if ( mob is PlayerMobile )
                ( (PlayerMobile) mob ).FactionPlayerState = null;

            mob.InvalidateProperties();
            mob.Delta( MobileDelta.Noto );

            // TODO: refactor this, maybe a Mobile.GetFollowers() ?
            var followers = World.Instance.Mobiles
                .OfType<BaseCreature>()
                .Where( bc => bc.Controlled && bc.ControlMaster == mob );

            foreach ( Mobile follower in followers )
            {
                follower.InvalidateProperties();
                follower.Delta( MobileDelta.Noto );
            }

            if ( Election.IsCandidate( mob ) )
                Election.RemoveCandidate( mob );

            Election.RemoveVoter( mob );

            if ( pl.Finance != null )
                pl.Finance.Finance = null;

            if ( pl.Sheriff != null )
                pl.Sheriff.Sheriff = null;

            if ( Commander == mob )
                Commander = null;

            if ( mob is PlayerMobile )
                ( (PlayerMobile) mob ).ValidateEquipment();
        }
示例#25
0
		public void SetValue( int bitmask, int value )
		{
			if ( ( bitmask == (int) AosWeaponAttribute.DurabilityBonus ) && ( this is AosWeaponAttributes ) )
			{
				if ( Owner is IWeapon )
					( (IWeapon) Owner ).UnscaleDurability();
			}
			else if ( ( bitmask == (int) AosArmorAttribute.DurabilityBonus ) && ( this is AosArmorAttributes ) )
			{
				if ( Owner is IArmor )
					( (IArmor) Owner ).UnscaleDurability();
			}

			uint mask = (uint) bitmask;

			if ( value != 0 )
			{
				if ( ( Names & mask ) != 0 )
				{
					int index = GetIndex( mask );

					if ( index >= 0 && index < m_Values.Length )
						m_Values[index] = (short) value;
				}
				else
				{
					int index = GetIndex( mask );

					if ( index >= 0 && index <= m_Values.Length )
					{
						short[] old = m_Values;
						m_Values = new short[old.Length + 1];

						for ( int i = 0; i < index; ++i )
							m_Values[i] = old[i];

						m_Values[index] = (short) value;

						for ( int i = index; i < old.Length; ++i )
							m_Values[i + 1] = old[i];

						Names |= mask;
					}
				}
			}
			else if ( ( Names & mask ) != 0 )
			{
				int index = GetIndex( mask );

				if ( index >= 0 && index < m_Values.Length )
				{
					Names &= ~mask;

					if ( m_Values.Length == 1 )
					{
						m_Values = m_Empty;
					}
					else
					{
						short[] old = m_Values;
						m_Values = new short[old.Length - 1];

						for ( int i = 0; i < index; ++i )
							m_Values[i] = old[i];

						for ( int i = index + 1; i < old.Length; ++i )
							m_Values[i - 1] = old[i];
					}
				}
			}

			if ( ( bitmask == (int) AosWeaponAttribute.DurabilityBonus ) && ( this is AosWeaponAttributes ) )
			{
				if ( Owner is IWeapon )
					( (IWeapon) Owner ).ScaleDurability();
			}
			else if ( ( bitmask == (int) AosArmorAttribute.DurabilityBonus ) && ( this is AosArmorAttributes ) )
			{
				if ( Owner is IArmor )
					( (IArmor) Owner ).ScaleDurability();
			}

			if ( Owner is Item )
			{
				Item owner = (Item) Owner;

				if ( owner.Parent is Mobile )
				{
					Mobile m = (Mobile) owner.Parent;

					m.CheckStatTimers();
					m.UpdateResistances();
					m.Delta( MobileDelta.Stat | MobileDelta.WeaponDamage | MobileDelta.Hits | MobileDelta.Stam | MobileDelta.Mana );

					if ( this is SkillBonuses )
					{
						SkillBonuses sb = (SkillBonuses) this;

						sb.Remove();
						sb.AddTo( m );
					}
				}

				owner.InvalidateProperties();
			}
		}
示例#26
0
        public static void DoEffects(Mobile from)
        {
            if (Table == null)
                Table = new Dictionary<Mobile, Timer>();

            if (!Table.ContainsKey(from))
            {
                Table[from] = Timer.DelayCall(TimeSpan.FromSeconds(5), () =>
                    {
                        EndEffects(from);
                    });

                from.Send(SpeedControl.WalkSpeed);
                from.SendLocalizedMessage(1150886); // Splashes from the creature encrust your weapon and equipment, slowing your movement.

                from.Delta(MobileDelta.WeaponDamage);
            }
        }
示例#27
0
		public virtual void OnEnter(PvPRegion region, Mobile m)
		{
			if (region == null || m == null || m.Deleted)
			{
				return;
			}

			var pm = m as PlayerMobile;

			if (pm != null)
			{
				if (region.IsPartOf(BattleRegion))
				{
					pm.SendMessage("You have entered {0}", Name);
				}
				else if (region.IsPartOf(SpectateRegion))
				{
					pm.SendMessage("You have entered {0} spectator area.", Name);

					if (!IsSpectator(pm))
					{
						AddSpectator(pm, false);
					}
				}
			}

			m.Delta(MobileDelta.Noto);
		}
示例#28
0
		public static void RemoveStatBonuses( Mobile from, Item item )
		{			
			string modName = item.Serial.ToString();
			
			from.RemoveStatMod( modName + "SetStr" );
			from.RemoveStatMod( modName + "SetDex" );
			from.RemoveStatMod( modName + "SetInt" );
			
			from.Delta( MobileDelta.Armor );
			from.CheckStatTimers();
		}
示例#29
0
		public virtual void AddMember( Mobile mob )
		{
			Members.Insert( ZeroRankOffset, new PlayerState( mob, this, Members ) );

			mob.AddToBackpack( FactionItem.Imbue( new Robe(), this, false, Definition.HuePrimary ) );
			mob.SendLocalizedMessage( 1010374 ); // You have been granted a robe which signifies your faction

			mob.InvalidateProperties();
			mob.Delta( MobileDelta.Noto );

			mob.FixedEffect( 0x373A, 10, 30 );
			mob.PlaySound( 0x209 );
		}
        /// <summary>
        /// Will remove the player from the game.
        /// </summary>
        /// <param name="m"></param>
        public static void LeaveGame(Mobile m)
        {
            if (!CTFGame.Running)
                return;

            CTFPlayerGameData pgd = GameData.GetPlayerData(m);

            if (pgd != null)
            {
                pgd.InGame = false;
                RemoveItems(m);
                SunnySystem.DisArmPlayer(m);

                m.Criminal = false;
                m.InvalidateProperties();
                m.Warmode = false;
                m.Aggressed.Clear();
                m.Aggressors.Clear();

                EventSystem.RemoveToRandomLoc(m);
                SunnySystem.ReDress(m);
                m.Delta(MobileDelta.Noto);
                m.InvalidateProperties();
            }
            else if (PlayerJoinList.Contains(m)) {
                try {
                    PlayerJoinList.Remove(m);
                    EventSystem.RemoveToRandomLoc(m);
                    SunnySystem.ReDress(m);
                } catch {}
            } else
                EventSystem.RemoveToRandomLoc(m);
        }
示例#31
0
		public void RemoveCoOwner( Mobile from, Mobile targ )
		{
			if ( !IsOwner( from ) || m_CoOwners == null )
				return;

			if ( m_CoOwners.Contains( targ ) )
			{
				m_CoOwners.Remove( targ );

				targ.Delta( MobileDelta.Noto );

				from.SendLocalizedMessage( 501299 ); // Co-owner removed from list.
				targ.SendLocalizedMessage( 501300 ); // You have been removed as a house co-owner.

				foreach ( SecureInfo info in m_Secures )
				{
					Container c = info.Item;

					if ( c is StrongBox && ((StrongBox)c).Owner == targ )
					{
						c.IsLockedDown = false;
						c.IsSecure = false;
						m_Secures.Remove( c );
						c.Destroy();
						break;
					}
				}
			}
		}
示例#32
0
		public void RemoveMember( Mobile mob )
		{
			PlayerState pl = PlayerState.Find( mob );

			if ( pl == null || !Members.Contains( pl ) )
				return;

			int killPoints = pl.KillPoints;

			if( mob.Backpack != null )
			{
				//Ordinarily, through normal faction removal, this will never find any sigils.
				//Only with a leave delay less than the ReturnPeriod or a Faction Kick/Ban, will this ever do anything
				Item[] sigils = mob.Backpack.FindItemsByType( typeof( Sigil ) );

				for ( int i = 0; i < sigils.Length; ++i )
					((Sigil)sigils[i]).ReturnHome();
			}

			if ( pl.RankIndex != -1 ) {
				while ( ( pl.RankIndex + 1 ) < ZeroRankOffset ) {
					PlayerState pNext = Members[pl.RankIndex+1];
					Members[pl.RankIndex+1] = pl;
					Members[pl.RankIndex] = pNext;
					pl.RankIndex++;
					pNext.RankIndex--;
				}

				ZeroRankOffset--;
			}

			Members.Remove( pl );

			if ( mob is PlayerMobile )
				((PlayerMobile)mob).FactionPlayerState = null;

			mob.InvalidateProperties();
			mob.Delta( MobileDelta.Noto );

			if ( Election.IsCandidate( mob ) )
				Election.RemoveCandidate( mob );

			Election.RemoveVoter( mob );

			if ( pl.Finance != null )
				pl.Finance.Finance = null;

			if ( pl.Sheriff != null )
				pl.Sheriff.Sheriff = null;

			if ( Commander == mob )
				Commander = null;

			if ( mob is PlayerMobile )
				((PlayerMobile)mob).ValidateEquipment();

			if ( killPoints > 0 )
				DistributePoints( killPoints );
		}
示例#33
0
		public void RemoveFriend( Mobile from, Mobile targ )
		{
			if ( !IsCoOwner( from ) || m_Friends == null )
				return;

			if ( m_Friends.Contains( targ ) )
			{
				m_Friends.Remove( targ );

				targ.Delta( MobileDelta.Noto );

				from.SendLocalizedMessage( 501298 ); // Friend removed from list.
				targ.SendLocalizedMessage( 1060751 ); // You are no longer a friend of this house.
			}
		}
示例#34
0
 /// <summary>
 /// Remove all ill effects from a player.
 /// </summary>
 /// <param name="pm"></param>
 public void CleanPlayer(Mobile pm)
 {
     //Cure Poison
     pm.CurePoison(pm);
     //Reset Hit Points
     pm.Hits = pm.HitsMax;
     //Rest Mana
     pm.Mana = pm.ManaMax;
     //Reset Stam
     pm.Stam = pm.StamMax;
     //Cancel any targeting
     Targeting.Target.Cancel(pm);
     //remove abosorption for magic
     pm.MagicDamageAbsorb = 0;
     //remove absorption for melee
     pm.MeleeDamageAbsorb = 0;
     //clear protection spell
     Spells.Second.ProtectionSpell.Registry.Remove(pm);
     //clear curse effect
     Spells.Fourth.CurseSpell.RemoveEffect(pm);
     //clear corpseskin
     Server.Spells.Necromancy.CorpseSkinSpell.RemoveCurse(pm);
     //clear blodd oath
     Server.Spells.Necromancy.BloodOathSpell.RemoveCurse(pm);
     //clear evil omen
     //Server.Spells.Necromancy.EvilOmenSpell.RemoveCurse(pm);
     //remove strangle
     Server.Spells.Necromancy.StrangleSpell.RemoveCurse(pm);
     //clear Paralyzed
     pm.Paralyzed = false;
     //clear defensive spell
     DefensiveSpell.Nullify(pm);
     //remove any combatant
     pm.Combatant = null;
     //remove war mode
     pm.Warmode = false;
     //remove criminal
     pm.Criminal = false;
     //clear agressed list
     pm.Aggressed.Clear();
     //clear agressor list
     pm.Aggressors.Clear();
     //clear delta notoriety
     pm.Delta(MobileDelta.Noto);
     //invalidate any properties due to the previous changes
     pm.InvalidateProperties();
 }
示例#35
0
文件: Guild.cs 项目: Leodinas/uolite
        public void RemoveMember( Mobile m, int message )
        {
            if ( m_Members.Contains( m ) )
            {
                m_Members.Remove( m );

                Guild guild = m.Guild as Guild;

                m.Guild = null;

                if( m is PlayerMobile )
                    ((PlayerMobile)m).GuildRank = RankDefinition.Lowest;

                if( message > 0 )
                    m.SendLocalizedMessage( message );

                if ( m == m_Leader )
                {
                    CalculateGuildmaster();

                    if ( m_Leader == null )
                        Disband();
                }

                if ( m_Members.Count == 0 )
                    Disband();

                if ( guild != null )
                    guild.InvalidateWarNotoriety();

                m.Delta( MobileDelta.Noto );
            }
        }
		public static void RemoveContext( Mobile m, TransformContext context, bool resetGraphics )
		{
			m_Table.Remove( m );

			List<ResistanceMod> mods = context.Mods;

			for ( int i = 0; i < mods.Count; ++i )
				m.RemoveResistanceMod( mods[i] );

			if ( resetGraphics )
			{
				m.HueMod = -1;
				m.BodyMod = 0;
			}

			context.Timer.Stop();

			if ( context.Type == typeof( HorrificBeastSpell ) )
				m.Delta( MobileDelta.WeaponDamage );
		}