Esempio n. 1
0
        public void Initialize()
        {
            tracks    = new int[8][];
            tracks[0] = new int[] { 14107, 182287, -3586, 12107, 182287, -3586 };
            tracks[1] = new int[] { 14107, 182229, -3586, 12107, 182229, -3586 };
            tracks[2] = new int[] { 14107, 182171, -3586, 12107, 182171, -3586 };
            tracks[3] = new int[] { 14107, 182113, -3586, 12107, 182113, -3586 };
            tracks[4] = new int[] { 14107, 182055, -3586, 12107, 182055, -3586 };
            tracks[5] = new int[] { 14107, 181997, -3586, 12107, 181997, -3586 };
            tracks[6] = new int[] { 14107, 181939, -3586, 12107, 181939, -3586 };
            tracks[7] = new int[] { 14107, 181881, -3586, 12107, 181881, -3586 };

            zoneLoc = new List <int[]>();
            zoneLoc.Add(new int[] { 11296, 181024, -3800, -3300 });
            zoneLoc.Add(new int[] { 14640, 180868, -3800, -3300 });
            zoneLoc.Add(new int[] { 14692, 183332, -3800, -3300 });
            zoneLoc.Add(new int[] { 11304, 183152, -3800, -3300 });

            runners     = new MonsterRunner[24];
            runners[0]  = new MonsterRunner(31003, 712, 130, 70);
            runners[1]  = new MonsterRunner(31004, 713, 125, 75);
            runners[2]  = new MonsterRunner(31005, 714, 125, 70);
            runners[3]  = new MonsterRunner(31006, 715, 120, 75);
            runners[4]  = new MonsterRunner(31007, 716, 120, 65);
            runners[5]  = new MonsterRunner(31008, 717, 115, 70);
            runners[6]  = new MonsterRunner(31009, 718, 110, 70);
            runners[7]  = new MonsterRunner(31010, 719, 115, 65);
            runners[8]  = new MonsterRunner(31011, 720, 120, 60);
            runners[9]  = new MonsterRunner(31012, 721, 125, 55);
            runners[10] = new MonsterRunner(31013, 722, 130, 50);
            runners[11] = new MonsterRunner(31014, 723, 135, 45);
            runners[12] = new MonsterRunner(31015, 724, 105, 65);
            runners[13] = new MonsterRunner(31016, 725, 110, 60);
            runners[14] = new MonsterRunner(31017, 726, 115, 55);
            runners[15] = new MonsterRunner(31018, 727, 120, 50);
            runners[16] = new MonsterRunner(31019, 728, 125, 45);
            runners[17] = new MonsterRunner(31020, 729, 130, 40);
            runners[18] = new MonsterRunner(31021, 730, 100, 60);
            runners[19] = new MonsterRunner(31022, 731, 95, 65);
            runners[20] = new MonsterRunner(31023, 732, 105, 55);
            runners[21] = new MonsterRunner(31024, 733, 110, 50);
            runners[22] = new MonsterRunner(31025, 734, 90, 70);
            runners[23] = new MonsterRunner(31026, 735, 100, 60);
            GenZone();
            GenNpc();

            L2World.Instance.RealiseEntry(raceManager1, null, true);
            raceManager1.onSpawn();
            L2World.Instance.RealiseEntry(raceManager2, null, true);
            raceManager2.onSpawn();

            CLogger.info("MonsterRace loaded.");
        }
