Criando um Conquer
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Evento ache o GM

Ir para baixo

Evento ache o GM Empty Evento ache o GM

Mensagem por FelipeXP Dom Out 04, 2015 9:34 am

Adicione uma nova class ao projeto.
Código:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Generic;
using Conquer_Online_Server.Game;
using Conquer_Online_Server.Database;
using Conquer_Online_Server.Network.GamePackets;
using System.Drawing;
using Conquer_Online_Server.Client;

namespace Conquer_Online_Server
{
    class FindGm
    {

        static ushort Mapid = (ushort)Kernel.RandFromGivingNums(1036);
        static Map Map = Kernel.Maps[Mapid];
        const int ITEMS = 1000, CPSMoney = 1001;
        //static int CurrentBoxes = 0;
        public static Conquer_Online_Server.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 (Map != null)
                    {
                        if (npc != null)
                        {
                            Map.RemoveNpc(npc);
                        }
                    }
                    Mapid = (ushort)Kernel.RandFromGivingNums(1036);
                    Map = Kernel.Maps[Mapid];
                Caspr:
                    var cord = Map.RandomCoordinates();
                    tempX = cord.Item1;
                    tempY = cord.Item2;
                    if (Map.Floor[tempX, tempY, MapObjectType.Item, null])
                    {
                        npc = new Network.GamePackets.NpcSpawn();
                        npc.UID = Map.EntityUIDCounter.Next;
                        npc.Mesh = (ushort)Kernel.RandFromGivingNums(29686);
                        npc.Type = Enums.NpcType.Talker;
                        npc.MapID = Map.ID;
                        npc.X = tempX;
                        npc.Y = tempY;
                        npc.Name = "YouFindMe";
                        Map.AddNpc(npc);
                        //CurrentBoxes++;
                        Kernel.SendWorldMessage(new Message("[Quest GM] Find GM in Map" + ((Enums.Maps)Mapid).ToString(), Color.Red, Message.Service));
                        Console.WriteLine(npc.Name + " has shown up in " + ((Enums.Maps)npc.MapID).ToString() + " (" + npc.X + ", " + npc.Y + ")");
                    }
                    else goto Caspr;
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }

        }

        public static void Reward(GameClient client)
        {

            int prize = Kernel.RandFromGivingNums(ITEMS, CPSMoney);
            //#warning TREASURE BOX PRIZE
            switch (prize)
            {
                default:
                case CPSMoney:
                    {//Conan
                        uint amount = (uint)Kernel.RandFromGivingNums(5000000, 10000000, 9000000, 7000000);
                        client.Entity.ConquerPoints += amount;
                        Kernel.SendWorldMessage(new Message(client.Entity.Name + " got " + amount + " CPs while Find GM " + ((Enums.Maps)Mapid).ToString(), Color.White, Message.Talk));
                        break;
                    }
                case ITEMS:
                    {
                       // Database.ConquerItemBaseInformation temp;
                        uint itemid = (uint)Kernel.RandFromGivingNums(727317, 729122, 3004247, 3004249, 3004248, 3005892, 3005891);
                        client.Inventory.Add(itemid, 0, 1);
                        //Database.ConquerItemInformation.BaseInformations.TryGetValue(itemid, out temp);
                        Kernel.SendWorldMessage(new Message(client.Entity.Name + " Got " + ITEMS + " while Find GM " + ((Enums.Maps)Mapid).ToString(), Color.White, Message.BroadcastMessage));
                        break;
                    }
            }

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

Na Npc.cs adicione:
Código:
if (FindGm.npc != null)
                           if (client.ActiveNpc == FindGm.npc.UID)
                           {
                                client.SendScreen(new Network.GamePackets.Data(true) { UID = client.ActiveNpc, ID = Network.GamePackets.Data.RemoveEntity }, true);
                                client.Map.RemoveNpc(client.Map.Npcs[client.ActiveNpc]);
                                FindGm.Reward(client);
                            }
Na World.cs Adicione:
Código:
#region FindGm
            if (Now64.Minute == 25 && Now64.Second == 0)
            {
                FindGm.Generate();
            }
            #endregion
Na PacketHandler.cs Procure por #region Misc e adicione isso: http://pastebin.com/0QVud2vL

Fotos:
Evento ache o GM 293i0dd
Evento ache o GM Bgzmag

FelipeXP
Membro
Membro

Mensagens : 320
Data de inscrição : 28/05/2014

https://www.youtube.com/channel/UCOmLJd3M1OSrMmlcR7UGlhw

Ir para o topo Ir para baixo

Ir para o topo


 
Permissões neste sub-fórum
Não podes responder a tópicos