示例#1
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (GuildGump.BadMember(m_Mobile, m_Guild))
            {
                return;
            }

            switch (info.ButtonID)
            {
            case 0: return;                    // Close

            case 1: break;                     // Return to main menu

            case 2:
            {
                string website;

                if ((website = m_Guild.Website) == null || (website = website.Trim()).Length <= 0)
                {
                    website = DefaultWebsite;
                }

                m_Mobile.LaunchBrowser(website);
                break;
            }
            }

            GuildGump.EnsureClosed(m_Mobile);
            m_Mobile.SendGump(new GuildGump(m_Mobile, m_Guild));
        }
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (GuildGump.BadMember(m_Mobile, m_Guild))
            {
                return;
            }

            if (info.ButtonID == 1)
            {
                int[] switches = info.Switches;

                if (switches.Length > 0)
                {
                    int index = switches[0];

                    if (index >= 0 && index < m_List.Count)
                    {
                        Mobile m = m_List[index];

                        if (m != null && !m.Deleted)
                        {
                            state.Mobile.GuildFealty = m;
                        }
                    }
                }
            }

            GuildGump.EnsureClosed(m_Mobile);
            m_Mobile.SendGump(new GuildGump(m_Mobile, m_Guild));
        }
		protected override void OnTargetFinish( Mobile from )
		{
			if ( GuildGump.BadMember( m_Mobile, m_Guild ) )
				return;

			GuildGump.EnsureClosed( m_Mobile );
			m_Mobile.SendGump( new GuildGump( m_Mobile, m_Guild ) );
		}
示例#4
0
        protected override void OnTargetFinish(Mobile from)
        {
            if (GuildGump.BadMember(this.m_Mobile, this.m_Guild))
            {
                return;
            }

            GuildGump.EnsureClosed(this.m_Mobile);
            this.m_Mobile.SendGump(new GuildGump(this.m_Mobile, this.m_Guild));
        }
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (GuildGump.BadMember(m_Mobile, m_Guild))
            {
                return;
            }

            if (info.ButtonID == 1)
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildGump(m_Mobile, m_Guild));
            }
        }
