RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

MWDrink Bottle

Im Sorry you talk my English, but the US updated it with slang. and so on. im %100 Brittish, i was born in the UK and live in the UK.

With my miss letters, every so on. it just as im typing quick.

lol
all the best
 

Packer898

Knight
WonderlandADnc said:
Im Sorry you talk my English, but the US updated it with slang. and so on. im %100 Brittish, i was born in the UK and live in the UK.

With my miss letters, every so on. it just as im typing quick.

lol
all the best

Well then you have no excuses. When you are asking a question or stating facts that we are trying to understand you need to slow down and form complete sentences. Most of the time what you write is jibberish and incomplete thoughts, so it makes it very hard to understand what your asking or saying.
 

TMSTKSBK

Lord
So LoNg As S/He DoEsNt TyPe LiKe DiS I DoNt MiNd!!!??!!!?!?!??!(*#^$(!#^(*$!!

There are three things represented here:

A. StUpId SpEEk
B. no punctuation at all whatsoever it just goes on and on and on and on...
C. MULTIPLE EXCLAMATIONS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 

Packer898

Knight
WonderlandADnc said:
im sorry Please forgive me

Nothing to forgive just make it easier on us and yourself by forming complete sentences. This would probably make it alot easier for us to help you rather then trying to guess at what your meaning.

Dont get me wrong Im not mad at you. Aggrivated yes, you obviously havent taken the time to read basic tutorials. Alot of this programming is basics and requires just an ounce of common sense. If you had been reading the tutorials like what we keep telling you then you'd know what objects, classes, properties and methods are and how to change/manipulate them.

Until you invest the time and energy into doing this it will continue to take you hours upon hours to do simple scripts such as this. :eek:
 
Well!
1. Im a He. lol

and 2, i dont talk like that.
i do agree i miss spell. or something like that.
but its nice for someone to say. (what do you mean by ....)
 
ok well im back, lol

i have been trying and did alsorts to try, but this is where i am. near home i think. lol

Code:
using System;
namespace Server.Items

{
	[FlipableAttribute( 0x99F, 0x99F )]
	public class DrinkMe : Item
	{
                [B]public override int Bonus{ get{ return 5; } }
		public override StatType Type{ get{ return StatType.Int; } }[/B]
		// int hi = 0; // 
		[Constructable]
		public DrinkMe() : base( 0x99F )
		{
			Name = "Drink Me!";
			this.Weight = 0.1;
		}

		public DrinkMe( Serial serial ) : base( serial )
		{
		}

		public override void OnDoubleClick( Mobile from )
		{
			Container pack = from.Backpack;
			if (pack != null && pack.ConsumeTotal( typeof( DrinkMe ), 1 ) )
			
					from.SendMessage( "You drink the liquid and feel small enough to fit through the door!" );
					from.PlaySound( 0x2D6 );
                                        from.Say( "*Hic*" );
											
		[B]}

                public virtual bool Apply( Mobile from )
                {
                                        int Bonus( get; )
                                        StatType Type( get; )                 
                }		[/B]

		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();
		}
	}
}

in bold is what i added.
but i got an error.

Code:
RunUO - [www.runuo.com] Version 1.0.0, Build 36918
Scripts: Compiling C# scripts...failed (2 errors, 0 warnings)
 - Error: Scripts\Customs\fortowns\AlicesWon\Food\DrinkMe.cs: CS0115: (line 8, c
olumn 37) 'Server.Items.DrinkMe.Bonus': no suitable method found to override
 - Error: Scripts\Customs\fortowns\AlicesWon\Food\DrinkMe.cs: CS0115: (line 9, c
olumn 28) 'Server.Items.DrinkMe.Type': no suitable method found to override
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

What am i doing wrong. thanks again.

PS to all that want to no. at the moment im in the recording stuido, working on the new EP. I want to do an album the our Manager wants what he wants. lol
thanks for the help. and rest. :)
 

