Source Windos Quest - System Quest

Iniciado por dakosmu, Nov 03, 2024, 06:39 PM

0 Miembros y 1 Visitante están viendo este tema.

dakosmu

  • Country: vn
  • *
    Newbie
    Mensajes: 3
    En Lorencia
    Agradecido: 11 veces
    En línea
    Source Windos Quest - System Quest


    /////////////////////////// LADO MAIN ////////////////////////////

    GUIA ACTUALIZADA 15-10-2024 Main. DataServer, GameServer





    stdafx.h

    LADO MAIN

    #define Windows_Quest                1 // Activar


    Crear El Nuevo Filtro en tu Visual Estudio, Luego Crear o Agregar los Nuevos elementos WindowsQuest.cpp y WindowsQuest.h.


    Aquí Puedes Descargarlo WindowsQuest.cpp/h

    https://mega.nz/folder/kvl0jSpZ#12XRwi_HK-AmXImgph569A
    Controller.cpp

    #if(Windows_Quest)
    #include "WindowsQuest.h"
    #endif

    Buscar
    (wParam);

    Agregar
    #if(Windows_Quest)
    g_ExWinQuestSystem.Button(wParam);
    #endif

    Interface.cpp


    #if(Windows_Quest)
    #include "WindowsQuest.h"
    #endif


    Buscar SetOp((LPVOID)oDrawInterface_Call, this->Work, ASM::CALL)

    Agregar debajo
    #if(Windows_Quest)
    g_ExWinQuestSystem.BindImages();
    #endif


    Buscar pLoadSomeForm()

    Agregar arriba
    #if(Windows_Quest)
    g_ExWinQuestSystem.ImageLoad();
    #endif


    Buscar pDrawInterface()

    Agregar Arriba
    #if(Windows_Quest)
    g_ExWinQuestSystem.DrawMiniInfo();
    g_ExWinQuestSystem.Draw();
    g_ExWinQuestSystem.DrawOpenWQ();
    #endif


    Buscar if (GetKeyState('

    Agregar
    #if(Windows_Quest)
    if (GetKeyState(VK_F7) & 0x4000)
    {
    g_ExWinQuestSystem.SwitchStatsWindowState();
    }
    #endif




    El siguiente código largo lo vas a colocar al final de todo, más abajo pues

    #if(Windows_Quest)
    void Interface::DrawText(DWORD Color, int PosX, int PosY, int Width, int Align, LPCSTR Text, ...) // OK
    {
    char Buff[2048];
    const int BuffLen = sizeof(Buff) - 1;
    ZeroMemory(Buff, BuffLen);

    Copiar
    va_list args;
    va_start(args, Text);
    vsprintf_s(Buff, BuffLen, Text, args);
    va_end(args);

    char* Line = strtok(Buff, "\n");

    while (Line != nullptr)
    {
        DrawInterfaceText(Line, PosX, PosY, Width, 0, Color, 0, Align);
        PosY += 10;
        Line = strtok(NULL, "\n");
    }
    }
    ////////////////
    bool Interface::ButtonEx(DWORD Event, int ButtonID, bool Type)
    {
    if (!this->IsWorkZone(ButtonID))
    {
    return false;
    }

    Copiar
    if (Type == true)
    {
        if (!this->Data[ButtonID].Attribute)
        {
            return false;
        }
    }

    // ----
    DWORD CurrentTick = GetTickCount();
    DWORD Delay = (CurrentTick - this->Data[ButtonID].EventTick);
    // ----

    if (Event == WM_LBUTTONDOWN && this->Data[ButtonID].OnClick == false)
    {
        this->Data[ButtonID].OnClick = true;
        //return false;
    }

    if (Event == WM_LBUTTONUP && this->Data[ButtonID].OnClick == true)
    {
        this->Data[ButtonID].OnClick = false;
        return true;
    }
    // ----
    if (Delay < 500)
    {
        return false;
    }
    // ----
    this->Data[ButtonID].OnClick = false;
    // ----
    this->Data[ButtonID].EventTick = GetTickCount();
    // ----
    return false;
    }
    #endif

    Interface.h


    Dentro de enum ObjectID

    Agregas
    #if(Windows_Quest)
    OBJECT_WIN_QUEST_MAIN,
    OBJECT_WIN_QUEST_TITLE,
    OBJECT_WIN_QUEST_FRAME,
    OBJECT_WIN_QUEST_FOOTER,
    OBJECT_WIN_QUEST_DIV,
    OBJECT_WIN_QUEST_CLOSE,
    OBJECT_WIN_QUEST_TAB,
    OBJECT_WIN_QUEST_TAB1,
    OBJECT_WIN_QUEST_TAB2,
    OBJECT_WIN_QUEST_TAB3,
    OBJECT_WIN_QUEST_FINISH,
    OBJECT_WIN_QUEST_COUNT1,
    OBJECT_WIN_QUEST_COUNT2,
    OBJECT_WIN_QUEST_COUNT3,
    OBJECT_WIN_QUEST_INFOBG,
    OBJECT_WIN_QUEST_INFOBG2,
    OBJECT_WIN_QUEST_LINE1,
    OBJECT_WIN_QUEST_POINT1,
    OBJECT_WIN_QUEST_INFO,
    OBJECT_WIN_QUEST_INFOBG3,
    OPEN_QUEST,
    #endif


    Dentro de struct InterfaceElement
    {


    Buscar     BYTE Attribute;

    Agregar debajo
    #if(Windows_Quest)
    //files limpios
    long    OpenedValue;
    BYTE    Speed;
    char    StatValue[20];
    bool    ByClose;
    bool    FirstLoad;
    //files limpios
    void Open(int Value, int Speed)
    {
    this->OnShow = true; pSetCursorFocus = true;
    this->OpenedValue = Value;
    this->Speed = Speed;
    this->ByClose = false;
    this->FirstLoad = true;
    };
    //files limpios
    void Close()
    {
    this->OnShow = false;
    pSetCursorFocus = false;
    this->ByClose = false;
    };
    #endif




    Buscar static void Work()

    Agregar
    #if(Windows_Quest)
    void        DrawText(DWORD Color, int PosX, int PosY, int Width, int Align, LPCSTR Text, ...);
    bool ButtonEx(DWORD Event, int ButtonID, bool Type);
    #endif

    Protocol.cpp

    #if(Windows_Quest)
    #include "WindowsQuest.h"
    #endif



    Buscar case 0xFB:

    Agregar
    #if(Windows_Quest)
                case 0x10:
                    g_ExWinQuestSystem.GC_MiniInfoRecvEx((GC_ExWinMiniInfoEx*)lpMsg); //0xFD, 0x13
                    return 1;
                case 0x11:
                    g_ExWinQuestSystem.GC_Start((GC_ExWinStart*)lpMsg); //0xFD, 0x14
                    return 1;
                case 0x14:
                    g_ExWinQuestSystem.GC_RecvMain((GC_MainPacket*)lpMsg); //0xFF, 0x0C
                    return 1;
                case 0x13:
                    g_ExWinQuestSystem.GC_MiniInfoRecv((GC_ExWinMiniInfo*)lpMsg); //0xFF, 0x0D
                    return 1;
    #endif

    //////////////////////////////// DATASERVER //////////////////////////////////////


    stdafx.h


    #define Windows_Quest  1

    DataServerProtocol.cpp


    Buscar gQueryManager.ExecQuery("UPDATE AccountCharacter SET GameIDC

    Agregar

    #if (Windows_Quest==1)
    if (gQueryManager.ExecQuery("SELECT * FROM QuestSystem WHERE AccountID = '%s' and Name='%s'", lpMsg->account, lpMsg->name) == 0 || gQueryManager.Fetch() == SQL_NO_DATA)
    {
    gQueryManager.Close();
    gQueryManager.ExecQuery("INSERT INTO QuestSystem (AccountID,Name) VALUES ('%s','%s')", lpMsg->account, lpMsg->name);
    gQueryManager.Close();

    pMsg.ExWQuestStart[0] = 0;
    pMsg.ExWQuestNum[0] = 0;
    pMsg.ExWQuestCount[0][0] = 0;
    pMsg.ExWQuestCount[0][1] = 0;
    pMsg.ExWQuestCount[0][2] = 0;
    pMsg.ExWQuestCount[0][3] = 0;
    pMsg.ExWQuestCount[0][4] = 0;

    pMsg.ExWQuestStart[1] = 0;
    pMsg.ExWQuestNum[1] = 0;
    pMsg.ExWQuestCount[1][0] = 0;
    pMsg.ExWQuestCount[1][1] = 0;
    pMsg.ExWQuestCount[1][2] = 0;
    pMsg.ExWQuestCount[1][3] = 0;
    pMsg.ExWQuestCount[1][4] = 0;

    pMsg.ExWQuestStart[2] = 0;
    pMsg.ExWQuestNum[2] = 0;
    pMsg.ExWQuestCount[2][0] = 0;
    pMsg.ExWQuestCount[2][1] = 0;
    pMsg.ExWQuestCount[2][2] = 0;
    pMsg.ExWQuestCount[2][3] = 0;
    pMsg.ExWQuestCount[2][4] = 0;
    }
    else
    {
    pMsg.ExWQuestStart[0] = gQueryManager.GetAsInteger("QuestStart_1");
    pMsg.ExWQuestNum[0] = gQueryManager.GetAsInteger("QuestNum_1");
    pMsg.ExWQuestCount[0][0] = gQueryManager.GetAsInteger("QuestCount1_1");
    pMsg.ExWQuestCount[0][1] = gQueryManager.GetAsInteger("QuestCount2_1");
    pMsg.ExWQuestCount[0][2] = gQueryManager.GetAsInteger("QuestCount3_1");
    pMsg.ExWQuestCount[0][3] = gQueryManager.GetAsInteger("QuestCount4_1");
    pMsg.ExWQuestCount[0][4] = gQueryManager.GetAsInteger("QuestCount5_1");

    pMsg.ExWQuestStart[1] = gQueryManager.GetAsInteger("QuestStart_2");
    pMsg.ExWQuestNum[1] = gQueryManager.GetAsInteger("QuestNum_2");
    pMsg.ExWQuestCount[1][0] = gQueryManager.GetAsInteger("QuestCount1_2");
    pMsg.ExWQuestCount[1][1] = gQueryManager.GetAsInteger("QuestCount2_2");
    pMsg.ExWQuestCount[1][2] = gQueryManager.GetAsInteger("QuestCount3_2");
    pMsg.ExWQuestCount[1][3] = gQueryManager.GetAsInteger("QuestCount4_2");
    pMsg.ExWQuestCount[1][4] = gQueryManager.GetAsInteger("QuestCount5_2");

    pMsg.ExWQuestStart[2] = gQueryManager.GetAsInteger("QuestStart_3");
    pMsg.ExWQuestNum[2] = gQueryManager.GetAsInteger("QuestNum_3");
    pMsg.ExWQuestCount[2][0] = gQueryManager.GetAsInteger("QuestCount1_3");
    pMsg.ExWQuestCount[2][1] = gQueryManager.GetAsInteger("QuestCount2_3");
    pMsg.ExWQuestCount[2][2] = gQueryManager.GetAsInteger("QuestCount3_3");
    pMsg.ExWQuestCount[2][3] = gQueryManager.GetAsInteger("QuestCount4_3");
    pMsg.ExWQuestCount[2][4] = gQueryManager.GetAsInteger("QuestCount5_3");

    gQueryManager.Close();
    }
    #endif


    Buscar gQueryManager.ExecQuery("UPDATE Character SET Kills=%d, Deads


    Agregar

    #if (Windows_Quest==1)
    gQueryManager.ExecQuery("UPDATE QuestSystem SET QuestStart_1=%d, QuestNum_1=%d, QuestCount1_1=%d, QuestCount2_1=%d, QuestCount3_1=%d, QuestCount4_1=%d, QuestCount5_1=%d, QuestStart_2=%d, QuestNum_2=%d, QuestCount1_2=%d, QuestCount2_2=%d, QuestCount3_2=%d, QuestCount4_2=%d, QuestCount5_2=%d, QuestStart_3=%d, QuestNum_3=%d, QuestCount1_3=%d, QuestCount2_3=%d, QuestCount3_3=%d, QuestCount4_3=%d, QuestCount5_3=%d WHERE Name = '%s'",
    lpMsg->ExWQuestStart[0], lpMsg->ExWQuestNum[0], lpMsg->ExWQuestCount[0][0], lpMsg->ExWQuestCount[0][1], lpMsg->ExWQuestCount[0][2], lpMsg->ExWQuestCount[0][3], lpMsg->ExWQuestCount[0][4],
    lpMsg->ExWQuestStart[1], lpMsg->ExWQuestNum[1], lpMsg->ExWQuestCount[1][0], lpMsg->ExWQuestCount[1][1], lpMsg->ExWQuestCount[1][2], lpMsg->ExWQuestCount[1][3], lpMsg->ExWQuestCount[1][4],
    lpMsg->ExWQuestStart[2], lpMsg->ExWQuestNum[2], lpMsg->ExWQuestCount[2][0], lpMsg->ExWQuestCount[2][1], lpMsg->ExWQuestCount[2][2], lpMsg->ExWQuestCount[2][3], lpMsg->ExWQuestCount[2][4],
    lpMsg->name);
    gQueryManager.Close();
    #endif


    dentro de struct SDHP_CHARACTER_INFO_SAVE_RECV Buscar DWORD Deads;



    Agregar

    #if (Windows_Quest==1)
    BYTE ExWQuestStart[3];
    WORD ExWQuestNum[3];
    WORD ExWQuestCount[3][5];
    #endif


    Dentro de struct SDHP_CHARACTER_INFO_SEND Buscar DWORD Deads;



    Agregar

    #if (Windows_Quest==1)
    BYTE ExWQuestStart[3];
    WORD ExWQuestNum[3];
    WORD ExWQuestCount[3][5];
    #endif



    ////////////////////////////////////// GAMESERVER  ////////////////////////////////////

    stdafx.h


    #define Windows_Quest           1

    Crear el Filtro y los elementos WindowsQuest.cpp y WindowsQuest.h

    Descargar los CPP/H https://mega.nz/folder/UwVU0QIL#aqSIGfhFHqLtJ61qC7yB_Q



    User.cpp

    Agregar


    #if (Windows_Quest == 1)
    #include "WindowsQuest.h"
    #endif


    Buscar
    lpObj->AutoResetEnable = 0

    Agregar

    #if (Windows_Quest==1)
    for (int i = 0; i < EW_MAX_ACT; i++)
    {
    lpObj->ExWQuestStart[i] = 0;
    lpObj->ExWQuestNum[i] = 0;

    for (int j = 0; j < EW_MAX_MISSION; j++)
    {
    lpObj->ExWQuestCount[i][j] = 0;
    }
    }
    #endif

    User.h

    Buscar DWORD m_OfflineTimeResetMove



    Agregar

    #if (Windows_Quest == 1)
    BYTE ExWQuestStart[3];
    WORD ExWQuestNum[3];
    WORD ExWQuestCount[3][5];
    #endif


    ServerInfo.cpp

    Agregar

    #if (Windows_Quest == 1)
    #include "WindowsQuest.h"
    #endif

    Buscar LogAdd(LOG_BLUE,"[ServerInfo] Custom loaded successfully


    Agregar

    #if (Windows_Quest==1)
    g_ExWinQuestSystem.Load();
    #endif

    Protocol.cpp


    Agregar
    #if (Windows_Quest == 1)
    #include "WindowsQuest.h"
    #endif


    Buscas case 0xFD si no tienes ese CASE. puedes crearlo igual a la de la foto ternando en break;


    Agregar

    #if (Windows_Quest==1)
    case 0x0D:
    g_ExWinQuestSystem.CG_AcceptQuest(aIndex, (CG_Accept_Done*)lpMsg);
    break;
    #endif

    ObjectManager.cpp


    Agregar

    #if (Windows_Quest == 1)
    #include "WindowsQuest.h"
    #endif

    Buscar lpObj->UseGuildMatchingJoin = lpMsg->UseGuildMatchingJoin



    Agregar

    #if (Windows_Quest==1)
    for (int a = 0; a < EW_MAX_ACT; a++)
    {
    lpObj->ExWQuestStart[a] = lpMsg->ExWQuestStart[a];
    lpObj->ExWQuestNum[a] = lpMsg->ExWQuestNum[a];

    for (int m = 0; m < EW_MAX_MISSION; m++)
    {
    lpObj->ExWQuestCount[a][m] = lpMsg->ExWQuestCount[a][m];
    }
    }
    #endif

    ItemManager.cpp


    Agregar
    #if (Windows_Quest == 1)
    #include "WindowsQuest.h"
    #endif

    Buscar this->ItemByteConvert(pMsg.ItemInfo,item)


    Agregar
    #if (Windows_Quest==1)
    auto quest_val = g_ExWinQuestSystem.PickUpItem(aIndex, lpItem->m_Index);

    if (quest_val == 1)
    {
    lpItem->Clear();
    pMsg.result = -1;
    pMsg.header.size -= sizeof(pMsg.ItemInfo);
    DataSend(aIndex, (LPBYTE)&pMsg, pMsg.header.size);
    return;
    }
    else if (quest_val == 2)
    {
    pMsg.result = -1;
    pMsg.header.size -= sizeof(pMsg.ItemInfo);
    DataSend(aIndex, (LPBYTE)&pMsg, pMsg.header.size);
    return;
    } //Need check
    #endif



    DSProtocol.cpp



    Agregar
    #if (Windows_Quest == 1)
    #include "WindowsQuest.h"
    #endif

    Buscar gCustomRankUser.GCReqRankLevelUser(lpObj->Index, lpObj->Index



    Agregar
    #if (Windows_Quest==1)
    g_ExWinQuestSystem.GC_MainInfo(lpObj->Index, false);
    #endif

    DSProtocol.h

    dentro de struct SDHP_CHARACTER_DELETE_RECV Buscar DWORD Deads


    Agregar
    #if (Windows_Quest==1)
    BYTE ExWQuestStart[3];
    WORD ExWQuestNum[3];
    WORD ExWQuestCount[3][5];
    #endif


    Dentro de struct SDHP_CHARACTER_INFO_SAVE_SEND Buscas DWORD Deads


    Agregas
    #if (Windows_Quest==1)
    BYTE ExWQuestStart[3];
    WORD ExWQuestNum[3];
    WORD ExWQuestCount[3][5];
    #endif




    Creditos
    Dakosmu - Por la Guia
    www.muserverfiles.com - En Lorencia

    🡱 🡳