public void Target(Mobile m) { Spellbook book = Spellbook.Find(Caster, -1, SpellbookType.Song); if (book == null) { return; } m_Book = (SongBook)book; PlayerMobile p = m as PlayerMobile; bool sings = false; if (!Caster.CanSee(m)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (CheckHSequence(m)) { sings = true; 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); bool IsSlayer = false; if (m is BaseCreature) { IsSlayer = CheckSlayer(m_Book.Instrument, m); } int amount = (int)(MusicSkill(Caster) / 16); TimeSpan duration = TimeSpan.FromSeconds((double)(MusicSkill(Caster))); if (IsSlayer == true) { amount = amount * 2; duration = TimeSpan.FromSeconds((double)(MusicSkill(Caster) * 2)); } m.SendMessage("Your resistance to fire has decreased."); ResistanceMod mod1 = new ResistanceMod(ResistanceType.Fire, -amount); m.FixedParticles(0x374A, 10, 30, 5013, 0x489, 2, EffectLayer.Waist); m.AddResistanceMod(mod1); ExpireTimer timer1 = new ExpireTimer(m, mod1, duration); timer1.Start(); } BardFunctions.UseBardInstrument(m_Book.Instrument, sings, Caster); 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]; Mobile source = Caster; double allvalue = Caster.Skills[SkillName.Musicianship].Value + Caster.Skills[SkillName.Provocation].Value + Caster.Skills[SkillName.Discordance].Value + Caster.Skills[SkillName.Peacemaking].Value; int amount = (int)(Math.Max((Caster.Skills[SkillName.Musicianship].Value * 0.1), (allvalue - 360 * 0.15))); //int amount = (int)( Caster.Skills[SkillName.Musicianship].Value * 0.1 ); string str = "str"; double duration = (Caster.Skills[SkillName.Musicianship].Value); StatMod mod = new StatMod(StatType.Str, str, +amount, TimeSpan.FromSeconds(duration)); m.AddStatMod(mod); m.FixedParticles(0x375A, 10, 15, 5017, 0x224, 3, EffectLayer.Waist); } } 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 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() { //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(4)) { if (m is BaseCreature) { BaseCreature mn = m as BaseCreature; if (mn.ControlSlots == 666) { targets.Add(m); } } if (m is BaseCreature && ((BaseCreature)m).Summoned) { targets.Add(m); } } Caster.FixedParticles(0x3709, 1, 30, 9965, 5, 7, EffectLayer.Waist); for (int i = 0; i < targets.Count; ++i) { Mobile m = (Mobile)targets[i]; Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042); m.Delete(); } } BardFunctions.UseBardInstrument(m_Book.Instrument, sings, Caster); 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 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]; int amount = Server.Misc.MyServerSettings.PlayerLevelMod((int)(MusicSkill(Caster) / 16), Caster); string intt = "int"; double duration = (double)(MusicSkill(Caster) * 2); StatMod mod = new StatMod(StatType.Int, intt, +amount, TimeSpan.FromSeconds(duration)); m.AddStatMod(mod); m.FixedParticles(0x375A, 10, 15, 5017, 0x1F8, 3, EffectLayer.Waist); } } BardFunctions.UseBardInstrument(m_Book.Instrument, sings, Caster); FinishSequence(); }
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(Caster, m); bool IsSlayer = false; if (m is BaseCreature) { IsSlayer = CheckSlayer(m_Book.Instrument, m); } double damage = ((Caster.Skills[SkillName.Musicianship].Value + Caster.Skills[SkillName.Peacemaking].Value + Caster.Skills[SkillName.Provocation].Value + Caster.Skills[SkillName.Discordance].Value) / 4 * 0.25); if (IsSlayer == true) { damage = damage * 2; } SpellHelper.Damage(this, m, damage, 20, 20, 20, 20, 20); m.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Head); source.MovingParticles(m, 0x379F, 7, 0, false, true, 3043, 4043, 0x211); m.PlaySound(0x1EA); } BardFunctions.UseBardInstrument(m_Book.Instrument, sings, Caster); 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; double allvalue = (double)MusicSkill(Caster); { ArrayList targets = new ArrayList(); foreach (Mobile m in Caster.GetMobilesInRange(3)) { if (Caster.CanBeBeneficial(m, false, true) && !(m is Golem) && !(m is BaseCreature)) { targets.Add(m); } //added: && !(m is BaseCreature ) , if it compiles. add to others } for (int i = 0; i < targets.Count; ++i) { Mobile m = (Mobile)targets[i]; //TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Musicianship].Value * 0.375); TimeSpan duration = TimeSpan.FromSeconds(allvalue / 4 * 0.5); int rounds = (int)(Caster.Skills[SkillName.Musicianship].Value * .16); if (allvalue < 120) { new ExpireTimer(m, 0, rounds, TimeSpan.FromSeconds(2)).Start(); } //2 mana else if (allvalue < 240) { new ExpireTimer1(m, 0, rounds, TimeSpan.FromSeconds(2)).Start(); } //3 mana else if (allvalue < 360) { new ExpireTimer2(m, 0, rounds, TimeSpan.FromSeconds(2)).Start(); } //4 mana else if (allvalue < 480) { new ExpireTimer3(m, 0, rounds, TimeSpan.FromSeconds(2)).Start(); } //5 else if (allvalue >= 480) { new ExpireTimer4(m, 0, rounds, TimeSpan.FromSeconds(2)).Start(); } //10 else { new ExpireTimer(m, 0, rounds, TimeSpan.FromSeconds(2)).Start(); } //not required, just in case the else if dont cover it all, same as first if m.FixedParticles(0x376A, 9, 32, 5030, 0x256, 3, EffectLayer.Waist); m.PlaySound(0x1F2); } } FinishSequence(); } BardFunctions.UseBardInstrument(m_Book.Instrument, sings, Caster); }