示例#6
0
        protected override void OnTarget(Mobile from, object targeted)
        {
            if (GuildGump.BadMember(m_Mobile, m_Guild))
            {
                return;
            }

            if (targeted is Mobile)
            {
                Mobile m = (Mobile)targeted;

                if (!m.Player)
                {
                    m_Mobile.SendAsciiMessage("You may only recruit players into the guild.");                       // You may only recruit players into the guild.
                }
                else if (!m.Alive)
                {
                    m_Mobile.SendAsciiMessage("Only the living may be recruited.");                       // Only the living may be recruited.
                }
                else if (m_Guild.IsMember(m))
                {
                    m_Mobile.SendAsciiMessage("They are already a guildmember!");                       // They are already a guildmember!
                }
                else if (m_Guild.Candidates.Contains(m))
                {
                    m_Mobile.SendAsciiMessage("They are already a candidate.");                       // They are already a candidate.
                }
                else if (m_Guild.Accepted.Contains(m))
                {
                    m_Mobile.SendAsciiMessage("They have already been accepted for membership, and merely need to use the Guildstone to gain full membership.");                       // They have already been accepted for membership, and merely need to use the Guildstone to gain full membership.
                }
                else if (m.Guild != null)
                {
                    m_Mobile.SendAsciiMessage("You can only recruit candidates who are not already in a guild.");                       // You can only recruit candidates who are not already in a guild.
                }

                else if (m_Mobile.AccessLevel >= AccessLevel.GameMaster || m_Guild.Leader == m_Mobile)
                {
                    m_Guild.Accepted.Add(m);
                }
                else
                {
                    m_Guild.Candidates.Add(m);
                }
            }
        }
		protected override void OnTarget( Mobile from, object targeted )
		{
			if ( GuildGump.BadMember( m_Mobile, m_Guild ) )
				return;

			if ( targeted is Mobile )
			{
				Mobile m = (Mobile)targeted;

				PlayerState guildState = PlayerState.Find( m_Guild.Leader );
				PlayerState targetState = PlayerState.Find( m );

				Faction guildFaction = ( guildState == null ? null : guildState.Faction );
				Faction targetFaction = ( targetState == null ? null : targetState.Faction );

				if ( !m.Player )
				{
					m_Mobile.SendLocalizedMessage( 501161 ); // You may only recruit players into the guild.
				}
				else if ( !m.Alive )
				{
					m_Mobile.SendLocalizedMessage( 501162 ); // Only the living may be recruited.
				}
				else if ( m_Guild.IsMember( m ) )
				{
					m_Mobile.SendLocalizedMessage( 501163 ); // They are already a guildmember!
				}
				else if ( m_Guild.Candidates.Contains( m ) )
				{
					m_Mobile.SendLocalizedMessage( 501164 ); // They are already a candidate.
				}
				else if ( m_Guild.Accepted.Contains( m ) )
				{
					m_Mobile.SendLocalizedMessage( 501165 ); // They have already been accepted for membership, and merely need to use the Guildstone to gain full membership.
				}
				else if ( m.Guild != null )
				{
					m_Mobile.SendLocalizedMessage( 501166 ); // You can only recruit candidates who are not already in a guild.
				}
				#region Factions
				else if ( guildFaction != targetFaction )
				{
					if ( guildFaction == null )
						m_Mobile.SendLocalizedMessage( 1013027 ); // That player cannot join a non-faction guild.
					else if ( targetFaction == null )
						m_Mobile.SendLocalizedMessage( 1013026 ); // That player must be in a faction before joining this guild.
					else
						m_Mobile.SendLocalizedMessage( 1013028 ); // That person has a different faction affiliation.
				}
				else if ( targetState != null && targetState.IsLeaving )
				{
					// OSI does this quite strangely, so we'll just do it this way
					m_Mobile.SendMessage( "That person is quitting their faction and so you may not recruit them." );
				}
				#endregion
				else if ( m_Mobile.AccessLevel >= AccessLevel.GameMaster || m_Guild.Leader == m_Mobile )
				{
					m_Guild.Accepted.Add( m );
				}
				else
				{
					m_Guild.Candidates.Add( m );
				}
			}
		}
