Fixes code according to modern code style. Fixes a few expression bugs.
This commit is contained in:
parent
89eea25e5f
commit
970fd563b2
3324 changed files with 441118 additions and 433755 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -1,31 +1,31 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class EnchantedSwitch : Item
|
||||
{
|
||||
public override int LabelNumber => 1072893; // enchanted switch
|
||||
public class EnchantedSwitch : Item
|
||||
{
|
||||
[Constructible]
|
||||
public EnchantedSwitch() : base(0x2F5C)
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public EnchantedSwitch() : base( 0x2F5C )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
public EnchantedSwitch(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public EnchantedSwitch( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override int LabelNumber => 1072893; // enchanted switch
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +1,31 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class HollowPrism : Item
|
||||
{
|
||||
public override int LabelNumber => 1072895; // hollow prism
|
||||
public class HollowPrism : Item
|
||||
{
|
||||
[Constructible]
|
||||
public HollowPrism() : base(0x2F5D)
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public HollowPrism() : base( 0x2F5D )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
public HollowPrism(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public HollowPrism( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override int LabelNumber => 1072895; // hollow prism
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +1,31 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class JeweledFiligree : Item
|
||||
{
|
||||
public override int LabelNumber => 1072894; // jeweled filigree
|
||||
public class JeweledFiligree : Item
|
||||
{
|
||||
[Constructible]
|
||||
public JeweledFiligree() : base(0x2F5E)
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public JeweledFiligree() : base( 0x2F5E )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
public JeweledFiligree(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public JeweledFiligree( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override int LabelNumber => 1072894; // jeweled filigree
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +1,31 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class RunedPrism : Item
|
||||
{
|
||||
public override int LabelNumber => 1073465; // runed prism
|
||||
public class RunedPrism : Item
|
||||
{
|
||||
[Constructible]
|
||||
public RunedPrism() : base(0x2F57)
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public RunedPrism() : base( 0x2F57 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
public RunedPrism(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public RunedPrism( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override int LabelNumber => 1073465; // runed prism
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2,74 +2,80 @@ using Server.Targeting;
|
|||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RunedSwitch : Item
|
||||
{
|
||||
public override int LabelNumber => 1072896; // runed switch
|
||||
public class RunedSwitch : Item
|
||||
{
|
||||
[Constructible]
|
||||
public RunedSwitch() : base(0x2F61)
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public RunedSwitch() : base( 0x2F61 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
public RunedSwitch(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public RunedSwitch( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override int LabelNumber => 1072896; // runed switch
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1075101 ); // Please select an item to recharge.
|
||||
from.Target = new InternalTarget( this );
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1060640 ); // The item must be in your backpack to use it.
|
||||
}
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1075101); // Please select an item to recharge.
|
||||
from.Target = new InternalTarget(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1060640); // The item must be in your backpack to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private RunedSwitch m_Item;
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private RunedSwitch m_Item;
|
||||
|
||||
public InternalTarget( RunedSwitch item ) : base( 0, false, TargetFlags.None )
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
public InternalTarget(RunedSwitch item) : base(0, false, TargetFlags.None)
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
if ( m_Item == null || m_Item.Deleted )
|
||||
return;
|
||||
|
||||
if ( o is BaseTalisman talisman )
|
||||
{
|
||||
if ( talisman.Charges == 0 )
|
||||
{
|
||||
talisman.Charges = talisman.MaxCharges;
|
||||
m_Item.Delete();
|
||||
from.SendLocalizedMessage( 1075100 ); // The item has been recharged.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1075099 ); // You cannot recharge that item until all of its current charges have been used.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1046439 ); // That is not a valid target.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if (m_Item == null || m_Item.Deleted)
|
||||
return;
|
||||
|
||||
if (o is BaseTalisman talisman)
|
||||
{
|
||||
if (talisman.Charges == 0)
|
||||
{
|
||||
talisman.Charges = talisman.MaxCharges;
|
||||
m_Item.Delete();
|
||||
from.SendLocalizedMessage(1075100); // The item has been recharged.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(
|
||||
1075099); // You cannot recharge that item until all of its current charges have been used.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1046439); // That is not a valid target.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,58 +1,58 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class RandomTalisman : BaseTalisman
|
||||
{
|
||||
[Constructible]
|
||||
public RandomTalisman() : base( GetRandomItemID() )
|
||||
{
|
||||
Summoner = GetRandomSummoner();
|
||||
public class RandomTalisman : BaseTalisman
|
||||
{
|
||||
[Constructible]
|
||||
public RandomTalisman() : base(GetRandomItemID())
|
||||
{
|
||||
Summoner = GetRandomSummoner();
|
||||
|
||||
if ( Summoner.IsEmpty )
|
||||
{
|
||||
Removal = GetRandomRemoval();
|
||||
if (Summoner.IsEmpty)
|
||||
{
|
||||
Removal = GetRandomRemoval();
|
||||
|
||||
if ( Removal != TalismanRemoval.None )
|
||||
{
|
||||
MaxCharges = GetRandomCharges();
|
||||
MaxChargeTime = 1200;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MaxCharges = Utility.RandomMinMax( 10, 50 );
|
||||
if (Removal != TalismanRemoval.None)
|
||||
{
|
||||
MaxCharges = GetRandomCharges();
|
||||
MaxChargeTime = 1200;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MaxCharges = Utility.RandomMinMax(10, 50);
|
||||
|
||||
if ( Summoner.IsItem )
|
||||
MaxChargeTime = 60;
|
||||
else
|
||||
MaxChargeTime = 1800;
|
||||
}
|
||||
if (Summoner.IsItem)
|
||||
MaxChargeTime = 60;
|
||||
else
|
||||
MaxChargeTime = 1800;
|
||||
}
|
||||
|
||||
Blessed = GetRandomBlessed();
|
||||
Slayer = GetRandomSlayer();
|
||||
Protection = GetRandomProtection();
|
||||
Killer = GetRandomKiller();
|
||||
Skill = GetRandomSkill();
|
||||
ExceptionalBonus = GetRandomExceptional();
|
||||
SuccessBonus = GetRandomSuccessful();
|
||||
Charges = MaxCharges;
|
||||
}
|
||||
Blessed = GetRandomBlessed();
|
||||
Slayer = GetRandomSlayer();
|
||||
Protection = GetRandomProtection();
|
||||
Killer = GetRandomKiller();
|
||||
Skill = GetRandomSkill();
|
||||
ExceptionalBonus = GetRandomExceptional();
|
||||
SuccessBonus = GetRandomSuccessful();
|
||||
Charges = MaxCharges;
|
||||
}
|
||||
|
||||
public RandomTalisman( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public RandomTalisman(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2,121 +2,121 @@ using System;
|
|||
|
||||
namespace Server.Items
|
||||
{
|
||||
[PropertyObject]
|
||||
public class TalismanAttribute
|
||||
{
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Type Type { get; set; }
|
||||
[PropertyObject]
|
||||
public class TalismanAttribute
|
||||
{
|
||||
public TalismanAttribute() : this(null, 0, 0)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public TextDefinition Name { get; set; }
|
||||
public TalismanAttribute(TalismanAttribute copy)
|
||||
{
|
||||
if (copy != null)
|
||||
{
|
||||
Type = copy.Type;
|
||||
Name = copy.Name;
|
||||
Amount = copy.Amount;
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Amount { get; set; }
|
||||
public TalismanAttribute(Type type, TextDefinition name) : this(type, name, 0)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsEmpty => Type == null;
|
||||
public TalismanAttribute(Type type, TextDefinition name, int amount)
|
||||
{
|
||||
Type = type;
|
||||
Name = name;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsItem => Type != null && Type.Namespace.Equals( "Server.Items" );
|
||||
public TalismanAttribute(GenericReader reader)
|
||||
{
|
||||
int version = reader.ReadInt();
|
||||
|
||||
public TalismanAttribute() : this( null, 0, 0 )
|
||||
{
|
||||
}
|
||||
SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();
|
||||
|
||||
public TalismanAttribute( TalismanAttribute copy )
|
||||
{
|
||||
if ( copy != null )
|
||||
{
|
||||
Type = copy.Type;
|
||||
Name = copy.Name;
|
||||
Amount = copy.Amount;
|
||||
}
|
||||
}
|
||||
if (GetSaveFlag(flags, SaveFlag.Type))
|
||||
Type = ScriptCompiler.FindTypeByFullName(reader.ReadString(), false);
|
||||
|
||||
public TalismanAttribute( Type type, TextDefinition name ) : this( type, name, 0 )
|
||||
{
|
||||
}
|
||||
if (GetSaveFlag(flags, SaveFlag.Name))
|
||||
Name = TextDefinition.Deserialize(reader);
|
||||
|
||||
public TalismanAttribute( Type type, TextDefinition name, int amount )
|
||||
{
|
||||
Type = type;
|
||||
Name = name;
|
||||
Amount = amount;
|
||||
}
|
||||
if (GetSaveFlag(flags, SaveFlag.Amount))
|
||||
Amount = reader.ReadEncodedInt();
|
||||
}
|
||||
|
||||
public TalismanAttribute( GenericReader reader )
|
||||
{
|
||||
int version = reader.ReadInt();
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Type Type{ get; set; }
|
||||
|
||||
SaveFlag flags = (SaveFlag) reader.ReadEncodedInt();
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public TextDefinition Name{ get; set; }
|
||||
|
||||
if ( GetSaveFlag( flags, SaveFlag.Type ) )
|
||||
Type = ScriptCompiler.FindTypeByFullName( reader.ReadString(), false );
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Amount{ get; set; }
|
||||
|
||||
if ( GetSaveFlag( flags, SaveFlag.Name ) )
|
||||
Name = TextDefinition.Deserialize( reader );
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsEmpty => Type == null;
|
||||
|
||||
if ( GetSaveFlag( flags, SaveFlag.Amount ) )
|
||||
Amount = reader.ReadEncodedInt();
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsItem => Type != null && Type.Namespace.Equals("Server.Items");
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if ( Type != null )
|
||||
return Type.Name;
|
||||
public override string ToString()
|
||||
{
|
||||
if (Type != null)
|
||||
return Type.Name;
|
||||
|
||||
return "None";
|
||||
}
|
||||
return "None";
|
||||
}
|
||||
|
||||
private static void SetSaveFlag( ref SaveFlag flags, SaveFlag toSet, bool setIf )
|
||||
{
|
||||
if ( setIf )
|
||||
flags |= toSet;
|
||||
}
|
||||
private static void SetSaveFlag(ref SaveFlag flags, SaveFlag toSet, bool setIf)
|
||||
{
|
||||
if (setIf)
|
||||
flags |= toSet;
|
||||
}
|
||||
|
||||
private static bool GetSaveFlag( SaveFlag flags, SaveFlag toGet )
|
||||
{
|
||||
return ( (flags & toGet) != 0 );
|
||||
}
|
||||
private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet)
|
||||
{
|
||||
return (flags & toGet) != 0;
|
||||
}
|
||||
|
||||
[Flags]
|
||||
private enum SaveFlag
|
||||
{
|
||||
None = 0x00000000,
|
||||
Type = 0x00000001,
|
||||
Name = 0x00000002,
|
||||
Amount = 0x00000004,
|
||||
}
|
||||
public virtual void Serialize(GenericWriter writer)
|
||||
{
|
||||
writer.Write(0); // version
|
||||
|
||||
public virtual void Serialize( GenericWriter writer )
|
||||
{
|
||||
writer.Write( (int) 0 ); // version
|
||||
SaveFlag flags = SaveFlag.None;
|
||||
|
||||
SaveFlag flags = SaveFlag.None;
|
||||
SetSaveFlag(ref flags, SaveFlag.Type, Type != null);
|
||||
SetSaveFlag(ref flags, SaveFlag.Name, Name != null);
|
||||
SetSaveFlag(ref flags, SaveFlag.Amount, Amount != 0);
|
||||
|
||||
SetSaveFlag( ref flags, SaveFlag.Type, Type != null );
|
||||
SetSaveFlag( ref flags, SaveFlag.Name, Name != null );
|
||||
SetSaveFlag( ref flags, SaveFlag.Amount, Amount != 0 );
|
||||
writer.WriteEncodedInt((int)flags);
|
||||
|
||||
writer.WriteEncodedInt( (int) flags );
|
||||
if (GetSaveFlag(flags, SaveFlag.Type))
|
||||
writer.Write(Type.FullName);
|
||||
|
||||
if ( GetSaveFlag( flags, SaveFlag.Type ) )
|
||||
writer.Write( Type.FullName );
|
||||
if (GetSaveFlag(flags, SaveFlag.Name))
|
||||
TextDefinition.Serialize(writer, Name);
|
||||
|
||||
if ( GetSaveFlag( flags, SaveFlag.Name ) )
|
||||
TextDefinition.Serialize( writer, Name );
|
||||
if (GetSaveFlag(flags, SaveFlag.Amount))
|
||||
writer.WriteEncodedInt(Amount);
|
||||
}
|
||||
|
||||
if ( GetSaveFlag( flags, SaveFlag.Amount ) )
|
||||
writer.WriteEncodedInt( Amount );
|
||||
}
|
||||
public int DamageBonus(Mobile to)
|
||||
{
|
||||
if (to != null && to.GetType() == Type) // Verified: only works on the exact type
|
||||
return Amount;
|
||||
|
||||
public int DamageBonus( Mobile to )
|
||||
{
|
||||
if ( to != null && to.GetType() == Type ) // Verified: only works on the exact type
|
||||
return Amount;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
[Flags]
|
||||
private enum SaveFlag
|
||||
{
|
||||
None = 0x00000000,
|
||||
Type = 0x00000001,
|
||||
Name = 0x00000002,
|
||||
Amount = 0x00000004
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4,110 +4,108 @@ using Server.Mobiles;
|
|||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum TalismanSlayerName
|
||||
{
|
||||
None,
|
||||
Bear,
|
||||
Vermin,
|
||||
Bat,
|
||||
Mage,
|
||||
Beetle,
|
||||
Bird,
|
||||
Ice,
|
||||
Flame,
|
||||
Bovine
|
||||
}
|
||||
public enum TalismanSlayerName
|
||||
{
|
||||
None,
|
||||
Bear,
|
||||
Vermin,
|
||||
Bat,
|
||||
Mage,
|
||||
Beetle,
|
||||
Bird,
|
||||
Ice,
|
||||
Flame,
|
||||
Bovine
|
||||
}
|
||||
|
||||
public static class TalismanSlayer
|
||||
{
|
||||
private static Dictionary<TalismanSlayerName, Type[]> m_Table = new Dictionary<TalismanSlayerName,Type[]>();
|
||||
public static class TalismanSlayer
|
||||
{
|
||||
private static Dictionary<TalismanSlayerName, Type[]> m_Table = new Dictionary<TalismanSlayerName, Type[]>();
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
m_Table[ TalismanSlayerName.Bear ] = new[]
|
||||
{
|
||||
typeof( GrizzlyBear ), typeof( BlackBear ), typeof( BrownBear ), typeof( PolarBear ) //, typeof( Grobu )
|
||||
};
|
||||
public static void Initialize()
|
||||
{
|
||||
m_Table[TalismanSlayerName.Bear] = new[]
|
||||
{
|
||||
typeof(GrizzlyBear), typeof(BlackBear), typeof(BrownBear), typeof(PolarBear) //, typeof( Grobu )
|
||||
};
|
||||
|
||||
m_Table[ TalismanSlayerName.Vermin ] = new[]
|
||||
{
|
||||
typeof( RatmanMage ), typeof( RatmanMage ), typeof( RatmanArcher ), typeof( Barracoon),
|
||||
typeof( Ratman ), typeof( SewerRat ), typeof( Rat ), typeof( GiantRat ) //, typeof( Chiikkaha )
|
||||
};
|
||||
m_Table[TalismanSlayerName.Vermin] = new[]
|
||||
{
|
||||
typeof(RatmanMage), typeof(RatmanMage), typeof(RatmanArcher), typeof(Barracoon),
|
||||
typeof(Ratman), typeof(SewerRat), typeof(Rat), typeof(GiantRat) //, typeof( Chiikkaha )
|
||||
};
|
||||
|
||||
m_Table[ TalismanSlayerName.Bat ] = new[]
|
||||
{
|
||||
typeof( Mongbat ), typeof( StrongMongbat ), typeof( VampireBat )
|
||||
};
|
||||
m_Table[TalismanSlayerName.Bat] = new[]
|
||||
{
|
||||
typeof(Mongbat), typeof(StrongMongbat), typeof(VampireBat)
|
||||
};
|
||||
|
||||
m_Table[ TalismanSlayerName.Mage ] = new[]
|
||||
{
|
||||
typeof( EvilMage ), typeof( EvilMageLord ), typeof( AncientLich ), typeof( Lich ), typeof( LichLord ),
|
||||
typeof( SkeletalMage ), typeof( BoneMagi ), typeof( OrcishMage ), typeof( KhaldunZealot ), typeof( JukaMage ),
|
||||
};
|
||||
m_Table[TalismanSlayerName.Mage] = new[]
|
||||
{
|
||||
typeof(EvilMage), typeof(EvilMageLord), typeof(AncientLich), typeof(Lich), typeof(LichLord),
|
||||
typeof(SkeletalMage), typeof(BoneMagi), typeof(OrcishMage), typeof(KhaldunZealot), typeof(JukaMage)
|
||||
};
|
||||
|
||||
m_Table[ TalismanSlayerName.Beetle ] = new[]
|
||||
{
|
||||
typeof( Beetle ), typeof( RuneBeetle ), typeof( FireBeetle ), typeof( DeathwatchBeetle ),
|
||||
typeof( DeathwatchBeetleHatchling )
|
||||
};
|
||||
m_Table[TalismanSlayerName.Beetle] = new[]
|
||||
{
|
||||
typeof(Beetle), typeof(RuneBeetle), typeof(FireBeetle), typeof(DeathwatchBeetle),
|
||||
typeof(DeathwatchBeetleHatchling)
|
||||
};
|
||||
|
||||
m_Table[ TalismanSlayerName.Bird ] = new[]
|
||||
{
|
||||
typeof( Bird ), typeof( TropicalBird ), typeof( Chicken ), typeof( Crane ),
|
||||
typeof( DesertOstard ), typeof( Eagle ), typeof( ForestOstard ), typeof( FrenziedOstard ),
|
||||
typeof( Phoenix ), /*typeof( Pyre ), typeof( Swoop ), typeof( Saliva ),*/ typeof( Harpy ),
|
||||
typeof( StoneHarpy ) // ?????
|
||||
};
|
||||
m_Table[TalismanSlayerName.Bird] = new[]
|
||||
{
|
||||
typeof(Bird), typeof(TropicalBird), typeof(Chicken), typeof(Crane),
|
||||
typeof(DesertOstard), typeof(Eagle), typeof(ForestOstard), typeof(FrenziedOstard),
|
||||
typeof(Phoenix), /*typeof( Pyre ), typeof( Swoop ), typeof( Saliva ),*/ typeof(Harpy),
|
||||
typeof(StoneHarpy) // ?????
|
||||
};
|
||||
|
||||
m_Table[ TalismanSlayerName.Ice ] = new[]
|
||||
{
|
||||
typeof( ArcticOgreLord ), typeof( IceElemental ), typeof( SnowElemental ), typeof( FrostOoze ),
|
||||
typeof( IceFiend ), /*typeof( UnfrozenMummy ),*/ typeof( FrostSpider ), typeof( LadyOfTheSnow ),
|
||||
typeof( FrostTroll ),
|
||||
m_Table[TalismanSlayerName.Ice] = new[]
|
||||
{
|
||||
typeof(ArcticOgreLord), typeof(IceElemental), typeof(SnowElemental), typeof(FrostOoze),
|
||||
typeof(IceFiend), /*typeof( UnfrozenMummy ),*/ typeof(FrostSpider), typeof(LadyOfTheSnow),
|
||||
typeof(FrostTroll),
|
||||
|
||||
// TODO WinterReaper, check
|
||||
typeof( IceSnake ), typeof( SnowLeopard ), typeof( PolarBear ), typeof( IceSerpent ), typeof( GiantIceWorm )
|
||||
};
|
||||
// TODO WinterReaper, check
|
||||
typeof(IceSnake), typeof(SnowLeopard), typeof(PolarBear), typeof(IceSerpent), typeof(GiantIceWorm)
|
||||
};
|
||||
|
||||
m_Table[ TalismanSlayerName.Flame ] = new[]
|
||||
{
|
||||
typeof( FireBeetle ), typeof( HellHound ), typeof( LavaSerpent ), typeof( FireElemental ),
|
||||
typeof( PredatorHellCat ), typeof( Phoenix ), typeof( FireGargoyle ), typeof( HellCat ),
|
||||
/*typeof( Pyre ),*/ typeof( FireSteed ), typeof( LavaLizard ),
|
||||
m_Table[TalismanSlayerName.Flame] = new[]
|
||||
{
|
||||
typeof(FireBeetle), typeof(HellHound), typeof(LavaSerpent), typeof(FireElemental),
|
||||
typeof(PredatorHellCat), typeof(Phoenix), typeof(FireGargoyle), typeof(HellCat),
|
||||
/*typeof( Pyre ),*/ typeof(FireSteed), typeof(LavaLizard),
|
||||
|
||||
// TODO check
|
||||
typeof( LavaSnake ),
|
||||
};
|
||||
// TODO check
|
||||
typeof(LavaSnake)
|
||||
};
|
||||
|
||||
m_Table[ TalismanSlayerName.Bovine ] = new[]
|
||||
{
|
||||
typeof( Cow ), typeof( Bull ), typeof( Gaman ) /*, typeof( MinotaurCaptain ),
|
||||
m_Table[TalismanSlayerName.Bovine] = new[]
|
||||
{
|
||||
typeof(Cow), typeof(Bull), typeof(Gaman) /*, typeof( MinotaurCaptain ),
|
||||
typeof( MinotaurScout ), typeof( Minotaur )*/
|
||||
|
||||
// TODO TormentedMinotaur
|
||||
};
|
||||
}
|
||||
// TODO TormentedMinotaur
|
||||
};
|
||||
}
|
||||
|
||||
public static bool Slays( TalismanSlayerName name, Mobile m )
|
||||
{
|
||||
if ( !m_Table.ContainsKey( name ) )
|
||||
return false;
|
||||
public static bool Slays(TalismanSlayerName name, Mobile m)
|
||||
{
|
||||
if (!m_Table.ContainsKey(name))
|
||||
return false;
|
||||
|
||||
Type[] types = m_Table[ name ];
|
||||
Type[] types = m_Table[name];
|
||||
|
||||
if ( types == null || m == null )
|
||||
return false;
|
||||
if (types == null || m == null)
|
||||
return false;
|
||||
|
||||
Type type = m.GetType();
|
||||
Type type = m.GetType();
|
||||
|
||||
for ( int i = 0; i < types.Length; i++ )
|
||||
{
|
||||
if ( types[ i ].IsAssignableFrom( type ) )
|
||||
return true;
|
||||
}
|
||||
for (int i = 0; i < types.Length; i++)
|
||||
if (types[i].IsAssignableFrom(type))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue