Jump to content

Recommended Posts

  • Honorable Member

M2 Download Center

This is the hidden content, please
( Internal )

This is the hidden content, please
( GitHub )

Spoiler

270404687474703a2f2f69332e7974696d672e63

Hi, I made this system not so long ago, benefited the script from the official server and worked on the C++, just decided to share this system with everyone because I no longer care much about it. It’s not really a big of a system and most likely it could be leaked from some traitor so honestly, I rather share it myself.
Instead of adding the tutorial here I will link a repository to the guidelines.

 

Demonstration

 

 

The inventory slot marking works best with @xP3NG3Rx's release.
I do not support the implementation of the system neither does do author of the inventory slot marking, I believe.

 

  • Metin2 Dev 116
  • kekw 1
  • Eyes 2
  • Dislove 2
  • Cry 1
  • Think 1
  • Scream 1
  • Good 37
  • Love 5
  • Love 97
Link to comment
https://metin2.dev/topic/23870-skill-book-combination-system/
Share on other sites

  • 7 months later...
  • Active Member

my problem is this:    GIF

 

Don't remove books from special inventory, and don't add to new book.

 

Does anybody have idea?

 

This part (original):

 

Spoiler


#if defined(__SKILLBOOK_COMB_SYSTEM__)
bool CInputMain::SkillBookCombination(LPCHARACTER ch, TItemPos(&CombItemGrid)[SKILLBOOK_COMB_SLOT_MAX], BYTE bAction)
{
	if (!ch->GetDesc())
		return false;

	// if (CombItemGrid.empty())
		// return false;

	if (ch->GetExchange() || ch->GetShop() || ch->GetMyShop() || ch->IsOpenSafebox() || ch->IsCubeOpen())
		return false;

	if (bAction != 2 /* COMBI_START */)
		return false;

	std::set <LPITEM> set_items;
	for (int i = 0; i < SKILLBOOK_COMB_SLOT_MAX; i++)
	{
		LPITEM pItem = ch->GetItem(CombItemGrid[i]);
		if (pItem)
		{	
			if (pItem->GetType() != ITEM_SKILLBOOK)
				return false;

			set_items.insert(pItem);
		}
	}

	if (set_items.empty())
		return false;

	if (ch->GetGold() < SKILLBOOK_COMB_COST)
	{
		ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You don't have enough Yang to trade books with me."));
		return false;
	}

	for (std::set <LPITEM>::iterator it = set_items.begin(); it != set_items.end(); ++it)
	{
		LPITEM pItem = *it;
		if (pItem)
		{
			pItem->SetCount(pItem->GetCount() - 1);
			// pItem->RemoveFromCharacter();
			// M2_DESTROY_ITEM(pItem);
		}
	}

	DWORD dwBooks[JOB_MAX_NUM][2 /* SKILL_GROUPS */][2] = {
		{ // 0 - Warrior
			{50401, 50406}, // Skill Group 1
			{50416, 50421}, // Skill Group 2
		},
		{ // 1 - Ninja
			{50431, 50436}, // Skill Group 1
			{50446, 50451}, // Skill Group 2
		},
		{ // 2 - Sura
			{50461, 50466}, // Skill Group 1
			{50476, 50481}, // Skill Group 2
		},
		{ // 3 - Shaman
			{50491, 50496}, // Skill Group 1
			{50506, 50511}, // Skill Group 2
		},
	#ifdef ENABLE_WOLFMAN_CHARACTER
		{ // 4 - Wolfman
			{50530, 50535}, // Skill Group 1
			{0, 0}, // Skill Group 2
		},
	#endif
	};

	ch->PointChange(POINT_GOLD, -SKILLBOOK_COMB_COST);

	if (ch->GetSkillGroup() != 0)
	{
		DWORD dwMinRandomBook = dwBooks[ch->GetJob()][ch->GetSkillGroup() - 1][0];
		DWORD dwMaxRandomBook = dwBooks[ch->GetJob()][ch->GetSkillGroup() - 1][1];

		std::random_device rd;
		std::mt19937 gen(rd());
		std::uniform_real_distribution<> dis(dwMinRandomBook, dwMaxRandomBook);
		DWORD dwRandomBook = dis(gen);

		ch->AutoGiveItem(dwRandomBook, 1);
	}
	else
		ch->AutoGiveItem(50300, 1);

	return true;
}
#endif

 

 

