CODE |
using Server; using Server.Items; using Server.Mobiles; using Server.Targeting; using System.Collections; namespace Server.Mobiles { [CorpseName( "a Cu Sidhe corpse" )] public class ACuSidhe : BaseMount { private DateTime m_Delay = DateTime.Now; public override WeaponAbility GetWeaponAbility() { return WeaponAbility.BleedAttack; } public override int GetDeathSound() { return 0x575; } public override int GetAttackSound() { return 0x576; } public override int GetIdleSound() { return 0x577; } public override int GetAngerSound() { return 0x578; } public override int GetHurtSound() { return 0x579; } public override bool StatLossAfterTame{ get{ return true; } } [Constructable] public ACuSidhe() : this( "a Cu Sidhe" ) { } [Constructable] public ACuSidhe( string name ) : base( name, 277, 0x3e91, AIType.AI_Animal, FightMode.Evil, 10, 1, 0.2, 0.4 ) { //BaseSoundID = 0xE5; Hue = Utility.RandomList( 0x0, 0x973, 0x966, 0x96D, 0x972, 0x8A5, 0x979, 0x89F, 0x8AB, 0x489, 1151, 1175 ); SetStr( 1200, 1225 ); SetDex( 150, 170 );// stratics has 150,170 but this is amount after taming so setting this to Hiryu Dex SetInt( 450, 500 ); SetHits( 1010, 1170 ); //SetMana( 60, 65 );//from Hiryu //SetStam( 170, 270 );//from hiryu SetDamage( 21, 28 );//hiryu damage SetDamageType( ResistanceType.Physical, 0 ); SetDamageType( ResistanceType.Cold, 50 ); SetDamageType( ResistanceType.Energy, 50 ); SetResistance( ResistanceType.Physical, 50, 65 );//used 5 over and 5 under what stratics posted SetResistance( ResistanceType.Fire, 30, 45 ); SetResistance( ResistanceType.Cold, 70, 85 ); SetResistance( ResistanceType.Poison, 30, 50 ); SetResistance( ResistanceType.Energy, 70, 85 ); SetSkill( SkillName.Healing, 77.7, 99.9 ); SetSkill( SkillName.Anatomy, 77.7, 99.9 ); SetSkill( SkillName.MagicResist, 76.0, 89.7 ); SetSkill( SkillName.Tactics, 94.0, 97.6 ); SetSkill( SkillName.Wrestling, 93.9, 99.9 ); //SetFameLevel( 5 ); //SetKarmaLevel( 5 ); VirtualArmor = 75; Fame = 5; Karma = -5; Tamable = true; ControlSlots = 4;//assuming these take same ammount of slots as a Hiryu MinTameSkill = 101.1; PackGold( 750, 950 );//1500 1900 is the gold amount found on these PackMagicItems( 1, 5 ); PackItem( new Bandage( 20 ) );// a total guess on the amount } public override void OnThink() // TODO: Please make sure, if you got Bloody bandages, that CuSidhe can NOT get them. { if ( DateTime.Now > m_Delay ) { Bandage band; if ( Controlled && ControlMaster != null ) { IPooledEnumerable eable = Map.GetMobilesInRange( Location, 1 ); foreach ( Mobile m in eable ) { if ( m == ControlMaster && m.Alive && m.Hits < m.HitsMax ) { band = new Bandage(); PackItem( band ); band.OnDoubleClick( this ); if ( Target != null ) { Target.Invoke( this, m ); DebugSay( "I heal Master." ); m_Delay = DateTime.Now + TimeSpan.FromSeconds( 7 ); } break; } } eable.Free(); } else if ( Hits < HitsMax ) { band = new Bandage(); PackItem( band ); band.OnDoubleClick( this ); if ( Target != null ) { Target.Invoke( this, this ); DebugSay( "I start heal!" ); m_Delay = DateTime.Now + TimeSpan.FromSeconds( 7 ); } } } base.OnThink(); } public override void OnDoubleClick( Mobile from ) { if ( /*from.IsElf ||*/ from.FindItemOnLayer( Layer.Shoes ) is PadsOfTheCuSidhe || from.AccessLevel > AccessLevel.Player ) // TODO: Elves check;) { base.OnDoubleClick( from ); } else from.SendMessage( "Only Elves may ride this" ); } public override void GenerateLoot() { AddLoot( LootPack.Rich );// to add a couple more magic items and the additional gold to make the 1500 mark } /*public override int GetAngerSound() { if ( !Controlled ) return 0x16A; return base.GetAngerSound(); }*/ public override double GetControlChance( Mobile m, bool useBaseSkill ) { if ( m.Skills[SkillName.AnimalTaming].Base < 93.0 ) { m.SendMessage( "You would not be able to control this creature." ); return 0; } else { return 1.0; } } public override int Meat{ get{ return 3; } } public override int Hides{ get{ return 10; } } public override FoodType FavoriteFood { get { return FoodType.FruitsAndVegies | FoodType.GrainsAndHay; } } public override int TreasureMapLevel { get { return 5; } } public ACuSidhe( 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(); /*if ( BaseSoundID == 0x16A ) BaseSoundID = 0xA8;*/ } } } |
CODE |
else if ( Hits < HitsMax ) |
CODE |
if ( Controlled && ControlMaster != null ) |
CODE |
if ( Hits < HitsMax ) |
CODE |
using Server; using System; using Server.Items; using Server.Mobiles; using Server.Targeting; using System.Collections; namespace Server.Mobiles { [CorpseName( "a cu sidhe corpse" )] public class CuSidhe1 : BaseMount { //public override bool OverrideBardingDifficulty { get { return true; } } //Osiris Mod //public override double BardingDifficulty { get { return 126.9; } } //Osiris Mod public override WeaponAbility GetWeaponAbility() { return WeaponAbility.BleedAttack; } public override bool StatLossAfterTame { get { return true; } } public override bool CanAngerOnTame { get { return true; } } [Constructable] public CuSidhe1() : this( "a cu sidhe" ) { } [Constructable] public CuSidhe1( string name ) : base( name, 277, 0x3e91, AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 ) { BaseSoundID = 0xE5; Hue = Utility.RandomList ( 897, 593, 1153, 1161, 2425, 2419, 2219, 33, 2406, 2413, 2207, 2418, 2213, 1278, 26, 0, 96, 900 ); SetStr( 1100, 1325 ); SetDex( 150, 170 ); SetInt( 250, 285 ); SetHits( 800, 1170 ); SetMana( 250, 285 );//from Hiryu SetStam( 170, 270 );//from hiryu SetDamage( 20, 28 );//hiryu damage SetDamageType( ResistanceType.Physical, 0 ); SetDamageType( ResistanceType.Cold, 50 ); SetDamageType( ResistanceType.Energy, 50 ); SetResistance( ResistanceType.Physical, 50, 65 );//used 5 over and 5 under what stratics posted SetResistance( ResistanceType.Fire, 25, 45 ); SetResistance( ResistanceType.Cold, 70, 85 ); SetResistance( ResistanceType.Poison, 30, 50 ); SetResistance( ResistanceType.Energy, 70, 85 ); SetSkill( SkillName.Anatomy, 65.2, 99.9 ); SetSkill( SkillName.MagicResist, 75.0, 89.7 ); SetSkill( SkillName.Tactics, 85.0, 97.6 ); SetSkill( SkillName.Wrestling, 88.9, 99.9 ); SetSkill( SkillName.Healing, 40.1, 50.0 ); SetSkill( SkillName.Veterinary, 40.1, 50.0 ); SetSkill( SkillName.AnimalLore, 40.1, 50.0 ); SetFameLevel( 5 ); SetKarmaLevel( 5 ); VirtualArmor = 75; Tamable = true; ControlSlots = 4; MinTameSkill = 101.1; PackGold(750, 950); PackMagicItems( 1, 5 ); PackItem( new Bandage( Utility.RandomMinMax( 1, 25 ) ) ); } #region Healing private DateTime m_BandageStart; private DateTime m_NextHeal; private static TimeSpan m_HealDelay = TimeSpan.FromSeconds( 10.0 ); public override void OnThink() { if( DateTime.Now < m_BandageStart + m_HealDelay ) return; bool r = false; if( !Deleted && Alive && Controlled && !ControlMaster.Deleted ) { //Priority for ControlMaster //Do these resurrect? if( ControlMaster.Hits < ControlMaster.HitsMax && ControlMaster.InRange( this, 2 ) && ControlMaster.Alive ) r = HealTarget( ControlMaster ); else if( Hits < HitsMax ) r = HealTarget( this ); } if( r ) DebugSay( "Healing..." ); else DebugSay( "Not healing..." ); base.OnThink(); } public bool HealTarget( Mobile tgt ) { if( tgt == null ) return false; if( BandageContext.GetContext( this ) == null ) //If not already healing { Item bandage = Backpack.FindItemByType( typeof( Bandage ) ); if( bandage == null ) { bandage = new Bandage(); Backpack.DropItem( bandage ); } BandageContext.BeginHeal( this, tgt ); m_BandageStart = DateTime.Now; return BandageContext.GetContext( this ) != null; } else return false; } #endregion public override void GenerateLoot() { AddLoot( LootPack.FilthyRich ); } public override int GetAngerSound() { if ( !Controlled ) return 0x16A; return base.GetAngerSound(); } public override int Meat{ get{ return 3; } } public override int Hides{ get{ return 5; } } public override HideType HideType{ get{ return HideType.Barbed; } } public override FoodType FavoriteFood{ get{ return FoodType.Meat; } } public override void OnDoubleClick( Mobile from ) { /* if( Core.ML && from.Race == Race.Elf ) { base.OnDoubleClick( from ); }*/ if ( from.Race == Race.Elf || from.FindItemOnLayer( Layer.Shoes ) is PadsOfTheCuSidhe || from.AccessLevel > AccessLevel.Player ) { base.OnDoubleClick( from ); } else { from.SendLocalizedMessage( 1072203 ); // Only Elves may use this. } } public CuSidhe1( 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(); // if ( BaseSoundID == 0x16A ) //BaseSoundID = 0xA8; } } } |