(New) Renewal Official cube System

Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
Status
Not open for further replies.

Vanilla

Elite
Elite
Joined
Jan 28, 2019
Messages
839
Credits
1,190
b03415827dbb95ad6fd1c561ee49a1df.jpg

1. Open the Client / UserInterface / Locale_inc.h file and add:
Code:
Expand Collapse Copy
#define ENABLE_CUBE_RENEWAL
2. Open Client / UI / packet.h and find in it:
Code:
Expand Collapse Copy
    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:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
    HEADER_CG_CUBE_RENEWAL                         = 215,
#endif
Find:
Code:
Expand Collapse Copy
    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:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
    HEADER_GC_CUBE_RENEWAL                         = 217,
#endif
Find:
Code:
Expand Collapse Copy
#pragma pack(pop)
Add below:
Code:
Expand Collapse Copy
#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:
Expand Collapse Copy
#include "PythonExchange.h"
#include "PythonChat.h"

Add on:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
#include "PythonCubeRenewal.h"
#endif
Find:
Code:
Expand Collapse Copy
        CGraphicDevice                m_grpDevice;
        CNetworkDevice                m_netDevice;

        CPythonSystem                m_pySystem;
Add below:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
        CPythonCubeRenewal             m_pyCubeRenewal;
#endif
4.Open client / UserInterface / PythonApplicationModule.cpp and find in it:
Code:
Expand Collapse Copy
#ifdef ENABLE_COSTUME_SYSTEM
    PyModule_AddIntConstant(poModule, "ENABLE_COSTUME_SYSTEM",    1);
#else
    PyModule_AddIntConstant(poModule, "ENABLE_COSTUME_SYSTEM",    0);
#endif
Add on:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
    PyModule_AddIntConstant(poModule, "ENABLE_CUBE_RENEWAL",    1);
#else
    PyModule_AddIntConstant(poModule, "ENABLE_CUBE_RENEWAL",    0);
#endif
Code:
Expand Collapse Copy
5.Open Client / UserInterface / PythonNetworkStream.cpp and find in it:
Code:
Expand Collapse Copy
            Set(HEADER_GC_DRAGON_SOUL_REFINE,        CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCDragonSoulRefine), STATIC_SIZE_PACKET));
Add below:
Code:
Expand Collapse Copy
#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:
Expand Collapse Copy
        // ETC
        DWORD GetMainActorVID();
        DWORD GetMainActorRace();
        DWORD GetMainActorEmpire();
        DWORD GetMainActorSkillGroup();
        void SetEmpireID(DWORD dwEmpireID);
        DWORD GetEmpireID();
        void __TEST_SetSkillGroupFake(int iIndex);
Add on:
Code:
Expand Collapse Copy
#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:
Expand Collapse Copy
#include "PythonTextTail.h"
#include "PythonItem.h"
#include "PythonChat.h"

Add below:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
#include "PythonCubeRenewal.h"
#endif
Find:
Code:
Expand Collapse Copy
            case HEADER_GC_DRAGON_SOUL_REFINE:
                ret = RecvDragonSoulRefine();
                break;
Add below:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
            case HEADER_GC_CUBE_RENEWAL:
                ret = RecvCubeRenewalPacket();
                break;  
#endif
Find:


Code:
Expand Collapse Copy
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:
Expand Collapse Copy
#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:
Expand Collapse Copy
void initsafebox();
void initguild();
void initMessenger();

Add below:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
void intcuberenewal();
#endif
9.Open Client / UserInterface / UserInterface.cpp and find in it:

Code:
Expand Collapse Copy
    initsafebox();
    initguild();
    initServerStateChecker();

Add below:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
    intcuberenewal();
#endif


11. Open and add game / service.h file:
Code:
Expand Collapse Copy
#define ENABLE_CUBE_RENEWAL
12. Open and find game / char.h:
Code:
Expand Collapse Copy
#include "cube.h"
Add below:
Code:
Expand Collapse Copy
#include "cube_renewal.h"
13. Open the file game / cmd_general.cpp and find in it:
Code:
Expand Collapse Copy
ACMD(do_cube)
Replace everything with:
Code:
Expand Collapse Copy
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:
Expand Collapse Copy
        void        Refine(LPCHARACTER ch, const char* c_pData);
