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
|
|
@ -1508,7 +1508,7 @@ namespace Server
|
|||
{
|
||||
get
|
||||
{
|
||||
return (Movable && Visible);
|
||||
return (Movable && Visible && Spawner == null);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1541,6 +1541,15 @@ namespace Server
|
|||
|
||||
public virtual bool StackWith( Mobile from, Item dropped, bool playSound )
|
||||
{
|
||||
// TODO: OSI actually just ignores the stacking attempt and places the item over it, can we do that?
|
||||
if( Nontransferable || dropped.Nontransferable )
|
||||
{
|
||||
if ( dropped.Nontransferable )
|
||||
HandleInvalidTransfer( from );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( dropped.Stackable && Stackable && dropped.GetType() == GetType() && dropped.ItemID == ItemID && dropped.Hue == Hue && dropped.Name == Name && (dropped.Amount + Amount) <= 60000 && dropped != this )
|
||||
{
|
||||
if ( m_LootType != dropped.m_LootType )
|
||||
|
|
@ -2840,7 +2849,7 @@ namespace Server
|
|||
{
|
||||
get
|
||||
{
|
||||
return (QuestItem ? QuestItemHue : m_Hue);
|
||||
return m_Hue;
|
||||
}
|
||||
set
|
||||
{
|
||||
|
|
@ -2854,10 +2863,7 @@ namespace Server
|
|||
}
|
||||
}
|
||||
|
||||
public virtual int QuestItemHue
|
||||
{
|
||||
get { return 0x04EA; } //HMMMM... For EA?
|
||||
}
|
||||
public const int QuestItemHue = 0x4EA; // Hmmmm... "for EA"?
|
||||
|
||||
public virtual bool Nontransferable
|
||||
{
|
||||
|
|
@ -2866,8 +2872,9 @@ namespace Server
|
|||
|
||||
public virtual void HandleInvalidTransfer( Mobile from )
|
||||
{
|
||||
// OSI sends 1074769, bug!
|
||||
if( QuestItem )
|
||||
from.SendLocalizedMessage( 1074769 ); // An item must be in your backpack (and not in a container within) to be toggled as a quest item.
|
||||
from.SendLocalizedMessage( 1049343 ); // You can only drop quest items into the top-most level of your backpack while you still need them for your quest.
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
|
|
@ -3797,7 +3804,7 @@ namespace Server
|
|||
|
||||
public virtual bool OnDroppedToMobile( Mobile from, Mobile target )
|
||||
{
|
||||
if( Nontransferable && from.Player && from.AccessLevel <= AccessLevel.GameMaster )
|
||||
if( Nontransferable && from.Player )
|
||||
{
|
||||
HandleInvalidTransfer( from );
|
||||
return false;
|
||||
|
|
@ -3830,7 +3837,7 @@ namespace Server
|
|||
{
|
||||
return false;
|
||||
}
|
||||
else if( Nontransferable && from.Player && target != from.Backpack && from.AccessLevel <= AccessLevel.GameMaster )
|
||||
else if( Nontransferable && from.Player && target != from.Backpack )
|
||||
{
|
||||
HandleInvalidTransfer( from );
|
||||
return false;
|
||||
|
|
@ -3851,7 +3858,7 @@ namespace Server
|
|||
return false;
|
||||
else if ( !from.OnDroppedItemOnto( this, target ) )
|
||||
return false;
|
||||
else if( Nontransferable && from.Player && from.AccessLevel <= AccessLevel.GameMaster )
|
||||
else if( Nontransferable && from.Player )
|
||||
{
|
||||
HandleInvalidTransfer( from );
|
||||
return false;
|
||||
|
|
@ -3885,7 +3892,7 @@ namespace Server
|
|||
|
||||
public virtual bool OnDroppedToWorld( Mobile from, Point3D p )
|
||||
{
|
||||
if( Nontransferable && from.Player && from.AccessLevel <= AccessLevel.GameMaster )
|
||||
if( Nontransferable && from.Player )
|
||||
{
|
||||
HandleInvalidTransfer( from );
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -4201,7 +4201,7 @@ namespace Server
|
|||
|
||||
public virtual void Use( Item item )
|
||||
{
|
||||
if( item == null || item.Deleted || this.Deleted )
|
||||
if( item == null || item.Deleted || item.QuestItem || this.Deleted )
|
||||
return;
|
||||
|
||||
DisruptiveAction();
|
||||
|
|
@ -4303,6 +4303,13 @@ namespace Server
|
|||
{
|
||||
reject = LRReason.CannotLift;
|
||||
}
|
||||
else if( item.Nontransferable && amount != item.Amount )
|
||||
{
|
||||
if ( item.QuestItem )
|
||||
from.SendLocalizedMessage( 1074868 ); // Stacks of quest items cannot be unstacked.
|
||||
|
||||
reject = LRReason.CannotLift;
|
||||
}
|
||||
else if( !item.CheckLift( from, item, ref reject ) )
|
||||
{
|
||||
}
|
||||
|
|
@ -4354,7 +4361,7 @@ namespace Server
|
|||
|
||||
foreach( NetState ns in eable )
|
||||
{
|
||||
if( !ns.StygianAbyss && ns.Mobile != from && ns.Mobile.CanSee( from ) )
|
||||
if( ns.Mobile != from && ns.Mobile.CanSee( from ) )
|
||||
{
|
||||
if( p == null )
|
||||
{
|
||||
|
|
@ -4492,7 +4499,7 @@ namespace Server
|
|||
|
||||
foreach( NetState ns in eable )
|
||||
{
|
||||
if( !ns.StygianAbyss && ns.Mobile != this && ns.Mobile.CanSee( this ) )
|
||||
if( ns.Mobile != this && ns.Mobile.CanSee( this ) )
|
||||
{
|
||||
if( p == null )
|
||||
{
|
||||
|
|
@ -9693,6 +9700,13 @@ namespace Server
|
|||
/// <returns>True if the request is accepted, false if otherwise.</returns>
|
||||
public virtual bool OnEquip( Item item )
|
||||
{
|
||||
// For some reason OSI allows equipping quest items, but they are unmarked in the process
|
||||
if ( item.QuestItem )
|
||||
{
|
||||
item.QuestItem = false;
|
||||
SendLocalizedMessage( 1074769 ); // An item must be in your backpack (and not in a container within) to be toggled as a quest item.
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -820,6 +820,18 @@ namespace Server.Network
|
|||
|
||||
break;
|
||||
}
|
||||
case 0x2F: // Old scroll double click
|
||||
{
|
||||
/*
|
||||
* This command is still sent for items 0xEF3 - 0xEF9
|
||||
*
|
||||
* Command is one of three, depending on the item ID of the scroll:
|
||||
* - [scroll serial]
|
||||
* - [scroll serial] [target serial]
|
||||
* - [scroll serial] [x] [y] [z]
|
||||
*/
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
Console.WriteLine( "Client: {0}: Unknown text-command type 0x{1:X2}: {2}", state, type, command );
|
||||
|
|
|
|||
|
|
@ -1837,7 +1837,7 @@ namespace Server.Network
|
|||
m_Stream.Write( (short) item.X );
|
||||
m_Stream.Write( (short) item.Y );
|
||||
m_Stream.Write( (int) parentSerial );
|
||||
m_Stream.Write( (ushort) item.Hue );
|
||||
m_Stream.Write( (ushort) ( item.QuestItem ? Item.QuestItemHue : item.Hue ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1865,7 +1865,7 @@ namespace Server.Network
|
|||
m_Stream.Write( (short) item.Y );
|
||||
m_Stream.Write( (byte) 0 ); // Grid Location?
|
||||
m_Stream.Write( (int) parentSerial );
|
||||
m_Stream.Write( (ushort) item.Hue );
|
||||
m_Stream.Write( (ushort) ( item.QuestItem ? Item.QuestItemHue : item.Hue ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1899,7 +1899,7 @@ namespace Server.Network
|
|||
m_Stream.Write( (short) loc.m_X );
|
||||
m_Stream.Write( (short) loc.m_Y );
|
||||
m_Stream.Write( (int) beheld.Serial );
|
||||
m_Stream.Write( (ushort) child.Hue );
|
||||
m_Stream.Write( (ushort) ( child.QuestItem ? Item.QuestItemHue : child.Hue ) );
|
||||
|
||||
++written;
|
||||
}
|
||||
|
|
@ -1941,7 +1941,7 @@ namespace Server.Network
|
|||
m_Stream.Write( (short) loc.m_Y );
|
||||
m_Stream.Write( (byte) 0 ); // Grid Location?
|
||||
m_Stream.Write( (int) beheld.Serial );
|
||||
m_Stream.Write( (ushort) child.Hue );
|
||||
m_Stream.Write( (ushort) ( child.QuestItem ? Item.QuestItemHue : child.Hue ) );
|
||||
|
||||
++written;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ namespace Server
|
|||
public abstract void WriteGuildSet<T>( HashSet<T> set ) where T : BaseGuild;
|
||||
public abstract void WriteGuildSet<T>( HashSet<T> set, bool tidy ) where T : BaseGuild;
|
||||
#endif
|
||||
//Stupid compiler won't notice there 'where' to differentiate the generic methods.
|
||||
// Compiler won't notice their 'where' to differentiate the generic methods.
|
||||
}
|
||||
|
||||
public class BinaryFileWriter : GenericWriter
|
||||
|
|
|
|||
|
|
@ -833,6 +833,9 @@ namespace Server
|
|||
|
||||
#region Random Hues
|
||||
|
||||
/// <summary>
|
||||
/// Random pink, blue, green, orange, red or yellow hue
|
||||
/// </summary>
|
||||
public static int RandomNondyedHue()
|
||||
{
|
||||
switch ( Random( 6 ) )
|
||||
|
|
@ -848,61 +851,97 @@ namespace Server
|
|||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Random hue in the range 1201-1254
|
||||
/// </summary>
|
||||
public static int RandomPinkHue()
|
||||
{
|
||||
return Random( 1201, 54 );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Random hue in the range 1301-1354
|
||||
/// </summary>
|
||||
public static int RandomBlueHue()
|
||||
{
|
||||
return Random( 1301, 54 );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Random hue in the range 1401-1454
|
||||
/// </summary>
|
||||
public static int RandomGreenHue()
|
||||
{
|
||||
return Random( 1401, 54 );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Random hue in the range 1501-1554
|
||||
/// </summary>
|
||||
public static int RandomOrangeHue()
|
||||
{
|
||||
return Random( 1501, 54 );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Random hue in the range 1601-1654
|
||||
/// </summary>
|
||||
public static int RandomRedHue()
|
||||
{
|
||||
return Random( 1601, 54 );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Random hue in the range 1701-1754
|
||||
/// </summary>
|
||||
public static int RandomYellowHue()
|
||||
{
|
||||
return Random( 1701, 54 );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Random hue in the range 1801-1908
|
||||
/// </summary>
|
||||
public static int RandomNeutralHue()
|
||||
{
|
||||
return Random( 1801, 108 );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Random hue in the range 2001-2018
|
||||
/// </summary>
|
||||
public static int RandomSnakeHue()
|
||||
{
|
||||
return Random( 2001, 18 );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Random hue in the range 2101-2130
|
||||
/// </summary>
|
||||
public static int RandomBirdHue()
|
||||
{
|
||||
return Random( 2101, 30 );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Random hue in the range 2201-2224
|
||||
/// </summary>
|
||||
public static int RandomSlimeHue()
|
||||
{
|
||||
return Random( 2201, 24 );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Random hue in the range 2301-2318
|
||||
/// </summary>
|
||||
public static int RandomAnimalHue()
|
||||
{
|
||||
return Random( 2301, 18 );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Random hue in the range 2401-2430
|
||||
/// </summary>
|
||||
public static int RandomMetalHue()
|
||||
{
|
||||
return Random( 2401, 30 );
|
||||
|
|
@ -918,11 +957,25 @@ namespace Server
|
|||
return hue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Random hue in the range 2-1001
|
||||
/// </summary>
|
||||
public static int RandomDyedHue()
|
||||
{
|
||||
return Random( 2, 1000 );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Random hue from 0x62, 0x71, 0x03, 0x0D, 0x13, 0x1C, 0x21, 0x30, 0x37, 0x3A, 0x44, 0x59
|
||||
/// </summary>
|
||||
public static int RandomBrightHue()
|
||||
{
|
||||
if ( Utility.RandomDouble() < 0.1 )
|
||||
return Utility.RandomList( 0x62, 0x71 );
|
||||
|
||||
return Utility.RandomList( 0x03, 0x0D, 0x13, 0x1C, 0x21, 0x30, 0x37, 0x3A, 0x44, 0x59 );
|
||||
}
|
||||
|
||||
//[Obsolete( "Depreciated, use the methods for the Mobile's race", false )]
|
||||
public static int ClipSkinHue( int hue )
|
||||
{
|
||||
|
|
@ -1234,11 +1287,13 @@ namespace Server
|
|||
{
|
||||
AssignRandomHair( m, true );
|
||||
}
|
||||
|
||||
public static void AssignRandomHair( Mobile m, int hue )
|
||||
{
|
||||
m.HairItemID = m.Race.RandomHair( m );
|
||||
m.HairHue = hue;
|
||||
}
|
||||
|
||||
public static void AssignRandomHair( Mobile m, bool randomHue )
|
||||
{
|
||||
m.HairItemID = m.Race.RandomHair( m );
|
||||
|
|
@ -1251,11 +1306,13 @@ namespace Server
|
|||
{
|
||||
AssignRandomFacialHair( m, true );
|
||||
}
|
||||
|
||||
public static void AssignRandomFacialHair( Mobile m, int hue )
|
||||
{
|
||||
m.FacialHairHue = m.Race.RandomFacialHair( m );
|
||||
m.FacialHairItemID = m.Race.RandomFacialHair( m );
|
||||
m.FacialHairHue = hue;
|
||||
}
|
||||
|
||||
public static void AssignRandomFacialHair( Mobile m, bool randomHue )
|
||||
{
|
||||
m.FacialHairItemID = m.Race.RandomFacialHair( m );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue