This commit is contained in:
commit
47711d616e
2644 changed files with 479454 additions and 0 deletions
4792
Scripts/Engines/AI/Creature/BaseCreature.cs
Normal file
4792
Scripts/Engines/AI/Creature/BaseCreature.cs
Normal file
File diff suppressed because it is too large
Load diff
152
Scripts/Engines/AI/Creature/Dummy.cs
Normal file
152
Scripts/Engines/AI/Creature/Dummy.cs
Normal file
|
|
@ -0,0 +1,152 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
/// <summary>
|
||||
/// This is a test creature
|
||||
/// You can set its value in game
|
||||
/// It die after 5 minutes, so your test server stay clean
|
||||
/// Create a macro to help your creation "[add Dummy 1 15 7 -1 0.5 2"
|
||||
///
|
||||
/// A iTeam of negative will set a faction at random
|
||||
///
|
||||
/// Say Kill if you want them to die
|
||||
///
|
||||
/// </summary>
|
||||
public class Dummy : BaseCreature
|
||||
{
|
||||
public Timer m_Timer;
|
||||
|
||||
[Constructable]
|
||||
public Dummy(AIType iAI, FightMode iFightMode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed) : base(iAI, iFightMode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed)
|
||||
{
|
||||
this.Body = 400 + Utility.Random(2);
|
||||
this.Hue = Utility.RandomSkinHue();
|
||||
|
||||
this.Skills[SkillName.DetectHidden].Base = 100;
|
||||
this.Skills[SkillName.MagicResist].Base = 120;
|
||||
|
||||
Team = Utility.Random(3);
|
||||
|
||||
int iHue = 20 + Team * 40;
|
||||
int jHue = 25 + Team * 40;
|
||||
|
||||
Utility.AssignRandomHair( this, iHue );
|
||||
|
||||
LeatherGloves glv = new LeatherGloves();
|
||||
glv.Hue = iHue;
|
||||
glv.LootType = LootType.Newbied;
|
||||
AddItem(glv);
|
||||
|
||||
Container pack = new Backpack();
|
||||
|
||||
pack.Movable = false;
|
||||
|
||||
AddItem( pack );
|
||||
|
||||
m_Timer = new AutokillTimer(this);
|
||||
m_Timer.Start();
|
||||
}
|
||||
|
||||
public Dummy( Serial serial ) : base( serial )
|
||||
{
|
||||
m_Timer = new AutokillTimer(this);
|
||||
m_Timer.Start();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public override bool HandlesOnSpeech( Mobile from )
|
||||
{
|
||||
if ( from.AccessLevel >= AccessLevel.GameMaster )
|
||||
return true;
|
||||
|
||||
return base.HandlesOnSpeech( from );
|
||||
}
|
||||
|
||||
public override void OnSpeech( SpeechEventArgs e )
|
||||
{
|
||||
base.OnSpeech( e );
|
||||
|
||||
if (e.Mobile.AccessLevel >= AccessLevel.GameMaster)
|
||||
{
|
||||
if (e.Speech == "kill")
|
||||
{
|
||||
m_Timer.Stop();
|
||||
m_Timer.Delay = TimeSpan.FromSeconds( Utility.Random(1, 5) );
|
||||
m_Timer.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnTeamChange()
|
||||
{
|
||||
int iHue = 20 + Team * 40;
|
||||
int jHue = 25 + Team * 40;
|
||||
|
||||
Item item = FindItemOnLayer( Layer.OuterTorso );
|
||||
|
||||
if ( item != null )
|
||||
item.Hue = jHue;
|
||||
|
||||
item = FindItemOnLayer( Layer.Helm );
|
||||
|
||||
if ( item != null )
|
||||
item.Hue = iHue;
|
||||
|
||||
item = FindItemOnLayer( Layer.Gloves );
|
||||
|
||||
if ( item != null )
|
||||
item.Hue = iHue;
|
||||
|
||||
item = FindItemOnLayer( Layer.Shoes );
|
||||
|
||||
if ( item != null )
|
||||
item.Hue = iHue;
|
||||
|
||||
HairHue = iHue;
|
||||
|
||||
item = FindItemOnLayer( Layer.MiddleTorso );
|
||||
|
||||
if ( item != null )
|
||||
item.Hue = iHue;
|
||||
|
||||
item = FindItemOnLayer( Layer.OuterLegs );
|
||||
|
||||
if ( item != null )
|
||||
item.Hue = iHue;
|
||||
}
|
||||
|
||||
private class AutokillTimer : Timer
|
||||
{
|
||||
private Dummy m_Owner;
|
||||
|
||||
public AutokillTimer( Dummy owner ) : base( TimeSpan.FromMinutes(5.0) )
|
||||
{
|
||||
m_Owner = owner;
|
||||
Priority = TimerPriority.FiveSeconds;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Owner.Kill();
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
814
Scripts/Engines/AI/Creature/DummySpecific.cs
Normal file
814
Scripts/Engines/AI/Creature/DummySpecific.cs
Normal file
|
|
@ -0,0 +1,814 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
/// <summary>
|
||||
/// This is a test creature
|
||||
/// You can set its value in game
|
||||
/// It die after 5 minutes, so your test server stay clean
|
||||
/// Create a macro to help your creation "[add Dummy 1 15 7 -1 0.5 2"
|
||||
///
|
||||
/// A iTeam of negative will set a faction at random
|
||||
///
|
||||
/// Say Kill if you want them to die
|
||||
///
|
||||
/// </summary>
|
||||
|
||||
public class DummyMace : Dummy
|
||||
{
|
||||
|
||||
[Constructable]
|
||||
public DummyMace() : base(AIType.AI_Melee, FightMode.Closest, 15, 1, 0.2, 0.6)
|
||||
{
|
||||
// A Dummy Macer
|
||||
int iHue = 20 + Team * 40;
|
||||
int jHue = 25 + Team * 40;
|
||||
|
||||
// Skills and Stats
|
||||
this.InitStats( 125, 125, 90 );
|
||||
this.Skills[SkillName.Macing].Base = 120;
|
||||
this.Skills[SkillName.Anatomy].Base = 120;
|
||||
this.Skills[SkillName.Healing].Base = 120;
|
||||
this.Skills[SkillName.Tactics].Base = 120;
|
||||
|
||||
|
||||
// Name
|
||||
this.Name = "Macer";
|
||||
|
||||
// Equip
|
||||
WarHammer war = new WarHammer();
|
||||
war.Movable = true;
|
||||
war.Crafter = this;
|
||||
war.Quality = WeaponQuality.Regular;
|
||||
AddItem( war );
|
||||
|
||||
Boots bts = new Boots();
|
||||
bts.Hue = iHue;
|
||||
AddItem( bts );
|
||||
|
||||
ChainChest cht = new ChainChest();
|
||||
cht.Movable = false;
|
||||
cht.LootType = LootType.Newbied;
|
||||
cht.Crafter = this;
|
||||
cht.Quality = ArmorQuality.Regular;
|
||||
AddItem( cht );
|
||||
|
||||
ChainLegs chl = new ChainLegs();
|
||||
chl.Movable = false;
|
||||
chl.LootType = LootType.Newbied;
|
||||
chl.Crafter = this;
|
||||
chl.Quality = ArmorQuality.Regular;
|
||||
AddItem( chl );
|
||||
|
||||
PlateArms pla = new PlateArms();
|
||||
pla.Movable = false;
|
||||
pla.LootType = LootType.Newbied;
|
||||
pla.Crafter = this;
|
||||
pla.Quality = ArmorQuality.Regular;
|
||||
AddItem( pla );
|
||||
|
||||
Bandage band = new Bandage( 50 );
|
||||
AddToBackpack( band );
|
||||
}
|
||||
|
||||
public DummyMace( 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();
|
||||
}
|
||||
}
|
||||
|
||||
public class DummyFence : Dummy
|
||||
{
|
||||
|
||||
[Constructable]
|
||||
public DummyFence() : base(AIType.AI_Melee, FightMode.Closest, 15, 1, 0.2, 0.6)
|
||||
{
|
||||
// A Dummy Fencer
|
||||
int iHue = 20 + Team * 40;
|
||||
int jHue = 25 + Team * 40;
|
||||
|
||||
// Skills and Stats
|
||||
this.InitStats( 125, 125, 90 );
|
||||
this.Skills[SkillName.Fencing].Base = 120;
|
||||
this.Skills[SkillName.Anatomy].Base = 120;
|
||||
this.Skills[SkillName.Healing].Base = 120;
|
||||
this.Skills[SkillName.Tactics].Base = 120;
|
||||
|
||||
// Name
|
||||
this.Name = "Fencer";
|
||||
|
||||
// Equip
|
||||
Spear ssp = new Spear();
|
||||
ssp.Movable = true;
|
||||
ssp.Crafter = this;
|
||||
ssp.Quality = WeaponQuality.Regular;
|
||||
AddItem( ssp );
|
||||
|
||||
Boots snd = new Boots();
|
||||
snd.Hue = iHue;
|
||||
snd.LootType = LootType.Newbied;
|
||||
AddItem( snd );
|
||||
|
||||
ChainChest cht = new ChainChest();
|
||||
cht.Movable = false;
|
||||
cht.LootType = LootType.Newbied;
|
||||
cht.Crafter = this;
|
||||
cht.Quality = ArmorQuality.Regular;
|
||||
AddItem( cht );
|
||||
|
||||
ChainLegs chl = new ChainLegs();
|
||||
chl.Movable = false;
|
||||
chl.LootType = LootType.Newbied;
|
||||
chl.Crafter = this;
|
||||
chl.Quality = ArmorQuality.Regular;
|
||||
AddItem( chl );
|
||||
|
||||
PlateArms pla = new PlateArms();
|
||||
pla.Movable = false;
|
||||
pla.LootType = LootType.Newbied;
|
||||
pla.Crafter = this;
|
||||
pla.Quality = ArmorQuality.Regular;
|
||||
AddItem( pla );
|
||||
|
||||
Bandage band = new Bandage( 50 );
|
||||
AddToBackpack( band );
|
||||
}
|
||||
|
||||
public DummyFence( 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();
|
||||
}
|
||||
}
|
||||
|
||||
public class DummySword : Dummy
|
||||
{
|
||||
|
||||
[Constructable]
|
||||
public DummySword() : base(AIType.AI_Melee, FightMode.Closest, 15, 1, 0.2, 0.6)
|
||||
{
|
||||
// A Dummy Swordsman
|
||||
int iHue = 20 + Team * 40;
|
||||
int jHue = 25 + Team * 40;
|
||||
|
||||
// Skills and Stats
|
||||
this.InitStats( 125, 125, 90 );
|
||||
this.Skills[SkillName.Swords].Base = 120;
|
||||
this.Skills[SkillName.Anatomy].Base = 120;
|
||||
this.Skills[SkillName.Healing].Base = 120;
|
||||
this.Skills[SkillName.Tactics].Base = 120;
|
||||
this.Skills[SkillName.Parry].Base = 120;
|
||||
|
||||
|
||||
// Name
|
||||
this.Name = "Swordsman";
|
||||
|
||||
// Equip
|
||||
Katana kat = new Katana();
|
||||
kat.Crafter = this;
|
||||
kat.Movable = true;
|
||||
kat.Quality = WeaponQuality.Regular;
|
||||
AddItem( kat );
|
||||
|
||||
Boots bts = new Boots();
|
||||
bts.Hue = iHue;
|
||||
AddItem( bts );
|
||||
|
||||
ChainChest cht = new ChainChest();
|
||||
cht.Movable = false;
|
||||
cht.LootType = LootType.Newbied;
|
||||
cht.Crafter = this;
|
||||
cht.Quality = ArmorQuality.Regular;
|
||||
AddItem( cht );
|
||||
|
||||
ChainLegs chl = new ChainLegs();
|
||||
chl.Movable = false;
|
||||
chl.LootType = LootType.Newbied;
|
||||
chl.Crafter = this;
|
||||
chl.Quality = ArmorQuality.Regular;
|
||||
AddItem( chl );
|
||||
|
||||
PlateArms pla = new PlateArms();
|
||||
pla.Movable = false;
|
||||
pla.LootType = LootType.Newbied;
|
||||
pla.Crafter = this;
|
||||
pla.Quality = ArmorQuality.Regular;
|
||||
AddItem( pla );
|
||||
|
||||
Bandage band = new Bandage( 50 );
|
||||
AddToBackpack( band );
|
||||
}
|
||||
|
||||
public DummySword( 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();
|
||||
}
|
||||
}
|
||||
|
||||
public class DummyNox : Dummy
|
||||
{
|
||||
|
||||
[Constructable]
|
||||
public DummyNox() : base(AIType.AI_Mage, FightMode.Closest, 15, 1, 0.2, 0.6)
|
||||
{
|
||||
|
||||
// A Dummy Nox or Pure Mage
|
||||
int iHue = 20 + Team * 40;
|
||||
int jHue = 25 + Team * 40;
|
||||
|
||||
// Skills and Stats
|
||||
this.InitStats( 90, 90, 125 );
|
||||
this.Skills[SkillName.Magery].Base = 120;
|
||||
this.Skills[SkillName.EvalInt].Base = 120;
|
||||
this.Skills[SkillName.Inscribe].Base = 100;
|
||||
this.Skills[SkillName.Wrestling].Base = 120;
|
||||
this.Skills[SkillName.Meditation].Base = 120;
|
||||
this.Skills[SkillName.Poisoning].Base = 100;
|
||||
|
||||
|
||||
// Name
|
||||
this.Name = "Nox Mage";
|
||||
|
||||
// Equip
|
||||
Spellbook book = new Spellbook();
|
||||
book.Movable = false;
|
||||
book.LootType = LootType.Newbied;
|
||||
book.Content =0xFFFFFFFFFFFFFFFF;
|
||||
AddItem( book );
|
||||
|
||||
Kilt kilt = new Kilt();
|
||||
kilt.Hue = jHue;
|
||||
AddItem( kilt );
|
||||
|
||||
Sandals snd = new Sandals();
|
||||
snd.Hue = iHue;
|
||||
snd.LootType = LootType.Newbied;
|
||||
AddItem( snd );
|
||||
|
||||
SkullCap skc = new SkullCap();
|
||||
skc.Hue = iHue;
|
||||
AddItem( skc );
|
||||
|
||||
// Spells
|
||||
AddSpellAttack( typeof(Spells.First.MagicArrowSpell) );
|
||||
AddSpellAttack( typeof(Spells.First.WeakenSpell) );
|
||||
AddSpellAttack( typeof(Spells.Third.FireballSpell) );
|
||||
AddSpellDefense( typeof(Spells.Third.WallOfStoneSpell) );
|
||||
AddSpellDefense( typeof(Spells.First.HealSpell) );
|
||||
}
|
||||
|
||||
public DummyNox( 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();
|
||||
}
|
||||
}
|
||||
|
||||
public class DummyStun : Dummy
|
||||
{
|
||||
|
||||
[Constructable]
|
||||
public DummyStun() : base(AIType.AI_Mage, FightMode.Closest, 15, 1, 0.2, 0.6)
|
||||
{
|
||||
|
||||
// A Dummy Stun Mage
|
||||
int iHue = 20 + Team * 40;
|
||||
int jHue = 25 + Team * 40;
|
||||
|
||||
// Skills and Stats
|
||||
this.InitStats( 90, 90, 125 );
|
||||
this.Skills[SkillName.Magery].Base = 100;
|
||||
this.Skills[SkillName.EvalInt].Base = 120;
|
||||
this.Skills[SkillName.Anatomy].Base = 80;
|
||||
this.Skills[SkillName.Wrestling].Base = 80;
|
||||
this.Skills[SkillName.Meditation].Base = 100;
|
||||
this.Skills[SkillName.Poisoning].Base = 100;
|
||||
|
||||
|
||||
// Name
|
||||
this.Name = "Stun Mage";
|
||||
|
||||
// Equip
|
||||
Spellbook book = new Spellbook();
|
||||
book.Movable = false;
|
||||
book.LootType = LootType.Newbied;
|
||||
book.Content =0xFFFFFFFFFFFFFFFF;
|
||||
AddItem( book );
|
||||
|
||||
LeatherArms lea = new LeatherArms();
|
||||
lea.Movable = false;
|
||||
lea.LootType = LootType.Newbied;
|
||||
lea.Crafter = this;
|
||||
lea.Quality = ArmorQuality.Regular;
|
||||
AddItem( lea );
|
||||
|
||||
LeatherChest lec = new LeatherChest();
|
||||
lec.Movable = false;
|
||||
lec.LootType = LootType.Newbied;
|
||||
lec.Crafter = this;
|
||||
lec.Quality = ArmorQuality.Regular;
|
||||
AddItem( lec );
|
||||
|
||||
LeatherGorget leg = new LeatherGorget();
|
||||
leg.Movable = false;
|
||||
leg.LootType = LootType.Newbied;
|
||||
leg.Crafter = this;
|
||||
leg.Quality = ArmorQuality.Regular;
|
||||
AddItem( leg );
|
||||
|
||||
LeatherLegs lel = new LeatherLegs();
|
||||
lel.Movable = false;
|
||||
lel.LootType = LootType.Newbied;
|
||||
lel.Crafter = this;
|
||||
lel.Quality = ArmorQuality.Regular;
|
||||
AddItem( lel );
|
||||
|
||||
Boots bts = new Boots();
|
||||
bts.Hue = iHue;
|
||||
AddItem( bts );
|
||||
|
||||
Cap cap = new Cap();
|
||||
cap.Hue = iHue;
|
||||
AddItem( cap );
|
||||
|
||||
// Spells
|
||||
AddSpellAttack( typeof(Spells.First.MagicArrowSpell) );
|
||||
AddSpellAttack( typeof(Spells.First.WeakenSpell) );
|
||||
AddSpellAttack( typeof(Spells.Third.FireballSpell) );
|
||||
AddSpellDefense( typeof(Spells.Third.WallOfStoneSpell) );
|
||||
AddSpellDefense( typeof(Spells.First.HealSpell) );
|
||||
}
|
||||
|
||||
public DummyStun( 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();
|
||||
}
|
||||
}
|
||||
|
||||
public class DummySuper : Dummy
|
||||
{
|
||||
|
||||
[Constructable]
|
||||
public DummySuper() : base(AIType.AI_Mage, FightMode.Closest, 15, 1, 0.2, 0.6)
|
||||
{
|
||||
// A Dummy Super Mage
|
||||
int iHue = 20 + Team * 40;
|
||||
int jHue = 25 + Team * 40;
|
||||
|
||||
// Skills and Stats
|
||||
this.InitStats( 125, 125, 125 );
|
||||
this.Skills[SkillName.Magery].Base = 120;
|
||||
this.Skills[SkillName.EvalInt].Base = 120;
|
||||
this.Skills[SkillName.Anatomy].Base = 120;
|
||||
this.Skills[SkillName.Wrestling].Base = 120;
|
||||
this.Skills[SkillName.Meditation].Base = 120;
|
||||
this.Skills[SkillName.Poisoning].Base = 100;
|
||||
this.Skills[SkillName.Inscribe].Base = 100;
|
||||
|
||||
// Name
|
||||
this.Name = "Super Mage";
|
||||
|
||||
// Equip
|
||||
Spellbook book = new Spellbook();
|
||||
book.Movable = false;
|
||||
book.LootType = LootType.Newbied;
|
||||
book.Content =0xFFFFFFFFFFFFFFFF;
|
||||
AddItem( book );
|
||||
|
||||
LeatherArms lea = new LeatherArms();
|
||||
lea.Movable = false;
|
||||
lea.LootType = LootType.Newbied;
|
||||
lea.Crafter = this;
|
||||
lea.Quality = ArmorQuality.Regular;
|
||||
AddItem( lea );
|
||||
|
||||
LeatherChest lec = new LeatherChest();
|
||||
lec.Movable = false;
|
||||
lec.LootType = LootType.Newbied;
|
||||
lec.Crafter = this;
|
||||
lec.Quality = ArmorQuality.Regular;
|
||||
AddItem( lec );
|
||||
|
||||
LeatherGorget leg = new LeatherGorget();
|
||||
leg.Movable = false;
|
||||
leg.LootType = LootType.Newbied;
|
||||
leg.Crafter = this;
|
||||
leg.Quality = ArmorQuality.Regular;
|
||||
AddItem( leg );
|
||||
|
||||
LeatherLegs lel = new LeatherLegs();
|
||||
lel.Movable = false;
|
||||
lel.LootType = LootType.Newbied;
|
||||
lel.Crafter = this;
|
||||
lel.Quality = ArmorQuality.Regular;
|
||||
AddItem( lel );
|
||||
|
||||
Sandals snd = new Sandals();
|
||||
snd.Hue = iHue;
|
||||
snd.LootType = LootType.Newbied;
|
||||
AddItem( snd );
|
||||
|
||||
JesterHat jhat = new JesterHat();
|
||||
jhat.Hue = iHue;
|
||||
AddItem( jhat );
|
||||
|
||||
Doublet dblt = new Doublet();
|
||||
dblt.Hue = iHue;
|
||||
AddItem( dblt );
|
||||
|
||||
// Spells
|
||||
AddSpellAttack( typeof(Spells.First.MagicArrowSpell) );
|
||||
AddSpellAttack( typeof(Spells.First.WeakenSpell) );
|
||||
AddSpellAttack( typeof(Spells.Third.FireballSpell) );
|
||||
AddSpellDefense( typeof(Spells.Third.WallOfStoneSpell) );
|
||||
AddSpellDefense( typeof(Spells.First.HealSpell) );
|
||||
}
|
||||
|
||||
public DummySuper( 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();
|
||||
}
|
||||
}
|
||||
|
||||
public class DummyHealer : Dummy
|
||||
{
|
||||
|
||||
[Constructable]
|
||||
public DummyHealer() : base(AIType.AI_Healer, FightMode.Closest, 15, 1, 0.2, 0.6)
|
||||
{
|
||||
// A Dummy Healer Mage
|
||||
int iHue = 20 + Team * 40;
|
||||
int jHue = 25 + Team * 40;
|
||||
|
||||
// Skills and Stats
|
||||
this.InitStats( 125, 125, 125 );
|
||||
this.Skills[SkillName.Magery].Base = 120;
|
||||
this.Skills[SkillName.EvalInt].Base = 120;
|
||||
this.Skills[SkillName.Anatomy].Base = 120;
|
||||
this.Skills[SkillName.Wrestling].Base = 120;
|
||||
this.Skills[SkillName.Meditation].Base = 120;
|
||||
this.Skills[SkillName.Healing].Base = 100;
|
||||
|
||||
// Name
|
||||
this.Name = "Healer";
|
||||
|
||||
// Equip
|
||||
Spellbook book = new Spellbook();
|
||||
book.Movable = false;
|
||||
book.LootType = LootType.Newbied;
|
||||
book.Content =0xFFFFFFFFFFFFFFFF;
|
||||
AddItem( book );
|
||||
|
||||
LeatherArms lea = new LeatherArms();
|
||||
lea.Movable = false;
|
||||
lea.LootType = LootType.Newbied;
|
||||
lea.Crafter = this;
|
||||
lea.Quality = ArmorQuality.Regular;
|
||||
AddItem( lea );
|
||||
|
||||
LeatherChest lec = new LeatherChest();
|
||||
lec.Movable = false;
|
||||
lec.LootType = LootType.Newbied;
|
||||
lec.Crafter = this;
|
||||
lec.Quality = ArmorQuality.Regular;
|
||||
AddItem( lec );
|
||||
|
||||
LeatherGorget leg = new LeatherGorget();
|
||||
leg.Movable = false;
|
||||
leg.LootType = LootType.Newbied;
|
||||
leg.Crafter = this;
|
||||
leg.Quality = ArmorQuality.Regular;
|
||||
AddItem( leg );
|
||||
|
||||
LeatherLegs lel = new LeatherLegs();
|
||||
lel.Movable = false;
|
||||
lel.LootType = LootType.Newbied;
|
||||
lel.Crafter = this;
|
||||
lel.Quality = ArmorQuality.Regular;
|
||||
AddItem( lel );
|
||||
|
||||
Sandals snd = new Sandals();
|
||||
snd.Hue = iHue;
|
||||
snd.LootType = LootType.Newbied;
|
||||
AddItem( snd );
|
||||
|
||||
Cap cap = new Cap();
|
||||
cap.Hue = iHue;
|
||||
AddItem( cap );
|
||||
|
||||
Robe robe = new Robe();
|
||||
robe.Hue = iHue;
|
||||
AddItem( robe );
|
||||
|
||||
}
|
||||
|
||||
public DummyHealer( 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();
|
||||
}
|
||||
}
|
||||
|
||||
public class DummyAssassin : Dummy
|
||||
{
|
||||
|
||||
[Constructable]
|
||||
public DummyAssassin() : base(AIType.AI_Melee, FightMode.Closest, 15, 1, 0.2, 0.6)
|
||||
{
|
||||
// A Dummy Hybrid Assassin
|
||||
int iHue = 20 + Team * 40;
|
||||
int jHue = 25 + Team * 40;
|
||||
|
||||
// Skills and Stats
|
||||
this.InitStats( 105, 105, 105 );
|
||||
this.Skills[SkillName.Magery].Base = 120;
|
||||
this.Skills[SkillName.EvalInt].Base = 120;
|
||||
this.Skills[SkillName.Swords].Base = 120;
|
||||
this.Skills[SkillName.Tactics].Base = 120;
|
||||
this.Skills[SkillName.Meditation].Base = 120;
|
||||
this.Skills[SkillName.Poisoning].Base = 100;
|
||||
|
||||
// Name
|
||||
this.Name = "Hybrid Assassin";
|
||||
|
||||
// Equip
|
||||
Spellbook book = new Spellbook();
|
||||
book.Movable = false;
|
||||
book.LootType = LootType.Newbied;
|
||||
book.Content =0xFFFFFFFFFFFFFFFF;
|
||||
AddToBackpack( book );
|
||||
|
||||
Katana kat = new Katana();
|
||||
kat.Movable = false;
|
||||
kat.LootType = LootType.Newbied;
|
||||
kat.Crafter = this;
|
||||
kat.Poison = Poison.Deadly;
|
||||
kat.PoisonCharges = 12;
|
||||
kat.Quality = WeaponQuality.Regular;
|
||||
AddToBackpack( kat );
|
||||
|
||||
LeatherArms lea = new LeatherArms();
|
||||
lea.Movable = false;
|
||||
lea.LootType = LootType.Newbied;
|
||||
lea.Crafter = this;
|
||||
lea.Quality = ArmorQuality.Regular;
|
||||
AddItem( lea );
|
||||
|
||||
LeatherChest lec = new LeatherChest();
|
||||
lec.Movable = false;
|
||||
lec.LootType = LootType.Newbied;
|
||||
lec.Crafter = this;
|
||||
lec.Quality = ArmorQuality.Regular;
|
||||
AddItem( lec );
|
||||
|
||||
LeatherGorget leg = new LeatherGorget();
|
||||
leg.Movable = false;
|
||||
leg.LootType = LootType.Newbied;
|
||||
leg.Crafter = this;
|
||||
leg.Quality = ArmorQuality.Regular;
|
||||
AddItem( leg );
|
||||
|
||||
LeatherLegs lel = new LeatherLegs();
|
||||
lel.Movable = false;
|
||||
lel.LootType = LootType.Newbied;
|
||||
lel.Crafter = this;
|
||||
lel.Quality = ArmorQuality.Regular;
|
||||
AddItem( lel );
|
||||
|
||||
Sandals snd = new Sandals();
|
||||
snd.Hue = iHue;
|
||||
snd.LootType = LootType.Newbied;
|
||||
AddItem( snd );
|
||||
|
||||
Cap cap = new Cap();
|
||||
cap.Hue = iHue;
|
||||
AddItem( cap );
|
||||
|
||||
Robe robe = new Robe();
|
||||
robe.Hue = iHue;
|
||||
AddItem( robe );
|
||||
|
||||
DeadlyPoisonPotion pota = new DeadlyPoisonPotion();
|
||||
pota.LootType = LootType.Newbied;
|
||||
AddToBackpack( pota );
|
||||
|
||||
DeadlyPoisonPotion potb = new DeadlyPoisonPotion();
|
||||
potb.LootType = LootType.Newbied;
|
||||
AddToBackpack( potb );
|
||||
|
||||
DeadlyPoisonPotion potc = new DeadlyPoisonPotion();
|
||||
potc.LootType = LootType.Newbied;
|
||||
AddToBackpack( potc );
|
||||
|
||||
DeadlyPoisonPotion potd = new DeadlyPoisonPotion();
|
||||
potd.LootType = LootType.Newbied;
|
||||
AddToBackpack( potd );
|
||||
|
||||
Bandage band = new Bandage( 50 );
|
||||
AddToBackpack( band );
|
||||
|
||||
}
|
||||
|
||||
public DummyAssassin( 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();
|
||||
}
|
||||
}
|
||||
|
||||
public class DummyTheif : Dummy
|
||||
{
|
||||
|
||||
[Constructable]
|
||||
public DummyTheif() : base(AIType.AI_Thief, FightMode.Closest, 15, 1, 0.2, 0.6)
|
||||
{
|
||||
// A Dummy Hybrid Theif
|
||||
int iHue = 20 + Team * 40;
|
||||
int jHue = 25 + Team * 40;
|
||||
|
||||
// Skills and Stats
|
||||
this.InitStats( 105, 105, 105 );
|
||||
this.Skills[SkillName.Healing].Base = 120;
|
||||
this.Skills[SkillName.Anatomy].Base = 120;
|
||||
this.Skills[SkillName.Stealing].Base = 120;
|
||||
this.Skills[SkillName.ArmsLore].Base = 100;
|
||||
this.Skills[SkillName.Meditation].Base = 120;
|
||||
this.Skills[SkillName.Wrestling].Base = 120;
|
||||
|
||||
// Name
|
||||
this.Name = "Hybrid Theif";
|
||||
|
||||
// Equip
|
||||
Spellbook book = new Spellbook();
|
||||
book.Movable = false;
|
||||
book.LootType = LootType.Newbied;
|
||||
book.Content =0xFFFFFFFFFFFFFFFF;
|
||||
AddItem( book );
|
||||
|
||||
LeatherArms lea = new LeatherArms();
|
||||
lea.Movable = false;
|
||||
lea.LootType = LootType.Newbied;
|
||||
lea.Crafter = this;
|
||||
lea.Quality = ArmorQuality.Regular;
|
||||
AddItem( lea );
|
||||
|
||||
LeatherChest lec = new LeatherChest();
|
||||
lec.Movable = false;
|
||||
lec.LootType = LootType.Newbied;
|
||||
lec.Crafter = this;
|
||||
lec.Quality = ArmorQuality.Regular;
|
||||
AddItem( lec );
|
||||
|
||||
LeatherGorget leg = new LeatherGorget();
|
||||
leg.Movable = false;
|
||||
leg.LootType = LootType.Newbied;
|
||||
leg.Crafter = this;
|
||||
leg.Quality = ArmorQuality.Regular;
|
||||
AddItem( leg );
|
||||
|
||||
LeatherLegs lel = new LeatherLegs();
|
||||
lel.Movable = false;
|
||||
lel.LootType = LootType.Newbied;
|
||||
lel.Crafter = this;
|
||||
lel.Quality = ArmorQuality.Regular;
|
||||
AddItem( lel );
|
||||
|
||||
Sandals snd = new Sandals();
|
||||
snd.Hue = iHue;
|
||||
snd.LootType = LootType.Newbied;
|
||||
AddItem( snd );
|
||||
|
||||
Cap cap = new Cap();
|
||||
cap.Hue = iHue;
|
||||
AddItem( cap );
|
||||
|
||||
Robe robe = new Robe();
|
||||
robe.Hue = iHue;
|
||||
AddItem( robe );
|
||||
|
||||
Bandage band = new Bandage( 50 );
|
||||
AddToBackpack( band );
|
||||
}
|
||||
|
||||
public DummyTheif( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
140
Scripts/Engines/AI/Creature/OppositionGroup.cs
Normal file
140
Scripts/Engines/AI/Creature/OppositionGroup.cs
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server
|
||||
{
|
||||
public class OppositionGroup
|
||||
{
|
||||
private Type[][] m_Types;
|
||||
|
||||
public OppositionGroup( Type[][] types )
|
||||
{
|
||||
m_Types = types;
|
||||
}
|
||||
|
||||
public bool IsEnemy( object from, object target )
|
||||
{
|
||||
int fromGroup = IndexOf( from );
|
||||
int targGroup = IndexOf( target );
|
||||
|
||||
return ( fromGroup != -1 && targGroup != -1 && fromGroup != targGroup );
|
||||
}
|
||||
|
||||
public int IndexOf( object obj )
|
||||
{
|
||||
if ( obj == null )
|
||||
return -1;
|
||||
|
||||
Type type = obj.GetType();
|
||||
|
||||
for ( int i = 0; i < m_Types.Length; ++i )
|
||||
{
|
||||
Type[] group = m_Types[i];
|
||||
|
||||
bool contains = false;
|
||||
|
||||
for ( int j = 0; !contains && j < group.Length; ++j )
|
||||
contains = ( type == group[j] );
|
||||
|
||||
if ( contains )
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
private static OppositionGroup m_TerathansAndOphidians = new OppositionGroup( new Type[][]
|
||||
{
|
||||
new Type[]
|
||||
{
|
||||
typeof( TerathanAvenger ),
|
||||
typeof( TerathanDrone ),
|
||||
typeof( TerathanMatriarch ),
|
||||
typeof( TerathanWarrior )
|
||||
},
|
||||
new Type[]
|
||||
{
|
||||
typeof( OphidianArchmage ),
|
||||
typeof( OphidianKnight ),
|
||||
typeof( OphidianMage ),
|
||||
typeof( OphidianMatriarch ),
|
||||
typeof( OphidianWarrior )
|
||||
}
|
||||
} );
|
||||
|
||||
public static OppositionGroup TerathansAndOphidians
|
||||
{
|
||||
get{ return m_TerathansAndOphidians; }
|
||||
}
|
||||
|
||||
private static OppositionGroup m_SavagesAndOrcs = new OppositionGroup( new Type[][]
|
||||
{
|
||||
new Type[]
|
||||
{
|
||||
typeof( Orc ),
|
||||
typeof( OrcBomber ),
|
||||
typeof( OrcBrute ),
|
||||
typeof( OrcCaptain ),
|
||||
typeof( OrcishLord ),
|
||||
typeof( OrcishMage ),
|
||||
typeof( SpawnedOrcishLord )
|
||||
},
|
||||
new Type[]
|
||||
{
|
||||
typeof( Savage ),
|
||||
typeof( SavageRider ),
|
||||
typeof( SavageRidgeback ),
|
||||
typeof( SavageShaman )
|
||||
}
|
||||
} );
|
||||
|
||||
public static OppositionGroup SavagesAndOrcs
|
||||
{
|
||||
get{ return m_SavagesAndOrcs; }
|
||||
}
|
||||
|
||||
private static OppositionGroup m_FeyAndUndead = new OppositionGroup( new Type[][]
|
||||
{
|
||||
new Type[]
|
||||
{
|
||||
typeof( Centaur ),
|
||||
typeof( EtherealWarrior ),
|
||||
typeof( Kirin ),
|
||||
typeof( LordOaks ),
|
||||
typeof( Pixie ),
|
||||
typeof( Silvani ),
|
||||
typeof( Unicorn ),
|
||||
typeof( Wisp ),
|
||||
typeof( Treefellow )
|
||||
},
|
||||
new Type[]
|
||||
{
|
||||
typeof( AncientLich ),
|
||||
typeof( Bogle ),
|
||||
typeof( LichLord ),
|
||||
typeof( Shade ),
|
||||
typeof( Spectre ),
|
||||
typeof( Wraith ),
|
||||
typeof( BoneKnight ),
|
||||
typeof( Ghoul ),
|
||||
typeof( Mummy ),
|
||||
typeof( SkeletalKnight ),
|
||||
typeof( Skeleton ),
|
||||
typeof( Zombie ),
|
||||
typeof( ShadowKnight ),
|
||||
typeof( DarknightCreeper ),
|
||||
typeof( RevenantLion ),
|
||||
typeof( LadyOfTheSnow ),
|
||||
typeof( RottingCorpse ),
|
||||
typeof( SkeletalDragon ),
|
||||
typeof( Lich )
|
||||
}
|
||||
} );
|
||||
|
||||
public static OppositionGroup FeyAndUndead
|
||||
{
|
||||
get{ return m_FeyAndUndead; }
|
||||
}
|
||||
}
|
||||
}
|
||||
182
Scripts/Engines/AI/Creature/Paragon.cs
Normal file
182
Scripts/Engines/AI/Creature/Paragon.cs
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class Paragon
|
||||
{
|
||||
public static double ChestChance = .10; // Chance that a paragon will carry a paragon chest
|
||||
public static Map[] Maps = new Map[] // Maps that paragons will spawn on
|
||||
{
|
||||
Map.Ilshenar
|
||||
};
|
||||
|
||||
public static Type[] Artifacts = new Type[]
|
||||
{
|
||||
typeof( GoldBricks ), typeof( PhillipsWoodenSteed ),
|
||||
typeof( AlchemistsBauble ), typeof( ArcticDeathDealer ),
|
||||
typeof( BlazeOfDeath ), typeof( BowOfTheJukaKing ),
|
||||
typeof( BurglarsBandana ), typeof( CavortingClub ),
|
||||
typeof( EnchantedTitanLegBone ), typeof( GwennosHarp ),
|
||||
typeof( IolosLute ), typeof( LunaLance ),
|
||||
typeof( NightsKiss ), typeof( NoxRangersHeavyCrossbow ),
|
||||
typeof( OrcishVisage ), typeof( PolarBearMask ),
|
||||
typeof( ShieldOfInvulnerability ), typeof( StaffOfPower ),
|
||||
typeof( VioletCourage ), typeof( HeartOfTheLion ),
|
||||
typeof( WrathOfTheDryad ), typeof( PixieSwatter ),
|
||||
typeof( GlovesOfThePugilist )
|
||||
};
|
||||
|
||||
public static int Hue = 0x501; // Paragon hue
|
||||
|
||||
// Buffs
|
||||
public static double HitsBuff = 5.0;
|
||||
public static double StrBuff = 1.05;
|
||||
public static double IntBuff = 1.20;
|
||||
public static double DexBuff = 1.20;
|
||||
public static double SkillsBuff = 1.20;
|
||||
public static double SpeedBuff = 1.20;
|
||||
public static double FameBuff = 1.40;
|
||||
public static double KarmaBuff = 1.40;
|
||||
public static int DamageBuff = 5;
|
||||
|
||||
public static void Convert( BaseCreature bc )
|
||||
{
|
||||
if ( bc.IsParagon )
|
||||
return;
|
||||
|
||||
bc.Hue = Hue;
|
||||
|
||||
if ( bc.HitsMaxSeed >= 0 )
|
||||
bc.HitsMaxSeed = (int)( bc.HitsMaxSeed * HitsBuff );
|
||||
|
||||
bc.RawStr = (int)( bc.RawStr * StrBuff );
|
||||
bc.RawInt = (int)( bc.RawInt * IntBuff );
|
||||
bc.RawDex = (int)( bc.RawDex * DexBuff );
|
||||
|
||||
bc.Hits = bc.HitsMax;
|
||||
bc.Mana = bc.ManaMax;
|
||||
bc.Stam = bc.StamMax;
|
||||
|
||||
for( int i = 0; i < bc.Skills.Length; i++ )
|
||||
{
|
||||
Skill skill = (Skill)bc.Skills[i];
|
||||
|
||||
if ( skill.Base > 0.0 )
|
||||
skill.Base *= SkillsBuff;
|
||||
}
|
||||
|
||||
bc.PassiveSpeed /= SpeedBuff;
|
||||
bc.ActiveSpeed /= SpeedBuff;
|
||||
|
||||
bc.DamageMin += DamageBuff;
|
||||
bc.DamageMax += DamageBuff;
|
||||
|
||||
if ( bc.Fame > 0 )
|
||||
bc.Fame = (int)( bc.Fame * FameBuff );
|
||||
|
||||
if ( bc.Fame > 32000 )
|
||||
bc.Fame = 32000;
|
||||
|
||||
// TODO: Mana regeneration rate = Sqrt( buffedFame ) / 4
|
||||
|
||||
if ( bc.Karma != 0 )
|
||||
{
|
||||
bc.Karma = (int)( bc.Karma * KarmaBuff );
|
||||
|
||||
if( Math.Abs( bc.Karma ) > 32000 )
|
||||
bc.Karma = 32000 * Math.Sign( bc.Karma );
|
||||
}
|
||||
}
|
||||
|
||||
public static void UnConvert( BaseCreature bc )
|
||||
{
|
||||
if ( !bc.IsParagon )
|
||||
return;
|
||||
|
||||
bc.Hue = 0;
|
||||
|
||||
if ( bc.HitsMaxSeed >= 0 )
|
||||
bc.HitsMaxSeed = (int)( bc.HitsMaxSeed / HitsBuff );
|
||||
|
||||
bc.RawStr = (int)( bc.RawStr / StrBuff );
|
||||
bc.RawInt = (int)( bc.RawInt / IntBuff );
|
||||
bc.RawDex = (int)( bc.RawDex / DexBuff );
|
||||
|
||||
bc.Hits = bc.HitsMax;
|
||||
bc.Mana = bc.ManaMax;
|
||||
bc.Stam = bc.StamMax;
|
||||
|
||||
for( int i = 0; i < bc.Skills.Length; i++ )
|
||||
{
|
||||
Skill skill = (Skill)bc.Skills[i];
|
||||
|
||||
if ( skill.Base > 0.0 )
|
||||
skill.Base /= SkillsBuff;
|
||||
}
|
||||
|
||||
bc.PassiveSpeed *= SpeedBuff;
|
||||
bc.ActiveSpeed *= SpeedBuff;
|
||||
|
||||
bc.DamageMin -= DamageBuff;
|
||||
bc.DamageMax -= DamageBuff;
|
||||
|
||||
if ( bc.Fame > 0 )
|
||||
bc.Fame = (int)( bc.Fame / FameBuff );
|
||||
if ( bc.Karma != 0 )
|
||||
bc.Karma = (int)( bc.Karma / KarmaBuff );
|
||||
}
|
||||
|
||||
public static bool CheckConvert( BaseCreature bc )
|
||||
{
|
||||
return CheckConvert( bc, bc.Location, bc.Map );
|
||||
}
|
||||
|
||||
public static bool CheckConvert( BaseCreature bc, Point3D location, Map m )
|
||||
{
|
||||
if ( !Core.AOS )
|
||||
return false;
|
||||
|
||||
if ( Array.IndexOf( Maps, m ) == -1 )
|
||||
return false;
|
||||
|
||||
if ( bc is BaseChampion || bc is Harrower || bc is BaseVendor || bc is BaseEscortable || bc is Clone )
|
||||
return false;
|
||||
|
||||
int fame = bc.Fame;
|
||||
|
||||
if ( fame > 32000 )
|
||||
fame = 32000;
|
||||
|
||||
double chance = 1 / Math.Round( 20.0 - ( fame / 3200 ));
|
||||
|
||||
return ( chance > Utility.RandomDouble() );
|
||||
}
|
||||
|
||||
public static bool CheckArtifactChance( Mobile m, BaseCreature bc )
|
||||
{
|
||||
if ( !Core.AOS )
|
||||
return false;
|
||||
|
||||
double fame = (double)bc.Fame;
|
||||
|
||||
if ( fame > 32000 )
|
||||
fame = 32000;
|
||||
|
||||
double chance = 1 / ( Math.Max( 10, 100 * ( 0.83 - Math.Round( Math.Log( Math.Round( fame / 6000, 3 ) + 0.001, 10 ), 3 ) ) ) * ( 100 - Math.Sqrt( m.Luck ) ) / 100.0 );
|
||||
|
||||
return chance > Utility.RandomDouble();
|
||||
}
|
||||
|
||||
public static void GiveArtifactTo( Mobile m )
|
||||
{
|
||||
Item item = (Item)Activator.CreateInstance( Artifacts[Utility.Random(Artifacts.Length)] );
|
||||
|
||||
if ( m.AddToBackpack( item ) )
|
||||
m.SendMessage( "As a reward for slaying the mighty paragon, an artifact has been placed in your backpack." );
|
||||
else
|
||||
m.SendMessage( "As your backpack is full, your reward for destroying the legendary paragon has been placed at your feet." );
|
||||
}
|
||||
}
|
||||
}
|
||||
213
Scripts/Engines/AI/Creature/SpeedInfo.cs
Normal file
213
Scripts/Engines/AI/Creature/SpeedInfo.cs
Normal file
|
|
@ -0,0 +1,213 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Factions;
|
||||
|
||||
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( AntLion ), typeof( ArcticOgreLord ), typeof( BogThing ),
|
||||
typeof( Bogle ), typeof( BoneKnight ), typeof( EarthElemental ),
|
||||
typeof( Ettin ), typeof( FrostOoze ), typeof( FrostTroll ),
|
||||
typeof( GazerLarva ), typeof( Ghoul ), typeof( Golem ),
|
||||
typeof( HeadlessOne ), typeof( Jwilson ), typeof( Mummy ),
|
||||
typeof( Ogre ), typeof( OgreLord ), typeof( PlagueBeast ),
|
||||
typeof( Quagmire ), typeof( Rat ), typeof( RottingCorpse ),
|
||||
typeof( Sewerrat ), typeof( Skeleton ), typeof( Slime ),
|
||||
typeof( Zombie ), typeof( Walrus ), typeof( RestlessSoul ),
|
||||
typeof( CrystalElemental ), typeof( DarknightCreeper ), typeof( MoundOfMaggots ),
|
||||
typeof( Juggernaut ), typeof( Yamandon ), typeof( Serado )
|
||||
} ),
|
||||
/* Fast */
|
||||
new SpeedInfo( 0.2, 0.4, new Type[]
|
||||
{
|
||||
typeof( LordOaks ), typeof( Silvani ), typeof( AirElemental ),
|
||||
typeof( AncientWyrm ), typeof( Balron ), typeof( BladeSpirits ),
|
||||
typeof( DreadSpider ), typeof( Efreet ), typeof( EtherealWarrior ),
|
||||
typeof( Lich ), typeof( Nightmare ), typeof( OphidianArchmage ),
|
||||
typeof( OphidianMage ), typeof( OphidianWarrior ), typeof( OphidianMatriarch ),
|
||||
typeof( OphidianKnight ), typeof( PoisonElemental ), typeof( Revenant ),
|
||||
typeof( SandVortex ), typeof( SavageRider ), typeof( SavageShaman ),
|
||||
typeof( SnowElemental ), typeof( WhiteWyrm ), typeof( Wisp ),
|
||||
typeof( DemonKnight ), typeof( GiantBlackWidow ), typeof( SummonedAirElemental ),
|
||||
typeof( LesserHiryu ), typeof( Hiryu ), typeof( LadyOfTheSnow ),
|
||||
typeof( RaiJu ), typeof( Ronin )
|
||||
} ),
|
||||
/* Very Fast */
|
||||
new SpeedInfo( 0.175, 0.350, new Type[]
|
||||
{
|
||||
typeof( Barracoon ), typeof( Mephitis ), typeof( Neira ),
|
||||
typeof( Rikktor ), typeof( Semidar ), typeof( EnergyVortex ),
|
||||
typeof( Beetle ), typeof( Pixie ), typeof( SilverSerpent ),
|
||||
typeof( VorpalBunny ), typeof( FleshRenderer ), typeof( KhaldunRevenant ),
|
||||
typeof( FactionDragoon ), typeof( FactionKnight ), typeof( FactionPaladin ),
|
||||
typeof( FactionHenchman ), typeof( FactionMercenary ), typeof( FactionNecromancer ),
|
||||
typeof( FactionSorceress ), typeof( FactionWizard ), typeof( FactionBerserker ),
|
||||
typeof( FactionPaladin ), typeof( Leviathan ), typeof( FireBeetle ),
|
||||
typeof( FanDancer ), typeof( EliteNinja )
|
||||
} ),
|
||||
/* Medium */
|
||||
new SpeedInfo( 0.25, 0.5, new Type[]
|
||||
{
|
||||
typeof( ToxicElemental ), typeof( AgapiteElemental ), typeof( Alligator ),
|
||||
typeof( AncientLich ), typeof( Betrayer ), typeof( Bird ),
|
||||
typeof( BlackBear ), typeof( BlackSolenInfiltratorQueen ), typeof( BlackSolenInfiltratorWarrior ),
|
||||
typeof( BlackSolenQueen ), typeof( BlackSolenWarrior ), typeof( BlackSolenWorker ),
|
||||
typeof( BloodElemental ), typeof( Boar ), typeof( Bogling ),
|
||||
typeof( BoneMagi ), typeof( Brigand ), typeof( BronzeElemental ),
|
||||
typeof( BrownBear ), typeof( Bull ), typeof( BullFrog ),
|
||||
typeof( Cat ), typeof( Centaur ), typeof( ChaosDaemon ),
|
||||
typeof( Chicken ), typeof( GolemController ), typeof( CopperElemental ),
|
||||
typeof( CopperElemental ), typeof( Cougar ), typeof( Cow ),
|
||||
typeof( Cyclops ), typeof( Daemon ), typeof( DeepSeaSerpent ),
|
||||
typeof( DesertOstard ), typeof( DireWolf ), typeof( Dog ),
|
||||
typeof( Dolphin ), typeof( Dragon ), typeof( Drake ),
|
||||
typeof( DullCopperElemental ), typeof( Eagle ), typeof( ElderGazer ),
|
||||
typeof( EvilMage ), typeof( EvilMageLord ), typeof( Executioner ),
|
||||
typeof( Savage ), typeof( FireElemental ), typeof( FireGargoyle ),
|
||||
typeof( FireSteed ), typeof( ForestOstard ), typeof( FrenziedOstard ),
|
||||
typeof( FrostSpider ), typeof( Gargoyle ), typeof( Gazer ),
|
||||
typeof( IceSerpent ), typeof( GiantRat ), typeof( GiantSerpent ),
|
||||
typeof( GiantSpider ), typeof( GiantToad ), typeof( Goat ),
|
||||
typeof( GoldenElemental ), typeof( Gorilla ), typeof( GreatHart ),
|
||||
typeof( GreyWolf ), typeof( GrizzlyBear ), typeof( Guardian ),
|
||||
typeof( Harpy ), typeof( Harrower ), typeof( HellHound ),
|
||||
typeof( Hind ), typeof( HordeMinion ), typeof( Horse ),
|
||||
typeof( Horse ), typeof( IceElemental ), typeof( IceFiend ),
|
||||
typeof( IceSnake ), typeof( Imp ), typeof( JackRabbit ),
|
||||
typeof( Kirin ), typeof( Kraken ), typeof( PredatorHellCat ),
|
||||
typeof( LavaLizard ), typeof( LavaSerpent ), typeof( LavaSnake ),
|
||||
typeof( Lizardman ), typeof( Llama ), typeof( Mongbat ),
|
||||
typeof( StrongMongbat ), typeof( MountainGoat ), typeof( Orc ),
|
||||
typeof( OrcBomber ), typeof( OrcBrute ), typeof( OrcCaptain ),
|
||||
typeof( OrcishLord ), typeof( OrcishMage ), typeof( PackHorse ),
|
||||
typeof( PackLlama ), typeof( Panther ), typeof( Pig ),
|
||||
typeof( PlagueSpawn ), typeof( PolarBear ), typeof( Rabbit ),
|
||||
typeof( Ratman ), typeof( RatmanArcher ), typeof( RatmanMage ),
|
||||
typeof( RedSolenInfiltratorQueen ), typeof( RedSolenInfiltratorWarrior ), typeof( RedSolenQueen ),
|
||||
typeof( RedSolenWarrior ), typeof( RedSolenWorker ), typeof( RidableLlama ),
|
||||
typeof( Ridgeback ), typeof( Scorpion ), typeof( SeaSerpent ),
|
||||
typeof( SerpentineDragon ), typeof( Shade ), typeof( ShadowIronElemental ),
|
||||
typeof( ShadowWisp ), typeof( ShadowWyrm ), typeof( Sheep ),
|
||||
typeof( SilverSteed ), typeof( SkeletalDragon ), typeof( SkeletalMage ),
|
||||
typeof( SkeletalMount ), typeof( HellCat ), typeof( Snake ),
|
||||
typeof( SnowLeopard ), typeof( SpectralArmour ), typeof( Spectre ),
|
||||
typeof( StoneGargoyle ), typeof( StoneHarpy ), typeof( SwampDragon ),
|
||||
typeof( ScaledSwampDragon ), typeof( SwampTentacle ), typeof( TerathanAvenger ),
|
||||
typeof( TerathanDrone ), typeof( TerathanMatriarch ), typeof( TerathanWarrior ),
|
||||
typeof( TimberWolf ), typeof( Titan ), typeof( Troll ),
|
||||
typeof( Unicorn ), typeof( ValoriteElemental ), typeof( VeriteElemental ),
|
||||
typeof( CoMWarHorse ), typeof( MinaxWarHorse ), typeof( SLWarHorse ),
|
||||
typeof( TBWarHorse ), typeof( WaterElemental ), typeof( WhippingVine ),
|
||||
typeof( WhiteWolf ), typeof( Wraith ), typeof( Wyvern ),
|
||||
typeof( KhaldunZealot ), typeof( KhaldunSummoner ), typeof( SavageRidgeback ),
|
||||
typeof( LichLord ), typeof( SkeletalKnight ), typeof( SummonedDaemon ),
|
||||
typeof( SummonedEarthElemental ), typeof( SummonedWaterElemental ), typeof( SummonedFireElemental ),
|
||||
typeof( MeerWarrior ), typeof( MeerEternal ), typeof( MeerMage ),
|
||||
typeof( MeerCaptain ), typeof( JukaLord ), typeof( JukaMage ),
|
||||
typeof( JukaWarrior ), typeof( AbysmalHorror ), typeof( BoneDemon ),
|
||||
typeof( Devourer ), typeof( FleshGolem ), typeof( Gibberling ),
|
||||
typeof( GoreFiend ), typeof( Impaler ), typeof( PatchworkSkeleton ),
|
||||
typeof( Ravager ), typeof( ShadowKnight ), typeof( SkitteringHopper ),
|
||||
typeof( Treefellow ), typeof( VampireBat ), typeof( WailingBanshee ),
|
||||
typeof( WandererOfTheVoid ), typeof( Cursed ), typeof( GrimmochDrummel ),
|
||||
typeof( LysanderGathenwale ), typeof( MorgBergen ), typeof( ShadowFiend ),
|
||||
typeof( SpectralArmour ), typeof( TavaraSewel ), typeof( ArcaneDaemon ),
|
||||
typeof( Doppleganger ), typeof( EnslavedGargoyle ), typeof( ExodusMinion ),
|
||||
typeof( ExodusOverseer ), typeof( GargoyleDestroyer ), typeof( GargoyleEnforcer ),
|
||||
typeof( Moloch ), typeof( BakeKitsune ), typeof( DeathwatchBeetleHatchling ),
|
||||
typeof( Kappa ), typeof( KazeKemono ), typeof( DeathwatchBeetle ),
|
||||
typeof( TsukiWolf ), typeof( YomotsuElder ), typeof( YomotsuPriest ),
|
||||
typeof( YomotsuWarrior ), typeof( RevenantLion ), typeof( Oni ),
|
||||
typeof( RuneBeetle ), typeof( Gaman ), typeof( Crane )
|
||||
} )
|
||||
};
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue