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

            switch (info.ButtonID)
            {
            case 1:                     // Declare alliance
            {
                m_Mobile.SendMessage("Declare alliance through search - Enter Guild Name:");
                m_Mobile.Prompt = new GuildDeclareAlliancePrompt(m_Mobile, m_Guild);

                break;
            }

            case 2:                     // Break alliance
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildBreakAllianceGump(m_Mobile, m_Guild));

                break;
            }

            case 3:                     // Accept alliance
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildAcceptAllianceGump(m_Mobile, m_Guild));

                break;
            }

            case 4:                     // Reject alliance
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildRejectAllianceGump(m_Mobile, m_Guild));

                break;
            }

            case 5:                     // Rescind declarations
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildRescindAllianceGump(m_Mobile, m_Guild));

                break;
            }

            case 6:                     // Return
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));

                break;
            }
            }
        }
コード例 #2
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (GuildGump.BadLeader(m_Mobile, m_Guild))
            {
                return;
            }

            switch (info.ButtonID)
            {
            case 1:                                     // Declare war
            {
                m_Mobile.SendLocalizedMessage(1018001); // Declare war through search - Enter Guild Name:
                m_Mobile.Prompt = new GuildDeclareWarPrompt(m_Mobile, m_Guild);

                break;
            }

            case 2:                     // Declare peace
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildDeclarePeaceGump(m_Mobile, m_Guild));

                break;
            }

            case 3:                     // Accept war
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildAcceptWarGump(m_Mobile, m_Guild));

                break;
            }

            case 4:                     // Reject war
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildRejectWarGump(m_Mobile, m_Guild));

                break;
            }

            case 5:                     // Rescind declarations
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildRescindDeclarationGump(m_Mobile, m_Guild));

                break;
            }

            case 6:                     // Return
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));

                break;
            }
            }
        }
コード例 #3
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (GuildGump.BadLeader(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)
                    {
                        Guild g = (Guild)m_List[index];

                        if (g != null)
                        {
                            if (m_Guild.Peaceful == true)
                            {
                                m_Mobile.SendMessage("You belong to a peaceful guild and may not do that.");
                                m_Guild.WarInvitations.Remove(g);
                                g.WarDeclarations.Remove(m_Guild);
                            }
                            else
                            {
                                m_Guild.WarInvitations.Remove(g);
                                g.WarDeclarations.Remove(m_Guild);

                                m_Guild.AddEnemy(g);
                                m_Guild.GuildMessage(1018020, "{0} ({1})", g.Name, g.Abbreviation);

                                GuildGump.EnsureClosed(m_Mobile);
                            }

                            if (m_Guild.WarInvitations.Count > 0)
                            {
                                m_Mobile.SendGump(new GuildAcceptWarGump(m_Mobile, m_Guild));
                            }
                            else
                            {
                                m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
                            }
                        }
                    }
                }
            }
            else if (info.ButtonID == 2)
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
            }
        }
コード例 #4
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (GuildGump.BadLeader(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)
                    {
                        Guild g = m_List[index];

                        if (g != null)
                        {
                            if (g == m_Guild)
                            {
                                m_Mobile.SendLocalizedMessage(501184);                                   // You cannot declare war against yourself!
                            }
                            else if (g.WarInvitations.Contains(m_Guild) && m_Guild.WarDeclarations.Contains(g) || m_Guild.IsWar(g))
                            {
                                m_Mobile.SendLocalizedMessage(501183);                                   // You are already at war with that guild.
                            }
                            else
                            {
                                if (!m_Guild.WarDeclarations.Contains(g))
                                {
                                    m_Guild.WarDeclarations.Add(g);
                                    m_Guild.GuildMessage(1018019, true, "{0} ({1})", g.Name, g.Abbreviation);                                       // Guild Message: Your guild has sent an invitation for war:
                                }

                                if (!g.WarInvitations.Contains(m_Guild))
                                {
                                    g.WarInvitations.Add(m_Guild);
                                    g.GuildMessage(1018021, true, "{0} ({1})", m_Guild.Name, m_Guild.Abbreviation);                                       // Guild Message: Your guild has received an invitation to war:
                                }
                            }

                            GuildGump.EnsureClosed(m_Mobile);
                            m_Mobile.SendGump(new GuildWarAdminGump(m_Mobile, m_Guild));
                        }
                    }
                }
            }
            else if (info.ButtonID == 2)
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
            }
        }
