public override void OnDoubleClick(Mobile from) { TeiravonMobile m_Player = (TeiravonMobile)from; if (m_Player.HasFeat(TeiravonMobile.Feats.ShieldBash) && m_Player.FindItemOnLayer(Layer.TwoHanded) == this) { if (m_Player.GetActiveFeats(TeiravonMobile.Feats.ShieldBash)) { m_Player.SendMessage(Teiravon.Colors.FeatMessageColor, Teiravon.Messages.TooSoon); } else { // m_Player.Target = new ShieldBashTarget( (int)this.ArmorRating ); m_Player.Target = new ShieldBashTarget((int)this.ArmorBase, this); } } }
private static TimeSpan Mobile_StamRegenRate(Mobile from) { double rate; double hungermod; if (from.Hunger > 12) { hungermod = 1.0; } else { hungermod = (from.Hunger * .08); } if (from.Player) { TeiravonMobile m_Player = (TeiravonMobile)from; if (m_Player.GetActiveFeats(TeiravonMobile.Feats.DarkAura) || m_Player.GetActiveFeats(TeiravonMobile.Feats.HolyAura) || m_Player.GetActiveFeats(TeiravonMobile.Feats.DivineAura)) { return(TimeSpan.FromSeconds(9)); } } if (from.Skills == null) { return(Mobile.DefaultStamRate); } CheckBonusSkill(from, from.Stam, from.StamMax, SkillName.Focus); int points = AosAttributes.GetValue(from, AosAttribute.RegenStam) + (int)(from.Skills[SkillName.Focus].Value * 0.1); if (CheckTransform(from, typeof(VampiricEmbraceSpell))) { points += 15; } if (from is Mobiles.BaseCreature && ((Mobiles.BaseCreature)from).IsParagon) { points += 40; } if (points < -1) { points = -1; } CampfireEntry entry = Campfire.GetEntry(from); if (entry != null && entry.Safe) { points += 40; } if (from is TeiravonMobile) { TeiravonMobile m_Player = (TeiravonMobile)from; if (m_Player.HasFeat(TeiravonMobile.Feats.WholenessOfSelf)) { points = (points + (int)(m_Player.PlayerLevel) + 6); } if (m_Player.HasFeat(TeiravonMobile.Feats.NorthernResilience)) { points += 10; } if (hungermod > 0) { rate = (1.0 / (0.1 * (2 + points))) / hungermod; } else { rate = 30; } if (rate > 30) { rate = 30; } } else { rate = (1.0 / (0.1 * (2 + points))); } return(TimeSpan.FromSeconds(rate)); }
public virtual TimeSpan GetCastDelay() { if (m_Scroll is BaseWand) { return(TimeSpan.Zero); } if (!Core.AOS) { return(TimeSpan.FromSeconds(0.5 + (0.25 * (int)Circle))); } // Faster casting cap of 2 (if not using the protection spell) // Faster casting cap of 0 (if using the protection spell) // Paladin spells are subject to a faster casting cap of 4 // Paladins with magery of 70.0 or above are subject to a faster casting cap of 2 int fcMax = 3; if (CastSkill == SkillName.Chivalry && m_Caster.Skills[SkillName.Magery].Value < 70.0) { fcMax = 4; } int fc = AosAttributes.GetValue(m_Caster, AosAttribute.CastSpeed); if (ProtectionSpell.Registry.Contains(m_Caster)) { fc -= 2; } if (fc > fcMax) { fc = fcMax; } IPooledEnumerable eable = m_Caster.GetMobilesInRange(8); int highest = 0; foreach (Mobile m in eable) { if (m is TeiravonMobile) { TeiravonMobile tav = m as TeiravonMobile; if (tav.GetActiveFeats(TeiravonMobile.Feats.DisruptingPresence) && highest < tav.PlayerLevel) { highest = tav.PlayerLevel; } } } eable.Free(); int circleDelay = CastDelayCircleScalar * (1 + (int)Circle); // Note: Circle is 0-based so we must offset int fcDelay = -(CastDelayFastScalar * fc); double delay = CastDelayBase + circleDelay + fcDelay; if (highest > 0) { delay *= (1 + highest * .05); } if (delay < CastDelayMinimum) { delay = CastDelayMinimum; } return(TimeSpan.FromSeconds((double)delay / CastDelayPerSecond)); }
public virtual bool CheckSequence() { int mana = ScaleMana(GetMana()); IPooledEnumerable eable = m_Caster.GetMobilesInRange(8); int highest = 0; foreach (Mobile m in eable) { if (m is TeiravonMobile) { TeiravonMobile tav = m as TeiravonMobile; if (tav.GetActiveFeats(TeiravonMobile.Feats.DisruptingPresence) && highest < tav.PlayerLevel) { highest = tav.PlayerLevel; } } } eable.Free(); if (highest > 0) { mana = (int)(mana * (1 + highest * .05)); } if (m_Caster.Deleted || !m_Caster.Alive || m_Caster.Spell != this || m_State != SpellState.Sequencing) { DoFizzle(); } else if (m_Scroll != null && !(m_Scroll is Runebook) && (m_Scroll.Amount <= 0 || m_Scroll.Deleted || m_Scroll.RootParent != m_Caster || (m_Scroll is BaseWand && (((BaseWand)m_Scroll).Charges <= 0 || m_Scroll.Parent != m_Caster)))) { DoFizzle(); } /* * else if ( !ConsumeReagents() ) * { * m_Caster.LocalOverheadMessage( MessageType.Regular, 0x22, 502630 ); // More reagents are needed for this spell. * } */ else if (m_Caster.Mana < mana) { m_Caster.LocalOverheadMessage(MessageType.Regular, 0x22, 502625); // Insufficient mana for this spell. } else if (Core.AOS && (m_Caster.Frozen || m_Caster.Paralyzed)) { m_Caster.SendLocalizedMessage(502646); // You cannot cast a spell while frozen. DoFizzle(); } else if (CheckFizzle()) { m_Caster.Mana -= mana; if (m_Scroll is SpellScroll) { m_Scroll.Consume(); } else if (m_Scroll is BaseWand) { ((BaseWand)m_Scroll).ConsumeCharge(m_Caster); } if (m_Scroll is BaseWand) { bool m = m_Scroll.Movable; m_Scroll.Movable = false; if (ClearHandsOnCast) { m_Caster.ClearHands(); } m_Scroll.Movable = m; } else { if (ClearHandsOnCast) { m_Caster.ClearHands(); } } int karma = ComputeKarmaAward(); if (karma != 0) { Misc.Titles.AwardKarma(Caster, karma, true); } /* * if ( TransformationSpell.UnderTransformation( m_Caster, typeof( VampiricEmbraceSpell ) ) ) * { * bool garlic = false; * * for ( int i = 0; !garlic && i < m_Info.Reagents.Length; ++i ) * garlic = ( m_Info.Reagents[i] == Reagent.Garlic ); * * if ( garlic ) * { * m_Caster.SendLocalizedMessage( 1061651 ); // The garlic burns you! * AOS.Damage( m_Caster, Utility.RandomMinMax( 17, 23 ), 100, 0, 0, 0, 0 ); * } * } */ return(true); } else { DoFizzle(); } return(false); }
public static void Damage(Spell spell, Mobile target, double damage, int phys, int fire, int cold, int pois, int nrgy) { //Most (All) Damage spells start here if (spell.CheckResisted(target)) { damage *= 0.75; target.SendLocalizedMessage(501783); // You feel yourself resisting magical energy. } //KENSAI AVOIDANCE bool KensaiAvoided = false; bool KensaiAvoidable = true; Type[] m_NotAvoidable = new Type[] { //typeof( Fifth.MindBlastSpell ), typeof(Seventh.MeteorSwarmSpell), typeof(Eighth.EarthquakeSpell), typeof(Seventh.ChainLightningSpell), typeof(Fourth.FireFieldSpell) }; for (int i = 0; i < m_NotAvoidable.Length; i++) { if (m_NotAvoidable[i] == spell.GetType()) { KensaiAvoidable = false; break; } } if (target is TeiravonMobile) { TeiravonMobile m_Player = (TeiravonMobile)target; if (Spells.Third.BlessSpell.gruumsh.Contains(m_Player) || Spells.Third.BlessSpell.gruumsh.Contains(target)) { damage *= 1.30; } if (m_Player.GetActiveFeats(TeiravonMobile.Feats.DisruptingPresence) && m_Player.HasFeat(TeiravonMobile.Feats.DisruptingPresence)) { damage *= 0.75; m_Player.SendMessage("Your disrupting presense dulls the potency of the spell"); } if (m_Player.HasFeat(TeiravonMobile.Feats.MagicResistance)) { damage *= 0.75; target.SendLocalizedMessage(501783); } int cntmith = 0; ArrayList mithitems = new ArrayList(); BaseArmor tmpitem; tmpitem = m_Player.FindItemOnLayer(Layer.InnerTorso) as BaseArmor; if (tmpitem != null) { if (tmpitem.Resource == CraftResource.Mithril) { mithitems.Add(tmpitem); cntmith++; } } tmpitem = m_Player.FindItemOnLayer(Layer.Pants) as BaseArmor; if (tmpitem != null) { if (tmpitem.Resource == CraftResource.Mithril) { mithitems.Add(tmpitem); cntmith++; } } tmpitem = m_Player.FindItemOnLayer(Layer.Arms) as BaseArmor; if (tmpitem != null) { if (tmpitem.Resource == CraftResource.Mithril) { mithitems.Add(tmpitem); cntmith++; } } tmpitem = m_Player.FindItemOnLayer(Layer.Gloves) as BaseArmor; if (tmpitem != null) { if (tmpitem.Resource == CraftResource.Mithril) { mithitems.Add(tmpitem); cntmith++; } } tmpitem = m_Player.FindItemOnLayer(Layer.Helm) as BaseArmor; if (tmpitem != null) { if (tmpitem.Resource == CraftResource.Mithril) { mithitems.Add(tmpitem); cntmith++; } } tmpitem = m_Player.FindItemOnLayer(Layer.Neck) as BaseArmor; if (tmpitem != null) { if (tmpitem.Resource == CraftResource.Mithril) { mithitems.Add(tmpitem); cntmith++; } } tmpitem = m_Player.FindItemOnLayer(Layer.TwoHanded) as BaseArmor; if (tmpitem != null) { if (tmpitem.Resource == CraftResource.Mithril) { mithitems.Add(tmpitem); cntmith++; } } if (target.VirtualArmorMod >= 1) { if (Utility.Random(3) > 1) { double amount = damage - target.VirtualArmorMod; target.VirtualArmorMod -= (int)damage; if (amount < 0) { amount = 0; } damage = amount; if (target.VirtualArmorMod < 1) { target.VirtualArmorMod = 0; target.FixedParticles(14276, 10, 20, 14276, EffectLayer.Waist); target.PlaySound(0x38F); } else { string shield = target.VirtualArmorMod.ToString(); target.LocalOverheadMessage(MessageType.Emote, 90, true, shield); target.FixedParticles(14265, 10, 20, 14276, EffectLayer.Waist); target.PlaySound(0x525); } } } if (Utility.RandomMinMax(1, 100) < cntmith) { m_Player.SendMessage("Your mithril arbsorbs the spell damage!"); int armordam = (int)((damage / 2) / cntmith); int tmphits; damage = 0; for (int i = 0; i < mithitems.Count; ++i) { BaseArmor tmparm = (BaseArmor)mithitems[i]; if (tmparm.HitPoints > armordam) { tmparm.HitPoints -= armordam; } else { tmphits = tmparm.HitPoints; tmparm.HitPoints = 0; tmparm.MaxHitPoints = tmparm.MaxHitPoints - (armordam - tmphits); if (tmparm.MaxHitPoints < 1) { tmparm.Delete(); m_Player.SendMessage("Your mithril armor has been destroyed!"); } else { m_Player.SendMessage("Your mithril armor has been severely damaged!"); } } } } } if (!KensaiAvoided) { damage = CloakOfDarknessCheck(spell, target, damage); } // TimeSpan ts = GetDamageDelayForSpell(spell); Damage(ts, target, spell.Caster, damage, phys, fire, cold, pois, nrgy); }