| CODE |
using System; using Server; using Server.Mobiles; using Server.Network; using Server.Items; using Server.Gumps; //commande qui fait apparaitre le gump namespace Server.Scripts.Commands { public class fenetre { public static void Initialize() { Server.Commands.Register( "fenetre", AccessLevel.Player, new CommandEventHandler(fenetre_OnCommand ) ); } [Usage( "fenetre" )] [Description( "fait apparaitre une fenetre" )] public static void fenetre_OnCommand( CommandEventArgs e ) { from.SendGump( new fenetreGump ( from ) ); } } } //gump avec le bouton namespace Server.Gumps { public class fenetreGump : Gump { public void AddBlueBack( int width, int height ) { AddBackground ( 55, 60, width-00, height-00, 0xE10 ); AddBackground ( 63, 65, width-16, height-11, 0x053 ); AddImageTiled ( 70, 74, width-29, height-29, 0xE14 ); AddAlphaRegion( 70, 74, width-29, height-29 ); } public fenetreGump(Mobile from) : base(0,0) { Closable = true; Dragable = true; AddPage(0); AddBlueBack( 300, 200 ); AddLabel( 100, 75, 1150,"Blacksmithy "); AddButton( 85, 75, 0x2623, 0x2622, 1, GumpButtonType.Reply, 0 ); } public override void OnResponse( NetState state, RelayInfo info ) { Mobile from = state.Mobile; PlayerMobile player= ( PlayerMobile ) from; int val = info.ButtonID; //quand on appuis sur le bouton switch(val) { case 0: break; case 1: { player.Skills[SkillName.Blacksmith].Cap+=4; break; } } } } } |