コード例 #5
0
        public override void OnCancel(Mobile from)
        {
            if (GuildGump.BadLeader(m_Mobile, m_Guild))
            {
                return;
            }

            GuildGump.EnsureClosed(m_Mobile);
            m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
        }
コード例 #6
0
        public override void OnCancel(Mobile from)
        {
            if (GuildGump.BadLeader(this.m_Mobile, this.m_Guild))
            {
                return;
            }

            GuildGump.EnsureClosed(this.m_Mobile);
            this.m_Mobile.SendGump(new GuildWarAdminGump(this.m_Mobile, this.m_Guild));
        }
コード例 #7
0
        public override void OnResponse(Mobile from, string text)
        {
            if (GuildGump.BadLeader(m_Mobile, m_Guild))
            {
                return;
            }

            text = text.Trim();

            if (text.Length > 40)
            {
                text = text[..40];
コード例 #8
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (GuildGump.BadLeader(this.m_Mobile, this.m_Guild))
            {
                return;
            }

            PlayerState pl = PlayerState.Find(this.m_Mobile);

            if (pl != null)
            {
                this.m_Mobile.SendLocalizedMessage(1010405); // You cannot change guild types while in a Faction!
            }
            else if (this.m_Guild.TypeLastChange.AddDays(7) > DateTime.UtcNow)
            {
                this.m_Mobile.SendLocalizedMessage(1005292); // Your guild type will be changed in one week.
            }
            else
            {
                GuildType newType;

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

                case 1:
                    newType = GuildType.Regular;
                    break;

                case 2:
                    newType = GuildType.Order;
                    break;

                case 3:
                    newType = GuildType.Chaos;
                    break;
                }

                if (this.m_Guild.Type == newType)
                {
                    return;
                }

                this.m_Guild.Type = newType;
                this.m_Guild.GuildMessage(1018022, true, newType.ToString()); // Guild Message: Your guild type has changed:
            }

            GuildGump.EnsureClosed(this.m_Mobile);
            this.m_Mobile.SendGump(new GuildmasterGump(this.m_Mobile, this.m_Guild));
        }
コード例 #9
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (GuildGump.BadLeader(m_Mobile, m_Guild))
            {
                return;
            }

            if (info.ButtonID == 1)
            {
                var switches = info.Switches;

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

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

                        if (g != null)
                        {
                            m_Guild.RemoveEnemy(g);
                            m_Guild.GuildMessage(
                                1018018,
                                true,
                                "{0} ({1})",
                                g.Name,
                                g.Abbreviation
                                ); // Guild Message: You are now at peace with this guild:

                            GuildGump.EnsureClosed(m_Mobile);

                            if (m_Guild.Enemies.Count > 0)
                            {
                                m_Mobile.SendGump(new GuildDeclarePeaceGump(m_Mobile, m_Guild));
                            }
                            else
                            {
                                m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
                            }
                        }
                    }
                }
            }
            else if (info.ButtonID == 2)
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
            }
        }
コード例 #10
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (Guild.NewGuildSystem && !BaseGuildGump.IsLeader(m_Mobile, m_Guild) ||
                !Guild.NewGuildSystem && GuildGump.BadLeader(m_Mobile, m_Guild))
            {
                return;
            }

            var newType = info.ButtonID switch
            {
                1 => GuildType.Regular,
                2 => GuildType.Order,
                3 => GuildType.Chaos,
                _ => m_Guild.Type
            };

            if (m_Guild.Type != newType)
            {
                var pl = PlayerState.Find(m_Mobile);

                if (pl != null)
                {
                    m_Mobile.SendLocalizedMessage(1010405); // You cannot change guild types while in a Faction!
                }
                else if (m_Guild.TypeLastChange.AddDays(7) > DateTime.UtcNow)
                {
                    m_Mobile.SendLocalizedMessage(1011142); // You have already changed your guild type recently.
                    // TODO: Clilocs 1011142-1011145 suggest a timer for pending changes
                }
                else
                {
                    m_Guild.Type = newType;
                    m_Guild.GuildMessage(1018022, true, newType.ToString()); // Guild Message: Your guild type has changed:
                }
            }

            if (Guild.NewGuildSystem)
            {
                if (m_Mobile is PlayerMobile mobile)
                {
                    mobile.SendGump(new GuildInfoGump(mobile, m_Guild));
                }

                return;
            }

            GuildGump.EnsureClosed(m_Mobile);
            m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
        }
    }
コード例 #11
0
ファイル: GuildTitlePrompt.cs プロジェクト: silky/ModernUO
        public override void OnCancel(Mobile from)
        {
            if (GuildGump.BadLeader(m_Leader, m_Guild))
            {
                return;
            }
            if (m_Target.Deleted || !m_Guild.IsMember(m_Target))
            {
                return;
            }

            GuildGump.EnsureClosed(m_Leader);
            m_Leader.SendGump(new GuildmasterGump(m_Leader, m_Guild));
        }
コード例 #12
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (GuildGump.BadLeader(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)
                    {
                        Guild g = (Guild)m_List[index];

                        if (g != null)
                        {
                            m_Guild.WarInvitations.Remove(g);
                            g.WarDeclarations.Remove(m_Guild);

                            m_Guild.AddEnemy(g);
                            m_Guild.GuildTextMessage(String.Format("Guild Message: Your guild is now at war: {0} ({1})", g.Name, g.Abbreviation));

                            GuildGump.EnsureClosed(m_Mobile);

                            if (m_Guild.WarInvitations.Count > 0)
                            {
                                m_Mobile.SendGump(new GuildAcceptWarGump(m_Mobile, m_Guild));
                            }
                            else
                            {
                                m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
                            }
                        }
                    }
                }
            }
            else if (info.ButtonID == 2)
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
            }
        }
コード例 #13
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (GuildGump.BadLeader(this.m_Mobile, this.m_Guild))
            {
                return;
            }

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

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

                    if (index >= 0 && index < this.m_List.Count)
                    {
                        Guild g = (Guild)this.m_List[index];

                        if (g != null)
                        {
                            this.m_Guild.WarInvitations.Remove(g);
                            g.WarDeclarations.Remove(this.m_Guild);

                            this.m_Guild.AddEnemy(g);
                            this.m_Guild.GuildMessage(1018020, true, "{0} ({1})", g.Name, g.Abbreviation);

                            GuildGump.EnsureClosed(this.m_Mobile);

                            if (this.m_Guild.WarInvitations.Count > 0)
                            {
                                this.m_Mobile.SendGump(new GuildAcceptWarGump(this.m_Mobile, this.m_Guild));
                            }
                            else
                            {
                                this.m_Mobile.SendGump(new GuildmasterGump(this.m_Mobile, this.m_Guild));
                            }
                        }
                    }
                }
            }
            else if (info.ButtonID == 2)
            {
                GuildGump.EnsureClosed(this.m_Mobile);
                this.m_Mobile.SendGump(new GuildmasterGump(this.m_Mobile, this.m_Guild));
            }
        }
コード例 #14
0
        public override void OnResponse(Mobile from, string text)
        {
            if (GuildGump.BadLeader(m_Leader, m_Guild))
            {
                return;
            }

            if (m_Target.Deleted || !m_Guild.IsMember(m_Target))
            {
                return;
            }

            text = text.Trim();

            if (text.Length > 20)
            {
                text = text[..20];
コード例 #15
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (GuildGump.BadLeader(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)
                    {
                        Guild g = (Guild)m_List[index];

                        if (g != null)
                        {
                            m_Guild.RemoveAlly(g);
                            string s = string.Format("You break your alliance with, {0} {1}", g.Name, g.Abbreviation);
                            m_Guild.GuildMessage(s);

                            GuildGump.EnsureClosed(m_Mobile);

                            if (m_Guild.Allies.Count > 0)
                            {
                                m_Mobile.SendGump(new GuildBreakAllianceGump(m_Mobile, m_Guild));
                            }
                            else
                            {
                                m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
                            }
                        }
                    }
                }
            }
            else if (info.ButtonID == 2)
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
            }
        }
コード例 #16
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (GuildGump.BadLeader(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)
                    {
                        Guild g = m_List[index];

                        if (g != null)
                        {
                            m_Guild.WarDeclarations.Remove(g);
                            g.WarInvitations.Remove(m_Guild);

                            GuildGump.EnsureClosed(m_Mobile);

                            if (m_Guild.WarDeclarations.Count > 0)
                            {
                                m_Mobile.SendGump(new GuildRescindDeclarationGump(m_Mobile, m_Guild));
                            }
                            else
                            {
                                m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
                            }
                        }
                    }
                }
            }
            else if (info.ButtonID == 2)
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
            }
        }
コード例 #17
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (GuildGump.BadLeader(m_Mobile, m_Guild))
            {
                return;
            }

            PlayerState pl = PlayerState.Find(m_Mobile);

            if (pl != null)
            {
                m_Mobile.SendMessage("Voce nao pode mudar de Alinhamento enquanto esta em uma Faccao"); // You cannot change guild types while in a Faction!
            }
            else if (m_Guild.TypeLastChange.AddDays(7) > DateTime.Now)
            {
                m_Mobile.SendMessage("Seu Alinhamento sera alterado em dentro de uma semana");                   // Your guild type will be changed in one week.
            }
            else
            {
                GuildType newType;

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

                case 1: newType = GuildType.Regular; break;

                case 2: newType = GuildType.Order;   break;

                case 3: newType = GuildType.Chaos;   break;
                }

                if (m_Guild.Type == newType)
                {
                    return;
                }

                m_Guild.Type = newType;
                m_Guild.GuildMessage(1018022, true, newType.ToString());                   // Guild Message: Your guild type has changed:
            }

            GuildGump.EnsureClosed(m_Mobile);
            m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
        }
コード例 #18
0
    public override void OnResponse(Mobile from, string text)
    {
      if (GuildGump.BadLeader(m_Mobile, m_Guild))
        return;

      text = text.Trim();

      if (text.Length > 50)
        text = text.Substring(0, 50);

      if (text.Length > 0)
        m_Guild.Charter = text;

      m_Mobile.SendLocalizedMessage(1013072); // Enter the new website for the guild (50 characters max):
      m_Mobile.Prompt = new GuildWebsitePrompt(m_Mobile, m_Guild);

      GuildGump.EnsureClosed(m_Mobile);
      m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
    }
コード例 #19
0
ファイル: GuildWebsitePrompt.cs プロジェクト: silky/ModernUO
        public override void OnResponse(Mobile from, string text)
        {
            if (GuildGump.BadLeader(m_Mobile, m_Guild))
            {
                return;
            }

            text = text.Trim();

            if (text.Length > 50)
            {
                text = text.Substring(0, 50);
            }

            if (text.Length > 0)
            {
                m_Guild.Website = text;
            }

            GuildGump.EnsureClosed(m_Mobile);
            m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
        }
コード例 #20
0
        public override void OnResponse(Mobile from, string text)
        {
            if (GuildGump.BadLeader(m_Mobile, m_Guild))
            {
                return;
            }

            text = text.Trim();

            Guild guild = Guild.FindByAbbrev(text) as Guild;

            if (guild != null)
            {
                GuildGump.EnsureClosed(m_Mobile);
                List <Guild> guilds = new List <Guild>();
                guilds.Add(guild);
                m_Mobile.SendGump(new GuildDeclareWarGump(m_Mobile, m_Guild, guilds));
            }
            else if (text.Length >= 3)
            {
                List <Guild> guilds = Utility.CastConvertList <BaseGuild, Guild>(Guild.Search(text));

                GuildGump.EnsureClosed(m_Mobile);

                if (guilds.Count > 0)
                {
                    m_Mobile.SendGump(new GuildDeclareWarGump(m_Mobile, m_Guild, guilds));
                }
                else
                {
                    m_Mobile.SendGump(new GuildWarAdminGump(m_Mobile, m_Guild));
                    m_Mobile.SendLocalizedMessage(1018003);                       // No guilds found matching - try another name in the search
                }
            }
            else
            {
                m_Mobile.SendMessage("Search string must be at least three letters in length or a valid guild abbreviation.");
            }
        }
コード例 #21
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (GuildGump.BadLeader(m_Mobile, m_Guild))
            {
                return;
            }

            if (m_Guild.TypeLastChange.AddDays(7) > DateTime.Now)
            {
                m_Mobile.SendLocalizedMessage(1005292);                   // Your guild type will be changed in one week.
            }
            else
            {
                GuildType newType;

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

                case 1: newType = GuildType.Regular; break;

                case 2: newType = GuildType.Order;   break;

                case 3: newType = GuildType.Chaos;   break;
                }

                if (m_Guild.Type == newType)
                {
                    return;
                }

                m_Guild.Type = newType;
                m_Guild.GuildMessage(1018022, true, newType.ToString());                   // Guild Message: Your guild type has changed:
            }

            GuildGump.EnsureClosed(m_Mobile);
            m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
        }
コード例 #22
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (GuildGump.BadLeader(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 = (Mobile)m_List[index];

                        if (m != null && !m.Deleted)
                        {
                            m_Guild.RemoveMember(m);

                            if (m_Mobile == m_Guild.Leader)
                            {
                                GuildGump.EnsureClosed(m_Mobile);
                                m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
                            }
                        }
                    }
                }
            }
            else if (info.ButtonID == 2)
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
            }
        }
コード例 #23
0
ファイル: GuildDismissGump.cs プロジェクト: alucardxlx/forkuo
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (GuildGump.BadLeader(this.m_Mobile, this.m_Guild))
            {
                return;
            }

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

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

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

                        if (m != null && !m.Deleted)
                        {
                            this.m_Guild.RemoveMember(m);

                            if (this.m_Mobile.AccessLevel >= AccessLevel.GameMaster || this.m_Mobile == this.m_Guild.Leader)
                            {
                                GuildGump.EnsureClosed(this.m_Mobile);
                                this.m_Mobile.SendGump(new GuildmasterGump(this.m_Mobile, this.m_Guild));
                            }
                        }
                    }
                }
            }
            else if (info.ButtonID == 2 && (this.m_Mobile.AccessLevel >= AccessLevel.GameMaster || this.m_Mobile == this.m_Guild.Leader))
            {
                GuildGump.EnsureClosed(this.m_Mobile);
                this.m_Mobile.SendGump(new GuildmasterGump(this.m_Mobile, this.m_Guild));
            }
        }
コード例 #24
0
        public override void OnResponse(Mobile from, string text)
        {
            if (GuildGump.BadLeader(m_Mobile, m_Guild))
            {
                return;
            }

            text = text.Trim();

            if (text.Length > 20)
            {
                text = text.Substring(0, 20);
            }

            if (text.Length > 0)
            {
                if (BaseGuild.FindByAbbrev(text) != null)
                {
                    m_Mobile.SendMessage("{0} conflicts with the abbreviation of an existing guild.", text);
                }
                else
                {
                    if (text.Length > 20)
                    {
                        m_Mobile.SendMessage("Your Guild Abrevation is too long.");
                    }
                    else
                    {
                        m_Guild.Abbreviation = text;
                        m_Guild.GuildTextMessage("Your guild abbreviation has changed to: " + m_Guild.Abbreviation);
                        //m_Guild.GuildMessage(1018025, true, "2Your guild abbreviation has changed to: " + m_Guild.Abbreviation); // Your guild abbreviation has changed:
                    }
                }
            }

            GuildGump.EnsureClosed(m_Mobile);
            m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
        }
コード例 #25
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (GuildGump.BadLeader(m_Mobile, m_Guild))
            {
                return;
            }

            if (info.ButtonID == 1)
            {
                var switches = info.Switches;

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

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

                        if (m?.Deleted == false)
                        {
                            m_Guild.RemoveMember(m);

                            if (m_Mobile.AccessLevel >= AccessLevel.GameMaster || m_Mobile == m_Guild.Leader)
                            {
                                GuildGump.EnsureClosed(m_Mobile);
                                m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
                            }
                        }
                    }
                }
            }
            else if (info.ButtonID == 2 && (m_Mobile.AccessLevel >= AccessLevel.GameMaster || m_Mobile == m_Guild.Leader))
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
            }
        }
コード例 #26
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (GuildGump.BadLeader(m_Mobile, m_Guild))
            {
                return;
            }

            GuildType newType;

            switch (info.ButtonID)
            {
            default: newType = m_Guild.Type;     break;

            case 1: newType = GuildType.Regular; break;

            case 2: newType = GuildType.Order;   break;

            case 3: newType = GuildType.Chaos;   break;
            }

            if (m_Guild.Type != newType)
            {
                if (m_Guild.TypeLastChange.AddDays(7) > DateTime.Now)
                {
                    m_Mobile.SendLocalizedMessage(1011142);                       // You have already changed your guild type recently.
                    // TODO: Clilocs 1011142-1011145 suggest a timer for pending changes
                }
                else
                {
                    m_Guild.Type = newType;
                    m_Guild.GuildMessage(1018022, true, newType.ToString());                       // Guild Message: Your guild type has changed:
                }
            }

            GuildGump.EnsureClosed(m_Mobile);
            m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
        }
