Example #1
0
        public static void MultiPlay_OnCommand(CommandEventArgs e)
        {
            Harp    inst1 = new Harp();
            Lute    inst2 = new Lute();
            LapHarp inst3 = new LapHarp();

            if (PlayChord(e.Mobile, e.Arguments, false, inst1, inst2, inst3))
            {
                inst1.Delete();
                inst2.Delete();
                inst3.Delete();
            }
        }
Example #2
0
        public static void PlayLapHarpMinor_OnCommand(CommandEventArgs e)
        {
            LapHarp inst1 = new LapHarp();
            LapHarp inst2 = new LapHarp();
            LapHarp inst3 = new LapHarp();

            if (PlayChord(e.Mobile, e.Arguments, true, inst1, inst2, inst3))
            {
                inst1.Delete();
                inst2.Delete();
                inst3.Delete();
            }
        }
Example #3
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            from.CloseGump(typeof(SynthGump));

            InstrumentType inst = InstrumentType.Harp;

            if (info.IsSwitched((int)Buttons.RB2_LapHarp))
            {
                inst = InstrumentType.LapHarp;
            }
            if (info.IsSwitched((int)Buttons.RB3_Lute))
            {
                inst = InstrumentType.Lute;
            }
            if (info.IsSwitched((int)Buttons.RB4_Drums))
            {
                inst = InstrumentType.Drums;
            }

            try { m_Name = info.TextEntries[0].Text.Trim(); }
            catch { m_Name = "Untitled"; }

            if (info.ButtonID > 100)
            {
                m_Page = info.ButtonID - 100;
                from.SendGump(new SynthGump(m_From, m_Page, (int)inst, m_Music, m_Keys, m_Recording, m_FileOptions, m_Chords, m_Mixer, m_Song, m_Name, m_MusicTracks));
            }
            else if (info.ButtonID >= (int)Buttons.Track1 && info.ButtonID <= (int)Buttons.Track8)
            {
                EditTrack(from);
                from.SendGump(new SynthGump(m_From, m_Page, (int)inst, m_Music, m_Keys, m_Recording, m_FileOptions, m_Chords, m_Mixer, m_Song, m_Name, m_MusicTracks));
            }
            else if (info.ButtonID >= (int)Buttons.PlayTrack1 && info.ButtonID <= (int)Buttons.PlayTrack8)
            {
                int track = info.ButtonID - (int)Buttons.PlayTrack1 + 1;
                m_Mixer[track] = !m_Mixer[track];
                from.SendGump(new SynthGump(m_From, m_Page, (int)inst, m_Music, m_Keys, m_Recording, m_FileOptions, m_Chords, m_Mixer, m_Song, m_Name, m_MusicTracks));
            }
            else if (info.ButtonID == (int)Buttons.PlayTracks)
            {
                Container             pack        = m_From.Backpack;
                List <BaseInstrument> instruments = new List <BaseInstrument>();
                List <XmlMusic>       mxm         = new List <XmlMusic>();
                if (pack == null || pack.Deleted || pack.Items.Count == 0)
                {
                    from.SendMessage("Your pack is missing or empty!");
                }
                else
                {
                    foreach (Item i in pack.Items)
                    {
                        if (i is BaseInstrument)
                        {
                            instruments.Add(i as BaseInstrument);
                        }
                    }
                    if (instruments.Count > 0)
                    {
                        XmlMusic findxm = null;
                        for (int x = 0; x < instruments.Count; x++)
                        {
                            if (!m_Mixer[x + 1])
                            {
                                from.SendMessage("Skipping Track {0}", (int)(x + 1));
                                continue;
                            }
                            findxm = (XmlMusic)XmlAttach.FindAttachment(instruments[x], typeof(XmlMusic));
                            if (findxm != null)
                            {
                                try
                                {
                                    mxm.Add(findxm);
                                }
                                catch { }
                            }
                            else
                            {
                                from.SendMessage("XmlMusic was null on the {0}", instruments[x].GetType().Name);
                            }
                        }
                    }
                    if (mxm.Count > 0)
                    {
                        Mix.PlayTracks(from, mxm);
                    }
                    else
                    {
                        from.SendMessage("xmx.Count was 0.");
                    }
                }
            }
            else
            {
                switch (info.ButtonID)
                {
                case (int)Buttons.Quit:
                    break;

                case (int)Buttons.ShowKeys:
                    from.SendGump(new SynthGump(m_From, m_Page, (int)inst, m_Music, !m_Keys, m_Recording, m_FileOptions, m_Chords, m_Mixer, m_Song, m_Name, m_MusicTracks));
                    break;

                case (int)Buttons.ShowMusic:
                    from.SendGump(new SynthGump(m_From, m_Page, (int)inst, !m_Music, m_Keys, m_Recording, m_FileOptions, m_Chords, m_Mixer, m_Song, m_Name, m_MusicTracks));
                    break;

                case (int)Buttons.ShowChords:
                {
                    m_Chords = !m_Chords;
                    from.SendGump(new SynthGump(m_From, m_Page, (int)inst, m_Music, m_Keys, m_Recording, m_FileOptions, m_Chords, m_Mixer, m_Song, m_Name, m_MusicTracks));
                    break;
                }

                case (int)Buttons.ShowMixer:
                {
                    m_Mixer[0] = !m_Mixer[0];
                    from.SendGump(new SynthGump(m_From, m_Page, (int)inst, m_Music, m_Keys, m_Recording, m_FileOptions, m_Chords, m_Mixer, m_Song, m_Name, m_MusicTracks));
                    break;
                }

                case (int)Buttons.StartRecording:
                {
                    if (m_Recording)
                    {
                        from.SendGump(new SynthGump(m_From, m_Page, (int)inst, m_Music, m_Keys, m_Recording, m_FileOptions, m_Chords, m_Mixer, m_Song, m_Name, m_MusicTracks));
                    }
                    else
                    {
                        m_Song = new List <string>();
                        m_Song.Add("norm");
                        from.SendGump(new SynthGump(m_From, m_Page, (int)inst, m_Music, m_Keys, true, m_FileOptions, m_Chords, m_Mixer, m_Song, m_Name, m_MusicTracks));
                    }
                    break;
                }

                case (int)Buttons.StopRecording:
                {
                    if (!m_Recording)
                    {
                        from.SendGump(new SynthGump(m_From, m_Page, (int)inst, m_Music, m_Keys, m_Recording, m_FileOptions, m_Chords, m_Mixer, m_Song, m_Name, m_MusicTracks));
                    }
                    else
                    {
                        List <string> tempSong = new List <string>(m_Song);
                        string        speed    = tempSong[0];
                        tempSong.RemoveAt(0);
                        string[] newSong = tempSong.ToArray();
                        Play.Play_OnCommand(new CommandEventArgs(from, "Play", speed, newSong));
                        from.SendGump(new SynthGump(m_From, m_Page, (int)inst, m_Music, m_Keys, !m_Recording, m_FileOptions, m_Chords, m_Mixer, m_Song, m_Name, m_MusicTracks));
                    }
                    break;
                }

                case (int)Buttons.FileOptions: from.SendGump(new SynthGump(m_From, m_Page, (int)inst, m_Music, m_Keys, m_Recording, !m_FileOptions, m_Chords, m_Mixer, m_Song, m_Name, m_MusicTracks)); break;

                case (int)Buttons.Play:
                {
                    List <string> tempSong = new List <string>(m_Song);
                    string        speed    = tempSong[0];
                    tempSong.RemoveAt(0);
                    string[] newSong = tempSong.ToArray();
                    Play.Play_OnCommand(new CommandEventArgs(from, "Play", speed, newSong));
                    from.SendGump(new SynthGump(m_From, m_Page, (int)inst, m_Music, m_Keys, m_Recording, m_FileOptions, m_Chords, m_Mixer, m_Song, m_Name, m_MusicTracks));
                    break;
                }

                case (int)Buttons.Save:
                {
                    SaveSong(from, m_Name, m_Song);
                    from.SendGump(new SynthGump(m_From, m_Page, (int)inst, m_Music, m_Keys, m_Recording, m_FileOptions, m_Chords, m_Mixer, m_Song, m_Name, m_MusicTracks));
                    break;
                }

                case (int)Buttons.Load:
                {
                    m_Song = LoadSong(from, m_Name);
                    from.SendGump(new SynthGump(m_From, m_Page, (int)inst, m_Music, m_Keys, m_Recording, m_FileOptions, m_Chords, m_Mixer, m_Song, m_Name, m_MusicTracks));
                    break;
                }

                case (int)Buttons.Fast:
                {
                    if (m_Song.Count == 0)
                    {
                        m_Song.Add("fast");
                    }
                    else if (m_Song[0] == "fast")
                    {
                        m_Song[0] = "veryfast";
                    }
                    else if (m_Song[0] == "norm")
                    {
                        m_Song[0] = "fast";
                    }
                    else if (m_Song[0] == "slow")
                    {
                        m_Song[0] = "norm";
                    }
                    else if (m_Song[0] == "veryslow")
                    {
                        m_Song[0] = "slow";
                    }
                    from.SendGump(new SynthGump(m_From, m_Page, (int)inst, m_Music, m_Keys, m_Recording, m_FileOptions, m_Chords, m_Mixer, m_Song, m_Name, m_MusicTracks));
                    break;
                }

                case (int)Buttons.Slow:
                {
                    if (m_Song.Count == 0)
                    {
                        m_Song.Add("slow");
                    }
                    else if (m_Song[0] == "slow")
                    {
                        m_Song[0] = "veryslow";
                    }
                    else if (m_Song[0] == "norm")
                    {
                        m_Song[0] = "slow";
                    }
                    else if (m_Song[0] == "fast")
                    {
                        m_Song[0] = "norm";
                    }
                    else if (m_Song[0] == "veryfast")
                    {
                        m_Song[0] = "fast";
                    }
                    from.SendGump(new SynthGump(m_From, m_Page, (int)inst, m_Music, m_Keys, m_Recording, m_FileOptions, m_Chords, m_Mixer, m_Song, m_Name, m_MusicTracks));
                    break;
                }

                default:
                {
                    try
                    {
                        if (m_Song.Count == 0)
                        {
                            m_Song.Add("norm");
                        }
                        if (m_Chords && info.ButtonID < (int)Buttons.n13_c)
                        {
                            switch ((InstrumentType)inst)
                            {
                            case InstrumentType.Harp:
                            {
                                Harp inst1 = new Harp();
                                Harp inst2 = new Harp();
                                Harp inst3 = new Harp();
                                if (Play.PlayChord(from, new string[] { GetNoteString((NoteValue)(info.ButtonID - 1)) }, true, inst1, inst2, inst3))
                                {
                                    inst1.Delete();
                                    inst2.Delete();
                                    inst3.Delete();
                                }
                                break;
                            }

                            case InstrumentType.Lute:
                            {
                                Lute inst1 = new Lute();
                                Lute inst2 = new Lute();
                                Lute inst3 = new Lute();
                                if (Play.PlayChord(from, new string[] { GetNoteString((NoteValue)(info.ButtonID - 1)) }, true, inst1, inst2, inst3))
                                {
                                    inst1.Delete();
                                    inst2.Delete();
                                    inst3.Delete();
                                }
                                break;
                            }

                            case InstrumentType.LapHarp:
                            {
                                LapHarp inst1 = new LapHarp();
                                LapHarp inst2 = new LapHarp();
                                LapHarp inst3 = new LapHarp();
                                if (Play.PlayChord(from, new string[] { GetNoteString((NoteValue)(info.ButtonID - 1)) }, true, inst1, inst2, inst3))
                                {
                                    inst1.Delete();
                                    inst2.Delete();
                                    inst3.Delete();
                                }
                                break;
                            }

                            case InstrumentType.Drums: break;
                            }
                        }
                        else
                        {
                            NoteValue nv = (NoteValue)(info.ButtonID - 1);

                            Music.PlayNote(from, (int)nv, inst);
                            if (m_Recording)
                            {
                                m_Song.Add(GetNoteString(nv));
                                //from.SendMessage("Note added to song: #: {0}, string: {1}", nv, GetNoteString(nv));
                            }
                        }
                    }
                    catch { }
                    from.SendGump(new SynthGump(m_From, m_Page, (int)inst, m_Music, m_Keys, m_Recording, m_FileOptions, m_Chords, m_Mixer, m_Song, m_Name, m_MusicTracks));
                    break;
                }
                }
            }
        }
