Ejemplo n.º 1
0
        public SherryTheMouse()
            : base("the Mouse")
        {
            LuteList = new List <Item>();

            NoteList = RandomNotes();

            Timer.DelayCall(TimeSpan.FromSeconds(5), () =>
            {
                SherryStrongBox b = new SherryStrongBox();
                Box = b;
                b.MoveToWorld(new Point3D(1347, 1642, 80), Map);

                for (int i = 0; i < LuteLocations.Length; i++)
                {
                    Point3D p = LuteLocations[i];

                    SherryLute sl = new SherryLute();
                    LuteList.Add(sl);
                    sl.Note       = NoteList[i].Note;
                    sl.Sound      = NoteList[i].Sound;
                    sl.Controller = this;

                    sl.MoveToWorld(p, Map);
                }
            });
        }
Ejemplo n.º 2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            reader.ReadInt();

            LuteList = new List <Item>();

            Box = (SherryStrongBox)reader.ReadItem();

            int lutecount = reader.ReadInt();

            for (int x = 0; x < lutecount; x++)
            {
                var l = reader.ReadItem();

                if (l != null)
                {
                    LuteList.Add(l);
                }
            }

            if (Map == Map.Trammel)
            {
                InstanceTram = this;
            }

            if (Map == Map.Felucca)
            {
                InstanceFel = this;
            }

            Timer.DelayCall(TimeSpan.FromSeconds(10), ChangeNotes);
        }
Ejemplo n.º 3
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InRange(GetWorldLocation(), 1))
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
            }
            else if (Controller != null)
            {
                PrivateOverheadMessage(MessageType.Regular, 0x47E, 1159341, from.NetState, Note); // *You strum the lute, it is tuned to ~1_NOTE~*

                if (Controller._List.ContainsKey(from))
                {
                    if (Controller._List.Any(x => x.Key == from && x.Value.Contains(Note)))
                    {
                        from.PlaySound(0x4C);
                        Controller._List.Remove(from);
                    }
                    else
                    {
                        var temp = Controller._List[from].ToList();
                        temp.Add(Note);

                        bool correct = false;

                        int i;

                        for (i = 0; i < temp.Count; i++)
                        {
                            if (temp[i] == Controller.Notes[i].Note)
                            {
                                correct = true;
                            }
                            else
                            {
                                correct = false;
                            }
                        }

                        if (correct)
                        {
                            Controller._List[from] = temp.ToArray();
                            from.PlaySound(Sound);
                        }
                        else
                        {
                            Controller._List.Remove(from);
                            from.PlaySound(0x4D);
                        }

                        if (i == 8)
                        {
                            from.PlaySound(511);
                            from.PrivateOverheadMessage(MessageType.Regular, 0x47E, 1159342, from.NetState); // *You hear a click as the chest in the corner unlocks!*
                            from.PlaySound(1048);
                            SherryStrongBox.AddPermission(from);
                            Controller._List.Remove(from);
                            Controller.ChangeNotes();
                        }
                    }
                }
                else if (Controller.Notes[0].Note == Note)
                {
                    Controller._List.Add(from, new[] { Note });
                    from.PlaySound(Sound);
                }
                else
                {
                    from.PlaySound(0x4D);
                }
            }
        }