Example #1
0
        public override void DoEffect( Mobile m )
        {
            m.PlaySound( 0x165 );
            m.FixedParticles( 0x3728, 1, 13, 9918, 92, 3, EffectLayer.Head );

            m.Delta( MobileDelta.WeaponDamage );
        }
Example #2
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!this.Validate(attacker) || !this.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 override void RemoveEffect(Mobile m)
        {
            ResistanceMod[] mods = (ResistanceMod[])m_Table[m];

            if (mods != null)
            {             
                m_Table.Remove(m);

                m_Table[m] = mods;

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

                m.PlaySound(0x65B);
                m.FixedParticles(0x3728, 1, 13, 9918, 92, 3, EffectLayer.Head);
                m.Delta(MobileDelta.WeaponDamage);
                m.EndAction(typeof(StoneFormSpell));
            }
        }
Example #4
0
        public void RemoveFriend(Mobile from, Mobile targ)
        {
            if (!this.IsCoOwner(from) || this.m_Friends == null)
                return;

            if (this.m_Friends.Contains(targ))
            {
                this.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.
            }
        }
Example #5
0
        public void AddFriend(Mobile from, Mobile targ)
        {
            if (!this.IsCoOwner(from) || this.m_Friends == null || this.m_CoOwners == null)
                return;

            if (this.IsOwner(targ))
            {
                from.SendLocalizedMessage(501370); // This person is already an owner of the house!
            }
            else if (this.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 (this.IsBanned(targ))
            {
                from.SendLocalizedMessage(501374); // This person is banned!  Unban them first.
            }
            else if (this.m_Friends.Count >= MaxFriends)
            {
                from.SendLocalizedMessage(501375); // Your friends list is full!
            }
            else if (this.m_Friends.Contains(targ))
            {
                from.SendLocalizedMessage(501376); // This person is already on your friends list!
            }
            else
            {
                this.m_Friends.Add(targ);

                targ.Delta(MobileDelta.Noto);
                targ.SendLocalizedMessage(501337); // You have been made a friend of this house.
            }
        }
Example #6
0
        public void RemoveCoOwner(Mobile from, Mobile targ)
        {
            if (!this.IsOwner(from) || this.m_CoOwners == null)
                return;

            if (this.m_CoOwners.Contains(targ))
            {
                this.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 this.m_Secures)
                {
                    Container c = info.Item;

                    if (c is StrongBox && ((StrongBox)c).Owner == targ)
                    {
                        c.IsLockedDown = false;
                        c.IsSecure = false;
                        this.m_Secures.Remove(info);
                        c.Destroy();
                        break;
                    }
                }
            }
        }
Example #7
0
        public void AddCoOwner(Mobile from, Mobile targ)
        {
            if (!this.IsOwner(from) || this.m_CoOwners == null || this.m_Friends == null)
                return;

            if (this.IsOwner(targ))
            {
                from.SendLocalizedMessage(501360); // This person is already the house owner!
            }
            else if (this.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 (this.IsBanned(targ))
            {
                from.SendLocalizedMessage(501367); // This person is banned!  Unban them first.
            }
            else if (this.m_CoOwners.Count >= MaxCoOwners)
            {
                from.SendLocalizedMessage(501368); // Your co-owner list is full!
            }
            else if (this.m_CoOwners.Contains(targ))
            {
                from.SendLocalizedMessage(501369); // This person is already on your co-owner list!
            }
            else
            {
                this.m_CoOwners.Add(targ);

                targ.Delta(MobileDelta.Noto);
                targ.SendLocalizedMessage(501343); // You have been made a co-owner of this house.
            }
        }
Example #8
0
        public virtual void RemovePlayer(Mobile player)
        {
            if (player == null || player.Deleted)
                return;

            if (!Players.Contains(player))
                return;

            if (!player.Alive)
                player.Resurrect();

            if (player is PlayerMobile)
            {
                ((PlayerMobile)player).CurrentEvent = null;
                ((PlayerMobile)player).IsInEvent = false;
                ((PlayerMobile)player).Score = 0;
            }

            player.Blessed = false;

            if (player.Map != Map.Internal)
            {
                player.Location = m_Lobby;
                player.Map = m_LobbyMap;
            }
            else
            {
                player.LogoutLocation = m_Lobby;
                player.LogoutMap = m_LobbyMap;
            }
            m_Players.Remove(player);

            if (m_PlayerSupplies.ContainsKey((PlayerMobile)player))
            {
                SupplySystem.RemoveEventGear(player);
                EquipmentStorage storage = m_PlayerSupplies[(PlayerMobile)player];
                if (storage != null)
                {
                    storage.OnDoubleClick(player);
                    m_PlayerSupplies.Remove((PlayerMobile)player);
                }
            }
            player.Delta(MobileDelta.Noto);
            SendPlayerGumps();
        }
Example #9
0
		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 );
			}
		}
