Jump to content

Fix Korean Errors #PART3


Recommended Posts

  • Premium

As promised, here's to you:

 

1 - NullPtr + NewCase on famous Item MYTHICAL_PEACH

char_item.cpp

Find for:

case 71107:

 

Add below of this line:   

quest::PC* pPC = quest::CQuestManager::instance().GetPC(GetPlayerID());

This prevent:

                                    if (!pPC)
                                        return false;

In your database there is an item like 71107, add the other case for it.

                            case 71107:
                            case 39032:

 

2 - Warp_all_to_village function was keeping also STAFF out.

Replace the struct like this in questlua_global.cpp

    struct FWarpAllToVillage
    {
        FWarpAllToVillage() {};
        void operator()(LPENTITY ent)
        {
            if (ent->IsType(ENTITY_CHARACTER))
            {
                const LPCHARACTER ch = (LPCHARACTER) ent;
                if (ch)
                {
                    if (ch->IsPC() && !ch->IsGM())
                    {
                        const auto bEmpire = ch->GetEmpire();
                        if (!bEmpire)
                            return;

                        ch->WarpSet( g_start_position[bEmpire][0], g_start_position[bEmpire][1] );
                    }
                }
            }
        }
    };

 

 

3 - Enable Syserr also in LUA.

In file questlua_global.cpp

find for 

int _syserr(lua_State* L)

or

ALUA(_syserr)

 

If you don't have it or if you have, replace or insert this function .

    int _syserr(lua_State* L)
    {
        if (!lua_isstring(L, 1))
            return 0;

        sys_err("From LUA: %s", lua_tostring(L, 1));
/*
        PC* pc = CQuestManager::instance().GetCurrentPC();
        if (!pc)
            return 0;

        LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
        if (!ch)
            return 0;

        ch->ChatPacket(CHAT_TYPE_INFO, "QUEST_SYSERR %s", lua_tostring(L, 1));
*/
        return 0;
    }

OR
    int _syserr(lua_State* L)
    {
        if (!lua_isstring(L, 1))
            return 0;

        sys_err("From LUA: %s", lua_tostring(L, 1));

        PC* pc = CQuestManager::instance().GetCurrentPC();
        if (!pc)
            return 0;

        LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
        if (ch)
       	    ch->ChatPacket(CHAT_TYPE_INFO, "QUEST_SYSERR %s", lua_tostring(L, 1));
  
        return 0;
    }

As you can see I commented the char part, because I suggest to use without! For server_timer and automatic things without char entity etc.

Don't forget to add the function in RegisterGlobalFunctionTable and quest_functions file.

 

 

4 - Fix of bonus application like Official on special mineral slots.

File item.cpp find for:

if (0 != accessoryGrade)

replace the if statement with this for 2 bonus only:

if (0 != accessoryGrade && i < ITEM_APPLY_MAX_NUM - 1)

UPDATE:

From 2020-21 in official site, the bonus are shown and apply x3. 

So if you want to have like official, just leave c++ default and fix in python the show of the 3rd bonus.

 

 

5 - item with remain time stay into a shop, time shows: "Remain time 0 Sec.".

In file uitooltip.py replace these functions:

    def AppendUniqueItemLastTime(self, restMin):

    def AppendMallItemLastTime(self, endTime):

Like this:

    def AppendUniqueItemLastTime(self, restMin):
        if restMin > 0:
            restSecond = restMin*60
            self.AppendSpace(5)
            self.AppendTextLine(localeInfo.LEFT_TIME + " : " + localeInfo.SecondToHM(restSecond), self.NORMAL_COLOR)

    def AppendMallItemLastTime(self, endTime):
        if endTime > 0:
            leftSec = max(0, endTime - app.GetGlobalTimeStamp())
            self.AppendSpace(5)
            self.AppendTextLine(localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(leftSec), self.NORMAL_COLOR)

 

Edited by WeedHex
  • Metin2 Dev 1
  • Love 26
Link to comment
Share on other sites

  • 2 weeks later...

im so grateful. thanks.

39032 alreaddy written in ori_to_new_table so its unnecessary

On 6/6/2019 at 5:32 AM, WeedHex said:

In your database there is an item like 71107, add a new case for it 39032.


                            case 71107:
                            case 39032:

 

 

Link to comment
Share on other sites

  • 6 months later...
  • 1 year later...

Announcements



×
×
  • 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.