Edited by Metin2 Dev
Core X - External 2 Internal

Buy a new system? 
My systems:  https://payhip.com/Pisti95

  • 2 months later...
  • Active Member

My problem is this:    GIF

 

Solution my problem:

char.h

Everywhere in the file

Search for:

BYTE bCell

Change for:

UINT bCell


After

Search for: (everywhere too)

BYTE bDestCell

Change for:

UINT bDestCell

 

 

             You should do In char_item.cpp too.

 

 

 

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

Buy a new system? 
My systems:  https://payhip.com/Pisti95

  • 2 months later...

After edit a bit uiskillbook...py

            #    if self.inven or self.invenSpecial:
                if self.invenSpecial:

 

Got exactly the same problem als Pisti95, and BYTE bCell > UINT bCell doesnt work for me ?

Edited by danhakhavro
1 hour ago, Pisti95 said:

Use uiskillbook.py from GF root, if you can’t do the python part.

Python part working well. I have exactly the same problem: GIF

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
6 hours ago, Pisti95 said:

Check out my files.

This is the hidden content, please

 

Thanks for your reply. Now i got this error:

 

0614 14:14:46801 :: Traceback (most recent call last):

0614 14:14:46801 ::   File "uiSkillBookCombination.py", line 224, in OnPressEscapeKey

0614 14:14:46801 ::   File "uiSkillBookCombination.py", line 40, in Close

0614 14:14:46801 ::   File "uiSkillBookCombination.py", line 174, in SetCanMouseEventSlot

0614 14:14:46801 :: AttributeError
0614 14:14:46801 :: : 
0614 14:14:46801 :: 'NoneType' object has no attribute 'GetInventoryPageIndex'
0614 14:14:46801 :: 

 

Line 174:

	def SetCanMouseEventSlot(self, idx):
		if not isinstance(idx, types.NoneType):
			if app.WJ_SPLIT_INVENTORY_SYSTEM:
				if self.inven or self.invenSpecial:
					page = self.inven.GetInventoryPageIndex() # range 0 ~ 1
					special_page = self.invenSpecial.GetInventoryPageIndex()
					
					if (page * INVENTORY_PAGE_SIZE) <= idx < ((page + 1) * INVENTORY_PAGE_SIZE): # range 0 ~ 44, 45 ~ 89
						idx = idx - (page * INVENTORY_PAGE_SIZE)
						self.inven.wndItem.SetCanMouseEventSlot(idx)

					elif self.invenSpecial.GetInventoryType() == 0:
						if (item.SKILL_BOOK_INVENTORY_SLOT_START + (special_page * SPECIAL_INVENTORY_PAGE_SIZE)) <= idx < (item.SKILL_BOOK_INVENTORY_SLOT_START + (((special_page + 1) * SPECIAL_INVENTORY_PAGE_SIZE))):
							idx = idx - (item.SKILL_BOOK_INVENTORY_SLOT_START + (special_page * SPECIAL_INVENTORY_PAGE_SIZE))
							self.invenSpecial.wndItem.SetCanMouseEventSlot(idx)

 

If i make:

            #    if self.inven or self.invenSpecial:
                if self.invenSpecial:

 

Than happen the previous bug: GIF

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 4
  • Good 1
  • Love 2
  • 4 months later...

    if (!ch)
        return;

Owsap may have forgotten because he loves game.core so much. Please add just in case. 
I deleted the folder. keep it if it's void and false if it's bool.

Edited by EAkar
    if (!c_pData)         return; delete
1029 22:03:29127 :: Traceback (most recent call last):

1029 22:03:29127 ::   File "ui.py", line 1535, in OnSelectEmptySlot

1029 22:03:29127 ::   File "ui.py", line 87, in __call__

1029 22:03:29127 ::   File "ui.py", line 78, in __call__

1029 22:03:29127 ::   File "uiSkillBookCombination.py", line 116, in SelectEmptySlot

1029 22:03:29128 :: AttributeError
1029 22:03:29128 :: : 
1029 22:03:29128 :: 'module' object has no attribute 'ITEM_SLOT_COUNT'
1029 22:03:29128 :: 

Any ideea? I don t have special invetory.

  • Active Member
On 10/29/2021 at 10:23 PM, narcisxb said:
1029 22:03:29127 :: Traceback (most recent call last):