コード例 #27
0
        public override void OnResponse(Mobile from, string text)
        {
            if (GuildGump.BadLeader(m_Leader, m_Guild))
            {
                return;
            }
            else if (m_Target.Deleted || !m_Guild.IsMember(m_Target))
            {
                return;
            }

            text = text.Trim();

            if (text.Length > 20)
            {
                text = text.Substring(0, 20);
            }

            if (text.Length > 0)
            {
                m_Target.GuildTitle = text;
            }

            if (m_Leader == m_Target)
            {
                from.SendAsciiMessage(string.Format("You have changed your title to: {0}", text));
            }
            else if (m_Target != null)
            {
                from.SendAsciiMessage(string.Format("You have changed {0}'s title to: {1}", m_Target.Name, text));
            }


            GuildGump.EnsureClosed(m_Leader);
            m_Leader.SendGump(new GuildmasterGump(m_Leader, m_Guild));
        }
コード例 #28
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (GuildGump.BadLeader(m_Mobile, m_Guild))
            {
                return;
            }

            GuildType    newType    = m_Guild.Type;         //GuildType.Regular;
            IOBAlignment newIOBType = m_Guild.IOBAlignment; //IOBAlignment.None;

            switch (info.ButtonID)
            {
            default: break;                    //return; // Close

            case 1: newType = GuildType.Regular;        break;

            case 2: newType = GuildType.Order;                      break;

            case 3: newType = GuildType.Chaos;                      break;

            case 5: newIOBType = IOBAlignment.Brigand;      break;

            case 6: newIOBType = IOBAlignment.Council;      break;

            case 7: newIOBType = IOBAlignment.Good;         break;

            case 8: newIOBType = IOBAlignment.Orcish;       break;

            case 9: newIOBType = IOBAlignment.Pirate;       break;

            case 10: newIOBType = IOBAlignment.Savage;      break;

            case 11: newIOBType = IOBAlignment.Undead;      break;

            case 12: newIOBType = IOBAlignment.None;    break;
            }

            if (m_Guild.IOBAlignment != newIOBType && CanChangeKin() == false)
            {
                m_Mobile.SendMessage("Guild Kin Alignment change is currently disabled.");
                return;
            }

            if ((m_Guild.Type != newType || m_Guild.IOBAlignment != newIOBType) &&
                m_Guild.TypeLastChange.AddDays(7) > DateTime.Now)
            {
                m_Mobile.SendMessage("You can only change your alignment once every 7 days.");
            }
            else
            {
                if (m_Guild.Type != newType)
                {
                    //Changing Order/Chaos

                    //Check that Order/Chaos guilds aren't allied
                    if (newType != GuildType.Regular)                    //we only care if there changeing to a differnt special type
                    {
                        ArrayList Allies = m_Guild.Allies;

                        for (int i = 0; i < Allies.Count; ++i)
                        {
                            Guild g = (Guild)Allies[i];

                            if (g.Type != GuildType.Regular && g.Type != newType)
                            {
                                m_Mobile.SendMessage("Break any alliances with opposing guild types first");
                                return;
                            }
                        }
                    }

                    //Change the Guild!
                    m_Guild.Type = newType;
                    m_Guild.GuildMessage(1018022, newType.ToString());                       // Guild Message: Your guild type has changed:
                }
                else if (m_Guild.IOBAlignment != newIOBType)
                {
                    //Changing KIN

                    //Check that different IOB types aren't allied
                    if (newIOBType != IOBAlignment.None)
                    {
                        ArrayList Allies = m_Guild.Allies;

                        for (int i = 0; i < Allies.Count; ++i)
                        {
                            Guild g = (Guild)Allies[i];

                            if (g.IOBAlignment != IOBAlignment.None && g.IOBAlignment != newIOBType)
                            {
                                m_Mobile.SendMessage("Break any alliances with opposing guild types first");
                                return;
                            }
                        }
                    }

                    //Change the Guild!
                    m_Guild.IOBAlignment = newIOBType;
                    if (m_Guild.IOBAlignment != IOBAlignment.None)
                    {
                        m_Guild.GuildMessage("Your guild is now allied with the " + this.TranslateIOBName(newIOBType));
                    }
                    else
                    {
                        m_Guild.GuildMessage("Your guild has broken its kin alignment, it is now unaligned.");
                    }
                }
                else
                {
                    m_Mobile.SendMessage("You have not changed your alignment.");
                }
            }


            GuildGump.EnsureClosed(m_Mobile);
            m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
        }
