public override void OnThink() { base.OnThink(); if (Combatant == null) { return; } if (CanDoSpecial && InRange(Combatant, 4) && 0.1 > Utility.RandomDouble() && _NextSpecial < DateTime.UtcNow) { DoSpecial(); _NextSpecial = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(30, 60)); } else if (_Sampire) { if (0.1 > Utility.RandomDouble() && Weapon is BaseWeapon && !CurseWeaponSpell.IsCursed(this, (BaseWeapon)Weapon)) { CurseWeaponSpell spell = new CurseWeaponSpell(this, null); spell.Cast(); } else if (!TransformationSpellHelper.UnderTransformation(this, typeof(VampiricEmbraceSpell))) { VampiricEmbraceSpell spell = new VampiricEmbraceSpell(this, null); spell.Cast(); } } }
public override bool CheckCast() { if (!CheckFlyingAllowed(Caster, true)) { return(false); } else if (!Caster.Alive) { Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1113082); // You may not fly while dead. } else if (Caster.IsBodyMod && !VampiricEmbraceSpell.UnderEffect(Caster)) { Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1112453); // You can't fly in your current form! } else { if (Caster is PlayerMobile) { ((PlayerMobile)Caster).Flying = true; } Caster.Animate(0x9); return(true); } return(false); }
public ShrineMaster(MasterTitle specialty, MasterType type, ShrineBattleController controller) : base(GetAI(specialty), FightMode.Closest, 10, 1, .2, .1) { _Specialty = specialty; _Type = type; _Controller = controller; if (Female = Utility.RandomBool()) { Name = NameList.RandomName("female"); } else { Name = NameList.RandomName("male"); } SetBody(); Title = "the " + specialty; SetStr(250); SetDex(SpellCaster ? 150 : 200); SetInt(SpellCaster ? 1000 : 5000); SetHits(20000, 25000); if (AI == AIType.AI_Melee) { SetDamage(22, 30); } else if (!SpellCaster) { SetDamage(20, 28); } else { SetDamage(10, 20); } Fame = 48000; Karma = -48000; SetResists(); SetSkills(); EquipSpecialty(); _NextSpecial = DateTime.UtcNow; if (specialty == MasterTitle.Sampire) { Timer.DelayCall(TimeSpan.FromSeconds(1), () => { VampiricEmbraceSpell spell = new VampiricEmbraceSpell(this, null); spell.Cast(); }); } }
public override void OnThink() { base.OnThink(); if (Blessed && _Controller != null && _Controller.MasterBlessCheck(this)) { for (int i = 1; i < 4; i++) { Timer.DelayCall(TimeSpan.FromMilliseconds(i * 50), o => { Geometry.Circle2D(Location, Map, o, (pnt, map) => { Effects.SendLocationEffect(pnt, map, 0x36B0, 14, 14, 2053, 0); }); }, i); } Blessed = false; } if (!Hidden && 0.1 > Utility.RandomDouble() && (_Specialty == MasterTitle.Rogue || _Specialty == MasterTitle.Assassin)) { HideSelf(); } if (Combatant == null) { return; } if (!Utility.InRange(Location, Home, 20)) { Timer.DelayCall(TimeSpan.FromSeconds(5), () => { Location = Home; }); } if (0.3 > Utility.RandomDouble() && _NextSpecial < DateTime.UtcNow) { switch (_Specialty) { case MasterTitle.Macer: Teleport(); break; case MasterTitle.Fencer: case MasterTitle.Swordsman: ChangeWeapon(); break; case MasterTitle.Wizard: if (0.5 > Utility.RandomDouble()) { DoNuke(Location); } else { DoDismount((Mobile)Combatant); } break; } _NextSpecial = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(30, 60)); } else if (_Specialty == MasterTitle.Sampire) { if (0.1 > Utility.RandomDouble() && Weapon is BaseWeapon weapon && !CurseWeaponSpell.IsCursed(this, weapon)) { CurseWeaponSpell spell = new CurseWeaponSpell(this, null); spell.Cast(); } else if (!TransformationSpellHelper.UnderTransformation(this, typeof(VampiricEmbraceSpell))) { VampiricEmbraceSpell spell = new VampiricEmbraceSpell(this, null); spell.Cast(); } }
public Invader(SkillName specialty, InvasionType type) : base(GetAI(specialty), FightMode.Closest, 10, 1, .2, .1) { _Specialty = specialty; _InvasionType = type; if (_Specialty == SkillName.Bushido && Utility.RandomBool()) { _Sampire = true; } if (Female = Utility.RandomBool()) { //Body = 0x191; Name = NameList.RandomName("female"); } else { //Body = 0x190; Name = NameList.RandomName("male"); } SetBody(); string title; if (_Sampire) { title = "the sampire"; } else if (specialty == SkillName.Magery) { title = "the wizard"; } else { title = String.Format("the {0}", Skills[specialty].Info.Title); if (Female && title.EndsWith("man")) { title = title.Substring(0, title.Length - 3) + "woman"; } } Title = title; SetStr(120, 170); SetDex(SpellCaster ? 75 : 150); SetInt(SpellCaster ? 1800 : 500); SetHits(800, 1250); if (AI == AIType.AI_Melee) { SetDamage(15, 28); } else if (!SpellCaster) { SetDamage(12, 22); } else { SetDamage(8, 18); } Fame = 8000; Karma = -8000; SetResists(); SetSkills(); EquipSpecialty(); _NextSpecial = DateTime.UtcNow; if (_Sampire) { Timer.DelayCall(TimeSpan.FromSeconds(1), () => { VampiricEmbraceSpell spell = new VampiricEmbraceSpell(this, null); spell.Cast(); }); } }