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.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.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_Mobile, m_Guild)) { return; } text = text.Trim(); if (text.Length > 40) { text = text.Substring(0, 40); } if (text.Length > 0) { if (BaseGuild.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; } 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.SendAsciiMessage("New title (20 characters max):"); // 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 > 4) { text = text.Substring(0, 4); } if (text.Length > 0) { if (Guild.FindByAbbrev(text) != null) { m_Mobile.SendAsciiMessage("{0} conflicts with the abbreviation of an existing guild.", text); } else { m_Guild.Abbreviation = text; m_Guild.GuildMessage(1018025, text); // Your guild abbreviation has changed: } } 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) { BaseGuild[] guilds = Guild.Search(text); GuildGump.EnsureClosed(m_Mobile); if (guilds.Length > 0) { m_Mobile.SendGump(new GuildDeclareAllianceGump(m_Mobile, m_Guild, new ArrayList(guilds))); } else { m_Mobile.SendGump(new GuildAllianceAdminGump(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 >= 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(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)); }
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(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_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 > 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; } switch (info.ButtonID) { case 1: // Declare war { //m_Mobile.SendLocalizedMessage( 1018001 ); // Declare war through search - Enter Guild Name: m_Mobile.SendMessage("Declare war through search - Enter Guild Name or Abbreviation:"); 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 OnResponse(NetState state, RelayInfo info) { if (info.ButtonID == 1) { GuildGump.EnsureClosed(m_Mobile); m_Mobile.SendGump(new GuildWarInfoGump(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)); }
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 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; } } }
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)); } }
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 OnCancel(Mobile from) { if (GuildGump.BadLeader(m_Mobile, m_Guild)) { return; } GuildGump.EnsureClosed(m_Mobile); m_Mobile.SendGump(new GuildWarAdminGump(m_Mobile, m_Guild)); }
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 GuildmasterGump(this.m_Mobile, this.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.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: } } 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(this.m_Mobile, this.m_Guild)) { return; } if (info.ButtonID == 1) { 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.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)); }
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) > Core.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: } } 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)); } }
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)); }
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)); } }
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; } 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: } 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; } 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)); } }
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)); } }
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)); } }