Jogos Brasil

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

    [Release] Wuxing Oven(Compose)

    avatar
    Convidad
    Convidado


    [Release] Wuxing Oven(Compose) Empty [Release] Wuxing Oven(Compose)

    Mensagem  Convidad Dom Jul 12, 2009 11:58 am

    [Release] Wuxing Oven (Compose)

    Primeiro, adicione este código acima deste caso em PacketProcessor.cs

    default:
    {
    Console.WriteLine("[GameServer] Unknown packet type: " + Type);
    CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "[Handler-Error] Please report: Unable to handle packet type " + Type, Struct.ChatType.Top));
    break;
    }

    O código para adicionar

    case 2036: // COMPOSITION STOVE
    {
    int MainUID = ReadLong(Data, Cool;
    int MinorUID = ReadLong(Data, 12);
    int PlusVal = 0;
    int OldPlus = 0;
    int ComPoints = 0;
    string ItemName = String.Empty;
    Struct.ItemInfo Main = new Struct.ItemInfo();
    Struct.ItemInfo Minor = new Struct.ItemInfo();

    foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
    {
    if (Item.UID == MainUID)
    {
    Main = Item;
    }
    else if (Item.UID == MinorUID)
    {
    PlusVal = Item.Plus;
    Minor = Item;
    }
    }

    if (Minor.Plus == 0)
    break;

    OldPlus = Main.Plus;

    if (PlusVal == 1)
    ComPoints = 10;
    else if (PlusVal == 2)
    ComPoints = 40;
    else if (PlusVal == 3)
    ComPoints = 120;
    else if (PlusVal == 4)
    ComPoints = 360;
    else if (PlusVal == 5)
    ComPoints = 1080;
    else if (PlusVal == 6)
    ComPoints = 3240;
    else if (PlusVal == 7)
    ComPoints = 9720;
    else if (PlusVal == Cool
    ComPoints = 29160;

    List ItemData = new List();
    foreach (KeyValuePair Items in Nano.Items)
    ItemData.Add(Items.Value);

    foreach (Struct.ItemData ItemDataPiece in ItemData)
    if (ItemDataPiece.ID == Main.ItemID)
    ItemName = ItemDataPiece.Name;

    while (ComPoints > 0 && Main.Plus < 12)
    {
    if (ComPoints < (GetPlusReq(Main.Plus) - Main.Progress))
    {
    Main.Progress += ComPoints;
    ComPoints = 0;
    break;
    }
    else
    {
    Main.Progress += GetPlusReq(Main.Plus);
    ComPoints -= GetPlusReq(Main.Plus);
    if (Main.Progress >= GetPlusReq(Main.Plus))
    {
    Main.Plus += 1;
    Main.Progress = 0;
    }
    }
    }

    if (Main.Plus != OldPlus && Main.Plus >= 6)
    {
    CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "Congratulations! " + CSocket.Client.Name + " has upgraded the bonus level of " + ItemName + " to +" + Main.Plus + "!", Struct.ChatType.Talk));
    }

    Database.Database.DeleteItem(Minor.UID);
    CSocket.Client.Inventory.Remove(Minor.UID);
    CSocket.Send(ConquerPacket.ItemUsage(MinorUID, 255, Struct.ItemUsage.RemoveItem));
    Database.Database.DeleteItem(MainUID);
    CSocket.Client.Inventory.Remove(MainUID);
    CSocket.Send(ConquerPacket.ItemUsage(MainUID, 255, Struct.ItemUsage.RemoveItem));
    Main.UID = Nano.Rand.Next(1, 9999999);
    bool created = Database.Database.NewItem(Main, CSocket);
    while (!created)
    {
    Main.UID = Nano.Rand.Next(1, 9999999);
    created = Database.Database.NewItem(Main, CSocket);
    }
    CSocket.Client.Inventory.Add(Main.UID, Main);
    CSocket.Send(ConquerPacket.ItemInfo(Main.UID, Main.ItemID, Main.Plus, Main.Progress, Main.Bless, Main.Enchant, Main.Soc1, Main.Soc2, Main.Dura, Main.MaxDura, Main.Position, Main.Color));
    break;
    }


    Ao redor da parte inferior do arquivo de acrescentar que esta função

    private static int GetPlusReq(int p)
    {
    switch (p)
    {
    case 0:
    {
    return 20;
    }
    case 1:
    {
    return 20;
    }
    case 2:
    {
    return 80;
    }
    case 3:
    {
    return 240;
    }
    case 4:
    {
    return 720;
    }
    case 5:
    {
    return 2160;
    }
    case 6:
    {
    return 6480;
    }
    case 7:
    {
    return 19440;
    }
    case 8:
    {
    return 58320;
    }
    case 9:
    {
    return 2700;
    }
    case 10:
    {
    return 5500;
    }
    case 11:
    {
    return 9000;
    }
    default:
    {
    return 0;
    }
    }
    }

    Agora em NpcTalk.cs adicionar este caso

    case 35016: // WUXING OVEN
    {
    CSocket.Send(ConquerPacket.General(CSocket.Client.ID, 1, 0, 0, 0, 0, Struct.DataType.Dialog));
    break;
    }


    Agora em Packets/ItemInfo.cs substitua

    public static byte[] ItemInfo(int UID, int itemid, int Plus, int Minus, int Enchant, int soc1, int soc2, int currentdura, int maxdura, int Location, int Color)

    com

    public static byte[] ItemInfo(int UID, int itemid, int Plus, int Progress, int Minus, int Enchant, int soc1, int soc2, int currentdura, int maxdura, int Location, int Color)

    abaixo

    Packet.Long(Color); //Item color. 2-9(headgear is 3-9)

    adicione

    Packet.Long(Progress); // Composition Progress

    REPLACING

    Packet.Long(0);

    Agora, em sua tabela sql fazer algo nos moldes

    ALTER TABLE items ADD Progress INT(11) NOT NULL DEFAULT 0 AFTER Plus;

    na Database.cs procure

    public static bool NewItem(Struct.ItemInfo Item, ClientSocket CSocket)


    e na função que encontrar

    ," + Item.Plus + "

    Na mesma seqüência logo depois que adicionar

    ," + Item.Progress + "

    de novo Database.cs, procure

    public static void UpdateItem(Struct.ItemInfo Item)

    Nessa função, encontrar

    `Plus` = " + Item.Plus + ",

    depois adicione

    `Progress` = " + Item.Progress + ",

    de novo, Database.cs; procure

    public static void GetItems(ClientSocket CSocket)


    Nessa função, encontrar

    Item.Plus = Convert.ToInt32(DR["Plus"]);


    E abaixo dela, adicione

    Item.Progress = Convert.ToInt32(DR["Progress"]);

    Agora em Structs/Item.cs procure

    public class ItemInfo

    Nesse encontrar

    public int Plus;

    e em que, adicionar

    public int Progress;


    Titulo Iditado (DiegoAlef) Cool

      Data/hora atual: Ter Nov 26, 2024 9:33 pm