#W# Initial Commit: Avatars Conquest
This commit is contained in:
commit
8eae46895e
7512 changed files with 416187 additions and 0 deletions
69
Scripts/Items/Skill Items/Fishing/MessageInABottle.cs
Normal file
69
Scripts/Items/Skill Items/Fishing/MessageInABottle.cs
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class MessageInABottle : Item
|
||||
{
|
||||
public static int GetRandomLevel()
|
||||
{
|
||||
return Utility.RandomMinMax( 1, 3 );
|
||||
}
|
||||
|
||||
public override int LabelNumber{ get{ return 1041080; } } // a message in a bottle
|
||||
|
||||
private int m_Level;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Level
|
||||
{
|
||||
get { return m_Level; }
|
||||
set { m_Level = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MessageInABottle() : this( GetRandomLevel() )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MessageInABottle( int level ) : base( 0x127D )
|
||||
{
|
||||
Weight = 1.0;
|
||||
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 );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
m_Level = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
Consume();
|
||||
from.AddToBackpack( new SOS( 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.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue