Go Back   RunUO - Ultima Online Emulation > RunUO > Script Support

Script Support Get support for modifying RunUO Scripts, or writing your own!

Reply
 
Thread Tools Display Modes
Old 11-13-2008, 03:16 PM   #1 (permalink)
Newbie
 
Join Date: Nov 2008
Age: 24
Posts: 43
Default Archery System Help

Hi not sure what i need to look for to fix this error:

Thanks for any help

RunUO - [www.runuo.com] Version 2.0, Build 2959.20979
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 2 processors
Scripts: Compiling C# scripts...failed (2 errors, 0 warnings)
Errors:
+ Customs/Lucid's Systems/Advanced Archery/Items/Quivers/ElvenQuiver.cs:
CS0127: Line 50: Since 'Server.Items.ElvenQuiver.OnRemoved(object)' returns
void, a return keyword must not be followed by an object expression
+ Customs/Lucid's Systems/Advanced Archery/Items/Quivers/UltimateQuiver.cs:
CS0127: Line 50: Since 'Server.Items.UltimateQuiver.OnRemoved(object)' retur
ns void, a return keyword must not be followed by an object expression
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.


Code:
/*
    _________________________________
 -=(_)_______________________________)=-
   /   .   .   . ____  . ___      _/
  /~ /    /   / /     / /   )2008 /
 (~ (____(___/ (____ / /___/     (
  \ ----------------------------- \
   \    lucidnagual@charter.net    \
    \_     ===================      \
     \         Lucid Systems         \
      \_     ===================     ~\
       )      Lucid's Mega Pack        )
      /~    The Mother Load v1.1     _/
    _/_______________________________/
 -=(_)_______________________________)=-
 */
using System;

namespace Server.Items
{
	[Flipable( 0x2FB7, 0x3171 )]
	public class ElvenQuiver : BaseQuiver
	{
		public override int MaxWeight{ get{ return 250; } }

		[Constructable]
		public ElvenQuiver() : base( 0x2FB7 )
		{
			Name = "Elven Quiver";

			Attributes.DefendChance = 5; //Defense Chance 15%
			Attributes.WeaponDamage = 10; //Weapon Damage 15%

			LowerAmmoCost = 10; //Lower Ammo Cost Mod

			SkillBonuses.SetValues( 0, SkillName.Archery, 3.0 ); /*= Utility.Random( 0,4 );*/
		}

		public override bool OnEquip( Mobile from )
		{
			Name = from.Name + "'s Quiver";

			return base.OnEquip(from);
		}

		public override void OnRemoved( object parent )
		{
			Name = "Elven Quiver";

			return base.OnRemoved( parent );
		}


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

			if ( Layer != Layer.MiddleTorso )
				Layer = Layer.MiddleTorso;
		}
	}
}
Memphis.Knox is offline   Reply With Quote
Old 11-13-2008, 03:30 PM   #2 (permalink)
Forum Novice
 
Join Date: Feb 2007
Posts: 305
Default

Hi,

Code:
public override void OnRemoved( object parent )
		{
			Name = "Elven Quiver";

			return base.OnRemoved( parent );
		}
Your OnRemoved method is defined as returning void... In that way you can't return base.OnRemoved...

Two things :

- if base OnRemoved ( here it means BaseQuiver/OnRemoved ) is really defined as returning void
Code:
public override void OnRemoved( object parent )
		{
			Name = "Elven Quiver";

			base.OnRemoved( parent );//without returning value, just calling base method
		}
- and if it is an error, meaning that base method returning a value, you must change your OnRemoved method in order to declare the good return type.

(I bet it's the first soluce of course).
Gargouille is online now   Reply With Quote
Old 11-13-2008, 03:56 PM   #3 (permalink)
Newbie
 
Join Date: Nov 2008
Age: 24
Posts: 43
Default

Thank you Gargouille !!!!!!! That worked Server started with no errors woot!!!!!!! and thanks for breaking the code down to help me understand. 10 X Karma

Memphis
Memphis.Knox is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5