public Dummy(AIType iAI, FightMode iFightMode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed) : base(iAI, iFightMode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed) { Body = 400 + Utility.Random(2); Hue = Utility.RandomSkinHue(); Skills[SkillName.DetectHidden].Base = 100; 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 BaseBlue(AIType ai, FightMode fm, int PR, int FR, double AS, double PS) : base(ai, fm, PR, FR, AS, PS) { SpeechHue = Utility.RandomDyedHue(); Hue = Utility.RandomSkinHue(); // RangePerception = BaseCreature.DefaultRangePerception; }
public BaseWarHorse(int bodyID, int itemID, AIType aiType, FightMode fightMode, int rangePerception, int rangeFight, double activeSpeed, double passiveSpeed) : base(bodyID, itemID, aiType, fightMode, rangePerception, rangeFight, activeSpeed, passiveSpeed) { BaseSoundID = 0xA8; InitStats(Utility.Random(300, 100), 125, 60); SetStr(400); SetDex(125); SetInt(51, 55); SetHits(240); SetMana(0); SetDamage(5, 8); SetDamageType(ResistanceType.Physical, 100); SetResistance(ResistanceType.Physical, 40, 50); SetResistance(ResistanceType.Fire, 30, 40); SetResistance(ResistanceType.Cold, 30, 40); SetResistance(ResistanceType.Poison, 30, 40); SetResistance(ResistanceType.Energy, 30, 40); SetSkill(SkillName.MagicResist, 25.1, 30.0); SetSkill(SkillName.Tactics, 29.3, 44.0); SetSkill(SkillName.Wrestling, 29.3, 44.0); Fame = 300; Karma = 300; Tamable = true; ControlSlots = 1; MinTameSkill = 29.1; }
public void SelectFightMode() { if (Utility.RandomDouble() <= CombatantChangeChance) { curFightMode = (curFightMode == FightMode.Closest) ? FightMode.Weakest : FightMode.Closest; } }
public Dummy( AIType iAI, FightMode iFightMode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed ) : base(iAI, iFightMode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed) { Body = 400 + Utility.Random(2); Hue = Race.Human.RandomSkinHue(); Skills.DetectHidden.Base = 100; Skills.MagicResist.Base = 120; Team = Utility.Random(3); var iHue = 20 + Team * 40; var jHue = 25 + Team * 40; Utility.AssignRandomHair(this, iHue); var 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 BaseMount(string name, int bodyID, int itemID, AIType aiType, FightMode fightMode, int rangePerception, int rangeFight, double activeSpeed, double passiveSpeed) : base(aiType, fightMode, rangePerception, rangeFight, activeSpeed, passiveSpeed) { Name = name; Body = bodyID; m_InternalItem = new MountItem(this, itemID); }
public BaseMount( string name, int bodyID, int itemID, AIType aiType, FightMode fightMode, int rangePerception, int rangeFight, double activeSpeed, double passiveSpeed ) : base ( aiType, fightMode, rangePerception, rangeFight, activeSpeed, passiveSpeed ) { Name = name; Body = bodyID; m_InternalItem = new MountItem( this, itemID ); }
public BaseWarHorse( int bodyID, int itemID, AIType aiType, FightMode fightMode, int rangePerception, int rangeFight, double activeSpeed, double passiveSpeed ) : base ( "a war horse", bodyID, itemID, aiType, fightMode, rangePerception, rangeFight, activeSpeed, passiveSpeed ) { BaseSoundID = 0xA8; InitStats( Utility.Random( 300, 100 ), 125, 60 ); SetStr( 400 ); SetDex( 125 ); SetInt( 51, 55 ); SetHits( 240 ); SetMana( 0 ); SetDamage( 5, 8 ); SetDamageType( ResistanceType.Physical, 100 ); SetResistance( ResistanceType.Physical, 40, 50 ); SetResistance( ResistanceType.Fire, 30, 40 ); SetResistance( ResistanceType.Cold, 30, 40 ); SetResistance( ResistanceType.Poison, 30, 40 ); SetResistance( ResistanceType.Energy, 30, 40 ); SetSkill( SkillName.MagicResist, 25.1, 30.0 ); SetSkill( SkillName.Tactics, 29.3, 44.0 ); SetSkill( SkillName.Wrestling, 29.3, 44.0 ); Fame = 300; Karma = 300; Tamable = true; ControlSlots = 1; MinTameSkill = 29.1; }
/// <summary> /// Initializes a new instance of the <see cref="ChangeModesOperation"/> class. /// </summary> /// <param name="requestorId">The id of the creature setting the modes.</param> /// <param name="fightMode">The fight mode to set.</param> /// <param name="chaseMode">The chase mode to set.</param> /// <param name="safeModeOn">A value indicating whether the safety mode is on.</param> public ChangeModesOperation(uint requestorId, FightMode fightMode, ChaseMode chaseMode, bool safeModeOn) : base(requestorId) { this.FightMode = fightMode; this.ChaseMode = chaseMode; this.IsSafeModeOn = safeModeOn; }
public Dummy(AIType iAI, FightMode iFightMode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed) : base(iAI, iFightMode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed) { Body = 400 + Utility.Random(2); Hue = Utility.RandomSkinHue(); Skills[SkillName.DetectHidden].Base = 100; 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 { Hue = iHue, LootType = LootType.Newbied }; AddItem(glv); Container pack = new Backpack { Movable = false }; AddItem(pack); m_Timer = new AutokillTimer(this); m_Timer.Start(); }
public BaseMustang( int bodyID, int itemID, AIType aiType, FightMode fightMode, int rangePerception, int rangeFight, double activeSpeed, double passiveSpeed ) : base ( "Un Mustang", bodyID, itemID, aiType, fightMode, rangePerception, rangeFight, activeSpeed, passiveSpeed ) { BaseSoundID = 0xA8; SetStr( 70, 120 ); SetDex( 70, 105 ); SetInt( 9, 15 ); SetHits( 80, 120 ); SetMana( 0 ); SetDamage( 3, 4 ); SetDamageType( ResistanceType.Physical, 100 ); SetResistance( ResistanceType.Physical, 25, 35 ); SetResistance( ResistanceType.Fire, 10, 20 ); SetResistance( ResistanceType.Cold, 10, 20 ); SetResistance( ResistanceType.Poison, 10, 20 ); SetResistance( ResistanceType.Energy, 10, 20 ); SetSkill( SkillName.MagicResist, 25.1, 30.0 ); SetSkill( SkillName.Tactics, 29.3, 44.0 ); SetSkill( SkillName.Wrestling, 29.3, 44.0 ); Fame = 300; Karma = 300; Tamable = true; ControlSlots = 1; }
public ArmyBase(int Team, 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.Team = Team; this.Skills[SkillName.DetectHidden].Base = 100; this.Skills[SkillName.MagicResist].Base = 120; int iHue = 20 + Team * 40; int jHue = 25 + Team * 40; Item hair = new Item( Utility.RandomList( 0x203C, 0x203B, 0x203C, 0x203D ) ); hair.Hue = iHue; hair.Layer = Layer.Hair; hair.Movable = false; AddItem( hair ); 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(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; Item hair = new Item(Utility.RandomList(0x203C, 0x203B, 0x203C, 0x203D)); hair.Hue = iHue; hair.Layer = Layer.Hair; hair.Movable = false; AddItem(hair); 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 FamousPirates(AIType iAI, FightMode iFightMode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed) : base(iAI, iFightMode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed) { this.Body = 400; this.Hue = Utility.RandomSkinHue(); this.Skills[SkillName.DetectHidden].Base = 100; this.Skills[SkillName.MagicResist].Base = 100; this.Skills[SkillName.Magery].Base = 100; this.Skills[SkillName.Healing].Base = 100; int Hue = 0 ; Utility.AssignRandomHair( this, Hue ); LeatherGloves glv = new LeatherGloves(); glv.Hue = Hue; glv.LootType = LootType.Regular; AddItem(glv); Container pack = new Backpack(); pack.Movable = false; AddItem( pack ); Kills = 5; }
//Allows to change all base creature and res type. public BaseCreatureStatue(int BodyValue, ResType restype, Direction direction, AIType ai, FightMode mode, int RangePerception, int RangeFight, double ActiveSpeed, double PassiveSpeed) : base(AIType.AI_Melee,FightMode.Closest, 10, 1, 0.2, 0.4) { Body = BodyValue; mResTyp = restype; mDirection = direction; AI = ai; FightMode = mode; RangePerception = RangePerception; RangeFight = RangeFight; ActiveSpeed = ActiveSpeed; PassiveSpeed = PassiveSpeed; m_ResType = restype; CantWalk = true; Paralyzed = true; Blessed = true; Timer.DelayCall(TimeSpan.Zero, Freeze); Timer.DelayCall(TimeSpan.Zero, SetUpBase); SolidHueOverride = (int)m_ResType; //One base for each creature. m_base = new CreatureStatueBase(this); }
public BaseSpecialCreature(AIType ai, FightMode mode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed) : base(ai, mode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed) { if (DoesTeleporting) { m_Timer = new TeleportTimer(this); m_Timer.Start(); } }
public BaseDragon(AIType ai, FightMode mode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed) : base(ai, mode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed) { Tamable = true; BaseSoundID = 362; Fav_Gem = 3859; //Ruby Fav_Gem2 = 3861; // Citrine }
public BlueMonster(AIType aitype, FightMode fightmode, int spot, int meleerange, double passivespeed, double activespeed) : base(aitype, fightmode, spot, meleerange, passivespeed, activespeed) { m_LastCast = DateTime.Now; // forces these skills to defualt to 100.0, just in case. SetSkill(SkillName.Forensics, 100.0); SetSkill(SkillName.MagicResist, 100.0); }
public BlueMonster( AIType aitype, FightMode fightmode, int spot, int meleerange, double passivespeed, double activespeed ) : base( aitype, fightmode, spot, meleerange, passivespeed, activespeed ) { m_LastCast = DateTime.Now; // forces these skills to defualt to 100.0, just in case. SetSkill( SkillName.Forensics, 100.0 ); SetSkill( SkillName.MagicResist, 100.0 ); }
public TalkingBaseCreature( AIType ai, FightMode mode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed) : base(ai, mode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed) { // add the XmlDialog attachment m_DialogAttachment = new XmlDialog((string)null); XmlAttach.AttachTo(this, m_DialogAttachment); }
public BaseWyvern(AIType ai, FightMode mode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed) : base(ai, mode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed) { Tamable = true; BaseSoundID = 362; Fav_Gem = 3877; //Amber Fav_Gem2 = 3885; //Tourmaline }
public virtual void HandleChangeMode(Player player, FightMode fightMode, FightStance fightStance) { lock (lockThis) { player.CurrentFightMode = fightMode; player.CurrentFightStance = fightStance; } }
void UpdateEnemyUI() { fightMode = FightMode.InFight; Name.text = "Name - " + FirstToFifthLevelEnemys[enemyCounter].name; Health.text = "Health - " + FirstToFifthLevelEnemys[enemyCounter].Health.ToString(); Damage.text = "Damage - " + FirstToFifthLevelEnemys[enemyCounter].Damage.ToString(); Level.text = "Level - " + FirstToFifthLevelEnemys[enemyCounter].level.ToString(); Debug.Log("fighting enemy " + FirstToFifthLevelEnemys[enemyCounter].name); }
public BaseSeaChampion(Mobile fisher, AIType ai, FightMode fm) : base(ai, fm) { m_NextBoatDamage = DateTime.UtcNow; m_InDamageMode = false; m_Fisher = fisher; m_DamageEntries = new Dictionary<Mobile, int>(); }
public ArmyAI(BaseCreature m) : base(m) { m_ArmyHome = m.Location; m_ArmyDirection = m.Direction; m_ArmyFightMode = FightMode.Aggressor; CreatePreviousAIType(); Action = ActionType.Backoff; }
public BaseSeaChampion(Mobile fisher, AIType ai, FightMode fm) : base(ai, fm) { m_NextBoatDamage = DateTime.UtcNow; m_InDamageMode = false; m_Fisher = fisher; m_DamageEntries = new Dictionary <Mobile, int>(); }
public CombatControlsCommand(Player player, FightMode fightMode, ChaseMode chaseMode, SafeMode safeMode) { Player = player; FightMode = fightMode; ChaseMode = chaseMode; SafeMode = safeMode; }
public BaseMount( string name, int bodyID, int itemID, AIType aiType, FightMode fightMode = FightMode.Closest, int rangePerception = 10, int rangeFight = 1 ) : base(aiType, fightMode, rangePerception, rangeFight) { Name = name; Body = bodyID; InternalItem = new MountItem(this, itemID); }
public BaseWhiteWyrm(AIType ai, FightMode mode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed) : base(ai, mode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed) { Tamable = true; BaseSoundID = 362; Fav_Gem = 3878; //Diamond Fav_Gem2 = 3873; //StarSapphire Dex = 50; }
public BaseEvo(AIType ai, FightMode mode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed) : base(ai, mode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed) //AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 ) { m_KP_Lv = 10000; m_KP_Lower = 0; Ability_ChargesMax = 15; //Temp StrLock = StatLockType.Up; DexLock = StatLockType.Up; IntLock = StatLockType.Up; Evolve_Check(); }
// Use this for initialization void Start() { escapeButton = GameObject.Find("ButtonForEscape"); dungeon = GameObject.Find("Dungeon"); displayParty = dungeon.GetComponent <DisplayParty>(); escapeButton.GetComponent <Button>().onClick.AddListener(escapeFromFight); randomNumber = new System.Random(); dungeonsGenerator = dungeon.GetComponent <DungeonsGenerator>(); fightMode = dungeon.GetComponent <FightMode>(); escapeButton.SetActive(false); }
public int MakeDamage(FightMode fightMode) { if (fightMode == FightMode.Punch) { return(this.PunchDamage); } else { return(this.KickDamage); } }
public bool Play() { Console.WriteLine("Choose location to go"); switch (currLocation) { case GameLocation.MAIN: { var locList = Enum.GetNames(typeof(GameLocation)).ToList(); locList.Remove(Enum.GetName(typeof(GameLocation), GameLocation.MAIN)); for (int i = 0; i < locList.Count; i++) { Console.WriteLine($"[{i}] {locList[i]}"); } int choice = int.Parse(Console.ReadLine()); GameLocation gameLocation = (GameLocation)choice; return(true); } case GameLocation.ARENA: { var fightTypes = Enum.GetNames(typeof(FightMode)); for (int i = 0; i < fightTypes.Length; i++) { Console.WriteLine($"[{i}] {fightTypes[i]}"); } int choice = int.Parse(Console.ReadLine()); FightMode fightMode = (FightMode)choice; GoFight(fightMode); } break; case GameLocation.FIGHTING: break; case GameLocation.ARMOURY: break; case GameLocation.BLACKSMITH: break; case GameLocation.MAGICSHOP: break; case GameLocation.CHURCH: break; default: break; } return(true); }
//the constructor sits inline with the standard BaseCreature constructor, allowing for easy //development of custom linked creatures public BaseLinkedCreature(AIType ai, FightMode mode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed) : base(ai, mode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed) { _LinkedCreatures = new List <BaseLinkedCreature>(); //keep it immortal, hidden, and frozen until it has linked to the desired number Blessed = true; Frozen = true; Hidden = true; //wait for the mobile to be fully placed in the world before trying to link Timer.DelayCall(TimeSpan.FromSeconds(1), new TimerStateCallback(Link_Callback), null); }
public TalkingBaseCreature(AIType ai, FightMode mode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed) : base(ai, mode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed) { // add the XmlDialog attachment m_DialogAttachment = new XmlDialog((string)null); XmlAttach.AttachTo(this, m_DialogAttachment); }
// Use this for initialization void Start() { dungeonCanvas = GameObject.Find("Dungeon"); fightMode = dungeonCanvas.GetComponent <FightMode>(); dungeonManager = dungeonCanvas.GetComponent <DungeonManager>(); dungeonsGenerator = dungeonCanvas.GetComponent <DungeonsGenerator>(); buttonForCameraMovement = dungeonCanvas.GetComponent <ButtonForCameraMovement>(); enemyObjectsArray = new List <FightModeObject>(); heroObjectsArray = new List <FightModeObject>(); tempObject = new GameObject(); createMasksForHighlight(); }
public void PlaySound_OnFightedMonster() { //untestable var mode = new FightMode(); var mode1 = new Mock <IFightMode>(); object x = 6; EventArgs y = EventArgs.Empty; mode1.Object.OnFightedMonster(x, y); mode1.Verify(z => z.OnFightedMonster(x, y), Times.Exactly(1)); }
public void ModesPacket_Initialization() { const FightMode ExpectedFightMode = FightMode.Balanced; const ChaseMode ExpectedChaseMode = ChaseMode.KeepDistance; const bool ExpectedSafetyModeValue = true; IModesInfo modesInfo = new ModesPacket(ExpectedFightMode, ExpectedChaseMode, ExpectedSafetyModeValue); Assert.AreEqual(ExpectedFightMode, modesInfo.FightMode, $"Expected {nameof(modesInfo.FightMode)} to match {ExpectedFightMode}."); Assert.AreEqual(ExpectedChaseMode, modesInfo.ChaseMode, $"Expected {nameof(modesInfo.ChaseMode)} to match {ExpectedChaseMode}."); Assert.AreEqual(ExpectedSafetyModeValue, modesInfo.SafeModeOn, $"Expected {nameof(modesInfo.SafeModeOn)} to match {ExpectedSafetyModeValue}."); }
/// <summary> /// Sets the target. /// </summary> /// <param name="fightMode">The fight mode.</param> private void SetTarget(FightMode fightMode) { //NAND out the options so these bits are all 0 FightMode newFightMode = (FightMode)m_State.GetValue <FightMode>("Target"); newFightMode &= ~FightMode.Strongest; newFightMode &= ~FightMode.Weakest; newFightMode &= ~FightMode.Closest; newFightMode |= fightMode; //Set the required option m_State.SetValue("Target", newFightMode); }
public VoidCreature(AIType ai, FightMode mode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed) : base(ai, mode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed) { m_Evolutions = new List <EvolutionHandler>(); CreateEvolutionHandlers(); m_Timer = new EvolutionTimer(this); m_Timer.Start(); Team = 1; }
public BaseRanger(AIType ai, FightMode fm, int PR, int FR, double AS, double PS) : base(ai, fm, PR, FR, AS, PS) { SpeechHue = Utility.RandomDyedHue(); Hue = Utility.RandomSkinHue(); Container pack = new Backpack(); pack.DropItem(new Bandage(10)); pack.Movable = false; AddItem(pack); }
public AuraCreature( AIType aitype, FightMode fightmode, int spot, int meleerange, double passivespeed, double activespeed ) : base( aitype, fightmode, spot, meleerange, passivespeed, activespeed ) { m_AuraDelay = DateTime.Now; /* Default is ? MinAuraDelay = 5; MaxAuraDelay = 15; MinAuraDamage = 15; MaxAuraDamage = 25; AuraRange = 3; */ }
//the constructor sits inline with the standard BaseCreature constructor, allowing for easy //development of custom linked creatures public BaseLinkedCreature(AIType ai, FightMode mode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed ) : base( ai, mode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed ) { _LinkedCreatures = new List<BaseLinkedCreature>(); //keep it immortal, hidden, and frozen until it has linked to the desired number Blessed = true; Frozen = true; Hidden = true; //wait for the mobile to be fully placed in the world before trying to link Timer.DelayCall( TimeSpan.FromSeconds( 1 ), new TimerStateCallback( Link_Callback ), null ); }
public BaseElf( AIType ai, FightMode mode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed ) : base( ai, mode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed ) { Hue = 1801; Body = 0x605; Race = Race.Elf; Utility.AssignRandomHair( this, false ); if ( Utility.Random( 10 ) <= 4 ) HairHue = 0; else HairHue = Utility.RandomBool() ? Utility.RandomMinMax( 1102, 1149 ) : Utility.RandomMinMax( 1801, 1908 ); }
public BaseMount( string name, int bodyID, int itemID, AIType aiType, FightMode fightMode, int rangePerception, int rangeFight, double activeSpeed, double passiveSpeed ) : base(aiType, fightMode, rangePerception, rangeFight, activeSpeed, passiveSpeed) { if (IsMountBlocked) { this.Tamable = false; this.MinTameSkill = 9999.9; this.Delete(); } Name = name; Body = bodyID; m_InternalItem = new MountItem( this, itemID ); }
public BaseShipCaptain(BaseGalleon galleon, AIType ai, FightMode fm, int per, int range, double passive, double active) : base(ai, fm, per, range, passive, active) { m_Galleon = galleon; m_OnCourse = true; m_StopTime = DateTime.MinValue; if (this.Female = Utility.RandomBool()) { Body = 0x191; Name = NameList.RandomName("female"); AddItem(new Skirt(Utility.RandomNeutralHue())); } else { Body = 0x190; Name = NameList.RandomName("male"); AddItem(new ShortPants(Utility.RandomNeutralHue())); } SetStr(500, 750); SetDex(125, 175); SetInt(61, 75); SetHits(4500, 5000); SetDamage(23, 35); SetSkill(SkillName.Fencing, 115.0, 120.0); SetSkill(SkillName.Macing, 115.0, 120.0); SetSkill(SkillName.MagicResist, 115.0, 120.0); SetSkill(SkillName.Swords, 115.0, 120.0); SetSkill(SkillName.Tactics, 115.0, 120.0); SetSkill(SkillName.Wrestling, 115.0, 120.0); SetSkill(SkillName.Anatomy, 115.0, 120.0); SetDamageType(ResistanceType.Physical, 100); SetResistance(ResistanceType.Physical, 45, 55); SetResistance(ResistanceType.Fire, 45, 55); SetResistance(ResistanceType.Cold, 45, 55); SetResistance(ResistanceType.Poison, 45, 55); SetResistance(ResistanceType.Energy, 45, 55); if (galleon == null) Timer.DelayCall(TimeSpan.FromSeconds(.5), new TimerCallback(SpawnShip)); }
public AuraCreature(AIType aitype, FightMode fightmode, int spot, int meleerange, double passivespeed, double activespeed) : base(aitype, fightmode, spot, meleerange, passivespeed, activespeed) { AuraPoison = null; m_AuraDelay = DateTime.UtcNow; /* Default is ? AuraMessage = "The intense cold is damaging you!"; AuraType = ResistanceType.Fire; MinAuraDelay = 5; MaxAuraDelay = 15; MinAuraDamage = 15; MaxAuraDamage = 25; AuraRange = 3; */ }
public BaseAmazon( AIType ai, FightMode mode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed ) : base( ai, mode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed ) { Name = NameList.RandomName( "female" ); Hue = 33220; Body = 0x191; Female = true; HairItemID = 0x203C; HairHue = 2127; AddItem( new BodySash( 58 ) ); }
public BaseBarbarian( bool female, AIType aiType, FightMode fightMode, int rangePerception, int rangeFight, double activeSpeed, double passiveSpeed ) : base( aiType, fightMode, rangePerception, rangeFight, activeSpeed, passiveSpeed ) { if ( this.Female = female ) { Body = 0x191; Name = NameList.RandomName( "female" ); HairItemID = 0x203D; HairHue = Utility.RandomRedHue(); } else { Body = 0x190; Name = NameList.RandomName( "male" ); HairItemID = 0x203C; HairHue = Utility.RandomRedHue(); } //PackItem( new Gold( Utility.Random( 50, 100 ) ) ); Hue = 0; }
public override double GetFightModeRanking(Mobile m, FightMode acqType, bool bPlayerOnly) { return (m.Int + m.Skills[SkillName.Magery].Value) / Math.Max(GetDistanceToSqrt(m), 1.0); }
public BaseRareBoss(AIType aiType, FightMode mode) : base(aiType, mode) { }
/* * Here we check to acquire a target from our surronding * * iRange : The range * acqType : A type of acquire we want (closest, strongest, etc) * bPlayerOnly : Don't bother with other creatures or NPCs, want a player * bFacFriend : Check people in my faction * bFacFoe : Check people in other factions * */ public virtual bool AcquireFocusMob(int iRange, FightMode acqType, bool bPlayerOnly, bool bFacFriend, bool bFacFoe) { if (m_Mobile.Deleted) { return false; } if (m_Mobile.BardProvoked) { if (m_Mobile.BardTarget == null || m_Mobile.BardTarget.Deleted) { m_Mobile.FocusMob = null; return false; } else { m_Mobile.FocusMob = m_Mobile.BardTarget; return (m_Mobile.FocusMob != null); } } else if (m_Mobile.Controlled) { if (m_Mobile.ControlTarget == null || m_Mobile.ControlTarget.Deleted || (m_Mobile.ControlTarget is Mobile && ((Mobile)m_Mobile.ControlTarget).Hidden) || !m_Mobile.ControlTarget.Alive || (m_Mobile.ControlTarget is Mobile && ((Mobile)m_Mobile.ControlTarget).IsDeadBondedPet) || !m_Mobile.InRange(m_Mobile.ControlTarget, m_Mobile.RangePerception * 2)) { if (m_Mobile.ControlTarget != null && m_Mobile.ControlTarget != m_Mobile.ControlMaster) { m_Mobile.ControlTarget = null; } m_Mobile.FocusMob = null; return false; } else { m_Mobile.FocusMob = m_Mobile.ControlTarget; return (m_Mobile.FocusMob != null); } } if (m_Mobile.ConstantFocus != null) { m_Mobile.DebugSay("Acquired my constant focus"); m_Mobile.FocusMob = m_Mobile.ConstantFocus; return true; } if (acqType == FightMode.None) { m_Mobile.FocusMob = null; return false; } if (acqType == FightMode.Aggressor && m_Mobile.Aggressors.Count == 0 && m_Mobile.Aggressed.Count == 0 && m_Mobile.FactionAllegiance == null && m_Mobile.EthicAllegiance == null) { m_Mobile.FocusMob = null; return false; } if (m_Mobile.NextReacquireTime > Core.TickCount) { m_Mobile.FocusMob = null; return false; } m_Mobile.NextReacquireTime = Core.TickCount + (int)m_Mobile.ReacquireDelay.TotalMilliseconds; m_Mobile.DebugSay("Acquiring..."); Map map = m_Mobile.Map; if (map != null) { Mobile newFocusMob = null; double val = double.MinValue; double theirVal; var eable = map.GetMobilesInRange(m_Mobile.Location, iRange); foreach (Mobile m in eable) { if (m.Deleted || m.Blessed) { continue; } // Let's not target ourselves... if (m == m_Mobile || m is BaseFamiliar) { continue; } // Dead targets are invalid. if (!m.Alive || m.IsDeadBondedPet) { continue; } // Staff members cannot be targeted. if (m.IsStaff()) { continue; } // Does it have to be a player? if (bPlayerOnly && !m.Player) { continue; } // Can't acquire a target we can't see. if (!m_Mobile.CanSee(m)) { continue; } if (m_Mobile.Summoned && m_Mobile.SummonMaster != null) { // If this is a summon, it can't target its controller. if (m == m_Mobile.SummonMaster) continue; // It also must abide by harmful spell rules if the master is a player. if (m_Mobile.SummonMaster is PlayerMobile && !Server.Spells.SpellHelper.ValidIndirectTarget(m_Mobile.SummonMaster, m)) continue; // Players animated creatures cannot attack other players directly. if (m is PlayerMobile && m_Mobile.IsAnimatedDead && m_Mobile.SummonMaster is PlayerMobile) continue; } // If we only want faction friends if (bFacFriend && !bFacFoe) { // Ignore anyone who's not a friend if (!m_Mobile.IsFriend(m)) { continue; } } // Don't ignore friends we want to and can help else if (!bFacFriend || !m_Mobile.IsFriend(m)) { // Ignore anyone we can't hurt if (!m_Mobile.CanBeHarmful(m, false)) { continue; } // Don't ignore hostile mobiles if (!IsHostile(m)) { // Ignore anyone if we don't want enemies if (!bFacFoe) { continue; } //Ignore anyone under EtherealVoyage if (TransformationSpellHelper.UnderTransformation(m, typeof(EtherealVoyageSpell))) { continue; } // Ignore players with activated honor if (m is PlayerMobile && ((PlayerMobile)m).HonorActive && !(m_Mobile.Combatant == m)) { continue; } // Xmlspawner faction check // Ignore mob faction ranked players, more highly more often //if (!Server.Engines.XmlSpawner2.XmlMobFactions.CheckAcquire(this.m_Mobile, m)) //continue; // We want a faction/ethic enemy bool bValid = (m_Mobile.GetFactionAllegiance(m) == BaseCreature.Allegiance.Enemy || m_Mobile.GetEthicAllegiance(m) == BaseCreature.Allegiance.Enemy); BaseCreature c = m as BaseCreature; // We want a special FightMode enemy if (!bValid) { // We want a karma enemy if (acqType == FightMode.Evil) { if (c != null && c.Controlled && c.ControlMaster != null) { bValid = (c.ControlMaster.Karma < 0); } else { bValid = (m.Karma < 0); } } // We want a karma enemy else if (acqType == FightMode.Good) { if (c != null && c.Controlled && c.ControlMaster != null) { bValid = (c.ControlMaster.Karma > 0); } else { bValid = (m.Karma > 0); } } } // Don't ignore valid targets if (!bValid) { // Ignore anyone if we are a Passive FightMode if (acqType == FightMode.Good || acqType == FightMode.Evil || acqType == FightMode.Aggressor) { continue; } // Ignore anyone if they are an Uncontrolled Summon else if (c != null && c.Summoned) { continue; } // We want an enemy (We are an Aggressive FightMode) else if (m_Mobile.IsEnemy(m)) { bValid = true; } // Ignore anyone else else { continue; } } } } theirVal = m_Mobile.GetFightModeRanking(m, acqType, bPlayerOnly); if (theirVal > val && m_Mobile.InLOS(m)) { newFocusMob = m; val = theirVal; } } eable.Free(); m_Mobile.FocusMob = newFocusMob; } return (m_Mobile.FocusMob != null); }
/* * Here we check to acquire a target from our surronding * * iRange : The range * acqType : A type of acquire we want (closest, strongest, etc) * bPlayerOnly : Don't bother with other creatures or NPCs, want a player * bFacFriend : Check people in my faction * bFacFoe : Check people in other factions * */ public virtual bool AcquireFocusMob(int iRange, FightMode acqType, bool bPlayerOnly, bool bFacFriend, bool bFacFoe) { if (m_Mobile.Deleted) { return false; } if (m_Mobile.BardProvoked) { if (m_Mobile.BardTarget == null || m_Mobile.BardTarget.Deleted) { m_Mobile.FocusMob = null; return false; } else { m_Mobile.FocusMob = m_Mobile.BardTarget; return (m_Mobile.FocusMob != null); } } else if (m_Mobile.Controlled) { if (m_Mobile.ControlTarget == null || m_Mobile.ControlTarget.Deleted || m_Mobile.ControlTarget.Hidden || !m_Mobile.ControlTarget.Alive || m_Mobile.ControlTarget.IsDeadBondedPet || !m_Mobile.InRange(m_Mobile.ControlTarget, m_Mobile.RangePerception * 2)) { if (m_Mobile.ControlTarget != null && m_Mobile.ControlTarget != m_Mobile.ControlMaster) { m_Mobile.ControlTarget = null; } m_Mobile.FocusMob = null; return false; } else { m_Mobile.FocusMob = m_Mobile.ControlTarget; return (m_Mobile.FocusMob != null); } } if (m_Mobile.ConstantFocus != null) { m_Mobile.DebugSay("Acquired my constant focus"); m_Mobile.FocusMob = m_Mobile.ConstantFocus; return true; } if (acqType == FightMode.None) { m_Mobile.FocusMob = null; return false; } if (acqType == FightMode.Aggressor && m_Mobile.Aggressors.Count == 0 && m_Mobile.Aggressed.Count == 0 && m_Mobile.FactionAllegiance == null && m_Mobile.EthicAllegiance == null) { m_Mobile.FocusMob = null; return false; } if (m_Mobile.NextReacquireTime > Core.TickCount) { m_Mobile.FocusMob = null; return false; } m_Mobile.NextReacquireTime = Core.TickCount + (int)m_Mobile.ReacquireDelay.TotalMilliseconds; m_Mobile.DebugSay("Acquiring..."); Map map = m_Mobile.Map; if (map != null) { Mobile newFocusMob = null; double val = double.MinValue; double theirVal; var eable = map.GetMobilesInRange(m_Mobile.Location, iRange); foreach (Mobile m in eable) { if (m.Deleted || m.Blessed) { continue; } // Let's not target ourselves... if (m == m_Mobile || m is BaseFamiliar) { continue; } // Dead targets are invalid. if (!m.Alive || m.IsDeadBondedPet) { continue; } // Staff members cannot be targeted. if (m.IsStaff()) { continue; } // Does it have to be a player? if (bPlayerOnly && !m.Player) { continue; } // Can't acquire a target we can't see. if (!m_Mobile.CanSee(m)) { continue; } // Xmlspawner faction check //if (!Server.Engines.XmlSpawner2.XmlMobFactions.CheckAcquire(this.m_Mobile, m)) //continue; if (Core.AOS && m is BaseCreature && (m as BaseCreature).Summoned && !(m as BaseCreature).Controlled) { continue; } if (m_Mobile.Summoned && m_Mobile.SummonMaster != null) { // If this is a summon, it can't target its controller. if (m == m_Mobile.SummonMaster) { continue; } // It also must abide by harmful spell rules. if (!SpellHelper.ValidIndirectTarget(m_Mobile.SummonMaster, m)) { continue; } // Animated creatures cannot attack players directly. if (m is PlayerMobile && m_Mobile.IsAnimatedDead) { continue; } } // If we only want faction friends, make sure it's one. if (bFacFriend && !m_Mobile.IsFriend(m)) { continue; } //Ignore anyone under EtherealVoyage if (TransformationSpellHelper.UnderTransformation(m, typeof(EtherealVoyageSpell))) { continue; } // Ignore players with activated honor if (m is PlayerMobile && ((PlayerMobile)m).HonorActive && !(m_Mobile.Combatant == m)) { continue; } if (acqType == FightMode.Aggressor || acqType == FightMode.Evil || (m is BaseCreature) && ((BaseCreature)m).Summoned || acqType == FightMode.Good) { bool bValid = IsHostile(m); if (!bValid) { bValid = (m_Mobile.GetFactionAllegiance(m) == BaseCreature.Allegiance.Enemy || m_Mobile.GetEthicAllegiance(m) == BaseCreature.Allegiance.Enemy); } if (acqType == FightMode.Evil && !bValid) { if (m is BaseCreature && ((BaseCreature)m).Controlled && ((BaseCreature)m).ControlMaster != null) { bValid = (((BaseCreature)m).ControlMaster.Karma < 0); } else { bValid = (m.Karma < 0); } } if (acqType == FightMode.Good && !bValid) { if (m is BaseCreature && ((BaseCreature)m).Controlled && ((BaseCreature)m).ControlMaster != null) { bValid = (((BaseCreature)m).ControlMaster.Karma > 0); } else { bValid = (m.Karma > 0); } } if (!bValid) { continue; } } else { // Same goes for faction enemies. if (bFacFoe && !m_Mobile.IsEnemy(m)) { continue; } // If it's an enemy factioned mobile, make sure we can be harmful to it. if (bFacFoe && !bFacFriend && !m_Mobile.CanBeHarmful(m, false)) { continue; } } theirVal = m_Mobile.GetFightModeRanking(m, acqType, bPlayerOnly); if (theirVal > val && m_Mobile.InLOS(m)) { newFocusMob = m; val = theirVal; } } eable.Free(); m_Mobile.FocusMob = newFocusMob; } return (m_Mobile.FocusMob != null); }
public override bool AcquireFocusMob( int iRange, FightMode acqType, bool bPlayerOnly, bool bFacFriend, bool bFacFoe ) { if ( m_Mobile.Deleted ) { return false; } if ( m_Mobile.BardProvoked ) { if ( m_Mobile.BardTarget == null || m_Mobile.BardTarget.Deleted ) { m_Mobile.FocusMob = null; return false; } else { m_Mobile.FocusMob = m_Mobile.BardTarget; return ( m_Mobile.FocusMob != null ); } } else if ( m_Mobile.Controlled ) { if ( m_Mobile.ControlTarget == null || m_Mobile.ControlTarget.Deleted ) { m_Mobile.FocusMob = null; return false; } else { m_Mobile.FocusMob = m_Mobile.ControlTarget; return ( m_Mobile.FocusMob != null ); } } if ( acqType == FightMode.None ) { m_Mobile.FocusMob = null; return false; } if ( acqType == FightMode.Aggressor && m_Mobile.Aggressors.Count == 0 && m_Mobile.Aggressed.Count == 0 ) { m_Mobile.FocusMob = null; return false; } Map map = m_Mobile.Map; if ( map != null ) { Mobile newFocusMob = null; double val = double.MinValue; var eable = map.GetMobilesInRange( m_Mobile.Location, iRange ); foreach ( Mobile m in eable ) { bool bCheckIt = false; // // Basic check // if ( ( bPlayerOnly && m.IsPlayer ) || !bPlayerOnly ) { if ( m.AccessLevel == AccessLevel.Player && m.Alive && !m.Blessed && !m.Deleted && m != m_Mobile && m_Mobile.CanSee( m ) ) { bCheckIt = true; } } if ( bCheckIt && !m_Mobile.Controlled && m_Mobile.Summoned && m_Mobile.SummonMaster != null ) { bCheckIt = ( m != m_Mobile.SummonMaster ); } // // Team check // if ( bCheckIt ) // alrealy passed the others tests { bCheckIt = ( ( bFacFriend && m_Mobile.IsFriend( m ) ) || ( bFacFoe && m_Mobile.IsEnemy( m ) ) ); } if ( bCheckIt && bFacFoe && !bFacFriend && m_Mobile.Summoned && !m_Mobile.Controlled && m_Mobile.SummonMaster != null ) { bCheckIt = Server.Spells.SpellHelper.ValidIndirectTarget( m_Mobile.SummonMaster, m ); } if ( bCheckIt ) { if ( acqType == FightMode.Aggressor || acqType == FightMode.Evil ) { bCheckIt = false; for ( int a = 0; !bCheckIt && a < m_Mobile.Aggressors.Count; ++a ) { bCheckIt = ( ( (AggressorInfo) m_Mobile.Aggressors[a] ).Attacker == m ); } for ( int a = 0; !bCheckIt && a < m_Mobile.Aggressed.Count; ++a ) { bCheckIt = ( ( (AggressorInfo) m_Mobile.Aggressed[a] ).Defender == m ); } if ( acqType == FightMode.Evil && !bCheckIt ) { bCheckIt = ( m.Karma < 0 ); } } double theirVal = m_Mobile.GetValueFrom( m, acqType, bPlayerOnly ); if ( theirVal > val && m_Mobile.InLOS( m ) ) { newFocusMob = m; val = theirVal; } } } m_Mobile.FocusMob = newFocusMob; } return ( m_Mobile.FocusMob != null ); }
public void SelectFightMode() { if ( Utility.RandomDouble() <= CombatantChangeChance ) { curFightMode = ( curFightMode == FightMode.Closest ) ? FightMode.Weakest : FightMode.Closest; } }
public MephitisAI( BaseCreature m ) : base(m) { curFightMode = m.FightMode; }
public BaseChampion( AIType aiType, FightMode mode ) : base( aiType, mode, 18, 1, 0.1, 0.2 ) { }
/* * This function can be overriden.. so a "Strongest" mobile, can have a different definition depending * on who check for value * -Could add a FightMode.Prefered * */ public virtual double GetFightModeRanking( Mobile m, FightMode acqType, bool bPlayerOnly ) { if ( ( bPlayerOnly && m.Player ) || !bPlayerOnly ) { switch( acqType ) { case FightMode.Strongest : return (m.Skills[SkillName.Tactics].Value + m.Str); //returns strongest mobile case FightMode.Weakest : return -m.Hits; // returns weakest mobile default : return -GetDistanceToSqrt( m ); // returns closest mobile } } else { return double.MinValue; } }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); m_CurrentAI = (AIType)reader.ReadInt(); m_DefaultAI = (AIType)reader.ReadInt(); m_iRangePerception = reader.ReadInt(); m_iRangeFight = reader.ReadInt(); m_iTeam = reader.ReadInt(); m_dActiveSpeed = reader.ReadDouble(); m_dPassiveSpeed = reader.ReadDouble(); m_dCurrentSpeed = reader.ReadDouble(); if ( m_iRangePerception == OldRangePerception ) m_iRangePerception = DefaultRangePerception; m_pHome.X = reader.ReadInt(); m_pHome.Y = reader.ReadInt(); m_pHome.Z = reader.ReadInt(); if ( version >= 1 ) { m_iRangeHome = reader.ReadInt(); int i, iCount; iCount = reader.ReadInt(); for ( i=0; i< iCount; i++ ) { string str = reader.ReadString(); Type type = Type.GetType( str ); if ( type != null ) { m_arSpellAttack.Add( type ); } } iCount = reader.ReadInt(); for ( i=0; i< iCount; i++ ) { string str = reader.ReadString(); Type type = Type.GetType( str ); if ( type != null ) { m_arSpellDefense.Add( type ); } } } else { m_iRangeHome = 0; } if ( version >= 2 ) { m_FightMode = ( FightMode )reader.ReadInt(); m_bControlled = reader.ReadBool(); m_ControlMaster = reader.ReadMobile(); m_ControlTarget = reader.ReadMobile(); m_ControlDest = reader.ReadPoint3D(); m_ControlOrder = (OrderType) reader.ReadInt(); m_dMinTameSkill = reader.ReadDouble(); if ( version < 9 ) reader.ReadDouble(); m_bTamable = reader.ReadBool(); m_bSummoned = reader.ReadBool(); if ( m_bSummoned ) { m_SummonEnd = reader.ReadDeltaTime(); new UnsummonTimer( m_ControlMaster, this, m_SummonEnd - DateTime.Now ).Start(); } m_iControlSlots = reader.ReadInt(); } else { m_FightMode = FightMode.Closest; m_bControlled = false; m_ControlMaster = null; m_ControlTarget = null; m_ControlOrder = OrderType.None; } if ( version >= 3 ) m_Loyalty = reader.ReadInt(); else m_Loyalty = MaxLoyalty; // Wonderfully Happy if ( version >= 4 ) m_CurrentWayPoint = reader.ReadItem() as WayPoint; if ( version >= 5 ) m_SummonMaster = reader.ReadMobile(); if ( version >= 6 ) { m_HitsMax = reader.ReadInt(); m_StamMax = reader.ReadInt(); m_ManaMax = reader.ReadInt(); m_DamageMin = reader.ReadInt(); m_DamageMax = reader.ReadInt(); } if ( version >= 7 ) { m_PhysicalResistance = reader.ReadInt(); m_PhysicalDamage = reader.ReadInt(); m_FireResistance = reader.ReadInt(); m_FireDamage = reader.ReadInt(); m_ColdResistance = reader.ReadInt(); m_ColdDamage = reader.ReadInt(); m_PoisonResistance = reader.ReadInt(); m_PoisonDamage = reader.ReadInt(); m_EnergyResistance = reader.ReadInt(); m_EnergyDamage = reader.ReadInt(); } if ( version >= 8 ) m_Owners = reader.ReadStrongMobileList(); else m_Owners = new List<Mobile>(); if ( version >= 10 ) { m_IsDeadPet = reader.ReadBool(); m_IsBonded = reader.ReadBool(); m_BondingBegin = reader.ReadDateTime(); m_OwnerAbandonTime = reader.ReadDateTime(); } if ( version >= 11 ) m_HasGeneratedLoot = reader.ReadBool(); else m_HasGeneratedLoot = true; if ( version >= 12 ) m_Paragon = reader.ReadBool(); else m_Paragon = false; if ( version >= 13 && reader.ReadBool() ) m_Friends = reader.ReadStrongMobileList(); else if ( version < 13 && m_ControlOrder >= OrderType.Unfriend ) ++m_ControlOrder; if ( version < 16 && Loyalty != MaxLoyalty ) Loyalty *= 10; double activeSpeed = m_dActiveSpeed; double passiveSpeed = m_dPassiveSpeed; SpeedInfo.GetSpeeds( this, ref activeSpeed, ref passiveSpeed ); bool isStandardActive = false; for ( int i = 0; !isStandardActive && i < m_StandardActiveSpeeds.Length; ++i ) isStandardActive = ( m_dActiveSpeed == m_StandardActiveSpeeds[i] ); bool isStandardPassive = false; for ( int i = 0; !isStandardPassive && i < m_StandardPassiveSpeeds.Length; ++i ) isStandardPassive = ( m_dPassiveSpeed == m_StandardPassiveSpeeds[i] ); if ( isStandardActive && m_dCurrentSpeed == m_dActiveSpeed ) m_dCurrentSpeed = activeSpeed; else if ( isStandardPassive && m_dCurrentSpeed == m_dPassiveSpeed ) m_dCurrentSpeed = passiveSpeed; if ( isStandardActive && !m_Paragon ) m_dActiveSpeed = activeSpeed; if ( isStandardPassive && !m_Paragon ) m_dPassiveSpeed = passiveSpeed; if ( version >= 14 ) { m_RemoveIfUntamed = reader.ReadBool(); m_RemoveStep = reader.ReadInt(); } TimeSpan deleteTime = TimeSpan.Zero; if ( version >= 17 ) deleteTime = reader.ReadTimeSpan(); if ( deleteTime > TimeSpan.Zero || LastOwner != null && !Controlled && !IsStabled ) { if ( deleteTime == TimeSpan.Zero ) deleteTime = TimeSpan.FromDays( 3.0 ); m_DeleteTimer = new DeleteTimer( this, deleteTime ); m_DeleteTimer.Start(); } if( version <= 14 && m_Paragon && Hue == 0x31 ) { Hue = Paragon.Hue; //Paragon hue fixed, should now be 0x501. } CheckStatTimers(); ChangeAIType(m_CurrentAI); AddFollowers(); if ( IsAnimatedDead ) Spells.Necromancy.AnimateDeadSpell.Register( m_SummonMaster, this ); }
public BaseCreature(AIType ai, FightMode mode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed) { if ( iRangePerception == OldRangePerception ) iRangePerception = DefaultRangePerception; m_Loyalty = MaxLoyalty; // Wonderfully Happy m_CurrentAI = ai; m_DefaultAI = ai; m_iRangePerception = iRangePerception; m_iRangeFight = iRangeFight; m_FightMode = mode; m_iTeam = 0; SpeedInfo.GetSpeeds( this, ref dActiveSpeed, ref dPassiveSpeed ); m_dActiveSpeed = dActiveSpeed; m_dPassiveSpeed = dPassiveSpeed; m_dCurrentSpeed = dPassiveSpeed; m_bDebugAI = false; m_arSpellAttack = new List<Type>(); m_arSpellDefense = new List<Type>(); m_bControlled = false; m_ControlMaster = null; m_ControlTarget = null; m_ControlOrder = OrderType.None; m_bTamable = false; m_Owners = new List<Mobile>(); m_NextReacquireTime = DateTime.Now + ReacquireDelay; ChangeAIType(AI); InhumanSpeech speechType = this.SpeechType; if ( speechType != null ) speechType.OnConstruct( this ); GenerateLoot( true ); }