Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
[CorpseName( "a zombie corpse" )]
|
||||
public class DecayingCorpse : BaseCreature
|
||||
{
|
||||
[Constructable]
|
||||
public DecayingCorpse() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.4, 0.8 )
|
||||
{
|
||||
Name = "a decaying corpse";
|
||||
Body = 155;
|
||||
Hue = 1173;
|
||||
BaseSoundID = 471;
|
||||
|
||||
SetStr( 346, 370 );
|
||||
SetDex( 71, 90 );
|
||||
SetInt( 26, 40 );
|
||||
|
||||
SetHits( 222, 250 );
|
||||
|
||||
SetDamage( 13, 23 );
|
||||
|
||||
SetDamageType( ResistanceType.Physical, 40 );
|
||||
SetDamageType( ResistanceType.Cold, 60 );
|
||||
|
||||
SetResistance( ResistanceType.Physical, 45, 55 );
|
||||
SetResistance( ResistanceType.Fire, 10, 20 );
|
||||
SetResistance( ResistanceType.Cold, 50, 60 );
|
||||
SetResistance( ResistanceType.Poison, 20, 30 );
|
||||
SetResistance( ResistanceType.Energy, 20, 30 );
|
||||
|
||||
SetSkill( SkillName.MagicResist, 15.1, 40.0 );
|
||||
SetSkill( SkillName.Tactics, 35.1, 50.0 );
|
||||
SetSkill( SkillName.Wrestling, 35.1, 50.0 );
|
||||
|
||||
Fame = 4000;
|
||||
Karma = -4000;
|
||||
|
||||
VirtualArmor = 50;
|
||||
|
||||
PackItem( new Garlic( 5 ) );
|
||||
PackItem( new Bandage( 10 ) );
|
||||
|
||||
if( 0.30 > Utility.RandomDouble() ) // 0.30 = 30% = chance to drop
|
||||
switch ( Utility.Random( 1 ))
|
||||
{
|
||||
case 0: PackItem( new Worm()); break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
AddLoot( LootPack.Rich );
|
||||
AddLoot( LootPack.Gems );
|
||||
AddLoot( LootPack.Potions );
|
||||
}
|
||||
|
||||
public override Poison PoisonImmune{ get{ return Poison.Lesser; } }
|
||||
|
||||
public DecayingCorpse( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
153
Scripts/Scripts-master/Quests/OldFishermanQuest/OldFisherman.cs
Normal file
153
Scripts/Scripts-master/Quests/OldFishermanQuest/OldFisherman.cs
Normal file
@@ -0,0 +1,153 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
using Server.ContextMenus;
|
||||
using Server.Gumps;
|
||||
using Server.Misc;
|
||||
using Server.Network;
|
||||
using Server.Spells;
|
||||
using Server.Accounting;
|
||||
using System.Collections.Generic;
|
||||
using Server.Commands;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
[CorpseName( "Fisherman's Corpse" )]
|
||||
public class OldFisherman : Mobile
|
||||
{
|
||||
public virtual bool IsInvulnerable{ get{ return true; } }
|
||||
[Constructable]
|
||||
public OldFisherman()
|
||||
{
|
||||
Name = "James";
|
||||
Title = "the old fisherman";
|
||||
Body = 0x190;
|
||||
CantWalk = true;
|
||||
Hue = 0x83F8;
|
||||
AddItem( new Server.Items.Boots( 1138 ) );
|
||||
AddItem( new Server.Items.Shirt( 969 ) );
|
||||
AddItem( new Server.Items.ShortPants( 1118 ) );
|
||||
AddItem( new Server.Items.FloppyHat( 1138 ) );
|
||||
|
||||
FishingPole fp = new FishingPole();
|
||||
fp.Hue = 1150;
|
||||
fp.Name = "Ancient Fishing Pole";
|
||||
AddItem( fp );
|
||||
|
||||
|
||||
int hairHue = 1150;
|
||||
|
||||
switch ( Utility.Random( 1 ) )
|
||||
{
|
||||
case 0: AddItem( new ShortHair( hairHue ) ); break;
|
||||
}
|
||||
|
||||
Blessed = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public OldFisherman( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries( from, list );
|
||||
list.Add( new OldFishermanEntry( from, this ) );
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public class OldFishermanEntry : ContextMenuEntry
|
||||
{
|
||||
private Mobile m_Mobile;
|
||||
private Mobile m_Giver;
|
||||
|
||||
public OldFishermanEntry( Mobile from, Mobile giver ) : base( 6146, 3 )
|
||||
{
|
||||
m_Mobile = from;
|
||||
m_Giver = giver;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
|
||||
|
||||
if( !( m_Mobile is PlayerMobile ) )
|
||||
return;
|
||||
|
||||
PlayerMobile mobile = (PlayerMobile) m_Mobile;
|
||||
|
||||
{
|
||||
if ( ! mobile.HasGump( typeof( OldFishermanGump ) ) )
|
||||
{
|
||||
mobile.SendGump( new OldFishermanGump( mobile ));
|
||||
mobile.AddToBackpack( new WormJarEmpty() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnDragDrop( Mobile from, Item dropped )
|
||||
{
|
||||
Mobile m = from;
|
||||
PlayerMobile mobile = m as PlayerMobile;
|
||||
|
||||
if ( mobile != null)
|
||||
{
|
||||
if( dropped is WormJarFull )
|
||||
{
|
||||
if( dropped.Amount!=1)
|
||||
{
|
||||
this.PrivateOverheadMessage( MessageType.Regular, 1153, false, "AH! Now this is Babe Winkleman material here!", mobile.NetState );
|
||||
return false;
|
||||
}
|
||||
|
||||
dropped.Delete();
|
||||
mobile.SendGump( new OldFishermanGump2(m) );
|
||||
|
||||
if( 1 > Utility.RandomDouble() ) // 1 = 100% = chance to drop
|
||||
switch ( Utility.Random( 3 ))
|
||||
{
|
||||
|
||||
case 0: mobile.AddToBackpack( new AncientFishingPole15() ); break;
|
||||
case 1: mobile.AddToBackpack( new AncientFishingPole30() ); break;
|
||||
case 2: mobile.AddToBackpack( new AncientFishingPole60() ); break;
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else if ( dropped is WormJarFull )
|
||||
{
|
||||
this.PrivateOverheadMessage( MessageType.Regular, 1153, 1054071, mobile.NetState );
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.PrivateOverheadMessage( MessageType.Regular, 1153, false, "I don't think the fish will be biting on that!", mobile.NetState );
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Commands;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class OldFishermanGump : Gump
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("OldFishermanGump", AccessLevel.GameMaster, new CommandEventHandler(OldFishermanGump_OnCommand));
|
||||
}
|
||||
|
||||
private static void OldFishermanGump_OnCommand( CommandEventArgs e )
|
||||
{
|
||||
e.Mobile.SendGump( new OldFishermanGump( e.Mobile ) );
|
||||
}
|
||||
|
||||
public OldFishermanGump( Mobile owner ) : base( 50,50 )
|
||||
{
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
|
||||
AddPage( 0 );
|
||||
AddImageTiled( 54, 33, 369, 400, 2624 );
|
||||
AddAlphaRegion( 54, 33, 369, 400 );
|
||||
|
||||
AddImageTiled( 416, 39, 44, 389, 203 );
|
||||
//--------------------------------------Window size bar--------------------------------------------
|
||||
|
||||
AddImage( 97, 49, 9005 );
|
||||
AddImageTiled( 58, 39, 29, 390, 10460 );
|
||||
AddImageTiled( 412, 37, 31, 389, 10460 );
|
||||
AddLabel( 140, 60, 0x34, "The Old Fisherman" );
|
||||
|
||||
|
||||
AddHtml( 107, 140, 300, 230, "<BODY>" +
|
||||
//----------------------/----------------------------------------------/
|
||||
"<BASEFONT COLOR=YELLOW><I>James looks to you with a gleam in his eye</I><BR><BR>Hi there stranger!<BR><BR>" +
|
||||
"<BASEFONT COLOR=YELLOW>You know, worms are the best bait. Get an old fisherman 10 worms, would ye?<BR><BR>" +
|
||||
"<BASEFONT COLOR=YELLOW>I hear you can get worms from decaying corpses over at the cemetery in Cove.<BR><BR><I>James hands you an empty jar</I><BR><BR>If you get me enough fertile dirt and worms to fill this jar, you can have my old fishing pole." +
|
||||
"<BASEFONT COLOR=YELLOW> I wouldn't need this old thing if I had some bait.<BR><BR>You will have to go find the 40 dirt, I think earth elementals will give you some if you ask kindly, hehe. If not just killem' and take it!" +
|
||||
|
||||
"</BODY>", false, true);
|
||||
|
||||
|
||||
AddImage( 430, 9, 10441);
|
||||
AddImageTiled( 40, 38, 17, 391, 9263 );
|
||||
AddImage( 6, 25, 10421 );
|
||||
AddImage( 34, 12, 10420 );
|
||||
AddImageTiled( 94, 25, 342, 15, 10304 );
|
||||
AddImageTiled( 40, 427, 415, 16, 10304 );
|
||||
AddImage( -10, 314, 10402 );
|
||||
AddImage( 56, 150, 10411 );
|
||||
AddImage( 155, 120, 2103 );
|
||||
AddImage( 136, 84, 96 );
|
||||
|
||||
AddButton( 225, 390, 0xF7, 0xF8, 0, GumpButtonType.Reply, 0 );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState state, RelayInfo info ) //Function for GumpButtonType.Reply Buttons
|
||||
{
|
||||
Mobile from = state.Mobile;
|
||||
|
||||
switch ( info.ButtonID )
|
||||
{
|
||||
case 0: //Case uses the ActionIDs defenied above. Case 0 defenies the actions for the button with the action id 0
|
||||
{
|
||||
//Cancel
|
||||
from.SendMessage( "Get 10 worms and 40 fertile dirt to fill the jar and return it to James." );
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
using Server.ContextMenus;
|
||||
using Server.Commands;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class OldFishermanGump2 : Gump
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("OldFishermanGump2", AccessLevel.GameMaster, new CommandEventHandler(OldFishermanGump2_OnCommand));
|
||||
}
|
||||
|
||||
private static void OldFishermanGump2_OnCommand( CommandEventArgs e )
|
||||
{
|
||||
e.Mobile.SendGump( new OldFishermanGump2( e.Mobile ) );
|
||||
}
|
||||
|
||||
public OldFishermanGump2( Mobile owner ) : base( 50,50 )
|
||||
{
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
|
||||
AddPage( 0 );
|
||||
AddImageTiled( 54, 33, 369, 400, 2624 );
|
||||
AddAlphaRegion( 54, 33, 369, 400 );
|
||||
|
||||
AddImageTiled( 416, 39, 44, 389, 203 );
|
||||
//--------------------------------------Window size bar--------------------------------------------
|
||||
|
||||
AddImage( 97, 49, 9005 );
|
||||
AddImageTiled( 58, 39, 29, 390, 10460 );
|
||||
AddImageTiled( 412, 37, 31, 389, 10460 );
|
||||
AddLabel( 140, 60, 0x34, "The Old Fisherman" );
|
||||
|
||||
|
||||
AddHtml( 107, 140, 300, 230, "<BODY>" +
|
||||
//----------------------/----------------------------------------------/
|
||||
"<BASEFONT COLOR=YELLOW><I>James carefully inspects the jar</I><BR><BR>Now let me see... Yep! That'll do it!<BR><BR>" +
|
||||
"<BASEFONT COLOR=YELLOW>Thanks alot youngster! You can have this old pole here. I won't be needing it anymore.<BR><BR><I>James hands you his fishing pole</I><BR><BR>" +
|
||||
"<BASEFONT COLOR=YELLOW>Darn thing never caught nothin' but old boots anyhow. I wish ye better luck with it. Happy to see another fisherman around." +
|
||||
"<BASEFONT COLOR=YELLOW> Just not enough fisherman anymore.<BR><BR> Oh! By the way, if you come back I have a few more of them poles you could have, for the price of worms, of course!" +
|
||||
"</BODY>", false, true);
|
||||
|
||||
|
||||
AddImage( 430, 9, 10441);
|
||||
AddImageTiled( 40, 38, 17, 391, 9263 );
|
||||
AddImage( 6, 25, 10421 );
|
||||
AddImage( 34, 12, 10420 );
|
||||
AddImageTiled( 94, 25, 342, 15, 10304 );
|
||||
AddImageTiled( 40, 427, 415, 16, 10304 );
|
||||
AddImage( -10, 314, 10402 );
|
||||
AddImage( 56, 150, 10411 );
|
||||
AddImage( 155, 120, 2103 );
|
||||
AddImage( 136, 84, 96 );
|
||||
|
||||
AddButton( 225, 390, 0xF7, 0xF8, 0, GumpButtonType.Reply, 0 );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState state, RelayInfo info ) //Function for GumpButtonType.Reply Buttons
|
||||
{
|
||||
Mobile from = state.Mobile;
|
||||
|
||||
switch ( info.ButtonID )
|
||||
{
|
||||
case 0: //Case uses the ActionIDs defenied above. Case 0 defenies the actions for the button with the action id 0
|
||||
{
|
||||
//Cancel
|
||||
from.SendMessage( "Catch yourself a whopper! Thanks again for the worms!" );
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Worm : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Worm() : base( 0x1085 )
|
||||
{
|
||||
Name = "a worm";
|
||||
Hue = 1114;
|
||||
|
||||
}
|
||||
|
||||
public Worm( 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,78 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using System.Collections;
|
||||
using Server.Multis;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
|
||||
public class WormJarEmpty : Item
|
||||
{
|
||||
[Constructable]
|
||||
public WormJarEmpty() : this( null )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public WormJarEmpty ( string name ) : base ( 0x1005 )
|
||||
{
|
||||
Name = "Bait Jar (It's Empty)";
|
||||
Hue = 1113;
|
||||
}
|
||||
|
||||
public WormJarEmpty ( Serial serial ) : base ( serial )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public override void OnDoubleClick( Mobile m )
|
||||
|
||||
{
|
||||
Item [] a = m.Backpack.FindItemsByType( typeof( Worm ) );
|
||||
// are there at least 10 elements in the returned array?
|
||||
if ( a!= null && a.Length >= 10)
|
||||
{
|
||||
|
||||
Item b = m.Backpack.FindItemByType( typeof( WormJarEmpty ) );
|
||||
if ( b != null )
|
||||
{
|
||||
Item c = m.Backpack.FindItemByType( typeof(FertileDirt) );
|
||||
if ( c != null )
|
||||
{
|
||||
// delete the first 10 of them
|
||||
for(int i=0;i<10;i++) a[i].Delete();
|
||||
b.Delete();
|
||||
c.Delete();
|
||||
// and add the full jar of worms
|
||||
m.AddToBackpack( new WormJarFull() );
|
||||
m.SendMessage("The jar is full, hurry back to James for your reward!");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendMessage( "James wants this jar full of worms and fertile dirt. There is still room for more..." );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WormJarFull : Item
|
||||
{
|
||||
[Constructable]
|
||||
public WormJarFull() : base( 0x1007 )
|
||||
{
|
||||
Name = "Bait Jar (It's Full)";
|
||||
Hue = 1113;
|
||||
Weight = 1.0;
|
||||
|
||||
}
|
||||
|
||||
public WormJarFull( 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,181 @@
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
using Server.Engines.Harvest;
|
||||
using Server.ContextMenus;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AncientFishingPole30 : BaseAFP
|
||||
{
|
||||
|
||||
public SkillMod m_SkillMod;
|
||||
|
||||
[Constructable]
|
||||
public AncientFishingPole30() : base( 0x0DC0 )
|
||||
{
|
||||
Layer = Layer.OneHanded;
|
||||
Weight = 8.0;
|
||||
Hue = 1150;
|
||||
Name = "Ancient Fishing Pole";
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientFishingPole30( int uses ) : base( uses, 0x0DC0 )
|
||||
{
|
||||
Layer = Layer.OneHanded;
|
||||
Weight = 8.0;
|
||||
Hue = 1150;
|
||||
Name = "Ancient Fishing Pole";
|
||||
}
|
||||
|
||||
public override void AddNameProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.AddNameProperties( list );
|
||||
list.Add( 1062613, "+ 30" );
|
||||
}
|
||||
|
||||
public override bool OnEquip( Mobile m )
|
||||
{
|
||||
base.OnEquip( m );
|
||||
m_SkillMod = new DefaultSkillMod( SkillName.Fishing, true, 30 );
|
||||
m.AddSkillMod(m_SkillMod );
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnRemoved( object parent )
|
||||
{
|
||||
base.OnRemoved( parent );
|
||||
|
||||
if ( m_SkillMod != null )
|
||||
m_SkillMod.Remove();
|
||||
m_SkillMod = null;
|
||||
}
|
||||
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
Fishing.System.BeginHarvesting( from, this );
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries( from, list );
|
||||
|
||||
BaseHarvestTool.AddContextMenuEntries( from, this, list, Fishing.System );
|
||||
}
|
||||
|
||||
public AncientFishingPole30( 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 abstract class BaseAFP : Item, IUsesRemaining
|
||||
{
|
||||
private int m_UsesRemaining;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int UsesRemaining
|
||||
{
|
||||
get { return m_UsesRemaining; }
|
||||
set { m_UsesRemaining = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
public bool ShowUsesRemaining{ get{ return true; } set{} }
|
||||
|
||||
public BaseAFP( int itemID ) : this( 50, itemID )
|
||||
{
|
||||
}
|
||||
|
||||
public BaseAFP( int uses, int itemID ) : base( itemID )
|
||||
{
|
||||
m_UsesRemaining = uses;
|
||||
}
|
||||
|
||||
public BaseAFP( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
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 BaseAFP && check != tool )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
DisplayDurabilityTo( from );
|
||||
|
||||
base.OnSingleClick( from );
|
||||
}
|
||||
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( (int) m_UsesRemaining );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_UsesRemaining = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
using Server.Engines.Harvest;
|
||||
using Server.ContextMenus;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AncientFishingPole15 : BaseAFP
|
||||
{
|
||||
|
||||
public SkillMod m_SkillMod;
|
||||
|
||||
[Constructable]
|
||||
public AncientFishingPole15() : base( 0x0DC0 )
|
||||
{
|
||||
Layer = Layer.OneHanded;
|
||||
Weight = 8.0;
|
||||
Hue = 1150;
|
||||
Name = "Ancient Fishing Pole";
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientFishingPole15( int uses ) : base( uses, 0x0DC0 )
|
||||
{
|
||||
Layer = Layer.OneHanded;
|
||||
Weight = 8.0;
|
||||
Hue = 1150;
|
||||
Name = "Ancient Fishing Pole";
|
||||
}
|
||||
|
||||
public override void AddNameProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.AddNameProperties( list );
|
||||
list.Add( 1062613, "+ 15" );
|
||||
}
|
||||
|
||||
public override bool OnEquip( Mobile m )
|
||||
{
|
||||
base.OnEquip( m );
|
||||
m_SkillMod = new DefaultSkillMod( SkillName.Fishing, true, 15 );
|
||||
m.AddSkillMod(m_SkillMod );
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnRemoved( object parent )
|
||||
{
|
||||
base.OnRemoved( parent );
|
||||
|
||||
if ( m_SkillMod != null )
|
||||
m_SkillMod.Remove();
|
||||
m_SkillMod = null;
|
||||
}
|
||||
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
Fishing.System.BeginHarvesting( from, this );
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries( from, list );
|
||||
|
||||
BaseHarvestTool.AddContextMenuEntries( from, this, list, Fishing.System );
|
||||
}
|
||||
|
||||
public AncientFishingPole15( 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,90 @@
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
using Server.Engines.Harvest;
|
||||
using Server.ContextMenus;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AncientFishingPole60 : BaseAFP
|
||||
{
|
||||
|
||||
public SkillMod m_SkillMod;
|
||||
|
||||
[Constructable]
|
||||
public AncientFishingPole60() : base( 0x0DC0 )
|
||||
{
|
||||
Layer = Layer.OneHanded;
|
||||
Weight = 8.0;
|
||||
Hue = 1150;
|
||||
Name = "Ancient Fishing Pole";
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientFishingPole60( int uses ) : base( uses, 0x0DC0 )
|
||||
{
|
||||
Layer = Layer.OneHanded;
|
||||
Weight = 8.0;
|
||||
Hue = 1150;
|
||||
Name = "Ancient Fishing Pole";
|
||||
}
|
||||
|
||||
public override void AddNameProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.AddNameProperties( list );
|
||||
list.Add( 1062613, "+ 60" );
|
||||
}
|
||||
|
||||
public override bool OnEquip( Mobile m )
|
||||
{
|
||||
base.OnEquip( m );
|
||||
m_SkillMod = new DefaultSkillMod( SkillName.Fishing, true, 60 );
|
||||
m.AddSkillMod(m_SkillMod );
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnRemoved( object parent )
|
||||
{
|
||||
base.OnRemoved( parent );
|
||||
|
||||
if ( m_SkillMod != null )
|
||||
m_SkillMod.Remove();
|
||||
m_SkillMod = null;
|
||||
}
|
||||
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
Fishing.System.BeginHarvesting( from, this );
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries( from, list );
|
||||
|
||||
BaseHarvestTool.AddContextMenuEntries( from, this, list, Fishing.System );
|
||||
}
|
||||
|
||||
public AncientFishingPole60( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user