This commit is contained in:
parent
296ef1be68
commit
5718b66fde
4 changed files with 36 additions and 13 deletions
|
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
|
|
@ -24,10 +23,7 @@ namespace Server.Items
|
|||
{
|
||||
if( !Validate( attacker ) || !CheckMana( attacker, true ) )
|
||||
{
|
||||
if( !( defender is BaseCreature ) || !( defender as BaseCreature ).HasManaOveride )
|
||||
{
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
ClearCurrentAbility( attacker );
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ using System.Collections;
|
|||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Spells;
|
||||
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
|
|
@ -141,6 +141,11 @@ namespace Server.Items
|
|||
|
||||
if ( from.Mana < mana )
|
||||
{
|
||||
if( ( from is BaseCreature ) && ( from as BaseCreature ).HasManaOveride )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage( 1060181, mana.ToString() ); // You need ~1_MANA_REQUIREMENT~ mana to perform that attack
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5239,9 +5239,10 @@ namespace Server.Mobiles
|
|||
m_NextHealTime = DateTime.Now + TimeSpan.FromSeconds( HealInterval );
|
||||
}
|
||||
}
|
||||
else if( ( this.FightMode != FightMode.None ) && ( Home != Point3D.Zero ) && ( RangeHome >= 0 ) && !InRange( Home, ( RangeHome ) ) )
|
||||
|
||||
if( ReturnsToHome && ( this.FightMode != FightMode.None ) && ( Home != Point3D.Zero ) && ( RangeHome >= 0 ) && !InRange( Home, ( RangeHome ) ) )
|
||||
{
|
||||
if( Utility.RandomDouble() < .05 ) /* some throttling */
|
||||
if( ( Combatant == null ) && ( Warmode == false ) && Utility.RandomDouble() < .05 ) /* some throttling */
|
||||
{
|
||||
m_FailedReturnHome = !this.Move( GetDirectionTo( Home.X, Home.Y ) ) ? m_FailedReturnHome + 1 : 0;
|
||||
|
||||
|
|
@ -5486,11 +5487,17 @@ namespace Server.Mobiles
|
|||
/* until we are sure about who should be getting deleted, move them instead */
|
||||
/* On OSI, they despawn */
|
||||
|
||||
public virtual bool ReturnsToHome { get { return true; } }
|
||||
|
||||
private bool m_ReturnQueued;
|
||||
|
||||
public override void OnSectorDeactivate()
|
||||
{
|
||||
if( ( this.FightMode != FightMode.None ) && ( Home != Point3D.Zero ) && ( RangeHome >= 0 ) && !this.InRange( Home, ( RangeHome + 10 ) ) )
|
||||
if( ReturnsToHome && !m_ReturnQueued && ( this.FightMode != FightMode.None ) && ( Home != Point3D.Zero ) && ( RangeHome >= 0 ) && !this.InRange( Home, ( RangeHome + 5 ) ) )
|
||||
{
|
||||
this.SetLocation( Home, true );
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( Utility.Random( 10 ) ), new TimerCallback( GoHome_Callback ) );
|
||||
|
||||
m_ReturnQueued = true;
|
||||
}
|
||||
else if( PlayerRangeSensitive && m_AI != null )
|
||||
{
|
||||
|
|
@ -5500,6 +5507,21 @@ namespace Server.Mobiles
|
|||
base.OnSectorDeactivate();
|
||||
}
|
||||
|
||||
public void GoHome_Callback()
|
||||
{
|
||||
if( !( ( Map.GetSector( X, Y ) ).Active ) )
|
||||
{
|
||||
this.SetLocation( Home, true );
|
||||
|
||||
if( !( ( Map.GetSector( X, Y ) ).Active ) && m_AI != null )
|
||||
{
|
||||
m_AI.Deactivate();
|
||||
}
|
||||
}
|
||||
|
||||
m_ReturnQueued = false;
|
||||
}
|
||||
|
||||
public override void OnSectorActivate()
|
||||
{
|
||||
if( PlayerRangeSensitive && m_AI != null )
|
||||
|
|
|
|||
|
|
@ -43,10 +43,10 @@ namespace Server.Mobiles
|
|||
}
|
||||
|
||||
/* yes, this is OSI style */
|
||||
public override double WeaponAbilityChance { get { return .5; } }
|
||||
public override double HitPoisonChance { get { return 0.1; } }
|
||||
public override double WeaponAbilityChance { get { return 0.6; } }
|
||||
public override double HitPoisonChance { get { return 0.25; } }
|
||||
public override Poison HitPoison { get { return ( Poison.Lethal ); } }
|
||||
public override bool HasManaOveride { get { return false; } }
|
||||
public override bool HasManaOveride { get { return true; } }
|
||||
public override bool GivesMLMinorArtifact { get { return true; } }
|
||||
public override int TreasureMapLevel { get { return 5; } }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue