What's new

Welcome to Onforum.net - Web and gaming resource community

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

Ask question

Ask Questions and Get Answers from Our Community

Answer

Answer Questions and Become an Expert on Your Topic

Contact Staff

Our Experts are Ready to Answer your Questions

Metin2 (New) Renewal Official cube System

Vanilla

Elite
Elite
Joined
Jan 28, 2019
Messages
541
Reaction score
2,964
Points
93
Credits
289

1. Open the Client / UserInterface / Locale_inc.h file and add:
Code:
#define ENABLE_CUBE_RENEWAL
2. Open Client / UI / packet.h and find in it:
Code:
    HEADER_CG_KEY_AGREEMENT                        = 0xfb, // _IMPROVED_PACKET_ENCRYPTION_
    HEADER_CG_TIME_SYNC                            = 0xfc,
    HEADER_CG_CLIENT_VERSION                    = 0xfd,
    HEADER_CG_CLIENT_VERSION2                    = 0xf1,
    HEADER_CG_PONG                                = 0xfe,
    HEADER_CG_HANDSHAKE                         = 0xff,
Add on:
Code:
#ifdef ENABLE_CUBE_RENEWAL
    HEADER_CG_CUBE_RENEWAL                         = 215,
#endif
Find:
Code:
    HEADER_GC_KEY_AGREEMENT_COMPLETED            = 0xfa, // _IMPROVED_PACKET_ENCRYPTION_
    HEADER_GC_KEY_AGREEMENT                        = 0xfb, // _IMPROVED_PACKET_ENCRYPTION_
    HEADER_GC_HANDSHAKE_OK                        = 0xfc, // 252
    HEADER_GC_PHASE                                = 0xfd,    // 253
    HEADER_GC_BINDUDP                           = 0xfe, // 254
    HEADER_GC_HANDSHAKE                         = 0xff, // 255
Add on:
Code:
#ifdef ENABLE_CUBE_RENEWAL
    HEADER_GC_CUBE_RENEWAL                         = 217,
#endif
Find:
Code:
#pragma pack(pop)
Add below:
Code:
#ifdef ENABLE_CUBE_RENEWAL
enum
{
    CUBE_RENEWAL_SUB_HEADER_OPEN_RECEIVE,
    CUBE_RENEWAL_SUB_HEADER_CLEAR_DATES_RECEIVE,
    CUBE_RENEWAL_SUB_HEADER_DATES_RECEIVE,
    CUBE_RENEWAL_SUB_HEADER_DATES_LOADING,

    CUBE_RENEWAL_SUB_HEADER_MAKE_ITEM,
    CUBE_RENEWAL_SUB_HEADER_CLOSE,
};

typedef struct  packet_send_cube_renewal
{
    BYTE header;
    BYTE subheader;
    DWORD index_item;
    DWORD count_item;
    DWORD index_item_improve;
} TPacketCGCubeRenewalSend;

typedef struct dates_cube_renewal
{
    DWORD npc_vnum;
    DWORD index;

    DWORD    vnum_reward;
    int        count_reward;

    bool     item_reward_stackable;

    DWORD    vnum_material_1;
    int        count_material_1;

    DWORD    vnum_material_2;
    int        count_material_2;

    DWORD    vnum_material_3;
    int        count_material_3;

    DWORD    vnum_material_4;
    int        count_material_4;

    DWORD    vnum_material_5;
    int        count_material_5;

    int     gold;
    int     percent;

    char     category[100];
} TInfoDateCubeRenewal;

typedef struct packet_receive_cube_renewal
{
    packet_receive_cube_renewal(): header(HEADER_GC_CUBE_RENEWAL)
    {}

    BYTE header;
    BYTE subheader;
    TInfoDateCubeRenewal    date_cube_renewal;
} TPacketGCCubeRenewalReceive;
#endif
3.Open Client / UserInterface / PythonApplication.h and find in it:
Code:
#include "PythonExchange.h"
#include "PythonChat.h"
Add on:
Code:
#ifdef ENABLE_CUBE_RENEWAL
#include "PythonCubeRenewal.h"
#endif
Find:
Code:
        CGraphicDevice                m_grpDevice;
        CNetworkDevice                m_netDevice;

        CPythonSystem                m_pySystem;
Add below:
Code:
#ifdef ENABLE_CUBE_RENEWAL
        CPythonCubeRenewal             m_pyCubeRenewal;
#endif
4.Open client / UserInterface / PythonApplicationModule.cpp and find in it:
Code:
#ifdef ENABLE_COSTUME_SYSTEM
    PyModule_AddIntConstant(poModule, "ENABLE_COSTUME_SYSTEM",    1);
#else
    PyModule_AddIntConstant(poModule, "ENABLE_COSTUME_SYSTEM",    0);
#endif
Add on:
Code:
#ifdef ENABLE_CUBE_RENEWAL
    PyModule_AddIntConstant(poModule, "ENABLE_CUBE_RENEWAL",    1);
#else
    PyModule_AddIntConstant(poModule, "ENABLE_CUBE_RENEWAL",    0);
#endif
Code:
5.Open Client / UserInterface / PythonNetworkStream.cpp and find in it:
Code:
            Set(HEADER_GC_DRAGON_SOUL_REFINE,        CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCDragonSoulRefine), STATIC_SIZE_PACKET));
Add below:
Code:
#ifdef ENABLE_CUBE_RENEWAL
            Set(HEADER_GC_CUBE_RENEWAL,    CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCCubeRenewalReceive), STATIC_SIZE_PACKET));
#endif
6.Open client / UserInterface / PythonNetworkStream.h and find in it:
Code:
        // ETC
        DWORD GetMainActorVID();
        DWORD GetMainActorRace();
        DWORD GetMainActorEmpire();
        DWORD GetMainActorSkillGroup();
        void SetEmpireID(DWORD dwEmpireID);
        DWORD GetEmpireID();
        void __TEST_SetSkillGroupFake(int iIndex);
Add on:
Code:
#ifdef ENABLE_CUBE_RENEWAL
        bool CubeRenewalMakeItem(int index_item, int count_item, int index_item_improve);
        bool CubeRenewalClose();
        bool RecvCubeRenewalPacket();
#endif
7.Open Client / UserInterface / PythonNetworkStreamPhaseGame.cpp and find in it:
Code:
#include "PythonTextTail.h"
#include "PythonItem.h"
#include "PythonChat.h"
Add below:
Code:
#ifdef ENABLE_CUBE_RENEWAL
#include "PythonCubeRenewal.h"
#endif
Find:
Code:
            case HEADER_GC_DRAGON_SOUL_REFINE:
                ret = RecvDragonSoulRefine();
                break;
Add below:
Code:
#ifdef ENABLE_CUBE_RENEWAL
            case HEADER_GC_CUBE_RENEWAL:
                ret = RecvCubeRenewalPacket();
                break;   
#endif
Find:


Code:
bool CPythonNetworkStream::SendDragonSoulRefinePacket(BYTE bRefineType, TItemPos* pos)
{
    TPacketCGDragonSoulRefine pk;
    pk.header = HEADER_CG_DRAGON_SOUL_REFINE;
    pk.bSubType = bRefineType;
    memcpy (pk.ItemGrid, pos, sizeof (TItemPos) * DS_REFINE_WINDOW_MAX_NUM);
    if (!Send(sizeof (pk), &pk))
    {
        return false;
    }
    return true;
}
Add below:
Code:
#ifdef ENABLE_CUBE_RENEWAL
bool CPythonNetworkStream::CubeRenewalMakeItem(int index_item, int count_item, int index_item_improve)
{
    if (!__CanActMainInstance())
        return true;

    TPacketCGCubeRenewalSend    packet;

    packet.header        = HEADER_CG_CUBE_RENEWAL;
    packet.subheader    = CUBE_RENEWAL_SUB_HEADER_MAKE_ITEM;
    packet.index_item     = index_item;
    packet.count_item   = count_item;
    packet.index_item_improve    = index_item_improve;

    if (!Send(sizeof(TPacketCGCubeRenewalSend), &packet))
    {
        Tracef("CPythonNetworkStream::CubeRenewalMakeItem Error\n");
        return false;
    }

    return SendSequence();
}

