[Stable command
hi,
on my shard i don't want to do the pet shrink thing, but i had the idea of having people be able to stable their pet anywhere. I'm new to scripting. I took the best looking parts out of several scripts already there, (like a [hue command i have and the animal trainer) and tried to put this together. I was expecting 300 errors, but only got a few. can someone help me?
here is the error
and here's my first script (of sorts since its taken from already existing ones)
thank you for any help you all can give.
hi,
on my shard i don't want to do the pet shrink thing, but i had the idea of having people be able to stable their pet anywhere. I'm new to scripting. I took the best looking parts out of several scripts already there, (like a [hue command i have and the animal trainer) and tried to put this together. I was expecting 300 errors, but only got a few. can someone help me?
here is the error
Code:
RunUO - [www.runuo.com] Version 1.0.0, Build 36918
Scripts: Compiling C# scripts...failed (6 errors, 0 warnings)
- Error: Scripts\Customs\montoyastable.cs: CS1518: (line 13, column 15) Expecte
d class, delegate, enum, interface, or struct
- Error: Scripts\Customs\montoyastable.cs: CS1518: (line 19, column 15) Expecte
d class, delegate, enum, interface, or struct
- Error: Scripts\Customs\montoyastable.cs: CS1518: (line 23, column 17) Expecte
d class, delegate, enum, interface, or struct
- Error: Scripts\Customs\montoyastable.cs: CS1518: (line 27, column 21) Expecte
d class, delegate, enum, interface, or struct
- Error: Scripts\Customs\montoyastable.cs: CS1518: (line 32, column 10) Expecte
d class, delegate, enum, interface, or struct
- Error: Scripts\Customs\montoyastable.cs: CS1022: (line 37, column 3) Type or
namespace definition, or end-of-file expected
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
and here's my first script (of sorts since its taken from already existing ones)
Code:
using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Targeting;
using Server.ContextMenus;//not sure if i need these
using Server.Network;//not sure if i need these
namespace Server.Factions.Scripts.Commands
{
public static void Initialize()
}
{
Server.Commands.Register( "stable", AccessLevel.Player, new CommandEventHandler( stable_OnCommand ) );
}
public static void stable_OnCommand( CommandEventArgs e )
{
int m_stable;
public static void Initialize()
{
Server.Commands.Register( "Stable", AccessLevel.Player, new CommandEventHandler( Hue_OnCommand ) );
}
public static void stable_OnCommand( CommandEventArgs e )
{
if(e.Length >= 1)
e.Mobile.Target = new stableTarget( e.GetInt32(0) );
}
public stableTarget( int stable ) : base( -1, false, TargetFlags.None )
{
m_stable = stable;
}
}
public static int GetMaxStabled( Mobile from )
{
double taming = from.Skills[SkillName.AnimalTaming].Value;
double anlore = from.Skills[SkillName.AnimalLore].Value;
double vetern = from.Skills[SkillName.Veterinary].Value;
double sklsum = taming + anlore + vetern;
int max;
if ( sklsum >= 240.0 )
max = 5;
else if ( sklsum >= 200.0 )
max = 4;
else if ( sklsum >= 160.0 )
max = 3;
else
max = 2;
if ( taming >= 100.0 )
max += (int)((taming - 90.0) / 10);
if ( anlore >= 100.0 )
max += (int)((anlore - 90.0) / 10);
if ( vetern >= 100.0 )
max += (int)((vetern - 90.0) / 10);
return max;
}
private class StableTarget : Target
{
protected override void OnTarget( Mobile from, object targeted )
{
if ( targeted is BaseCreature )
m_Trainer.EndStable( from, (BaseCreature)targeted );
else if ( targeted == from )
m_Trainer.SayTo( from, 502672 ); // HA HA HA! Sorry, I am not an inn.
else
m_Trainer.SayTo( from, 1048053 ); // You can't stable that!
}
}
public void BeginStable( Mobile from )
{
if ( Deleted || !from.CheckAlive() )
return;
if ( from.Stabled.Count >= GetMaxStabled( from ) )
{
SayTo( from, 1042565 ); // You have too many pets in the stables!
}
else
{
SayTo( from, 1042558 ); /* I charge 30 gold per pet for a real week's stable time.
* I will withdraw it from thy bank account.
* Which animal wouldst thou like to stable here?
*/
from.Target = new StableTarget( this );
}
}
thank you for any help you all can give.