Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Action frame for sub job

Newbie Spellweaver
Joined
Aug 1, 2014
Messages
26
Reaction score
10
Hello everyone I'm currently working on a terrible GF flaw. As you know, when you change the main class, you get a clean action frame. But when you change the additional class, the action frame remains unchanged. So far, I've only found a few scripts in the source code, but I can't figure out how to apply them so that it works with an additional class.



I found a script that writes a file with an action frame

C++:
void CActionFrame::Save()
{
    if (m_interface == NULL || m_interface->IsLoadVariables() == false)
        return;

    FILE* fptr = NULL;
    wstring globalName = GetGlobalPathW(L"Action.bsd");
    wstring localName = GetLocalPathW(L"Action.bsd");

    // 儲存共用資料           

    // 記錄資料   

    // 關閉檔案   

    if ((fptr = _wfopen(localName.c_str(), L"wb")) != NULL)
    {
        int size;
        int version;
        int classNum;
        int itemNum;

        // 第二版
        {
            // 寫入識別編號
            version = ACTION_ITEM_VERSION;
            fwrite(&version, sizeof(int), 1, fptr);

            // 寫入結構大小
            size = sizeof(ActionItem2);
            fwrite(&size, sizeof(int), 1, fptr);

            // 寫入職業個數
            classNum = ACTION_BAR_MAX_CLASS;
            fwrite(&classNum, sizeof(int), 1, fptr);

            // 寫入一個職業最大按鈕個數
            itemNum = ACTION_BAR_MAX_ITEMS;
            fwrite(&itemNum, sizeof(int), 1, fptr);

            // 儲存整筆資料
            fwrite(m_items, size, classNum * itemNum, fptr);
        }

        // 關閉檔案
        fclose(fptr);
    }

    fptr = NULL;
    localName = GetLocalPathW(L"ActionSetting.bsd");
    if ((fptr = _wfopen(localName.c_str(), L"wb")) != NULL)
    {
        int size;
        int version;

        // 寫入識別編號
        version = ACTION_ITEM_VERSION;
        fwrite(&version, sizeof(int), 1, fptr);

        // 寫入結構大小
        size = sizeof(ActionBarSetting);
        fwrite(&size, sizeof(int), 1, fptr);

        // 寫入資料大小
        fwrite(&m_setting, sizeof(ActionBarSetting), 1, fptr);

        // 關閉檔案
        fclose(fptr);
    }
}


and class change script
C++:
void NetCli_RoleValueChild::R_ChangeJobResult( ChangeJobResult_ENUM Result )
{   
    int job[2] = { 0, 0 };
    int level[2] = { 0, 0 };

    job[0] = g_pExchangeClassFrame->GetExchangeMainClass();
    job[1] = g_pExchangeClassFrame->GetExchangeSubClass();
    if ( job[0] > 0 )
        level[0] = RoleData()->PlayerBaseData->AbilityList[job[0]].Level;
    if ( job[1] > 0 )
        level[1] = RoleData()->PlayerBaseData->AbilityList[job[1]].Level;

    g_pExchangeClassFrame->Locked(false);
    switch (Result)
    {
    case EM_ChangeJobResult_OK:
        g_pExchangeClassFrame->SendWorldEvent("EXCHANGECLASS_SUCCESS");
        g_pChatFrame->SendChatMessage(CHAT_MSG_SYSTEM, "", g_ObjectData->GetSpecialString("SYS_EXCHANGE_CLASS_SUCCESS"));

        // message
        {           
            CRoleSprite* player = g_pGameMain->GetPlayer();
            if ( player ) {
                char buf[512];
                char temp[512];               

                strcpy(buf, g_ObjectData->GetString("SYS_EXCHANGE_CLASS_RESULT"));
                if ( level[0] > 0 )
                {
                    sprintf(temp, "%s Lv%d", g_ObjectData->GetClassNameByID((Voc_ENUM)job[0]), level[0]);
                    strcat(buf, temp);
                }
                if ( level[1] > 0 )
                {
                    sprintf(temp, "%s Lv%d", g_ObjectData->GetClassNameByID((Voc_ENUM)job[1]), level[1]);
                    strcat(buf, temp);
                }
                g_pGameMain->SendSystemMsg(buf);
            }
        }

        return;

    case EM_ChangeJobResult_Failed:
        break;
    }

    const char* msg = g_ObjectData->GetSpecialString("SYS_EXCHANGE_CLASS_ERR_1");
    g_pGameMain->SendWarningMsg(msg);
    g_pChatFrame->SendMsgEvent(CHAT_MSG_SYSTEM, msg, "");
}

If someone can help me figure this out, I will be very grateful! You can also use it in private messages. I am glad of any way to help. I have been dealing with this issue for a very long time
 
Back
Top