ModernUO/Scripts/Mobiles/AI/OppositionGroup.cs
eos 43e5982fbb - Terrible Hatchlings quest fixed to only reward SE weapons and armor.
- Slayer and opposition systems now account for inheritance.
- Added Satyrs to the fey opposition group.
- Added fey slayer vulnerability to cu sidhes.
- Added reptilian and dragon slayer vulnerabilities to reptalons.
- Various mage AI additions for necromancers. (Spirit speak for healing, pain spike and strangle for damage, automatic mage/necro bias by skill value.)
- Fixed a targeting issue not accounting for FightMode.Evil versus low karma targeting.
- Added melee damage bonus for Talisman killer properties.
- Added general ML loot for ML areas.
- Added ML minor artifact drops for named ML mobs.
- Added named ML mobs for Bedlam.
2012-02-26 05:11:25 +00:00

142 lines
No EOL
3 KiB
C#

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 = group[j].IsAssignableFrom( type );
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 ),
typeof( MLDryad ),
typeof( Satyr )
},
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; }
}
}
}