Fixes casting checks

This commit is contained in:
Kamron Batman 2018-08-19 01:38:55 +08:00
parent 7ea00fbf4f
commit 03dd5f1926
431 changed files with 5616 additions and 6250 deletions

View file

@ -10,49 +10,49 @@ namespace Server.Mobiles
public BerserkAI(BaseCreature m) : base (m)
{
}
public override bool DoActionWander()
{
m_Mobile.DebugSay( "I have No Combatant" );
if( AcquireFocusMob( m_Mobile.RangePerception, FightMode.Closest, false, true, true) )
if ( AcquireFocusMob( m_Mobile.RangePerception, FightMode.Closest, false, true, true) )
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "I have detected " + m_Mobile.FocusMob.Name + " and I will attack" );
m_Mobile.Combatant = m_Mobile.FocusMob;
Action = ActionType.Combat;
}
}
else
{
base.DoActionWander();
}
return true;
return true;
}
public override bool DoActionCombat()
{
if( m_Mobile.Combatant == null || m_Mobile.Combatant.Deleted )
if ( m_Mobile.Combatant == null || m_Mobile.Combatant.Deleted )
{
m_Mobile.DebugSay("My combatant is deleted");
Action = ActionType.Guard;
return true;
}
if( WalkMobileRange( m_Mobile.Combatant, 1, true, m_Mobile.RangeFight, m_Mobile.RangeFight ) )
if ( WalkMobileRange( m_Mobile.Combatant, 1, true, m_Mobile.RangeFight, m_Mobile.RangeFight ) )
{
// Be sure to face the combatant
m_Mobile.Direction = m_Mobile.GetDirectionTo( m_Mobile.Combatant.Location );
}
else
{
if( m_Mobile.Combatant != null )
if ( m_Mobile.Combatant != null )
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay("I am still not in range of " + m_Mobile.Combatant.Name);
if( (int) m_Mobile.GetDistanceToSqrt( m_Mobile.Combatant ) > m_Mobile.RangePerception + 1 )
if ( (int) m_Mobile.GetDistanceToSqrt( m_Mobile.Combatant ) > m_Mobile.RangePerception + 1 )
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "I have lost " + m_Mobile.Combatant.Name );
@ -62,10 +62,10 @@ namespace Server.Mobiles
}
}
}
return true;
}
public override bool DoActionGuard()
{
if ( AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, false, true, true ) )

View file

@ -25,10 +25,10 @@ namespace Server.Mobiles
public override bool Think()
{
if( m_Mobile.Deleted )
if ( m_Mobile.Deleted )
return false;
if( ProcessTarget() )
if ( ProcessTarget() )
return true;
else
return base.Think();
@ -55,7 +55,7 @@ namespace Server.Mobiles
public override bool DoActionWander()
{
if( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
if ( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
{
m_Mobile.DebugSay( "I am going to attack {0}", m_Mobile.FocusMob.Name );
@ -63,7 +63,7 @@ namespace Server.Mobiles
Action = ActionType.Combat;
m_NextCastTime = Core.TickCount;
}
else if( SmartAI && m_Mobile.Mana < m_Mobile.ManaMax && !m_Mobile.Meditating )
else if ( SmartAI && m_Mobile.Mana < m_Mobile.ManaMax && !m_Mobile.Meditating )
{
m_Mobile.DebugSay( "I am going to meditate" );
@ -77,11 +77,11 @@ namespace Server.Mobiles
base.DoActionWander();
if( Utility.RandomDouble() < 0.05 )
if ( Utility.RandomDouble() < 0.05 )
{
Spell spell = CheckCastHealingSpell();
if( spell != null )
if ( spell != null )
spell.Cast();
}
}
@ -92,33 +92,33 @@ namespace Server.Mobiles
private Spell CheckCastHealingSpell()
{
// If I'm poisoned, always attempt to cure.
if( m_Mobile.Poisoned )
if ( m_Mobile.Poisoned )
return new CureSpell( m_Mobile, null );
// Summoned creatures never heal themselves.
if( m_Mobile.Summoned )
if ( m_Mobile.Summoned )
return null;
if( m_Mobile.Controlled )
if ( m_Mobile.Controlled )
{
if (Core.TickCount - m_NextHealTime < 0)
return null;
}
if( !SmartAI )
if ( !SmartAI )
{
if( ScaleBySkill( HealChance, SkillName.Magery ) < Utility.RandomDouble() )
if ( ScaleBySkill( HealChance, SkillName.Magery ) < Utility.RandomDouble() )
return null;
}
else
{
if( Utility.Random( 0, 4 + ( m_Mobile.Hits == 0 ? m_Mobile.HitsMax : ( m_Mobile.HitsMax / m_Mobile.Hits ) ) ) < 3 )
if ( Utility.Random( 0, 4 + ( m_Mobile.Hits == 0 ? m_Mobile.HitsMax : ( m_Mobile.HitsMax / m_Mobile.Hits ) ) ) < 3 )
return null;
}
Spell spell = null;
if( m_Mobile.Hits < ( m_Mobile.HitsMax - 50 ) )
if ( m_Mobile.Hits < ( m_Mobile.HitsMax - 50 ) )
{
if ( UseNecromancy() )
{
@ -128,18 +128,18 @@ namespace Server.Mobiles
{
spell = new GreaterHealSpell( m_Mobile, null );
if( spell == null )
if ( spell == null )
spell = new HealSpell( m_Mobile, null );
}
}
else if( m_Mobile.Hits < ( m_Mobile.HitsMax - 10 ) )
else if ( m_Mobile.Hits < ( m_Mobile.HitsMax - 10 ) )
{
spell = new HealSpell( m_Mobile, null );
}
double delay;
if( m_Mobile.Int >= 500 )
if ( m_Mobile.Int >= 500 )
delay = Utility.RandomMinMax( 7, 10 );
else
delay = Math.Sqrt( 600 - m_Mobile.Int );
@ -151,29 +151,29 @@ namespace Server.Mobiles
public void RunTo( Mobile m )
{
if( !SmartAI )
if ( !SmartAI )
{
if( !MoveTo( m, true, m_Mobile.RangeFight ) )
if ( !MoveTo( m, true, m_Mobile.RangeFight ) )
OnFailedMove();
return;
}
if( m.Paralyzed || m.Frozen )
if ( m.Paralyzed || m.Frozen )
{
if( m_Mobile.InRange( m, 1 ) )
if ( m_Mobile.InRange( m, 1 ) )
RunFrom( m );
else if( !m_Mobile.InRange( m, m_Mobile.RangeFight > 2 ? m_Mobile.RangeFight : 2 ) && !MoveTo( m, true, 1 ) )
else if ( !m_Mobile.InRange( m, m_Mobile.RangeFight > 2 ? m_Mobile.RangeFight : 2 ) && !MoveTo( m, true, 1 ) )
OnFailedMove();
}
else
{
if( !m_Mobile.InRange( m, m_Mobile.RangeFight ) )
if ( !m_Mobile.InRange( m, m_Mobile.RangeFight ) )
{
if( !MoveTo( m, true, 1 ) )
if ( !MoveTo( m, true, 1 ) )
OnFailedMove();
}
else if( m_Mobile.InRange( m, m_Mobile.RangeFight - 1 ) )
else if ( m_Mobile.InRange( m, m_Mobile.RangeFight - 1 ) )
{
RunFrom( m );
}
@ -187,16 +187,16 @@ namespace Server.Mobiles
public void OnFailedMove()
{
if( !m_Mobile.DisallowAllMoves && ( SmartAI ? Utility.Random( 4 ) == 0 : ScaleBySkill( TeleportChance, SkillName.Magery ) > Utility.RandomDouble() ) )
if ( !m_Mobile.DisallowAllMoves && ( SmartAI ? Utility.Random( 4 ) == 0 : ScaleBySkill( TeleportChance, SkillName.Magery ) > Utility.RandomDouble() ) )
{
if( m_Mobile.Target != null )
if ( m_Mobile.Target != null )
m_Mobile.Target.Cancel( m_Mobile, TargetCancelType.Canceled );
new TeleportSpell( m_Mobile, null ).Cast();
m_Mobile.DebugSay( "I am stuck, I'm going to try teleporting away" );
}
else if( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
else if ( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
{
m_Mobile.DebugSay( "My move is blocked, so I am going to attack {0}", m_Mobile.FocusMob.Name );
@ -211,12 +211,12 @@ namespace Server.Mobiles
public void Run( Direction d )
{
if( ( m_Mobile.Spell != null && m_Mobile.Spell.IsCasting ) || m_Mobile.Paralyzed || m_Mobile.Frozen || m_Mobile.DisallowAllMoves )
if ( ( m_Mobile.Spell != null && m_Mobile.Spell.IsCasting ) || m_Mobile.Paralyzed || m_Mobile.Frozen || m_Mobile.DisallowAllMoves )
return;
m_Mobile.Direction = d | Direction.Running;
if( !DoMove( m_Mobile.Direction, true ) )
if ( !DoMove( m_Mobile.Direction, true ) )
OnFailedMove();
}
@ -251,9 +251,9 @@ namespace Server.Mobiles
{
int maxCircle = (int)( ( m_Mobile.Skills[ SkillName.Magery ].Value + 20.0 ) / ( 100.0 / 7.0 ) );
if( maxCircle < 1 )
if ( maxCircle < 1 )
maxCircle = 1;
else if( maxCircle > 8 )
else if ( maxCircle > 8 )
maxCircle = 8;
switch( Utility.Random( maxCircle * 2 ) )
@ -292,7 +292,7 @@ namespace Server.Mobiles
public virtual Spell GetRandomCurseSpellMage()
{
if( m_Mobile.Skills[ SkillName.Magery ].Value >= 40.0 && Utility.Random( 4 ) == 0 )
if ( m_Mobile.Skills[ SkillName.Magery ].Value >= 40.0 && Utility.Random( 4 ) == 0 )
return new CurseSpell( m_Mobile, null );
switch( Utility.Random( 3 ) )
@ -305,7 +305,7 @@ namespace Server.Mobiles
public virtual Spell GetRandomManaDrainSpell()
{
if( m_Mobile.Skills[ SkillName.Magery ].Value >= 80.0 && Utility.RandomBool() )
if ( m_Mobile.Skills[ SkillName.Magery ].Value >= 80.0 && Utility.RandomBool() )
return new ManaVampireSpell( m_Mobile, null );
return new ManaDrainSpell( m_Mobile, null );
@ -313,9 +313,9 @@ namespace Server.Mobiles
public virtual Spell DoDispel( Mobile toDispel )
{
if( !SmartAI )
if ( !SmartAI )
{
if( ScaleBySkill( DispelChance, SkillName.Magery ) > Utility.RandomDouble() )
if ( ScaleBySkill( DispelChance, SkillName.Magery ) > Utility.RandomDouble() )
return new DispelSpell( m_Mobile, null );
return ChooseSpell( toDispel );
@ -323,11 +323,11 @@ namespace Server.Mobiles
Spell spell = CheckCastHealingSpell();
if( spell == null )
if ( spell == null )
{
if( !m_Mobile.DisallowAllMoves && Utility.Random( (int)m_Mobile.GetDistanceToSqrt( toDispel ) ) == 0 )
if ( !m_Mobile.DisallowAllMoves && Utility.Random( (int)m_Mobile.GetDistanceToSqrt( toDispel ) ) == 0 )
spell = new TeleportSpell( m_Mobile, null );
else if( Utility.Random( 3 ) == 0 && !m_Mobile.InRange( toDispel, 3 ) && !toDispel.Paralyzed && !toDispel.Frozen )
else if ( Utility.Random( 3 ) == 0 && !m_Mobile.InRange( toDispel, 3 ) && !toDispel.Paralyzed && !toDispel.Frozen )
spell = new ParalyzeSpell( m_Mobile, null );
else
spell = new DispelSpell( m_Mobile, null );
@ -340,18 +340,18 @@ namespace Server.Mobiles
{
Spell spell = null;
if( !SmartAI )
if ( !SmartAI )
{
spell = CheckCastHealingSpell();
if( spell != null )
if ( spell != null )
return spell;
if( IsNecromancer )
if ( IsNecromancer )
{
double psDamage = ( ( m_Mobile.Skills[ SkillName.SpiritSpeak ].Value - c.Skills[ SkillName.MagicResist ].Value ) / 10 ) + ( c.Player ? 18 : 30 );
if( psDamage > c.Hits )
if ( psDamage > c.Hits )
return new PainSpikeSpell( m_Mobile, null );
}
@ -424,14 +424,14 @@ namespace Server.Mobiles
spell = CheckCastHealingSpell();
if( spell != null )
if ( spell != null )
return spell;
switch( Utility.Random( 3 ) )
{
case 0: // Poison them
{
if( c.Poisoned )
if ( c.Poisoned )
goto case 1;
spell = new PoisonSpell( m_Mobile, null );
@ -445,22 +445,22 @@ namespace Server.Mobiles
}
default: // Set up a combo
{
if( m_Mobile.Mana > 15 && m_Mobile.Mana < 40 )
if ( m_Mobile.Mana > 15 && m_Mobile.Mana < 40 )
{
if( c.Paralyzed && !c.Poisoned && !m_Mobile.Meditating )
if ( c.Paralyzed && !c.Poisoned && !m_Mobile.Meditating )
{
m_Mobile.DebugSay( "I am going to meditate" );
m_Mobile.UseSkill( SkillName.Meditation );
}
else if( !c.Poisoned )
else if ( !c.Poisoned )
{
spell = new ParalyzeSpell( m_Mobile, null );
}
}
else if( m_Mobile.Mana > 60 )
else if ( m_Mobile.Mana > 60 )
{
if( Utility.RandomBool() && !c.Paralyzed && !c.Frozen && !c.Poisoned )
if ( Utility.RandomBool() && !c.Paralyzed && !c.Frozen && !c.Poisoned )
{
m_Combo = 0;
spell = new ParalyzeSpell( m_Mobile, null );
@ -485,19 +485,19 @@ namespace Server.Mobiles
{
Spell spell = null;
if( m_Combo == 0 )
if ( m_Combo == 0 )
{
spell = new ExplosionSpell( m_Mobile, null );
++m_Combo; // Move to next spell
}
else if( m_Combo == 1 )
else if ( m_Combo == 1 )
{
spell = new WeakenSpell( m_Mobile, null );
++m_Combo; // Move to next spell
}
else if( m_Combo == 2 )
else if ( m_Combo == 2 )
{
if( !c.Poisoned )
if ( !c.Poisoned )
spell = new PoisonSpell( m_Mobile, null );
else if ( IsNecromancer )
spell = new StrangleSpell( m_Mobile, null );
@ -505,13 +505,13 @@ namespace Server.Mobiles
++m_Combo; // Move to next spell
}
if( m_Combo == 3 && spell == null )
if ( m_Combo == 3 && spell == null )
{
switch( Utility.Random( IsNecromancer ? 4 : 3 ) )
{
case 0:
{
if( c.Int < c.Dex )
if ( c.Int < c.Dex )
spell = new FeeblemindSpell( m_Mobile, null );
else
spell = new ClumsySpell( m_Mobile, null );
@ -540,7 +540,7 @@ namespace Server.Mobiles
}
}
}
else if( m_Combo == 4 && spell == null )
else if ( m_Combo == 4 && spell == null )
{
spell = new MindBlastSpell( m_Mobile, null );
m_Combo = -1;
@ -551,7 +551,7 @@ namespace Server.Mobiles
private TimeSpan GetDelay( Spell spell )
{
if( SmartAI || ( spell is DispelSpell ) )
if ( SmartAI || ( spell is DispelSpell ) )
{
return TimeSpan.FromSeconds( m_Mobile.ActiveSpeed );
}
@ -573,12 +573,12 @@ namespace Server.Mobiles
Mobile c = m_Mobile.Combatant;
m_Mobile.Warmode = true;
if( c == null || c.Deleted || !c.Alive || c.IsDeadBondedPet || !m_Mobile.CanSee( c ) || !m_Mobile.CanBeHarmful( c, false ) || c.Map != m_Mobile.Map )
if ( c == null || c.Deleted || !c.Alive || c.IsDeadBondedPet || !m_Mobile.CanSee( c ) || !m_Mobile.CanBeHarmful( c, false ) || c.Map != m_Mobile.Map )
{
// Our combatant is deleted, dead, hidden, or we cannot hurt them
// Try to find another combatant
if( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
if ( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
{
m_Mobile.DebugSay( "Something happened to my combatant, so I am going to fight {0}", m_Mobile.FocusMob.Name );
@ -593,11 +593,11 @@ namespace Server.Mobiles
}
}
if( !m_Mobile.InLOS( c ) )
if ( !m_Mobile.InLOS( c ) )
{
m_Mobile.DebugSay( "I can't see my target" );
if( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
if ( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
{
m_Mobile.DebugSay( "I will switch to {0}", m_Mobile.FocusMob.Name );
m_Mobile.Combatant = c = m_Mobile.FocusMob;
@ -605,26 +605,26 @@ namespace Server.Mobiles
}
}
if( !Core.AOS && SmartAI && !m_Mobile.StunReady && m_Mobile.Skills[ SkillName.Wrestling ].Value >= 80.0 && m_Mobile.Skills[ SkillName.Anatomy ].Value >= 80.0 )
if ( !Core.AOS && SmartAI && !m_Mobile.StunReady && m_Mobile.Skills[ SkillName.Wrestling ].Value >= 80.0 && m_Mobile.Skills[ SkillName.Anatomy ].Value >= 80.0 )
EventSink.InvokeStunRequest( new StunRequestEventArgs( m_Mobile ) );
if( !m_Mobile.InRange( c, m_Mobile.RangePerception ) )
if ( !m_Mobile.InRange( c, m_Mobile.RangePerception ) )
{
// They are somewhat far away, can we find something else?
if( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
if ( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
{
m_Mobile.Combatant = m_Mobile.FocusMob;
m_Mobile.FocusMob = null;
}
else if( !m_Mobile.InRange( c, m_Mobile.RangePerception * 3 ) )
else if ( !m_Mobile.InRange( c, m_Mobile.RangePerception * 3 ) )
{
m_Mobile.Combatant = null;
}
c = m_Mobile.Combatant;
if( c == null )
if ( c == null )
{
m_Mobile.DebugSay( "My combatant has fled, so I am on guard" );
Action = ActionType.Guard;
@ -633,15 +633,15 @@ namespace Server.Mobiles
}
}
if( !m_Mobile.Controlled && !m_Mobile.Summoned && m_Mobile.CanFlee )
if ( !m_Mobile.Controlled && !m_Mobile.Summoned && m_Mobile.CanFlee )
{
if( m_Mobile.Hits < m_Mobile.HitsMax * 20 / 100 )
if ( m_Mobile.Hits < m_Mobile.HitsMax * 20 / 100 )
{
// We are low on health, should we flee?
bool flee = false;
if( m_Mobile.Hits < c.Hits )
if ( m_Mobile.Hits < c.Hits )
{
// We are more hurt than them
@ -654,7 +654,7 @@ namespace Server.Mobiles
flee = Utility.Random( 0, 100 ) > 10; // 10% chance to flee
}
if( flee )
if ( flee )
{
m_Mobile.DebugSay( "I am going to flee from {0}", c.Name );
@ -671,23 +671,23 @@ namespace Server.Mobiles
Spell spell = null;
Mobile toDispel = FindDispelTarget( true );
if( m_Mobile.Poisoned ) // Top cast priority is cure
if ( m_Mobile.Poisoned ) // Top cast priority is cure
{
m_Mobile.DebugSay( "I am going to cure myself" );
spell = new CureSpell( m_Mobile, null );
}
else if( toDispel != null ) // Something dispellable is attacking us
else if ( toDispel != null ) // Something dispellable is attacking us
{
m_Mobile.DebugSay( "I am going to dispel {0}", toDispel );
spell = DoDispel( toDispel );
}
else if( SmartAI && m_Combo != -1 ) // We are doing a spell combo
else if ( SmartAI && m_Combo != -1 ) // We are doing a spell combo
{
spell = DoCombo( c );
}
else if( SmartAI && ( c.Spell is HealSpell || c.Spell is GreaterHealSpell ) && !c.Poisoned ) // They have a heal spell out
else if ( SmartAI && ( c.Spell is HealSpell || c.Spell is GreaterHealSpell ) && !c.Poisoned ) // They have a heal spell out
{
spell = new PoisonSpell( m_Mobile, null );
}
@ -699,11 +699,11 @@ namespace Server.Mobiles
// Now we have a spell picked
// Move first before casting
if( SmartAI && toDispel != null )
if ( SmartAI && toDispel != null )
{
if( m_Mobile.InRange( toDispel, 10 ) )
if ( m_Mobile.InRange( toDispel, 10 ) )
RunFrom( toDispel );
else if( !m_Mobile.InRange( toDispel, Core.ML ? 10 : 12 ) )
else if ( !m_Mobile.InRange( toDispel, Core.ML ? 10 : 12 ) )
RunTo( toDispel );
}
else
@ -711,12 +711,12 @@ namespace Server.Mobiles
RunTo( c );
}
if( spell != null )
if ( spell != null )
spell.Cast();
m_NextCastTime = Core.TickCount + (int)GetDelay(spell).TotalMilliseconds;
}
else if( m_Mobile.Spell == null || !m_Mobile.Spell.IsCasting )
else if ( m_Mobile.Spell == null || !m_Mobile.Spell.IsCasting )
{
RunTo( c );
}
@ -731,29 +731,29 @@ namespace Server.Mobiles
public override bool DoActionGuard()
{
if( m_LastTarget != null && m_LastTarget.Hidden )
if ( m_LastTarget != null && m_LastTarget.Hidden )
{
Map map = m_Mobile.Map;
if( map == null || !m_Mobile.InRange( m_LastTargetLoc, Core.ML ? 10 : 12 ) )
if ( map == null || !m_Mobile.InRange( m_LastTargetLoc, Core.ML ? 10 : 12 ) )
{
m_LastTarget = null;
}
else if( m_Mobile.Spell == null && Core.TickCount - m_NextCastTime >= 0 )
else if ( m_Mobile.Spell == null && Core.TickCount - m_NextCastTime >= 0 )
{
m_Mobile.DebugSay( "I am going to reveal my last target" );
m_RevealTarget = new LandTarget( m_LastTargetLoc, map );
Spell spell = new RevealSpell( m_Mobile, null );
if( spell.Cast() )
if ( spell.Cast() )
m_LastTarget = null; // only do it once
m_NextCastTime = Core.TickCount + (int)GetDelay(spell).TotalMilliseconds;
}
}
if( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
if ( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
{
m_Mobile.DebugSay( "I am going to attack {0}", m_Mobile.FocusMob.Name );
@ -762,13 +762,13 @@ namespace Server.Mobiles
}
else
{
if( !m_Mobile.Controlled )
if ( !m_Mobile.Controlled )
{
ProcessTarget();
Spell spell = CheckCastHealingSpell();
if( spell != null )
if ( spell != null )
spell.Cast();
}
@ -782,19 +782,19 @@ namespace Server.Mobiles
{
Mobile c = m_Mobile.Combatant;
if( ( m_Mobile.Mana > 20 || m_Mobile.Mana == m_Mobile.ManaMax ) && m_Mobile.Hits > ( m_Mobile.HitsMax / 2 ) )
if ( ( m_Mobile.Mana > 20 || m_Mobile.Mana == m_Mobile.ManaMax ) && m_Mobile.Hits > ( m_Mobile.HitsMax / 2 ) )
{
m_Mobile.DebugSay( "I am stronger now, my guard is up" );
Action = ActionType.Guard;
}
else if( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
else if ( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
{
m_Mobile.DebugSay( "I am scared of {0}", m_Mobile.FocusMob.Name );
RunFrom( m_Mobile.FocusMob );
m_Mobile.FocusMob = null;
if( m_Mobile.Poisoned && Utility.Random( 0, 5 ) == 0 )
if ( m_Mobile.Poisoned && Utility.Random( 0, 5 ) == 0 )
new CureSpell( m_Mobile, null ).Cast();
}
else
@ -810,10 +810,10 @@ namespace Server.Mobiles
public Mobile FindDispelTarget( bool activeOnly )
{
if( m_Mobile.Deleted || m_Mobile.Int < 95 || CanDispel( m_Mobile ) || m_Mobile.AutoDispel )
if ( m_Mobile.Deleted || m_Mobile.Int < 95 || CanDispel( m_Mobile ) || m_Mobile.AutoDispel )
return null;
if( activeOnly )
if ( activeOnly )
{
List<AggressorInfo> aggressed = m_Mobile.Aggressed;
List<AggressorInfo> aggressors = m_Mobile.Aggressors;
@ -823,12 +823,12 @@ namespace Server.Mobiles
Mobile comb = m_Mobile.Combatant;
if( comb != null && !comb.Deleted && comb.Alive && !comb.IsDeadBondedPet && m_Mobile.InRange( comb, Core.ML ? 10 : 12 ) && CanDispel( comb ) )
if ( comb != null && !comb.Deleted && comb.Alive && !comb.IsDeadBondedPet && m_Mobile.InRange( comb, Core.ML ? 10 : 12 ) && CanDispel( comb ) )
{
active = comb;
activePrio = m_Mobile.GetDistanceToSqrt( comb );
if( activePrio <= 2 )
if ( activePrio <= 2 )
return active;
}
@ -837,16 +837,16 @@ namespace Server.Mobiles
AggressorInfo info = aggressed[ i ];
Mobile m = info.Defender;
if( m != comb && m.Combatant == m_Mobile && m_Mobile.InRange( m, Core.ML ? 10 : 12 ) && CanDispel( m ) )
if ( m != comb && m.Combatant == m_Mobile && m_Mobile.InRange( m, Core.ML ? 10 : 12 ) && CanDispel( m ) )
{
double prio = m_Mobile.GetDistanceToSqrt( m );
if( active == null || prio < activePrio )
if ( active == null || prio < activePrio )
{
active = m;
activePrio = prio;
if( activePrio <= 2 )
if ( activePrio <= 2 )
return active;
}
}
@ -857,16 +857,16 @@ namespace Server.Mobiles
AggressorInfo info = aggressors[ i ];
Mobile m = info.Attacker;
if( m != comb && m.Combatant == m_Mobile && m_Mobile.InRange( m, Core.ML ? 10 : 12 ) && CanDispel( m ) )
if ( m != comb && m.Combatant == m_Mobile && m_Mobile.InRange( m, Core.ML ? 10 : 12 ) && CanDispel( m ) )
{
double prio = m_Mobile.GetDistanceToSqrt( m );
if( active == null || prio < activePrio )
if ( active == null || prio < activePrio )
{
active = m;
activePrio = prio;
if( activePrio <= 2 )
if ( activePrio <= 2 )
return active;
}
}
@ -878,14 +878,14 @@ namespace Server.Mobiles
{
Map map = m_Mobile.Map;
if( map != null )
if ( map != null )
{
Mobile active = null, inactive = null;
double actPrio = 0.0, inactPrio = 0.0;
Mobile comb = m_Mobile.Combatant;
if( comb != null && !comb.Deleted && comb.Alive && !comb.IsDeadBondedPet && CanDispel( comb ) )
if ( comb != null && !comb.Deleted && comb.Alive && !comb.IsDeadBondedPet && CanDispel( comb ) )
{
active = inactive = comb;
actPrio = inactPrio = m_Mobile.GetDistanceToSqrt( comb );
@ -893,17 +893,17 @@ namespace Server.Mobiles
foreach( Mobile m in m_Mobile.GetMobilesInRange( Core.ML ? 10 : 12 ) )
{
if( m != m_Mobile && CanDispel( m ) )
if ( m != m_Mobile && CanDispel( m ) )
{
double prio = m_Mobile.GetDistanceToSqrt( m );
if( !activeOnly && ( inactive == null || prio < inactPrio ) )
if ( !activeOnly && ( inactive == null || prio < inactPrio ) )
{
inactive = m;
inactPrio = prio;
}
if( ( m_Mobile.Combatant == m || m.Combatant == m_Mobile ) && ( active == null || prio < actPrio ) )
if ( ( m_Mobile.Combatant == m || m.Combatant == m_Mobile ) && ( active == null || prio < actPrio ) )
{
active = m;
actPrio = prio;
@ -956,7 +956,7 @@ namespace Server.Mobiles
{
Target targ = m_Mobile.Target;
if( targ == null )
if ( targ == null )
return false;
bool isReveal = ( targ is RevealSpell.InternalTarget );
@ -968,31 +968,31 @@ namespace Server.Mobiles
Mobile toTarget;
if( isInvisible )
if ( isInvisible )
{
toTarget = m_Mobile;
}
else if( isDispel )
else if ( isDispel )
{
toTarget = FindDispelTarget( false );
if( !SmartAI && toTarget != null )
if ( !SmartAI && toTarget != null )
RunTo( toTarget );
else if( toTarget != null && m_Mobile.InRange( toTarget, 10 ) )
else if ( toTarget != null && m_Mobile.InRange( toTarget, 10 ) )
RunFrom( toTarget );
}
else if( SmartAI && ( isParalyze || isTeleport ) )
else if ( SmartAI && ( isParalyze || isTeleport ) )
{
toTarget = FindDispelTarget( true );
if( toTarget == null )
if ( toTarget == null )
{
toTarget = m_Mobile.Combatant;
if( toTarget != null )
if ( toTarget != null )
RunTo( toTarget );
}
else if( m_Mobile.InRange( toTarget, 10 ) )
else if ( m_Mobile.InRange( toTarget, 10 ) )
{
RunFrom( toTarget );
teleportAway = true;
@ -1006,34 +1006,34 @@ namespace Server.Mobiles
{
toTarget = m_Mobile.Combatant;
if( toTarget != null )
if ( toTarget != null )
RunTo( toTarget );
}
if( ( targ.Flags & TargetFlags.Harmful ) != 0 && toTarget != null )
if ( ( targ.Flags & TargetFlags.Harmful ) != 0 && toTarget != null )
{
if( ( targ.Range == -1 || m_Mobile.InRange( toTarget, targ.Range ) ) && m_Mobile.CanSee( toTarget ) && m_Mobile.InLOS( toTarget ) )
if ( ( targ.Range == -1 || m_Mobile.InRange( toTarget, targ.Range ) ) && m_Mobile.CanSee( toTarget ) && m_Mobile.InLOS( toTarget ) )
{
targ.Invoke( m_Mobile, toTarget );
}
else if( isDispel )
else if ( isDispel )
{
targ.Cancel( m_Mobile, TargetCancelType.Canceled );
}
}
else if( ( targ.Flags & TargetFlags.Beneficial ) != 0 )
else if ( ( targ.Flags & TargetFlags.Beneficial ) != 0 )
{
targ.Invoke( m_Mobile, m_Mobile );
}
else if( isReveal && m_RevealTarget != null )
else if ( isReveal && m_RevealTarget != null )
{
targ.Invoke( m_Mobile, m_RevealTarget );
}
else if( isTeleport && toTarget != null )
else if ( isTeleport && toTarget != null )
{
Map map = m_Mobile.Map;
if( map == null )
if ( map == null )
{
targ.Cancel( m_Mobile, TargetCancelType.Canceled );
return true;
@ -1041,7 +1041,7 @@ namespace Server.Mobiles
int px, py;
if( teleportAway )
if ( teleportAway )
{
int rx = m_Mobile.X - toTarget.X;
int ry = m_Mobile.Y - toTarget.Y;
@ -1065,7 +1065,7 @@ namespace Server.Mobiles
LandTarget lt = new LandTarget( p, map );
if( ( targ.Range == -1 || m_Mobile.InRange( p, targ.Range ) ) && m_Mobile.InLOS( lt ) && map.CanSpawnMobile( px + x, py + y, lt.Z ) && !SpellHelper.CheckMulti( p, map ) )
if ( ( targ.Range == -1 || m_Mobile.InRange( p, targ.Range ) ) && m_Mobile.InLOS( lt ) && map.CanSpawnMobile( px + x, py + y, lt.Z ) && !SpellHelper.CheckMulti( p, map ) )
{
targ.Invoke( m_Mobile, lt );
return true;
@ -1074,7 +1074,7 @@ namespace Server.Mobiles
int teleRange = targ.Range;
if( teleRange < 0 )
if ( teleRange < 0 )
teleRange = Core.ML ? 11 : 12;
for( int i = 0; i < 10; ++i )
@ -1083,7 +1083,7 @@ namespace Server.Mobiles
LandTarget lt = new LandTarget( randomPoint, map );
if( m_Mobile.InLOS( lt ) && map.CanSpawnMobile( lt.X, lt.Y, lt.Z ) && !SpellHelper.CheckMulti( randomPoint, map ) )
if ( m_Mobile.InLOS( lt ) && map.CanSpawnMobile( lt.X, lt.Y, lt.Z ) && !SpellHelper.CheckMulti( randomPoint, map ) )
{
targ.Invoke( m_Mobile, new LandTarget( randomPoint, map ) );
return true;
@ -1100,4 +1100,4 @@ namespace Server.Mobiles
return true;
}
}
}
}

View file

@ -52,13 +52,13 @@ namespace Server.Mobiles
public override void OnDoubleClick( Mobile from )
{
if( from.AccessLevel >= AccessLevel.GameMaster )
if ( from.AccessLevel >= AccessLevel.GameMaster )
Jump();
}
public virtual void Jump()
{
if( Utility.RandomBool() )
if ( Utility.RandomBool() )
Animate( 3, 16, 1, true, false, 0 );
else
Animate( 4, 20, 1, true, false, 0 );
@ -66,7 +66,7 @@ namespace Server.Mobiles
public override void OnThink()
{
if( Utility.RandomDouble() < .005 ) // slim chance to jump
if ( Utility.RandomDouble() < .005 ) // slim chance to jump
Jump();
base.OnThink();

View file

@ -247,7 +247,7 @@ namespace Server.Mobiles
}
else
{
if( m_Rider != null )
if ( m_Rider != null )
{
Dismount( m_Rider );
}
@ -261,7 +261,7 @@ namespace Server.Mobiles
Internalize();
if( value.Target is Bola.BolaTarget )
if ( value.Target is Bola.BolaTarget )
{
Target.Cancel( value );
}
@ -292,16 +292,16 @@ namespace Server.Mobiles
public virtual void OnRiderDamaged( int amount, Mobile from, bool willKill )
{
if( m_Rider == null )
if ( m_Rider == null )
return;
Mobile attacker = from;
if( attacker == null )
if ( attacker == null )
attacker = m_Rider.FindMostRecentDamager( true );
if( !(attacker == this || attacker == m_Rider || willKill || DateTime.UtcNow < m_NextMountAbility) )
if ( !(attacker == this || attacker == m_Rider || willKill || DateTime.UtcNow < m_NextMountAbility) )
{
if( DoMountAbility( amount, from ) )
if ( DoMountAbility( amount, from ) )
m_NextMountAbility = DateTime.UtcNow + MountAbilityDelay;
}

View file

@ -50,12 +50,12 @@ namespace Server.Mobiles
{
base.GetProperties( list );
if( m_IsDonationItem )
if ( m_IsDonationItem )
{
list.Add( "Donation Ethereal" );
list.Add( "7.5 sec slower cast time if not a 9mo. Veteran" );
}
if( Core.ML && m_IsRewardItem )
if ( Core.ML && m_IsRewardItem )
list.Add( RewardSystem.GetRewardYearLabel( this, new object[] { } ) ); // X Year Veteran Reward
}
@ -68,11 +68,11 @@ namespace Server.Mobiles
}
set
{
if( m_MountedID != value )
if ( m_MountedID != value )
{
m_MountedID = value;
if( m_Rider != null )
if ( m_Rider != null )
ItemID = value;
}
}
@ -87,11 +87,11 @@ namespace Server.Mobiles
}
set
{
if( m_RegularID != value )
if ( m_RegularID != value )
{
m_RegularID = value;
if( m_Rider == null )
if ( m_Rider == null )
ItemID = value;
}
}
@ -108,57 +108,57 @@ namespace Server.Mobiles
public void RemoveFollowers()
{
if( m_Rider != null )
if ( m_Rider != null )
m_Rider.Followers -= FollowerSlots;
if( m_Rider != null && m_Rider.Followers < 0 )
if ( m_Rider != null && m_Rider.Followers < 0 )
m_Rider.Followers = 0;
}
public void AddFollowers()
{
if( m_Rider != null )
if ( m_Rider != null )
m_Rider.Followers += FollowerSlots;
}
public virtual bool Validate( Mobile from )
{
if( Parent == null )
if ( Parent == null )
{
from.SayTo( from, 1010095 ); // This must be on your person to use.
return false;
}
else if( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
else if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
{
// CheckIsUsableBy sends the message
return false;
}
else if( !BaseMount.CheckMountAllowed( from ) )
else if ( !BaseMount.CheckMountAllowed( from ) )
{
// CheckMountAllowed sends the message
return false;
}
else if( from.Mounted )
else if ( from.Mounted )
{
from.SendLocalizedMessage( 1005583 ); // Please dismount first.
return false;
}
else if( from.IsBodyMod && !from.Body.IsHuman )
else if ( from.IsBodyMod && !from.Body.IsHuman )
{
from.SendLocalizedMessage( 1061628 ); // You can't do that while polymorphed.
return false;
}
else if( from.HasTrade )
else if ( from.HasTrade )
{
from.SendLocalizedMessage( 1042317, "", 0x41 ); // You may not ride at this time
return false;
}
else if( ( from.Followers + FollowerSlots ) > from.FollowersMax )
else if ( ( from.Followers + FollowerSlots ) > from.FollowersMax )
{
from.SendLocalizedMessage( 1049679 ); // You have too many followers to summon your mount.
return false;
}
else if( !Multis.DesignContext.Check( from ) )
else if ( !Multis.DesignContext.Check( from ) )
{
// Check sends the message
return false;
@ -169,7 +169,7 @@ namespace Server.Mobiles
public override void OnDoubleClick( Mobile from )
{
if( Validate( from ) )
if ( Validate( from ) )
new EtherealSpell( this, from ).Cast();
}
@ -223,7 +223,7 @@ namespace Server.Mobiles
m_RegularID = reader.ReadInt();
m_Rider = reader.ReadMobile();
if( m_MountedID == 0x3EA2 )
if ( m_MountedID == 0x3EA2 )
m_MountedID = 0x3EAA;
break;
@ -232,7 +232,7 @@ namespace Server.Mobiles
AddFollowers();
if( version < 3 && Weight == 0 )
if ( version < 3 && Weight == 0 )
Weight = -1;
}
@ -247,7 +247,7 @@ namespace Server.Mobiles
{
IMount mount = m.Mount;
if( mount != null )
if ( mount != null )
mount.Rider = null;
}
@ -260,9 +260,9 @@ namespace Server.Mobiles
}
set
{
if( value != m_Rider )
if ( value != m_Rider )
{
if( value == null )
if ( value == null )
{
Internalize();
UnmountMe();
@ -272,7 +272,7 @@ namespace Server.Mobiles
}
else
{
if( m_Rider != null )
if ( m_Rider != null )
Dismount( m_Rider );
Dismount( value );
@ -297,10 +297,10 @@ namespace Server.Mobiles
Layer = Layer.Invalid;
Movable = true;
if( Hue == EtherealHue )
if ( Hue == EtherealHue )
Hue = 0;
if( bp != null )
if ( bp != null )
{
bp.DropItem( this );
}
@ -309,7 +309,7 @@ namespace Server.Mobiles
Point3D loc = m_Rider.Location;
Map map = m_Rider.Map;
if( map == null || map == Map.Internal )
if ( map == null || map == Map.Internal )
{
loc = m_Rider.LogoutLocation;
map = m_Rider.LogoutMap;
@ -325,7 +325,7 @@ namespace Server.Mobiles
Layer = Layer.Mount;
Movable = false;
if( Hue == 0 )
if ( Hue == 0 )
Hue = EtherealHue;
ProcessDelta();
@ -345,7 +345,7 @@ namespace Server.Mobiles
public static void StopMounting( Mobile mob )
{
if( mob.Spell is EtherealSpell )
if ( mob.Spell is EtherealSpell )
( (EtherealSpell)mob.Spell ).Stop();
}
@ -410,7 +410,7 @@ namespace Server.Mobiles
public override bool CheckDisturb( DisturbType type, bool checkFirst, bool resistable )
{
if( type == DisturbType.EquipRequest || type == DisturbType.UseRequest/* || type == DisturbType.Hurt*/ )
if ( type == DisturbType.EquipRequest || type == DisturbType.UseRequest/* || type == DisturbType.Hurt*/ )
return false;
return true;
@ -418,19 +418,19 @@ namespace Server.Mobiles
public override void DoHurtFizzle()
{
if( !m_Stop )
if ( !m_Stop )
base.DoHurtFizzle();
}
public override void DoFizzle()
{
if( !m_Stop )
if ( !m_Stop )
base.DoFizzle();
}
public override void OnDisturb( DisturbType type, bool message )
{
if( message && !m_Stop )
if ( message && !m_Stop )
Caster.SendLocalizedMessage( 1049455 ); // You have been disrupted while attempting to summon your ethereal mount!
//m_Mount.UnmountMe();
@ -438,7 +438,7 @@ namespace Server.Mobiles
public override void OnCast()
{
if( !m_Mount.Deleted && m_Mount.Rider == null && m_Mount.Validate( m_Rider ) )
if ( !m_Mount.Deleted && m_Mount.Rider == null && m_Mount.Validate( m_Rider ) )
m_Mount.Rider = m_Rider;
FinishSequence();
@ -474,10 +474,10 @@ namespace Server.Mobiles
int version = reader.ReadInt();
if( Name == "an ethereal horse" )
if ( Name == "an ethereal horse" )
Name = null;
if( ItemID == 0x2124 )
if ( ItemID == 0x2124 )
ItemID = 0x20DD;
}
}
@ -510,7 +510,7 @@ namespace Server.Mobiles
int version = reader.ReadInt();
if( Name == "an ethereal llama" )
if ( Name == "an ethereal llama" )
Name = null;
}
}
@ -543,7 +543,7 @@ namespace Server.Mobiles
int version = reader.ReadInt();
if( Name == "an ethereal ostard" )
if ( Name == "an ethereal ostard" )
Name = null;
}
}
@ -576,7 +576,7 @@ namespace Server.Mobiles
int version = reader.ReadInt();
if( Name == "an ethereal ridgeback" )
if ( Name == "an ethereal ridgeback" )
Name = null;
}
}
@ -609,7 +609,7 @@ namespace Server.Mobiles
int version = reader.ReadInt();
if( Name == "an ethereal unicorn" )
if ( Name == "an ethereal unicorn" )
Name = null;
}
}
@ -642,7 +642,7 @@ namespace Server.Mobiles
int version = reader.ReadInt();
if( Name == "an ethereal beetle" )
if ( Name == "an ethereal beetle" )
Name = null;
}
}
@ -675,7 +675,7 @@ namespace Server.Mobiles
int version = reader.ReadInt();
if( Name == "an ethereal kirin" )
if ( Name == "an ethereal kirin" )
Name = null;
}
}
@ -708,7 +708,7 @@ namespace Server.Mobiles
int version = reader.ReadInt();
if( Name == "an ethereal swamp dragon" )
if ( Name == "an ethereal swamp dragon" )
Name = null;
}
}
@ -864,7 +864,7 @@ namespace Server.Mobiles
int version = reader.ReadInt();
if( version <= 1 && Hue != 0 )
if ( version <= 1 && Hue != 0 )
{
Hue = 0;
}

View file

@ -76,7 +76,7 @@ namespace Server.Mobiles
if ( BaseSoundID <= 0 )
BaseSoundID = 0xA8;
if( version < 1 )
if ( version < 1 )
{
for ( int i = 0; i < Skills.Length; ++i )
{

View file

@ -41,31 +41,31 @@ namespace Server.Mobiles
1 1075 Strong Green 0.09% 0x855C
* */
if( rand <= 0 )
if ( rand <= 0 )
return 0x855C;
else if( rand <= 1 )
else if ( rand <= 1 )
return 0x8490;
else if( rand <= 3 )
else if ( rand <= 3 )
return 0x8030;
else if( rand <= 5 )
else if ( rand <= 5 )
return 0x8037;
else if( rand <= 8 )
else if ( rand <= 8 )
return 0x8295;
else if( rand <= 11 )
else if ( rand <= 11 )
return 0x8123;
else if( rand <= 16 )
else if ( rand <= 16 )
return 0x8482;
else if( rand <= 24 )
else if ( rand <= 24 )
return 0x8487;
else if( rand <= 34 )
else if ( rand <= 34 )
return 0x8032;
else if( rand <= 44 )
else if ( rand <= 44 )
return 0x8899;
else if( rand <= 54 )
else if ( rand <= 54 )
return 0x8495;
else if( rand <= 64 )
else if ( rand <= 64 )
return 0x848D;
else if( rand <= 74 )
else if ( rand <= 74 )
return 0x847F;
@ -107,7 +107,7 @@ namespace Server.Mobiles
ControlSlots = 4;
MinTameSkill = 98.7;
if( Utility.RandomDouble() < .33 )
if ( Utility.RandomDouble() < .33 )
PackItem( Engines.Plants.Seed.RandomBonsaiSeed() );
if ( Core.ML && Utility.RandomDouble() < .33 )
@ -156,7 +156,7 @@ namespace Server.Mobiles
{
base.OnGaveMeleeAttack( defender );
if( 0.1 > Utility.RandomDouble() )
if ( 0.1 > Utility.RandomDouble() )
{
/* Grasping Claw
* Start cliloc: 1070836
@ -167,7 +167,7 @@ namespace Server.Mobiles
ExpireTimer timer = (ExpireTimer)m_Table[defender];
if( timer != null )
if ( timer != null )
{
timer.DoExpire();
defender.SendLocalizedMessage( 1070837 ); // The creature lands another blow in your weakened state.
@ -233,13 +233,13 @@ namespace Server.Mobiles
base.Deserialize( reader );
int version = reader.ReadInt();
if( version == 0 )
if ( version == 0 )
Timer.DelayCall( TimeSpan.Zero, delegate { Hue = GetHue(); } );
if( version <= 1 )
Timer.DelayCall( TimeSpan.Zero, delegate { if( InternalItem != null ) { InternalItem.Hue = this.Hue; } } );
if ( version <= 1 )
Timer.DelayCall( TimeSpan.Zero, delegate { if ( InternalItem != null ) { InternalItem.Hue = this.Hue; } } );
if( version < 2 )
if ( version < 2 )
{
for ( int i = 0; i < Skills.Length; ++i )
{

View file

@ -22,10 +22,10 @@ namespace Server.Mobiles
public override bool DoMountAbility( int damage, Mobile attacker )
{
if( Rider == null || attacker == null ) //sanity
if ( Rider == null || attacker == null ) //sanity
return false;
if( (Rider.Hits - damage) < 30 && Rider.Map == attacker.Map && Rider.InRange( attacker, 18 ) ) //Range and map checked here instead of other base fuction because of abiliites that don't need to check this
if ( (Rider.Hits - damage) < 30 && Rider.Map == attacker.Map && Rider.InRange( attacker, 18 ) ) //Range and map checked here instead of other base fuction because of abiliites that don't need to check this
{
attacker.BoltEffect( 0 );
// 35~100 damage, unresistable, by the Ki-rin.

View file

@ -29,15 +29,15 @@ namespace Server.Mobiles
* */
if( rand <= 0 )
if ( rand <= 0 )
return 0x8258;
else if( rand <= 1 )
else if ( rand <= 1 )
return 0x88AB;
else if( rand <= 6 )
else if ( rand <= 6 )
return 0x87D4;
else if( rand <= 16 )
else if ( rand <= 16 )
return 0x8163;
else if( rand <= 26 )
else if ( rand <= 26 )
return 0x8295;
@ -79,7 +79,7 @@ namespace Server.Mobiles
ControlSlots = 3;
MinTameSkill = 98.7;
if( Utility.RandomDouble() < .33 )
if ( Utility.RandomDouble() < .33 )
PackItem( Engines.Plants.Seed.RandomBonsaiSeed() );
}
@ -126,21 +126,21 @@ namespace Server.Mobiles
{
double tamingChance = base.GetControlChance( m, useBaseSkill );
if( tamingChance >= 0.95 )
if ( tamingChance >= 0.95 )
{
return tamingChance;
}
double skill = (useBaseSkill? m.Skills.Bushido.Base : m.Skills.Bushido.Value);
if( skill < 90.0 )
if ( skill < 90.0 )
{
return tamingChance;
}
double bushidoChance = ( skill - 30.0 ) / 100;
if( m.Skills.Bushido.Base >= 120 )
if ( m.Skills.Bushido.Base >= 120 )
bushidoChance += 0.05;
return bushidoChance > tamingChance ? bushidoChance : tamingChance;
@ -156,7 +156,7 @@ namespace Server.Mobiles
{
base.OnGaveMeleeAttack( defender );
if( 0.1 > Utility.RandomDouble() )
if ( 0.1 > Utility.RandomDouble() )
{
/* Grasping Claw
* Start cliloc: 1070836
@ -167,7 +167,7 @@ namespace Server.Mobiles
ExpireTimer timer = (ExpireTimer)m_Table[defender];
if( timer != null )
if ( timer != null )
{
timer.DoExpire();
defender.SendLocalizedMessage( 1070837 ); // The creature lands another blow in your weakened state.
@ -233,13 +233,13 @@ namespace Server.Mobiles
base.Deserialize( reader );
int version = reader.ReadInt();
if( version == 0 )
if ( version == 0 )
Timer.DelayCall( TimeSpan.Zero, delegate { Hue = GetHue(); } );
if( version <= 1 )
Timer.DelayCall( TimeSpan.Zero, delegate { if( InternalItem != null ) { InternalItem.Hue = this.Hue; } } );
if ( version <= 1 )
Timer.DelayCall( TimeSpan.Zero, delegate { if ( InternalItem != null ) { InternalItem.Hue = this.Hue; } } );
if( version < 2 )
if ( version < 2 )
{
for ( int i = 0; i < Skills.Length; ++i )
{

View file

@ -22,21 +22,21 @@ namespace Server.Mobiles
public override bool DoMountAbility( int damage, Mobile attacker )
{
if( Rider == null || attacker == null ) //sanity
if ( Rider == null || attacker == null ) //sanity
return false;
if( Rider.Poisoned && ((Rider.Hits - damage) < 40) )
if ( Rider.Poisoned && ((Rider.Hits - damage) < 40) )
{
Poison p = Rider.Poison;
if( p != null )
if ( p != null )
{
int chanceToCure = 10000 + (int)(this.Skills[SkillName.Magery].Value * 75) - ((p.Level + 1) * (Core.AOS ? (p.Level < 4 ? 3300 : 3100) : 1750));
chanceToCure /= 100;
if( chanceToCure > Utility.Random( 100 ) )
if ( chanceToCure > Utility.Random( 100 ) )
{
if( Rider.CurePoison( this ) ) //TODO: Confirm if mount is the one flagged for curing it or the rider is
if ( Rider.CurePoison( this ) ) //TODO: Confirm if mount is the one flagged for curing it or the rider is
{
Rider.LocalOverheadMessage( Server.Network.MessageType.Regular, 0x3B2, true, "Your mount senses you are in danger and aids you with magic." );
Rider.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist );

View file

@ -144,11 +144,11 @@ namespace Server.Mobiles
public static TextDefinition GetFriendlyNameFor( Type t )
{
if( t.IsDefined( typeof( FriendlyNameAttribute ), false ) )
if ( t.IsDefined( typeof( FriendlyNameAttribute ), false ) )
{
object[] objs = t.GetCustomAttributes( typeof( FriendlyNameAttribute ), false );
if( objs != null && objs.Length > 0 )
if ( objs != null && objs.Length > 0 )
{
FriendlyNameAttribute friendly = objs[0] as FriendlyNameAttribute;
@ -422,7 +422,7 @@ namespace Server.Mobiles
{
get
{
if( Spawner is Spawner )
if ( Spawner is Spawner )
{
return ( Spawner as Spawner );
}
@ -751,7 +751,7 @@ namespace Server.Mobiles
public virtual void BreathDealDamage( Mobile target )
{
if( !Evasion.CheckSpellEvasion( target ) )
if ( !Evasion.CheckSpellEvasion( target ) )
{
int physDamage = BreathPhysicalDamage;
int fireDamage = BreathFireDamage;
@ -759,7 +759,7 @@ namespace Server.Mobiles
int poisDamage = BreathPoisonDamage;
int nrgyDamage = BreathEnergyDamage;
if( BreathChaosDamage > 0 )
if ( BreathChaosDamage > 0 )
{
switch( Utility.Random( 5 ))
{
@ -771,7 +771,7 @@ namespace Server.Mobiles
}
}
if( physDamage == 0 && fireDamage == 0 && coldDamage == 0 && poisDamage == 0 && nrgyDamage == 0 )
if ( physDamage == 0 && fireDamage == 0 && coldDamage == 0 && poisDamage == 0 && nrgyDamage == 0 )
{
target.Damage( BreathComputeDamage(), this );// Unresistable damage even in AOS
}
@ -1003,7 +1003,7 @@ namespace Server.Mobiles
if ( !(m is BaseCreature) || m is Server.Engines.Quests.Haven.MilitiaFighter )
return true;
if( TransformationSpellHelper.UnderTransformation( m, typeof( EtherealVoyageSpell ) ) )
if ( TransformationSpellHelper.UnderTransformation( m, typeof( EtherealVoyageSpell ) ) )
return false;
if ( m is PlayerMobile && ( (PlayerMobile)m ).HonorActive )
@ -1073,16 +1073,16 @@ namespace Server.Mobiles
int lore = (int)((useBaseSkill ? m.Skills[SkillName.AnimalLore].Base : m.Skills[SkillName.AnimalLore].Value )* 10);
int bonus = 0, chance = 700;
if( Core.ML )
if ( Core.ML )
{
int SkillBonus = taming - (int)(dMinTameSkill * 10);
int LoreBonus = lore - (int)(dMinTameSkill * 10);
int SkillMod = 6, LoreMod = 6;
if( SkillBonus < 0 )
if ( SkillBonus < 0 )
SkillMod = 28;
if( LoreBonus < 0 )
if ( LoreBonus < 0 )
LoreMod = 14;
SkillBonus *= SkillMod;
@ -1322,9 +1322,9 @@ namespace Server.Mobiles
if ( m_HitsMax > 0 ) {
int value = m_HitsMax + GetStatOffset( StatType.Str );
if( value < 1 )
if ( value < 1 )
value = 1;
else if( value > 65000 )
else if ( value > 65000 )
value = 65000;
return value;
@ -1349,9 +1349,9 @@ namespace Server.Mobiles
if ( m_StamMax > 0 ) {
int value = m_StamMax + GetStatOffset( StatType.Dex );
if( value < 1 )
if ( value < 1 )
value = 1;
else if( value > 65000 )
else if ( value > 65000 )
value = 65000;
return value;
@ -1376,9 +1376,9 @@ namespace Server.Mobiles
if ( m_ManaMax > 0 ) {
int value = m_ManaMax + GetStatOffset( StatType.Int );
if( value < 1 )
if ( value < 1 )
value = 1;
else if( value > 65000 )
else if ( value > 65000 )
value = 65000;
return value;
@ -1445,7 +1445,7 @@ namespace Server.Mobiles
public virtual void CheckDistracted( Mobile from )
{
if( Utility.RandomDouble() < .10 )
if ( Utility.RandomDouble() < .10 )
{
ControlTarget = from;
ControlOrder = OrderType.Attack;
@ -1461,22 +1461,22 @@ namespace Server.Mobiles
int disruptThreshold;
//NPCs can use bandages too!
if( !Core.AOS )
if ( !Core.AOS )
disruptThreshold = 0;
else if( from != null && from.Player )
else if ( from != null && from.Player )
disruptThreshold = 18;
else
disruptThreshold = 25;
if( amount > disruptThreshold )
if ( amount > disruptThreshold )
{
BandageContext c = BandageContext.GetContext( this );
if( c != null )
if ( c != null )
c.Slip();
}
if( Confidence.IsRegenerating( this ) )
if ( Confidence.IsRegenerating( this ) )
Confidence.StopRegenerating( this );
WeightOverloading.FatigueOnDamage( this, amount );
@ -1489,14 +1489,14 @@ namespace Server.Mobiles
if ( m_ReceivedHonorContext != null )
m_ReceivedHonorContext.OnTargetDamaged( from, amount );
if( !willKill )
if ( !willKill )
{
if( CanBeDistracted && ControlOrder == OrderType.Follow )
if ( CanBeDistracted && ControlOrder == OrderType.Follow )
{
CheckDistracted( from );
}
}
else if( from is PlayerMobile )
else if ( from is PlayerMobile )
{
Timer.DelayCall( TimeSpan.FromSeconds( 10 ), new TimerCallback( ( ( PlayerMobile )from ).RecoverAmmo ) );
}
@ -1506,7 +1506,7 @@ namespace Server.Mobiles
public virtual void OnDamagedBySpell( Mobile from )
{
if( CanBeDistracted && ControlOrder == OrderType.Follow )
if ( CanBeDistracted && ControlOrder == OrderType.Follow )
{
CheckDistracted( from );
}
@ -2106,7 +2106,7 @@ namespace Server.Mobiles
if ( version >= 19 )
m_HomeMap = reader.ReadMap();
if( version <= 14 && m_Paragon && Hue == 0x31 )
if ( version <= 14 && m_Paragon && Hue == 0x31 )
{
Hue = Paragon.Hue; //Paragon hue fixed, should now be 0x501.
}
@ -2327,7 +2327,7 @@ namespace Server.Mobiles
from.SendLocalizedMessage( 1049666 ); // Your pet has bonded with you!
}
}
else if( Core.ML )
else if ( Core.ML )
{
from.SendLocalizedMessage( 1075268 ); // Your pet cannot form a bond with you until your animal taming ability has risen.
}
@ -2405,7 +2405,7 @@ namespace Server.Mobiles
if ( m_AI != null )
m_AI.m_Timer.Stop();
if( ForcedAI != null )
if ( ForcedAI != null )
{
m_AI = ForcedAI;
return;
@ -2673,17 +2673,17 @@ namespace Server.Mobiles
if ( m_ControlMaster != null )
{
m_ControlMaster.Followers -= ControlSlots;
if( m_ControlMaster is PlayerMobile )
if ( m_ControlMaster is PlayerMobile )
{
((PlayerMobile)m_ControlMaster).AllFollowers.Remove( this );
if( ((PlayerMobile)m_ControlMaster).AutoStabled.Contains( this ) )
if ( ((PlayerMobile)m_ControlMaster).AutoStabled.Contains( this ) )
((PlayerMobile)m_ControlMaster).AutoStabled.Remove( this );
}
}
else if ( m_SummonMaster != null )
{
m_SummonMaster.Followers -= ControlSlots;
if( m_SummonMaster is PlayerMobile )
if ( m_SummonMaster is PlayerMobile )
{
((PlayerMobile)m_SummonMaster).AllFollowers.Remove( this );
}
@ -2701,7 +2701,7 @@ namespace Server.Mobiles
if ( m_ControlMaster != null )
{
m_ControlMaster.Followers += ControlSlots;
if( m_ControlMaster is PlayerMobile )
if ( m_ControlMaster is PlayerMobile )
{
((PlayerMobile)m_ControlMaster).AllFollowers.Add( this );
}
@ -2709,7 +2709,7 @@ namespace Server.Mobiles
else if ( m_SummonMaster != null )
{
m_SummonMaster.Followers += ControlSlots;
if( m_SummonMaster is PlayerMobile )
if ( m_SummonMaster is PlayerMobile )
{
((PlayerMobile)m_SummonMaster).AllFollowers.Add( this );
}
@ -3146,7 +3146,7 @@ namespace Server.Mobiles
if ( !CanTeach )
return false;
if( skill == SkillName.Stealth && from.Skills[SkillName.Hiding].Base < Stealth.HidingRequirement )
if ( skill == SkillName.Stealth && from.Skills[SkillName.Hiding].Base < Stealth.HidingRequirement )
return false;
if ( skill == SkillName.RemoveTrap && (from.Skills[SkillName.Lockpicking].Base < 50.0 || from.Skills[SkillName.DetectHidden].Base < 50.0) )
@ -3346,7 +3346,7 @@ namespace Server.Mobiles
if ( m_AI != null )
{
if( !Core.ML || ( ct != OrderType.Follow && ct != OrderType.Stop && ct != OrderType.Stay ) )
if ( !Core.ML || ( ct != OrderType.Follow && ct != OrderType.Stop && ct != OrderType.Stay ) )
{
m_AI.OnAggressiveAction( aggressor );
}
@ -3597,7 +3597,7 @@ namespace Server.Mobiles
public virtual void CheckedAnimate( int action, int frameCount, int repeatCount, bool forward, bool repeat, int delay )
{
if( !Mounted )
if ( !Mounted )
{
base.Animate( action, frameCount, repeatCount, forward, repeat, delay );
}
@ -3622,7 +3622,7 @@ namespace Server.Mobiles
Warmode = ( Combatant != null && !Combatant.Deleted && Combatant.Alive );
if( CanFly && Warmode )
if ( CanFly && Warmode )
{
Flying = false;
}
@ -3649,15 +3649,15 @@ namespace Server.Mobiles
public override void OnMovement( Mobile m, Point3D oldLocation )
{
if( AcquireOnApproach && ( !Controlled && !Summoned ) && FightMode != FightMode.Aggressor )
if ( AcquireOnApproach && ( !Controlled && !Summoned ) && FightMode != FightMode.Aggressor )
{
if( InRange( m.Location, AcquireOnApproachRange ) && !InRange( oldLocation, AcquireOnApproachRange ) )
if ( InRange( m.Location, AcquireOnApproachRange ) && !InRange( oldLocation, AcquireOnApproachRange ) )
{
if( CanBeHarmful( m ) && IsEnemy( m ))
if ( CanBeHarmful( m ) && IsEnemy( m ))
{
Combatant = FocusMob = m;
if( AIObject != null )
if ( AIObject != null )
{
AIObject.MoveTo( m, true, 1 );
}
@ -3666,7 +3666,7 @@ namespace Server.Mobiles
}
}
}
else if( ReacquireOnMovement )
else if ( ReacquireOnMovement )
{
ForceReacquire();
}
@ -3769,7 +3769,7 @@ namespace Server.Mobiles
for( i=0; i< m_SpellAttack.Count; i++ )
{
if( m_SpellAttack[i] == type )
if ( m_SpellAttack[i] == type )
{
object[] args = { this, null };
return Activator.CreateInstance( type, args ) as Spell;
@ -4054,7 +4054,7 @@ namespace Server.Mobiles
{
if ( Backpack != null )
{
if( Backpack.Items.Count > 0 )
if ( Backpack.Items.Count > 0 )
{
Backpack b = new CreatureBackpack( Name );
@ -4946,7 +4946,7 @@ namespace Server.Mobiles
Region region = ds.m_Mobile.Region;
if( !givenToTKill && ( Map == Map.Tokuno || region.IsPartOf( "Yomotsu Mines" ) || region.IsPartOf( "Fan Dancer's Dojo" ) ))
if ( !givenToTKill && ( Map == Map.Tokuno || region.IsPartOf( "Yomotsu Mines" ) || region.IsPartOf( "Fan Dancer's Dojo" ) ))
{
givenToTKill = true;
TreasuresOfTokuno.HandleKill( this, ds.m_Mobile );
@ -5407,9 +5407,9 @@ namespace Server.Mobiles
{
Mobile target = this.Combatant;
if( target != null && target.Alive && !target.IsDeadBondedPet && CanBeHarmful( target ) && target.Map == this.Map && !IsDeadBondedPet && target.InRange( this, BreathRange ) && InLOS( target ) && !BardPacified )
if ( target != null && target.Alive && !target.IsDeadBondedPet && CanBeHarmful( target ) && target.Map == this.Map && !IsDeadBondedPet && target.InRange( this, BreathRange ) && InLOS( target ) && !BardPacified )
{
if( ( Core.TickCount - m_NextBreathTime ) < 30000 && Utility.RandomBool() )
if ( ( Core.TickCount - m_NextBreathTime ) < 30000 && Utility.RandomBool() )
{
BreathStart( target );
}
@ -5574,7 +5574,7 @@ namespace Server.Mobiles
string name = this.Name;
if( name == null || str.Length < name.Length )
if ( name == null || str.Length < name.Length )
return false;
string[] wordsString = str.Split(' ');
@ -5691,13 +5691,13 @@ namespace Server.Mobiles
private bool IsSpawnerBound()
{
if( ( Map != null ) && ( Map != Map.Internal ) )
if ( ( Map != null ) && ( Map != Map.Internal ) )
{
if( FightMode != FightMode.None && ( RangeHome >= 0 ) )
if ( FightMode != FightMode.None && ( RangeHome >= 0 ) )
{
if( !Controlled && !Summoned )
if ( !Controlled && !Summoned )
{
if( Spawner != null && Spawner is Spawner && ( ( Spawner as Spawner ).Map ) == Map )
if ( Spawner != null && Spawner is Spawner && ( ( Spawner as Spawner ).Map ) == Map )
{
return true;
}
@ -5718,13 +5718,13 @@ namespace Server.Mobiles
public override void OnSectorDeactivate()
{
if( !Deleted && ReturnsToHome && IsSpawnerBound() && !this.InRange( Home, ( RangeHome + 5 ) ) )
if ( !Deleted && ReturnsToHome && IsSpawnerBound() && !this.InRange( Home, ( RangeHome + 5 ) ) )
{
Timer.DelayCall( TimeSpan.FromSeconds( ( Utility.Random( 45 ) + 15 ) ), new TimerCallback( GoHome_Callback ) );
m_ReturnQueued = true;
}
else if( PlayerRangeSensitive && m_AI != null )
else if ( PlayerRangeSensitive && m_AI != null )
{
m_AI.Deactivate();
}
@ -5734,13 +5734,13 @@ namespace Server.Mobiles
public void GoHome_Callback()
{
if( m_ReturnQueued && IsSpawnerBound() )
if ( m_ReturnQueued && IsSpawnerBound() )
{
if( !( ( Map.GetSector( X, Y ) ).Active ) )
if ( !( ( Map.GetSector( X, Y ) ).Active ) )
{
this.SetLocation( Home, true );
if( !( ( Map.GetSector( X, Y ) ).Active ) && m_AI != null )
if ( !( ( Map.GetSector( X, Y ) ).Active ) && m_AI != null )
{
m_AI.Deactivate();
}
@ -5752,7 +5752,7 @@ namespace Server.Mobiles
public override void OnSectorActivate()
{
if( PlayerRangeSensitive && m_AI != null )
if ( PlayerRangeSensitive && m_AI != null )
{
m_AI.Activate();
}
@ -5838,7 +5838,7 @@ namespace Server.Mobiles
{
c.Loyalty -= (BaseCreature.MaxLoyalty / 10);
if( c.Loyalty < (BaseCreature.MaxLoyalty / 10) )
if ( c.Loyalty < (BaseCreature.MaxLoyalty / 10) )
{
c.Say( 1043270, c.Name ); // * ~1_NAME~ looks around desperately *
c.PlaySound( c.GetIdleSound() );

View file

@ -24,17 +24,17 @@ namespace Server.Mobiles
public virtual void RangeCheck()
{
if( !Deleted && ControlMaster != null && !ControlMaster.Deleted )
if ( !Deleted && ControlMaster != null && !ControlMaster.Deleted )
{
int range = ( RangeHome - 2 );
if( !InRange( ControlMaster.Location, RangeHome ) )
if ( !InRange( ControlMaster.Location, RangeHome ) )
{
Mobile master = ControlMaster;
Point3D m_Loc = Point3D.Zero;
if( Map == master.Map )
if ( Map == master.Map )
{
int x = ( X > master.X ) ? ( master.X + range ) : ( master.X - range );
int y = ( Y > master.Y ) ? ( master.Y + range ) : ( master.Y - range );
@ -46,7 +46,7 @@ namespace Server.Mobiles
m_Loc.Z = Map.GetAverageZ( m_Loc.X, m_Loc.Y );
if( Map.CanSpawnMobile( m_Loc ) )
if ( Map.CanSpawnMobile( m_Loc ) )
{
break;
}
@ -54,7 +54,7 @@ namespace Server.Mobiles
m_Loc = master.Location;
}
if( !Deleted )
if ( !Deleted )
{
SetLocation( m_Loc, true );
}
@ -67,11 +67,11 @@ namespace Server.Mobiles
{
Mobile master = ControlMaster;
if( Deleted )
if ( Deleted )
{
return;
}
if( master == null || master.Deleted )
if ( master == null || master.Deleted )
{
DropPackContents();
EndRelease( null );
@ -80,10 +80,10 @@ namespace Server.Mobiles
RangeCheck();
if( m_LastHidden != master.Hidden )
if ( m_LastHidden != master.Hidden )
Hidden = m_LastHidden = master.Hidden;
if( AIObject != null && AIObject.WalkMobileRange( master, 5, true, 1, 1 ))
if ( AIObject != null && AIObject.WalkMobileRange( master, 5, true, 1, 1 ))
{
Warmode = master.Warmode;
Combatant = master.Combatant;

View file

@ -65,7 +65,7 @@ namespace Server.Mobiles
}
Utility.AssignRandomHair( this );
if( Utility.RandomBool() )
if ( Utility.RandomBool() )
Utility.AssignRandomFacialHair( this, HairHue );
Halberd weapon = new Halberd();
@ -264,7 +264,7 @@ namespace Server.Mobiles
Mobile target = m_Owner.Focus;
if ( target != null && (target.Deleted || !target.Alive || !m_Owner.CanBeHarmful( target )) )
if ( target != null && (target.Deleted || !target.Alive || !m_Owner.CanBeHarmful( target )) )
{
m_Owner.Focus = null;
Stop();
@ -366,4 +366,4 @@ namespace Server.Mobiles
}
}
}
}
}

View file

@ -49,7 +49,7 @@ namespace Server.Mobiles
PackItem( new ZoogiFungus( ( Utility.RandomDouble() > 0.05 )? 5 : 25 ) );
if( Utility.RandomDouble() < 0.05 )
if ( Utility.RandomDouble() < 0.05 )
PackItem( new BallOfSummoning() );
}

View file

@ -62,7 +62,7 @@ namespace Server.Mobiles
public override void OnDamagedBySpell( Mobile from )
{
if( from != null && from.Alive && 0.4 > Utility.RandomDouble() )
if ( from != null && from.Alive && 0.4 > Utility.RandomDouble() )
{
ThrowHatchet( from );
}
@ -72,7 +72,7 @@ namespace Server.Mobiles
{
base.OnGotMeleeAttack( attacker );
if( attacker != null && attacker.Alive && attacker.Weapon is BaseRanged && 0.4 > Utility.RandomDouble() )
if ( attacker != null && attacker.Alive && attacker.Weapon is BaseRanged && 0.4 > Utility.RandomDouble() )
{
ThrowHatchet( attacker );
}

View file

@ -115,7 +115,7 @@ namespace Server.Mobiles
public void BeginSavageDance()
{
if( this.Map == null )
if ( this.Map == null )
return;
ArrayList list = new ArrayList();

View file

@ -17,7 +17,7 @@ namespace Server.Mobiles
Hue = 0x8026;
Buckler buckler = new Buckler();
ChainCoif coif = new ChainCoif();
ChainCoif coif = new ChainCoif ();
PlateGloves gloves = new PlateGloves();
buckler.Hue = 0x835; buckler.Movable = false;

View file

@ -107,7 +107,7 @@ namespace Server.Mobiles
public override void OnDamagedBySpell( Mobile from )
{
if( from != null && from.Alive && 0.4 > Utility.RandomDouble() )
if ( from != null && from.Alive && 0.4 > Utility.RandomDouble() )
{
SendEBolt( from );
}
@ -139,7 +139,7 @@ namespace Server.Mobiles
attacker.SendAsciiMessage( "Your weapon cannot penetrate the creature's magical barrier" );
}
if( attacker != null && attacker.Alive && attacker.Weapon is BaseRanged && 0.4 > Utility.RandomDouble() )
if ( attacker != null && attacker.Alive && attacker.Weapon is BaseRanged && 0.4 > Utility.RandomDouble() )
{
SendEBolt( attacker );
}

View file

@ -103,7 +103,7 @@ namespace Server.Mobiles
public override void OnDamagedBySpell( Mobile from )
{
if( from != null && from.Alive && 0.4 > Utility.RandomDouble() )
if ( from != null && from.Alive && 0.4 > Utility.RandomDouble() )
{
SendEBolt( from );
}
@ -135,7 +135,7 @@ namespace Server.Mobiles
attacker.SendAsciiMessage( "Your weapon cannot penetrate the creature's magical barrier" );
}
if( attacker != null && attacker.Alive && attacker.Weapon is BaseRanged && 0.4 > Utility.RandomDouble() )
if ( attacker != null && attacker.Alive && attacker.Weapon is BaseRanged && 0.4 > Utility.RandomDouble() )
{
SendEBolt( attacker );
}
@ -185,7 +185,7 @@ namespace Server.Mobiles
m_FieldActive = CanUseField;
if( this.Name == "Exodus Overseer" )
if ( this.Name == "Exodus Overseer" )
this.Name = null;
}
}

View file

@ -197,9 +197,9 @@ namespace Server.Mobiles
less than stam.
*/
if( Str < Hits )
if ( Str < Hits )
Str = Hits;
if( Dex < Stam )
if ( Dex < Stam )
Dex = Stam;
Karma = -1000;
@ -211,7 +211,7 @@ namespace Server.Mobiles
public override void OnThink()
{
if( SummonMaster == null || SummonMaster.Deleted )
if ( SummonMaster == null || SummonMaster.Deleted )
{
Delete();
}
@ -222,9 +222,9 @@ namespace Server.Mobiles
but never actually "follow".
*/
else if( !Combat( this ))
else if ( !Combat( this ))
{
if( AIObject != null )
if ( AIObject != null )
{
AIObject.MoveTo( SummonMaster, false , 5 );
}
@ -237,14 +237,14 @@ namespace Server.Mobiles
engaged in combat.
*/
else if( !Combat( SummonMaster ))
else if ( !Combat( SummonMaster ))
{
BaseCreature bc = null;
if( Combatant is BaseCreature )
if ( Combatant is BaseCreature )
{
bc = (BaseCreature)Combatant;
}
if( Combatant.Player || ( bc != null && ( bc.Controlled || bc.SummonMaster != null )))
if ( Combatant.Player || ( bc != null && ( bc.Controlled || bc.SummonMaster != null )))
{
SummonMaster.Combatant = Combatant;
}
@ -258,7 +258,7 @@ namespace Server.Mobiles
private bool Combat( Mobile mobile )
{
Mobile combatant = mobile.Combatant;
if( combatant == null || combatant.Deleted )
if ( combatant == null || combatant.Deleted )
{
return false;
}

View file

@ -89,11 +89,11 @@ namespace Server.Mobiles
{
m_NextAbilityTime = DateTime.UtcNow + TimeSpan.FromSeconds( Utility.RandomMinMax( 20, 30 ) );
if( combatant is BaseCreature )
if ( combatant is BaseCreature )
{
BaseCreature bc = (BaseCreature)combatant;
if( bc.Controlled && bc.ControlMaster != null && !bc.ControlMaster.Deleted && bc.ControlMaster.Alive )
if ( bc.Controlled && bc.ControlMaster != null && !bc.ControlMaster.Deleted && bc.ControlMaster.Alive )
{
if ( bc.ControlMaster.Map == this.Map && bc.ControlMaster.InRange( this, 12 ) && !UnderEffect( bc.ControlMaster ) )
{
@ -102,7 +102,7 @@ namespace Server.Mobiles
}
}
if( Utility.RandomDouble() < .1 )
if ( Utility.RandomDouble() < .1 )
{
int[][] coord =
{

View file

@ -78,11 +78,11 @@ namespace Server.Mobiles
Say( m_Vocabulary[ Utility.Random( m_Vocabulary.Length ) ] );
if ( to != null && Utility.RandomBool() )
Timer.DelayCall( TimeSpan.FromSeconds( Utility.RandomMinMax( 5, 8 ) ), new TimerCallback( delegate() { to.Talk(); } ) );
Timer.DelayCall( TimeSpan.FromSeconds( Utility.RandomMinMax( 5, 8 ) ), new TimerCallback( delegate { to.Talk(); } ) );
m_CanTalk = false;
Timer.DelayCall( TimeSpan.FromSeconds( Utility.RandomMinMax( 20, 30 ) ), new TimerCallback( delegate() { m_CanTalk = true; } ) );
Timer.DelayCall( TimeSpan.FromSeconds( Utility.RandomMinMax( 20, 30 ) ), new TimerCallback( delegate { m_CanTalk = true; } ) );
}
}

View file

@ -86,7 +86,7 @@ namespace Server.Mobiles
public override void OnDamage( int amount, Mobile from, bool willKill )
{
if( Utility.RandomDouble() < 0.1 )
if ( Utility.RandomDouble() < 0.1 )
DropOoze();
base.OnDamage( amount, from, willKill );
@ -104,7 +104,7 @@ namespace Server.Mobiles
public virtual Point3D GetSpawnPosition( Point3D from, Map map, int range )
{
if( map == null )
if ( map == null )
return from;
Point3D loc = new Point3D( ( RandomPoint( X ) ), ( RandomPoint( Y ) ), Z );
@ -130,22 +130,22 @@ namespace Server.Mobiles
bool found = false;
foreach( Item item in Map.GetItemsInRange( p, 0 ) )
if( item is StainedOoze )
if ( item is StainedOoze )
{
found = true;
break;
}
if( !found )
if ( !found )
break;
}
ooze.MoveToWorld( p, Map );
}
if( Combatant != null )
if ( Combatant != null )
{
if( corrosive )
if ( corrosive )
Combatant.SendLocalizedMessage( 1072071 ); // A corrosive gas seeps out of your enemy's skin!
else
Combatant.SendLocalizedMessage( 1072072 ); // A poisonous gas seeps out of your enemy's skin!

View file

@ -90,7 +90,7 @@ namespace Server.Mobiles
SetDamage( 24, 33 );
if( version == 0 )
if ( version == 0 )
{
Server.SkillHandlers.AnimalTaming.ScaleStats( this, 0.50 );
Server.SkillHandlers.AnimalTaming.ScaleSkills( this, 0.80, 0.90 ); // 90% * 80% = 72% of original skills trainable to 90%

View file

@ -125,10 +125,10 @@ namespace Server.Mobiles
/*if ( Utility.RandomDouble() < 0.6 )
c.DropItem( new ParrotItem() ); */
if( Utility.RandomDouble() < 0.05 )
if ( Utility.RandomDouble() < 0.05 )
c.DropItem( new GrizzledMareStatuette() );
if( Utility.RandomDouble() < 0.025 )
if ( Utility.RandomDouble() < 0.025 )
c.DropItem( new CrimsonCincture() );
// TODO: Armor sets
@ -156,13 +156,13 @@ namespace Server.Mobiles
{
base.OnGaveMeleeAttack( defender );
if( Utility.RandomDouble() < 0.25 )
if ( Utility.RandomDouble() < 0.25 )
CacophonicAttack( defender );
}
public override void OnDamage( int amount, Mobile from, bool willKill )
{
if( Utility.RandomDouble() < 0.1 )
if ( Utility.RandomDouble() < 0.1 )
DropOoze();
base.OnDamage( amount, from, willKill );
@ -216,10 +216,10 @@ namespace Server.Mobiles
public virtual void CacophonicAttack( Mobile to )
{
if( m_Table == null )
if ( m_Table == null )
m_Table = new Hashtable();
if( to.Alive && to.Player && m_Table[ to ] == null )
if ( to.Alive && to.Player && m_Table[ to ] == null )
{
to.Send( SpeedControl.WalkSpeed );
to.SendLocalizedMessage( 1072069 ); // A cacophonic sound lambastes you, suppressing your ability to move.
@ -231,13 +231,13 @@ namespace Server.Mobiles
private void EndCacophonic_Callback( object state )
{
if( state is Mobile )
if ( state is Mobile )
CacophonicEnd( (Mobile)state );
}
public virtual void CacophonicEnd( Mobile from )
{
if( m_Table == null )
if ( m_Table == null )
m_Table = new Hashtable();
m_Table[ from ] = null;
@ -247,7 +247,7 @@ namespace Server.Mobiles
public static bool UnderCacophonicAttack( Mobile from )
{
if( m_Table == null )
if ( m_Table == null )
m_Table = new Hashtable();
return m_Table[ from ] != null;
@ -271,22 +271,22 @@ namespace Server.Mobiles
bool found = false;
foreach( Item item in Map.GetItemsInRange( p, 0 ) )
if( item is StainedOoze )
if ( item is StainedOoze )
{
found = true;
break;
}
if( !found )
if ( !found )
break;
}
ooze.MoveToWorld( p, Map );
}
if( Combatant != null )
if ( Combatant != null )
{
if( corrosive )
if ( corrosive )
Combatant.SendLocalizedMessage( 1072071 ); // A corrosive gas seeps out of your enemy's skin!
else
Combatant.SendLocalizedMessage( 1072072 ); // A poisonous gas seeps out of your enemy's skin!
@ -305,7 +305,7 @@ namespace Server.Mobiles
public virtual Point3D GetSpawnPosition( Point3D from, Map map, int range )
{
if( map == null )
if ( map == null )
return from;
Point3D loc = new Point3D( ( RandomPoint( X ) ), ( RandomPoint( Y ) ), Z );

View file

@ -187,10 +187,10 @@ namespace Server.Mobiles
for (int i = 0; i < targets.Count; ++i)
{
Mobile m = (Mobile)targets[i];
if( m != null && !m.Deleted && m is PlayerMobile )
if ( m != null && !m.Deleted && m is PlayerMobile )
{
PlayerMobile pm = m as PlayerMobile;
if(pm != null && pm.Mounted)
if (pm != null && pm.Mounted)
{
pm.Mount.Rider=null;
}

View file

@ -55,11 +55,11 @@ namespace Server.Mobiles
{
base.OnGaveMeleeAttack( defender );
if( 0.1 > Utility.RandomDouble() )
if ( 0.1 > Utility.RandomDouble() )
{
ExpireTimer timer = (ExpireTimer)m_Table[defender];
if( timer != null )
if ( timer != null )
{
timer.DoExpire();
defender.SendLocalizedMessage( 1070837 ); // The creature lands another blow in your weakened state.

View file

@ -190,7 +190,7 @@ namespace Server.Mobiles
// Ensure that the corpse was killed by us
if ( item.Killer == this && item.Owner != null )
{
if( !item.DevourCorpse() && !item.Devoured )
if ( !item.DevourCorpse() && !item.Devoured )
PublicOverheadMessage( MessageType.Emote, 0x3B2, 1053032 ); // * The plague beast attempts to absorb the remains, but cannot! *
}
}
@ -201,10 +201,10 @@ namespace Server.Mobiles
public bool Devour( Corpse corpse )
{
if( corpse == null || corpse.Owner == null ) // sorry we can't devour because the corpse's owner is null
if ( corpse == null || corpse.Owner == null ) // sorry we can't devour because the corpse's owner is null
return false;
if( corpse.Owner.Body.IsHuman )
if ( corpse.Owner.Body.IsHuman )
corpse.TurnToBones(); // Not bones yet, and we are a human body therefore we turn to bones.
IncreaseHits( (int)Math.Ceiling( (double)corpse.Owner.HitsMax * 0.75 ) );
@ -212,7 +212,7 @@ namespace Server.Mobiles
PublicOverheadMessage( MessageType.Emote, 0x3B2, 1053033 ); // * The plague beast absorbs the fleshy remains of the corpse *
if( !m_HasMetalChest && m_DevourTotal >= DevourGoal )
if ( !m_HasMetalChest && m_DevourTotal >= DevourGoal )
{
PackItem( new MetalChest() );
m_HasMetalChest = true;
@ -230,10 +230,10 @@ namespace Server.Mobiles
if ( this.IsParagon )
maxhits = (int)(maxhits * Paragon.HitsBuff);
if( hp < 1000 && !Core.AOS )
if ( hp < 1000 && !Core.AOS )
hp = (hp * 100) / 60;
if( HitsMaxSeed >= maxhits )
if ( HitsMaxSeed >= maxhits )
{
HitsMaxSeed = maxhits;

View file

@ -50,7 +50,7 @@ namespace Server.Mobiles
rope.ItemID = 0x14F8;
PackItem( rope );
if( Utility.RandomDouble() < .05 )
if ( Utility.RandomDouble() < .05 )
PackItem( new MessageInABottle() );
PackItem( new SpecialFishingNet() ); //Confirm?

View file

@ -111,7 +111,7 @@ namespace Server.Mobiles
if ( combatant == null || combatant.Deleted || combatant.Map != Map || !InRange( combatant, 12 ) || !CanBeHarmful( combatant ) || !InLOS( combatant ) )
return;
if( Utility.Random( 10 ) == 0 )
if ( Utility.Random( 10 ) == 0 )
PoisonAttack( combatant );
base.OnDamage( amount, from, willKill );

View file

@ -41,7 +41,7 @@ namespace Server.Mobiles
Karma = -700;
if( Utility.RandomBool() )
if ( Utility.RandomBool() )
{
Item i = Loot.RandomReagent();
i.Amount = 3;

View file

@ -68,7 +68,7 @@ namespace Server.Mobiles
AddItem( new LeatherNinjaPants());
AddItem( new LeatherNinjaMitts());
if( Utility.RandomDouble() < 0.33 )
if ( Utility.RandomDouble() < 0.33 )
AddItem( new SmokeBomb() );
switch ( Utility.Random( 8 ))

View file

@ -118,7 +118,7 @@ namespace Server.Mobiles
int version = reader.ReadInt();
if( version == 0 )
if ( version == 0 )
Hue = 0x489;
}
}

View file

@ -58,7 +58,7 @@ namespace Server.Mobiles
{
base.OnGaveMeleeAttack( defender );
if( 0.1 > Utility.RandomDouble() )
if ( 0.1 > Utility.RandomDouble() )
{
/* Flurry of Twigs
* Start cliloc: 1070850
@ -69,7 +69,7 @@ namespace Server.Mobiles
ExpireTimer timer = (ExpireTimer)m_FlurryOfTwigsTable[defender];
if( timer != null )
if ( timer != null )
{
timer.DoExpire();
defender.SendLocalizedMessage( 1070851 ); // The creature lands another blow in your weakened state.
@ -88,7 +88,7 @@ namespace Server.Mobiles
timer.Start();
m_FlurryOfTwigsTable[defender] = timer;
}
else if( 0.05 > Utility.RandomDouble() )
else if ( 0.05 > Utility.RandomDouble() )
{
/* Chlorophyl Blast
* Start cliloc: 1070827
@ -99,7 +99,7 @@ namespace Server.Mobiles
ExpireTimer timer = (ExpireTimer)m_ChlorophylBlastTable[defender];
if( timer != null )
if ( timer != null )
{
timer.DoExpire();
defender.SendLocalizedMessage( 1070828 ); // The creature continues to hinder your energy resistance!
@ -147,7 +147,7 @@ namespace Server.Mobiles
protected override void OnTick()
{
if( m_Mod.Type == ResistanceType.Physical )
if ( m_Mod.Type == ResistanceType.Physical )
m_Mobile.SendLocalizedMessage( 1070852 ); // Your resistance to physical attacks has returned.
else
m_Mobile.SendLocalizedMessage( 1070829 ); // Your resistance to energy attacks has returned.

View file

@ -73,7 +73,7 @@ namespace Server.Mobiles
{
base.OnGaveMeleeAttack( defender );
if( 0.1 > Utility.RandomDouble() )
if ( 0.1 > Utility.RandomDouble() )
{
/* Cold Wind
* Graphics: Message - Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x37B9" ItemIdName: "glow" FromLocation: "(928 164, 34)" ToLocation: "(928 164, 34)" Speed: "10" Duration: "5" FixedDirection: "True" Explode: "False"
@ -85,7 +85,7 @@ namespace Server.Mobiles
ExpireTimer timer = (ExpireTimer)m_Table[defender];
if( timer != null )
if ( timer != null )
{
timer.DoExpire();
defender.SendLocalizedMessage( 1070831 ); // The freezing wind continues to blow!
@ -123,7 +123,7 @@ namespace Server.Mobiles
public void DrainLife()
{
if( m_Mobile.Alive )
if ( m_Mobile.Alive )
m_Mobile.Damage( 2, m_From );
else
DoExpire();
@ -133,7 +133,7 @@ namespace Server.Mobiles
{
DrainLife();
if( ++m_Count >= 5 )
if ( ++m_Count >= 5 )
{
DoExpire();
m_Mobile.SendLocalizedMessage( 1070830 ); // The icy wind dissipates.

View file

@ -69,7 +69,7 @@ namespace Server.Mobiles
if( Utility.RandomDouble() > .2 )
if ( Utility.RandomDouble() > .2 )
AddItem( new NoDachi() );
else
AddItem( new Halberd() );

View file

@ -220,7 +220,7 @@ namespace Server.Mobiles
base.Deserialize( reader );
int version = reader.ReadInt();
if( version < 1 )
if ( version < 1 )
{
for ( int i = 0; i < Skills.Length; ++i )
{

View file

@ -75,7 +75,7 @@ namespace Server.Mobiles
{
base.OnGaveMeleeAttack( defender );
if( 0.1 > Utility.RandomDouble() )
if ( 0.1 > Utility.RandomDouble() )
{
/* Blood Bath
* Start cliloc 1070826
@ -87,7 +87,7 @@ namespace Server.Mobiles
ExpireTimer timer = (ExpireTimer)m_Table[defender];
if( timer != null )
if ( timer != null )
{
timer.DoExpire();
defender.SendLocalizedMessage( 1070825 ); // The creature continues to rage!
@ -125,7 +125,7 @@ namespace Server.Mobiles
public void DrainLife()
{
if( m_Mobile.Alive )
if ( m_Mobile.Alive )
m_Mobile.Damage( 2, m_From );
else
DoExpire();
@ -135,7 +135,7 @@ namespace Server.Mobiles
{
DrainLife();
if( ++m_Count >= 5 )
if ( ++m_Count >= 5 )
{
DoExpire();
m_Mobile.SendLocalizedMessage( 1070824 ); // The creature's rage subsides.

View file

@ -78,7 +78,7 @@ namespace Server.Mobiles
private void DoCounter( Mobile attacker )
{
if( this.Map == null )
if ( this.Map == null )
return;
if ( attacker is BaseCreature && ((BaseCreature)attacker).BardProvoked )
@ -99,7 +99,7 @@ namespace Server.Mobiles
{
Mobile m = ((BaseCreature)attacker).GetMaster();
if( m != null )
if ( m != null )
target = m;
}

View file

@ -45,7 +45,7 @@ namespace Server.Mobiles
PackItem( new GreenGourd() );
PackItem( new ExecutionersAxe() );
if( Utility.RandomBool() )
if ( Utility.RandomBool() )
PackItem( new LongPants() );
else
PackItem( new ShortPants() );

View file

@ -233,7 +233,7 @@ namespace Server.Mobiles
{
get
{
if( m_AllFollowers == null )
if ( m_AllFollowers == null )
m_AllFollowers = new List<Mobile>();
return m_AllFollowers;
}
@ -243,7 +243,7 @@ namespace Server.Mobiles
{
get
{
if( this.AccessLevel >= AccessLevel.GameMaster )
if ( this.AccessLevel >= AccessLevel.GameMaster )
return Server.Guilds.RankDefinition.Leader;
else
return m_GuildRank;
@ -294,7 +294,7 @@ namespace Server.Mobiles
}
set
{
if( m_IgnoreMobiles != value )
if ( m_IgnoreMobiles != value )
{
m_IgnoreMobiles = value;
Delta( MobileDelta.Flags );
@ -722,7 +722,7 @@ namespace Server.Mobiles
EventSink.Connected += new ConnectedEventHandler( EventSink_Connected );
EventSink.Disconnected += new DisconnectedEventHandler( EventSink_Disconnected );
if( Core.SE )
if ( Core.SE )
{
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( CheckPets ) );
}
@ -732,11 +732,11 @@ namespace Server.Mobiles
{
foreach( Mobile m in World.Mobiles.Values )
{
if( m is PlayerMobile )
if ( m is PlayerMobile )
{
PlayerMobile pm = (PlayerMobile)m;
if((( !pm.Mounted || ( pm.Mount != null && pm.Mount is EtherealMount )) && ( pm.AllFollowers.Count > pm.AutoStabled.Count )) ||
if ((( !pm.Mounted || ( pm.Mount != null && pm.Mount is EtherealMount )) && ( pm.AllFollowers.Count > pm.AutoStabled.Count )) ||
( pm.Mounted && ( pm.AllFollowers.Count > ( pm.AutoStabled.Count +1 ))))
{
pm.AutoStablePets(); /* autostable checks summons, et al: no need here */
@ -780,19 +780,19 @@ namespace Server.Mobiles
public void SetMountBlock( BlockMountType type, TimeSpan duration, bool dismount )
{
if( dismount )
if ( dismount )
{
if ( this.Mount != null )
{
this.Mount.Rider = null;
}
else if( AnimalForm.UnderTransformation( this ) )
else if ( AnimalForm.UnderTransformation( this ) )
{
AnimalForm.RemoveContext(this, true);
}
}
if( ( m_MountBlock == null ) || !m_MountBlock.m_Timer.Running || ( m_MountBlock.m_Timer.Next < ( DateTime.UtcNow + duration ) ) )
if ( ( m_MountBlock == null ) || !m_MountBlock.m_Timer.Running || ( m_MountBlock.m_Timer.Next < ( DateTime.UtcNow + duration ) ) )
{
m_MountBlock = new MountBlock( duration, type, this );
}
@ -814,7 +814,7 @@ namespace Server.Mobiles
if ( type != ResistanceType.Physical && 60 < max && Spells.Fourth.CurseSpell.UnderEffect( this ) )
max = 60;
if( Core.ML && this.Race == Race.Elf && type == ResistanceType.Energy )
if ( Core.ML && this.Race == Race.Elf && type == ResistanceType.Energy )
max += 5; //Intended to go after the 60 max from curse
return max;
@ -939,7 +939,7 @@ namespace Server.Mobiles
return;
}
if( from is PlayerMobile )
if ( from is PlayerMobile )
((PlayerMobile)from).ClaimAutoStabledPets();
}
@ -1027,13 +1027,13 @@ namespace Server.Mobiles
bool drop = false;
if( dex < weapon.DexRequirement )
if ( dex < weapon.DexRequirement )
drop = true;
else if( str < AOS.Scale( weapon.StrRequirement, 100 - weapon.GetLowerStatReq() ) )
else if ( str < AOS.Scale( weapon.StrRequirement, 100 - weapon.GetLowerStatReq() ) )
drop = true;
else if( intel < weapon.IntRequirement )
else if ( intel < weapon.IntRequirement )
drop = true;
else if( weapon.RequiredRace != null && weapon.RequiredRace != this.Race )
else if ( weapon.RequiredRace != null && weapon.RequiredRace != this.Race )
drop = true;
if ( drop )
@ -1062,7 +1062,7 @@ namespace Server.Mobiles
{
drop = true;
}
else if( armor.RequiredRace != null && armor.RequiredRace != this.Race )
else if ( armor.RequiredRace != null && armor.RequiredRace != this.Race )
{
drop = true;
}
@ -1072,11 +1072,11 @@ namespace Server.Mobiles
int dexBonus = armor.ComputeStatBonus( StatType.Dex ), dexReq = armor.ComputeStatReq( StatType.Dex );
int intBonus = armor.ComputeStatBonus( StatType.Int ), intReq = armor.ComputeStatReq( StatType.Int );
if( dex < dexReq || (dex + dexBonus) < 1 )
if ( dex < dexReq || (dex + dexBonus) < 1 )
drop = true;
else if( str < strReq || (str + strBonus) < 1 )
else if ( str < strReq || (str + strBonus) < 1 )
drop = true;
else if( intel < intReq || (intel + intBonus) < 1 )
else if ( intel < intReq || (intel + intBonus) < 1 )
drop = true;
}
@ -1110,7 +1110,7 @@ namespace Server.Mobiles
{
drop = true;
}
else if( clothing.RequiredRace != null && clothing.RequiredRace != this.Race )
else if ( clothing.RequiredRace != null && clothing.RequiredRace != this.Race )
{
drop = true;
}
@ -1119,7 +1119,7 @@ namespace Server.Mobiles
int strBonus = clothing.ComputeStatBonus( StatType.Str );
int strReq = clothing.ComputeStatReq( StatType.Str );
if( str < strReq || (str + strBonus) < 1 )
if ( str < strReq || (str + strBonus) < 1 )
drop = true;
}
@ -1192,7 +1192,7 @@ namespace Server.Mobiles
private static void OnLogout( LogoutEventArgs e )
{
if( e.Mobile is PlayerMobile )
if ( e.Mobile is PlayerMobile )
((PlayerMobile)e.Mobile).AutoStablePets();
}
@ -1290,7 +1290,7 @@ namespace Server.Mobiles
{
RemoveBuff(BuffIcon.HidingAndOrStealth);
}
else// if( !InvisibilitySpell.HasTimer( this ) )
else// if ( !InvisibilitySpell.HasTimer( this ) )
{
BuffInfo.AddBuff(this, new BuffInfo(BuffIcon.HidingAndOrStealth, 1075655)); //Hidden/Stealthing & You Are Hidden
}
@ -1397,7 +1397,7 @@ namespace Server.Mobiles
{
BaseArmor ar = armor as BaseArmor;
if( ar != null && ( !Core.AOS || ar.ArmorAttributes.MageArmor == 0 ))
if ( ar != null && ( !Core.AOS || ar.ArmorAttributes.MageArmor == 0 ))
rating += ar.ArmorRatingScaled;
}
@ -1450,7 +1450,7 @@ namespace Server.Mobiles
{
get
{
if( Core.ML && this.AccessLevel == AccessLevel.Player )
if ( Core.ML && this.AccessLevel == AccessLevel.Player )
return Math.Min( base.Str, 150 );
return base.Str;
@ -1466,7 +1466,7 @@ namespace Server.Mobiles
{
get
{
if( Core.ML && this.AccessLevel == AccessLevel.Player )
if ( Core.ML && this.AccessLevel == AccessLevel.Player )
return Math.Min( base.Int, 150 );
return base.Int;
@ -1482,7 +1482,7 @@ namespace Server.Mobiles
{
get
{
if( Core.ML && this.AccessLevel == AccessLevel.Player )
if ( Core.ML && this.AccessLevel == AccessLevel.Player )
return Math.Min( base.Dex, 150 );
return base.Dex;
@ -1578,7 +1578,7 @@ namespace Server.Mobiles
{
for( int i = 0; i < m_AnimalFormRestrictedSkills.Length; i++ )
{
if( m_AnimalFormRestrictedSkills[i] == skill )
if ( m_AnimalFormRestrictedSkills[i] == skill )
{
SendLocalizedMessage( 1070771 ); // You cannot use that skill in this form.
return false;
@ -1684,7 +1684,7 @@ namespace Server.Mobiles
if ( m_JusticeProtectors.Count > 0 )
list.Add( new CallbackEntry( 6157, new ContextCallback( CancelProtection ) ) );
if( Alive )
if ( Alive )
list.Add( new CallbackEntry( 6210, new ContextCallback( ToggleChampionTitleDisplay ) ) );
if ( Core.HS )
@ -1720,7 +1720,7 @@ namespace Server.Mobiles
BaseHouse curhouse = BaseHouse.FindHouseAt( this );
if( curhouse != null )
if ( curhouse != null )
{
if ( Alive && Core.Expansion >= Expansion.AOS && curhouse.IsAosRules && curhouse.IsFriend( from ) )
list.Add( new EjectPlayerEntry( from, this ) );
@ -1865,9 +1865,9 @@ namespace Server.Mobiles
if ( !CheckAlive() )
return;
if( Core.SE )
if ( Core.SE )
{
if( !HasGump( typeof( CancelRenewInventoryInsuranceGump ) ) )
if ( !HasGump( typeof( CancelRenewInventoryInsuranceGump ) ) )
SendGump( new CancelRenewInventoryInsuranceGump( this, null ) );
}
else
@ -2283,7 +2283,7 @@ namespace Server.Mobiles
public override void DisruptiveAction()
{
if( Meditating )
if ( Meditating )
{
RemoveBuff( BuffIcon.ActiveMeditation );
}
@ -2545,7 +2545,7 @@ namespace Server.Mobiles
public override bool CheckShove( Mobile shoved )
{
if( m_IgnoreMobiles || TransformationSpellHelper.UnderTransformation( shoved, typeof( WraithFormSpell ) ) )
if ( m_IgnoreMobiles || TransformationSpellHelper.UnderTransformation( shoved, typeof( WraithFormSpell ) ) )
return true;
else
return base.CheckShove( shoved );
@ -2603,7 +2603,7 @@ namespace Server.Mobiles
c.Slip();
}
if( Confidence.IsRegenerating( this ) )
if ( Confidence.IsRegenerating( this ) )
Confidence.StopRegenerating( this );
WeightOverloading.FatigueOnDamage( this, amount );
@ -2638,7 +2638,7 @@ namespace Server.Mobiles
{
get
{
if( Core.ML && this.Race == Race.Human )
if ( Core.ML && this.Race == Race.Human )
return 20.0;
return 0;
@ -2859,7 +2859,7 @@ namespace Server.Mobiles
{
Mobile m = FindMostRecentDamager( false );
if( m is BaseCreature )
if ( m is BaseCreature )
m = ((BaseCreature)m).GetMaster();
if ( m != null && m is PlayerMobile && m != this )
@ -2902,7 +2902,7 @@ namespace Server.Mobiles
BaseCreature bc = (BaseCreature)killer;
Mobile master = bc.GetMaster();
if( master != null )
if ( master != null )
killer = master;
}
@ -2924,13 +2924,13 @@ namespace Server.Mobiles
m_DuelContext.OnDeath( this, c );
#endregion
if( m_BuffTable != null )
if ( m_BuffTable != null )
{
List<BuffInfo> list = new List<BuffInfo>();
foreach( BuffInfo buff in m_BuffTable.Values )
{
if( !buff.RetainThroughDeath )
if ( !buff.RetainThroughDeath )
{
list.Add( buff );
}
@ -3121,16 +3121,16 @@ namespace Server.Mobiles
public override void DoSpeech( string text, int[] keywords, MessageType type, int hue )
{
if( Guilds.Guild.NewGuildSystem && (type == MessageType.Guild || type == MessageType.Alliance) )
if ( Guilds.Guild.NewGuildSystem && (type == MessageType.Guild || type == MessageType.Alliance) )
{
Guilds.Guild g = this.Guild as Guilds.Guild;
if( g == null )
if ( g == null )
{
SendLocalizedMessage( 1063142 ); // You are not in a guild!
}
else if( type == MessageType.Alliance )
else if ( type == MessageType.Alliance )
{
if( g.Alliance != null && g.Alliance.IsMember( g ) )
if ( g.Alliance != null && g.Alliance.IsMember( g ) )
{
//g.Alliance.AllianceTextMessage( hue, "[Alliance][{0}]: {1}", this.Name, text );
g.Alliance.AllianceChat( this, text );
@ -3165,9 +3165,9 @@ namespace Server.Mobiles
{
Mobile mob = ns.Mobile;
if( mob != null && mob.AccessLevel >= AccessLevel.GameMaster && mob.AccessLevel > from.AccessLevel )
if ( mob != null && mob.AccessLevel >= AccessLevel.GameMaster && mob.AccessLevel > from.AccessLevel )
{
if( p == null )
if ( p == null )
p = Packet.Acquire( new UnicodeMessage( from.Serial, from.Body, MessageType.Regular, from.SpeechHue, 3, from.Language, from.Name, text ) );
ns.Send( p );
@ -3197,12 +3197,12 @@ namespace Server.Mobiles
{
amount = (int)(amount * 1.1);
if( amount > 35 && from is PlayerMobile ) /* capped @ 35, seems no expansion */
if ( amount > 35 && from is PlayerMobile ) /* capped @ 35, seems no expansion */
{
amount = 35;
}
if( Core.ML )
if ( Core.ML )
{
from.Damage( (int)(amount * ( 1 - ((( from.Skills.MagicResist.Value * .5 ) + 10) / 100 ))), this );
}
@ -3398,14 +3398,14 @@ namespace Server.Mobiles
{
int recipeCount = reader.ReadInt();
if( recipeCount > 0 )
if ( recipeCount > 0 )
{
m_AcquiredRecipes = new Dictionary<int, bool>();
for( int i = 0; i < recipeCount; i++ )
{
int r = reader.ReadInt();
if( reader.ReadBool() ) //Don't add in recipies which we haven't gotten or have been removed
if ( reader.ReadBool() ) //Don't add in recipies which we haven't gotten or have been removed
m_AcquiredRecipes.Add( r, true );
}
}
@ -3443,7 +3443,7 @@ namespace Server.Mobiles
{
int rank = reader.ReadEncodedInt();
int maxRank = Guilds.RankDefinition.Ranks.Length -1;
if( rank > maxRank )
if ( rank > maxRank )
rank = maxRank;
m_GuildRank = Guilds.RankDefinition.Ranks[rank];
@ -3592,7 +3592,7 @@ namespace Server.Mobiles
}
case 0:
{
if( version < 26 )
if ( version < 26 )
m_AutoStabled = new List<Mobile>();
break;
}
@ -3614,13 +3614,13 @@ namespace Server.Mobiles
if ( m_BOBFilter == null )
m_BOBFilter = new Engines.BulkOrders.BOBFilter();
if( m_GuildRank == null )
if ( m_GuildRank == null )
m_GuildRank = Guilds.RankDefinition.Member; //Default to member if going from older version to new version (only time it should be null)
if( m_LastOnline == DateTime.MinValue && Account != null )
if ( m_LastOnline == DateTime.MinValue && Account != null )
m_LastOnline = ((Account)Account).LastLogin;
if( m_ChampionTitles == null )
if ( m_ChampionTitles == null )
m_ChampionTitles = new ChampionTitleInfo();
if ( AccessLevel > AccessLevel.Player )
@ -3641,7 +3641,7 @@ namespace Server.Mobiles
CheckAtrophies( this );
if( Hidden ) //Hiding is the only buff where it has an effect that's serialized.
if ( Hidden ) //Hiding is the only buff where it has an effect that's serialized.
AddBuff( new BuffInfo( BuffIcon.HidingAndOrStealth, 1075655 ) );
}
@ -3689,7 +3689,7 @@ namespace Server.Mobiles
writer.Write( (DateTime) m_AnkhNextUse );
writer.Write( m_AutoStabled, true );
if( m_AcquiredRecipes == null )
if ( m_AcquiredRecipes == null )
{
writer.Write( (int)0 );
}
@ -3795,7 +3795,7 @@ namespace Server.Mobiles
CompassionVirtue.CheckAtrophy( m );
ValorVirtue.CheckAtrophy( m );
if( m is PlayerMobile )
if ( m is PlayerMobile )
ChampionTitleInfo.CheckAtrophy( (PlayerMobile)m );
}
@ -3858,7 +3858,7 @@ namespace Server.Mobiles
Mobile master = bc.GetMaster();
if( master != null )
if ( master != null )
owner = master;
}
@ -3871,7 +3871,7 @@ namespace Server.Mobiles
public virtual void CheckedAnimate( int action, int frameCount, int repeatCount, bool forward, bool repeat, int delay )
{
if( !Mounted )
if ( !Mounted )
{
base.Animate( action, frameCount, repeatCount, forward, repeat, delay );
}
@ -3988,24 +3988,24 @@ namespace Server.Mobiles
protected override bool OnMove( Direction d )
{
if( !Core.SE )
if ( !Core.SE )
return base.OnMove( d );
if( AccessLevel != AccessLevel.Player )
if ( AccessLevel != AccessLevel.Player )
return true;
if( Hidden && DesignContext.Find( this ) == null ) //Hidden & NOT customizing a house
if ( Hidden && DesignContext.Find( this ) == null ) //Hidden & NOT customizing a house
{
if( !Mounted && Skills.Stealth.Value >= 25.0 )
if ( !Mounted && Skills.Stealth.Value >= 25.0 )
{
bool running = (d & Direction.Running) != 0;
if( running )
if ( running )
{
if( (AllowedStealthSteps -= 2) <= 0 )
if ( (AllowedStealthSteps -= 2) <= 0 )
RevealingAction();
}
else if( AllowedStealthSteps-- <= 0 )
else if ( AllowedStealthSteps-- <= 0 )
{
Server.SkillHandlers.Stealth.OnUse( this );
}
@ -4038,7 +4038,7 @@ namespace Server.Mobiles
{
base.Paralyzed = value;
if( value )
if ( value )
AddBuff( new BuffInfo( BuffIcon.Paralyze, 1075827 ) ); //Paralyze/You are frozen and can not move
else
RemoveBuff( BuffIcon.Paralyze );
@ -4246,7 +4246,7 @@ namespace Server.Mobiles
AnimalFormContext animalContext = AnimalForm.GetContext( this );
if( onHorse || (animalContext != null && animalContext.SpeedBoost) )
if ( onHorse || (animalContext != null && animalContext.SpeedBoost) )
return ( running ? Mobile.RunMount : Mobile.WalkMount );
return ( running ? Mobile.RunFoot : Mobile.WalkFoot );
@ -4349,7 +4349,7 @@ namespace Server.Mobiles
private void CreateHair( bool hair, int id, int hue )
{
if( hair )
if ( hair )
{
//TODO Verification?
HairItemID = id;
@ -4372,7 +4372,7 @@ namespace Server.Mobiles
else
FacialHairItemID = 0;
//if( id != 0 )
//if ( id != 0 )
CreateHair( hair, id, hue );
id = -1;
@ -4500,7 +4500,7 @@ namespace Server.Mobiles
if ( Region is BaseRegion && !((BaseRegion)Region).YoungProtected )
return false;
if( from is BaseCreature && ((BaseCreature)from).IgnoreYoungProtection )
if ( from is BaseCreature && ((BaseCreature)from).IgnoreYoungProtection )
return false;
if ( this.Quest != null && this.Quest.IgnoreYoungProtection( from ) )
@ -4671,10 +4671,10 @@ namespace Server.Mobiles
private void ToggleChampionTitleDisplay()
{
if( !CheckAlive() )
if ( !CheckAlive() )
return;
if( DisplayChampionTitle )
if ( DisplayChampionTitle )
SendLocalizedMessage( 1062419, "", 0x23 ); // You have chosen to hide your monster kill title.
else
SendLocalizedMessage( 1062418, "", 0x23 ); // You have chosen to display your monster kill title.
@ -4745,10 +4745,10 @@ namespace Server.Mobiles
public int GetValue( int index )
{
if( m_Values == null || index < 0 || index >= m_Values.Length )
if ( m_Values == null || index < 0 || index >= m_Values.Length )
return 0;
if( m_Values[index] == null )
if ( m_Values[index] == null )
m_Values[index] = new TitleInfo();
return m_Values[index].Value;
@ -4756,10 +4756,10 @@ namespace Server.Mobiles
public DateTime GetLastDecay( int index )
{
if( m_Values == null || index < 0 || index >= m_Values.Length )
if ( m_Values == null || index < 0 || index >= m_Values.Length )
return DateTime.MinValue;
if( m_Values[index] == null )
if ( m_Values[index] == null )
m_Values[index] = new TitleInfo();
return m_Values[index].LastDecay;
@ -4767,16 +4767,16 @@ namespace Server.Mobiles
public void SetValue( int index, int value )
{
if( m_Values == null )
if ( m_Values == null )
m_Values = new TitleInfo[ChampionSpawnInfo.Table.Length];
if( value < 0 )
if ( value < 0 )
value = 0;
if( index < 0 || index >= m_Values.Length )
if ( index < 0 || index >= m_Values.Length )
return;
if( m_Values[index] == null )
if ( m_Values[index] == null )
m_Values[index] = new TitleInfo();
m_Values[index].Value = value;
@ -4784,13 +4784,13 @@ namespace Server.Mobiles
public void Award( int index, int value )
{
if( m_Values == null )
if ( m_Values == null )
m_Values = new TitleInfo[ChampionSpawnInfo.Table.Length];
if( index < 0 || index >= m_Values.Length || value <= 0 )
if ( index < 0 || index >= m_Values.Length || value <= 0 )
return;
if( m_Values[index] == null )
if ( m_Values[index] == null )
m_Values[index] = new TitleInfo();
m_Values[index].Value += value;
@ -4798,23 +4798,23 @@ namespace Server.Mobiles
public void Atrophy( int index, int value )
{
if( m_Values == null )
if ( m_Values == null )
m_Values = new TitleInfo[ChampionSpawnInfo.Table.Length];
if( index < 0 || index >= m_Values.Length || value <= 0 )
if ( index < 0 || index >= m_Values.Length || value <= 0 )
return;
if( m_Values[index] == null )
if ( m_Values[index] == null )
m_Values[index] = new TitleInfo();
int before = m_Values[index].Value;
if( (m_Values[index].Value - value) < 0 )
if ( (m_Values[index].Value - value) < 0 )
m_Values[index].Value = 0;
else
m_Values[index].Value -= value;
if( before != m_Values[index].Value )
if ( before != m_Values[index].Value )
m_Values[index].LastDecay = DateTime.UtcNow;
}
@ -4872,7 +4872,7 @@ namespace Server.Mobiles
m_Values[i] = new TitleInfo( reader );
}
if( m_Values.Length != ChampionSpawnInfo.Table.Length )
if ( m_Values.Length != ChampionSpawnInfo.Table.Length )
{
TitleInfo[] oldValues = m_Values;
m_Values = new TitleInfo[ChampionSpawnInfo.Table.Length];
@ -4898,7 +4898,7 @@ namespace Server.Mobiles
for( int i = 0; i < length; i++ )
{
if( titles.m_Values[i] == null )
if ( titles.m_Values[i] == null )
titles.m_Values[i] = new TitleInfo();
TitleInfo.Serialize( writer, titles.m_Values[i] );
@ -4908,15 +4908,15 @@ namespace Server.Mobiles
public static void CheckAtrophy( PlayerMobile pm )
{
ChampionTitleInfo t = pm.m_ChampionTitles;
if( t == null )
if ( t == null )
return;
if( t.m_Values == null )
if ( t.m_Values == null )
t.m_Values = new TitleInfo[ChampionSpawnInfo.Table.Length];
for( int i = 0; i < t.m_Values.Length; i++ )
{
if( (t.GetLastDecay( i ) + LossDelay) < DateTime.UtcNow )
if ( (t.GetLastDecay( i ) + LossDelay) < DateTime.UtcNow )
{
t.Atrophy( i, LossAmount );
}
@ -4926,17 +4926,17 @@ namespace Server.Mobiles
public static void AwardHarrowerTitle( PlayerMobile pm ) //Called when killing a harrower. Will give a minimum of 1 point.
{
ChampionTitleInfo t = pm.m_ChampionTitles;
if( t == null )
if ( t == null )
return;
if( t.m_Values == null )
if ( t.m_Values == null )
t.m_Values = new TitleInfo[ChampionSpawnInfo.Table.Length];
int count = 1;
for( int i = 0; i < t.m_Values.Length; i++ )
{
if( t.m_Values[i].Value > 900 )
if ( t.m_Values[i].Value > 900 )
count++;
}
@ -4952,7 +4952,7 @@ namespace Server.Mobiles
public virtual bool HasRecipe( Recipe r )
{
if( r == null )
if ( r == null )
return false;
return HasRecipe( r.ID );
@ -4960,7 +4960,7 @@ namespace Server.Mobiles
public virtual bool HasRecipe( int recipeID )
{
if( m_AcquiredRecipes != null && m_AcquiredRecipes.ContainsKey( recipeID ) )
if ( m_AcquiredRecipes != null && m_AcquiredRecipes.ContainsKey( recipeID ) )
return m_AcquiredRecipes[recipeID];
return false;
@ -4968,13 +4968,13 @@ namespace Server.Mobiles
public virtual void AcquireRecipe( Recipe r )
{
if( r != null )
if ( r != null )
AcquireRecipe( r.ID );
}
public virtual void AcquireRecipe( int recipeID )
{
if( m_AcquiredRecipes == null )
if ( m_AcquiredRecipes == null )
m_AcquiredRecipes = new Dictionary<int, bool>();
m_AcquiredRecipes[recipeID] = true;
@ -4990,7 +4990,7 @@ namespace Server.Mobiles
{
get
{
if( m_AcquiredRecipes == null )
if ( m_AcquiredRecipes == null )
return 0;
return m_AcquiredRecipes.Count;
@ -5003,12 +5003,12 @@ namespace Server.Mobiles
public void ResendBuffs()
{
if( !BuffInfo.Enabled || m_BuffTable == null )
if ( !BuffInfo.Enabled || m_BuffTable == null )
return;
NetState state = this.NetState;
if( state != null && state.BuffIcon )
if ( state != null && state.BuffIcon )
{
foreach( BuffInfo info in m_BuffTable.Values )
{
@ -5021,19 +5021,19 @@ namespace Server.Mobiles
public void AddBuff( BuffInfo b )
{
if( !BuffInfo.Enabled || b == null )
if ( !BuffInfo.Enabled || b == null )
return;
RemoveBuff( b ); //Check & subsequently remove the old one.
if( m_BuffTable == null )
if ( m_BuffTable == null )
m_BuffTable = new Dictionary<BuffIcon, BuffInfo>();
m_BuffTable.Add( b.ID, b );
NetState state = this.NetState;
if( state != null && state.BuffIcon )
if ( state != null && state.BuffIcon )
{
state.Send( new AddBuffPacket( this, b ) );
}
@ -5041,7 +5041,7 @@ namespace Server.Mobiles
public void RemoveBuff( BuffInfo b )
{
if( b == null )
if ( b == null )
return;
RemoveBuff( b.ID );
@ -5049,24 +5049,24 @@ namespace Server.Mobiles
public void RemoveBuff( BuffIcon b )
{
if( m_BuffTable == null || !m_BuffTable.ContainsKey( b ) )
if ( m_BuffTable == null || !m_BuffTable.ContainsKey( b ) )
return;
BuffInfo info = m_BuffTable[b];
if( info.Timer != null && info.Timer.Running )
if ( info.Timer != null && info.Timer.Running )
info.Timer.Stop();
m_BuffTable.Remove( b );
NetState state = this.NetState;
if( state != null && state.BuffIcon )
if ( state != null && state.BuffIcon )
{
state.Send( new RemoveBuffPacket( this, b ) );
}
if( m_BuffTable.Count <= 0 )
if ( m_BuffTable.Count <= 0 )
m_BuffTable = null;
}

View file

@ -61,7 +61,7 @@ namespace Server.Mobiles
public Item CreateArtifact( Type[] list )
{
if( list.Length == 0 )
if ( list.Length == 0 )
return null;
int random = Utility.Random( list.Length );
@ -70,7 +70,7 @@ namespace Server.Mobiles
Item artifact = Loot.Construct( type );
if( artifact is MonsterStatuette && StatueTypes.Length > 0 )
if ( artifact is MonsterStatuette && StatueTypes.Length > 0 )
{
((MonsterStatuette)artifact).Type = StatueTypes[Utility.Random( StatueTypes.Length )];
((MonsterStatuette)artifact).LootType = LootType.Regular;
@ -117,16 +117,16 @@ namespace Server.Mobiles
{
Mobile m = toGive[i];
if( !(m is PlayerMobile) )
if ( !(m is PlayerMobile) )
continue;
bool gainedPath = false;
int pointsToGain = 800;
if( VirtueHelper.Award( m, VirtueName.Valor, pointsToGain, ref gainedPath ) )
if ( VirtueHelper.Award( m, VirtueName.Valor, pointsToGain, ref gainedPath ) )
{
if( gainedPath )
if ( gainedPath )
m.SendLocalizedMessage( 1054032 ); // You have gained a path in Valor!
else
m.SendLocalizedMessage( 1054030 ); // You have gained in Valor!
@ -156,22 +156,22 @@ namespace Server.Mobiles
public static void GivePowerScrollTo( Mobile m, PowerScroll ps )
{
if( ps == null || m == null ) //sanity
if ( ps == null || m == null ) //sanity
return;
m.SendLocalizedMessage( 1049524 ); // You have received a scroll of power!
if( !Core.SE || m.Alive )
if ( !Core.SE || m.Alive )
m.AddToBackpack( ps );
else
{
if( m.Corpse != null && !m.Corpse.Deleted )
if ( m.Corpse != null && !m.Corpse.Deleted )
m.Corpse.DropItem( ps );
else
m.AddToBackpack( ps );
}
if( m is PlayerMobile )
if ( m is PlayerMobile )
{
PlayerMobile pm = (PlayerMobile)m;
@ -179,7 +179,7 @@ namespace Server.Mobiles
{
Mobile prot = pm.JusticeProtectors[j];
if( prot.Map != m.Map || prot.Kills >= 5 || prot.Criminal || !JusticeVirtue.CheckMapRegion( m, prot ) )
if ( prot.Map != m.Map || prot.Kills >= 5 || prot.Criminal || !JusticeVirtue.CheckMapRegion( m, prot ) )
continue;
int chance = 0;
@ -191,17 +191,17 @@ namespace Server.Mobiles
case VirtueLevel.Knight: chance = 100; break;
}
if( chance > Utility.Random( 100 ) )
if ( chance > Utility.Random( 100 ) )
{
PowerScroll powerScroll = new PowerScroll( ps.Skill, ps.Value );
prot.SendLocalizedMessage( 1049368 ); // You have been rewarded for your dedication to Justice!
if( !Core.SE || prot.Alive )
if ( !Core.SE || prot.Alive )
prot.AddToBackpack( powerScroll );
else
{
if( prot.Corpse != null && !prot.Corpse.Deleted )
if ( prot.Corpse != null && !prot.Corpse.Deleted )
prot.Corpse.DropItem( powerScroll );
else
prot.AddToBackpack( powerScroll );
@ -217,7 +217,7 @@ namespace Server.Mobiles
{
GivePowerScrolls();
if( NoGoodies )
if ( NoGoodies )
return base.OnBeforeDeath();
Map map = this.Map;

View file

@ -56,7 +56,7 @@ namespace Server.Mobiles
}
Utility.AssignRandomHair( this );
if( Utility.RandomBool() )
if ( Utility.RandomBool() )
Utility.AssignRandomFacialHair( this, HairHue );
VikingSword weapon = new VikingSword();
@ -148,4 +148,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -399,7 +399,7 @@ namespace Server.Mobiles
public virtual void RegisterDamageTo( Mobile m )
{
if( m == null )
if ( m == null )
return;
foreach( DamageEntry de in m.DamageEntries )
@ -408,7 +408,7 @@ namespace Server.Mobiles
Mobile master = damager.GetDamageMaster( m );
if( master != null )
if ( master != null )
damager = master;
RegisterDamage( damager, de.DamageGiven );
@ -417,10 +417,10 @@ namespace Server.Mobiles
public void RegisterDamage( Mobile from, int amount )
{
if( from == null || !from.Player )
if ( from == null || !from.Player )
return;
if( m_DamageEntries.ContainsKey( from ) )
if ( m_DamageEntries.ContainsKey( from ) )
m_DamageEntries[from] += amount;
else
m_DamageEntries.Add( from, amount );
@ -439,7 +439,7 @@ namespace Server.Mobiles
foreach (KeyValuePair<Mobile, int> kvp in m_DamageEntries)
{
if( IsEligible( kvp.Key, artifact ) )
if ( IsEligible( kvp.Key, artifact ) )
{
validEntries.Add( kvp.Key, kvp.Value );
totalDamage += kvp.Value;
@ -454,7 +454,7 @@ namespace Server.Mobiles
{
totalDamage += kvp.Value;
if( totalDamage >= randomDamage )
if ( totalDamage >= randomDamage )
{
GiveArtifact( kvp.Key, artifact );
return;
@ -496,7 +496,7 @@ namespace Server.Mobiles
public Item CreateArtifact( Type[] list )
{
if( list.Length == 0 )
if ( list.Length == 0 )
return null;
int random = Utility.Random( list.Length );

View file

@ -146,7 +146,7 @@ namespace Server.Mobiles
public void CheckQueen()
{
if( this.Map == null )
if ( this.Map == null )
return;
if ( !m_SpawnedQueen )

View file

@ -106,16 +106,16 @@ namespace Server.Mobiles
private void CheckSpeedBoost()
{
if( Hits < (HitsMax / 4 ) )
if ( Hits < (HitsMax / 4 ) )
{
if( !m_SpeedBoost )
if ( !m_SpeedBoost )
{
ActiveSpeed /= SpeedBoostScalar;
PassiveSpeed /= SpeedBoostScalar;
m_SpeedBoost = true;
}
}
else if( m_SpeedBoost )
else if ( m_SpeedBoost )
{
ActiveSpeed *= SpeedBoostScalar;
PassiveSpeed *= SpeedBoostScalar;
@ -189,7 +189,7 @@ namespace Server.Mobiles
m_Rider = reader.ReadMobile();
if( m_Rider == null )
if ( m_Rider == null )
Delete();
}
}
@ -231,7 +231,7 @@ namespace Server.Mobiles
public void AddUnholyBone( Mobile target, double chanceToThrow )
{
if( this.Map == null )
if ( this.Map == null )
return;
if ( chanceToThrow >= Utility.RandomDouble() )

View file

@ -30,7 +30,7 @@ namespace Server.Mobiles
protected override void OnTick()
{
if( !m_Owner.Deleted && m_Owner.IsParagon && m_Owner .Map != Map.Internal )
if ( !m_Owner.Deleted && m_Owner.IsParagon && m_Owner .Map != Map.Internal )
{
m_Owner.Stam++;
@ -117,7 +117,7 @@ namespace Server.Mobiles
{
bc.Karma = (int)( bc.Karma * KarmaBuff );
if( Math.Abs( bc.Karma ) > 32000 )
if ( Math.Abs( bc.Karma ) > 32000 )
bc.Karma = 32000 * Math.Sign( bc.Karma );
}
@ -126,12 +126,12 @@ namespace Server.Mobiles
public static void UnConvert( BaseCreature bc )
{
if( !bc.IsParagon )
if ( !bc.IsParagon )
return;
bc.Hue = 0;
if( bc.HitsMaxSeed >= 0 )
if ( bc.HitsMaxSeed >= 0 )
bc.HitsMaxSeed = (int)( bc.HitsMaxSeed / HitsBuff );
bc.RawStr = (int)( bc.RawStr / StrBuff );
@ -214,4 +214,4 @@ namespace Server.Mobiles
m.SendMessage( "As your backpack is full, your reward for destroying the legendary paragon has been placed at your feet." );
}
}
}
}

View file

@ -77,7 +77,7 @@ namespace Server.Mobiles
public void DrainLife()
{
if( this.Map == null )
if ( this.Map == null )
return;
ArrayList list = new ArrayList();

View file

@ -23,7 +23,7 @@ namespace Server.Mobiles
Hue = Utility.RandomSkinHue();
if( this.Female = Utility.RandomBool() )
if ( this.Female = Utility.RandomBool() )
{
this.Body = 0x191;
this.Name = NameList.RandomName( "female" );

View file

@ -49,7 +49,7 @@ namespace Server.Mobiles
else
AddItem( new Boots( lowHue ) );
if( Utility.RandomBool() )
if ( Utility.RandomBool() )
HairItemID = 0x203B;
else
HairItemID = 0x203C;

View file

@ -23,7 +23,7 @@ namespace Server.Mobiles
Hue = Utility.RandomSkinHue();
if( this.Female = Utility.RandomBool() )
if ( this.Female = Utility.RandomBool() )
{
this.Body = 0x191;
this.Name = NameList.RandomName( "female" );

View file

@ -23,7 +23,7 @@ namespace Server.Mobiles
Blessed = true;
if( this.Female = Utility.RandomBool() )
if ( this.Female = Utility.RandomBool() )
{
this.Body = 0x191;
this.Name = NameList.RandomName( "female" );

View file

@ -35,7 +35,7 @@ namespace Server.Mobiles
public override void InitOutfit()
{
if( Female )
if ( Female )
AddItem( new PlainDress() );
else
AddItem( new Shirt( GetRandomHue() ) );
@ -44,13 +44,13 @@ namespace Server.Mobiles
AddItem( new ThighBoots() );
if( Female )
if ( Female )
AddItem( new FancyDress( lowHue ) );
else
AddItem( new FancyShirt( lowHue ) );
AddItem( new LongPants( lowHue ) );
if( !Female )
if ( !Female )
AddItem( new BodySash( lowHue ) );

View file

@ -51,7 +51,7 @@ namespace Server.Mobiles
Utility.AssignRandomHair( this, hairHue );
if( Utility.Random( 7 ) != 0 )
if ( Utility.Random( 7 ) != 0 )
Utility.AssignRandomFacialHair( this, hairHue );
PackGold( 250, 300 );

View file

@ -67,7 +67,7 @@ namespace Server.Mobiles
Utility.AssignRandomHair( this, hairHue );
if( Utility.Random( 7 ) != 0 )
if ( Utility.Random( 7 ) != 0 )
Utility.AssignRandomFacialHair( this, hairHue );
PackGold( 250, 300 );

View file

@ -17,7 +17,7 @@ namespace Server.Mobiles
Title = "the sculptor";
Hue = Utility.RandomSkinHue();
if( this.Female = Utility.RandomBool() )
if ( this.Female = Utility.RandomBool() )
{
this.Body = 0x191;
this.Name = NameList.RandomName( "female" );

View file

@ -145,7 +145,7 @@ namespace Server.Mobiles
{
TimeSpan ts;
if( !TimeSpan.TryParse( text, out ts ) )
if ( !TimeSpan.TryParse( text, out ts ) )
{
from.SendMessage( "Value was not properly formatted. Use: <hours:minutes:seconds>" );
from.SendGump( new TownCrierGump( from, m_Owner ) );
@ -565,4 +565,4 @@ namespace Server.Mobiles
NameHue = -1;
}
}
}
}

View file

@ -310,7 +310,7 @@ namespace Server.Mobiles
object Obj_Disp = GetDisplayEntity();
if( Core.ML && Obj_Disp is Item && !( Obj_Disp as Item ).Stackable )
if ( Core.ML && Obj_Disp is Item && !( Obj_Disp as Item ).Stackable )
{
m_MaxAmount = Math.Min( 20, m_MaxAmount );
}

View file

@ -122,7 +122,7 @@ namespace Server.Mobiles
public override void OnSuccessfulBulkOrderReceive( Mobile from )
{
if( Core.SE && from is PlayerMobile )
if ( Core.SE && from is PlayerMobile )
((PlayerMobile)from).NextSmithBulkOrder = TimeSpan.Zero;
}
#endregion

View file

@ -73,7 +73,7 @@ namespace Server.Mobiles
public override void OnSuccessfulBulkOrderReceive( Mobile from )
{
if( Core.SE && from is PlayerMobile )
if ( Core.SE && from is PlayerMobile )
((PlayerMobile)from).NextTailorBulkOrder = TimeSpan.Zero;
}
#endregion

View file

@ -24,7 +24,7 @@ namespace Server.Mobiles
public override void InitSBInfo()
{
m_SBInfos.Add( new SBWeaponSmith() );
if ( IsTokunoVendor )
m_SBInfos.Add( new SBSEWeapons() );
}
@ -91,7 +91,7 @@ namespace Server.Mobiles
public override void OnSuccessfulBulkOrderReceive( Mobile from )
{
if( Core.SE && from is PlayerMobile )
if ( Core.SE && from is PlayerMobile )
((PlayerMobile)from).NextSmithBulkOrder = TimeSpan.Zero;
}
#endregion
@ -114,4 +114,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -73,7 +73,7 @@ namespace Server.Mobiles
public override void OnSuccessfulBulkOrderReceive( Mobile from )
{
if( Core.SE && from is PlayerMobile )
if ( Core.SE && from is PlayerMobile )
((PlayerMobile)from).NextTailorBulkOrder = TimeSpan.Zero;
}
#endregion

View file

@ -28,7 +28,7 @@ namespace Server.Mobiles
public override void OnResponse( Mobile from, string text )
{
if( text.Length > 130 )
if ( text.Length > 130 )
text = text.Substring( 0, 130 );
m_Barkeeper.EndChangeRumor( from, m_RumorIndex, text );
@ -53,7 +53,7 @@ namespace Server.Mobiles
public override void OnResponse( Mobile from, string text )
{
if( text.Length > 130 )
if ( text.Length > 130 )
text = text.Substring( 0, 130 );
m_Barkeeper.EndChangeKeyword( from, m_RumorIndex, text );

View file

@ -27,7 +27,7 @@ namespace Server.Mobiles
Add( new AnimalBuyInfo( 1, typeof( PackLlama ), 565, 10, 292, 0 ) );
Add( new AnimalBuyInfo( 1, typeof( Rabbit ), 106, 10, 205, 0 ) );
if( !Core.AOS )
if ( !Core.AOS )
{
Add( new AnimalBuyInfo( 1, typeof( Eagle ), 402, 10, 5, 0 ) );
Add( new AnimalBuyInfo( 1, typeof( BrownBear ), 855, 10, 167, 0 ) );

View file

@ -110,7 +110,7 @@ namespace Server.Mobiles
Add( new GenericBuyInfo( typeof( WarHammer ), 25, 20, 0x1439, 0 ) );
Add( new GenericBuyInfo( typeof( WarMace ), 31, 20, 0x1407, 0 ) );
if( Core.AOS )
if ( Core.AOS )
{
Add( new GenericBuyInfo( typeof( Scepter ), 39, 20, 0x26BC, 0 ) );
Add( new GenericBuyInfo( typeof( BladedStaff ), 40, 20, 0x26BD, 0 ) );
@ -191,7 +191,7 @@ namespace Server.Mobiles
Add( typeof( Bow ), 17 );
Add( typeof( Crossbow ), 23 );
if( Core.AOS )
if ( Core.AOS )
{
Add( typeof( CompositeBow ), 25 );
Add( typeof( RepeatingCrossbow ), 28 );

View file

@ -22,7 +22,7 @@ namespace Server.Mobiles
public InternalBuyInfo()
{
#region Salvage Bag
if( Core.ML )
if ( Core.ML )
Add( new GenericBuyInfo( "1079931", typeof( SalvageBag ), 1255, 20, 0xE76, Utility.RandomBlueHue() ) );
#endregion
Add( new GenericBuyInfo( "1060834", typeof( Engines.Plants.PlantBowl ), 2, 20, 0x15FD, 0 ) );
@ -101,7 +101,7 @@ namespace Server.Mobiles
Add( new GenericBuyInfo( typeof( LargeBagBall ), 3, 20, 0x2257, 0 ) );
}
if( !Guild.NewGuildSystem )
if ( !Guild.NewGuildSystem )
Add( new GenericBuyInfo( "1041055", typeof( GuildDeed ), 12450, 20, 0x14F0, 0 ) );
}
}
@ -166,7 +166,7 @@ namespace Server.Mobiles
Add( typeof( GoldEarrings ), 13 );
Add( typeof( SilverEarrings ), 10 );
if( !Guild.NewGuildSystem )
if ( !Guild.NewGuildSystem )
Add( typeof( GuildDeed ), 6225 );
}
}

View file

@ -33,7 +33,7 @@ namespace Server.Mobiles
Add( new GenericBuyInfo( typeof( WarHammer ), 25, 20, 0x1439, 0 ) );
Add( new GenericBuyInfo( typeof( WarMace ), 31, 20, 0x1407, 0 ) );
if( Core.AOS )
if ( Core.AOS )
{
Add( new GenericBuyInfo( typeof( Scepter ), 39, 20, 0x26BC, 0 ) );
Add( new GenericBuyInfo( typeof( BladedStaff ), 40, 20, 0x26BD, 0 ) );
@ -138,7 +138,7 @@ namespace Server.Mobiles
Add( typeof( Bow ), 17 );
Add( typeof( Crossbow ), 23 );
if( Core.AOS )
if ( Core.AOS )
{
Add( typeof( CompositeBow ), 25 );
Add( typeof( RepeatingCrossbow ), 28 );

View file

@ -22,7 +22,7 @@ namespace Server.Mobiles
{
Add( new GenericBuyInfo( typeof( Crossbow ), 55, 20, 0xF50, 0 ) );
Add( new GenericBuyInfo( typeof( HeavyCrossbow ), 55, 20, 0x13FD, 0 ) );
if( Core.AOS )
if ( Core.AOS )
{
Add( new GenericBuyInfo( typeof( RepeatingCrossbow ), 46, 20, 0x26C3, 0 ) );
Add( new GenericBuyInfo( typeof( CompositeBow ), 45, 20, 0x26C2, 0 ) );
@ -48,7 +48,7 @@ namespace Server.Mobiles
Add( typeof( Bow ), 17 );
Add( typeof( Crossbow ), 25 );
if( Core.AOS )
if ( Core.AOS )
{
Add( typeof( CompositeBow ), 23 );
Add( typeof( RepeatingCrossbow ), 22 );