Example #4
0
        private void Process(Mobile from)
        {
            Item rewardItem;

            switch (m_Skill.SkillID)
            {
            case 0:                     // alchemy
                rewardItem = new MortarPestle();
                break;

            case 7:                     // Blacksmithy
                rewardItem = new GMSmithHammer();
                break;

            case 8:                     // Bowcraft/fletching
                rewardItem = new Bow();
                break;

            case 11:                     // Carpentry
                switch (m_Itemid)
                {
                case 4138:
                    rewardItem = new Hammer();
                    break;

                case 4148:
                    rewardItem = new Saw();
                    break;

                case 4146:
                    rewardItem = new SmoothingPlane();
                    break;

                case 4325:
                    rewardItem = new Froe();
                    break;

                case 4326:
                    rewardItem = new Inshave();
                    break;

                case 4324:
                    rewardItem = new DrawKnife();
                    break;

                default:
                    return;
                }
                break;

            case 23:                     // Inscription
                rewardItem = new ScribesPen();
                break;

            case 25:                     // Magery
                rewardItem = new Spellbook();
                (rewardItem as Spellbook).Content  = ulong.MaxValue;
                (rewardItem as Spellbook).LootType = LootType.Blessed;
                break;

            case 34:                     // Tailoring
                rewardItem = new RewardDyeTub();
                break;

            case 35:                     // Animal Taming
                rewardItem = new ShepherdsCrook();
                break;

            case 44:     //Lumberjacking
                rewardItem = new Hatchet();
                break;

            case 45:     // Mining
                rewardItem = new Pickaxe();
                break;

            //Bardic skills
            case 9:
            case 15:
            case 22:
            case 29:
                switch (m_Itemid)
                {
                case 3740:
                    rewardItem = new Drums();
                    break;

                case 3761:
                    rewardItem = new Harp();
                    break;

                case 3762:
                    rewardItem = new LapHarp();
                    break;

                case 3763:
                    rewardItem = new Lute();
                    break;

                case 3741:
                    rewardItem = new Tambourine();
                    break;

                case 3742:
                    rewardItem = new TambourineTassel();
                    break;

                default:
                    return;
                }
                break;

            //"Thieving" skills
            case 21:
            case 28:
            case 33:
            case 47:
                rewardItem = new Cloak();
                break;

            default:
                return;
            }

            rewardItem.Hue      = m_CurrentHue;
            rewardItem.LootType = LootType.Blessed;

            if (m_Name != "")
            {
                rewardItem.Name = m_Name;
            }

            if (rewardItem is RewardDyeTub)
            {
                var tub = (RewardDyeTub)rewardItem;
                tub.DyedHue  = rewardItem.Hue;
                tub.Redyable = false;
                tub.LootType = LootType.Blessed;
                tub.Owner    = from;
            }
            else if (rewardItem is GMSmithHammer)
            {
                var hammer = (GMSmithHammer)rewardItem;
                hammer.Owner = from;
            }

            from.AddToBackpack(rewardItem);

            // Log
            RewardLogging.WriteLine(from, m_Skill, m_Name, m_CurrentHue);
        }