Add on:
Code:
Expand Collapse Copy
#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:
Expand Collapse Copy
        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:
Expand Collapse Copy
#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:
Expand Collapse Copy
#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:
Expand Collapse Copy
#include "cube.h"
Add below:
Code:
Expand Collapse Copy
#include "cube_renewal.h"
17. Open the file game / packet.h and find:

Code:
Expand Collapse Copy
    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:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
    HEADER_CG_CUBE_RENEWAL                     = 215,
#endif

Find:
Code:
Expand Collapse Copy
    HEADER_GC_DRAGON_SOUL_REFINE            = 209,
    HEADER_GC_RESPOND_CHANNELSTATUS            = 210,
Add to gold:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
    HEADER_GC_CUBE_RENEWAL                     = 217,
#endif

Find:
Code:
Expand Collapse Copy
#pragma pack()
#endif
Add on:
Code:
Expand Collapse Copy
#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:
Expand Collapse Copy
    Set(HEADER_CG_STATE_CHECKER, sizeof(BYTE), "ServerStateCheck", false);
Add below:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
    Set(HEADER_CG_CUBE_RENEWAL, sizeof(TPacketCGCubeRenewalSend), "CubeRenewalSend", true);
#endif
19. Game / Makefile'a ekle:
Code:
Expand Collapse Copy
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:
Expand Collapse Copy
    def BINARY_DragonSoulGiveQuilification(self):
        self.interface.DragonSoulGiveQuilification()
Add on:
Code:
Expand Collapse Copy
   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:
Expand Collapse Copy
        self.wndDragonSoulRefine = None
        self.wndChat = None
Add below:
Code:
Expand Collapse Copy
        if app.ENABLE_CUBE_RENEWAL:
            self.wndCubeRenewal = None

Find:
Code:
Expand Collapse Copy
   def __MakeCubeResultWindow(self):
        self.wndCubeResult = uiCube.CubeResultWindow()
        self.wndCubeResult.LoadWindow()
        self.wndCubeResult.Hide()

Add below:
Code:
Expand Collapse Copy
    if app.ENABLE_CUBE_RENEWAL:
        def __MakeCubeRenewal(self):
            import uicuberenewal
            self.wndCubeRenewal = uicuberenewal.CubeRenewalWindows()
            self.wndCubeRenewal.Hide()

Find:
Code:
Expand Collapse Copy
        self.__MakeCubeWindow()
        self.__MakeCubeResultWindow()
Add below:
Code:
Expand Collapse Copy
        if app.ENABLE_CUBE_RENEWAL:
            self.__MakeCubeRenewal()

Find:
Code:
Expand Collapse Copy
        # ACCESSORY_REFINE_ADD_METIN_STONE
        if self.wndItemSelect:
            self.wndItemSelect.Destroy()
        # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE

Add below:
Code:
Expand Collapse Copy
        if app.ENABLE_CUBE_RENEWAL:
            if self.wndCubeRenewal:
                self.wndCubeRenewal.Destroy()
                self.wndCubeRenewal.Close()
Find:

Code:
Expand Collapse Copy
        del self.wndUICurtain
        del self.wndChat

Add below:

Code:
Expand Collapse Copy
        if app.ENABLE_CUBE_RENEWAL:
            del self.wndCubeRenewal

Find:
Code:
Expand Collapse Copy
    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:
Expand Collapse Copy
    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:
Expand Collapse Copy
CUBE_RENEWAL_TITLE    Okienko uszlachetniania
CUBE_RENEWAL_BELT_IMPROVE    Podwyższ Szansę
 
Thanks for sharing this system. I was working on it myself and this helped quite a lot.
 
Thank you for sharing this, i'll try to implement this into my server.Have this Bugg's?
 
b03415827dbb95ad6fd1c561ee49a1df.jpg

