منتدي اكواد

منتدي اكواد (https://code.vpscairo.com/index.php)
-   تطوير سيرفرات كونكر (https://code.vpscairo.com/forumdisplay.php?f=11)
-   -   Quest TreasureBox (https://code.vpscairo.com/showthread.php?t=763)

osama 2019-07-12 06:03 PM

رد: Quest TreasureBox
 
اقتباس:

المشاركة الأصلية كتبت بواسطة hazem (المشاركة 4913)
عدل علي القيمه ده
كود PHP:

uint amount = (uint)kernel.random.next(10000000,100000000); 


غيرت الاركام الكبيرة ومفيش فيدة بردو بيظر تحت ارقام زى منا عاوز بس بيجى فى الايتم سبس كتير بردو + لما بيجي جرمنت يجى معها سبس بردو ولما افتح صندوق ويطردنى فى التون يجى سبس بردو اعمل اية ؟؟

saeed 2019-07-12 06:06 PM

رد: Quest TreasureBox
 
اقتباس:

المشاركة الأصلية كتبت بواسطة osama (المشاركة 4923)
غيرت الاركام الكبيرة ومفيش فيدة بردو بيظر تحت ارقام زى منا عاوز بس بيجى فى الايتم سبس كتير بردو + لما بيجي جرمنت يجى معها سبس بردو ولما افتح صندوق ويطردنى فى التون يجى سبس بردو اعمل اية ؟؟

عدل على الرقم دا باللى انت عاوزه
كود PHP:

 client.Player.ConquerPoints += 100000


saeed 2019-07-12 06:14 PM

رد: Quest TreasureBox
 
اقتباس:

المشاركة الأصلية كتبت بواسطة saeed (المشاركة 4924)
عدل على الرقم دا باللى انت عاوزه
كود PHP:

 client.player.conquerpoints += 100000


وعلى فكرة اللى قاله حازم صح بس دا تكملة للى قاله حازم مش أكتر ...
وياريت ترد تقولنا المشكلة اتحلت ولا لا

Tefa 2019-07-12 06:16 PM

رد: Quest TreasureBox
 
اقتباس:

المشاركة الأصلية كتبت بواسطة osama (المشاركة 4912)
طيب لما بفتح الصنديق كلها بتدينى سبس عالى انا عاوز السبس يكون صعب علشان السرفر انا عملو صعب يريت يكون من 100 سبس الى 2000 سبس الى يجيى فى الصنديق كلها اعمل اية علشان يحصل كدة ؟

ف تريجر بوكس حط الكود ده بدل الي عندك و متنساش تعدل علي الريورد
كود بلغة HTML:

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using Mr_Panda.Client;
using Mr_Panda.Interfaces;
using Mr_Panda.Network.GamePackets;


namespace Mr_Panda.Game
{
    public class TreasureBox
    {
        static Map Map = Kernel.Maps[3820];
        const int MAX_BOXES = 20, ITEMS = 1000, CPSMoney = 1001, LEVEL = 1002, DEATH = 1003, STUN = 1004, KICK = 1005;
        static int CurrentBoxes = 0;
        static Mr_Panda.Interfaces.INpc npc;
        static ushort tempX, tempY = 0;
        static uint BaseId = 101002;
        static List<Point> VaildOnes = new List<Point>();
        public static bool OnGoing;

        public static void Generate()
        {
            try
            {
                if (CurrentBoxes < MAX_BOXES)
                {
                    if (Map == null)
                    {
                        Map = Kernel.Maps[3820];
                        return;
                    }
                    tempX = (ushort)Kernel.Random.Next(0, Map.Floor.Bounds.Width);
                    tempY = (ushort)Kernel.Random.Next(0, Map.Floor.Bounds.Height);
                    if (Map.Floor[tempX, tempY, MapObjectType.Item, null])
                    {
                        npc = new Network.GamePackets.NpcSpawn();
                        npc.UID = BaseId++;
                        npc.Mesh = (ushort)Kernel.RandFromGivingNums(9307, 9277, 9267, 9287, 9287, 9287 ,9257, 9257, 9257, 9257, 9257, 9257, 9307, 9307, 9307, 9307, 9307, 9277, 9267, 9267, 9267, 9277, 9277, 9277, 9277, 9277);
                        npc.Type = Enums.NpcType.Talker;
                        npc.MapID = Map.ID;
                        npc.X = tempX;
                        npc.Y = tempY;

                        Map.AddNpc(npc);
                        CurrentBoxes++;
                        Kernel.SendWorldMessage(new Message("A new treasure box appeared!", Color.Red, 2012));
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }

        }

        public static void Reward(GameState client)
        {
            client.Player.CurrentTreasureBoxes++;
            var orders = Kernel.GamePool.Values.OrderByDescending(x =>
x.Player.CurrentTreasureBoxes).ToArray();
            for (int i = 0; i < orders.Length + 1; i++)
            {
                if (i == 11) break;
                Message msg;

                if (i == 0)
                {
                    msg = new Message("", System.Drawing.Color.Red, Message.FirstRightCorner);
                }
                else
                {
                    if (orders[i - 1].Player.CurrentTreasureBoxes == 0) continue;
                    msg = new Message("No " + i.ToString() + "- " + orders[i - 1].Player.Name + " Opened " + orders[i - 1].Player.CurrentTreasureBoxes.ToString() + " Boxes!", System.Drawing.Color.Red, Message.ContinueRightCorner);
                }

                Kernel.SendWorldMessage(msg, Program.GamePool, (ushort)3820);
            }

            int prize = 0;

            if (client.Player.Level <= 135)
                prize = Kernel.RandFromGivingNums(ITEMS, CPSMoney, KICK, ITEMS, CPSMoney, ITEMS, CPSMoney, DEATH);
            else prize = Kernel.RandFromGivingNums(ITEMS, CPSMoney, KICK, ITEMS, CPSMoney, ITEMS, CPSMoney, DEATH);
            //#warning TREASURE BOX PRIZE
            switch (prize)
            {
                case CPSMoney:
                    {
                        uint amount = (uint)Kernel.Random.Next(100,2000);
                        if (amount <= 2000)
                        {
                            client.Player.ConquerPoints += amount;
                            Kernel.SendWorldMessage(new Message(client.Player.Name + " got " + amount.ToString() + " CPs while opening the TreasureBox!", Color.White, Message.Talk));
                        }
                        break;
                    }
                case ITEMS:
                    {
                        Database.ConquerItemBaseInformation temp;
                        uint itemid = (uint)Kernel.RandFromGivingNums(188755, 192935, 192775, 187405, 188105, 188705, 188945, 188515, 192825, 200220, 187855, 200475, 187405, 187415, 187425, 3004124, 183325, 183495, 184305, 184315, 184375, 187305, 187315, 181395, 184405, 184365);
                        client.Inventory.Add(itemid, 0, 1);
                        Database.ConquerItemInformation.BaseInformations.TryGetValue(itemid, out temp);
                        Kernel.SendWorldMessage(new Message(client.Player.Name + " got " + temp.Name + " while opening the TreasureBox!", Color.White, Message.Talk));
                        break;
                    }
                case KICK:
                    {
                        client.Player.Teleport(1002, 338, 345);
                        Kernel.SendWorldMessage(new Message(client.Player.Name + " got KICKED-OUT! while opening the TreasureBox!", Color.White, Message.Talk));
                        break;
                    }
                case DEATH:
                    {
                        client.Player.Die(client.Player);
                        Kernel.SendWorldMessage(new Message(client.Player.Name + " got Death! while opening the TreasureBox!", Color.White, Message.Talk));
                        break;
                    }
            }

            CurrentBoxes--;
       
            //client.Entity.TreasuerPoints += 1;
        }
    }
}


osama 2019-07-12 06:41 PM

رد: Quest TreasureBox
 
اقتباس:

المشاركة الأصلية كتبت بواسطة rider (المشاركة 4930)
ف تريجر بوكس حط الكود ده بدل الي عندك و متنساش تعدل علي الريورد
كود بلغة HTML:

using system;
using system.collections.generic;
using system.drawing;
using system.linq;
using system.text;
using system.threading;
using mr_panda.client;
using mr_panda.interfaces;
using mr_panda.network.gamepackets;


namespace mr_panda.game
{
    public class treasurebox
    {
        static map map = kernel.maps[3820];
        const int max_boxes = 20, items = 1000, cpsmoney = 1001, level = 1002, death = 1003, stun = 1004, kick = 1005;
        static int currentboxes = 0;
        static mr_panda.interfaces.inpc npc;
        static ushort tempx, tempy = 0;
        static uint baseid = 101002;
        static list<point> vaildones = new list<point>();
        public static bool ongoing;

        public static void generate()
        {
            try
            {
                if (currentboxes < max_boxes)
                {
                    if (map == null)
                    {
                        map = kernel.maps[3820];
                        return;
                    }
                    tempx = (ushort)kernel.random.next(0, map.floor.bounds.width);
                    tempy = (ushort)kernel.random.next(0, map.floor.bounds.height);
                    if (map.floor[tempx, tempy, mapobjecttype.item, null])
                    {
                        npc = new network.gamepackets.npcspawn();
                        npc.uid = baseid++;
                        npc.mesh = (ushort)kernel.randfromgivingnums(9307, 9277, 9267, 9287, 9287, 9287 ,9257, 9257, 9257, 9257, 9257, 9257, 9307, 9307, 9307, 9307, 9307, 9277, 9267, 9267, 9267, 9277, 9277, 9277, 9277, 9277);
                        npc.type = enums.npctype.talker;
                        npc.mapid = map.id;
                        npc.x = tempx;
                        npc.y = tempy;

                        map.addnpc(npc);
                        currentboxes++;
                        kernel.sendworldmessage(new message("a new treasure box appeared!", color.red, 2012));
                    }
                }
            }
            catch (exception e)
            {
                console.writeline(e.tostring());
            }

        }

        public static void reward(gamestate client)
        {
            client.player.currenttreasureboxes++;
            var orders = kernel.gamepool.values.orderbydescending(x =>
x.player.currenttreasureboxes).toarray();
            for (int i = 0; i < orders.length + 1; i++)
            {
                if (i == 11) break;
                message msg;

                if (i == 0)
                {
                    msg = new message("", system.drawing.color.red, message.firstrightcorner);
                }
                else
                {
                    if (orders[i - 1].player.currenttreasureboxes == 0) continue;
                    msg = new message("no " + i.tostring() + "- " + orders[i - 1].player.name + " opened " + orders[i - 1].player.currenttreasureboxes.tostring() + " boxes!", system.drawing.color.red, message.continuerightcorner);
                }

                kernel.sendworldmessage(msg, program.gamepool, (ushort)3820);
            }

            int prize = 0;

            if (client.player.level <= 135)
                prize = kernel.randfromgivingnums(items, cpsmoney, kick, items, cpsmoney, items, cpsmoney, death);
            else prize = kernel.randfromgivingnums(items, cpsmoney, kick, items, cpsmoney, items, cpsmoney, death);
            //#warning treasure box prize
            switch (prize)
            {
                case cpsmoney:
                    {
                        uint amount = (uint)kernel.random.next(100,2000);
                        if (amount <= 2000)
                        {
                            client.player.conquerpoints += amount;
                            kernel.sendworldmessage(new message(client.player.name + " got " + amount.tostring() + " cps while opening the treasurebox!", color.white, message.talk));
                        }
                        break;
                    }
                case items:
                    {
                        database.conqueritembaseinformation temp;
                        uint itemid = (uint)kernel.randfromgivingnums(188755, 192935, 192775, 187405, 188105, 188705, 188945, 188515, 192825, 200220, 187855, 200475, 187405, 187415, 187425, 3004124, 183325, 183495, 184305, 184315, 184375, 187305, 187315, 181395, 184405, 184365);
                        client.inventory.add(itemid, 0, 1);
                        database.conqueriteminformation.baseinformations.trygetvalue(itemid, out temp);
                        kernel.sendworldmessage(new message(client.player.name + " got " + temp.name + " while opening the treasurebox!", color.white, message.talk));
                        break;
                    }
                case kick:
                    {
                        client.player.teleport(1002, 338, 345);
                        kernel.sendworldmessage(new message(client.player.name + " got kicked-out! While opening the treasurebox!", color.white, message.talk));
                        break;
                    }
                case death:
                    {
                        client.player.die(client.player);
                        kernel.sendworldmessage(new message(client.player.name + " got death! While opening the treasurebox!", color.white, message.talk));
                        break;
                    }
            }

            currentboxes--;
       
            //client.entity.treasuerpoints += 1;
        }
    }
}



تم حل المشكلة شكرا جدا على مجهودكو

youssefabdelmanam 2019-07-12 08:19 PM

رد: Quest TreasureBox
 
اقتباس:

المشاركة الأصلية كتبت بواسطة Rayzo (المشاركة 4824)
الله ينور جهز موضوعاتك عشان قربنا
وياريت تشارك المنتدى مع الناس للافاده

انا شغال بنشر المنتدي بين جميع الناس عشان كلو يستفاد :D
وانشاء الله المنتدي دا يكون من افضل المنتديات الي اتعملت :emoji9:
سؤال هو هيتم اعلان بداء المسابقة لما عدد الاعضاء يوصل 400

محمد ياسر 2019-07-12 08:33 PM

رد: Quest TreasureBox
 
ايو المسابقه اتبداء لما يوصل عدد الاعضاء ل400
واتستمر 15 يوم

MHMOUDr6 2019-07-12 11:16 PM

رد: Quest TreasureBox
 
جممميل عاش ي غالي


الساعة الآن 07:04 AM

مرحبا بكم في منتدي اكواد لتطوير الالعاب