public override TimeSpan GetCastDelay() { //Pre-AOS delay is 0.25 * circle int fc = AosAttributes.GetValue(Caster, AosAttribute.CastSpeed); if (fc > 2) { fc = 2; } if (ProtectionSpell.Registry.Contains(Caster)) { fc -= 2; } if (EssenceOfWindSpell.IsDebuffed(Caster)) { fc -= EssenceOfWindSpell.GetFCMalus(Caster); } double delay = 0.15 * PowerLevel; delay -= ((double)fc) * 0.15; return(TimeSpan.FromSeconds(delay)); }
public override int GetSpellCastSpeedBonus(SkillName castSkill) { int castSpeed = base.GetSpellCastSpeedBonus(castSkill); castSpeed += AosAttributes.GetValue(this, AosAttribute.CastSpeed); // 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 = 4; if (castSkill == SkillName.Magery || castSkill == SkillName.Necromancy || (castSkill == SkillName.Chivalry && Skills[SkillName.Magery].Value >= 70.0)) { fcMax = 2; } if (castSpeed > fcMax) { castSpeed = fcMax; } if (ProtectionSpell.Registry.Contains(this)) { castSpeed -= 2; } if (EssenceOfWindSpell.IsDebuffed(this)) { castSpeed -= EssenceOfWindSpell.GetFCMalus(this); } return(castSpeed); }
//public virtual int CastDelayBase{ get{ return 3; } } //public virtual int CastDelayFastScalar{ get{ return 1; } } //public virtual int CastDelayPerSecond{ get{ return 4; } } //public virtual int CastDelayMinimum{ get{ return 1; } } public virtual TimeSpan GetCastDelay() { if (m_Scroll is BaseWand) { return(Core.ML ? CastDelayBase : TimeSpan.Zero); // TODO: Should FC apply to wands? } // 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 (no longer) subject to a faster casting cap of 2 int fcMax = 4; if (CastSkill == SkillName.Magery || CastSkill == SkillName.Necromancy) //|| ( CastSkill == SkillName.Chivalry && m_Caster.Skills[SkillName.Magery].Value >= 70.0 ) ) { fcMax = 2; } int fc = AosAttributes.GetValue(m_Caster, AosAttribute.CastSpeed); int sc = AosAttributes.GetValue(m_Caster, AosAttribute.SpellChanneling); if (sc > 2 && Mantra != "In Nox") //sneaky way to increase cap on FC (except poison to avoid poison spam win vs cure) { fcMax += sc - 2; } if (fc > fcMax) { fc = fcMax; } if (ProtectionSpell.Registry.Contains(m_Caster)) { fc -= 2; } if (EssenceOfWindSpell.IsDebuffed(m_Caster)) { fc -= EssenceOfWindSpell.GetFCMalus(m_Caster); } if (SpellHelper.IsBuffed(m_Caster)) { fc += SpellHelper.GetFCBonus(m_Caster); } TimeSpan baseDelay = CastDelayBase; TimeSpan fcDelay = TimeSpan.FromSeconds(-(CastDelayFastScalar * fc * CastDelaySecondsPerTick)); //int delay = CastDelayBase + circleDelay + fcDelay; TimeSpan delay = baseDelay + fcDelay; if (delay < CastDelayMinimum) { delay = CastDelayMinimum; } //return TimeSpan.FromSeconds( (double)delay / CastDelayPerSecond ); return(delay); }
public virtual TimeSpan GetCastDelay() { // Staff members cast instantly if (Caster.AccessLevel >= AccessLevel.GameMaster) { return(TimeSpan.Zero); } if (Scroll is SpellStone) { return(TimeSpan.Zero); } if (Caster is BaseCreature && ((BaseCreature)Caster).InstantCast) { return(TimeSpan.Zero); } int fcMax = FasterCastingCap; int fc = Caster.GetMagicalAttribute(AosAttribute.CastSpeed); if (Caster is BaseCreature && !((BaseCreature)Caster).Controlled && !((BaseCreature)Caster).Summoned) { fc = 2; } if (fc > fcMax) { fc = fcMax; } if (ProtectionSpell.Registry.Contains(Caster)) { fc -= 2; } if (EssenceOfWindSpell.IsDebuffed(Caster)) { fc -= EssenceOfWindSpell.GetFCMalus(Caster); } if (StoneFormSpell.UnderEffect(Caster)) { fc -= 2; } TimeSpan baseDelay = CastDelayBase; TimeSpan fcDelay = TimeSpan.FromSeconds(-(CastDelayFastScalar * fc * CastDelaySecondsPerTick)); TimeSpan delay = baseDelay + fcDelay; if (delay < CastDelayMinimum) { delay = CastDelayMinimum; } return(delay); }
//public virtual int CastDelayBase{ get{ return 3; } } //public virtual int CastDelayFastScalar{ get{ return 1; } } //public virtual int CastDelayPerSecond{ get{ return 4; } } //public virtual int CastDelayMinimum{ get{ return 1; } } public virtual TimeSpan GetCastDelay() { if (m_Scroll is BaseWand) { return(Core.ML ? CastDelayBase : TimeSpan.Zero); // TODO: Should FC apply to wands? } // 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 = 4; if (CastSkill == SkillName.Magery || CastSkill == SkillName.Necromancy || (CastSkill == SkillName.Chivalry && m_Caster.Skills[SkillName.Magery].Value >= 70.0)) { fcMax = 2; } int fc = AosAttributes.GetValue(m_Caster, AosAttribute.CastSpeed); if (fc > fcMax) { fc = fcMax; } if (ProtectionSpell.Registry.Contains(m_Caster)) { fc -= 2; } if (EssenceOfWindSpell.IsDebuffed(m_Caster)) { fc -= EssenceOfWindSpell.GetFCMalus(m_Caster); } TimeSpan baseDelay = CastDelayBase; TimeSpan fcDelay = TimeSpan.FromSeconds(-(CastDelayFastScalar * fc * CastDelaySecondsPerTick)); //int delay = CastDelayBase + circleDelay + fcDelay; TimeSpan delay = baseDelay + fcDelay; if (delay < CastDelayMinimum) { delay = CastDelayMinimum; } #region Mondain's Legacy if (DreadHorn.IsUnderInfluence(m_Caster)) { delay.Add(delay); } #endregion //return TimeSpan.FromSeconds( (double)delay / CastDelayPerSecond ); return(delay); }
//public virtual int CastDelayMinimum{ get{ return 1; } } public virtual TimeSpan GetCastDelay() { if (m_Scroll is BaseWand) { return(TimeSpan.Zero); } if (CastSkill == SkillName.Magery) { int circle = (int)(((MagerySpell)this).Circle); return(TimeSpan.FromSeconds(0.5 + (circle) * 0.5)); } // 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 = 4; if (CastSkill == SkillName.Magery || CastSkill == SkillName.Necromancy || (CastSkill == SkillName.Chivalry && m_Caster.Skills[SkillName.Magery].Value >= 70.0)) { fcMax = 2; } int fc = AosAttributes.GetValue(m_Caster, AosAttribute.CastSpeed); if (fc > fcMax) { fc = fcMax; } if (ProtectionSpell.Registry.Contains(m_Caster)) { fc -= 2; } if (EssenceOfWindSpell.IsDebuffed(m_Caster)) { fc -= EssenceOfWindSpell.GetFCMalus(m_Caster); } TimeSpan baseDelay = CastDelayBase; TimeSpan fcDelay = TimeSpan.FromSeconds(-(CastDelayFastScalar * fc * CastDelaySecondsPerTick)); //int delay = CastDelayBase + circleDelay + fcDelay; TimeSpan delay = baseDelay + fcDelay; if (delay < CastDelayMinimum) { delay = CastDelayMinimum; } //return TimeSpan.FromSeconds( (double)delay / CastDelayPerSecond ); return(delay); }
//public virtual int CastDelayBase{ get{ return 3; } } //public virtual int CastDelayFastScalar{ get{ return 1; } } //public virtual int CastDelayPerSecond{ get{ return 4; } } //public virtual int CastDelayMinimum{ get{ return 1; } } public virtual TimeSpan GetCastDelay() { if (m_Scroll is BaseWand || m_Scroll is BaseJewel || m_Scroll is GnarledStaff || m_Scroll is BaseStationary) { return(TimeSpan.Zero); } // 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 = 2; if (CastSkill == SkillName.Chivalry && m_Caster.Skills[SkillName.Magery].Value < 70.0) { fcMax = 4; } int fc = AosAttributes.GetValue(m_Caster, AosAttribute.CastSpeed); if (fc > fcMax) { fc = fcMax; } if (ProtectionSpell.Registry.Contains(m_Caster)) { fc -= 2; } if (EssenceOfWindSpell.IsDebuffed(m_Caster)) { fc -= EssenceOfWindSpell.GetFCMalus(m_Caster); } TimeSpan baseDelay = CastDelayBase; TimeSpan fcDelay = TimeSpan.FromSeconds(-(CastDelayFastScalar * fc * CastDelaySecondsPerTick)); TimeSpan delay = baseDelay + fcDelay; if (delay < CastDelayMinimum) { delay = CastDelayMinimum; } if (m_Scroll != null) { delay = TimeSpan.FromSeconds(((((m_Scroll.ItemID - 7981) - 1) / 8) + 1) / 4); } //return TimeSpan.FromSeconds( (double)delay / CastDelayPerSecond ); return(delay); }
//public virtual int CastDelayBase{ get{ return 3; } } //public virtual int CastDelayFastScalar{ get{ return 1; } } //public virtual int CastDelayPerSecond{ get{ return 4; } } //public virtual int CastDelayMinimum{ get{ return 1; } } public virtual TimeSpan GetCastDelay() { if (m_Scroll is BaseWand || m_Scroll is GnarledStaff) { return(TimeSpan.Zero); } // 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 = 4; if (CastSkill == SkillName.Magery || CastSkill == SkillName.Necromancy || (CastSkill == SkillName.Chivalry && m_Caster.Skills[SkillName.Magery].Value >= 70.0)) { fcMax = 2; } int fc = AosAttributes.GetValue(m_Caster, AosAttribute.CastSpeed); if (fc > fcMax) { fc = fcMax; } if (ProtectionSpell.Registry.ContainsKey(m_Caster)) { fc -= 2; } if (EssenceOfWindSpell.IsDebuffed(m_Caster)) { fc -= EssenceOfWindSpell.GetFCMalus(m_Caster); } TimeSpan fcDelay = TimeSpan.FromSeconds(-(CastDelayFastScalar * fc * CastDelaySecondsPerTick)); TimeSpan delay = CastDelayBase + fcDelay; if (delay < CastDelayMinimum) { delay = CastDelayMinimum; } return(delay); }
public bool Action_EssenceOfWind() { if (m_Mobile.Skills[SkillName.Spellweaving].Value > 62.0 && m_Mobile.Mana > 40) { if (!EssenceOfWindSpell.IsDebuffed(m_Mobile.Combatant)) { if (m_Mobile.Debug) { m_Mobile.Say(1436, "Casting Essence Of Wind"); } new EssenceOfWindSpell(m_Mobile, null).Cast(); return(true); } } return(false); }
public override int GetAttackSpeedBonus() { int bonus = base.GetAttackSpeedBonus(); if (Core.SE) { /* * This is likely true for Core.AOS as well... both guides report the same * formula, and both are wrong. * The old formula left in for AOS for legacy & because we aren't quite 100% * Sure that AOS has THIS formula */ bonus += AosAttributes.GetValue(this, AosAttribute.WeaponSpeed); if (Spells.Chivalry.DivineFurySpell.UnderEffect(this)) { bonus += 10; } // Bonus granted by successful use of Honorable Execution. bonus += HonorableExecution.GetSwingBonus(this); if (DualWield.Registry.Contains(this)) { bonus += ((DualWield.DualWieldTimer)DualWield.Registry[this]).BonusSwingSpeed; } if (Feint.Registry.Contains(this)) { bonus -= ((Feint.FeintTimer)Feint.Registry[this]).SwingSpeedReduction; } TransformContext context = TransformationSpellHelper.GetContext(this); if (context != null && context.Spell is ReaperFormSpell reaperSpell) { bonus += reaperSpell.SwingSpeedBonus; } int discordanceEffect = 0; // Discordance gives a malus of -0/-28% to swing speed. if (SkillHandlers.Discordance.GetEffect(this, ref discordanceEffect)) { bonus -= discordanceEffect; } if (EssenceOfWindSpell.IsDebuffed(this)) { bonus -= EssenceOfWindSpell.GetSSIMalus(this); } if (bonus > 60) { bonus = 60; } } else if (Core.AOS) { bonus += AosAttributes.GetValue(this, AosAttribute.WeaponSpeed); if (Spells.Chivalry.DivineFurySpell.UnderEffect(this)) { bonus += 10; } int discordanceEffect = 0; // Discordance gives a malus of -0/-28% to swing speed. if (SkillHandlers.Discordance.GetEffect(this, ref discordanceEffect)) { bonus -= discordanceEffect; } } return(bonus); }
public override Spell ChooseSpell(Mobile c) { Spell spell = CheckCastHealingSpell(); if (spell != null) { return(spell); } switch (Utility.Random(16)) { case 0: case 1: case 2: // Poison them { m_Mobile.DebugSay("Attempting to poison"); if (!c.Poisoned) { spell = new PoisonSpell(m_Mobile, null); } break; } case 3: // Bless ourselves. { m_Mobile.DebugSay("Blessing myself"); if (Utility.RandomBool() && !ArcaneEmpowermentSpell.IsBuffed(m_Mobile)) { spell = new ArcaneEmpowermentSpell(m_Mobile, null); } else { spell = new BlessSpell(m_Mobile, null); } break; } case 4: // Wildfire { m_Mobile.DebugSay("Incendio!"); spell = new WildfireSpell(m_Mobile, null); break; } case 5: // Reduce their cast speed { if (c.InRange(m_Mobile.Location, 6)) { if (m_Mobile.Skills[SkillName.Spellweaving].Value >= 90.0) { spell = new EssenceOfWindSpell(m_Mobile, null); } else if (c.InRange(m_Mobile.Location, 2)) { spell = new ThunderstormSpell(m_Mobile, null); } } m_Mobile.DebugSay("Attempting to reduce their cast speed"); break; } case 6: // Curse them. { m_Mobile.DebugSay("Attempting to curse"); spell = GetRandomCurseSpell(c); break; } case 7: // Paralyze them. { m_Mobile.DebugSay("Attempting to paralyze"); if (m_Mobile.Skills[SkillName.Magery].Value > 50.0) { spell = new ParalyzeSpell(m_Mobile, null); } break; } case 8: // Drain mana { m_Mobile.DebugSay("Attempting to drain mana"); spell = GetRandomManaDrainSpell(c); break; } default: // Damage them. { m_Mobile.DebugSay("Just doing damage"); spell = GetRandomDamageSpell(c); break; } } return(spell); }
public void SpellweavingPower() { this.CheckFocus(); if (this.CheckForAttuneWeapon()) // Always attune if needed { return; } else if (this.CheckForGiftOfRenewal()) // Always use renewal { return; } if (this.m_Mobile.Combatant == null) { return; } // TODO improve selecting the spell. int choices = 5; // default choices: allure, summon, melee, melee, thunderstorm if (this.m_Mobile.Mana > 50) { if (this.m_Mobile.Skills[SkillName.Spellweaving].Value > 90.0) // add word of death+, uses 50 mana { choices += 4; } else if (this.m_Mobile.Skills[SkillName.Spellweaving].Value > 66.0) // add wildfire+, uses 50 mana { choices += 3; } else if (this.m_Mobile.Skills[SkillName.Spellweaving].Value > 62.0) // add essence of wind+, uses 42 mana { choices += 2; } else if (this.m_Mobile.Skills[SkillName.Spellweaving].Value > 44.0) // add empower, uses 50 mana { ++choices; } } switch (Utility.Random(choices)) { case 0: // Allure { if (this.m_Mobile.Combatant is BaseCreature) { if (this.m_Mobile.Debug) { this.m_Mobile.Say(1436, "Casting Dryad Allure"); } new DryadAllureSpell(this.m_Mobile, null).Cast(); break; } else { goto case 1; } } case 1: // Summon { if (this.m_Mobile.Followers < this.m_Mobile.FollowersMax) { Spell spell = this.GetSpellweavingSummon(); if (spell != null) { if (this.m_Mobile.Debug) { this.m_Mobile.Say(1436, "Summoning help"); } spell.Cast(); } this.ForceTarget(); break; } else { goto case 2; } } case 2: case 3: // Do nothing, aka melee { break; } case 4: { new ThunderstormSpell(this.m_Mobile, null).Cast(); break; } case 5: // Empower, increases summons & healing. { if (ArcaneEmpowermentSpell.GetSpellBonus(this.m_Mobile, true) == 0) { new ArcaneEmpowermentSpell(this.m_Mobile, null).Cast(); break; } else { goto case 2; } } case 6: // Essence of Wind, cold aura and speed debuff. { if (!EssenceOfWindSpell.IsDebuffed(this.m_Mobile.Combatant)) { new EssenceOfWindSpell(this.m_Mobile, null).Cast(); break; } else { goto case 2; } } case 7: { new WildfireSpell(this.m_Mobile, null).Cast(); this.ForceTarget(); break; } case 8: { new WordOfDeathSpell(this.m_Mobile, null).Cast(); break; } } return; }