示例#8
0
        protected override void OnTarget(Mobile from, object targeted)
        {
            if (GuildGump.BadMember(m_Mobile, m_Guild))
            {
                return;
            }

            if (targeted is Mobile || targeted is Items.CertificateOfIdentity)
            {
                Mobile       m  = targeted as Mobile;
                PlayerMobile pm = targeted as PlayerMobile;
                Items.CertificateOfIdentity coi = null;

                if (targeted is Items.CertificateOfIdentity)
                {
                    coi = targeted as Items.CertificateOfIdentity;
                    if (coi.Mobile != null && coi.Mobile.Deleted == false)
                    {                           // reassign
                        m  = coi.Mobile as Mobile;
                        pm = coi.Mobile as PlayerMobile;
                    }
                }

                if (coi != null && (coi.Mobile == null || coi.Mobile.Deleted))
                {
                    from.SendMessage("That identity certificate does not represent a player.");
                }
                else if (!m.Player)
                {
                    m_Mobile.SendLocalizedMessage(501161);                       // You may only recruit players into the guild.
                }
                else if (!m.Alive)
                {
                    m_Mobile.SendLocalizedMessage(501162);                       // Only the living may be recruited.
                }
                else if (m_Guild.IsMember(m))
                {
                    m_Mobile.SendLocalizedMessage(501163);                       // They are already a guildmember!
                }
                //Pix: IOBAlignment check
                else if (pm != null && !(pm.IOBAlignment == IOBAlignment.None || pm.IOBAlignment == m_Guild.IOBAlignment))
                {
                    m_Mobile.SendMessage("Only non-aligned or same-aligned can be recruited.");
                }
                else if (m_Guild.Candidates.Contains(m))
                {
                    m_Mobile.SendLocalizedMessage(501164);                       // They are already a candidate.
                }
                else if (m_Guild.Accepted.Contains(m))
                {
                    m_Mobile.SendLocalizedMessage(501165);                       // They have already been accepted for membership, and merely need to use the Guildstone to gain full membership.
                }
                else if (m.Guild != null)
                {
                    m_Mobile.SendLocalizedMessage(501166);                       // You can only recruit candidates who are not already in a guild.
                }
                else if (m_Mobile.AccessLevel >= AccessLevel.GameMaster || m_Guild.Leader == m_Mobile)
                {
                    m_Guild.Accepted.Add(m);
                }
                else
                {
                    m_Guild.Candidates.Add(m);
                }
            }
        }
        protected override void OnTarget(Mobile from, object targeted)
        {
            if (GuildGump.BadMember(m_Mobile, m_Guild))
            {
                return;
            }

            if (targeted is Mobile || targeted is Items.CertificateOfIdentity)
            {
                Mobile m = targeted as Mobile;

                PlayerState guildState  = PlayerState.Find(m_Guild.Leader);
                PlayerState targetState = PlayerState.Find(m);

                Faction guildFaction  = (guildState == null ? null : guildState.Faction);
                Faction targetFaction = (targetState == null ? null : targetState.Faction);

                PlayerMobile pm = targeted as PlayerMobile;
                Items.CertificateOfIdentity coi = null;

                if (targeted is Items.CertificateOfIdentity)
                {
                    coi = targeted as Items.CertificateOfIdentity;
                    if (coi.Mobile != null && coi.Mobile.Deleted == false)
                    {                           // reassign
                        m  = coi.Mobile as Mobile;
                        pm = coi.Mobile as PlayerMobile;
                    }
                }

                if (coi != null && (coi.Mobile == null || coi.Mobile.Deleted))
                {
                    from.SendMessage("That identity certificate does not represent a player.");
                }
                else if (!m.Player)
                {
                    m_Mobile.SendLocalizedMessage(501161);                     // You may only recruit players into the guild.
                }
                else if (!m.Alive)
                {
                    m_Mobile.SendLocalizedMessage(501162);                     // Only the living may be recruited.
                }
                else if (m_Guild.IsMember(m))
                {
                    m_Mobile.SendLocalizedMessage(501163);                     // They are already a guildmember!
                }
                #region Kin
                else if (pm != null && !(pm.IOBAlignment == IOBAlignment.None || pm.IOBAlignment == m_Guild.IOBAlignment))
                {
                    m_Mobile.SendMessage("Only non-aligned or same-aligned can be recruited.");
                }
                #endregion
                else if (m_Guild.Candidates.Contains(m))
                {
                    m_Mobile.SendLocalizedMessage(501164);                     // They are already a candidate.
                }
                else if (m_Guild.Accepted.Contains(m))
                {
                    m_Mobile.SendLocalizedMessage(501165);                     // They have already been accepted for membership, and merely need to use the Guildstone to gain full membership.
                }
                else if (m.Guild != null)
                {
                    m_Mobile.SendLocalizedMessage(501166);                     // You can only recruit candidates who are not already in a guild.
                }
                #region Factions
                else if (guildFaction != targetFaction)
                {
                    if (guildFaction == null)
                    {
                        m_Mobile.SendLocalizedMessage(1013027);                         // That player cannot join a non-faction guild.
                    }
                    else if (targetFaction == null)
                    {
                        m_Mobile.SendLocalizedMessage(1013026);                         // That player must be in a faction before joining this guild.
                    }
                    else
                    {
                        m_Mobile.SendLocalizedMessage(1013028);                         // That person has a different faction affiliation.
                    }
                }
                else if (targetState != null && targetState.IsLeaving)
                {
                    // OSI does this quite strangely, so we'll just do it this way
                    m_Mobile.SendMessage("That person is quitting their faction and so you may not recruit them.");
                }
                #endregion
                else if (m_Mobile.AccessLevel >= AccessLevel.GameMaster || m_Guild.Leader == m_Mobile)
                {
                    m_Guild.Accepted.Add(m);
                }
                else
                {
                    m_Guild.Candidates.Add(m);
                }
            }
        }