Jump to content

Recommended Posts

  • Bot
This is the hidden content, please

Alternative download links →

This is the hidden content, please

 

PS: I don't know what versions these fixes were added in 

Fixes:
- First click doesn't fail anymore (when clicking from a distance)
- If the mining fails the change will be broadcasted around (also for you)

Notes:
- InstanceBase.cpp -> FUNC_WAIT: this is diferent in the oficial binary, I just adapted it for mining only
- Server part is just a guess because they added this (kDigMotion.target_vid == 0 && kDigMotion.count == 0) in PythonNetworkStreamPhaseGame.cpp
- The notice function from game.py is also changed (def OnCannotMining) but I can't find the texts in locale_game.txt

Spoiler
def OnCannotMining(self, fail_type):
    if fail_type == playerm2g2.MINING_FAIL_ON_MOUNT:
        chatm2g.AppendChat(chatm2g.CHAT_TYPE_INFO, localeInfo.GAME_CANNOT_MINING)
    elif fail_type == playerm2g2.MINING_FAIL_WITHOUT_PICK:
        chatm2g.AppendChat(chatm2g.CHAT_TYPE_INFO, localeInfo.MINING_FAIL_WITHOUT_PICK)
    elif fail_type == playerm2g2.MINING_FAIL_WHEN_POLY:
        chatm2g.AppendChat(chatm2g.CHAT_TYPE_INFO, localeInfo.MINING_FAIL_WHEN_POLY)
        
void CPythonPlayer::__SendClickActorPacket(CInstanceBase& rkInstVictim)
{
    if (rkInstVictim.IsResource())
    {
        CInstanceBase* pkInstMain = NEW_GetMainActorPtr();
        if (pkInstMain)
        {
            BYTE bFailType = 0;

           if (pkInstMain->IsPoly())
            {
                bFailType = CPythonPlayer::MINING_FAIL_WHEN_POLY;
            }
            else if (!pkInstMain->IsHoldingPickAxe())
            {
                bFailType = CPythonPlayer::MINING_FAIL_WITHOUT_PICK;
            }
            else if (pkInstMain->IsMountingHorse())
            {
                bFailType = CPythonPlayer::MINING_FAIL_ON_MOUNT;
            }

            if (bFailType != 0)
            {
                PyCallClassMemberFunc(m_ppyGameWindow, "OnCannotMining", Py_BuildValue("(i)", bFailType));
                return;
            }
        }
    }

    static DWORD s_dwNextTCPTime = 0;

    DWORD dwCurTime              = ELTimer_GetMSec();

    if (dwCurTime >= s_dwNextTCPTime)
    {
        s_dwNextTCPTime                   = dwCurTime + 1000;

        CPythonNetworkStream& rkNetStream = CPythonNetworkStream::Instance();
        DWORD dwVictimVID                 = rkInstVictim.GetVirtualID();

        rkNetStream.SendOnClickPacket(dwVictimVID);
    }
}

 


.gif

 

  • Metin2 Dev 23
  • Flame 2
  • Good 3
  • muscle 1
  • Love 8

english_banner.gif

Link to comment
https://metin2.dev/topic/34478-mining-improvements-reversed/
Share on other sites

  • Honorable Member
Posted (edited)

The fail_type came with v25.1.6. and the custom mining motion type in 2018.

Spoiler

CqEcfM.jpg

The texts are not in the locale, they forgot to add them, since then it still spams into syserr.

Edited by Metin2 Dev International
Core X - External 2 Internal
  • Metin2 Dev 2
  • Love 1

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.