bool CPythonNetworkStream::CubeRenewalClose()
{
    if (!__CanActMainInstance())
        return true;

    TPacketCGCubeRenewalSend    packet;

    packet.header        = HEADER_CG_CUBE_RENEWAL;
    packet.subheader    = CUBE_RENEWAL_SUB_HEADER_CLOSE;

    if (!Send(sizeof(TPacketCGCubeRenewalSend), &packet))
    {
        Tracef("CPythonNetworkStream::CubeRenewalClose Error\n");
        return false;
    }

    return SendSequence();
}

bool CPythonNetworkStream::RecvCubeRenewalPacket()
{

    TPacketGCCubeRenewalReceive CubeRenewalPacket;

    if (!Recv(sizeof(CubeRenewalPacket), &CubeRenewalPacket))
        return false;

    switch (CubeRenewalPacket.subheader)
    {

        case CUBE_RENEWAL_SUB_HEADER_OPEN_RECEIVE:
        {
            PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_CUBE_RENEWAL_OPEN", Py_BuildValue("()"));
        }
        break;

        case CUBE_RENEWAL_SUB_HEADER_DATES_RECEIVE:
        {
            CPythonCubeRenewal::Instance().ReceiveList(CubeRenewalPacket.date_cube_renewal);
        }
        break;

        case CUBE_RENEWAL_SUB_HEADER_DATES_LOADING:
        {
            CPythonCubeRenewal::Instance().LoadingList();
        }
        break;

        case CUBE_RENEWAL_SUB_HEADER_CLEAR_DATES_RECEIVE:
        {
            CPythonCubeRenewal::Instance().ClearList();
        }
        break;
    }

    return true;
}
#endif
8.Open Client / UserInterface / StdAfx.h and find in it:
Code:
void initsafebox();
void initguild();
void initMessenger();
Add below:
Code:
#ifdef ENABLE_CUBE_RENEWAL
void intcuberenewal();
#endif
9.Open Client / UserInterface / UserInterface.cpp and find in it:

Code:
    initsafebox();
    initguild();
    initServerStateChecker();
Add below:
Code:
#ifdef ENABLE_CUBE_RENEWAL
    intcuberenewal();
#endif


11. Open and add game / service.h file:
Code:
#define ENABLE_CUBE_RENEWAL
12. Open and find game / char.h:
Code:
#include "cube.h"
Add below:
Code:
#include "cube_renewal.h"
13. Open the file game / cmd_general.cpp and find in it:
Code:
ACMD(do_cube)
Replace everything with:
Code:
ACMD(do_cube)
{

    const char *line;
    char arg1[256], arg2[256], arg3[256];
    line = two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
    one_argument(line, arg3, sizeof(arg3));

    if (0 == arg1[0])
    {
        return;
    }

    switch (LOWER(arg1[0]))
    {
        case 'o':    // open
            Cube_open(ch);
            break;

        default:
            return;
    }
}
14. Open the file game / input.h and find in it:
Code:
        void        Refine(LPCHARACTER ch, const char* c_pData);
Add on:
Code:
#ifdef ENABLE_CUBE_RENEWAL
        void         CubeRenewalSend(LPCHARACTER ch, const char* data);
#endif
15. Open the file game / input_main.cpp and find in it:
Code:
        case HEADER_CG_DRAGON_SOUL_REFINE:
            {
                TPacketCGDragonSoulRefine* p = reinterpret_cast <TPacketCGDragonSoulRefine*>((void*)c_pData);
                switch(p->bSubType)
                {
                case DS_SUB_HEADER_CLOSE:
                    ch->DragonSoul_RefineWindow_Close();
                    break;
                case DS_SUB_HEADER_DO_REFINE_GRADE:
                    {
                        DSManager::instance().DoRefineGrade(ch, p->ItemGrid);
                    }
                    break;
                case DS_SUB_HEADER_DO_REFINE_STEP:
                    {
                        DSManager::instance().DoRefineStep(ch, p->ItemGrid);
                    }
                    break;
                case DS_SUB_HEADER_DO_REFINE_STRENGTH:
                    {
                        DSManager::instance().DoRefineStrength(ch, p->ItemGrid);
                    }
                    break;
                }
            }
            break;
