public GuildTrack( Mobile from, Guild guild, bool locations ) : base(0x02, ( ( guild.Members.Count - 1 ) * ( locations ? 10 : 4 ) ) + 5) { m_Stream.Write( (byte) ( locations ? 1 : 0 ) ); for ( int i = 0; i < guild.Members.Count; ++i ) { Mobile mob = guild.Members[i]; if ( mob == null || mob == from || mob.NetState == null ) continue; if ( locations && Utility.InUpdateRange( from, mob ) && from.CanSee( mob ) ) continue; m_Stream.Write( (int) mob.Serial ); if ( locations ) { m_Stream.Write( (short) mob.X ); m_Stream.Write( (short) mob.Y ); m_Stream.Write( (byte) ( mob.Map == null ? 0 : mob.Map.MapID ) ); if ( Settings.GuildHitsPercent && mob.Alive ) m_Stream.Write( (byte) ( mob.Hits / Math.Max( mob.HitsMax, 1.0 ) * 100 ) ); else m_Stream.Write( (byte) 0 ); } } m_Stream.Write( (int) 0 ); }
public GuildChangeTypeGump( Mobile from, Guild guild ) : base( 20, 30 ) { m_Mobile = from; m_Guild = guild; Dragable = false; AddPage( 0 ); AddBackground( 0, 0, 550, 400, 5054 ); AddBackground( 10, 10, 530, 380, 3000 ); AddHtmlLocalized( 20, 15, 510, 30, 1013062, false, false ); // <center>Change Guild Type Menu</center> AddHtmlLocalized( 50, 50, 450, 30, 1013066, false, false ); // Please select the type of guild you would like to change to AddButton( 20, 100, 4005, 4007, 1, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 85, 100, 300, 30, 1013063, false, false ); // Standard guild AddButton( 20, 150, 4005, 4007, 2, GumpButtonType.Reply, 0 ); AddItem( 50, 143, 7109 ); AddHtmlLocalized( 85, 150, 300, 300, 1013064, false, false ); // Order guild AddButton( 20, 200, 4005, 4007, 3, GumpButtonType.Reply, 0 ); AddItem( 45, 200, 7107 ); AddHtmlLocalized( 85, 200, 300, 300, 1013065, false, false ); // Chaos guild AddButton( 300, 360, 4005, 4007, 4, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 335, 360, 150, 30, 1011012, false, false ); // CANCEL }
public Guildstone( Guild g ) : base(0xED4) { m_Guild = g; Movable = false; }
public WarDeclarationGump( PlayerMobile pm, Guild g, Guild otherGuild ) : base(pm, g) { m_Other = otherGuild; WarDeclaration war = g.FindPendingWar( otherGuild ); AddPage( 0 ); AddBackground( 0, 0, 500, 340, 0x24AE ); AddBackground( 65, 50, 370, 30, 0x2486 ); AddHtmlLocalized( 75, 55, 370, 26, 1062979, 0x3C00, false, false ); // <div align=center><i>Declaration of War</i></div> AddImage( 410, 45, 0x232C ); AddHtmlLocalized( 65, 95, 200, 20, 1063009, 0x14AF, false, false ); // <i>Duration of War</i> AddHtmlLocalized( 65, 120, 400, 20, 1063010, 0x0, false, false ); // Enter the number of hours the war will last. AddBackground( 65, 150, 40, 30, 0x2486 ); AddTextEntry( 70, 154, 50, 30, 0x481, 10, (war != null) ? war.WarLength.Hours.ToString() : "0" ); AddHtmlLocalized( 65, 195, 200, 20, 1063011, 0x14AF, false, false ); // <i>Victory Condition</i> AddHtmlLocalized( 65, 220, 400, 20, 1063012, 0x0, false, false ); // Enter the winning number of kills. AddBackground( 65, 250, 40, 30, 0x2486 ); AddTextEntry( 70, 254, 50, 30, 0x481, 11, (war != null) ? war.MaxKills.ToString() : "0" ); AddBackground( 190, 270, 130, 26, 0x2486 ); AddButton( 195, 275, 0x845, 0x846, 0, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 220, 273, 90, 26, 1006045, 0x0, false, false ); // Cancel AddBackground( 330, 270, 130, 26, 0x2486 ); AddButton( 335, 275, 0x845, 0x846, 1, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 360, 273, 90, 26, 1062989, 0x5000, false, false ); // Declare War! }
public GuildMemberInfoGump( PlayerMobile pm, Guild g, PlayerMobile member, bool toKick, bool toPromoteToLeader ) : base( pm, g, 10, 40 ) { m_ToLeader = toPromoteToLeader; m_toKick = toKick; m_Member = member; PopulateGump(); }
public GuildChangeTypeGump( Mobile from, Guild guild ) : base(20, 30) { m_Mobile = from; m_Guild = guild; Dragable = true; AddPage( 0 ); AddBackground(0, 0, 550, 400, 9270); //AddBackground( 10, 10, 530, 380, 3000 ); AddHtml(20, 15, 510, 30, "<center>Mudar Alinhamento da Guilda</center>", false, false); // <center>Change Guild Type Menu</center> AddHtml(50, 50, 450, 30, "Selecione o Alinhamento da Guilda", false, false); // Please select the type of guild you would like to change to AddButton( 20, 100, 4005, 4007, 1, GumpButtonType.Reply, 0 ); AddHtml(85, 100, 300, 30, "Neutro", false, false); // Standard guild AddButton( 20, 150, 4005, 4007, 2, GumpButtonType.Reply, 0 ); AddItem( 50, 143, 7109 ); AddHtml(85, 150, 300, 300, "Order Guild", false, false); // Order guild AddButton( 20, 200, 4005, 4007, 3, GumpButtonType.Reply, 0 ); AddItem( 45, 200, 7107 ); AddHtml(85, 200, 300, 300, "Chaos Guild", false, false); // Chaos guild AddButton( 300, 360, 4005, 4007, 4, GumpButtonType.Reply, 0 ); AddHtml(335, 360, 150, 30, "Cancelar", false, false); // CANCEL }
public GuildCharterGump( Mobile from, Guild guild ) : base(20, 30) { m_Mobile = from; m_Guild = guild; Dragable = false; AddPage( 0 ); AddBackground( 0, 0, 550, 400, 5054 ); AddBackground( 10, 10, 530, 380, 3000 ); AddButton( 20, 360, 4005, 4007, 1, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 55, 360, 300, 35, 1011120, false, false ); // Return to the main menu. string charter; if ( (charter = guild.Charter) == null || (charter = charter.Trim()).Length <= 0 ) AddHtmlLocalized( 20, 20, 400, 35, 1013032, false, false ); // No charter has been defined. else AddHtml( 20, 20, 510, 75, charter, true, true ); AddButton( 20, 200, 4005, 4007, 2, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 55, 200, 300, 20, 1011122, false, false ); // Visit the guild website : string website; if ( (website = guild.Website) == null || (website = website.Trim()).Length <= 0 ) website = DefaultWebsite; AddHtml( 55, 220, 300, 20, website, false, false ); }
public GuildAdvancedSearchGump(PlayerMobile pm, Guild g, GuildDisplayType display, SearchSelectionCallback callback) : base(pm, g) { this.m_Callback = callback; this.m_Display = display; this.PopulateGump(); }
public GuildInvitationRequest( PlayerMobile pm, Guild g, PlayerMobile inviter ) : base(pm, g) { m_Inviter = inviter; PopulateGump(); }
public override void OnResponse( Mobile from, string text ) { if ( m_Deed.Deleted ) return; if ( !m_Deed.IsChildOf( from.Backpack ) ) { from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it. } else { m_Deed.Delete(); Guild guild = new Guild( from, "Chaos", "none" ); from.Guild = guild; from.GuildTitle = "Guildmaster" ; ChaosStone stone = new ChaosStone( guild ); stone.MoveToWorld( from.Location, from.Map ); guild.Guildstone = stone; guild.Type = GuildType.Chaos; guild.Abbreviation = "RP"; } }
public GuildmasterMenu( Mobile from, Guild guild ) : base("GUILDMASTER FUNCTIONS", null) { m_Mobile = from; m_Guild = guild; List<String> list = new List<String>(); list.Add( "Set the guild name." ); list.Add( "Set the guild's abbreviation." ); list.Add( "Set the guild's charter." ); list.Add( "Dismiss a member." ); list.Add( "Go to the WAR menu." ); if ( m_Guild.Candidates.Count > 0 ) { list.Add( "Administer the list of candidates" ); } else { list.Add( "There are currently no candidates for membership." ); } list.Add( "Set the guildmaster's title." ); list.Add( "Grant a title to another member." ); list.Add( "Move this guildstone." ); list.Add( "Access Guild Protection menu." ); list.Add( "Return to the main menu." ); Answers = list.ToArray(); }
public BaseGuildGump( PlayerMobile pm, Guild g, int x, int y ) : base( x, y ) { m_Guild = g; m_Player = pm; pm.CloseGump( typeof( BaseGuildGump ) ); }
public NewPlayerGuildJoinGump(Guild guild, Mobile m) : base(0, 0) { _Guild = guild; Closable = true; Disposable = true; Dragable = true; Resizable = false; AddPage(0); AddBackground(27, 83, 424, 357, 9200); AddImage(127, 174, 1418); AddImageTiled(30, 85, 21, 349, 10464); AddImageTiled(426, 87, 21, 349, 10464); AddImage(417, 27, 10441); AddImage(205, 44, 9000); AddLabel(63, 158, 54, ("Welcome to UO:Forever, " + m.Name)); AddLabel(55, 185, 2047, "If you would like to join the new player's guild, click the"); AddLabel(55, 205, 2047, "okay button below. The new player's guild will help you get"); AddLabel(55, 225, 2047, "started on your journey. They will provide you with valuable"); AddLabel(55, 250, 2047, "supplies and knowledge that will aid you on your adventures"); AddLabel(55, 275, 2047, "throughout the world of Sosaria!"); AddButton(55, 340, 247, 248, 1, GumpButtonType.Reply, 0); AddButton(147, 340, 242, 243, 0, GumpButtonType.Reply, 0); AddImageTiled(63, 176, 253, 1, 5410); }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch ( version ) { case 1: { m_Guild = reader.ReadGuild() as Server.Guilds.Guild; goto case 0; } case 0: { break; } } if ( m_Guild == null ) this.Delete(); else Timer.DelayCall( TimeSpan.Zero, new TimerCallback( ResetType ) ); }
public NewPlayerGuildHelpGump(Guild guild, Mobile m) : base(0, 0) { _Guild = guild; Closable = true; Disposable = true; Dragable = true; Resizable = false; AddPage(0); AddBackground(27, 83, 424, 357, 9200); AddImage(127, 174, 1418); AddImageTiled(30, 85, 21, 349, 10464); AddImageTiled(426, 87, 21, 349, 10464); AddImage(417, 27, 10441); AddImage(205, 44, 9000); AddLabel(63, 158, 54, ("Congratulations on joining the new player's guild, " + m.Name)); AddLabel(55, 185, 2047, "Here are a few things you need to know about your guild:"); AddLabel(55, 205, 2047, "-The NEW guild is run by " + guild.Leader.Name); AddLabel(55, 225, 2047, "-To type in guild chat, type \\ then your message"); AddLabel(55, 250, 2047, "-To type in alliance chat, type shift+\\ then your message"); AddLabel(55, 275, 2047, "-To resign from your guild, type I resign from my guild"); AddButton(55, 340, 247, 248, 1, GumpButtonType.Reply, 0); AddImageTiled(63, 176, 380, 1, 5410); }
public OtherGuildInfo( PlayerMobile pm, Guild g, Guild otherGuild ) : base( pm, g, 10, 40 ) { m_Other = otherGuild; g.CheckExpiredWars(); PopulateGump(); }
public Guildstone( Guild g, string guildName, string abbrev ) : base( Guild.NewGuildSystem ? 0xED6 : 0xED4 ) { m_Guild = g; m_GuildName = guildName; m_GuildAbbrev = abbrev; Movable = false; }
public Guildstone( Guild g, string guildName, string abbrev ) : base( 0xEDE /*Guild.NewGuildSystem ? 0xED6 : 0xED4*/ ) //Iza - proper guildstone { m_Guild = g; m_GuildName = guildName; m_GuildAbbrev = abbrev; Movable = false; }
public static bool BadMember(Mobile m, Guild g) { if (m.Deleted || g.Disbanded || (m.AccessLevel < AccessLevel.GameMaster && !g.IsMember(m))) return true; Item stone = g.Guildstone; return (stone == null || stone.Deleted || !m.InRange(stone.GetWorldLocation(), 2)); }
public GuildWarAdminGump( Mobile from, Guild guild ) : base(20, 30) { m_Mobile = from; m_Guild = guild; Dragable = false; AddPage( 0 ); AddBackground(0, 0, 550, 440, 9270); //AddBackground( 10, 10, 530, 420, 9270 ); AddHtml(20, 10, 510, 35, "<center>GUILD WAR</center>", false, false); // <center>WAR FUNCTIONS</center> AddButton( 20, 40, 4005, 4007, 1, GumpButtonType.Reply, 0 ); AddHtml(55, 40, 400, 30, "Pesquisar Guilda para Declarar Guerra", false, false); // Declare war through guild name search. int count = 0; if ( guild.Enemies.Count > 0 ) { AddButton( 20, 160 + (count * 30), 4005, 4007, 2, GumpButtonType.Reply, 0 ); AddHtml(55, 160 + (count++ * 30), 400, 30, "Declarar Paz", false, false); // Declare peace. } else { AddHtml(20, 160 + (count++ * 30), 400, 30, "Sem Guerras no momento", false, false); // No current wars } if ( guild.WarInvitations.Count > 0 ) { AddButton( 20, 160 + (count * 30), 4005, 4007, 3, GumpButtonType.Reply, 0 ); AddHtml(55, 160 + (count++ * 30), 400, 30, "Aceitar solicitações de Guerra", false, false); // Accept war invitations. AddButton( 20, 160 + (count * 30), 4005, 4007, 4, GumpButtonType.Reply, 0 ); AddHtml(55, 160 + (count++ * 30), 400, 30, "Recusar solicitações de Guerra", false, false); // Reject war invitations. } else { AddHtml(20, 160 + (count++ * 30), 400, 30, "Sem convites de Guerra", false, false); // No current invitations received for war. } if ( guild.WarDeclarations.Count > 0 ) { AddButton( 20, 160 + (count * 30), 4005, 4007, 5, GumpButtonType.Reply, 0 ); AddHtml(55, 160 + (count++ * 30), 400, 30, "Aceitar Guerra", false, false); // Rescind your war declarations. } else { AddHtml(20, 160 + (count++ * 30), 400, 30, "Sem Guerras Declaradas", false, false); // No current war declarations } AddButton( 20, 400, 4005, 4007, 6, GumpButtonType.Reply, 0 ); AddHtml(55, 400, 400, 35, "Retornar", false, false); // Return to the previous menu. }
public GuildWarAdminGump( Mobile from, Guild guild ) : base(20, 30) { m_Mobile = from; m_Guild = guild; Dragable = false; AddPage( 0 ); AddBackground( 0, 0, 550, 440, 5054 ); AddBackground( 10, 10, 530, 420, 3000 ); AddHtmlLocalized( 20, 10, 510, 35, 1011105, false, false ); // <center>WAR FUNCTIONS</center> AddButton( 20, 40, 4005, 4007, 1, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 55, 40, 400, 30, 1011099, false, false ); // Declare war through guild name search. int count = 0; if ( guild.Enemies.Count > 0 ) { AddButton( 20, 160 + (count * 30), 4005, 4007, 2, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 55, 160 + (count++ * 30), 400, 30, 1011103, false, false ); // Declare peace. } else { AddHtmlLocalized( 20, 160 + (count++ * 30), 400, 30, 1013033, false, false ); // No current wars } if ( guild.WarInvitations.Count > 0 ) { AddButton( 20, 160 + (count * 30), 4005, 4007, 3, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 55, 160 + (count++ * 30), 400, 30, 1011100, false, false ); // Accept war invitations. AddButton( 20, 160 + (count * 30), 4005, 4007, 4, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 55, 160 + (count++ * 30), 400, 30, 1011101, false, false ); // Reject war invitations. } else { AddHtmlLocalized( 20, 160 + (count++ * 30), 400, 30, 1018012, false, false ); // No current invitations received for war. } if ( guild.WarDeclarations.Count > 0 ) { AddButton( 20, 160 + (count * 30), 4005, 4007, 5, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 55, 160 + (count++ * 30), 400, 30, 1011102, false, false ); // Rescind your war declarations. } else { AddHtmlLocalized( 20, 160 + (count++ * 30), 400, 30, 1013055, false, false ); // No current war declarations } AddButton( 20, 400, 4005, 4007, 6, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 55, 400, 400, 35, 1011104, false, false ); // Return to the previous menu. }
public GuildAllianceAdminGump( Mobile from, Guild guild ) : base( 20, 30 ) { m_Mobile = from; m_Guild = guild; Dragable = false; AddPage( 0 ); AddBackground( 0, 0, 550, 440, 5054 ); AddBackground( 10, 10, 530, 420, 3000 ); AddHtml( 20, 10, 510, 35, "<center>ALLY FUNCTIONS</center>", false, false ); // <center>WAR FUNCTIONS</center> AddButton( 20, 40, 4005, 4007, 1, GumpButtonType.Reply, 0 ); AddHtml( 55, 40, 400, 30, "Declare an alliance through guild name search", false, false ); // Declare war through guild name search. int count = 0; if ( guild.Allies.Count > 0 ) { AddButton( 20, 160 + (count * 30), 4005, 4007, 2, GumpButtonType.Reply, 0 ); AddHtml( 55, 160 + (count++ * 30), 400, 30, "Break alliance", false, false ); // Declare peace. } else { AddHtml( 20, 160 + (count++ * 30), 400, 30, "No current allies", false, false ); // No current wars } if ( guild.AllyInvitations.Count > 0 ) { AddButton( 20, 160 + (count * 30), 4005, 4007, 3, GumpButtonType.Reply, 0 ); AddHtml( 55, 160 + (count++ * 30), 400, 30, "Accept ally invitations", false, false ); // Accept ally invitations. AddButton( 20, 160 + (count * 30), 4005, 4007, 4, GumpButtonType.Reply, 0 ); AddHtml( 55, 160 + (count++ * 30), 400, 30, "Reject ally invitations", false, false ); // Reject ally invitations. } else { AddHtml( 20, 160 + (count++ * 30), 400, 30, "No current alliance invitations", false, false ); // No current invitations received for ally. } if ( guild.AllyDeclarations.Count > 0 ) { AddButton( 20, 160 + (count * 30), 4005, 4007, 5, GumpButtonType.Reply, 0 ); AddHtml( 55, 160 + (count++ * 30), 400, 30, "Rescind your alliance declarations", false, false ); // Rescind your ally declarations. } else { AddHtml( 20, 160 + (count++ * 30), 400, 30, "No current alliance declarations", false, false ); // No current ally declarations } AddButton( 20, 400, 4005, 4007, 6, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 55, 400, 400, 35, 1011104, false, false ); // Return to the previous menu. }
public ViewGuildGump(Mobile from, Guild guild) : base(50, 40) { if (guild == null || guild.Disbanded) { from.SendAsciiMessage("That guild was removed"); return; } m_From = from; m_Guild = guild; m_StoneMap = m_Guild.Guildstone.Map; m_StoneLocation = m_Guild.Guildstone.Location; from.CloseGump(typeof(ViewGuildGump)); AddPage(0); AddBackground(0, 0, 240, 230, 5054); AddBlackAlpha(10, 10, 220, 210); string guildName = m_Guild.Name; string guildAbb = m_Guild.Abbreviation; string guildId = m_Guild.Id.ToString(); string guildMaster = m_Guild.Leader.Name; string members = m_Guild.Members.Count.ToString(); string type = m_Guild.Type.ToString(); AddHtml(10, 15, 220, 20, Color(Center("Guild Properties"), White), false, false); AddHtml(15, 40, 210, 20, Color("Name:", White), false, false); AddHtml(15, 40, 210, 20, Color(Right(guildName), White), false, false); AddHtml(15, 60, 210, 20, Color("Abbreviation:", White), false, false); AddHtml(15, 60, 210, 20, Color(Right(guildAbb), White), false, false); AddHtml(15, 80, 210, 20, Color("Guildmaster:", White), false, false); AddHtml(15, 80, 210, 20, Color(Right(guildMaster), White), false, false); AddHtml(15, 100, 210, 20, Color("Type:", White), false, false); AddHtml(15, 100, 210, 20, Color(Right(type), White), false, false); AddHtml(15, 120, 210, 20, Color("Members:", White), false, false); AddHtml(15, 120, 210, 20, Color(Right(members), White), false, false); AddHtml(15, 140, 210, 20, Color("ID:", White), false, false); AddHtml(15, 140, 210, 20, Color(Right(guildId), White), false, false); AddButton(15, 165, 4005, 4007, 1, GumpButtonType.Reply, 0); AddHtml(50, 165, 120, 20, Color("Go to guildstone", White), false, false); AddButton(15, 185, 4005, 4007, 2, GumpButtonType.Reply, 0); AddHtml(50, 185, 160, 20, Color("Open guildstone menu", White), false, false); }
public GuildCandidateMenu( Mobile from, Guild guild, Mobile candidate ) : base(candidate.Name, null) { m_Mobile = from; m_Guild = guild; m_Candidate = candidate; List<String> list = new List<String>(); list.Add( "Accept" ); list.Add( "Reject" ); Answers = list.ToArray(); }
public AllianceInfo( Guild leader, string name, Guild partner ) { m_Leader = leader; m_Name = name; m_Members = new List<Guild>(); m_PendingMembers = new List<Guild>(); leader.Alliance = this; partner.Alliance = this; if( !m_Alliances.ContainsKey( m_Name.ToLower() ) ) m_Alliances.Add( m_Name.ToLower(), this ); }
public GuildWarMenu( Mobile from, Guild guild ) : base("WARFARE STATUS", null) { m_Mobile = from; m_Guild = guild; List<String> list = new List<String>(); list.Add( "Guilds we are at war with" ); list.Add( "Guilds that we have declared war on" ); list.Add( "Guilds that have declared war on us" ); list.Add( "Return to the main menu." ); Answers = list.ToArray(); }
public GuildMenu(Mobile beholder, Guild guild, string loyalty) : base(String.Format("{0} (Guild {1} {2})", guild.Name, guild.Leader.Female ? "Mistress" : "Master", guild.Leader.Name), new string[] { "Recruit someone into the guild.", "View the current roster.", "View the guild's charter.", String.Format("Declare your fealty. You are currently loyal to {0}.", loyalty), String.Format("Toggle showing the guild's abbreviation in your name to unguilded people. Currently {0}.", beholder.DisplayGuildTitle ? "on" : "off"), "Resign from the guild.", "View list of candidates who have been sponsored to the guild.", String.Format("Access Guild {0} functions.", guild.Leader.Female ? "Mistress" : "Master"), String.Format("View list of guilds that {0} has declared war on.", guild.Name) }) { m_Mobile = beholder; m_Guild = guild; }
public AdvancedSearchGump( Mobile from, Guild guild ) : base(20, 30) { m_Mobile = from; m_Guild = guild; AddPage( 0 ); AddBackground( 0, 0, 600, 440, 0x24AE ); AddBackground( 66, 40, 150, 26, 0x2486 ); AddButton( 71, 45, 0x845, 0x846, 100, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 96, 43, 110, 26, 1063014, false, false ); // My Guild AddBackground( 236, 40, 150, 26, 0x2486 ); AddButton( 241, 45, 0x845, 0x846, 110, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 266, 43, 110, 26, 1062974, false, false ); // Guild Roster AddBackground( 401, 40, 150, 26, 0x2486 ); AddButton( 406, 45, 0x845, 0x846, 120, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 431, 43, 110, 26, 1062978, 75, false, false ); // Diplomacy AddHtmlLocalized( 65, 80, 480, 26, 1063124, 75, true, false ); // <i>Advanced Search Options</i> AddHtmlLocalized( 65, 110, 480, 26, 1063136, 75, false, false ); // Showing All Guilds AddGroup( 1 ); AddRadio( 75, 140, 0xD2, 0xD3, false, 500 ); AddHtmlLocalized( 105, 140, 200, 26, 1063006, false, false ); // Show Guilds with Relationship AddRadio( 75, 170, 0xD2, 0xD3, false, 501 ); AddHtmlLocalized( 105, 170, 200, 26, 1063005, false, false ); // Show Guilds Awaiting Action AddRadio( 75, 200, 0xD2, 0xD3, false, 502 ); AddHtmlLocalized( 105, 200, 200, 26, 1063007, false, false ); // Show All Guilds AddBackground( 450, 370, 100, 26, 0x2486 ); AddButton( 455, 375, 0x845, 0x846, 1, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 480, 373, 60, 26, 1006044, false, false ); // OK AddBackground( 340, 370, 100, 26, 0x2486 ); AddButton( 345, 375, 0x845, 0x846, 0, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 370, 373, 60, 26, 1006045, false, false ); // Cancel }
public GuildListGump( Mobile from, Guild guild, bool radio, List<Guild> list ) : base(20, 30) { m_Mobile = from; m_Guild = guild; Dragable = true; AddPage( 0 ); AddBackground(0, 0, 550, 440, 9270); //AddBackground(10, 10, 530, 420, 9270); Design(); m_List = new List<Guild>( list ); for ( int i = 0; i < m_List.Count; ++i ) { if ( (i % 11) == 0 ) { if ( i != 0 ) { AddButton( 300, 370, 4005, 4007, 0, GumpButtonType.Page, (i / 11) + 1 ); AddHtml(335, 370, 300, 35, "Próxima página", false, false); // Next page } AddPage( (i / 11) + 1 ); if ( i != 0 ) { AddButton( 20, 370, 4014, 4016, 0, GumpButtonType.Page, (i / 11) ); AddHtml(55, 370, 300, 35, "Página anterior", false, false); // Previous page } } if ( radio ) AddRadio( 20, 35 + ((i % 11) * 30), 210, 211, false, i ); Guild g = m_List[i]; string name; if ( (name = g.Name) != null && (name = name.Trim()).Length <= 0 ) name = "(empty)"; AddLabel((radio ? 55 : 20), 35 + ((i % 11) * 30), 400, name); } }
public GuildListGump( Mobile from, Guild guild, bool radio, ArrayList list ) : base(20, 30) { m_Mobile = from; m_Guild = guild; Dragable = false; AddPage( 0 ); AddBackground( 0, 0, 550, 440, 5054 ); AddBackground( 10, 10, 530, 420, 3000 ); Design(); m_List = new ArrayList( list ); for ( int i = 0; i < m_List.Count; ++i ) { if ( (i % 11) == 0 ) { if ( i != 0 ) { AddButton( 300, 370, 4005, 4007, 0, GumpButtonType.Page, (i / 11) + 1 ); AddHtmlLocalized( 335, 370, 300, 35, 1011066, false, false ); // Next page } AddPage( (i / 11) + 1 ); if ( i != 0 ) { AddButton( 20, 370, 4014, 4016, 0, GumpButtonType.Page, (i / 11) ); AddHtmlLocalized( 55, 370, 300, 35, 1011067, false, false ); // Previous page } } if ( radio ) AddRadio( 20, 35 + ((i % 11) * 30), 208, 209, false, i ); Guild g = (Guild)m_List[i]; string name; if ( (name = g.Name) != null && (name = name.Trim()).Length <= 0 ) name = "(empty)"; AddLabel( (radio ? 55 : 20), 35 + ((i % 11) * 30), 0, name ); } }
public override Gump GetResentGump(PlayerMobile pm, Guild g, IComparer <PlayerMobile> comparer, bool ascending, string filter, int startNumber) { return(new GuildRosterGump(pm, g, comparer, ascending, filter, startNumber)); }
public GuildRosterGump(PlayerMobile pm, Guild g, IComparer <PlayerMobile> currentComparer, bool ascending, string filter, int startNumber) : base(pm, g, Utility.SafeConvertList <Mobile, PlayerMobile>(g.Members), currentComparer, ascending, filter, startNumber, m_Fields) { PopulateGump(); }
public void InvitePlayer_Callback(Mobile from, object targeted, object state) { PlayerMobile pm = from as PlayerMobile; PlayerMobile targ = targeted as PlayerMobile; Guild g = state as Guild; PlayerState guildState = PlayerState.Find(g.Leader); PlayerState targetState = PlayerState.Find(targ); Faction guildFaction = (guildState == null ? null : guildState.Faction); Faction targetFaction = (targetState == null ? null : targetState.Faction); Ethic guildEthic = Ethic.Find(g.Leader); Ethic targetEthic = Ethic.Find(targ); if (pm == null || !IsMember(pm, guild) || !pm.GuildRank.GetFlag(RankFlags.CanInvitePlayer)) { pm.SendLocalizedMessage(503301); // You don't have permission to do that. } else if (targ == null) { pm.SendLocalizedMessage(1063334); // That isn't a valid player. } else if (!targ.AcceptGuildInvites) { pm.SendLocalizedMessage(1063049, targ.Name); // ~1_val~ is not accepting guild invitations. } else if (g.IsMember(targ)) { pm.SendLocalizedMessage(1063050, targ.Name); // ~1_val~ is already a member of your guild! } else if (targ.Guild != null) { pm.SendLocalizedMessage(1063051, targ.Name); // ~1_val~ is already a member of a guild. } else if (targ.HasGump(typeof(BaseGuildGump)) || targ.HasGump(typeof(CreateGuildGump))) //TODO: Check message if CreateGuildGump Open { pm.SendLocalizedMessage(1063052, targ.Name); // ~1_val~ is currently considering another guild invitation. } #region Factions else if (targ.Young && guildFaction != null) { pm.SendLocalizedMessage(1070766); // You cannot invite a young player to your faction-aligned guild. } else if (guildFaction != targetFaction) { if (guildFaction == null) { pm.SendLocalizedMessage(1013027); // That player cannot join a non-faction guild. } else if (targetFaction == null) { pm.SendLocalizedMessage(1013026); // That player must be in a faction before joining this guild. } else { pm.SendLocalizedMessage(1013028); // That person has a different faction affiliation. } } else if (guildEthic != targetEthic) { if (guildEthic == null) { pm.SendMessage("That player cannot join a non-ethic guild."); } else if (targetEthic == null) { pm.SendMessage("That player must be {0} {1} before joining this guild.", guildEthic.Definition.ArticleAn ? "an" : "a", guildEthic.Definition.Title); } else { pm.SendMessage("That player is {0} {1}! You cannot recruit {2}!", targetEthic.Definition.ArticleAn ? "an" : "a", targetEthic.Definition.Title, targ.Female ? "her" : "him"); } } else if (targetState != null && targetState.IsLeaving) { // OSI does this quite strangely, so we'll just do it this way pm.SendMessage("That person is quitting their faction and so you may not recruit them."); } #endregion else { pm.SendLocalizedMessage(1063053, targ.Name); // You invite ~1_val~ to join your guild. targ.SendGump(new GuildInvitationRequest(targ, guild, pm)); } }
public override Gump GetObjectInfoGump(PlayerMobile pm, Guild g, PlayerMobile o) { return(new GuildMemberInfoGump(pm, g, o, false, false)); }
public GuildRosterGump(PlayerMobile pm, Guild g) : this(pm, g, LastOnComparer.Instance) { }
public override void OnResponse(NetState sender, RelayInfo info) { PlayerMobile pm = sender.Mobile as PlayerMobile; if (pm == null || pm.Guild != null) { return; //Sanity } switch (info.ButtonID) { case 1: { TextRelay tName = info.GetTextEntry(5); TextRelay tAbbrev = info.GetTextEntry(6); string guildName = (tName == null) ? "" : tName.Text; string guildAbbrev = (tAbbrev == null) ? "" : tAbbrev.Text; guildName = Utility.FixHtml(guildName.Trim()); guildAbbrev = Utility.FixHtml(guildAbbrev.Trim()); if (guildName.Length <= 0) { pm.SendLocalizedMessage(1070884); // Guild name cannot be blank. } else if (guildAbbrev.Length <= 0) { pm.SendLocalizedMessage(1070885); // You must provide a guild abbreviation. } else if (guildName.Length > Guild.NameLimit) { pm.SendLocalizedMessage(1063036, Guild.NameLimit.ToString()); // A guild name cannot be more than ~1_val~ characters in length. } else if (guildAbbrev.Length > Guild.AbbrevLimit) { pm.SendLocalizedMessage(1063037, Guild.AbbrevLimit.ToString()); // An abbreviation cannot exceed ~1_val~ characters in length. } else if (Guild.FindByAbbrev(guildAbbrev) != null || !BaseGuildGump.CheckProfanity(guildAbbrev)) { pm.SendLocalizedMessage(501153); // That abbreviation is not available. } else if (Guild.FindByName(guildName) != null) { pm.SendLocalizedMessage(1063000); // That guild name is not available. } else if (!Banker.Withdraw(pm, Guild.RegistrationFee)) { pm.SendLocalizedMessage(1063001, Guild.RegistrationFee.ToString()); // You do not possess the ~1_val~ gold piece fee required to create a guild. } else { pm.SendLocalizedMessage(1060398, Guild.RegistrationFee.ToString()); // ~1_AMOUNT~ gold has been withdrawn from your bank box. pm.SendLocalizedMessage(1063238); // Your new guild has been founded. pm.Guild = new Guild(pm, guildName, guildAbbrev); } break; } case 2: { pm.AcceptGuildInvites = !pm.AcceptGuildInvites; if (pm.AcceptGuildInvites) { pm.SendLocalizedMessage(1070699); // You are now accepting guild invitations. } else { pm.SendLocalizedMessage(1070698); // You are now ignoring guild invitations. } break; } } }
public AllianceRosterGump(PlayerMobile pm, Guild g, AllianceInfo alliance) : base(pm, g, true, "", 0, alliance.m_Members, alliance.Name) =>
public GuildAdvancedSearchGump(PlayerMobile pm, Guild g, GuildDisplayType display, SearchSelectionCallback callback) : base(pm, g) { m_Callback = callback; m_Display = display; PopulateGump(); }
public GuildInfoGump(PlayerMobile pm, Guild g) : this(pm, g, false, false) { }
public AllianceRosterGump(PlayerMobile pm, Guild g, AllianceInfo alliance, IComparer <Guild> currentComparer, bool ascending, string filter, int startNumber) : base(pm, g, currentComparer, ascending, filter, startNumber, alliance.m_Members, alliance.Name) =>
public void CheckExpiredWars() { for (int i = 0; i < AcceptedWars.Count; i++) { WarDeclaration w = AcceptedWars[i]; Guild g = w.Opponent; WarStatus status = w.Status; if (status != WarStatus.InProgress) { AllianceInfo myAlliance = Alliance; bool inAlliance = (myAlliance != null && myAlliance.IsMember(this)); AllianceInfo otherAlliance = ((g != null) ? g.Alliance : null); bool otherInAlliance = (otherAlliance != null && otherAlliance.IsMember(this)); if (inAlliance) { myAlliance.AllianceMessage(1070739 + (int)status, (g == null) ? "a deleted opponent" : (otherInAlliance ? otherAlliance.Name : g.Name)); myAlliance.InvalidateMemberProperties(); } else { GuildMessage(1070739 + (int)status, (g == null) ? "a deleted opponent" : (otherInAlliance ? otherAlliance.Name : g.Name)); InvalidateMemberProperties(); } AcceptedWars.Remove(w); if (g != null) { if (status != WarStatus.Draw) { status = (WarStatus)((int)status + 1 % 2); } if (otherInAlliance) { otherAlliance.AllianceMessage(1070739 + (int)status, (inAlliance ? Alliance.Name : Name)); otherAlliance.InvalidateMemberProperties(); } else { g.GuildMessage(1070739 + (int)status, (inAlliance ? Alliance.Name : Name)); g.InvalidateMemberProperties(); } g.AcceptedWars.Remove(g.FindActiveWar(this)); } } } for (int i = 0; i < PendingWars.Count; i++) { WarDeclaration w = PendingWars[i]; Guild g = w.Opponent; if (w.Status != WarStatus.Pending) { //All sanity in here PendingWars.Remove(w); if (g != null) { g.PendingWars.Remove(g.FindPendingWar(this)); } } } }
public override void Deserialize(GenericReader reader) { int version = reader.ReadInt(); switch (version) { case 5: { int count = reader.ReadInt(); PendingWars = new List <WarDeclaration>(); for (int i = 0; i < count; i++) { PendingWars.Add(new WarDeclaration(reader)); } count = reader.ReadInt(); AcceptedWars = new List <WarDeclaration>(); for (int i = 0; i < count; i++) { AcceptedWars.Add(new WarDeclaration(reader)); } bool isAllianceLeader = reader.ReadBool(); if (isAllianceLeader) { m_AllianceInfo = new AllianceInfo(reader); } else { m_AllianceLeader = reader.ReadGuild() as Guild; } goto case 4; } case 4: { AllyDeclarations = reader.ReadStrongGuildList <Guild>(); AllyInvitations = reader.ReadStrongGuildList <Guild>(); goto case 3; } case 3: { TypeLastChange = reader.ReadDateTime(); goto case 2; } case 2: { m_Type = (GuildType)reader.ReadInt(); goto case 1; } case 1: { LastFealty = reader.ReadDateTime(); goto case 0; } case 0: { m_Leader = reader.ReadMobile(); if (m_Leader is PlayerMobile) { ((PlayerMobile)m_Leader).GuildRank = RankDefinition.Leader; } m_Name = reader.ReadString(); m_Abbreviation = reader.ReadString(); Allies = reader.ReadStrongGuildList <Guild>(); Enemies = reader.ReadStrongGuildList <Guild>(); WarDeclarations = reader.ReadStrongGuildList <Guild>(); WarInvitations = reader.ReadStrongGuildList <Guild>(); Members = reader.ReadStrongMobileList(); Candidates = reader.ReadStrongMobileList(); Accepted = reader.ReadStrongMobileList(); Guildstone = reader.ReadItem(); Teleporter = reader.ReadItem(); Charter = reader.ReadString(); Website = reader.ReadString(); break; } } if (AllyDeclarations == null) { AllyDeclarations = new List <Guild>(); } if (AllyInvitations == null) { AllyInvitations = new List <Guild>(); } if (AcceptedWars == null) { AcceptedWars = new List <WarDeclaration>(); } if (PendingWars == null) { PendingWars = new List <WarDeclaration>(); } /* * if ( ( !NewGuildSystem && m_Guildstone == null )|| m_Members.Count == 0 ) * Disband(); */ Timer.DelayCall(TimeSpan.Zero, new TimerCallback(VerifyGuild_Callback)); }
public abstract Gump GetResentGump(PlayerMobile pm, Guild g, IComparer <T> comparer, bool ascending, string filter, int startNumber);
public GuildRosterGump(PlayerMobile pm, Guild g) : this(pm, g, GuildRosterGump.LastOnComparer.Instance, true, "", 0) { }
public void CalculateAllianceLeader() { m_Leader = m_Members.Count >= 2 ? m_Members[Utility.Random(m_Members.Count)] : null; }
public GuildInfoGump(PlayerMobile pm, Guild g, bool isResigning) : base(pm, g) { m_IsResigning = isResigning; PopulateGump(); }
public override void PopulateGump() { Guild g = Guild.GetAllianceLeader(guild); Guild other = Guild.GetAllianceLeader(m_Other); WarDeclaration war = g.FindPendingWar(other); WarDeclaration activeWar = g.FindActiveWar(other); AllianceInfo alliance = guild.Alliance; AllianceInfo otherAlliance = m_Other.Alliance; //NOTE TO SELF: Only only alliance leader can see pending guild alliance statuses bool PendingWar = (war != null); bool ActiveWar = (activeWar != null); AddPage(0); AddBackground(0, 0, 520, 335, 0x242C); AddHtmlLocalized(20, 15, 480, 26, 1062975, 0x0, false, false); // <div align=center><i>Guild Relationship</i></div> AddImageTiled(20, 40, 480, 2, 0x2711); AddHtmlLocalized(20, 50, 120, 26, 1062954, 0x0, true, false); // <i>Guild Name</i> AddHtml(150, 53, 360, 26, m_Other.Name, false, false); AddHtmlLocalized(20, 80, 120, 26, 1063025, 0x0, true, false); // <i>Alliance</i> if (otherAlliance != null) { if (otherAlliance.IsMember(m_Other)) { AddHtml(150, 83, 360, 26, otherAlliance.Name, false, false); } //else if( otherAlliance.Leader == guild && ( otherAlliance.IsPendingMember( m_Other ) || otherAlliance.IsPendingMember( guild ) ) ) /* else if( (otherAlliance.Leader == guild && otherAlliance.IsPendingMember( m_Other ) ) || ( otherAlliance.Leader == m_Other && otherAlliance.IsPendingMember( guild ) ) ) * { * AddHtml( 150, 83, 360, 26, Color( alliance.Name, 0xF), false, false ); * } * //AddHtml( 150, 83, 360, 26, ( alliance.PendingMembers.Contains( guild ) || alliance.PendingMembers.Contains( m_Other ) ) ? String.Format( "<basefont color=#blue>{0}</basefont>", alliance.Name ) : alliance.Name, false, false ); * //AddHtml( 150, 83, 360, 26, ( otherAlliance == alliance && otherAlliance.PendingMembers.Contains( guild ) || otherAlliance.PendingMembers.Contains( m_Other ) ) ? String.Format( "<basefont color=#blue>{0}</basefont>", otherAlliance.Name ) : otherAlliance.Name, false, false ); */ } AddHtmlLocalized(20, 110, 120, 26, 1063139, 0x0, true, false); // <i>Abbreviation</i> AddHtml(150, 113, 120, 26, m_Other.Abbreviation, false, false); string kills = "0/0"; string time = "00:00"; string otherKills = "0/0"; WarDeclaration otherWar; if (ActiveWar) { kills = String.Format("{0}/{1}", activeWar.Kills, activeWar.MaxKills); TimeSpan timeRemaining = TimeSpan.Zero; if (activeWar.WarLength != TimeSpan.Zero && (activeWar.WarBeginning + activeWar.WarLength) > DateTime.Now) { timeRemaining = (activeWar.WarBeginning + activeWar.WarLength) - DateTime.Now; } //time = String.Format( "{0:D2}:{1:D2}", timeRemaining.Hours.ToString(), timeRemaining.Subtract( TimeSpan.FromHours( timeRemaining.Hours ) ).Minutes ); //Is there a formatter for htis? it's 2AM and I'm tired and can't find it time = String.Format("{0:D2}:{1:mm}", timeRemaining.Hours, DateTime.MinValue + timeRemaining); otherWar = m_Other.FindActiveWar(guild); if (otherWar != null) { otherKills = String.Format("{0}/{1}", otherWar.Kills, otherWar.MaxKills); } } else if (PendingWar) { kills = Color(String.Format("{0}/{1}", war.Kills, war.MaxKills), 0x990000); //time = Color( String.Format( "{0}:{1}", war.WarLength.Hours, ((TimeSpan)(war.WarLength - TimeSpan.FromHours( war.WarLength.Hours ))).Minutes ), 0xFF0000 ); time = Color(String.Format("{0:D2}:{1:mm}", war.WarLength.Hours, DateTime.MinValue + war.WarLength), 0x990000); otherWar = m_Other.FindPendingWar(guild); if (otherWar != null) { otherKills = Color(String.Format("{0}/{1}", otherWar.Kills, otherWar.MaxKills), 0x990000); } } AddHtmlLocalized(280, 110, 120, 26, 1062966, 0x0, true, false); // <i>Your Kills</i> AddHtml(410, 113, 120, 26, kills, false, false); AddHtmlLocalized(20, 140, 120, 26, 1062968, 0x0, true, false); // <i>Time Remaining</i> AddHtml(150, 143, 120, 26, time, false, false); AddHtmlLocalized(280, 140, 120, 26, 1062967, 0x0, true, false); // <i>Their Kills</i> AddHtml(410, 143, 120, 26, otherKills, false, false); AddImageTiled(20, 172, 480, 2, 0x2711); int number = 1062973; // <div align=center>You are at peace with this guild.</div> if (PendingWar) { if (war.WarRequester) { number = 1063027; // <div align=center>You have challenged this guild to war!</div> } else { number = 1062969; // <div align=center>This guild has challenged you to war!</div> AddButtonAndBackground(20, 260, 5, 1062981); // Accept Challenge AddButtonAndBackground(275, 260, 6, 1062983); //Modify Terms } AddButtonAndBackground(20, 290, 7, 1062982); // Dismiss Challenge } else if (ActiveWar) { number = 1062965; // <div align=center>You are at war with this guild!</div> AddButtonAndBackground(20, 290, 8, 1062980); // Surrender } else if (alliance != null && alliance == otherAlliance) //alliance, Same Alliance { if (alliance.IsMember(guild) && alliance.IsMember(m_Other)) //Both in Same alliance, full members { number = 1062970; // <div align=center>You are allied with this guild.</div> if (alliance.Leader == guild) { AddButtonAndBackground(20, 260, 12, 1062984); // Remove Guild from Alliance AddButtonAndBackground(275, 260, 13, 1063433); // Promote to Alliance Leader //Note: No 'confirmation' like the other leader guild promotion things //Remove guild from alliance //Promote to Alliance Leader } //Show roster, Centered, up AddButtonAndBackground(148, 215, 10, 1063164); //Show Alliance Roster //Leave Alliance AddButtonAndBackground(20, 290, 11, 1062985); // Leave Alliance } else if (alliance.Leader == guild && alliance.IsPendingMember(m_Other)) { number = 1062971; // <div align=center>You have requested an alliance with this guild.</div> //Show Alliance Roster, Centered, down. AddButtonAndBackground(148, 245, 10, 1063164); //Show Alliance Roster //Withdraw Request AddButtonAndBackground(20, 290, 14, 1062986); // Withdraw Request AddHtml(150, 83, 360, 26, Color(alliance.Name, 0x99), false, false); } else if (alliance.Leader == m_Other && alliance.IsPendingMember(guild)) { number = 1062972; // <div align=center>This guild has requested an alliance.</div> //Show alliance Roster, top AddButtonAndBackground(148, 215, 10, 1063164); //Show Alliance Roster //Deny Request //Accept Request AddButtonAndBackground(20, 260, 15, 1062988); // Deny Request AddButtonAndBackground(20, 290, 16, 1062987); // Accept Request AddHtml(150, 83, 360, 26, Color(alliance.Name, 0x99), false, false); } } else { AddButtonAndBackground(20, 260, 2, 1062990); // Request Alliance AddButtonAndBackground(20, 290, 1, 1062989); // Declare War! } AddButtonAndBackground(275, 290, 0, 3000091); //Cancel AddHtmlLocalized(20, 180, 480, 30, number, 0x0, true, false); AddImageTiled(20, 245, 480, 2, 0x2711); }
public BaseGuildGump(PlayerMobile pm, Guild g) : this(pm, g, 10, 10) { }
public override void OnResponse(NetState sender, RelayInfo info) { PlayerMobile pm = sender.Mobile as PlayerMobile; if (!IsMember(pm, guild)) { return; } RankDefinition playerRank = pm.GuildRank; Guild guildLeader = Guild.GetAllianceLeader(guild); Guild otherGuild = Guild.GetAllianceLeader(m_Other); WarDeclaration war = guildLeader.FindPendingWar(otherGuild); WarDeclaration activeWar = guildLeader.FindActiveWar(otherGuild); WarDeclaration otherWar = otherGuild.FindPendingWar(guildLeader); AllianceInfo alliance = guild.Alliance; AllianceInfo otherAlliance = otherGuild.Alliance; switch (info.ButtonID) { #region War case 5: //Accept the war { if (war != null && !war.WarRequester && activeWar == null) { if (!playerRank.GetFlag(RankFlags.ControlWarStatus)) { pm.SendLocalizedMessage(1063440); // You don't have permission to negotiate wars. } else if (alliance != null && alliance.Leader != guild) { pm.SendLocalizedMessage(1063239, String.Format("{0}\t{1}", guild.Name, alliance.Name)); // ~1_val~ is not the leader of the ~2_val~ alliance. pm.SendLocalizedMessage(1070707, alliance.Leader.Name); // You need to negotiate via ~1_val~ instead. } else { //Accept the war guild.PendingWars.Remove(war); war.WarBeginning = DateTime.Now; guild.AcceptedWars.Add(war); if (alliance != null && alliance.IsMember(guild)) { alliance.AllianceMessage(1070769, ((otherAlliance != null) ? otherAlliance.Name : otherGuild.Name)); // Guild Message: Your guild is now at war with ~1_GUILDNAME~ alliance.InvalidateMemberProperties(); } else { guild.GuildMessage(1070769, ((otherAlliance != null) ? otherAlliance.Name : otherGuild.Name)); // Guild Message: Your guild is now at war with ~1_GUILDNAME~ guild.InvalidateMemberProperties(); } //Technically SHOULD say Your guild is now at war w/out any info, intentional diff. otherGuild.PendingWars.Remove(otherWar); otherWar.WarBeginning = DateTime.Now; otherGuild.AcceptedWars.Add(otherWar); if (otherAlliance != null && m_Other.Alliance.IsMember(m_Other)) { otherAlliance.AllianceMessage(1070769, ((alliance != null) ? alliance.Name : guild.Name)); // Guild Message: Your guild is now at war with ~1_GUILDNAME~ otherAlliance.InvalidateMemberProperties(); } else { otherGuild.GuildMessage(1070769, ((alliance != null) ? alliance.Name : guild.Name)); // Guild Message: Your guild is now at war with ~1_GUILDNAME~ otherGuild.InvalidateMemberProperties(); } } } break; } case 6: //Modify war terms { if (war != null && !war.WarRequester && activeWar == null) { if (!playerRank.GetFlag(RankFlags.ControlWarStatus)) { pm.SendLocalizedMessage(1063440); // You don't have permission to negotiate wars. } else if (alliance != null && alliance.Leader != guild) { pm.SendLocalizedMessage(1063239, String.Format("{0}\t{1}", guild.Name, alliance.Name)); // ~1_val~ is not the leader of the ~2_val~ alliance. pm.SendLocalizedMessage(1070707, alliance.Leader.Name); // You need to negotiate via ~1_val~ instead. } else { pm.SendGump(new WarDeclarationGump(pm, guild, otherGuild)); } } break; } case 7: //Dismiss war { if (war != null) { if (!playerRank.GetFlag(RankFlags.ControlWarStatus)) { pm.SendLocalizedMessage(1063440); // You don't have permission to negotiate wars. } else if (alliance != null && alliance.Leader != guild) { pm.SendLocalizedMessage(1063239, String.Format("{0}\t{1}", guild.Name, alliance.Name)); // ~1_val~ is not the leader of the ~2_val~ alliance. pm.SendLocalizedMessage(1070707, alliance.Leader.Name); // You need to negotiate via ~1_val~ instead. } else { //Dismiss the war guild.PendingWars.Remove(war); otherGuild.PendingWars.Remove(otherWar); pm.SendLocalizedMessage(1070752); // The proposal has been updated. //Messages to opposing guild? (Testing on OSI says no) } } break; } case 8: //Surrender { if (!playerRank.GetFlag(RankFlags.ControlWarStatus)) { pm.SendLocalizedMessage(1063440); // You don't have permission to negotiate wars. } else if (alliance != null && alliance.Leader != guild) { pm.SendLocalizedMessage(1063239, String.Format("{0}\t{1}", guild.Name, alliance.Name)); // ~1_val~ is not the leader of the ~2_val~ alliance. pm.SendLocalizedMessage(1070707, alliance.Leader.Name); // You need to negotiate via ~1_val~ instead. } else { if (activeWar != null) { if (alliance != null && alliance.IsMember(guild)) { alliance.AllianceMessage(1070740, ((otherAlliance != null) ? otherAlliance.Name : otherGuild.Name)); // You have lost the war with ~1_val~. alliance.InvalidateMemberProperties(); } else { guild.GuildMessage(1070740, ((otherAlliance != null) ? otherAlliance.Name : otherGuild.Name)); // You have lost the war with ~1_val~. guild.InvalidateMemberProperties(); } guild.AcceptedWars.Remove(activeWar); if (otherAlliance != null && otherAlliance.IsMember(otherGuild)) { otherAlliance.AllianceMessage(1070739, ((guild.Alliance != null) ? guild.Alliance.Name : guild.Name)); // You have won the war against ~1_val~! otherAlliance.InvalidateMemberProperties(); } else { otherGuild.GuildMessage(1070739, ((guild.Alliance != null) ? guild.Alliance.Name : guild.Name)); // You have won the war against ~1_val~! otherGuild.InvalidateMemberProperties(); } otherGuild.AcceptedWars.Remove(otherGuild.FindActiveWar(guild)); } } break; } case 1: //Declare War { if (war == null && activeWar == null) { if (!playerRank.GetFlag(RankFlags.ControlWarStatus)) { pm.SendLocalizedMessage(1063440); // You don't have permission to negotiate wars. } else if (alliance != null && alliance.Leader != guild) { pm.SendLocalizedMessage(1063239, String.Format("{0}\t{1}", guild.Name, alliance.Name)); // ~1_val~ is not the leader of the ~2_val~ alliance. pm.SendLocalizedMessage(1070707, alliance.Leader.Name); // You need to negotiate via ~1_val~ instead. } else if (otherAlliance != null && otherAlliance.Leader != m_Other) { pm.SendLocalizedMessage(1063239, String.Format("{0}\t{1}", m_Other.Name, otherAlliance.Name)); // ~1_val~ is not the leader of the ~2_val~ alliance. pm.SendLocalizedMessage(1070707, otherAlliance.Leader.Name); // You need to negotiate via ~1_val~ instead. } else { pm.SendGump(new WarDeclarationGump(pm, guild, m_Other)); } } break; } #endregion case 2: //Request Alliance { #region New alliance if (alliance == null) { if (!playerRank.GetFlag(RankFlags.AllianceControl)) { pm.SendLocalizedMessage(1070747); // You don't have permission to create an alliance. } else if (Faction.Find(guild.Leader) != Faction.Find(m_Other.Leader)) { pm.SendLocalizedMessage(1070758); // You cannot propose an alliance to a guild with a different faction allegiance. } else if (otherAlliance != null) { if (otherAlliance.IsPendingMember(m_Other)) { pm.SendLocalizedMessage(1063416, m_Other.Name); // ~1_val~ is currently considering another alliance proposal. } else { pm.SendLocalizedMessage(1063426, m_Other.Name); // ~1_val~ already belongs to an alliance. } } else if (m_Other.AcceptedWars.Count > 0 || m_Other.PendingWars.Count > 0) { pm.SendLocalizedMessage(1063427, m_Other.Name); // ~1_val~ is currently involved in a guild war. } else if (guild.AcceptedWars.Count > 0 || guild.PendingWars.Count > 0) { pm.SendLocalizedMessage(1063427, guild.Name); // ~1_val~ is currently involved in a guild war. } else { pm.SendLocalizedMessage(1063439); // Enter a name for the new alliance: pm.BeginPrompt(new PromptCallback(CreateAlliance_Callback)); } } #endregion #region Existing Alliance else { if (!playerRank.GetFlag(RankFlags.AllianceControl)) { pm.SendLocalizedMessage(1063436); // You don't have permission to negotiate an alliance. } else if (alliance.Leader != guild) { pm.SendLocalizedMessage(1063239, String.Format("{0}\t{1}", guild.Name, alliance.Name)); // ~1_val~ is not the leader of the ~2_val~ alliance. } else if (otherAlliance != null) { if (otherAlliance.IsPendingMember(m_Other)) { pm.SendLocalizedMessage(1063416, m_Other.Name); // ~1_val~ is currently considering another alliance proposal. } else { pm.SendLocalizedMessage(1063426, m_Other.Name); // ~1_val~ already belongs to an alliance. } } else if (alliance.IsPendingMember(guild)) { pm.SendLocalizedMessage(1063416, guild.Name); // ~1_val~ is currently considering another alliance proposal. } else if (m_Other.AcceptedWars.Count > 0 || m_Other.PendingWars.Count > 0) { pm.SendLocalizedMessage(1063427, m_Other.Name); // ~1_val~ is currently involved in a guild war. } else if (guild.AcceptedWars.Count > 0 || guild.PendingWars.Count > 0) { pm.SendLocalizedMessage(1063427, guild.Name); // ~1_val~ is currently involved in a guild war. } else if (Faction.Find(guild.Leader) != Faction.Find(m_Other.Leader)) { pm.SendLocalizedMessage(1070758); // You cannot propose an alliance to a guild with a different faction allegiance. } else { pm.SendLocalizedMessage(1070750, m_Other.Name); // An invitation to join your alliance has been sent to ~1_val~. m_Other.GuildMessage(1070780, guild.Name); // ~1_val~ has proposed an alliance. m_Other.Alliance = alliance; //Calls addPendingGuild //alliance.AddPendingGuild( m_Other ); } } #endregion break; } case 10: //Show Alliance Roster { if (alliance != null && alliance == otherAlliance) { pm.SendGump(new AllianceInfo.AllianceRosterGump(pm, guild, alliance)); } break; } case 11: //Leave Alliance { if (!playerRank.GetFlag(RankFlags.AllianceControl)) { pm.SendLocalizedMessage(1063436); // You don't have permission to negotiate an alliance. } else if (alliance != null && alliance.IsMember(guild)) { guild.Alliance = null; //Calls alliance.Removeguild // alliance.RemoveGuild( guild ); m_Other.InvalidateWarNotoriety(); guild.InvalidateMemberNotoriety(); } break; } case 12: //Remove Guild from alliance { if (!playerRank.GetFlag(RankFlags.AllianceControl)) { pm.SendLocalizedMessage(1063436); // You don't have permission to negotiate an alliance. } else if (alliance != null && alliance.Leader != guild) { pm.SendLocalizedMessage(1063239, String.Format("{0}\t{1}", guild.Name, alliance.Name)); // ~1_val~ is not the leader of the ~2_val~ alliance. } else if (alliance != null && alliance.IsMember(guild) && alliance.IsMember(m_Other)) { m_Other.Alliance = null; m_Other.InvalidateMemberNotoriety(); guild.InvalidateWarNotoriety(); } break; } case 13: //Promote to Alliance leader { if (!playerRank.GetFlag(RankFlags.AllianceControl)) { pm.SendLocalizedMessage(1063436); // You don't have permission to negotiate an alliance. } else if (alliance != null && alliance.Leader != guild) { pm.SendLocalizedMessage(1063239, String.Format("{0}\t{1}", guild.Name, alliance.Name)); // ~1_val~ is not the leader of the ~2_val~ alliance. } else if (alliance != null && alliance.IsMember(guild) && alliance.IsMember(m_Other)) { pm.SendLocalizedMessage(1063434, String.Format("{0}\t{1}", m_Other.Name, alliance.Name)); // ~1_val~ is now the leader of ~2_val~. alliance.Leader = m_Other; } break; } case 14: //Withdraw Request { if (!playerRank.GetFlag(RankFlags.AllianceControl)) { pm.SendLocalizedMessage(1063436); // You don't have permission to negotiate an alliance. } else if (alliance != null && alliance.Leader == guild && alliance.IsPendingMember(m_Other)) { m_Other.Alliance = null; pm.SendLocalizedMessage(1070752); // The proposal has been updated. } break; } case 15: //Deny Alliance Request { if (!playerRank.GetFlag(RankFlags.AllianceControl)) { pm.SendLocalizedMessage(1063436); // You don't have permission to negotiate an alliance. } else if (alliance != null && otherAlliance != null && alliance.Leader == m_Other && otherAlliance.IsPendingMember(guild)) { pm.SendLocalizedMessage(1070752); // The proposal has been updated. //m_Other.GuildMessage( 1070782 ); // ~1_val~ has responded to your proposal. //Per OSI commented out. guild.Alliance = null; } break; } case 16: //Accept Alliance Request { if (!playerRank.GetFlag(RankFlags.AllianceControl)) { pm.SendLocalizedMessage(1063436); // You don't have permission to negotiate an alliance. } else if (otherAlliance != null && otherAlliance.Leader == m_Other && otherAlliance.IsPendingMember(guild)) { pm.SendLocalizedMessage(1070752); // The proposal has been updated. otherAlliance.TurnToMember(m_Other); //No need to verify it's in the guild or already a member, the function does this otherAlliance.TurnToMember(guild); } break; } } }
public abstract Gump GetObjectInfoGump(PlayerMobile pm, Guild g, T o);
public static bool IsMember(Mobile m, Guild g) => !(m.Deleted || g.Disbanded || !(m is PlayerMobile) || (m.AccessLevel < AccessLevel.GameMaster && !g.IsMember(m)));
public static bool IsLeader(Mobile m, Guild g) => !(m.Deleted || g.Disbanded || !(m is PlayerMobile) || (m.AccessLevel < AccessLevel.GameMaster && g.Leader != m));
public GuildInvitationRequest(PlayerMobile pm, Guild g, PlayerMobile inviter) : base(pm, g) { m_Inviter = inviter; PopulateGump(); }