metalscourge
Member
Having a bit of trouble with this script, It's not mine i got it somewhere here in the forums. i butchered it a bit but it works as intended, when i add it in game "[RunebookTownsTammel" it will pop down one or more books on the ground depending on how many locations i have in my text file, but if i try to add this to a new players backpack in charactercreation.cs
I get this error.
[article]
ServUO - [https://www.servuo.com] Version 0.5, Build 6864.17389 - Build on 10/17/2018 9:39:38 AM UTC - Release
Core: Optimizing for 4 64-bit processors
Core: Compiled for .NET 4.0
RandomImpl: CSPRandom (Software)
Core: Loading config...
Scripts: Compiling C# scripts...Failed with: 1 errors, 0 warnings
Errors:
+ Misc/CharacterCreation.cs:
CS1729: Line 70: 'Server.Items.RunebookTownsTrammel' does not contain a constructor that takes 0 arguments
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
[/article]
This is RunebookTownsTrammel.cs
I'm sorry if i didn't add these files and descriptions of the problem properly. this is very new to me. Thank you in advance for any help.
Code:
PackItem(new RedBook("a book", m.Name, 20, true));
PackItem(new Gold(1000)); // Starting gold can be customized here
PackItem(new SkillBall());
PackItem(new StatBall());
PackItem(new RunebookTownsTrammel());
PackItem(new Candle());
I get this error.
[article]
ServUO - [https://www.servuo.com] Version 0.5, Build 6864.17389 - Build on 10/17/2018 9:39:38 AM UTC - Release
Core: Optimizing for 4 64-bit processors
Core: Compiled for .NET 4.0
RandomImpl: CSPRandom (Software)
Core: Loading config...
Scripts: Compiling C# scripts...Failed with: 1 errors, 0 warnings
Errors:
+ Misc/CharacterCreation.cs:
CS1729: Line 70: 'Server.Items.RunebookTownsTrammel' does not contain a constructor that takes 0 arguments
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
[/article]
This is RunebookTownsTrammel.cs
Code:
#region AuthorHeader
//
// Runebook Library Changed by Partystuffcloseouts/Soultaker
// GraveYards Ver. 1.0
//
// Based on Runebook T-Hunting Files Original Ideas and code by // A_Li_N // Senior Member
//
#endregion AuthorHeader
using System;
using System.IO;
using Server.Commands;
using System.Collections;
using Server;
using Server.Items;
namespace Server.Items
{
public class RunebookTownsTrammel : Item
{
private static string pathlist = "Scripts/customrunebooks/Data/TownsFT.txt";
private static string entry = "Name X Y Z";
private static string[] mapNames;
private static string[] xs;
private static string[] ys;
private static string[] zs;
private static int size = 0;
private static ArrayList library;
public static void Initialize()
{
CommandSystem.Register( "RunebookTownsTrammel", AccessLevel.Administrator, new CommandEventHandler( RunebookTownsTrammel_OnCommand ) );
}
public static void RunebookTownsTrammel_OnCommand( CommandEventArgs args )
{
Mobile m = args.Mobile;
RunebookTownsTrammel rl = new RunebookTownsTrammel(m);
}
private static void readLine()
{
if( File.Exists( pathlist ) )
{
size = 0;
string name = "";
string x = "";
string y = "";
string z = "";
StreamReader f = new StreamReader( pathlist );
while( (entry = f.ReadLine()) != null )
{
string[] parts = null;
parts = entry.Split();
name += parts[0]+" ";
x += parts[1]+" ";
y += parts[2]+" ";
z += parts[3]+" ";
size++;
}
f.Close();
mapNames = name.Split();
xs = x.Split();
ys = y.Split();
zs = z.Split();
}
}
[Constructable]
public RunebookTownsTrammel (Mobile from)
{
library = new ArrayList();
readLine();
Runebook rb = new Runebook(0);
int nameStart = 1;
int nameEnd = 1;
for( int i=0; i<size; i++ )
{
if( rb.Entries.Count == 16 )
{
rb.Name = "Towns Trammel";
library.Add(rb);
rb = new Runebook(0);
nameStart = nameEnd;
}
int x = int.Parse(xs[i]);
int y = int.Parse(ys[i]);
int z = int.Parse(zs[i]);
Point3D targ = new Point3D(x, y, z);
RecallRune rr = new RecallRune();
rr.Target = targ;
rr.TargetMap = Map.Trammel;
rr.Description = mapNames[i];
rr.House = null;
rr.Marked = true;
rb.OnDragDrop(from, rr );
nameEnd++;
}
rb.Name = "Towns Trammel";
library.Add(rb);
int height = 6;
int offx;
int offy;
int offz;
for(int p=0; p<library.Count; p++)
{
Runebook librarybook = (Runebook)library[p];
librarybook.Movable = true;
librarybook.MaxCharges = 12;
librarybook.CurCharges = 12;
if(p < 4)
{
offx = from.Location.X-1;
offy = from.Location.Y-1;
offz = from.Location.Z+height;
}
else if(p >= 4 && p < 5)
{
offx = from.Location.X;
offy = from.Location.Y-1;
offz = from.Location.Z+height+2;
height += 2;
}
else if(p >= 5 && p < 9)
{
offx = from.Location.X;
offy = from.Location.Y-1;
offz = from.Location.Z+height;
}
else
{
offx = from.Location.X+1;
offy = from.Location.Y-1;
offz = from.Location.Z+height;
}
Point3D loc = new Point3D(offx, offy, offz);
librarybook.MoveToWorld(loc, from.Map);
if( height == 0 )
height = 8;
height -= 2;
}
}
public RunebookTownsTrammel( 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();
}
}
}
I'm sorry if i didn't add these files and descriptions of the problem properly. this is very new to me. Thank you in advance for any help.