#W# Source and Scripts added. Added Scripts/Settings.cs to expose some basic tweak able settings.
This commit is contained in:
parent
b51c58f514
commit
3045c83799
3512 changed files with 627673 additions and 0 deletions
|
|
@ -0,0 +1,46 @@
|
|||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.Quests.Samurai
|
||||
{
|
||||
public class HaochisKatana : QuestItem
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1063165; } } // Daimyo Haochi's Katana
|
||||
|
||||
[Constructable]
|
||||
public HaochisKatana() : base( 0x13FF )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public HaochisKatana( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override bool CanDrop( PlayerMobile player )
|
||||
{
|
||||
HaochisTrialsQuest qs = player.Quest as HaochisTrialsQuest;
|
||||
|
||||
if ( qs == null )
|
||||
return true;
|
||||
|
||||
//return !qs.IsObjectiveInProgress( typeof( FifthTrialReturnObjective ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
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,80 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests.Samurai
|
||||
{
|
||||
public class HaochisKatanaGenerator : Item
|
||||
{
|
||||
[Constructable]
|
||||
public HaochisKatanaGenerator() : base( 0x1B7B )
|
||||
{
|
||||
Visible = false;
|
||||
Name = "Haochi's katana generator";
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public override bool OnMoveOver( Mobile m )
|
||||
{
|
||||
PlayerMobile player = m as PlayerMobile;
|
||||
|
||||
if ( player != null )
|
||||
{
|
||||
QuestSystem qs = player.Quest;
|
||||
|
||||
if ( qs is HaochisTrialsQuest )
|
||||
{
|
||||
if ( HaochisTrialsQuest.HasLostHaochisKatana( player ) )
|
||||
{
|
||||
Item katana = new HaochisKatana();
|
||||
|
||||
if ( !player.PlaceInBackpack( katana ) )
|
||||
{
|
||||
katana.Delete();
|
||||
player.SendLocalizedMessage( 1046260 ); // You need to clear some space in your inventory to continue with the quest. Come back here when you have more space in your inventory.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QuestObjective obj = qs.FindObjective( typeof( FifthTrialIntroObjective ) );
|
||||
|
||||
if ( obj != null && !obj.Completed )
|
||||
{
|
||||
Item katana = new HaochisKatana();
|
||||
|
||||
if ( player.PlaceInBackpack( katana ) )
|
||||
{
|
||||
obj.Complete();
|
||||
}
|
||||
else
|
||||
{
|
||||
katana.Delete();
|
||||
player.SendLocalizedMessage( 1046260 ); // You need to clear some space in your inventory to continue with the quest. Come back here when you have more space in your inventory.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return base.OnMoveOver( m );
|
||||
}
|
||||
|
||||
public HaochisKatanaGenerator( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Engines.Quests.Samurai
|
||||
{
|
||||
public class HaochisTreasureChest : WoodenFootLocker
|
||||
{
|
||||
[Constructable]
|
||||
public HaochisTreasureChest()
|
||||
{
|
||||
Movable = false;
|
||||
|
||||
GenerateTreasure();
|
||||
}
|
||||
|
||||
public HaochisTreasureChest( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override bool IsDecoContainer{ get{ return false; } }
|
||||
|
||||
private void GenerateTreasure()
|
||||
{
|
||||
for ( int i = this.Items.Count - 1; i >= 0; i-- )
|
||||
this.Items[i].Delete();
|
||||
|
||||
for ( int i = 0; i < 75; i++ )
|
||||
{
|
||||
switch ( Utility.Random( 3 ) )
|
||||
{
|
||||
case 0: DropItem( new GoldBracelet() ); break;
|
||||
case 1: DropItem( new GoldRing() ); break;
|
||||
case 2: DropItem( Loot.RandomGem() ); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckHold( Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckItemUse( Mobile from, Item item )
|
||||
{
|
||||
return item == this;
|
||||
}
|
||||
|
||||
public override bool CheckLift( Mobile from, Item item, ref LRReason reject )
|
||||
{
|
||||
if ( from.AccessLevel >= AccessLevel.GameMaster )
|
||||
return true;
|
||||
|
||||
PlayerMobile player = from as PlayerMobile;
|
||||
|
||||
if ( player != null && player.Quest is HaochisTrialsQuest )
|
||||
{
|
||||
FifthTrialIntroObjective obj = player.Quest.FindObjective( typeof( FifthTrialIntroObjective ) ) as FifthTrialIntroObjective;
|
||||
|
||||
if ( obj != null )
|
||||
{
|
||||
if ( obj.StolenTreasure )
|
||||
from.SendLocalizedMessage( 1063247 ); // The guard is watching you carefully! It would be unwise to remove another item from here.
|
||||
else
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnItemLifted( Mobile from, Item item )
|
||||
{
|
||||
PlayerMobile player = from as PlayerMobile;
|
||||
|
||||
if ( player != null && player.Quest is HaochisTrialsQuest )
|
||||
{
|
||||
FifthTrialIntroObjective obj = player.Quest.FindObjective( typeof( FifthTrialIntroObjective ) ) as FifthTrialIntroObjective;
|
||||
|
||||
if ( obj != null )
|
||||
obj.StolenTreasure = true;
|
||||
}
|
||||
|
||||
Timer.DelayCall( TimeSpan.FromMinutes( 2.0 ), new TimerCallback( GenerateTreasure ) );
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( GenerateTreasure ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
79
Scripts/Engines/Quests/Haochi's Trials/Items/HonorCandle.cs
Normal file
79
Scripts/Engines/Quests/Haochi's Trials/Items/HonorCandle.cs
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests.Samurai
|
||||
{
|
||||
public class HonorCandle : CandleLong
|
||||
{
|
||||
private static readonly TimeSpan LitDuration = TimeSpan.FromSeconds( 20.0 );
|
||||
|
||||
public override int LitSound{ get{ return 0; } }
|
||||
public override int UnlitSound{ get{ return 0; } }
|
||||
|
||||
[Constructable]
|
||||
public HonorCandle()
|
||||
{
|
||||
Movable = false;
|
||||
Duration = LitDuration;
|
||||
}
|
||||
|
||||
public HonorCandle( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
bool wasBurning = Burning;
|
||||
|
||||
base.OnDoubleClick( from );
|
||||
|
||||
if ( !wasBurning && Burning )
|
||||
{
|
||||
PlayerMobile player = from as PlayerMobile;
|
||||
|
||||
if ( player == null )
|
||||
return;
|
||||
|
||||
QuestSystem qs = player.Quest;
|
||||
|
||||
if ( qs != null && qs is HaochisTrialsQuest )
|
||||
{
|
||||
QuestObjective obj = qs.FindObjective( typeof( SixthTrialIntroObjective ) );
|
||||
|
||||
if ( obj != null && !obj.Completed )
|
||||
obj.Complete();
|
||||
|
||||
this.SendLocalizedMessageTo( from, 1063251 ); // You light a candle in honor.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Burn()
|
||||
{
|
||||
Douse();
|
||||
}
|
||||
|
||||
public override void Douse()
|
||||
{
|
||||
base.Douse();
|
||||
|
||||
Duration = LitDuration;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue