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(); }
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 (!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(); }
public override void OnCast() { if (CheckSequence()) { // Values var bonus1 = 2 + (int)(Caster.Skills[SkillName.Mysticism].Value / 20); var bonus = 1 + (int)(Caster.Skills[SkillName.Focus].Value / 20); // Mount var mount = Caster.Mount; if (mount != null) { mount.Rider = null; } // Resists var mods = new List <ResistanceMod>(); mods.Add(new ResistanceMod(ResistanceType.Physical, bonus1 + bonus)); mods.Add(new ResistanceMod(ResistanceType.Fire, bonus1 + bonus)); mods.Add(new ResistanceMod(ResistanceType.Cold, bonus1 + bonus)); mods.Add(new ResistanceMod(ResistanceType.Poison, bonus1 + bonus)); mods.Add(new ResistanceMod(ResistanceType.Energy, bonus1 + bonus)); for (var i = 0; i < mods.Count; i++) { Caster.AddResistanceMod(mods[i]); } // Effects Caster.BodyMod = 705; Caster.PlaySound(0x65A); Caster.FixedParticles(0x3728, 1, 13, 9918, 92, 3, EffectLayer.Head); m_Table.Add(Caster, mods); Enhancement.SetValue(Caster, AosAttribute.CastSpeed, -2, "Stone Form"); Enhancement.SetValue(Caster, AosAttribute.WeaponSpeed, -10, "Stone Form"); Caster.BeginAction(typeof(StoneFormSpell)); } FinishSequence(); }
public override void OnCast() { if (!Caster.CanBeginAction(typeof(WoodlandProtectionSpell))) { Caster.SendLocalizedMessage(1005559); } else if (CheckSequence()) { int MyResist = (int)(Caster.Skills[SkillName.AnimalTaming].Value) / 5; object[] mods = new object[] { new ResistanceMod(ResistanceType.Physical, MyResist), new ResistanceMod(ResistanceType.Fire, MyResist), new ResistanceMod(ResistanceType.Cold, MyResist), new ResistanceMod(ResistanceType.Poison, MyResist), new ResistanceMod(ResistanceType.Energy, MyResist) }; m_Table[Caster] = mods; Caster.AddResistanceMod((ResistanceMod)mods[0]); Caster.AddResistanceMod((ResistanceMod)mods[1]); Caster.AddResistanceMod((ResistanceMod)mods[2]); Caster.AddResistanceMod((ResistanceMod)mods[3]); Caster.AddResistanceMod((ResistanceMod)mods[4]); double span = (Caster.Skills[SkillName.AnimalLore].Value / 2) * 60; new InternalTimer(Caster, TimeSpan.FromSeconds((int)span)).Start(); Caster.PlaySound(0x19); Effects.SendLocationParticles(Caster, 0xC87, 9, 10, 5025); Caster.BeginAction(typeof(WoodlandProtectionSpell)); } FinishSequence(); }
public override void OnCast() { if (Factions.Sigil.ExistsOn(Caster)) { Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil. } else if (!Caster.CanBeginAction(typeof(PolymorphSpell))) { Caster.SendLocalizedMessage(1061628); // You can't do that while polymorphed. } else if (!Caster.CanBeginAction(typeof(IncognitoSpell)) || (Caster.IsBodyMod && !UnderEffect(Caster))) { Caster.SendLocalizedMessage(1063218); // You cannot use that ability in this form. } else if (CheckSequence()) { if (UnderEffect(Caster)) { RemoveEffects(Caster); Caster.PlaySound(0xFA); } else { int offset = 3; // Bonus por Arcane Circle offset += GetFocusLevel(Caster); // Declaramos las Resistencias ArrayList mods = new ArrayList(); // Seteamos las Resistencias mods.Add(new ResistanceMod(ResistanceType.Physical, offset)); mods.Add(new ResistanceMod(ResistanceType.Fire, -20)); mods.Add(new ResistanceMod(ResistanceType.Cold, offset)); mods.Add(new ResistanceMod(ResistanceType.Poison, offset)); mods.Add(new ResistanceMod(ResistanceType.Energy, offset)); // Bajamos de la montura if (Caster.Mount != null) { IMount mt = Caster.Mount; if (mt != null) { mt.Rider = null; } } // Aspecto Caster.BodyMod = 285; Caster.HueMod = 0; // Aplicamos las Resistencias for (int i = 0; i < mods.Count; ++i) { Caster.AddResistanceMod((ResistanceMod)mods[i]); } // Salvamos las Resistencias en la Hashtable m_Table[Caster] = mods; Caster.PlaySound(442); } } FinishSequence(); }
public override void OnCast() { if (Sigil.ExistsOn(Caster)) { Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil. } else if (!Caster.CanBeginAction <PolymorphSpell>()) { Caster.SendLocalizedMessage(1061628); // You can't do that while polymorphed. } else if (!Caster.CanBeginAction <IncognitoSpell>() || Caster.IsBodyMod && !UnderEffect(Caster)) { Caster.SendLocalizedMessage(1063218); // You cannot use that ability in this form. } else if (CheckSequence()) { if (UnderEffect(Caster)) { RemoveEffects(Caster); Caster.PlaySound(0xFA); Caster.Delta(MobileDelta.Resistances); } else { var mount = Caster.Mount; if (mount != null) { mount.Rider = null; } Caster.BodyMod = 0x2C1; Caster.HueMod = 0; var offset = (int)((GetBaseSkill(Caster) + GetBoostSkill(Caster)) / 24.0); ResistanceMod[] mods = { new ResistanceMod(ResistanceType.Physical, offset), new ResistanceMod(ResistanceType.Fire, offset), new ResistanceMod(ResistanceType.Cold, offset), new ResistanceMod(ResistanceType.Poison, offset), new ResistanceMod(ResistanceType.Energy, offset) }; for (var i = 0; i < mods.Length; ++i) { Caster.AddResistanceMod(mods[i]); } m_Table[Caster] = mods; Caster.PlaySound(0x65A); Caster.Delta(MobileDelta.Resistances); BuffInfo.AddBuff( Caster, new BuffInfo( BuffIcon.StoneForm, 1080145, 1080146, $"-10\t-2\t{offset}\t{GetResistCapBonus(Caster)}\t{GetDIBonus(Caster)}", false ) ); } } FinishSequence(); }
public override void OnCast() { if (Factions.Sigil.ExistsOn(Caster)) { Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil. } else if (!Caster.CanBeginAction(typeof(PolymorphSpell))) { Caster.SendLocalizedMessage(1061628); // You can't do that while polymorphed. } else if (!Caster.CanBeginAction(typeof(IncognitoSpell)) || (Caster.IsBodyMod && !UnderEffect(Caster))) { Caster.SendLocalizedMessage(1063218); // You cannot use that ability in this form. } else if (CheckSequence()) { if (UnderEffect(Caster)) { RemoveEffects(Caster); Caster.PlaySound(0xFA); Caster.Delta(MobileDelta.Resistances); } else { Mobiles.IMount mount = Caster.Mount; if (mount != null) { mount.Rider = null; } Caster.BodyMod = 0x2C1; Caster.HueMod = 0; int offset = (int)((GetBaseSkill(Caster) + GetBoostSkill(Caster)) / 24.0); List <ResistanceMod> mods = new List <ResistanceMod> { new ResistanceMod(ResistanceType.Physical, offset), new ResistanceMod(ResistanceType.Fire, offset), new ResistanceMod(ResistanceType.Cold, offset), new ResistanceMod(ResistanceType.Poison, offset), new ResistanceMod(ResistanceType.Energy, offset) }; foreach (ResistanceMod mod in mods) { Caster.AddResistanceMod(mod); } m_Table[Caster] = mods; Caster.PlaySound(0x65A); Caster.Delta(MobileDelta.Resistances); BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.StoneForm, 1080145, 1080146, string.Format("-10\t-2\t{0}\t{1}\t{2}", offset, GetResistCapBonus(Caster), GetDIBonus(Caster)), false)); } } FinishSequence(); }
public override void OnCast() { if (Factions.Sigil.ExistsOn(Caster)) { Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil. } else if (!Caster.CanBeginAction(typeof(PolymorphSpell))) { Caster.SendLocalizedMessage(1061628); // You can't do that while polymorphed. } else if (!Caster.CanBeginAction(typeof(IncognitoSpell)) || (Caster.IsBodyMod && !UnderEffect(Caster))) { Caster.SendLocalizedMessage(1063218); // You cannot use that ability in this form. } else if (CheckSequence()) { if (UnderEffect(Caster)) { RemoveEffects(Caster); Caster.PlaySound(0xFA); Caster.Delta(MobileDelta.Resistances); } else { int offset = (int)((GetBaseSkill(Caster) + GetBoostSkill(Caster)) / 24.0); // Declaramos las Resistencias ArrayList mods = new ArrayList(); // Seteamos las Resistencias mods.Add(new ResistanceMod(ResistanceType.Physical, offset)); mods.Add(new ResistanceMod(ResistanceType.Fire, offset)); mods.Add(new ResistanceMod(ResistanceType.Cold, offset)); mods.Add(new ResistanceMod(ResistanceType.Poison, offset)); mods.Add(new ResistanceMod(ResistanceType.Energy, offset)); // Bajamos de la montura if (Caster.Mount != null) { IMount mt = Caster.Mount; if (mt != null) { mt.Rider = null; } } // Aspecto Caster.BodyMod = 0x2C1; Caster.HueMod = 0; // Aplicamos las Resistencias for (int i = 0; i < mods.Count; ++i) { Caster.AddResistanceMod((ResistanceMod)mods[i]); } // Salvamos las Resistencias en la Hashtable m_Table[Caster] = mods; Caster.PlaySound(0x65A); Caster.Delta(MobileDelta.Resistances); BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.StoneForm, 1080145, 1080146, String.Format("-10\t-2\t{0}\t{1}\t{2}", offset, GetResistCapBonus(Caster), GetDIBonus(Caster)), false)); } } FinishSequence(); }