hey all
i'm new to servuo. and mostly to scripting but was wondering if it is possible to add scripted items to addons

what i'm working on is trying to make it sothat people can have a fishing hole in there house
tho i'm having problems figuring out how to add the parts to it:
here is the script
(at this point i'm not even 100% sure if it did compile it would be fishable)
[COMMENT]
using System;

namespace Server.Items
{
public class fishingholeAddon : BaseAddon
{
[Constructable]
public fishingholeAddon()
{

this.AddComponent(new AddonComponent(0x346E), 0, -1, 0);
this.AddComponent(new AddonComponent(0x346E), 1, -1, 0);
this.AddComponent(new AddonComponent(0x346E), -1, 0, 0);
this.AddComponent(new AddonComponent(item.WaterTile), 0, 0, 0);
this.AddComponent(new AddonComponent(0x346E), 1, 0, 0);
this.AddComponent(new AddonComponent(0x346E), -1, 1, 0);
this.AddComponent(new AddonComponent(0x346E), 0, 1, 0);
this.AddComponent(new AddonComponent(0x346E), 1, 1, 0);
}

public fishingholeAddon(Serial serial)
: base(serial)
{
}

public override BaseAddonDeed Deed
{
get
{
return new fishingholeDeed();
}
}
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();
}
}

public class fishingholeDeed : BaseAddonDeed
{
[Constructable]
public fishingholeDeed()
{
}

public fishingholeDeed(Serial serial)
: base(serial)
{
}

public override BaseAddon Addon
{
get
{
return new fishingholeAddon();
}
}
public override int LabelNumber
{
get
{
return 1044329;
}
}// fishinghole
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();
}
}
}
[/COMMENT]
 
So long as the components you add to an add-on inherit from the AddonComponent class, you can create special items to insert in to your design. These AddonComponents can be treated like any other item, you can override any functionality you like (eg; OnDoubleClick) to do what you want to do :)
 
Back