Fixes code according to modern code style. Fixes a few expression bugs.
This commit is contained in:
parent
89eea25e5f
commit
970fd563b2
3324 changed files with 441118 additions and 433755 deletions
|
|
@ -5,280 +5,277 @@ using Server.Spells;
|
|||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class SavageShaman : BaseCreature
|
||||
{
|
||||
public override string CorpseName => "a savage corpse";
|
||||
[Constructible]
|
||||
public SavageShaman() : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
|
||||
{
|
||||
Name = NameList.RandomName( "savage shaman" );
|
||||
|
||||
if ( Utility.RandomBool() )
|
||||
Body = 184;
|
||||
else
|
||||
Body = 183;
|
||||
|
||||
SetStr( 126, 145 );
|
||||
SetDex( 91, 110 );
|
||||
SetInt( 161, 185 );
|
||||
|
||||
SetDamage( 4, 10 );
|
||||
|
||||
SetDamageType( ResistanceType.Physical, 100 );
|
||||
|
||||
SetResistance( ResistanceType.Physical, 30, 40 );
|
||||
SetResistance( ResistanceType.Fire, 20, 30 );
|
||||
SetResistance( ResistanceType.Cold, 20, 30 );
|
||||
SetResistance( ResistanceType.Poison, 20, 30 );
|
||||
SetResistance( ResistanceType.Energy, 40, 50 );
|
||||
|
||||
SetSkill( SkillName.EvalInt, 77.5, 100.0 );
|
||||
SetSkill( SkillName.Fencing, 62.5, 85.0 );
|
||||
SetSkill( SkillName.Macing, 62.5, 85.0 );
|
||||
SetSkill( SkillName.Magery, 72.5, 95.0 );
|
||||
SetSkill( SkillName.Meditation, 77.5, 100.0 );
|
||||
SetSkill( SkillName.MagicResist, 77.5, 100.0 );
|
||||
SetSkill( SkillName.Swords, 62.5, 85.0 );
|
||||
SetSkill( SkillName.Tactics, 62.5, 85.0 );
|
||||
SetSkill( SkillName.Wrestling, 62.5, 85.0 );
|
||||
|
||||
Fame = 1000;
|
||||
Karma = -1000;
|
||||
|
||||
PackReg( 10, 15 );
|
||||
PackItem( new Bandage( Utility.RandomMinMax( 1, 15 ) ) );
|
||||
|
||||
if ( 0.1 > Utility.RandomDouble() )
|
||||
PackItem( new TribalBerry() );
|
||||
|
||||
AddItem( new BoneArms() );
|
||||
AddItem( new BoneLegs() );
|
||||
AddItem( new DeerMask() );
|
||||
}
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
AddLoot( LootPack.Average );
|
||||
|
||||
}
|
||||
|
||||
public override int Meat => 1;
|
||||
public override bool AlwaysMurderer => true;
|
||||
public override bool ShowFameTitle => false;
|
||||
|
||||
public override OppositionGroup OppositionGroup => OppositionGroup.SavagesAndOrcs;
|
||||
|
||||
public override bool IsEnemy( Mobile m )
|
||||
{
|
||||
if ( m.BodyMod == 183 || m.BodyMod == 184 )
|
||||
return false;
|
||||
|
||||
return base.IsEnemy( m );
|
||||
}
|
||||
|
||||
public override void AggressiveAction( Mobile aggressor, bool criminal )
|
||||
{
|
||||
base.AggressiveAction( aggressor, criminal );
|
||||
|
||||
if ( aggressor.BodyMod == 183 || aggressor.BodyMod == 184 )
|
||||
{
|
||||
AOS.Damage( aggressor, 50, 0, 100, 0, 0, 0 );
|
||||
aggressor.BodyMod = 0;
|
||||
aggressor.HueMod = -1;
|
||||
aggressor.FixedParticles( 0x36BD, 20, 10, 5044, EffectLayer.Head );
|
||||
aggressor.PlaySound( 0x307 );
|
||||
aggressor.SendLocalizedMessage( 1040008 ); // Your skin is scorched as the tribal paint burns away!
|
||||
|
||||
if ( aggressor is PlayerMobile mobile )
|
||||
mobile.SavagePaintExpiration = TimeSpan.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
public override void AlterMeleeDamageTo( Mobile to, ref int damage )
|
||||
{
|
||||
if ( to is Dragon || to is WhiteWyrm || to is SwampDragon || to is Drake || to is Nightmare || to is Hiryu || to is LesserHiryu || to is Daemon )
|
||||
damage *= 3;
|
||||
}
|
||||
public class SavageShaman : BaseCreature
|
||||
{
|
||||
[Constructible]
|
||||
public SavageShaman() : base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4)
|
||||
{
|
||||
Name = NameList.RandomName("savage shaman");
|
||||
|
||||
if (Utility.RandomBool())
|
||||
Body = 184;
|
||||
else
|
||||
Body = 183;
|
||||
|
||||
SetStr(126, 145);
|
||||
SetDex(91, 110);
|
||||
SetInt(161, 185);
|
||||
|
||||
SetDamage(4, 10);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 100);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 30, 40);
|
||||
SetResistance(ResistanceType.Fire, 20, 30);
|
||||
SetResistance(ResistanceType.Cold, 20, 30);
|
||||
SetResistance(ResistanceType.Poison, 20, 30);
|
||||
SetResistance(ResistanceType.Energy, 40, 50);
|
||||
|
||||
SetSkill(SkillName.EvalInt, 77.5, 100.0);
|
||||
SetSkill(SkillName.Fencing, 62.5, 85.0);
|
||||
SetSkill(SkillName.Macing, 62.5, 85.0);
|
||||
SetSkill(SkillName.Magery, 72.5, 95.0);
|
||||
SetSkill(SkillName.Meditation, 77.5, 100.0);
|
||||
SetSkill(SkillName.MagicResist, 77.5, 100.0);
|
||||
SetSkill(SkillName.Swords, 62.5, 85.0);
|
||||
SetSkill(SkillName.Tactics, 62.5, 85.0);
|
||||
SetSkill(SkillName.Wrestling, 62.5, 85.0);
|
||||
|
||||
Fame = 1000;
|
||||
Karma = -1000;
|
||||
|
||||
PackReg(10, 15);
|
||||
PackItem(new Bandage(Utility.RandomMinMax(1, 15)));
|
||||
|
||||
if (0.1 > Utility.RandomDouble())
|
||||
PackItem(new TribalBerry());
|
||||
|
||||
AddItem(new BoneArms());
|
||||
AddItem(new BoneLegs());
|
||||
AddItem(new DeerMask());
|
||||
}
|
||||
|
||||
public SavageShaman(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string CorpseName => "a savage corpse";
|
||||
|
||||
public override int Meat => 1;
|
||||
public override bool AlwaysMurderer => true;
|
||||
public override bool ShowFameTitle => false;
|
||||
|
||||
public override OppositionGroup OppositionGroup => OppositionGroup.SavagesAndOrcs;
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
AddLoot(LootPack.Average);
|
||||
}
|
||||
|
||||
public override bool IsEnemy(Mobile m)
|
||||
{
|
||||
if (m.BodyMod == 183 || m.BodyMod == 184)
|
||||
return false;
|
||||
|
||||
return base.IsEnemy(m);
|
||||
}
|
||||
|
||||
public override void OnGotMeleeAttack( Mobile attacker )
|
||||
{
|
||||
base.OnGotMeleeAttack( attacker );
|
||||
public override void AggressiveAction(Mobile aggressor, bool criminal)
|
||||
{
|
||||
base.AggressiveAction(aggressor, criminal);
|
||||
|
||||
if ( 0.1 > Utility.RandomDouble() )
|
||||
BeginSavageDance();
|
||||
}
|
||||
|
||||
public void BeginSavageDance()
|
||||
{
|
||||
if ( Map == null )
|
||||
return;
|
||||
if (aggressor.BodyMod == 183 || aggressor.BodyMod == 184)
|
||||
{
|
||||
AOS.Damage(aggressor, 50, 0, 100, 0, 0, 0);
|
||||
aggressor.BodyMod = 0;
|
||||
aggressor.HueMod = -1;
|
||||
aggressor.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
|
||||
aggressor.PlaySound(0x307);
|
||||
aggressor.SendLocalizedMessage(1040008); // Your skin is scorched as the tribal paint burns away!
|
||||
|
||||
if (aggressor is PlayerMobile mobile)
|
||||
mobile.SavagePaintExpiration = TimeSpan.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
public override void AlterMeleeDamageTo(Mobile to, ref int damage)
|
||||
{
|
||||
if (to is Dragon || to is WhiteWyrm || to is SwampDragon || to is Drake || to is Nightmare || to is Hiryu ||
|
||||
to is LesserHiryu || to is Daemon)
|
||||
damage *= 3;
|
||||
}
|
||||
|
||||
ArrayList list = new ArrayList();
|
||||
public override void OnGotMeleeAttack(Mobile attacker)
|
||||
{
|
||||
base.OnGotMeleeAttack(attacker);
|
||||
|
||||
foreach ( Mobile m in GetMobilesInRange( 8 ) )
|
||||
{
|
||||
if ( m != this && m is SavageShaman )
|
||||
list.Add( m );
|
||||
}
|
||||
if (0.1 > Utility.RandomDouble())
|
||||
BeginSavageDance();
|
||||
}
|
||||
|
||||
Animate( 111, 5, 1, true, false, 0 ); // Do a little dance...
|
||||
public void BeginSavageDance()
|
||||
{
|
||||
if (Map == null)
|
||||
return;
|
||||
|
||||
if ( AIObject != null )
|
||||
AIObject.NextMove = Core.TickCount + 1000;
|
||||
ArrayList list = new ArrayList();
|
||||
|
||||
if ( list.Count >= 3 )
|
||||
{
|
||||
for ( int i = 0; i < list.Count; ++i )
|
||||
{
|
||||
SavageShaman dancer = (SavageShaman)list[i];
|
||||
foreach (Mobile m in GetMobilesInRange(8))
|
||||
if (m != this && m is SavageShaman)
|
||||
list.Add(m);
|
||||
|
||||
Animate(111, 5, 1, true, false, 0); // Do a little dance...
|
||||
|
||||
if (AIObject != null)
|
||||
AIObject.NextMove = Core.TickCount + 1000;
|
||||
|
||||
dancer.Animate( 111, 5, 1, true, false, 0 ); // Get down tonight...
|
||||
if (list.Count >= 3)
|
||||
{
|
||||
for (int i = 0; i < list.Count; ++i)
|
||||
{
|
||||
SavageShaman dancer = (SavageShaman)list[i];
|
||||
|
||||
if ( dancer.AIObject != null )
|
||||
dancer.AIObject.NextMove = Core.TickCount + 1000;
|
||||
}
|
||||
dancer.Animate(111, 5, 1, true, false, 0); // Get down tonight...
|
||||
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), EndSavageDance );
|
||||
}
|
||||
}
|
||||
if (dancer.AIObject != null)
|
||||
dancer.AIObject.NextMove = Core.TickCount + 1000;
|
||||
}
|
||||
|
||||
public void EndSavageDance()
|
||||
{
|
||||
if ( Deleted )
|
||||
return;
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1.0), EndSavageDance);
|
||||
}
|
||||
}
|
||||
|
||||
ArrayList list = new ArrayList();
|
||||
public void EndSavageDance()
|
||||
{
|
||||
if (Deleted)
|
||||
return;
|
||||
|
||||
foreach ( Mobile m in GetMobilesInRange( 8 ) )
|
||||
list.Add( m );
|
||||
ArrayList list = new ArrayList();
|
||||
|
||||
if ( list.Count > 0 )
|
||||
{
|
||||
switch ( Utility.Random( 3 ) )
|
||||
{
|
||||
case 0: /* greater heal */
|
||||
{
|
||||
foreach ( Mobile m in list )
|
||||
{
|
||||
bool isFriendly = ( m is Savage || m is SavageRider || m is SavageShaman || m is SavageRidgeback );
|
||||
foreach (Mobile m in GetMobilesInRange(8))
|
||||
list.Add(m);
|
||||
|
||||
if ( !isFriendly )
|
||||
continue;
|
||||
if (list.Count > 0)
|
||||
switch (Utility.Random(3))
|
||||
{
|
||||
case 0: /* greater heal */
|
||||
{
|
||||
foreach (Mobile m in list)
|
||||
{
|
||||
bool isFriendly = m is Savage || m is SavageRider || m is SavageShaman || m is SavageRidgeback;
|
||||
|
||||
if ( m.Poisoned || MortalStrike.IsWounded( m ) || !CanBeBeneficial( m ) )
|
||||
continue;
|
||||
if (!isFriendly)
|
||||
continue;
|
||||
|
||||
DoBeneficial( m );
|
||||
if (m.Poisoned || MortalStrike.IsWounded(m) || !CanBeBeneficial(m))
|
||||
continue;
|
||||
|
||||
// Algorithm: (40% of magery) + (1-10)
|
||||
DoBeneficial(m);
|
||||
|
||||
int toHeal = (int)(Skills[SkillName.Magery].Value * 0.4);
|
||||
toHeal += Utility.Random( 1, 10 );
|
||||
// Algorithm: (40% of magery) + (1-10)
|
||||
|
||||
m.Heal( toHeal, this );
|
||||
int toHeal = (int)(Skills[SkillName.Magery].Value * 0.4);
|
||||
toHeal += Utility.Random(1, 10);
|
||||
|
||||
m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
|
||||
m.PlaySound( 0x202 );
|
||||
}
|
||||
m.Heal(toHeal, this);
|
||||
|
||||
break;
|
||||
}
|
||||
case 1: /* lightning */
|
||||
{
|
||||
foreach ( Mobile m in list )
|
||||
{
|
||||
bool isFriendly = ( m is Savage || m is SavageRider || m is SavageShaman || m is SavageRidgeback );
|
||||
m.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
|
||||
m.PlaySound(0x202);
|
||||
}
|
||||
|
||||
if ( isFriendly )
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
case 1: /* lightning */
|
||||
{
|
||||
foreach (Mobile m in list)
|
||||
{
|
||||
bool isFriendly = m is Savage || m is SavageRider || m is SavageShaman || m is SavageRidgeback;
|
||||
|
||||
if ( !CanBeHarmful( m ) )
|
||||
continue;
|
||||
if (isFriendly)
|
||||
continue;
|
||||
|
||||
DoHarmful( m );
|
||||
if (!CanBeHarmful(m))
|
||||
continue;
|
||||
|
||||
double damage;
|
||||
DoHarmful(m);
|
||||
|
||||
if ( Core.AOS )
|
||||
{
|
||||
int baseDamage = 6 + (int)(Skills[SkillName.EvalInt].Value / 5.0);
|
||||
double damage;
|
||||
|
||||
damage = Utility.RandomMinMax( baseDamage, baseDamage + 3 );
|
||||
}
|
||||
else
|
||||
{
|
||||
damage = Utility.Random( 12, 9 );
|
||||
}
|
||||
if (Core.AOS)
|
||||
{
|
||||
int baseDamage = 6 + (int)(Skills[SkillName.EvalInt].Value / 5.0);
|
||||
|
||||
m.BoltEffect( 0 );
|
||||
damage = Utility.RandomMinMax(baseDamage, baseDamage + 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
damage = Utility.Random(12, 9);
|
||||
}
|
||||
|
||||
SpellHelper.Damage( TimeSpan.FromSeconds( 0.25 ), m, this, damage, 0, 0, 0, 0, 100 );
|
||||
}
|
||||
m.BoltEffect(0);
|
||||
|
||||
break;
|
||||
}
|
||||
case 2: /* poison */
|
||||
{
|
||||
foreach ( Mobile m in list )
|
||||
{
|
||||
bool isFriendly = ( m is Savage || m is SavageRider || m is SavageShaman || m is SavageRidgeback );
|
||||
SpellHelper.Damage(TimeSpan.FromSeconds(0.25), m, this, damage, 0, 0, 0, 0, 100);
|
||||
}
|
||||
|
||||
if ( isFriendly )
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
case 2: /* poison */
|
||||
{
|
||||
foreach (Mobile m in list)
|
||||
{
|
||||
bool isFriendly = m is Savage || m is SavageRider || m is SavageShaman || m is SavageRidgeback;
|
||||
|
||||
if ( !CanBeHarmful( m ) )
|
||||
continue;
|
||||
if (isFriendly)
|
||||
continue;
|
||||
|
||||
DoHarmful( m );
|
||||
if (!CanBeHarmful(m))
|
||||
continue;
|
||||
|
||||
m.Spell?.OnCasterHurt();
|
||||
DoHarmful(m);
|
||||
|
||||
m.Paralyzed = false;
|
||||
m.Spell?.OnCasterHurt();
|
||||
|
||||
double total = Skills[SkillName.Magery].Value + Skills[SkillName.Poisoning].Value;
|
||||
m.Paralyzed = false;
|
||||
|
||||
double dist = GetDistanceToSqrt( m );
|
||||
double total = Skills[SkillName.Magery].Value + Skills[SkillName.Poisoning].Value;
|
||||
|
||||
if ( dist >= 3.0 )
|
||||
total -= (dist - 3.0) * 10.0;
|
||||
double dist = GetDistanceToSqrt(m);
|
||||
|
||||
int level;
|
||||
if (dist >= 3.0)
|
||||
total -= (dist - 3.0) * 10.0;
|
||||
|
||||
if ( total >= 200.0 && Utility.Random( 1, 100 ) <= 10 )
|
||||
level = 3;
|
||||
else if ( total > 170.0 )
|
||||
level = 2;
|
||||
else if ( total > 130.0 )
|
||||
level = 1;
|
||||
else
|
||||
level = 0;
|
||||
int level;
|
||||
|
||||
m.ApplyPoison( this, Poison.GetPoison( level ) );
|
||||
if (total >= 200.0 && Utility.Random(1, 100) <= 10)
|
||||
level = 3;
|
||||
else if (total > 170.0)
|
||||
level = 2;
|
||||
else if (total > 130.0)
|
||||
level = 1;
|
||||
else
|
||||
level = 0;
|
||||
|
||||
m.FixedParticles( 0x374A, 10, 15, 5021, EffectLayer.Waist );
|
||||
m.PlaySound( 0x474 );
|
||||
}
|
||||
m.ApplyPoison(this, Poison.GetPoison(level));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
m.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
|
||||
m.PlaySound(0x474);
|
||||
}
|
||||
|
||||
public SavageShaman( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue