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; } } }
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 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 ((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.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 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; } } }