This commit is contained in:
mark 2009-08-09 07:18:50 +00:00
parent 57b345a480
commit 68d742d262
28 changed files with 432 additions and 193 deletions

View file

@ -2487,10 +2487,6 @@ namespace Server.Mobiles
if ( bFacFriend && !m_Mobile.IsFriend( m ) )
continue;
// Same goes for faction enemies.
if ( bFacFoe && !m_Mobile.IsEnemy( m ) )
continue;
//Ignore anyone under EtherealVoyage
if( TransformationSpellHelper.UnderTransformation( m, typeof( EtherealVoyageSpell ) ) )
continue;
@ -2521,11 +2517,17 @@ namespace Server.Mobiles
if ( !bValid )
continue;
}
} else {
// If it's an enemy factioned mobile, make sure we can be harmful to it.
if ( bFacFoe && !bFacFriend && !m_Mobile.CanBeHarmful( m, false ) )
continue;
// Same goes for faction enemies.
if ( bFacFoe && !m_Mobile.IsEnemy( m ) )
continue;
// If it's an enemy factioned mobile, make sure we can be harmful to it.
if ( bFacFoe && !bFacFriend && !m_Mobile.CanBeHarmful( m, false ) )
continue;
}
theirVal = m_Mobile.GetFightModeRanking( m, acqType, bPlayerOnly );

View file

