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!

!!!!Need Help!!!!

!!!!Need Help!!!!

:confused: Let me start out with this im trying to figure out how to mod the cow and chicken script so that when u double click the cowu can get milk from it and with the chicken you double click it and u get eggs.as i said im not sure were to start with this so i turn to the comunity and maybe you guys can help me out with it or at least send me in the right direction. thanks :confused:
 

krazeykow

Sorceror
public override void OnDoubleClick( Mobile from )
{
Egg egg = new Egg();

if ( !from.AddToBackpack( egg ) )
egg.Delete();
}



Im not sure, but that should work for the chicken :]

-Do the same for the milk :]
 
krazeykow said:
public override void OnDoubleClick( Mobile from )
{
Egg egg = new Egg();

if ( !from.AddToBackpack( egg ) )
egg.Delete();
}



Im not sure, but that should work for the chicken :]



were would i add this at
 

krazeykow

Sorceror
Well, are you trying to add this to a statue of a chicken/cow or to the actual mobile chicken/cow

-Sorry i should of asked before :]
 
C:\>Scripts: Compiling C# scripts...failed (5 errors, 0 warnings)
- Error: c:\Documents and Settings\home\Desktop\RUNUO\RunUO-Beta-36\Scripts\Mob
iles\Animals\Birds\EggChicken.cs: CS1513: (line 50, column 4) } expected
- Error: c:\Documents and Settings\home\Desktop\RUNUO\RunUO-Beta-36\Scripts\Mob
iles\Animals\Birds\EggChicken.cs: CS1518: (line 61, column 19) Expected class, d
elegate, enum, interface, or struct
- Error: c:\Documents and Settings\home\Desktop\RUNUO\RunUO-Beta-36\Scripts\Mob
iles\Animals\Birds\EggChicken.cs: CS1518: (line 68, column 19) Expected class, d
elegate, enum, interface, or struct
- Error: c:\Documents and Settings\home\Desktop\RUNUO\RunUO-Beta-36\Scripts\Mob
iles\Animals\Birds\EggChicken.cs: CS1022: (line 75, column 1) Type or namespace
definition, or end-of-file expected
- Error: c:\Documents and Settings\home\Desktop\RUNUO\RunUO-Beta-36\Scripts\Mob
iles\Animals\Birds\EggChicken.cs: CS0101: (line 7, column 15) The namespace 'Ser
ver.Mobiles' already contains a definition for 'Chicken'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
using System;
using Server.Mobiles;

namespace Server.Mobiles
{
[CorpseName( "a chicken corpse" )]
public class Chicken : BaseCreature
{
[Constructable]
public Chicken() : base( AIType.AI_Animal, FightMode.Agressor, 10, 1, 0.2, 0.4 )
{
Name = "a chicken";
Body = 0xD0;
BaseSoundID = 0x6E;

SetStr( 5 );
SetDex( 15 );
SetInt( 5 );

SetHits( 3 );
SetMana( 0 );

SetDamage( 1 );

SetDamageType( ResistanceType.Physical, 100 );

SetResistance( ResistanceType.Physical, 1, 5 );

SetSkill( SkillName.MagicResist, 4.0 );
SetSkill( SkillName.Tactics, 5.0 );
SetSkill( SkillName.Wrestling, 5.0 );

Fame = 150;
Karma = 0;

VirtualArmor = 2;

Tamable = true;
ControlSlots = 1;
MinTameSkill = -0.9;
}

public override int Meat{ get{ return 1; } }
public override MeatType MeatType{ get{ return MeatType.Bird; } }
public override FoodType FavoriteFood{ get{ return FoodType.GrainsAndHay; } }

public override int Feathers{ get{ return 25; } }

public Chicken(Serial serial) : base(serial)
{
public override void OnDoubleClick( Mobile from )
{
Egg egg = new Egg();

if ( !from.AddToBackpack( egg ) )
egg.Delete();
}

}

public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);

writer.Write((int) 0);
}

public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);

int version = reader.ReadInt();
}
}
}
 

ArteGordon

Wanderer
Code:
public Chicken(Serial serial) : base(serial)
{
public override void OnDoubleClick( Mobile from )
{
Egg egg = new Egg();

if ( !from.AddToBackpack( egg ) )
egg.Delete();
}

}
is wrong. You put the override for OnDoubleClick inside of the Chicken serial method.

you want

Code:
public Chicken(Serial serial) : base(serial)
{
}

public override void OnDoubleClick( Mobile from )
{
Egg egg = new Egg();

if ( !from.AddToBackpack( egg ) )
egg.Delete();
}
 
C:\>Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
- Error: c:\Documents and Settings\home\Desktop\RUNUO\RunUO-Beta-36\Scripts\Mob
iles\Animals\Birds\Chicken.cs: CS1513: (line 62, column 4) } expected
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

}

public override int Meat{ get{ return 1; } }
public override MeatType MeatType{ get{ return MeatType.Bird; } }
public override FoodType FavoriteFood{ get{ return FoodType.GrainsAndHay; } }

public override void OnDoubleClick( Mobile from )
{
Egg egg= new Egg();

if ( !from.AddToBackpack( egg ) )
egg.Delete();
}
 

ArteGordon

Wanderer
while it reports the error there, the problem is probably a matter of mis-matched brackets so you really need the whole script to find the problem. If you are just using a simple text editor I would strongly recommend something more helpful for coding that will allow you to match brackets, for example. SharpDevelop and ConTEXT are two that I like.

http://www.icsharpcode.net

http://www.fixedsys.com/context
 

ArteGordon

Wanderer
alucardthevamp said:
srry dident see the links there how do i use the sharp develop

just download and install it. It provides a code development environment that includes an editor that provides many helpful coding features. You can use it just like you would use your normal text editor for modifying code.
 

Jason

Wanderer
alucardthevamp said:
were would i add this at

Thought you knew what you wanted to do?

That would go in the class that you want the given object to give you eggs when you double click it.
 
G

GoldDraco13

Guest
Jason said:
Thought you knew what you wanted to do?

That would go in the class that you want the given object to give you eggs when you double click it.


Just a quick question for Jason....Why would you post this after they have already moved past this problem in the thread? I hope your not trying to just get to 19k plus posts again....that would be a huge waste of space on this forum, specially if they all were as pointless as this latest post. :rolleyes:
 
Top