public void Target( Mobile m ) { if ( CheckHSequence( m ) ) { SpellHelper.Turn( Caster, m ); /* Transmogrifies the flesh of the target creature or player to resemble rotted corpse flesh, * making them more vulnerable to Fire and Poison damage, * but increasing their resistance to Physical and Cold damage. * * The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 25 ) + 40 seconds. * * NOTE: Algorithm above is fixed point, should be: * ((ss-mr)/2.5) + 40 * * NOTE: Resistance is not checked if targeting yourself */ ExpireTimer timer = (ExpireTimer)m_Table[m]; if ( timer != null ) timer.DoExpire(); else m.SendLocalizedMessage( 1061689 ); // Your skin turns dry and corpselike. if ( m.Spell != null ) m.Spell.OnCasterHurt(); m.FixedParticles( 0x373A, 1, 15, 9913, 67, 7, EffectLayer.Head ); m.PlaySound( 0x1BB ); double ss = GetDamageSkill( Caster ); double mr = ( Caster == m ? 0.0 : GetResistSkill( m ) ); m.CheckSkill( SkillName.MagicResist, 0.0, 120.0 ); //Skill check for gain TimeSpan duration = TimeSpan.FromSeconds( ((ss - mr) / 2.5) + 40.0 ); ResistanceMod[] mods = new ResistanceMod[4] { new ResistanceMod( ResistanceType.Fire, -15 ), new ResistanceMod( ResistanceType.Poison, -15 ), new ResistanceMod( ResistanceType.Cold, +10 ), new ResistanceMod( ResistanceType.Physical, +10 ) }; timer = new ExpireTimer( m, mods, duration ); timer.Start(); BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.CorpseSkin, 1075663, duration, m ) ); m_Table[m] = timer; for ( int i = 0; i < mods.Length; ++i ) m.AddResistanceMod( mods[i] ); HarmfulSpell( m ); } FinishSequence(); }
// TODO: Put this attack shared with Hiryu and Lesser Hiryu in one place public override void OnGaveMeleeAttack( Mobile defender ) { base.OnGaveMeleeAttack( defender ); if( 0.1 > Utility.RandomDouble() ) { ExpireTimer timer = (ExpireTimer)m_Table[defender]; if( timer != null ) { timer.DoExpire(); defender.SendLocalizedMessage( 1070837 ); // The creature lands another blow in your weakened state. } else defender.SendLocalizedMessage( 1070836 ); // The blow from the creature's claws has made you more susceptible to physical attacks. int effect = -(defender.PhysicalResistance * 15 / 100); ResistanceMod mod = new ResistanceMod( ResistanceType.Physical, effect ); defender.FixedEffect( 0x37B9, 10, 5 ); defender.AddResistanceMod( mod ); timer = new ExpireTimer( defender, mod, TimeSpan.FromSeconds( 5.0 ) ); timer.Start(); m_Table[defender] = timer; } }
public void Target( Mobile m ) { if ( !Caster.CanSee( m ) ) { Caster.SendLocalizedMessage( 500237 ); // Target can not be seen. } else if ( CheckHSequence( m ) ) { Mobile source = Caster; SpellHelper.Turn( source, m ); SpellHelper.CheckReflect( (int)this.Circle, ref source, ref m ); m.FixedParticles( 0x374A, 10, 30, 5013, 0x238, 2, EffectLayer.Waist ); int amount = (int)( Caster.Skills[SkillName.Musicianship].Base * 0.17 ); TimeSpan duration = TimeSpan.FromSeconds( Caster.Skills[SkillName.Musicianship].Base * 0.15 ); m.SendMessage( "Your poison resistance has decreased." ); ResistanceMod mod1 = new ResistanceMod( ResistanceType.Cold, - amount ); m.AddResistanceMod( mod1 ); ExpireTimer timer1 = new ExpireTimer( m, mod1, duration ); timer1.Start(); } FinishSequence(); }
public ExpireTimer( Mobile m, ResistanceMod mod ) : base( TimeSpan.FromSeconds( 10 ) ) { m_Mobile = m; m_Mod = mod; Priority = TimerPriority.TwoFiftyMS; }
public override void DoEffect(Mobile m) { ResistanceMod[] mods = (ResistanceMod[])m_Table[m]; int otherMod = 0 + (int)(m.Skills[SkillName.Mysticism].Value / 20); int admod = 1 + (int)(m.Skills[SkillName.Focus].Value / 20); //int casts = (int)AosAttributes.GetValue(Caster, AosAttribute.CastSpeed - 2); mods = new ResistanceMod[5] { new ResistanceMod( ResistanceType.Physical, otherMod + admod ), new ResistanceMod( ResistanceType.Fire, otherMod + admod ), new ResistanceMod( ResistanceType.Cold, otherMod + admod ), new ResistanceMod( ResistanceType.Poison, otherMod + admod ), new ResistanceMod( ResistanceType.Energy, otherMod + admod ), // new ResistanceMod( AosAttribute.CastSpeed, casts ) }; m_Table[m] = mods; for (int i = 0; i < mods.Length; ++i) m.AddResistanceMod(mods[i]); m.PlaySound(0x65B); m.FixedParticles(0x3728, 1, 13, 9918, 92, 3, EffectLayer.Head); m.Delta(MobileDelta.WeaponDamage); m.EndAction(typeof(StoneFormSpell)); }
public override void OnHit(Mobile attacker, Mobile defender, int damage) { if (!this.Validate(attacker) || !this.CheckMana(attacker, true)) return; ClearCurrentAbility(attacker); attacker.SendLocalizedMessage(1063353); // You perform a masterful defense! attacker.FixedParticles(0x375A, 1, 17, 0x7F2, 0x3E8, 0x3, EffectLayer.Waist); int modifier = (int)(30.0 * ((Math.Max(attacker.Skills[SkillName.Bushido].Value, attacker.Skills[SkillName.Ninjitsu].Value) - 50.0) / 70.0)); DefenseMasteryInfo info = m_Table[attacker] as DefenseMasteryInfo; if (info != null) EndDefense((object)info); ResistanceMod mod = new ResistanceMod(ResistanceType.Physical, 50 + modifier); attacker.AddResistanceMod(mod); info = new DefenseMasteryInfo(attacker, 80 - modifier, mod); info.m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(3.0), new TimerStateCallback(EndDefense), info); m_Table[attacker] = info; attacker.Delta(MobileDelta.WeaponDamage); }
public ExpireTimer(Mobile m, ResistanceMod mod, Hashtable table, TimeSpan delay) : base(delay) { m_Mobile = m; m_Mod = mod; m_Table = table; Priority = TimerPriority.TwoFiftyMS; }
public void Target(Mobile m) { bool sings = false; if (!Caster.CanSee(m)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (CheckHSequence(m)) { sings = true; //get songbook instrument Spellbook book = Spellbook.Find(Caster, -1, SpellbookType.Song); if (book == null) { return; } m_Book = (SongBook)book; if (m_Book.Instrument == null || !(Caster.InRange(m_Book.Instrument.GetWorldLocation(), 1))) { Caster.SendMessage("Your instrument is missing! You can select another from your song book."); return; } Mobile source = Caster; SpellHelper.Turn(source, m); m.FixedParticles(0x374A, 10, 30, 5013, 0x14, 2, EffectLayer.Waist); bool IsSlayer = false; if (m is BaseCreature) { IsSlayer = CheckSlayer(m_Book.Instrument, m); } int amount = (int)((Caster.Skills[SkillName.Musicianship].Value + Caster.Skills[SkillName.Peacemaking].Value + Caster.Skills[SkillName.Provocation].Value + Caster.Skills[SkillName.Discordance].Value) / 4 * .167); TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Musicianship].Value * 0.3); if (IsSlayer == true) { amount = amount * 2; duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Musicianship].Value * 0.6); } m.SendMessage("Your resistance to energy has decreased."); ResistanceMod mod1 = new ResistanceMod(ResistanceType.Energy, -amount); m.AddResistanceMod(mod1); ExpireTimer timer1 = new ExpireTimer(m, mod1, duration); timer1.Start(); } BardFunctions.UseBardInstrument(m_Book.Instrument, sings, Caster); FinishSequence(); }
public override void OnCast() { bool sings = false; //get songbook instrument Spellbook book = Spellbook.Find(Caster, -1, SpellbookType.Song); if (book == null) { return; } m_Book = (SongBook)book; if (m_Book.Instrument == null || !(Caster.InRange(m_Book.Instrument.GetWorldLocation(), 1))) { Caster.SendMessage("Your instrument is missing! You can select another from your song book."); return; } //added this to test if (m_Book.Instrument == null || !(Caster.InRange(m_Book.Instrument.GetWorldLocation(), 1))) { Caster.SendMessage("You need an instrument to play that song!"); } else if (CheckSequence()) { sings = true; ArrayList targets = new ArrayList(); foreach (Mobile m in Caster.GetMobilesInRange(3)) { if (Caster.CanBeBeneficial(m, false, true) && !(m is Golem)) { targets.Add(m); } } for (int i = 0; i < targets.Count; ++i) { Mobile m = (Mobile)targets[i]; TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Musicianship].Value * 2.5); int amount = (int)((Caster.Skills[SkillName.Musicianship].Value + Caster.Skills[SkillName.Peacemaking].Value + Caster.Skills[SkillName.Provocation].Value + Caster.Skills[SkillName.Discordance].Value) / 4 * .125); m.SendMessage("Your resistance to fire has increased."); ResistanceMod mod1 = new ResistanceMod(ResistanceType.Fire, +amount); m.AddResistanceMod(mod1); m.FixedParticles(0x373A, 10, 15, 5012, 0x21, 3, EffectLayer.Waist); new ExpireTimer(m, mod1, duration).Start(); } } BardFunctions.UseBardInstrument(m_Book.Instrument, sings, Caster); FinishSequence(); }
public virtual bool Equals(ResistanceMod mod) { if (ReferenceEquals(null, mod)) { return(false); } return(Type == mod.Type && Offset == mod.Offset); }
public InternalTimer(Mobile caster, int value, double duree) : base(TimeSpan.FromSeconds(duree)) { Priority = TimerPriority.OneSecond; m_Owner = caster; m_resMod = new ResistanceMod(ResistanceType.Physical, (int)value); m_Owner.AddResistanceMod(m_resMod); }
public void Target(Mobile m) { if (CheckHSequence(m)) { SpellHelper.Turn(Caster, m); /* Transmogrifies the flesh of the target creature or player to resemble rotted corpse flesh, * making them more vulnerable to Fire and Poison damage, * but increasing their resistance to Physical and Cold damage. * * The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 25 ) + 40 seconds. * * NOTE: Algorithm above is fixed point, should be: * ((ss-mr)/2.5) + 40 * * NOTE: Resistance is not checked if targeting yourself */ ExpireTimer timer = (ExpireTimer)m_Table[m]; if (timer != null) { timer.DoExpire(); } else { m.SendLocalizedMessage(1061689); // Your skin turns dry and corpselike. } m.FixedParticles(0x373A, 1, 15, 9913, 67, 7, EffectLayer.Head); m.PlaySound(0x1BB); double ss = GetDamageSkill(Caster); double mr = (Caster == m ? 0.0 : GetResistSkill(m)); TimeSpan duration = TimeSpan.FromSeconds(((ss - mr) / 2.5) + 40.0); ResistanceMod[] mods = new ResistanceMod[4] { new ResistanceMod(ResistanceType.Fire, -10), new ResistanceMod(ResistanceType.Poison, -10), new ResistanceMod(ResistanceType.Cold, +10), new ResistanceMod(ResistanceType.Physical, +10) }; timer = new ExpireTimer(m, mods, duration); timer.Start(); m_Table[m] = timer; for (int i = 0; i < mods.Length; ++i) { m.AddResistanceMod(mods[i]); } } FinishSequence(); }
public override void DoEffects(Mobile m) { base.DoEffects(m); ResistanceMod mod = new ResistanceMod(ResistanceType.Fire, 10); m.AddResistanceMod(mod); Timer.DelayCall(TimeSpan.FromMinutes(10), () => m.RemoveResistanceMod(mod)); }
public void Target(Mobile m) { if (!Caster.CanSee(m)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } if (m_Table.Contains(m)) { Caster.LocalOverheadMessage(MessageType.Regular, 0x481, false, "That target is under the effect of that spell already."); } if (CheckBSequence(m)) { SpellHelper.Turn(Caster, m); ExpireTimer timer = (ExpireTimer)m_Table[m]; if (timer != null) { timer.DoExpire(); } else { m.SendMessage("You feel hatred shielding you from physical harm."); } m.PlaySound(0x5C0); m.FixedParticles(0x376A, 1, 29, 9961, 1152, 0, EffectLayer.Waist); TimeSpan duration = TimeSpan.FromSeconds(GetKarmaPower(Caster)); ResistanceMod[] mods = new ResistanceMod[4] { new ResistanceMod(ResistanceType.Fire, +0), new ResistanceMod(ResistanceType.Poison, +0), new ResistanceMod(ResistanceType.Cold, +0), new ResistanceMod(ResistanceType.Physical, +100) }; timer = new ExpireTimer(m, mods, duration); timer.Start(); BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.ReactiveArmor, 1044120, 1044118, duration, m)); m_Table[m] = timer; for (int i = 0; i < mods.Length; ++i) { m.AddResistanceMod(mods[i]); } } FinishSequence(); }
public override void OnCast() { /* The magic reflection spell decreases the caster's physical resistance, while increasing the caster's elemental resistances. * Physical decrease = 25 - (Inscription/20). * Elemental resistance = +10 (-20 physical, +10 elemental at GM Inscription) * The magic reflection spell has an indefinite duration, becoming active when cast, and deactivated when re-cast. * Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out, even after dying—until you “turn them off” by casting them again. */ if (CheckSequence()) { Mobile targ = Caster; var context = GetContext(targ); targ.PlaySound(0x1E9); targ.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist); if (context == null) { int physiMod = 20 - (int)(targ.Skills[SkillName.Inscribe].Value / 20); int otherMod = 10; var mods = new ResistanceMod[5] { new ResistanceMod(ResistanceType.Physical, -physiMod), new ResistanceMod(ResistanceType.Fire, otherMod), new ResistanceMod(ResistanceType.Cold, otherMod), new ResistanceMod(ResistanceType.Poison, otherMod), new ResistanceMod(ResistanceType.Energy, otherMod) }; context = new MagicReflectContext(Caster, mods); m_Table.Add(context); for (int i = 0; i < mods.Length; ++i) { targ.AddResistanceMod(mods[i]); } string buffFormat = string.Format("-{0}\t+{1}\t+{1}\t+{1}\t+{1}\t{2}\t{3}", physiMod, otherMod, "-5", context.ReflectPool); BuffInfo.AddBuff(targ, new BuffInfo(BuffIcon.MagicReflection, 1015197, 1149979, buffFormat, true)); } else if (CooldownTimer.InCooldown(Caster)) { Caster.SendLocalizedMessage(1150073, CooldownTimer.GetRemaining(Caster)); // You must wait ~1_seconds~ seconds to tap into your magic reflection pool. } else if (context.NextReplenish > DateTime.UtcNow || !context.TryReplenish()) { Expire(context); } } FinishSequence(); }
public override void OnCast() { //get songbook instrument Spellbook book = Spellbook.Find(Caster, -1, SpellbookType.Song); if (book == null) { return; } m_Book = (SongBook)book; if (m_Book.Instrument == null || !(Caster.InRange(m_Book.Instrument.GetWorldLocation(), 1))) { Caster.SendMessage("Your instrument is missing! You can select another from your song book."); return; } bool sings = false; if (CheckSequence()) { sings = true; ArrayList targets = new ArrayList(); foreach (Mobile m in Caster.GetMobilesInRange(3)) { if (Caster.CanBeBeneficial(m, false, true) && !(m is Golem)) { targets.Add(m); } } for (int i = 0; i < targets.Count; ++i) { Mobile m = (Mobile)targets[i]; TimeSpan duration = TimeSpan.FromSeconds((double)(MusicSkill(Caster) * 2)); int amount = Server.Misc.MyServerSettings.PlayerLevelMod((int)(MusicSkill(Caster) / 16), Caster); m.SendMessage("Your resistance to poison has increased."); ResistanceMod mod1 = new ResistanceMod(ResistanceType.Poison, +amount); m.AddResistanceMod(mod1); m.FixedParticles(0x373A, 10, 15, 5012, 0x238, 3, EffectLayer.Waist); new ExpireTimer(m, mod1, duration).Start(); } } BardFunctions.UseBardInstrument(m_Book.Instrument, sings, Caster); FinishSequence(); }
public void UpdateMobile(Mobile m) { if (Core.AOS) { if (ReistanceMod != null) { m.RemoveResistanceMod(ReistanceMod); } ReistanceMod = new ResistanceMod(ResistanceType.Poison, Level * 5); m.AddResistanceMod(ReistanceMod); } }
public void Target(Mobile m) { if (!Caster.CanSee(m)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } if (sobreEfeito(m)) { Caster.LocalOverheadMessage(MessageType.Regular, 0x481, false, "O alvo já esta sobre o efeito de magia de proteção."); } else if (CheckBSequence(m, false)) { SpellHelper.Turn(Caster, m); //proteção double valorSkill = Caster.Skills[DamageSkill].Value; int bonus = (int)(valorSkill / 10); int valorMaximo = bonus > 6 ? 6 : bonus; int protecao = Utility.RandomMinMax(Math.Max(1, bonus - 3), valorMaximo); //duracao TimeSpan duracao = TimeSpan.FromMinutes(Caster.Skills[CastSkill].Value / 10 + Utility.Random(2)); //adicona a resistencia ResistanceMod[] resistencias = new ResistanceMod[5]; resistencias[0] = new ResistanceMod(ResistanceType.Physical, protecao); resistencias[1] = new ResistanceMod(ResistanceType.Fire, protecao); resistencias[2] = new ResistanceMod(ResistanceType.Cold, protecao); resistencias[3] = new ResistanceMod(ResistanceType.Energy, protecao); resistencias[4] = new ResistanceMod(ResistanceType.Poison, protecao); foreach (ResistanceMod resis in resistencias) { Caster.AddResistanceMod(resis); } //efeito m.PlaySound(0x202); m.FixedParticles(0x373A, 10, 15, 5012, 0x450, 3, EffectLayer.Waist); m.SendMessage("Você esta sobre o efeito do Toque da Resistência"); adicionarEfeito(m); Timer t = new InternalTimer(m, resistencias, duracao); t.Start(); } FinishSequence(); }
private void RemoveMod_Callback(object obj) { object[] o = obj as object[]; Mobile m = o[0] as Mobile; ResistanceMod mod = (ResistanceMod)o[1]; m.RemoveResistanceMod(mod); BuffInfo.RemoveBuff(m, BuffIcon.DragonTurtleDebuff); if (_Affected != null && _Affected.ContainsKey(m)) { _Affected.Remove(m); } }
public override void OnCast() { if (CheckSequence()) { if (contemMagia.ContainsKey(Caster)) { Caster.SendLocalizedMessage(1005559); // This spell is already in effect. return; } Caster.PlaySound(0x1E9); Caster.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist); //valor da proteção int protecao = (int) (Caster.Skills[DamageSkill].Value / 5.0) + Utility.Random(2); ResistanceMod[] resistencias = new ResistanceMod[5]; resistencias[0] = new ResistanceMod(ResistanceType.Physical, protecao); resistencias[1] = new ResistanceMod(ResistanceType.Fire, protecao); resistencias[2] = new ResistanceMod(ResistanceType.Cold, protecao); resistencias[3] = new ResistanceMod(ResistanceType.Energy, protecao); resistencias[4] = new ResistanceMod(ResistanceType.Poison, protecao); Caster.AddResistanceMod(resistencias[0]); Caster.AddResistanceMod(resistencias[1]); Caster.AddResistanceMod(resistencias[2]); Caster.AddResistanceMod(resistencias[3]); Caster.AddResistanceMod(resistencias[4]); //marca que ele contem a magia contemMagia.Add(Caster, Caster); string args = String.Format("{0}", protecao); //adiciona o buff de armadura arcana BuffInfo armaduraArcana = new BuffInfo(BuffIcon.Protection, 1075814, 1075815, args.ToString()); BuffInfo.AddBuff(Caster, armaduraArcana); //calculo da duracao int intDuracao = (int) (Caster.Skills[CastSkill].Value / 10) + Utility.Random(2); TimeSpan duracao = TimeSpan.FromMinutes(intDuracao); //Tempo para remover Timer remover = new InternalTimer(Caster, resistencias, armaduraArcana, duracao); remover.Start(); } FinishSequence(); }
public override void OnCast() { if (CheckSequence()) { if (contemMagia.ContainsKey(Caster)) { Caster.SendLocalizedMessage(1005559); // This spell is already in effect. return; } Caster.PlaySound(0x1E9); Caster.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist); //valor da proteção int protecao = (int)(Caster.Skills[DamageSkill].Value / 5.0) + Utility.Random(2); ResistanceMod[] resistencias = new ResistanceMod[5]; resistencias[0] = new ResistanceMod(ResistanceType.Physical, protecao); resistencias[1] = new ResistanceMod(ResistanceType.Fire, protecao); resistencias[2] = new ResistanceMod(ResistanceType.Cold, protecao); resistencias[3] = new ResistanceMod(ResistanceType.Energy, protecao); resistencias[4] = new ResistanceMod(ResistanceType.Poison, protecao); Caster.AddResistanceMod(resistencias[0]); Caster.AddResistanceMod(resistencias[1]); Caster.AddResistanceMod(resistencias[2]); Caster.AddResistanceMod(resistencias[3]); Caster.AddResistanceMod(resistencias[4]); //marca que ele contem a magia contemMagia.Add(Caster, Caster); string args = String.Format("{0}", protecao); //adiciona o buff de armadura arcana BuffInfo armaduraArcana = new BuffInfo(BuffIcon.Protection, 1075814, 1075815, args.ToString()); BuffInfo.AddBuff(Caster, armaduraArcana); //calculo da duracao int intDuracao = (int)(Caster.Skills[CastSkill].Value / 10) + Utility.Random(2); TimeSpan duracao = TimeSpan.FromMinutes(intDuracao); //Tempo para remover Timer remover = new InternalTimer(Caster, resistencias, armaduraArcana, duracao); remover.Start(); } FinishSequence(); }
public static void CursePlayer(Mobile m) { if (IsCursed(m)) { return; } if (!UnEquipPlayer(m)) { return; } ExpireTimer timer = (ExpireTimer)m_Table[m]; if (timer != null) { timer.DoExpire(); } else { m.SendMessage("You feel yourself transform into a cursed pirate"); } Effects.SendLocationEffect(m.Location, m.Map, 0x3709, 28, 10, 0x1D3, 5); TimeSpan duration = TimeSpan.FromSeconds(240.0); ResistanceMod[] mods = new ResistanceMod[4] { new ResistanceMod(ResistanceType.Fire, -10), new ResistanceMod(ResistanceType.Poison, -10), new ResistanceMod(ResistanceType.Cold, +10), new ResistanceMod(ResistanceType.Physical, +10) }; timer = new ExpireTimer(m, mods, duration); timer.Start(); m_Table[m] = timer; for (int i = 0; i < mods.Length; ++i) { m.AddResistanceMod(mods[i]); } m.ApplyPoison(m, Poison.Greater); m.Criminal = true; }
public void LowerResist(Mobile target) { if (BaseAttackHelperSE.IsUnderEffect(target, BaseAttackHelperSE.m_KazeKemonoRMT)) { return; } TimeSpan duration = TimeSpan.FromSeconds(121 - (int)(target.Skills[SkillName.MagicResist].Value)); ResistanceMod[] mod = new ResistanceMod[1] { new ResistanceMod(ResistanceType.Physical, -25) }; BaseAttackHelperSE.LowerResistanceAttack(this, ref m_Timer, duration, target, mod, BaseAttackHelperSE.m_KazeKemonoRMT); }
public override void OnCast() { if (CheckSequence()) { Mobile targ = Caster; ResistanceMod[] mods = (ResistanceMod[])m_Table[targ]; if (mods == null) { targ.PlaySound(0x1E9); targ.FixedParticles(0x376A, 9, 32, 5008, 0xB41, 0, EffectLayer.Waist); int phys = (int)((targ.Skills[SkillName.Inscribe].Value / 15) + (GetJediDamage(Caster) / 50)); int engy = (int)((targ.Skills[SkillName.Inscribe].Value / 25) + (GetJediDamage(Caster) / 75)); mods = new ResistanceMod[5] { new ResistanceMod(ResistanceType.Physical, phys), new ResistanceMod(ResistanceType.Fire, -5), new ResistanceMod(ResistanceType.Cold, -5), new ResistanceMod(ResistanceType.Poison, -5), new ResistanceMod(ResistanceType.Energy, engy) }; m_Table[targ] = mods; for (int i = 0; i < mods.Length; ++i) { targ.AddResistanceMod(mods[i]); } } else { targ.PlaySound(0x1ED); targ.FixedParticles(0x376A, 9, 32, 5008, 0xB41, 0, EffectLayer.Waist); m_Table.Remove(targ); for (int i = 0; i < mods.Length; ++i) { targ.RemoveResistanceMod(mods[i]); } } } FinishSequence(); }
public override void OnCast() { if (!Caster.CanBeginAction(typeof(ResearchRockFlesh))) { ResearchRockFlesh.RemoveEffect(Caster); } ResistanceMod[] mods = (ResistanceMod[])TableStoneFlesh[Caster]; mods = new ResistanceMod[1] { new ResistanceMod(ResistanceType.Physical, 90) }; TableStoneFlesh[Caster] = mods; for (int i = 0; i < mods.Length; ++i) { Caster.AddResistanceMod(mods[i]); } double TotalTime = DamagingSkill(Caster) * 4; new InternalTimer(Caster, TimeSpan.FromSeconds(TotalTime)).Start(); Caster.BodyMod = 14; Caster.HueMod = 0xB31; Mobiles.IMount mt = Caster.Mount; if (mt != null) { Server.Mobiles.EtherealMount.EthyDismount(Caster, true); mt.Rider = null; } Caster.SendMessage("Your flesh turns to stone."); Server.Misc.Research.ConsumeScroll(Caster, true, spellID, false); KarmaMod(Caster, ((int)RequiredSkill + RequiredMana)); Point3D hands = new Point3D((Caster.X + 1), (Caster.Y + 1), (Caster.Z + 8)); Effects.SendLocationParticles(EffectItem.Create(hands, Caster.Map, EffectItem.DefaultDuration), 0x3837, 9, 32, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0xB7F), 0, 5022, 0); Caster.PlaySound(0x65A); FinishSequence(); }
} // You apply the ointment and suddenly feel less vulnerable! public override void AddBuff(Mobile m, TimeSpan duration) { ResistanceMod[] mods = new ResistanceMod[] { new ResistanceMod(ResistanceType.Physical, 30), new ResistanceMod(ResistanceType.Fire, -5), new ResistanceMod(ResistanceType.Cold, -5) }; for (int i = 0; i < mods.Length; ++i) { m.AddResistanceMod(mods[i]); } m_Table[m] = mods; }
public override void DoEffects(Mobile m) { base.DoEffects(m); ResistanceMod mod1 = new ResistanceMod(ResistanceType.Poison, 10); m.AddResistanceMod(mod1); Timer.DelayCall(TimeSpan.FromMinutes(10), () => m.RemoveResistanceMod(mod1)); ResistanceMod mod2 = new ResistanceMod(ResistanceType.Energy, 5); m.AddResistanceMod(mod2); Timer.DelayCall(TimeSpan.FromMinutes(10), () => m.RemoveResistanceMod(mod2)); }
public override void OnCast() { if (CheckSequence()) { Mobile targ = Caster; ResistanceMod[] mods = (ResistanceMod[])m_Table[targ]; if (mods == null) { Caster.PlaySound(0x5C9); Point3D wings = new Point3D(Caster.X + 1, Caster.Y + 1, Caster.Z + 18); Effects.SendLocationEffect(wings, Caster.Map, 0x3FE5, 30, 10, 0, 0); int modify = (int)(DamagingSkill(Caster) / 5); mods = new ResistanceMod[5] { new ResistanceMod(ResistanceType.Physical, +modify), new ResistanceMod(ResistanceType.Fire, +modify), new ResistanceMod(ResistanceType.Cold, +modify), new ResistanceMod(ResistanceType.Poison, +modify), new ResistanceMod(ResistanceType.Energy, +modify) }; m_Table[targ] = mods; for (int i = 0; i < mods.Length; ++i) { targ.AddResistanceMod(mods[i]); } int value = (int)(DamagingSkill(Caster) / 2); Caster.MagicDamageAbsorb = value; int TotalTime = (int)(DamagingSkill(Caster) / 12); new InternalTimer(Caster, TimeSpan.FromMinutes(TotalTime)).Start(); Server.Misc.Research.ConsumeScroll(Caster, true, spellID, false); } else { DoFizzle(); } } FinishSequence(); }
public override void OnGaveMeleeAttack(Mobile defender) { base.OnGaveMeleeAttack(defender); if (m_Table == null) { m_Table = new Hashtable(); } if (Combatant != null && m_Table[Combatant] == null) { ResistanceMod mod = new ResistanceMod(ResistanceType.Fire, -10); Combatant.AddResistanceMod(mod); m_Table[Combatant] = mod; Timer.DelayCall(TimeSpan.FromSeconds(30), new TimerStateCallback(EndMod_Callback), Combatant); } }
public void LowerFireResist(Mobile target) { if (BaseAttackHelperSE.IsUnderEffect(target, BaseAttackHelperSE.m_FanDancerRMT)) { return; } TimeSpan duration = TimeSpan.FromSeconds(121 - (int)(target.Skills[SkillName.MagicResist].Value)); ResistanceMod[] mod = new ResistanceMod[1] { new ResistanceMod(ResistanceType.Fire, -25) }; target.SendLocalizedMessage(1070833); // The creature fans you with fire, reducing your resistance to fire attacks. BaseAttackHelperSE.LowerResistanceAttack(this, ref m_Timer, duration, target, mod, BaseAttackHelperSE.m_FanDancerRMT); }
protected override void OnTarget(object o) { Mobile m = o as Mobile; if (m != null) { if (CheckHSequence(m)) { if (CheckResisted(m)) { m.SendLocalizedMessage(1156101); // You resist the effects of death ray. Caster.SendLocalizedMessage(1156102); // Your target resists the effects of death ray. } else { SpellHelper.CheckReflect(0, Caster, ref m); SkillMasterySpell spell = GetSpell(Caster, this.GetType()); if (spell != null && spell.Target == m) { spell.Expire(); } _Location = Caster.Location; m.FixedParticles(0x374A, 1, 15, 5054, 0x7A2, 7, EffectLayer.Head); Caster.FixedParticles(0x0000, 10, 5, 2054, EffectLayer.Head); double damage = (Caster.Skills[CastSkill].Base + Caster.Skills[DamageSkill].Base) * ((double)GetMasteryLevel() * .8); damage /= Target is PlayerMobile ? 5.15 : 2.5; int mod = (int)Caster.Skills[DamageSkill].Value / 12; _Mod = new ResistanceMod(ResistanceType.Energy, -mod); m.AddResistanceMod(_Mod); BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.DeathRay, 1155896, 1156085, String.Format("{0}\t{1}", ((int)damage).ToString(), m.Name))); // Deals ~2_DAMAGE~ to ~1_NAME~ every 3 seconds while in range. Preforming any action will end spell. BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.DeathRayDebuff, 1155896, 1156086, mod.ToString())); // Energy Resist Debuff: ~1_VAL~% Target = m; BeginTimer(); } } } }
public override void OnThink() { double value; int i; if ( Hits != m_HitsLast ) { if ( m_HitsLast != -1 ) { for ( i = 0; i < m_Mods.Length; i++ ) { RemoveResistanceMod( m_Mods[ i ] ); } } for ( i = 0; i < m_Mods.Length; i++ ) { value = ((double) (HitsMax - Hits))*((double) ((m_ResistMax[ i ] - m_Resist[ i ])/(double) HitsMax)); m_Mods[ i ] = new ResistanceMod( (ResistanceType) i, m_Resist[ i ] + (int) value ); } for ( i = 0; i < m_Mods.Length; i++ ) { AddResistanceMod( m_Mods[ i ] ); } m_HitsLast = Hits; } if ( DateTime.Now >= m_NextAbilityTime ) { Mobile target = BaseAttackHelperSE.GetRandomAttacker( this, Yamandon.AbilityRange ); if ( target != null ) { BaseAttackHelperSE.SpillAcid( target, true ); } m_NextAbilityTime = DateTime.Now + TimeSpan.FromSeconds( Utility.RandomMinMax( m_MinTime, m_MaxTime ) ); } base.OnThink(); }
private void ApplyMod(Mobile m, int hue) { ResistanceType type = GetResistanceFromHue(hue); if (_Affected == null) { _Affected = new Dictionary <Mobile, int>(); } _Affected[m] = hue; ResistanceMod mod = new ResistanceMod(type, -25); m.AddResistanceMod(mod); BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.DragonTurtleDebuff, 1156192, 1156192)); Server.Timer.DelayCall(TimeSpan.FromSeconds(30), RemoveMod_Callback, new object[] { m, mod }); }
public override void OnCast() { if (CheckSequence()) { bool success = false; ArrayList targets = new ArrayList(); foreach (Mobile m in Caster.GetMobilesInRange(3)) { if (Caster.CanBeBeneficial(m, false, true) && !(m is Golem)) { targets.Add(m); } } for (int i = 0; i < targets.Count; ++i) { Mobile m = (Mobile)targets[i]; TimeSpan duration = TimeSpan.FromSeconds((double)(DamagingSkill(Caster) * 4)); int amount = (int)(DamagingSkill(Caster) / 8); m.SendMessage("Your resistance to cold has increased."); ResistanceMod mod1 = new ResistanceMod(ResistanceType.Cold, +amount); m.AddResistanceMod(mod1); m.PlaySound(0x1E9); m.FixedParticles(0x375A, 9, 20, 5016, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0), 0, EffectLayer.Waist); new ExpireTimer(m, mod1, duration).Start(); success = true; } if (success) { Server.Misc.Research.ConsumeScroll(Caster, true, spellIndex, false); } } FinishSequence(); }
public static void MustardBomb(Mobile from, Mobile to) { if (!Ability.CanUse(to, from, true)) { return; } Point3D point = to.Location; for (int i = -3; i < 4; i++) { for (int j = -3; j < 4; j++) { point = new Point3D(to.X + i, to.Y + j, to.Z); if (BlueSpell.GetDist(point, to.Location) < 3.1) { Effects.SendLocationEffect(point, to.Map, 0x3728, 13, 1283 /*Hue*/, 4); } } } ResistanceMod[] mods = new ResistanceMod[] { new ResistanceMod(ResistanceType.Fire, -300), new ResistanceMod(ResistanceType.Cold, -300) }; for (int i = 0; i < mods.Length; ++i) { to.AddResistanceMod(mods[i]); } TimedResistanceMod.AddMod( to, "Mustard Bomb", mods, TimeSpan.FromSeconds(60) ); to.AddSkillMod(new TimedSkillMod(SkillName.MagicResist, true, -120.0, TimeSpan.FromSeconds(60))); to.SendMessage("The intense heat scalds your elemental resistance."); }
public override void OnHit(Mobile attacker, Mobile defender, double damageBonus) { base.OnHit(attacker, defender, damageBonus); if (attacker != null && defender != null) { ResistanceMod[] mods = new ResistanceMod[] { new ResistanceMod(ResistanceType.Fire, -15) }; for (int i = 0; i < mods.Length; ++i) { attacker.AddResistanceMod(mods[i]); } TimedResistanceMod.AddMod( defender, "BistroFork", mods, TimeSpan.FromSeconds(10) ); } }
public override void OnGaveMeleeAttack(Mobile defender) { base.OnGaveMeleeAttack(defender); if (0.1 > Utility.RandomDouble()) { /* Grasping Claw * Start cliloc: 1070836 * Effect: Physical resistance -15% for 5 seconds * End cliloc: 1070838 * Effect: Type: "3" - From: "0x57D4F5B" (player) - To: "0x0" - ItemId: "0x37B9" - ItemIdName: "glow" - FromLocation: "(1149 808, 32)" - ToLocation: "(1149 808, 32)" - Speed: "10" - Duration: "5" - FixedDirection: "True" - Explode: "False" */ if (_Table != null && _Table.ContainsKey(defender)) { _Table[defender].DoExpire(); defender.SendLocalizedMessage(1070837); // The creature lands another blow in your weakened state. } else { defender.SendLocalizedMessage(1070836); // The blow from the creature's claws has made you more susceptible to physical attacks. } int effect = -(defender.PhysicalResistance * 15 / 100); ResistanceMod mod = new ResistanceMod(ResistanceType.Physical, effect); defender.FixedEffect(0x37B9, 10, 5); defender.AddResistanceMod(mod); ExpireTimer timer = new ExpireTimer(defender, mod, TimeSpan.FromSeconds(5.0)); timer.Start(); if (_Table == null) { _Table = new Dictionary <Mobile, ExpireTimer>(); } _Table[defender] = timer; } }
public override void OnGaveMeleeAttack( Mobile defender ) { base.OnGaveMeleeAttack( defender ); if ( Utility.RandomDouble() < 0.1 ) { ExpireTimer timer; if ( m_Table.TryGetValue( defender, out timer ) ) timer.DoExpire(); defender.FixedParticles( 0x3709, 10, 30, 5052, EffectLayer.LeftFoot ); defender.PlaySound( 0x208 ); defender.SendLocalizedMessage( 1070833 ); // The creature fans you with fire, reducing your resistance to fire attacks. ResistanceMod mod = new ResistanceMod( ResistanceType.Fire, -10 ); defender.AddResistanceMod( mod ); m_Table[defender] = timer = new ExpireTimer( defender, mod ); timer.Start(); } }
public override void OnGaveMeleeAttack(Mobile defender) { base.OnGaveMeleeAttack(defender); if (0.1 > Utility.RandomDouble()) { /* Grasping Claw * Start cliloc: 1070836 * Effect: Physical resistance -15% for 5 seconds * End cliloc: 1070838 * Effect: Type: "3" - From: "0x57D4F5B" (player) - To: "0x0" - ItemId: "0x37B9" - ItemIdName: "glow" - FromLocation: "(1149 808, 32)" - ToLocation: "(1149 808, 32)" - Speed: "10" - Duration: "5" - FixedDirection: "True" - Explode: "False" */ ExpireTimer timer = (ExpireTimer)m_Table[defender]; if (timer != null) { timer.DoExpire(); defender.SendLocalizedMessage(1070837); // The creature lands another blow in your weakened state. } else defender.SendLocalizedMessage(1070836); // The blow from the creature's claws has made you more susceptible to physical attacks. int effect = -(defender.PhysicalResistance * 15 / 100); ResistanceMod mod = new ResistanceMod(ResistanceType.Physical, effect); defender.FixedEffect(0x37B9, 10, 5); defender.AddResistanceMod(mod); timer = new ExpireTimer(defender, mod, TimeSpan.FromSeconds(5.0)); timer.Start(); m_Table[defender] = timer; } }
public void LowerFireResist( Mobile target ) { if ( BaseAttackHelperSE.IsUnderEffect( target, BaseAttackHelperSE.m_FanDancerRMT ) ) return; TimeSpan duration = TimeSpan.FromSeconds( 121 - (int) ( target.Skills[SkillName.MagicResist].Value ) ); ResistanceMod[] mod = new ResistanceMod[1] { new ResistanceMod( ResistanceType.Fire, -25 ) }; target.SendLocalizedMessage( 1070833 ); // The creature fans you with fire, reducing your resistance to fire attacks. BaseAttackHelperSE.LowerResistanceAttack( this, ref m_Timer, duration, target, mod, BaseAttackHelperSE.m_FanDancerRMT ); }
public bool AddMods() { if ( Owner == null ) return false; BonusNumber++; if ( BonusNumber > 5 ) return false; // @100.0 Forensics bonus's value is 10. double bonus = (BlueSpell.ScaleBySkill( Owner, SkillName.Forensics ) / 2.0); StatMod stat = null; DefaultSkillMod skill = null; ResistanceMod resist = null; int intdiff = 0; double doublediff = 0.0; // Str (+10 @ GM) intdiff = (int)( m_StrCap - (Owner.RawStr + bonus) ); if ( intdiff > 0 ) { stat = new StatMod( StatType.Str, ("DragonForceStr" + BonusNumber.ToString()), intdiff, TimeSpan.FromHours( 24 ) ); Owner.AddStatMod( stat ); StatMods.Add( stat ); } // Dex (+10 @ GM) intdiff = (int)( m_DexCap - (Owner.RawDex + bonus) ); if ( intdiff > 0 ) { stat = new StatMod( StatType.Dex, ("DragonForceDex" + BonusNumber.ToString()), intdiff, TimeSpan.FromHours( 24 ) ); Owner.AddStatMod( stat ); StatMods.Add( stat ); } // Tactics (+5.0 @ GM) doublediff = m_TacticsCap - (Owner.Skills[SkillName.Tactics].Value + bonus); if ( doublediff > 0.0 ) { skill = new DefaultSkillMod( SkillName.Tactics, true, (bonus / 2) ); Owner.AddSkillMod( skill ); SkillMods.Add( skill ); } // Wrestling (+5.0 @ GM) doublediff = m_WrestlingCap - (Owner.Skills[SkillName.Tactics].Value + bonus); if ( doublediff > 0.0 ) { skill = new DefaultSkillMod( SkillName.Wrestling, true, bonus ); Owner.AddSkillMod( skill ); SkillMods.Add( skill ); } // Lose all Magic Resist in preparation of negative resistances. if ( Owner.Skills[SkillName.MagicResist].Value > 0 ) { skill = new DefaultSkillMod( SkillName.MagicResist, true, -Owner.Skills[SkillName.MagicResist].Value ); Owner.AddSkillMod( skill ); SkillMods.Add( skill ); } if ( !Status.Enabled ) { // Lower Magery (-30 @ GM) if ( Owner.Skills[SkillName.Magery].Value > 0 ) { skill = new DefaultSkillMod( SkillName.Magery, true, -(bonus * 3) ); Owner.AddSkillMod( skill ); SkillMods.Add( skill ); } // Lower Necromancy (-30 @ GM) if ( Owner.Skills[SkillName.Necromancy].Value > 0 ) { skill = new DefaultSkillMod( SkillName.Necromancy, true, -(bonus * 3) ); Owner.AddSkillMod( skill ); SkillMods.Add( skill ); } // Lower Chivalry (-30 @ GM) if ( Owner.Skills[SkillName.Chivalry].Value > 0 ) { skill = new DefaultSkillMod( SkillName.Chivalry, true, -(bonus * 3) ); Owner.AddSkillMod( skill ); SkillMods.Add( skill ); } // Lower Bushido (-30 @ GM) if ( Owner.Skills[SkillName.Bushido].Value > 0 ) { skill = new DefaultSkillMod( SkillName.Bushido, true, -(bonus * 3) ); Owner.AddSkillMod( skill ); SkillMods.Add( skill ); } // Lower Ninjitsu (-30 @ GM) if ( Owner.Skills[SkillName.Ninjitsu].Value > 0 ) { skill = new DefaultSkillMod( SkillName.Ninjitsu, true, -(bonus * 3) ); Owner.AddSkillMod( skill ); SkillMods.Add( skill ); } // Lower Spellweaving (-30 @ GM) if ( Owner.Skills[SkillName.Spellweaving].Value > 0 ) { skill = new DefaultSkillMod( SkillName.Spellweaving, true, -(bonus * 3) ); Owner.AddSkillMod( skill ); SkillMods.Add( skill ); } // Lower Mysticism (-30 @ GM) if ( Owner.Skills[SkillName.Mysticism].Value > 0 ) { skill = new DefaultSkillMod( SkillName.Mysticism, true, -(bonus * 3) ); Owner.AddSkillMod( skill ); SkillMods.Add( skill ); } } // Physical (+5 @ GM) intdiff = m_PhysicalResistCap - (int)( Owner.PhysicalResistance + (bonus / 2) ); if ( intdiff > 0 ) { resist = new ResistanceMod( ResistanceType.Physical, intdiff ); Owner.AddResistanceMod( resist ); ResistMods.Add( resist ); } // Fire (+10 @ GM) intdiff = m_FireResistCap - (int)( Owner.FireResistance + bonus ); if ( intdiff > 0 ) { resist = new ResistanceMod( ResistanceType.Fire, (int)(bonus) ); Owner.AddResistanceMod( resist ); ResistMods.Add( resist ); } // Cold (-20 @ GM) resist = new ResistanceMod( ResistanceType.Cold, (int)(-(bonus * 2)) ); Owner.AddResistanceMod( resist ); ResistMods.Add( resist ); // Energy (-10 @ GM) resist = new ResistanceMod( ResistanceType.Energy, (int)(-bonus) ); Owner.AddResistanceMod( resist ); ResistMods.Add( resist ); return true; }
public override void OnGaveMeleeAttack(Mobile defender) { base.OnGaveMeleeAttack(defender); if (!this.IsFanned(defender) && 0.05 > Utility.RandomDouble()) { /* Fanning Fire * Graphic: Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x3709" ItemIdName: "fire column" FromLocation: "(994 325, 16)" ToLocation: "(994 325, 16)" Speed: "10" Duration: "30" FixedDirection: "True" Explode: "False" Hue: "0x0" RenderMode: "0x0" Effect: "0x34" ExplodeEffect: "0x1" ExplodeSound: "0x0" Serial: "0x57D4F5B" Layer: "5" Unknown: "0x0" * Sound: 0x208 * Start cliloc: 1070833 * Effect: Fire res -10% for 10 seconds * Damage: 35-45, 100% fire * End cliloc: 1070834 * Effect does not stack */ defender.SendLocalizedMessage(1070833); // The creature fans you with fire, reducing your resistance to fire attacks. int effect = -(defender.FireResistance / 10); ResistanceMod mod = new ResistanceMod(ResistanceType.Fire, effect); defender.FixedParticles(0x37B9, 10, 30, 0x34, EffectLayer.RightFoot); defender.PlaySound(0x208); // This should be done in place of the normal attack damage. //AOS.Damage( defender, this, Utility.RandomMinMax( 35, 45 ), 0, 100, 0, 0, 0 ); defender.AddResistanceMod(mod); ExpireTimer timer = new ExpireTimer(defender, mod, TimeSpan.FromSeconds(10.0)); timer.Start(); m_Table[defender] = timer; } }
public override void OnCast() { /* The reactive armor spell increases the caster's physical resistance, while lowering the caster's elemental resistances. * 15 + (Inscription/20) Physcial bonus * -5 Elemental * The reactive armor spell has an indefinite duration, becoming active when cast, and deactivated when re-cast. * Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out, even after dying—until you “turn them off” by casting them again. * (+20 physical -5 elemental at 100 Inscription) */ if ( CheckSequence() ) { Mobile targ = Caster; ResistanceMod[] mods = (ResistanceMod[]) m_Table[targ]; if ( mods == null ) { targ.PlaySound( 0x1E9 ); targ.FixedParticles( 0x376A, 9, 32, 5008, EffectLayer.Waist ); int physmod = 15 + (int) ( targ.Skills[SkillName.Inscribe].Value / 20 ); mods = new ResistanceMod[5] { new ResistanceMod( ResistanceType.Physical, physmod ), new ResistanceMod( ResistanceType.Fire, -5 ), new ResistanceMod( ResistanceType.Cold, -5 ), new ResistanceMod( ResistanceType.Poison, -5 ), new ResistanceMod( ResistanceType.Energy, -5 ) }; string buffFormat = String.Format( "{0}\t{1}\t{1}\t{1}\t{1}", physmod, 5 ); BuffInfo.AddBuff( targ, new BuffInfo( BuffIcon.ReactiveArmor, 1075812, buffFormat, true ) ); m_Table[targ] = mods; for ( int i = 0; i < mods.Length; ++i ) targ.AddResistanceMod( mods[i] ); } else { targ.PlaySound( 0x1ED ); targ.FixedParticles( 0x376A, 9, 32, 5008, EffectLayer.Waist ); BuffInfo.RemoveBuff( targ, BuffIcon.ReactiveArmor ); m_Table.Remove( targ ); for ( int i = 0; i < mods.Length; ++i ) targ.RemoveResistanceMod( mods[i] ); } } FinishSequence(); }
public override void OnCast() { if ( Core.AOS ) { /* The magic reflection spell decreases the caster's physical resistance, while increasing the caster's elemental resistances. * Physical decrease = 25 - (Inscription/20). * Elemental resistance = +10 (-20 physical, +10 elemental at GM Inscription) * The magic reflection spell has an indefinite duration, becoming active when cast, and deactivated when re-cast. * Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out, even after dying—until you “turn them off” by casting them again. */ if ( CheckSequence() ) { Mobile targ = Caster; ResistanceMod[] mods = (ResistanceMod[])m_Table[targ]; if ( mods == null ) { targ.PlaySound( 0x1E9 ); targ.FixedParticles( 0x375A, 10, 15, 5037, EffectLayer.Waist ); int physiMod = -25 + (int)(targ.Skills[SkillName.Inscribe].Value / 20); int otherMod = 10; mods = new ResistanceMod[5] { new ResistanceMod( ResistanceType.Physical, physiMod ), new ResistanceMod( ResistanceType.Fire, otherMod ), new ResistanceMod( ResistanceType.Cold, otherMod ), new ResistanceMod( ResistanceType.Poison, otherMod ), new ResistanceMod( ResistanceType.Energy, otherMod ) }; m_Table[targ] = mods; for ( int i = 0; i < mods.Length; ++i ) targ.AddResistanceMod( mods[i] ); string buffFormat = String.Format( "{0}\t+{1}\t+{1}\t+{1}\t+{1}", physiMod, otherMod ); BuffInfo.AddBuff( targ, new BuffInfo( BuffIcon.MagicReflection, 1075817, buffFormat, true ) ); } else { targ.PlaySound( 0x1ED ); targ.FixedParticles( 0x375A, 10, 15, 5037, EffectLayer.Waist ); m_Table.Remove( targ ); for ( int i = 0; i < mods.Length; ++i ) targ.RemoveResistanceMod( mods[i] ); BuffInfo.RemoveBuff( targ, BuffIcon.MagicReflection ); } } FinishSequence(); } else { if ( Caster.MagicDamageAbsorb > 0 ) { Caster.SendLocalizedMessage( 1005559 ); // This spell is already in effect. } else if ( !Caster.CanBeginAction( typeof( DefensiveSpell ) ) ) { Caster.SendLocalizedMessage( 1005385 ); // The spell will not adhere to you at this time. } else if ( CheckSequence() ) { if ( Caster.BeginAction( typeof( DefensiveSpell ) ) ) { int value = (int)(Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.Inscribe].Value); value = (int)(8 + (value/200)*7.0);//absorb from 8 to 15 "circles" Caster.MagicDamageAbsorb = value; Caster.FixedParticles( 0x375A, 10, 15, 5037, EffectLayer.Waist ); Caster.PlaySound( 0x1E9 ); } else { Caster.SendLocalizedMessage( 1005385 ); // The spell will not adhere to you at this time. } } FinishSequence(); } }
public override void OnGaveMeleeAttack(Mobile defender) { base.OnGaveMeleeAttack(defender); if (0.1 > Utility.RandomDouble()) { /* Flurry of Twigs * Start cliloc: 1070850 * Effect: Physical resistance -15% for 5 seconds * End cliloc: 1070852 * Effect: Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x37B9" ItemIdName: "glow" FromLocation: "(1048 779, 6)" ToLocation: "(1048 779, 6)" Speed: "10" Duration: "5" FixedDirection: "True" Explode: "False" */ ExpireTimer timer = (ExpireTimer)m_FlurryOfTwigsTable[defender]; if (timer != null) { timer.DoExpire(); defender.SendLocalizedMessage(1070851); // The creature lands another blow in your weakened state. } else defender.SendLocalizedMessage(1070850); // The creature's flurry of twigs has made you more susceptible to physical attacks! int effect = -(defender.PhysicalResistance * 15 / 100); ResistanceMod mod = new ResistanceMod(ResistanceType.Physical, effect); defender.FixedEffect(0x37B9, 10, 5); defender.AddResistanceMod(mod); timer = new ExpireTimer(defender, mod, m_FlurryOfTwigsTable, TimeSpan.FromSeconds(5.0)); timer.Start(); m_FlurryOfTwigsTable[defender] = timer; } else if (0.05 > Utility.RandomDouble()) { /* Chlorophyl Blast * Start cliloc: 1070827 * Effect: Energy resistance -50% for 10 seconds * End cliloc: 1070829 * Effect: Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x37B9" ItemIdName: "glow" FromLocation: "(1048 779, 6)" ToLocation: "(1048 779, 6)" Speed: "10" Duration: "5" FixedDirection: "True" Explode: "False" */ ExpireTimer timer = (ExpireTimer)m_ChlorophylBlastTable[defender]; if (timer != null) { timer.DoExpire(); defender.SendLocalizedMessage(1070828); // The creature continues to hinder your energy resistance! } else defender.SendLocalizedMessage(1070827); // The creature's attack has made you more susceptible to energy attacks! int effect = -(defender.EnergyResistance / 2); ResistanceMod mod = new ResistanceMod(ResistanceType.Energy, effect); defender.FixedEffect(0x37B9, 10, 5); defender.AddResistanceMod(mod); timer = new ExpireTimer(defender, mod, m_ChlorophylBlastTable, TimeSpan.FromSeconds(10.0)); timer.Start(); m_ChlorophylBlastTable[defender] = timer; } }
public ExpireTimer(Mobile m, ResistanceMod mod, TimeSpan delay) : base(delay) { this.m_Mobile = m; this.m_Mod = mod; this.Priority = TimerPriority.TwoFiftyMS; }
public void Target( Mobile m ) { if ( !Caster.CanSee( m ) ) { Caster.SendLocalizedMessage( 500237 ); // Target can not be seen. } if ( sobreEfeito( m ) ){ Caster.LocalOverheadMessage( MessageType.Regular, 0x481, false, "O alvo já esta sobre o efeito de magia Proteção Frio." ); } else if ( CheckBSequence( m, false ) ) { SpellHelper.Turn( Caster, m ); //proteção double valorSkill = Caster.Skills[DamageSkill].Value; int bonus = (int)(valorSkill / 10); int protecao = Utility.RandomMinMax(Math.Max(1, bonus - 3), bonus + Utility.Random(5)); //duracao TimeSpan duracao = TimeSpan.FromMinutes(Caster.Skills[CastSkill].Value / 10 + Utility.Random(2)); //adicona a resistencia ResistanceMod[] resistencias = new ResistanceMod[1]; resistencias[0] = new ResistanceMod(ResistanceType.Cold, protecao); foreach (ResistanceMod resis in resistencias) { Caster.AddResistanceMod(resis); } //efeito m.PlaySound( 0x202 ); m.FixedParticles( 0x373A, 10, 15, 5012, 0x450, 3, EffectLayer.Waist ); m.SendMessage( "Você esta sobre o efeito da magia Proteção Frio" ); adicionarEfeito(m); Timer t = new InternalTimer(m, resistencias, duracao); t.Start(); } FinishSequence(); }
public static void MustardBomb( Mobile from, Mobile to ) { if ( !Ability.CanUse( to, from, true ) ) return; Point3D point = to.Location; for( int i = -3; i < 4; i++ ) { for( int j = -3; j < 4; j++ ) { point = new Point3D( to.X + i, to.Y + j, to.Z ); if ( BlueSpell.GetDist( point, to.Location ) < 3.1 ) Effects.SendLocationEffect( point,to.Map, 0x3728, 13, 1283/*Hue*/, 4 ); } } ResistanceMod[] mods = new ResistanceMod[]{ new ResistanceMod( ResistanceType.Fire, -300 ), new ResistanceMod( ResistanceType.Cold, -300 ) }; for ( int i = 0; i < mods.Length; ++i ) to.AddResistanceMod( mods[i] ); TimedResistanceMod.AddMod( to, "Mustard Bomb", mods, TimeSpan.FromSeconds( 60 ) ); to.AddSkillMod( new TimedSkillMod( SkillName.MagicResist, true, -120.0, TimeSpan.FromSeconds( 60 ) ) ); to.SendMessage( "The intense heat scalds your elemental resistance." ); }
protected override void OnTarget(Mobile from, object targeted) { var pm = from as PlayerMobile; if (m_Tasty.Deleted) return; if (targeted is BaseCreature) { var creature = (BaseCreature) targeted; if ((creature.Controlled || creature.Summoned) && (from == creature.ControlMaster) && !(creature.Asleep)) { creature.FixedParticles(0x373A, 10, 15, 5018, EffectLayer.Waist); creature.PlaySound(0x1EA); var mod = new ResistanceMod(ResistanceType.Physical, +15); var mod1 = new ResistanceMod(ResistanceType.Fire, +10); var mod2 = new ResistanceMod(ResistanceType.Cold, +10); var mod3 = new ResistanceMod(ResistanceType.Poison, +10); var mod4 = new ResistanceMod(ResistanceType.Energy, +10); creature.AddResistanceMod(mod); creature.AddResistanceMod(mod1); creature.AddResistanceMod(mod2); creature.AddResistanceMod(mod3); creature.AddResistanceMod(mod4); from.SendMessage("You have increased the Damage Absorption of your pet by 10% for 10 Minutes !!"); m_Tasty.Used = true; creature.Asleep = true; Timer.DelayCall(TimeSpan.FromMinutes(10.0), delegate { var mod5 = new ResistanceMod(ResistanceType.Physical, -15); var mod6 = new ResistanceMod(ResistanceType.Fire, -10); var mod7 = new ResistanceMod(ResistanceType.Cold, -10); var mod8 = new ResistanceMod(ResistanceType.Poison, -10); var mod9 = new ResistanceMod(ResistanceType.Energy, -10); creature.AddResistanceMod(mod5); creature.AddResistanceMod(mod6); creature.AddResistanceMod(mod7); creature.AddResistanceMod(mod8); creature.AddResistanceMod(mod9); creature.PlaySound(0x1EB); this.m_Tasty.Used = true; creature.Asleep = false; from.SendMessage("The effect of Vial of Armor Essence is finish !"); Timer.DelayCall(TimeSpan.FromMinutes(120.0), delegate { this.m_Tasty.Used = false; }); }); } else if ((creature.Controlled || creature.Summoned) && (from == creature.ControlMaster) && (creature.Asleep)) { from.SendMessage("Pet already under the influence of Vial of Armor Essence !"); } else { from.SendLocalizedMessage(1113049); } } else { from.SendLocalizedMessage(500329); } }
public ExpireTimer( Mobile m, ResistanceMod[] mods, TimeSpan delay ) : base( delay ) { m_Mobile = m; m_Mods = mods; }
public DefenseMasteryInfo(Mobile from, int damageMalus, ResistanceMod mod) { this.m_From = from; this.m_DamageMalus = damageMalus; this.m_Mod = mod; }
public override void OnCast() { if ( Core.AOS ) { if ( CheckSequence() ) { Mobile targ = Caster; ResistanceMod[] mods = (ResistanceMod[])m_Table[targ]; if ( mods == null ) { targ.PlaySound( 0x1E9 ); targ.FixedParticles( 0x376A, 9, 32, 5008, EffectLayer.Waist ); mods = new ResistanceMod[5] { new ResistanceMod( ResistanceType.Physical, 15 + (int)(targ.Skills[SkillName.Inscribe].Value / 20) ), new ResistanceMod( ResistanceType.Fire, -5 ), new ResistanceMod( ResistanceType.Cold, -5 ), new ResistanceMod( ResistanceType.Poison, -5 ), new ResistanceMod( ResistanceType.Energy, -5 ) }; m_Table[targ] = mods; for ( int i = 0; i < mods.Length; ++i ) targ.AddResistanceMod( mods[i] ); } else { targ.PlaySound( 0x1ED ); targ.FixedParticles( 0x376A, 9, 32, 5008, EffectLayer.Waist ); m_Table.Remove( targ ); for ( int i = 0; i < mods.Length; ++i ) targ.RemoveResistanceMod( mods[i] ); } } FinishSequence(); } else { if ( Caster.MeleeDamageAbsorb > 0 ) { Caster.SendAsciiMessage( "This spell is already in effect." ); } else if ( !Caster.CanBeginAction( typeof( DefensiveSpell ) ) ) { Caster.SendAsciiMessage( "The spell will not adhere to you at this time." ); } else if ( CheckSequence() ) { if ( Caster.BeginAction( typeof( DefensiveSpell ) ) ) { int value = (int)(Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.Meditation].Value + Caster.Skills[SkillName.Inscribe].Value); value /= 3; if ( value < 0 ) value = 1; else if ( value > 75 ) value = 75; Caster.MeleeDamageAbsorb = value; Caster.FixedParticles( 0x376A, 9, 32, 5008, EffectLayer.Waist ); Caster.PlaySound( 0x1F2 ); } else { Caster.SendAsciiMessage( "The spell will not adhere to you at this time." ); } } FinishSequence(); } }
public override void OnCast() { if ( Core.AOS ) { /* The reactive armor spell increases the caster's physical resistance, while lowering the caster's elemental resistances. * 15 + (Inscription/20) Physcial bonus * -5 Elemental * The reactive armor spell has an indefinite duration, becoming active when cast, and deactivated when re-cast. * Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out, even after dying—until you “turn them off” by casting them again. * (+20 physical -5 elemental at 100 Inscription) */ if ( CheckSequence() ) { Mobile targ = Caster; ResistanceMod[] mods = (ResistanceMod[])m_Table[targ]; if ( mods == null ) { targ.PlaySound( 0x1E9 ); targ.FixedParticles( 0x376A, 9, 32, 5008, EffectLayer.Waist ); mods = new ResistanceMod[5] { new ResistanceMod( ResistanceType.Physical, 15 + (int)(targ.Skills[SkillName.Inscribe].Value / 20) ), new ResistanceMod( ResistanceType.Fire, -5 ), new ResistanceMod( ResistanceType.Cold, -5 ), new ResistanceMod( ResistanceType.Poison, -5 ), new ResistanceMod( ResistanceType.Energy, -5 ) }; m_Table[targ] = mods; for ( int i = 0; i < mods.Length; ++i ) targ.AddResistanceMod( mods[i] ); } else { targ.PlaySound( 0x1ED ); targ.FixedParticles( 0x376A, 9, 32, 5008, EffectLayer.Waist ); m_Table.Remove( targ ); for ( int i = 0; i < mods.Length; ++i ) targ.RemoveResistanceMod( mods[i] ); } } FinishSequence(); } else { if ( Caster.MeleeDamageAbsorb > 0 ) { Caster.SendLocalizedMessage( 1005559 ); // This spell is already in effect. } else if ( !Caster.CanBeginAction( typeof( DefensiveSpell ) ) ) { Caster.SendLocalizedMessage( 1005385 ); // The spell will not adhere to you at this time. } else if ( CheckSequence() ) { if ( Caster.BeginAction( typeof( DefensiveSpell ) ) ) { int value = (int)(Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.Meditation].Value + Caster.Skills[SkillName.Inscribe].Value); value /= 3; if ( value < 0 ) value = 1; else if ( value > 75 ) value = 75; Caster.MeleeDamageAbsorb = value; Caster.FixedParticles( 0x376A, 9, 32, 5008, EffectLayer.Waist ); Caster.PlaySound( 0x1F2 ); } else { Caster.SendLocalizedMessage( 1005385 ); // The spell will not adhere to you at this time. } } FinishSequence(); } }
public InternalTimer(Mobile m, ResistanceMod[] resistencias, TimeSpan delay ) : base(delay) { alvo = m; this.resistencias = resistencias; bf = new BuffInfo( BuffIcon.Bless, 1075843, new TextDefinition("Proteção Frio")); BuffInfo.AddBuff( m, bf); }
public InternalTimer(Mobile caster, ResistanceMod[] resistencias, BuffInfo armaduraArcana, TimeSpan duracao) : base(duracao) { this.caster = caster; this.resistencias = resistencias; this.armaduraArcana = armaduraArcana; }
public ExpireTimer( Mobile m, ResistanceMod mod, Hashtable table, TimeSpan delay ) : base( delay ) { m_Mobile = m; m_Mod = mod; m_Table = table; Priority = TimerPriority.TwoFiftyMS; }