@ -14,6 +14,7 @@ using Server.Engines.Quests;
using Server.Factions;
using Server.Spells.Bushido;
using Server.Spells.Spellweaving;
using Server.Spells.Necromancy;
namespace Server.Mobiles
{
@ -565,32 +566,22 @@ namespace Server.Mobiles
#endregion
#region Spill Acid
public void SpillAcid( TimeSpan duration, int minDamage, int maxDamage )
{
SpillAcid( duration, minDamage, maxDamage, null, 1, 1 );
}
public void SpillAcid( Mobile target, int amount, string name )
{
SpillAcid( TimeSpan.FromSeconds(10), 5, 10, target, amount, amount, AosElementAttribute.Poison , name );
}
public void SpillAcid( TimeSpan duration, int minDamage, int maxDamage, Mobile target )
{
SpillAcid( duration, minDamage, maxDamage, target, 1, 1 );
}
public void SpillAcid( TimeSpan duration, int minDamage, int maxDamage, int count )
{
SpillAcid( duration, minDamage, maxDamage, null, count, count );
SpillAcid( duration, minDamage, maxDamage, target, 1, 1, 0, null );
}
public void SpillAcid( TimeSpan duration, int minDamage, int maxDamage, int minAmount, int maxAmount )
{
SpillAcid( duration, minDamage, maxDamage, null, minAmount, maxAmount );
SpillAcid( duration, minDamage, maxDamage, null, minAmount, maxAmount, 0, null );
}
public void SpillAcid( TimeSpan duration, int minDamage, int maxDamage, Mobile target, int count )
{
SpillAcid( duration, minDamage, maxDamage, target, count, count );
}
public void SpillAcid( TimeSpan duration, int minDamage, int maxDamage, Mobile target, int minAmount, int maxAmount )
public void SpillAcid( TimeSpan duration, int minDamage, int maxDamage, Mobile target, int minAmount, int maxAmount, AosElementAttribute damagetype, string name )
{
if ( (target != null && target.Map == null) || this.Map == null )
return;
@ -599,30 +590,28 @@ namespace Server.Mobiles
for ( int i = 0; i < pools; ++i )
{
PoolOfAcid acid = new PoolOfAcid( duration, minDamage, maxDamage );
if ( target != null && target.Map != null )
{
acid.MoveToWorld( target.Location, target.Map );
continue;
}
bool validLocation = false;
Point3D loc = this.Location;
Map map = this.Map;
for ( int j = 0; !validLocation && j < 10; ++j )
PoolOfAcid acid = new PoolOfAcid( duration, minDamage, maxDamage, damagetype, name );
if ( target != null && target.Map != null && pools == 1 )
{
int x = X + Utility.Random( 3 ) - 1;
int y = Y + Utility.Random( 3 ) - 1;
int z = map.GetAverageZ( x, y );
if ( validLocation = map.CanFit( x, y, this.Z, 16, false, false ) )
loc = new Point3D( x, y, Z );
else if ( validLocation = map.CanFit( x, y, z, 16, false, false ) )
loc = new Point3D( x, y, z );
loc = target.Location;
map = target.Map;
} else
{
bool validLocation = false;
for ( int j = 0; !validLocation && j < 10; ++j )
{
loc = new Point3D(
loc.X+(Utility.Random(0,3)-2),
loc.Y+(Utility.Random(0,3)-2),
loc.Z );
loc.Z = map.GetAverageZ( loc.X, loc.Y );
validLocation = map.CanFit( loc, 16, false, false ) ;
}
}
acid.MoveToWorld( loc, map );
}
}
@ -905,6 +894,20 @@ namespace Server.Mobiles
}
}
public virtual bool IsNecroFamiliar
{
get
{
if ( !Summoned )
return false;
if ( m_ControlMaster != null && SummonFamiliarSpell.Table.Contains( m_ControlMaster ) )
return SummonFamiliarSpell.Table[ m_ControlMaster ] == this;
return false;
}
}
public override void Damage( int amount, Mobile from )
{
int oldHits = this.Hits;
@ -1067,7 +1070,7 @@ namespace Server.Mobiles
get
{
if ( m_HitsMax >= 0 )
return m_HitsMax;
return m_HitsMax + GetStatOffset( StatType.Str );
return Str;
}
@ -1086,7 +1089,7 @@ namespace Server.Mobiles
get
{
if ( m_StamMax >= 0 )
return m_StamMax;
return m_StamMax + GetStatOffset( StatType.Dex );
return Dex;
}
@ -1105,7 +1108,7 @@ namespace Server.Mobiles
get
{
if ( m_ManaMax >= 0 )
return m_ManaMax;
return m_ManaMax + GetStatOffset( StatType.Int );
return Int;
}
@ -2377,6 +2380,11 @@ namespace Server.Mobiles
if ( m_AI != null )
m_AI.OnCurrentOrderChanged();
InvalidateProperties();
if ( m_ControlMaster != null )
m_ControlMaster.InvalidateProperties();
}
}
@ -3938,11 +3946,20 @@ namespace Server.Mobiles
{
base.AddNameProperties( list );
if ( Controlled && Commandable )
if ( Core.ML )
{
if ( Summoned )
list.Add( 1049646 ); // (summoned)
else if ( IsBonded ) //Intentional difference (showing ONLY bonded when bonded instead of bonded & tame)
if ( Backpack is StrongBackpack )
list.Add( TotalWeight == 1 ? 1072788 : 1072789, TotalWeight.ToString() ); // Weight: ~1_WEIGHT~ stones
if ( m_ControlOrder == OrderType.Guard )
list.Add( 1080078 ); // guarding
}
if ( Summoned && !IsAnimatedDead && !IsNecroFamiliar )
list.Add( 1049646 ); // (summoned)
else if ( Controlled && Commandable )
{
if ( IsBonded ) //Intentional difference (showing ONLY bonded when bonded instead of bonded & tame)
list.Add( 1049608 ); // (bonded)
else
list.Add( 502006 ); // (tame)
@ -4419,6 +4436,8 @@ namespace Server.Mobiles
Delta( MobileDelta.Noto );
}
InvalidateProperties();
return true;
}

View file

