Fixes code according to modern code style. Fixes a few expression bugs.

This commit is contained in:
Kamron Batman 2018-09-15 09:58:51 -07:00
parent 89eea25e5f
commit 970fd563b2
3324 changed files with 441118 additions and 433755 deletions

View file

@ -3,93 +3,92 @@ using Server.Mobiles;
namespace Server.Spells.Fifth
{
public class SummonCreatureSpell : MagerySpell
{
private static SpellInfo m_Info = new SpellInfo(
"Summon Creature", "Kal Xen",
16,
false,
Reagent.Bloodmoss,
Reagent.MandrakeRoot,
Reagent.SpidersSilk
);
public class SummonCreatureSpell : MagerySpell
{
private static SpellInfo m_Info = new SpellInfo(
"Summon Creature", "Kal Xen",
16,
false,
Reagent.Bloodmoss,
Reagent.MandrakeRoot,
Reagent.SpidersSilk
);
public override SpellCircle Circle => SpellCircle.Fifth;
// NOTE: Creature list based on 1hr of summon/release on OSI.
public SummonCreatureSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
private static Type[] m_Types =
{
typeof(PolarBear),
typeof(GrizzlyBear),
typeof(BlackBear),
typeof(Horse),
typeof(Walrus),
typeof(Chicken),
typeof(Scorpion),
typeof(GiantSerpent),
typeof(Llama),
typeof(Alligator),
typeof(GreyWolf),
typeof(Slime),
typeof(Eagle),
typeof(Gorilla),
typeof(SnowLeopard),
typeof(Pig),
typeof(Hind),
typeof(Rabbit)
};
// NOTE: Creature list based on 1hr of summon/release on OSI.
public SummonCreatureSpell(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
{
}
private static Type[] m_Types = {
typeof( PolarBear ),
typeof( GrizzlyBear ),
typeof( BlackBear ),
typeof( Horse ),
typeof( Walrus ),
typeof( Chicken ),
typeof( Scorpion ),
typeof( GiantSerpent ),
typeof( Llama ),
typeof( Alligator ),
typeof( GreyWolf ),
typeof( Slime ),
typeof( Eagle ),
typeof( Gorilla ),
typeof( SnowLeopard ),
typeof( Pig ),
typeof( Hind ),
typeof( Rabbit )
};
public override SpellCircle Circle => SpellCircle.Fifth;
public override bool CheckCast()
{
if ( !base.CheckCast() )
return false;
public override bool CheckCast()
{
if (!base.CheckCast())
return false;
if ( (Caster.Followers + 2) > Caster.FollowersMax )
{
Caster.SendLocalizedMessage( 1049645 ); // You have too many followers to summon that creature.
return false;
}
if (Caster.Followers + 2 > Caster.FollowersMax)
{
Caster.SendLocalizedMessage(1049645); // You have too many followers to summon that creature.
return false;
}
return true;
}
return true;
}
public override void OnCast()
{
if ( CheckSequence() )
{
try
{
BaseCreature creature = (BaseCreature)Activator.CreateInstance( m_Types[Utility.Random( m_Types.Length )] );
public override void OnCast()
{
if (CheckSequence())
try
{
BaseCreature creature = (BaseCreature)Activator.CreateInstance(m_Types[Utility.Random(m_Types.Length)]);
//creature.ControlSlots = 2;
//creature.ControlSlots = 2;
TimeSpan duration;
TimeSpan duration;
if ( Core.AOS )
duration = TimeSpan.FromSeconds( (2 * Caster.Skills.Magery.Fixed) / 5 );
else
duration = TimeSpan.FromSeconds( 4.0 * Caster.Skills[SkillName.Magery].Value );
if (Core.AOS)
duration = TimeSpan.FromSeconds(2 * Caster.Skills.Magery.Fixed / 5);
else
duration = TimeSpan.FromSeconds(4.0 * Caster.Skills[SkillName.Magery].Value);
SpellHelper.Summon( creature, Caster, 0x215, duration, false, false );
}
catch
{
}
}
SpellHelper.Summon(creature, Caster, 0x215, duration, false, false);
}
catch
{
}
FinishSequence();
}
FinishSequence();
}
public override TimeSpan GetCastDelay()
{
if ( Core.AOS )
return TimeSpan.FromTicks( base.GetCastDelay().Ticks * 5 );
public override TimeSpan GetCastDelay()
{
if (Core.AOS)
return TimeSpan.FromTicks(base.GetCastDelay().Ticks * 5);
return base.GetCastDelay() + TimeSpan.FromSeconds( 6.0 );
}
}
}
return base.GetCastDelay() + TimeSpan.FromSeconds(6.0);
}
}
}