using System; using Server; using Server.Network; using Server.Targeting; using Server.Gumps; using Server.Mobiles; using Server.Items; using Server.Commands; namespace Server.Gumps { public class LevelGump : Gump { public static void Initialize() { CommandSystem.Register( "Level", AccessLevel.Player, new CommandEventHandler( LevelGump_OnCommand ) ); } private static void LevelGump_OnCommand( CommandEventArgs e ) { e.Mobile.CloseGump( typeof( LevelGump ) ); e.Mobile.SendGump( new LevelGump( e.Mobile ) ); } private Mobile m_Level; private Mobile m_Experience; private Mobile m_NextLevelUp; public LevelGump( Mobile level ) : base( 0, 0 ) { this.Closable=true; this.Disposable=true; this.Dragable=true; this.Resizable=false; this.AddPage(0); this.AddBackground(239, 88, 291, 455, 9200); this.AddBackground(240, 88, 351, 46, 9200); this.AddBackground(240, 133, 175, 410, 9200); this.AddBackground(416, 133, 175, 409, 9200); this.AddLabel(252, 137, 50, @"Player Status"); this.AddImageTiled(249, 157, 152, 3, 96); this.AddLabel(491, 91, 50, "Level:"); this.AddImageTiled(460, 111, 92, 3, 96); this.AddLabel(251, 445, 50, @"Current Experience:"); this.AddImageTiled(247, 465, 152, 3, 96); this.AddLabel(251, 102, 50, @"Name:"); this.AddImageTiled(249, 122, 152, 3, 96); this.AddLabel(255, 169, 50, @"Strength:"); this.AddLabel(255, 187, 50, @"Dexterity:"); this.AddLabel(255, 204, 50, @"Intelligence:"); this.AddButton(395, 172, 1209, 248, 1, GumpButtonType.Reply, 0); this.AddButton(395, 190, 1209, 248, 2, GumpButtonType.Reply, 0); this.AddButton(395, 208, 1209, 248, 3, GumpButtonType.Reply, 0); this.AddImageTiled(453, 165, 92, 3, 96); this.AddLabel(452, 144, 50, @"Advanced Skills"); this.AddLabel(424, 170, 58, @"Light Weapons:"); this.AddLabel(423, 185, 57, @"Medium Weapons:"); this.AddLabel(423, 245, 56, @"Heavy Armor:"); this.AddLabel(423, 215, 58, @"Light Armor:"); this.AddLabel(423, 230, 57, @"Medium Armor:"); this.AddLabel(423, 200, 56, @"Heavy Weapons:"); this.AddLabel(423, 260, 32, @"Shields:"); this.AddLabel(423, 275, 31, @"Projectiles:"); this.AddLabel(250, 489, 50, @"Next Level Up:"); this.AddImageTiled(246, 509, 152, 3, 96); this.AddLabel(262, 469, 0, ""+ ((PlayerMobile)level).Experience +""); this.AddLabel(262, 513, 0, ""+ ((PlayerMobile)level).NextLevelUp +""); this.AddLabel(340, 169, 0, ""+ level.RawStr + ""); this.AddLabel(340, 187, 0, ""+ level.RawDex + ""); this.AddLabel(340, 204, 0, ""+ level.RawInt + ""); this.AddLabel(540, 170, 0, ""+ ((PlayerMobile)level).LightWeapons + ""); this.AddLabel(540, 185, 0, ""+ ((PlayerMobile)level).MediumWeapons + ""); this.AddLabel(540, 200, 0, ""+ ((PlayerMobile)level).HeavyWeapons + ""); this.AddLabel(540, 215, 0, ""+ ((PlayerMobile)level).LightArmor + ""); this.AddLabel(540, 230, 0, ""+ ((PlayerMobile)level).MediumArmor + ""); this.AddLabel(540, 245, 0, ""+ ((PlayerMobile)level).HeavyArmor + ""); this.AddLabel(540, 260, 0, ""+ ((PlayerMobile)level).Shields + ""); this.AddLabel(540, 275, 0, ""+ ((PlayerMobile)level).Projectiles + ""); this.AddLabel(292, 102, 0, ""+ level.Name + ""); this.AddLabel(531, 91, 0, ""+ ((PlayerMobile)level).Level + ""); this.AddButton(570, 172, 1209, 1210, 4, GumpButtonType.Reply, 0); this.AddButton(570, 187, 1209, 1210, 5, GumpButtonType.Reply, 0); this.AddButton(570, 202, 1209, 1210, 6, GumpButtonType.Reply, 0); this.AddButton(570, 217, 1209, 1210, 7, GumpButtonType.Reply, 0); this.AddButton(570, 232, 1209, 1210, 8, GumpButtonType.Reply, 0); this.AddButton(570, 247, 1209, 1210, 9, GumpButtonType.Reply, 0); this.AddButton(570, 262, 1209, 1210, 10, GumpButtonType.Reply, 0); this.AddButton(570, 277, 1209, 1210, 11, GumpButtonType.Reply, 0); this.AddLabel(284, 225, 50, @"Level Points:"); this.AddLabel(370, 225, 0, ""+ ((PlayerMobile)level).LevelPoints + ""); this.AddLabel(452, 293, 50, @"Skill Points:"); this.AddImageTiled(282, 245, 117, 3, 96); this.AddImageTiled(450, 312, 117, 3, 96); this.AddLabel(533, 293, 0, ""+ ((PlayerMobile)level).SkillPoints + ""); this.AddLabel(245, 255, 50, @"Stats Total:"); this.AddLabel(245, 271, 50, @"Stat Cap:"); this.AddLabel(325, 255, 0, ""+ level.RawStatTotal + ""); this.AddLabel(309, 271, 0, ""+ level.StatCap + ""); this.AddImageTiled(244, 292, 117, 3, 96); this.AddLabel(244, 297, 50, @"Skills Total:"); this.AddLabel(244, 313, 50, @"Skills Cap:"); this.AddLabel(324, 297, 0, ""+ level.SkillsTotal + ""); this.AddLabel(312, 313, 0, ""+ level.SkillsCap + ""); } public override void OnResponse( NetState state, RelayInfo info ) { Mobile from = state.Mobile; if ( from == null ) return; if ( info.ButtonID == 1 ) //STR gain { if ( ((PlayerMobile)from).LevelPoints >= 1 ) { from.SendMessage( "You've used an [LP] on [Strength]." ); from.CloseGump( typeof( LevelGump ) ); from.SendGump( new LevelGump( from )); ((PlayerMobile)from).LevelPoints--; from.RawStr += 1; } else { from.SendMessage( "You don't have enough [LP]!" ); from.CloseGump( typeof( LevelGump ) ); from.SendGump( new LevelGump( from )); } } if ( info.ButtonID == 2 ) //DEX gain { if ( ((PlayerMobile)from).LevelPoints >= 1 ) { from.SendMessage( "You've used an [LP] on [Strength]." ); from.CloseGump( typeof( LevelGump ) ); from.SendGump( new LevelGump( from )); ((PlayerMobile)from).LevelPoints--; from.RawDex += 1; } else { from.SendMessage( "You don't have enough [LP]!" ); from.CloseGump( typeof( LevelGump ) ); from.SendGump( new LevelGump( from )); } } if ( info.ButtonID == 3 ) //INT gain { if ( ((PlayerMobile)from).LevelPoints >= 1 ) { from.SendMessage( "You've used an [LP] on [Strength]." ); from.CloseGump( typeof( LevelGump ) ); from.SendGump( new LevelGump( from )); ((PlayerMobile)from).LevelPoints--; from.RawInt += 1; } else { from.SendMessage( "You don't have enough [LP]!" ); from.CloseGump( typeof( LevelGump ) ); from.SendGump( new LevelGump( from )); } } if ( info.ButtonID == 7 ) //LightArmor gain { if ( ((PlayerMobile)from).SkillPoints >= 1 ) { if ( ((PlayerMobile)from).LightArmor <= 19 ) { from.SendMessage( "You've used an [SP] on [Light Armor]." ); from.CloseGump( typeof( LevelGump ) ); from.SendGump( new LevelGump( from )); ((PlayerMobile)from).SkillPoints--; ((PlayerMobile)from).LightArmor += 1; } else { from.SendMessage( "Your at the max level for this!" ); } } else { from.SendMessage( "You don't have enough [SP]!" ); from.CloseGump( typeof( LevelGump ) ); from.SendGump( new LevelGump( from )); } } if ( info.ButtonID == 8 ) //MediumArmor gain { if ( ((PlayerMobile)from).SkillPoints >= 1 ) { if ( ((PlayerMobile)from).MediumArmor <= 19 ) { from.SendMessage( "You've used an [SP] on [Medium Armor]." ); from.CloseGump( typeof( LevelGump ) ); from.SendGump( new LevelGump( from )); ((PlayerMobile)from).SkillPoints--; ((PlayerMobile)from).MediumArmor += 1; } else { from.SendMessage( "Your at the max level for this!" ); } } else { from.SendMessage( "You don't have enough [SP]!" ); from.CloseGump( typeof( LevelGump ) ); from.SendGump( new LevelGump( from )); } } if ( info.ButtonID == 9 ) //HeavyArmor gain { if ( ((PlayerMobile)from).SkillPoints >= 1 ) { if ( ((PlayerMobile)from).HeavyArmor <= 19 ) { from.SendMessage( "You've used an [SP] on [Heavy Armor]." ); from.CloseGump( typeof( LevelGump ) ); from.SendGump( new LevelGump( from )); ((PlayerMobile)from).SkillPoints--; ((PlayerMobile)from).HeavyArmor += 1; } else { from.SendMessage( "Your at the max level for this!" ); } } else { from.SendMessage( "You don't have enough [SP]!" ); from.CloseGump( typeof( LevelGump ) ); from.SendGump( new LevelGump( from )); } } if ( info.ButtonID == 4 ) //LightWeapon gain { if ( ((PlayerMobile)from).SkillPoints >= 1 ) { if ( ((PlayerMobile)from).LightWeapons <= 19 ) { from.SendMessage( "You've used an [SP] on [Light Weapons]." ); from.CloseGump( typeof( LevelGump ) ); from.SendGump( new LevelGump( from )); ((PlayerMobile)from).SkillPoints--; ((PlayerMobile)from).LightWeapons += 1; } else { from.SendMessage( "Your at the max level for this!" ); } } else { from.SendMessage( "You don't have enough [SP]!" ); from.CloseGump( typeof( LevelGump ) ); from.SendGump( new LevelGump( from )); } } if ( info.ButtonID == 5 ) //MediumWeapon gain { if ( ((PlayerMobile)from).SkillPoints >= 1 ) { if ( ((PlayerMobile)from).MediumWeapons <= 19 ) { from.SendMessage( "You've used an [SP] on [Medium Weapons]." ); from.CloseGump( typeof( LevelGump ) ); from.SendGump( new LevelGump( from )); ((PlayerMobile)from).SkillPoints--; ((PlayerMobile)from).MediumWeapons += 1; } else { from.SendMessage( "Your at the max level for this!" ); } } else { from.SendMessage( "You don't have enough [SP]!" ); from.CloseGump( typeof( LevelGump ) ); from.SendGump( new LevelGump( from )); } } if ( info.ButtonID == 6 ) //HeavyWeapon gain { if ( ((PlayerMobile)from).SkillPoints >= 1 ) { if ( ((PlayerMobile)from).HeavyWeapons <= 19 ) { from.SendMessage( "You've used an [SP] on [Heavy Weapons]." ); from.CloseGump( typeof( LevelGump ) ); from.SendGump( new LevelGump( from )); ((PlayerMobile)from).SkillPoints--; ((PlayerMobile)from).HeavyWeapons += 1; } else { from.SendMessage( "Your at the max level for this!" ); } } else { from.SendMessage( "You don't have enough [SP]!" ); from.CloseGump( typeof( LevelGump ) ); from.SendGump( new LevelGump( from )); } } if ( info.ButtonID == 10 ) //Shields gain { if ( ((PlayerMobile)from).SkillPoints >= 1 ) { if ( ((PlayerMobile)from).Shields <= 19 ) { from.SendMessage( "You've used an [SP] on [Shields]." ); from.CloseGump( typeof( LevelGump ) ); from.SendGump( new LevelGump( from )); ((PlayerMobile)from).SkillPoints--; ((PlayerMobile)from).Shields += 1; } else { from.SendMessage( "Your at the max level for this!" ); } } else { from.SendMessage( "You don't have enough [SP]!" ); from.CloseGump( typeof( LevelGump ) ); from.SendGump( new LevelGump( from )); } } if ( info.ButtonID == 11 ) //Projectiles gain { if ( ((PlayerMobile)from).SkillPoints >= 1 ) { if ( ((PlayerMobile)from).Projectiles <= 19 ) { from.SendMessage( "You've used an [SP] on [Projectiles]." ); from.CloseGump( typeof( LevelGump ) ); from.SendGump( new LevelGump( from )); ((PlayerMobile)from).SkillPoints--; ((PlayerMobile)from).Projectiles += 1; } else { from.SendMessage( "Your at the max level for this!" ); } } else { from.SendMessage( "You don't have enough [SP]!" ); from.CloseGump( typeof( LevelGump ) ); from.SendGump( new LevelGump( from )); } } } } }