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!

Exchange Stone

etherkye

Wanderer
just try the shadow horse script by itself to make sure theres no errors in that.

*edit*
checked out the shadow horse script and that works, what did you save it as?
 

Shadow_2004

Wanderer
ok

this is how i left the exchange stone and horse script, and this is the error im getting still,

- Error: Scripts\Custom\Town Quests\Reward Quest 1.cs: CS0103: (line 30, column
24) The name 'ShadowHorse' does not exist in the class or namespace 'Server.Ite
ms.Qone'

this is the exchange stone script
Code:
using System; 
using Server.Items;

namespace Server.Items
{ 
[Serializable()] 
public class Qone : Item 
{ 
[Constructable] 
public Qone() : base( 0xED4 ) 
{ 
Movable = false; 
Hue = 0x85; 
Name = "A Quest 1 Exchange Stone"; 
} 


public override void GetProperties( ObjectPropertyList list ) 
{ 
base.GetProperties( list ); 

list.Add( "The Evil Mage Ring for The Shadow Horse"); 
} 

public override void OnDoubleClick( Mobile from ) 
{ 
Container pack = from.Backpack; 
if ( from.Backpack.ConsumeTotal( typeof( Qoner ), 1 ) ) 
{ 
from.Backpack.AddItem( ShadowHorse() );

((Mobile)from).SendMessage("You Exchange The Ring For The Horse."); 

} 
else 
((Mobile)from).SendMessage("You do not have The Ring."); 
} 

public Qone( 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 horse script
Code:
using System;
using Server.Mobiles;
using Server.Items;

namespace Server.Mobiles
{
	[CorpseName( "a Shadow Horse corpse" )]
	[TypeAlias( "Server.Mobiles.BrownHorse", "Server.Mobiles.DirtyHorse", "Server.Mobiles.GrayHorse", "Server.Mobiles.TanHorse" )]
	public class ShadowHorse : BaseMount
	{
		private static int[] m_IDs = new int[]
			{
				0xC8, 0x3E9F,
				0xE2, 0x3EA0,
				0xE4, 0x3EA1,
				0xCC, 0x3EA2
			};

		[Constructable]
		public ShadowHorse() : this( "a Shadow horse" )
		{
		}

		[Constructable]
		public ShadowHorse( string name ) : base( name, 0xE2, 0x3EA0, AIType.AI_Animal, FightMode.Agressor, 10, 1, 0.2, 0.4 )
		{
			int random = Utility.Random( 4 );

			Body = m_IDs[random * 2];
			ItemID = m_IDs[random * 2 + 1];
			BaseSoundID = 0xA8;
			Hue = 1889;

			SetStr( 82, 118 );
			SetDex( 56, 75 );
			SetInt( 6, 10 );

			SetHits( 28, 45 );
			SetMana( 0 );

			SetDamage( 7, 10 );

			SetDamageType( ResistanceType.Physical, 100 );

			SetResistance( ResistanceType.Physical, 15, 20 );

			SetSkill( SkillName.MagicResist, 25.1, 30.0 );
			SetSkill( SkillName.Tactics, 29.3, 44.0 );
			SetSkill( SkillName.Wrestling, 29.3, 44.0 );

			Fame = 300;
			Karma = 300;

			Tamable = true;
			ControlSlots = 1;
			MinTameSkill = 29.1;
		}

		public override int Meat{ get{ return 3; } }
		public override int Hides{ get{ return 10; } }
		public override FoodType FavoriteFood{ get{ return FoodType.FruitsAndVegies | FoodType.GrainsAndHay; } }

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

thankyou for ur replies, much appreicated
 

etherkye

Wanderer
line 28
Code:
typeof( Qoner ),

Error: Scripts\Custom\Town Quests\Reward Quest 1.cs: CS0103: (line 30, column
24) The name 'ShadowHorse' does not exist in the class or namespace 'Server.Ite
ms.Qone'


one says Qone and one says Qoner. try removing the r and seeing if it works then. and please do what geezer said above.
 

Shadow_2004

Wanderer
k

Qone means Quest 1 Stone, the Qoner is the Quest 1 Reward you get and u trade that in for the horse

i put typeof( Qoner ),
i get all these errors i done wot u sed, gives me these lol i mite nt bother wiv the horse just script a item instead LOL

Scripts: Compiling C# scripts...failed (5 errors, 2 warnings)
- Error: Scripts\Custom\Town Quests\Reward Quest 1.cs: CS1525: (line 29, column
1) Invalid expression term '{'
- Error: Scripts\Custom\Town Quests\Reward Quest 1.cs: CS1026: (line 29, column
2) ) expected
- Error: Scripts\Custom\Town Quests\Reward Quest 1.cs: CS1026: (line 29, column
2) ) expected
- Error: Scripts\Custom\Town Quests\Reward Quest 1.cs: CS1514: (line 32, column
68) { expected
- Error: Scripts\Custom\Town Quests\Reward Quest 1.cs: CS1525: (line 35, column
1) Invalid expression term 'else'
i think iots this bit
Code:
public override void OnDoubleClick( Mobile from ) 
{ 
Container pack = from.Backpack; 
if ( from.Backpack.ConsumeTotal( typeof( Qoner ), 
{ 
from.Backpack.AddItem( new ShadowHorse() );

((Mobile)from).SendMessage("You Exchange The Ring For The Horse."); 

} 
else 
((Mobile)from).SendMessage("You do not have The Ring."); 
}

thx 4 replies
 

Shadow_2004

Wanderer
k

i get this error now lol, sorry im being a pain my stupid scripting

- Warning: Scripts\Custom\Town Quests\Reward Quest 1.cs: CS0642: (line 29, colu
mn 54) Possible mistaken null statement
- Error: Scripts\Custom\Town Quests\Reward Quest 1.cs: CS1525: (line 37, column
1) Invalid expression term 'else'

this is wot the script looks like now
Code:
using System; 
using Server.Items;

namespace Server.Items
{ 
[Serializable()] 
public class Qone : Item 
{ 
[Constructable] 
public Qone() : base( 0xED4 ) 
{ 
Movable = false; 
Hue = 0x85; 
Name = "A Quest 1 Exchange Stone"; 
} 


public override void GetProperties( ObjectPropertyList list ) 
{ 
base.GetProperties( list ); 

list.Add( "The Evil Mage Ring for The Shadow Horse"); 
} 

public override void OnDoubleClick( Mobile from ) 
{ 
Container pack = from.Backpack; 

	if ( from.Backpack.ConsumeTotal( typeof( Qoner ) ) );

{ 
from.Backpack.AddItem( new ShadowHorse() );

((Mobile)from).SendMessage("You Exchange The Ring For The Horse."); 

} 
else 
((Mobile)from).SendMessage("You do not have The Ring."); 
} 

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

thx 4 all the help
 

Shadow_2004

Wanderer
so

so i take out the ; what about the error thx

Scripts: Compiling C# scripts...failed (1 errors, 3 warnings)
- Warning: Scripts\Custom\Town Quests\Reward Quest 1.cs: CS0642: (line 29, colu
mn 54) Possible mistaken null statement
- Error: Scripts\Custom\Town Quests\Reward Quest 1.cs: CS1525: (line 37, column
1) Invalid expression term 'else'

???????????
 

Shadow_2004

Wanderer
ok

if i take the ; out i get this

Scripts: Compiling C# scripts...failed (2 errors, 2 warnings)
- Error: Scripts\Custom\Town Quests\Reward Quest 1.cs: CS1501: (line 29, column
7) No overload for method 'ConsumeTotal' takes '1' arguments
- Error: Scripts\Custom\Town Quests\Reward Quest 1.cs: CS0246: (line 32, column
28) The type or namespace name 'ShadowHorse' could not be found (are you missin
g a using directive or an assembly reference?)


thx again and tht
 

Geezer

Wanderer
Try and get in the habit of laying out your code better, it makes it much easier to read.

Code:
using System; 
using Server.Items;
using Server.Mobiles;

namespace Server.Items
{ 
	[Serializable()] 
	public class Qone : Item 
	{ 
		[Constructable] 
		public Qone() : base( 0xED4 ) 
		{ 
			Movable = false; 
			Hue = 0x85; 
			Name = "A Quest 1 Exchange Stone"; 
		} 

		public override void GetProperties( ObjectPropertyList list ) 
		{ 
			base.GetProperties( list ); 
			list.Add( "The Evil Mage Ring for The Shadow Horse"); 
		} 

		public override void OnDoubleClick( Mobile from ) 
		{ 
			Container pack = from.Backpack; 
			if ( from.Backpack.ConsumeTotal( typeof( Qoner ), 1  ) )
			{ 
				from.AddToBackpack( new ShadowHorse() );
				from.SendMessage("You Exchange The Ring For The Horse."); 
			} 
			else
			{
				from.SendMessage("You do not have The Ring."); 
			}
		} 

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

Shadow_2004

Wanderer
ok

i used the script that geezer gave me, but i got this :(


- Error: Scripts\Custom\Town Quests\Reward Quest 1.cs: CS1502: (line 29, column
5) The best overloaded method match for 'Server.Mobile.AddToBackpack(Server.Ite
m)' has some invalid arguments
- Error: Scripts\Custom\Town Quests\Reward Quest 1.cs: CS1503: (line 29, column
25) Argument '1': cannot convert from 'Server.Mobiles.ShadowHorse' to 'Server.I
tem'
 
Top