1. Open the Client / UserInterface / Locale_inc.h file and add:
Code:
Expand Collapse Copy
#define ENABLE_CUBE_RENEWAL
2. Open Client / UI / packet.h and find in it:
Code:
Expand Collapse Copy
    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:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
    HEADER_CG_CUBE_RENEWAL                         = 215,
#endif
Find:
Code:
Expand Collapse Copy
    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:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
    HEADER_GC_CUBE_RENEWAL                         = 217,
#endif
Find:
Code:
Expand Collapse Copy
#pragma pack(pop)
Add below:
Code:
Expand Collapse Copy
#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:
Expand Collapse Copy
#include "PythonExchange.h"
#include "PythonChat.h"

Add on:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
#include "PythonCubeRenewal.h"
#endif
Find:
Code:
Expand Collapse Copy
        CGraphicDevice                m_grpDevice;
        CNetworkDevice                m_netDevice;

        CPythonSystem                m_pySystem;
Add below:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
        CPythonCubeRenewal             m_pyCubeRenewal;
#endif
4.Open client / UserInterface / PythonApplicationModule.cpp and find in it:
Code:
Expand Collapse Copy
#ifdef ENABLE_COSTUME_SYSTEM
    PyModule_AddIntConstant(poModule, "ENABLE_COSTUME_SYSTEM",    1);
#else
    PyModule_AddIntConstant(poModule, "ENABLE_COSTUME_SYSTEM",    0);
#endif
Add on:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
    PyModule_AddIntConstant(poModule, "ENABLE_CUBE_RENEWAL",    1);
#else
    PyModule_AddIntConstant(poModule, "ENABLE_CUBE_RENEWAL",    0);
#endif
Code:
Expand Collapse Copy
5.Open Client / UserInterface / PythonNetworkStream.cpp and find in it:
Code:
Expand Collapse Copy
            Set(HEADER_GC_DRAGON_SOUL_REFINE,        CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCDragonSoulRefine), STATIC_SIZE_PACKET));
Add below:
Code:
Expand Collapse Copy
#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:
Expand Collapse Copy
        // ETC
        DWORD GetMainActorVID();
        DWORD GetMainActorRace();
        DWORD GetMainActorEmpire();
        DWORD GetMainActorSkillGroup();
        void SetEmpireID(DWORD dwEmpireID);
        DWORD GetEmpireID();
        void __TEST_SetSkillGroupFake(int iIndex);
Add on:
Code:
Expand Collapse Copy
#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:
Expand Collapse Copy
#include "PythonTextTail.h"
#include "PythonItem.h"
#include "PythonChat.h"

Add below:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
#include "PythonCubeRenewal.h"
#endif
Find:
Code:
Expand Collapse Copy
            case HEADER_GC_DRAGON_SOUL_REFINE:
                ret = RecvDragonSoulRefine();
                break;
Add below:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
            case HEADER_GC_CUBE_RENEWAL:
                ret = RecvCubeRenewalPacket();
                break; 
#endif
Find:


Code:
Expand Collapse Copy
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:
Expand Collapse Copy
#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:
Expand Collapse Copy
void initsafebox();
void initguild();
void initMessenger();

Add below:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
void intcuberenewal();
#endif
9.Open Client / UserInterface / UserInterface.cpp and find in it:

Code:
Expand Collapse Copy
    initsafebox();
    initguild();
    initServerStateChecker();

Add below:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
    intcuberenewal();
#endif
*** Hidden text: cannot be quoted. ***


11. Open and add game / service.h file:
Code:
Expand Collapse Copy
#define ENABLE_CUBE_RENEWAL
12. Open and find game / char.h:
Code:
Expand Collapse Copy
#include "cube.h"
Add below:
Code:
Expand Collapse Copy
#include "cube_renewal.h"
13. Open the file game / cmd_general.cpp and find in it:
Code:
Expand Collapse Copy
ACMD(do_cube)
Replace everything with:
Code:
Expand Collapse Copy
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:
Expand Collapse Copy
        void        Refine(LPCHARACTER ch, const char* c_pData);
Add on:
Code:
Expand Collapse Copy
#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:
Expand Collapse Copy
        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:
