dragon slayer2
Member
I am working on adding al HS fish tot he taxidermy untell I ran intothe second fish requires u to add the back board with the fish.. here is the code but im lost on how to do this..
any help on how to add the back board item behind the fish would be nice
Code:
public class TrophyAddonHS : Item, IAddon
{
private int m_WestID;
private int m_NorthID;
private int m_DeedNumber;
private int m_AddonNumber;
private Mobile m_Hunter;
private int m_AnimalWeight;
private int m_FishHue;
[Constructable]
public TrophyAddonHS(Mobile from, int itemID, int westID, int northID, int deedNumber, int addonNumber)
: this(from, itemID, westID, northID, deedNumber, addonNumber, null, 0, 0)
{
}
public TrophyAddonHS(Mobile from, int itemID, int westID, int northID, int deedNumber, int addonNumber, Mobile hunter, int animalWeight, int fishHue)
: base(itemID)
{
this.m_WestID = westID;
this.m_NorthID = northID;
this.m_DeedNumber = deedNumber;
this.m_AddonNumber = addonNumber;
this.m_Hunter = hunter;
this.m_AnimalWeight = animalWeight;
this.m_FishHue = fishHue;
Hue = fishHue;
this.Movable = false;
this.MoveToWorld(from.Location, from.Map);
}
public TrophyAddonHS(Serial serial)
: base(serial)
{
}
public override bool ForceShowProperties
{
get
{
return ObjectPropertyList.Enabled;
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int WestID
{
get
{
return this.m_WestID;
}
set
{
this.m_WestID = value;
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int NorthID
{
get
{
return this.m_NorthID;
}
set
{
this.m_NorthID = value;
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int DeedNumber
{
get
{
return this.m_DeedNumber;
}
set
{
this.m_DeedNumber = value;
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int AddonNumber
{
get
{
return this.m_AddonNumber;
}
set
{
this.m_AddonNumber = value;
this.InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public Mobile Hunter
{
get
{
return this.m_Hunter;
}
set
{
this.m_Hunter = value;
this.InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int AnimalWeight
{
get
{
return this.m_AnimalWeight;
}
set
{
this.m_AnimalWeight = value;
this.InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int FishHue
{
get
{
return this.m_FishHue;
}
set
{
this.m_FishHue = value;
this.InvalidateProperties();
}
}
public override int LabelNumber
{
get
{
return this.m_AddonNumber;
}
}
public Item Deed
{
get
{
return new TrophyDeedHS(this.m_WestID, this.m_NorthID, this.m_DeedNumber, this.m_AddonNumber, this.m_Hunter, this.m_AnimalWeight, this.m_FishHue);
}
}
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
if (this.m_AnimalWeight >= 20)
{
if (this.m_Hunter != null)
list.Add(1070857, this.m_Hunter.Name); // Caught by ~1_fisherman~
list.Add(1070858, this.m_AnimalWeight.ToString()); // ~1_weight~ stones
}
}
public bool CouldFit(IPoint3D p, Map map)
{
if (!map.CanFit(p.X, p.Y, p.Z, this.ItemData.Height))
return false;
if (this.ItemID == this.m_NorthID)
return BaseAddon.IsWall(p.X, p.Y - 1, p.Z, map); // North wall
else
return BaseAddon.IsWall(p.X - 1, p.Y, p.Z, map); // West wall
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)1); // version
writer.Write((Mobile)this.m_Hunter);
writer.Write((int)this.m_AnimalWeight);
writer.Write((int)this.m_FishHue);
writer.Write((int)this.m_WestID);
writer.Write((int)this.m_NorthID);
writer.Write((int)this.m_DeedNumber);
writer.Write((int)this.m_AddonNumber);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 1:
{
this.m_Hunter = reader.ReadMobile();
this.m_AnimalWeight = reader.ReadInt();
this.m_FishHue = reader.ReadInt();
goto case 0;
}
case 0:
{
this.m_WestID = reader.ReadInt();
this.m_NorthID = reader.ReadInt();
this.m_DeedNumber = reader.ReadInt();
this.m_AddonNumber = reader.ReadInt();
break;
}
}
Timer.DelayCall(TimeSpan.Zero, new TimerCallback(FixMovingCrate));
}
public override void OnDoubleClick(Mobile from)
{
BaseHouse house = BaseHouse.FindHouseAt(this);
if (house != null && house.IsCoOwner(from))
{
if (from.InRange(this.GetWorldLocation(), 1))
{
from.AddToBackpack(this.Deed);
this.Delete();
}
else
{
from.SendLocalizedMessage(500295); // You are too far away to do that.
}
}
}
private void FixMovingCrate()
{
if (this.Deleted)
return;
if (this.Movable || this.IsLockedDown)
{
Item deed = this.Deed;
if (this.Parent is Item)
{
((Item)this.Parent).AddItem(deed);
deed.Location = this.Location;
}
else
{
deed.MoveToWorld(this.Location, this.Map);
}
this.Delete();
}
}
}
[Flipable(0x14F0, 0x14EF)]
public class TrophyDeedHS : Item
{
private int m_WestID;
private int m_NorthID;
private int m_DeedNumber;
private int m_AddonNumber;
private Mobile m_Hunter;
private int m_AnimalWeight;
private int m_FishHue;
[Constructable]
public TrophyDeedHS(int westID, int northID, int deedNumber, int addonNumber)
: this(westID, northID, deedNumber, addonNumber, null, 0, 0)
{
}
public TrophyDeedHS(int westID, int northID, int deedNumber, int addonNumber, Mobile hunter, int animalWeight, int fishHue)
: base(0x14F0)
{
this.m_WestID = westID;
this.m_NorthID = northID;
this.m_DeedNumber = deedNumber;
this.m_AddonNumber = addonNumber;
this.m_Hunter = hunter;
this.m_AnimalWeight = animalWeight;
this.m_FishHue = fishHue;
}
public TrophyDeedHS(TaxidermyKit.TrophyInfo info, Mobile hunter, int animalWeight, int fishHue)
: this(info.NorthID + 1, info.NorthID, info.DeedNumber, info.AddonNumber, hunter, animalWeight, fishHue)
{
}
public TrophyDeedHS(Serial serial)
: base(serial)
{
}
[CommandProperty(AccessLevel.GameMaster)]
public int WestID
{
get
{
return this.m_WestID;
}
set
{
this.m_WestID = value;
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int NorthID
{
get
{
return this.m_NorthID;
}
set
{
this.m_NorthID = value;
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int DeedNumber
{
get
{
return this.m_DeedNumber;
}
set
{
this.m_DeedNumber = value;
this.InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int AddonNumber
{
get
{
return this.m_AddonNumber;
}
set
{
this.m_AddonNumber = value;
}
}
[CommandProperty(AccessLevel.GameMaster)]
public Mobile Hunter
{
get
{
return this.m_Hunter;
}
set
{
this.m_Hunter = value;
this.InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int AnimalWeight
{
get
{
return this.m_AnimalWeight;
}
set
{
this.m_AnimalWeight = value;
this.InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int FishHue
{
get
{
return this.m_FishHue;
}
set
{
this.m_FishHue = value;
this.InvalidateProperties();
}
}
public override int LabelNumber
{
get
{
return this.m_DeedNumber;
}
}
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
if (this.m_AnimalWeight >= 20)
{
if (this.m_Hunter != null)
list.Add(1070857, this.m_Hunter.Name); // Caught by ~1_fisherman~
list.Add(1070858, this.m_AnimalWeight.ToString()); // ~1_weight~ stones
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)1); // version
writer.Write((Mobile)this.m_Hunter);
writer.Write((int)this.m_AnimalWeight);
writer.Write((int)this.m_FishHue);
writer.Write((int)this.m_WestID);
writer.Write((int)this.m_NorthID);
writer.Write((int)this.m_DeedNumber);
writer.Write((int)this.m_AddonNumber);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 1:
{
this.m_Hunter = reader.ReadMobile();
this.m_AnimalWeight = reader.ReadInt();
this.m_FishHue = reader.ReadInt();
goto case 0;
}
case 0:
{
this.m_WestID = reader.ReadInt();
this.m_NorthID = reader.ReadInt();
this.m_DeedNumber = reader.ReadInt();
this.m_AddonNumber = reader.ReadInt();
break;
}
}
}
public override void OnDoubleClick(Mobile from)
{
if (this.IsChildOf(from.Backpack))
{
BaseHouse house = BaseHouse.FindHouseAt(from);
if (house != null && house.IsCoOwner(from))
{
bool northWall = BaseAddon.IsWall(from.X, from.Y - 1, from.Z, from.Map);
bool westWall = BaseAddon.IsWall(from.X - 1, from.Y, from.Z, from.Map);
if (northWall && westWall)
{
switch (from.Direction & Direction.Mask)
{
case Direction.North:
case Direction.South:
northWall = true;
westWall = false;
break;
case Direction.East:
case Direction.West:
northWall = false;
westWall = true;
break;
default:
from.SendMessage("Turn to face the wall on which to hang this trophy.");
return;
}
}
int itemID = 0;
if (northWall)
itemID = this.m_NorthID;
else if (westWall)
itemID = this.m_WestID;
else
from.SendLocalizedMessage(1042626); // The trophy must be placed next to a wall.
if (itemID > 0)
{
house.Addons.Add(new TrophyAddonHS(from, itemID, this.m_WestID, this.m_NorthID, this.m_DeedNumber, this.m_AddonNumber, this.m_Hunter, this.m_AnimalWeight, this.m_FishHue));
this.Delete();
}
}
else
{
from.SendLocalizedMessage(502092); // You must be in your house to do this.
}
}
else
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
}
}
}
any help on how to add the back board item behind the fish would be nice