Esempio n. 2
0
        public void OnBypass(L2Player player, npcs.L2Citizen npc, string cmd)
        {
            if (cmd.Equals("_mrvhome"))
            {
                player.ShowHtm("mr_keeper.htm", npc);
            }
            else if (cmd.Equals("_mrvw01"))//View Odds
            {
            }
            else if (cmd.Equals("_mrvw20"))//View Monster Information
            {
                if (status == 1)
                {
                    NpcHtmlMessage htm = new NpcHtmlMessage(player, "mr_vw20.htm", npc.ObjID);

                    for (byte a = 0; a < 8; a++)
                    {
                        MonsterRunner mr = runners[a + rnd];

                        htm.replace("<?NAME" + (a + 1) + "?>", "&$" + mr.sys_string + ";");
                        htm.replace("<?COND" + (a + 1) + "?>", 0);
                        htm.replace("<?WIN" + (a + 1) + "?>", (int)(mr.winCount / mr.runCount * 100));
                    }

                    htm.replace("<?LINK_HOME?>", "bypass _mrvhome");
                    player.sendPacket(htm);
                }
            }
            else if (cmd.Equals("_mrbu01"))//Purchase Ticket
            {
                if (status == 1)
                {
                    NpcHtmlMessage htm = new NpcHtmlMessage(player, "mr_buy1.htm", npc.ObjID);
                    htm.replace("<?RACE_ID?>", currentRaceId);
                    for (byte a = 0; a < 8; a++)
                    {
                        MonsterRunner mr = runners[a + rnd];

                        htm.replace("<?SEL" + (a + 1) + "?>", "bypass _mrbu2 " + a + " 1");
                        htm.replace("<?NAME" + (a + 1) + "?>", "&$" + mr.sys_string + ";");
                        htm.replace("<?COND" + (a + 1) + "?>", 0);
                        htm.replace("<?WIN" + (a + 1) + "?>", (int)(mr.winCount / mr.runCount * 100));
                    }

                    htm.replace("<?LINK_HOME?>", "bypass _mrvhome");
                    htm.replace("<?SEL_ID?>", "");
                    player.sendPacket(htm);
                }
            }
            else if (cmd.Equals("_mrsl01"))//Calculate Winnings
            {
            }
            else if (cmd.Equals("_mrvw31"))//View Past Results
            {
            }
            else if (cmd.StartsWith("_mrbu2"))
            {
                byte line = Convert.ToByte(cmd.Split(' ')[1]);
                byte cost = Convert.ToByte(cmd.Split(' ')[2]);

                int adena = 0;
                switch (cost)
                {
                case 1: adena = 100; break;

                case 2: adena = 500; break;

                case 3: adena = 1000; break;

                case 4: adena = 5000; break;

                case 5: adena = 10000; break;

                case 6: adena = 20000; break;

                case 7: adena = 50000; break;

                case 8: adena = 100000; break;
                }

                MonsterRunner  mr  = runners[line + rnd];
                NpcHtmlMessage htm = new NpcHtmlMessage(player, "mr_buy2.htm", npc.ObjID);
                htm.replace("<?RACE_ID?>", currentRaceId);
                htm.replace("<?LANE?>", (line + 1));
                htm.replace("<?NAME1?>", "&$" + mr.sys_string + ";");
                htm.replace("<?COND1?>", 0);
                htm.replace("<?WIN1?>", (int)(mr.winCount / mr.runCount * 100));

                for (byte a = 1; a <= 8; a++)
                {
                    htm.replace("<?LINK_BUY_" + a + "?>", "bypass _mrbu2 " + line + " " + a);
                }

                htm.replace("<?SEL_ID?>", adena);
                htm.replace("<?LINK_NEXT?>", "bypass _mrbu3 " + line + " " + cost);
                player.sendPacket(htm);
            }
            else if (cmd.StartsWith("_mrbu3"))
            {
                byte line = Convert.ToByte(cmd.Split(' ')[1]);
                byte cost = Convert.ToByte(cmd.Split(' ')[2]);

                int adena = 0;
                switch (cost)
                {
                case 1: adena = 100; break;

                case 2: adena = 500; break;

                case 3: adena = 1000; break;

                case 4: adena = 5000; break;

                case 5: adena = 10000; break;

                case 6: adena = 20000; break;

                case 7: adena = 50000; break;

                case 8: adena = 100000; break;
                }

                MonsterRunner  mr  = runners[line + rnd];
                NpcHtmlMessage htm = new NpcHtmlMessage(player, "mr_buy3.htm", npc.ObjID);
                htm.replace("<?RACE_ID?>", currentRaceId);
                htm.replace("<?LANE?>", (line + 1));
                htm.replace("<?NAME1?>", "&$" + mr.sys_string + ";");
                htm.replace("<?COND1?>", 0);
                htm.replace("<?WIN1?>", (int)(mr.winCount / mr.runCount * 100));

                htm.replace("<?BUY_AMOUNT?>", adena);
                htm.replace("<?TAX_AMOUNT?>", 0);
                htm.replace("<?SUM_AMOUNT?>", adena);

                htm.replace("<?LINK_HOME?>", "bypass _mrvhome");
                htm.replace("<?LINK_NEXT?>", "bypass _mrbu4 " + line + " " + cost);
                player.sendPacket(htm);
            }
            else if (cmd.StartsWith("_mrbu4"))
            {
                byte line = Convert.ToByte(cmd.Split(' ')[1]);
                byte cost = Convert.ToByte(cmd.Split(' ')[2]);

                int adena = 0;
                switch (cost)
                {
                case 1: adena = 100; break;

                case 2: adena = 500; break;

                case 3: adena = 1000; break;

                case 4: adena = 5000; break;

                case 5: adena = 10000; break;

                case 6: adena = 20000; break;

                case 7: adena = 50000; break;

                case 8: adena = 100000; break;
                }

                if (player.getAdena() < adena)
                {
                    player.sendSystemMessage(279);//You do not have enough adena.
                    return;
                }

                player.reduceAdena(adena, true, true);

                L2Item ticket = new L2Item(ItemTable.getInstance().getItem(TICKET));
                ticket.Location    = L2Item.L2ItemLocation.inventory;
                ticket.CustomType1 = line + 1;
                ticket.CustomType2 = adena / 100;
                ticket.Enchant     = currentRaceId;

                player.Inventory.addItem(ticket, true, true);
            }
        }