Expand Collapse Copy
#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:
Expand Collapse Copy
#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:
Expand Collapse Copy
#include "cube.h"
Add below:
Code:
Expand Collapse Copy
#include "cube_renewal.h"
17. Open the file game / packet.h and find:

Code:
Expand Collapse Copy
    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:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
    HEADER_CG_CUBE_RENEWAL                     = 215,
#endif

Find:
Code:
Expand Collapse Copy
    HEADER_GC_DRAGON_SOUL_REFINE            = 209,
    HEADER_GC_RESPOND_CHANNELSTATUS            = 210,
Add to gold:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
    HEADER_GC_CUBE_RENEWAL                     = 217,
#endif

Find:
Code:
Expand Collapse Copy
#pragma pack()
#endif
Add on:
Code:
Expand Collapse Copy
#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:
Expand Collapse Copy
    Set(HEADER_CG_STATE_CHECKER, sizeof(BYTE), "ServerStateCheck", false);
Add below:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
    Set(HEADER_CG_CUBE_RENEWAL, sizeof(TPacketCGCubeRenewalSend), "CubeRenewalSend", true);
#endif
19. Game / Makefile'a ekle:
Code:
Expand Collapse Copy
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:
*** Hidden text: cannot be quoted. ***
*** Hidden text: cannot be quoted. ***

22. Open root / game.py and find in it:
Code:
Expand Collapse Copy
    def BINARY_DragonSoulGiveQuilification(self):
        self.interface.DragonSoulGiveQuilification()
Add on:
Code:
Expand Collapse Copy
   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:
Expand Collapse Copy
        self.wndDragonSoulRefine = None
        self.wndChat = None
Add below:
Code:
Expand Collapse Copy
        if app.ENABLE_CUBE_RENEWAL:
            self.wndCubeRenewal = None

Find:
Code:
Expand Collapse Copy
   def __MakeCubeResultWindow(self):
        self.wndCubeResult = uiCube.CubeResultWindow()
        self.wndCubeResult.LoadWindow()
        self.wndCubeResult.Hide()

Add below:
Code:
Expand Collapse Copy
    if app.ENABLE_CUBE_RENEWAL:
        def __MakeCubeRenewal(self):
            import uicuberenewal
            self.wndCubeRenewal = uicuberenewal.CubeRenewalWindows()
            self.wndCubeRenewal.Hide()

Find:
Code:
Expand Collapse Copy
        self.__MakeCubeWindow()
        self.__MakeCubeResultWindow()
Add below:
Code:
Expand Collapse Copy
        if app.ENABLE_CUBE_RENEWAL:
            self.__MakeCubeRenewal()

Find:
Code:
Expand Collapse Copy
        # ACCESSORY_REFINE_ADD_METIN_STONE
        if self.wndItemSelect:
            self.wndItemSelect.Destroy()
        # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE

Add below:
Code:
Expand Collapse Copy
        if app.ENABLE_CUBE_RENEWAL:
            if self.wndCubeRenewal:
                self.wndCubeRenewal.Destroy()
                self.wndCubeRenewal.Close()
Find:

Code:
Expand Collapse Copy
        del self.wndUICurtain
        del self.wndChat

Add below:

Code:
Expand Collapse Copy
        if app.ENABLE_CUBE_RENEWAL:
            del self.wndCubeRenewal

Find:
Code:
Expand Collapse Copy
    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:
Expand Collapse Copy
    if app.ENABLE_CUBE_RENEWAL:
        def BINARY_CUBE_RENEWAL_OPEN(self):
            self.wndCubeRenewal.Show()
24. Add root: *** Hidden text: cannot be quoted. ***


25. Add to uiscript:*** Hidden text: cannot be quoted. ***

26.Translation of locale_interface.txt:
Code:
Expand Collapse Copy
CUBE_RENEWAL_TITLE    Okienko uszlachetniania
CUBE_RENEWAL_BELT_IMPROVE    Podwyższ Szansę

nice man, thanks really! it works fine for me!
 
b03415827dbb95ad6fd1c561ee49a1df.jpg

1. Open the Client / UserInterface / Locale_inc.h file and add:
Code:
Expand Collapse Copy
#define ENABLE_CUBE_RENEWAL
2. Open Client / UI / packet.h and find in it:
Code:
Expand Collapse Copy
    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:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
    HEADER_CG_CUBE_RENEWAL                         = 215,
#endif
Find:
Code:
Expand Collapse Copy
    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:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
    HEADER_GC_CUBE_RENEWAL                         = 217,
#endif
Find:
Code:
Expand Collapse Copy
#pragma pack(pop)
Add below:
Code:
Expand Collapse Copy
#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:
Expand Collapse Copy
#include "PythonExchange.h"
#include "PythonChat.h"

Add on:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
#include "PythonCubeRenewal.h"
#endif
Find:
Code:
Expand Collapse Copy
        CGraphicDevice                m_grpDevice;
        CNetworkDevice                m_netDevice;

        CPythonSystem                m_pySystem;
Add below:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
        CPythonCubeRenewal             m_pyCubeRenewal;
#endif
4.Open client / UserInterface / PythonApplicationModule.cpp and find in it:
Code:
Expand Collapse Copy
#ifdef ENABLE_COSTUME_SYSTEM
    PyModule_AddIntConstant(poModule, "ENABLE_COSTUME_SYSTEM",    1);
#else
    PyModule_AddIntConstant(poModule, "ENABLE_COSTUME_SYSTEM",    0);
#endif
Add on:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
    PyModule_AddIntConstant(poModule, "ENABLE_CUBE_RENEWAL",    1);
#else
    PyModule_AddIntConstant(poModule, "ENABLE_CUBE_RENEWAL",    0);
#endif
Code:
Expand Collapse Copy
5.Open Client / UserInterface / PythonNetworkStream.cpp and find in it:
Code:
Expand Collapse Copy
            Set(HEADER_GC_DRAGON_SOUL_REFINE,        CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCDragonSoulRefine), STATIC_SIZE_PACKET));
Add below:
Code:
Expand Collapse Copy
#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:
Expand Collapse Copy
        // ETC
        DWORD GetMainActorVID();
        DWORD GetMainActorRace();
        DWORD GetMainActorEmpire();
        DWORD GetMainActorSkillGroup();
        void SetEmpireID(DWORD dwEmpireID);
        DWORD GetEmpireID();
        void __TEST_SetSkillGroupFake(int iIndex);
Add on:
Code:
Expand Collapse Copy
#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:
Expand Collapse Copy
#include "PythonTextTail.h"
#include "PythonItem.h"
#include "PythonChat.h"

Add below:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
#include "PythonCubeRenewal.h"
#endif
Find:
Code:
Expand Collapse Copy
            case HEADER_GC_DRAGON_SOUL_REFINE:
                ret = RecvDragonSoulRefine();
                break;
Add below:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
            case HEADER_GC_CUBE_RENEWAL:
                ret = RecvCubeRenewalPacket();
                break; 
#endif
Find:


Code:
Expand Collapse Copy
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:
Expand Collapse Copy
#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:
Expand Collapse Copy
void initsafebox();
void initguild();
void initMessenger();

Add below:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
void intcuberenewal();
#endif
9.Open Client / UserInterface / UserInterface.cpp and find in it:

Code:
Expand Collapse Copy
    initsafebox();
    initguild();
    initServerStateChecker();

Add below:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
    intcuberenewal();
#endif
*** Hidden text: cannot be quoted. ***


11. Open and add game / service.h file:
Code:
Expand Collapse Copy
#define ENABLE_CUBE_RENEWAL
12. Open and find game / char.h:
Code:
Expand Collapse Copy
#include "cube.h"
Add below:
Code:
Expand Collapse Copy
#include "cube_renewal.h"
13. Open the file game / cmd_general.cpp and find in it:
Code:
Expand Collapse Copy
ACMD(do_cube)
Replace everything with:
Code:
Expand Collapse Copy
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:
Expand Collapse Copy
        void        Refine(LPCHARACTER ch, const char* c_pData);
Add on:
Code:
Expand Collapse Copy
#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:
Expand Collapse Copy
        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:
