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();
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
        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();
        }
Esempio n. 4
0
        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();
        }
Esempio n. 5
0
        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();
        }
Esempio n. 6
0
        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();
        }
Esempio n. 8
0
        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();
        }
Esempio n. 9
0
 // POST: api/SongBook
 public void AddSongBook(SongBookInfo value)
 {
     using (var context = Context)
     {
         var songBook = new SongBook {
             Name = value.Name
         };
         songBook.Songs = value.Songs.Select(d => new SongInSongBook {
             SongBook = songBook, SongKey = d
         }).ToList();
         context.SongBooks.Add(songBook);
         context.SaveChanges();
     }
 }
Esempio n. 10
0
        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);
        }
        public static Song GetExpectedSong()
        {
            Song song = new Song
            {
                Title    = "Näher, mein Gott, zu Dir",
                Language = "Deutsch"
            };

            song.Themes.Add("Anbetung");

            song.Copyright  = "Text und Musik: Lowell Mason, 1792-1872";
            song.Formatting = new SongFormatting();
            song.Formatting.CopyrightPosition = AdditionalInformationPosition.LastSlide;

            SongBook sb = new SongBook
            {
                Name = "grünes Buch 339"
            };

            song.SongBooks.Add(sb);
            song.Formatting.SourcePosition = AdditionalInformationPosition.FirstSlide;

            SongPart part = new SongPart
            {
                Caption = "Teil 1"
            };

            SongSlide slide = new SongSlide
            {
                Background = new ImageBackground("Blumen\\Blume 3.jpg"),
                TextSize   = 42
            };

            slide.Lines.Add("Näher, mein Gott, zu Dir,");
            slide.Lines.Add("sei meine Bitt'!");
            slide.Lines.Add("Näher, o Herr, zu Dir");
            slide.Lines.Add("mit jedem Schritt.");
            part.Slides.Add(slide);

            slide = new SongSlide
            {
                Background = new ImageBackground("Blumen\\Blume 3.jpg"),
                TextSize   = 44
            };
            slide.Lines.Add("Nur an dem Herzen Dein");
            slide.Lines.Add("kann ich geborgen sein;");
            slide.Lines.Add("deshalb die Bitte mein:");
            slide.Lines.Add("Näher zu Dir!");
            part.Slides.Add(slide);
            song.Parts.Add(part);

            part = new SongPart
            {
                Caption = "Teil 2"
            };

            slide = new SongSlide
            {
                Background = new ImageBackground("Blumen\\Blume 3.jpg"),
                TextSize   = 42
            };
            slide.Lines.Add("Näher, mein Gott, zu Dir!");
            slide.Lines.Add("Ein jeder Tag");
            slide.Lines.Add("soll es neu zeigen mir,");
            slide.Lines.Add("was er vermag:");
            part.Slides.Add(slide);

            slide = new SongSlide
            {
                Background = new ImageBackground("Blumen\\Blume 3.jpg"),
                TextSize   = 42
            };
            slide.Lines.Add("Wie seiner Gnade Macht,");
            slide.Lines.Add("Erlösung hat gebracht,");
            slide.Lines.Add("in uns're Sündennacht.");
            slide.Lines.Add("Näher zu Dir!");
            part.Slides.Add(slide);
            song.Parts.Add(part);

            part = new SongPart
            {
                Caption = "Teil 3"
            };

            slide = new SongSlide
            {
                Background = new ImageBackground("Blumen\\Blume 3.jpg"),
                TextSize   = 42
            };
            slide.Lines.Add("Näher, mein Gott, zu Dir!");
            slide.Lines.Add("Dich bet' ich an.");
            slide.Lines.Add("Wie vieles hast an mir,");
            slide.Lines.Add("Du doch getan!");
            part.Slides.Add(slide);

            slide = new SongSlide
            {
                Background = new ImageBackground("Blumen\\Blume 3.jpg"),
                TextSize   = 42
            };
            slide.Lines.Add("Von Banden frei und los,");
            slide.Lines.Add("ruh' ich in Deinem Schoss.");
            slide.Lines.Add("Ja, Deine Gnad' ist gross!");
            slide.Lines.Add("Näher zu Dir!");
            part.Slides.Add(slide);
            song.Parts.Add(part);

            song.PartSequence.Add(song.Parts[0]);
            song.PartSequence.Add(song.Parts[1]);
            song.PartSequence.Add(song.Parts[2]);

            song.Formatting.MainText = new TextFormatting(
                new Font("Times New Roman", 44, FontStyle.Bold | FontStyle.Italic),
                Color.White,
                new TextOutline(30, Color.Black),
                new TextShadow(15, 0, 125, Color.Black)
                );
            song.Formatting.TranslationText = new TextFormatting(
                new Font("Times New Roman", 20, FontStyle.Regular),
                Color.White,
                new TextOutline(30, Color.Black),
                new TextShadow(20, 0, 125, Color.Black)
                );
            song.Formatting.CopyrightText = new TextFormatting(
                new Font("Times New Roman", 14, FontStyle.Regular),
                Color.White,
                new TextOutline(30, Color.Black),
                new TextShadow(20, 0, 125, Color.Black)
                );
            song.Formatting.SourceText = new TextFormatting(
                new Font("Times New Roman", 30, FontStyle.Regular),
                Color.White,
                new TextOutline(30, Color.Black),
                new TextShadow(20, 0, 125, Color.Black)
                );
            song.Formatting.MainLineSpacing        = 30;
            song.Formatting.TranslationLineSpacing = 20;

            song.Formatting.TextOrientation = new TextOrientation(VerticalOrientation.Middle, HorizontalOrientation.Left);

            song.Formatting.TextOutlineEnabled = false;
            song.Formatting.TextShadowEnabled  = true;

            song.Formatting.TextBorders = new SongTextBorders(50, 40, 60, 70, 30, 20, 40);

            return(song);
        }
