#W# Initial Commit: Avatars Conquest

This commit is contained in:
WarrentyExpired 2026-07-04 10:35:30 -04:00
commit 5df497787a
7510 changed files with 416048 additions and 0 deletions

View file

@ -0,0 +1,56 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "an ape corpse" )]
public class Ape : BaseCreature
{
[Constructable]
public Ape() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "an ape";
Body = 319;
BaseSoundID = 0x9E;
SetStr( 73, 115 );
SetDex( 46, 65 );
SetInt( 36, 60 );
SetHits( 58, 71 );
SetMana( 0 );
SetDamage( 4, 10 );
SetSkill( SkillName.MagicResist, 55.1, 70.0 );
SetSkill( SkillName.Tactics, 53.3, 68.0 );
SetSkill( SkillName.HandToHand, 53.3, 68.0 );
Fame = 500;
Karma = 0;
VirtualArmor = 23;
}
public override int Meat{ get{ return 2; } }
public override int Hides{ get{ return 8; } }
public Ape(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,58 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a bear corpse" )]
[TypeAlias( "Server.Mobiles.Bear" )]
public class BlackBear : BaseCreature
{
[Constructable]
public BlackBear() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a black bear";
Body = 211;
Hue = 0x8FD;
BaseSoundID = 0xA3;
SetStr( 76, 100 );
SetDex( 56, 75 );
SetInt( 11, 14 );
SetHits( 46, 60 );
SetMana( 0 );
SetDamage( 4, 10 );
SetSkill( SkillName.MagicResist, 20.1, 40.0 );
SetSkill( SkillName.Tactics, 40.1, 60.0 );
SetSkill( SkillName.HandToHand, 40.1, 60.0 );
Fame = 450;
Karma = 0;
VirtualArmor = 24;
}
public override int Meat{ get{ return 1; } }
public override int Hides{ get{ return 12; } }
public BlackBear( 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,56 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a bear corpse" )]
public class BrownBear : BaseCreature
{
[Constructable]
public BrownBear() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a brown bear";
Body = 211;
BaseSoundID = 0xA3;
SetStr( 76, 100 );
SetDex( 26, 45 );
SetInt( 23, 47 );
SetHits( 46, 60 );
SetMana( 0 );
SetDamage( 6, 12 );
SetSkill( SkillName.MagicResist, 25.1, 35.0 );
SetSkill( SkillName.Tactics, 40.1, 60.0 );
SetSkill( SkillName.HandToHand, 40.1, 60.0 );
Fame = 450;
Karma = 0;
VirtualArmor = 24;
}
public override int Meat{ get{ return 1; } }
public override int Hides{ get{ return 12; } }
public BrownBear( 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,54 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a bear corpse" )]
public class CaveBear : BaseCreature
{
[Constructable]
public CaveBear() : base( AIType.AI_Animal, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a cave bear";
Body = 266;
BaseSoundID = 0xA3;
SetStr( 126, 155 );
SetDex( 81, 105 );
SetInt( 16, 40 );
SetHits( 96, 133 );
SetMana( 0 );
SetDamage( 10, 15 );
SetSkill( SkillName.MagicResist, 25.1, 40.0 );
SetSkill( SkillName.Tactics, 80.1, 110.0 );
SetSkill( SkillName.HandToHand, 65.1, 90.0 );
Fame = 1500;
Karma = 0;
VirtualArmor = 24;
}
public override int Meat{ get{ return 3; } }
public override int Hides{ get{ return 18; } }
public CaveBear( 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,57 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a bear corpse" )]
[TypeAlias( "Server.Mobiles.Grizzlybear" )]
public class GrizzlyBear : BaseCreature
{
[Constructable]
public GrizzlyBear() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a grizzly bear";
Body = 212;
BaseSoundID = 0xA3;
SetStr( 126, 155 );
SetDex( 81, 105 );
SetInt( 16, 40 );
SetHits( 76, 93 );
SetMana( 0 );
SetDamage( 8, 13 );
SetSkill( SkillName.MagicResist, 25.1, 40.0 );
SetSkill( SkillName.Tactics, 70.1, 100.0 );
SetSkill( SkillName.HandToHand, 45.1, 70.0 );
Fame = 1000;
Karma = 0;
VirtualArmor = 24;
}
public override int Meat{ get{ return 2; } }
public override int Hides{ get{ return 16; } }
public GrizzlyBear( 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,54 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a bear corpse" )]
public class KodiakBear : BaseCreature
{
[Constructable]
public KodiakBear() : base( AIType.AI_Animal, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a kodiak bear";
Body = 267;
BaseSoundID = 0xA3;
SetStr( 126, 155 );
SetDex( 81, 105 );
SetInt( 16, 40 );
SetHits( 96, 133 );
SetMana( 0 );
SetDamage( 10, 15 );
SetSkill( SkillName.MagicResist, 25.1, 40.0 );
SetSkill( SkillName.Tactics, 80.1, 110.0 );
SetSkill( SkillName.HandToHand, 65.1, 90.0 );
Fame = 1500;
Karma = 0;
VirtualArmor = 24;
}
public override int Meat{ get{ return 3; } }
public override int Hides{ get{ return 18; } }
public KodiakBear( 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,56 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a bear corpse" )]
public class PandaBear : BaseCreature
{
[Constructable]
public PandaBear() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a panda bear";
Body = 112;
BaseSoundID = 0xA3;
SetStr( 76, 100 );
SetDex( 56, 75 );
SetInt( 11, 14 );
SetHits( 46, 60 );
SetMana( 0 );
SetDamage( 4, 10 );
SetSkill( SkillName.MagicResist, 20.1, 40.0 );
SetSkill( SkillName.Tactics, 40.1, 60.0 );
SetSkill( SkillName.HandToHand, 40.1, 60.0 );
Fame = 450;
Karma = 0;
VirtualArmor = 24;
}
public override int Meat{ get{ return 1; } }
public override int Hides{ get{ return 12; } }
public PandaBear( 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,57 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a polar bear corpse" )]
[TypeAlias( "Server.Mobiles.Polarbear" )]
public class PolarBear : BaseCreature
{
[Constructable]
public PolarBear() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a polar bear";
Body = 213;
BaseSoundID = 0xA3;
SetStr( 116, 140 );
SetDex( 81, 105 );
SetInt( 26, 50 );
SetHits( 70, 84 );
SetMana( 0 );
SetDamage( 7, 12 );
SetSkill( SkillName.MagicResist, 45.1, 60.0 );
SetSkill( SkillName.Tactics, 60.1, 90.0 );
SetSkill( SkillName.HandToHand, 45.1, 70.0 );
Fame = 1500;
Karma = 0;
VirtualArmor = 18;
}
public override int Meat{ get{ return 2; } }
public override int Hides{ get{ return 16; } }
public PolarBear( 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,54 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a bear corpse" )]
public class SnowBear : BaseCreature
{
[Constructable]
public SnowBear() : base( AIType.AI_Animal, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a snow bear";
Body = 268;
BaseSoundID = 0xA3;
SetStr( 126, 155 );
SetDex( 81, 105 );
SetInt( 16, 40 );
SetHits( 96, 133 );
SetMana( 0 );
SetDamage( 10, 15 );
SetSkill( SkillName.MagicResist, 25.1, 40.0 );
SetSkill( SkillName.Tactics, 80.1, 110.0 );
SetSkill( SkillName.HandToHand, 65.1, 90.0 );
Fame = 1500;
Karma = 0;
VirtualArmor = 24;
}
public override int Meat{ get{ return 3; } }
public override int Hides{ get{ return 18; } }
public SnowBear( 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,56 @@
using System;
using Server.Mobiles;
using Server.Items;
namespace Server.Mobiles
{
[CorpseName( "an axebeak corpse" )]
public class AxeBeak : BaseCreature
{
[Constructable]
public AxeBeak() : base( AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "an axebeak";
Body = 295;
BaseSoundID = 0x2EE;
SetStr( 96, 120 );
SetDex( 86, 110 );
SetInt( 51, 75 );
SetHits( 58, 72 );
SetDamage( 5, 7 );
SetSkill( SkillName.MagicResist, 20.1, 35.0 );
SetSkill( SkillName.Tactics, 70.1, 100.0 );
SetSkill( SkillName.HandToHand, 60.1, 90.0 );
Fame = 200;
Karma = 0;
VirtualArmor = 28;
}
public override int Meat{ get{ return 4; } }
public override MeatType MeatType{ get{ return MeatType.Bird; } }
public override int Feathers{ get{ return 50; } }
public override int Hides{ get{ return 5; } }
public AxeBeak(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,74 @@
using System;
using Server;
using Server.Misc;
namespace Server.Mobiles
{
[CorpseName( "a bird corpse" )]
public class Bird : BaseCreature
{
[Constructable]
public Bird() : base( AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
if ( Utility.RandomBool() )
{
Hue = 0x901;
switch ( Utility.Random( 3 ) )
{
case 0: Name = "a crow"; break;
case 2: Name = "a raven"; break;
case 1: Name = "a magpie"; break;
}
}
else
{
Hue = Utility.RandomBirdHue();
Name = NameList.RandomName( "bird" );
}
Body = 6;
BaseSoundID = 0x1B;
VirtualArmor = Utility.RandomMinMax( 0, 6 );
SetStr( 10 );
SetDex( 25, 35 );
SetInt( 10 );
SetDamage( 0 );
SetSkill( SkillName.HandToHand, 4.2, 6.4 );
SetSkill( SkillName.Tactics, 4.0, 6.0 );
SetSkill( SkillName.MagicResist, 4.0, 5.0 );
Fame = 0;
Karma = 0;
}
public override MeatType MeatType{ get{ return MeatType.Bird; } }
public override int Meat{ get{ return 1; } }
public override int Feathers{ get{ return 25; } }
public Bird( 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();
if ( Hue == 0 )
Hue = Utility.RandomBirdHue();
}
}
}

View file

@ -0,0 +1,58 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a chicken corpse" )]
public class Chicken : BaseCreature
{
[Constructable]
public Chicken() : base( AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a chicken";
Body = 208;
BaseSoundID = 0x6E;
SetStr( 5 );
SetDex( 15 );
SetInt( 5 );
SetHits( 3 );
SetMana( 0 );
SetDamage( 1 );
SetSkill( SkillName.MagicResist, 4.0 );
SetSkill( SkillName.Tactics, 5.0 );
SetSkill( SkillName.HandToHand, 5.0 );
Fame = 0;
Karma = 150;
VirtualArmor = 2;
}
public override int Meat{ get{ return 2; } }
public override MeatType MeatType{ get{ return MeatType.BigBird; } }
public override int Feathers{ get{ return 25; } }
public Chicken(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,58 @@
using System;
using Server.Items;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "an eagle corpse" )]
public class Eagle : BaseCreature
{
[Constructable]
public Eagle() : base( AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "an eagle";
Body = 5;
BaseSoundID = 0x2EE;
SetStr( 31, 47 );
SetDex( 36, 60 );
SetInt( 8, 20 );
SetHits( 20, 27 );
SetMana( 0 );
SetDamage( 5, 10 );
SetSkill( SkillName.MagicResist, 15.3, 30.0 );
SetSkill( SkillName.Tactics, 18.1, 37.0 );
SetSkill( SkillName.HandToHand, 20.1, 30.0 );
Fame = 300;
Karma = 0;
VirtualArmor = 22;
}
public override int Meat{ get{ return 1; } }
public override MeatType MeatType{ get{ return MeatType.Bird; } }
public override int Feathers{ get{ return 36; } }
public Eagle(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,58 @@
using System;
using System.Collections;
using Server;
using Server.Items;
namespace Server.Mobiles
{
[CorpseName( "a dead bird" )]
public class GiantHawk : BaseCreature
{
[Constructable]
public GiantHawk() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a giant hawk";
Body = 224;
BaseSoundID = 0x2EE;
Hue = 2708;
SetStr( 126, 155 );
SetDex( 81, 105 );
SetInt( 16, 40 );
SetHits( 76, 93 );
SetMana( 0 );
SetDamage( 8, 13 );
SetSkill( SkillName.MagicResist, 25.1, 40.0 );
SetSkill( SkillName.Tactics, 70.1, 100.0 );
SetSkill( SkillName.HandToHand, 45.1, 70.0 );
Fame = 1000;
Karma = -500;
VirtualArmor = 24;
}
public override int Meat { get { return 5; } }
public override MeatType MeatType{ get{ return MeatType.Bird; } }
public override int Feathers{ get{ return 50; } }
public GiantHawk( Serial serial ): base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)2 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View file

@ -0,0 +1,58 @@
using System;
using System.Collections;
using Server;
using Server.Items;
namespace Server.Mobiles
{
[CorpseName( "a dead bird" )]
public class GiantRaven : BaseCreature
{
[Constructable]
public GiantRaven() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a giant raven";
Body = 224;
Hue = 0x497;
BaseSoundID = 0x2EE;
SetStr( 126, 155 );
SetDex( 81, 105 );
SetInt( 16, 40 );
SetHits( 76, 93 );
SetMana( 0 );
SetDamage( 8, 13 );
SetSkill( SkillName.MagicResist, 25.1, 40.0 );
SetSkill( SkillName.Tactics, 70.1, 100.0 );
SetSkill( SkillName.HandToHand, 45.1, 70.0 );
Fame = 1000;
Karma = -500;
VirtualArmor = 24;
}
public override int Meat { get { return 5; } }
public override MeatType MeatType{ get{ return MeatType.Bird; } }
public override int Feathers{ get{ return 50; } }
public GiantRaven( Serial serial ): base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)2 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View file

@ -0,0 +1,65 @@
using System;
using Server;
using Server.Items;
namespace Server.Mobiles
{
[CorpseName( "a phoenix corpse" )]
public class Phoenix : BaseCreature
{
[Constructable]
public Phoenix() : base( AIType.AI_Mage, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a phoenix";
Body = 224;
Hue = 1184;
BaseSoundID = 0x8F;
SetStr( 504, 700 );
SetDex( 202, 300 );
SetInt( 504, 700 );
SetHits( 340, 383 );
SetDamage( 25 );
SetSkill( SkillName.Concentration, 90.2, 100.0 );
SetSkill( SkillName.Magery, 90.2, 100.0 );
SetSkill( SkillName.Meditation, 75.1, 100.0 );
SetSkill( SkillName.MagicResist, 86.0, 135.0 );
SetSkill( SkillName.Tactics, 80.1, 90.0 );
SetSkill( SkillName.HandToHand, 90.1, 100.0 );
Fame = 15000;
Karma = 0;
VirtualArmor = 60;
}
public override void GenerateLoot()
{
AddLoot( LootPack.FilthyRich );
AddLoot( LootPack.Rich );
}
public override int Meat{ get{ return 1; } }
public override MeatType MeatType{ get{ return MeatType.Bird; } }
public override int Feathers{ get{ return 36; } }
public Phoenix( 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,61 @@
using System;
using System.Collections;
using Server;
using Server.Items;
namespace Server.Mobiles
{
[CorpseName( "a dead bird" )]
public class Roc : BaseCreature
{
[Constructable]
public Roc() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a roc";
Body = 224;
BaseSoundID = 0x2EE;
SetStr( 1201, 1410 );
SetDex( 171, 270 );
SetInt( 301, 325 );
SetHits( 901, 1100 );
SetMana( 60 );
SetDamage( 20, 30 );
SetSkill( SkillName.MagicResist, 85.1, 100.0 );
SetSkill( SkillName.Tactics, 100.1, 110.0 );
SetSkill( SkillName.HandToHand, 100.1, 120.0 );
Fame = 18000;
Karma = -18000;
}
public override void GenerateLoot()
{
AddLoot( LootPack.FilthyRich, 3 );
AddLoot( LootPack.Gems, 4 );
}
public override int Meat { get { return 5; } }
public override MeatType MeatType{ get{ return MeatType.Bird; } }
public override int Feathers{ get{ return 100; } }
public Roc( Serial serial ): base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)2 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View file

@ -0,0 +1,58 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a turkey corpse" )]
public class Turkey : BaseCreature
{
[Constructable]
public Turkey() : base( AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a turkey";
Body = 306;
BaseSoundID = 0x6E;
SetStr( 15 );
SetDex( 15 );
SetInt( 5 );
SetHits( 15 );
SetMana( 0 );
SetDamage( 3 );
SetSkill( SkillName.MagicResist, 5.0 );
SetSkill( SkillName.Tactics, 15.0 );
SetSkill( SkillName.HandToHand, 15.0 );
Fame = 200;
Karma = 0;
VirtualArmor = 5;
}
public override int Meat{ get{ return 5; } }
public override MeatType MeatType{ get{ return MeatType.BigBird; } }
public override int Feathers{ get{ return 35; } }
public Turkey(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,56 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a pig corpse" )]
public class Boar : BaseCreature
{
[Constructable]
public Boar() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a boar";
Body = 290;
BaseSoundID = 0xC4;
SetStr( 25 );
SetDex( 15 );
SetInt( 5 );
SetHits( 15 );
SetMana( 0 );
SetDamage( 3, 6 );
SetSkill( SkillName.MagicResist, 9.0 );
SetSkill( SkillName.Tactics, 9.0 );
SetSkill( SkillName.HandToHand, 9.0 );
Fame = 300;
Karma = 0;
VirtualArmor = 10;
}
public override int Meat{ get{ return 2; } }
public override MeatType MeatType{ get{ return MeatType.Ham; } }
public Boar(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,58 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a dire wolf corpse" )]
[TypeAlias( "Server.Mobiles.Direwolf" )]
public class DireWolf : BaseCreature
{
[Constructable]
public DireWolf() : base( AIType.AI_Melee,FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a dire wolf";
Body = 225;
Hue = 2305;
BaseSoundID = 0xE5;
SetStr( 96, 120 );
SetDex( 81, 105 );
SetInt( 36, 60 );
SetHits( 58, 72 );
SetMana( 0 );
SetDamage( 11, 17 );
SetSkill( SkillName.MagicResist, 57.6, 75.0 );
SetSkill( SkillName.Tactics, 50.1, 70.0 );
SetSkill( SkillName.HandToHand, 60.1, 80.0 );
Fame = 2500;
Karma = -2500;
VirtualArmor = 22;
}
public override int Meat{ get{ return 1; } }
public override int Hides{ get{ return 7; } }
public DireWolf(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,56 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a dog corpse" )]
public class Dog : BaseCreature
{
[Constructable]
public Dog() : base( AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a dog";
Body = 217;
Hue = Utility.RandomAnimalHue();
BaseSoundID = 0x85;
SetStr( 27, 37 );
SetDex( 28, 43 );
SetInt( 29, 37 );
SetHits( 17, 22 );
SetMana( 0 );
SetDamage( 4, 7 );
SetSkill( SkillName.MagicResist, 22.1, 47.0 );
SetSkill( SkillName.Tactics, 19.2, 31.0 );
SetSkill( SkillName.HandToHand, 19.2, 31.0 );
Fame = 0;
Karma = 300;
VirtualArmor = 12;
}
public override int Meat{ get{ return 1; } }
public Dog(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,58 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a grey wolf corpse" )]
[TypeAlias( "Server.Mobiles.Greywolf" )]
public class GreyWolf : BaseCreature
{
[Constructable]
public GreyWolf() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a grey wolf";
Body = 225;
Hue = Utility.RandomList( 946, 947 );
BaseSoundID = 0xE5;
SetStr( 56, 80 );
SetDex( 56, 75 );
SetInt( 31, 55 );
SetHits( 34, 48 );
SetMana( 0 );
SetDamage( 3, 7 );
SetSkill( SkillName.MagicResist, 20.1, 35.0 );
SetSkill( SkillName.Tactics, 45.1, 60.0 );
SetSkill( SkillName.HandToHand, 45.1, 60.0 );
Fame = 450;
Karma = 0;
VirtualArmor = 16;
}
public override int Meat{ get{ return 1; } }
public override int Hides{ get{ return 6; } }
public GreyWolf(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,57 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a timber wolf corpse" )]
[TypeAlias( "Server.Mobiles.Timberwolf" )]
public class TimberWolf : BaseCreature
{
[Constructable]
public TimberWolf() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a timber wolf";
Body = 225;
BaseSoundID = 0xE5;
SetStr( 56, 80 );
SetDex( 56, 75 );
SetInt( 11, 25 );
SetHits( 34, 48 );
SetMana( 0 );
SetDamage( 5, 9 );
SetSkill( SkillName.MagicResist, 27.6, 45.0 );
SetSkill( SkillName.Tactics, 30.1, 50.0 );
SetSkill( SkillName.HandToHand, 40.1, 60.0 );
Fame = 450;
Karma = 0;
VirtualArmor = 16;
}
public override int Meat{ get{ return 1; } }
public override int Hides{ get{ return 5; } }
public TimberWolf(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,54 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a wolf corpse" )]
public class Werewolf : BaseCreature
{
[Constructable]
public Werewolf() : base( AIType.AI_Animal, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a werewolf";
Body = Utility.RandomList( 293, 252 );
BaseSoundID = 0x575;
SetStr( 126, 155 );
SetDex( 81, 105 );
SetInt( 16, 40 );
SetHits( 96, 133 );
SetMana( 0 );
SetDamage( 10, 15 );
SetSkill( SkillName.MagicResist, 25.1, 40.0 );
SetSkill( SkillName.Tactics, 80.1, 110.0 );
SetSkill( SkillName.HandToHand, 65.1, 90.0 );
Fame = 1500;
Karma = -1500;
VirtualArmor = 24;
}
public override int Meat{ get{ return 3; } }
public override int Hides{ get{ return 18; } }
public Werewolf( 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,60 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a white wolf corpse" )]
[TypeAlias( "Server.Mobiles.Whitewolf" )]
public class WhiteWolf : BaseCreature
{
[Constructable]
public WhiteWolf() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a white wolf";
Body = 225;
Hue = Utility.RandomList( 2301, 1154 );
BaseSoundID = 0xE5;
SetStr( 56, 80 );
SetDex( 56, 75 );
SetInt( 31, 55 );
SetHits( 34, 48 );
SetMana( 0 );
SetDamage( 3, 7 );
SetSkill( SkillName.MagicResist, 20.1, 35.0 );
SetSkill( SkillName.Tactics, 45.1, 60.0 );
SetSkill( SkillName.HandToHand, 45.1, 60.0 );
Fame = 450;
Karma = 0;
VirtualArmor = 16;
}
public override int Meat{ get{ return 1; } }
public override int Hides{ get{ return 6; } }
public WhiteWolf( 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,59 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a bull corpse" )]
public class Bull : BaseCreature
{
[Constructable]
public Bull() : base( AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a bull";
Body = Utility.RandomList( 232, 233 );
BaseSoundID = 0x64;
if ( 0.5 >= Utility.RandomDouble() )
Hue = 0x901;
SetStr( 77, 111 );
SetDex( 56, 75 );
SetInt( 47, 75 );
SetHits( 50, 64 );
SetMana( 0 );
SetDamage( 4, 9 );
SetSkill( SkillName.MagicResist, 17.6, 25.0 );
SetSkill( SkillName.Tactics, 67.6, 85.0 );
SetSkill( SkillName.HandToHand, 40.1, 57.5 );
Fame = 0;
Karma = 600;
VirtualArmor = 28;
}
public override int Meat{ get{ return 10; } }
public override int Hides{ get{ return 15; } }
public Bull(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,127 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a cow corpse" )]
public class Cow : BaseCreature
{
private DateTime m_MilkedOn;
[CommandProperty( AccessLevel.GameMaster )]
public DateTime MilkedOn
{
get { return m_MilkedOn; }
set { m_MilkedOn = value; }
}
private int m_Milk;
[CommandProperty( AccessLevel.GameMaster )]
public int Milk
{
get { return m_Milk; }
set { m_Milk = value; }
}
[Constructable]
public Cow() : base( AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a cow";
Body = Utility.RandomList( 216, 231 );
BaseSoundID = 0x78;
SetStr( 30 );
SetDex( 15 );
SetInt( 5 );
SetHits( 18 );
SetMana( 0 );
SetDamage( 1, 4 );
SetDamage( 1, 4 );
SetSkill( SkillName.MagicResist, 5.5 );
SetSkill( SkillName.Tactics, 5.5 );
SetSkill( SkillName.HandToHand, 5.5 );
Fame = 0;
Karma = 300;
VirtualArmor = 10;
}
public override int Meat{ get{ return 8; } }
public override int Hides{ get{ return 12; } }
public override void OnDoubleClick( Mobile from )
{
base.OnDoubleClick( from );
int random = Utility.Random( 100 );
if ( random < 5 )
Tip();
else if ( random < 20 )
PlaySound( 120 );
else if ( random < 40 )
PlaySound( 121 );
}
public void Tip()
{
PlaySound( 121 );
Animate( 8, 0, 3, true, false, 0 );
}
public bool TryMilk( Mobile from )
{
if ( !from.InLOS( this ) || !from.InRange( Location, 2 ) )
from.SendLocalizedMessage( 1080400 ); // You can not milk the cow from this location.
if ( Controlled && ControlMaster != from )
from.SendLocalizedMessage( 1071182 ); // The cow nimbly escapes your attempts to milk it.
if ( m_Milk == 0 && m_MilkedOn + TimeSpan.FromDays( 1 ) > DateTime.Now )
from.SendLocalizedMessage( 1080198 ); // This cow can not be milked now. Please wait for some time.
else
{
if ( m_Milk == 0 )
m_Milk = 4;
m_MilkedOn = DateTime.Now;
m_Milk--;
return true;
}
return false;
}
public Cow( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 1 );
writer.Write( (DateTime) m_MilkedOn );
writer.Write( (int) m_Milk );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
if ( version > 0 )
{
m_MilkedOn = reader.ReadDateTime();
m_Milk = reader.ReadInt();
}
}
}
}

View file

@ -0,0 +1,70 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a deer corpse" )]
public class Deer : BaseCreature
{
[Constructable]
public Deer() : base( AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a deer";
Body = 237;
SetStr( 21, 51 );
SetDex( 47, 77 );
SetInt( 17, 47 );
SetHits( 15, 29 );
SetMana( 0 );
SetDamage( 4 );
SetSkill( SkillName.MagicResist, 15.0 );
SetSkill( SkillName.Tactics, 19.0 );
SetSkill( SkillName.HandToHand, 26.0 );
Fame = 300;
Karma = 0;
VirtualArmor = 8;
}
public override int Meat{ get{ return 5; } }
public override int Hides{ get{ return 8; } }
public Deer(Serial serial) : base(serial)
{
}
public override int GetAttackSound()
{
return 0x82;
}
public override int GetHurtSound()
{
return 0x83;
}
public override int GetDeathSound()
{
return 0x84;
}
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,57 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a cat corpse" )]
[TypeAlias( "Server.Mobiles.Housecat" )]
public class Cat : BaseCreature
{
[Constructable]
public Cat() : base( AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a cat";
Body = 201;
Hue = Utility.RandomAnimalHue();
BaseSoundID = 0x69;
SetStr( 9 );
SetDex( 35 );
SetInt( 5 );
SetHits( 6 );
SetMana( 0 );
SetDamage( 1 );
SetSkill( SkillName.MagicResist, 5.0 );
SetSkill( SkillName.Tactics, 4.0 );
SetSkill( SkillName.HandToHand, 5.0 );
Fame = 0;
Karma = 150;
VirtualArmor = 8;
}
public override int Meat{ get{ return 1; } }
public Cat(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,56 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a cougar corpse" )]
public class Cougar : BaseCreature
{
[Constructable]
public Cougar() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a cougar";
Body = 214;
BaseSoundID = 0x73;
SetStr( 56, 80 );
SetDex( 66, 85 );
SetInt( 26, 50 );
SetHits( 34, 48 );
SetMana( 0 );
SetDamage( 4, 10 );
SetSkill( SkillName.MagicResist, 15.1, 30.0 );
SetSkill( SkillName.Tactics, 45.1, 60.0 );
SetSkill( SkillName.HandToHand, 45.1, 60.0 );
Fame = 450;
Karma = 0;
VirtualArmor = 16;
}
public override int Meat{ get{ return 1; } }
public override int Hides{ get{ return 10; } }
public Cougar(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,56 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a lion corpse" )]
public class Lion : BaseCreature
{
[Constructable]
public Lion() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a lion";
Body = 236;
BaseSoundID = 0x0B2;
SetStr( 126, 155 );
SetDex( 81, 105 );
SetInt( 16, 40 );
SetHits( 76, 93 );
SetMana( 0 );
SetDamage( 8, 13 );
SetSkill( SkillName.MagicResist, 25.1, 40.0 );
SetSkill( SkillName.Tactics, 70.1, 100.0 );
SetSkill( SkillName.HandToHand, 45.1, 70.0 );
Fame = 1000;
Karma = 0;
VirtualArmor = 24;
}
public override int Meat{ get{ return 2; } }
public override int Hides{ get{ return 14; } }
public Lion(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,57 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a panther corpse" )]
public class Panther : BaseCreature
{
[Constructable]
public Panther() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a panther";
Body = 214;
Hue = 0x901;
BaseSoundID = 0x462;
SetStr( 61, 85 );
SetDex( 86, 105 );
SetInt( 26, 50 );
SetHits( 37, 51 );
SetMana( 0 );
SetDamage( 4, 12 );
SetSkill( SkillName.MagicResist, 15.1, 30.0 );
SetSkill( SkillName.Tactics, 50.1, 65.0 );
SetSkill( SkillName.HandToHand, 50.1, 65.0 );
Fame = 450;
Karma = 0;
VirtualArmor = 16;
}
public override int Meat{ get{ return 1; } }
public override int Hides{ get{ return 10; } }
public Panther(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,58 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a leopard corpse" )]
[TypeAlias( "Server.Mobiles.Snowleopard" )]
public class SnowLeopard : BaseCreature
{
[Constructable]
public SnowLeopard() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a snow leopard";
Body = 214;
Hue = 2301;
BaseSoundID = 0x73;
SetStr( 56, 80 );
SetDex( 66, 85 );
SetInt( 26, 50 );
SetHits( 34, 48 );
SetMana( 0 );
SetDamage( 3, 9 );
SetSkill( SkillName.MagicResist, 25.1, 35.0 );
SetSkill( SkillName.Tactics, 45.1, 60.0 );
SetSkill( SkillName.HandToHand, 40.1, 50.0 );
Fame = 450;
Karma = 0;
VirtualArmor = 24;
}
public override int Meat{ get{ return 1; } }
public override int Hides{ get{ return 8; } }
public SnowLeopard(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,56 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a tiger corpse" )]
public class Tiger : BaseCreature
{
[Constructable]
public Tiger() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a tiger";
Body = 327;
BaseSoundID = 0x0B2;
SetStr( 126, 155 );
SetDex( 81, 105 );
SetInt( 16, 40 );
SetHits( 76, 93 );
SetMana( 0 );
SetDamage( 8, 13 );
SetSkill( SkillName.MagicResist, 25.1, 40.0 );
SetSkill( SkillName.Tactics, 70.1, 100.0 );
SetSkill( SkillName.HandToHand, 45.1, 70.0 );
Fame = 1000;
Karma = 0;
VirtualArmor = 24;
}
public override int Meat{ get{ return 2; } }
public override int Hides{ get{ return 14; } }
public Tiger(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,57 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a goat corpse" )]
public class Goat : BaseCreature
{
[Constructable]
public Goat() : base( AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a goat";
Body = 209;
BaseSoundID = 0x99;
SetStr( 19 );
SetDex( 15 );
SetInt( 5 );
SetHits( 12 );
SetMana( 0 );
SetDamage( 3, 4 );
SetSkill( SkillName.MagicResist, 5.0 );
SetSkill( SkillName.Tactics, 5.0 );
SetSkill( SkillName.HandToHand, 5.0 );
Fame = 0;
Karma = 300;
VirtualArmor = 10;
}
public override int Meat{ get{ return 2; } }
public override MeatType MeatType{ get{ return MeatType.Lamb; } }
public override int Hides{ get{ return 8; } }
public Goat(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,56 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a gorilla corpse" )]
public class Gorilla : BaseCreature
{
[Constructable]
public Gorilla() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a gorilla";
Body = 29;
BaseSoundID = 0x9E;
SetStr( 53, 95 );
SetDex( 36, 55 );
SetInt( 36, 60 );
SetHits( 38, 51 );
SetMana( 0 );
SetDamage( 4, 10 );
SetSkill( SkillName.MagicResist, 45.1, 60.0 );
SetSkill( SkillName.Tactics, 43.3, 58.0 );
SetSkill( SkillName.HandToHand, 43.3, 58.0 );
Fame = 450;
Karma = 0;
VirtualArmor = 20;
}
public override int Meat{ get{ return 1; } }
public override int Hides{ get{ return 6; } }
public Gorilla(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,71 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a deer corpse" )]
[TypeAlias( "Server.Mobiles.GreatDeer" )]
public class GreatDeer : BaseCreature
{
[Constructable]
public GreatDeer() : base( AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a deer";
Body = 234;
SetStr( 41, 71 );
SetDex( 47, 77 );
SetInt( 27, 57 );
SetHits( 27, 41 );
SetMana( 0 );
SetDamage( 5, 9 );
SetSkill( SkillName.MagicResist, 26.8, 44.5 );
SetSkill( SkillName.Tactics, 29.8, 47.5 );
SetSkill( SkillName.HandToHand, 29.8, 47.5 );
Fame = 300;
Karma = 0;
VirtualArmor = 24;
}
public override int Meat{ get{ return 6; } }
public override int Hides{ get{ return 15; } }
public GreatDeer(Serial serial) : base(serial)
{
}
public override int GetAttackSound()
{
return 0x82;
}
public override int GetHurtSound()
{
return 0x83;
}
public override int GetDeathSound()
{
return 0x84;
}
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,57 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a mountain goat corpse" )]
public class MountainGoat : BaseCreature
{
[Constructable]
public MountainGoat() : base( AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a mountain goat";
Body = 289;
BaseSoundID = 0x99;
SetStr( 22, 64 );
SetDex( 56, 75 );
SetInt( 16, 30 );
SetHits( 20, 33 );
SetMana( 0 );
SetDamage( 3, 7 );
SetSkill( SkillName.MagicResist, 25.1, 30.0 );
SetSkill( SkillName.Tactics, 29.3, 44.0 );
SetSkill( SkillName.HandToHand, 29.3, 44.0 );
Fame = 300;
Karma = 0;
VirtualArmor = 10;
}
public override int Meat{ get{ return 3; } }
public override MeatType MeatType{ get{ return MeatType.Lamb; } }
public override int Hides{ get{ return 12; } }
public MountainGoat(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,462 @@
using System;
using System.Collections;
using Server;
using Server.Regions;
namespace Server.Mobiles
{
public abstract class BaseMount : BaseCreature, IMount
{
private Mobile m_Rider;
private Item m_InternalItem;
private DateTime m_NextMountAbility;
public virtual TimeSpan MountAbilityDelay { get { return TimeSpan.Zero; } }
[CommandProperty( AccessLevel.GameMaster )]
public DateTime NextMountAbility
{
get { return m_NextMountAbility; }
set { m_NextMountAbility = value; }
}
protected Item InternalItem { get { return m_InternalItem; } }
public virtual bool AllowMaleRider{ get{ return true; } }
public virtual bool AllowFemaleRider{ get{ return true; } }
public BaseMount( string name, int bodyID, int itemID, AIType aiType, FightMode fightMode, int rangePerception, int rangeFight, double activeSpeed, double passiveSpeed ) : base ( aiType, fightMode, rangePerception, rangeFight, activeSpeed, passiveSpeed )
{
Name = name;
Body = bodyID;
m_InternalItem = new MountItem( this, itemID );
}
public BaseMount( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 1 ); // version
writer.Write( m_NextMountAbility );
writer.Write( m_Rider );
writer.Write( m_InternalItem );
}
[Hue, CommandProperty( AccessLevel.GameMaster )]
public override int Hue
{
get
{
return base.Hue;
}
set
{
base.Hue = value;
if ( m_InternalItem != null )
m_InternalItem.Hue = value;
}
}
public override bool OnBeforeDeath()
{
Rider = null;
return base.OnBeforeDeath();
}
public override void OnAfterDelete()
{
if ( m_InternalItem != null )
m_InternalItem.Delete();
m_InternalItem = null;
base.OnAfterDelete();
}
public override void OnDelete()
{
Rider = null;
base.OnDelete();
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 1:
{
m_NextMountAbility = reader.ReadDateTime();
goto case 0;
}
case 0:
{
m_Rider = reader.ReadMobile();
m_InternalItem = reader.ReadItem();
if ( m_InternalItem == null )
Delete();
break;
}
}
}
public virtual void OnDisallowedRider( Mobile m )
{
m.SendMessage( "You may not ride this creature." );
}
public override void OnDoubleClick( Mobile from )
{
if ( IsDeadPet )
return;
Region reg = from.Region;
if ( reg.NoMounts( from, from.Location ) )
{
from.SendMessage( "You cannot mount that in here!" );
return;
}
if ( from.IsBodyMod && !from.Body.IsHuman )
{
from.SendLocalizedMessage( 1061628 ); // You can't do that while polymorphed.
return;
}
if ( !CheckMountAllowed( from, true ) )
return;
if ( from.Mounted )
{
from.SendLocalizedMessage( 1005583 ); // Please dismount first.
return;
}
if ( from.Female ? !AllowFemaleRider : !AllowMaleRider )
{
OnDisallowedRider( from );
return;
}
if ( !Multis.DesignContext.Check( from ) )
return;
if ( from.HasTrade )
{
from.SendLocalizedMessage( 1042317, "", 0x41 ); // You may not ride at this time
return;
}
if ( from.InRange( this, 1 ) )
{
bool canAccess = ( from.AccessLevel >= AccessLevel.GameMaster )
|| ( Controlled && ControlMaster == from )
|| ( Summoned && SummonMaster == from );
if ( canAccess )
{
if ( this.Poisoned )
PrivateOverheadMessage( Network.MessageType.Regular, 0x3B2, 1049692, from.NetState ); // This mount is too ill to ride.
else
Rider = from;
}
else if ( !Controlled && !Summoned )
{
// That mount does not look broken! You would have to tame it to ride it.
PrivateOverheadMessage( Network.MessageType.Regular, 0x3B2, 501263, from.NetState );
}
else
{
// This isn't your mount; it refuses to let you ride.
PrivateOverheadMessage( Network.MessageType.Regular, 0x3B2, 501264, from.NetState );
}
}
else
{
from.SendLocalizedMessage( 500206 ); // That is too far away to ride.
}
}
[CommandProperty( AccessLevel.GameMaster )]
public int ItemID
{
get
{
if ( m_InternalItem != null )
return m_InternalItem.ItemID;
else
return 0;
}
set
{
if ( m_InternalItem != null )
m_InternalItem.ItemID = value;
}
}
public static void Dismount( Mobile m )
{
IMount mount = m.Mount;
if ( mount != null )
mount.Rider = null;
}
[CommandProperty( AccessLevel.GameMaster )]
public Mobile Rider
{
get
{
return m_Rider;
}
set
{
if ( m_Rider != value )
{
if ( value == null )
{
Point3D loc = m_Rider.Location;
Map map = m_Rider.Map;
if ( map == null || map == Map.Internal )
{
loc = m_Rider.LogoutLocation;
map = m_Rider.LogoutMap;
}
Direction = m_Rider.Direction;
Location = loc;
Map = map;
if ( m_InternalItem != null )
m_InternalItem.Internalize();
}
else
{
if ( m_Rider != null )
Dismount( m_Rider );
Dismount( value );
if ( m_InternalItem != null )
value.AddItem( m_InternalItem );
value.Direction = this.Direction;
Internalize();
}
m_Rider = value;
}
}
}
private class BlockEntry
{
public BlockMountType m_Type;
public DateTime m_Expiration;
public bool IsExpired{ get{ return ( DateTime.Now >= m_Expiration ); } }
public BlockEntry( BlockMountType type, DateTime expiration )
{
m_Type = type;
m_Expiration = expiration;
}
}
private static Hashtable m_Table = new Hashtable();
public static void SetMountPrevention( Mobile mob, BlockMountType type, TimeSpan duration )
{
if ( mob == null )
return;
DateTime expiration = DateTime.Now + duration;
BlockEntry entry = m_Table[mob] as BlockEntry;
if ( entry != null )
{
entry.m_Type = type;
entry.m_Expiration = expiration;
}
else
{
m_Table[mob] = entry = new BlockEntry( type, expiration );
}
}
public static void ClearMountPrevention( Mobile mob )
{
if ( mob != null )
m_Table.Remove( mob );
}
public static BlockMountType GetMountPrevention( Mobile mob )
{
if ( mob == null )
return BlockMountType.None;
BlockEntry entry = m_Table[mob] as BlockEntry;
if ( entry == null )
return BlockMountType.None;
if ( entry.IsExpired )
{
m_Table.Remove( mob );
return BlockMountType.None;
}
return entry.m_Type;
}
public static bool CheckMountAllowed( Mobile mob, bool message )
{
BlockMountType type = GetMountPrevention( mob );
if ( type == BlockMountType.None )
return true;
if ( message )
{
switch ( type )
{
case BlockMountType.Dazed:
{
mob.SendLocalizedMessage( 1040024 ); // You are still too dazed from being knocked off your mount to ride!
break;
}
case BlockMountType.DismountRecovery:
{
mob.SendLocalizedMessage( 1070859 ); // You cannot mount while recovering from a dismount special maneuver.
break;
}
}
}
return false;
}
public virtual void OnRiderDamaged( int amount, Mobile from, bool willKill )
{
if( m_Rider == null )
return;
Mobile attacker = from;
if( attacker == null )
attacker = m_Rider.FindMostRecentDamager( true );
if( !(attacker == this || attacker == m_Rider || willKill || DateTime.Now < m_NextMountAbility) )
{
if( DoMountAbility( amount, from ) )
m_NextMountAbility = DateTime.Now + MountAbilityDelay;
}
}
public virtual bool DoMountAbility( int damage, Mobile attacker )
{
return false;
}
}
public class MountItem : Item, IMountItem
{
private BaseMount m_Mount;
public override double DefaultWeight { get { return 0; } }
public MountItem( BaseMount mount, int itemID ) : base( itemID )
{
Layer = Layer.Mount;
Movable = false;
m_Mount = mount;
}
public MountItem( Serial serial ) : base( serial )
{
}
public override void OnAfterDelete()
{
if ( m_Mount != null )
m_Mount.Delete();
m_Mount = null;
base.OnAfterDelete();
}
public override DeathMoveResult OnParentDeath(Mobile parent)
{
if ( m_Mount != null )
m_Mount.Rider = null;
return DeathMoveResult.RemainEquiped;
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( m_Mount );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
m_Mount = reader.ReadMobile() as BaseMount;
if ( m_Mount == null )
Delete();
break;
}
}
}
public IMount Mount
{
get
{
return m_Mount;
}
}
}
public enum BlockMountType
{
None = -1,
Dazed,
DismountRecovery
}
}

View file

@ -0,0 +1,72 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a horse corpse" )]
[TypeAlias( "Server.Mobiles.BrownHorse", "Server.Mobiles.DirtyHorse", "Server.Mobiles.GrayHorse", "Server.Mobiles.TanHorse" )]
public class Horse : BaseMount
{
private static int[] m_IDs = new int[]
{
0xC8, 0x3E9F,
0xE2, 0x3EA0,
0xE4, 0x3EA1,
0xCC, 0x3EA2
};
[Constructable]
public Horse() : this( "a horse" )
{
}
[Constructable]
public Horse( string name ) : base( name, 0xE2, 0x3EA0, AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
int random = Utility.Random( 4 );
Body = m_IDs[random * 2];
ItemID = m_IDs[random * 2 + 1];
BaseSoundID = 0xA8;
Invulnerable = true;
SetStr( 22, 98 );
SetDex( 56, 75 );
SetInt( 6, 10 );
SetHits( 28, 45 );
SetMana( 0 );
SetDamage( 3, 4 );
SetSkill( SkillName.MagicResist, 25.1, 30.0 );
SetSkill( SkillName.Tactics, 29.3, 44.0 );
SetSkill( SkillName.HandToHand, 29.3, 44.0 );
Fame = 0;
Karma = 400;
ControlSlots = 2;
}
public override int Meat{ get{ return 3; } }
public override int Hides{ get{ return 10; } }
public Horse( 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,60 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a llama corpse" )]
public class Llama : BaseMount
{
[Constructable]
public Llama() : this( "a llama" )
{
}
[Constructable]
public Llama( string name ) : base( name, 0xDC, 0x3EA6, AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Invulnerable = true;
BaseSoundID = 0x3F3;
SetStr( 21, 49 );
SetDex( 56, 75 );
SetInt( 16, 30 );
SetHits( 15, 27 );
SetMana( 0 );
SetDamage( 3, 5 );
SetSkill( SkillName.MagicResist, 15.1, 20.0 );
SetSkill( SkillName.Tactics, 19.2, 29.0 );
SetSkill( SkillName.HandToHand, 19.2, 29.0 );
Fame = 0;
Karma = 200;
ControlSlots = 2;
}
public override int Meat{ get{ return 1; } }
public override int Hides{ get{ return 12; } }
public Llama( 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,202 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Mobiles;
using Server.Items;
using Server.ContextMenus;
namespace Server.Mobiles
{
[CorpseName( "a horse corpse" )]
public class PackHorse : BaseCreature
{
[Constructable]
public PackHorse() : base( AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a pack horse";
Body = 291;
BaseSoundID = 0xA8;
Invulnerable = true;
SetStr( 44, 120 );
SetDex( 36, 55 );
SetInt( 6, 10 );
SetHits( 61, 80 );
SetStam( 81, 100 );
SetMana( 0 );
SetDamage( 5, 11 );
SetSkill( SkillName.MagicResist, 25.1, 30.0 );
SetSkill( SkillName.Tactics, 29.3, 44.0 );
SetSkill( SkillName.HandToHand, 29.3, 44.0 );
Fame = 0;
Karma = 400;
VirtualArmor = 16;
ControlSlots = 2;
Container pack = Backpack;
if ( pack != null )
pack.Delete();
pack = new StrongBackpack();
pack.Movable = false;
AddItem( pack );
}
public override int Meat{ get{ return 3; } }
public override int Hides{ get{ return 10; } }
public PackHorse( Serial serial ) : base( serial )
{
}
#region Pack Animal Methods
public override bool OnBeforeDeath()
{
if ( !base.OnBeforeDeath() )
return false;
PackAnimal.CombineBackpacks( this );
return true;
}
public override DeathMoveResult GetInventoryMoveResultFor( Item item )
{
return DeathMoveResult.MoveToCorpse;
}
public override bool IsSnoop( Mobile from )
{
if ( PackAnimal.CheckAccess( this, from ) )
return false;
return base.IsSnoop( from );
}
public override bool OnDragDrop( Mobile from, Item item )
{
if ( PackAnimal.CheckAccess( this, from ) )
{
AddToBackpack( item );
return true;
}
return base.OnDragDrop( from, item );
}
public override bool CheckNonlocalDrop( Mobile from, Item item, Item target )
{
return PackAnimal.CheckAccess( this, from );
}
public override bool CheckNonlocalLift( Mobile from, Item item )
{
return PackAnimal.CheckAccess( this, from );
}
public override void OnDoubleClick( Mobile from )
{
PackAnimal.TryPackOpen( this, from );
}
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
{
base.GetContextMenuEntries( from, list );
PackAnimal.GetContextMenuEntries( this, from, list );
}
#endregion
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();
}
}
public class PackAnimalBackpackEntry : ContextMenuEntry
{
private BaseCreature m_Animal;
private Mobile m_From;
public PackAnimalBackpackEntry( BaseCreature animal, Mobile from ) : base( 6145, 3 )
{
m_Animal = animal;
m_From = from;
if ( animal.IsDeadPet )
Enabled = false;
}
public override void OnClick()
{
PackAnimal.TryPackOpen( m_Animal, m_From );
}
}
public class PackAnimal
{
public static void GetContextMenuEntries( BaseCreature animal, Mobile from, List<ContextMenuEntry> list )
{
if ( CheckAccess( animal, from ) )
list.Add( new PackAnimalBackpackEntry( animal, from ) );
}
public static bool CheckAccess( BaseCreature animal, Mobile from )
{
if ( from == animal || from.AccessLevel >= AccessLevel.GameMaster )
return true;
if ( from.Alive && animal.Controlled && !animal.IsDeadPet && (from == animal.ControlMaster || from == animal.SummonMaster) )
return true;
return false;
}
public static void CombineBackpacks( BaseCreature animal )
{
Container pack = animal.Backpack;
if ( pack != null )
{
Container newPack = new Backpack();
for ( int i = pack.Items.Count - 1; i >= 0; --i )
{
if ( i >= pack.Items.Count )
continue;
newPack.DropItem( pack.Items[i] );
}
pack.DropItem( newPack );
}
}
public static void TryPackOpen( BaseCreature animal, Mobile from )
{
if ( animal.IsDeadPet )
return;
Container item = animal.Backpack;
if ( item != null )
from.Use( item );
}
}
}

View file

@ -0,0 +1,129 @@
using System;
using System.Collections.Generic;
using Server.Mobiles;
using Server.Items;
using Server.ContextMenus;
namespace Server.Mobiles
{
[CorpseName("a llama corpse")]
public class PackLlama : BaseCreature
{
[Constructable]
public PackLlama() : base( AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a pack llama";
Body = 292;
BaseSoundID = 0x3F3;
Invulnerable = true;
SetStr( 52, 80 );
SetDex( 36, 55 );
SetInt( 16, 30 );
SetHits( 50 );
SetStam( 86, 105 );
SetMana( 0 );
SetDamage( 2, 6 );
SetSkill( SkillName.MagicResist, 15.1, 20.0 );
SetSkill( SkillName.Tactics, 19.2, 29.0 );
SetSkill( SkillName.HandToHand, 19.2, 29.0 );
Fame = 0;
Karma = 200;
ControlSlots = 2;
VirtualArmor = 16;
Container pack = Backpack;
if ( pack != null )
pack.Delete();
pack = new StrongBackpack();
pack.Movable = false;
AddItem( pack );
}
public override int Meat{ get{ return 1; } }
public PackLlama( Serial serial ) : base( serial )
{
}
#region Pack Animal Methods
public override bool OnBeforeDeath()
{
if ( !base.OnBeforeDeath() )
return false;
PackAnimal.CombineBackpacks( this );
return true;
}
public override DeathMoveResult GetInventoryMoveResultFor( Item item )
{
return DeathMoveResult.MoveToCorpse;
}
public override bool IsSnoop( Mobile from )
{
if ( PackAnimal.CheckAccess( this, from ) )
return false;
return base.IsSnoop( from );
}
public override bool OnDragDrop( Mobile from, Item item )
{
if ( PackAnimal.CheckAccess( this, from ) )
{
AddToBackpack( item );
return true;
}
return base.OnDragDrop( from, item );
}
public override bool CheckNonlocalDrop( Mobile from, Item item, Item target )
{
return PackAnimal.CheckAccess( this, from );
}
public override bool CheckNonlocalLift( Mobile from, Item item )
{
return PackAnimal.CheckAccess( this, from );
}
public override void OnDoubleClick( Mobile from )
{
PackAnimal.TryPackOpen( this, from );
}
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
{
base.GetContextMenuEntries( from, list );
PackAnimal.GetContextMenuEntries( this, from, list );
}
#endregion
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,56 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a pig corpse" )]
public class Pig : BaseCreature
{
[Constructable]
public Pig() : base( AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a pig";
Body = 203;
BaseSoundID = 0xC4;
SetStr( 20 );
SetDex( 20 );
SetInt( 5 );
SetHits( 12 );
SetMana( 0 );
SetDamage( 2, 4 );
SetSkill( SkillName.MagicResist, 5.0 );
SetSkill( SkillName.Tactics, 5.0 );
SetSkill( SkillName.HandToHand, 5.0 );
Fame = 0;
Karma = 150;
VirtualArmor = 12;
}
public override int Meat{ get{ return 1; } }
public override MeatType MeatType{ get{ return MeatType.Ham; } }
public Pig(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,61 @@
using System;
using Server;
using Server.Items;
namespace Server.Mobiles
{
[CorpseName( "a bat corpse" )]
public class Bat : BaseCreature
{
[Constructable]
public Bat() : base( AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a bat";
Body = 43;
BaseSoundID = 0x270;
SetStr( 91, 110 );
SetDex( 91, 115 );
SetInt( 26, 50 );
SetHits( 55, 66 );
SetDamage( 7, 9 );
SetSkill( SkillName.MagicResist, 70.1, 95.0 );
SetSkill( SkillName.Tactics, 55.1, 80.0 );
SetSkill( SkillName.HandToHand, 30.1, 55.0 );
Fame = 1000;
Karma = -1000;
VirtualArmor = 14;
}
public override void GenerateLoot()
{
AddLoot( LootPack.Poor );
}
public override int GetIdleSound()
{
return 0x29B;
}
public Bat( 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,80 @@
using System;
using Server;
using Server.Items;
namespace Server.Mobiles
{
[CorpseName( "a bat corpse" )]
public class CaveBat : BaseCreature
{
[Constructable]
public CaveBat() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a cave bat";
Body = 185;
BaseSoundID = 0x270;
AnimationMod = 7;
SetStr( 91, 110 );
SetDex( 91, 115 );
SetInt( 26, 50 );
SetHits( 55, 66 );
SetDamage( 7, 9 );
SetSkill( SkillName.MagicResist, 70.1, 95.0 );
SetSkill( SkillName.Tactics, 55.1, 80.0 );
SetSkill( SkillName.HandToHand, 30.1, 55.0 );
Fame = 1000;
Karma = -1000;
VirtualArmor = 14;
}
public void DrainBlood( Mobile m )
{
DoHarmful( m );
new Blood().MoveToWorld( m.Location, m.Map );
m.SendMessage( "The creature feeds on your blood!" );
int toDrain = Utility.RandomMinMax( 2, 10 );
m.PlaySound( 0x23F );
Hits += toDrain;
m.Damage( toDrain, this );
}
public override void OnGaveMeleeAttack( Mobile defender )
{
base.OnGaveMeleeAttack( defender );
DrainBlood( defender );
}
public override void OnGotMeleeAttack( Mobile attacker )
{
base.OnGotMeleeAttack( attacker );
DrainBlood( attacker );
}
public override void GenerateLoot()
{
AddLoot( LootPack.Poor );
}
public CaveBat( 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,62 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a giant rat corpse" )]
[TypeAlias( "Server.Mobiles.Giantrat" )]
public class GiantRat : BaseCreature
{
[Constructable]
public GiantRat() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a giant rat";
Body = 215;
BaseSoundID = 0x188;
SetStr( 32, 74 );
SetDex( 46, 65 );
SetInt( 16, 30 );
SetHits( 26, 39 );
SetMana( 0 );
SetDamage( 4, 8 );
SetSkill( SkillName.MagicResist, 25.1, 30.0 );
SetSkill( SkillName.Tactics, 29.3, 44.0 );
SetSkill( SkillName.HandToHand, 29.3, 44.0 );
Fame = 300;
Karma = -300;
VirtualArmor = 18;
}
public override void GenerateLoot()
{
AddLoot( LootPack.Poor );
}
public override int Meat{ get{ return 1; } }
public override int Hides{ get{ return 6; } }
public GiantRat(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,64 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a hare corpse" )]
public class Rabbit : BaseCreature
{
[Constructable]
public Rabbit() : base( AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a rabbit";
Body = 205;
if ( 0.5 >= Utility.RandomDouble() )
Hue = Utility.RandomAnimalHue();
SetStr( 6, 10 );
SetDex( 26, 38 );
SetInt( 6, 14 );
SetHits( 4, 6 );
SetMana( 0 );
SetDamage( 1 );
SetSkill( SkillName.MagicResist, 5.0 );
SetSkill( SkillName.Tactics, 5.0 );
SetSkill( SkillName.HandToHand, 5.0 );
Fame = 0;
Karma = 0;
VirtualArmor = 6;
}
public override int Meat{ get{ return 1; } }
public override int Hides{ get{ return 1; } }
public override int GetAngerSound(){ return 0x0C9; }
public override int GetIdleSound(){ return 0x0C9; }
public override int GetAttackSound(){ return 0x0CA; }
public override int GetHurtSound(){ return 0x0CA; }
public override int GetDeathSound(){ return 0x0CB; }
public Rabbit(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,59 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a raccoon corpse" )]
public class Raccoon : BaseCreature
{
[Constructable]
public Raccoon() : base( AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a raccoon";
Body = 227;
SetStr( 16, 20 );
SetDex( 26, 38 );
SetInt( 6, 14 );
SetHits( 6, 9 );
SetMana( 0 );
SetDamage( Utility.RandomMinMax( 1, 3 ) );
SetSkill( SkillName.MagicResist, 5.0 );
SetSkill( SkillName.Tactics, 15.0 );
SetSkill( SkillName.HandToHand, 15.0 );
Fame = 0;
Karma = 0;
VirtualArmor = 9;
}
public override int Meat{ get{ return 1; } }
public override int Hides{ get{ return 1; } }
public override int GetAngerSound(){ return 0x0C9; }
public override int GetIdleSound(){ return 0x0C9; }
public override int GetAttackSound(){ return 0x0CA; }
public override int GetHurtSound(){ return 0x0CA; }
public override int GetDeathSound(){ return 0x0CB; }
public Raccoon(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,60 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a rat corpse" )]
public class Rat : BaseCreature
{
[Constructable]
public Rat() : base( AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a rat";
Body = 238;
BaseSoundID = 0xCC;
SetStr( 9 );
SetDex( 35 );
SetInt( 5 );
SetHits( 6 );
SetMana( 0 );
SetDamage( 1, 2 );
SetSkill( SkillName.MagicResist, 4.0 );
SetSkill( SkillName.Tactics, 4.0 );
SetSkill( SkillName.HandToHand, 4.0 );
Fame = 150;
Karma = -150;
VirtualArmor = 6;
}
public override void GenerateLoot()
{
AddLoot( LootPack.Poor );
}
public override int Meat{ get{ return 1; } }
public Rat(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,59 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a squirrel corpse" )]
public class Squirrel : BaseCreature
{
[Constructable]
public Squirrel() : base( AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a squirrel";
Body = 229;
SetStr( 6, 10 );
SetDex( 26, 38 );
SetInt( 6, 14 );
SetHits( 4, 6 );
SetMana( 0 );
SetDamage( 1 );
SetSkill( SkillName.MagicResist, 5.0 );
SetSkill( SkillName.Tactics, 5.0 );
SetSkill( SkillName.HandToHand, 5.0 );
Fame = 0;
Karma = 0;
VirtualArmor = 6;
}
public override int Meat{ get{ return 1; } }
public override int Hides{ get{ return 1; } }
public override int GetAngerSound(){ return 0x0C9; }
public override int GetIdleSound(){ return 0x0C9; }
public override int GetAttackSound(){ return 0x0CA; }
public override int GetHurtSound(){ return 0x0CA; }
public override int GetDeathSound(){ return 0x0CB; }
public Squirrel(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,79 @@
using System;
using Server;
using Server.Items;
namespace Server.Mobiles
{
[CorpseName( "a bat corpse" )]
public class VampireBat : BaseCreature
{
[Constructable]
public VampireBat() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a vampire bat";
Body = 119;
BaseSoundID = 0x270;
SetStr( 91, 110 );
SetDex( 91, 115 );
SetInt( 26, 50 );
SetHits( 55, 66 );
SetDamage( 7, 9 );
SetSkill( SkillName.MagicResist, 70.1, 95.0 );
SetSkill( SkillName.Tactics, 55.1, 80.0 );
SetSkill( SkillName.HandToHand, 30.1, 55.0 );
Fame = 1000;
Karma = -1000;
VirtualArmor = 14;
}
public void DrainBlood( Mobile m )
{
DoHarmful( m );
new Blood().MoveToWorld( m.Location, m.Map );
m.SendMessage( "The creature feeds on your blood!" );
int toDrain = Utility.RandomMinMax( 2, 10 );
m.PlaySound( 0x23F );
Hits += toDrain;
m.Damage( toDrain, this );
}
public override void OnGaveMeleeAttack( Mobile defender )
{
base.OnGaveMeleeAttack( defender );
DrainBlood( defender );
}
public override void OnGotMeleeAttack( Mobile attacker )
{
base.OnGotMeleeAttack( attacker );
DrainBlood( attacker );
}
public override void GenerateLoot()
{
AddLoot( LootPack.Poor );
}
public VampireBat( 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,102 @@
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Network;
namespace Server.Mobiles
{
[CorpseName( "a sheep corpse" )]
public class Sheep : BaseCreature, ICarvable
{
private DateTime m_NextWoolTime;
[CommandProperty( AccessLevel.GameMaster )]
public DateTime NextWoolTime
{
get{ return m_NextWoolTime; }
set{ m_NextWoolTime = value; Body = ( DateTime.Now >= m_NextWoolTime ) ? 0xCF : 0xDF; }
}
public void Carve( Mobile from, Item item )
{
if ( DateTime.Now < m_NextWoolTime )
{
// This sheep is not yet ready to be shorn.
PrivateOverheadMessage( MessageType.Regular, 0x3B2, 500449, from.NetState );
return;
}
from.SendLocalizedMessage( 500452 ); // You place the gathered wool into your backpack.
from.AddToBackpack( new Wool( 1 ) );
NextWoolTime = DateTime.Now + TimeSpan.FromHours( 3.0 ); // TODO: Proper time delay
}
public override void OnThink()
{
base.OnThink();
Body = ( DateTime.Now >= m_NextWoolTime ) ? 0xCF : 0xDF;
}
[Constructable]
public Sheep() : base( AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a sheep";
Body = 207;
BaseSoundID = 0xD6;
SetStr( 19 );
SetDex( 25 );
SetInt( 5 );
SetHits( 12 );
SetMana( 0 );
SetDamage( 1, 2 );
SetSkill( SkillName.MagicResist, 5.0 );
SetSkill( SkillName.Tactics, 6.0 );
SetSkill( SkillName.HandToHand, 5.0 );
Fame = 0;
Karma = 200;
VirtualArmor = 6;
}
public override int Meat{ get{ return 2; } }
public override MeatType MeatType{ get{ return MeatType.Lamb; } }
public override int Wool{ get{ return (Body == 0xCF ? 3 : 0); } }
public Sheep( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 1 );
writer.WriteDeltaTime( m_NextWoolTime );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 1:
{
NextWoolTime = reader.ReadDeltaTime();
break;
}
}
}
}
}

View file

@ -0,0 +1,56 @@
using System;
using Server.Mobiles;
namespace Server.Mobiles
{
[CorpseName( "a walrus corpse" )]
public class Walrus : BaseCreature
{
[Constructable]
public Walrus() : base( AIType.AI_Timid, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a walrus";
Body = 221;
BaseSoundID = 0xE0;
SetStr( 21, 29 );
SetDex( 46, 55 );
SetInt( 16, 20 );
SetHits( 14, 17 );
SetMana( 0 );
SetDamage( 4, 10 );
SetSkill( SkillName.MagicResist, 15.1, 20.0 );
SetSkill( SkillName.Tactics, 19.2, 29.0 );
SetSkill( SkillName.HandToHand, 19.2, 29.0 );
Fame = 150;
Karma = 0;
VirtualArmor = 18;
}
public override int Meat{ get{ return 1; } }
public override int Hides{ get{ return 12; } }
public Walrus(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,60 @@
using System;
using Server;
using System.Collections;
using Server.Items;
using Server.Targeting;
using Server.Misc;
using System.Collections.Generic;
using Server.Mobiles;
using Server.ContextMenus;
namespace Server.Mobiles
{
[CorpseName( "a WoolyBanta corpse" )]
public class WoolyBanta : BaseCreature
{
[Constructable]
public WoolyBanta() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "a wooly banta";
Body = 264;
BaseSoundID = 0x508;
SetStr( 176, 200 );
SetDex( 26, 45 );
SetInt( 23, 47 );
SetHits( 146, 160 );
SetMana( 0 );
SetDamage( 8, 16 );
SetSkill( SkillName.Tactics, 40.1, 60.0 );
SetSkill( SkillName.HandToHand, 40.1, 60.0 );
Fame = 1000;
Karma = 0;
VirtualArmor = 28;
}
public override int Meat{ get{ return 18; } }
public override int Hides{ get{ return 24; } }
public WoolyBanta( 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,43 @@
using System;
using System.Collections.Generic;
using Server;
using Server.Mobiles;
using Server.Targeting;
namespace Server.Targets
{
public class AIControlMobileTarget : Target
{
private List<BaseAI> m_List;
private OrderType m_Order;
public OrderType Order {
get {
return m_Order;
}
}
public AIControlMobileTarget( BaseAI ai, OrderType order ) : base( -1, false, ( order == OrderType.Attack ? TargetFlags.Harmful : TargetFlags.None ) )
{
m_List = new List<BaseAI>();
m_Order = order;
AddAI( ai );
}
public void AddAI( BaseAI ai )
{
if ( !m_List.Contains( ai ) )
m_List.Add( ai );
}
protected override void OnTarget( Mobile from, object o )
{
if ( o is Mobile ) {
Mobile m = (Mobile)o;
for ( int i = 0; i < m_List.Count; ++i )
m_List[i].EndPickTarget( from, m, m_Order );
}
}
}
}

View file

@ -0,0 +1,157 @@
using System;
using System.Collections;
using Server.Targeting;
using Server.Network;
// Ideas
// When you run on animals the panic
// When if ( distance < 8 && Utility.RandomDouble() * Math.Sqrt( (8 - distance) / 6 ) >= incoming.Skills[SkillName.AnimalTaming].Value )
// More your close, the more it can panic
/*
* AnimalHunterAI, AnimalHidingAI, AnimalDomesticAI...
*
*/
namespace Server.Mobiles
{
public class AnimalAI : BaseAI
{
public AnimalAI(BaseCreature m) : base (m)
{
}
public override bool DoActionWander()
{
// Old:
#if false
if (AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, true, false, true))
{
m_Mobile.DebugSay( "There is something near, I go away" );
Action = ActionType.Backoff;
}
else if ( m_Mobile.IsHurt() || m_Mobile.Combatant != null )
{
m_Mobile.DebugSay( "I am hurt or being attacked, I flee" );
Action = ActionType.Flee;
}
else
{
base.DoActionWander();
}
return true;
#endif
// New, only flee @ 10%
double hitPercent = (double)m_Mobile.Hits / m_Mobile.HitsMax;
if ( !m_Mobile.Summoned && !m_Mobile.Controlled && hitPercent < 0.1 ) // Less than 10% health
{
m_Mobile.DebugSay( "I am low on health!" );
Action = ActionType.Flee;
}
else if ( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "I have detected {0}, attacking", m_Mobile.FocusMob.Name );
m_Mobile.Combatant = m_Mobile.FocusMob;
Action = ActionType.Combat;
}
else
{
base.DoActionWander();
}
return true;
}
public override bool DoActionCombat()
{
Mobile combatant = m_Mobile.Combatant;
if ( combatant == null || combatant.Deleted || combatant.Map != m_Mobile.Map )
{
m_Mobile.DebugSay( "My combatant is gone.." );
Action = ActionType.Wander;
return true;
}
if ( WalkMobileRange( combatant, 1, true, m_Mobile.RangeFight, m_Mobile.RangeFight ) )
{
m_Mobile.Direction = m_Mobile.GetDirectionTo( combatant );
}
else
{
if ( m_Mobile.GetDistanceToSqrt( combatant ) > m_Mobile.RangePerception + 1 )
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "I cannot find {0}", combatant.Name );
Action = ActionType.Wander;
return true;
}
else
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "I should be closer to {0}", combatant.Name );
}
}
if ( !m_Mobile.Controlled && !m_Mobile.Summoned )
{
double hitPercent = (double)m_Mobile.Hits / m_Mobile.HitsMax;
if ( hitPercent < 0.1 )
{
m_Mobile.DebugSay( "I am low on health!" );
Action = ActionType.Flee;
}
}
return true;
}
public override bool DoActionBackoff()
{
double hitPercent = (double)m_Mobile.Hits / m_Mobile.HitsMax;
if ( !m_Mobile.Summoned && !m_Mobile.Controlled && hitPercent < 0.1 ) // Less than 10% health
{
Action = ActionType.Flee;
}
else
{
if (AcquireFocusMob(m_Mobile.RangePerception * 2, FightMode.Closest, true, false , true))
{
if ( WalkMobileRange(m_Mobile.FocusMob, 1, false, m_Mobile.RangePerception, m_Mobile.RangePerception * 2) )
{
m_Mobile.DebugSay( "Well, here I am safe" );
Action = ActionType.Wander;
}
}
else
{
m_Mobile.DebugSay( "I have lost my focus, lets relax" );
Action = ActionType.Wander;
}
}
return true;
}
public override bool DoActionFlee()
{
AcquireFocusMob(m_Mobile.RangePerception * 2, m_Mobile.FightMode, true, false, true);
if ( m_Mobile.FocusMob == null )
m_Mobile.FocusMob = m_Mobile.Combatant;
return base.DoActionFlee();
}
}
}

View file

@ -0,0 +1,131 @@
using System;
using System.Collections;
using Server.Targeting;
using Server.Network;
using Server.Mobiles;
using Server.Items;
namespace Server.Mobiles
{
public class ArcherAI : BaseAI
{
public ArcherAI(BaseCreature m) : base (m)
{
}
public override bool DoActionWander()
{
m_Mobile.DebugSay( "I have no combatant" );
if (AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true))
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "I have detected {0} and I will attack", m_Mobile.FocusMob.Name );
m_Mobile.Combatant = m_Mobile.FocusMob;
Action = ActionType.Combat;
}
else
{
return base.DoActionWander();
}
return true;
}
public override bool DoActionCombat()
{
if ( m_Mobile.Combatant == null || m_Mobile.Combatant.Deleted || !m_Mobile.Combatant.Alive || m_Mobile.Combatant.IsDeadBondedPet )
{
m_Mobile.DebugSay("My combatant is deleted");
Action = ActionType.Guard;
return true;
}
if ( (m_Mobile.LastMoveTime + TimeSpan.FromSeconds( 1.0 )) < DateTime.Now )
{
if (WalkMobileRange(m_Mobile.Combatant, 1, true, m_Mobile.RangeFight, m_Mobile.Weapon.MaxRange))
{
// 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.Debug )
m_Mobile.DebugSay( "I am still not in range of {0}", m_Mobile.Combatant.Name);
if ( (int) m_Mobile.GetDistanceToSqrt( m_Mobile.Combatant ) > m_Mobile.RangePerception + 1 )
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "I have lost {0}", m_Mobile.Combatant.Name);
m_Mobile.Combatant = null;
Action = ActionType.Guard;
return true;
}
}
}
}
// When we have no ammo, we flee
Container pack = m_Mobile.Backpack;
if ( pack == null || pack.FindItemByType( typeof( Arrow ) ) == null )
{
Action = ActionType.Flee;
return true;
}
// At 20% we should check if we must leave
if ( m_Mobile.Hits < m_Mobile.HitsMax*20/100 )
{
bool bFlee = false;
// if my current hits are more than my opponent, i don't care
if ( m_Mobile.Combatant != null && m_Mobile.Hits < m_Mobile.Combatant.Hits)
{
int iDiff = m_Mobile.Combatant.Hits - m_Mobile.Hits;
if ( Utility.Random(0, 100) > 10 + iDiff) // 10% to flee + the diff of hits
{
bFlee = true;
}
}
else if ( m_Mobile.Combatant != null && m_Mobile.Hits >= m_Mobile.Combatant.Hits)
{
if ( Utility.Random(0, 100) > 10 ) // 10% to flee
{
bFlee = true;
}
}
if (bFlee)
{
Action = ActionType.Flee;
}
}
return true;
}
public override bool DoActionGuard()
{
if ( AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "I have detected {0}, attacking", m_Mobile.FocusMob.Name );
m_Mobile.Combatant = m_Mobile.FocusMob;
Action = ActionType.Combat;
}
else
{
base.DoActionGuard();
}
return true;
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,87 @@
using System;
using System.Collections;
using Server.Targeting;
using Server.Network;
namespace Server.Mobiles
{
public class BerserkAI : BaseAI
{
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 ( 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;
}
public override bool DoActionCombat()
{
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 ) )
{
// 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.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 ( m_Mobile.Debug )
m_Mobile.DebugSay( "I have lost " + m_Mobile.Combatant.Name );
Action = ActionType.Guard;
return true;
}
}
}
return true;
}
public override bool DoActionGuard()
{
if ( AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, false, true, true ) )
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "I have detected {0}, attacking", m_Mobile.FocusMob.Name );
m_Mobile.Combatant = m_Mobile.FocusMob;
Action = ActionType.Combat;
}
else
{
base.DoActionGuard();
}
return true;
}
}
}

View file

@ -0,0 +1,34 @@
using System;
using System.Collections;
using Server.Targeting;
using Server.Network;
namespace Server.Mobiles
{
public class CitizenAI : BaseAI
{
public CitizenAI(BaseCreature m) : base (m)
{
}
public override bool DoActionWander()
{
return false;
}
public override bool DoActionCombat()
{
return false;
}
public override bool DoActionBackoff()
{
return false;
}
public override bool DoActionFlee()
{
return false;
}
}
}

View file

@ -0,0 +1,176 @@
using System;
using System.Collections;
using Server.Targeting;
using Server.Network;
using Server.Spells;
using Server.Spells.First;
using Server.Spells.Second;
using Server.Spells.Fourth;
namespace Server.Mobiles
{
public class HealerAI : BaseAI
{
private static NeedDelegate m_Cure = new NeedDelegate( NeedCure );
private static NeedDelegate m_GHeal = new NeedDelegate( NeedGHeal );
private static NeedDelegate m_LHeal = new NeedDelegate( NeedLHeal );
private static NeedDelegate[] m_ACure = new NeedDelegate[] { m_Cure };
private static NeedDelegate[] m_AGHeal = new NeedDelegate[] { m_GHeal };
private static NeedDelegate[] m_ALHeal = new NeedDelegate[] { m_LHeal };
private static NeedDelegate[] m_All = new NeedDelegate[] { m_Cure, m_GHeal, m_LHeal };
public HealerAI( BaseCreature m ) : base( m )
{
}
public override bool Think()
{
if ( m_Mobile.Deleted )
return false;
Target targ = m_Mobile.Target;
if ( targ != null )
{
if ( targ is CureSpell.InternalTarget )
{
ProcessTarget( targ, m_ACure );
}
else if ( targ is GreaterHealSpell.InternalTarget )
{
ProcessTarget( targ, m_AGHeal );
}
else if ( targ is HealSpell.InternalTarget )
{
ProcessTarget( targ, m_ALHeal );
}
else
{
targ.Cancel( m_Mobile, TargetCancelType.Canceled );
}
}
else
{
Mobile toHelp = Find( m_All );
if ( toHelp != null )
{
if ( NeedCure( toHelp ) )
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "{0} needs a cure", toHelp.Name );
if ( !(new CureSpell( m_Mobile, null )).Cast() )
new CureSpell( m_Mobile, null ).Cast();
}
else if ( NeedGHeal( toHelp ) )
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "{0} needs a greater heal", toHelp.Name );
if ( !(new GreaterHealSpell( m_Mobile, null )).Cast() )
new HealSpell( m_Mobile, null ).Cast();
}
else if ( NeedLHeal( toHelp ) )
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "{0} needs a lesser heal", toHelp.Name );
new HealSpell( m_Mobile, null ).Cast();
}
}
else
{
if ( AcquireFocusMob( m_Mobile.RangePerception, FightMode.Weakest, false, true, false ) )
{
WalkMobileRange( m_Mobile.FocusMob, 1, false, 4, 7 );
}
else
{
WalkRandomInHome( 3, 2, 1 );
}
}
}
return true;
}
private delegate bool NeedDelegate( Mobile m );
private void ProcessTarget( Target targ, NeedDelegate[] func )
{
Mobile toHelp = Find( func );
if ( toHelp != null )
{
if ( targ.Range != -1 && !m_Mobile.InRange( toHelp, targ.Range ) )
{
DoMove( m_Mobile.GetDirectionTo( toHelp ) | Direction.Running );
}
else
{
targ.Invoke( m_Mobile, toHelp );
}
}
else
{
targ.Cancel( m_Mobile, TargetCancelType.Canceled );
}
}
private Mobile Find( params NeedDelegate[] funcs )
{
if ( m_Mobile.Deleted )
return null;
Map map = m_Mobile.Map;
if ( map != null )
{
double prio = 0.0;
Mobile found = null;
foreach ( Mobile m in m_Mobile.GetMobilesInRange( m_Mobile.RangePerception ) )
{
if ( !m_Mobile.CanSee( m ) || !(m is BaseCreature) || ((BaseCreature)m).Team != m_Mobile.Team )
continue;
for ( int i = 0; i < funcs.Length; ++i )
{
if ( funcs[i]( m ) )
{
double val = -m_Mobile.GetDistanceToSqrt( m );
if ( found == null || val > prio )
{
prio = val;
found = m;
}
break;
}
}
}
return found;
}
return null;
}
private static bool NeedCure( Mobile m )
{
return m.Poisoned;
}
private static bool NeedGHeal( Mobile m )
{
return m.Hits < m.HitsMax - 40;
}
private static bool NeedLHeal( Mobile m )
{
return m.Hits < m.HitsMax - 10;
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,183 @@
using System;
using System.Collections;
using Server.Targeting;
using Server.Network;
//
// This is a first simple AI
//
//
namespace Server.Mobiles
{
public class MeleeAI : BaseAI
{
public MeleeAI(BaseCreature m) : base (m)
{
}
public override bool DoActionWander()
{
m_Mobile.DebugSay( "I have no combatant" );
if ( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "I have detected {0}, attacking", m_Mobile.FocusMob.Name );
m_Mobile.Combatant = m_Mobile.FocusMob;
Action = ActionType.Combat;
}
else
{
base.DoActionWander();
}
return true;
}
public override bool DoActionCombat()
{
Mobile combatant = m_Mobile.Combatant;
if ( combatant == null || combatant.Deleted || combatant.Map != m_Mobile.Map || !combatant.Alive || combatant.IsDeadBondedPet )
{
m_Mobile.DebugSay( "My combatant is gone, so my guard is up" );
Action = ActionType.Guard;
return true;
}
if ( !m_Mobile.InRange( combatant, m_Mobile.RangePerception ) )
{
// They are somewhat far away, can we find something else?
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( combatant, m_Mobile.RangePerception * 3 ) )
{
m_Mobile.Combatant = null;
}
combatant = m_Mobile.Combatant;
if ( combatant == null )
{
m_Mobile.DebugSay( "My combatant has fled, so I am on guard" );
Action = ActionType.Guard;
return true;
}
}
/*if ( !m_Mobile.InLOS( combatant ) )
{
if ( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
{
m_Mobile.Combatant = combatant = m_Mobile.FocusMob;
m_Mobile.FocusMob = null;
}
}*/
if ( MoveTo( combatant, true, m_Mobile.RangeFight ) )
{
m_Mobile.Direction = m_Mobile.GetDirectionTo( combatant );
}
else if ( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "My move is blocked, so I am going to attack {0}", m_Mobile.FocusMob.Name );
m_Mobile.Combatant = m_Mobile.FocusMob;
Action = ActionType.Combat;
return true;
}
else if ( m_Mobile.GetDistanceToSqrt( combatant ) > m_Mobile.RangePerception + 1 )
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "I cannot find {0}, so my guard is up", combatant.Name );
Action = ActionType.Guard;
return true;
}
else
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "I should be closer to {0}", combatant.Name );
}
if ( !m_Mobile.Controlled && !m_Mobile.Summoned )
{
if ( m_Mobile.Hits < m_Mobile.HitsMax * 20/100 )
{
// We are low on health, should we flee?
bool flee = false;
if ( m_Mobile.Hits < combatant.Hits )
{
// We are more hurt than them
int diff = combatant.Hits - m_Mobile.Hits;
flee = ( Utility.Random( 0, 100 ) < (10 + diff) ); // (10 + diff)% chance to flee
}
else
{
flee = Utility.Random( 0, 100 ) < 10; // 10% chance to flee
}
if ( flee )
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "I am going to flee from {0}", combatant.Name );
Action = ActionType.Flee;
}
}
}
return true;
}
public override bool DoActionGuard()
{
if ( AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "I have detected {0}, attacking", m_Mobile.FocusMob.Name );
m_Mobile.Combatant = m_Mobile.FocusMob;
Action = ActionType.Combat;
}
else
{
base.DoActionGuard();
}
return true;
}
public override bool DoActionFlee()
{
if ( m_Mobile.Hits > m_Mobile.HitsMax/2 )
{
m_Mobile.DebugSay( "I am stronger now, so I will continue fighting" );
Action = ActionType.Combat;
}
else
{
m_Mobile.FocusMob = m_Mobile.Combatant;
base.DoActionFlee();
}
return true;
}
}
}

View file

@ -0,0 +1,100 @@
using System;
using System.Collections;
using Server.Targeting;
using Server.Network;
/*
* PredatorAI, its an animal that can attack
* Dont flee but dont attack if not hurt or attacked
*
*/
namespace Server.Mobiles
{
public class PredatorAI : BaseAI
{
public PredatorAI(BaseCreature m) : base (m)
{
}
public override bool DoActionWander()
{
if ( m_Mobile.Combatant != null )
{
m_Mobile.DebugSay( "I am hurt or being attacked, I kill him" );
Action = ActionType.Combat;
}
else if (AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, true, false, true))
{
m_Mobile.DebugSay( "There is something near, I go away" );
Action = ActionType.Backoff;
}
else
{
base.DoActionWander();
}
return true;
}
public override bool DoActionCombat()
{
Mobile combatant = m_Mobile.Combatant;
if ( combatant == null || combatant.Deleted || combatant.Map != m_Mobile.Map )
{
m_Mobile.DebugSay( "My combatant is gone, so my guard is up" );
Action = ActionType.Wander;
return true;
}
if ( WalkMobileRange( combatant, 1, true, m_Mobile.RangeFight, m_Mobile.RangeFight ) )
{
m_Mobile.Direction = m_Mobile.GetDirectionTo( combatant );
}
else
{
if ( m_Mobile.GetDistanceToSqrt( combatant ) > m_Mobile.RangePerception + 1 )
{
m_Mobile.DebugSay( "I cannot find {0}", combatant.Name );
Action = ActionType.Wander;
return true;
}
else
{
m_Mobile.DebugSay( "I should be closer to {0}", combatant.Name );
}
}
return true;
}
public override bool DoActionBackoff()
{
if ( m_Mobile.IsHurt() || m_Mobile.Combatant != null )
{
Action = ActionType.Combat;
}
else
{
if (AcquireFocusMob(m_Mobile.RangePerception * 2, FightMode.Closest, true, false , true))
{
if ( WalkMobileRange(m_Mobile.FocusMob, 1, false, m_Mobile.RangePerception, m_Mobile.RangePerception * 2) )
{
m_Mobile.DebugSay( "Well, here I am safe" );
Action = ActionType.Wander;
}
}
else
{
m_Mobile.DebugSay( "I have lost my focus, lets relax" );
Action = ActionType.Wander;
}
}
return true;
}
}
}

View file

@ -0,0 +1,458 @@
using System;
using System.Collections;
using Server;
using Server.Mobiles;
namespace Server
{
public class SpeedInfo
{
// Should we use the new method of speeds?
private static bool Enabled = true;
private double m_ActiveSpeed;
private double m_PassiveSpeed;
private Type[] m_Types;
public double ActiveSpeed
{
get{ return m_ActiveSpeed; }
set{ m_ActiveSpeed = value; }
}
public double PassiveSpeed
{
get{ return m_PassiveSpeed; }
set{ m_PassiveSpeed = value; }
}
public Type[] Types
{
get{ return m_Types; }
set{ m_Types = value; }
}
public SpeedInfo( double activeSpeed, double passiveSpeed, Type[] types )
{
m_ActiveSpeed = activeSpeed;
m_PassiveSpeed = passiveSpeed;
m_Types = types;
}
public static bool Contains( object obj )
{
if ( !Enabled )
return false;
if ( m_Table == null )
LoadTable();
SpeedInfo sp = (SpeedInfo)m_Table[obj.GetType()];
return ( sp != null );
}
public static bool GetSpeeds( object obj, ref double activeSpeed, ref double passiveSpeed )
{
if ( !Enabled )
return false;
if ( m_Table == null )
LoadTable();
SpeedInfo sp = (SpeedInfo)m_Table[obj.GetType()];
if ( sp == null )
return false;
activeSpeed = sp.ActiveSpeed;
passiveSpeed = sp.PassiveSpeed;
return true;
}
private static void LoadTable()
{
m_Table = new Hashtable();
for ( int i = 0; i < m_Speeds.Length; ++i )
{
SpeedInfo info = m_Speeds[i];
Type[] types = info.Types;
for ( int j = 0; j < types.Length; ++j )
m_Table[types[j]] = info;
}
}
private static Hashtable m_Table;
private static SpeedInfo[] m_Speeds = new SpeedInfo[]
{
/* Slow */
new SpeedInfo( 0.3, 0.6, new Type[]
{
typeof( RottingDrake ),
typeof( ZombieDragon ),
typeof( CarcassWorm ),
typeof( Meglasaur ),
typeof( Gorceratops ),
typeof( Stegosaurus ),
typeof( Turtle ),
typeof( Shambler ),
typeof( ShamblingMound ),
typeof( AntLion ),
typeof( ArcticOgreLord ),
typeof( BoneKnight ),
typeof( EarthElemental ),
typeof( MeteorElemental ),
typeof( StoneGolem ),
typeof( StoneStatue ),
typeof( Goliath ),
typeof( MudElemental ),
typeof( MagmaElemental ),
typeof( WoodElemental ),
typeof( Ettin ),
typeof( SnowEttin ),
typeof( SwampThing ),
typeof( FrostOoze ),
typeof( FrostTroll ),
typeof( Ghoul ),
typeof( Wight ),
typeof( Golem ),
typeof( HeadlessOne ),
typeof( Mummy ),
typeof( Ogre ),
typeof( Owlbear ),
typeof( Sasquatch ),
typeof( CorpseGolem ),
typeof( FleshGolem ),
typeof( FleshGoliath ),
typeof( Caveman ),
typeof( OgreLord ),
typeof( ForestGiant ),
typeof( HillGiant ),
typeof( MountainGiant ),
typeof( FrostGiant ),
typeof( Xorn ),
typeof( Rat ),
typeof( RottingCorpse ),
typeof( Skeleton ),
typeof( Slime ),
typeof( Sludge ),
typeof( LargeSlime ),
typeof( Zombie ),
typeof( ZombieGargoyle ),
typeof( GargoyleUndead ),
typeof( Walrus )
} ),
/* Fast */
new SpeedInfo( 0.2, 0.4, new Type[]
{
typeof( BoneClaw ),
typeof( ShadowDemon ),
typeof( Torax ),
typeof( Teradactyl ),
typeof( AirElemental ),
typeof( Typhoon ),
typeof( AncientWyrm ),
typeof( Balron ),
typeof( SeaDevil ),
typeof( DemonClaw ),
typeof( BladeSpirits ),
typeof( DreadSpider ),
typeof( Efreet ),
typeof( Lich ),
typeof( Vampire ),
typeof( Nightmare ),
typeof( Cerberus ),
typeof( Serperus ),
typeof( Haderus ),
typeof( OphidianArchmage ),
typeof( OphidianMage ),
typeof( OphidianWarrior ),
typeof( OphidianMatriarch ),
typeof( OphidianKnight ),
typeof( Naga ),
typeof( NagaWarrior ),
typeof( NagaQueen ),
typeof( FireNaga ),
typeof( Kobra ),
typeof( Medusa ),
typeof( PoisonElemental ),
typeof( GasCloud ),
typeof( StormCloud ),
typeof( IceSalamander ),
typeof( FireSalamander ),
typeof( Raptor ),
typeof( SandVortex ),
typeof( SavageShaman ),
typeof( SnowElemental ),
typeof( SuccubusQueen ),
typeof( WhiteWyrm ),
typeof( Wisp ),
typeof( WidowQueen ),
typeof( Kith ),
typeof( BloodSpider ),
typeof( GiantBlackWidow )
} ),
/* Very Fast */
new SpeedInfo( 0.175, 0.350, new Type[]
{
typeof( EnergyVortex ),
typeof( Pixie ),
typeof( Fairy ),
typeof( Swarm ),
typeof( SilverSerpent ),
typeof( Leviathan ),
} ),
/* Medium */
new SpeedInfo( 0.25, 0.5, new Type[]
{
typeof( Demoness ),
typeof( Hydra ),
typeof( SeaHydra ),
typeof( Goblin ),
typeof( GoblinArcher ),
typeof( GoblinWarrior ),
typeof( MummyLord ),
typeof( GiantCrab ),
typeof( Lobstran ),
typeof( Lurker ),
typeof( ForestStalker ),
typeof( CaveDweller ),
typeof( Minotaur ),
typeof( MinotaurLord ),
typeof( MinotaurChief ),
typeof( Ent ),
typeof( Fungal ),
typeof( FungalMage ),
typeof( Sphinx ),
typeof( RoyalSphinx ),
typeof( AncientSphinx ),
typeof( AcidElemental ),
typeof( Alligator ),
typeof( AncientLich ),
typeof( AncientVampire ),
typeof( Bird ),
typeof( BlackBear ),
typeof( BloodElemental ),
typeof( BloodElementalElder ),
typeof( PoisonElementalElder ),
typeof( WaterElementalElder ),
typeof( Boar ),
typeof( BoneMagi ),
typeof( Brigand ),
typeof( BlackKnight ),
typeof( BrownBear ),
typeof( Bull ),
typeof( BullFrog ),
typeof( Cat ),
typeof( Centaur ),
typeof( Chicken ),
typeof( Cougar ),
typeof( Cow ),
typeof( Cyclops ),
typeof( CyclopsChief ),
typeof( CyclopsLord ),
typeof( Daemon ),
typeof( Ktulu ),
typeof( Deviless ),
typeof( HornedDevil ),
typeof( IceDevil ),
typeof( DeepSeaSerpent ),
typeof( GiantEel ),
typeof( GiantSquid ),
typeof( DemonicSpirit ),
typeof( DireWolf ),
typeof( Dog ),
typeof( Dolphin ),
typeof( GreatWhite ),
typeof( Lochasaur ),
typeof( Megalodon ),
typeof( Shark ),
typeof( Seahorse ),
typeof( Tyranasaur ),
typeof( SeaDragon ),
typeof( Dragon ),
typeof( Drakkhen ),
typeof( DragonTurtle ),
typeof( Drake ),
typeof( LavaDrake ),
typeof( SeaDrake ),
typeof( SwampDragon ),
typeof( Dwarf ),
typeof( DwarfWarrior ),
typeof( DwarfKnight ),
typeof( Eagle ),
typeof( ElderGazer ),
typeof( AncientGazer ),
typeof( EvilMage ),
typeof( EvilMageLord ),
typeof( MindFlayer ),
typeof( Executioner ),
typeof( Savage ),
typeof( SavageLeader ),
typeof( FireElemental ),
typeof( LightningElemental ),
typeof( FireGargoyle ),
typeof( FrostSpider ),
typeof( Shaclaw ),
typeof( Gargoyle ),
typeof( GargoyleMage ),
typeof( GargoyleKnight ),
typeof( GargoyleIce ),
typeof( GargoyleStone ),
typeof( GargoyleWizard ),
typeof( GargoyleCrimson ),
typeof( Gazer ),
typeof( IceSerpent ),
typeof( GiantRat ),
typeof( GiantSerpent ),
typeof( Viper ),
typeof( Cobra ),
typeof( GiantSpider ),
typeof( GiantToad ),
typeof( IceToad ),
typeof( FireToad ),
typeof( Goat ),
typeof( Gorilla ),
typeof( Ape ),
typeof( GreatDeer ),
typeof( GreyWolf ),
typeof( GrizzlyBear ),
typeof( CaveBear ),
typeof( KodiakBear ),
typeof( Lion ),
typeof( Tiger ),
typeof( Manticore ),
typeof( SnowBear ),
typeof( PandaBear ),
typeof( Harpy ),
typeof( ElderHarpy ),
typeof( GiantHawk ),
typeof( GiantRaven ),
typeof( Roc ),
typeof( AxeBeak ),
typeof( Griffon ),
typeof( Hippogriff ),
typeof( HellHound ),
typeof( Deer ),
typeof( Hobgoblin ),
typeof( HobgoblinChief ),
typeof( HobgoblinArcher ),
typeof( HobgoblinShaman ),
typeof( Horse ),
typeof( IceElemental ),
typeof( IceFiend ),
typeof( Imp ),
typeof( FireImp ),
typeof( IceImp ),
typeof( Kraken ),
typeof( HellCat ),
typeof( LavaLizard ),
typeof( GiantLizard ),
typeof( LavaSerpent ),
typeof( Lizardman ),
typeof( Drasolisk ),
typeof( Silisk ),
typeof( Sakkhra ),
typeof( SakkhraShaman ),
typeof( Sahuagin ),
typeof( SahuaginMage ),
typeof( Llama ),
typeof( Mongbat ),
typeof( MountainGoat ),
typeof( Dagon ),
typeof( Krakoa ),
typeof( OgreMagi ),
typeof( Minion ),
typeof( MinionWizard ),
typeof( MinionWarrior ),
typeof( Orc ),
typeof( OrcCaptain ),
typeof( OrcishLord ),
typeof( OrcishMage ),
typeof( PackHorse ),
typeof( PackLlama ),
typeof( Pirate ),
typeof( Panther ),
typeof( Pig ),
typeof( PolarBear ),
typeof( Rabbit ),
typeof( Raccoon ),
typeof( Squirrel ),
typeof( Ratman ),
typeof( RatmanArcher ),
typeof( RatmanMage ),
typeof( Satyr ),
typeof( FlameCrawler ),
typeof( Scorpion ),
typeof( Mantis ),
typeof( SandScorpion ),
typeof( DeadlyScorpion ),
typeof( SeaSerpent ),
typeof( Shade ),
typeof( ShadowWyrm ),
typeof( Sheep ),
typeof( BoneDrake ),
typeof( SkeletalDragon ),
typeof( VampiricDragon ),
typeof( VampiricDrake ),
typeof( SkeletalMage ),
typeof( SkeletonArcher ),
typeof( Snake ),
typeof( SnowLeopard ),
typeof( Spectre ),
typeof( StoneGargoyle ),
typeof( StoneHarpy ),
typeof( StormGiant ),
typeof( ShadowTitan ),
typeof( SandGiant ),
typeof( JungleGiant ),
typeof( Succubus ),
typeof( SwampTentacle ),
typeof( AntaurWorker ),
typeof( AntaurSoldier ),
typeof( AntaurLord ),
typeof( AntaurQueen ),
typeof( TerathanAvenger ),
typeof( TerathanDrone ),
typeof( TerathanMatriarch ),
typeof( TerathanWarrior ),
typeof( TimberWolf ),
typeof( Titan ),
typeof( Troll ),
typeof( Yeti ),
typeof( Bugbear ),
typeof( Unicorn ),
typeof( DreadHorn ),
typeof( WaterElemental ),
typeof( DeepSeaElemental ),
typeof( WhippingVine ),
typeof( WhiteWolf ),
typeof( Wraith ),
typeof( AncientWyvern ),
typeof( Wyvern ),
typeof( Pharaoh ),
typeof( LichLord ),
typeof( Nazghoul ),
typeof( Demilich ),
typeof( VampireLord ),
typeof( SkeletalKnight ),
typeof( Bat ),
typeof( VampireBat ),
typeof( CaveBat ),
typeof( Stirge ),
typeof( ArcaneScarab ),
typeof( Werewolf ),
typeof( Scarab ),
typeof( GoraxHorned ),
typeof( GoraxSlicer ),
typeof( GiantScarab ),
typeof( IronBeetle ),
typeof( Beetle )
} )
};
}
}

View file

@ -0,0 +1,194 @@
using System;
using System.Collections;
using Server.Targeting;
using Server.Network;
using Server.Items;
//
// This is a first simple AI
//
//
namespace Server.Mobiles
{
public class ThiefAI : BaseAI
{
public ThiefAI(BaseCreature m) : base (m)
{
}
private Item m_toDisarm;
public override bool DoActionWander()
{
m_Mobile.DebugSay( "I have no combatant" );
if ( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
{
m_Mobile.DebugSay( "I have detected {0}, attacking", m_Mobile.FocusMob.Name );
m_Mobile.Combatant = m_Mobile.FocusMob;
Action = ActionType.Combat;
}
else
{
base.DoActionWander();
}
return true;
}
public override bool DoActionCombat()
{
Mobile combatant = m_Mobile.Combatant;
if ( combatant == null || combatant.Deleted || combatant.Map != m_Mobile.Map )
{
m_Mobile.DebugSay( "My combatant is gone, so my guard is up" );
Action = ActionType.Guard;
return true;
}
if ( WalkMobileRange( combatant, 1, true, m_Mobile.RangeFight, m_Mobile.RangeFight ) )
{
m_Mobile.Direction = m_Mobile.GetDirectionTo( combatant );
if ( m_toDisarm == null )
m_toDisarm = combatant.FindItemOnLayer( Layer.OneHanded );
if ( m_toDisarm == null )
m_toDisarm = combatant.FindItemOnLayer( Layer.TwoHanded );
if ( m_toDisarm != null && m_toDisarm.IsChildOf( m_Mobile.Backpack ) )
{
m_toDisarm = combatant.FindItemOnLayer( Layer.OneHanded );
if ( m_toDisarm == null )
m_toDisarm = combatant.FindItemOnLayer( Layer.TwoHanded );
}
if ( !m_Mobile.DisarmReady && m_Mobile.Skills[SkillName.HandToHand].Value >= 80.0 && m_Mobile.Skills[SkillName.Tactics].Value >= 80.0 && m_toDisarm != null )
EventSink.InvokeDisarmRequest( new DisarmRequestEventArgs( m_Mobile ) );
if ( m_toDisarm != null && m_toDisarm.IsChildOf( combatant.Backpack ) && m_Mobile.NextSkillTime <= DateTime.Now && (m_toDisarm.LootType != LootType.Blessed ) )
{
m_Mobile.DebugSay( "Trying to steal from combatant." );
m_Mobile.UseSkill( SkillName.Stealing );
if ( m_Mobile.Target != null )
m_Mobile.Target.Invoke( m_Mobile, m_toDisarm );
}
else if ( m_toDisarm == null && m_Mobile.NextSkillTime <= DateTime.Now )
{
Container cpack = combatant.Backpack;
if ( cpack != null )
{
Item steala = cpack.FindItemByType( typeof ( Bandage ) );
if ( steala != null )
{
m_Mobile.DebugSay( "Trying to steal from combatant." );
m_Mobile.UseSkill( SkillName.Stealing );
if ( m_Mobile.Target != null )
m_Mobile.Target.Invoke( m_Mobile, steala );
}
Item stealb = cpack.FindItemByType( typeof ( Nightshade ) );
if ( stealb != null )
{
m_Mobile.DebugSay( "Trying to steal from combatant." );
m_Mobile.UseSkill( SkillName.Stealing );
if ( m_Mobile.Target != null )
m_Mobile.Target.Invoke( m_Mobile, stealb );
}
Item stealc = cpack.FindItemByType( typeof ( BlackPearl ) );
if ( stealc != null )
{
m_Mobile.DebugSay( "Trying to steal from combatant." );
m_Mobile.UseSkill( SkillName.Stealing );
if ( m_Mobile.Target != null )
m_Mobile.Target.Invoke( m_Mobile, stealc );
}
Item steald = cpack.FindItemByType( typeof ( MandrakeRoot ) );
if ( steald != null )
{
m_Mobile.DebugSay( "Trying to steal from combatant." );
m_Mobile.UseSkill( SkillName.Stealing );
if ( m_Mobile.Target != null )
m_Mobile.Target.Invoke( m_Mobile, steald );
}
else if ( steala == null && stealb == null && stealc == null && steald == null )
{
m_Mobile.DebugSay( "I am going to flee from {0}", combatant.Name );
Action = ActionType.Flee;
}
}
}
}
else
{
m_Mobile.DebugSay( "I should be closer to {0}", combatant.Name );
}
if ( m_Mobile.Hits < m_Mobile.HitsMax * 20/100 )
{
// We are low on health, should we flee?
bool flee = false;
if ( m_Mobile.Hits < combatant.Hits )
{
// We are more hurt than them
int diff = combatant.Hits - m_Mobile.Hits;
flee = ( Utility.Random( 0, 100 ) > (10 + diff) ); // (10 + diff)% chance to flee
}
else
{
flee = Utility.Random( 0, 100 ) > 10; // 10% chance to flee
}
if ( flee )
{
m_Mobile.DebugSay( "I am going to flee from {0}", combatant.Name );
Action = ActionType.Flee;
}
}
return true;
}
public override bool DoActionGuard()
{
if ( AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
{
m_Mobile.DebugSay( "I have detected {0}, attacking", m_Mobile.FocusMob.Name );
m_Mobile.Combatant = m_Mobile.FocusMob;
Action = ActionType.Combat;
}
else
{
base.DoActionGuard();
}
return true;
}
public override bool DoActionFlee()
{
if ( m_Mobile.Hits > m_Mobile.HitsMax/2 )
{
m_Mobile.DebugSay( "I am stronger now, so I will continue fighting" );
Action = ActionType.Combat;
}
else
{
m_Mobile.FocusMob = m_Mobile.Combatant;
base.DoActionFlee();
}
return true;
}
}
}

View file

@ -0,0 +1,121 @@
using System;
using System.Collections;
using Server.Targeting;
using Server.Network;
namespace Server.Mobiles
{
public class TimidAI : BaseAI
{
public TimidAI(BaseCreature m) : base (m)
{
}
public override bool DoActionWander()
{
if (AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, true, false, true))
{
m_Mobile.DebugSay( "There is something near, I go away" );
Action = ActionType.Backoff;
}
else if ( m_Mobile.IsHurt() || m_Mobile.Combatant != null )
{
m_Mobile.DebugSay( "I am hurt or being attacked, I flee" );
Action = ActionType.Flee;
}
else
{
base.DoActionWander();
}
return true;
}
public override bool DoActionCombat()
{
Mobile combatant = m_Mobile.Combatant;
if ( combatant == null || combatant.Deleted || combatant.Map != m_Mobile.Map )
{
m_Mobile.DebugSay( "My combatant is gone.." );
Action = ActionType.Wander;
return true;
}
if ( WalkMobileRange( combatant, 1, true, m_Mobile.RangeFight, m_Mobile.RangeFight ) )
{
m_Mobile.Direction = m_Mobile.GetDirectionTo( combatant );
}
else
{
if ( m_Mobile.GetDistanceToSqrt( combatant ) > m_Mobile.RangePerception + 1 )
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "I cannot find {0}", combatant.Name );
Action = ActionType.Wander;
return true;
}
else
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "I should be closer to {0}", combatant.Name );
}
}
if ( !m_Mobile.Controlled && !m_Mobile.Summoned )
{
double hitPercent = (double)m_Mobile.Hits / m_Mobile.HitsMax;
if ( hitPercent < 0.1 )
{
m_Mobile.DebugSay( "I am low on health!" );
Action = ActionType.Flee;
}
}
return true;
}
public override bool DoActionBackoff()
{
double hitPercent = (double)m_Mobile.Hits / m_Mobile.HitsMax;
if ( !m_Mobile.Summoned && !m_Mobile.Controlled && hitPercent < 0.1 ) // Less than 10% health
{
Action = ActionType.Flee;
}
else
{
if (AcquireFocusMob(m_Mobile.RangePerception * 2, FightMode.Closest, true, false , true))
{
if ( WalkMobileRange(m_Mobile.FocusMob, 1, false, m_Mobile.RangePerception, m_Mobile.RangePerception * 2) )
{
m_Mobile.DebugSay( "Well, here I am safe" );
Action = ActionType.Wander;
}
}
else
{
m_Mobile.DebugSay( "I have lost my focus, lets relax" );
Action = ActionType.Wander;
}
}
return true;
}
public override bool DoActionFlee()
{
AcquireFocusMob(m_Mobile.RangePerception * 2, m_Mobile.FightMode, true, false, true);
if ( m_Mobile.FocusMob == null )
m_Mobile.FocusMob = m_Mobile.Combatant;
return base.DoActionFlee();
}
}
}

View file

@ -0,0 +1,149 @@
using System;
using System.Collections;
using Server.Targeting;
using Server.Network;
//
// This is a first simple AI
//
//
namespace Server.Mobiles
{
public class VendorAI : BaseAI
{
public VendorAI(BaseCreature m) : base (m)
{
}
public override bool DoActionWander()
{
m_Mobile.DebugSay( "I'm fine" );
if ( m_Mobile.Combatant != null )
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "{0} is attacking me", m_Mobile.Combatant.Name );
m_Mobile.Say( Utility.RandomList( 1005305, 501603 ) );
Action = ActionType.Flee;
}
else
{
if ( m_Mobile.FocusMob != null )
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "{0} has talked to me", m_Mobile.FocusMob.Name );
Action = ActionType.Interact;
}
else
{
m_Mobile.Warmode = false;
base.DoActionWander();
}
}
return true;
}
public override bool DoActionInteract()
{
Mobile customer = m_Mobile.FocusMob;
if ( m_Mobile.Combatant != null )
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "{0} is attacking me", m_Mobile.Combatant.Name );
m_Mobile.Say( Utility.RandomList( 1005305, 501603 ) );
Action = ActionType.Flee;
return true;
}
if ( customer == null || customer.Deleted || customer.Map != m_Mobile.Map )
{
m_Mobile.DebugSay( "My customer have disapeared" );
m_Mobile.FocusMob = null;
Action = ActionType.Wander;
}
else
{
if ( customer.InRange( m_Mobile, m_Mobile.RangeFight ) )
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "I am with {0}", customer.Name );
m_Mobile.Direction = m_Mobile.GetDirectionTo( customer );
}
else
{
if ( m_Mobile.Debug )
m_Mobile.DebugSay( "{0} is gone", customer.Name );
m_Mobile.FocusMob = null;
Action = ActionType.Wander;
}
}
return true;
}
public override bool DoActionGuard()
{
m_Mobile.FocusMob = m_Mobile.Combatant;
return base.DoActionGuard();
}
public override bool HandlesOnSpeech( Mobile from )
{
if ( from.InRange( m_Mobile, 4 ) )
return true;
return base.HandlesOnSpeech( from );
}
// Temporary
public override void OnSpeech( SpeechEventArgs e )
{
base.OnSpeech( e );
Mobile from = e.Mobile;
if ( m_Mobile is BaseVendor && from.InRange( m_Mobile, Core.AOS ? 1 : 4 ) && !e.Handled )
{
if ( e.HasKeyword( 0x14D ) ) // *vendor sell*
{
e.Handled = true;
((BaseVendor)m_Mobile).VendorSell( from );
m_Mobile.FocusMob = from;
}
else if ( e.HasKeyword( 0x3C ) )
{
e.Handled = true;
((BaseVendor)m_Mobile).VendorBuy( from );
m_Mobile.FocusMob = from;
}
else if ( WasNamed( e.Speech ) )
{
e.Handled = true;
if ( e.HasKeyword( 0x177 ) ) // *sell*
((BaseVendor)m_Mobile).VendorSell( from );
else if ( e.HasKeyword( 0x171 ) ) // *buy*
((BaseVendor)m_Mobile).VendorBuy( from );
m_Mobile.FocusMob = from;
}
}
}
}
}

View file

@ -0,0 +1,28 @@
using System;
using System.Collections;
using Server.Items;
namespace Server.Mobiles
{
public class AnimalBuyInfo : GenericBuyInfo
{
private int m_ControlSlots;
public AnimalBuyInfo( int controlSlots, Type type, int price, int amount, int itemID, int hue ) : this( controlSlots, null, type, price, amount, itemID, hue )
{
}
public AnimalBuyInfo( int controlSlots, string name, Type type, int price, int amount, int itemID, int hue ) : base( name, type, price, amount, itemID, hue )
{
m_ControlSlots = controlSlots;
}
public override int ControlSlots
{
get
{
return m_ControlSlots;
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,233 @@
using System;
using Server;
using Server.Misc;
using System.Collections.Generic;
using System.Collections;
using Server.Network;
using Server.Mobiles;
using Server.Items;
using Server.ContextMenus;
namespace Server.Mobiles
{
public abstract class BaseGuildmaster : BaseVendor
{
private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override bool IsActiveVendor{ get{ return true; } }
public override bool ClickTitle{ get{ return false; } }
public virtual int JoinCost{ get{ return 1000; } }
public override void InitSBInfo()
{
}
public virtual void SayGuildTo( Mobile m )
{
SayTo( m, 1008055 + (int)NpcGuild );
}
public virtual void SayWelcomeTo( Mobile m )
{
SayTo( m, "Welcome to the guild! Thou shalt find it beneficial to your future endeavors." );
}
public virtual void SayPriceTo( Mobile m )
{
m.Send( new MessageLocalizedAffix( Serial, Body, MessageType.Regular, SpeechHue, 3, 1008052, Name, AffixType.Append, JoinCost.ToString(), "" ) );
}
public virtual bool WasNamed( string speech )
{
string name = this.Name;
return ( name != null && Insensitive.StartsWith( speech, name ) );
}
public override bool HandlesOnSpeech( Mobile from )
{
if ( from.InRange( this.Location, 2 ) )
return true;
return base.HandlesOnSpeech( from );
}
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
{
PlayerMobile pm = (PlayerMobile)from;
base.GetContextMenuEntries( from, list );
if ( pm.NpcGuild != this.NpcGuild ){ list.Add( new JoinEntry( from, this ) ); }
else if ( pm.NpcGuild == this.NpcGuild ){ list.Add( new ResignEntry( from, this ) ); }
}
public class JoinEntry : ContextMenuEntry
{
private Mobile m_Mobile;
private Mobile m_Guildmaster;
public JoinEntry( Mobile from, Mobile guildmaster ) : base( 6116, 3 )
{
m_Mobile = from;
m_Guildmaster = guildmaster;
}
public override void OnClick()
{
if( !( m_Mobile is PlayerMobile ) )
return;
JoinGuild( m_Mobile, (BaseGuildmaster)m_Guildmaster );
}
}
public class ResignEntry : ContextMenuEntry
{
private Mobile m_Mobile;
private Mobile m_Guildmaster;
public ResignEntry( Mobile from, Mobile guildmaster ) : base( 6115, 3 )
{
m_Mobile = from;
m_Guildmaster = guildmaster;
}
public override void OnClick()
{
if( !( m_Mobile is PlayerMobile ) )
return;
ResignGuild( m_Mobile, (BaseGuildmaster)m_Guildmaster );
}
}
public override void OnSpeech( SpeechEventArgs e )
{
Mobile from = e.Mobile;
if ( !e.Handled && from is PlayerMobile && from.InRange( this.Location, 2 ) && WasNamed( e.Speech ) )
{
PlayerMobile pm = (PlayerMobile)from;
if ( e.HasKeyword( 0x0004 ) ) // *join* | *member*
{
if ( pm.NpcGuild == this.NpcGuild )
SayTo( from, 501047 ); // Thou art already a member of our guild.
else if ( pm.NpcGuild != NpcGuild.None )
SayTo( from, 501046 ); // Thou must resign from thy other guild first.
else
SayPriceTo( from );
e.Handled = true;
}
else if ( e.HasKeyword( 0x0005 ) ) // *resign* | *quit*
{
if ( pm.NpcGuild != this.NpcGuild )
{
SayTo( from, 501052 ); // Thou dost not belong to my guild!
}
else
{
SayTo( from, 501054 ); // I accept thy resignation.
pm.NpcGuild = NpcGuild.None;
pm.InvalidateProperties();
}
e.Handled = true;
}
}
base.OnSpeech( e );
}
public static void JoinGuild( Mobile player, BaseGuildmaster guildmaster )
{
PlayerMobile pm = (PlayerMobile)player;
if ( pm.NpcGuild == ((BaseVendor)guildmaster).NpcGuild )
guildmaster.SayTo( player, 501047 ); // Thou art already a member of our guild.
else if ( pm.NpcGuild != NpcGuild.None )
guildmaster.SayTo( player, 501046 ); // Thou must resign from thy other guild first.
else
guildmaster.SayPriceTo( player );
}
public static void ResignGuild( Mobile player, BaseGuildmaster guildmaster )
{
PlayerMobile pm = (PlayerMobile)player;
if ( pm.NpcGuild != ((BaseVendor)guildmaster).NpcGuild )
{
guildmaster.SayTo( player, 501052 ); // Thou dost not belong to my guild!
}
else
{
guildmaster.SayTo( player, 501054 ); // I accept thy resignation.
pm.NpcGuild = NpcGuild.None;
pm.InvalidateProperties();
}
}
public override bool OnGoldGiven( Mobile from, Gold dropped )
{
if ( from is PlayerMobile && dropped.Amount == JoinCost )
{
PlayerMobile pm = (PlayerMobile)from;
if ( pm.NpcGuild == this.NpcGuild )
{
SayTo( from, 501047 ); // Thou art already a member of our guild.
}
else if ( pm.NpcGuild != NpcGuild.None )
{
SayTo( from, 501046 ); // Thou must resign from thy other guild first.
}
else if ( pm.Kills > 4 && this.NpcGuild != NpcGuild.AssassinsGuild && this.NpcGuild != NpcGuild.ThievesGuild )
{
SayTo( from, 501522 ); // I shall not deal with scum like thee!
}
else
{
SayWelcomeTo( from );
pm.NpcGuild = this.NpcGuild;
pm.NpcGuildJoinTime = DateTime.Now;
pm.NpcGuildGameTime = pm.GameTime;
pm.InvalidateProperties();
dropped.Delete();
return true;
}
return false;
}
return base.OnGoldGiven( from, dropped );
}
public BaseGuildmaster( string title ) : base( title )
{
Title = String.Format( "the {0} {1}", title, Female ? "guildmistress" : "guildmaster" );
}
public BaseGuildmaster( 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,107 @@
using System;
using System.Collections.Generic;
using Server;
using Server.Misc;
using Server.Items;
using Server.Gumps;
namespace Server.Mobiles
{
public abstract class BaseHealer : BaseVendor
{
private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override bool IsActiveVendor{ get{ return false; } }
public override void InitSBInfo()
{
}
public BaseHealer() : base( null )
{
Invulnerable = true;
SetStr( 304, 400 );
SetDex( 102, 150 );
SetInt( 204, 300 );
SetDamage( 10, 23 );
SetSkill( SkillName.Concentration, 82.0, 100.0 );
SetSkill( SkillName.Healing, 75.0, 97.5 );
SetSkill( SkillName.Magery, 82.0, 100.0 );
SetSkill( SkillName.MagicResist, 82.0, 100.0 );
SetSkill( SkillName.Tactics, 82.0, 100.0 );
}
public virtual bool CheckResurrect( Mobile m )
{
return true;
}
private DateTime m_NextResurrect;
private static TimeSpan ResurrectDelay = TimeSpan.FromSeconds( 2.0 );
public virtual void OfferResurrection( Mobile m )
{
Direction = GetDirectionTo( m );
m.PlaySound(0x1F2);
m.FixedEffect( 0x376A, 10, 16 );
m.CloseGump( typeof( ResurrectGump ) );
m.SendGump( new ResurrectGump( m, ResurrectMessage.Healer ) );
}
public virtual void OfferHeal( PlayerMobile m )
{
Direction = GetDirectionTo( m );
Say( 501228 ); // I can do no more for you at this time.
}
public override void OnMovement( Mobile m, Point3D oldLocation )
{
if ( !m.Frozen && DateTime.Now >= m_NextResurrect && InRange( m, 4 ) && !InRange( oldLocation, 4 ) && InLOS( m ) )
{
if ( !m.Alive )
{
m_NextResurrect = DateTime.Now + ResurrectDelay;
if ( m.Map == null || !m.Map.CanFit( m.Location, 16, false, false ) )
{
m.SendLocalizedMessage( 502391 ); // Thou can not be resurrected there!
}
else if ( CheckResurrect( m ) )
{
OfferResurrection( m );
}
}
}
}
public BaseHealer( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
if ( !Invulnerable )
{
AI = AIType.AI_Mage;
ActiveSpeed = 0.2;
PassiveSpeed = 0.8;
RangePerception = BaseCreature.DefaultRangePerception;
FightMode = FightMode.Aggressor;
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,34 @@
using System;
using System.Collections;
using Server.Items;
namespace Server.Mobiles
{
public class BeverageBuyInfo : GenericBuyInfo
{
private BeverageType m_Content;
public override bool CanCacheDisplay{ get{ return false; } }
public BeverageBuyInfo( Type type, BeverageType content, int price, int amount, int itemID, int hue ) : this( null, type, content, price, amount, itemID, hue )
{
}
public BeverageBuyInfo( string name, Type type, BeverageType content, int price, int amount, int itemID, int hue ) : base( name, type, price, amount, itemID, hue )
{
m_Content = content;
if ( type == typeof( Pitcher ) )
Name = (1048128 + (int)content).ToString();
else if ( type == typeof( BeverageBottle ) )
Name = (1042959 + (int)content).ToString();
else if ( type == typeof( Jug ) )
Name = (1042965 + (int)content).ToString();
}
public override IEntity GetEntity()
{
return (IEntity)Activator.CreateInstance( Type, new object[]{ m_Content } );
}
}
}

View file

@ -0,0 +1,347 @@
using System;
using System.Collections.Generic;
using Server;
using Server.Items;
using Server.Network;
namespace Server.Mobiles
{
public class GenericBuyInfo : IBuyItemInfo
{
private class DisplayCache : Container
{
private static DisplayCache m_Cache;
public static DisplayCache Cache {
get {
if ( m_Cache == null || m_Cache.Deleted )
m_Cache = new DisplayCache();
return m_Cache;
}
}
private Dictionary<Type, IEntity> m_Table;
private List<Mobile> m_Mobiles;
public DisplayCache() : base( 0 )
{
m_Table = new Dictionary<Type, IEntity>();
m_Mobiles = new List<Mobile>();
}
public IEntity Lookup( Type key )
{
IEntity e = null;
m_Table.TryGetValue( key, out e );
return e;
}
public void Store( Type key, IEntity obj, bool cache )
{
if ( cache )
m_Table[key] = obj;
if ( obj is Item )
{
Item sell = (Item)obj;
if ( sell is BaseJewel )
((BaseJewel)sell).GemType = GemType.None;
AddItem( (Item)obj );
}
else if ( obj is Mobile )
m_Mobiles.Add( (Mobile)obj );
}
public DisplayCache( Serial serial ) : base( serial )
{
}
public override void OnAfterDelete()
{
base.OnAfterDelete();
for ( int i = 0; i < m_Mobiles.Count; ++i )
m_Mobiles[i].Delete();
m_Mobiles.Clear();
for ( int i = Items.Count - 1; i >= 0; --i )
if ( i < Items.Count )
Items[i].Delete();
if ( m_Cache == this )
m_Cache = null;
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( m_Mobiles );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
m_Mobiles = reader.ReadStrongMobileList();
for ( int i = 0; i < m_Mobiles.Count; ++i )
m_Mobiles[i].Delete();
m_Mobiles.Clear();
for ( int i = Items.Count - 1; i >= 0; --i )
if ( i < Items.Count )
Items[i].Delete();
if ( m_Cache == null )
m_Cache = this;
else
Delete();
m_Table = new Dictionary<Type, IEntity>();
}
}
private Type m_Type;
private string m_Name;
private int m_Price;
private int m_MaxAmount, m_Amount;
private int m_ItemID;
private int m_Hue;
private object[] m_Args;
private IEntity m_DisplayEntity;
public virtual int ControlSlots{ get{ return 0; } }
public virtual bool CanCacheDisplay{ get{ return false; } } //return ( m_Args == null || m_Args.Length == 0 ); }
private bool IsDeleted( IEntity obj )
{
if ( obj is Item )
return ((Item)obj).Deleted;
else if ( obj is Mobile )
return ((Mobile)obj).Deleted;
return false;
}
public void DeleteDisplayEntity()
{
if ( m_DisplayEntity == null )
return;
m_DisplayEntity.Delete();
m_DisplayEntity = null;
}
public IEntity GetDisplayEntity()
{
if ( m_DisplayEntity != null && !IsDeleted( m_DisplayEntity ) )
return m_DisplayEntity;
bool canCache = this.CanCacheDisplay;
if ( canCache )
m_DisplayEntity = DisplayCache.Cache.Lookup( m_Type );
if ( m_DisplayEntity == null || IsDeleted( m_DisplayEntity ) )
m_DisplayEntity = GetEntity();
DisplayCache.Cache.Store( m_Type, m_DisplayEntity, canCache );
return m_DisplayEntity;
}
public Type Type
{
get{ return m_Type; }
set{ m_Type = value; }
}
public string Name
{
get{ return m_Name; }
set{ m_Name = value; }
}
public int DefaultPrice{ get{ return m_PriceScalar; } }
private int m_PriceScalar;
public int PriceScalar
{
get{ return m_PriceScalar; }
set{ m_PriceScalar = value; }
}
public int Price
{
get
{
if ( m_PriceScalar != 0 )
{
if ( m_Price > 5000000 )
{
long price = m_Price;
price *= m_PriceScalar;
price += 50;
price /= 100;
if ( price > int.MaxValue )
price = int.MaxValue;
return (int)price;
}
return ( ((m_Price * m_PriceScalar) + 50) / 100 );
}
return m_Price;
}
set{ m_Price = value; }
}
public int ItemID
{
get{ return m_ItemID; }
set{ m_ItemID = value; }
}
public int Hue
{
get{ return m_Hue; }
set{ m_Hue = value; }
}
public int Amount
{
get{ return m_Amount; }
set{ if ( value < 0 ) value = 0; m_Amount = value; }
}
public int MaxAmount
{
get{ return m_MaxAmount; }
set{ m_MaxAmount = value; }
}
public object[] Args
{
get{ return m_Args; }
set{ m_Args = value; }
}
public GenericBuyInfo( Type type, int price, int amount, int itemID, int hue ) : this( null, type, price, amount, itemID, hue, null )
{
}
public GenericBuyInfo( string name, Type type, int price, int amount, int itemID, int hue ) : this( name, type, price, amount, itemID, hue, null )
{
}
public GenericBuyInfo( Type type, int price, int amount, int itemID, int hue, object[] args ) : this( null, type, price, amount, itemID, hue, args )
{
}
public GenericBuyInfo( string name, Type type, int price, int amount, int itemID, int hue, object[] args )
{
if ( amount > 10 )
amount = Utility.RandomMinMax( (amount-5), (amount+10) );
m_Type = type;
m_Price = price;
m_MaxAmount = m_Amount = amount;
m_ItemID = itemID;
m_Hue = hue;
m_Args = args;
if ( name == null )
m_Name = itemID < 0x4000 ? (1020000 + itemID).ToString() : (1078872 + itemID).ToString();
else
m_Name = name;
}
//get a new instance of an object (we just bought it)
public virtual IEntity GetEntity()
{
if ( m_Args == null || m_Args.Length == 0 )
return (IEntity)Activator.CreateInstance( m_Type );
return (IEntity)Activator.CreateInstance( m_Type, m_Args );
//return (Item)Activator.CreateInstance( m_Type );
}
//Attempt to restock with item, (return true if restock sucessful)
public bool Restock( Item item, int amount )
{
return false;
/*if ( item.GetType() == m_Type )
{
if ( item is BaseWeapon )
{
BaseWeapon weapon = (BaseWeapon)item;
if ( weapon.Quality == WeaponQuality.Low || weapon.Quality == WeaponQuality.Exceptional || (int)weapon.DurabilityLevel > 0 || (int)weapon.DamageLevel > 0 || (int)weapon.AccuracyLevel > 0 )
return false;
}
if ( item is BaseArmor )
{
BaseArmor armor = (BaseArmor)item;
if ( armor.Quality == ArmorQuality.Low || armor.Quality == ArmorQuality.Exceptional || (int)armor.Durability > 0 || (int)armor.ProtectionLevel > 0 )
return false;
}
m_Amount += amount;
return true;
}
else
{
return false;
}*/
}
public void OnRestock()
{
if ( m_Amount <= 0 )
{
m_MaxAmount *= 2;
if ( m_MaxAmount >= 999 )
m_MaxAmount = 999;
}
else
{
/* NOTE: According to UO.com, the quantity is halved if the item does not reach 0
* Here we implement differently: the quantity is halved only if less than half
* of the maximum quantity was bought. That is, if more than half is sold, then
* there's clearly a demand and we should not cut down on the stock.
*/
int halfQuantity = m_MaxAmount;
if ( halfQuantity >= 999 )
halfQuantity = 640;
else if ( halfQuantity > 20 )
halfQuantity /= 2;
if ( m_Amount >= halfQuantity )
m_MaxAmount = halfQuantity;
}
m_Amount = m_MaxAmount;
}
}
}

View file

@ -0,0 +1,148 @@
using System;
using System.Collections.Generic;
using Server.Items;
namespace Server.Mobiles
{
public class GenericSellInfo : IShopSellInfo
{
private Dictionary<Type, int> m_Table = new Dictionary<Type, int>();
private Type[] m_Types;
public GenericSellInfo()
{
}
public void Add( Type type, int price )
{
m_Table[type] = price;
m_Types = null;
}
public int GetSellPriceFor( Item item )
{
int price = 0;
m_Table.TryGetValue( item.GetType(), out price );
if ( item is BaseArmor ) {
BaseArmor armor = (BaseArmor)item;
if ( armor.Quality == ArmorQuality.Low )
price = (int)( price * 0.60 );
else if ( armor.Quality == ArmorQuality.Exceptional )
price = (int)( price * 1.25 );
price += 100 * (int)armor.Durability;
price += 100 * (int)armor.ProtectionLevel;
if ( price < 1 )
price = 1;
}
else if ( item is BaseWeapon ) {
BaseWeapon weapon = (BaseWeapon)item;
if ( weapon.Quality == WeaponQuality.Low )
price = (int)( price * 0.60 );
else if ( weapon.Quality == WeaponQuality.Exceptional )
price = (int)( price * 1.25 );
price += 100 * (int)weapon.DurabilityLevel;
price += 100 * (int)weapon.DamageLevel;
if ( price < 1 )
price = 1;
}
else if ( item is BaseJewel ) {
BaseJewel jewel = (BaseJewel)item;
if ( jewel.GemType == GemType.StarSapphire )
price += 62;
else if ( jewel.GemType == GemType.Emerald )
price += 50;
else if ( jewel.GemType == GemType.Sapphire )
price += 50;
else if ( jewel.GemType == GemType.Ruby )
price += 37;
else if ( jewel.GemType == GemType.Citrine )
price += 25;
else if ( jewel.GemType == GemType.Amethyst )
price += 50;
else if ( jewel.GemType == GemType.Tourmaline )
price += 47;
else if ( jewel.GemType == GemType.Amber )
price += 25;
else if ( jewel.GemType == GemType.Diamond )
price += 100;
}
else if ( item is BaseBeverage ) {
int price1 = price, price2 = price;
if ( item is Pitcher )
{ price1 = 3; price2 = 5; }
else if ( item is BeverageBottle )
{ price1 = 3; price2 = 3; }
else if ( item is Jug )
{ price1 = 6; price2 = 6; }
BaseBeverage bev = (BaseBeverage)item;
if ( bev.IsEmpty || bev.Content == BeverageType.Milk )
price = price1;
else
price = price2;
}
return price;
}
public int GetBuyPriceFor( Item item )
{
return (int)( 1.90 * GetSellPriceFor( item ) );
}
public Type[] Types
{
get
{
if ( m_Types == null )
{
m_Types = new Type[m_Table.Keys.Count];
m_Table.Keys.CopyTo( m_Types, 0 );
}
return m_Types;
}
}
public string GetNameFor( Item item )
{
if ( item.Name != null )
return item.Name;
else
return item.LabelNumber.ToString();
}
public bool IsSellable( Item item )
{
//if ( item.Hue != 0 )
//return false;
return IsInList( item.GetType() );
}
public bool IsResellable( Item item )
{
//if ( item.Hue != 0 )
//return false;
return IsInList( item.GetType() );
}
public bool IsInList( Type type )
{
return m_Table.ContainsKey( type );
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,23 @@
using System;
using System.Collections;
using Server.Items;
namespace Server.Mobiles
{
public class PresetMapBuyInfo : GenericBuyInfo
{
private PresetMapEntry m_Entry;
public override bool CanCacheDisplay{ get{ return false; } }
public PresetMapBuyInfo( PresetMapEntry entry, int price, int amount ) : base( entry.Name.ToString(), null, price, amount, 0x14EC, 0 )
{
m_Entry = entry;
}
public override IEntity GetEntity()
{
return new PresetMap( m_Entry );
}
}
}

View file

@ -0,0 +1,426 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Gumps;
using Server.Multis;
using Server.ContextMenus;
using Server.Prompts;
namespace Server.Mobiles
{
public class VendorRentalDuration
{
public static readonly VendorRentalDuration[] Instances = new VendorRentalDuration[]
{
new VendorRentalDuration( TimeSpan.FromDays( 7.0 ), 1062361 ), // 1 Week
new VendorRentalDuration( TimeSpan.FromDays( 14.0 ), 1062362 ), // 2 Weeks
new VendorRentalDuration( TimeSpan.FromDays( 21.0 ), 1062363 ), // 3 Weeks
new VendorRentalDuration( TimeSpan.FromDays( 28.0 ), 1062364 ) // 1 Month
};
private TimeSpan m_Duration;
private int m_Name;
public TimeSpan Duration{ get{ return m_Duration; } }
public int Name{ get{ return m_Name; } }
public int ID
{
get
{
for ( int i = 0; i < Instances.Length; i++ )
{
if ( Instances[i] == this )
return i;
}
return 0;
}
}
private VendorRentalDuration( TimeSpan duration, int name )
{
m_Duration = duration;
m_Name = name;
}
}
public class RentedVendor : PlayerVendor
{
private VendorRentalDuration m_RentalDuration;
private int m_RentalPrice;
private bool m_LandlordRenew;
private bool m_RenterRenew;
private int m_RenewalPrice;
private int m_RentalGold;
private DateTime m_RentalExpireTime;
private Timer m_RentalExpireTimer;
public RentedVendor( Mobile owner, BaseHouse house, VendorRentalDuration duration, int rentalPrice, bool landlordRenew, int rentalGold ) : base( owner, house )
{
m_RentalDuration = duration;
m_RentalPrice = m_RenewalPrice = rentalPrice;
m_LandlordRenew = landlordRenew;
m_RenterRenew = false;
m_RentalGold = rentalGold;
m_RentalExpireTime = DateTime.Now + duration.Duration;
m_RentalExpireTimer = new RentalExpireTimer( this, duration.Duration );
m_RentalExpireTimer.Start();
}
public RentedVendor( Serial serial ) : base( serial )
{
}
public VendorRentalDuration RentalDuration
{
get{ return m_RentalDuration; }
}
[CommandProperty( AccessLevel.GameMaster )]
public int RentalPrice
{
get{ return m_RentalPrice; }
set{ m_RentalPrice = value; }
}
[CommandProperty( AccessLevel.GameMaster )]
public bool LandlordRenew
{
get{ return m_LandlordRenew; }
set{ m_LandlordRenew = value; }
}
[CommandProperty( AccessLevel.GameMaster )]
public bool RenterRenew
{
get{ return m_RenterRenew; }
set{ m_RenterRenew = value; }
}
[CommandProperty( AccessLevel.GameMaster )]
public bool Renew
{
get{ return LandlordRenew && RenterRenew && House != null && House.DecayType != DecayType.Condemned; }
}
[CommandProperty( AccessLevel.GameMaster )]
public int RenewalPrice
{
get{ return m_RenewalPrice; }
set{ m_RenewalPrice = value; }
}
[CommandProperty( AccessLevel.GameMaster )]
public int RentalGold
{
get{ return m_RentalGold; }
set{ m_RentalGold = value; }
}
[CommandProperty( AccessLevel.GameMaster )]
public DateTime RentalExpireTime
{
get{ return m_RentalExpireTime; }
}
public override bool IsOwner( Mobile m )
{
return m == Owner || m.AccessLevel >= AccessLevel.GameMaster;
}
[CommandProperty( AccessLevel.GameMaster )]
public Mobile Landlord
{
get
{
if ( House != null )
return House.Owner;
return null;
}
}
public bool IsLandlord( Mobile m )
{
return House != null && House.IsOwner( m );
}
public void ComputeRentalExpireDelay( out int days, out int hours )
{
TimeSpan delay = RentalExpireTime - DateTime.Now;
if ( delay <= TimeSpan.Zero )
{
days = 0;
hours = 0;
}
else
{
days = delay.Days;
hours = delay.Hours;
}
}
public void SendRentalExpireMessage( Mobile to )
{
int days, hours;
ComputeRentalExpireDelay( out days, out hours );
to.SendLocalizedMessage( 1062464, days.ToString() + "\t" + hours.ToString() ); // The rental contract on this vendor will expire in ~1_DAY~ day(s) and ~2_HOUR~ hour(s).
}
public override void OnAfterDelete()
{
base.OnAfterDelete();
m_RentalExpireTimer.Stop();
}
public override void Destroy( bool toBackpack )
{
if ( RentalGold > 0 && House != null && House.IsAosRules )
{
if ( House.MovingCrate == null )
House.MovingCrate = new MovingCrate( House );
Innkeeper.Deposit( House.MovingCrate, RentalGold );
RentalGold = 0;
}
base.Destroy( toBackpack );
}
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
{
if ( from.Alive )
{
if ( IsOwner( from ) )
{
list.Add( new ContractOptionsEntry( this ) );
}
else if ( IsLandlord( from ) )
{
if ( RentalGold > 0 )
list.Add( new CollectRentEntry( this ) );
list.Add( new TerminateContractEntry( this ) );
list.Add( new ContractOptionsEntry( this ) );
}
}
base.GetContextMenuEntries( from, list );
}
private class ContractOptionsEntry : ContextMenuEntry
{
private RentedVendor m_Vendor;
public ContractOptionsEntry( RentedVendor vendor ) : base( 6209 )
{
m_Vendor = vendor;
}
public override void OnClick()
{
Mobile from = Owner.From;
if ( m_Vendor.Deleted || !from.CheckAlive() )
return;
if ( m_Vendor.IsOwner( from ) )
{
from.CloseGump( typeof( RenterVendorRentalGump ) );
from.SendGump( new RenterVendorRentalGump( m_Vendor ) );
m_Vendor.SendRentalExpireMessage( from );
}
else if ( m_Vendor.IsLandlord( from ) )
{
from.CloseGump( typeof( LandlordVendorRentalGump ) );
from.SendGump( new LandlordVendorRentalGump( m_Vendor ) );
m_Vendor.SendRentalExpireMessage( from );
}
}
}
private class CollectRentEntry : ContextMenuEntry
{
private RentedVendor m_Vendor;
public CollectRentEntry( RentedVendor vendor ) : base( 6212 )
{
m_Vendor = vendor;
}
public override void OnClick()
{
Mobile from = Owner.From;
if ( m_Vendor.Deleted || !from.CheckAlive() || !m_Vendor.IsLandlord( from ) )
return;
if ( m_Vendor.RentalGold > 0 )
{
int depositedGold = Innkeeper.DepositUpTo( from, m_Vendor.RentalGold );
m_Vendor.RentalGold -= depositedGold;
if ( depositedGold > 0 )
from.SendLocalizedMessage( 1060397, depositedGold.ToString() ); // ~1_AMOUNT~ gold has been deposited into your inn chest.
if ( m_Vendor.RentalGold > 0 )
from.SendLocalizedMessage( 500390 ); // Your inn chest is full.
}
}
}
private class TerminateContractEntry : ContextMenuEntry
{
private RentedVendor m_Vendor;
public TerminateContractEntry( RentedVendor vendor ) : base( 6218 )
{
m_Vendor = vendor;
}
public override void OnClick()
{
Mobile from = Owner.From;
if ( m_Vendor.Deleted || !from.CheckAlive() || !m_Vendor.IsLandlord( from ) )
return;
from.SendLocalizedMessage( 1062503 ); // Enter the amount of gold you wish to offer the renter in exchange for immediate termination of this contract?
from.Prompt = new RefundOfferPrompt( m_Vendor );
}
}
private class RefundOfferPrompt : Prompt
{
private RentedVendor m_Vendor;
public RefundOfferPrompt( RentedVendor vendor )
{
m_Vendor = vendor;
}
public override void OnResponse( Mobile from, string text )
{
if ( !m_Vendor.CanInteractWith( from, false ) || !m_Vendor.IsLandlord( from ) )
return;
text = text.Trim();
int amount;
if ( !int.TryParse( text, out amount ) )
amount = -1;
Mobile owner = m_Vendor.Owner;
if ( owner == null )
return;
if ( amount < 0 )
{
from.SendLocalizedMessage( 1062506 ); // You did not enter a valid amount. Offer canceled.
}
else if ( Innkeeper.GetBalance( from ) < amount )
{
from.SendLocalizedMessage( 1062507 ); // You do not have that much money in your inn chest.
}
else if ( owner.Map != m_Vendor.Map || !owner.InRange( m_Vendor, 5 ) )
{
from.SendLocalizedMessage( 1062505 ); // The renter must be closer to the vendor in order for you to make this offer.
}
else
{
from.SendLocalizedMessage( 1062504 ); // Please wait while the renter considers your offer.
owner.CloseGump( typeof( VendorRentalRefundGump ) );
owner.SendGump( new VendorRentalRefundGump( m_Vendor, from, amount ) );
}
}
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.WriteEncodedInt( 0 ); // version
writer.WriteEncodedInt( m_RentalDuration.ID );
writer.Write( (int) m_RentalPrice );
writer.Write( (bool) m_LandlordRenew );
writer.Write( (bool) m_RenterRenew );
writer.Write( (int) m_RenewalPrice );
writer.Write( (int) m_RentalGold );
writer.WriteDeltaTime( (DateTime) m_RentalExpireTime );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadEncodedInt();
int durationID = reader.ReadEncodedInt();
if ( durationID < VendorRentalDuration.Instances.Length )
m_RentalDuration = VendorRentalDuration.Instances[durationID];
else
m_RentalDuration = VendorRentalDuration.Instances[0];
m_RentalPrice = reader.ReadInt();
m_LandlordRenew = reader.ReadBool();
m_RenterRenew = reader.ReadBool();
m_RenewalPrice = reader.ReadInt();
m_RentalGold = reader.ReadInt();
m_RentalExpireTime = reader.ReadDeltaTime();
TimeSpan delay = m_RentalExpireTime - DateTime.Now;
m_RentalExpireTimer = new RentalExpireTimer( this, delay > TimeSpan.Zero ? delay : TimeSpan.Zero );
m_RentalExpireTimer.Start();
}
private class RentalExpireTimer : Timer
{
private RentedVendor m_Vendor;
public RentalExpireTimer( RentedVendor vendor, TimeSpan delay ) : base( delay, vendor.RentalDuration.Duration )
{
m_Vendor = vendor;
Priority = TimerPriority.OneMinute;
}
protected override void OnTick()
{
int renewalPrice = m_Vendor.RenewalPrice;
if ( m_Vendor.Renew && m_Vendor.HoldGold >= renewalPrice )
{
m_Vendor.HoldGold -= renewalPrice;
m_Vendor.RentalGold += renewalPrice;
m_Vendor.RentalPrice = renewalPrice;
m_Vendor.m_RentalExpireTime = DateTime.Now + m_Vendor.RentalDuration.Duration;
}
else
{
m_Vendor.Destroy( false );
}
}
}
}
}

View file

@ -0,0 +1,179 @@
using System;
using System.Collections.Generic;
using Server;
using Server.Multis;
namespace Server.Mobiles
{
public class VendorInventory
{
public static readonly TimeSpan GracePeriod = TimeSpan.FromDays( 7.0 );
private BaseHouse m_House;
private string m_VendorName;
private string m_ShopName;
private Mobile m_Owner;
private List<Item> m_Items;
private int m_Gold;
private DateTime m_ExpireTime;
private Timer m_ExpireTimer;
public VendorInventory( BaseHouse house, Mobile owner, string vendorName, string shopName )
{
m_House = house;
m_Owner = owner;
m_VendorName = vendorName;
m_ShopName = shopName;
m_Items = new List<Item>();
m_ExpireTime = DateTime.Now + GracePeriod;
m_ExpireTimer = new ExpireTimer( this, GracePeriod );
m_ExpireTimer.Start();
}
public BaseHouse House
{
get{ return m_House; }
set{ m_House = value; }
}
public string VendorName
{
get{ return m_VendorName; }
set{ m_VendorName = value; }
}
public string ShopName
{
get{ return m_ShopName; }
set{ m_ShopName = value; }
}
public Mobile Owner
{
get{ return m_Owner; }
set{ m_Owner = value; }
}
public List<Item> Items
{
get{ return m_Items; }
}
public int Gold
{
get{ return m_Gold; }
set{ m_Gold = value; }
}
public DateTime ExpireTime
{
get{ return m_ExpireTime; }
}
public void AddItem( Item item )
{
item.Internalize();
m_Items.Add( item );
}
public void Delete()
{
foreach ( Item item in Items )
{
item.Delete();
}
Items.Clear();
Gold = 0;
if ( House != null )
House.VendorInventories.Remove( this );
m_ExpireTimer.Stop();
}
public void Serialize( GenericWriter writer )
{
writer.WriteEncodedInt( 0 ); // version
writer.Write( (Mobile) m_Owner );
writer.Write( (string) m_VendorName );
writer.Write( (string) m_ShopName );
writer.Write( m_Items, true );
writer.Write( (int) m_Gold );
writer.WriteDeltaTime( m_ExpireTime );
}
public VendorInventory( BaseHouse house, GenericReader reader )
{
m_House = house;
int version = reader.ReadEncodedInt();
m_Owner = reader.ReadMobile();
m_VendorName = reader.ReadString();
m_ShopName = reader.ReadString();
m_Items = reader.ReadStrongItemList();
m_Gold = reader.ReadInt();
m_ExpireTime = reader.ReadDeltaTime();
if ( m_Items.Count == 0 && m_Gold == 0 )
{
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Delete ) );
}
else
{
TimeSpan delay = m_ExpireTime - DateTime.Now;
m_ExpireTimer = new ExpireTimer( this, delay > TimeSpan.Zero ? delay : TimeSpan.Zero );
m_ExpireTimer.Start();
}
}
private class ExpireTimer : Timer
{
private VendorInventory m_Inventory;
public ExpireTimer( VendorInventory inventory, TimeSpan delay ) : base( delay )
{
m_Inventory = inventory;
Priority = TimerPriority.OneMinute;
}
protected override void OnTick()
{
BaseHouse house = m_Inventory.House;
if ( house != null )
{
if ( m_Inventory.Gold > 0 )
{
if ( house.MovingCrate == null )
house.MovingCrate = new MovingCrate( house );
Innkeeper.Deposit( house.MovingCrate, m_Inventory.Gold );
}
foreach ( Item item in m_Inventory.Items )
{
if ( !item.Deleted )
house.DropToMovingCrate( item );
}
m_Inventory.Gold = 0;
m_Inventory.Items.Clear();
}
m_Inventory.Delete();
}
}
}
}

View file

@ -0,0 +1,91 @@
using System;
using System.Collections;
using Server.Items;
using Server.Targeting;
namespace Server.Mobiles
{
[CorpseName( "an ant lion corpse" )]
public class AntLion : BaseCreature
{
[Constructable]
public AntLion() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "an ant lion";
Body = 11;
BaseSoundID = 1006;
SetStr( 296, 320 );
SetDex( 81, 105 );
SetInt( 36, 60 );
SetHits( 151, 162 );
SetDamage( 7, 21 );
SetSkill( SkillName.MagicResist, 70.0 );
SetSkill( SkillName.Tactics, 90.0 );
SetSkill( SkillName.HandToHand, 90.0 );
Fame = 4500;
Karma = -4500;
VirtualArmor = 45;
PackItem( new Bone( 3 ) );
Item orepile = new IronOre();
orepile.Amount = Utility.RandomMinMax(10, 100);
orepile.ItemID = 0x19B9;
PackItem(orepile);
// TODO: skeleton
}
public override int GetAngerSound()
{
return 0x5A;
}
public override int GetIdleSound()
{
return 0x5A;
}
public override int GetAttackSound()
{
return 0x164;
}
public override int GetHurtSound()
{
return 0x187;
}
public override int GetDeathSound()
{
return 0x1BA;
}
public override void GenerateLoot()
{
AddLoot( LootPack.Average, 2 );
}
public AntLion( 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,61 @@
using System;
using System.Collections;
using Server.Items;
using Server.Network;
namespace Server.Mobiles
{
[CorpseName( "an antaur corpse" )]
public class AntaurLord : BaseCreature
{
[Constructable]
public AntaurLord() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "an antaur lord";
Body = 314;
BaseSoundID = 0x4F0;
SetStr( 588, 660 );
SetDex( 303, 375 );
SetInt( 108, 180 );
SetHits( 288, 321 );
SetDamage( 9, 30 );
SetSkill( SkillName.MagicResist, 90.0, 120.0 );
SetSkill( SkillName.Tactics, 90.0, 120.0 );
SetSkill( SkillName.HandToHand, 90.0, 120.0 );
Fame = 9000;
Karma = -9000;
VirtualArmor = 55;
}
public override void GenerateLoot()
{
AddLoot( LootPack.FilthyRich );
AddLoot( LootPack.MedPotions );
AddLoot( LootPack.HighPotions );
AddLoot( LootPack.Gems, 3 );
}
public AntaurLord( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 1 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
Hue = 0;
}
}
}

View file

@ -0,0 +1,55 @@
using System;
using System.Collections;
using Server.Items;
using Server.Network;
namespace Server.Mobiles
{
[CorpseName( "an antaur corpse" )]
public class AntaurQueen : BaseCreature
{
[Constructable]
public AntaurQueen() : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "an antaur queen";
Body = 179;
BaseSoundID = 0x4F0;
SetStr( 296, 320 );
SetDex( 121, 145 );
SetInt( 76, 100 );
SetHits( 151, 162 );
SetDamage( 10, 15 );
SetSkill( SkillName.Concentration, 70.1, 85.0 );
SetSkill( SkillName.Magery, 70.1, 85.0 );
SetSkill( SkillName.MagicResist, 60.1, 75.0 );
SetSkill( SkillName.Tactics, 80.1, 90.0 );
SetSkill( SkillName.HandToHand, 70.1, 90.0 );
Fame = 4500;
Karma = -4500;
VirtualArmor = 45;
}
public AntaurQueen( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 1 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
Hue = 0;
}
}
}

View file

@ -0,0 +1,58 @@
using System;
using System.Collections;
using Server.Items;
using Server.Network;
namespace Server.Mobiles
{
[CorpseName( "an antaur corpse" )]
public class AntaurSoldier : BaseCreature
{
[Constructable]
public AntaurSoldier() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "an antaur soldier";
Body = 178;
BaseSoundID = 0x4F0;
SetStr( 196, 220 );
SetDex( 101, 125 );
SetInt( 36, 60 );
SetHits( 96, 107 );
SetDamage( 5, 15 );
SetSkill( SkillName.MagicResist, 60.0 );
SetSkill( SkillName.Tactics, 80.0 );
SetSkill( SkillName.HandToHand, 80.0 );
Fame = 3000;
Karma = -3000;
VirtualArmor = 35;
}
public override void GenerateLoot()
{
AddLoot( LootPack.Average );
}
public AntaurSoldier( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 1 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
Hue = 0;
}
}
}

View file

@ -0,0 +1,58 @@
using System;
using System.Collections;
using Server.Items;
using Server.Targeting;
namespace Server.Mobiles
{
[CorpseName( "an antaur corpse" )]
public class AntaurWorker : BaseCreature
{
[Constructable]
public AntaurWorker() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "an antaur worker";
Body = 177;
BaseSoundID = 0x57F;
SetStr( 96, 120 );
SetDex( 81, 105 );
SetInt( 36, 60 );
SetHits( 58, 72 );
SetDamage( 5, 7 );
SetSkill( SkillName.MagicResist, 60.0 );
SetSkill( SkillName.Tactics, 65.0 );
SetSkill( SkillName.HandToHand, 60.0 );
Fame = 1500;
Karma = -1500;
VirtualArmor = 28;
}
public override void GenerateLoot()
{
AddLoot( LootPack.Meager );
}
public AntaurWorker( 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();
Hue = 0;
}
}
}

View file

@ -0,0 +1,78 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Items;
using Server.Targeting;
namespace Server.Mobiles
{
[CorpseName( "a beetle corpse" )]
public class ArcaneScarab : BaseCreature
{
[Constructable]
public ArcaneScarab() : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "an arcane scarab";
Body = 68;
BaseSoundID = 0x4E5;
SetStr( 401, 460 );
SetDex( 121, 170 );
SetInt( 376, 450 );
SetHits( 301, 360 );
SetDamage( 15, 22 );
SetSkill( SkillName.Concentration, 100.1, 125.0 );
SetSkill( SkillName.Magery, 100.1, 110.0 );
SetSkill( SkillName.Poisoning, 120.1, 140.0 );
SetSkill( SkillName.MagicResist, 95.1, 110.0 );
SetSkill( SkillName.Tactics, 78.1, 93.0 );
SetSkill( SkillName.HandToHand, 70.1, 77.5 );
Fame = 15000;
Karma = -15000;
VirtualArmor = 48;
switch ( Utility.Random( 10 ))
{
case 0: PackItem( new LeftArm() ); break;
case 1: PackItem( new RightArm() ); break;
case 2: PackItem( new Torso() ); break;
case 3: PackItem( new Bone() ); break;
case 4: PackItem( new RibCage() ); break;
case 5: PackItem( new RibCage() ); break;
case 6: PackItem( new BonePile() ); break;
case 7: PackItem( new BonePile() ); break;
case 8: PackItem( new BonePile() ); break;
case 9: PackItem( new BonePile() ); break;
}
}
public override void GenerateLoot()
{
AddLoot( LootPack.FilthyRich, 2 );
AddLoot( LootPack.MedScrolls, 1 );
}
public override Poison PoisonImmune{ get{ return Poison.Greater; } }
public override Poison HitPoison{ get{ return Poison.Greater; } }
public ArcaneScarab( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 1 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View file

@ -0,0 +1,63 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.ContextMenus;
namespace Server.Mobiles
{
[CorpseName( "a beetle corpse" )]
public class Beetle : BaseCreature
{
[Constructable]
public Beetle() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a giant beetle";
Body = 254;
BaseSoundID = 0x4E5;
SetStr( 296, 320 );
SetDex( 81, 105 );
SetInt( 36, 60 );
SetHits( 180, 220 );
SetMana( 0 );
SetDamage( 7, 16 );
SetSkill( SkillName.MagicResist, 60, 80.0 );
SetSkill( SkillName.Tactics, 80, 100.0 );
SetSkill( SkillName.HandToHand, 80, 100.0 );
Fame = 4000;
Karma = -4000;
VirtualArmor = 24;
}
public override void GenerateLoot()
{
AddLoot( LootPack.Average );
}
public Beetle( 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,88 @@
using System;
using Server.Items;
using Server.Targeting;
using System.Collections;
namespace Server.Mobiles
{
[CorpseName( "a spider corpse" )]
public class BloodSpider : BaseCreature
{
[Constructable]
public BloodSpider() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a blood spider";
Body = 193;
BaseSoundID = 0x388;
SetStr( 76, 100 );
SetDex( 96, 115 );
SetInt( 36, 60 );
SetHits( 46, 60 );
SetDamage( 5, 17 );
SetSkill( SkillName.Poisoning, 60.1, 80.0 );
SetSkill( SkillName.MagicResist, 45.1, 60.0 );
SetSkill( SkillName.Tactics, 65.1, 80.0 );
SetSkill( SkillName.HandToHand, 70.1, 85.0 );
Fame = 4000;
Karma = -4000;
VirtualArmor = 24;
PackItem( new SpidersSilk( 5 ) );
PackItem( new LesserPoisonPotion() );
PackItem( new LesserPoisonPotion() );
}
public override void GenerateLoot()
{
AddLoot( LootPack.Average );
}
public override Poison PoisonImmune{ get{ return Poison.Deadly; } }
public override Poison HitPoison{ get{ return Poison.Deadly; } }
public void DrainBlood( Mobile m )
{
DoHarmful( m );
new Blood().MoveToWorld( m.Location, m.Map );
m.SendMessage( "The creature feeds on your blood!" );
int toDrain = Utility.RandomMinMax( 2, 10 );
m.PlaySound( 0x23F );
Hits += toDrain;
m.Damage( toDrain, this );
}
public override void OnGaveMeleeAttack( Mobile defender )
{
base.OnGaveMeleeAttack( defender );
DrainBlood( defender );
}
public override void OnGotMeleeAttack( Mobile attacker )
{
base.OnGotMeleeAttack( attacker );
DrainBlood( attacker );
}
public BloodSpider( 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,59 @@
using System;
using System.Collections;
using Server;
using Server.Items;
namespace Server.Mobiles
{
[CorpseName( "a worm corpse" )]
public class CarcassWorm : BaseCreature
{
[Constructable]
public CarcassWorm () : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a carcass worm";
Body = 143;
BaseSoundID = 0x382;
AnimationMod = 6;
SetStr( 38, 52 );
SetDex( 12, 17 );
SetInt( 1, 5 );
SetHits( 19, 25 );
SetDamage( 2, 8 );
SetSkill( SkillName.Tactics, 80.1, 90.0 );
SetSkill( SkillName.HandToHand, 80.1, 90.0 );
Fame = 450;
Karma = -450;
VirtualArmor = 12;
}
public override void GenerateLoot()
{
AddLoot( LootPack.Poor );
}
public override int Meat{ get{ return 4; } }
public CarcassWorm( 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,65 @@
using System;
using System.Collections;
using Server.Items;
using Server.Targeting;
namespace Server.Mobiles
{
[CorpseName( "a scorpion corpse" )]
public class DeadlyScorpion : BaseCreature
{
[Constructable]
public DeadlyScorpion() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a scorpion";
Body = 147;
BaseSoundID = 397;
SetStr( 103, 145 );
SetDex( 76, 95 );
SetInt( 16, 30 );
SetHits( 80, 93 );
SetMana( 0 );
SetDamage( 9, 14 );
SetSkill( SkillName.Poisoning, 80.1, 100.0 );
SetSkill( SkillName.MagicResist, 30.1, 35.0 );
SetSkill( SkillName.Tactics, 80.3, 95.0 );
SetSkill( SkillName.HandToHand, 60.3, 98.0 );
Fame = 4000;
Karma = -4000;
VirtualArmor = 48;
PackItem( new DeadlyPoisonPotion() );
}
public override void GenerateLoot()
{
AddLoot( LootPack.Average );
}
public override int Meat{ get{ return 1; } }
public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
public override Poison HitPoison{ get{ return (0.8 >= Utility.RandomDouble() ? Poison.Deadly : Poison.Lethal); } }
public DeadlyScorpion( 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,67 @@
using System;
using Server;
using Server.Items;
namespace Server.Mobiles
{
[CorpseName( "a spider corpse" )]
public class DreadSpider : BaseCreature
{
[Constructable]
public DreadSpider () : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a dread spider";
Body = 27;
BaseSoundID = 1170;
SetStr( 196, 220 );
SetDex( 126, 145 );
SetInt( 286, 310 );
SetHits( 118, 132 );
SetDamage( 5, 17 );
SetSkill( SkillName.Concentration, 65.1, 80.0 );
SetSkill( SkillName.Magery, 65.1, 80.0 );
SetSkill( SkillName.Meditation, 65.1, 80.0 );
SetSkill( SkillName.MagicResist, 45.1, 60.0 );
SetSkill( SkillName.Tactics, 55.1, 70.0 );
SetSkill( SkillName.HandToHand, 60.1, 75.0 );
Fame = 5000;
Karma = -5000;
VirtualArmor = 36;
PackItem( new SpidersSilk( 8 ) );
}
public override void GenerateLoot()
{
AddLoot( LootPack.FilthyRich );
}
public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
public override Poison HitPoison{ get{ return Poison.Lethal; } }
public DreadSpider( 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();
if ( BaseSoundID == 263 )
BaseSoundID = 1170;
}
}
}

View file

@ -0,0 +1,65 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.ContextMenus;
namespace Server.Mobiles
{
[CorpseName( "a beetle corpse" )]
public class FireBeetle : BaseCreature
{
public override bool HasBreath{ get{ return true; } } // fire breath enabled
[Constructable]
public FireBeetle() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a fire beetle";
Body = 240;
BaseSoundID = 0x4E5;
SetStr( 296, 320 );
SetDex( 81, 105 );
SetInt( 36, 60 );
SetHits( 180, 220 );
SetMana( 0 );
SetDamage( 7, 16 );
SetSkill( SkillName.MagicResist, 60, 80.0 );
SetSkill( SkillName.Tactics, 80, 100.0 );
SetSkill( SkillName.HandToHand, 80, 100.0 );
Fame = 4000;
Karma = -4000;
VirtualArmor = 24;
}
public override void GenerateLoot()
{
AddLoot( LootPack.Average );
}
public FireBeetle( 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,66 @@
using System;
using System.Collections;
using Server.Items;
using Server.Targeting;
namespace Server.Mobiles
{
[CorpseName( "a insect corpse" )]
public class FlameCrawler : BaseCreature
{
[Constructable]
public FlameCrawler() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a flame crawler";
Body = 158;
BaseSoundID = 397;
SetStr( 103, 145 );
SetDex( 76, 95 );
SetInt( 16, 30 );
SetHits( 80, 93 );
SetMana( 0 );
SetDamage( 9, 14 );
SetSkill( SkillName.Poisoning, 80.1, 100.0 );
SetSkill( SkillName.MagicResist, 30.1, 35.0 );
SetSkill( SkillName.Tactics, 80.3, 95.0 );
SetSkill( SkillName.HandToHand, 60.3, 98.0 );
Fame = 4000;
Karma = -4000;
VirtualArmor = 48;
PackItem( new DeadlyPoisonPotion() );
AddItem( new LightSource() );
}
public override void GenerateLoot()
{
AddLoot( LootPack.Average );
}
public override int Meat{ get{ return 1; } }
public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
public override Poison HitPoison{ get{ return (0.8 >= Utility.RandomDouble() ? Poison.Deadly : Poison.Lethal); } }
public FlameCrawler( 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,61 @@
using System;
using Server.Items;
namespace Server.Mobiles
{
[CorpseName( "a spider corpse" )]
public class FrostSpider : BaseCreature
{
[Constructable]
public FrostSpider() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a frost spider";
Body = 96;
BaseSoundID = 0x388;
SetStr( 76, 100 );
SetDex( 126, 145 );
SetInt( 36, 60 );
SetHits( 46, 60 );
SetMana( 0 );
SetDamage( 6, 16 );
SetSkill( SkillName.MagicResist, 25.1, 40.0 );
SetSkill( SkillName.Tactics, 35.1, 50.0 );
SetSkill( SkillName.HandToHand, 50.1, 65.0 );
Fame = 775;
Karma = -775;
VirtualArmor = 28;
PackItem( new SpidersSilk( 7 ) );
}
public override void GenerateLoot()
{
AddLoot( LootPack.Meager );
}
public FrostSpider( 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();
if ( BaseSoundID == 387 )
BaseSoundID = 0x388;
}
}
}

View file

@ -0,0 +1,65 @@
using System;
using Server.Items;
using Server.Targeting;
using System.Collections;
namespace Server.Mobiles
{
[CorpseName( "a spider corpse" )]
public class GiantBlackWidow : BaseCreature
{
[Constructable]
public GiantBlackWidow() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a giant black widow";
Body = 19;
BaseSoundID = 0x388; // TODO: validate
SetStr( 76, 100 );
SetDex( 96, 115 );
SetInt( 36, 60 );
SetHits( 46, 60 );
SetDamage( 5, 17 );
SetSkill( SkillName.Poisoning, 60.1, 80.0 );
SetSkill( SkillName.MagicResist, 45.1, 60.0 );
SetSkill( SkillName.Tactics, 65.1, 80.0 );
SetSkill( SkillName.HandToHand, 70.1, 85.0 );
Fame = 3500;
Karma = -3500;
VirtualArmor = 24;
PackItem( new SpidersSilk( 5 ) );
PackItem( new LesserPoisonPotion() );
PackItem( new LesserPoisonPotion() );
}
public override void GenerateLoot()
{
AddLoot( LootPack.Meager );
}
public override Poison PoisonImmune{ get{ return Poison.Deadly; } }
public override Poison HitPoison{ get{ return Poison.Deadly; } }
public GiantBlackWidow( 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,66 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.ContextMenus;
namespace Server.Mobiles
{
[CorpseName( "a scarab corpse" )]
public class GiantScarab : BaseCreature
{
[Constructable]
public GiantScarab() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a giant scarab";
Body = 263;
BaseSoundID = 0x4F0;
AnimationMod = 2;
SetStr( 296, 320 );
SetDex( 81, 105 );
SetInt( 36, 60 );
SetHits( 175, 200 );
SetDamage( 7, 20 );
SetSkill( SkillName.MagicResist, 60.0 );
SetSkill( SkillName.Tactics, 90.0 );
SetSkill( SkillName.HandToHand, 90.0 );
Fame = 4500;
Karma = -4500;
VirtualArmor = 24;
}
public override void GenerateLoot()
{
AddLoot( LootPack.Average );
}
public override Poison PoisonImmune{ get{ return Poison.Greater; } }
public override Poison HitPoison{ get{ return Poison.Greater; } }
public GiantScarab( 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,64 @@
using System;
using Server.Items;
using Server.Targeting;
using System.Collections;
namespace Server.Mobiles
{
[CorpseName( "a spider corpse" )]
public class GiantSpider : BaseCreature
{
[Constructable]
public GiantSpider() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a giant spider";
Body = 28;
BaseSoundID = 0x388;
SetStr( 76, 100 );
SetDex( 76, 95 );
SetInt( 36, 60 );
SetHits( 46, 60 );
SetMana( 0 );
SetDamage( 5, 13 );
SetSkill( SkillName.Poisoning, 60.1, 80.0 );
SetSkill( SkillName.MagicResist, 25.1, 40.0 );
SetSkill( SkillName.Tactics, 35.1, 50.0 );
SetSkill( SkillName.HandToHand, 50.1, 65.0 );
Fame = 600;
Karma = -600;
VirtualArmor = 16;
PackItem( new SpidersSilk( 5 ) );
}
public override void GenerateLoot()
{
AddLoot( LootPack.Poor );
}
public override Poison PoisonImmune{ get{ return Poison.Regular; } }
public override Poison HitPoison{ get{ return Poison.Regular; } }
public GiantSpider( 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();
}
}
}

Some files were not shown because too many files have changed in this diff Show more