ML quest system; first SVN release.
Secondary changes: - Region fixes, mainly for New Haven. - Recipe system changes. - Enabled ML craftables. - Dyeing/cutting restrictions for quest items. - Moved IsInvulnerable from BaseVendor to BaseCreature. - Moved RandomBrightHue to Utility. - Items no longer decay when attached to a spawner. - Quest item hue is now faked through packets, instead of overriding Hue. - Re-enabled item drag effects for SA clients. - Fixed AssignRandomFacialHair bug in Utility. - Added random hue comments to Utility.
This commit is contained in:
parent
5c7af18dfb
commit
35fbffdb51
167 changed files with 23218 additions and 234 deletions
|
|
@ -252,23 +252,22 @@ namespace Server.Items
|
|||
|
||||
Container sBag = this;
|
||||
|
||||
List<Item> Scissorables = sBag.FindItemsByType<Item>();
|
||||
List<Item> scissorables = sBag.FindItemsByType<Item>();
|
||||
|
||||
for (int i = Scissorables.Count - 1; i >= 0; i--)
|
||||
for ( int i = scissorables.Count - 1; i >= 0; --i )
|
||||
{
|
||||
Item item = scissorables[i];
|
||||
|
||||
if ( item is IScissorable )
|
||||
{
|
||||
Item item = Scissorables[i];
|
||||
if( item is IScissorable )
|
||||
{
|
||||
if( ( (IScissorable)item ).Scissor( from, scissors ) )
|
||||
{
|
||||
salvaged++;
|
||||
}
|
||||
else
|
||||
{
|
||||
notSalvaged++;
|
||||
}
|
||||
}
|
||||
IScissorable scissorable = (IScissorable)item;
|
||||
|
||||
if ( Scissors.CanScissor( from, scissorable ) && scissorable.Scissor( from, scissors ) )
|
||||
++salvaged;
|
||||
else
|
||||
++notSalvaged;
|
||||
}
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage( 1079974, String.Format( "{0}\t{1}", salvaged, salvaged + notSalvaged ) ); // Salvaged: ~1_COUNT~/~2_NUM~ tailored items
|
||||
|
||||
|
|
|
|||
74
Scripts/Items/New Haven Quest Rewards/HammerOfHephaestus.cs
Normal file
74
Scripts/Items/New Haven Quest Rewards/HammerOfHephaestus.cs
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
using System;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0x13E3, 0x13E4 )]
|
||||
public class HammerOfHephaestus : SmithHammer
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1077740; } } // Hammer of Hephaestus
|
||||
|
||||
public static readonly TimeSpan RechargeDelay = TimeSpan.FromMinutes( 5 );
|
||||
|
||||
[Constructable]
|
||||
public HammerOfHephaestus()
|
||||
{
|
||||
UsesRemaining = 20;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
// TODO: Blacksmith +10 bonus when equipped
|
||||
|
||||
StartRechargeTimer();
|
||||
}
|
||||
|
||||
public override bool BreakOnDepletion { get { return false; } }
|
||||
/* Note:
|
||||
* On EA, it also leaves the crafting gump open when it reaches 0 charges.
|
||||
* When crafting again, only then the crafting gump closes with the 1072306 system message.
|
||||
*/
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !IsChildOf( from.Backpack ) && Parent != from ) // TODO: These checks don't match EA, but they match BaseTool for now
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
else if ( UsesRemaining <= 0 )
|
||||
from.SendLocalizedMessage( 1072306 ); // You must wait a moment for it to recharge.
|
||||
else
|
||||
base.OnDoubleClick( from );
|
||||
}
|
||||
|
||||
private void StartRechargeTimer()
|
||||
{
|
||||
// TODO: Needs work
|
||||
//Timer.DelayCall( RechargeDelay, RechargeDelay, new TimerCallback( Recharge ) );
|
||||
}
|
||||
|
||||
public void Recharge()
|
||||
{
|
||||
// TODO: Stop timer at 20? Count downtime? Something more generic so we can use it for JacobsPickaxe too (both are IUsesRemaining)?
|
||||
if ( UsesRemaining < 20 )
|
||||
++UsesRemaining;
|
||||
}
|
||||
|
||||
public HammerOfHephaestus( 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();
|
||||
|
||||
StartRechargeTimer();
|
||||
}
|
||||
}
|
||||
}
|
||||
40
Scripts/Items/New Haven Quest Rewards/JacobsPickaxe.cs
Normal file
40
Scripts/Items/New Haven Quest Rewards/JacobsPickaxe.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class JacobsPickaxe : Pickaxe
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1077758; } } // Jacob's Pickaxe
|
||||
|
||||
// TODO: Recharges 1 use every 5 minutes. Doesn't break when it reaches 0, you get a system message "You must wait a moment for it to recharge" 1072306 if you attempt to use it with no uses remaining.
|
||||
|
||||
[Constructable]
|
||||
public JacobsPickaxe()
|
||||
{
|
||||
UsesRemaining = 20;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
SkillBonuses.SetValues( 0, SkillName.Mining, 10.0 );
|
||||
}
|
||||
|
||||
public JacobsPickaxe( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -23,13 +23,12 @@ namespace Server.Items
|
|||
{
|
||||
get
|
||||
{
|
||||
if( Recipe.Recipes.ContainsKey( m_RecipeID ) )
|
||||
if ( Recipe.Recipes.ContainsKey( m_RecipeID ) )
|
||||
return Recipe.Recipes[m_RecipeID];
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -177,7 +177,11 @@ namespace Server.Items
|
|||
{
|
||||
Item item = (Item)targeted;
|
||||
|
||||
if ( item is IDyable && m_Tub.AllowDyables )
|
||||
if ( item.QuestItem )
|
||||
{
|
||||
from.SendLocalizedMessage( 1151836 ); // You may not dye toggled quest items.
|
||||
}
|
||||
else if ( 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.
|
||||
|
|
|
|||
|
|
@ -77,15 +77,15 @@ namespace Server.Items
|
|||
{
|
||||
IScissorable obj = (IScissorable) targeted;
|
||||
|
||||
if( obj.Scissor( from, m_Item ) )
|
||||
if ( CanScissor( from, obj ) && obj.Scissor( from, m_Item ) )
|
||||
from.PlaySound( 0x248 );
|
||||
}
|
||||
}
|
||||
else if( targeted is IScissorable )
|
||||
else if ( targeted is IScissorable )
|
||||
{
|
||||
IScissorable obj = (IScissorable)targeted;
|
||||
|
||||
if( obj.Scissor( from, m_Item ) )
|
||||
if ( CanScissor( from, obj ) && obj.Scissor( from, m_Item ) )
|
||||
from.PlaySound( 0x248 );
|
||||
}
|
||||
else
|
||||
|
|
@ -100,12 +100,25 @@ namespace Server.Items
|
|||
{
|
||||
IScissorable obj = (IScissorable) targeted;
|
||||
|
||||
if ( obj.Scissor( from, m_Item ) )
|
||||
if ( CanScissor( from, obj ) && obj.Scissor( from, m_Item ) )
|
||||
from.PlaySound( 0x248 );
|
||||
}
|
||||
else
|
||||
base.OnNonlocalTarget( from, targeted );
|
||||
}
|
||||
}
|
||||
|
||||
public static bool CanScissor( Mobile from, IScissorable obj )
|
||||
{
|
||||
if ( obj is Item && ( (Item)obj ).Nontransferable )
|
||||
{
|
||||
from.SendLocalizedMessage( 502440 ); // Scissors can not be used on that to produce anything.
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: Move other general checks from the different implementations here
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ namespace Server.Items
|
|||
set { m_UsesRemaining = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
public virtual bool BreakOnDepletion { get { return true; } }
|
||||
|
||||
public void ScaleUses()
|
||||
{
|
||||
m_UsesRemaining = (m_UsesRemaining * GetUsesScalar()) / 100;
|
||||
|
|
|
|||
|
|
@ -13,10 +13,11 @@ namespace Server.Mobiles
|
|||
{
|
||||
public override bool Commandable{ get{ return false; } }
|
||||
public override bool InitialInnocent{ get{ return true; } }
|
||||
public virtual bool IsInvulnerable{ get{ return true; } }
|
||||
//public override bool IsInvulnerable{ get{ return true; } } // TODO: Wailing banshees are NOT invulnerable, are any of the others?
|
||||
|
||||
public BaseTalismanSummon() : base( AIType.AI_Melee, FightMode.None, 10, 1, 0.2, 0.4 )
|
||||
{
|
||||
// TODO: Stats/skills
|
||||
}
|
||||
|
||||
public BaseTalismanSummon( Serial serial ) : base( serial )
|
||||
|
|
@ -368,8 +369,10 @@ namespace Server.Mobiles
|
|||
|
||||
public override void OnThink()
|
||||
{
|
||||
/*
|
||||
if ( m_NextWave < DateTime.Now )
|
||||
AreaHeatDamage();
|
||||
*/
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
|
|
@ -386,6 +389,9 @@ namespace Server.Mobiles
|
|||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
|
||||
/*
|
||||
// An area attack that only damages staff, wtf?
|
||||
|
||||
private DateTime m_NextWave;
|
||||
|
||||
public void AreaHeatDamage()
|
||||
|
|
@ -417,6 +423,7 @@ namespace Server.Mobiles
|
|||
|
||||
m_NextWave = DateTime.Now + TimeSpan.FromSeconds( 3 );
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
public class SummonedOrcBrute : BaseTalismanSummon
|
||||
|
|
|
|||
|
|
@ -1,19 +1,31 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Engines.MLQuests.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BoneMachete : ElvenMachete
|
||||
public class BoneMachete : ElvenMachete, ITicket
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1020526; } } // bone machete
|
||||
public override WeaponAbility PrimaryAbility { get { return null; } }
|
||||
public override WeaponAbility SecondaryAbility { get { return null; } }
|
||||
|
||||
public override int PhysicalResistance { get { return 1; } }
|
||||
public override int FireResistance { get { return 1; } }
|
||||
public override int ColdResistance { get { return 1; } }
|
||||
public override int PoisonResistance { get { return 1; } }
|
||||
public override int EnergyResistance { get { return 1; } }
|
||||
|
||||
public override int InitMinHits { get { return 5; } }
|
||||
public override int InitMaxHits { get { return 5; } }
|
||||
|
||||
[Constructable]
|
||||
public BoneMachete()
|
||||
{
|
||||
// TODO attributes
|
||||
ItemID = 0x20E;
|
||||
}
|
||||
|
||||
public BoneMachete( Serial serial ) : base( serial )
|
||||
public BoneMachete( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -30,5 +42,22 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
|
||||
#region ITicket Members
|
||||
|
||||
public void OnTicketUsed( Mobile from )
|
||||
{
|
||||
if ( Utility.RandomDouble() < 0.25 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1075007 ); // Your bone handled machete snaps in half as you force your way through the poisonous undergrowth.
|
||||
Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1075008 ); // Your bone handled machete has grown dull but you still manage to force your way past the venomous branches.
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue