Been trying to get a working version of all the Christmas items not already present. While doing so I've hit a problem with the Fireflies.
The problem being I can't seem to figure out how to fix this part.
More specifically this part.
I can't find an existing example anywhere in ServUO so I'm not sure how ServUO process this command.
Code:
protected override void OnTarget( Mobile from, object targeted )
{
if( m_FirefliesDeed == null || m_FirefliesDeed.Deleted )
return;
if( m_FirefliesDeed.IsChildOf( from.Backpack ) )
{
BaseHouse house = BaseHouse.FindHouseAt( from );
if( house != null && house.IsOwner( from ) )
{
IPoint3D p = targeted as IPoint3D;
Map map = from.Map;
if( p == null || map == null || map == Map.Internal )
return;
Point3D p3d = new Point3D( p );
ItemData id = TileData.ItemTable[ m_ItemID & TileData.MaxItemValue ];
if( map.CanFit( p3d, id.Height ) )
{
house = BaseHouse.FindHouseAt( p3d, map, id.Height );
if( house != null && house.IsOwner( from ) )
{
bool north = BaseAddon.IsWall( p3d.X, p3d.Y - 1, p3d.Z, map );
bool west = BaseAddon.IsWall( p3d.X - 1, p3d.Y, p3d.Z, map );
bool isclear = true;
foreach( Item item in Map.Malas.GetItemsInRange( p3d, 0 ) )
{
if( item is Fireflies )
{
isclear = false;
}
}
if( ( ( m_ItemID == 0x2336 && north ) || ( m_ItemID == 0x2332 && west ) ) && isclear )
{
Fireflies flies = new Fireflies( m_ItemID );
house.Addons.Add( flies );
flies.MoveToWorld( p3d, from.Map );
m_FirefliesDeed.Delete();
}
else
from.SendLocalizedMessage( 1150065 ); // Holiday fireflies must be placed next to a wall.
}
else
from.SendLocalizedMessage( 1042036 ); // That location is not in your house.
}
else
from.SendLocalizedMessage( 500269 ); // You cannot build that there.
}
else
from.SendLocalizedMessage( 502092 ); // You must be in your house to do this.
}
else
from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it.
}
The problem being I can't seem to figure out how to fix this part.
Code:
if( ( ( m_ItemID == 0x2336 && north ) || ( m_ItemID == 0x2332 && west ) ) && isclear )
{
Fireflies flies = new Fireflies( m_ItemID );
house.Addons.Add( flies );
flies.MoveToWorld( p3d, from.Map );
m_FirefliesDeed.Delete();
}
More specifically this part.
Code:
house.Addons.Add( flies );
I can't find an existing example anywhere in ServUO so I'm not sure how ServUO process this command.