Ejemplo n.º 1
0
        public void CheckCode()
        {
            bool incomplete = false;

            int correct_souls = 0;

            for (int i = 0; i < m_Pads.Count; i++)
            {
                PuzzlePad pad = m_Pads[i] as PuzzlePad;

                if (pad == null || !pad.Busy)
                {
                    incomplete = true;
                }
            }

            correct_souls = CompareCodes(m_PuzzleCode, m_Code);

            if (incomplete)
            {
                SayStatues(1050004, -1);                   // The circle is the key, the key is incomplete and so the gate remains closed.
            }
            else
            {
                // we don't guess code
                if (correct_souls >= 0 && correct_souls < 4)
                {
                    ArrayList players = new ArrayList();

                    for (int i = 0; i < m_Pads.Count; i++)
                    {
                        PuzzlePad pad = m_Pads[i] as PuzzlePad;

                        if (pad != null && pad.Stander != null && pad.Stander.Alive)
                        {
                            players.Add(pad.Stander);
                        }
                    }

                    for (int j = 0; j < players.Count; j++)
                    {
                        PlayerMobile player = players[j] as PlayerMobile;

                        if (player != null)
                        {
                            Point3D location1 = player.Location;
                            location1.Z = 49;

                            Point3D location2 = player.Location;
                            location2.Z = -1;

                            Effects.SendPacket(player, player.Map, new HuedEffect(EffectType.Moving, Serial.Zero, player.Serial, 0x11B7, location1, location2, 20, 0, true, true, 0, 0));

                            Effects.PlaySound(new Point3D(324, 64, -1), Map.Malas, 0x144);

                            Effects.PlaySound(new Point3D(player.X, player.Y, -1), Map.Malas, Utility.RandomList(0x154, 0x14B));

                            player.Send(new AsciiMessage(Serial.MinusOne, 0xFFFF, MessageType.Label, 0x66D, 3, "", "You are pinned down by the weight of the boulder!!!"));
                        }
                    }

                    switch (correct_souls)
                    {
                    case 0:
                        SayStatues(1050009, correct_souls);
                        break;                                 // The circle of souls has failed to turn the key.  The gate remains closed...

                    case 1:
                        SayStatues(1050007, correct_souls);
                        break;                                 // ~1_NUM~ soul has turned the key correctly, but the rest have forsaken the circle...

                    default:
                        SayStatues(1050008, correct_souls);
                        break;                                 // ~1_NUM~ souls have turned the key correctly, but the rest have forsaken the circle...
                    }

                    for (int j = 0; j < players.Count; j++)
                    {
                        PlayerMobile player = players[j] as PlayerMobile;

                        if (player != null)
                        {
                            Effects.SendPacket(player, player.Map, new GraphicalEffect(EffectType.FixedXYZ, Serial.Zero, Serial.Zero, 0x36BD, new Point3D(player.X, player.Y, 0), new Point3D(player.X, player.Y, 0), 20, 10, true, false));

                            Effects.SendPacket(player, player.Map, new GraphicalEffect(EffectType.FixedFrom, player.Serial, Serial.Zero, 0x36BD, new Point3D(player.X, player.Y, -1), new Point3D(player.X, player.Y, -1), 20, 10, true, false));

                            Effects.PlaySound(new Point3D(player.X, player.Y, -1), player.Map, 0x307);

                            for (int k = 0; k < 5; k++)
                            {
                                Effects.SendPacket(player, player.Map, new GraphicalEffect(EffectType.Moving, Serial.Zero, Serial.Zero, 0x1363 + Utility.Random(0, 11), new Point3D(player.X, player.Y, 0), new Point3D(player.X, player.Y, 0), 5, 0, false, false));

                                Effects.PlaySound(new Point3D(player.X, player.Y, -1), Map.Malas, 0x13F);

                                Effects.PlaySound(new Point3D(player.X, player.Y, -1), Map.Malas, 0x154);

                                player.Say("OUCH!");
                            }

                            player.Damage(90, null);

                            player.Send(new AsciiMessage(Serial.MinusOne, 0xFFFF, MessageType.Label, 0x66D, 3, "", "A speeding rock hits you in the head!"));

                            player.SendLocalizedMessage(502382);                               // You can move!
                        }
                    }
                }
                else
                {
                    // we done it!
                    PlayerMobile center = ((PuzzlePad)m_Pads[4]).Stander;

                    for (int i = 0; i < m_Pads.Count; i++)
                    {
                        PuzzlePad pad = m_Pads[i] as PuzzlePad;

                        if (pad != null && pad.Stander != null && pad.Stander.Alive)
                        {
                            Effects.SendPacket(pad.Stander, Map.Malas, new GraphicalEffect(EffectType.FixedXYZ, Serial.Zero, Serial.Zero, 0x1153, new Point3D(325, 64, -1), new Point3D(325, 64, -1), 1, 60, true, false));
                            Effects.SendPacket(pad.Stander, Map.Malas, new GraphicalEffect(EffectType.FixedXYZ, Serial.Zero, Serial.Zero, 0x1153, new Point3D(325, 64, -1), new Point3D(325, 64, -1), 1, 60, true, false));

                            Effects.PlaySound(new Point3D(325, 64, -1), Map.Malas, 0x244);

                            if (center != null)
                            {
                                Effects.SendPacket(pad.Stander, Map.Malas, new GraphicalEffect(EffectType.Lightning, center.Serial, Serial.Zero, 0x0, new Point3D(324, 64, -1), new Point3D(324, 64, -1), 0, 0, false, false));
                                Effects.SendPacket(pad.Stander, Map.Malas, new ParticleEffect(EffectType.FixedFrom, center.Serial, Serial.Zero, 0x0, new Point3D(324, 64, -1), new Point3D(324, 64, -1), 0, 0, false, false, 0, 0, 0x13A7, 0, 0, center.Serial, 3, 0));
                            }
                        }
                    }

                    if (center != null)
                    {
                        center.MoveToWorld(new Point3D(467, 96, -1), Map.Malas);

                        if (m_Timer != null)
                        {
                            m_Timer.Stop();
                        }

                        m_Timer = new PoisonTimer(this);

                        m_Timer.Start();

                        m_CanActive = false;

                        m_Box.CanSummon = true;
                    }
                }
            }

            FreeLevers();
        }