Add below:
Code:
#ifdef ENABLE_CUBE_RENEWAL
        case HEADER_CG_CUBE_RENEWAL:
            CubeRenewalSend(ch, c_pData);
            break;
#endif
Add the following to the end of the file:
Code:
#ifdef ENABLE_CUBE_RENEWAL
void CInputMain::CubeRenewalSend(LPCHARACTER ch, const char* data)
{
    struct packet_send_cube_renewal * pinfo = (struct packet_send_cube_renewal *) data;
    switch (pinfo->subheader)
    {
        case CUBE_RENEWAL_SUB_HEADER_MAKE_ITEM:
        {

            int index_item = pinfo->index_item;
            int count_item = pinfo->count_item;
            int index_item_improve = pinfo->index_item_improve;

            Cube_Make(ch,index_item,count_item,index_item_improve);
        }
        break;

        case CUBE_RENEWAL_SUB_HEADER_CLOSE:
        {
            Cube_close(ch);
        }
        break;
    }
}
#endif
16. Open the file game / item_manager.cpp and find in it:
Code:
#include "cube.h"
Add below:
Code:
#include "cube_renewal.h"
17. Open the file game / packet.h and find:

Code:
    HEADER_CG_CLIENT_VERSION            = 0xfd,
    HEADER_CG_CLIENT_VERSION2            = 0xf1,

    /********************************************************/
    HEADER_GC_KEY_AGREEMENT_COMPLETED = 0xfa, // _IMPROVED_PACKET_ENCRYPTION_
    HEADER_GC_KEY_AGREEMENT            = 0xfb, // _IMPROVED_PACKET_ENCRYPTION_
    HEADER_GC_TIME_SYNC                = 0xfc,
    HEADER_GC_PHASE                    = 0xfd,
    HEADER_GC_BINDUDP                = 0xfe,
    HEADER_GC_HANDSHAKE                = 0xff,
Add on:
Code:
#ifdef ENABLE_CUBE_RENEWAL
    HEADER_CG_CUBE_RENEWAL                     = 215,
#endif
Find:
Code:
    HEADER_GC_DRAGON_SOUL_REFINE            = 209,
    HEADER_GC_RESPOND_CHANNELSTATUS            = 210,
Add to gold:
Code:
#ifdef ENABLE_CUBE_RENEWAL
    HEADER_GC_CUBE_RENEWAL                     = 217,
#endif
Find:
Code:
#pragma pack()
#endif
Add on:
Code:
#ifdef ENABLE_CUBE_RENEWAL
enum
{
    CUBE_RENEWAL_SUB_HEADER_OPEN_RECEIVE,
    CUBE_RENEWAL_SUB_HEADER_CLEAR_DATES_RECEIVE,
    CUBE_RENEWAL_SUB_HEADER_DATES_RECEIVE,
    CUBE_RENEWAL_SUB_HEADER_DATES_LOADING,

    CUBE_RENEWAL_SUB_HEADER_MAKE_ITEM,
    CUBE_RENEWAL_SUB_HEADER_CLOSE,
};

typedef struct  packet_send_cube_renewal
{
    BYTE header;
    BYTE subheader;
    DWORD index_item;
    DWORD count_item;
    DWORD index_item_improve;
} TPacketCGCubeRenewalSend;

typedef struct dates_cube_renewal
{
    DWORD npc_vnum;
    DWORD index;

    DWORD    vnum_reward;
    int        count_reward;

    bool     item_reward_stackable;

    DWORD    vnum_material_1;
    int        count_material_1;

    DWORD    vnum_material_2;
    int        count_material_2;

    DWORD    vnum_material_3;
    int        count_material_3;

    DWORD    vnum_material_4;
    int        count_material_4;

    DWORD    vnum_material_5;
    int        count_material_5;

    int     gold;
    int     percent;

    char     category[100];
} TInfoDateCubeRenewal;

