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(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; } GuildGump.EnsureClosed(m_Leader); m_Leader.SendGump(new GuildmasterGump(m_Leader, m_Guild)); }
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 (Faction.Find(m_Guild.Leader) != null) { m_Mobile.SendLocalizedMessage(1005288); // You cannot declare war while you are in a faction } 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)); } }
public override void OnResponse(Mobile from, string text) { if (GuildGump.BadLeader(m_Mobile, m_Guild)) { return; } text = text.Trim(); 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."); } }
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)); }
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_Mobile.SendLocalizedMessage(1013074); // New title (20 characters max): m_Mobile.Prompt = new GuildTitlePrompt(m_Mobile, m, m_Guild); } } } } else if (info.ButtonID == 2) { GuildGump.EnsureClosed(m_Mobile); m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild)); } }
public override void OnResponse(Mobile from, string text) { if (GuildGump.BadLeader(m_Mobile, m_Guild)) { return; } text = text.Trim(); if (text.Length > 3) { text = text.Substring(0, 3); } if (text.Length > 0) { if (Guild.FindByAbbrev(text) != null) { m_Mobile.SendMessage("{0} conflicts with the abbreviation of an existing guild.", text); } else { m_Guild.Abbreviation = text; m_Guild.GuildMessage(1018025, true, text); // Your guild abbreviation has changed: } } GuildGump.EnsureClosed(m_Mobile); m_Mobile.SendGump(new GuildmasterGump(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 = (Mobile)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)); }
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.Substring(0, 40); } if (text.Length > 0) { if (Guild.FindByName(text) != null) { m_Mobile.SendMessage("{0} conflicts with the name of an existing guild.", text); } else { m_Guild.Name = text; m_Guild.GuildMessage(1018024, true, text); // The name of your guild has changed: } } GuildGump.EnsureClosed(m_Mobile); m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild)); }
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; } } }
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)); }
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)); }
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; } 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) { PlayerState 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) { m_Mobile.SendGump(new GuildInfoGump((PlayerMobile)m_Mobile, m_Guild)); } return; } GuildGump.EnsureClosed(m_Mobile); m_Mobile.SendGump(new GuildmasterGump(m_Mobile, 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)); } }
public override void OnCancel(Mobile from) { if (GuildGump.BadLeader(m_Leader, m_Guild)) { return; } else if (m_Target.Deleted || !m_Guild.IsMember(m_Target)) { return; } GuildGump.EnsureClosed(m_Leader); m_Leader.SendGump(new GuildmasterGump(m_Leader, m_Guild)); }
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.GuildMessage(1018020, true, "{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)); } }
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.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)); } }
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.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)); } }
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)); }
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.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)); } }
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 4: // Change guild type { if (!Guild.OrderChaos) { return; } GuildGump.EnsureClosed(m_Mobile); m_Mobile.SendGump(new GuildChangeTypeGump(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; } } }
public override void OnResponse(NetState state, RelayInfo info) { if (GuildGump.BadLeader(m_Mobile, m_Guild)) { return; } switch (info.ButtonID) { case 0: { GuildGump.EnsureClosed(m_Mobile); m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild)); break; } case 1: // Accept { 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) { #region Factions 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 (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. } break; } 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."); break; } #endregion m_Guild.Candidates.Remove(m); m_Guild.Accepted.Add(m); GuildGump.EnsureClosed(m_Mobile); if (m_Guild.Candidates.Count > 0) { m_Mobile.SendGump(new GuildAdminCandidatesGump(m_Mobile, m_Guild)); } else { m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild)); } } } } break; } case 2: // Refuse { 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.Candidates.Remove(m); GuildGump.EnsureClosed(m_Mobile); if (m_Guild.Candidates.Count > 0) { m_Mobile.SendGump(new GuildAdminCandidatesGump(m_Mobile, m_Guild)); } else { m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild)); } } } } break; } } }
public override void OnResponse(NetState sender, RelayInfo info) { if (BadMember(m_Mobile, m_Guild)) { return; } switch (info.ButtonID) { case 1: // Loyalty { EnsureClosed(m_Mobile); m_Mobile.SendGump(new DeclareFealtyGump(m_Mobile, m_Guild)); break; } case 2: // Toggle display abbreviation { m_Mobile.DisplayGuildTitle = !m_Mobile.DisplayGuildTitle; EnsureClosed(m_Mobile); m_Mobile.SendGump(new GuildGump(m_Mobile, m_Guild)); break; } case 3: // View the current roster { EnsureClosed(m_Mobile); m_Mobile.SendGump(new GuildRosterGump(m_Mobile, m_Guild)); break; } case 4: // Recruit { m_Mobile.Target = new GuildRecruitTarget(m_Mobile, m_Guild); break; } case 5: // Membership candidates { GuildGump.EnsureClosed(m_Mobile); m_Mobile.SendGump(new GuildCandidatesGump(m_Mobile, m_Guild)); break; } case 6: // View charter { EnsureClosed(m_Mobile); m_Mobile.SendGump(new GuildCharterGump(m_Mobile, m_Guild)); break; } case 7: // Resign { m_Guild.RemoveMember(m_Mobile); break; } case 8: // View wars { EnsureClosed(m_Mobile); m_Mobile.SendGump(new GuildWarGump(m_Mobile, m_Guild)); break; } case 9: // Guildmaster functions { if (m_Mobile.AccessLevel >= AccessLevel.GameMaster || m_Guild.Leader == m_Mobile) { EnsureClosed(m_Mobile); m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild)); } break; } } }