Ejemplo n.º 2
0
        public void Setup()
        {
            m_CanActive  = true;
            m_Code       = "";
            m_PuzzleCode = "";

            m_Levers  = new ArrayList();
            m_Statues = new ArrayList();
            m_Pads    = new ArrayList();

            PuzzleLever lever1 = new PuzzleLever(1);

            lever1.Controller = this;
            lever1.MoveToWorld(new Point3D(316, 64, 5), Map.Malas);
            m_Levers.Add(lever1);

            PuzzleLever lever2 = new PuzzleLever(2);

            lever2.Controller = this;
            lever2.MoveToWorld(new Point3D(323, 58, 5), Map.Malas);
            m_Levers.Add(lever2);

            PuzzleLever lever3 = new PuzzleLever(3);

            lever3.Controller = this;
            lever3.MoveToWorld(new Point3D(332, 63, 5), Map.Malas);
            m_Levers.Add(lever3);

            PuzzleLever lever4 = new PuzzleLever(4);

            lever4.Controller = this;
            lever4.MoveToWorld(new Point3D(323, 71, 5), Map.Malas);
            m_Levers.Add(lever4);

            PuzzleStatue statue1 = new PuzzleStatue(0x12D8);

            statue1.MoveToWorld(new Point3D(319, 70, 18), Map.Malas);
            m_Statues.Add(statue1);

            PuzzleStatue statue2 = new PuzzleStatue(0x12D9);

            statue2.MoveToWorld(new Point3D(329, 60, 18), Map.Malas);
            m_Statues.Add(statue2);

            PuzzlePad pad1 = new PuzzlePad();

            pad1.MoveToWorld(new Point3D(324, 58, -1), Map.Malas);
            pad1.Visible = false;
            m_Pads.Add(pad1);

            PuzzlePad pad2 = new PuzzlePad();

            pad2.MoveToWorld(new Point3D(332, 64, -1), Map.Malas);
            pad2.Visible = false;
            m_Pads.Add(pad2);

            PuzzlePad pad3 = new PuzzlePad();

            pad3.MoveToWorld(new Point3D(323, 72, -1), Map.Malas);
            pad3.Visible = false;
            m_Pads.Add(pad3);

            PuzzlePad pad4 = new PuzzlePad();

            pad4.MoveToWorld(new Point3D(316, 65, -1), Map.Malas);
            pad4.Visible = false;
            m_Pads.Add(pad4);

            PuzzlePad pad5 = new PuzzlePad();

            pad5.MoveToWorld(new Point3D(324, 64, -1), Map.Malas);
            m_Pads.Add(pad5);

            Teleporter teleporter1 = new Teleporter();

            teleporter1.MapDest   = Map.Malas;
            teleporter1.PointDest = new Point3D(353, 172, -1);
            teleporter1.MoveToWorld(new Point3D(468, 92, -1), Map.Malas);

            Teleporter teleporter2 = new Teleporter();

            teleporter2.MapDest   = Map.Malas;
            teleporter2.PointDest = new Point3D(353, 172, -1);
            teleporter2.MoveToWorld(new Point3D(469, 92, -1), Map.Malas);

            Teleporter teleporter3 = new Teleporter();

            teleporter3.MapDest   = Map.Malas;
            teleporter3.PointDest = new Point3D(353, 172, -1);
            teleporter3.MoveToWorld(new Point3D(470, 92, -1), Map.Malas);

            m_Box           = new PuzzleBox();
            m_Box.CanSummon = true;
            m_Box.MoveToWorld(new Point3D(469, 96, 6), Map.Malas);

            m_PuzzleCode = GenerateCode(m_PuzzleCode);
        }
