Jump to content

Kafa

Inactive Member
  • Posts

    269
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by Kafa

  1. void locale_quest_init(const char* filename, BYTE lang)
    {
    	std::ifstream file(filename);
    	if (file.is_open() == false)
    	{
    		sys_err("Cannot open %s file.", filename);
    		return;
    	}
    
    	std::string   line;
    
    	while (std::getline(file, line))
    	{
    		std::stringstream			linestream(line);
    		int							vnum;
    		std::string					text;
    
    		std::getline(linestream, text, '\t');
    
    		if (text.empty() || text.at(0) == '#')
    			continue;
    
    		linestream >> vnum;
    		localequest[lang].insert(std::make_pair(vnum, text));
    	}
    
    	file.close();
    }

     

    Can someone help me, i do not understand what's wrong there 😞 

    Goal was to read 

    13305	Hey! Do you have the key to free me?
    13306	Please set me free. Can't anybody help me?

    These lines from locale_quest.txt

  2. 2 hours ago, Mali said:

    #Version: 2.5

    Without-LZO brach

    For enable LZO:

      Reveal hidden contents

    1) Set UseLZO option to true (at config.json)

    2) Enable __CHEST_DROP_USELZO__ macro (at ItemManager.cpp)

    Now you can see chests which contains that item:

    0420270105-005831.jpg0420270105-005857.jpg

    Insane!!! Bro I have a question could you code the auto hunt from official gf root 2k18 If you are bored? I really really love your coding style thank you for everything !!!

    • Metin2 Dev 1
  3. Hey guys im having this issue: 

     

    SYSERR: Reset Device Failed in my client when i try to open another client as admin

     

    i followed @ Distraught Instructions and did this:

     

    In EterLib/GrpScreen.cpp find CScreen::RestoreDevice and in the

    if (FAILED(hrReset))

    condition add (and don't forget to include comdef.h)

    _com_error ce(hrReset);

    const TCHAR* errMsg = ce.ErrorMessage();

     

    to see what is the error but i just receive "Unknown Error 0x8876086C"

     

    I offer money to fix my problem i tried to fix this for weeks now..

     

     

  4. On 11/14/2021 at 4:39 PM, CsanMag said:

    If I remove all these features will the server be faster or why we need to remove them?

    I get they are not used but that's it? It's just about thinning the code?

    I don't recommend you using this tutorial if you don't understand what you do, the code's are just there, just keep them. 😄  (Just my opinion, dont change what you dont understand)

  5. 6 hours ago, Abel(Tiger) said:
    				BYTE bMaxItemSize = 1;
    				const CSpecialItemGroup* pGroup = ITEM_MANAGER::instance().GetSpecialItemGroup(dwBoxVnum);
    				if (pGroup)
    				{
    					for (int i = 0; i < pGroup->GetGroupSize(); i++)
    					{
    						const TItemTable* itemTable = ITEM_MANAGER::instance().GetTable(pGroup->GetVnum(i));
    						if(itemTable)
    						{
    							if(itemTable->bSize > bMaxItemSize)
    							{
    								bMaxItemSize = itemTable->bSize;
    								if(bMaxItemSize == 3)
    									break;
    							}
    						}
    					}
    				}
    				
    				if(GetEmptyInventory(bMaxItemSize) == -1)
    				{
    					ChatPacket(CHAT_TYPE_INFO, "You need %d perpendicular slots in your inventory to open the Chest.", bMaxItemSize);
    					return false;
    				}

     

    Place it in char_item.cpp inside case ITEM_GIFTBOX: after dwBoxVnum. (there are other cases for other types of chests, this instruction is only for giftbox type). 

    Also I think the max size from the chest must be a info loaded when the special group is loaded and saved in a variable.

    The code I posted for you increases the time complexity of the function and it's not a good ideea 😀

     

     

    It was a patch to a item duplication bug. I'm pretty sure this is something everyone needs (since the dupe-bug appeared on official server)

     

    Big thanks to you abel.

  6. 17 hours ago, DrTurk said:

    ye better, the thing that i did was without checking if the string is empty

    also created something for whisper because of duel:

    pkVictim->LocaleWhisperPacket(WHISPER_TYPE_SYSTEM , pkChr, 503, "%s challenged you to a battle!", pkChr->GetName());

    but the ugliest part that i did was for the priv_empire, no one wants to see what i did there 🤣

     

    Can i ask you what you did at start_position.cpp/,h ? 

  7. 6 hours ago, DrTurk said:

    Just create another function like that:

    void SendNoticeMapLocal(DWORD dwIndex, const char* c_pszBuf, int nMapIndex, bool bBigFont, ...)
    {
    	BYTE type = 0;
    
    	const DESC_MANAGER::DESC_SET& c_ref_set = DESC_MANAGER::instance().GetClientSet();
    	if (!c_pszBuf)
    		return;
    
    	DESC_MANAGER::DESC_SET::const_iterator it = c_ref_set.begin();
    
    	while (it != c_ref_set.end())
    	{
    		LPDESC d = *(it++);
    
    		if (d->GetCharacter())
    		{
    			if (d->GetCharacter()->GetMapIndex() != nMapIndex)
    				continue;
    
    			bool isNotice = false;
    			if (c_pszBuf == "%s")
    			{
    				char chatbuf[CHAT_MAX_LEN + 1];
    				va_list args;
    
    				va_start(args, c_pszBuf);
    				vsnprintf(chatbuf, sizeof(chatbuf), c_pszBuf, args);
    				va_end(args);
    
    				strlcpy(chatbuf, c_pszBuf, sizeof(chatbuf));
    				isNotice = true;
    			}
    
    			TEMP_BUFFER buf;
    
    			if (bBigFont == true)
    			{
    				type = CHAT_TYPE_BIG_NOTICE;
    			}
    			else
    			{
    				type = CHAT_TYPE_NOTICE;
    			}
    
    			TPacketGCLocaleChat packet;
    			packet.header = HEADER_GC_LOCALE_CHAT;
    			packet.size = sizeof(TPacketGCLocaleChat);
    			packet.type = type;
    			packet.format = dwIndex;
    
    			va_list args;
    
    			va_start(args, bBigFont);
    			FindFormatSpecifiers(c_pszBuf, args, &packet.size, &buf);
    			va_end(args);
    
    			d->Packet(&packet, sizeof(packet));
    
    			if (buf.size())
    				d->Packet(buf.read_peek(), buf.size());
    		}
    	}
    }

    then you can use it like that:

    void WeddingMap::SetEnded(DWORD dwMapIndex)
    	{
    		if (m_pEndEvent)
    		{
    			sys_err("WeddingMap::SetEnded - ALREADY EndEvent(m_pEndEvent=%x)", get_pointer(m_pEndEvent));
    			return;
    		}
    
    		wedding_map_info* info = AllocEventInfo<wedding_map_info>();
    
    		info->pWeddingMap = this;
    
    		m_pEndEvent = event_create(wedding_end_event, info, PASSES_PER_SEC(5));
    
    		SendNoticeMapLocal(889, " ", dwMapIndex, true);
    		SendNoticeMapLocal(447, " ", dwMapIndex, true);

     

     

    Thanks buddy, im pretty sure we need to change something in client source too, am i right? 

    Cause currently the chat packets are only appearing in chat. The big notice thing doesnt appear. If you understand me 🙂 

  8. Can someone help me with Wedding & war_map ?

     

    I mean 

     

    	struct FNotice
    	{
    		FNotice(const char * psz) : m_psz(psz)
    		{
    		}
    
    		void operator() (LPCHARACTER ch)
    		{
    			ch->ChatPacket(CHAT_TYPE_NOTICE, "%s", m_psz);
    		}
    
    		const char * m_psz;
    	};

     

    I would really love if someone extends the topic with notice, so i can actually use this beatiful release.

  9. Seems like i can't edit posts, anyways:

     

    - Fixed the empire reselect bug which was caused due to include "service.h" was missing.

    - Fixed a bug in character window where the values were shown as 999 because some function was missing. (Added isPoly function) 

    -  Fixed a bug in official multi textline (NO NOT the public ones..) where after each popupdialog the line position got more buggy during the client opened time.

     

     Im almost done, should i create a new topic? Maybe this can be our Metin2.dev community files. :) 

    • Sad 1
    • Good 2
    • Love 1
  10. I updated my first post with things i already made, i'll definitly try to fix the existing exploits too. (I'll tell what is fixed, so you know what is already done)

    There are currently some problems when logging in you always need to choose your empire and also some small wolfman bugs, that i need to fix. :P 

    From now on i'll update my posts, to avoid spam.

     

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