Example #10
0
        public virtual void AddMember(Mobile mob)
        {
            this.Members.Insert(this.ZeroRankOffset, new PlayerState(mob, this, this.Members));

            mob.AddToBackpack(FactionItem.Imbue(new Robe(), this, false, this.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);
        }
 public void UpdateTitle( Mobile m )
 {
     m.InvalidateProperties();
     m.Delta( MobileDelta.Name );
 }
Example #12
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));

				foreach (Sigil s in sigils.OfType<Sigil>())
				{
					s.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)
			{
				LoggingCustom.Log(
					"LOG_FactionPoints.txt", DateTime.Now + "\t" + mob.Name + "\tFaction.RemoveMember: DistributePoints\t" + killPoints);
				DistributePoints(killPoints);
			}

			Player epl = Player.Find(mob);
			if (Ethic.Enabled && epl != null)
			{
				epl.Detach();
			}
		}
Example #13
0
        public override void DoEffect(Mobile m)
        {
            ResistanceMod[] mods = (ResistanceMod[])m_Table[m];
       
                int otherMod = 0 + (int)(m.Skills[SkillName.Mysticism].Value / 20);
                int admod = 1 + (int)(m.Skills[SkillName.Focus].Value / 20);
                //int casts = (int)AosAttributes.GetValue(Caster, AosAttribute.CastSpeed - 2);
               

                mods = new ResistanceMod[5]
				{
					new ResistanceMod( ResistanceType.Physical, otherMod + admod  ),
					new ResistanceMod( ResistanceType.Fire,		otherMod + admod  ),
				    new ResistanceMod( ResistanceType.Cold,		otherMod + admod  ),
					new ResistanceMod( ResistanceType.Poison,	otherMod + admod  ),
					new ResistanceMod( ResistanceType.Energy,	otherMod + admod  ),
                   // new ResistanceMod( AosAttribute.CastSpeed, casts )
			       
				};

                m_Table[m] = mods;

                for (int i = 0; i < mods.Length; ++i)
                    m.AddResistanceMod(mods[i]);

                m.PlaySound(0x65B);
                m.FixedParticles(0x3728, 1, 13, 9918, 92, 3, EffectLayer.Head);
                m.Delta(MobileDelta.WeaponDamage);
                
                m.EndAction(typeof(StoneFormSpell));
                
            }
Example #14
0
        public void AddFriend( Mobile from, Mobile targ )
        {
            if ( !IsCoOwner( from ) || m_Friends == null || m_CoOwners == null )
            {
                return;
            }

            Account acc = targ.Account as Account;

            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.IsPlayer )
            {
                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 ( acc == null || acc.Trial )
            {
                from.SendLocalizedMessage( 1111865 ); // Trial account players do not have access to that level of house security.
            }
            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.
            }
        }
Example #15
0
		public override void RemoveEffect( Mobile m )
		{
			m.Delta( MobileDelta.WeaponDamage );
		}
Example #16
0
        public override void RemoveEffect( Mobile m )
        {
            m.Delta( MobileDelta.WeaponDamage );

            BuffInfo.RemoveBuff(m, BuffIcon.StoneForm);
        }
Example #17
0
		public void AddFriend( Mobile from, Mobile targ )
		{
			if( m_Friends == null || m_Owner == targ )
				return;

			if( !targ.Player )
			{
				from.SendMessage( "That can't be a friend of the tent." );
			}
			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.SendMessage( "You have been granted access to this tent." );
			}
		}
Example #18
0
        public void RemoveMember(Mobile mob)
        {
            PlayerState pl = PlayerState.Find(mob);

            if (pl == null || !this.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) < this.ZeroRankOffset)
                {
                    PlayerState pNext = this.Members[pl.RankIndex + 1];
                    this.Members[pl.RankIndex + 1] = pl;
                    this.Members[pl.RankIndex] = pNext;
                    pl.RankIndex++;
                    pNext.RankIndex--;
                }

                this.ZeroRankOffset--;
            }

            this.Members.Remove(pl);

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

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

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

            this.Election.RemoveVoter(mob);

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

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

            if (this.Commander == mob)
                this.Commander = null;

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

            if (killPoints > 0)
                DistributePoints(killPoints);
        }
Example #19
0
		public void RemoveFriend( Mobile from, Mobile targ )
		{
			if( m_Friends == null )
				return;

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

				targ.Delta( MobileDelta.Noto );

				from.SendMessage( "{0} has been removed from your friends list.", targ.RawName );
				targ.SendMessage( "Your access to this tent has been removed." );
			}
		}
Example #20
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;

			if ( Core.ML && target is BaseCreature && ((BaseCreature)target).Controlled && this == ((BaseCreature)target).ControlMaster )
				return false;

			return base.IsHarmfulCriminal( target );
		}
Example #21
0
 public static void RemoveEffect( Mobile m )
 {
     m_Table.Remove( m );
     m.Delta( MobileDelta.WeaponDamage );
 }