@ -86,8 +86,11 @@ namespace Server.Engines.Craft
int index = -1;
// Other Items
index = AddCraft( typeof( Board ), 1044294, 1027127, 0.0, 0.0, typeof( Log ), 1044466, 1, 1044465 );
SetUseAllRes( index, true );
if ( Core.Expansion == Expansion.AOS || Core.Expansion == Expansion.SE )
{
index = AddCraft( typeof( Board ), 1044294, 1027127, 0.0, 0.0, typeof( Log ), 1044466, 1, 1044465 );
SetUseAllRes( index, true );
}
AddCraft( typeof( BarrelStaves ), 1044294, 1027857, 00.0, 25.0, typeof( Log ), 1044041, 5, 1044351 );
AddCraft( typeof( BarrelLid ), 1044294, 1027608, 11.0, 36.0, typeof( Log ), 1044041, 4, 1044351 );

View file

@ -52,9 +52,21 @@ namespace Server.Engines.Harvest
}
}
}
if ( m_System is Lumberjacking && targeted is IChopable )
((IChopable)targeted).OnChop( from );
else if ( m_System is Lumberjacking && targeted is IAxe )
{
IAxe obj = (IAxe)targeted;
Item item = (Item)targeted;
if ( !item.IsChildOf( from.Backpack ) )
from.SendLocalizedMessage( 1062334 ); // This item must be in your backpack to be used.
else if ( obj.Axe( from, (BaseAxe)m_Tool ) )
from.PlaySound( 0x13E );
}
else if ( m_System is Lumberjacking && targeted is ICarvable )
((ICarvable)targeted).Carve( from, (Item)m_Tool );
else if ( m_System is Lumberjacking && FurnitureAttribute.Check( targeted as Item ) )
DestroyFurniture( from, (Item)targeted );
else if ( m_System is Mining && targeted is TreasureMap )

View file

@ -134,13 +134,7 @@ namespace Server.Engines.Harvest
public override bool CheckHarvest( Mobile from, Item tool )
{
if ( !base.CheckHarvest( from, tool ) )
return false;
if ( tool.Parent != from )
{
from.SendLocalizedMessage( 500487 ); // The axe must be equipped for any serious wood chopping.
return false;
}
return false;
return true;
}
@ -161,7 +155,20 @@ namespace Server.Engines.Harvest
public override void OnBadHarvestTarget( Mobile from, Item tool, object toHarvest )
{
from.SendLocalizedMessage( 500489 ); // You can't use an axe on that.
if ( toHarvest is Mobile )
{
Mobile obj = (Mobile)toHarvest;
obj.PublicOverheadMessage( Server.Network.MessageType.Regular, 0x3E9, 500450 ); // You can only skin dead creatures.
}
else if ( toHarvest is Item )
{
Item obj = (Item)toHarvest;
obj.PublicOverheadMessage( Server.Network.MessageType.Regular, 0x3E9, 500464 ); // Use this on corpses to carve away meat and hide
}
else if ( toHarvest is Targeting.StaticTarget || toHarvest is Targeting.LandTarget )
from.SendLocalizedMessage( 500489 ); // You can't use an axe on that.
else
from.SendLocalizedMessage( 1005213 ); // You can't do that
}
public override void OnHarvestStarted( Mobile from, Item tool, HarvestDefinition def, object toHarvest )

View file

@ -147,15 +147,24 @@ namespace Server.Engines.Quests.Collector
if ( obj != null && !obj.Completed )
{
BankBox bank = player.FindBankNoCreate();
if ( bank != null && bank.ConsumeTotal( typeof( Gold ), 10 ) )
if ( player.Backpack!= null && player.Backpack.ConsumeTotal( typeof( Gold ), 10 ) )
{
obj.Complete();
}
else
{
player.SendLocalizedMessage( 1055108 ); // You don't have enough gold to buy the sheet music.
BankBox bank = player.FindBankNoCreate();
if ( bank != null && bank.ConsumeTotal( typeof( Gold ), 10 ) )
{
obj.Complete();
}
else
{
player.SendLocalizedMessage( 1055108 ); // You don't have enough gold to buy the sheet music.
}
}
}
}