- Future ML craftables added to the special repair list until the craft system is updated.
- Items can now be repaired while wearing them. - Items can now be fortified while wearing them. - Fixed repair deed messages not sending. - Sound effect added to powder of fortifying. - Map issue for fishing and SOSs fixed, where it would not allow fishing in empty resource banks when not on the target SOS map. - Added proximity spawner. - Improved spawner mouseover menu, now also shows types set on the spawner which are not yet spawned. - Fixed spawners only deleting half of their spawned objects when deleted. - Added the ability to set TextDefinition objects in the props gump. - WaitTeleporters now round delays to nearest in the remaining time messages. - Updated TextDefinition to be more usable; made it parsable from string and added safe serialization/deserialization methods. - Improved checking whether a mobile can flee. - Monsters that give ML minor artifacts will no longer flee when low on hits (like paragons). - Monsters that give ML minor artifacts will no longer spawn as paragon. - Fixed issue with pets not eating certain foods. - AI and targeting fixes for Red Death, Pyre and Swoop. - Fame and karma added to Rend. - Swoop corrected to have 0 karma. - Stat and skill tweaks for Putrefier. - Changelings will no longer show their fame title when morphed. - Added travel restrictions for ML dungeons. - Fixed issue of travel restriction message displaying twice. - Monster teleporting is no longer affected by region travel restrictions.
This commit is contained in:
parent
4bcde77cc2
commit
a0e13d5007
25 changed files with 432 additions and 140 deletions
|
|
@ -101,7 +101,7 @@ namespace Server.Engines.Craft
|
|||
|
||||
private bool IsSpecialClothing( BaseClothing clothing )
|
||||
{
|
||||
// Armor repairable but not craftable
|
||||
// Clothing repairable but not craftable
|
||||
|
||||
if( m_CraftSystem is DefTailoring )
|
||||
{
|
||||
|
|
@ -132,12 +132,41 @@ namespace Server.Engines.Craft
|
|||
}
|
||||
else if ( m_CraftSystem is DefBlacksmithy )
|
||||
{
|
||||
return ( weapon is Pitchfork );
|
||||
return ( weapon is Pitchfork )
|
||||
#region Temporary
|
||||
// TODO: Make these items craftable
|
||||
|| ( weapon is RadiantScimitar )
|
||||
|| ( weapon is WarCleaver )
|
||||
|| ( weapon is ElvenSpellblade )
|
||||
|| ( weapon is AssassinSpike )
|
||||
|| ( weapon is Leafblade )
|
||||
|| ( weapon is RuneBlade )
|
||||
|| ( weapon is ElvenMachete )
|
||||
|| ( weapon is OrnateAxe )
|
||||
|| ( weapon is DiamondMace );
|
||||
#endregion
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool IsSpecialArmor( BaseArmor armor )
|
||||
{
|
||||
// Armor repairable but not craftable
|
||||
|
||||
#region Temporary
|
||||
// TODO: Make these items craftable
|
||||
if ( m_CraftSystem is DefBlacksmithy )
|
||||
{
|
||||
return ( armor is Circlet )
|
||||
|| ( armor is RoyalCirclet )
|
||||
|| ( armor is GemmedCirclet );
|
||||
}
|
||||
#endregion
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
int number;
|
||||
|
|
@ -149,8 +178,8 @@ namespace Server.Engines.Craft
|
|||
bool usingDeed = (m_Deed != null);
|
||||
bool toDelete = false;
|
||||
|
||||
//TODO: Make a IRepairable
|
||||
|
||||
// TODO: Make an IRepairable
|
||||
|
||||
if ( m_CraftSystem.CanCraft( from, m_Tool, targeted.GetType() ) == 1044267 )
|
||||
{
|
||||
number = 1044282; // You must be near a forge and and anvil to repair items. * Yes, there are two and's *
|
||||
|
|
@ -244,7 +273,7 @@ namespace Server.Engines.Craft
|
|||
{
|
||||
number = (usingDeed)? 1061136 : 1044277; // That item cannot be repaired. // You cannot repair that item with this type of repair contract.
|
||||
}
|
||||
else if ( !weapon.IsChildOf( from.Backpack ) )
|
||||
else if ( !weapon.IsChildOf( from.Backpack ) && ( !Core.ML || weapon.Parent != from ) )
|
||||
{
|
||||
number = 1044275; // The item must be in your backpack to repair it.
|
||||
}
|
||||
|
|
@ -301,11 +330,11 @@ namespace Server.Engines.Craft
|
|||
toWeaken = 3;
|
||||
}
|
||||
|
||||
if ( m_CraftSystem.CraftItems.SearchForSubclass( armor.GetType() ) == null )
|
||||
if ( m_CraftSystem.CraftItems.SearchForSubclass( armor.GetType() ) == null && !IsSpecialArmor( armor ) )
|
||||
{
|
||||
number = (usingDeed)? 1061136 : 1044277; // That item cannot be repaired. // You cannot repair that item with this type of repair contract.
|
||||
}
|
||||
else if ( !armor.IsChildOf( from.Backpack ) )
|
||||
else if ( !armor.IsChildOf( from.Backpack ) && ( !Core.ML || armor.Parent != from ) )
|
||||
{
|
||||
number = 1044275; // The item must be in your backpack to repair it.
|
||||
}
|
||||
|
|
@ -366,7 +395,7 @@ namespace Server.Engines.Craft
|
|||
{
|
||||
number = (usingDeed) ? 1061136 : 1044277; // That item cannot be repaired. // You cannot repair that item with this type of repair contract.
|
||||
}
|
||||
else if ( !clothing.IsChildOf( from.Backpack ) )
|
||||
else if ( !clothing.IsChildOf( from.Backpack ) && ( !Core.ML || clothing.Parent != from ) )
|
||||
{
|
||||
number = 1044275; // The item must be in your backpack to repair it.
|
||||
}
|
||||
|
|
@ -430,10 +459,12 @@ namespace Server.Engines.Craft
|
|||
CraftContext context = m_CraftSystem.GetContext( from );
|
||||
from.SendGump( new CraftGump( from, m_CraftSystem, m_Tool, number ) );
|
||||
}
|
||||
else if( toDelete )
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( number );
|
||||
m_Deed.Delete();
|
||||
|
||||
if( toDelete )
|
||||
m_Deed.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ namespace Server.Engines.Harvest
|
|||
{
|
||||
SOS sos = messages[i];
|
||||
|
||||
if ( from.Map == sos.TargetMap && from.InRange( sos.TargetLocation, 60 ) )
|
||||
if ( ( from.Map == Map.Felucca || from.Map == Map.Trammel ) && from.InRange( sos.TargetLocation, 60 ) )
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
176
Scripts/Engines/Spawner/ProximitySpawner.cs
Normal file
176
Scripts/Engines/Spawner/ProximitySpawner.cs
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class ProximitySpawner : Spawner
|
||||
{
|
||||
private int m_TriggerRange;
|
||||
private TextDefinition m_SpawnMessage;
|
||||
private bool m_InstantFlag;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int TriggerRange
|
||||
{
|
||||
get { return m_TriggerRange; }
|
||||
set { m_TriggerRange = value; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public TextDefinition SpawnMessage
|
||||
{
|
||||
get { return m_SpawnMessage; }
|
||||
set { m_SpawnMessage = value; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool InstantFlag
|
||||
{
|
||||
get { return m_InstantFlag; }
|
||||
set { m_InstantFlag = value; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ProximitySpawner()
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ProximitySpawner( string spawnName )
|
||||
: base( spawnName )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ProximitySpawner( int amount, int minDelay, int maxDelay, int team, int homeRange, string spawnName )
|
||||
: base( amount, minDelay, maxDelay, team, homeRange, spawnName )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ProximitySpawner( int amount, int minDelay, int maxDelay, int team, int homeRange, string spawnName, int triggerRange, string spawnMessage, bool instantFlag )
|
||||
: base( amount, minDelay, maxDelay, team, homeRange, spawnName )
|
||||
{
|
||||
m_TriggerRange = triggerRange;
|
||||
m_SpawnMessage = TextDefinition.Parse( spawnMessage );
|
||||
m_InstantFlag = instantFlag;
|
||||
}
|
||||
|
||||
public ProximitySpawner( int amount, TimeSpan minDelay, TimeSpan maxDelay, int team, int homeRange, List<string> spawnNames )
|
||||
: base( amount, minDelay, maxDelay, team, homeRange, spawnNames )
|
||||
{
|
||||
}
|
||||
|
||||
public ProximitySpawner( int amount, TimeSpan minDelay, TimeSpan maxDelay, int team, int homeRange, List<string> spawnNames, int triggerRange, TextDefinition spawnMessage, bool instantFlag )
|
||||
: base( amount, minDelay, maxDelay, team, homeRange, spawnNames )
|
||||
{
|
||||
m_TriggerRange = triggerRange;
|
||||
m_SpawnMessage = spawnMessage;
|
||||
m_InstantFlag = instantFlag;
|
||||
}
|
||||
|
||||
public override string DefaultName
|
||||
{
|
||||
get { return "Proximity Spawner"; }
|
||||
}
|
||||
|
||||
public override void DoTimer( TimeSpan delay )
|
||||
{
|
||||
if ( !Running )
|
||||
return;
|
||||
|
||||
End = DateTime.Now + delay;
|
||||
}
|
||||
|
||||
public override void Respawn()
|
||||
{
|
||||
RemoveSpawned();
|
||||
|
||||
End = DateTime.Now;
|
||||
}
|
||||
|
||||
public override void Spawn()
|
||||
{
|
||||
for ( int i = 0; i < SpawnNamesCount; ++i )
|
||||
{
|
||||
for ( int j = 0; j < Count; ++j )
|
||||
Spawn( i );
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckSpawnCount()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool HandlesOnMovement { get { return true; } }
|
||||
|
||||
public virtual bool ValidTrigger( Mobile m )
|
||||
{
|
||||
if ( m is BaseCreature )
|
||||
{
|
||||
BaseCreature bc = (BaseCreature)m;
|
||||
|
||||
if ( !bc.Controlled && !bc.Summoned )
|
||||
return false;
|
||||
}
|
||||
else if ( !m.Player )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return ( m.Alive && !m.IsDeadBondedPet && m.CanBeDamaged() && !m.Hidden );
|
||||
}
|
||||
|
||||
public override void OnMovement( Mobile m, Point3D oldLocation )
|
||||
{
|
||||
if ( !Running )
|
||||
return;
|
||||
|
||||
if ( IsEmpty && End <= DateTime.Now && m.InRange( GetWorldLocation(), m_TriggerRange ) && m.Location != oldLocation && ValidTrigger( m ) )
|
||||
{
|
||||
TextDefinition.SendMessageTo( m, m_SpawnMessage );
|
||||
|
||||
DoTimer();
|
||||
Spawn();
|
||||
|
||||
if ( m_InstantFlag )
|
||||
{
|
||||
foreach ( ISpawnable spawned in Spawned )
|
||||
{
|
||||
if ( spawned is Mobile )
|
||||
((Mobile)spawned).Combatant = m;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ProximitySpawner( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( m_TriggerRange );
|
||||
TextDefinition.Serialize( writer, m_SpawnMessage );
|
||||
writer.Write( m_InstantFlag );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_TriggerRange = reader.ReadInt();
|
||||
m_SpawnMessage = TextDefinition.Deserialize( reader );
|
||||
m_InstantFlag = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -28,7 +28,8 @@ namespace Server.Mobiles
|
|||
private bool m_Group;
|
||||
private WayPoint m_WayPoint;
|
||||
|
||||
public bool IsFull{ get{ return ( m_Spawned != null && m_Spawned.Count >= m_Count ); } }
|
||||
public bool IsFull{ get{ return ( m_Spawned.Count >= m_Count ); } }
|
||||
public bool IsEmpty{ get{ return ( m_Spawned.Count == 0 ); } }
|
||||
|
||||
public List<string> SpawnNames
|
||||
{
|
||||
|
|
@ -43,6 +44,11 @@ namespace Server.Mobiles
|
|||
}
|
||||
}
|
||||
|
||||
public List<ISpawnable> Spawned
|
||||
{
|
||||
get { return m_Spawned; }
|
||||
}
|
||||
|
||||
public virtual int SpawnNamesCount { get { return m_SpawnNames.Count; } }
|
||||
|
||||
public override void OnAfterDuped( Item newItem )
|
||||
|
|
@ -126,6 +132,12 @@ namespace Server.Mobiles
|
|||
set { m_MaxDelay = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
public DateTime End
|
||||
{
|
||||
get { return m_End; }
|
||||
set { m_End = value; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public TimeSpan NextSpawn
|
||||
{
|
||||
|
|
@ -231,7 +243,7 @@ namespace Server.Mobiles
|
|||
list.Add( 1060660, "team\t{0}", m_Team ); // ~1_val~: ~2_val~
|
||||
list.Add( 1060661, "speed\t{0} to {1}", m_MinDelay, m_MaxDelay ); // ~1_val~: ~2_val~
|
||||
|
||||
if ( m_Spawned.Count != 0 )
|
||||
if ( m_SpawnNames.Count != 0 )
|
||||
list.Add( SpawnedStats() );
|
||||
}
|
||||
else
|
||||
|
|
@ -266,7 +278,9 @@ namespace Server.Mobiles
|
|||
{
|
||||
if ( m_Running )
|
||||
{
|
||||
m_Timer.Stop();
|
||||
if ( m_Timer != null )
|
||||
m_Timer.Stop();
|
||||
|
||||
m_Running = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -356,7 +370,7 @@ namespace Server.Mobiles
|
|||
}
|
||||
}
|
||||
|
||||
public void Respawn()
|
||||
public virtual void Respawn()
|
||||
{
|
||||
RemoveSpawned();
|
||||
|
||||
|
|
@ -364,7 +378,7 @@ namespace Server.Mobiles
|
|||
Spawn();
|
||||
}
|
||||
|
||||
public void Spawn()
|
||||
public virtual void Spawn()
|
||||
{
|
||||
if ( SpawnNamesCount > 0 )
|
||||
Spawn( Utility.Random( SpawnNamesCount ) );
|
||||
|
|
@ -511,6 +525,11 @@ namespace Server.Mobiles
|
|||
|
||||
public Point3D HomeLocation { get { return this.Location; } }
|
||||
|
||||
public virtual bool CheckSpawnCount()
|
||||
{
|
||||
return ( m_Spawned.Count >= m_Count );
|
||||
}
|
||||
|
||||
public void Spawn( int index )
|
||||
{
|
||||
Map map = Map;
|
||||
|
|
@ -520,7 +539,7 @@ namespace Server.Mobiles
|
|||
|
||||
Defrag();
|
||||
|
||||
if ( m_Spawned.Count >= m_Count )
|
||||
if ( !CheckSpawnCount() )
|
||||
return;
|
||||
|
||||
ISpawnable spawned = CreateSpawnedObject( index );
|
||||
|
|
@ -555,7 +574,7 @@ namespace Server.Mobiles
|
|||
|
||||
bc.Home = this.HomeLocation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Point3D GetSpawnPosition()
|
||||
{
|
||||
|
|
@ -600,7 +619,7 @@ namespace Server.Mobiles
|
|||
DoTimer( delay );
|
||||
}
|
||||
|
||||
public void DoTimer( TimeSpan delay )
|
||||
public virtual void DoTimer( TimeSpan delay )
|
||||
{
|
||||
if ( !m_Running )
|
||||
return;
|
||||
|
|
@ -640,7 +659,18 @@ namespace Server.Mobiles
|
|||
{
|
||||
Defrag();
|
||||
|
||||
Dictionary<string, int> counts = new Dictionary<string, int>();
|
||||
Dictionary<string, int> counts = new Dictionary<string, int>( StringComparer.OrdinalIgnoreCase );
|
||||
|
||||
foreach ( string entry in m_SpawnNames )
|
||||
{
|
||||
string name = ParseType( entry );
|
||||
Type type = ScriptCompiler.FindTypeByName( name );
|
||||
|
||||
if ( type == null )
|
||||
counts[name] = 0;
|
||||
else
|
||||
counts[type.Name] = 0;
|
||||
}
|
||||
|
||||
foreach ( ISpawnable spawned in m_Spawned )
|
||||
{
|
||||
|
|
@ -695,7 +725,7 @@ namespace Server.Mobiles
|
|||
{
|
||||
Defrag();
|
||||
|
||||
for ( int i = 0; i < m_Spawned.Count; ++i )
|
||||
for ( int i = m_Spawned.Count - 1; i >= 0; --i )
|
||||
m_Spawned[i].Delete();
|
||||
|
||||
InvalidateProperties();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue