This commit is contained in:
mark 2006-06-15 04:14:30 +00:00
commit 47711d616e
2644 changed files with 479454 additions and 0 deletions

View file

@ -0,0 +1,232 @@
using System;
using Server;
using Server.Items;
using Server.Spells;
using Server.Spells.Seventh;
using Server.Spells.Fifth;
using Server.Engines.CannedEvil;
namespace Server.Mobiles
{
public class Barracoon : BaseChampion
{
public override ChampionSkullType SkullType{ get{ return ChampionSkullType.Greed; } }
[Constructable]
public Barracoon() : base( AIType.AI_Melee )
{
Name = "Barracoon";
Title = "the piper";
Body = 0x190;
Hue = 0x83EC;
SetStr( 305, 425 );
SetDex( 72, 150 );
SetInt( 505, 750 );
SetHits( 4200 );
SetStam( 102, 300 );
SetDamage( 25, 35 );
SetDamageType( ResistanceType.Physical, 100 );
SetResistance( ResistanceType.Physical, 60, 70 );
SetResistance( ResistanceType.Fire, 50, 60 );
SetResistance( ResistanceType.Cold, 50, 60 );
SetResistance( ResistanceType.Poison, 40, 50 );
SetResistance( ResistanceType.Energy, 40, 50 );
SetSkill( SkillName.MagicResist, 100.0 );
SetSkill( SkillName.Tactics, 97.6, 100.0 );
SetSkill( SkillName.Wrestling, 97.6, 100.0 );
Fame = 22500;
Karma = -22500;
VirtualArmor = 70;
AddItem( new FancyShirt( Utility.RandomGreenHue() ) );
AddItem( new LongPants( Utility.RandomYellowHue() ) );
AddItem( new JesterHat( Utility.RandomPinkHue() ) );
AddItem( new Cloak( Utility.RandomPinkHue() ) );
AddItem( new Sandals() );
HairItemID = 0x203B; // Short Hair
HairHue = 0x94;
}
public override void GenerateLoot()
{
AddLoot( LootPack.UltraRich, 3 );
}
public override bool AlwaysMurderer{ get{ return true; } }
public override bool AutoDispel{ get{ return true; } }
public override double AutoDispelChance{ get{ return 1.0; } }
public override bool BardImmune{ get{ return !Core.SE; } }
public override bool Unprovokable{ get{ return Core.SE; } }
public override bool Uncalmable{ get{ return Core.SE; } }
public override Poison PoisonImmune{ get{ return Poison.Deadly; } }
public override bool ShowFameTitle{ get{ return false; } }
public override bool ClickTitle{ get{ return false; } }
public void Polymorph( Mobile m )
{
if ( !m.CanBeginAction( typeof( PolymorphSpell ) ) || !m.CanBeginAction( typeof( IncognitoSpell ) ) || m.IsBodyMod )
return;
IMount mount = m.Mount;
if ( mount != null )
mount.Rider = null;
if ( m.Mounted )
return;
if ( m.BeginAction( typeof( PolymorphSpell ) ) )
{
Item disarm = m.FindItemOnLayer( Layer.OneHanded );
if ( disarm != null && disarm.Movable )
m.AddToBackpack( disarm );
disarm = m.FindItemOnLayer( Layer.TwoHanded );
if ( disarm != null && disarm.Movable )
m.AddToBackpack( disarm );
m.BodyMod = 42;
m.HueMod = 0;
new ExpirePolymorphTimer( m ).Start();
}
}
private class ExpirePolymorphTimer : Timer
{
private Mobile m_Owner;
public ExpirePolymorphTimer( Mobile owner ) : base( TimeSpan.FromMinutes( 3.0 ) )
{
m_Owner = owner;
Priority = TimerPriority.OneSecond;
}
protected override void OnTick()
{
if ( !m_Owner.CanBeginAction( typeof( PolymorphSpell ) ) )
{
m_Owner.BodyMod = 0;
m_Owner.HueMod = -1;
m_Owner.EndAction( typeof( PolymorphSpell ) );
}
}
}
public void SpawnRatmen( Mobile target )
{
Map map = this.Map;
if ( map == null )
return;
int rats = 0;
foreach ( Mobile m in this.GetMobilesInRange( 10 ) )
{
if ( m is Ratman || m is RatmanArcher || m is RatmanMage )
++rats;
}
if ( rats < 16 )
{
PlaySound( 0x3D );
int newRats = Utility.RandomMinMax( 3, 6 );
for ( int i = 0; i < newRats; ++i )
{
BaseCreature rat;
switch ( Utility.Random( 5 ) )
{
default:
case 0: case 1: rat = new Ratman(); break;
case 2: case 3: rat = new RatmanArcher(); break;
case 4: rat = new RatmanMage(); break;
}
rat.Team = this.Team;
bool validLocation = false;
Point3D loc = this.Location;
for ( int j = 0; !validLocation && j < 10; ++j )
{
int x = X + Utility.Random( 3 ) - 1;
int y = Y + Utility.Random( 3 ) - 1;
int z = map.GetAverageZ( x, y );
if ( validLocation = map.CanFit( x, y, this.Z, 16, false, false ) )
loc = new Point3D( x, y, Z );
else if ( validLocation = map.CanFit( x, y, z, 16, false, false ) )
loc = new Point3D( x, y, z );
}
rat.MoveToWorld( loc, map );
rat.Combatant = target;
}
}
}
public void DoSpecialAbility( Mobile target )
{
if ( target == null || target.Deleted ) //sanity
return;
if ( 0.6 >= Utility.RandomDouble() ) // 60% chance to polymorph attacker into a ratman
Polymorph( target );
if ( 0.2 >= Utility.RandomDouble() ) // 20% chance to more ratmen
SpawnRatmen( target );
if ( Hits < 500 && !IsBodyMod ) // Baracoon is low on life, polymorph into a ratman
Polymorph( this );
}
public override void OnGotMeleeAttack( Mobile attacker )
{
base.OnGotMeleeAttack( attacker );
DoSpecialAbility( attacker );
}
public override void OnGaveMeleeAttack( Mobile defender )
{
base.OnGaveMeleeAttack( defender );
DoSpecialAbility( defender );
}
public Barracoon( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View file

@ -0,0 +1,276 @@
using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Engines.CannedEvil;
using System.Collections.Generic;
namespace Server.Mobiles
{
public abstract class BaseChampion : BaseCreature
{
public BaseChampion( AIType aiType ) : this( aiType, FightMode.Closest )
{
}
public BaseChampion( AIType aiType, FightMode mode ) : base( aiType, mode, 18, 1, 0.1, 0.2 )
{
}
public BaseChampion( Serial serial ) : base( serial )
{
}
public abstract ChampionSkullType SkullType{ get; }
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
private PowerScroll CreateRandomPowerScroll()
{
int level;
double random = Utility.RandomDouble();
if ( 0.1 >= random )
level = 20;
else if ( 0.4 >= random )
level = 15;
else
level = 10;
return PowerScroll.CreateRandomNoCraft( level, level );
}
public void GivePowerScrolls()
{
if ( Map != Map.Felucca )
return;
ArrayList toGive = new ArrayList();
List<DamageStore> rights = BaseCreature.GetLootingRights( this.DamageEntries, this.HitsMax );
for ( int i = rights.Count - 1; i >= 0; --i )
{
DamageStore ds = rights[i];
if ( ds.m_HasRight )
toGive.Add( ds.m_Mobile );
}
if ( toGive.Count == 0 )
return;
for( int i = 0; i < toGive.Count; i++ )
{
Mobile m = (Mobile)toGive[i];
if( !(m is PlayerMobile) )
continue;
bool gainedPath = false;
int pointsToGain = 800;
if( VirtueHelper.Award( m, VirtueName.Valor, pointsToGain, ref gainedPath ) )
{
if( gainedPath )
m.SendLocalizedMessage( 1054032 ); // You have gained a path in Valor!
else
m.SendLocalizedMessage( 1054030 ); // You have gained in Valor!
//No delay on Valor gains
}
}
// Randomize
for ( int i = 0; i < toGive.Count; ++i )
{
int rand = Utility.Random( toGive.Count );
object hold = toGive[i];
toGive[i] = toGive[rand];
toGive[rand] = hold;
}
for ( int i = 0; i < 6; ++i )
{
Mobile m = (Mobile)toGive[i % toGive.Count];
PowerScroll ps = CreateRandomPowerScroll();
m.SendLocalizedMessage( 1049524 ); // You have received a scroll of power!
if ( !Core.SE || m.Alive )
m.AddToBackpack( ps );
else
{
if ( m.Corpse != null && !m.Corpse.Deleted )
((Container)m.Corpse).DropItem( ps );
else
m.AddToBackpack( ps );
}
if ( m is PlayerMobile )
{
PlayerMobile pm = (PlayerMobile)m;
for ( int j = 0; j < pm.JusticeProtectors.Count; ++j )
{
Mobile prot = (Mobile)pm.JusticeProtectors[j];
if ( prot.Map != m.Map || prot.Kills >= 5 || prot.Criminal || !JusticeVirtue.CheckMapRegion( m, prot ) )
continue;
int chance = 0;
switch ( VirtueHelper.GetLevel( prot, VirtueName.Justice ) )
{
case VirtueLevel.Seeker: chance = 60; break;
case VirtueLevel.Follower: chance = 80; break;
case VirtueLevel.Knight: chance = 100; break;
}
if ( chance > Utility.Random( 100 ) )
{
ps = CreateRandomPowerScroll();
prot.SendLocalizedMessage( 1049368 ); // You have been rewarded for your dedication to Justice!
if ( !Core.SE || prot.Alive )
prot.AddToBackpack( ps );
else
{
if ( prot.Corpse != null && !prot.Corpse.Deleted )
((Container)prot.Corpse).DropItem( ps );
else
prot.AddToBackpack( ps );
}
}
}
}
}
}
public override bool OnBeforeDeath()
{
if ( !NoKillAwards )
{
GivePowerScrolls();
Map map = this.Map;
if ( map != null )
{
for ( int x = -12; x <= 12; ++x )
{
for ( int y = -12; y <= 12; ++y )
{
double dist = Math.Sqrt(x*x+y*y);
if ( dist <= 12 )
new GoodiesTimer( map, X + x, Y + y ).Start();
}
}
}
}
return base.OnBeforeDeath();
}
public override void OnDeath( Container c )
{
if ( Map == Map.Felucca )
{
//TODO: Confirm SE change or AoS one too?
List<DamageStore> rights = BaseCreature.GetLootingRights( this.DamageEntries, this.HitsMax );
List<Mobile> toGive = new List<Mobile>();
for ( int i = rights.Count - 1; i >= 0; --i )
{
DamageStore ds = rights[i];
if ( ds.m_HasRight )
toGive.Add( ds.m_Mobile );
}
if ( toGive.Count > 0 )
toGive[Utility.Random( toGive.Count )].AddToBackpack( new ChampionSkull( SkullType ) );
else
c.DropItem( new ChampionSkull( SkullType ) );
}
base.OnDeath( c );
}
private class GoodiesTimer : Timer
{
private Map m_Map;
private int m_X, m_Y;
public GoodiesTimer( Map map, int x, int y ) : base( TimeSpan.FromSeconds( Utility.RandomDouble() * 10.0 ) )
{
m_Map = map;
m_X = x;
m_Y = y;
}
protected override void OnTick()
{
int z = m_Map.GetAverageZ( m_X, m_Y );
bool canFit = m_Map.CanFit( m_X, m_Y, z, 6, false, false );
for ( int i = -3; !canFit && i <= 3; ++i )
{
canFit = m_Map.CanFit( m_X, m_Y, z + i, 6, false, false );
if ( canFit )
z += i;
}
if ( !canFit )
return;
Gold g = new Gold( 500, 1000 );
g.MoveToWorld( new Point3D( m_X, m_Y, z ), m_Map );
if ( 0.5 >= Utility.RandomDouble() )
{
switch ( Utility.Random( 3 ) )
{
case 0: // Fire column
{
Effects.SendLocationParticles( EffectItem.Create( g.Location, g.Map, EffectItem.DefaultDuration ), 0x3709, 10, 30, 5052 );
Effects.PlaySound( g, g.Map, 0x208 );
break;
}
case 1: // Explosion
{
Effects.SendLocationParticles( EffectItem.Create( g.Location, g.Map, EffectItem.DefaultDuration ), 0x36BD, 20, 10, 5044 );
Effects.PlaySound( g, g.Map, 0x307 );
break;
}
case 2: // Ball of fire
{
Effects.SendLocationParticles( EffectItem.Create( g.Location, g.Map, EffectItem.DefaultDuration ), 0x36FE, 10, 10, 5052 );
break;
}
}
}
}
}
}
}

View file

@ -0,0 +1,151 @@
using System;
using Server;
using Server.Misc;
using Server.Items;
using Server.Guilds;
namespace Server.Mobiles
{
public abstract class BaseShieldGuard : BaseCreature
{
public BaseShieldGuard() : base( AIType.AI_Melee, FightMode.Aggressor, 14, 1, 0.8, 1.6 )
{
InitStats( 1000, 1000, 1000 );
Title = "the guard";
SpeechHue = Utility.RandomDyedHue();
Hue = Utility.RandomSkinHue();
if ( Female = Utility.RandomBool() )
{
Body = 0x191;
Name = NameList.RandomName( "female" );
AddItem( new FemalePlateChest() );
AddItem( new PlateArms() );
AddItem( new PlateLegs() );
switch( Utility.Random( 2 ) )
{
case 0: AddItem( new Doublet( Utility.RandomNondyedHue() ) ); break;
case 1: AddItem( new BodySash( Utility.RandomNondyedHue() ) ); break;
}
switch( Utility.Random( 2 ) )
{
case 0: AddItem( new Skirt( Utility.RandomNondyedHue() ) ); break;
case 1: AddItem( new Kilt( Utility.RandomNondyedHue() ) ); break;
}
}
else
{
Body = 0x190;
Name = NameList.RandomName( "male" );
AddItem( new PlateChest() );
AddItem( new PlateArms() );
AddItem( new PlateLegs() );
switch( Utility.Random( 3 ) )
{
case 0: AddItem( new Doublet( Utility.RandomNondyedHue() ) ); break;
case 1: AddItem( new Tunic( Utility.RandomNondyedHue() ) ); break;
case 2: AddItem( new BodySash( Utility.RandomNondyedHue() ) ); break;
}
}
Utility.AssignRandomHair( this );
if( Utility.RandomBool() )
Utility.AssignRandomFacialHair( this, HairHue );
VikingSword weapon = new VikingSword();
weapon.Movable = false;
AddItem( weapon );
BaseShield shield = Shield;
shield.Movable = false;
AddItem( shield );
PackGold( 250, 500 );
Skills[SkillName.Anatomy].Base = 120.0;
Skills[SkillName.Tactics].Base = 120.0;
Skills[SkillName.Swords].Base = 120.0;
Skills[SkillName.MagicResist].Base = 120.0;
Skills[SkillName.DetectHidden].Base = 100.0;
}
public abstract int Keyword{ get; }
public abstract BaseShield Shield{ get; }
public abstract int SignupNumber{ get; }
public abstract GuildType Type{ get; }
public override bool HandlesOnSpeech( Mobile from )
{
if ( from.InRange( this.Location, 2 ) )
return true;
return base.HandlesOnSpeech( from );
}
public override void OnSpeech( SpeechEventArgs e )
{
if ( !e.Handled && e.HasKeyword( Keyword ) && e.Mobile.InRange( this.Location, 2 ) )
{
e.Handled = true;
Mobile from = e.Mobile;
Guild g = from.Guild as Guild;
if ( g == null || g.Type != Type )
{
Say( SignupNumber );
}
else
{
Container pack = from.Backpack;
BaseShield shield = Shield;
Item twoHanded = from.FindItemOnLayer( Layer.TwoHanded );
if ( (pack != null && pack.FindItemByType( shield.GetType() ) != null) || ( twoHanded != null && shield.GetType().IsAssignableFrom( twoHanded.GetType() ) ) )
{
Say( 1007110 ); // Why dost thou ask about virtue guards when thou art one?
shield.Delete();
}
else if ( from.PlaceInBackpack( shield ) )
{
Say( Utility.Random( 1007101, 5 ) );
Say( 1007139 ); // I see you are in need of our shield, Here you go.
from.AddToBackpack( shield );
}
else
{
from.SendLocalizedMessage( 502868 ); // Your backpack is too full.
shield.Delete();
}
}
}
base.OnSpeech( e );
}
public BaseShieldGuard( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View file

@ -0,0 +1,39 @@
using System;
using Server;
namespace Server.Mobiles
{
public class CapturedHordeMinion : HordeMinion
{
[Constructable]
public CapturedHordeMinion()
{
this.FightMode = FightMode.None;
}
public override bool InitialInnocent{ get{ return true; } }
public override bool CanBeDamaged()
{
return false;
}
public CapturedHordeMinion( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.WriteEncodedInt( 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadEncodedInt();
}
}
}

View file

@ -0,0 +1,41 @@
using System;
using Server;
using Server.Misc;
using Server.Items;
using Server.Guilds;
namespace Server.Mobiles
{
public class ChaosGuard : BaseShieldGuard
{
public override int Keyword{ get{ return 0x22; } } // *chaos shield*
public override BaseShield Shield{ get{ return new ChaosShield(); } }
public override int SignupNumber{ get{ return 1007140; } } // Sign up with a guild of chaos if thou art interested.
public override GuildType Type{ get{ return GuildType.Chaos; } }
public override bool BardImmune{ get{ return true; } }
[Constructable]
public ChaosGuard()
{
}
public ChaosGuard( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View file

@ -0,0 +1,545 @@
using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Engines.CannedEvil;
using System.Collections.Generic;
namespace Server.Mobiles
{
public class Harrower : BaseCreature
{
private bool m_TrueForm;
private Item m_GateItem;
private ArrayList m_Tentacles;
private Timer m_Timer;
private class SpawnEntry
{
public Point3D m_Location;
public Point3D m_Entrance;
public SpawnEntry( Point3D loc, Point3D ent )
{
m_Location = loc;
m_Entrance = ent;
}
}
private static SpawnEntry[] m_Entries = new SpawnEntry[]
{
new SpawnEntry( new Point3D( 5242, 945, -40 ), new Point3D( 1176, 2638, 0 ) ), // Destard
new SpawnEntry( new Point3D( 5225, 798, 0 ), new Point3D( 1176, 2638, 0 ) ), // Destard
new SpawnEntry( new Point3D( 5556, 886, 30 ), new Point3D( 1298, 1080, 0 ) ), // Despise
new SpawnEntry( new Point3D( 5187, 615, 0 ), new Point3D( 4111, 432, 5 ) ), // Deceit
new SpawnEntry( new Point3D( 5319, 583, 0 ), new Point3D( 4111, 432, 5 ) ), // Deceit
new SpawnEntry( new Point3D( 5713, 1334, -1 ), new Point3D( 2923, 3407, 8 ) ), // Fire
new SpawnEntry( new Point3D( 5860, 1460, -2 ), new Point3D( 2923, 3407, 8 ) ), // Fire
new SpawnEntry( new Point3D( 5328, 1620, 0 ), new Point3D( 5451, 3143, -60 ) ), // Terathan Keep
new SpawnEntry( new Point3D( 5690, 538, 0 ), new Point3D( 2042, 224, 14 ) ), // Wrong
new SpawnEntry( new Point3D( 5609, 195, 0 ), new Point3D( 514, 1561, 0 ) ), // Shame
new SpawnEntry( new Point3D( 5475, 187, 0 ), new Point3D( 514, 1561, 0 ) ), // Shame
new SpawnEntry( new Point3D( 6085, 179, 0 ), new Point3D( 4721, 3822, 0 ) ), // Hythloth
new SpawnEntry( new Point3D( 6084, 66, 0 ), new Point3D( 4721, 3822, 0 ) ), // Hythloth
new SpawnEntry( new Point3D( 5499, 2003, 0 ), new Point3D( 2499, 919, 0 ) ), // Covetous
new SpawnEntry( new Point3D( 5579, 1858, 0 ), new Point3D( 2499, 919, 0 ) ) // Covetous
};
private static ArrayList m_Instances = new ArrayList();
public static ArrayList Instances{ get{ return m_Instances; } }
public static Harrower Spawn( Point3D platLoc, Map platMap )
{
if ( m_Instances.Count > 0 )
return null;
SpawnEntry entry = m_Entries[Utility.Random( m_Entries.Length )];
Harrower harrower = new Harrower();
harrower.MoveToWorld( entry.m_Location, Map.Felucca );
harrower.m_GateItem = new HarrowerGate( harrower, platLoc, platMap, entry.m_Entrance, Map.Felucca );
return harrower;
}
public static bool CanSpawn
{
get
{
return ( m_Instances.Count == 0 );
}
}
[Constructable]
public Harrower() : base( AIType.AI_Mage, FightMode.Closest, 18, 1, 0.2, 0.4 )
{
m_Instances.Add( this );
Name = "the harrower";
BodyValue = 146;
SetStr( 900, 1000 );
SetDex( 125, 135 );
SetInt( 1000, 1200 );
Fame = 22500;
Karma = -22500;
VirtualArmor = 60;
SetDamageType( ResistanceType.Physical, 50 );
SetDamageType( ResistanceType.Energy, 50 );
SetResistance( ResistanceType.Physical, 55, 65 );
SetResistance( ResistanceType.Fire, 60, 80 );
SetResistance( ResistanceType.Cold, 60, 80 );
SetResistance( ResistanceType.Poison, 60, 80 );
SetResistance( ResistanceType.Energy, 60, 80 );
SetSkill( SkillName.Wrestling, 90.1, 100.0 );
SetSkill( SkillName.Tactics, 90.2, 110.0 );
SetSkill( SkillName.MagicResist, 120.2, 160.0 );
SetSkill( SkillName.Magery, 120.0 );
SetSkill( SkillName.EvalInt, 120.0 );
SetSkill( SkillName.Meditation, 120.0 );
m_Tentacles = new ArrayList();
m_Timer = new TeleportTimer( this );
m_Timer.Start();
}
public override void GenerateLoot()
{
AddLoot( LootPack.SuperBoss, 2 );
AddLoot( LootPack.Meager );
}
public override bool AutoDispel{ get{ return true; } }
public override bool Unprovokable{ get{ return true; } }
public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
private static readonly double[] m_Offsets = new double[]
{
Math.Cos( 000.0 / 180.0 * Math.PI ), Math.Sin( 000.0 / 180.0 * Math.PI ),
Math.Cos( 040.0 / 180.0 * Math.PI ), Math.Sin( 040.0 / 180.0 * Math.PI ),
Math.Cos( 080.0 / 180.0 * Math.PI ), Math.Sin( 080.0 / 180.0 * Math.PI ),
Math.Cos( 120.0 / 180.0 * Math.PI ), Math.Sin( 120.0 / 180.0 * Math.PI ),
Math.Cos( 160.0 / 180.0 * Math.PI ), Math.Sin( 160.0 / 180.0 * Math.PI ),
Math.Cos( 200.0 / 180.0 * Math.PI ), Math.Sin( 200.0 / 180.0 * Math.PI ),
Math.Cos( 240.0 / 180.0 * Math.PI ), Math.Sin( 240.0 / 180.0 * Math.PI ),
Math.Cos( 280.0 / 180.0 * Math.PI ), Math.Sin( 280.0 / 180.0 * Math.PI ),
Math.Cos( 320.0 / 180.0 * Math.PI ), Math.Sin( 320.0 / 180.0 * Math.PI ),
};
public void Morph()
{
if ( m_TrueForm )
return;
m_TrueForm = true;
Name = "the true harrower";
BodyValue = 780;
Hue = 0x497;
Hits = HitsMax;
Stam = StamMax;
Mana = ManaMax;
ProcessDelta();
Say( 1049499 ); // Behold my true form!
Map map = this.Map;
if ( map != null )
{
for ( int i = 0; i < m_Offsets.Length; i += 2 )
{
double rx = m_Offsets[i];
double ry = m_Offsets[i + 1];
int dist = 0;
bool ok = false;
int x = 0, y = 0, z = 0;
while ( !ok && dist < 10 )
{
int rdist = 10 + dist;
x = this.X + (int)(rx * rdist);
y = this.Y + (int)(ry * rdist);
z = map.GetAverageZ( x, y );
if ( !(ok = map.CanFit( x, y, this.Z, 16, false, false ) ) )
ok = map.CanFit( x, y, z, 16, false, false );
if ( dist >= 0 )
dist = -(dist + 1);
else
dist = -(dist - 1);
}
if ( !ok )
continue;
BaseCreature spawn = new HarrowerTentacles( this );
spawn.Team = this.Team;
spawn.MoveToWorld( new Point3D( x, y, z ), map );
m_Tentacles.Add( spawn );
}
}
}
[CommandProperty( AccessLevel.GameMaster )]
public override int HitsMax{ get{ return m_TrueForm ? 65000 : 30000; } }
[CommandProperty( AccessLevel.GameMaster )]
public override int ManaMax{ get{ return 5000; } }
public Harrower( Serial serial ) : base( serial )
{
m_Instances.Add( this );
}
public override void OnAfterDelete()
{
m_Instances.Remove( this );
base.OnAfterDelete();
}
public override bool DisallowAllMoves{ get{ return m_TrueForm; } }
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( m_TrueForm );
writer.Write( m_GateItem );
writer.WriteMobileList( m_Tentacles );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
m_TrueForm = reader.ReadBool();
m_GateItem = reader.ReadItem();
m_Tentacles = reader.ReadMobileList();
m_Timer = new TeleportTimer( this );
m_Timer.Start();
break;
}
}
}
public void GivePowerScrolls()
{
List<Mobile> toGive = new List<Mobile>();
List<DamageStore> rights = BaseCreature.GetLootingRights( this.DamageEntries, this.HitsMax );
for ( int i = rights.Count - 1; i >= 0; --i )
{
DamageStore ds = rights[i];
if ( ds.m_HasRight )
toGive.Add( ds.m_Mobile );
}
if ( toGive.Count == 0 )
return;
// Randomize
for ( int i = 0; i < toGive.Count; ++i )
{
int rand = Utility.Random( toGive.Count );
Mobile hold = toGive[i];
toGive[i] = toGive[rand];
toGive[rand] = hold;
}
for ( int i = 0; i < 16; ++i )
{
int level;
double random = Utility.RandomDouble();
if ( 0.1 >= random )
level = 25;
else if ( 0.25 >= random )
level = 20;
else if ( 0.45 >= random )
level = 15;
else if ( 0.70 >= random )
level = 10;
else
level = 5;
Mobile m = toGive[i % toGive.Count];
m.SendLocalizedMessage( 1049524 ); // You have received a scroll of power!
m.AddToBackpack( new StatCapScroll( 225 + level ) );
if ( m is PlayerMobile )
{
PlayerMobile pm = (PlayerMobile)m;
for ( int j = 0; j < pm.JusticeProtectors.Count; ++j )
{
Mobile prot = (Mobile)pm.JusticeProtectors[j];
if ( prot.Map != m.Map || prot.Kills >= 5 || prot.Criminal || !JusticeVirtue.CheckMapRegion( m, prot ) )
continue;
int chance = 0;
switch ( VirtueHelper.GetLevel( prot, VirtueName.Justice ) )
{
case VirtueLevel.Seeker: chance = 60; break;
case VirtueLevel.Follower: chance = 80; break;
case VirtueLevel.Knight: chance = 100; break;
}
if ( chance > Utility.Random( 100 ) )
{
prot.SendLocalizedMessage( 1049368 ); // You have been rewarded for your dedication to Justice!
prot.AddToBackpack( new StatCapScroll( 225 + level ) );
}
}
}
}
}
public override bool OnBeforeDeath()
{
if ( m_TrueForm )
{
List<DamageStore> rights = BaseCreature.GetLootingRights( this.DamageEntries, this.HitsMax );
for ( int i = rights.Count - 1; i >= 0; --i )
{
DamageStore ds = rights[i];
if ( ds.m_HasRight && ds.m_Mobile is PlayerMobile )
PlayerMobile.ChampionTitleInfo.AwardHarrowerTitle( (PlayerMobile)ds.m_Mobile );
}
if ( !NoKillAwards )
{
GivePowerScrolls();
Map map = this.Map;
if ( map != null )
{
for ( int x = -16; x <= 16; ++x )
{
for ( int y = -16; y <= 16; ++y )
{
double dist = Math.Sqrt(x*x+y*y);
if ( dist <= 16 )
new GoodiesTimer( map, X + x, Y + y ).Start();
}
}
}
for ( int i = 0; i < m_Tentacles.Count; ++i )
{
Mobile m = (Mobile)m_Tentacles[i];
if ( !m.Deleted )
m.Kill();
}
m_Tentacles.Clear();
if ( m_GateItem != null )
m_GateItem.Delete();
}
return base.OnBeforeDeath();
}
else
{
Morph();
return false;
}
}
private class TeleportTimer : Timer
{
private Mobile m_Owner;
private static int[] m_Offsets = new int[]
{
-1, -1,
-1, 0,
-1, 1,
0, -1,
0, 1,
1, -1,
1, 0,
1, 1
};
public TeleportTimer( Mobile owner ) : base( TimeSpan.FromSeconds( 5.0 ), TimeSpan.FromSeconds( 5.0 ) )
{
m_Owner = owner;
}
protected override void OnTick()
{
if ( m_Owner.Deleted )
{
Stop();
return;
}
Map map = m_Owner.Map;
if ( map == null )
return;
if ( 0.25 < Utility.RandomDouble() )
return;
Mobile toTeleport = null;
foreach ( Mobile m in m_Owner.GetMobilesInRange( 16 ) )
{
if ( m != m_Owner && m.Player && m_Owner.CanBeHarmful( m ) && m_Owner.CanSee( m ) )
{
toTeleport = m;
break;
}
}
if ( toTeleport != null )
{
int offset = Utility.Random( 8 ) * 2;
Point3D to = m_Owner.Location;
for ( int i = 0; i < m_Offsets.Length; i += 2 )
{
int x = m_Owner.X + m_Offsets[(offset + i) % m_Offsets.Length];
int y = m_Owner.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
if ( map.CanSpawnMobile( x, y, m_Owner.Z ) )
{
to = new Point3D( x, y, m_Owner.Z );
break;
}
else
{
int z = map.GetAverageZ( x, y );
if ( map.CanSpawnMobile( x, y, z ) )
{
to = new Point3D( x, y, z );
break;
}
}
}
Mobile m = toTeleport;
Point3D from = m.Location;
m.Location = to;
Server.Spells.SpellHelper.Turn( m_Owner, toTeleport );
Server.Spells.SpellHelper.Turn( toTeleport, m_Owner );
m.ProcessDelta();
Effects.SendLocationParticles( EffectItem.Create( from, m.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 2023 );
Effects.SendLocationParticles( EffectItem.Create( to, m.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 5023 );
m.PlaySound( 0x1FE );
m_Owner.Combatant = toTeleport;
}
}
}
private class GoodiesTimer : Timer
{
private Map m_Map;
private int m_X, m_Y;
public GoodiesTimer( Map map, int x, int y ) : base( TimeSpan.FromSeconds( Utility.RandomDouble() * 10.0 ) )
{
m_Map = map;
m_X = x;
m_Y = y;
}
protected override void OnTick()
{
int z = m_Map.GetAverageZ( m_X, m_Y );
bool canFit = m_Map.CanFit( m_X, m_Y, z, 6, false, false );
for ( int i = -3; !canFit && i <= 3; ++i )
{
canFit = m_Map.CanFit( m_X, m_Y, z + i, 6, false, false );
if ( canFit )
z += i;
}
if ( !canFit )
return;
Gold g = new Gold( 750, 1250 );
g.MoveToWorld( new Point3D( m_X, m_Y, z ), m_Map );
if ( 0.5 >= Utility.RandomDouble() )
{
switch ( Utility.Random( 3 ) )
{
case 0: // Fire column
{
Effects.SendLocationParticles( EffectItem.Create( g.Location, g.Map, EffectItem.DefaultDuration ), 0x3709, 10, 30, 5052 );
Effects.PlaySound( g, g.Map, 0x208 );
break;
}
case 1: // Explosion
{
Effects.SendLocationParticles( EffectItem.Create( g.Location, g.Map, EffectItem.DefaultDuration ), 0x36BD, 20, 10, 5044 );
Effects.PlaySound( g, g.Map, 0x307 );
break;
}
case 2: // Ball of fire
{
Effects.SendLocationParticles( EffectItem.Create( g.Location, g.Map, EffectItem.DefaultDuration ), 0x36FE, 10, 10, 5052 );
break;
}
}
}
}
}
}
}

View file

@ -0,0 +1,221 @@
using System;
using System.Collections;
using Server.Items;
namespace Server.Mobiles
{
[CorpseName( "a tentacles corpse" )]
public class HarrowerTentacles : BaseCreature
{
private Mobile m_Harrower;
private DrainTimer m_Timer;
[CommandProperty( AccessLevel.GameMaster )]
public Mobile Harrower
{
get
{
return m_Harrower;
}
set
{
m_Harrower = value;
}
}
[Constructable]
public HarrowerTentacles() : this( null )
{
}
public HarrowerTentacles( Mobile harrower ) : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
m_Harrower = harrower;
Name = "tentacles of the harrower";
Body = 129;
SetStr( 901, 1000 );
SetDex( 126, 140 );
SetInt( 1001, 1200 );
SetHits( 541, 600 );
SetDamage( 13, 20 );
SetDamageType( ResistanceType.Physical, 20 );
SetDamageType( ResistanceType.Fire, 20 );
SetDamageType( ResistanceType.Cold, 20 );
SetDamageType( ResistanceType.Poison, 20 );
SetDamageType( ResistanceType.Energy, 20 );
SetResistance( ResistanceType.Physical, 55, 65 );
SetResistance( ResistanceType.Fire, 35, 45 );
SetResistance( ResistanceType.Cold, 35, 45 );
SetResistance( ResistanceType.Poison, 35, 45 );
SetResistance( ResistanceType.Energy, 35, 45 );
SetSkill( SkillName.Meditation, 100.0 );
SetSkill( SkillName.MagicResist, 120.1, 140.0 );
SetSkill( SkillName.Swords, 90.1, 100.0 );
SetSkill( SkillName.Tactics, 90.1, 100.0 );
SetSkill( SkillName.Wrestling, 90.1, 100.0 );
Fame = 15000;
Karma = -15000;
VirtualArmor = 60;
m_Timer = new DrainTimer( this );
m_Timer.Start();
PackReg( 50 );
PackNecroReg( 15, 75 );
}
public override void CheckReflect( Mobile caster, ref bool reflect )
{
reflect = true;
}
public override int GetIdleSound()
{
return 0x101;
}
public override int GetAngerSound()
{
return 0x5E;
}
public override int GetDeathSound()
{
return 0x1C2;
}
public override int GetAttackSound()
{
return -1; // unknown
}
public override int GetHurtSound()
{
return 0x289;
}
public override void GenerateLoot()
{
AddLoot( LootPack.FilthyRich, 2 );
AddLoot( LootPack.MedScrolls, 3 );
AddLoot( LootPack.HighScrolls, 2 );
}
public override bool AutoDispel{ get{ return true; } }
public override bool Unprovokable{ get{ return true; } }
public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
public override bool DisallowAllMoves{ get{ return true; } }
public HarrowerTentacles( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( m_Harrower );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
m_Harrower = reader.ReadMobile();
m_Timer = new DrainTimer( this );
m_Timer.Start();
break;
}
}
}
public override void OnAfterDelete()
{
if ( m_Timer != null )
m_Timer.Stop();
m_Timer = null;
base.OnAfterDelete();
}
private class DrainTimer : Timer
{
private HarrowerTentacles m_Owner;
public DrainTimer( HarrowerTentacles owner ) : base( TimeSpan.FromSeconds( 5.0 ), TimeSpan.FromSeconds( 5.0 ) )
{
m_Owner = owner;
Priority = TimerPriority.TwoFiftyMS;
}
private static ArrayList m_ToDrain = new ArrayList();
protected override void OnTick()
{
if ( m_Owner.Deleted )
{
Stop();
return;
}
foreach ( Mobile m in m_Owner.GetMobilesInRange( 9 ) )
{
if ( m == m_Owner || m == m_Owner.Harrower || !m_Owner.CanBeHarmful( m ) )
continue;
if ( m is BaseCreature )
{
BaseCreature bc = m as BaseCreature;
if ( bc.Controlled || bc.Summoned )
m_ToDrain.Add( m );
}
else if ( m.Player )
{
m_ToDrain.Add( m );
}
}
foreach ( Mobile m in m_ToDrain )
{
m_Owner.DoHarmful( m );
m.FixedParticles( 0x374A, 10, 15, 5013, 0x455, 0, EffectLayer.Waist );
m.PlaySound( 0x1F1 );
int drain = Utility.RandomMinMax( 14, 30 );
m_Owner.Hits += drain;
if ( m_Owner.Harrower != null )
m_Owner.Harrower.Hits += drain;
m.Damage( drain, m_Owner );
}
m_ToDrain.Clear();
}
}
}
}

View file

@ -0,0 +1,221 @@
using System;
using Server;
using Server.Items;
using Server.Engines.CannedEvil;
namespace Server.Mobiles
{
public class LordOaks : BaseChampion
{
private Mobile m_Queen;
private bool m_SpawnedQueen;
public override ChampionSkullType SkullType{ get{ return ChampionSkullType.Enlightenment; } }
[Constructable]
public LordOaks() : base( AIType.AI_Mage, FightMode.Evil )
{
Body = 175;
Name = "Lord Oaks";
SetStr( 403, 850 );
SetDex( 101, 150 );
SetInt( 503, 800 );
SetHits( 3000 );
SetStam( 202, 400 );
SetDamage( 21, 33 );
SetDamageType( ResistanceType.Physical, 75 );
SetDamageType( ResistanceType.Fire, 25 );
SetResistance( ResistanceType.Physical, 85, 90 );
SetResistance( ResistanceType.Fire, 60, 70 );
SetResistance( ResistanceType.Cold, 60, 70 );
SetResistance( ResistanceType.Poison, 80, 90 );
SetResistance( ResistanceType.Energy, 80, 90 );
SetSkill( SkillName.Anatomy, 75.1, 100.0 );
SetSkill( SkillName.EvalInt, 120.1, 130.0 );
SetSkill( SkillName.Magery, 120.0 );
SetSkill( SkillName.Meditation, 120.1, 130.0 );
SetSkill( SkillName.MagicResist, 100.5, 150.0 );
SetSkill( SkillName.Tactics, 100.0 );
SetSkill( SkillName.Wrestling, 100.0 );
Fame = 22500;
Karma = 22500;
VirtualArmor = 100;
}
public override void GenerateLoot()
{
AddLoot( LootPack.UltraRich, 5 );
}
public override bool AutoDispel{ get{ return true; } }
public override bool BardImmune{ get{ return !Core.SE; } }
public override bool Unprovokable{ get{ return Core.SE; } }
public override bool Uncalmable{ get{ return Core.SE; } }
public override OppositionGroup OppositionGroup
{
get{ return OppositionGroup.FeyAndUndead; }
}
public override Poison PoisonImmune{ get{ return Poison.Deadly; } }
public void SpawnPixies( Mobile target )
{
Map map = this.Map;
if ( map == null )
return;
this.Say( 1042154 ); // You shall never defeat me as long as I have my queen!
int newPixies = Utility.RandomMinMax( 3, 6 );
for ( int i = 0; i < newPixies; ++i )
{
Pixie pixie = new Pixie();
pixie.Team = this.Team;
pixie.FightMode = FightMode.Closest;
bool validLocation = false;
Point3D loc = this.Location;
for ( int j = 0; !validLocation && j < 10; ++j )
{
int x = X + Utility.Random( 3 ) - 1;
int y = Y + Utility.Random( 3 ) - 1;
int z = map.GetAverageZ( x, y );
if ( validLocation = map.CanFit( x, y, this.Z, 16, false, false ) )
loc = new Point3D( x, y, Z );
else if ( validLocation = map.CanFit( x, y, z, 16, false, false ) )
loc = new Point3D( x, y, z );
}
pixie.MoveToWorld( loc, map );
pixie.Combatant = target;
}
}
public override int GetAngerSound()
{
return 0x2F8;
}
public override int GetIdleSound()
{
return 0x2F8;
}
public override int GetAttackSound()
{
return Utility.Random( 0x2F5, 2 );
}
public override int GetHurtSound()
{
return 0x2F9;
}
public override int GetDeathSound()
{
return 0x2F7;
}
public void CheckQueen()
{
if ( !m_SpawnedQueen )
{
this.Say( 1042153 ); // Come forth my queen!
m_Queen = new Silvani();
((BaseCreature)m_Queen).Team = this.Team;
m_Queen.MoveToWorld( this.Location, this.Map );
m_SpawnedQueen = true;
}
else if ( m_Queen != null && m_Queen.Deleted )
{
m_Queen = null;
}
}
public override void AlterDamageScalarFrom( Mobile caster, ref double scalar )
{
CheckQueen();
if ( m_Queen != null )
{
scalar *= 0.1;
if ( 0.1 >= Utility.RandomDouble() )
SpawnPixies( caster );
}
}
public override void OnGaveMeleeAttack( Mobile defender )
{
base.OnGaveMeleeAttack( defender );
defender.Damage( Utility.Random( 20, 10 ), this );
defender.Stam -= Utility.Random( 20, 10 );
defender.Mana -= Utility.Random( 20, 10 );
}
public override void OnGotMeleeAttack( Mobile attacker )
{
base.OnGotMeleeAttack( attacker );
CheckQueen();
if ( m_Queen != null && 0.1 >= Utility.RandomDouble() )
SpawnPixies( attacker );
attacker.Damage( Utility.Random( 20, 10 ), this );
attacker.Stam -= Utility.Random( 20, 10 );
attacker.Mana -= Utility.Random( 20, 10 );
}
public LordOaks( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( m_Queen );
writer.Write( m_SpawnedQueen );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
m_Queen = reader.ReadMobile();
m_SpawnedQueen = reader.ReadBool();
break;
}
}
}
}
}

View file

@ -0,0 +1,81 @@
using System;
using Server;
using Server.Items;
using Server.Engines.CannedEvil;
namespace Server.Mobiles
{
public class Mephitis : BaseChampion
{
public override ChampionSkullType SkullType{ get{ return ChampionSkullType.Venom; } }
[Constructable]
public Mephitis() : base( AIType.AI_Melee )
{
Body = 173;
Name = "Mephitis";
BaseSoundID = 0x183;
SetStr( 505, 1000 );
SetDex( 102, 300 );
SetInt( 402, 600 );
SetHits( 3000 );
SetStam( 105, 600 );
SetDamage( 21, 33 );
SetDamageType( ResistanceType.Physical, 50 );
SetDamageType( ResistanceType.Poison, 50 );
SetResistance( ResistanceType.Physical, 75, 80 );
SetResistance( ResistanceType.Fire, 60, 70 );
SetResistance( ResistanceType.Cold, 60, 70 );
SetResistance( ResistanceType.Poison, 100 );
SetResistance( ResistanceType.Energy, 60, 70 );
SetSkill( SkillName.MagicResist, 70.7, 140.0 );
SetSkill( SkillName.Tactics, 97.6, 100.0 );
SetSkill( SkillName.Wrestling, 97.6, 100.0 );
Fame = 22500;
Karma = -22500;
VirtualArmor = 80;
}
public override void GenerateLoot()
{
AddLoot( LootPack.UltraRich, 4 );
}
public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
public override Poison HitPoison{ get{ return Poison.Lethal; } }
public override void OnGotMeleeAttack( Mobile attacker )
{
base.OnGotMeleeAttack( attacker );
// TODO: Web ability
}
public Mephitis( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View file

@ -0,0 +1,287 @@
using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Engines.CannedEvil;
namespace Server.Mobiles
{
public class Neira : BaseChampion
{
public override ChampionSkullType SkullType{ get{ return ChampionSkullType.Death; } }
[Constructable]
public Neira() : base( AIType.AI_Mage )
{
Name = "Neira";
Title = "the necromancer";
Body = 401;
Hue = 0x83EC;
SetStr( 305, 425 );
SetDex( 72, 150 );
SetInt( 505, 750 );
SetHits( 4800 );
SetStam( 102, 300 );
SetDamage( 25, 35 );
SetDamageType( ResistanceType.Physical, 100 );
SetResistance( ResistanceType.Physical, 25, 30 );
SetResistance( ResistanceType.Fire, 35, 45 );
SetResistance( ResistanceType.Cold, 50, 60 );
SetResistance( ResistanceType.Poison, 30, 40 );
SetResistance( ResistanceType.Energy, 20, 30 );
SetSkill( SkillName.EvalInt, 120.0 );
SetSkill( SkillName.Magery, 120.0 );
SetSkill( SkillName.Meditation, 120.0 );
SetSkill( SkillName.MagicResist, 150.0 );
SetSkill( SkillName.Tactics, 97.6, 100.0 );
SetSkill( SkillName.Wrestling, 97.6, 100.0 );
Fame = 22500;
Karma = -22500;
VirtualArmor = 30;
Female = true;
Item shroud = new HoodedShroudOfShadows();
shroud.Movable = false;
AddItem( shroud );
Scimitar weapon = new Scimitar();
weapon.Skill = SkillName.Wrestling;
weapon.Hue = 38;
weapon.Movable = false;
AddItem( weapon );
//new SkeletalMount().Rider = this;
AddItem( new VirtualMountItem( this ) );
}
public override void GenerateLoot()
{
AddLoot( LootPack.UltraRich, 3 );
AddLoot( LootPack.Meager );
}
public override bool OnBeforeDeath()
{
IMount mount = this.Mount;
if ( mount != null )
mount.Rider = null;
if ( mount is Mobile )
((Mobile)mount).Delete();
return base.OnBeforeDeath();
}
private bool m_SpeedBoost;
public override void OnDamage( int amount, Mobile from, bool willKill )
{
CheckSpeedBoost();
base.OnDamage( amount, from, willKill );
}
private const double SpeedBoostScalar = 1.2;
private void CheckSpeedBoost()
{
if( Hits < (HitsMax / 4 ) )
{
if( !m_SpeedBoost )
{
ActiveSpeed /= SpeedBoostScalar;
PassiveSpeed /= SpeedBoostScalar;
m_SpeedBoost = true;
}
}
else if( m_SpeedBoost )
{
ActiveSpeed *= SpeedBoostScalar;
PassiveSpeed *= SpeedBoostScalar;
m_SpeedBoost = false;
}
}
private class VirtualMount : IMount
{
private VirtualMountItem m_Item;
public Mobile Rider
{
get { return m_Item.Rider; }
set { }
}
public VirtualMount( VirtualMountItem item )
{
m_Item = item;
}
public virtual void OnRiderDamaged( int amount, Mobile from, bool willKill )
{
}
}
private class VirtualMountItem : Item, IMountItem
{
private Mobile m_Rider;
private VirtualMount m_Mount;
public Mobile Rider { get { return m_Rider; } }
public VirtualMountItem( Mobile mob )
: base( 0x3EBB )
{
Layer = Layer.Mount;
Movable = false;
m_Rider = mob;
m_Mount = new VirtualMount( this );
}
public IMount Mount
{
get { return m_Mount; }
}
public VirtualMountItem( Serial serial )
: base( serial )
{
m_Mount = new VirtualMount( this );
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)0 ); // version
writer.Write( (Mobile)m_Rider );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
m_Rider = reader.ReadMobile();
if( m_Rider == null )
Delete();
}
}
public override bool AlwaysMurderer{ get{ return true; } }
public override bool BardImmune{ get{ return !Core.SE; } }
public override bool Unprovokable{ get{ return Core.SE; } }
public override bool Uncalmable{ get{ return Core.SE; } }
public override Poison PoisonImmune{ get{ return Poison.Deadly; } }
public override bool ShowFameTitle{ get{ return false; } }
public override bool ClickTitle{ get{ return false; } }
public override void OnGaveMeleeAttack( Mobile defender )
{
base.OnGaveMeleeAttack( defender );
if ( 0.1 >= Utility.RandomDouble() ) // 10% chance to drop or throw an unholy bone
AddUnholyBone( defender, 0.25 );
CheckSpeedBoost();
}
public override void OnGotMeleeAttack( Mobile attacker )
{
base.OnGotMeleeAttack( attacker );
if ( 0.1 >= Utility.RandomDouble() ) // 10% chance to drop or throw an unholy bone
AddUnholyBone( attacker, 0.25 );
}
public override void AlterDamageScalarFrom( Mobile caster, ref double scalar )
{
base.AlterDamageScalarFrom( caster, ref scalar );
if ( 0.1 >= Utility.RandomDouble() ) // 10% chance to throw an unholy bone
AddUnholyBone( caster, 1.0 );
}
public void AddUnholyBone( Mobile target, double chanceToThrow )
{
if ( chanceToThrow >= Utility.RandomDouble() )
{
Direction = GetDirectionTo( target );
MovingEffect( target, 0xF7E, 10, 1, true, false, 0x496, 0 );
new DelayTimer( this, target ).Start();
}
else
{
new UnholyBone().MoveToWorld( Location, Map );
}
}
private class DelayTimer : Timer
{
private Mobile m_Mobile;
private Mobile m_Target;
public DelayTimer( Mobile m, Mobile target ) : base( TimeSpan.FromSeconds( 1.0 ) )
{
m_Mobile = m;
m_Target = target;
}
protected override void OnTick()
{
if ( m_Mobile.CanBeHarmful( m_Target ) )
{
m_Mobile.DoHarmful( m_Target );
AOS.Damage( m_Target, m_Mobile, Utility.RandomMinMax( 10, 20 ), 100, 0, 0, 0, 0 );
new UnholyBone().MoveToWorld( m_Target.Location, m_Target.Map );
}
}
}
public Neira( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 1 ); // version
writer.Write( m_SpeedBoost );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch( version )
{
case 1:
{
m_SpeedBoost = reader.ReadBool();
break;
}
}
}
}
}

View file

@ -0,0 +1,41 @@
using System;
using Server;
using Server.Misc;
using Server.Items;
using Server.Guilds;
namespace Server.Mobiles
{
public class OrderGuard : BaseShieldGuard
{
public override int Keyword{ get{ return 0x21; } } // *order shield*
public override BaseShield Shield{ get{ return new OrderShield(); } }
public override int SignupNumber{ get{ return 1007141; } } // Sign up with a guild of order if thou art interested.
public override GuildType Type{ get{ return GuildType.Order; } }
public override bool BardImmune{ get{ return true; } }
[Constructable]
public OrderGuard()
{
}
public OrderGuard( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View file

@ -0,0 +1,151 @@
using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Spells;
using Server.Engines.CannedEvil;
namespace Server.Mobiles
{
public class Rikktor : BaseChampion
{
public override ChampionSkullType SkullType{ get{ return ChampionSkullType.Power; } }
[Constructable]
public Rikktor() : base( AIType.AI_Melee )
{
Body = 172;
Name = "Rikktor";
SetStr( 701, 900 );
SetDex( 201, 350 );
SetInt( 51, 100 );
SetHits( 3000 );
SetStam( 203, 650 );
SetDamage( 28, 55 );
SetDamageType( ResistanceType.Physical, 25 );
SetDamageType( ResistanceType.Fire, 50 );
SetDamageType( ResistanceType.Energy, 25 );
SetResistance( ResistanceType.Physical, 80, 90 );
SetResistance( ResistanceType.Fire, 80, 90 );
SetResistance( ResistanceType.Cold, 30, 40 );
SetResistance( ResistanceType.Poison, 80, 90 );
SetResistance( ResistanceType.Energy, 80, 90 );
SetSkill( SkillName.Anatomy, 100.0 );
SetSkill( SkillName.MagicResist, 140.2, 160.0 );
SetSkill( SkillName.Tactics, 100.0 );
Fame = 22500;
Karma = -22500;
VirtualArmor = 130;
}
public override void GenerateLoot()
{
AddLoot( LootPack.UltraRich, 4 );
}
public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
public override ScaleType ScaleType{ get{ return ScaleType.All; } }
public override int Scales{ get{ return 20; } }
public override void OnGaveMeleeAttack( Mobile defender )
{
base.OnGaveMeleeAttack( defender );
if ( 0.2 >= Utility.RandomDouble() )
Earthquake();
}
public void Earthquake()
{
Map map = this.Map;
if ( map == null )
return;
ArrayList targets = new ArrayList();
foreach ( Mobile m in this.GetMobilesInRange( 8 ) )
{
if ( m == this || !CanBeHarmful( m ) )
continue;
if ( m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != this.Team) )
targets.Add( m );
else if ( m.Player )
targets.Add( m );
}
PlaySound( 0x2F3 );
for ( int i = 0; i < targets.Count; ++i )
{
Mobile m = (Mobile)targets[i];
double damage = m.Hits * 0.6;
if ( damage < 10.0 )
damage = 10.0;
else if ( damage > 75.0 )
damage = 75.0;
DoHarmful( m );
AOS.Damage( m, this, (int)damage, 100, 0, 0, 0, 0 );
if ( m.Alive && m.Body.IsHuman && !m.Mounted )
m.Animate( 20, 7, 1, true, false, 0 ); // take hit
}
}
public override int GetAngerSound()
{
return Utility.Random( 0x2CE, 2 );
}
public override int GetIdleSound()
{
return 0x2D2;
}
public override int GetAttackSound()
{
return Utility.Random( 0x2C7, 5 );
}
public override int GetHurtSound()
{
return 0x2D1;
}
public override int GetDeathSound()
{
return 0x2CC;
}
public Rikktor( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View file

@ -0,0 +1,134 @@
using System;
using System.Collections;
using Server.Items;
using Server.Engines.CannedEvil;
namespace Server.Mobiles
{
public class Semidar : BaseChampion
{
public override ChampionSkullType SkullType{ get{ return ChampionSkullType.Pain; } }
[Constructable]
public Semidar() : base( AIType.AI_Mage )
{
Name = "Semidar";
Body = 174;
BaseSoundID = 0x4B0;
SetStr( 502, 600 );
SetDex( 102, 200 );
SetInt( 601, 750 );
SetHits( 1500 );
SetStam( 103, 250 );
SetDamage( 29, 35 );
SetDamageType( ResistanceType.Physical, 75 );
SetDamageType( ResistanceType.Fire, 25 );
SetResistance( ResistanceType.Physical, 20, 30 );
SetResistance( ResistanceType.Fire, 50, 60 );
SetResistance( ResistanceType.Cold, 20, 30 );
SetResistance( ResistanceType.Poison, 20, 30 );
SetResistance( ResistanceType.Energy, 10, 20 );
SetSkill( SkillName.EvalInt, 95.1, 100.0 );
SetSkill( SkillName.Magery, 90.1, 105.0 );
SetSkill( SkillName.Meditation, 95.1, 100.0 );
SetSkill( SkillName.MagicResist, 120.2, 140.0 );
SetSkill( SkillName.Tactics, 90.1, 105.0 );
SetSkill( SkillName.Wrestling, 90.1, 105.0 );
Fame = 24000;
Karma = -24000;
VirtualArmor = 20;
}
public override void GenerateLoot()
{
AddLoot( LootPack.UltraRich, 4 );
AddLoot( LootPack.FilthyRich );
}
public override bool Unprovokable{ get{ return true; } }
public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
public override void CheckReflect( Mobile caster, ref bool reflect )
{
if ( caster.Body.IsMale )
reflect = true; // Always reflect if caster isn't female
}
public override void AlterDamageScalarFrom( Mobile caster, ref double scalar )
{
if ( caster.Body.IsMale )
scalar = 20; // Male bodies always reflect.. damage scaled 20x
}
public void DrainLife()
{
ArrayList list = new ArrayList();
foreach ( Mobile m in this.GetMobilesInRange( 2 ) )
{
if ( m == this || !CanBeHarmful( m ) )
continue;
if ( m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != this.Team) )
list.Add( m );
else if ( m.Player )
list.Add( m );
}
foreach ( Mobile m in list )
{
DoHarmful( m );
m.FixedParticles( 0x374A, 10, 15, 5013, 0x496, 0, EffectLayer.Waist );
m.PlaySound( 0x231 );
m.SendMessage( "You feel the life drain out of you!" );
int toDrain = Utility.RandomMinMax( 10, 40 );
Hits += toDrain;
m.Damage( toDrain, this );
}
}
public override void OnGaveMeleeAttack( Mobile defender )
{
base.OnGaveMeleeAttack( defender );
if ( 0.25 >= Utility.RandomDouble() )
DrainLife();
}
public override void OnGotMeleeAttack( Mobile attacker )
{
base.OnGotMeleeAttack( attacker );
if ( 0.25 >= Utility.RandomDouble() )
DrainLife();
}
public Semidar( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View file

@ -0,0 +1,178 @@
using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Engines.CannedEvil;
namespace Server.Mobiles
{
public class Serado : BaseChampion
{
public override ChampionSkullType SkullType{ get{ return ChampionSkullType.Power; } }
public override WeaponAbility GetWeaponAbility()
{
return WeaponAbility.DoubleStrike;
}
[Constructable]
public Serado() : base( AIType.AI_Melee )
{
Name = "Serado";
Title = "the awakened";
Body = 249;
Hue = 0x96C;
SetStr( 1000 );
SetDex( 150 );
SetInt( 300 );
SetHits( 9000 );
SetMana( 300 );
SetDamage( 29, 35 );
SetDamageType( ResistanceType.Physical, 70 );
SetDamageType( ResistanceType.Poison, 20 );
SetDamageType( ResistanceType.Energy, 10 );
SetResistance( ResistanceType.Physical, 30 );
SetResistance( ResistanceType.Fire, 60 );
SetResistance( ResistanceType.Cold, 60 );
SetResistance( ResistanceType.Poison, 90 );
SetResistance( ResistanceType.Energy, 50 );
SetSkill( SkillName.MagicResist, 120.0 );
SetSkill( SkillName.Tactics, 120.0 );
SetSkill( SkillName.Wrestling, 70.0 );
SetSkill( SkillName.Poisoning, 150.0 );
Fame = 22500;
Karma = -22500;
PackItem( Engines.Plants.Seed.RandomBonsaiSeed() );
}
public override void GenerateLoot()
{
AddLoot( LootPack.UltraRich, 4 );
AddLoot( LootPack.FilthyRich );
AddLoot( LootPack.Gems, 6 );
}
public override int TreasureMapLevel{ get{ return 5; } }
public override Poison HitPoison{ get{ return Poison.Lethal; } }
public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
public override double HitPoisonChance{ get{ return 0.8; } }
public override int Feathers{ get{ return 30; } }
public override bool ShowFameTitle{ get{ return false; } }
public override bool ClickTitle{ get{ return false; } }
// TODO: Hit Lightning Area
public override void OnDamagedBySpell( Mobile attacker )
{
base.OnDamagedBySpell( attacker );
ScaleResistances();
DoCounter( attacker );
}
public override void OnGotMeleeAttack( Mobile attacker )
{
base.OnGotMeleeAttack( attacker );
ScaleResistances();
DoCounter( attacker );
}
private void ScaleResistances()
{
double hitsLost = (HitsMax - Hits) / (double)HitsMax;
SetResistance( ResistanceType.Physical, 30 + (int)(hitsLost * ( 95 - 30 )) );
SetResistance( ResistanceType.Fire, 60 + (int)(hitsLost * ( 95 - 60 )) );
SetResistance( ResistanceType.Cold, 60 + (int)(hitsLost * ( 95 - 60 )) );
SetResistance( ResistanceType.Poison, 90 + (int)(hitsLost * ( 95 - 90 )) );
SetResistance( ResistanceType.Energy, 50 + (int)(hitsLost * ( 95 - 50 )) );
}
private void DoCounter( Mobile attacker )
{
if ( attacker is BaseCreature && ((BaseCreature)attacker).BardProvoked )
return;
if ( 0.2 > Utility.RandomDouble() )
{
/* Counterattack with Hit Poison Area
* 20-25 damage, unresistable
* Lethal poison, 100% of the time
* Particle effect: Type: "2" From: "0x4061A107" To: "0x0" ItemId: "0x36BD" ItemIdName: "explosion" FromLocation: "(296 615, 17)" ToLocation: "(296 615, 17)" Speed: "1" Duration: "10" FixedDirection: "True" Explode: "False" Hue: "0xA6" RenderMode: "0x0" Effect: "0x1F78" ExplodeEffect: "0x1" ExplodeSound: "0x0" Serial: "0x4061A107" Layer: "255" Unknown: "0x0"
* Doesn't work on provoked monsters
*/
Mobile target = null;
if ( attacker is BaseCreature )
{
Mobile m = ((BaseCreature)attacker).GetMaster();
if ( m != null )
target = m;
}
if ( target == null || !target.InRange( this, 25 ) )
target = attacker;
this.Animate( 10, 4, 1, true, false, 0 );
ArrayList targets = new ArrayList();
foreach ( Mobile m in target.GetMobilesInRange( 8 ) )
{
if ( m == this || !CanBeHarmful( m ) )
continue;
if ( m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != this.Team) )
targets.Add( m );
else if ( m.Player )
targets.Add( m );
}
for ( int i = 0; i < targets.Count; ++i )
{
Mobile m = (Mobile)targets[i];
DoHarmful( m );
AOS.Damage( m, this, Utility.RandomMinMax( 20, 25 ), true, 0, 0, 0, 100, 0 );
m.FixedParticles( 0x36BD, 1, 10, 0x1F78, 0xA6, 0, (EffectLayer)255 );
m.ApplyPoison( this, Poison.Lethal );
}
}
}
public Serado( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View file

@ -0,0 +1,49 @@
using System;
using Server;
namespace Server.Mobiles
{
public class ServantOfSemidar : BaseCreature
{
[Constructable]
public ServantOfSemidar() : base( AIType.AI_Melee, FightMode.None, 10, 1, 0.2, 0.4 )
{
Name = "a servant of Semidar";
Body = 0x26;
}
public override bool DisallowAllMoves{ get{ return true; } }
public override bool InitialInnocent{ get{ return true; } }
public override bool CanBeDamaged()
{
return false;
}
public override void AddNameProperties( ObjectPropertyList list )
{
base.AddNameProperties( list );
list.Add( 1005494 ); // enslaved
}
public ServantOfSemidar( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.WriteEncodedInt( 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadEncodedInt();
}
}
}

View file

@ -0,0 +1,137 @@
using System;
using Server;
using Server.Items;
namespace Server.Mobiles
{
public class Silvani : BaseCreature
{
[Constructable]
public Silvani() : base( AIType.AI_Mage, FightMode.Evil, 18, 1, 0.1, 0.2 )
{
Name = "Silvani";
Body = 176;
BaseSoundID = 0x467;
SetStr( 253, 400 );
SetDex( 157, 850 );
SetInt( 503, 800 );
SetHits( 600 );
SetDamage( 27, 38 );
SetDamageType( ResistanceType.Physical, 75 );
SetDamageType( ResistanceType.Cold, 25 );
SetResistance( ResistanceType.Physical, 45, 55 );
SetResistance( ResistanceType.Fire, 30, 40 );
SetResistance( ResistanceType.Cold, 30, 40 );
SetResistance( ResistanceType.Poison, 40, 50 );
SetResistance( ResistanceType.Energy, 40, 50 );
SetSkill( SkillName.EvalInt, 100.0 );
SetSkill( SkillName.Magery, 97.6, 107.5 );
SetSkill( SkillName.Meditation, 100.0 );
SetSkill( SkillName.MagicResist, 100.5, 150.0 );
SetSkill( SkillName.Tactics, 97.6, 100.0 );
SetSkill( SkillName.Wrestling, 97.6, 100.0 );
Fame = 20000;
Karma = 20000;
VirtualArmor = 50;
}
public override void GenerateLoot()
{
AddLoot( LootPack.UltraRich, 2 );
}
public override OppositionGroup OppositionGroup
{
get{ return OppositionGroup.FeyAndUndead; }
}
public override bool Unprovokable{ get{ return true; } }
public override Poison PoisonImmune{ get{ return Poison.Regular; } }
public override int TreasureMapLevel{ get{ return 5; } }
public void SpawnPixies( Mobile target )
{
Map map = this.Map;
if ( map == null )
return;
int newPixies = Utility.RandomMinMax( 3, 6 );
for ( int i = 0; i < newPixies; ++i )
{
Pixie pixie = new Pixie();
pixie.Team = this.Team;
pixie.FightMode = FightMode.Closest;
bool validLocation = false;
Point3D loc = this.Location;
for ( int j = 0; !validLocation && j < 10; ++j )
{
int x = X + Utility.Random( 3 ) - 1;
int y = Y + Utility.Random( 3 ) - 1;
int z = map.GetAverageZ( x, y );
if ( validLocation = map.CanFit( x, y, this.Z, 16, false, false ) )
loc = new Point3D( x, y, Z );
else if ( validLocation = map.CanFit( x, y, z, 16, false, false ) )
loc = new Point3D( x, y, z );
}
pixie.MoveToWorld( loc, map );
pixie.Combatant = target;
}
}
public override void AlterDamageScalarFrom( Mobile caster, ref double scalar )
{
if ( 0.1 >= Utility.RandomDouble() )
SpawnPixies( caster );
}
public override void OnGaveMeleeAttack( Mobile defender )
{
base.OnGaveMeleeAttack( defender );
defender.Damage( Utility.Random( 20, 10 ), this );
defender.Stam -= Utility.Random( 20, 10 );
defender.Mana -= Utility.Random( 20, 10 );
}
public override void OnGotMeleeAttack( Mobile attacker )
{
base.OnGotMeleeAttack( attacker );
if ( 0.1 >= Utility.RandomDouble() )
SpawnPixies( attacker );
}
public Silvani( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View file

@ -0,0 +1,69 @@
using System;
using Server;
namespace Server.Mobiles
{
public class Wanderer : Mobile
{
private Timer m_Timer;
[Constructable]
public Wanderer()
{
this.Name = "Me";
this.Body = 0x1;
this.AccessLevel = AccessLevel.Counselor;
m_Timer = new InternalTimer( this );
m_Timer.Start();
}
public Wanderer( Serial serial ) : base( serial )
{
m_Timer = new InternalTimer( this );
m_Timer.Start();
}
public override void OnDelete()
{
m_Timer.Stop();
base.OnDelete();
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
private class InternalTimer : Timer
{
private Wanderer m_Owner;
private int m_Count = 0;
public InternalTimer( Wanderer owner ) : base( TimeSpan.FromSeconds( 0.1 ), TimeSpan.FromSeconds( 0.1 ) )
{
m_Owner = owner;
}
protected override void OnTick()
{
if ( (m_Count++ & 0x3) == 0 )
{
m_Owner.Direction = (Direction)(Utility.Random( 8 ) | 0x80);
}
m_Owner.Move( m_Owner.Direction );
}
}
}
}