#W# Initial Commit: Avatars Conquest
This commit is contained in:
commit
8eae46895e
7512 changed files with 416187 additions and 0 deletions
61
Scripts/Items/Skill Items/Blacksmith Items/AnvilForge.cs
Normal file
61
Scripts/Items/Skill Items/Blacksmith Items/AnvilForge.cs
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0xFAF, 0xFB0 )]
|
||||
[Server.Engines.Craft.Anvil]
|
||||
public class Anvil : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Anvil() : base( 0xFAF )
|
||||
{
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public Anvil( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[Server.Engines.Craft.Forge]
|
||||
public class Forge : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Forge() : base( 0xFB1 )
|
||||
{
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public Forge( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
357
Scripts/Items/Skill Items/Blacksmith Items/LargeForge.cs
Normal file
357
Scripts/Items/Skill Items/Blacksmith Items/LargeForge.cs
Normal file
|
|
@ -0,0 +1,357 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Server.Engines.Craft.Forge]
|
||||
public class LargeForgeWest : Item
|
||||
{
|
||||
private InternalItem m_Item;
|
||||
private InternalItem2 m_Item2;
|
||||
|
||||
[Constructable]
|
||||
public LargeForgeWest() : base( 0x199A )
|
||||
{
|
||||
Movable = false;
|
||||
|
||||
m_Item = new InternalItem( this );
|
||||
m_Item2 = new InternalItem2( this );
|
||||
}
|
||||
|
||||
public LargeForgeWest( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnLocationChange( Point3D oldLocation )
|
||||
{
|
||||
if ( m_Item != null )
|
||||
m_Item.Location = new Point3D( X, Y + 1, Z );
|
||||
if ( m_Item2 != null )
|
||||
m_Item2.Location = new Point3D( X, Y + 2, Z );
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
if ( m_Item != null )
|
||||
m_Item.Map = Map;
|
||||
if ( m_Item2 != null )
|
||||
m_Item2.Map = Map;
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if ( m_Item != null )
|
||||
m_Item.Delete();
|
||||
if ( m_Item2 != null )
|
||||
m_Item2.Delete();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( m_Item );
|
||||
writer.Write( m_Item2 );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Item = reader.ReadItem() as InternalItem;
|
||||
m_Item2 = reader.ReadItem() as InternalItem2;
|
||||
}
|
||||
|
||||
[Server.Engines.Craft.Forge]
|
||||
private class InternalItem : Item
|
||||
{
|
||||
private LargeForgeWest m_Item;
|
||||
|
||||
public InternalItem( LargeForgeWest item ) : base( 0x1996 )
|
||||
{
|
||||
Movable = false;
|
||||
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
public InternalItem( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnLocationChange( Point3D oldLocation )
|
||||
{
|
||||
if ( m_Item != null )
|
||||
m_Item.Location = new Point3D( X, Y - 1, Z );
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
if ( m_Item != null )
|
||||
m_Item.Map = Map;
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if ( m_Item != null )
|
||||
m_Item.Delete();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( m_Item );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Item = reader.ReadItem() as LargeForgeWest;
|
||||
}
|
||||
}
|
||||
|
||||
[Server.Engines.Craft.Forge]
|
||||
private class InternalItem2 : Item
|
||||
{
|
||||
private LargeForgeWest m_Item;
|
||||
|
||||
public InternalItem2( LargeForgeWest item ) : base( 0x1992 )
|
||||
{
|
||||
Movable = false;
|
||||
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
public InternalItem2( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnLocationChange( Point3D oldLocation )
|
||||
{
|
||||
if ( m_Item != null )
|
||||
m_Item.Location = new Point3D( X, Y - 2, Z );
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
if ( m_Item != null )
|
||||
m_Item.Map = Map;
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if ( m_Item != null )
|
||||
m_Item.Delete();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( m_Item );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Item = reader.ReadItem() as LargeForgeWest;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Server.Engines.Craft.Forge]
|
||||
public class LargeForgeEast : Item
|
||||
{
|
||||
private InternalItem m_Item;
|
||||
private InternalItem2 m_Item2;
|
||||
|
||||
[Constructable]
|
||||
public LargeForgeEast() : base( 0x197A )
|
||||
{
|
||||
Movable = false;
|
||||
|
||||
m_Item = new InternalItem( this );
|
||||
m_Item2 = new InternalItem2( this );
|
||||
}
|
||||
|
||||
public LargeForgeEast( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnLocationChange( Point3D oldLocation )
|
||||
{
|
||||
if ( m_Item != null )
|
||||
m_Item.Location = new Point3D( X + 1, Y, Z );
|
||||
if ( m_Item2 != null )
|
||||
m_Item2.Location = new Point3D( X + 2, Y, Z );
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
if ( m_Item != null )
|
||||
m_Item.Map = Map;
|
||||
if ( m_Item2 != null )
|
||||
m_Item2.Map = Map;
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if ( m_Item != null )
|
||||
m_Item.Delete();
|
||||
if ( m_Item2 != null )
|
||||
m_Item2.Delete();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( m_Item );
|
||||
writer.Write( m_Item2 );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Item = reader.ReadItem() as InternalItem;
|
||||
m_Item2 = reader.ReadItem() as InternalItem2;
|
||||
}
|
||||
|
||||
[Server.Engines.Craft.Forge]
|
||||
private class InternalItem : Item
|
||||
{
|
||||
private LargeForgeEast m_Item;
|
||||
|
||||
public InternalItem( LargeForgeEast item ) : base( 0x197E )
|
||||
{
|
||||
Movable = false;
|
||||
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
public InternalItem( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnLocationChange( Point3D oldLocation )
|
||||
{
|
||||
if ( m_Item != null )
|
||||
m_Item.Location = new Point3D( X - 1, Y, Z );
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
if ( m_Item != null )
|
||||
m_Item.Map = Map;
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if ( m_Item != null )
|
||||
m_Item.Delete();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( m_Item );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Item = reader.ReadItem() as LargeForgeEast;
|
||||
}
|
||||
}
|
||||
|
||||
[Server.Engines.Craft.Forge]
|
||||
private class InternalItem2 : Item
|
||||
{
|
||||
private LargeForgeEast m_Item;
|
||||
|
||||
public InternalItem2( LargeForgeEast item ) : base( 0x1982 )
|
||||
{
|
||||
Movable = false;
|
||||
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
public InternalItem2( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnLocationChange( Point3D oldLocation )
|
||||
{
|
||||
if ( m_Item != null )
|
||||
m_Item.Location = new Point3D( X - 2, Y, Z );
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
if ( m_Item != null )
|
||||
m_Item.Map = Map;
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if ( m_Item != null )
|
||||
m_Item.Delete();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( m_Item );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Item = reader.ReadItem() as LargeForgeEast;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
144
Scripts/Items/Skill Items/Camping/BedRolled.cs
Normal file
144
Scripts/Items/Skill Items/Camping/BedRolled.cs
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Regions;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0xA58, 0xA59 )]
|
||||
public class BedRolled : Item
|
||||
{
|
||||
[Constructable]
|
||||
public BedRolled() : base( 0xA58 )
|
||||
{
|
||||
Weight = 5.0;
|
||||
Utility.RandomMinMax( 0xA58, 0xA59 );
|
||||
}
|
||||
|
||||
public BedRolled( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
private bool BedsNearby( Mobile from )
|
||||
{
|
||||
foreach( Item i in GetItemsInRange( 20 ) )
|
||||
{
|
||||
if ( i is Bedroll )
|
||||
{
|
||||
Bedroll bed = (Bedroll)i;
|
||||
|
||||
if ( bed.Owner == from )
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( from is PlayerMobile )
|
||||
{
|
||||
PlayerMobile pm = (PlayerMobile)from;
|
||||
|
||||
if ( BedsNearby( from ) )
|
||||
{
|
||||
from.SendMessage( "You already have a bedroll laid out!" );
|
||||
}
|
||||
else if ( !Server.Items.Kindling.EnemiesNearby( from ) )
|
||||
{
|
||||
from.SendMessage( "It is not safe enough to setup camp!" );
|
||||
}
|
||||
else if ( DateTime.Now >= pm.Bedroll )
|
||||
{
|
||||
if ( !this.VerifyMove( from ) )
|
||||
return;
|
||||
|
||||
if ( !from.InRange( this.GetWorldLocation(), 2 ) )
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
return;
|
||||
}
|
||||
|
||||
Point3D bedLocation = GetBedLocation( from );
|
||||
|
||||
if ( bedLocation == Point3D.Zero )
|
||||
{
|
||||
from.SendMessage( "There is not a spot nearby to place your bedroll." );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !this.Deleted && this.Parent == null )
|
||||
from.PlaceInBackpack( this );
|
||||
|
||||
new Bedroll( from ).MoveToWorld( bedLocation, from.Map );
|
||||
pm.Bedroll = DateTime.Now + TimeSpan.FromMinutes( 10.0 );
|
||||
this.Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( "You can only lay out a bedroll every 10 minutes!" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Point3D GetBedLocation( Mobile from )
|
||||
{
|
||||
if ( !Kindling.CampAllowed( from ) )
|
||||
return Point3D.Zero;
|
||||
|
||||
if ( this.Parent == null )
|
||||
return this.Location;
|
||||
|
||||
ArrayList list = new ArrayList( 4 );
|
||||
|
||||
AddOffsetLocation( from, 0, -1, list );
|
||||
AddOffsetLocation( from, -1, 0, list );
|
||||
AddOffsetLocation( from, 0, 1, list );
|
||||
AddOffsetLocation( from, 1, 0, list );
|
||||
|
||||
if ( list.Count == 0 )
|
||||
return Point3D.Zero;
|
||||
|
||||
int idx = Utility.Random( list.Count );
|
||||
return (Point3D) list[idx];
|
||||
}
|
||||
|
||||
private void AddOffsetLocation( Mobile from, int offsetX, int offsetY, ArrayList list )
|
||||
{
|
||||
Map map = from.Map;
|
||||
|
||||
int x = from.X + offsetX;
|
||||
int y = from.Y + offsetY;
|
||||
|
||||
Point3D loc = new Point3D( x, y, from.Z );
|
||||
|
||||
if ( map.CanFit( loc, 1 ) && from.InLOS( loc ) )
|
||||
{
|
||||
list.Add( loc );
|
||||
}
|
||||
else
|
||||
{
|
||||
loc = new Point3D( x, y, map.GetAverageZ( x, y ) );
|
||||
|
||||
if ( map.CanFit( loc, 1 ) && from.InLOS( loc ) )
|
||||
list.Add( loc );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
139
Scripts/Items/Skill Items/Camping/Bedroll.cs
Normal file
139
Scripts/Items/Skill Items/Camping/Bedroll.cs
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Bedroll : Item
|
||||
{
|
||||
private Timer m_Timer;
|
||||
private DateTime m_Created;
|
||||
private Mobile m_Owner;
|
||||
|
||||
public Bedroll( Mobile owner ) : base( 0x0A55 )
|
||||
{
|
||||
ItemID = Utility.RandomMinMax( 0x0A55, 0x0A56 );
|
||||
m_Owner = owner;
|
||||
Movable = false;
|
||||
m_Created = DateTime.Now;
|
||||
m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ), new TimerCallback( OnTick ) );
|
||||
}
|
||||
|
||||
public Bedroll( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.Counselor, AccessLevel.GameMaster )]
|
||||
public Mobile Owner
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Owner;
|
||||
}
|
||||
set{ m_Owner = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public DateTime Created
|
||||
{
|
||||
get{ return m_Created; }
|
||||
}
|
||||
|
||||
private bool EnemiesNearby()
|
||||
{
|
||||
foreach( Mobile m in GetMobilesInRange( 20 ) )
|
||||
{
|
||||
if ( m is PlayerMobile && m.Combatant != null && m.InRange( m.Combatant.Location, 20 ) && m.Combatant.InLOS( m ) )
|
||||
return true;
|
||||
else if ( m is BaseCreature && !((BaseCreature)m).Controlled && !((BaseCreature)m).Summoned && ((BaseCreature)m).FightMode == FightMode.Closest )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void OnTick()
|
||||
{
|
||||
DateTime now = DateTime.Now;
|
||||
TimeSpan age = now - this.Created;
|
||||
|
||||
if ( age >= TimeSpan.FromSeconds( 100.0 ) )
|
||||
RollUp();
|
||||
|
||||
if ( this.Deleted )
|
||||
return;
|
||||
|
||||
List<Mobile> toRest = new List<Mobile>();
|
||||
if ( !EnemiesNearby() )
|
||||
{
|
||||
foreach( Mobile m in GetMobilesInRange( 3 ) )
|
||||
{
|
||||
if ( m is PlayerMobile && m == m_Owner )
|
||||
toRest.Add( m );
|
||||
}
|
||||
|
||||
for ( int i = 0; i < toRest.Count; i++ )
|
||||
Rest( toRest[i] );
|
||||
}
|
||||
}
|
||||
|
||||
public void RollUp()
|
||||
{
|
||||
if ( m_Owner != null )
|
||||
{
|
||||
Container cont = m_Owner.Backpack;
|
||||
if ( cont != null )
|
||||
m_Owner.AddToBackpack( new BedRolled() );
|
||||
}
|
||||
|
||||
this.Delete();
|
||||
}
|
||||
|
||||
public void Rest( Mobile m )
|
||||
{
|
||||
if ( m.Hunger > 4 && m.Thirst > 4 )
|
||||
{
|
||||
if ( m.Stam < m.StamMax )
|
||||
m.Stam++;
|
||||
if ( m.Hits < m.HitsMax )
|
||||
{
|
||||
int hits = (int)(1 * Server.Misc.Settings.HitPoints());
|
||||
if ( hits < 1 )
|
||||
hits = 1;
|
||||
|
||||
m.Hits = m.Hits + hits;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_Owner == from )
|
||||
RollUp();
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if ( m_Timer != null )
|
||||
m_Timer.Stop();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
writer.Write( (Mobile) m_Owner );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
m_Owner = reader.ReadMobile();
|
||||
RollUp();
|
||||
}
|
||||
}
|
||||
}
|
||||
160
Scripts/Items/Skill Items/Camping/Campfire.cs
Normal file
160
Scripts/Items/Skill Items/Camping/Campfire.cs
Normal file
|
|
@ -0,0 +1,160 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum CampfireStatus
|
||||
{
|
||||
Burning,
|
||||
Extinguishing,
|
||||
Off
|
||||
}
|
||||
|
||||
public class Campfire : Item
|
||||
{
|
||||
private Timer m_Timer;
|
||||
private DateTime m_Created;
|
||||
|
||||
public Campfire() : base( 0xDE3 )
|
||||
{
|
||||
Movable = false;
|
||||
Light = LightType.Circle300;
|
||||
m_Created = DateTime.Now;
|
||||
m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ), new TimerCallback( OnTick ) );
|
||||
}
|
||||
|
||||
public Campfire( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public DateTime Created
|
||||
{
|
||||
get{ return m_Created; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public CampfireStatus Status
|
||||
{
|
||||
get
|
||||
{
|
||||
switch ( this.ItemID )
|
||||
{
|
||||
case 0xDE3:
|
||||
return CampfireStatus.Burning;
|
||||
|
||||
case 0xDE9:
|
||||
return CampfireStatus.Extinguishing;
|
||||
|
||||
default:
|
||||
return CampfireStatus.Off;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
if ( this.Status == value )
|
||||
return;
|
||||
|
||||
switch ( value )
|
||||
{
|
||||
case CampfireStatus.Burning:
|
||||
this.ItemID = 0xDE3;
|
||||
this.Light = LightType.Circle300;
|
||||
break;
|
||||
|
||||
case CampfireStatus.Extinguishing:
|
||||
this.ItemID = 0xDE9;
|
||||
this.Light = LightType.Circle150;
|
||||
break;
|
||||
|
||||
default:
|
||||
this.ItemID = 0xDEA;
|
||||
this.Light = LightType.ArchedWindowEast;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool EnemiesNearby()
|
||||
{
|
||||
foreach( Mobile m in GetMobilesInRange( 20 ) )
|
||||
{
|
||||
if ( m is PlayerMobile && m.Combatant != null && m.InRange( m.Combatant.Location, 20 ) && m.Combatant.InLOS( m ) )
|
||||
return true;
|
||||
else if ( m is BaseCreature && !((BaseCreature)m).Controlled && !((BaseCreature)m).Summoned && ((BaseCreature)m).FightMode == FightMode.Closest )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void OnTick()
|
||||
{
|
||||
DateTime now = DateTime.Now;
|
||||
TimeSpan age = now - this.Created;
|
||||
|
||||
if ( age >= TimeSpan.FromSeconds( 100.0 ) )
|
||||
this.Delete();
|
||||
else if ( age >= TimeSpan.FromSeconds( 90.0 ) )
|
||||
this.Status = CampfireStatus.Off;
|
||||
else if ( age >= TimeSpan.FromSeconds( 60.0 ) )
|
||||
this.Status = CampfireStatus.Extinguishing;
|
||||
|
||||
if ( this.Status == CampfireStatus.Off || this.Deleted )
|
||||
return;
|
||||
|
||||
List<Mobile> toRest = new List<Mobile>();
|
||||
if ( !EnemiesNearby() )
|
||||
{
|
||||
foreach( Mobile m in GetMobilesInRange( 6 ) )
|
||||
{
|
||||
if ( m is PlayerMobile )
|
||||
toRest.Add( m );
|
||||
}
|
||||
|
||||
for ( int i = 0; i < toRest.Count; i++ )
|
||||
Rest( toRest[i] );
|
||||
}
|
||||
}
|
||||
|
||||
public void Rest( Mobile m )
|
||||
{
|
||||
if ( m.Hunger > 4 && m.Thirst > 4 )
|
||||
{
|
||||
if ( m.Stam < m.StamMax )
|
||||
m.Stam++;
|
||||
if ( m.Hits < m.HitsMax )
|
||||
{
|
||||
int hits = (int)(1 * Server.Misc.Settings.HitPoints());
|
||||
if ( hits < 1 )
|
||||
hits = 1;
|
||||
|
||||
m.Hits = m.Hits + hits;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if ( m_Timer != null )
|
||||
m_Timer.Stop();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
this.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
183
Scripts/Items/Skill Items/Camping/Kindling.cs
Normal file
183
Scripts/Items/Skill Items/Camping/Kindling.cs
Normal file
|
|
@ -0,0 +1,183 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Regions;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Kindling : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Kindling() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Kindling( int amount ) : base( 0xDE1 )
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 5.0;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public Kindling( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public static bool EnemiesNearby( Mobile from )
|
||||
{
|
||||
foreach( Mobile m in from.GetMobilesInRange( 20 ) )
|
||||
{
|
||||
if ( m is PlayerMobile && m.Combatant != null && m.InRange( m.Combatant.Location, 20 ) && m.Combatant.InLOS( m ) )
|
||||
return true;
|
||||
else if ( m is BaseCreature && !((BaseCreature)m).Controlled && !((BaseCreature)m).Summoned && ((BaseCreature)m).FightMode == FightMode.Closest )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool CampAllowed( Mobile from )
|
||||
{
|
||||
if ( from.Region.IsPartOf( typeof( InnRegion ) ) )
|
||||
return false;
|
||||
|
||||
if ( from.Region.IsPartOf( typeof( HouseRegion ) ) )
|
||||
return false;
|
||||
|
||||
if ( from.Region.IsPartOf( typeof( GateRegion ) ) )
|
||||
return false;
|
||||
|
||||
if ( from.Region.IsPartOf( typeof( GardenRegion ) ) )
|
||||
return false;
|
||||
|
||||
if ( from.Region.IsPartOf( typeof( BuildingRegion ) ) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
private bool CampsNearby()
|
||||
{
|
||||
foreach( Item i in GetItemsInRange( 20 ) )
|
||||
{
|
||||
if ( i is Campfire )
|
||||
{
|
||||
Campfire fire = (Campfire)i;
|
||||
|
||||
if ( fire.Status != CampfireStatus.Off )
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( from is PlayerMobile )
|
||||
{
|
||||
PlayerMobile pm = (PlayerMobile)from;
|
||||
|
||||
if ( CampsNearby() )
|
||||
{
|
||||
from.SendMessage( "There is already a camp nearby!" );
|
||||
}
|
||||
else if ( !EnemiesNearby( from ) )
|
||||
{
|
||||
from.SendMessage( "It is not safe enough to setup camp!" );
|
||||
}
|
||||
else if ( DateTime.Now >= pm.Camp )
|
||||
{
|
||||
if ( !this.VerifyMove( from ) )
|
||||
return;
|
||||
|
||||
if ( !from.InRange( this.GetWorldLocation(), 2 ) )
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
return;
|
||||
}
|
||||
|
||||
Point3D fireLocation = GetFireLocation( from );
|
||||
|
||||
if ( fireLocation == Point3D.Zero )
|
||||
{
|
||||
from.SendLocalizedMessage( 501695 ); // There is not a spot nearby to place your campfire.
|
||||
}
|
||||
else
|
||||
{
|
||||
Consume();
|
||||
|
||||
if ( !this.Deleted && this.Parent == null )
|
||||
from.PlaceInBackpack( this );
|
||||
|
||||
new Campfire().MoveToWorld( fireLocation, from.Map );
|
||||
pm.Camp = DateTime.Now + TimeSpan.FromMinutes( 10.0 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( "You can only build a camp fire every 10 minutes!" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Point3D GetFireLocation( Mobile from )
|
||||
{
|
||||
if ( !CampAllowed( from ) )
|
||||
return Point3D.Zero;
|
||||
|
||||
if ( this.Parent == null )
|
||||
return this.Location;
|
||||
|
||||
ArrayList list = new ArrayList( 4 );
|
||||
|
||||
AddOffsetLocation( from, 0, -1, list );
|
||||
AddOffsetLocation( from, -1, 0, list );
|
||||
AddOffsetLocation( from, 0, 1, list );
|
||||
AddOffsetLocation( from, 1, 0, list );
|
||||
|
||||
if ( list.Count == 0 )
|
||||
return Point3D.Zero;
|
||||
|
||||
int idx = Utility.Random( list.Count );
|
||||
return (Point3D) list[idx];
|
||||
}
|
||||
|
||||
private void AddOffsetLocation( Mobile from, int offsetX, int offsetY, ArrayList list )
|
||||
{
|
||||
Map map = from.Map;
|
||||
|
||||
int x = from.X + offsetX;
|
||||
int y = from.Y + offsetY;
|
||||
|
||||
Point3D loc = new Point3D( x, y, from.Z );
|
||||
|
||||
if ( map.CanFit( loc, 1 ) && from.InLOS( loc ) )
|
||||
{
|
||||
list.Add( loc );
|
||||
}
|
||||
else
|
||||
{
|
||||
loc = new Point3D( x, y, map.GetAverageZ( x, y ) );
|
||||
|
||||
if ( map.CanFit( loc, 1 ) && from.InLOS( loc ) )
|
||||
list.Add( loc );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
545
Scripts/Items/Skill Items/Carpenter Items/TrophyBoard.cs
Normal file
545
Scripts/Items/Skill Items/Carpenter Items/TrophyBoard.cs
Normal file
|
|
@ -0,0 +1,545 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Multis;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
using Server.Misc;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0x20D4, 0x20D5 )]
|
||||
public class TrophyBoard : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyBoard() : base( 0x1EBA )
|
||||
{
|
||||
Name = "trophy board";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyBoard( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if ( !IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042595 ); // Target the corpse to make a trophy out of.
|
||||
from.Target = new CorpseTarget( this );
|
||||
}
|
||||
}
|
||||
|
||||
private class CorpseTarget : Target
|
||||
{
|
||||
private TrophyBoard m_Trophy;
|
||||
|
||||
public CorpseTarget( TrophyBoard boards ) : base( 3, false, TargetFlags.None )
|
||||
{
|
||||
m_Trophy = boards;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Trophy.Deleted )
|
||||
return;
|
||||
|
||||
if ( targeted is Fish || targeted is BigFish )
|
||||
{
|
||||
Item fish = (Item)targeted;
|
||||
Item trophy = new TrophyFish();
|
||||
from.AddToBackpack( trophy );
|
||||
fish.Delete();
|
||||
m_Trophy.Delete();
|
||||
}
|
||||
else if ( !(targeted is Corpse) )
|
||||
{
|
||||
from.SendMessage("That cannot be mounted as a trophy!");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
object obj = targeted;
|
||||
Item i = null;
|
||||
|
||||
if ( obj is Corpse )
|
||||
obj = ((Corpse)obj).Owner;
|
||||
|
||||
if ( obj != null )
|
||||
{
|
||||
Corpse c = (Corpse)targeted;
|
||||
|
||||
if ( c.VisitedByTaxidermist == true )
|
||||
{
|
||||
from.SendMessage("This has already been claimed as a trophy!");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( typeof( BlackBear ) == c.Owner.GetType() ){ i = new TrophyBear(); }
|
||||
else if ( typeof( BrownBear ) == c.Owner.GetType() ){ i = new TrophyBear(); }
|
||||
else if ( typeof( GrizzlyBear ) == c.Owner.GetType() ){ i = new TrophyCaveBear(); }
|
||||
else if ( typeof( CaveBear ) == c.Owner.GetType() ){ i = new TrophyCaveBear(); }
|
||||
else if ( typeof( KodiakBear ) == c.Owner.GetType() ){ i = new TrophyKodiak(); }
|
||||
else if ( typeof( SnowBear ) == c.Owner.GetType() ){ i = new TrophySnowBear(); }
|
||||
else if ( typeof( PolarBear ) == c.Owner.GetType() ){ i = new TrophyPolarBear(); }
|
||||
else if ( typeof( FrostTroll ) == c.Owner.GetType() ){ i = new TrophyTroll(); }
|
||||
else if ( typeof( Troll ) == c.Owner.GetType() ){ i = new TrophyTroll(); }
|
||||
else if ( typeof( Orc ) == c.Owner.GetType() ){ i = new TrophyOrc(); }
|
||||
else if ( typeof( OrcCaptain ) == c.Owner.GetType() ){ i = new TrophyOrc(); }
|
||||
else if ( typeof( OrcishLord ) == c.Owner.GetType() ){ i = new TrophyOrc(); }
|
||||
else if ( typeof( OrcishMage ) == c.Owner.GetType() ){ i = new TrophyOrc(); }
|
||||
else if ( typeof( OgreMagi ) == c.Owner.GetType() ){ i = new TrophyOgre(); }
|
||||
else if ( typeof( Ogre ) == c.Owner.GetType() ){ i = new TrophyOgre(); }
|
||||
else if ( typeof( ArcticOgreLord ) == c.Owner.GetType() ){ i = new TrophyOgreLord(); }
|
||||
else if ( typeof( OgreLord ) == c.Owner.GetType() ){ i = new TrophyOgreLord(); }
|
||||
else if ( typeof( GreatDeer ) == c.Owner.GetType() ){ i = new TrophyDeer(); }
|
||||
else if ( typeof( Deer ) == c.Owner.GetType() ){ i = new TrophyDeer(); }
|
||||
else if ( typeof( Gorilla ) == c.Owner.GetType() ){ i = new TrophyApe(); }
|
||||
else if ( typeof( Ape ) == c.Owner.GetType() ){ i = new TrophyApe(); }
|
||||
else if ( typeof( Nightmare ) == c.Owner.GetType() ){ i = new TrophyNightmare(); }
|
||||
else if ( typeof( Goblin ) == c.Owner.GetType() ){ i = new TrophyGoblin(); }
|
||||
else if ( typeof( GoblinArcher ) == c.Owner.GetType() ){ i = new TrophyGoblin(); }
|
||||
else if ( typeof( GoblinWarrior ) == c.Owner.GetType() ){ i = new TrophyGoblin(); }
|
||||
else if ( typeof( Minotaur ) == c.Owner.GetType() ){ i = new TrophyMinotaur(); }
|
||||
else if ( typeof( MinotaurLord ) == c.Owner.GetType() ){ i = new TrophyMinotaur(); }
|
||||
else if ( typeof( MinotaurChief ) == c.Owner.GetType() ){ i = new TrophyMinotaurLord(); }
|
||||
else if ( typeof( Ettin ) == c.Owner.GetType() ){ i = new TrophyEttin(); }
|
||||
else if ( typeof( SnowEttin ) == c.Owner.GetType() ){ i = new TrophyEttin(); }
|
||||
else if ( typeof( Cyclops ) == c.Owner.GetType() ){ i = new TrophyCyclops(); }
|
||||
else if ( typeof( CyclopsChief ) == c.Owner.GetType() ){ i = new TrophyCyclops(); }
|
||||
else if ( typeof( CyclopsLord ) == c.Owner.GetType() ){ i = new TrophyCyclops(); }
|
||||
else if ( typeof( FireGargoyle ) == c.Owner.GetType() ){ i = new TrophyGargoyle(); }
|
||||
else if ( typeof( Gargoyle ) == c.Owner.GetType() ){ i = new TrophyGargoyle(); }
|
||||
else if ( typeof( GargoyleMage ) == c.Owner.GetType() ){ i = new TrophyGargoyle(); }
|
||||
else if ( typeof( StoneGargoyle ) == c.Owner.GetType() ){ i = new TrophyGargoyle(); }
|
||||
else if ( typeof( GargoyleKnight ) == c.Owner.GetType() ){ i = new TrophyGargoyle(); }
|
||||
else if ( typeof( Ratman ) == c.Owner.GetType() ){ i = new TrophyRatman(); }
|
||||
else if ( typeof( RatmanArcher ) == c.Owner.GetType() ){ i = new TrophyRatman(); }
|
||||
else if ( typeof( RatmanMage ) == c.Owner.GetType() ){ i = new TrophyRatman(); }
|
||||
else if ( typeof( Lizardman ) == c.Owner.GetType() ){ i = new TrophyLizardman(); }
|
||||
else if ( typeof( SakkhraShaman ) == c.Owner.GetType() ){ i = new TrophyLizard(); }
|
||||
else if ( typeof( Sakkhra ) == c.Owner.GetType() ){ i = new TrophyLizard(); }
|
||||
else if ( typeof( Drasolisk ) == c.Owner.GetType() ){ i = new TrophyLizard(); }
|
||||
else if ( typeof( Silisk ) == c.Owner.GetType() ){ i = new TrophyLizard(); }
|
||||
else if ( typeof( GargoyleIce ) == c.Owner.GetType() ){ i = new TrophyDaemon(); i.Name = "mounted gargoyle"; i.Hue = 0x4A3; }
|
||||
else if ( typeof( GargoyleStone ) == c.Owner.GetType() ){ i = new TrophyDaemon(); i.Name = "mounted gargoyle"; i.Hue = 0x49D; }
|
||||
else if ( typeof( GargoyleWizard ) == c.Owner.GetType() ){ i = new TrophyDaemon(); i.Name = "mounted gargoyle"; i.Hue = 0x4A5; }
|
||||
else if ( typeof( GargoyleCrimson ) == c.Owner.GetType() ){ i = new TrophyDaemon(); i.Name = "mounted gargoyle"; i.Hue = 0x2B; }
|
||||
else if ( typeof( Balron ) == c.Owner.GetType() ){ i = new TrophyDaemon(); i.Hue = 0x668; }
|
||||
else if ( typeof( SeaDevil ) == c.Owner.GetType() ){ i = new TrophyDaemon(); i.Hue = 0x42F; }
|
||||
else if ( typeof( Daemon ) == c.Owner.GetType() ){ i = new TrophyDaemon(); i.Hue = 0x668; }
|
||||
else if ( typeof( IceFiend ) == c.Owner.GetType() ){ i = new TrophyDaemon(); i.Hue = 0x43C; }
|
||||
else if ( typeof( IceDevil ) == c.Owner.GetType() ){ i = new TrophyDaemon(); i.Hue = 0x43C; }
|
||||
else if ( typeof( AncientWyrm ) == c.Owner.GetType() ){ i = new TrophyDragon(); i.Hue = 0x429; }
|
||||
else if ( typeof( Dragon ) == c.Owner.GetType() ){ i = new TrophyDragon(); i.Hue = 0x429; }
|
||||
else if ( typeof( SwampDragon ) == c.Owner.GetType() ){ i = new TrophyDragon(); i.Hue = 0x84F; }
|
||||
else if ( typeof( ShadowWyrm ) == c.Owner.GetType() ){ i = new TrophyDragon(); i.Hue = 0x4D8; }
|
||||
else if ( typeof( SeaDragon ) == c.Owner.GetType() ){ i = new TrophyDragon(); i.Hue = 0x847; }
|
||||
else if ( typeof( WhiteWyrm ) == c.Owner.GetType() ){ i = new TrophyDragon(); i.Hue = 0x982; }
|
||||
|
||||
if ( i != null )
|
||||
{
|
||||
from.AddToBackpack( i );
|
||||
c.VisitedByTaxidermist = true;
|
||||
m_Trophy.Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("That cannot be mounted as a trophy!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("That cannot be mounted as a trophy!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_Trophy.Deleted )
|
||||
from.SendMessage("You mount that as a trophy.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0x1E62, 0x1E69 )]
|
||||
public class TrophyFish : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyFish() : base( 0x1E62 )
|
||||
{
|
||||
Name = "mounted fish";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyFish( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x1E60, 0x1E67 )]
|
||||
public class TrophyBear : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyBear() : base( 0x1E60 )
|
||||
{
|
||||
Name = "mounted bear";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyBear( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x1E61, 0x1E68 )]
|
||||
public class TrophyDeer : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyDeer() : base( 0x1E61 )
|
||||
{
|
||||
Name = "mounted deer";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyDeer( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x1E63, 0x1E6A )]
|
||||
public class TrophyApe : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyApe() : base( 0x1E63 )
|
||||
{
|
||||
Name = "mounted ape";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyApe( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x1E64, 0x1E6B )]
|
||||
public class TrophyOrc : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyOrc() : base( 0x1E64 )
|
||||
{
|
||||
Name = "mounted orc";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyOrc( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x1E65, 0x1E6C )]
|
||||
public class TrophyPolarBear : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyPolarBear() : base( 0x1E65 )
|
||||
{
|
||||
Name = "mounted bear";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyPolarBear( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x1E66, 0x1E6D )]
|
||||
public class TrophyTroll : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyTroll() : base( 0x1E66 )
|
||||
{
|
||||
Name = "mounted troll";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyTroll( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x20D6, 0x20D7 )]
|
||||
public class TrophySnowBear : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophySnowBear() : base( 0x20D6 )
|
||||
{
|
||||
Name = "mounted bear";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophySnowBear( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x20D8, 0x20D9 )]
|
||||
public class TrophyCaveBear : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyCaveBear() : base( 0x20D8 )
|
||||
{
|
||||
Name = "mounted bear";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyCaveBear( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x20DA, 0x20DB )]
|
||||
public class TrophyKodiak : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyKodiak() : base( 0x20DA )
|
||||
{
|
||||
Name = "mounted bear";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyKodiak( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x20DC, 0x20DD )]
|
||||
public class TrophyLizard : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyLizard() : base( 0x20DC )
|
||||
{
|
||||
Name = "mounted lizardman";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyLizard( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x20DE, 0x20DF )]
|
||||
public class TrophyLizardman : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyLizardman() : base( 0x20DE )
|
||||
{
|
||||
Name = "mounted lizardman";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyLizardman( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x20E0, 0x20E1 )]
|
||||
public class TrophyNightmare : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyNightmare() : base( 0x20E0 )
|
||||
{
|
||||
Name = "mounted nightmare";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyNightmare( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x20E2, 0x20E3 )]
|
||||
public class TrophyOgre : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyOgre() : base( 0x20E2 )
|
||||
{
|
||||
Name = "mounted ogre";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyOgre( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x20E4, 0x20E5 )]
|
||||
public class TrophyRatman : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyRatman() : base( 0x20E4 )
|
||||
{
|
||||
Name = "mounted ratman";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyRatman( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x20E6, 0x20E7 )]
|
||||
public class TrophyEttin : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyEttin() : base( 0x20E6 )
|
||||
{
|
||||
Name = "mounted ettin";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyEttin( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x20E8, 0x20E9 )]
|
||||
public class TrophyOgreLord : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyOgreLord() : base( 0x20E8 )
|
||||
{
|
||||
Name = "mounted ogre";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyOgreLord( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x20EA, 0x20EB )]
|
||||
public class TrophyCyclops : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyCyclops() : base( 0x20EA )
|
||||
{
|
||||
Name = "mounted cyclops";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyCyclops( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x20EC, 0x20ED )]
|
||||
public class TrophyGargoyle : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyGargoyle() : base( 0x20EC )
|
||||
{
|
||||
Name = "mounted gargoyle";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyGargoyle( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x20EE, 0x20EF )]
|
||||
public class TrophyMinotaur : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyMinotaur() : base( 0x20EE )
|
||||
{
|
||||
Name = "mounted minotaur";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyMinotaur( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x20F0, 0x20F1 )]
|
||||
public class TrophyGoblin : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyGoblin() : base( 0x20F0 )
|
||||
{
|
||||
Name = "mounted goblin";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyGoblin( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x20F2, 0x20F3 )]
|
||||
public class TrophyMinotaurLord : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyMinotaurLord() : base( 0x20F2 )
|
||||
{
|
||||
Name = "mounted minotaur";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyMinotaurLord( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x20F4, 0x20F5 )]
|
||||
public class TrophyDragon : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyDragon() : base( 0x20F4 )
|
||||
{
|
||||
Name = "mounted dragon";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyDragon( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x20F6, 0x20F7 )]
|
||||
public class TrophyDaemon : Item
|
||||
{
|
||||
[Constructable]
|
||||
public TrophyDaemon() : base( 0x20F6 )
|
||||
{
|
||||
Name = "mounted daemon";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TrophyDaemon( Serial serial ) : base( serial ){}
|
||||
public override void Serialize( GenericWriter writer ){ base.Serialize( writer ); writer.Write( (int) 0 ); }
|
||||
public override void Deserialize( GenericReader reader ){ base.Deserialize( reader ); int version = reader.ReadInt(); }
|
||||
}
|
||||
}
|
||||
53
Scripts/Items/Skill Items/Fishing/FishingPole.cs
Normal file
53
Scripts/Items/Skill Items/Fishing/FishingPole.cs
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
using Server.Engines.Harvest;
|
||||
using System.Collections.Generic;
|
||||
using Server.ContextMenus;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FishingPole : BaseHarvestTool
|
||||
{
|
||||
public override HarvestSystem HarvestSystem{ get{ return Fishing.System; } }
|
||||
|
||||
[Constructable]
|
||||
public FishingPole() : this( 50 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FishingPole( int uses ) : base( uses, 0x0DC0 )
|
||||
{
|
||||
Layer = Layer.OneHanded;
|
||||
Weight = 8.0;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( from.Map != Map.Britannia )
|
||||
from.SendMessage( "You cannot fish here!" );
|
||||
else
|
||||
Fishing.System.BeginHarvesting( from, this );
|
||||
}
|
||||
|
||||
public FishingPole( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
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.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
178
Scripts/Items/Skill Items/Fishing/SOS.cs
Normal file
178
Scripts/Items/Skill Items/Fishing/SOS.cs
Normal file
|
|
@ -0,0 +1,178 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
using Server.Gumps;
|
||||
using Server.Regions;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SOS : Item
|
||||
{
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( IsAncient )
|
||||
return 1063450; // an ancient SOS
|
||||
|
||||
return 1041081; // a waterstained SOS
|
||||
}
|
||||
}
|
||||
|
||||
private Point3D m_TargetLocation;
|
||||
private int m_MessageIndex;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsAncient
|
||||
{
|
||||
get{ return ( m_Level >= 4 ); }
|
||||
}
|
||||
|
||||
private int m_Level;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Level
|
||||
{
|
||||
get { return m_Level; }
|
||||
set { m_Level = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Point3D TargetLocation
|
||||
{
|
||||
get{ return m_TargetLocation; }
|
||||
set{ m_TargetLocation = value; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int MessageIndex
|
||||
{
|
||||
get{ return m_MessageIndex; }
|
||||
set{ m_MessageIndex = value; }
|
||||
}
|
||||
|
||||
public void UpdateHue()
|
||||
{
|
||||
if ( IsAncient )
|
||||
Hue = 0x481;
|
||||
else
|
||||
Hue = 0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SOS() : this( MessageInABottle.GetRandomLevel() )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SOS( int level ) : base( 0x14ED )
|
||||
{
|
||||
Weight = 1.0;
|
||||
|
||||
m_Level = level;
|
||||
m_MessageIndex = Utility.Random( MessageEntry.Entries.Length );
|
||||
m_TargetLocation = BaseRegion.GetOceanSpot();
|
||||
|
||||
UpdateHue();
|
||||
}
|
||||
|
||||
public SOS( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 4 ); // version
|
||||
writer.Write( m_Level );
|
||||
writer.Write( m_TargetLocation );
|
||||
writer.Write( m_MessageIndex );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
m_Level = reader.ReadInt();
|
||||
m_TargetLocation = reader.ReadPoint3D();
|
||||
m_MessageIndex = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
MessageEntry entry;
|
||||
|
||||
if ( m_MessageIndex >= 0 && m_MessageIndex < MessageEntry.Entries.Length )
|
||||
entry = MessageEntry.Entries[m_MessageIndex];
|
||||
else
|
||||
entry = MessageEntry.Entries[m_MessageIndex = Utility.Random( MessageEntry.Entries.Length )];
|
||||
|
||||
from.CloseGump( typeof( MessageGump ) );
|
||||
from.SendGump( new MessageGump( entry, m_TargetLocation ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
private class MessageGump : Gump
|
||||
{
|
||||
public MessageGump( MessageEntry entry, Point3D loc ) : base( (640 - entry.Width) / 2, (480 - entry.Height) / 2 )
|
||||
{
|
||||
int xLong = 0, yLat = 0;
|
||||
int xMins = 0, yMins = 0;
|
||||
bool xEast = false, ySouth = false;
|
||||
string fmt;
|
||||
|
||||
if ( Sextant.Format( loc, Map.Britannia, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth ) )
|
||||
fmt = String.Format( "{0}°{1}'{2},{3}°{4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W" );
|
||||
else
|
||||
fmt = "?????";
|
||||
|
||||
AddPage( 0 );
|
||||
AddBackground( 0, 0, entry.Width, entry.Height, 2520 );
|
||||
AddHtml( 38, 38, entry.Width - 83, entry.Height - 86, String.Format( entry.Message, fmt ), false, false );
|
||||
}
|
||||
}
|
||||
|
||||
private class MessageEntry
|
||||
{
|
||||
private int m_Width, m_Height;
|
||||
private string m_Message;
|
||||
|
||||
public int Width{ get{ return m_Width; } }
|
||||
public int Height{ get{ return m_Height; } }
|
||||
public string Message{ get{ return m_Message; } }
|
||||
|
||||
public MessageEntry( int width, int height, string message )
|
||||
{
|
||||
m_Width = width;
|
||||
m_Height = height;
|
||||
m_Message = message;
|
||||
}
|
||||
|
||||
private static MessageEntry[] m_Entries = new MessageEntry[]
|
||||
{
|
||||
new MessageEntry( 280, 180, "...Ar! {0} and a fair wind! No chance... storms, though--ar! Is that a sea serp...<br><br>uh oh." ),
|
||||
new MessageEntry( 280, 215, "...been inside this whale for three days now. I've run out of food I can pick out of his teeth. I took a sextant reading through the blowhole: {0}. I'll never see my treasure again..." ),
|
||||
new MessageEntry( 280, 285, "...grand adventure! Captain Quacklebush had me swab down the decks daily...<br> ...pirates came, I was in the rigging practicing with my sextant. {0} if I am not mistaken...<br> ....scuttled the ship, and our precious cargo went with her and the screaming pirates, down to the bottom of the sea..." ),
|
||||
new MessageEntry( 280, 180, "Help! Ship going dow...n heavy storms...precious cargo...st reach dest...current coordinates {0}...ve any survivors... ease!" ),
|
||||
new MessageEntry( 280, 215, "...know that the wreck is near {0} but have not found it. Could the message passed down in my family for generations be wrong? No... I swear on the soul of my grandfather, I will find..." ),
|
||||
new MessageEntry( 280, 195, "...never expected an iceberg...silly woman on bow crushed instantly...send help to {0}...ey'll never forget the tragedy of the sinking of the Miniscule..." ),
|
||||
new MessageEntry( 280, 265, "...nobody knew I was a girl. They just assumed I was another sailor...then we met the undine. {0}. It was demanded sacrifice...I was youngset, they figured...<br> ...grabbed the captain's treasure, screamed, 'It'll go down with me!'<br> ...they took me up on it." ),
|
||||
new MessageEntry( 280, 230, "...so I threw the treasure overboard, before the curse could get me too. But I was too late. Now I am doomed to wander these seas, a ghost forever. Join me: seek ye at {0} if thou wishest my company..." ),
|
||||
new MessageEntry( 280, 285, "...then the ship exploded. A dragon swooped by. The slime swallowed Bertie whole--he screamed, it was amazing. The sky glowed orange. A sextant reading put us at {0}. Norma was chattering about sailing over the edge of the world. I looked at my hands and saw through them..." ),
|
||||
new MessageEntry( 280, 285, "...trapped on a deserted island, with a magic fountain supplying wood, fresh water springs, gorgeous scenery, and my lovely young wife. I know the ship with all our life's earnings sank at {0} but I don't know what our coordinates are... someone has GOT to rescue me before Sunday's finals game or I'll go mad..." ),
|
||||
new MessageEntry( 280, 160, "WANTED: divers exp...d in shipwre...overy. Must have own vess...pply at {0}<br>...good benefits, flexible hours..." ),
|
||||
new MessageEntry( 280, 250, "...was a cad and a boor, no matter what momma s...rew him overboard! Oh, Anna, 'twas so exciting!<br> Unfort...y he grabbe...est, and all his riches went with him!<br> ...sked the captain, and he says we're at {0}<br>...so maybe..." )
|
||||
};
|
||||
|
||||
public static MessageEntry[] Entries
|
||||
{
|
||||
get{ return m_Entries; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
155
Scripts/Items/Skill Items/Fishing/Sextant.cs
Normal file
155
Scripts/Items/Skill Items/Fishing/Sextant.cs
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Sextant : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Sextant() : base( 0x1058 )
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
public Sextant( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
int xLong = 0, yLat = 0;
|
||||
int xMins = 0, yMins = 0;
|
||||
bool xEast = false, ySouth = false;
|
||||
|
||||
if ( Sextant.Format( from.Location, from.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth ) )
|
||||
{
|
||||
string location = String.Format( "{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W" );
|
||||
from.LocalOverheadMessage( MessageType.Regular, from.SpeechHue, false, location );
|
||||
}
|
||||
}
|
||||
|
||||
public static bool ComputeMapDetails( Map map, int x, int y, out int xCenter, out int yCenter, out int xWidth, out int yHeight )
|
||||
{
|
||||
xWidth = 5120; yHeight = 4096;
|
||||
|
||||
if ( map == Map.Britannia )
|
||||
{
|
||||
if ( x >= 0 && y >= 0 && x < 7168 && y < 4096 )
|
||||
{
|
||||
xCenter = 1323; yCenter = 1624;
|
||||
}
|
||||
else
|
||||
{
|
||||
xCenter = 0; yCenter = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if ( x >= 0 && y >= 0 && x < map.Width && y < map.Height )
|
||||
{
|
||||
xCenter = 1323; yCenter = 1624;
|
||||
}
|
||||
else
|
||||
{
|
||||
xCenter = 0; yCenter = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static Point3D ReverseLookup( Map map, int xLong, int yLat, int xMins, int yMins, bool xEast, bool ySouth )
|
||||
{
|
||||
if ( map == null || map == Map.Internal )
|
||||
return Point3D.Zero;
|
||||
|
||||
int xCenter, yCenter;
|
||||
int xWidth, yHeight;
|
||||
|
||||
if ( !ComputeMapDetails( map, 0, 0, out xCenter, out yCenter, out xWidth, out yHeight ) )
|
||||
return Point3D.Zero;
|
||||
|
||||
double absLong = xLong + ((double)xMins / 60);
|
||||
double absLat = yLat + ((double)yMins / 60);
|
||||
|
||||
if ( !xEast )
|
||||
absLong = 360.0 - absLong;
|
||||
|
||||
if ( !ySouth )
|
||||
absLat = 360.0 - absLat;
|
||||
|
||||
int x, y, z;
|
||||
|
||||
x = xCenter + (int)((absLong * xWidth) / 360);
|
||||
y = yCenter + (int)((absLat * yHeight) / 360);
|
||||
|
||||
if ( x < 0 )
|
||||
x += xWidth;
|
||||
else if ( x >= xWidth )
|
||||
x -= xWidth;
|
||||
|
||||
if ( y < 0 )
|
||||
y += yHeight;
|
||||
else if ( y >= yHeight )
|
||||
y -= yHeight;
|
||||
|
||||
z = map.GetAverageZ( x, y );
|
||||
|
||||
return new Point3D( x, y, z );
|
||||
}
|
||||
|
||||
public static bool Format( Point3D p, Map map, ref int xLong, ref int yLat, ref int xMins, ref int yMins, ref bool xEast, ref bool ySouth )
|
||||
{
|
||||
if ( map == null || map == Map.Internal )
|
||||
return false;
|
||||
|
||||
int x = p.X, y = p.Y;
|
||||
int xCenter, yCenter;
|
||||
int xWidth, yHeight;
|
||||
|
||||
if ( !ComputeMapDetails( map, x, y, out xCenter, out yCenter, out xWidth, out yHeight ) )
|
||||
return false;
|
||||
|
||||
double absLong = (double)((x - xCenter) * 360) / xWidth;
|
||||
double absLat = (double)((y - yCenter) * 360) / yHeight;
|
||||
|
||||
if ( absLong > 180.0 )
|
||||
absLong = -180.0 + (absLong % 180.0);
|
||||
|
||||
if ( absLat > 180.0 )
|
||||
absLat = -180.0 + (absLat % 180.0);
|
||||
|
||||
bool east = ( absLong >= 0 ), south = ( absLat >= 0 );
|
||||
|
||||
if ( absLong < 0.0 )
|
||||
absLong = -absLong;
|
||||
|
||||
if ( absLat < 0.0 )
|
||||
absLat = -absLat;
|
||||
|
||||
xLong = (int)absLong;
|
||||
yLat = (int)absLat;
|
||||
|
||||
xMins = (int)((absLong % 1.0) * 60);
|
||||
yMins = (int)((absLat % 1.0) * 60);
|
||||
|
||||
xEast = east;
|
||||
ySouth = south;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
81
Scripts/Items/Skill Items/Fishing/ShipwreckedItem.cs
Normal file
81
Scripts/Items/Skill Items/Fishing/ShipwreckedItem.cs
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public interface IShipwreckedItem
|
||||
{
|
||||
bool IsShipwreckedItem { get; set; }
|
||||
}
|
||||
|
||||
public class ShipwreckedItem : Item, IDyable, IShipwreckedItem
|
||||
{
|
||||
public ShipwreckedItem( int itemID ) : base( itemID )
|
||||
{
|
||||
int weight = this.ItemData.Weight;
|
||||
|
||||
if ( weight >= 255 )
|
||||
weight = 1;
|
||||
|
||||
this.Weight = weight;
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
this.LabelTo( from, 1050039, String.Format( "#{0}\t#1041645", LabelNumber ) );
|
||||
}
|
||||
|
||||
public override void AddNameProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.AddNameProperties( list );
|
||||
list.Add( 1041645 ); // recovered from a shipwreck
|
||||
}
|
||||
|
||||
public ShipwreckedItem( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public bool Dye( Mobile from, DyeTub sender )
|
||||
{
|
||||
if ( Deleted )
|
||||
return false;
|
||||
|
||||
if ( ItemID >= 0x13A4 && ItemID <= 0x13AE )
|
||||
{
|
||||
Hue = sender.DyedHue;
|
||||
return true;
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage( sender.FailMessage );
|
||||
return false;
|
||||
}
|
||||
|
||||
#region IShipwreckedItem Members
|
||||
|
||||
public bool IsShipwreckedItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return true; //It's a ShipwreckedItem item. 'Course it's gonna be a Shipwreckeditem
|
||||
}
|
||||
set
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
352
Scripts/Items/Skill Items/Fishing/SpecialFishingNet.cs
Normal file
352
Scripts/Items/Skill Items/Fishing/SpecialFishingNet.cs
Normal file
|
|
@ -0,0 +1,352 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SpecialFishingNet : Item
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041079; } } // a special fishing net
|
||||
|
||||
private bool m_InUse;
|
||||
|
||||
[Constructable]
|
||||
public SpecialFishingNet() : base( 0x0DCA )
|
||||
{
|
||||
Weight = 1.0;
|
||||
|
||||
if ( 0.01 > Utility.RandomDouble() )
|
||||
Hue = Utility.RandomList( m_Hues );
|
||||
else
|
||||
Hue = 0x8A0;
|
||||
}
|
||||
|
||||
private static int[] m_Hues = new int[]
|
||||
{
|
||||
0x09B,
|
||||
0x0CD,
|
||||
0x0D3,
|
||||
0x14D,
|
||||
0x1DD,
|
||||
0x1E9,
|
||||
0x1F4,
|
||||
0x373,
|
||||
0x451,
|
||||
0x47F,
|
||||
0x489,
|
||||
0x492,
|
||||
0x4B5,
|
||||
0x8AA
|
||||
};
|
||||
|
||||
public SpecialFishingNet( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
// as if the name wasn't enough..
|
||||
list.Add( 1017410 ); // Special Fishing Net
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( m_InUse );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_InUse = reader.ReadBool();
|
||||
|
||||
if ( m_InUse )
|
||||
Delete();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Stackable = false;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_InUse )
|
||||
{
|
||||
from.SendLocalizedMessage( 1010483 ); // Someone is already using that net!
|
||||
}
|
||||
else if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1010484 ); // Where do you wish to use the net?
|
||||
from.BeginTarget( -1, true, TargetFlags.None, new TargetCallback( OnTarget ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public void OnTarget( Mobile from, object obj )
|
||||
{
|
||||
if ( Deleted || m_InUse )
|
||||
return;
|
||||
|
||||
IPoint3D p3D = obj as IPoint3D;
|
||||
|
||||
if ( p3D == null )
|
||||
return;
|
||||
|
||||
Map map = from.Map;
|
||||
|
||||
if ( map == null || map == Map.Internal )
|
||||
return;
|
||||
|
||||
int x = p3D.X, y = p3D.Y;
|
||||
|
||||
if ( map != Map.Britannia || p3D.Z != -5 )
|
||||
{
|
||||
from.SendMessage( "You cannot fish here!" );
|
||||
}
|
||||
else if ( !from.InRange( p3D, 6 ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 500976 ); // You need to be closer to the water to fish!
|
||||
}
|
||||
else if ( !Server.Engines.Harvest.Fishing.IsOnBoat( from ) )
|
||||
{
|
||||
from.SendMessage( "You need to be out on your ship's deck to use this!" );
|
||||
}
|
||||
else if ( FullValidation( map, x, y ) )
|
||||
{
|
||||
Point3D p = new Point3D( x, y, map.GetAverageZ( x, y ) );
|
||||
|
||||
for ( int i = 1; i < Amount; ++i ) // these were stackable before, doh
|
||||
from.AddToBackpack( new SpecialFishingNet() );
|
||||
|
||||
m_InUse = true;
|
||||
Movable = false;
|
||||
MoveToWorld( p, map );
|
||||
|
||||
from.Animate( 12, 5, 1, true, false, 0 );
|
||||
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 1.5 ), TimeSpan.FromSeconds( 1.0 ), 20, new TimerStateCallback( DoEffect ), new object[]{ p, 0, from } );
|
||||
|
||||
from.SendLocalizedMessage( 1010487 ); // You plunge the net into the sea...
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1010485 ); // You can only use this net in deep water!
|
||||
}
|
||||
}
|
||||
|
||||
private void DoEffect( object state )
|
||||
{
|
||||
if ( Deleted )
|
||||
return;
|
||||
|
||||
object[] states = (object[])state;
|
||||
|
||||
Point3D p = (Point3D)states[0];
|
||||
int index = (int)states[1];
|
||||
Mobile from = (Mobile)states[2];
|
||||
|
||||
states[1] = ++index;
|
||||
|
||||
if ( index == 1 )
|
||||
{
|
||||
Effects.SendLocationEffect( p, Map, 0x352D, 16, 4 );
|
||||
Effects.PlaySound( p, Map, 0x364 );
|
||||
}
|
||||
else if ( index <= 10 || index == 20 )
|
||||
{
|
||||
for ( int i = 0; i < 3; ++i )
|
||||
{
|
||||
int x, y;
|
||||
|
||||
switch ( Utility.Random( 8 ) )
|
||||
{
|
||||
default:
|
||||
case 0: x = -1; y = -1; break;
|
||||
case 1: x = -1; y = 0; break;
|
||||
case 2: x = -1; y = +1; break;
|
||||
case 3: x = 0; y = -1; break;
|
||||
case 4: x = 0; y = +1; break;
|
||||
case 5: x = +1; y = -1; break;
|
||||
case 6: x = +1; y = 0; break;
|
||||
case 7: x = +1; y = +1; break;
|
||||
}
|
||||
|
||||
Effects.SendLocationEffect( new Point3D( p.X + x, p.Y + y, p.Z ), Map, 0x352D, 16, 4 );
|
||||
}
|
||||
|
||||
Effects.PlaySound( p, Map, 0x364 );
|
||||
|
||||
if ( index == 20 )
|
||||
FinishEffect( p, Map, from );
|
||||
else
|
||||
this.Z -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual int GetSpawnCount()
|
||||
{
|
||||
int count = Utility.RandomMinMax( 1, 3 );
|
||||
|
||||
if ( Hue != 0x8A0 )
|
||||
count += Utility.RandomMinMax( 1, 2 );
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
protected void Spawn( Point3D p, Map map, BaseCreature spawn )
|
||||
{
|
||||
if ( map == null )
|
||||
{
|
||||
spawn.Delete();
|
||||
return;
|
||||
}
|
||||
|
||||
int x = p.X, y = p.Y;
|
||||
|
||||
for ( int j = 0; j < 20; ++j )
|
||||
{
|
||||
int tx = p.X - 2 + Utility.Random( 5 );
|
||||
int ty = p.Y - 2 + Utility.Random( 5 );
|
||||
|
||||
LandTile t = map.Tiles.GetLandTile( tx, ty );
|
||||
|
||||
if ( t.Z == p.Z && ( (t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137) ) && !Spells.SpellHelper.CheckMulti( new Point3D( tx, ty, p.Z ), map ) )
|
||||
{
|
||||
x = tx;
|
||||
y = ty;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
spawn.MoveToWorld( new Point3D( x, y, p.Z ), map );
|
||||
|
||||
if ( spawn is Kraken && 0.2 > Utility.RandomDouble() )
|
||||
spawn.PackItem( new MessageInABottle() );
|
||||
}
|
||||
|
||||
protected virtual void FinishEffect( Point3D p, Map map, Mobile from )
|
||||
{
|
||||
from.RevealingAction();
|
||||
|
||||
int count = GetSpawnCount();
|
||||
|
||||
for ( int i = 0; map != null && i < count; ++i )
|
||||
{
|
||||
BaseCreature spawn;
|
||||
|
||||
switch ( Utility.Random( 8 ) )
|
||||
{
|
||||
default:
|
||||
case 0: spawn = new SeaSerpent(); break;
|
||||
case 1: spawn = new DeepSeaSerpent(); break;
|
||||
case 2: spawn = new WaterElemental(); break;
|
||||
case 3: spawn = new Kraken(); break;
|
||||
case 4: spawn = new GiantEel(); break;
|
||||
case 5: spawn = new GiantSquid(); break;
|
||||
case 6: spawn = new SeaHydra(); break;
|
||||
case 7: spawn = new GreatWhite(); break;
|
||||
}
|
||||
|
||||
Spawn( p, map, spawn );
|
||||
|
||||
spawn.Combatant = from;
|
||||
}
|
||||
|
||||
Delete();
|
||||
}
|
||||
|
||||
public static bool FullValidation( Map map, int x, int y )
|
||||
{
|
||||
bool valid = ValidateDeepWater( map, x, y );
|
||||
|
||||
for ( int j = 1, offset = 5; valid && j <= 5; ++j, offset += 5 )
|
||||
{
|
||||
if ( !ValidateDeepWater( map, x + offset, y + offset ) )
|
||||
valid = false;
|
||||
else if ( !ValidateDeepWater( map, x + offset, y - offset ) )
|
||||
valid = false;
|
||||
else if ( !ValidateDeepWater( map, x - offset, y + offset ) )
|
||||
valid = false;
|
||||
else if ( !ValidateDeepWater( map, x - offset, y - offset ) )
|
||||
valid = false;
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
private static bool ValidateDeepWater( Map map, int x, int y )
|
||||
{
|
||||
Point3D loc = new Point3D( x, y, -5 );
|
||||
Region reg = Region.Find( loc, map );
|
||||
int tileID = map.Tiles.GetLandTile( x, y ).ID;
|
||||
bool water = false;
|
||||
|
||||
for( int i = 0; !water && i < Server.Engines.Harvest.Fishing.m_WaterTiles.Length; i += 2 )
|
||||
water = (tileID >= Server.Engines.Harvest.Fishing.m_WaterTiles[i] && tileID <= Server.Engines.Harvest.Fishing.m_WaterTiles[i + 1]);
|
||||
|
||||
if ( reg != map.DefaultRegion )
|
||||
water = false;
|
||||
|
||||
return water;
|
||||
}
|
||||
}
|
||||
|
||||
public class FabledFishingNet : SpecialFishingNet
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1063451; } } // a fabled fishing net
|
||||
|
||||
[Constructable]
|
||||
public FabledFishingNet()
|
||||
{
|
||||
Hue = 0x481;
|
||||
}
|
||||
|
||||
protected override int GetSpawnCount()
|
||||
{
|
||||
return base.GetSpawnCount() + 4;
|
||||
}
|
||||
|
||||
protected override void FinishEffect( Point3D p, Map map, Mobile from )
|
||||
{
|
||||
Spawn( p, map, new Leviathan( from ) );
|
||||
|
||||
base.FinishEffect( p, map, from );
|
||||
}
|
||||
|
||||
public FabledFishingNet( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
159
Scripts/Items/Skill Items/Harvest Tools/BaseHarvestTool.cs
Normal file
159
Scripts/Items/Skill Items/Harvest Tools/BaseHarvestTool.cs
Normal file
|
|
@ -0,0 +1,159 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.Engines.Craft;
|
||||
using Server.Engines.Harvest;
|
||||
using Server.ContextMenus;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public interface IUsesRemaining
|
||||
{
|
||||
int UsesRemaining{ get; set; }
|
||||
bool ShowUsesRemaining{ get; set; }
|
||||
}
|
||||
|
||||
public abstract class BaseHarvestTool : Item, IUsesRemaining, ICraftable
|
||||
{
|
||||
private Mobile m_Crafter;
|
||||
private ToolQuality m_Quality;
|
||||
private int m_UsesRemaining;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Mobile Crafter
|
||||
{
|
||||
get{ return m_Crafter; }
|
||||
set{ m_Crafter = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public ToolQuality Quality
|
||||
{
|
||||
get{ return m_Quality; }
|
||||
set{ UnscaleUses(); m_Quality = value; InvalidateProperties(); ScaleUses(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int UsesRemaining
|
||||
{
|
||||
get { return m_UsesRemaining; }
|
||||
set { m_UsesRemaining = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
public void ScaleUses()
|
||||
{
|
||||
m_UsesRemaining = (m_UsesRemaining * GetUsesScalar()) / 100;
|
||||
InvalidateProperties();
|
||||
}
|
||||
|
||||
public void UnscaleUses()
|
||||
{
|
||||
m_UsesRemaining = (m_UsesRemaining * 100) / GetUsesScalar();
|
||||
}
|
||||
|
||||
public int GetUsesScalar()
|
||||
{
|
||||
if ( m_Quality == ToolQuality.Exceptional )
|
||||
return 200;
|
||||
|
||||
return 100;
|
||||
}
|
||||
|
||||
public bool ShowUsesRemaining{ get{ return true; } set{} }
|
||||
|
||||
public abstract HarvestSystem HarvestSystem{ get; }
|
||||
|
||||
public BaseHarvestTool( int itemID ) : this( 50, itemID )
|
||||
{
|
||||
}
|
||||
|
||||
public BaseHarvestTool( int usesRemaining, int itemID ) : base( itemID )
|
||||
{
|
||||
m_UsesRemaining = usesRemaining;
|
||||
m_Quality = ToolQuality.Regular;
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_Quality == ToolQuality.Exceptional )
|
||||
list.Add( 1060636 ); // exceptional
|
||||
|
||||
list.Add( 1060584, m_UsesRemaining.ToString() ); // uses remaining: ~1_val~
|
||||
}
|
||||
|
||||
public virtual void DisplayDurabilityTo( Mobile m )
|
||||
{
|
||||
LabelToAffix( m, 1017323, AffixType.Append, ": " + m_UsesRemaining.ToString() ); // Durability
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
DisplayDurabilityTo( from );
|
||||
|
||||
base.OnSingleClick( from );
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( IsChildOf( from.Backpack ) || Parent == from )
|
||||
HarvestSystem.BeginHarvesting( from, this );
|
||||
else
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
|
||||
public BaseHarvestTool( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( (Mobile) m_Crafter );
|
||||
writer.Write( (int) m_Quality );
|
||||
|
||||
writer.Write( (int) m_UsesRemaining );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_Crafter = reader.ReadMobile();
|
||||
m_Quality = (ToolQuality) reader.ReadInt();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_UsesRemaining = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region ICraftable Members
|
||||
|
||||
public int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue )
|
||||
{
|
||||
Quality = (ToolQuality)quality;
|
||||
|
||||
if ( makersMark )
|
||||
Crafter = from;
|
||||
|
||||
return quality;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
40
Scripts/Items/Skill Items/Harvest Tools/Shovel.cs
Normal file
40
Scripts/Items/Skill Items/Harvest Tools/Shovel.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Harvest;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Shovel : BaseHarvestTool
|
||||
{
|
||||
public override HarvestSystem HarvestSystem{ get{ return Mining.System; } }
|
||||
|
||||
[Constructable]
|
||||
public Shovel() : this( 50 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Shovel( int uses ) : base( uses, 0xF39 )
|
||||
{
|
||||
Weight = 5.0;
|
||||
}
|
||||
|
||||
public Shovel( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
574
Scripts/Items/Skill Items/Instruments/BaseInstrument.cs
Normal file
574
Scripts/Items/Skill Items/Instruments/BaseInstrument.cs
Normal file
|
|
@ -0,0 +1,574 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public delegate void InstrumentPickedCallback( Mobile from, BaseInstrument instrument );
|
||||
|
||||
public enum InstrumentQuality
|
||||
{
|
||||
Low,
|
||||
Regular,
|
||||
Exceptional
|
||||
}
|
||||
|
||||
public abstract class BaseInstrument : Item, ICraftable, ISlayer
|
||||
{
|
||||
private int m_WellSound, m_BadlySound;
|
||||
private SlayerName m_Slayer, m_Slayer2;
|
||||
private InstrumentQuality m_Quality;
|
||||
private Mobile m_Crafter;
|
||||
private int m_UsesRemaining;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int SuccessSound
|
||||
{
|
||||
get{ return m_WellSound; }
|
||||
set{ m_WellSound = value; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int FailureSound
|
||||
{
|
||||
get{ return m_BadlySound; }
|
||||
set{ m_BadlySound = value; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public SlayerName Slayer
|
||||
{
|
||||
get{ return m_Slayer; }
|
||||
set{ m_Slayer = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public SlayerName Slayer2
|
||||
{
|
||||
get{ return m_Slayer2; }
|
||||
set{ m_Slayer2 = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public InstrumentQuality Quality
|
||||
{
|
||||
get{ return m_Quality; }
|
||||
set{ UnscaleUses(); m_Quality = value; InvalidateProperties(); ScaleUses(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Mobile Crafter
|
||||
{
|
||||
get{ return m_Crafter; }
|
||||
set{ m_Crafter = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
public virtual int InitMinUses{ get{ return 350; } }
|
||||
public virtual int InitMaxUses{ get{ return 450; } }
|
||||
|
||||
public virtual TimeSpan ChargeReplenishRate { get { return TimeSpan.FromMinutes( 5.0 ); } }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int UsesRemaining
|
||||
{
|
||||
get{ CheckReplenishUses(); return m_UsesRemaining; }
|
||||
set{ m_UsesRemaining = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
private DateTime m_LastReplenished;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public DateTime LastReplenished
|
||||
{
|
||||
get { return m_LastReplenished; }
|
||||
set { m_LastReplenished = value; CheckReplenishUses(); }
|
||||
}
|
||||
|
||||
private bool m_ReplenishesCharges;
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool ReplenishesCharges
|
||||
{
|
||||
get { return m_ReplenishesCharges; }
|
||||
set
|
||||
{
|
||||
if( value != m_ReplenishesCharges && value )
|
||||
m_LastReplenished = DateTime.Now;
|
||||
|
||||
m_ReplenishesCharges = value;
|
||||
}
|
||||
}
|
||||
|
||||
public void CheckReplenishUses()
|
||||
{
|
||||
CheckReplenishUses( true );
|
||||
}
|
||||
|
||||
public void CheckReplenishUses( bool invalidate )
|
||||
{
|
||||
if( !m_ReplenishesCharges || m_UsesRemaining >= InitMaxUses )
|
||||
return;
|
||||
|
||||
if( m_LastReplenished + ChargeReplenishRate < DateTime.Now )
|
||||
{
|
||||
TimeSpan timeDifference = DateTime.Now - m_LastReplenished;
|
||||
|
||||
m_UsesRemaining = Math.Min( m_UsesRemaining + (int)( timeDifference.Ticks / ChargeReplenishRate.Ticks), InitMaxUses ); //How rude of TimeSpan to not allow timespan division.
|
||||
m_LastReplenished = DateTime.Now;
|
||||
|
||||
if( invalidate )
|
||||
InvalidateProperties();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void ScaleUses()
|
||||
{
|
||||
UsesRemaining = (UsesRemaining * GetUsesScalar()) / 100;
|
||||
//InvalidateProperties();
|
||||
}
|
||||
|
||||
public void UnscaleUses()
|
||||
{
|
||||
UsesRemaining = (UsesRemaining * 100) / GetUsesScalar();
|
||||
}
|
||||
|
||||
public int GetUsesScalar()
|
||||
{
|
||||
if ( m_Quality == InstrumentQuality.Exceptional )
|
||||
return 200;
|
||||
|
||||
return 100;
|
||||
}
|
||||
|
||||
public void ConsumeUse( Mobile from )
|
||||
{
|
||||
// TODO: Confirm what must happen here?
|
||||
|
||||
if ( UsesRemaining > 1 )
|
||||
{
|
||||
--UsesRemaining;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( from != null )
|
||||
from.SendLocalizedMessage( 502079 ); // The instrument played its last tune.
|
||||
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
||||
private static Hashtable m_Instruments = new Hashtable();
|
||||
|
||||
public static BaseInstrument GetInstrument( Mobile from )
|
||||
{
|
||||
BaseInstrument item = m_Instruments[from] as BaseInstrument;
|
||||
|
||||
if ( item == null )
|
||||
return null;
|
||||
|
||||
if ( !item.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
m_Instruments.Remove( from );
|
||||
return null;
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
public static int GetBardRange( Mobile bard, SkillName skill )
|
||||
{
|
||||
return 8 + (int)(bard.Skills[skill].Value / 15);
|
||||
}
|
||||
|
||||
public static void PickInstrument( Mobile from, InstrumentPickedCallback callback )
|
||||
{
|
||||
BaseInstrument instrument = GetInstrument( from );
|
||||
|
||||
if ( instrument != null )
|
||||
{
|
||||
if ( callback != null )
|
||||
callback( from, instrument );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 500617 ); // What instrument shall you play?
|
||||
from.BeginTarget( 1, false, TargetFlags.None, new TargetStateCallback( OnPickedInstrument ), callback );
|
||||
}
|
||||
}
|
||||
|
||||
public static void OnPickedInstrument( Mobile from, object targeted, object state )
|
||||
{
|
||||
BaseInstrument instrument = targeted as BaseInstrument;
|
||||
|
||||
if ( instrument == null )
|
||||
{
|
||||
from.SendLocalizedMessage( 500619 ); // That is not a musical instrument.
|
||||
}
|
||||
else
|
||||
{
|
||||
SetInstrument( from, instrument );
|
||||
|
||||
InstrumentPickedCallback callback = state as InstrumentPickedCallback;
|
||||
|
||||
if ( callback != null )
|
||||
callback( from, instrument );
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsMageryCreature( BaseCreature bc )
|
||||
{
|
||||
return ( bc != null && bc.AI == AIType.AI_Mage && bc.Skills[SkillName.Magery].Base > 5.0 );
|
||||
}
|
||||
|
||||
public static bool IsFireBreathingCreature( BaseCreature bc )
|
||||
{
|
||||
if ( bc == null )
|
||||
return false;
|
||||
|
||||
return bc.HasBreath;
|
||||
}
|
||||
|
||||
public static bool IsPoisonImmune( BaseCreature bc )
|
||||
{
|
||||
return ( bc != null && bc.PoisonImmune != null );
|
||||
}
|
||||
|
||||
public static int GetPoisonLevel( BaseCreature bc )
|
||||
{
|
||||
if ( bc == null )
|
||||
return 0;
|
||||
|
||||
Poison p = bc.HitPoison;
|
||||
|
||||
if ( p == null )
|
||||
return 0;
|
||||
|
||||
return p.Level + 1;
|
||||
}
|
||||
|
||||
public static double GetBaseDifficulty( Mobile targ )
|
||||
{
|
||||
/* Difficulty TODO: Add another 100 points for each of the following abilities:
|
||||
- Radiation or Aura Damage (Heat, Cold etc.)
|
||||
- Summoning Undead
|
||||
*/
|
||||
|
||||
double val = (targ.HitsMax * 1.6) + targ.StamMax + targ.ManaMax;
|
||||
|
||||
val += targ.SkillsTotal / 10;
|
||||
|
||||
if ( val > 700 )
|
||||
val = 700 + (int)((val - 700) * (3.0 / 11));
|
||||
|
||||
BaseCreature bc = targ as BaseCreature;
|
||||
|
||||
if ( IsMageryCreature( bc ) )
|
||||
val += 100;
|
||||
|
||||
if ( IsFireBreathingCreature( bc ) )
|
||||
val += 100;
|
||||
|
||||
if ( IsPoisonImmune( bc ) )
|
||||
val += 100;
|
||||
|
||||
if ( targ is Bat )
|
||||
val += 100;
|
||||
|
||||
val += GetPoisonLevel( bc ) * 20;
|
||||
|
||||
val /= 10;
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
public double GetDifficultyFor( Mobile targ )
|
||||
{
|
||||
double val = GetBaseDifficulty( targ );
|
||||
|
||||
if ( m_Quality == InstrumentQuality.Exceptional )
|
||||
val -= 5.0; // 10%
|
||||
|
||||
if ( m_Slayer != SlayerName.None )
|
||||
{
|
||||
SlayerEntry entry = SlayerGroup.GetEntryByName( m_Slayer );
|
||||
|
||||
if ( entry != null )
|
||||
{
|
||||
if ( entry.Slays( targ ) )
|
||||
val -= 10.0; // 20%
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_Slayer2 != SlayerName.None )
|
||||
{
|
||||
SlayerEntry entry = SlayerGroup.GetEntryByName( m_Slayer2 );
|
||||
|
||||
if ( entry != null )
|
||||
{
|
||||
if ( entry.Slays( targ ) )
|
||||
val -= 10.0; // 20%
|
||||
}
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
public static void SetInstrument( Mobile from, BaseInstrument item )
|
||||
{
|
||||
m_Instruments[from] = item;
|
||||
}
|
||||
|
||||
public BaseInstrument( int itemID, int wellSound, int badlySound ) : base( itemID )
|
||||
{
|
||||
m_WellSound = wellSound;
|
||||
m_BadlySound = badlySound;
|
||||
UsesRemaining = Utility.RandomMinMax( InitMinUses, InitMaxUses );
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
int oldUses = m_UsesRemaining;
|
||||
CheckReplenishUses( false );
|
||||
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_Crafter != null )
|
||||
list.Add( 1050043, m_Crafter.Name ); // crafted by ~1_NAME~
|
||||
|
||||
if ( m_Quality == InstrumentQuality.Exceptional )
|
||||
list.Add( 1060636 ); // exceptional
|
||||
|
||||
list.Add( 1060584, m_UsesRemaining.ToString() ); // uses remaining: ~1_val~
|
||||
|
||||
if( m_ReplenishesCharges )
|
||||
list.Add( 1070928 ); // Replenish Charges
|
||||
|
||||
if( m_Slayer != SlayerName.None )
|
||||
{
|
||||
SlayerEntry entry = SlayerGroup.GetEntryByName( m_Slayer );
|
||||
if( entry != null )
|
||||
list.Add( entry.Title );
|
||||
}
|
||||
|
||||
if( m_Slayer2 != SlayerName.None )
|
||||
{
|
||||
SlayerEntry entry = SlayerGroup.GetEntryByName( m_Slayer2 );
|
||||
if( entry != null )
|
||||
list.Add( entry.Title );
|
||||
}
|
||||
|
||||
if( m_UsesRemaining != oldUses )
|
||||
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( InvalidateProperties ) );
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
ArrayList attrs = new ArrayList();
|
||||
|
||||
if ( DisplayLootType )
|
||||
{
|
||||
if ( LootType == LootType.Blessed )
|
||||
attrs.Add( new EquipInfoAttribute( 1038021 ) ); // blessed
|
||||
}
|
||||
|
||||
if ( m_Quality == InstrumentQuality.Exceptional )
|
||||
attrs.Add( new EquipInfoAttribute( 1018305 - (int)m_Quality ) );
|
||||
|
||||
if( m_ReplenishesCharges )
|
||||
attrs.Add( new EquipInfoAttribute( 1070928 ) ); // Replenish Charges
|
||||
|
||||
if( m_Slayer != SlayerName.None )
|
||||
{
|
||||
SlayerEntry entry = SlayerGroup.GetEntryByName( m_Slayer );
|
||||
if( entry != null )
|
||||
attrs.Add( new EquipInfoAttribute( entry.Title ) );
|
||||
}
|
||||
|
||||
if( m_Slayer2 != SlayerName.None )
|
||||
{
|
||||
SlayerEntry entry = SlayerGroup.GetEntryByName( m_Slayer2 );
|
||||
if( entry != null )
|
||||
attrs.Add( new EquipInfoAttribute( entry.Title ) );
|
||||
}
|
||||
|
||||
int number;
|
||||
|
||||
if ( Name == null )
|
||||
{
|
||||
number = LabelNumber;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.LabelTo( from, Name );
|
||||
number = 1041000;
|
||||
}
|
||||
|
||||
if ( attrs.Count == 0 && Crafter == null && Name != null )
|
||||
return;
|
||||
|
||||
EquipmentInfo eqInfo = new EquipmentInfo( number, m_Crafter, false, (EquipInfoAttribute[])attrs.ToArray( typeof( EquipInfoAttribute ) ) );
|
||||
|
||||
from.Send( new DisplayEquipmentInfo( this, eqInfo ) );
|
||||
}
|
||||
|
||||
public BaseInstrument( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 3 ); // version
|
||||
|
||||
writer.Write( m_ReplenishesCharges );
|
||||
if( m_ReplenishesCharges )
|
||||
writer.Write( m_LastReplenished );
|
||||
|
||||
|
||||
writer.Write( m_Crafter );
|
||||
|
||||
writer.WriteEncodedInt( (int) m_Quality );
|
||||
writer.WriteEncodedInt( (int) m_Slayer );
|
||||
writer.WriteEncodedInt( (int) m_Slayer2 );
|
||||
|
||||
writer.WriteEncodedInt( (int)UsesRemaining );
|
||||
|
||||
writer.WriteEncodedInt( (int) m_WellSound );
|
||||
writer.WriteEncodedInt( (int) m_BadlySound );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 3:
|
||||
{
|
||||
m_ReplenishesCharges = reader.ReadBool();
|
||||
|
||||
if( m_ReplenishesCharges )
|
||||
m_LastReplenished = reader.ReadDateTime();
|
||||
|
||||
goto case 2;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
m_Crafter = reader.ReadMobile();
|
||||
|
||||
m_Quality = (InstrumentQuality)reader.ReadEncodedInt();
|
||||
m_Slayer = (SlayerName)reader.ReadEncodedInt();
|
||||
m_Slayer2 = (SlayerName)reader.ReadEncodedInt();
|
||||
|
||||
UsesRemaining = reader.ReadEncodedInt();
|
||||
|
||||
m_WellSound = reader.ReadEncodedInt();
|
||||
m_BadlySound = reader.ReadEncodedInt();
|
||||
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
m_Crafter = reader.ReadMobile();
|
||||
|
||||
m_Quality = (InstrumentQuality)reader.ReadEncodedInt();
|
||||
m_Slayer = (SlayerName)reader.ReadEncodedInt();
|
||||
|
||||
UsesRemaining = reader.ReadEncodedInt();
|
||||
|
||||
m_WellSound = reader.ReadEncodedInt();
|
||||
m_BadlySound = reader.ReadEncodedInt();
|
||||
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_WellSound = reader.ReadInt();
|
||||
m_BadlySound = reader.ReadInt();
|
||||
UsesRemaining = Utility.RandomMinMax( InitMinUses, InitMaxUses );
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
CheckReplenishUses();
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !from.InRange( GetWorldLocation(), 1 ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 500446 ); // That is too far away.
|
||||
}
|
||||
else if ( from.BeginAction( typeof( BaseInstrument ) ) )
|
||||
{
|
||||
SetInstrument( from, this );
|
||||
|
||||
// Delay of 7 second before beign able to play another instrument again
|
||||
new InternalTimer( from ).Start();
|
||||
|
||||
if ( CheckMusicianship( from ) )
|
||||
PlayInstrumentWell( from );
|
||||
else
|
||||
PlayInstrumentBadly( from );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 500119 ); // You must wait to perform another action
|
||||
}
|
||||
}
|
||||
|
||||
public static bool CheckMusicianship( Mobile m )
|
||||
{
|
||||
m.CheckSkill( SkillName.Musicianship, 0.0, 120.0 );
|
||||
|
||||
return ( (m.Skills[SkillName.Musicianship].Value / 100) > Utility.RandomDouble() );
|
||||
}
|
||||
|
||||
public void PlayInstrumentWell( Mobile from )
|
||||
{
|
||||
from.PlaySound( m_WellSound );
|
||||
}
|
||||
|
||||
public void PlayInstrumentBadly( Mobile from )
|
||||
{
|
||||
from.PlaySound( m_BadlySound );
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_From;
|
||||
|
||||
public InternalTimer( Mobile from ) : base( TimeSpan.FromSeconds( 6.0 ) )
|
||||
{
|
||||
m_From = from;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_From.EndAction( typeof( BaseInstrument ) );
|
||||
}
|
||||
}
|
||||
#region ICraftable Members
|
||||
|
||||
public int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue )
|
||||
{
|
||||
Quality = (InstrumentQuality)quality;
|
||||
|
||||
if ( makersMark )
|
||||
Crafter = from;
|
||||
|
||||
return quality;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
35
Scripts/Items/Skill Items/Instruments/Drums.cs
Normal file
35
Scripts/Items/Skill Items/Instruments/Drums.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Drums : BaseInstrument
|
||||
{
|
||||
[Constructable]
|
||||
public Drums() : base( 0xE9C, 0x38, 0x39 )
|
||||
{
|
||||
Name = "drum";
|
||||
Weight = 4.0;
|
||||
}
|
||||
|
||||
public Drums( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( Weight == 3.0 )
|
||||
Weight = 4.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
33
Scripts/Items/Skill Items/Instruments/Flute.cs
Normal file
33
Scripts/Items/Skill Items/Instruments/Flute.cs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Flute : BaseInstrument
|
||||
{
|
||||
[Constructable]
|
||||
public Flute() : base( 0x134E, 0x504, 0x503 )
|
||||
{
|
||||
Name = "flute";
|
||||
Weight = 2.0;
|
||||
ItemID = Utility.RandomList( 0x134E, 0x136F );
|
||||
}
|
||||
|
||||
public Flute( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
34
Scripts/Items/Skill Items/Instruments/Harp.cs
Normal file
34
Scripts/Items/Skill Items/Instruments/Harp.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Harp : BaseInstrument
|
||||
{
|
||||
[Constructable]
|
||||
public Harp() : base( 0xEB1, 0x43, 0x44 )
|
||||
{
|
||||
Weight = 35.0;
|
||||
}
|
||||
|
||||
public Harp( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( Weight == 3.0 )
|
||||
Weight = 35.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
31
Scripts/Items/Skill Items/Instruments/Horn.cs
Normal file
31
Scripts/Items/Skill Items/Instruments/Horn.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Horn : BaseInstrument
|
||||
{
|
||||
[Constructable]
|
||||
public Horn() : base( 0x10E0, 0x5D4, 0x5D3 )
|
||||
{
|
||||
Name = "shell trumpet";
|
||||
Weight = 5.0;
|
||||
ItemID = Utility.RandomList( 0x10E0, 0x10F4 );
|
||||
}
|
||||
|
||||
public Horn( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Scripts/Items/Skill Items/Instruments/LapHarp.cs
Normal file
36
Scripts/Items/Skill Items/Instruments/LapHarp.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LapHarp : BaseInstrument
|
||||
{
|
||||
[Constructable]
|
||||
public LapHarp() : base( 0xEB2, 0x45, 0x46 )
|
||||
{
|
||||
Name = "harp";
|
||||
Weight = 10.0;
|
||||
ItemID = Utility.RandomList( 0xEB2, 0x13F3 );
|
||||
}
|
||||
|
||||
public LapHarp( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( Weight == 3.0 )
|
||||
Weight = 10.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Scripts/Items/Skill Items/Instruments/Lute.cs
Normal file
36
Scripts/Items/Skill Items/Instruments/Lute.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Lute : BaseInstrument
|
||||
{
|
||||
[Constructable]
|
||||
public Lute() : base( 0xEB3, 0x4C, 0x4D )
|
||||
{
|
||||
Name = "lute";
|
||||
Weight = 5.0;
|
||||
ItemID = Utility.RandomList( 0xEB3, 0x0EB4 );
|
||||
}
|
||||
|
||||
public Lute( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( Weight == 3.0 )
|
||||
Weight = 5.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
31
Scripts/Items/Skill Items/Instruments/MagicHorn.cs
Normal file
31
Scripts/Items/Skill Items/Instruments/MagicHorn.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class MagicHorn : BaseInstrument
|
||||
{
|
||||
[Constructable]
|
||||
public MagicHorn() : base( 0x0409, 0x5D2, 0x5D3 )
|
||||
{
|
||||
Name = "magic shell trumpet";
|
||||
Weight = 5.0;
|
||||
ItemID = Utility.RandomList( 0x0409, 0x040A );
|
||||
}
|
||||
|
||||
public MagicHorn( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
35
Scripts/Items/Skill Items/Instruments/Pipes.cs
Normal file
35
Scripts/Items/Skill Items/Instruments/Pipes.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Pipes : BaseInstrument
|
||||
{
|
||||
[Constructable]
|
||||
public Pipes() : base( 0x212E, 0x5B8, 0x5B7 )
|
||||
{
|
||||
Name = "pipes";
|
||||
Weight = 5.0;
|
||||
}
|
||||
|
||||
public Pipes( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( Weight == 3.0 )
|
||||
Weight = 5.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
35
Scripts/Items/Skill Items/Instruments/Tambourine.cs
Normal file
35
Scripts/Items/Skill Items/Instruments/Tambourine.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Tambourine : BaseInstrument
|
||||
{
|
||||
[Constructable]
|
||||
public Tambourine() : base( 0xE9D, 0x52, 0x53 )
|
||||
{
|
||||
Name = "tambourine";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public Tambourine( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( Weight == 2.0 )
|
||||
Weight = 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
35
Scripts/Items/Skill Items/Instruments/TambourineTassel.cs
Normal file
35
Scripts/Items/Skill Items/Instruments/TambourineTassel.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class TambourineTassel : BaseInstrument
|
||||
{
|
||||
[Constructable]
|
||||
public TambourineTassel() : base( 0xE9E, 0x52, 0x53 )
|
||||
{
|
||||
Name = "tambourine";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public TambourineTassel( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( Weight == 2.0 )
|
||||
Weight = 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
115
Scripts/Items/Skill Items/Lumberjack/WoodBoard.cs
Normal file
115
Scripts/Items/Skill Items/Lumberjack/WoodBoard.cs
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Misc;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WoodBoard : Item, IAxe
|
||||
{
|
||||
private CraftResource m_Resource;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public CraftResource Resource
|
||||
{
|
||||
get { return m_Resource; }
|
||||
set { m_Resource = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public WoodBoard() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public WoodBoard( int amount ) : this( CraftResource.Wooden, amount )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public WoodBoard( CraftResource resource ): this( resource, 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public WoodBoard( CraftResource resource, int amount ): base( 0x1BD7 )
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 1.0;
|
||||
Name = "wood";
|
||||
Amount = amount;
|
||||
m_Resource = resource;
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( !CraftResources.IsStandard( m_Resource ) )
|
||||
{
|
||||
int num = CraftResources.GetLocalizationNumber( m_Resource );
|
||||
|
||||
if ( num > 0 )
|
||||
list.Add( num );
|
||||
else
|
||||
list.Add( CraftResources.GetName( m_Resource ) );
|
||||
}
|
||||
}
|
||||
public WoodBoard( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( (int)m_Resource );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_Resource = (CraftResource)reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( version == 0 )
|
||||
m_Resource = CraftResource.Wooden;
|
||||
}
|
||||
|
||||
public virtual bool TryCreateBoards( Mobile from, double skill, Item item )
|
||||
{
|
||||
if ( Deleted || !from.CanSee( this ) )
|
||||
return false;
|
||||
else if ( Server.Misc.SkillCheck.TradeSkill( from, Trades.Carpentry, false ) < skill && Server.Misc.SkillCheck.TradeSkill( from, Trades.Lumberjacking, false ) < skill )
|
||||
{
|
||||
item.Delete();
|
||||
from.SendLocalizedMessage( 1072652 ); // You cannot work this strange and unusual wood.
|
||||
return false;
|
||||
}
|
||||
base.ScissorHelper( from, item, 1, false );
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual bool Axe( Mobile from, BaseAxe axe )
|
||||
{
|
||||
if ( ItemID != 0x1BD7 )
|
||||
{
|
||||
ItemID = 0x1BD7;
|
||||
Weight = 1.0;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Skill Items/Magical/BlankScroll.cs
Normal file
38
Scripts/Items/Skill Items/Magical/BlankScroll.cs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BlankScroll : Item
|
||||
{
|
||||
[Constructable]
|
||||
public BlankScroll() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BlankScroll( int amount ) : base( 0xEF3 )
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 1.0;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public BlankScroll( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
40
Scripts/Items/Skill Items/Magical/Bottle.cs
Normal file
40
Scripts/Items/Skill Items/Magical/Bottle.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Bottle : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Bottle() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Bottle( int amount ) : base( 0xF0E )
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 1.0;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public Bottle( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
236
Scripts/Items/Skill Items/Magical/MagicRune.cs
Normal file
236
Scripts/Items/Skill Items/Magical/MagicRune.cs
Normal file
|
|
@ -0,0 +1,236 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
using Server.Prompts;
|
||||
using Server.Multis;
|
||||
using Server.Regions;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class MagicRune : Item, IDyable
|
||||
{
|
||||
private string m_Description;
|
||||
private bool m_Marked;
|
||||
private Point3D m_Target;
|
||||
private Map m_TargetMap;
|
||||
private BaseHouse m_House;
|
||||
private Mobile m_Owner;
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( (Item) m_House );
|
||||
writer.Write( (string) m_Description );
|
||||
writer.Write( (bool) m_Marked );
|
||||
writer.Write( (Point3D) m_Target );
|
||||
writer.Write( (Map) m_TargetMap );
|
||||
writer.Write( (Mobile) m_Owner );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_House = reader.ReadItem() as BaseHouse;
|
||||
m_Description = reader.ReadString();
|
||||
m_Marked = reader.ReadBool();
|
||||
m_Target = reader.ReadPoint3D();
|
||||
m_TargetMap = reader.ReadMap();
|
||||
m_Owner = reader.ReadMobile();
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.Counselor, AccessLevel.GameMaster )]
|
||||
public Mobile Owner
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Owner;
|
||||
}
|
||||
set{ m_Owner = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.Counselor, AccessLevel.GameMaster )]
|
||||
public BaseHouse House
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_House != null && m_House.Deleted )
|
||||
House = null;
|
||||
|
||||
return m_House;
|
||||
}
|
||||
set{ m_House = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.Counselor, AccessLevel.GameMaster )]
|
||||
public string Description
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Description;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Description = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.Counselor, AccessLevel.GameMaster )]
|
||||
public bool Marked
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Marked;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ( m_Marked != value )
|
||||
{
|
||||
m_Marked = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.Counselor, AccessLevel.GameMaster )]
|
||||
public Point3D Target
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Target;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Target = value;
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.Counselor, AccessLevel.GameMaster )]
|
||||
public Map TargetMap
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_TargetMap;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ( m_TargetMap != value )
|
||||
{
|
||||
m_TargetMap = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool Dye( Mobile from, DyeTub sender )
|
||||
{
|
||||
if ( Deleted )
|
||||
return false;
|
||||
else if ( RootParent is Mobile && from != RootParent )
|
||||
return false;
|
||||
|
||||
Hue = sender.DyedHue;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Mark( Mobile m )
|
||||
{
|
||||
m_Marked = true;
|
||||
m_Owner = m;
|
||||
|
||||
bool setDesc = false;
|
||||
|
||||
m_House = null;
|
||||
m_Target = m.Location;
|
||||
m_TargetMap = m.Map;
|
||||
|
||||
if( !setDesc )
|
||||
m_Description = BaseRegion.GetRuneNameFor( Region.Find( m_Target, m_TargetMap ) );
|
||||
|
||||
ItemID = 0x1f15;
|
||||
InvalidateProperties();
|
||||
}
|
||||
|
||||
private const string RuneFormat = "a rune for {0}";
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_Marked )
|
||||
{
|
||||
string desc;
|
||||
|
||||
if ( (desc = m_Description) == null || (desc = desc.Trim()).Length == 0 )
|
||||
desc = "an unknown location";
|
||||
|
||||
list.Add( ("{0}"), String.Format( RuneFormat, desc ) );
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddNameProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.AddNameProperties(list);
|
||||
if ( Owner != null ){ list.Add( 1070722, "Belongs to " + Owner.Name + "" ); }
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
int number;
|
||||
|
||||
if ( !IsChildOf( from.Backpack ) )
|
||||
{
|
||||
number = 1042001; // That must be in your pack for you to use it.
|
||||
}
|
||||
else if ( House != null )
|
||||
{
|
||||
number = 1062399; // You cannot edit the description for this rune.
|
||||
}
|
||||
else if ( m_Marked )
|
||||
{
|
||||
number = 501804; // Please enter a description for this marked object.
|
||||
|
||||
from.Prompt = new RenamePrompt( this );
|
||||
}
|
||||
else
|
||||
{
|
||||
number = 501805; // That rune is not yet marked.
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage( number );
|
||||
}
|
||||
|
||||
private class RenamePrompt : Prompt
|
||||
{
|
||||
private MagicRune m_Rune;
|
||||
|
||||
public RenamePrompt( MagicRune rune )
|
||||
{
|
||||
m_Rune = rune;
|
||||
}
|
||||
|
||||
public override void OnResponse( Mobile from, string text )
|
||||
{
|
||||
if ( m_Rune.House == null && m_Rune.Marked )
|
||||
{
|
||||
m_Rune.Description = text;
|
||||
from.SendLocalizedMessage( 1010474 ); // The etching on the rune has been changed.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MagicRune() : base( 0x1F14 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public MagicRune( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
412
Scripts/Items/Skill Items/Magical/Magicgate.cs
Normal file
412
Scripts/Items/Skill Items/Magical/Magicgate.cs
Normal file
|
|
@ -0,0 +1,412 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server.Misc;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.Gumps;
|
||||
using Server.Regions;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[DispellableFieldAttribute]
|
||||
public class Magicgate : Item
|
||||
{
|
||||
private Point3D m_Target;
|
||||
private Map m_TargetMap;
|
||||
private bool m_bDispellable;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Point3D Target
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Target;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Target = value;
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Map TargetMap
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_TargetMap;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_TargetMap = value;
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool Dispellable
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bDispellable;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bDispellable = value;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Magicgate() : this( Point3D.Zero, null )
|
||||
{
|
||||
m_bDispellable = true;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Magicgate(bool bDispellable) : this( Point3D.Zero, null )
|
||||
{
|
||||
m_bDispellable = bDispellable;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Magicgate( Point3D target, Map targetMap ) : base( 0xF6C )
|
||||
{
|
||||
Movable = false;
|
||||
Light = LightType.Circle300;
|
||||
|
||||
m_Target = target;
|
||||
m_TargetMap = targetMap;
|
||||
}
|
||||
|
||||
public Magicgate( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !from.Player )
|
||||
return;
|
||||
|
||||
if ( from.InRange( GetWorldLocation(), 1 ) )
|
||||
CheckGate( from, 1 );
|
||||
else
|
||||
from.SendLocalizedMessage( 500446 ); // That is too far away.
|
||||
}
|
||||
|
||||
public override bool OnMoveOver( Mobile m )
|
||||
{
|
||||
if ( m.Player )
|
||||
CheckGate( m, 0 );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual void CheckGate( Mobile m, int range )
|
||||
{
|
||||
new DelayTimer( m, this, range ).Start();
|
||||
}
|
||||
|
||||
public virtual void OnGateUsed( Mobile m )
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void UseGate( Mobile m )
|
||||
{
|
||||
ClientFlags flags = m.NetState == null ? ClientFlags.None : m.NetState.Flags;
|
||||
|
||||
if ( m.Spell != null )
|
||||
{
|
||||
m.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
|
||||
}
|
||||
else if ( m_TargetMap != null && m_TargetMap != Map.Internal )
|
||||
{
|
||||
BaseCreature.TeleportPets( m, m_Target, m_TargetMap );
|
||||
|
||||
m.MoveToWorld( m_Target, m_TargetMap );
|
||||
|
||||
if ( m.AccessLevel == AccessLevel.Player || !m.Hidden )
|
||||
m.PlaySound( 0x1FE );
|
||||
|
||||
OnGateUsed( m );
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendMessage( "This moongate does not seem to go anywhere." );
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( m_Target );
|
||||
writer.Write( m_TargetMap );
|
||||
|
||||
// Version 1
|
||||
writer.Write( m_bDispellable );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Target = reader.ReadPoint3D();
|
||||
m_TargetMap = reader.ReadMap();
|
||||
|
||||
if ( version >= 1 )
|
||||
m_bDispellable = reader.ReadBool();
|
||||
}
|
||||
|
||||
public virtual bool ValidateUse( Mobile from, bool message )
|
||||
{
|
||||
if ( from.Deleted || this.Deleted )
|
||||
return false;
|
||||
|
||||
if ( from.Map != this.Map || !from.InRange( this, 1 ) )
|
||||
{
|
||||
if ( message )
|
||||
from.SendLocalizedMessage( 500446 ); // That is too far away.
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual void BeginConfirmation( Mobile from )
|
||||
{
|
||||
if ( IsInTown( from.Location, from.Map ) && !IsInTown( m_Target, m_TargetMap ) )
|
||||
{
|
||||
if ( from.AccessLevel == AccessLevel.Player || !from.Hidden )
|
||||
from.Send( new PlaySound( 0x20E, from.Location ) );
|
||||
from.CloseGump( typeof( MagicgateConfirmGump ) );
|
||||
from.SendGump( new MagicgateConfirmGump( from, this ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
EndConfirmation( from );
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void EndConfirmation( Mobile from )
|
||||
{
|
||||
if ( !ValidateUse( from, true ) )
|
||||
return;
|
||||
|
||||
UseGate( from );
|
||||
}
|
||||
|
||||
public virtual void DelayCallback( Mobile from, int range )
|
||||
{
|
||||
if ( !ValidateUse( from, false ) || !from.InRange( this, range ) )
|
||||
return;
|
||||
|
||||
if ( m_TargetMap != null )
|
||||
BeginConfirmation( from );
|
||||
else
|
||||
from.SendMessage( "This moongate does not seem to go anywhere." );
|
||||
}
|
||||
|
||||
public static bool IsInTown( Point3D p, Map map )
|
||||
{
|
||||
if ( map == null )
|
||||
return false;
|
||||
|
||||
TownRegion reg = (TownRegion) Region.Find( p, map ).GetRegion( typeof( TownRegion ) );
|
||||
|
||||
return ( reg != null );
|
||||
}
|
||||
|
||||
private class DelayTimer : Timer
|
||||
{
|
||||
private Mobile m_From;
|
||||
private Magicgate m_Gate;
|
||||
private int m_Range;
|
||||
|
||||
public DelayTimer( Mobile from, Magicgate gate, int range ) : base( TimeSpan.FromSeconds( 1.0 ) )
|
||||
{
|
||||
m_From = from;
|
||||
m_Gate = gate;
|
||||
m_Range = range;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Gate.DelayCallback( m_From, m_Range );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ConfirmationMagicgate : Magicgate
|
||||
{
|
||||
private int m_GumpWidth;
|
||||
private int m_GumpHeight;
|
||||
|
||||
private int m_TitleColor;
|
||||
private int m_MessageColor;
|
||||
|
||||
private int m_TitleNumber;
|
||||
private int m_MessageNumber;
|
||||
|
||||
private string m_MessageString;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int GumpWidth
|
||||
{
|
||||
get{ return m_GumpWidth; }
|
||||
set{ m_GumpWidth = value; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int GumpHeight
|
||||
{
|
||||
get{ return m_GumpHeight; }
|
||||
set{ m_GumpHeight = value; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int TitleColor
|
||||
{
|
||||
get{ return m_TitleColor; }
|
||||
set{ m_TitleColor = value; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int MessageColor
|
||||
{
|
||||
get{ return m_MessageColor; }
|
||||
set{ m_MessageColor = value; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int TitleNumber
|
||||
{
|
||||
get{ return m_TitleNumber; }
|
||||
set{ m_TitleNumber = value; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int MessageNumber
|
||||
{
|
||||
get{ return m_MessageNumber; }
|
||||
set{ m_MessageNumber = value; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public string MessageString
|
||||
{
|
||||
get{ return m_MessageString; }
|
||||
set{ m_MessageString = value; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ConfirmationMagicgate() : this( Point3D.Zero, null )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ConfirmationMagicgate( Point3D target, Map targetMap ) : base( target, targetMap )
|
||||
{
|
||||
}
|
||||
|
||||
public ConfirmationMagicgate( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Warning_Callback( Mobile from, bool okay, object state )
|
||||
{
|
||||
if ( okay )
|
||||
EndConfirmation( from );
|
||||
}
|
||||
|
||||
public override void BeginConfirmation( Mobile from )
|
||||
{
|
||||
if ( m_GumpWidth > 0 && m_GumpHeight > 0 && m_TitleNumber > 0 && (m_MessageNumber > 0 || m_MessageString != null) )
|
||||
{
|
||||
from.CloseGump( typeof( WarningGump ) );
|
||||
from.SendGump( new WarningGump( m_TitleNumber, m_TitleColor, m_MessageString == null ? (object)m_MessageNumber : (object)m_MessageString, m_MessageColor, m_GumpWidth, m_GumpHeight, new WarningGumpCallback( Warning_Callback ), from ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
base.BeginConfirmation( from );
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.WriteEncodedInt( m_GumpWidth );
|
||||
writer.WriteEncodedInt( m_GumpHeight );
|
||||
|
||||
writer.WriteEncodedInt( m_TitleColor );
|
||||
writer.WriteEncodedInt( m_MessageColor );
|
||||
|
||||
writer.WriteEncodedInt( m_TitleNumber );
|
||||
writer.WriteEncodedInt( m_MessageNumber );
|
||||
|
||||
writer.Write( m_MessageString );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_GumpWidth = reader.ReadEncodedInt();
|
||||
m_GumpHeight = reader.ReadEncodedInt();
|
||||
|
||||
m_TitleColor = reader.ReadEncodedInt();
|
||||
m_MessageColor = reader.ReadEncodedInt();
|
||||
|
||||
m_TitleNumber = reader.ReadEncodedInt();
|
||||
m_MessageNumber = reader.ReadEncodedInt();
|
||||
|
||||
m_MessageString = reader.ReadString();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MagicgateConfirmGump : Gump
|
||||
{
|
||||
private Mobile m_From;
|
||||
private Magicgate m_Gate;
|
||||
|
||||
public MagicgateConfirmGump( Mobile from, Magicgate gate ) : base( 20, 30 )
|
||||
{
|
||||
m_From = from;
|
||||
m_Gate = gate;
|
||||
|
||||
AddPage( 0 );
|
||||
|
||||
AddBackground( 0, 0, 420, 400, 5054 );
|
||||
AddBackground( 10, 10, 400, 380, 3000 );
|
||||
|
||||
AddHtml( 20, 40, 380, 60, @"Dost thou wish to step into the moongate? Continue to enter the gate, Cancel to stay here", false, false );
|
||||
|
||||
AddHtmlLocalized( 55, 110, 290, 20, 1011012, false, false ); // CANCEL
|
||||
AddButton( 20, 110, 4005, 4007, 0, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddHtmlLocalized( 55, 140, 290, 40, 1011011, false, false ); // CONTINUE
|
||||
AddButton( 20, 140, 4005, 4007, 1, GumpButtonType.Reply, 0 );
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState state, RelayInfo info )
|
||||
{
|
||||
if ( info.ButtonID == 1 )
|
||||
m_Gate.EndConfirmation( m_From );
|
||||
}
|
||||
}
|
||||
}
|
||||
344
Scripts/Items/Skill Items/Magical/PotionKeg.cs
Normal file
344
Scripts/Items/Skill Items/Magical/PotionKeg.cs
Normal file
|
|
@ -0,0 +1,344 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class PotionKeg : Item
|
||||
{
|
||||
private PotionEffect m_Type;
|
||||
private int m_Held;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Held
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Held;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ( m_Held != value )
|
||||
{
|
||||
m_Held = value;
|
||||
UpdateWeight();
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public PotionEffect Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Type;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Type = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public PotionKeg() : base( 0x1940 )
|
||||
{
|
||||
UpdateWeight();
|
||||
}
|
||||
|
||||
public virtual void UpdateWeight()
|
||||
{
|
||||
int held = Math.Max( 0, Math.Min( m_Held, 100 ) );
|
||||
|
||||
this.Weight = 20 + ((held * 80) / 100);
|
||||
}
|
||||
|
||||
public PotionKeg( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( (int) m_Type );
|
||||
writer.Write( (int) m_Held );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
case 0:
|
||||
{
|
||||
m_Type = (PotionEffect)reader.ReadInt();
|
||||
m_Held = reader.ReadInt();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( version < 1 )
|
||||
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( UpdateWeight ) );
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_Held == 0 )
|
||||
return 1041084; // A specially lined keg for potions.
|
||||
else
|
||||
return ( 1041620 + (int)m_Type );
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
int number;
|
||||
|
||||
if ( m_Held <= 0 )
|
||||
number = 502246; // The keg is empty.
|
||||
else if ( m_Held < 5 )
|
||||
number = 502248; // The keg is nearly empty.
|
||||
else if ( m_Held < 20 )
|
||||
number = 502249; // The keg is not very full.
|
||||
else if ( m_Held < 30 )
|
||||
number = 502250; // The keg is about one quarter full.
|
||||
else if ( m_Held < 40 )
|
||||
number = 502251; // The keg is about one third full.
|
||||
else if ( m_Held < 47 )
|
||||
number = 502252; // The keg is almost half full.
|
||||
else if ( m_Held < 54 )
|
||||
number = 502254; // The keg is approximately half full.
|
||||
else if ( m_Held < 70 )
|
||||
number = 502253; // The keg is more than half full.
|
||||
else if ( m_Held < 80 )
|
||||
number = 502255; // The keg is about three quarters full.
|
||||
else if ( m_Held < 96 )
|
||||
number = 502256; // The keg is very full.
|
||||
else if ( m_Held < 100 )
|
||||
number = 502257; // The liquid is almost to the top of the keg.
|
||||
else
|
||||
number = 502258; // The keg is completely full.
|
||||
|
||||
list.Add( number );
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
base.OnSingleClick( from );
|
||||
|
||||
int number;
|
||||
|
||||
if ( m_Held <= 0 )
|
||||
number = 502246; // The keg is empty.
|
||||
else if ( m_Held < 5 )
|
||||
number = 502248; // The keg is nearly empty.
|
||||
else if ( m_Held < 20 )
|
||||
number = 502249; // The keg is not very full.
|
||||
else if ( m_Held < 30 )
|
||||
number = 502250; // The keg is about one quarter full.
|
||||
else if ( m_Held < 40 )
|
||||
number = 502251; // The keg is about one third full.
|
||||
else if ( m_Held < 47 )
|
||||
number = 502252; // The keg is almost half full.
|
||||
else if ( m_Held < 54 )
|
||||
number = 502254; // The keg is approximately half full.
|
||||
else if ( m_Held < 70 )
|
||||
number = 502253; // The keg is more than half full.
|
||||
else if ( m_Held < 80 )
|
||||
number = 502255; // The keg is about three quarters full.
|
||||
else if ( m_Held < 96 )
|
||||
number = 502256; // The keg is very full.
|
||||
else if ( m_Held < 100 )
|
||||
number = 502257; // The liquid is almost to the top of the keg.
|
||||
else
|
||||
number = 502258; // The keg is completely full.
|
||||
|
||||
this.LabelTo( from, number );
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( from.InRange( GetWorldLocation(), 2 ) )
|
||||
{
|
||||
if ( m_Held > 0 )
|
||||
{
|
||||
Container pack = from.Backpack;
|
||||
|
||||
if ( pack != null && pack.ConsumeTotal( typeof( Bottle ), 1 ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 502242 ); // You pour some of the keg's contents into an empty bottle...
|
||||
|
||||
BasePotion pot = FillBottle();
|
||||
|
||||
if ( pack.TryDropItem( from, pot, false ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 502243 ); // ...and place it into your backpack.
|
||||
from.PlaySound( 0x240 );
|
||||
|
||||
if ( --Held == 0 )
|
||||
from.SendLocalizedMessage( 502245 ); // The keg is now empty.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 502244 ); // ...but there is no room for the bottle in your backpack.
|
||||
pot.Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: Target a bottle
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 502246 ); // The keg is empty.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.LocalOverheadMessage( Network.MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnDragDrop( Mobile from, Item item )
|
||||
{
|
||||
if ( item is BasePotion )
|
||||
{
|
||||
BasePotion pot = (BasePotion)item;
|
||||
int toHold = Math.Min( 100 - m_Held, pot.Amount );
|
||||
|
||||
|
||||
if ( toHold <= 0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 502233 ); // The keg will not hold any more!
|
||||
return false;
|
||||
}
|
||||
else if ( m_Held == 0 )
|
||||
{
|
||||
if ( GiveBottle( from, toHold ) )
|
||||
{
|
||||
m_Type = pot.PotionEffect;
|
||||
Held = toHold;
|
||||
|
||||
from.PlaySound( 0x240 );
|
||||
|
||||
from.SendLocalizedMessage( 502237 ); // You place the empty bottle in your backpack.
|
||||
|
||||
item.Consume( toHold );
|
||||
|
||||
if( !item.Deleted )
|
||||
item.Bounce( from );
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 502238 ); // You don't have room for the empty bottle in your backpack.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if ( pot.PotionEffect != m_Type )
|
||||
{
|
||||
from.SendLocalizedMessage( 502236 ); // You decide that it would be a bad idea to mix different types of potions.
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( GiveBottle( from, toHold ) )
|
||||
{
|
||||
Held += toHold;
|
||||
|
||||
from.PlaySound( 0x240 );
|
||||
|
||||
from.SendLocalizedMessage( 502237 ); // You place the empty bottle in your backpack.
|
||||
|
||||
item.Consume( toHold );
|
||||
|
||||
if( !item.Deleted )
|
||||
item.Bounce( from );
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 502238 ); // You don't have room for the empty bottle in your backpack.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 502232 ); // The keg is not designed to hold that type of object.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool GiveBottle( Mobile m, int amount )
|
||||
{
|
||||
Container pack = m.Backpack;
|
||||
|
||||
Bottle bottle = new Bottle( amount );
|
||||
|
||||
if ( pack == null || !pack.TryDropItem( m, bottle, false ) )
|
||||
{
|
||||
bottle.Delete();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public BasePotion FillBottle()
|
||||
{
|
||||
switch ( m_Type )
|
||||
{
|
||||
default:
|
||||
case PotionEffect.Nightsight: return new NightSightPotion();
|
||||
|
||||
case PotionEffect.CureLesser: return new LesserCurePotion();
|
||||
case PotionEffect.Cure: return new CurePotion();
|
||||
case PotionEffect.CureGreater: return new GreaterCurePotion();
|
||||
|
||||
case PotionEffect.Agility: return new AgilityPotion();
|
||||
case PotionEffect.AgilityGreater: return new GreaterAgilityPotion();
|
||||
|
||||
case PotionEffect.Strength: return new StrengthPotion();
|
||||
case PotionEffect.StrengthGreater: return new GreaterStrengthPotion();
|
||||
|
||||
case PotionEffect.PoisonLesser: return new LesserPoisonPotion();
|
||||
case PotionEffect.Poison: return new PoisonPotion();
|
||||
case PotionEffect.PoisonGreater: return new GreaterPoisonPotion();
|
||||
case PotionEffect.PoisonDeadly: return new DeadlyPoisonPotion();
|
||||
|
||||
case PotionEffect.Refresh: return new RefreshPotion();
|
||||
case PotionEffect.RefreshTotal: return new TotalRefreshPotion();
|
||||
|
||||
case PotionEffect.HealLesser: return new LesserHealPotion();
|
||||
case PotionEffect.Heal: return new HealPotion();
|
||||
case PotionEffect.HealGreater: return new GreaterHealPotion();
|
||||
|
||||
case PotionEffect.ExplosionLesser: return new LesserExplosionPotion();
|
||||
case PotionEffect.Explosion: return new ExplosionPotion();
|
||||
case PotionEffect.ExplosionGreater: return new GreaterExplosionPotion();
|
||||
}
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
TileData.ItemTable[0x1940].Height = 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
464
Scripts/Items/Skill Items/Misc/Bandage.cs
Normal file
464
Scripts/Items/Skill Items/Misc/Bandage.cs
Normal file
|
|
@ -0,0 +1,464 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Bandage : Item, IDyable
|
||||
{
|
||||
public static int Range = 1;
|
||||
|
||||
public override double DefaultWeight
|
||||
{
|
||||
get { return 0.1; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Bandage() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Bandage( int amount ) : base( 0xE21 )
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public Bandage( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public virtual bool Dye( Mobile from, DyeTub sender )
|
||||
{
|
||||
if ( Deleted )
|
||||
return false;
|
||||
|
||||
Hue = sender.DyedHue;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( from.InRange( GetWorldLocation(), Range ) )
|
||||
{
|
||||
from.RevealingAction();
|
||||
|
||||
from.SendLocalizedMessage( 500948 ); // Who will you use the bandages on?
|
||||
|
||||
from.Target = new InternalTarget( this );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 500295 ); // You are too far away to do that.
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private Bandage m_Bandage;
|
||||
|
||||
public InternalTarget( Bandage bandage ) : base( Bandage.Range, false, TargetFlags.Beneficial )
|
||||
{
|
||||
m_Bandage = bandage;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Bandage.Deleted )
|
||||
return;
|
||||
|
||||
if ( targeted is Mobile )
|
||||
{
|
||||
if ( from.InRange( m_Bandage.GetWorldLocation(), Bandage.Range ) )
|
||||
{
|
||||
if ( BandageContext.BeginHeal( from, (Mobile)targeted ) != null )
|
||||
{
|
||||
m_Bandage.Consume();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 500295 ); // You are too far away to do that.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 500970 ); // Bandages can not be used on that.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class BandageContext
|
||||
{
|
||||
private Mobile m_Healer;
|
||||
private Mobile m_Patient;
|
||||
private int m_Slips;
|
||||
private Timer m_Timer;
|
||||
|
||||
public Mobile Healer{ get{ return m_Healer; } }
|
||||
public Mobile Patient{ get{ return m_Patient; } }
|
||||
public int Slips{ get{ return m_Slips; } set{ m_Slips = value; } }
|
||||
public Timer Timer{ get{ return m_Timer; } }
|
||||
|
||||
public void Slip()
|
||||
{
|
||||
m_Healer.SendLocalizedMessage( 500961 ); // Your fingers slip!
|
||||
++m_Slips;
|
||||
}
|
||||
|
||||
public BandageContext( Mobile healer, Mobile patient, TimeSpan delay )
|
||||
{
|
||||
m_Healer = healer;
|
||||
m_Patient = patient;
|
||||
|
||||
m_Timer = new InternalTimer( this, delay );
|
||||
m_Timer.Start();
|
||||
}
|
||||
|
||||
public void StopHeal()
|
||||
{
|
||||
m_Table.Remove( m_Healer );
|
||||
|
||||
if ( m_Timer != null )
|
||||
m_Timer.Stop();
|
||||
|
||||
m_Timer = null;
|
||||
}
|
||||
|
||||
private static Dictionary<Mobile, BandageContext> m_Table = new Dictionary<Mobile, BandageContext>();
|
||||
|
||||
public static BandageContext GetContext( Mobile healer )
|
||||
{
|
||||
BandageContext bc = null;
|
||||
m_Table.TryGetValue( healer, out bc );
|
||||
return bc;
|
||||
}
|
||||
|
||||
public static SkillName GetPrimarySkill( Mobile m )
|
||||
{
|
||||
return SkillName.Healing;
|
||||
}
|
||||
|
||||
public static SkillName GetSecondarySkill( Mobile m )
|
||||
{
|
||||
return SkillName.Healing;
|
||||
}
|
||||
|
||||
public void EndHeal()
|
||||
{
|
||||
StopHeal();
|
||||
|
||||
int healerNumber = -1, patientNumber = -1;
|
||||
bool playSound = true;
|
||||
bool checkSkills = false;
|
||||
|
||||
SkillName primarySkill = GetPrimarySkill( m_Patient );
|
||||
SkillName secondarySkill = GetSecondarySkill( m_Patient );
|
||||
|
||||
BaseCreature petPatient = m_Patient as BaseCreature;
|
||||
|
||||
bool guild = false;
|
||||
if ( m_Healer is PlayerMobile )
|
||||
{
|
||||
PlayerMobile pm = (PlayerMobile)m_Healer;
|
||||
|
||||
if ( pm.NpcGuild == NpcGuild.HealersGuild )
|
||||
guild = true;
|
||||
}
|
||||
|
||||
if ( !m_Healer.Alive )
|
||||
{
|
||||
healerNumber = 500962; // You were unable to finish your work before you died.
|
||||
patientNumber = -1;
|
||||
playSound = false;
|
||||
}
|
||||
else if ( !m_Healer.InRange( m_Patient, Bandage.Range ) )
|
||||
{
|
||||
healerNumber = 500963; // You did not stay close enough to heal your target.
|
||||
patientNumber = -1;
|
||||
playSound = false;
|
||||
}
|
||||
else if ( !guild && ( !m_Patient.Alive || (petPatient != null && petPatient.IsDeadPet) ) )
|
||||
{
|
||||
healerNumber = 500966; // You are unable to resurrect your patient.
|
||||
patientNumber = -1;
|
||||
playSound = false;
|
||||
}
|
||||
else if ( !m_Patient.Alive || (petPatient != null && petPatient.IsDeadPet) )
|
||||
{
|
||||
double healing = m_Healer.Skills[primarySkill].Value;
|
||||
double anatomy = m_Healer.Skills[secondarySkill].Value;
|
||||
double chance = ((healing - 68.0) / 50.0) - (m_Slips * 0.02);
|
||||
|
||||
if (( (checkSkills = (healing >= 80.0 && anatomy >= 80.0)) && chance > Utility.RandomDouble() ) )
|
||||
{
|
||||
if ( m_Patient.Map == null || !m_Patient.Map.CanFit( m_Patient.Location, 16, false, false ) )
|
||||
{
|
||||
healerNumber = 501042; // Target can not be resurrected at that location.
|
||||
patientNumber = 502391; // Thou can not be resurrected there!
|
||||
}
|
||||
else
|
||||
{
|
||||
healerNumber = 500965; // You are able to resurrect your patient.
|
||||
patientNumber = -1;
|
||||
|
||||
m_Patient.PlaySound( 0x214 );
|
||||
m_Patient.FixedEffect( 0x376A, 10, 16 );
|
||||
|
||||
if ( petPatient != null && petPatient.IsDeadPet )
|
||||
{
|
||||
Mobile master = petPatient.ControlMaster;
|
||||
|
||||
if( master != null && m_Healer == master )
|
||||
{
|
||||
petPatient.ResurrectPet();
|
||||
|
||||
for ( int i = 0; i < petPatient.Skills.Length; ++i )
|
||||
{
|
||||
petPatient.Skills[i].Base -= 0.1;
|
||||
}
|
||||
}
|
||||
else if ( master != null && master.InRange( petPatient, 3 ) )
|
||||
{
|
||||
healerNumber = 503255; // You are able to resurrect the creature.
|
||||
|
||||
master.CloseGump( typeof( PetResurrectGump ) );
|
||||
master.SendGump( new PetResurrectGump( m_Healer, petPatient ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
List<Mobile> friends = petPatient.Friends;
|
||||
|
||||
for ( int i = 0; friends != null && i < friends.Count; ++i )
|
||||
{
|
||||
Mobile friend = friends[i];
|
||||
|
||||
if ( friend.InRange( petPatient, 3 ) )
|
||||
{
|
||||
healerNumber = 503255; // You are able to resurrect the creature.
|
||||
|
||||
friend.CloseGump( typeof( PetResurrectGump ) );
|
||||
friend.SendGump( new PetResurrectGump( m_Healer, petPatient ) );
|
||||
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !found )
|
||||
healerNumber = 1049670; // The pet's owner must be nearby to attempt resurrection.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Patient.CloseGump( typeof( ResurrectGump ) );
|
||||
m_Patient.SendGump( new ResurrectGump( m_Patient, m_Healer ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( petPatient != null && petPatient.IsDeadPet )
|
||||
healerNumber = 503256; // You fail to resurrect the creature.
|
||||
else
|
||||
healerNumber = 500966; // You are unable to resurrect your patient.
|
||||
|
||||
patientNumber = -1;
|
||||
}
|
||||
}
|
||||
else if ( m_Patient.Poisoned )
|
||||
{
|
||||
m_Healer.SendLocalizedMessage( 500969 ); // You finish applying the bandages.
|
||||
|
||||
double healing = m_Healer.Skills[primarySkill].Value;
|
||||
double anatomy = m_Healer.Skills[secondarySkill].Value;
|
||||
double chance = ((healing - 30.0) / 50.0) - (m_Patient.Poison.Level * 0.1) - (m_Slips * 0.02);
|
||||
|
||||
if ( (checkSkills = (healing >= 60.0 && anatomy >= 60.0)) && chance > Utility.RandomDouble() )
|
||||
{
|
||||
if ( m_Patient.CurePoison( m_Healer ) )
|
||||
{
|
||||
healerNumber = (m_Healer == m_Patient) ? -1 : 1010058; // You have cured the target of all poisons.
|
||||
patientNumber = 1010059; // You have been cured of all poisons.
|
||||
}
|
||||
else
|
||||
{
|
||||
healerNumber = -1;
|
||||
patientNumber = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
healerNumber = 1010060; // You have failed to cure your target!
|
||||
patientNumber = -1;
|
||||
}
|
||||
}
|
||||
else if ( m_Patient.Hits == m_Patient.HitsMax )
|
||||
{
|
||||
healerNumber = 500967; // You heal what little damage your patient had.
|
||||
patientNumber = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
checkSkills = true;
|
||||
patientNumber = -1;
|
||||
|
||||
double healing = m_Healer.Skills[primarySkill].Value;
|
||||
double anatomy = m_Healer.Skills[secondarySkill].Value;
|
||||
double chance = ((healing + 10.0) / 100.0) - (m_Slips * 0.02);
|
||||
|
||||
if ( chance > Utility.RandomDouble() )
|
||||
{
|
||||
healerNumber = 500969; // You finish applying the bandages.
|
||||
|
||||
double min, max;
|
||||
|
||||
min = (anatomy / 5.0) + (healing / 5.0) + 3.0;
|
||||
max = (anatomy / 5.0) + (healing / 2.0) + 10.0;
|
||||
|
||||
double toHeal = min + (Utility.RandomDouble() * (max - min));
|
||||
|
||||
if ( m_Patient.Body.IsMonster || m_Patient.Body.IsAnimal )
|
||||
toHeal += m_Patient.HitsMax / 100;
|
||||
|
||||
toHeal -= m_Slips * 4;
|
||||
|
||||
if ( m_Patient is PlayerMobile ){ toHeal = (int)(toHeal * Server.Misc.Settings.HitPoints()); }
|
||||
|
||||
if ( toHeal < 1 )
|
||||
{
|
||||
toHeal = 1;
|
||||
healerNumber = 500968; // You apply the bandages, but they barely help.
|
||||
}
|
||||
|
||||
m_Patient.Heal( (int) toHeal, m_Healer, false );
|
||||
}
|
||||
else
|
||||
{
|
||||
healerNumber = 500968; // You apply the bandages, but they barely help.
|
||||
playSound = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( healerNumber != -1 )
|
||||
m_Healer.SendLocalizedMessage( healerNumber );
|
||||
|
||||
if ( patientNumber != -1 )
|
||||
m_Patient.SendLocalizedMessage( patientNumber );
|
||||
|
||||
if ( playSound )
|
||||
m_Patient.PlaySound( 0x57 );
|
||||
|
||||
if ( checkSkills )
|
||||
{
|
||||
m_Healer.CheckSkill( secondarySkill, 0.0, 120.0 );
|
||||
m_Healer.CheckSkill( primarySkill, 0.0, 120.0 );
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private BandageContext m_Context;
|
||||
|
||||
public InternalTimer( BandageContext context, TimeSpan delay ) : base( delay )
|
||||
{
|
||||
m_Context = context;
|
||||
Priority = TimerPriority.FiftyMS;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Context.EndHeal();
|
||||
}
|
||||
}
|
||||
|
||||
public static BandageContext BeginHeal( Mobile healer, Mobile patient )
|
||||
{
|
||||
bool isDeadPet = ( patient is BaseCreature && ((BaseCreature)patient).IsDeadPet );
|
||||
|
||||
if ( patient is Golem )
|
||||
{
|
||||
healer.SendLocalizedMessage( 500970 ); // Bandages cannot be used on that.
|
||||
}
|
||||
else if ( patient is PlayerMobile && patient.Hunger < 5 )
|
||||
{
|
||||
healer.SendMessage( "One cannot be healed when they are starving!" );
|
||||
}
|
||||
else if ( !patient.Poisoned && patient.Hits == patient.HitsMax && !isDeadPet )
|
||||
{
|
||||
healer.SendLocalizedMessage( 500955 ); // That being is not damaged!
|
||||
}
|
||||
else if ( !patient.Alive && (patient.Map == null || !patient.Map.CanFit( patient.Location, 16, false, false )) )
|
||||
{
|
||||
healer.SendLocalizedMessage( 501042 ); // Target cannot be resurrected at that location.
|
||||
}
|
||||
else if ( healer.CanBeBeneficial( patient, true, true ) )
|
||||
{
|
||||
healer.DoBeneficial( patient );
|
||||
|
||||
bool onSelf = ( healer == patient );
|
||||
int dex = healer.Dex;
|
||||
|
||||
double seconds;
|
||||
double resDelay = ( patient.Alive ? 0.0 : 5.0 );
|
||||
|
||||
if ( onSelf )
|
||||
{
|
||||
seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10));
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( dex >= 100 )
|
||||
seconds = 3.0 + resDelay;
|
||||
else if ( dex >= 40 )
|
||||
seconds = 4.0 + resDelay;
|
||||
else
|
||||
seconds = 5.0 + resDelay;
|
||||
}
|
||||
|
||||
BandageContext context = GetContext( healer );
|
||||
|
||||
if ( context != null )
|
||||
context.StopHeal();
|
||||
seconds *= 1000;
|
||||
|
||||
context = new BandageContext( healer, patient, TimeSpan.FromMilliseconds( seconds ) );
|
||||
|
||||
m_Table[healer] = context;
|
||||
|
||||
if ( !onSelf )
|
||||
patient.SendLocalizedMessage( 1008078, false, healer.Name ); // : Attempting to heal you.
|
||||
|
||||
|
||||
healer.SendLocalizedMessage( 500956 ); // You begin applying the bandages.
|
||||
return context;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
199
Scripts/Items/Skill Items/Misc/FireHorn.cs
Normal file
199
Scripts/Items/Skill Items/Misc/FireHorn.cs
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FireHorn : Item
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1060456; } } // fire horn
|
||||
|
||||
[Constructable]
|
||||
public FireHorn() : base( 0xFC7 )
|
||||
{
|
||||
ItemID = Utility.RandomList( 0x10E0, 0x10F4 );
|
||||
Hue = 0x4A1;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public FireHorn( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
private bool CheckUse( Mobile from )
|
||||
{
|
||||
if ( !this.IsAccessibleTo( from ) )
|
||||
return false;
|
||||
|
||||
if ( from.Map != this.Map || !from.InRange( GetWorldLocation(), 2 ) )
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( !from.CanBeginAction( typeof( FireHorn ) ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049615 ); // You must take a moment to catch your breath.
|
||||
return false;
|
||||
}
|
||||
|
||||
int sulfAsh = 15;
|
||||
if ( from.Backpack == null || from.Backpack.GetAmount( typeof( SulfurousAsh ) ) < sulfAsh )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049617 ); // You do not have enough sulfurous ash.
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( CheckUse( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049620 ); // Select an area to incinerate.
|
||||
from.Target = new InternalTarget( this );
|
||||
}
|
||||
}
|
||||
|
||||
public void Use( Mobile from, IPoint3D loc )
|
||||
{
|
||||
if ( !CheckUse( from ) )
|
||||
return;
|
||||
|
||||
from.BeginAction( typeof( FireHorn ) );
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 12.0 ), new TimerStateCallback( EndAction ), from );
|
||||
|
||||
int music = from.Skills[SkillName.Musicianship].Fixed;
|
||||
|
||||
int sucChance = 500 + ( music - 775 ) * 2;
|
||||
double dSucChance = ((double)sucChance) / 1000.0;
|
||||
|
||||
if ( !from.CheckSkill( SkillName.Musicianship, dSucChance ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049618 ); // The horn emits a pathetic squeak.
|
||||
from.PlaySound( 0x18A );
|
||||
return;
|
||||
}
|
||||
|
||||
int sulfAsh = 15;
|
||||
from.Backpack.ConsumeUpTo( typeof( SulfurousAsh ), sulfAsh );
|
||||
|
||||
from.PlaySound( 0x15F );
|
||||
Effects.SendPacket( from, from.Map, new HuedEffect( EffectType.Moving, from.Serial, Serial.Zero, 0x36D4, from.Location, loc, 5, 0, false, true, 0, 0 ) );
|
||||
|
||||
ArrayList targets = new ArrayList();
|
||||
bool playerVsPlayer = false;
|
||||
|
||||
IPooledEnumerable eable = from.Map.GetMobilesInRange( new Point3D( loc ), 2 );
|
||||
|
||||
foreach ( Mobile m in eable )
|
||||
{
|
||||
if ( from != m && SpellHelper.ValidIndirectTarget( from, m ) && from.CanBeHarmful( m, false ) )
|
||||
{
|
||||
targets.Add( m );
|
||||
|
||||
if ( m.Player )
|
||||
playerVsPlayer = true;
|
||||
}
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
|
||||
if ( targets.Count > 0 )
|
||||
{
|
||||
int prov = from.Skills[SkillName.Provocation].Fixed;
|
||||
int disc = from.Skills[SkillName.Discordance].Fixed;
|
||||
int peace = from.Skills[SkillName.Peacemaking].Fixed;
|
||||
|
||||
int minDamage, maxDamage;
|
||||
|
||||
int total = prov + disc / 5 + peace / 5;
|
||||
|
||||
if ( playerVsPlayer )
|
||||
total /= 3;
|
||||
|
||||
maxDamage = ( total * 2 ) / 30;
|
||||
minDamage = ( maxDamage * 7 ) / 10;
|
||||
|
||||
double damage = Utility.RandomMinMax( minDamage, maxDamage );
|
||||
|
||||
damage /= targets.Count;
|
||||
|
||||
for ( int i = 0; i < targets.Count; ++i )
|
||||
{
|
||||
Mobile m = (Mobile)targets[i];
|
||||
|
||||
double toDeal = damage;
|
||||
|
||||
if ( m.CheckSkill( SkillName.MagicResist, 0.0, 120.0 ) )
|
||||
{
|
||||
toDeal *= 0.5;
|
||||
m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
|
||||
}
|
||||
|
||||
from.DoHarmful( m );
|
||||
SpellHelper.Damage( TimeSpan.Zero, m, from, toDeal );
|
||||
|
||||
Effects.SendTargetEffect( m, 0x3709, 10, 30 );
|
||||
}
|
||||
}
|
||||
|
||||
double breakChance = 0.16;
|
||||
if ( Utility.RandomDouble() < breakChance )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049619 ); // The fire horn crumbles in your hands.
|
||||
this.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
private static void EndAction( object state )
|
||||
{
|
||||
Mobile m = (Mobile) state;
|
||||
|
||||
m.EndAction( typeof( FireHorn ) );
|
||||
m.SendLocalizedMessage( 1049621 ); // You catch your breath.
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private FireHorn m_Horn;
|
||||
|
||||
public InternalTarget( FireHorn horn ) : base( 2, true, TargetFlags.Harmful )
|
||||
{
|
||||
m_Horn = horn;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Horn.Deleted )
|
||||
return;
|
||||
|
||||
IPoint3D loc;
|
||||
if ( targeted is Item )
|
||||
loc = ((Item)targeted).GetWorldLocation();
|
||||
else
|
||||
loc = targeted as IPoint3D;
|
||||
|
||||
m_Horn.Use( from, loc );
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AgilityPotion : BaseAgilityPotion
|
||||
{
|
||||
public override int DexOffset{ get{ return 10; } }
|
||||
public override TimeSpan Duration{ get{ return TimeSpan.FromMinutes( 2.0 ); } }
|
||||
|
||||
[Constructable]
|
||||
public AgilityPotion() : base( PotionEffect.Agility )
|
||||
{
|
||||
}
|
||||
|
||||
public AgilityPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseAgilityPotion : BasePotion
|
||||
{
|
||||
public abstract int DexOffset{ get; }
|
||||
public abstract TimeSpan Duration{ get; }
|
||||
|
||||
public BaseAgilityPotion( PotionEffect effect ) : base( 0xF08, effect )
|
||||
{
|
||||
}
|
||||
|
||||
public BaseAgilityPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public bool DoAgility( Mobile from )
|
||||
{
|
||||
// TODO: Verify scaled; is it offset, duration, or both?
|
||||
if ( Spells.SpellHelper.AddStatOffset( from, StatType.Dex, Scale( from, DexOffset ), Duration ) )
|
||||
{
|
||||
from.FixedEffect( 0x375A, 10, 15 );
|
||||
from.PlaySound( 0x1E7 );
|
||||
return true;
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage( 502173 ); // You are already under a similar effect.
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Drink( Mobile from )
|
||||
{
|
||||
if ( DoAgility( from ) )
|
||||
{
|
||||
BasePotion.PlayDrinkEffect( from );
|
||||
|
||||
this.Consume();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GreaterAgilityPotion : BaseAgilityPotion
|
||||
{
|
||||
public override int DexOffset{ get{ return 20; } }
|
||||
public override TimeSpan Duration{ get{ return TimeSpan.FromMinutes( 2.0 ); } }
|
||||
|
||||
[Constructable]
|
||||
public GreaterAgilityPotion() : base( PotionEffect.AgilityGreater )
|
||||
{
|
||||
}
|
||||
|
||||
public GreaterAgilityPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
235
Scripts/Items/Skill Items/Potions/BasePotion.cs
Normal file
235
Scripts/Items/Skill Items/Potions/BasePotion.cs
Normal file
|
|
@ -0,0 +1,235 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum PotionEffect
|
||||
{
|
||||
Nightsight,
|
||||
CureLesser,
|
||||
Cure,
|
||||
CureGreater,
|
||||
Agility,
|
||||
AgilityGreater,
|
||||
Strength,
|
||||
StrengthGreater,
|
||||
PoisonLesser,
|
||||
Poison,
|
||||
PoisonGreater,
|
||||
PoisonDeadly,
|
||||
Refresh,
|
||||
RefreshTotal,
|
||||
HealLesser,
|
||||
Heal,
|
||||
HealGreater,
|
||||
ExplosionLesser,
|
||||
Explosion,
|
||||
ExplosionGreater,
|
||||
InvisibilityWeak,
|
||||
Invisibility,
|
||||
InvisibilityStrong,
|
||||
VigorWeak,
|
||||
Vigor,
|
||||
VigorStrong,
|
||||
ManaWeak,
|
||||
Mana,
|
||||
ManaStrong
|
||||
}
|
||||
|
||||
public abstract class BasePotion : Item, ICraftable
|
||||
{
|
||||
private PotionEffect m_PotionEffect;
|
||||
|
||||
public PotionEffect PotionEffect
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_PotionEffect;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_PotionEffect = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public override int LabelNumber{ get{ return 1041314 + (int)m_PotionEffect; } }
|
||||
|
||||
public BasePotion( int itemID, PotionEffect effect ) : base( itemID )
|
||||
{
|
||||
m_PotionEffect = effect;
|
||||
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public BasePotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public virtual bool RequireFreeHand{ get{ return Server.Misc.Settings.CannotDrinkPotionsWhileHoldingThings(); } }
|
||||
|
||||
public static bool HasFreeHand( Mobile m )
|
||||
{
|
||||
Item handOne = m.FindItemOnLayer( Layer.OneHanded );
|
||||
Item handTwo = m.FindItemOnLayer( Layer.TwoHanded );
|
||||
|
||||
if ( handTwo is BaseWeapon )
|
||||
handOne = handTwo;
|
||||
|
||||
return ( handOne == null || handTwo == null );
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !Movable )
|
||||
return;
|
||||
|
||||
if ( from.InRange( this.GetWorldLocation(), 1 ) )
|
||||
{
|
||||
if (!RequireFreeHand || HasFreeHand(from))
|
||||
{
|
||||
if (this is BaseExplosionPotion && Amount > 1)
|
||||
{
|
||||
BasePotion pot = (BasePotion)Activator.CreateInstance(this.GetType());
|
||||
|
||||
if (pot != null)
|
||||
{
|
||||
Amount--;
|
||||
|
||||
if (from.Backpack != null && !from.Backpack.Deleted)
|
||||
{
|
||||
from.Backpack.DropItem(pot);
|
||||
}
|
||||
else
|
||||
{
|
||||
pot.MoveToWorld(from.Location, from.Map);
|
||||
}
|
||||
pot.Drink( from );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Drink( from );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(502172); // You must have a free hand to drink a potion.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 502138 ); // That is too far away for you to use
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( (int) m_PotionEffect );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
case 0:
|
||||
{
|
||||
m_PotionEffect = (PotionEffect)reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( version == 0 )
|
||||
Stackable = false;
|
||||
}
|
||||
|
||||
public abstract void Drink( Mobile from );
|
||||
|
||||
public static void PlayDrinkEffect( Mobile m )
|
||||
{
|
||||
m.RevealingAction();
|
||||
|
||||
m.PlaySound( 0x2D6 );
|
||||
|
||||
m.AddToBackpack( new Bottle() );
|
||||
|
||||
if ( m.Body.IsHuman && !m.Mounted )
|
||||
m.Animate( 34, 5, 1, true, false, 0 );
|
||||
}
|
||||
|
||||
public static TimeSpan Scale( Mobile m, TimeSpan v )
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
public static double Scale( Mobile m, double v )
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
public static int Scale( Mobile m, int v )
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
public override bool StackWith( Mobile from, Item dropped, bool playSound )
|
||||
{
|
||||
if( dropped is BasePotion && ((BasePotion)dropped).m_PotionEffect == m_PotionEffect )
|
||||
return base.StackWith( from, dropped, playSound );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#region ICraftable Members
|
||||
|
||||
public int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue )
|
||||
{
|
||||
if ( craftSystem is DefAlchemy )
|
||||
{
|
||||
Container pack = from.Backpack;
|
||||
|
||||
if ( pack != null )
|
||||
{
|
||||
List<PotionKeg> kegs = pack.FindItemsByType<PotionKeg>();
|
||||
|
||||
for ( int i = 0; i < kegs.Count; ++i )
|
||||
{
|
||||
PotionKeg keg = kegs[i];
|
||||
|
||||
if ( keg == null )
|
||||
continue;
|
||||
|
||||
if ( keg.Held <= 0 || keg.Held >= 100 )
|
||||
continue;
|
||||
|
||||
if ( keg.Type != PotionEffect )
|
||||
continue;
|
||||
|
||||
++keg.Held;
|
||||
|
||||
Consume();
|
||||
from.AddToBackpack( new Bottle() );
|
||||
|
||||
return -1; // signal placed in keg
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
104
Scripts/Items/Skill Items/Potions/Cure Potions/BaseCurePotion.cs
Normal file
104
Scripts/Items/Skill Items/Potions/Cure Potions/BaseCurePotion.cs
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CureLevelInfo
|
||||
{
|
||||
private Poison m_Poison;
|
||||
private double m_Chance;
|
||||
|
||||
public Poison Poison
|
||||
{
|
||||
get{ return m_Poison; }
|
||||
}
|
||||
|
||||
public double Chance
|
||||
{
|
||||
get{ return m_Chance; }
|
||||
}
|
||||
|
||||
public CureLevelInfo( Poison poison, double chance )
|
||||
{
|
||||
m_Poison = poison;
|
||||
m_Chance = chance;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class BaseCurePotion : BasePotion
|
||||
{
|
||||
public abstract CureLevelInfo[] LevelInfo{ get; }
|
||||
|
||||
public BaseCurePotion( PotionEffect effect ) : base( 0xF07, effect )
|
||||
{
|
||||
}
|
||||
|
||||
public BaseCurePotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public void DoCure( Mobile from )
|
||||
{
|
||||
bool cure = false;
|
||||
|
||||
CureLevelInfo[] info = LevelInfo;
|
||||
|
||||
for ( int i = 0; i < info.Length; ++i )
|
||||
{
|
||||
CureLevelInfo li = info[i];
|
||||
|
||||
if ( li.Poison == from.Poison && Scale( from, li.Chance ) > Utility.RandomDouble() )
|
||||
{
|
||||
cure = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( cure && from.CurePoison( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 500231 ); // You feel cured of poison!
|
||||
|
||||
from.FixedEffect( 0x373A, 10, 15 );
|
||||
from.PlaySound( 0x1E0 );
|
||||
}
|
||||
else if ( !cure )
|
||||
{
|
||||
from.SendLocalizedMessage( 500232 ); // That potion was not strong enough to cure your ailment!
|
||||
}
|
||||
}
|
||||
|
||||
public override void Drink( Mobile from )
|
||||
{
|
||||
if ( from.Poisoned )
|
||||
{
|
||||
DoCure( from );
|
||||
|
||||
BasePotion.PlayDrinkEffect( from );
|
||||
|
||||
from.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist );
|
||||
from.PlaySound( 0x1E0 );
|
||||
|
||||
this.Consume();
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042000 ); // You are not poisoned.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Scripts/Items/Skill Items/Potions/Cure Potions/CurePotion.cs
Normal file
41
Scripts/Items/Skill Items/Potions/Cure Potions/CurePotion.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CurePotion : BaseCurePotion
|
||||
{
|
||||
private static CureLevelInfo[] m_OldLevelInfo = new CureLevelInfo[]
|
||||
{
|
||||
new CureLevelInfo( Poison.Lesser, 1.00 ), // 100% chance to cure lesser poison
|
||||
new CureLevelInfo( Poison.Regular, 0.75 ), // 75% chance to cure regular poison
|
||||
new CureLevelInfo( Poison.Greater, 0.50 ), // 50% chance to cure greater poison
|
||||
new CureLevelInfo( Poison.Deadly, 0.15 ) // 15% chance to cure deadly poison
|
||||
};
|
||||
|
||||
public override CureLevelInfo[] LevelInfo{ get{ return m_OldLevelInfo; } }
|
||||
|
||||
[Constructable]
|
||||
public CurePotion() : base( PotionEffect.Cure )
|
||||
{
|
||||
}
|
||||
|
||||
public CurePotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GreaterCurePotion : BaseCurePotion
|
||||
{
|
||||
private static CureLevelInfo[] m_OldLevelInfo = new CureLevelInfo[]
|
||||
{
|
||||
new CureLevelInfo( Poison.Lesser, 1.00 ), // 100% chance to cure lesser poison
|
||||
new CureLevelInfo( Poison.Regular, 1.00 ), // 100% chance to cure regular poison
|
||||
new CureLevelInfo( Poison.Greater, 1.00 ), // 100% chance to cure greater poison
|
||||
new CureLevelInfo( Poison.Deadly, 0.75 ), // 75% chance to cure deadly poison
|
||||
new CureLevelInfo( Poison.Lethal, 0.25 ) // 25% chance to cure lethal poison
|
||||
};
|
||||
|
||||
public override CureLevelInfo[] LevelInfo{ get{ return m_OldLevelInfo; } }
|
||||
|
||||
[Constructable]
|
||||
public GreaterCurePotion() : base( PotionEffect.CureGreater )
|
||||
{
|
||||
}
|
||||
|
||||
public GreaterCurePotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LesserCurePotion : BaseCurePotion
|
||||
{
|
||||
private static CureLevelInfo[] m_OldLevelInfo = new CureLevelInfo[]
|
||||
{
|
||||
new CureLevelInfo( Poison.Lesser, 0.75 ), // 75% chance to cure lesser poison
|
||||
new CureLevelInfo( Poison.Regular, 0.50 ), // 50% chance to cure regular poison
|
||||
new CureLevelInfo( Poison.Greater, 0.15 ) // 15% chance to cure greater poison
|
||||
};
|
||||
|
||||
public override CureLevelInfo[] LevelInfo{ get{ return m_OldLevelInfo; } }
|
||||
|
||||
[Constructable]
|
||||
public LesserCurePotion() : base( PotionEffect.CureLesser )
|
||||
{
|
||||
}
|
||||
|
||||
public LesserCurePotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,296 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
using Server.Spells;
|
||||
using Server.Misc;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseExplosionPotion : BasePotion
|
||||
{
|
||||
public abstract int MinDamage { get; }
|
||||
public abstract int MaxDamage { get; }
|
||||
|
||||
public override bool RequireFreeHand{ get{ return false; } }
|
||||
|
||||
private static bool LeveledExplosion = false; // Should explosion potions explode other nearby potions?
|
||||
private static bool InstantExplosion = false; // Should explosion potions explode on impact?
|
||||
private static bool RelativeLocation = false; // Is the explosion target location relative for mobiles?
|
||||
private const int ExplosionRange = 2; // How long is the blast radius?
|
||||
|
||||
public BaseExplosionPotion( PotionEffect effect ) : base( 0xF0D, effect )
|
||||
{
|
||||
}
|
||||
|
||||
public BaseExplosionPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public virtual object FindParent( Mobile from )
|
||||
{
|
||||
Mobile m = this.HeldBy;
|
||||
|
||||
if ( m != null && m.Holding == this )
|
||||
return m;
|
||||
|
||||
object obj = this.RootParent;
|
||||
|
||||
if ( obj != null )
|
||||
return obj;
|
||||
|
||||
if ( Map == Map.Internal )
|
||||
return from;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
private Timer m_Timer;
|
||||
|
||||
private ArrayList m_Users;
|
||||
|
||||
public override void Drink( Mobile from )
|
||||
{
|
||||
ThrowTarget targ = from.Target as ThrowTarget;
|
||||
this.Stackable = false; // Scavenged explosion potions won't stack with those ones in backpack, and still will explode.
|
||||
|
||||
if ( targ != null && targ.Potion == this )
|
||||
return;
|
||||
|
||||
from.RevealingAction();
|
||||
|
||||
if ( m_Users == null )
|
||||
m_Users = new ArrayList();
|
||||
|
||||
if ( !m_Users.Contains( from ) )
|
||||
m_Users.Add( from );
|
||||
|
||||
from.Target = new ThrowTarget( this );
|
||||
|
||||
if ( m_Timer == null )
|
||||
{
|
||||
from.SendLocalizedMessage( 500236 ); // You should throw it now!
|
||||
|
||||
m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 0.75 ), TimeSpan.FromSeconds( 1.0 ), 4, new TimerStateCallback( Detonate_OnTick ), new object[]{ from, 3 } ); // 2.6 seconds explosion delay
|
||||
}
|
||||
}
|
||||
|
||||
private void Detonate_OnTick( object state )
|
||||
{
|
||||
if ( Deleted )
|
||||
return;
|
||||
|
||||
object[] states = (object[])state;
|
||||
Mobile from = (Mobile)states[0];
|
||||
int timer = (int)states[1];
|
||||
|
||||
object parent = FindParent( from );
|
||||
|
||||
if ( timer == 0 )
|
||||
{
|
||||
Point3D loc;
|
||||
Map map;
|
||||
|
||||
if ( parent is Item )
|
||||
{
|
||||
Item item = (Item)parent;
|
||||
|
||||
loc = item.GetWorldLocation();
|
||||
map = item.Map;
|
||||
}
|
||||
else if ( parent is Mobile )
|
||||
{
|
||||
Mobile m = (Mobile)parent;
|
||||
|
||||
loc = m.Location;
|
||||
map = m.Map;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Explode( from, true, loc, map );
|
||||
m_Timer = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( parent is Item )
|
||||
((Item)parent).PublicOverheadMessage( MessageType.Regular, 0x22, false, timer.ToString() );
|
||||
else if ( parent is Mobile )
|
||||
((Mobile)parent).PublicOverheadMessage( MessageType.Regular, 0x22, false, timer.ToString() );
|
||||
|
||||
states[1] = timer - 1;
|
||||
}
|
||||
}
|
||||
|
||||
private void Reposition_OnTick( object state )
|
||||
{
|
||||
if ( Deleted )
|
||||
return;
|
||||
|
||||
object[] states = (object[])state;
|
||||
Mobile from = (Mobile)states[0];
|
||||
IPoint3D p = (IPoint3D)states[1];
|
||||
Map map = (Map)states[2];
|
||||
|
||||
Point3D loc = new Point3D( p );
|
||||
|
||||
if ( InstantExplosion )
|
||||
Explode( from, true, loc, map );
|
||||
else
|
||||
MoveToWorld( loc, map );
|
||||
}
|
||||
|
||||
private class ThrowTarget : Target
|
||||
{
|
||||
private BaseExplosionPotion m_Potion;
|
||||
|
||||
public BaseExplosionPotion Potion
|
||||
{
|
||||
get{ return m_Potion; }
|
||||
}
|
||||
|
||||
public ThrowTarget( BaseExplosionPotion potion ) : base( 12, true, TargetFlags.None )
|
||||
{
|
||||
m_Potion = potion;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Potion.Deleted || m_Potion.Map == Map.Internal )
|
||||
return;
|
||||
|
||||
IPoint3D p = targeted as IPoint3D;
|
||||
|
||||
if ( p == null )
|
||||
return;
|
||||
|
||||
Map map = from.Map;
|
||||
|
||||
if ( map == null )
|
||||
return;
|
||||
|
||||
SpellHelper.GetSurfaceTop( ref p );
|
||||
|
||||
from.RevealingAction();
|
||||
|
||||
IEntity to;
|
||||
|
||||
to = new Entity( Serial.Zero, new Point3D( p ), map );
|
||||
|
||||
if( p is Mobile )
|
||||
{
|
||||
if( !RelativeLocation ) // explosion location = current mob location.
|
||||
p = ((Mobile)p).Location;
|
||||
else
|
||||
to = (Mobile)p;
|
||||
}
|
||||
|
||||
Effects.SendMovingEffect( from, to, m_Potion.ItemID, 7, 0, false, false, m_Potion.Hue, 0 );
|
||||
|
||||
if( m_Potion.Amount > 1 )
|
||||
{
|
||||
Mobile.LiftItemDupe( m_Potion, 1 );
|
||||
}
|
||||
|
||||
m_Potion.Internalize();
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( m_Potion.Reposition_OnTick ), new object[]{ from, p, map } );
|
||||
}
|
||||
}
|
||||
|
||||
public void Explode( Mobile from, bool direct, Point3D loc, Map map )
|
||||
{
|
||||
if ( Deleted )
|
||||
return;
|
||||
|
||||
Consume();
|
||||
|
||||
for ( int i = 0; m_Users != null && i < m_Users.Count; ++i )
|
||||
{
|
||||
Mobile m = (Mobile)m_Users[i];
|
||||
ThrowTarget targ = m.Target as ThrowTarget;
|
||||
|
||||
if ( targ != null && targ.Potion == this )
|
||||
Target.Cancel( m );
|
||||
}
|
||||
|
||||
if ( map == null )
|
||||
return;
|
||||
|
||||
Effects.PlaySound(loc, map, 0x307);
|
||||
|
||||
Effects.SendLocationEffect(loc, map, 0x36B0, 9, 10, 0, 0);
|
||||
int alchemyBonus = 0;
|
||||
|
||||
if ( direct )
|
||||
alchemyBonus = (int)(Server.Misc.SkillCheck.TradeSkill( from, Trades.Alchemy, false ) / 10);
|
||||
|
||||
IPooledEnumerable eable = LeveledExplosion ? map.GetObjectsInRange( loc, ExplosionRange ) : map.GetMobilesInRange( loc, ExplosionRange );
|
||||
ArrayList toExplode = new ArrayList();
|
||||
|
||||
int toDamage = 0;
|
||||
|
||||
foreach ( object o in eable )
|
||||
{
|
||||
if ( o is Mobile && (from == null || (SpellHelper.ValidIndirectTarget( from, (Mobile)o ) && from.CanBeHarmful( (Mobile)o, false ))))
|
||||
{
|
||||
toExplode.Add( o );
|
||||
++toDamage;
|
||||
}
|
||||
else if ( o is BaseExplosionPotion && o != this )
|
||||
{
|
||||
toExplode.Add( o );
|
||||
}
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
|
||||
int min = Scale( from, MinDamage );
|
||||
int max = Scale( from, MaxDamage );
|
||||
|
||||
for ( int i = 0; i < toExplode.Count; ++i )
|
||||
{
|
||||
object o = toExplode[i];
|
||||
|
||||
if ( o is Mobile )
|
||||
{
|
||||
Mobile m = (Mobile)o;
|
||||
|
||||
if ( from != null )
|
||||
from.DoHarmful( m );
|
||||
|
||||
int damage = Utility.RandomMinMax( min, max );
|
||||
|
||||
damage += alchemyBonus;
|
||||
|
||||
if ( damage > 40 )
|
||||
damage = 40;
|
||||
|
||||
Ultima.Damage( m, from, damage );
|
||||
}
|
||||
else if ( o is BaseExplosionPotion )
|
||||
{
|
||||
BaseExplosionPotion pot = (BaseExplosionPotion)o;
|
||||
|
||||
pot.Explode( from, false, pot.GetWorldLocation(), pot.Map );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ExplosionPotion : BaseExplosionPotion
|
||||
{
|
||||
public override int MinDamage { get { return 10; } }
|
||||
public override int MaxDamage { get { return 20; } }
|
||||
|
||||
[Constructable]
|
||||
public ExplosionPotion() : base( PotionEffect.Explosion )
|
||||
{
|
||||
}
|
||||
|
||||
public ExplosionPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GreaterExplosionPotion : BaseExplosionPotion
|
||||
{
|
||||
public override int MinDamage { get { return 15; } }
|
||||
public override int MaxDamage { get { return 30; } }
|
||||
|
||||
[Constructable]
|
||||
public GreaterExplosionPotion() : base( PotionEffect.ExplosionGreater )
|
||||
{
|
||||
}
|
||||
|
||||
public GreaterExplosionPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LesserExplosionPotion : BaseExplosionPotion
|
||||
{
|
||||
public override int MinDamage { get { return 5; } }
|
||||
public override int MaxDamage { get { return 10; } }
|
||||
|
||||
[Constructable]
|
||||
public LesserExplosionPotion() : base( PotionEffect.ExplosionLesser )
|
||||
{
|
||||
}
|
||||
|
||||
public LesserExplosionPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseHealPotion : BasePotion
|
||||
{
|
||||
public abstract int MinHeal { get; }
|
||||
public abstract int MaxHeal { get; }
|
||||
public abstract double Delay { get; }
|
||||
|
||||
public BaseHealPotion( PotionEffect effect ) : base( 0xF0C, effect )
|
||||
{
|
||||
}
|
||||
|
||||
public BaseHealPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public void DoHeal( Mobile from )
|
||||
{
|
||||
int min = Scale( from, MinHeal );
|
||||
int max = Scale( from, MaxHeal );
|
||||
|
||||
int heal = Utility.RandomMinMax( min, max );
|
||||
if ( from is PlayerMobile ){ heal = (int)(heal * Server.Misc.Settings.HitPoints()); }
|
||||
|
||||
from.Heal( heal );
|
||||
}
|
||||
|
||||
public override void Drink( Mobile from )
|
||||
{
|
||||
if ( from.Hits < from.HitsMax )
|
||||
{
|
||||
if ( from.Poisoned )
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x22, 1005000 ); // You can not heal yourself in your current state.
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( from.BeginAction( typeof( BaseHealPotion ) ) )
|
||||
{
|
||||
DoHeal( from );
|
||||
|
||||
BasePotion.PlayDrinkEffect( from );
|
||||
|
||||
this.Consume();
|
||||
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( Delay ), new TimerStateCallback( ReleaseHealLock ), from );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x22, 500235 ); // You must wait 10 seconds before using another healing potion.
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1049547 ); // You decide against drinking this potion, as you are already at full health.
|
||||
}
|
||||
}
|
||||
|
||||
private static void ReleaseHealLock( object state )
|
||||
{
|
||||
((Mobile)state).EndAction( typeof( BaseHealPotion ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GreaterHealPotion : BaseHealPotion
|
||||
{
|
||||
public override int MinHeal { get { return 9; } }
|
||||
public override int MaxHeal { get { return 30; } }
|
||||
public override double Delay{ get{ return 10.0; } }
|
||||
|
||||
[Constructable]
|
||||
public GreaterHealPotion() : base( PotionEffect.HealGreater )
|
||||
{
|
||||
}
|
||||
|
||||
public GreaterHealPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
35
Scripts/Items/Skill Items/Potions/Heal Potions/HealPotion.cs
Normal file
35
Scripts/Items/Skill Items/Potions/Heal Potions/HealPotion.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class HealPotion : BaseHealPotion
|
||||
{
|
||||
public override int MinHeal { get { return 6; } }
|
||||
public override int MaxHeal { get { return 20; } }
|
||||
public override double Delay{ get{ return 10.0; } }
|
||||
|
||||
[Constructable]
|
||||
public HealPotion() : base( PotionEffect.Heal )
|
||||
{
|
||||
}
|
||||
|
||||
public HealPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LesserHealPotion : BaseHealPotion
|
||||
{
|
||||
public override int MinHeal { get { return 3; } }
|
||||
public override int MaxHeal { get { return 10; } }
|
||||
public override double Delay{ get{ return 10.0; } }
|
||||
|
||||
[Constructable]
|
||||
public LesserHealPotion() : base( PotionEffect.HealLesser )
|
||||
{
|
||||
}
|
||||
|
||||
public LesserHealPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
51
Scripts/Items/Skill Items/Potions/NightSight.cs
Normal file
51
Scripts/Items/Skill Items/Potions/NightSight.cs
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class NightSightPotion : BasePotion
|
||||
{
|
||||
[Constructable]
|
||||
public NightSightPotion() : base( 0xF06, PotionEffect.Nightsight )
|
||||
{
|
||||
}
|
||||
|
||||
public NightSightPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Drink( Mobile from )
|
||||
{
|
||||
if ( from.BeginAction( typeof( LightCycle ) ) )
|
||||
{
|
||||
new LightCycle.NightSightTimer( from ).Start();
|
||||
from.LightLevel = LightCycle.DungeonLevel / 2;
|
||||
|
||||
from.FixedParticles( 0x376A, 9, 32, 5007, EffectLayer.Waist );
|
||||
from.PlaySound( 0x1E3 );
|
||||
|
||||
BasePotion.PlayDrinkEffect( from );
|
||||
|
||||
this.Consume();
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( "You already have nightsight." );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BasePoisonPotion : BasePotion
|
||||
{
|
||||
public abstract Poison Poison{ get; }
|
||||
|
||||
public abstract double MinPoisoningSkill{ get; }
|
||||
public abstract double MaxPoisoningSkill{ get; }
|
||||
|
||||
public BasePoisonPotion( PotionEffect effect ) : base( 0xF0A, effect )
|
||||
{
|
||||
}
|
||||
|
||||
public BasePoisonPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public void DoPoison( Mobile from )
|
||||
{
|
||||
from.ApplyPoison( from, Poison );
|
||||
}
|
||||
|
||||
public override void Drink( Mobile from )
|
||||
{
|
||||
DoPoison( from );
|
||||
|
||||
BasePotion.PlayDrinkEffect( from );
|
||||
|
||||
this.Consume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DeadlyPoisonPotion : BasePoisonPotion
|
||||
{
|
||||
public override Poison Poison{ get{ return Poison.Deadly; } }
|
||||
|
||||
public override double MinPoisoningSkill{ get{ return 95.0; } }
|
||||
public override double MaxPoisoningSkill{ get{ return 100.0; } }
|
||||
|
||||
[Constructable]
|
||||
public DeadlyPoisonPotion() : base( PotionEffect.PoisonDeadly )
|
||||
{
|
||||
}
|
||||
|
||||
public DeadlyPoisonPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GreaterPoisonPotion : BasePoisonPotion
|
||||
{
|
||||
public override Poison Poison{ get{ return Poison.Greater; } }
|
||||
|
||||
public override double MinPoisoningSkill{ get{ return 60.0; } }
|
||||
public override double MaxPoisoningSkill{ get{ return 100.0; } }
|
||||
|
||||
[Constructable]
|
||||
public GreaterPoisonPotion() : base( PotionEffect.PoisonGreater )
|
||||
{
|
||||
}
|
||||
|
||||
public GreaterPoisonPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LesserPoisonPotion : BasePoisonPotion
|
||||
{
|
||||
public override Poison Poison{ get{ return Poison.Lesser; } }
|
||||
|
||||
public override double MinPoisoningSkill{ get{ return 0.0; } }
|
||||
public override double MaxPoisoningSkill{ get{ return 60.0; } }
|
||||
|
||||
[Constructable]
|
||||
public LesserPoisonPotion() : base( PotionEffect.PoisonLesser )
|
||||
{
|
||||
}
|
||||
|
||||
public LesserPoisonPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class PoisonPotion : BasePoisonPotion
|
||||
{
|
||||
public override Poison Poison{ get{ return Poison.Regular; } }
|
||||
|
||||
public override double MinPoisoningSkill{ get{ return 30.0; } }
|
||||
public override double MaxPoisoningSkill{ get{ return 70.0; } }
|
||||
|
||||
[Constructable]
|
||||
public PoisonPotion() : base( PotionEffect.Poison )
|
||||
{
|
||||
}
|
||||
|
||||
public PoisonPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseRefreshPotion : BasePotion
|
||||
{
|
||||
public abstract double Refresh{ get; }
|
||||
|
||||
public BaseRefreshPotion( PotionEffect effect ) : base( 0xF0B, effect )
|
||||
{
|
||||
}
|
||||
|
||||
public BaseRefreshPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Drink( Mobile from )
|
||||
{
|
||||
if ( from.Stam < from.StamMax )
|
||||
{
|
||||
from.Stam += Scale( from, (int)(Refresh * from.StamMax) );
|
||||
|
||||
BasePotion.PlayDrinkEffect( from );
|
||||
|
||||
this.Consume();
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( "You decide against drinking this potion, as you are already at full stamina." );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RefreshPotion : BaseRefreshPotion
|
||||
{
|
||||
public override double Refresh{ get{ return 0.25; } }
|
||||
|
||||
[Constructable]
|
||||
public RefreshPotion() : base( PotionEffect.Refresh )
|
||||
{
|
||||
}
|
||||
|
||||
public RefreshPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class TotalRefreshPotion : BaseRefreshPotion
|
||||
{
|
||||
public override double Refresh{ get{ return 1.0; } }
|
||||
|
||||
[Constructable]
|
||||
public TotalRefreshPotion() : base( PotionEffect.RefreshTotal )
|
||||
{
|
||||
}
|
||||
|
||||
public TotalRefreshPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseStrengthPotion : BasePotion
|
||||
{
|
||||
public abstract int StrOffset{ get; }
|
||||
public abstract TimeSpan Duration{ get; }
|
||||
|
||||
public BaseStrengthPotion( PotionEffect effect ) : base( 0xF09, effect )
|
||||
{
|
||||
}
|
||||
|
||||
public BaseStrengthPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public bool DoStrength( Mobile from )
|
||||
{
|
||||
// TODO: Verify scaled; is it offset, duration, or both?
|
||||
if ( Spells.SpellHelper.AddStatOffset( from, StatType.Str, Scale( from, StrOffset ), Duration ) )
|
||||
{
|
||||
from.FixedEffect( 0x375A, 10, 15 );
|
||||
from.PlaySound( 0x1E7 );
|
||||
return true;
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage( 502173 ); // You are already under a similar effect.
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Drink( Mobile from )
|
||||
{
|
||||
if ( DoStrength( from ) )
|
||||
{
|
||||
BasePotion.PlayDrinkEffect( from );
|
||||
|
||||
this.Consume();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GreaterStrengthPotion : BaseStrengthPotion
|
||||
{
|
||||
public override int StrOffset{ get{ return 20; } }
|
||||
public override TimeSpan Duration{ get{ return TimeSpan.FromMinutes( 2.0 ); } }
|
||||
|
||||
[Constructable]
|
||||
public GreaterStrengthPotion() : base( PotionEffect.StrengthGreater )
|
||||
{
|
||||
}
|
||||
|
||||
public GreaterStrengthPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class StrengthPotion : BaseStrengthPotion
|
||||
{
|
||||
public override int StrOffset{ get{ return 10; } }
|
||||
public override TimeSpan Duration{ get{ return TimeSpan.FromMinutes( 2.0 ); } }
|
||||
|
||||
[Constructable]
|
||||
public StrengthPotion() : base( PotionEffect.Strength )
|
||||
{
|
||||
}
|
||||
|
||||
public StrengthPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
32
Scripts/Items/Skill Items/Tailor Items/Dressform.cs
Normal file
32
Scripts/Items/Skill Items/Tailor Items/Dressform.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0xec6, 0xec7)]
|
||||
public class Dressform : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Dressform() : base(0xec6)
|
||||
{
|
||||
Weight = 10;
|
||||
}
|
||||
|
||||
public Dressform(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int) 0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
291
Scripts/Items/Skill Items/Tailor Items/DyeTub.cs
Normal file
291
Scripts/Items/Skill Items/Tailor Items/DyeTub.cs
Normal file
|
|
@ -0,0 +1,291 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Multis;
|
||||
using Server.Targeting;
|
||||
using Server.ContextMenus;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public interface IDyable
|
||||
{
|
||||
bool Dye( Mobile from, DyeTub sender );
|
||||
}
|
||||
|
||||
public class DyeTub : Item, ISecurable
|
||||
{
|
||||
private bool m_Redyable;
|
||||
private int m_DyedHue;
|
||||
private SecureLevel m_SecureLevel;
|
||||
|
||||
public virtual bool AllowFurniture
|
||||
{
|
||||
get{ return false; }
|
||||
}
|
||||
|
||||
public virtual bool AllowLeather
|
||||
{
|
||||
get{ return false; }
|
||||
}
|
||||
|
||||
public virtual bool AllowMetal
|
||||
{
|
||||
get{ return false; }
|
||||
}
|
||||
|
||||
public virtual bool AllowWood
|
||||
{
|
||||
get{ return false; }
|
||||
}
|
||||
|
||||
public virtual bool AllowDyables
|
||||
{
|
||||
get{ return true; }
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( (int)m_SecureLevel );
|
||||
writer.Write( (bool) m_Redyable );
|
||||
writer.Write( (int) m_DyedHue );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_SecureLevel = (SecureLevel)reader.ReadInt();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_Redyable = reader.ReadBool();
|
||||
m_DyedHue = reader.ReadInt();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool Redyable
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Redyable;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Redyable = value;
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int DyedHue
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_DyedHue;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ( m_Redyable )
|
||||
{
|
||||
m_DyedHue = value;
|
||||
Hue = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public SecureLevel Level
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_SecureLevel;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_SecureLevel = value;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DyeTub() : base( 0xFAB )
|
||||
{
|
||||
Weight = 10.0;
|
||||
m_Redyable = true;
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
|
||||
{
|
||||
base.GetContextMenuEntries( from, list );
|
||||
SetSecureLevelEntry.AddTo( from, this, list );
|
||||
}
|
||||
|
||||
public DyeTub( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
// Select the clothing to dye.
|
||||
public virtual int TargetMessage{ get{ return 500859; } }
|
||||
|
||||
// You can not dye that.
|
||||
public virtual int FailMessage{ get{ return 1042083; } }
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( from.InRange( this.GetWorldLocation(), 1 ) )
|
||||
{
|
||||
from.SendLocalizedMessage( TargetMessage );
|
||||
from.Target = new InternalTarget( this );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 500446 ); // That is too far away.
|
||||
}
|
||||
}
|
||||
|
||||
public static bool alsoDyable( Item item )
|
||||
{
|
||||
if ( item is Lexicon ||
|
||||
item is Grimoire ||
|
||||
item is Journal ||
|
||||
item is Diary ||
|
||||
item is CandleShort ||
|
||||
item is CandleMedium ||
|
||||
item is CandleLong ||
|
||||
item is DyeTub )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private DyeTub m_Tub;
|
||||
|
||||
public InternalTarget( DyeTub tub ) : base( 1, false, TargetFlags.None )
|
||||
{
|
||||
m_Tub = tub;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( targeted is Item )
|
||||
{
|
||||
Item item = (Item)targeted;
|
||||
|
||||
if ( ( alsoDyable( item ) || item is IDyable ) && m_Tub.AllowDyables )
|
||||
{
|
||||
if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
|
||||
from.SendLocalizedMessage( 500446 ); // That is too far away.
|
||||
else if ( item.Parent is Mobile )
|
||||
from.SendLocalizedMessage( 500861 ); // Can't Dye clothing that is being worn.
|
||||
else if ( alsoDyable( item ) )
|
||||
{
|
||||
item.Hue = m_Tub.DyedHue;
|
||||
if ( item is DyeTub ){ ((DyeTub)item).DyedHue = item.Hue; }
|
||||
from.PlaySound( 0x23E );
|
||||
}
|
||||
else if ( ((IDyable)item).Dye( from, m_Tub ) )
|
||||
from.PlaySound( 0x23E );
|
||||
}
|
||||
else if ( (FurnitureAttribute.Check( item ) || (item is PotionKeg)) && m_Tub.AllowFurniture )
|
||||
{
|
||||
if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 500446 ); // That is too far away.
|
||||
}
|
||||
else
|
||||
{
|
||||
bool okay = ( item.IsChildOf( from.Backpack ) );
|
||||
|
||||
if ( !okay )
|
||||
{
|
||||
if ( item.Parent == null )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( item );
|
||||
|
||||
if ( house == null || ( !house.IsLockedDown( item ) && !house.IsSecure( item ) ) )
|
||||
from.SendLocalizedMessage( 501022 ); // Furniture must be locked down to paint it.
|
||||
else if ( !house.IsCoOwner( from ) )
|
||||
from.SendLocalizedMessage( 501023 ); // You must be the owner to use this item.
|
||||
else
|
||||
okay = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1048135 ); // The furniture must be in your backpack to be painted.
|
||||
}
|
||||
}
|
||||
|
||||
if ( okay )
|
||||
{
|
||||
item.Hue = m_Tub.DyedHue;
|
||||
from.PlaySound( 0x23E );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( ( item is MyTentEastAddonDeed ) || ( item is MyTentSouthAddonDeed ) )
|
||||
{
|
||||
if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 500446 ); // That is too far away.
|
||||
}
|
||||
else if ( !item.Movable )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042083 ); // You cannot dye that.
|
||||
}
|
||||
else
|
||||
{
|
||||
item.Hue = m_Tub.DyedHue;
|
||||
if ( item is MyTentEastAddonDeed ) { MyTentEastAddonDeed tent = (MyTentEastAddonDeed)item; tent.TentColor = m_Tub.DyedHue; }
|
||||
else { MyTentSouthAddonDeed tent = (MyTentSouthAddonDeed)item; tent.TentColor = m_Tub.DyedHue; }
|
||||
from.PlaySound( 0x23E );
|
||||
}
|
||||
}
|
||||
else if ( item is BaseArmor && ( (((BaseArmor)item).Resource == CraftResource.Leathered && m_Tub.AllowLeather ) || (((BaseArmor)item).Resource == CraftResource.Iron && m_Tub.AllowMetal ) || (((BaseArmor)item).Resource == CraftResource.Wooden && m_Tub.AllowWood ) ) )
|
||||
{
|
||||
if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 500446 ); // That is too far away.
|
||||
}
|
||||
else if ( !item.Movable )
|
||||
{
|
||||
from.SendLocalizedMessage( 1010093 ); // You may not dye items which are locked down.
|
||||
}
|
||||
else if ( item.Parent is Mobile )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070753 ); // You cannot dye equipped items.
|
||||
}
|
||||
else
|
||||
{
|
||||
item.Hue = m_Tub.DyedHue;
|
||||
from.PlaySound( 0x23E );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( m_Tub.FailMessage );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( m_Tub.FailMessage );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
97
Scripts/Items/Skill Items/Tailor Items/Dyes.cs
Normal file
97
Scripts/Items/Skill Items/Tailor Items/Dyes.cs
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.HuePickers;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Dyes : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Dyes() : base( 0xFA9 )
|
||||
{
|
||||
Weight = 3.0;
|
||||
}
|
||||
|
||||
public Dyes( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( Weight == 0.0 )
|
||||
Weight = 3.0;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
from.SendLocalizedMessage( 500856 ); // Select the dye tub to use the dyes on.
|
||||
from.Target = new InternalTarget();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
public InternalTarget() : base( 1, false, TargetFlags.None )
|
||||
{
|
||||
}
|
||||
|
||||
private class InternalPicker : HuePicker
|
||||
{
|
||||
private DyeTub m_Tub;
|
||||
|
||||
public InternalPicker( DyeTub tub ) : base( tub.ItemID )
|
||||
{
|
||||
m_Tub = tub;
|
||||
}
|
||||
|
||||
public override void OnResponse( int hue )
|
||||
{
|
||||
m_Tub.DyedHue = hue;
|
||||
}
|
||||
}
|
||||
|
||||
private static void SetTubHue( Mobile from, object state, int hue )
|
||||
{
|
||||
((DyeTub)state).DyedHue = hue;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( targeted is PigmentTub )
|
||||
{
|
||||
PigmentTub tub = (PigmentTub)targeted;
|
||||
|
||||
from.CloseGump( typeof( PigmentTub.PigmentGump ) );
|
||||
from.SendGump( new PigmentTub.PigmentGump( from, tub ) );
|
||||
}
|
||||
else if ( targeted is DyeTub )
|
||||
{
|
||||
DyeTub tub = (DyeTub) targeted;
|
||||
|
||||
if ( tub.Redyable )
|
||||
{
|
||||
from.SendHuePicker( new InternalPicker( tub ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( "That dye tub may not be redyed." );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 500857 ); // Use this on a dye tub.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Scripts/Items/Skill Items/Tailor Items/FurnitureDyeTub.cs
Normal file
36
Scripts/Items/Skill Items/Tailor Items/FurnitureDyeTub.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FurnitureDyeTub : DyeTub
|
||||
{
|
||||
public override bool AllowDyables{ get{ return false; } }
|
||||
public override bool AllowFurniture{ get{ return true; } }
|
||||
public override int TargetMessage{ get{ return 501019; } } // Select the furniture to dye.
|
||||
public override int FailMessage{ get{ return 501021; } } // That is not a piece of furniture.
|
||||
|
||||
[Constructable]
|
||||
public FurnitureDyeTub()
|
||||
{
|
||||
Name = "furniture paint tub";
|
||||
}
|
||||
|
||||
public FurnitureDyeTub( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
159
Scripts/Items/Skill Items/Tailor Items/PigmentTub.cs
Normal file
159
Scripts/Items/Skill Items/Tailor Items/PigmentTub.cs
Normal file
|
|
@ -0,0 +1,159 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Multis;
|
||||
using Server.Targeting;
|
||||
using Server.ContextMenus;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Misc;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class PigmentTub : DyeTub
|
||||
{
|
||||
public override bool AllowLeather{ get{ return Settings.PigmentLeather(); } }
|
||||
public override bool AllowMetal{ get{ return Settings.PigmentMetal(); } }
|
||||
public override bool AllowWood{ get{ return Settings.PigmentWood(); } }
|
||||
|
||||
public int m_Color;
|
||||
public int m_Hue;
|
||||
public int m_Category;
|
||||
|
||||
[Constructable]
|
||||
public PigmentTub()
|
||||
{
|
||||
Name = "pigment tub";
|
||||
}
|
||||
|
||||
public PigmentTub( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 1 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public static int tubCost()
|
||||
{
|
||||
int value = 1000;
|
||||
if ( Settings.PigmentLeather() )
|
||||
value = value + 1000;
|
||||
if ( Settings.PigmentMetal() )
|
||||
value = value + 1000;
|
||||
if ( Settings.PigmentWood() )
|
||||
value = value + 500;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public class PigmentGump : Gump
|
||||
{
|
||||
private PigmentTub m_Tub;
|
||||
|
||||
public PigmentGump( Mobile from, PigmentTub tub ) : base( 50, 50 )
|
||||
{
|
||||
m_Tub = tub;
|
||||
|
||||
if ( m_Tub.m_Color < 1 )
|
||||
{
|
||||
m_Tub.m_Color = 1200;
|
||||
m_Tub.m_Hue = m_Tub.m_Color+1;
|
||||
m_Tub.m_Category = 900;
|
||||
}
|
||||
|
||||
int color = m_Tub.m_Color;
|
||||
int c = 0;
|
||||
int d = 162;
|
||||
int n = 18;
|
||||
if ( m_Tub.m_Color == 1800 )
|
||||
d = 142;
|
||||
|
||||
this.Closable=true;
|
||||
this.Disposable=true;
|
||||
this.Dragable=true;
|
||||
this.Resizable=false;
|
||||
|
||||
AddPage(0);
|
||||
AddImage(0, 0, 1);
|
||||
|
||||
int x = 52;
|
||||
int y = 50;
|
||||
|
||||
while ( d > 0 )
|
||||
{
|
||||
c++;
|
||||
d--;
|
||||
if ( c >= n ){ c=1; y=y+12; x=52; }
|
||||
x=x+12;
|
||||
|
||||
if ( color == 1254 ){ color = 1300; }
|
||||
else if ( color == 1354 ){ color = 1400; }
|
||||
else if ( color == 1454 ){ color = 1500; }
|
||||
else if ( color == 1554 ){ color = 1600; }
|
||||
else if ( color == 1654 ){ color = 1700; }
|
||||
else if ( color == 1754 ){ color = 1800; }
|
||||
else if ( color == 1908 ){ color = 2400; }
|
||||
|
||||
AddButton(x, y, 2, 2, color, GumpButtonType.Reply, 0);
|
||||
AddImage(x, y, 2, color);
|
||||
|
||||
color++;
|
||||
}
|
||||
|
||||
AddItem(283, 43, 7939, m_Tub.m_Hue);
|
||||
if ( Settings.PigmentLeather() ){ AddItem(276, 71, 5075, m_Tub.m_Hue); }
|
||||
if ( Settings.PigmentMetal() ){ AddItem(291, 94, 5137, m_Tub.m_Hue); }
|
||||
if ( Settings.PigmentWood() ){ AddItem(280, 120, 7034, m_Tub.m_Hue); }
|
||||
AddItem(293, 149, 4011, m_Tub.m_Hue);
|
||||
|
||||
AddButton(280, 205, 247, 248, 0, GumpButtonType.Reply, 0);
|
||||
|
||||
int prev = m_Tub.m_Category-1; if ( prev == 899 ){ prev = 902; }
|
||||
int next = m_Tub.m_Category+1; if ( next == 903 ){ next = 900; }
|
||||
|
||||
AddButton(47, 213, 5603, 5603, prev, GumpButtonType.Reply, 0);
|
||||
AddButton(70, 213, 5601, 5601, next, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
Mobile from = sender.Mobile;
|
||||
int button = info.ButtonID;
|
||||
|
||||
if ( button == 900 )
|
||||
{
|
||||
m_Tub.m_Color = 1200;
|
||||
m_Tub.m_Category = button;
|
||||
}
|
||||
else if ( button == 901 )
|
||||
{
|
||||
m_Tub.m_Color = 1500;
|
||||
m_Tub.m_Category = button;
|
||||
}
|
||||
else if ( button == 902 )
|
||||
{
|
||||
m_Tub.m_Color = 1800;
|
||||
m_Tub.m_Category = button;
|
||||
}
|
||||
else if ( button > 1000 )
|
||||
{
|
||||
m_Tub.m_Hue = button+1;
|
||||
m_Tub.Hue = m_Tub.m_Hue;
|
||||
m_Tub.DyedHue = m_Tub.Hue;
|
||||
}
|
||||
|
||||
if ( button > 0 )
|
||||
from.SendGump( new PigmentTub.PigmentGump( from, m_Tub ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
75
Scripts/Items/Skill Items/Tailor Items/Scissors.cs
Normal file
75
Scripts/Items/Skill Items/Tailor Items/Scissors.cs
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public interface IScissorable
|
||||
{
|
||||
bool Scissor( Mobile from, Scissors scissors );
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0xf9f, 0xf9e )]
|
||||
public class Scissors : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Scissors() : base( 0xF9F )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public Scissors( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
from.SendLocalizedMessage( 502434 ); // What should I use these scissors on?
|
||||
|
||||
from.Target = new InternalTarget( this );
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private Scissors m_Item;
|
||||
|
||||
public InternalTarget( Scissors item ) : base( 2, false, TargetFlags.None )
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Item.Deleted )
|
||||
return;
|
||||
|
||||
if( targeted is IScissorable )
|
||||
{
|
||||
IScissorable obj = (IScissorable)targeted;
|
||||
|
||||
if( obj.Scissor( from, m_Item ) )
|
||||
from.PlaySound( 0x248 );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 502440 ); // Scissors can not be used on that to produce anything.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
352
Scripts/Items/Skill Items/Thief/DisguiseKit.cs
Normal file
352
Scripts/Items/Skill Items/Thief/DisguiseKit.cs
Normal file
|
|
@ -0,0 +1,352 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Spells;
|
||||
using Server.Spells.Fifth;
|
||||
using Server.Spells.Seventh;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.SkillHandlers;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DisguiseKit : Item
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041078; } } // a disguise kit
|
||||
|
||||
[Constructable]
|
||||
public DisguiseKit() : base( 0xE05 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public DisguiseKit( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public bool ValidateUse( Mobile from )
|
||||
{
|
||||
PlayerMobile pm = from as PlayerMobile;
|
||||
|
||||
if ( !IsChildOf( from.Backpack ) )
|
||||
{
|
||||
// That must be in your pack for you to use it.
|
||||
from.SendLocalizedMessage( 1042001 );
|
||||
}
|
||||
else if ( !from.CanBeginAction( typeof( IncognitoSpell ) ) )
|
||||
{
|
||||
// You cannot disguise yourself while incognitoed.
|
||||
from.SendLocalizedMessage( 501704 );
|
||||
}
|
||||
else if ( TransformationSpellHelper.UnderTransformation( from ) )
|
||||
{
|
||||
// You cannot disguise yourself while in that form.
|
||||
from.SendLocalizedMessage( 1061634 );
|
||||
}
|
||||
else if ( !from.CanBeginAction( typeof( PolymorphSpell ) ) || from.IsBodyMod )
|
||||
{
|
||||
// You cannot disguise yourself while polymorphed.
|
||||
from.SendLocalizedMessage( 501705 );
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( ValidateUse( from ) )
|
||||
from.SendGump( new DisguiseGump( from, this, true, false ) );
|
||||
}
|
||||
}
|
||||
|
||||
public class DisguiseGump : Gump
|
||||
{
|
||||
private Mobile m_From;
|
||||
private DisguiseKit m_Kit;
|
||||
private bool m_Used;
|
||||
|
||||
public DisguiseGump( Mobile from, DisguiseKit kit, bool startAtHair, bool used ) : base( 50, 50 )
|
||||
{
|
||||
m_From = from;
|
||||
m_Kit = kit;
|
||||
m_Used = used;
|
||||
|
||||
from.CloseGump( typeof( DisguiseGump ) );
|
||||
|
||||
AddPage( 0 );
|
||||
|
||||
AddBackground( 100, 10, 400, 385, 2600 );
|
||||
|
||||
// <center>THIEF DISGUISE KIT</center>
|
||||
AddHtmlLocalized( 100, 25, 400, 35, 1011045, false, false );
|
||||
|
||||
AddButton( 140, 353, 4005, 4007, 0, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 172, 355, 90, 35, 1011036, false, false ); // OKAY
|
||||
|
||||
AddButton( 257, 353, 4005, 4007, 1, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 289, 355, 90, 35, 1011046, false, false ); // APPLY
|
||||
|
||||
if ( from.Female || from.Body.IsFemale )
|
||||
{
|
||||
DrawEntries( 0, 1, -1, m_HairEntries, -1 );
|
||||
}
|
||||
else if ( startAtHair )
|
||||
{
|
||||
DrawEntries( 0, 1, 2, m_HairEntries, 1011056 );
|
||||
DrawEntries( 1, 2, 1, m_BeardEntries, 1011059 );
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawEntries( 1, 1, 2, m_BeardEntries, 1011059 );
|
||||
DrawEntries( 0, 2, 1, m_HairEntries, 1011056 );
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawEntries( int index, int page, int nextPage, DisguiseEntry[] entries, int nextNumber )
|
||||
{
|
||||
AddPage( page );
|
||||
|
||||
if ( nextPage != -1 )
|
||||
{
|
||||
AddButton( 155, 320, 250 + (index*2), 251 + (index*2), 0, GumpButtonType.Page, nextPage );
|
||||
AddHtmlLocalized( 180, 320, 150, 35, nextNumber, false, false );
|
||||
}
|
||||
|
||||
for ( int i = 0; i < entries.Length; ++i )
|
||||
{
|
||||
DisguiseEntry entry = entries[i];
|
||||
|
||||
if ( entry == null )
|
||||
continue;
|
||||
|
||||
int x = (i % 2) * 205;
|
||||
int y = (i / 2) * 55;
|
||||
|
||||
if ( entry.m_GumpID != 0 )
|
||||
{
|
||||
AddBackground( 220 + x, 60 + y, 50, 50, 2620 );
|
||||
AddImage( 153 + x + entry.m_OffsetX, 15 + y + entry.m_OffsetY, entry.m_GumpID );
|
||||
}
|
||||
|
||||
AddHtmlLocalized( 140 + x, 72 + y, 80, 35, entry.m_Number, false, false );
|
||||
AddRadio( 118 + x, 73 + y, 208, 209, false, (i * 2) + index );
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if ( info.ButtonID == 0 )
|
||||
{
|
||||
if ( m_Used )
|
||||
m_From.SendLocalizedMessage( 501706 ); // Disguises wear off after 2 hours.
|
||||
else
|
||||
m_From.SendLocalizedMessage( 501707 ); // You're looking good.
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int[] switches = info.Switches;
|
||||
|
||||
if ( switches.Length == 0 )
|
||||
return;
|
||||
|
||||
int switched = switches[0];
|
||||
int type = switched % 2;
|
||||
int index = switched / 2;
|
||||
|
||||
bool hair = ( type == 0 );
|
||||
|
||||
DisguiseEntry[] entries = ( hair ? m_HairEntries : m_BeardEntries );
|
||||
|
||||
if ( index >= 0 && index < entries.Length )
|
||||
{
|
||||
DisguiseEntry entry = entries[index];
|
||||
|
||||
if ( entry == null )
|
||||
return;
|
||||
|
||||
if ( !m_Kit.ValidateUse( m_From ) )
|
||||
return;
|
||||
|
||||
if ( !hair && (m_From.Female || m_From.Body.IsFemale) )
|
||||
return;
|
||||
|
||||
m_From.NameMod = NameList.RandomName( m_From.Female ? "female" : "male" );
|
||||
|
||||
if ( m_From is PlayerMobile )
|
||||
{
|
||||
PlayerMobile pm = (PlayerMobile)m_From;
|
||||
|
||||
if ( hair )
|
||||
pm.SetHairMods( entry.m_ItemID, -2 );
|
||||
else
|
||||
pm.SetHairMods( -2, entry.m_ItemID );
|
||||
}
|
||||
|
||||
m_From.SendGump( new DisguiseGump( m_From, m_Kit, hair, true ) );
|
||||
|
||||
DisguiseTimers.RemoveTimer( m_From );
|
||||
|
||||
DisguiseTimers.CreateTimer( m_From, TimeSpan.FromHours( 2.0 ) );
|
||||
DisguiseTimers.StartTimer( m_From );
|
||||
}
|
||||
}
|
||||
|
||||
private static DisguiseEntry[] m_HairEntries = new DisguiseEntry[]
|
||||
{
|
||||
new DisguiseEntry( 8251, 50700, 0, 5, 1011052 ), // Short
|
||||
new DisguiseEntry( 8261, 60710, 0, 3, 1011047 ), // Pageboy
|
||||
new DisguiseEntry( 8252, 60708, 0,- 5, 1011053 ), // Long
|
||||
new DisguiseEntry( 8264, 60901, 0, 5, 1011048 ), // Receding
|
||||
new DisguiseEntry( 8253, 60702, 0,- 5, 1011054 ), // Ponytail
|
||||
new DisguiseEntry( 8265, 60707, 0,- 5, 1011049 ), // 2-tails
|
||||
new DisguiseEntry( 8260, 50703, 0, 5, 1011055 ), // Mohawk
|
||||
new DisguiseEntry( 8266, 60713, 0, 10, 1011050 ), // Topknot
|
||||
null,
|
||||
new DisguiseEntry( 0, 0, 0, 0, 1011051 ) // None
|
||||
};
|
||||
|
||||
private static DisguiseEntry[] m_BeardEntries = new DisguiseEntry[]
|
||||
{
|
||||
new DisguiseEntry( 8269, 50906, 0, 0, 1011401 ), // Vandyke
|
||||
new DisguiseEntry( 8257, 50808, 0,- 2, 1011062 ), // Mustache
|
||||
new DisguiseEntry( 8255, 50802, 0, 0, 1011060 ), // Short beard
|
||||
new DisguiseEntry( 8268, 50905, 0,-10, 1011061 ), // Long beard
|
||||
new DisguiseEntry( 8267, 50904, 0, 0, 1011060 ), // Short beard
|
||||
new DisguiseEntry( 8254, 50801, 0,-10, 1011061 ), // Long beard
|
||||
null,
|
||||
new DisguiseEntry( 0, 0, 0, 0, 1011051 ) // None
|
||||
};
|
||||
|
||||
private class DisguiseEntry
|
||||
{
|
||||
public int m_Number;
|
||||
public int m_ItemID;
|
||||
public int m_GumpID;
|
||||
public int m_OffsetX;
|
||||
public int m_OffsetY;
|
||||
|
||||
public DisguiseEntry( int itemID, int gumpID, int ox, int oy, int name )
|
||||
{
|
||||
m_ItemID = itemID;
|
||||
m_GumpID = gumpID;
|
||||
m_OffsetX = ox;
|
||||
m_OffsetY = oy;
|
||||
m_Number = name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class DisguiseTimers
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
new DisguisePersistance();
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_Player;
|
||||
|
||||
public InternalTimer( Mobile m, TimeSpan delay ) : base( delay )
|
||||
{
|
||||
m_Player = m;
|
||||
Priority = TimerPriority.OneMinute;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Player.NameMod = null;
|
||||
|
||||
if ( m_Player is PlayerMobile )
|
||||
((PlayerMobile)m_Player).SetHairMods( -1, -1 );
|
||||
|
||||
DisguiseTimers.RemoveTimer( m_Player );
|
||||
}
|
||||
}
|
||||
|
||||
public static void CreateTimer( Mobile m, TimeSpan delay )
|
||||
{
|
||||
if ( m != null )
|
||||
if ( !m_Timers.Contains( m ) )
|
||||
m_Timers[m] = new InternalTimer( m, delay );
|
||||
}
|
||||
|
||||
public static void StartTimer( Mobile m )
|
||||
{
|
||||
Timer t = (Timer)m_Timers[m];
|
||||
|
||||
if ( t != null )
|
||||
t.Start();
|
||||
}
|
||||
|
||||
public static bool IsDisguised( Mobile m )
|
||||
{
|
||||
return m_Timers.Contains( m );
|
||||
}
|
||||
|
||||
public static bool StopTimer( Mobile m )
|
||||
{
|
||||
Timer t = (Timer)m_Timers[m];
|
||||
|
||||
if ( t != null )
|
||||
{
|
||||
t.Delay = t.Next - DateTime.Now;
|
||||
t.Stop();
|
||||
}
|
||||
|
||||
return ( t != null );
|
||||
}
|
||||
|
||||
public static bool RemoveTimer( Mobile m )
|
||||
{
|
||||
Timer t = (Timer)m_Timers[m];
|
||||
|
||||
if ( t != null )
|
||||
{
|
||||
t.Stop();
|
||||
m_Timers.Remove( m );
|
||||
}
|
||||
|
||||
return ( t != null );
|
||||
}
|
||||
|
||||
public static TimeSpan TimeRemaining( Mobile m )
|
||||
{
|
||||
Timer t = (Timer)m_Timers[m];
|
||||
|
||||
if ( t != null )
|
||||
{
|
||||
return t.Next - DateTime.Now;
|
||||
}
|
||||
|
||||
return TimeSpan.Zero;
|
||||
}
|
||||
|
||||
private static Hashtable m_Timers = new Hashtable();
|
||||
|
||||
public static Hashtable Timers
|
||||
{
|
||||
get { return m_Timers; }
|
||||
}
|
||||
}
|
||||
}
|
||||
83
Scripts/Items/Skill Items/Thief/DisguisePersistance.cs
Normal file
83
Scripts/Items/Skill Items/Thief/DisguisePersistance.cs
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DisguisePersistance : Item
|
||||
{
|
||||
private static DisguisePersistance m_Instance;
|
||||
|
||||
public static DisguisePersistance Instance{ get{ return m_Instance; } }
|
||||
|
||||
public override string DefaultName
|
||||
{
|
||||
get { return "Disguise Persistance - Internal"; }
|
||||
}
|
||||
|
||||
public DisguisePersistance() : base( 1 )
|
||||
{
|
||||
Movable = false;
|
||||
|
||||
if ( m_Instance == null || m_Instance.Deleted )
|
||||
m_Instance = this;
|
||||
else
|
||||
base.Delete();
|
||||
}
|
||||
|
||||
public DisguisePersistance( Serial serial ) : base( serial )
|
||||
{
|
||||
m_Instance = this;
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
int timerCount = DisguiseTimers.Timers.Count;
|
||||
|
||||
writer.Write( timerCount );
|
||||
|
||||
foreach ( DictionaryEntry entry in DisguiseTimers.Timers )
|
||||
{
|
||||
Mobile m = (Mobile)entry.Key;
|
||||
|
||||
writer.Write( m );
|
||||
writer.Write( ((Timer)entry.Value).Next - DateTime.Now );
|
||||
writer.Write( m.NameMod );
|
||||
}
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
int count = reader.ReadInt();
|
||||
|
||||
for ( int i = 0; i < count; ++i )
|
||||
{
|
||||
Mobile m = reader.ReadMobile();
|
||||
DisguiseTimers.CreateTimer( m, reader.ReadTimeSpan() );
|
||||
m.NameMod = reader.ReadString();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
189
Scripts/Items/Skill Items/Thief/LockPick.cs
Normal file
189
Scripts/Items/Skill Items/Thief/LockPick.cs
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
using Server.Regions;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public interface ILockpickable : IPoint2D
|
||||
{
|
||||
int LockLevel{ get; set; }
|
||||
bool Locked{ get; set; }
|
||||
Mobile Picker{ get; set; }
|
||||
int MaxLockLevel{ get; set; }
|
||||
int RequiredSkill{ get; set; }
|
||||
|
||||
void LockPick( Mobile from );
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x14fc, 0x14fb )]
|
||||
public class Lockpick : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Lockpick() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Lockpick( int amount ) : base( 0x14FC )
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public Lockpick( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( version == 0 && Weight == 0.1 )
|
||||
Weight = -1;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
from.SendLocalizedMessage( 502068 ); // What do you want to pick?
|
||||
from.Target = new InternalTarget( this );
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private Lockpick m_Item;
|
||||
|
||||
public InternalTarget( Lockpick item ) : base( 1, false, TargetFlags.None )
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Item.Deleted )
|
||||
return;
|
||||
|
||||
if ( targeted is LootChest )
|
||||
((LootChest)targeted).Setup();
|
||||
|
||||
if ( targeted is BaseDoor && from.Region is DungeonRegion )
|
||||
{
|
||||
BaseDoor door = (BaseDoor)targeted;
|
||||
|
||||
if ( door.Sealed > DateTime.Now )
|
||||
{
|
||||
from.PlaySound( 0x241 );
|
||||
door.Sealed = DateTime.MinValue;
|
||||
door.SendLocalizedMessageTo( from, 502076 );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 502069 ); // This does not appear to be locked
|
||||
}
|
||||
}
|
||||
else if ( targeted is ILockpickable )
|
||||
{
|
||||
Item item = (Item)targeted;
|
||||
from.Direction = from.GetDirectionTo( item );
|
||||
|
||||
if ( ((ILockpickable)targeted).Locked )
|
||||
{
|
||||
from.PlaySound( 0x241 );
|
||||
|
||||
new InternalTimer( from, (ILockpickable)targeted, m_Item ).Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
// The door is not locked
|
||||
from.SendLocalizedMessage( 502069 ); // This does not appear to be locked
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 501666 ); // You can't unlock that!
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_From;
|
||||
private ILockpickable m_Item;
|
||||
private Lockpick m_Lockpick;
|
||||
|
||||
public InternalTimer( Mobile from, ILockpickable item, Lockpick lockpick ) : base( TimeSpan.FromSeconds( 3.0 ) )
|
||||
{
|
||||
m_From = from;
|
||||
m_Item = item;
|
||||
m_Lockpick = lockpick;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
protected void BrokeLockPickTest()
|
||||
{
|
||||
// When failed, a 25% chance to break the lockpick
|
||||
if ( Utility.Random( 4 ) == 0 )
|
||||
{
|
||||
Item item = (Item)m_Item;
|
||||
|
||||
// You broke the lockpick.
|
||||
item.SendLocalizedMessageTo( m_From, 502074 );
|
||||
|
||||
m_From.PlaySound( 0x3A4 );
|
||||
m_Lockpick.Consume();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
Item item = (Item)m_Item;
|
||||
|
||||
if ( !m_From.InRange( item.GetWorldLocation(), 1 ) )
|
||||
return;
|
||||
|
||||
if ( m_Item.LockLevel == 0 || m_Item.LockLevel == -255 )
|
||||
{
|
||||
// LockLevel of 0 means that the door can't be picklocked
|
||||
// LockLevel of -255 means it's magic locked
|
||||
item.SendLocalizedMessageTo( m_From, 502073 ); // This lock cannot be picked by normal means
|
||||
return;
|
||||
}
|
||||
|
||||
if ( m_From.Skills[SkillName.Lockpicking].Value < m_Item.RequiredSkill )
|
||||
{
|
||||
/*
|
||||
// Do some training to gain skills
|
||||
m_From.CheckSkill( SkillName.Lockpicking, 0, m_Item.LockLevel );*/
|
||||
|
||||
// The LockLevel is higher thant the LockPicking of the player
|
||||
item.SendLocalizedMessageTo( m_From, 502072 ); // You don't see how that lock can be manipulated.
|
||||
return;
|
||||
}
|
||||
|
||||
if ( m_From.CheckTargetSkill( SkillName.Lockpicking, m_Item, m_Item.LockLevel, m_Item.MaxLockLevel ) )
|
||||
{
|
||||
// Success! Pick the lock!
|
||||
item.SendLocalizedMessageTo( m_From, 502076 ); // The lock quickly yields to your skill.
|
||||
m_From.PlaySound( 0x4A );
|
||||
m_Item.LockPick( m_From );
|
||||
}
|
||||
else
|
||||
{
|
||||
// The player failed to pick the lock
|
||||
BrokeLockPickTest();
|
||||
item.SendLocalizedMessageTo( m_From, 502075 ); // You are unable to pick the lock.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Skill Items/Tinkering/Axle.cs
Normal file
39
Scripts/Items/Skill Items/Tinkering/Axle.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable( 0x105B, 0x105C )]
|
||||
public class Axle : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Axle() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Axle( int amount ) : base( 0x105B )
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public Axle( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Skill Items/Tinkering/AxleGears.cs
Normal file
39
Scripts/Items/Skill Items/Tinkering/AxleGears.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable( 0x1051, 0x1052 )]
|
||||
public class AxleGears : Item
|
||||
{
|
||||
[Constructable]
|
||||
public AxleGears() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AxleGears( int amount ) : base( 0x1051 )
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public AxleGears( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Skill Items/Tinkering/ClockFrame.cs
Normal file
39
Scripts/Items/Skill Items/Tinkering/ClockFrame.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable( 0x104D, 0x104E )]
|
||||
public class ClockFrame : Item
|
||||
{
|
||||
[Constructable]
|
||||
public ClockFrame() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ClockFrame( int amount ) : base( 0x104D )
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
public ClockFrame( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Skill Items/Tinkering/ClockParts.cs
Normal file
39
Scripts/Items/Skill Items/Tinkering/ClockParts.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable( 0x104F, 0x1050 )]
|
||||
public class ClockParts : Item
|
||||
{
|
||||
[Constructable]
|
||||
public ClockParts() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ClockParts( int amount ) : base( 0x104F )
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public ClockParts( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
220
Scripts/Items/Skill Items/Tinkering/Clocks.cs
Normal file
220
Scripts/Items/Skill Items/Tinkering/Clocks.cs
Normal file
|
|
@ -0,0 +1,220 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum MoonPhase
|
||||
{
|
||||
NewMoon,
|
||||
WaxingCrescentMoon,
|
||||
FirstQuarter,
|
||||
WaxingGibbous,
|
||||
FullMoon,
|
||||
WaningGibbous,
|
||||
LastQuarter,
|
||||
WaningCrescent
|
||||
}
|
||||
|
||||
[Flipable( 0x104B, 0x104C )]
|
||||
public class Clock : Item
|
||||
{
|
||||
private static DateTime m_ServerStart;
|
||||
|
||||
public static DateTime ServerStart
|
||||
{
|
||||
get{ return m_ServerStart; }
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
m_ServerStart = DateTime.Now;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Clock() : this( 0x104B )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Clock( int itemID ) : base( itemID )
|
||||
{
|
||||
Weight = 3.0;
|
||||
}
|
||||
|
||||
public Clock( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public const double SecondsPerUOMinute = 5.0;
|
||||
public const double MinutesPerUODay = SecondsPerUOMinute * 24;
|
||||
|
||||
private static DateTime WorldStart = new DateTime( 1997, 9, 1 );
|
||||
|
||||
public static MoonPhase GetMoonPhase( Map map, int x, int y )
|
||||
{
|
||||
int hours, minutes, totalMinutes;
|
||||
|
||||
GetTime( map, 3584, 2048, out hours, out minutes, out totalMinutes );
|
||||
|
||||
if ( map != null )
|
||||
totalMinutes /= 10 + (map.MapIndex * 20);
|
||||
|
||||
return (MoonPhase)(totalMinutes % 8);
|
||||
}
|
||||
|
||||
public static void GetTime( Map map, int x, int y, out int hours, out int minutes )
|
||||
{
|
||||
int totalMinutes;
|
||||
|
||||
GetTime( map, 3584, 2048, out hours, out minutes, out totalMinutes );
|
||||
}
|
||||
|
||||
public static void GetTime( Map map, int x, int y, out int hours, out int minutes, out int totalMinutes )
|
||||
{
|
||||
TimeSpan timeSpan = DateTime.Now - WorldStart;
|
||||
|
||||
totalMinutes = (int)(timeSpan.TotalSeconds / SecondsPerUOMinute);
|
||||
|
||||
if ( map != null )
|
||||
totalMinutes += map.MapIndex * 320;
|
||||
|
||||
// Really on OSI this must be by subserver
|
||||
totalMinutes += x / 16;
|
||||
|
||||
hours = (totalMinutes / 60) % 24;
|
||||
minutes = totalMinutes % 60;
|
||||
}
|
||||
|
||||
public static void GetTime( out int generalNumber, out string exactTime )
|
||||
{
|
||||
GetTime( null, 3584, 2048, out generalNumber, out exactTime );
|
||||
}
|
||||
|
||||
public static void GetTime( Mobile from, out int generalNumber, out string exactTime )
|
||||
{
|
||||
GetTime( from.Map, 3584, 2048, out generalNumber, out exactTime );
|
||||
}
|
||||
|
||||
public static void GetTime( Map map, int x, int y, out int generalNumber, out string exactTime )
|
||||
{
|
||||
int hours, minutes;
|
||||
|
||||
GetTime( map, 3584, 2048, out hours, out minutes );
|
||||
|
||||
// 00:00 AM - 00:59 AM : Witching hour
|
||||
// 01:00 AM - 03:59 AM : Middle of night
|
||||
// 04:00 AM - 07:59 AM : Early morning
|
||||
// 08:00 AM - 11:59 AM : Late morning
|
||||
// 12:00 PM - 12:59 PM : Noon
|
||||
// 01:00 PM - 03:59 PM : Afternoon
|
||||
// 04:00 PM - 07:59 PM : Early evening
|
||||
// 08:00 PM - 11:59 AM : Late at night
|
||||
|
||||
if ( hours >= 20 )
|
||||
generalNumber = 1042957; // It's late at night
|
||||
else if ( hours >= 16 )
|
||||
generalNumber = 1042956; // It's early in the evening
|
||||
else if ( hours >= 13 )
|
||||
generalNumber = 1042955; // It's the afternoon
|
||||
else if ( hours >= 12 )
|
||||
generalNumber = 1042954; // It's around noon
|
||||
else if ( hours >= 08 )
|
||||
generalNumber = 1042953; // It's late in the morning
|
||||
else if ( hours >= 04 )
|
||||
generalNumber = 1042952; // It's early in the morning
|
||||
else if ( hours >= 01 )
|
||||
generalNumber = 1042951; // It's the middle of the night
|
||||
else
|
||||
generalNumber = 1042950; // 'Tis the witching hour. 12 Midnight.
|
||||
|
||||
hours %= 12;
|
||||
|
||||
if ( hours == 0 )
|
||||
hours = 12;
|
||||
|
||||
exactTime = String.Format( "{0}:{1:D2}", hours, minutes );
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
int genericNumber;
|
||||
string exactTime;
|
||||
|
||||
GetTime( from, out genericNumber, out exactTime );
|
||||
|
||||
SendLocalizedMessageTo( from, genericNumber );
|
||||
SendLocalizedMessageTo( from, 1042958, exactTime ); // ~1_TIME~ to be exact
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( Weight == 2.0 )
|
||||
Weight = 3.0;
|
||||
}
|
||||
}
|
||||
|
||||
[Flipable( 0x104B, 0x104C )]
|
||||
public class ClockRight : Clock
|
||||
{
|
||||
[Constructable]
|
||||
public ClockRight() : base( 0x104B )
|
||||
{
|
||||
}
|
||||
|
||||
public ClockRight( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[Flipable( 0x104B, 0x104C )]
|
||||
public class ClockLeft : Clock
|
||||
{
|
||||
[Constructable]
|
||||
public ClockLeft() : base( 0x104C )
|
||||
{
|
||||
}
|
||||
|
||||
public ClockLeft( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Skill Items/Tinkering/Gears.cs
Normal file
39
Scripts/Items/Skill Items/Tinkering/Gears.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable( 0x1053, 0x1054 )]
|
||||
public class Gears : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Gears() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Gears( int amount ) : base( 0x1053 )
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public Gears( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
32
Scripts/Items/Skill Items/Tinkering/Globe.cs
Normal file
32
Scripts/Items/Skill Items/Tinkering/Globe.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Globe : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Globe() : base( 0x1047 ) // It isn't flipable
|
||||
{
|
||||
Weight = 3.0;
|
||||
}
|
||||
|
||||
public Globe( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Skill Items/Tinkering/Hinge.cs
Normal file
39
Scripts/Items/Skill Items/Tinkering/Hinge.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable( 0x1055, 0x1056 )]
|
||||
public class Hinge : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Hinge() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Hinge( int amount ) : base( 0x1055 )
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public Hinge( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Skill Items/Tinkering/SextantParts.cs
Normal file
39
Scripts/Items/Skill Items/Tinkering/SextantParts.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable( 0x1059, 0x105A )]
|
||||
public class SextantParts : Item
|
||||
{
|
||||
[Constructable]
|
||||
public SextantParts() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SextantParts( int amount ) : base( 0x1059 )
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
public SextantParts( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Skill Items/Tinkering/Springs.cs
Normal file
39
Scripts/Items/Skill Items/Tinkering/Springs.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable( 0x105D, 0x105E )]
|
||||
public class Springs : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Springs() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Springs( int amount ) : base( 0x105D )
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public Springs( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
52
Scripts/Items/Skill Items/Tinkering/Spyglass.cs
Normal file
52
Scripts/Items/Skill Items/Tinkering/Spyglass.cs
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable( 0x14F5, 0x14F6 )]
|
||||
public class Spyglass : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Spyglass() : base( 0x14F5 )
|
||||
{
|
||||
Name = "spyglass";
|
||||
Weight = 3.0;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( from.Map != Map.Britannia )
|
||||
{
|
||||
from.SendMessage( "That does not work here!" );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1008155 ); // You peer into the heavens, seeking the moons...
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1008146 + (int)Clock.GetMoonPhase( Map.Britannia, 3584, 2048 ) );
|
||||
}
|
||||
}
|
||||
|
||||
public Spyglass( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
277
Scripts/Items/Skill Items/Tinkering/Utensils.cs
Normal file
277
Scripts/Items/Skill Items/Tinkering/Utensils.cs
Normal file
|
|
@ -0,0 +1,277 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable( 0x9F4, 0x9F5, 0x9A3, 0x9A4 )]
|
||||
public class Fork : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Fork() : base( 0x9F4 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public Fork( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class ForkLeft : Item
|
||||
{
|
||||
[Constructable]
|
||||
public ForkLeft() : base( 0x9F4 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public ForkLeft( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class ForkRight : Item
|
||||
{
|
||||
[Constructable]
|
||||
public ForkRight() : base( 0x9F5 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public ForkRight( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[Flipable( 0x9F8, 0x9F9, 0x9C2, 0x9C3 )]
|
||||
public class Spoon : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Spoon() : base( 0x9F8 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public Spoon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SpoonLeft : Item
|
||||
{
|
||||
[Constructable]
|
||||
public SpoonLeft() : base( 0x9F8 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public SpoonLeft( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SpoonRight : Item
|
||||
{
|
||||
[Constructable]
|
||||
public SpoonRight() : base( 0x9F9 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public SpoonRight( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[Flipable( 0x9F6, 0x9F7, 0x9A5, 0x9A6 )]
|
||||
public class Knife : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Knife() : base( 0x9F6 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public Knife( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class KnifeLeft : Item
|
||||
{
|
||||
[Constructable]
|
||||
public KnifeLeft() : base( 0x9F6 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public KnifeLeft( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class KnifeRight : Item
|
||||
{
|
||||
[Constructable]
|
||||
public KnifeRight() : base( 0x9F7 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public KnifeRight( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class Plate : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Plate() : base( 0x9D7 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public Plate( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
197
Scripts/Items/Skill Items/Tools/BaseTool.cs
Normal file
197
Scripts/Items/Skill Items/Tools/BaseTool.cs
Normal file
|
|
@ -0,0 +1,197 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum ToolQuality
|
||||
{
|
||||
Low,
|
||||
Regular,
|
||||
Exceptional
|
||||
}
|
||||
|
||||
public abstract class BaseTool : Item, IUsesRemaining, ICraftable
|
||||
{
|
||||
private Mobile m_Crafter;
|
||||
private ToolQuality m_Quality;
|
||||
private int m_UsesRemaining;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Mobile Crafter
|
||||
{
|
||||
get{ return m_Crafter; }
|
||||
set{ m_Crafter = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public ToolQuality Quality
|
||||
{
|
||||
get{ return m_Quality; }
|
||||
set{ UnscaleUses(); m_Quality = value; InvalidateProperties(); ScaleUses(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int UsesRemaining
|
||||
{
|
||||
get { return m_UsesRemaining; }
|
||||
set { m_UsesRemaining = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
public void ScaleUses()
|
||||
{
|
||||
m_UsesRemaining = (m_UsesRemaining * GetUsesScalar()) / 100;
|
||||
InvalidateProperties();
|
||||
}
|
||||
|
||||
public void UnscaleUses()
|
||||
{
|
||||
m_UsesRemaining = (m_UsesRemaining * 100) / GetUsesScalar();
|
||||
}
|
||||
|
||||
public int GetUsesScalar()
|
||||
{
|
||||
if ( m_Quality == ToolQuality.Exceptional )
|
||||
return 200;
|
||||
|
||||
return 100;
|
||||
}
|
||||
|
||||
public bool ShowUsesRemaining{ get{ return true; } set{} }
|
||||
|
||||
public abstract CraftSystem CraftSystem{ get; }
|
||||
|
||||
public BaseTool( int itemID ) : this( Utility.RandomMinMax( 25, 75 ), itemID )
|
||||
{
|
||||
}
|
||||
|
||||
public BaseTool( int uses, int itemID ) : base( itemID )
|
||||
{
|
||||
m_UsesRemaining = uses;
|
||||
m_Quality = ToolQuality.Regular;
|
||||
}
|
||||
|
||||
public BaseTool( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
// Makers mark not displayed on OSI
|
||||
//if ( m_Crafter != null )
|
||||
// list.Add( 1050043, m_Crafter.Name ); // crafted by ~1_NAME~
|
||||
|
||||
if ( m_Quality == ToolQuality.Exceptional )
|
||||
list.Add( 1060636 ); // exceptional
|
||||
|
||||
list.Add( 1060584, m_UsesRemaining.ToString() ); // uses remaining: ~1_val~
|
||||
}
|
||||
|
||||
public virtual void DisplayDurabilityTo( Mobile m )
|
||||
{
|
||||
LabelToAffix( m, 1017323, AffixType.Append, ": " + m_UsesRemaining.ToString() ); // Durability
|
||||
}
|
||||
|
||||
public static bool CheckAccessible( Item tool, Mobile m )
|
||||
{
|
||||
return ( tool.IsChildOf( m ) || tool.Parent == m );
|
||||
}
|
||||
|
||||
public static bool CheckTool( Item tool, Mobile m )
|
||||
{
|
||||
Item check = m.FindItemOnLayer( Layer.OneHanded );
|
||||
|
||||
if ( check is BaseTool && check != tool )
|
||||
return false;
|
||||
|
||||
check = m.FindItemOnLayer( Layer.TwoHanded );
|
||||
|
||||
if ( check is BaseTool && check != tool )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
DisplayDurabilityTo( from );
|
||||
|
||||
base.OnSingleClick( from );
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( IsChildOf( from.Backpack ) || Parent == from )
|
||||
{
|
||||
CraftSystem system = this.CraftSystem;
|
||||
|
||||
int num = system.CanCraft( from, this, null );
|
||||
|
||||
if ( num > 0 && num != 1044267 ) // Blacksmithing shows the gump regardless of proximity of an anvil and forge after SE
|
||||
{
|
||||
from.SendLocalizedMessage( num );
|
||||
}
|
||||
else
|
||||
{
|
||||
CraftContext context = system.GetContext( from );
|
||||
|
||||
from.SendGump( new CraftGump( from, system, this, null ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( (Mobile) m_Crafter );
|
||||
writer.Write( (int) m_Quality );
|
||||
|
||||
writer.Write( (int) m_UsesRemaining );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_Crafter = reader.ReadMobile();
|
||||
m_Quality = (ToolQuality) reader.ReadInt();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_UsesRemaining = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#region ICraftable Members
|
||||
|
||||
public int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue )
|
||||
{
|
||||
Quality = (ToolQuality)quality;
|
||||
|
||||
if ( makersMark )
|
||||
Crafter = from;
|
||||
|
||||
return quality;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
45
Scripts/Items/Skill Items/Tools/DovetailSaw.cs
Normal file
45
Scripts/Items/Skill Items/Tools/DovetailSaw.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable( 0x1028, 0x1029 )]
|
||||
public class DovetailSaw : BaseTool
|
||||
{
|
||||
public override CraftSystem CraftSystem{ get{ return DefCarpentry.CraftSystem; } }
|
||||
|
||||
[Constructable]
|
||||
public DovetailSaw() : base( 0x1028 )
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DovetailSaw( int uses ) : base( uses, 0x1028 )
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
public DovetailSaw( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( Weight == 1.0 )
|
||||
Weight = 2.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Scripts/Items/Skill Items/Tools/DrawKnife.cs
Normal file
41
Scripts/Items/Skill Items/Tools/DrawKnife.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DrawKnife : BaseTool
|
||||
{
|
||||
public override CraftSystem CraftSystem{ get{ return DefCarpentry.CraftSystem; } }
|
||||
|
||||
[Constructable]
|
||||
public DrawKnife() : base( 0x10E4 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DrawKnife( int uses ) : base( uses, 0x10E4 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public DrawKnife( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
45
Scripts/Items/Skill Items/Tools/FletcherTools.cs
Normal file
45
Scripts/Items/Skill Items/Tools/FletcherTools.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0x1022, 0x1023 )]
|
||||
public class FletcherTools : BaseTool
|
||||
{
|
||||
public override CraftSystem CraftSystem{ get{ return DefBowFletching.CraftSystem; } }
|
||||
|
||||
[Constructable]
|
||||
public FletcherTools() : base( 0x1022 )
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FletcherTools( int uses ) : base( uses, 0x1022 )
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
public FletcherTools( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( Weight == 1.0 )
|
||||
Weight = 2.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Scripts/Items/Skill Items/Tools/FlourSifter.cs
Normal file
41
Scripts/Items/Skill Items/Tools/FlourSifter.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FlourSifter : BaseTool
|
||||
{
|
||||
public override CraftSystem CraftSystem{ get{ return DefCooking.CraftSystem; } }
|
||||
|
||||
[Constructable]
|
||||
public FlourSifter() : base( 0x103E )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FlourSifter( int uses ) : base( uses, 0x103E )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public FlourSifter( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Scripts/Items/Skill Items/Tools/Froe.cs
Normal file
41
Scripts/Items/Skill Items/Tools/Froe.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Froe : BaseTool
|
||||
{
|
||||
public override CraftSystem CraftSystem{ get{ return DefCarpentry.CraftSystem; } }
|
||||
|
||||
[Constructable]
|
||||
public Froe() : base( 0x10E5 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Froe( int uses ) : base( uses, 0x10E5 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public Froe( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Scripts/Items/Skill Items/Tools/Hammer.cs
Normal file
41
Scripts/Items/Skill Items/Tools/Hammer.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Hammer : BaseTool
|
||||
{
|
||||
public override CraftSystem CraftSystem{ get{ return DefCarpentry.CraftSystem; } }
|
||||
|
||||
[Constructable]
|
||||
public Hammer() : base( 0x102A )
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Hammer( int uses ) : base( uses, 0x102A )
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
public Hammer( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Scripts/Items/Skill Items/Tools/Inshave.cs
Normal file
41
Scripts/Items/Skill Items/Tools/Inshave.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Inshave : BaseTool
|
||||
{
|
||||
public override CraftSystem CraftSystem{ get{ return DefCarpentry.CraftSystem; } }
|
||||
|
||||
[Constructable]
|
||||
public Inshave() : base( 0x10E6 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Inshave( int uses ) : base( uses, 0x10E6 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public Inshave( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
45
Scripts/Items/Skill Items/Tools/JointingPlane.cs
Normal file
45
Scripts/Items/Skill Items/Tools/JointingPlane.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable( 0x1030, 0x1031 )]
|
||||
public class JointingPlane : BaseTool
|
||||
{
|
||||
public override CraftSystem CraftSystem{ get{ return DefCarpentry.CraftSystem; } }
|
||||
|
||||
[Constructable]
|
||||
public JointingPlane() : base( 0x1030 )
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public JointingPlane( int uses ) : base( uses, 0x1030 )
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
public JointingPlane( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( Weight == 1.0 )
|
||||
Weight = 2.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
47
Scripts/Items/Skill Items/Tools/MapmakersPen.cs
Normal file
47
Scripts/Items/Skill Items/Tools/MapmakersPen.cs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0x0FBF, 0x0FC0 )]
|
||||
public class MapmakersPen : BaseTool
|
||||
{
|
||||
public override CraftSystem CraftSystem{ get{ return DefCartography.CraftSystem; } }
|
||||
|
||||
public override int LabelNumber{ get{ return 1044167; } } // mapmaker's pen
|
||||
|
||||
[Constructable]
|
||||
public MapmakersPen() : base( 0x0FBF )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MapmakersPen( int uses ) : base( uses, 0x0FBF )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public MapmakersPen( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( Weight == 2.0 )
|
||||
Weight = 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
74
Scripts/Items/Skill Items/Tools/MortarPestle.cs
Normal file
74
Scripts/Items/Skill Items/Tools/MortarPestle.cs
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class MortarPestle : BaseTool
|
||||
{
|
||||
public override CraftSystem CraftSystem{ get{ return DefAlchemy.CraftSystem; } }
|
||||
|
||||
[Constructable]
|
||||
public MortarPestle() : base( 0xE9B )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MortarPestle( int uses ) : base( uses, 0xE9B )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public MortarPestle( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override bool OnDragDrop( Mobile from, Item dropped )
|
||||
{
|
||||
Container pack = from.Backpack;
|
||||
int mod = 0;
|
||||
|
||||
if ( dropped is Amber ){ mod = dropped.Amount * 1; }
|
||||
else if ( dropped is Amethyst ){ mod = dropped.Amount * 3; }
|
||||
else if ( dropped is Citrine ){ mod = dropped.Amount * 1; }
|
||||
else if ( dropped is Diamond ){ mod = dropped.Amount * 5; }
|
||||
else if ( dropped is Emerald ){ mod = dropped.Amount * 3; }
|
||||
else if ( dropped is Ruby ){ mod = dropped.Amount * 2; }
|
||||
else if ( dropped is Sapphire ){ mod = dropped.Amount * 3; }
|
||||
else if ( dropped is StarSapphire ){ mod = dropped.Amount * 4; }
|
||||
else if ( dropped is Tourmaline ){ mod = dropped.Amount * 2; }
|
||||
|
||||
if ( from != null && mod > 0 )
|
||||
{
|
||||
if ( dropped.Amount > 100 )
|
||||
{
|
||||
from.SendMessage( "You can only grind up 100 gems at a time!" );
|
||||
from.AddToBackpack( dropped );
|
||||
}
|
||||
else
|
||||
{
|
||||
dropped.Delete();
|
||||
from.PlaySound( 0x242 );
|
||||
from.SendMessage( "You grind up the gems into a fine powder" );
|
||||
from.AddToBackpack( new CrystalPowder(mod) );
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
42
Scripts/Items/Skill Items/Tools/MouldingPlane.cs
Normal file
42
Scripts/Items/Skill Items/Tools/MouldingPlane.cs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable( 0x102C, 0x102D )]
|
||||
public class MouldingPlane : BaseTool
|
||||
{
|
||||
public override CraftSystem CraftSystem{ get{ return DefCarpentry.CraftSystem; } }
|
||||
|
||||
[Constructable]
|
||||
public MouldingPlane() : base( 0x102C )
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MouldingPlane( int uses ) : base( uses, 0x102C )
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
public MouldingPlane( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
42
Scripts/Items/Skill Items/Tools/Nails.cs
Normal file
42
Scripts/Items/Skill Items/Tools/Nails.cs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable( 0x102E, 0x102F )]
|
||||
public class Nails : BaseTool
|
||||
{
|
||||
public override CraftSystem CraftSystem{ get{ return DefCarpentry.CraftSystem; } }
|
||||
|
||||
[Constructable]
|
||||
public Nails() : base( 0x102E )
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Nails( int uses ) : base( uses, 0x102C )
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
public Nails( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Scripts/Items/Skill Items/Tools/RollingPin.cs
Normal file
41
Scripts/Items/Skill Items/Tools/RollingPin.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RollingPin : BaseTool
|
||||
{
|
||||
public override CraftSystem CraftSystem{ get{ return DefCooking.CraftSystem; } }
|
||||
|
||||
[Constructable]
|
||||
public RollingPin() : base( 0x1043 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RollingPin( int uses ) : base( uses, 0x1043 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public RollingPin( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
42
Scripts/Items/Skill Items/Tools/Saw.cs
Normal file
42
Scripts/Items/Skill Items/Tools/Saw.cs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0x1034, 0x1035 )]
|
||||
public class Saw : BaseTool
|
||||
{
|
||||
public override CraftSystem CraftSystem{ get{ return DefCarpentry.CraftSystem; } }
|
||||
|
||||
[Constructable]
|
||||
public Saw() : base( 0x1034 )
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Saw( int uses ) : base( uses, 0x1034 )
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
public Saw( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Scripts/Items/Skill Items/Tools/Scorp.cs
Normal file
41
Scripts/Items/Skill Items/Tools/Scorp.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Scorp : BaseTool
|
||||
{
|
||||
public override CraftSystem CraftSystem{ get{ return DefCarpentry.CraftSystem; } }
|
||||
|
||||
[Constructable]
|
||||
public Scorp() : base( 0x10E7 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Scorp( int uses ) : base( uses, 0x10E7 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public Scorp( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
47
Scripts/Items/Skill Items/Tools/ScribesPen.cs
Normal file
47
Scripts/Items/Skill Items/Tools/ScribesPen.cs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0x0FBF, 0x0FC0 )]
|
||||
public class ScribesPen : BaseTool
|
||||
{
|
||||
public override CraftSystem CraftSystem{ get{ return DefInscription.CraftSystem; } }
|
||||
|
||||
public override int LabelNumber{ get{ return 1044168; } } // scribe's pen
|
||||
|
||||
[Constructable]
|
||||
public ScribesPen() : base( 0x0FBF )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ScribesPen( int uses ) : base( uses, 0x0FBF )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public ScribesPen( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( Weight == 2.0 )
|
||||
Weight = 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue