View Single Post
Old 08-06-2008, 05:35 PM   #9 (permalink)
typhoonbot
Forum Novice
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 480
Default

Okay, no intention of bumping here, I have just updated the scripts, and I need you to show me what I'm doing wrong thus far.

this is how my UmbarianStone.cs looks:

Code:
using Server;
using System;
using Server.Gumps;
using Server.Network;
using Server.Items;
using Server.Mobiles;
using Server.Accounting;

namespace Server.Items
{
    public class UmbarianStone : Item
    {
    	
    	m_List = new List<Mobile>();

        [Constructable]
        public UmbarianStone()
            : base(3796)
        {
            Movable = false;
            Name = "Umbarian Shadows Stone";
        }
        
        public void AddMember( Mobile from )
		{
			if( m_List.Contains( from ) )
			{
				from.SendMessage(37, "You are already a member of the guild.");
				return;
			}

			if ( pm.ProfessionNumber == 10 )
			{
				m_List.Add( from );
				pm.Umbarian = 1;
				pm.SendMessage( 68, "You have joined the Umbarian Shadows Thief Guild.");
				pm.Backpack.DropItem( new UmbarianShadowsRobe() );
				pm.AcceptGuildInvites = false;
			}
		}
        
        public void RemoveMember( Mobile from )
		{
			if( m_List.Contains( from ) )
			{
				int x = 1;
				Container pack = pm.Backpack;
					if (pack != null)
					{
						if (pack.ConsumeTotal(typeof(UmbarianShadowsRobe), x))
						{
							m_List.Remove( from );
							pm.SendMessage(68, "You have Resigned From The Umbarian Shadows Thief Guild.");
							pm.AcceptGuildInvites = true;
							pm.Umbarian = 0;
						}
						else
						{
							pm.SendMessage( 38, "Please place your Umbarian Shadows Guild Robe in your backpack, and try again.");	
						}
					} 
			}
			else
			{
				from.SendMessage("You are not a member");
			}
	}
        

        public override void OnDoubleClick(Mobile from)
        {
        	
            from.SendMessage( 1172, "Select your Choice...");
        	if (from.InRange(GetWorldLocation(), 3))
                from.SendGump(new UmbarianGuildGump(this));
            else
                from.SendLocalizedMessage(500446); // That is too far away. 
        }
        public UmbarianStone(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(); 
		} 
    }  	        
}
This is the UmbarianGuildGump.cs script:

Code:
using Server;
using System;
using Server.Gumps;
using Server.Commands;
using Server.Network;
using Server.Items;
using Server.Mobiles;
//
namespace Server.Gumps
{
    public class UmbarianGuildGump : Gump
    {
    	//New Edit
    	private UmbarianStone m_Stone;
    	//End
    	
        public UmbarianGuildGump()
            : base(347, 216)
        {
        	//New Edit
        	m_Stone = stone;
        	//End
        	
            this.Closable = true;
            this.Disposable = false;
            this.Dragable = true;
            this.Resizable = false;
            this.AddPage(0);
            //
            //BackGrounds
            this.AddBackground(0, 0, 315, 150, 9250);
            //Labels
            this.AddLabel(94, 9, 3, @"Umbarian Shadows");
            this.AddLabel(30, 63, 1168, @"Join Umbarian Shadows");
            this.AddLabel(30, 108, 1168, @"Resign from Umbarian Shadows");
            //Buttons
            this.AddButton(230, 63, 247, 248, 1, GumpButtonType.Reply, 0);
            this.AddButton(230, 108, 247, 248, 2, GumpButtonType.Reply, 0);

        }

        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile m = sender.Mobile;
            PlayerMobile pm = (PlayerMobile)m;

            switch (info.ButtonID)
            {
                case 0:
                    {
                        pm.SendMessage( 68, "You choose not to join the Umbarian Shadows");
                        return;
                    }
                case 1:
                    {
            			m_Stone.AddMember( pm );
						break;
                    }

                case 2:
                    {
            			m_Stone.RemoveMember( pm );
                        break;
                    }
            }
        }
    }
}
I think my main cockup so far was the List<Mobile>.

Compiling those two scripts gives the following errors (mainly because of the List<Mobile>:

Errors:
+ Custom/Umbarian Shadows System/UmbarianStone.cs:
CS1519: Line 14: Invalid token '=' in class, struct, or interface member dec
laration
CS1519: Line 14: Invalid token '(' in class, struct, or interface member dec
laration
__________________
legendsofkaine.page.tl
typhoonbot is offline   Reply With Quote