Expand Collapse Copy
#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:
Expand Collapse Copy
#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:
Expand Collapse Copy
#include "cube.h"
Add below:
Code:
Expand Collapse Copy
#include "cube_renewal.h"
17. Open the file game / packet.h and find:

Code:
Expand Collapse Copy
    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:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
    HEADER_CG_CUBE_RENEWAL                     = 215,
#endif

Find:
Code:
Expand Collapse Copy
    HEADER_GC_DRAGON_SOUL_REFINE            = 209,
    HEADER_GC_RESPOND_CHANNELSTATUS            = 210,
Add to gold:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
    HEADER_GC_CUBE_RENEWAL                     = 217,
#endif

Find:
Code:
Expand Collapse Copy
#pragma pack()
#endif
Add on:
Code:
Expand Collapse Copy
#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:
Expand Collapse Copy
    Set(HEADER_CG_STATE_CHECKER, sizeof(BYTE), "ServerStateCheck", false);
Add below:
Code:
Expand Collapse Copy
#ifdef ENABLE_CUBE_RENEWAL
    Set(HEADER_CG_CUBE_RENEWAL, sizeof(TPacketCGCubeRenewalSend), "CubeRenewalSend", true);
#endif
19. Game / Makefile'a ekle:
Code:
Expand Collapse Copy
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:
*** Hidden text: cannot be quoted. ***
*** Hidden text: cannot be quoted. ***

22. Open root / game.py and find in it:
Code:
Expand Collapse Copy
    def BINARY_DragonSoulGiveQuilification(self):
        self.interface.DragonSoulGiveQuilification()
Add on:
Code:
Expand Collapse Copy
   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:
Expand Collapse Copy
        self.wndDragonSoulRefine = None
        self.wndChat = None
Add below:
Code:
Expand Collapse Copy
        if app.ENABLE_CUBE_RENEWAL:
            self.wndCubeRenewal = None

Find:
Code:
Expand Collapse Copy
   def __MakeCubeResultWindow(self):
        self.wndCubeResult = uiCube.CubeResultWindow()
        self.wndCubeResult.LoadWindow()
        self.wndCubeResult.Hide()

Add below:
Code:
Expand Collapse Copy
    if app.ENABLE_CUBE_RENEWAL:
        def __MakeCubeRenewal(self):
            import uicuberenewal
            self.wndCubeRenewal = uicuberenewal.CubeRenewalWindows()
            self.wndCubeRenewal.Hide()

Find:
Code:
Expand Collapse Copy
        self.__MakeCubeWindow()
        self.__MakeCubeResultWindow()
Add below:
Code:
Expand Collapse Copy
        if app.ENABLE_CUBE_RENEWAL:
            self.__MakeCubeRenewal()

Find:
Code:
Expand Collapse Copy
        # ACCESSORY_REFINE_ADD_METIN_STONE
        if self.wndItemSelect:
            self.wndItemSelect.Destroy()
        # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE

Add below:
Code:
Expand Collapse Copy
        if app.ENABLE_CUBE_RENEWAL:
            if self.wndCubeRenewal:
                self.wndCubeRenewal.Destroy()
                self.wndCubeRenewal.Close()
Find:

Code:
Expand Collapse Copy
        del self.wndUICurtain
        del self.wndChat

Add below:

Code:
Expand Collapse Copy
        if app.ENABLE_CUBE_RENEWAL:
            del self.wndCubeRenewal

Find:
Code:
Expand Collapse Copy
    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:
Expand Collapse Copy
    if app.ENABLE_CUBE_RENEWAL:
        def BINARY_CUBE_RENEWAL_OPEN(self):
            self.wndCubeRenewal.Show()
24. Add root: *** Hidden text: cannot be quoted. ***


25. Add to uiscript:*** Hidden text: cannot be quoted. ***

26.Translation of locale_interface.txt:
Code:
Expand Collapse Copy
CUBE_RENEWAL_TITLE    Okienko uszlachetniania
CUBE_RENEWAL_BELT_IMPROVE    Podwyższ Szansę
The download links have expired, can you renew them?
 
Status
Not open for further replies.
Back
Top