typedef struct packet_receive_cube_renewal
{
    packet_receive_cube_renewal(): header(HEADER_GC_CUBE_RENEWAL)
    {}

    BYTE header;
    BYTE subheader;
    TInfoDateCubeRenewal    date_cube_renewal;
} TPacketGCCubeRenewalReceive;
#endif
18. Open the file game / packet_info.cpp and find in it:
Code:
    Set(HEADER_CG_STATE_CHECKER, sizeof(BYTE), "ServerStateCheck", false);
Add below:
Code:
#ifdef ENABLE_CUBE_RENEWAL
    Set(HEADER_CG_CUBE_RENEWAL, sizeof(TPacketCGCubeRenewalSend), "CubeRenewalSend", true);
#endif
19. Game / Makefile'a ekle:
Code:
cube_renewal.cpp
20. Add #ifndef ENABLE_CUBE_RENEWAL to your cube.cpp / cube.h file at the beginning and finally to #endif.

21. Add to game:
22. Open root / game.py and find in it:
Code:
    def BINARY_DragonSoulGiveQuilification(self):
        self.interface.DragonSoulGiveQuilification()
Add on:
Code:
   if app.ENABLE_CUBE_RENEWAL:
        def BINARY_CUBE_RENEWAL_OPEN(self):
            if self.interface:
                self.interface.BINARY_CUBE_RENEWAL_OPEN()
23.Open the root / interfaceModule.py file and find in it:
Code:
        self.wndDragonSoulRefine = None
        self.wndChat = None
Add below:
Code:
        if app.ENABLE_CUBE_RENEWAL:
            self.wndCubeRenewal = None
Find:
Code:
   def __MakeCubeResultWindow(self):
        self.wndCubeResult = uiCube.CubeResultWindow()
        self.wndCubeResult.LoadWindow()
        self.wndCubeResult.Hide()
Add below:
Code:
    if app.ENABLE_CUBE_RENEWAL:
        def __MakeCubeRenewal(self):
            import uicuberenewal
            self.wndCubeRenewal = uicuberenewal.CubeRenewalWindows()
            self.wndCubeRenewal.Hide()
Find:
Code:
        self.__MakeCubeWindow()
        self.__MakeCubeResultWindow()
Add below:
Code:
        if app.ENABLE_CUBE_RENEWAL:
            self.__MakeCubeRenewal()
Find:
Code:
        # ACCESSORY_REFINE_ADD_METIN_STONE
        if self.wndItemSelect:
            self.wndItemSelect.Destroy()
        # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE
Add below:
Code:
        if app.ENABLE_CUBE_RENEWAL:
            if self.wndCubeRenewal:
                self.wndCubeRenewal.Destroy()
                self.wndCubeRenewal.Close()
Find:

Code:
        del self.wndUICurtain
        del self.wndChat
Add below:

Code:
        if app.ENABLE_CUBE_RENEWAL:
            del self.wndCubeRenewal
Find:
Code:
    def SucceedCubeWork(self, itemVnum, count):
        self.wndCube.Clear()

        print "큐브 제작 성공! [%d:%d]" % (itemVnum, count)

        if 0: # 결과 메시지 출력은 생략 한다
            self.wndCubeResult.SetPosition(*self.wndCube.GetGlobalPosition())
            self.wndCubeResult.SetCubeResultItem(itemVnum, count)
            self.wndCubeResult.Open()
            self.wndCubeResult.SetTop()
Add below:
Code:
    if app.ENABLE_CUBE_RENEWAL:
        def BINARY_CUBE_RENEWAL_OPEN(self):
            self.wndCubeRenewal.Show()
24. Add root:
25. Add to uiscript: 26.Translation of locale_interface.txt:
Code:
CUBE_RENEWAL_TITLE    Okienko uszlachetniania
CUBE_RENEWAL_BELT_IMPROVE    Podwyższ Szansę
 

Mxdleen

New member
Joined
Oct 13, 2020
Messages
4
Reaction score
0
Points
1
Credits
0
Thank you so much! Was looking for a working version of this. Hope this works!
 

Similar threads


shape1
shape2
shape3
shape4
shape7
shape8
Top