Logging of staff crafting items, Fixes for the OSI client changes The potion stacking stuff BaseWeapon fix, so that damage increase things don't multiply themselves. admin gump fixes for Firewall Various display tweaks for weight SoS no longer spawn in Tokuno Hiryu hues happified to OSI standards staff now see alliance chat correctly Play barkeeper text increased per OSI Various other OSI skill requirement changes Various unimplemented features of the SE moves EventSink for when the client version is received from client. Client validation moved out of the core. Client version validation now has options to ignore/kick/warn/annoy. Automagically tries to detect current client. Reverted the delayeddamagecontext back to OSI standards. Can no longer use bags of sending in jail. MagerySpell implemented. Now only Magery spells have a circle, and various other properties of 'em. TransformationSpellHelper now implemented. Things moved around for this. Spells now need a Timespan for the cast delay, instead of arbitrarily based on Circle. Circle doesn't make sense for non-Magery spells! Alot of the spellweaving spells added to OSI standards.
115 lines
No EOL
2.3 KiB
C#
115 lines
No EOL
2.3 KiB
C#
using System;
|
|
using Server.Network;
|
|
using Server.Items;
|
|
|
|
namespace Server.Items
|
|
{
|
|
public class MessageInABottle : Item
|
|
{
|
|
public static int GetRandomLevel()
|
|
{
|
|
if ( Core.AOS && 1 > Utility.Random( 25 ) )
|
|
return 4; // ancient
|
|
|
|
return Utility.RandomMinMax( 1, 3 );
|
|
}
|
|
|
|
public override int LabelNumber{ get{ return 1041080; } } // a message in a bottle
|
|
|
|
private Map m_TargetMap;
|
|
private int m_Level;
|
|
|
|
[CommandProperty( AccessLevel.GameMaster )]
|
|
public Map TargetMap
|
|
{
|
|
get{ return m_TargetMap; }
|
|
set{ m_TargetMap = value; }
|
|
}
|
|
|
|
[CommandProperty( AccessLevel.GameMaster )]
|
|
public int Level
|
|
{
|
|
get{ return m_Level; }
|
|
set{ m_Level = Math.Max( 1, Math.Min( value, 4 ) ); }
|
|
}
|
|
|
|
[Constructable]
|
|
public MessageInABottle() : this( Map.Trammel )
|
|
{
|
|
}
|
|
|
|
public MessageInABottle( Map map ) : this( map, GetRandomLevel() )
|
|
{
|
|
}
|
|
|
|
[Constructable]
|
|
public MessageInABottle( Map map, int level ) : base( 0x099F )
|
|
{
|
|
Weight = 1.0;
|
|
m_TargetMap = map;
|
|
m_Level = level;
|
|
}
|
|
|
|
public MessageInABottle( Serial serial ) : base( serial )
|
|
{
|
|
}
|
|
|
|
public override void Serialize( GenericWriter writer )
|
|
{
|
|
base.Serialize( writer );
|
|
|
|
writer.Write( (int) 3 ); // version
|
|
|
|
writer.Write( (int) m_Level );
|
|
|
|
writer.Write( m_TargetMap );
|
|
}
|
|
|
|
public override void Deserialize( GenericReader reader )
|
|
{
|
|
base.Deserialize( reader );
|
|
|
|
int version = reader.ReadInt();
|
|
|
|
switch ( version )
|
|
{
|
|
case 3:
|
|
case 2:
|
|
{
|
|
m_Level = reader.ReadInt();
|
|
goto case 1;
|
|
}
|
|
case 1:
|
|
{
|
|
m_TargetMap = reader.ReadMap();
|
|
break;
|
|
}
|
|
case 0:
|
|
{
|
|
m_TargetMap = Map.Trammel;
|
|
break;
|
|
}
|
|
}
|
|
|
|
if ( version < 2 )
|
|
m_Level = GetRandomLevel();
|
|
|
|
if( version < 3 && m_TargetMap == Map.Tokuno )
|
|
m_TargetMap = Map.Trammel;
|
|
}
|
|
|
|
public override void OnDoubleClick( Mobile from )
|
|
{
|
|
if ( IsChildOf( from.Backpack ) )
|
|
{
|
|
Consume();
|
|
from.AddToBackpack( new SOS( m_TargetMap, m_Level ) );
|
|
from.LocalOverheadMessage( Network.MessageType.Regular, 0x3B2, 501891 ); // You extract the message from the bottle.
|
|
}
|
|
else
|
|
{
|
|
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
|
}
|
|
}
|
|
}
|
|
} |