This commit is contained in:
parent
57b345a480
commit
68d742d262
28 changed files with 432 additions and 193 deletions
|
|
@ -101,7 +101,7 @@ namespace Server.Items
|
|||
|
||||
if ( house != null && house.IsCoOwner( from ) )
|
||||
{
|
||||
Effects.PlaySound( Location, Map, 0x11C );
|
||||
Effects.PlaySound( Location, Map, 0x3B3 );
|
||||
from.SendLocalizedMessage( 500461 ); // You destroy the item.
|
||||
Destroy();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ using Server.Engines.Harvest;
|
|||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GargoylesPickaxe : BaseAxe
|
||||
public class GargoylesPickaxe : BaseAxe, IUsesRemaining
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041281; } } // a gargoyle's pickaxe
|
||||
public override HarvestSystem HarvestSystem{ get{ return Mining.System; } }
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ using Server.Engines.Harvest;
|
|||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SturdyPickaxe : BaseAxe
|
||||
public class SturdyPickaxe : BaseAxe, IUsesRemaining
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1045126; } } // sturdy pickaxe
|
||||
public override HarvestSystem HarvestSystem{ get{ return Mining.System; } }
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ using Server.Items;
|
|||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0x1bdd, 0x1be0 )]
|
||||
public class Log : Item, ICommodity
|
||||
public class Log : Item, ICommodity, IAxe
|
||||
{
|
||||
private CraftResource m_Resource;
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
[Constructable]
|
||||
public Log( int amount ) : this( CraftResource.RegularWood )
|
||||
public Log( int amount ) : this( CraftResource.RegularWood, amount )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -40,7 +40,6 @@ namespace Server.Items
|
|||
: this( resource, 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Log( CraftResource resource, int amount )
|
||||
: base( 0x1BDD )
|
||||
|
|
@ -67,7 +66,6 @@ namespace Server.Items
|
|||
list.Add( CraftResources.GetName( m_Resource ) );
|
||||
}
|
||||
}
|
||||
|
||||
public Log( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
|
@ -99,38 +97,63 @@ namespace Server.Items
|
|||
if ( version == 0 )
|
||||
m_Resource = CraftResource.RegularWood;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool TryCreateBoards( Mobile from, double skill, Item item )
|
||||
{
|
||||
if ( Deleted || !from.CanSee( this ) )
|
||||
return false;
|
||||
else if ( from.Skills.Carpentry.Value < skill &&
|
||||
from.Skills.Lumberjacking.Value < skill )
|
||||
{
|
||||
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 ( !TryCreateBoards( from , 0, new Board() ) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public class HeartwoodLog : Log
|
||||
{
|
||||
[Constructable]
|
||||
public HeartwoodLog() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HeartwoodLog( int amount )
|
||||
: base( CraftResource.Heartwood, amount )
|
||||
{
|
||||
}
|
||||
|
||||
public HeartwoodLog( 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 Axe( Mobile from, BaseAxe axe )
|
||||
{
|
||||
if ( !TryCreateBoards( from , 100, new HeartwoodBoard() ) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public class BloodwoodLog : Log
|
||||
|
|
@ -140,31 +163,35 @@ namespace Server.Items
|
|||
: this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BloodwoodLog( int amount )
|
||||
: base( CraftResource.Bloodwood, amount )
|
||||
{
|
||||
}
|
||||
|
||||
public BloodwoodLog( 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 Axe( Mobile from, BaseAxe axe )
|
||||
{
|
||||
if ( !TryCreateBoards( from , 100, new BloodwoodBoard() ) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public class FrostwoodLog : Log
|
||||
|
|
@ -199,6 +226,14 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override bool Axe( Mobile from, BaseAxe axe )
|
||||
{
|
||||
if ( !TryCreateBoards( from , 100, new FrostwoodBoard() ) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public class OakLog : Log
|
||||
|
|
@ -233,6 +268,14 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override bool Axe( Mobile from, BaseAxe axe )
|
||||
{
|
||||
if ( !TryCreateBoards( from , 65, new OakBoard() ) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public class AshLog : Log
|
||||
|
|
@ -267,6 +310,14 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override bool Axe( Mobile from, BaseAxe axe )
|
||||
{
|
||||
if ( !TryCreateBoards( from , 80, new AshBoard() ) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public class YewLog : Log
|
||||
|
|
@ -301,5 +352,13 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override bool Axe( Mobile from, BaseAxe axe )
|
||||
{
|
||||
if ( !TryCreateBoards( from , 95, new YewBoard() ) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -257,7 +257,7 @@ namespace Server.Items
|
|||
- Summoning Undead
|
||||
*/
|
||||
|
||||
double val = (targ.Hits * 1.6) + targ.Stam + targ.Mana;
|
||||
double val = (targ.HitsMax * 1.6) + targ.StamMax + targ.ManaMax;
|
||||
|
||||
val += targ.SkillsTotal / 10;
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ namespace Server.Items
|
|||
}
|
||||
else
|
||||
{
|
||||
list.Add( new BallEntry( new BallCallback( SummonPet ), 6181 ) );
|
||||
list.Add(new BallEntry(new BallCallback( CastSummonPet ), 6181 ));
|
||||
list.Add( new BallEntry( new BallCallback( UpdatePetName ), 6183 ) );
|
||||
list.Add( new BallEntry( new BallCallback( UnlinkPet ), 6182 ) );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,12 @@ using Server.ContextMenus;
|
|||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseAxe : BaseMeleeWeapon, IUsesRemaining
|
||||
public interface IAxe
|
||||
{
|
||||
bool Axe( Mobile from, BaseAxe axe );
|
||||
}
|
||||
|
||||
public abstract class BaseAxe : BaseMeleeWeapon
|
||||
{
|
||||
public override int DefHitSound{ get{ return 0x232; } }
|
||||
public override int DefMissSound{ get{ return 0x23A; } }
|
||||
|
|
@ -75,13 +80,26 @@ namespace Server.Items
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( HarvestSystem == null )
|
||||
if ( HarvestSystem == null || Deleted )
|
||||
return;
|
||||
|
||||
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.
|
||||
Point3D loc = this.GetWorldLocation();
|
||||
|
||||
if ( !from.InLOS( loc ) || !from.InRange( loc, 2 ) )
|
||||
{
|
||||
from.LocalOverheadMessage( Server.Network.MessageType.Regular, 0x3E9, 1019045 ); // I can't reach that
|
||||
return;
|
||||
}
|
||||
else if ( !this.IsAccessibleTo( from ) )
|
||||
{
|
||||
this.PublicOverheadMessage( Server.Network.MessageType.Regular, 0x3E9, 1061637 ); // You are not allowed to access this.
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !(this.HarvestSystem is Mining) )
|
||||
from.SendLocalizedMessage( 1010018 ); // What do you want to use this item on?
|
||||
|
||||
HarvestSystem.BeginHarvesting( from, this );
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ using Server.Engines.Harvest;
|
|||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0xE86, 0xE85 )]
|
||||
public class Pickaxe : BaseAxe
|
||||
public class Pickaxe : BaseAxe, IUsesRemaining
|
||||
{
|
||||
public override HarvestSystem HarvestSystem{ get{ return Mining.System; } }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue