using Server.Items;
using System;
namespace Server.Mobiles
{
[CorpseName("an oompa corpse")]
public class Oompa : BaseCreature
{
[Constructable]
public Oompa()
: base(AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.1, 0.2)
{
Name = "an oompa";
Body = 334;
Hue = 1260;
SetStr(15);
SetDex(2000);
SetInt(1000);
SetHits(800);
SetStam(2000);
SetMana(2000);
SetDamage(1);
SetDamageType(ResistanceType.Physical, 100);
SetSkill(SkillName.Magery, 200.0);
SetSkill(SkillName.MagicResist, 200.0);
SetSkill(SkillName.Tactics, 5.0);
SetSkill(SkillName.Wrestling, 200.0);
Fame = 1000;
Karma = 0;
DelayBeginTunnel();
ForceActiveSpeed = 0.2;
ForcePassiveSpeed = 0.4;
}
public Oompa(Serial serial)
: base(serial)
{
}
public override double FleeChance => 1.0;
public override double BreakFleeChance => 0.05;
public override void GenerateLoot()
{
AddLoot(LootPack.Rich, 1);
}
public override bool OnBeforeDeath()
{
Gold gold = new Gold(Utility.RandomMinMax(120, 300));
if ( 50.0 > Utility.RandomDouble() )
{
switch (Utility.RandomMinMax( 1, 12 ))
{
case 0: PackItem(new ChocolateBeetle()); break;
case 1: PackItem (new ChocolateBunny()); break;
case 2: PackItem(new ChocolateOrc()); break;
case 3: PackItem(new ChocolateSolen()); break;
case 4: PackItem(new ChocolateUnicorn()); break;
case 5: PackItem(new NutcrackerMold()); break;
case 6: PackItem(new OrcMold()); break;
case 7: PackItem(new BeetleMold()); break;
case 8: PackItem(new BunnyMold()); break;
case 9: PackItem(new SolenMold()); break;
case 10: PackItem(new UnicornMold()); break;
case 11: PackItem(new GoldFoil()); break;
}
}
return base.OnBeforeDeath();
}
public override bool CheckFlee()
{
return true;
}
public override bool CheckBreakFlee()
{
return false;
}
public override bool BreakFlee()
{
NextFleeCheck = Core.TickCount + 1500;
return true;
}
public virtual void DelayBeginTunnel()
{
Timer.DelayCall(TimeSpan.FromMinutes(3.0), BeginTunnel);
}
public virtual void BeginTunnel()
{
if (Deleted)
return;
new BunnyHole().MoveToWorld(Location, Map);
Frozen = true;
Say("* The oompa mysteriously vanishes! *");
PlaySound(0x247);
Timer.DelayCall(TimeSpan.FromSeconds(5.0), Delete);
}
public override int GetAttackSound() { return 0x55C; }
public override int GetHurtSound() { return 0x542; }
public override int GetDeathSound() { return 0x55D; }
public override void OnDeath(Container c)
{
base.OnDeath(c);
if (Paragon.ChestChance > Utility.RandomDouble())
c.DropItem(new ParagonChest(Name, 5));
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
DelayBeginTunnel();
}
public class BunnyHole : Item
{
public BunnyHole()
: base(0x913)
{
Movable = false;
Hue = 1;
Name = "a mysterious hole";
Timer.DelayCall(TimeSpan.FromSeconds(40.0), Delete);
}
public BunnyHole(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
Delete();
}
}
}
[CorpseName("an loompa corpse")]
public class Loompa : BaseCreature
{
[Constructable]
public Loompa()
: base(AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.1, 0.2)
{
Name = "an oompa";
Body = 334;
Hue = 1260;
SetStr(15);
SetDex(2000);
SetInt(1000);
SetHits(800);
SetStam(2000);
SetMana(2000);
SetDamage(1);
SetDamageType(ResistanceType.Physical, 100);
SetSkill(SkillName.Magery, 200.0);
SetSkill(SkillName.MagicResist, 200.0);
SetSkill(SkillName.Tactics, 5.0);
SetSkill(SkillName.Wrestling, 200.0);
Fame = 1000;
Karma = 0;
DelayBeginTunnel();
ForceActiveSpeed = 0.2;
ForcePassiveSpeed = 0.4;
}
public Loompa(Serial serial)
: base(serial)
{
}
public override double FleeChance => 1.0;
public override double BreakFleeChance => 0.05;
public override void GenerateLoot()
{
AddLoot(LootPack.Rich, 1);
}
public override bool OnBeforeDeath()
{
Gold gold = new Gold(Utility.RandomMinMax(120, 300));
if ( 50.0 > Utility.RandomDouble() )
{
switch (Utility.RandomMinMax( 1, 12 ))
{
case 0: PackItem(new ChocolateBeetle()); break;
case 1: PackItem (new ChocolateBunny()); break;
case 2: PackItem(new ChocolateOrc()); break;
case 3: PackItem(new ChocolateSolen()); break;
case 4: PackItem(new ChocolateUnicorn()); break;
case 5: PackItem(new NutcrackerMold()); break;
case 6: PackItem(new OrcMold()); break;
case 7: PackItem(new BeetleMold()); break;
case 8: PackItem(new BunnyMold()); break;
case 9: PackItem(new SolenMold()); break;
case 10: PackItem(new UnicornMold()); break;
case 11: PackItem(new GoldFoil()); break;
}
}
return base.OnBeforeDeath();
}
public override bool CheckFlee()
{
return true;
}
public override bool CheckBreakFlee()
{
return false;
}
public override bool BreakFlee()
{
NextFleeCheck = Core.TickCount + 1500;
return true;
}
public virtual void DelayBeginTunnel()
{
Timer.DelayCall(TimeSpan.FromMinutes(3.0), BeginTunnel);
}
public virtual void BeginTunnel()
{
if (Deleted)
return;
new BunnyHole().MoveToWorld(Location, Map);
Frozen = true;
Say("* The oompa mysteriously vanishes! *");
PlaySound(0x247);
Timer.DelayCall(TimeSpan.FromSeconds(5.0), Delete);
}
public override int GetAttackSound() { return 0x55C; }
public override int GetHurtSound() { return 0x542; }
public override int GetDeathSound() { return 0x55D; }
public override void OnDeath(Container c)
{
base.OnDeath(c);
if (Paragon.ChestChance > Utility.RandomDouble())
c.DropItem(new ParagonChest(Name, 5));
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
DelayBeginTunnel();
}
public class BunnyHole : Item
{
public BunnyHole()
: base(0x913)
{
Movable = false;
Hue = 1;
Name = "a mysterious hole";
Timer.DelayCall(TimeSpan.FromSeconds(40.0), Delete);
}
public BunnyHole(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
Delete();
}
}
}
}