1029 22:03:29127 ::   File "ui.py", line 1535, in OnSelectEmptySlot

1029 22:03:29127 ::   File "ui.py", line 87, in __call__

1029 22:03:29127 ::   File "ui.py", line 78, in __call__

1029 22:03:29127 ::   File "uiSkillBookCombination.py", line 116, in SelectEmptySlot

1029 22:03:29128 :: AttributeError
1029 22:03:29128 :: : 
1029 22:03:29128 :: 'module' object has no attribute 'ITEM_SLOT_COUNT'
1029 22:03:29128 :: 

Any ideea? I don t have special invetory.

 

in GameType.h, if you have this:

const DWORD c_ItemSlot_Count = c_Inventory_Page_Size * c_Inventory_Page_Count;

 

You should add it to your PythonPlayerModule.cpp:

	PyModule_AddIntConstant(poModule, "ITEM_SLOT_COUNT",		c_ItemSlot_Count);

 

  • Metin2 Dev 1

Buy a new system? 
My systems:  https://payhip.com/Pisti95

  • 5 months later...
  • Honorable Member
On 4/30/2022 at 2:25 PM, speze012 said:

@ Owsap Why man why?

d83d747e655fc1e951dffb1c954da1e6.png

 

Quote

"Why man why?"

I'm sorry but this just frustrates me and makes me think that you are selfish and ungrateful, no offense but this question on the other hand offends me because this system was released free for all M2Dev members and despite your ignorance seeing the download button and link to the repository on the top of the topic just makes me think you want to make a problem out of 5 euro coffee money.


It's not like I’m asking or demanding anyone to spend 5€ on a free system, it doesn’t make sense so just to respond your question and curiosity of why I added a 5€ button on my website is just to give the opportunity for people that want to help and donate this free release and personally, I don’t see any problem with this but who cares, most people just want free, free, free and don’t value the work of others and appreciate the shares.

Addionally, the other reason I decided to add a value for downloading the system on my website was because I was constantly getting emails of orders regarding all free systems on my website.

So, I don't get why you waste your time asking for something that looks obvious? “This system is free and on his website it’s 5 euros? Yeah, maybe it’s just for donations if anyone wants to say “thanks”.

I hope you understand now...
Edit: I have added Yes/No donate button just for your satisfaction.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
  • 2 years later...

Hello everyone, first of all, thank you very much for someone taking the trouble to create such a system to share it with everyone ❤️ I tried to install the system, but unfortunately I get this error.

Quote


linking ../game_r41051
/usr/local/bin/ld: .obj/input_main.o: in function `CInputMain::SkillBookCombination(CHARACTER*, SItemPos (&) [10], unsigned char)':
/home/server/Srcs/Server/game/src/input_main.cpp:4010: undefined reference to `CItem::IsSkillBook() const'
collect2: error: ld returned 1 exit status
gmake: *** [Makefile:177: ../game_r41051] Error 1
 

Did anyone have a solution?? I would be very grateful for that

  • 10 months later...
On 5/19/2024 at 6:28 AM, Aer0xx70 said:

Hello everyone, first of all, thank you very much for someone taking the trouble to create such a system to share it with everyone ❤️ I tried to install the system, but unfortunately I get this error.

Did anyone have a solution?? I would be very grateful for that

if you don't use split invetory or special inventory (or call it whatever you want 🙂 ) it produces this error.

Fix: 

Spoiler

Input_main.cpp:
Search this: 

if (!pItem->IsSkillBook())



Replace with this: 
 

if (!pItem->GetType() == ITEM_SKILLBOOK)

 

 

Edited by T0gy3R
  • Love 1
  • 1 month later...
On 3/25/2025 at 5:14 PM, T0gy3R said:

if you don't use split invetory or special inventory (or call it whatever you want 🙂 ) it produces this error.

Fix: 

  Hide contents

Input_main.cpp:
Search this: 

if (!pItem->IsSkillBook())



Replace with this: 
 

if (!pItem->GetType() == ITEM_SKILLBOOK)

 

 

input_main.cpp:2997:26: warning: result of comparison of constant 'ITEM_SKILLBOOK' (17) with expression of type 'bool' is always false [-Wtautological-constant-out-of-range-compare] 2997 | if (!pItem->GetType() == ITEM_SKILLBOOK)

Maybe if (pItem->GetType() != ITEM_SKILLBOOK)

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