More Aquarium fixes
http://jira.runuo.com/browse/RUNUO-126 Various overhead messages wrongly set as public http://jira.runuo.com/browse/RUNUO-127 Enabling of Spellweaving's Immolating Weapon http://jira.runuo.com/browse/RUNUO-128
This commit is contained in:
parent
45bd3dba38
commit
c179bac4a2
11 changed files with 337 additions and 75 deletions
|
|
@ -293,9 +293,28 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
public override bool CheckItemUse( Mobile from, Item item )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
if ( item != this )
|
||||
return false;
|
||||
|
||||
return base.CheckItemUse( from, item );
|
||||
}
|
||||
|
||||
public override bool CheckLift( Mobile from, Item item, ref LRReason reject )
|
||||
{
|
||||
if ( item != this )
|
||||
{
|
||||
reject = LRReason.CannotLift;
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.CheckLift( from, item, ref reject );
|
||||
}
|
||||
|
||||
public override void AddNameProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.AddNameProperties( list );
|
||||
|
||||
if ( m_VacationLeft > 0 )
|
||||
list.Add( 1074430, m_VacationLeft.ToString() ); // Vacation days left: ~1_DAYS
|
||||
|
|
@ -371,7 +390,7 @@ namespace Server.Items
|
|||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( 2 ); // Version
|
||||
writer.Write( 3 ); // Version
|
||||
|
||||
// version 1
|
||||
if ( m_Timer != null )
|
||||
|
|
@ -402,6 +421,7 @@ namespace Server.Items
|
|||
|
||||
switch ( version )
|
||||
{
|
||||
case 3:
|
||||
case 2:
|
||||
case 1:
|
||||
{
|
||||
|
|
@ -443,6 +463,37 @@ namespace Server.Items
|
|||
Weight = DefaultWeight;
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
if ( version < 3 )
|
||||
m_Recount.Add( this );
|
||||
}
|
||||
|
||||
private void RecountLiveCreatures()
|
||||
{
|
||||
m_LiveCreatures = 0;
|
||||
List<BaseFish> fish = FindItemsByType<BaseFish>();
|
||||
|
||||
foreach ( BaseFish f in fish )
|
||||
{
|
||||
if ( !f.Dead )
|
||||
++m_LiveCreatures;
|
||||
}
|
||||
}
|
||||
|
||||
private static List<Aquarium> m_Recount;
|
||||
|
||||
public static void Configure()
|
||||
{
|
||||
m_Recount = new List<Aquarium>();
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
foreach ( Aquarium aquarium in m_Recount )
|
||||
aquarium.RecountLiveCreatures();
|
||||
|
||||
m_Recount.Clear();
|
||||
m_Recount = null;
|
||||
}
|
||||
|
||||
#region Members
|
||||
|
|
@ -695,6 +746,12 @@ namespace Server.Items
|
|||
|
||||
Item item = Items[ at ];
|
||||
|
||||
if ( item.IsLockedDown ) // for legacy aquariums
|
||||
{
|
||||
from.SendLocalizedMessage( 1010449 ); // You may not use this object while it is locked down.
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( item is BaseFish )
|
||||
{
|
||||
BaseFish fish = (BaseFish) item;
|
||||
|
|
|
|||
|
|
@ -23,12 +23,11 @@ namespace Server.Items
|
|||
{
|
||||
}
|
||||
|
||||
// TODO
|
||||
//public override bool RequireDeepWater { get { return false; } }
|
||||
public override bool RequireDeepWater { get { return false; } }
|
||||
|
||||
protected override void FinishEffect( Point3D p, Map map, Mobile from )
|
||||
{
|
||||
if ( Utility.RandomDouble() < 0.02 )
|
||||
if ( from.Skills.Fishing.Value < 10 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1074487 ); // The creatures are too quick for you!
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.ContextMenus;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
|
|
@ -48,6 +49,15 @@ namespace Server.Items
|
|||
{
|
||||
}
|
||||
|
||||
public override bool TryDropItem( Mobile from, Item dropped, bool sendFullMessage )
|
||||
{
|
||||
if ( !CheckHold( from, dropped, sendFullMessage, true ) )
|
||||
return false;
|
||||
|
||||
DropItem( dropped );
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool OnDragDrop( Mobile from, Item dropped )
|
||||
{
|
||||
if ( !IsAccessibleTo( from ) )
|
||||
|
|
@ -73,6 +83,25 @@ namespace Server.Items
|
|||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckItemUse( Mobile from, Item item )
|
||||
{
|
||||
if ( item != this )
|
||||
return false;
|
||||
|
||||
return base.CheckItemUse( from, item );
|
||||
}
|
||||
|
||||
public override bool CheckLift( Mobile from, Item item, ref LRReason reject )
|
||||
{
|
||||
if ( item != this )
|
||||
{
|
||||
reject = LRReason.CannotLift;
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.CheckLift( from, item, ref reject );
|
||||
}
|
||||
|
||||
public override void AddNameProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.AddNameProperties( list );
|
||||
|
|
@ -129,7 +158,7 @@ namespace Server.Items
|
|||
|
||||
if ( fish != null )
|
||||
{
|
||||
if ( fish.IsLockedDown )
|
||||
if ( fish.IsLockedDown ) // for legacy fish bowls
|
||||
{
|
||||
Owner.From.SendLocalizedMessage( 1010449 ); // You may not use this object while it is locked down.
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue