Noticias:

SMF - Just Installed!

Menú principal

Source Sistema de Agregar Puntos y Stats

Publicado por Dakosmu, Mar 26, 2024, 07:32 AM

Tema anterior - Siguiente tema

Dakosmu

Source Sistema de Agregar Puntos


Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión


#define ADD_POINT                    1
Controller.cpp



#if(ADD_POINT)
            gInterface.EventCharacterWindow(wParam);
            gInterface.EventStatsAddWindow(wParam);
            gInterface.EventResetStatsWindow(wParam);
#endif


Interface.cpp

#if(ADD_POINT)
    this->BindObject(eSTATSADD_MAIN, 0x7A5A, 222, 226, -1, -1);
    this->BindObject(eSTATSADD_TITLE, 0x7A63, 230, 67, -1, -1);
    this->BindObject(eSTATSADD_FRAME, 0x7A58, 230, 15, -1, -1);
    this->BindObject(eSTATSADD_FOOTER, 0x7A59, 230, 50, -1, -1);
    this->BindObject(eSTATSADD_CLOSE, 0x7EC5, 36, 29, -1, -1);
    this->BindObject(eSTATSADD_TEXTBOX01, 0x9307, 170, 21, -1, -1);
    this->BindObject(eSTATSADD_STATBOX01, 0x7AA3, 170, 21, -1, -1);
    this->BindObject(eSTATSADD_STATBOX02, 0x7AA3, 170, 21, -1, -1);
    this->BindObject(eSTATSADD_STATBOX03, 0x7AA3, 170, 21, -1, -1);
    this->BindObject(eSTATSADD_STATBOX04, 0x7AA3, 170, 21, -1, -1);
    this->BindObject(eSTATSADD_STATBOX05, 0x7AA3, 170, 21, -1, -1);
    this->BindObject(eSTATSADD_BTN_OK, 0x7A5B, 54, 30, -1, -1);
    //
    this->BindObject(eRESETSTATS_MAIN, 0x7A5A, 222, 140, -1, -1);
    this->BindObject(eRESETSTATS_TITLE, 0x7A63, 230, 67, -1, -1);
    this->BindObject(eRESETSTATS_FRAME, 0x7A58, 230, 15, -1, -1);
    this->BindObject(eRESETSTATS_FOOTER, 0x7A59, 230, 50, -1, -1);
    this->BindObject(eRESETSTATS_CLOSE, 0x7EC5, 36, 29, -1, -1);
    this->BindObject(eRESETSTATS_POINT, 0x7B68, 10, 10, -1, -1);
    this->BindObject(eRESETSTATS_CHECK_WC, 0x7BAE, 15, 15, 390, 132);
    this->BindObject(eRESETSTATS_CHECK_STAT, 0x7BAE, 15, 15, 390, 152);
    this->BindObject(eRESETMASTER_CHECK_WC, 0x7BAE, 15, 15, 390, 172);
    this->BindObject(eRESETMASTER_CHECK_STAT, 0x7BAE, 15, 15, 390, 192);
    this->BindObject(eRESETSTATS_BTN_OK, 0x7A5B, 54, 30, -1, -1);
    //
    this->BindObject(eCHARINFO_BTN_STAT, 0x7AA4, 16, 15, -1, 73);
    this->BindObject(eCHARINFO_BTN_RESSTAT, 0x7AA4, 16, 15, -1, 94);
#endif



#if(ADD_POINT)

    gInterface.DrawStatsAddWindow();
    gInterface.DrawResetStatsWindow();

#endif

#if(ADD_POINT)

void Interface::DrawAnimatedGUI(short ObjectID, float PosX, float PosY)
{
    this->Data[ObjectID].X = PosX;
    this->Data[ObjectID].Y = PosY;
    this->Data[ObjectID].MaxX = PosX + this->Data[ObjectID].Width;
    this->Data[ObjectID].MaxY = PosY + this->Data[ObjectID].Height;
    // ----
    pDrawGUI(this->Data[ObjectID].ModelID, PosX, PosY,
        this->Data[ObjectID].Width, this->Data[ObjectID].Height);
}

void Interface::DrawColoredAnimatedGUI(short ObjectID, float X, float Y, DWORD Color)
{
    this->Data[ObjectID].X = X;
    this->Data[ObjectID].Y = Y;
    this->Data[ObjectID].MaxX = X + this->Data[ObjectID].Width;
    this->Data[ObjectID].MaxY = Y + this->Data[ObjectID].Height;
    // ----
    pDrawColorButton(this->Data[ObjectID].ModelID, X, Y,
    this->Data[ObjectID].Width, this->Data[ObjectID].Height, 0, 0, Color);
}

void Interface::DrawAnimatedButton(short ObjectID, float PosX, float PosY, float ScaleX, float ScaleY)
{
    this->Data[ObjectID].X = PosX;
    this->Data[ObjectID].Y = PosY;
    this->Data[ObjectID].MaxX = PosX + this->Data[ObjectID].Width;
    this->Data[ObjectID].MaxY = PosY + this->Data[ObjectID].Height;
    // ----
    pDrawButton(this->Data[ObjectID].ModelID, PosX, PosY,
    this->Data[ObjectID].Width, this->Data[ObjectID].Height, ScaleX, ScaleY);
}

