| CODE |
using System; using Server; using Server.Items; using Server.Gumps; using Server.Network; using Server.Mobiles; using Server.Guilds; namespace Server.Items { public class ControlStone : Item { private Guild m_Guild; [Constructable] public ControlStone() : base( 0xED4 ) { Movable = false; Hue = 0x250; } public override void OnDoubleClick( Mobile from ) { from.SendGump(new RaceStoneGump(from, m_Guild) ); } public ControlStone( Serial serial ) : base( serial ) { } public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); writer.Write( (int) 0 ); // version } public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); } } } |
| CODE |
using System; using System.Collections; using Server; using Server.Guilds; using Server.Network; using Server.Prompts; using Server.Targeting; namespace Server.Gumps { public class RaceStoneGump : Gump { private Mobile m_Mobile; private Guild m_Guild; public RaceStoneGump( Mobile mobile, Guild guild ) : base( 20, 30 ) { m_Mobile = mobile; m_Guild = guild; this.Closable=true; this.Disposable=true; this.Dragable=true; this.Resizable=false; this.AddPage(0); this.AddBackground(0, 0, 400, 400, 9200); this.AddBackground(5, 5, 390, 390, 3000); this.AddHtml( 5, 5, 390, 20, String.Format( "<center><i>{0} RACE</i></center>", m_Guild.Name.ToUpper() ), false, false); this.AddHtml( 5, 25, 390, 20, String.Format( "<center>Chef Actuel: {0}</center>", m_Guild.Leader != null ? m_Guild.Leader.Name : "pas de chef" ), false, false); Mobile leader = guild.Leader; if ( leader != null ) { string leadTitle; if ( (leadTitle = leader.GuildTitle) != null && (leadTitle = leadTitle.Trim()).Length > 0 ) leadTitle += ": "; else leadTitle = ""; string leadName; if ( (leadName = leader.Name) == null || (leadName = leadName.Trim()).Length <= 0 ) leadName = "(empty)"; AddHtml( 220, 15, 250, 35, leadTitle + leadName, false, false ); } this.AddButton(20, 50, 4005, 4007, 1, GumpButtonType.Reply, 0); this.AddLabel(55, 52, 0, @"Liste des Membres"); this.AddButton(20, 70, 4005, 4007, 1, GumpButtonType.Reply, 0); this.AddLabel(55, 72, 0, @"Voir le Background de la Race"); if ( mobile.AccessLevel >= AccessLevel.GameMaster || mobile == leader ) { this.AddButton(20, 90, 4005, 4007, 1, GumpButtonType.Reply, 0); this.AddLabel(55, 92, 0, @"Section du Chef"); } } public override void OnResponse ( NetState sender, RelayInfo info ) { switch( info.ButtonID ) { case 1: m_Mobile.CloseGump( typeof( ListeMembres ) ); m_Mobile.SendGump( new ListeMembres( m_Mobile, m_Guild ) ); break; case 2: m_Mobile.CloseGump( typeof( BgRace ) ); m_Mobile.SendGump( new BgRace( m_Mobile, m_Guild ) ); break; case 3: m_Mobile.CloseGump( typeof( SectionChef ) ); m_Mobile.SendGump( new SectionChef( m_Mobile, m_Guild ) ); break; } } } } |
| CODE |
using System; using Server; using Server.Items; using Server.Gumps; using Server.Network; using Server.Mobiles; using Server.Guilds; namespace Server.Items { public class ControlStone : Item { private Guild m_Guild; [Constructable] public ControlStone() : base( 0xED4 ) { Movable = false; Hue = 0x250; } public override void OnDoubleClick( Mobile from ) { if (m_Guild != null) from.SendGump(new RaceStoneGump(from, m_Guild) ); } public ControlStone( Serial serial ) : base( serial ) { } public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); writer.Write( (int) 0 ); // version } public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); } } } |
| QUOTE |
| [CommandProperty( AccessLevel.GameMaster )] public Guild CurentGuild { get{ return m_Guild; } set{ m_Guild = value; InvalidateProperties(); } } |
| QUOTE (Ragnaroth @ Aug 13 2004, 04:56 PM) |
| pour l'erro j'ai jamais le temps de la copier |
| QUOTE (Injall @ Aug 15 2004, 11:17 AM) |
| pour l'erro j'ai jamais le temps de la copier |
| QUOTE |
Exception: System.NullReferenceException: Object reference not set to an instance of an object. at Server.Gumps.RaceStoneGump..ctor(Mobile mobile, Guild guild) at Server.Items.ControlStone.OnDoubleClick(Mobile from) at Server.Mobile.Use(Item item) at Server.Network.PacketHandlers.UseReq(NetState state, PacketReader pvSrc) at Server.Network.MessagePump.HandleReceive(NetState ns) at Server.Network.MessagePump.Slice() at Server.Core.Main(String[] args) |