A_Li_N

Knight
WonderlandADnc said:
ok well im back, lol

i have been trying and did alsorts to try, but this is where i am. near home i think. lol

Code:
	[FlipableAttribute( 0x99F, 0x99F )]
	public class DrinkMe : Item
	{
                [B]public override int Bonus{ get{ return 5; } }
		public override StatType Type{ get{ return StatType.Int; } }[/B]
It's quite obvious what the problem is...the error states exactly what's wrong. There are no defined variables for Bonus or StatType Type contained in Item. You have to define them.
 

Kamron

Knight
You cannot do this

Code:
                public virtual bool Apply( Mobile from )
                {
                                        int Bonus( get; )
                                        StatType Type( get; )                 
                }

Do you see that you have an abstract property definition in a method. You need to look at how that base class that everyone is telling you to look at uses the Apply method, and do it that way.

Wonderland, if you are on ICQ quite often, then please ICQ me and I will finish helping you when I get home. If you have AIM, then private message me your AIM.

If you choose to message me, then can everyone else please stop helping him, this is obviously confusing him, and he does not know enough programming to finish this. So either you guys can give him a final product or nothing.

Wonderland, I am offering to teach you enough about C# to complete what you need for this item considering you do not know the terminology, as well as the syntax "grammar" of coding what you need.
 
i would like that, anyway. i will try and get AIM, but its 4.30am here. so im going to sleep soon. but. thanks. i will take you up on the help.

with what people is tell me is to look at
Code:
Back to Server.Items
BaseMagicFish : Item, IEntity, IPoint3D, IPoint2D, IHued
Derived Types: PeculiarFish, PrizedFish, TrulyRareFish, WondrousFish
(ctor) BaseMagicFish( Serial serial )
(ctor) BaseMagicFish( int hue )
int Bonus( get; )
StatType Type( get; )
virtual bool Apply( Mobile from )
virtual void Deserialize( GenericReader reader )
virtual void OnDoubleClick( Mobile from )
virtual void Serialize( GenericWriter writer )

now other than
Code:
int Bonus( get; )
StatType Type( get; )
virtual bool Apply( Mobile from )
i cant see it., lol
and also putting in
Code:
public override int Bonus{ get{ return 5; } }
public override StatType Type{ get{ return StatType.Int; } }
so at the moment im looking around.

i no to some this is silly. but im liking this post and i like all my posts.
yes i need more learning. and im getting to the point of im going to learn the coding. with your offer. and read lots. and try not to script something over me to do at the moment. as i dont want to loose. the people on the site. when i doing something. i feel like the little boy who cryed wolf.
so thanks to all. i am always open to do this. but if not. i will get help leaning as well as i want to.
but please people dont shove me away out of you books.
i want to become a pall of people on here.
so again. im sorry. and i hope to get along better from now on.

Please reply if anything i have said is ok. :D
 

Packer898

Knight
Try this, Ihavent tested it.

Code:
using System;

namespace Server.Items
{
	public class DrinkMe : Item
	{
		public override int Bonus{ get{ return 5; } }
		public override StatType Type{ get{ return StatType.Int; } }
		
		[Constructable]
		public DrinkMe() : base( 0x99F )
		{
			Name = "Drink Me!";
			Weight = 0.1;
		}
		
		public DrinkMe( Serial serial ) : base( serial )
		{
		}
		
		public override void OnDoubleClick( Mobile from )
		{
			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
			else if ( Apply( from ) )
			{
				from.SendMessage( "You drink the liquid and feel small enough to fit through the door!" );
				from.PlaySound( 0x2D6 );
				from.Say( "*Hic*" );
				Delete();
			}
		}
		
		public virtual bool Apply( Mobile from )
		{
			bool applied = Spells.SpellHelper.AddStatOffset( from, Type, Bonus, TimeSpan.FromMinutes( 1.0 ) );
			
			if ( !applied )
				from.SendLocalizedMessage( 502173 ); // You are already under a similar effect.
			
			return applied;
		}
		
		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();
		}
	}
}
 
WOW that was mad and cool.
but no it didnt work.
Code:
RunUO - [www.runuo.com] Version 1.0.0, Build 36918
Scripts: Compiling C# scripts...failed (2 errors, 0 warnings)
 - Error: Scripts\Customs\fortowns\AlicesWon\Food\DrinkMe.cs: CS0115: (line 7, c
olumn 23) 'Server.Items.DrinkMe.Bonus': no suitable method found to override
 - Error: Scripts\Customs\fortowns\AlicesWon\Food\DrinkMe.cs: CS0115: (line 8, c
olumn 28) 'Server.Items.DrinkMe.Type': no suitable method found to override
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
strange, seems to not like the
Code:
public override int Bonus{ get{ return 5; } }
		public override StatType Type{ get{ return StatType.Int; } }
part. lol. thanks anyway. all the best.:)
 

Packer898

Knight
Oops. Yeah since your not using a parent class you need to get rid of the override part on those lines. I forgot to change it.

Code:
using System;

namespace Server.Items
{
	public class DrinkMe : Item
	{
		public int Bonus{ get{ return 5; } }
		public StatType Type{ get{ return StatType.Int; } }
		
		[Constructable]
		public DrinkMe() : base( 0x99F )
		{
			Name = "Drink Me!";
			Weight = 0.1;
		}
		
		public DrinkMe( Serial serial ) : base( serial )
		{
		}
		
		public override void OnDoubleClick( Mobile from )
		{
			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
			else if ( Apply( from ) )
			{
				from.SendMessage( "You drink the liquid and feel small enough to fit through the door!" );
				from.PlaySound( 0x2D6 );
				from.Say( "*Hic*" );
				Delete();
			}
		}
		
		public virtual bool Apply( Mobile from )
		{
			bool applied = Spells.SpellHelper.AddStatOffset( from, Type, Bonus, TimeSpan.FromMinutes( 1.0 ) );
			
			if ( !applied )
				from.SendLocalizedMessage( 502173 ); // You are already under a similar effect.
			
			return applied;
		}
		
		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();
		}
	}
}
 

A_Li_N

Knight
Since there's 5 pages, which means you're trying, I'm going to throw out some help....
Code:
RunUO - [www.runuo.com] Version 1.0.0, Build 36918
Scripts: Compiling C# scripts...failed (2 errors, 0 warnings)
 - Error: Scripts\Customs\fortowns\AlicesWon\Food\DrinkMe.cs: CS0115: (line 7, c
olumn 23) 'Server.Items.DrinkMe.Bonus': no suitable method found to override
 - Error: Scripts\Customs\fortowns\AlicesWon\Food\DrinkMe.cs: CS0115: (line 8, c
olumn 28) 'Server.Items.DrinkMe.Type': no suitable method found to override
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
These two errors mean the same thing. When you use 'override', it means it's trying to make something from the parent class equal something else. So if you wanted to do 'override int Bonus' and your parent class is Item, 'Item' would have to have a variable called 'Bonus' for you to override. Since you can't (dont want to actually) edit Item class, you don't want to use 'override'.

Instead, you probably want to define the variable for your actual class...
Code:
		public int Bonus{ get{ return 5; } }
		public StatType Type{ get{ return StatType.Int; } }
(like Packer898's example)
This will define the variables for your DrinkMe class. If you are deriving things from the DrinkMe class and want to be able to 'override' those values, you would do
Code:
		public virtual int Bonus{ get{ return 5; } }
		public virtual StatType Type{ get{ return StatType.Int; } }
(I believe, might be abstract instead of virtual)
This allows you to do something like this:
Code:
public class DrinkThis : DrinkMe
{
	public override int Bonus{ get{ return 10; } }
	public override StatType Type{ get{ return StatType.Str; } }
	...
}
 
Top