Ejemplo n.º 1
0
        public static void ConvertV3ToV4(int num)
        {
            DataConverter.Npcs.V4.Npc npcV4 = new Server.DataConverter.Npcs.V4.Npc();

            DataConverter.Npcs.V3.Npc npcV3 = Server.DataConverter.Npcs.V3.NpcManager.LoadNpc(num);
            npcV4.Name      = npcV3.Name;
            npcV4.AttackSay = npcV3.AttackSay;

            npcV4.Sprite    = npcV3.Sprite;
            npcV4.SpawnSecs = npcV3.SpawnSecs;
            npcV4.Behavior  = npcV3.Behavior;
            npcV4.Range     = npcV3.Range;
            Server.Pokedex.Pokemon pokemon = Server.Pokedex.Pokedex.FindBySprite(npcV3.Sprite);
            if (pokemon != null)
            {
                npcV4.Species = pokemon.ID;
            }
            else
            {
                npcV4.Species = 0;
            }
            npcV4.Big       = npcV3.Big;
            npcV4.SpawnTime = npcV3.SpawnTime;

            for (int z = 0; z < Constants.MAX_NPC_DROPS; z++)
            {
                npcV4.Drops[z].ItemNum   = npcV3.Drops[z].ItemNum;
                npcV4.Drops[z].ItemValue = npcV3.Drops[z].ItemValue;
                npcV4.Drops[z].Chance    = npcV3.Drops[z].Chance;
            }

            npcV4.RecruitRate  = npcV3.RecruitRate;
            npcV4.RecruitLevel = npcV3.RecruitLevel;

            npcV4.Spell     = npcV3.Spell;
            npcV4.Frequency = npcV3.Frequency;

            npcV4.AIScript = npcV3.AIScript;

            Npcs.V4.NpcManager.SaveNpc(npcV4, num);
        }
Ejemplo n.º 2
0
        public static void ConvertV3ToV4(int num)
        {
            DataConverter.Npcs.V4.Npc npcV4 = new Server.DataConverter.Npcs.V4.Npc();

            DataConverter.Npcs.V3.Npc npcV3 = Server.DataConverter.Npcs.V3.NpcManager.LoadNpc(num);
            npcV4.Name = npcV3.Name;
            npcV4.AttackSay = npcV3.AttackSay;

            npcV4.Sprite = npcV3.Sprite;
            npcV4.SpawnSecs = npcV3.SpawnSecs;
            npcV4.Behavior = npcV3.Behavior;
            npcV4.Range = npcV3.Range;
            Server.Pokedex.Pokemon pokemon = Server.Pokedex.Pokedex.FindBySprite(npcV3.Sprite);
            if (pokemon != null) {
                npcV4.Species = pokemon.ID;
            } else {
                npcV4.Species = 0;
            }
            npcV4.Big = npcV3.Big;
            npcV4.SpawnTime = npcV3.SpawnTime;

            for (int z = 0; z < Constants.MAX_NPC_DROPS; z++) {
                npcV4.Drops[z].ItemNum = npcV3.Drops[z].ItemNum;
                npcV4.Drops[z].ItemValue = npcV3.Drops[z].ItemValue;
                npcV4.Drops[z].Chance = npcV3.Drops[z].Chance;
            }

            npcV4.RecruitRate = npcV3.RecruitRate;
            npcV4.RecruitLevel = npcV3.RecruitLevel;

            npcV4.Spell = npcV3.Spell;
            npcV4.Frequency = npcV3.Frequency;

            npcV4.AIScript = npcV3.AIScript;

            Npcs.V4.NpcManager.SaveNpc(npcV4, num);
        }