Ejemplo n.º 3
0
        public void Setup()
        {
            m_CanActive = true;
            m_Code = "";
            m_PuzzleCode = "";

            m_Levers = new ArrayList();
            m_Statues = new ArrayList();
            m_Pads = new ArrayList();

            PuzzleLever lever1 = new PuzzleLever( 1 );
            lever1.Controller = this;
            lever1.MoveToWorld( new Point3D( 316, 64, 5 ), Map.Malas );
            m_Levers.Add( lever1 );

            PuzzleLever lever2 = new PuzzleLever( 2 );
            lever2.Controller = this;
            lever2.MoveToWorld( new Point3D( 323, 58, 5 ), Map.Malas );
            m_Levers.Add( lever2 );

            PuzzleLever lever3 = new PuzzleLever( 3 );
            lever3.Controller = this;
            lever3.MoveToWorld( new Point3D( 332, 63, 5 ), Map.Malas );
            m_Levers.Add( lever3 );

            PuzzleLever lever4 = new PuzzleLever( 4 );
            lever4.Controller = this;
            lever4.MoveToWorld( new Point3D( 323, 71, 5 ), Map.Malas );
            m_Levers.Add( lever4 );

            PuzzleStatue statue1 = new PuzzleStatue( 0x12D8 );
            statue1.MoveToWorld( new Point3D( 319, 70, 18 ), Map.Malas );
            m_Statues.Add( statue1 );

            PuzzleStatue statue2 = new PuzzleStatue( 0x12D9 );
            statue2.MoveToWorld( new Point3D( 329, 60, 18 ), Map.Malas );
            m_Statues.Add( statue2 );

            PuzzlePad pad1 = new PuzzlePad();
            pad1.MoveToWorld( new Point3D( 324, 58, -1 ), Map.Malas );
            pad1.Visible = false;
            m_Pads.Add( pad1 );

            PuzzlePad pad2 = new PuzzlePad();
            pad2.MoveToWorld( new Point3D( 332, 64, -1 ), Map.Malas );
            pad2.Visible = false;
            m_Pads.Add( pad2 );

            PuzzlePad pad3 = new PuzzlePad();
            pad3.MoveToWorld( new Point3D( 323, 72, -1 ), Map.Malas );
            pad3.Visible = false;
            m_Pads.Add( pad3 );

            PuzzlePad pad4 = new PuzzlePad();
            pad4.MoveToWorld( new Point3D( 316, 65, -1 ), Map.Malas );
            pad4.Visible = false;
            m_Pads.Add( pad4 );

            PuzzlePad pad5 = new PuzzlePad();
            pad5.MoveToWorld( new Point3D( 324, 64, -1 ), Map.Malas );
            m_Pads.Add( pad5 );

            Teleporter teleporter1 = new Teleporter();
            teleporter1.MapDest = Map.Malas;
            teleporter1.PointDest = new Point3D( 353, 172, -1 );
            teleporter1.MoveToWorld( new Point3D( 468, 92, -1 ), Map.Malas );

            Teleporter teleporter2 = new Teleporter();
            teleporter2.MapDest = Map.Malas;
            teleporter2.PointDest = new Point3D( 353, 172, -1 );
            teleporter2.MoveToWorld( new Point3D( 469, 92, -1 ), Map.Malas );

            Teleporter teleporter3 = new Teleporter();
            teleporter3.MapDest = Map.Malas;
            teleporter3.PointDest = new Point3D( 353, 172, -1 );
            teleporter3.MoveToWorld( new Point3D( 470, 92, -1 ), Map.Malas );

            m_Box = new PuzzleBox();
            m_Box.CanSummon = true;
            m_Box.MoveToWorld( new Point3D( 469, 96, 6 ), Map.Malas );

            m_PuzzleCode = GenerateCode( m_PuzzleCode );
        }
 public InternalStandTimer(PuzzlePad pad) : base(TimeSpan.FromSeconds(0.25), TimeSpan.FromSeconds(0.25))
 {
     m_Pad    = pad;
     Priority = TimerPriority.FiftyMS;
 }
Ejemplo n.º 5
0
 public InternalStandTimer( PuzzlePad pad )
     : base(TimeSpan.FromSeconds( 0.25 ), TimeSpan.FromSeconds( 0.25 ))
 {
     m_Pad = pad;
 }
Ejemplo n.º 6
0
 public InternalStandTimer(PuzzlePad pad)
     : base(TimeSpan.FromSeconds(0.25), TimeSpan.FromSeconds(0.25))
 {
     m_Pad = pad;
 }
Ejemplo n.º 7
0
 public InternalStandTimer( PuzzlePad pad )
     : base(TimeSpan.FromSeconds( 0.25 ), TimeSpan.FromSeconds( 0.25 ))
 {
     m_Pad = pad;
     Priority = TimerPriority.FiftyMS;
 }