コード例 #29
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (GuildGump.BadLeader(m_Mobile, m_Guild))
            {
                return;
            }

            switch (info.ButtonID)
            {
            case 1:                     // Main menu
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildGump(m_Mobile, m_Guild));

                break;
            }

            case 2:                                     // Set guild name
            {
                m_Mobile.SendLocalizedMessage(1013060); // Enter new guild name (40 characters max):
                m_Mobile.Prompt = new GuildNamePrompt(m_Mobile, m_Guild);

                break;
            }

            case 3:                                     // Set guild abbreviation
            {
                m_Mobile.SendLocalizedMessage(1013061); // Enter new guild abbreviation (3 characters max):
                m_Mobile.Prompt = new GuildAbbrvPrompt(m_Mobile, m_Guild);

                break;
            }

            case 5:                                     // Set charter
            {
                m_Mobile.SendLocalizedMessage(1013071); // Enter the new guild charter (50 characters max):
                m_Mobile.Prompt = new GuildCharterPrompt(m_Mobile, m_Guild);

                break;
            }

            case 6:                     // Dismiss member
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildDismissGump(m_Mobile, m_Guild));

                break;
            }

            case 7:                     // War menu
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildWarAdminGump(m_Mobile, m_Guild));

                break;
            }

            case 8:                     // Administer candidates
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildAdminCandidatesGump(m_Mobile, m_Guild));

                break;
            }

            case 9:                                     // Set guildmaster's title
            {
                m_Mobile.SendLocalizedMessage(1013073); // Enter new guildmaster title (20 characters max):
                m_Mobile.Prompt = new GuildTitlePrompt(m_Mobile, m_Mobile, m_Guild);

                break;
            }

            case 10:                     // Grant title
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GrantGuildTitleGump(m_Mobile, m_Guild));

                break;
            }

            case 11:                     // Move guildstone
            {
                if (m_Guild.Guildstone != null)
                {
                    GuildTeleporter item = new GuildTeleporter(m_Guild.Guildstone);

                    if (m_Guild.Teleporter != null)
                    {
                        m_Guild.Teleporter.Delete();
                    }

                    m_Mobile.SendLocalizedMessage(501133);                               // Use the teleporting object placed in your backpack to move this guildstone.

                    m_Mobile.AddToBackpack(item);
                    m_Guild.Teleporter = item;
                }

                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));

                break;
            }
            }
        }
コード例 #30
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (GuildGump.BadLeader(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)
                    {
                        Guild g = (Guild)m_List[index];

                        if (g != null)
                        {
                            if (g.IOBAlignment != IOBAlignment.None &&
                                m_Guild.IOBAlignment != IOBAlignment.None &&
                                g.IOBAlignment != m_Guild.IOBAlignment)
                            {
                                //If we're both not aligned, and aligned to different kin, then we can't ally.
                                m_Mobile.SendMessage("You cannot ally with different kin.");
                                m_Guild.AllyInvitations.Remove(g);
                                g.AllyDeclarations.Remove(m_Guild);
                            }
                            else if (m_Guild.Peaceful == true)
                            {
                                m_Mobile.SendMessage("You belong to a peaceful guild and may not do that.");
                                m_Guild.AllyInvitations.Remove(g);
                                g.AllyDeclarations.Remove(m_Guild);
                            }
                            else
                            {
                                m_Guild.AllyInvitations.Remove(g);
                                g.AllyDeclarations.Remove(m_Guild);

                                m_Guild.AddAlly(g);
                                string s = string.Format("Your guild is now allied, {0} {1}", g.Name, g.Abbreviation);
                                m_Guild.GuildMessage(s);

                                GuildGump.EnsureClosed(m_Mobile);
                            }

                            if (m_Guild.AllyInvitations.Count > 0)
                            {
                                m_Mobile.SendGump(new GuildAcceptAllianceGump(m_Mobile, m_Guild));
                            }
                            else
                            {
                                m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
                            }
                        }
                    }
                }
            }
            else if (info.ButtonID == 2)
            {
                GuildGump.EnsureClosed(m_Mobile);
                m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild));
            }
        }