void Interface::DrawStatsAddWindow()
{
    if (!this->Data[eSTATSADD_MAIN].OnShow)
    {
        return;
    }

    int ObjectCount = 4;
    if ((gObjUser.lpPlayer->Class & 7) == 4)
    {
        ObjectCount = 5;
    }
    char szCharNames[5][32];
    memcpy(szCharNames[0], "Sức Mạnh :", sizeof(szCharNames[0]));
    memcpy(szCharNames[1], "Nhanh Nhẹn :", sizeof(szCharNames[1]));
    memcpy(szCharNames[2], "Thể Lực :", sizeof(szCharNames[2]));
    memcpy(szCharNames[3], "Năng Lượng :", sizeof(szCharNames[3]));
    memcpy(szCharNames[4], "Mệnh Lệnh :", sizeof(szCharNames[4]));
    int ObjectIDs[5] =
    {
        eSTATSADD_STATBOX01,
        eSTATSADD_STATBOX02,
        eSTATSADD_STATBOX03,
        eSTATSADD_STATBOX04,
        eSTATSADD_STATBOX05,
    };

    if (this->Data[eSTATSADD_MAIN].ByClose == false)
    {
        if (this->Data[eSTATSADD_MAIN].OpenedValue < 0)
        {
            this->Data[eSTATSADD_MAIN].OpenedValue += this->Data[eSTATSADD_MAIN].Speed;

            if (this->Data[eSTATSADD_MAIN].OpenedValue >= -150)
            {
                this->Data[eSTATSADD_MAIN].Speed = 15;
            }

            if (this->Data[eSTATSADD_MAIN].OpenedValue > 0)
            {
                this->Data[eSTATSADD_MAIN].OpenedValue = 0;
            }
        }
    }
    else
    {
        if (this->Data[eSTATSADD_MAIN].OpenedValue > -226)
        {
            this->Data[eSTATSADD_MAIN].OpenedValue -= this->Data[eSTATSADD_MAIN].Speed;

            if (this->Data[eSTATSADD_MAIN].OpenedValue <= -150)
            {
                this->Data[eSTATSADD_MAIN].Speed = 20;
            }

            if (this->Data[eSTATSADD_MAIN].OpenedValue <= -226)
            {
                this->Data[eSTATSADD_MAIN].Close();
                for (int i = 0; i                {
                    this->Data[ObjectIDs[i]].Attribute = false;
                }
            }
        }
    }

    float MainWidth = 230.0;
    float StartY = 198;
    float StartX = this->Data[eSTATSADD_MAIN].OpenedValue;
    float MainCenter = StartX + (MainWidth / 3);
    float ButtonX = MainCenter - (29.0 / 2);

    //pSetCursorFocus = true;
    // ----
    this->DrawAnimatedGUI(eSTATSADD_MAIN, StartX, StartY + 2);
    this->DrawAnimatedGUI(eSTATSADD_TITLE, StartX, StartY);
    StartY = this->DrawRepeatGUI(eSTATSADD_FRAME, StartX, StartY + 67.0, 8);
    this->DrawAnimatedGUI(eSTATSADD_FOOTER, StartX, StartY);
    this->DrawAnimatedGUI(eSTATSADD_CLOSE, StartX + MainWidth - this->Data[eSTATSADD_CLOSE].Width, this->Data[eSTATSADD_MAIN].Y - 2);
    // ----

    // ----
    if (this->IsWorkZone(eSTATSADD_CLOSE))
    {
        DWORD Color = eGray100;
        // ----
        if (this->Data[eSTATSADD_CLOSE].OnClick)
        {
            Color = eGray150;
        }
        // ----
        this->DrawColoredGUI(eSTATSADD_CLOSE, this->Data[eSTATSADD_CLOSE].X, this->Data[eSTATSADD_CLOSE].Y, Color);
        this->DrawToolTip(this->Data[eSTATSADD_CLOSE].X + 5, this->Data[eSTATSADD_CLOSE].Y + 25, "Close");
    }
    // ----
    DWORD StatPoints = ViewPoint;

    for (int i = 0; i    {
        StatPoints -= atoi(this->Data[ObjectIDs[i]].StatValue);
    }
    // ----
    this->DrawFormat(eGold, StartX + 10, this->Data[eSTATSADD_MAIN].Y + 8, 210, 3, "CỘNG ĐIỂM NHANH");

    this->DrawAnimatedGUI(eSTATSADD_TEXTBOX01, ButtonX - 35, this->Data[eSTATSADD_MAIN].Y + 28);
    this->DrawFormat(eWhite, StartX - 40, this->Data[eSTATSADD_MAIN].Y + 34, 210, 3, "ĐIỂM DƯ HIỆN TẠI :");

    char Value[50];
    ZeroMemory(Value, sizeof(Value));
    pGetMoneyFormat((double)StatPoints, Value, 0);
    GetFormat(Value, ',', ' ');

    this->DrawFormat(eWhite, StartX + 45, this->Data[eSTATSADD_MAIN].Y + 34, 210, 3, "%s", Value);

    this->DrawFormat(eWhite, StartX + 10, this->Data[eSTATSADD_MAIN].Y + 55, 210, 3, "NHẬP SỐ ĐIỂM CẦN CỘNG BÊN DƯỚI");

    if (this->Data[eSTATSADD_MAIN].FirstLoad == true)
    {
        this->Data[eSTATSADD_STATBOX01].Attribute = 1;
    }

    for (int i = 0; i    {
        if (this->Data[eSTATSADD_MAIN].FirstLoad == true)
        {
            sprintf(this->Data[ObjectIDs[i]].StatValue, "0");
        }
        this->DrawAnimatedGUI(ObjectIDs[i], ButtonX - 35, this->Data[eSTATSADD_MAIN].Y + 63 + ((i + 1) * 21));
        this->DrawFormat(eWhite, StartX - 38, this->Data[eSTATSADD_MAIN].Y + 69 + ((i + 1) * 21), 210, 3, szCharNames[i]);
        this->DrawFormat(eWhite, StartX + 45, this->Data[eSTATSADD_MAIN].Y + 69 + ((i + 1) * 21), 210, 3, this->Data[ObjectIDs[i]].StatValue);
    }

    for (int i = 0; i    {
        if (this->Data[ObjectIDs[i]].Attribute == 1)
        {
            DWORD Color = eGray100;
            this->DrawColoredAnimatedGUI(ObjectIDs[i], ButtonX - 35, this->Data[eSTATSADD_MAIN].Y + 63 + ((i + 1) * 21), Color);
        }
    }

    this->DrawAnimatedButton(eSTATSADD_BTN_OK, StartX + 85, this->Data[eSTATSADD_MAIN].Y + 194, 0, 0);

    if (this->IsWorkZone(eSTATSADD_BTN_OK))
    {
        int ScaleY = 30;
        // ----
        if (this->Data[eSTATSADD_BTN_OK].OnClick)
        {
            ScaleY = 60;
        }
        // ----
        this->DrawAnimatedButton(eSTATSADD_BTN_OK, StartX + 85, this->Data[eSTATSADD_MAIN].Y + 194, 0, ScaleY);
    }

    if (this->Data[eSTATSADD_MAIN].FirstLoad == true)
    {
        this->Data[eSTATSADD_MAIN].FirstLoad = false;
    }
}
// ----------------------------------------------------------------------------------------------

void Interface::EventStatsAddWindow(DWORD Event)
{
    this->EventStatsAddWindow_Close(Event);
}

void Interface::EventStatsAddWindow_Close(DWORD Event)
{
    if (!this->Data[eSTATSADD_MAIN].OnShow)
    {
        return;
    }

    DWORD CurrentTick = GetTickCount();

    int ObjectIDs[5] =
    {
        eSTATSADD_STATBOX01,
        eSTATSADD_STATBOX02,
        eSTATSADD_STATBOX03,
        eSTATSADD_STATBOX04,
        eSTATSADD_STATBOX05,
    };

    int ObjectCount = 4;
    if ((gObjUser.lpPlayer->Class & 7) == 4)
    {
        ObjectCount = 5;
    }

    for (int i = 0; i    {
        if (IsWorkZone(ObjectIDs[i]))
        {
            DWORD Delay = (CurrentTick - this->Data[ObjectIDs[i]].EventTick);
            // ----
            if (Event == WM_LBUTTONDOWN)
            {
                this->Data[ObjectIDs[i]].OnClick = true;
                return;
            }
            // ----
            this->Data[ObjectIDs[i]].OnClick = false;
            // ----
            if (Delay < 500)
            {
                return;
            }
            this->Data[ObjectIDs[i]].EventTick = GetTickCount();

            for (int j = 0; j            {
                this->Data[ObjectIDs[j]].Attribute = 0;
            }

            this->Data[ObjectIDs[i]].Attribute = 1;
        }
    }

    for (int i = 5; i<5; i++)
    {
        if (IsWorkZone(ObjectIDs[i]))
        {
            DWORD Delay = (CurrentTick - this->Data[ObjectIDs[i]].EventTick);
            // ----
            if (Event == WM_LBUTTONDOWN)
            {
                this->Data[ObjectIDs[i]].OnClick = true;
                return;
            }
            // ----
            this->Data[ObjectIDs[i]].OnClick = false;
            // ----
            if (Delay < 500)
            {
                return;
            }
            this->Data[ObjectIDs[i]].EventTick = GetTickCount();

            for (int j = 5; j<8; j++)
            {
                this->Data[ObjectIDs[j]].Attribute = 0;
            }

            this->Data[ObjectIDs[i]].Attribute = 1;
        }
    }


    if (IsWorkZone(eSTATSADD_BTN_OK))
    {
        DWORD Delay = (CurrentTick - this->Data[eSTATSADD_BTN_OK].EventTick);
        // ----
        if (Event == WM_LBUTTONDOWN)
        {
            this->Data[eSTATSADD_BTN_OK].OnClick = true;
            return;
        }
        // ----
        this->Data[eSTATSADD_BTN_OK].OnClick = false;
        // ----
        if (Delay < 500)
        {
            return;
        }
        // ----
        this->Data[eSTATSADD_BTN_OK].EventTick = GetTickCount();
        Data[eSTATSADD_MAIN].CloseAnimated(15);
        PMSG_UPDATE_STATS_SEND pMsg;
        pMsg.Str = atoi(this->Data[eSTATSADD_STATBOX01].StatValue);
        pMsg.Agi = atoi(this->Data[eSTATSADD_STATBOX02].StatValue);
        pMsg.Vit = atoi(this->Data[eSTATSADD_STATBOX03].StatValue);
        pMsg.Ene = atoi(this->Data[eSTATSADD_STATBOX04].StatValue);
        pMsg.Com = 0;
        if (ObjectCount == 5)
        {
            pMsg.Com = atoi(this->Data[eSTATSADD_STATBOX05].StatValue);
        }
        CGSendStatsAdd(pMsg);
    }

    if (IsWorkZone(eSTATSADD_CLOSE))
    {
        DWORD Delay = (CurrentTick - this->Data[eSTATSADD_CLOSE].EventTick);
        // ----
        if (Event == WM_LBUTTONDOWN)
        {
            this->Data[eSTATSADD_CLOSE].OnClick = true;
            return;
        }
        // ----
        this->Data[eSTATSADD_CLOSE].OnClick = false;
        // ----
        if (Delay < 500)
        {
            return;
        }
        // ----
        this->Data[eSTATSADD_CLOSE].EventTick = GetTickCount();
        Data[eSTATSADD_MAIN].CloseAnimated(15);
    }

    // ----
    return;
}

// ----------------------------------------------------------------------------------------------
void Interface::EventCharacterWindow(DWORD Event)
{
    DWORD CurrentTick = GetTickCount();
    // ----
    if (!this->CheckWindow(Character))
    {
        return;
    }
    // ----
    if (IsWorkZone(eCHARINFO_BTN_STAT))
    {
        DWORD Delay = (CurrentTick - this->Data[eCHARINFO_BTN_STAT].EventTick);

        if (Event == WM_LBUTTONDOWN)
        {
            this->Data[eCHARINFO_BTN_STAT].OnClick = true;
            return;
        }
        // ----
        this->Data[eCHARINFO_BTN_STAT].OnClick = false;
        // ----
        if (Delay < 500)
        {
            return;
        }
        // ----
        this->Data[eCHARINFO_BTN_STAT].EventTick = GetTickCount();
        this->SwitchStatsWindowState();
    }

    if (IsWorkZone(eCHARINFO_BTN_RESSTAT))
    {
        DWORD Delay = (CurrentTick - this->Data[eCHARINFO_BTN_RESSTAT].EventTick);

        if (Event == WM_LBUTTONDOWN)
        {
            this->Data[eCHARINFO_BTN_RESSTAT].OnClick = true;
            return;
        }
        // ----
        this->Data[eCHARINFO_BTN_RESSTAT].OnClick = false;
        // ----
        if (Delay < 500)
        {
            return;
        }
        // ----
        this->Data[eCHARINFO_BTN_RESSTAT].EventTick = GetTickCount();
        this->SwitchResetStatsWindowState();
    }
}

void Interface::DrawResetStatsWindow()
{
    if (!this->Data[eRESETSTATS_MAIN].OnShow)
    {
        return;
    }
    // ----
    float MainWidth = 230.0;
    float StartY = 100.0;
    float StartX = (MAX_WIN_WIDTH / 2) - (MainWidth / 2);
    float MainCenter = StartX + (MainWidth / 3);

    //pSetCursorFocus = true;
    // ----

    this->DrawGUI(eRESETSTATS_MAIN, StartX, StartY + 2);
    this->DrawGUI(eRESETSTATS_TITLE, StartX, StartY);
    StartY = this->DrawRepeatGUI(eRESETSTATS_FRAME, StartX, StartY + 67.0, 2);
    this->DrawGUI(eRESETSTATS_FOOTER, StartX, StartY);
    this->DrawGUI(eRESETSTATS_CLOSE, StartX + MainWidth - this->Data[eRESETSTATS_CLOSE].Width, this->Data[eRESETSTATS_TITLE].Height + this->Data[eRESETSTATS_CLOSE].Height + 2);

    // ----
    if (this->IsWorkZone(eRESETSTATS_CLOSE))
    {
        DWORD Color = eGray100;
        // ----
        if (this->Data[eRESETSTATS_CLOSE].OnClick)
        {
            Color = eGray150;
        }
        // ----
        this->DrawColoredGUI(eRESETSTATS_CLOSE, this->Data[eRESETSTATS_CLOSE].X, this->Data[eRESETSTATS_CLOSE].Y, Color);
        this->DrawToolTip(this->Data[eRESETSTATS_CLOSE].X + 5, this->Data[eRESETSTATS_CLOSE].Y + 25,"Close");
    }
    // ----

    int x = GetPrivateProfileIntA("Custom", "X", -35, "./Settings.ini");
    int y = GetPrivateProfileIntA("Custom", "Y", 60, "./Settings.ini");

    int StatPoints = ViewStrength + ViewDexterity + ViewVitality + ViewEnergy + (ViewLeadership);

    StatPoints -= (gObjUser.d_Strength + gObjUser.d_Dexterity + gObjUser.d_Vitality + gObjUser.d_Energy + gObjUser.d_Leadership);

    this->DrawFormat(eGold, StartX + 10, 110, 210, 3, "Hệ Thống Tẩy Điểm Point");
    //Reset Point
    if (this->m_ResetPointCheckBox == 1)
    {
        this->DrawGUI(eRESETSTATS_POINT, StartX + 25, this->Data[eRESETSTATS_MAIN].Y + 33); // Point
        this->DrawFormat(eWhite, StartX + 40, this->Data[eRESETSTATS_MAIN].Y + 34, 100, 1, "Tẩy = Zen (TK Thường)", gObjUser.GetResetPointPriceWC(ViewAccountLevel)); // Text
        pDrawGUI(0x7B5E, StartX + 30, this->Data[eRESETSTATS_MAIN].Y + 45, 82.0, 2.0); // Äåëèòåëü ìåëêèé 1
        pDrawGUI(0x7B5E, StartX + 30 + 82, this->Data[eRESETSTATS_MAIN].Y + 45, 82.0, 2.0); // Äåëèòåëü ìåëêèé 2
    }
    if (this->m_ResetPointCheckBox1 == 1)
    {
        this->DrawGUI(eRESETSTATS_POINT, StartX + 25, this->Data[eRESETSTATS_MAIN].Y + 53); // Point
        this->DrawFormat(eWhite, StartX + 40, this->Data[eRESETSTATS_MAIN].Y + 54, 100, 1, "Tẩy = Zen (TK Vip)", gObjUser.GetResetPointPriceZen(ViewAccountLevel)); // Text
        pDrawGUI(0x7B5E, StartX + 30, this->Data[eRESETSTATS_MAIN].Y + 65, 82.0, 2.0); // Äåëèòåëü ìåëêèé 1
        pDrawGUI(0x7B5E, StartX + 30 + 82, this->Data[eRESETSTATS_MAIN].Y + 65, 82.0, 2.0); // Äåëèòåëü ìåëêèé 2
    }
    if (this->m_ResetMasterSkillCheckBox == 1)
    {
        //Master Point Reset
        this->DrawGUI(eRESETSTATS_POINT, StartX + 25, this->Data[eRESETSTATS_MAIN].Y + 73); // Point
        this->DrawFormat(eWhite, StartX + 40, this->Data[eRESETSTATS_MAIN].Y + 74, 115, 1, "Tẩy = WcoinC (TK Thường)", gObjUser.GetResetMasterSkillPriceWC(ViewAccountLevel)); // Text
        pDrawGUI(0x7B5E, StartX + 30, this->Data[eRESETSTATS_MAIN].Y + 85, 82.0, 2.0); // Äåëèòåëü ìåëêèé 1
        pDrawGUI(0x7B5E, StartX + 30 + 82, this->Data[eRESETSTATS_MAIN].Y + 85, 82.0, 2.0); // Äåëèòåëü ìåëêèé 2
    }
    if (this->m_ResetMasterSkillCheckBox1 == 1)
    {
        this->DrawGUI(eRESETSTATS_POINT, StartX + 25, this->Data[eRESETSTATS_MAIN].Y + 93); // Point
        this->DrawFormat(eWhite, StartX + 40, this->Data[eRESETSTATS_MAIN].Y + 94, 115, 1, "Tẩy = WcoinC (TK Vip)", gObjUser.GetResetMasterSkillPriceZen(ViewAccountLevel)); // Text
        pDrawGUI(0x7B5E, StartX + 30, this->Data[eRESETSTATS_MAIN].Y + 105, 82.0, 2.0); // Äåëèòåëü ìåëêèé 1
        pDrawGUI(0x7B5E, StartX + 30 + 82, this->Data[eRESETSTATS_MAIN].Y + 105, 82.0, 2.0); // Äåëèòåëü ìåëêèé 2
    }
    if (this->m_ResetPointCheckBox == 1)
    {
        //Reset Point
        if (this->Data[eRESETSTATS_CHECK_WC].Attribute == true)
        {
            this->DrawButton(eRESETSTATS_CHECK_WC, 385, 132, 0, 15);
        }
        else
        {
            this->DrawButton(eRESETSTATS_CHECK_WC, 385, 132, 0, 0);
        }
    }
    if (this->m_ResetPointCheckBox1 == 1)
    {
        if (this->Data[eRESETSTATS_CHECK_STAT].Attribute == true)
        {
            this->DrawButton(eRESETSTATS_CHECK_STAT, 385, 152, 0, 15);
        }
        else
        {
            this->DrawButton(eRESETSTATS_CHECK_STAT, 385, 152, 0, 0);
        }
    }

    if (this->m_ResetMasterSkillCheckBox == 1)
    {
        //Master Point Reset
        if (this->Data[eRESETMASTER_CHECK_WC].Attribute == true)
        {
            this->DrawButton(eRESETMASTER_CHECK_WC, 385, 172, 0, 15);
        }
        else
        {
            this->DrawButton(eRESETMASTER_CHECK_WC, 385, 172, 0, 0);
        }
    }
    if (this->m_ResetMasterSkillCheckBox1 == 1)
    {
        if (this->Data[eRESETMASTER_CHECK_STAT].Attribute == true)
        {
            this->DrawButton(eRESETMASTER_CHECK_STAT, 385, 192, 0, 15);
        }
        else
        {
            this->DrawButton(eRESETMASTER_CHECK_STAT, 385, 192, 0, 0);
        }
    }
    this->Data[eRESETSTATS_BTN_OK].Attribute = false;

    if (this->Data[eRESETSTATS_CHECK_WC].Attribute || this->Data[eRESETSTATS_CHECK_STAT].Attribute || this->Data[eRESETMASTER_CHECK_WC].Attribute || this->Data[eRESETMASTER_CHECK_STAT].Attribute)
    {
        this->DrawButton(eRESETSTATS_BTN_OK, StartX + 85, this->Data[eRESETSTATS_MAIN].Y + 108, 0, 0);

        if (this->IsWorkZone(eRESETSTATS_BTN_OK))
        {
            int ScaleY = 30;
            // ----
            if (this->Data[eRESETSTATS_BTN_OK].OnClick)
            {
                ScaleY = 60;
            }
            // ----
            this->DrawButton(eRESETSTATS_BTN_OK, StartX + 85, this->Data[eRESETSTATS_MAIN].Y + 108, 0, ScaleY);
        }
        this->Data[eRESETSTATS_BTN_OK].Attribute = true;
    }
}

void Interface::EventResetStatsWindow(DWORD Event)
{
    if (!this->Data[eRESETSTATS_MAIN].OnShow)
    {
        return;
    }

    this->EventResetStatsWindow_Close(Event);

    int eObjectIDs[4] =
    {
        eRESETSTATS_CHECK_WC,
        eRESETSTATS_CHECK_STAT,
        eRESETMASTER_CHECK_WC,
        eRESETMASTER_CHECK_STAT,
    };

    DWORD CurrentTick = GetTickCount();

    for (int i = 0; i<4; i++)
    {
        DWORD Delay = (CurrentTick - this->Data[eObjectIDs[i]].EventTick);
        // ----
        if (!IsWorkZone(eObjectIDs[i]))
        {
            continue;
        }
        // ----
        if (Event == WM_LBUTTONDOWN)
        {
            this->Data[eObjectIDs[i]].OnClick = true;
            break;;
        }
        // ----
        this->Data[eObjectIDs[i]].OnClick = false;
        // ----
        if (Delay < 500)
        {
            break;
        }
        // ----
        this->Data[eObjectIDs[i]].EventTick = GetTickCount();
        if (this->m_ResetPointCheckBox == 1)
        {
            if (eObjectIDs[i] == eRESETSTATS_CHECK_WC)
            {
                this->Data[eRESETSTATS_CHECK_WC].Attribute = 1;
                this->Data[eRESETSTATS_CHECK_STAT].Attribute = 0;
                this->Data[eRESETMASTER_CHECK_WC].Attribute = 0;
                this->Data[eRESETMASTER_CHECK_STAT].Attribute = 0;
            }
        }
        if (this->m_ResetPointCheckBox1 == 1)
        {
            if (eObjectIDs[i] == eRESETSTATS_CHECK_STAT)
            {
                this->Data[eRESETSTATS_CHECK_STAT].Attribute = 1;
                this->Data[eRESETSTATS_CHECK_WC].Attribute = 0;
                this->Data[eRESETMASTER_CHECK_WC].Attribute = 0;
                this->Data[eRESETMASTER_CHECK_STAT].Attribute = 0;
            }
        }
        if (this->m_ResetMasterSkillCheckBox == 1)
        {
            //Reset Master Point
            if (eObjectIDs[i] == eRESETMASTER_CHECK_WC)
            {
                this->Data[eRESETMASTER_CHECK_WC].Attribute = 1;
                this->Data[eRESETMASTER_CHECK_STAT].Attribute = 0;
                this->Data[eRESETSTATS_CHECK_WC].Attribute = 0;
                this->Data[eRESETSTATS_CHECK_STAT].Attribute = 0;
            }
        }
        if (this->m_ResetMasterSkillCheckBox1 == 1)
        {
            if (eObjectIDs[i] == eRESETMASTER_CHECK_STAT)
            {
                this->Data[eRESETMASTER_CHECK_STAT].Attribute = 1;
                this->Data[eRESETMASTER_CHECK_WC].Attribute = 0;
                this->Data[eRESETSTATS_CHECK_WC].Attribute = 0;
                this->Data[eRESETSTATS_CHECK_STAT].Attribute = 0;
            }
        }
    }

    DWORD Delay = (CurrentTick - this->Data[eRESETSTATS_BTN_OK].EventTick);
    // ----
    if (!IsWorkZone(eRESETSTATS_BTN_OK) || !this->Data[eRESETSTATS_BTN_OK].Attribute)
    {
        return;
    }
    // ----
    if (Event == WM_LBUTTONDOWN)
    {
        this->Data[eRESETSTATS_BTN_OK].OnClick = true;
        return;
    }
    // ----
    this->Data[eRESETSTATS_BTN_OK].OnClick = false;
    // ----
    if (Delay < 500)
    {
        return;
    }
    // ----
    this->Data[eRESETSTATS_BTN_OK].EventTick = GetTickCount();
    if (this->m_ResetPointCheckBox == 1)
    {
        //Reset Point
        if (this->Data[eRESETSTATS_CHECK_WC].Attribute == true)
        {
            CGSendResetStats(0);
        }
    }
    if (this->m_ResetPointCheckBox1 == 1)
    {
        if (this->Data[eRESETSTATS_CHECK_STAT].Attribute == true)
        {
            CGSendResetStats(1);
        }
    }
    if (this->m_ResetMasterSkillCheckBox == 1)
    {
        //Reset Master Skill
        if (this->Data[eRESETMASTER_CHECK_WC].Attribute == true)
        {
            CGSendResetStats(2);
        }
    }
    if (this->m_ResetMasterSkillCheckBox1 == 1)
    {
        if (this->Data[eRESETMASTER_CHECK_STAT].Attribute == true)
        {
            CGSendResetStats(3);
        }
    }
    this->SwitchResetStatsWindowState();
}

void Interface::EventResetStatsWindow_Close(DWORD Event)
{
    DWORD CurrentTick = GetTickCount();
    DWORD Delay = (CurrentTick - this->Data[eRESETSTATS_CLOSE].EventTick);
    // ----
    if (!this->Data[eRESETSTATS_MAIN].OnShow || !IsWorkZone(eRESETSTATS_CLOSE))
    {
        return;
    }
    // ----
    if (Event == WM_LBUTTONDOWN)
    {
        this->Data[eRESETSTATS_CLOSE].OnClick = true;
        return;
    }
    // ----
    this->Data[eRESETSTATS_CLOSE].OnClick = false;
    // ----
    if (Delay < 500)
    {
        return;
    }
    // ----
    this->Data[eRESETSTATS_CLOSE].EventTick = GetTickCount();
    this->SwitchResetStatsWindowState();
}
#endif



Interface.h



#if(ADD_POINT)
    eSTATSADD_MAIN,
    eSTATSADD_TITLE,
    eSTATSADD_FRAME,
    eSTATSADD_FOOTER,
    eSTATSADD_CLOSE,
    eSTATSADD_TEXTBOX01,
    eSTATSADD_STATBOX01,
    eSTATSADD_STATBOX02,
    eSTATSADD_STATBOX03,
    eSTATSADD_STATBOX04,
    eSTATSADD_STATBOX05,
    eSTATSADD_BTN_OK,
    eRESETSTATS_MAIN,
    eRESETSTATS_TITLE,
    eRESETSTATS_FRAME,
    eRESETSTATS_FOOTER,
    eRESETSTATS_CLOSE,
    eRESETSTATS_POINT,
    eRESETSTATS_CHECK_WC,
    eRESETSTATS_CHECK_STAT,
    eRESETMASTER_CHECK_WC,
    eRESETMASTER_CHECK_STAT,
    eRESETSTATS_BTN_OK,
    eCHARINFO_BTN_STAT,
    eCHARINFO_BTN_RESSTAT,
#endif


#if(ADD_POINT)
    void        DrawStatsAddWindow();
    void        EventStatsAddWindow(DWORD Event);
    void        EventStatsAddWindow_Close(DWORD Event);
    void        SwitchStatsWindowState() { (Data[eSTATSADD_MAIN].OnShow == true) ? Data[eSTATSADD_MAIN].CloseAnimated(15) : Data[eSTATSADD_MAIN].Open(-226, 20); };
    void        CloseStatsAddWindow() { this->Data[eSTATSADD_MAIN].OnShow = false; };
    //
    void        DrawResetStatsWindow();
    void        EventResetStatsWindow(DWORD Event);
    void        EventResetStatsWindow_Close(DWORD Event);
    void        SwitchResetStatsWindowState() { (Data[eRESETSTATS_MAIN].OnShow == true) ? Data[eRESETSTATS_MAIN].Close() : Data[eRESETSTATS_MAIN].Open(); };
    void        CloseResetStatsWindow() { this->Data[eRESETSTATS_MAIN].OnShow = false; };
    void        EventCharacterWindow(DWORD Event);

    void    DrawAnimatedGUI(short ObjectID, float PosX, float PosY);
    void    DrawColoredAnimatedGUI(short ObjectID, float X, float Y, DWORD Color);
    void    DrawAnimatedButton(short ObjectID, float PosX, float PosY, float ScaleX, float ScaleY);

#endif


#if(ADD_POINT)
    BYTE m_ResetPointCheckBox;
    BYTE m_ResetPointCheckBox1;
    BYTE m_ResetMasterSkillCheckBox;
    BYTE m_ResetMasterSkillCheckBox1;
    BYTE m_QuickAdd;
    BYTE m_ResetStats;
#endif

Protocol.cpp


#if(ADD_POINT)
            case 0x20:
                ExtraCpanelGetInfo((EXTRA_CPANEL_SENDINFO*)lpMsg);
                break;
#endif



#if(ADD_POINT)

void CGSendStatsAdd(PMSG_UPDATE_STATS_SEND pMsg)
{
    pMsg.header.set(0xFF, 0x0C, sizeof(pMsg));
    DataSend((BYTE*)&pMsg, pMsg.header.size);
}

void CGSendResetStats(int type)
{
    PMSG_RESET_STATS_SEND pMsg;
    pMsg.header.set(0xFF, 0x0F, sizeof(pMsg));
    pMsg.Type = type;
    DataSend((BYTE*)&pMsg, pMsg.header.size);
}

void ExtraCpanelGetInfo(EXTRA_CPANEL_SENDINFO * lpMsg)
{
    gInterface.m_ResetPointCheckBox = lpMsg->ResetPoint;
    gInterface.m_ResetPointCheckBox1 = lpMsg->ResetPoint2;
    gInterface.m_ResetMasterSkillCheckBox = lpMsg->ResetMasterSkill;
    gInterface.m_ResetMasterSkillCheckBox1 = lpMsg->ResetMasterSkill2;
    gInterface.m_QuickAdd = lpMsg->QuickAdd;
    gInterface.m_ResetStats = lpMsg->ResetStat;

    gObjUser.d_Strength = lpMsg->dStrength;
    gObjUser.d_Dexterity = lpMsg->dDexterity;
    gObjUser.d_Vitality = lpMsg->dVitality;
    gObjUser.d_Energy = lpMsg->dEnergy;
    gObjUser.d_Leadership = lpMsg->dLeadership;
    //
    for (int i = 0; i    {
        gObjUser.m_CustomResetPointPriceWC[i] = lpMsg->CustomResetPointPriceWC[i];
        gObjUser.m_CustomResetPointPriceZen[i] = lpMsg->CustomResetPointPriceZen[i];
        gObjUser.m_CustomMasterSkillPriceWC[i] = lpMsg->CustomMasterSkillPriceWC[i];
        gObjUser.m_CustomMasterSkillPriceZen[i] = lpMsg->CustomMasterSkillPriceZen[i];
        gObjUser.m_MaxStatPoint[i] = lpMsg->MaxStatPoint[i];
    }
}
#endif



Protocol.h


#if(ADD_POINT)

struct PMSG_UPDATE_STATS_SEND
{
    PSBMSG_HEAD header;
    int Str;
    int Agi;
    int Vit;
    int Ene;
    int Com;
};

struct PMSG_RESET_STATS_SEND
{
    PSBMSG_HEAD header;
    int Type;
};

struct EXTRA_CPANEL_SENDINFO
{
    PSBMSG_HEAD h;    // C1:01
    BYTE ResetPoint;
    BYTE ResetPoint2;
    BYTE ResetMasterSkill;
    BYTE ResetMasterSkill2;
    BYTE QuickAdd;
    BYTE ResetStat;
    int    dStrength;
    int    dDexterity;
    int    dVitality;
    int    dEnergy;
    int    dLeadership;
    int CustomResetPointPriceWC[MAX_ACCOUNT_LEVEL];
    int CustomResetPointPriceZen[MAX_ACCOUNT_LEVEL];
    int CustomMasterSkillPriceWC[MAX_ACCOUNT_LEVEL];
    int CustomMasterSkillPriceZen[MAX_ACCOUNT_LEVEL];
    int MaxStatPoint[MAX_ACCOUNT_LEVEL];
};
#endif

#if(ADD_POINT)
void CGSendStatsAdd(PMSG_UPDATE_STATS_SEND pMsg);
void CGSendResetStats(int type);
void ExtraCpanelGetInfo(EXTRA_CPANEL_SENDINFO * lpMsg);
#endif

User.cpp


#if(ADD_POINT)
void User::ChangeCharInfo(LPVOID This)
{
    if (!gInterface.CheckWindow(Character))
    {
        return;
    }
    lpViewObj lpObj = gObjUser.lpViewPlayer;

    //--------------------------------------
    char v10[256]; // ST08_4@6
    int v56; // [sp+8h] [bp-23Ch]@18
    int v65; // [sp+240h] [bp-4h]@16

    //--
    float StartY = 1;
    float StartX = 440;

    //-- Fruit Create
    //pSetTextColor(pTextThis(), 0xFFu, 0xFFu, 0xFFu, 0xFFu);
    //ZeroMemory(v10, sizeof(v10));
    //wsprintf(v10, "%s %s", pGetTextLine(pTextLineThis, 1901), pGetTextLine(pTextLineThis, 1412));
    //pDrawText(pTextThis(), QTFrame.DisplayWinCDepthBox + StartX + 30, StartY + 50, v10, 90, 0, (LPINT)1, 0);

    //pSetTextColor(pTextThis(), 0xFFu, 0xBDu, 0x19u, 0xFFu);
    //ZeroMemory(v10, sizeof(v10));
    //wsprintf(v10, "%d/%d", *(WORD *)(*(DWORD*)0x8128AC8 + 76), *(WORD *)(*(DWORD*)0x8128AC8 + 78));
    //pDrawText(pTextThis(), QTFrame.DisplayWinCDepthBox + StartX + 90, StartY + 50, v10, 90, 0, (LPINT)1, 0);

    //if ( (signed int)*(WORD *)(*(DWORD*)0x8128AC8 + 76) > 10 )
    //{
    //    v56 = 0;
    //    if ( *(WORD *)(*(DWORD*)0x8128AC8 + 78) )
    //        v56 = 100 * *(WORD *)(*(DWORD*)0x8128AC8 + 76) / *(WORD *)(*(DWORD*)0x8128AC8 + 78);
    //    if ( v56 > 10 )
    //    {
    //        if ( v56 <= 10 || v56 > 30 )
    //        {
    //            if ( v56 <= 30 || v56 > 50 )
    //            {
    //                if ( v56 > 50 )
    //                v65 = 40;
    //            }
    //            else
    //            {
    //                v65 = 50;
    //            }
    //        }
    //        else
    //        {
    //            v65 = 60;
    //        }
    //    }
    //    else
    //    {
    //        v65 = 70;
    //    }
    //}
    //else
    //{
    //    v65 = 100;
    //}
    //pSetTextColor(pTextThis(), 0x64u, 0x96u, 0xFFu, 0xFFu);
    //ZeroMemory(v10, sizeof(v10));
    //wsprintf(v10, "(%d%%)", v65);
    //pDrawText(pTextThis(), QTFrame.DisplayWinCDepthBox + StartX + 137, StartY + 50, v10, 35, 0, (LPINT)4, 0);
    ////-- Fruis Decrease
    //pSetTextColor(pTextThis(), 0xFFu, 0xFFu, 0xFFu, 0xFFu);
    //ZeroMemory(v10, sizeof(v10));
    //wsprintf(v10, "%s %s", pGetTextLine(pTextLineThis, 1901), pGetTextLine(pTextLineThis, 1903));
    //pDrawText(pTextThis(), QTFrame.DisplayWinCDepthBox + StartX + 30, StartY + 61, v10, 90, 0, (LPINT)1, 0);

    //pSetTextColor(pTextThis(), 0xFFu, 0xBDu, 0x19u, 0xFFu);
    //ZeroMemory(v10, sizeof(v10));
    //wsprintf(v10, "%d/%d", *(WORD *)(*(DWORD*)0x8128AC8 + 80), *(WORD *)(*(DWORD*)0x8128AC8 + 82));
    //pDrawText(pTextThis(), QTFrame.DisplayWinCDepthBox + StartX + 90, StartY + 61, v10, 90, 0, (LPINT)1, 0);
    //
    //if ( (signed int)*(WORD *)(*(DWORD*)0x8128AC8 + 80) + gCustomRankUser.m_Data[lpObj->aIndex].m_LevelPlus > 10 )
    //{
    //    v56 = 0;
    //    if ( *(WORD *)(*(DWORD*)0x8128AC8 + 82) )
    //        v56 = 100 * *(WORD *)(*(DWORD*)0x8128AC8 + 80) / *(WORD *)(*(DWORD*)0x8128AC8 + 82);
    //    if ( v56 > 10 )
    //    {
    //        if ( v56 <= 10 || v56 > 30 )
    //        {
    //            if ( v56 <= 30 || v56 > 50 )
    //            {
    //                if ( v56 > 50 )
    //                v65 = 40;
    //            }
    //            else
    //            {
    //                v65 = 50;
    //            }
    //        }
    //        else
    //        {
    //            v65 = 60;
    //        }
    //    }
    //    else
    //    {
    //        v65 = 70;
    //    }
    //}
    //else
    //{
    //    v65 = 100;
    //}
    //pSetTextColor(pTextThis(), 0x64u, 0x96u, 0xFFu, 0xFFu);
    //ZeroMemory(v10, sizeof(v10));
    //wsprintf(v10, "(%d%%)", v65);
    //pDrawText(pTextThis(), QTFrame.DisplayWinCDepthBox + StartX + 137, StartY + 61, v10, 35, 0, (LPINT)4, 0);

    //----------------------------------------
    gInterface.DrawFormat(eShinyGreen, QTFrame.DisplayWinCDepthBox + 470, 58, 100, 1, "Level: %d||Master: %d", gObjUser.lpPlayer->Level + gCustomRankUser.m_Data[lpObj->aIndex].m_LevelPlus,pMasterLevel);

    //gInterface.DrawFormat(eShinyGreen, 510, 56, 100, 1, "MLvl: %d", pMasterLevel);

    //gInterface.DrawFormat(eShinyGreen, 540, 56, 100, 1, "Reset: %d", ViewReset);

    //gInterface.DrawFormat(eShinyGreen, 570, 56, 100, 1, "GReset: %d", ViewGReset);
   
    char Value[50];
    if (gInterface.m_QuickAdd == 1)
    {
        gInterface.DrawButton(eCHARINFO_BTN_STAT, QTFrame.DisplayWinCDepthBox + 473, 73, 0, 0);
        gInterface.DrawFormat(eShinyGreen, QTFrame.DisplayWinCDepthBox + 492, 76, 100, 1, "Cộng Điểm Nhanh");
        pDrawGUI(0x9306, QTFrame.DisplayWinCDepthBox + 565, 73, 50, 16);

        ZeroMemory(Value, sizeof(Value));
        pGetMoneyFormat((double)ViewPoint, Value, 0);
        GetFormat(Value, ',', ' ');

        gInterface.DrawFormat(eBlue, QTFrame.DisplayWinCDepthBox + 540, 77, 100, 3, "%s", Value);

        if (gInterface.IsWorkZone(eCHARINFO_BTN_STAT))
        {
            if (gInterface.Data[eCHARINFO_BTN_STAT].OnClick)
            {
                gInterface.DrawButton(eCHARINFO_BTN_STAT, QTFrame.DisplayWinCDepthBox + 473, 73, 0, 14);
            }
        }
    }

    if (gInterface.m_ResetStats == 1)
    {
        int StatPoints = ViewStrength + ViewDexterity + ViewVitality + ViewEnergy + (ViewLeadership);

        StatPoints -= (gObjUser.d_Strength + gObjUser.d_Dexterity + gObjUser.d_Vitality + gObjUser.d_Energy + gObjUser.d_Leadership );

        gInterface.DrawButton(eCHARINFO_BTN_RESSTAT, QTFrame.DisplayWinCDepthBox + 473, 94, 0, 0);
        gInterface.DrawFormat(eShinyGreen, QTFrame.DisplayWinCDepthBox + 492, 97, 100, 1, "Tẩy Điểm Nhanh");
        pDrawGUI(0x9306, QTFrame.DisplayWinCDepthBox + 565, 94, 50, 16);

        char Value2[50];
        ZeroMemory(Value, sizeof(Value2));
        pGetMoneyFormat((double)StatPoints, Value2, 0);
        GetFormat(Value2, ',', ' ');

        gInterface.DrawFormat(eBlue, QTFrame.DisplayWinCDepthBox + 540, 98, 100, 3, "%s", Value2);

        if (gInterface.IsWorkZone(eCHARINFO_BTN_RESSTAT))
        {
            if (gInterface.Data[eCHARINFO_BTN_RESSTAT].OnClick)
            {
                gInterface.DrawButton(eCHARINFO_BTN_RESSTAT, QTFrame.DisplayWinCDepthBox + 473, 94, 0, 14);
            }
        }
    }
    else
    {
        ((BOOL(__thiscall*)(LPVOID This))0x0077FAE0)(This);
    }
}

int User::GetResetPointPriceWC(int AccountLevel)
{
    return this->m_CustomResetPointPriceWC[AccountLevel];
}


int User::GetResetPointPriceZen(int AccountLevel)
{
    return this->m_CustomResetPointPriceZen[AccountLevel];
}

int User::GetResetMasterSkillPriceWC(int AccountLevel)
{
    return this->m_CustomMasterSkillPriceWC[AccountLevel];
}

int User::GetResetMasterSkillPriceZen(int AccountLevel)
{
    return this->m_CustomMasterSkillPriceZen[AccountLevel];
}

int User::GetMaxStatPoint(int AccountLevel)
{
    return this->m_MaxStatPoint[AccountLevel];
}
#endif

#if(ADD_POINT)

    int GetResetPointPriceWC(int AccountLevel);
    int GetResetPointPriceZen(int AccountLevel);
    int GetResetMasterSkillPriceWC(int AccountLevel);
    int GetResetMasterSkillPriceZen(int AccountLevel);
    int GetMaxStatPoint(int AccountLevel);
    int m_CustomResetPointPriceWC[MAX_ACCOUNT_LEVEL];
    int m_CustomResetPointPriceZen[MAX_ACCOUNT_LEVEL];
    int m_CustomMasterSkillPriceWC[MAX_ACCOUNT_LEVEL];
    int m_CustomMasterSkillPriceZen[MAX_ACCOUNT_LEVEL];
    int m_MaxStatPoint[MAX_ACCOUNT_LEVEL];
    int    d_Strength;
    int    d_Dexterity;
    int    d_Vitality;
    int    d_Energy;
    int    d_Leadership;
#endif
Bon Dia

🡱 🡳