Esempio n. 12
0
        /// <summary>
        /// Function to convert GHS SongNumber to WLG/LQ SongNumbers and back
        /// </summary>
        /// <param name="songNumber">The SongNumber</param>
        /// <param name="strippedDown">Returns the Result wihout additional Text</param>
        /// <param name="choosenSongBook"></param>
        /// <returns>Tuple: String1=WLG/LQ SongNumber String2=SongBook</returns>
        public static Tuple <string, string> ConvertSong(string songNumber, bool strippedDown, SongBook choosenSongBook)
        {
            try
            {
                int songNumberInt;
                int.TryParse(songNumber, out songNumberInt);

                if (songNumberInt > 694)
                {
                    MessageBox.Show(songNumber + " ist keine gültige Liednummer", "Fehler!", MessageBoxButton.OK,
                                    MessageBoxImage.Exclamation);
                    return(new Tuple <string, string>("big", ""));
                }


                object result   = "";
                string songBook = "";

                var database =
                    new SQLiteConnection("Data Source=songs.db;Version=3;");
                database.Open();

                var cmdGhsWlg = "SELECT wlg FROM wlg WHERE ghs=\"" + songNumber + "\";";
                var cmdGhsLq  = "SELECT lq FROM lq WHERE ghs=\"" + songNumber + "\";";
                var cmdWlgGhs = "SELECT ghs FROM wlg WHERE wlg=\"" + songNumber + "\";";
                var cmdLqGhs  = "SELECT ghs FROM lq WHERE lq=\"" + songNumber + "\";";


                switch (choosenSongBook)
                {
                case SongBook.Ghs:
                    SQLiteCommand    commandGhsWlg = new SQLiteCommand(cmdGhsWlg, database);
                    SQLiteDataReader readerGhsWlg  = commandGhsWlg.ExecuteReader();
                    while (readerGhsWlg.Read())
                    {
                        songBook = "WLG";
                        if (strippedDown)
                        {
                            result = readerGhsWlg["wlg"];
                        }
                        else
                        {
                            result = "WLG: " + readerGhsWlg["wlg"];
                        }
                    }


                    if (String.IsNullOrEmpty(result.ToString()))
                    {
                        SQLiteCommand    commandGhsLq = new SQLiteCommand(cmdGhsLq, database);
                        SQLiteDataReader readerGhsLq  = commandGhsLq.ExecuteReader();
                        while (readerGhsLq.Read())
                        {
                            songBook = "LQ";
                            if (strippedDown)
                            {
                                result = readerGhsLq["lq"];
                            }
                            else
                            {
                                result = "LQ: " + readerGhsLq["lq"];
                            }
                        }
                    }

                    break;

                case SongBook.Wlg:
                    SQLiteCommand    commandWlgGhs = new SQLiteCommand(cmdWlgGhs, database);
                    SQLiteDataReader readerWlgGhs  = commandWlgGhs.ExecuteReader();

                    while (readerWlgGhs.Read())
                    {
                        songBook = "WLG";
                        if (strippedDown)
                        {
                            result = readerWlgGhs["ghs"];
                        }
                        else
                        {
                            result = "GHS: " + readerWlgGhs["ghs"];
                        }
                    }

                    break;

                case SongBook.Lq:
                    SQLiteCommand    commandLqGhs = new SQLiteCommand(cmdLqGhs, database);
                    SQLiteDataReader readerLqGhs  = commandLqGhs.ExecuteReader();

                    while (readerLqGhs.Read())
                    {
                        songBook = "WLG";
                        if (strippedDown)
                        {
                            result = readerLqGhs["ghs"];
                        }
                        else
                        {
                            result = "GHS: " + readerLqGhs["ghs"];
                        }
                    }

                    break;
                }


                if (String.IsNullOrEmpty(result.ToString()))
                {
                    result = strippedDown ? "" : "Lied nicht in der Liste";
                }

                return(new Tuple <string, string>(result.ToString(), songBook));
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
                throw;
            }
        }
Esempio n. 13
0
 protected bool Equals(SongBook other)
 {
     return(string.Equals(Name, other.Name) && string.Equals(Entry, other.Entry));
 }
Esempio n. 14
0
 public InternalTarget(SongBook book) : base(1, false, TargetFlags.None)
 {
     Book = book;
 }
Esempio n. 15
0
        public SongBookGump(Mobile from, SongBook book, int page) : base(0, 0)
        {
            m_Book = book;
            AddBackground();
            this.Closable   = true;
            this.Disposable = false;
            this.Dragable   = true;
            this.Resizable  = false;

            int PriorPage = page - 1;

            if (PriorPage < 1)
            {
                PriorPage = 17;
            }
            int NextPage = page + 1;

            AddButton(97, 59, 2205, 2205, PriorPage, GumpButtonType.Reply, 0);
            AddButton(368, 58, 2206, 2206, NextPage, GumpButtonType.Reply, 0);

            if (page == 1)
            {
                AddHtml(281, 68, 97, 19, @"<BASEFONT Color=#363329><BIG>Instrument</BIG></BASEFONT>", (bool)false, (bool)false);
                AddButton(264, 69, 55, 55, 99, GumpButtonType.Reply, 0);

                AddHtml(122, 64, 97, 36, @"<BASEFONT Color=#363329><BIG><CENTER>Bardic<br>Songs</CENTER></BIG></BASEFONT>", (bool)false, (bool)false);

                int lcbt = 108;
                int lcpg = 103;

                if (HasSpell(from, 351))
                {
                    AddButton(lcpg, lcbt, 9762, 9762, 351, GumpButtonType.Reply, 0);
                    AddLabel(lcpg + 20, lcbt - 2, gth, @"Army's Paeon");
                    lcbt = lcbt + 18; if (lcbt > 234)
                    {
                        lcbt = 108; lcpg = 258;
                    }
                }
                if (HasSpell(from, 352))
                {
                    AddButton(lcpg, lcbt, 9762, 9762, 352, GumpButtonType.Reply, 0);
                    AddLabel(lcpg + 20, lcbt - 2, gth, @"Enchanting Etude");
                    lcbt = lcbt + 18; if (lcbt > 234)
                    {
                        lcbt = 108; lcpg = 258;
                    }
                }
                if (HasSpell(from, 353))
                {
                    AddButton(lcpg, lcbt, 9762, 9762, 353, GumpButtonType.Reply, 0);
                    AddLabel(lcpg + 20, lcbt - 2, gth, @"Energy Carol");
                    lcbt = lcbt + 18; if (lcbt > 234)
                    {
                        lcbt = 108; lcpg = 258;
                    }
                }
                if (HasSpell(from, 354))
                {
                    AddButton(lcpg, lcbt, 9762, 9762, 354, GumpButtonType.Reply, 0);
                    AddLabel(lcpg + 20, lcbt - 2, gth, @"Energy Threnody");
                    lcbt = lcbt + 18; if (lcbt > 234)
                    {
                        lcbt = 108; lcpg = 258;
                    }
                }
                if (HasSpell(from, 355))
                {
                    AddButton(lcpg, lcbt, 9762, 9762, 355, GumpButtonType.Reply, 0);
                    AddLabel(lcpg + 20, lcbt - 2, gth, @"Fire Carol");
                    lcbt = lcbt + 18; if (lcbt > 234)
                    {
                        lcbt = 108; lcpg = 258;
                    }
                }
                if (HasSpell(from, 356))
                {
                    AddButton(lcpg, lcbt, 9762, 9762, 356, GumpButtonType.Reply, 0);
                    AddLabel(lcpg + 20, lcbt - 2, gth, @"Fire Threnody");
                    lcbt = lcbt + 18; if (lcbt > 234)
                    {
                        lcbt = 108; lcpg = 258;
                    }
                }
                if (HasSpell(from, 357))
                {
                    AddButton(lcpg, lcbt, 9762, 9762, 357, GumpButtonType.Reply, 0);
                    AddLabel(lcpg + 20, lcbt - 2, gth, @"Foe Requiem");
                    lcbt = lcbt + 18; if (lcbt > 234)
                    {
                        lcbt = 108; lcpg = 258;
                    }
                }
                if (HasSpell(from, 358))
                {
                    AddButton(lcpg, lcbt, 9762, 9762, 358, GumpButtonType.Reply, 0);
                    AddLabel(lcpg + 20, lcbt - 2, gth, @"Ice Carol");
                    lcbt = lcbt + 18; if (lcbt > 234)
                    {
                        lcbt = 108; lcpg = 258;
                    }
                }
                if (HasSpell(from, 359))
                {
                    AddButton(lcpg, lcbt, 9762, 9762, 359, GumpButtonType.Reply, 0);
                    AddLabel(lcpg + 20, lcbt - 2, gth, @"Ice Threnody");
                    lcbt = lcbt + 18; if (lcbt > 234)
                    {
                        lcbt = 108; lcpg = 258;
                    }
                }
                if (HasSpell(from, 360))
                {
                    AddButton(lcpg, lcbt, 9762, 9762, 360, GumpButtonType.Reply, 0);
                    AddLabel(lcpg + 20, lcbt - 2, gth, @"Knight's Minne");
                    lcbt = lcbt + 18; if (lcbt > 234)
                    {
                        lcbt = 108; lcpg = 258;
                    }
                }
                if (HasSpell(from, 361))
                {
                    AddButton(lcpg, lcbt, 9762, 9762, 361, GumpButtonType.Reply, 0);
                    AddLabel(lcpg + 20, lcbt - 2, gth, @"Mage's Ballad");
                    lcbt = lcbt + 18; if (lcbt > 234)
                    {
                        lcbt = 108; lcpg = 258;
                    }
                }
                if (HasSpell(from, 362))
                {
                    AddButton(lcpg, lcbt, 9762, 9762, 362, GumpButtonType.Reply, 0);
                    AddLabel(lcpg + 20, lcbt - 2, gth, @"Magic Finale");
                    lcbt = lcbt + 18; if (lcbt > 234)
                    {
                        lcbt = 108; lcpg = 258;
                    }
                }
                if (HasSpell(from, 363))
                {
                    AddButton(lcpg, lcbt, 9762, 9762, 363, GumpButtonType.Reply, 0);
                    AddLabel(lcpg + 20, lcbt - 2, gth, @"Poison Carol");
                    lcbt = lcbt + 18; if (lcbt > 234)
                    {
                        lcbt = 108; lcpg = 258;
                    }
                }
                if (HasSpell(from, 364))
                {
                    AddButton(lcpg, lcbt, 9762, 9762, 364, GumpButtonType.Reply, 0);
                    AddLabel(lcpg + 20, lcbt - 2, gth, @"Poison Threnody");
                    lcbt = lcbt + 18; if (lcbt > 234)
                    {
                        lcbt = 108; lcpg = 258;
                    }
                }
                if (HasSpell(from, 365))
                {
                    AddButton(lcpg, lcbt, 9762, 9762, 365, GumpButtonType.Reply, 0);
                    AddLabel(lcpg + 20, lcbt - 2, gth, @"Shepherd's Dance");
                    lcbt = lcbt + 18; if (lcbt > 234)
                    {
                        lcbt = 108; lcpg = 258;
                    }
                }
                if (HasSpell(from, 366))
                {
                    AddButton(lcpg, lcbt, 9762, 9762, 366, GumpButtonType.Reply, 0);
                    AddLabel(lcpg + 20, lcbt - 2, gth, @"Sinewy Etude");
                    lcbt = lcbt + 18; if (lcbt > 234)
                    {
                        lcbt = 108; lcpg = 258;
                    }
                }
            }

            else if (page == 2)
            {
                AddHtml(105, 86, 133, 163, @"<BASEFONT Color=#363329><BIG>Army's Paeon<br><br>An area of effect that regenerates your party's health slowly.</BIG></BASEFONT>", (bool)false, (bool)false);
                AddHtml(262, 89, 132, 120, @"<BASEFONT Color=#363329><BIG>Skill: 55<br><br>Mana: 15<br><br>[ArmysPaeon</BIG></BASEFONT>", (bool)false, (bool)false);
                AddImage(308, 197, 0x404);
            }
            else if (page == 3)
            {
                AddHtml(105, 86, 133, 163, @"<BASEFONT Color=#363329><BIG>Enchanting Etude<br><br>An area of effect that raises the intelligence of your party.</BIG></BASEFONT>", (bool)false, (bool)false);
                AddHtml(262, 89, 132, 120, @"<BASEFONT Color=#363329><BIG>Skill: 60<br><br>Mana: 20<br><br>[EnchantingEtude</BIG></BASEFONT>", (bool)false, (bool)false);
                AddImage(308, 197, 0x405);
            }
            else if (page == 4)
            {
                AddHtml(105, 86, 133, 163, @"<BASEFONT Color=#363329><BIG>Energy Carol<br><br>An area of effect that raises the energy resistance of your party.</BIG></BASEFONT>", (bool)false, (bool)false);
                AddHtml(262, 89, 132, 120, @"<BASEFONT Color=#363329><BIG>Skill: 50<br><br>Mana: 12<br><br>[EnergyCarol</BIG></BASEFONT>", (bool)false, (bool)false);
                AddImage(308, 197, 0x406);
            }
            else if (page == 5)
            {
                AddHtml(105, 86, 133, 163, @"<BASEFONT Color=#363329><BIG>Energy Threnody<br><br>Lowers the energy resistance of your target.</BIG></BASEFONT>", (bool)false, (bool)false);
                AddHtml(262, 89, 132, 120, @"<BASEFONT Color=#363329><BIG>Skill: 70<br><br>Mana: 25<br><br>[EnergyThrenody</BIG></BASEFONT>", (bool)false, (bool)false);
                AddImage(308, 197, 0x407);
            }
            else if (page == 6)
            {
                AddHtml(105, 86, 133, 163, @"<BASEFONT Color=#363329><BIG>Fire Carol<br><br>An area of effect that raises the fire resistance of your party.</BIG></BASEFONT>", (bool)false, (bool)false);
                AddHtml(262, 89, 132, 120, @"<BASEFONT Color=#363329><BIG>Skill: 50<br><br>Mana: 12<br><br>[FireCarol</BIG></BASEFONT>", (bool)false, (bool)false);
                AddImage(308, 197, 0x408);
            }
            else if (page == 7)
            {
                AddHtml(105, 86, 133, 163, @"<BASEFONT Color=#363329><BIG>Fire Threnody<br><br>Lowers the fire resistance of your target.</BIG></BASEFONT>", (bool)false, (bool)false);
                AddHtml(262, 89, 132, 120, @"<BASEFONT Color=#363329><BIG>Skill: 70<br><br>Mana: 25<br><br>[FireThrenody</BIG></BASEFONT>", (bool)false, (bool)false);
                AddImage(308, 197, 0x409);
            }
            else if (page == 8)
            {
                AddHtml(105, 86, 133, 163, @"<BASEFONT Color=#363329><BIG>Foe Requiem<br><br>Damages your target with a burst of sonic energy.</BIG></BASEFONT>", (bool)false, (bool)false);
                AddHtml(262, 89, 132, 120, @"<BASEFONT Color=#363329><BIG>Skill: 80<br><br>Mana: 30<br><br>[FoeRequiem</BIG></BASEFONT>", (bool)false, (bool)false);
                AddImage(308, 197, 0x40A);
            }
            else if (page == 9)
            {
                AddHtml(105, 86, 133, 163, @"<BASEFONT Color=#363329><BIG>Ice Carol<br><br>An area of effect that raises the cold resistance of your party.</BIG></BASEFONT>", (bool)false, (bool)false);
                AddHtml(262, 89, 132, 120, @"<BASEFONT Color=#363329><BIG>Skill: 50<br><br>Mana: 12<br><br>[IceCarol</BIG></BASEFONT>", (bool)false, (bool)false);
                AddImage(308, 197, 0x40B);
            }
            else if (page == 10)
            {
                AddHtml(105, 86, 133, 163, @"<BASEFONT Color=#363329><BIG>Ice Threnody<br><br>Lowers the ice resistance of your target.</BIG></BASEFONT>", (bool)false, (bool)false);
                AddHtml(262, 89, 132, 120, @"<BASEFONT Color=#363329><BIG>Skill: 70<br><br>Mana: 25<br><br>[IceThrenody</BIG></BASEFONT>", (bool)false, (bool)false);
                AddImage(308, 197, 0x40C);
            }
            else if (page == 11)
            {
                AddHtml(105, 86, 133, 163, @"<BASEFONT Color=#363329><BIG>Knight's Minne<br><br>An area of effect that raises the physical resist of your party.</BIG></BASEFONT>", (bool)false, (bool)false);
                AddHtml(262, 89, 132, 120, @"<BASEFONT Color=#363329><BIG>Skill: 50<br><br>Mana: 12<br><br>[KnightsMinne</BIG></BASEFONT>", (bool)false, (bool)false);
                AddImage(308, 197, 0x40D);
            }
            else if (page == 12)
            {
                AddHtml(105, 86, 133, 163, @"<BASEFONT Color=#363329><BIG>Mage's Ballad<br><br>An area of effect that regenerates your party's mana slowly.</BIG></BASEFONT>", (bool)false, (bool)false);
                AddHtml(262, 89, 132, 120, @"<BASEFONT Color=#363329><BIG>Skill: 55<br><br>Mana: 15<br><br>[MagesBallad</BIG></BASEFONT>", (bool)false, (bool)false);
                AddImage(308, 197, 0x40E);
            }
            else if (page == 13)
            {
                AddHtml(105, 86, 133, 163, @"<BASEFONT Color=#363329><BIG>Magic Finale<br><br>An area of effect that dispels all summoned creatures around you.</BIG></BASEFONT>", (bool)false, (bool)false);
                AddHtml(262, 89, 132, 120, @"<BASEFONT Color=#363329><BIG>Skill: 90<br><br>Mana: 35<br><br>[MagicFinale</BIG></BASEFONT>", (bool)false, (bool)false);
                AddImage(308, 197, 0x410);
            }
            else if (page == 14)
            {
                AddHtml(105, 86, 133, 163, @"<BASEFONT Color=#363329><BIG>Poison Carol<br><br>An area of effect that raises the poison resistance of your party.</BIG></BASEFONT>", (bool)false, (bool)false);
                AddHtml(262, 89, 132, 120, @"<BASEFONT Color=#363329><BIG>Skill: 50<br><br>Mana: 12<br><br>[PoisonCarol</BIG></BASEFONT>", (bool)false, (bool)false);
                AddImage(308, 197, 0x411);
            }
            else if (page == 15)
            {
                AddHtml(105, 86, 133, 163, @"<BASEFONT Color=#363329><BIG>Poison Threnody<br><br>Lowers the poison resistance of your target.</BIG></BASEFONT>", (bool)false, (bool)false);
                AddHtml(262, 89, 132, 120, @"<BASEFONT Color=#363329><BIG>Skill: 70<br><br>Mana: 25<br><br>[PoisonThrenody</BIG></BASEFONT>", (bool)false, (bool)false);
                AddImage(308, 197, 0x412);
            }
            else if (page == 16)
            {
                AddHtml(105, 86, 133, 163, @"<BASEFONT Color=#363329><BIG>Shepherd's Dance<br><br>An area of effect that raises the dexterity of your party.</BIG></BASEFONT>", (bool)false, (bool)false);
                AddHtml(262, 89, 132, 120, @"<BASEFONT Color=#363329><BIG>Skill: 60<br><br>Mana: 20<br><br>[ShephardsDance</BIG></BASEFONT>", (bool)false, (bool)false);
                AddImage(308, 197, 0x413);
            }
            else if (page == 17)
            {
                AddHtml(105, 86, 133, 163, @"<BASEFONT Color=#363329><BIG>Sinewy Etude<br><br>An area of effect that raises the strength of your party.</BIG></BASEFONT>", (bool)false, (bool)false);
                AddHtml(262, 89, 132, 120, @"<BASEFONT Color=#363329><BIG>Skill: 60<br><br>Mana: 20<br><br>[SinewyEtude</BIG></BASEFONT>", (bool)false, (bool)false);
                AddImage(308, 197, 0x414);
            }
        }