Jump to content

Official Enchant Item+


Recommended Posts

  • Honorable Member

M2 Download Center

This is the hidden content, please
( Internal )

This is the hidden content, please

 

The client part is from 2018 official root.

Do not forget to add slot marking.

  • Metin2 Dev 73
  • Eyes 1
  • Not Good 1
  • Sad 1
  • Confused 1
  • Scream 2
  • Good 23
  • Love 3
  • Love 41

 

Link to comment
Share on other sites

  • Honorable Member
54 minutes ago, VegasForPresident said:

WTF WHAT'S NEXT?? XD

Imagine he drops ENABLE_KEYCHANGE_SYSTEM from gfroot 2k18 too, BANGER then

He is already giving us a clue of what's coming next, just pay attention to the details and you will notice it.

  • Think 1
  • Scream 1
  • Love 1
Link to comment
Share on other sites

  • Honorable Member

Nice 😉.

If I know well (not sure, but) on the official it stores the attributes when the player get kicked or warped or whatever, on the next login the window will show up again like the luckybox.
I've done it like that way, even when shutdown or reboot happens.

Even if this isn't the official way, it's a player friendly feature.

Spoiler

YmlQZuN.png

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Good 2
Link to comment
Share on other sites

  • Contributor

Nice, good job, I don't know if it was intentional or it's like Official Servers, but I think he forgot the way Metin2 interprets Attribute levels.

Right now you only call the level but not the attribute stored in your Data Struct.
For correct call for level Attributes you will need add a some part for your code:

Search in from item_attribute.cpp:

Quote

void CItem::GetSelectAttr(TPlayerItemAttribute(&arr)[ITEM_ATTRIBUTE_MAX_NUM])
{
[...]
        arr[__GetAttributeCount()] = { static_cast<BYTE>(attr_idx), static_cast<short>(bLevel) };
};


and replace for:

Quote

        long lVal = r.lValues[MIN(4, bLevel - 1)];

        arr[__GetAttributeCount()] = { static_cast<BYTE>(attr_idx), lVal };
    };


And after will working perfectly

 

I love you, muack ❤️

  • Good 1
Link to comment
Share on other sites

On 9/16/2021 at 3:06 PM, Owsap said:

He is already giving us a clue of what's coming next, just pay attention to the details and you will notice it.

Its either premium private shop (in my opinion impossible)

glove or 6/7th attribute. xD really hyped 😄 

 

@ Mali you should do a trailer for upcoming releases xD 

Link to comment
Share on other sites

  • Honorable Member
7 hours ago, VegasForPresident said:

Its either premium private shop (in my opinion impossible)

glove or 6/7th attribute. xD really hyped 😄 

 

@ Mali you should do a trailer for upcoming releases xD 

Mali is watching the new season of his favorite series right now and he is away from Metin2 currently.

 

About 6&7 Attr:

https://metin2.dev/board/topic/27833-official-6-7-attr/?do=findComment&comment=142660

  • Metin2 Dev 1

 

Link to comment
Share on other sites

  • Contributor
1 hour ago, VegasForPresident said:

@ Mali  terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

 

Core crash after taking item on item2 (not even the select attr window is opened) 

😞 anyone else ? why 😞 

std::bad_alloc It's because you have a serious memory allocation problem, maybe you will need say if it happened on the first try or after many try's, but I think that you but i think you need to check all your code or check if you have any missing code snippets.

I haven't had problems, although I arranged some fragments in my own way.

https://metin2.download/picture/klRi93Xd3QFXt1eF0Rj4yJWfQyACU96t/.jpg

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
Link to comment
Share on other sites

3 minutes ago, Rakancito said:

std::bad_alloc It's because you have a serious memory allocation problem, maybe you will need say if it happened on the first try or after many try's, but I think that you but i think you need to check all your code or check if you have any missing code snippets.

I haven't had problems, although I arranged some fragments in my own way.

https://metin2.download/picture/klRi93Xd3QFXt1eF0Rj4yJWfQyACU96t/.jpg

 

 

 

Everything is implemented correct. I use gcc8 & FreeBSD 13

 

if i comment 

	static constexpr BYTE aiAttrPercentTable[ITEM_ATTRIBUTE_MAX_LEVEL] = { 0, 10, 40, 35, 15 };
	for (BYTE c = __GetAttributeCount(); c < GetAttributeCount(); c++)
	{
		int iAttrLevelPercent = number(1, 100);
		BYTE i;

		for (i = 0; i < ITEM_ATTRIBUTE_MAX_LEVEL; ++i)
		{
			if (iAttrLevelPercent <= aiAttrPercentTable[i])
				break;

			iAttrLevelPercent -= aiAttrPercentTable[i];
		}

		__PutAttributeWithLevel(i + 1);
	}

 

in void CItem::GetSelectAttr(TPlayerItemAttribute(&arr)[ITEM_ATTRIBUTE_MAX_NUM])

 

The core crash is gone but also there is no new attributes on the right side

 

Edit: I Solved the problem. I Changed: 

 

		for (BYTE i = 0; i < MAX_APPLY_NUM; ++i)
		{
			const TItemAttrTable& r = g_map_itemAttr[i];

			if (r.bMaxLevelBySet[iAttributeSet] && !__HasAttr(i))
			{
				avail.push_back(i);
				total += r.dwProb;
			}
		}

with

 

		for (int i = 0; i < MAX_APPLY_NUM; ++i)
		{
			const TItemAttrTable& r = g_map_itemAttr[i];

			if (r.bMaxLevelBySet[iAttributeSet] && !HasAttr(i))
			{
				avail.push_back(i);
				total += r.dwProb;
			}
		}

 

 

Thanks for not helping 😞 

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Honorable Member
34 minutes ago, VegasForPresident said:

 

 

Everything is implemented correct. I use gcc8 & FreeBSD 13

 

if i comment 

	static constexpr BYTE aiAttrPercentTable[ITEM_ATTRIBUTE_MAX_LEVEL] = { 0, 10, 40, 35, 15 };
	for (BYTE c = __GetAttributeCount(); c < GetAttributeCount(); c++)
	{
		int iAttrLevelPercent = number(1, 100);
		BYTE i;

		for (i = 0; i < ITEM_ATTRIBUTE_MAX_LEVEL; ++i)
		{
			if (iAttrLevelPercent <= aiAttrPercentTable[i])
				break;

			iAttrLevelPercent -= aiAttrPercentTable[i];
		}

		__PutAttributeWithLevel(i + 1);
	}

 

in void CItem::GetSelectAttr(TPlayerItemAttribute(&arr)[ITEM_ATTRIBUTE_MAX_NUM])

 

The core crash is gone but also there is no new attributes on the right side

 

Edit: I Solved the problem. I Changed: 

 

		for (BYTE i = 0; i < MAX_APPLY_NUM; ++i)
		{
			const TItemAttrTable& r = g_map_itemAttr[i];

			if (r.bMaxLevelBySet[iAttributeSet] && !__HasAttr(i))
			{
				avail.push_back(i);
				total += r.dwProb;
			}
		}

with

 

		for (int i = 0; i < MAX_APPLY_NUM; ++i)
		{
			const TItemAttrTable& r = g_map_itemAttr[i];

			if (r.bMaxLevelBySet[iAttributeSet] && !HasAttr(i))
			{
				avail.push_back(i);
				total += r.dwProb;
			}
		}

 

 

Thanks for not helping 😞 

It's not fix, you are using wrong function.

check my last update and tell the result

  • Metin2 Dev 1

 

Link to comment
Share on other sites

7 minutes ago, Mali said:

It's not fix, you are using wrong function.

check my last update and tell the result

Still core crash bro.. 😞 why i cant use the other one? Everything work good there 😞 

@ Mali It works after i change BYTE to INT .. 

 

 

        for (int i = 0; i < MAX_APPLY_NUM; ++i)
        {
            const TItemAttrTable& r = g_map_itemAttr[i];

            if (r.bMaxLevelBySet[iAttributeSet] && !__HasAttr(i))
            {
                avail.push_back(i);
                total += r.dwProb;
            }
        }

 

Mali i can prove it to u if u dont believe give me your discord addy 😄  its because of byte / int

  • Confused 1
Link to comment
Share on other sites

  • Contributor
3 hours ago, VegasForPresident said:

Still core crash bro.. 😞 why i cant use the other one? Everything work good there 😞 

@ Mali It works after i change BYTE to INT .. 

 

 

        for (int i = 0; i < MAX_APPLY_NUM; ++i)
        {
            const TItemAttrTable& r = g_map_itemAttr[i];

            if (r.bMaxLevelBySet[iAttributeSet] && !__HasAttr(i))
            {
                avail.push_back(i);
                total += r.dwProb;
            }
        }

 

Mali i can prove it to u if u dont believe give me your discord addy 😄  its because of byte / int


I'm tired.

I was in Match League of Legends (I had Games over 😢 ) This is the problem:
 

Your solution it's good because the problem in the function is, we have a mapping, not a direct search::

Quote

avail.push_back(i);

The array Data Struct it's declared like DWORD, and we are searching in BYTE, in general we should not have problems but we have Crazy Compilers.

I didn't make the mistake before because I forgot.

OK, if we come back for this, we need check the Word Size Data Types (The most important), Is nice if we use Short Data Types for a some values, but we need check if our Struct's have same declared data types.

DWORD = 4 bytes, int = 4 bytes

BYTE = 2 bytes

If we search with 2 bytes, we will have errors in the future, if we search with a other Data type with more bytes, we will have errors, but if we will check with = sizes we have nice functions.

The logic is simple: We don't put a bigger box in a smaller box. (Computer architecture)

The fix it's in your for changed for int or DWORD, 😄  (Just if you have problems), Maybe in new compiler versions that was corrected or not.

 

Now how do I remove notifications from this topic?, I have SPAM.

I love you ❤️ Muack, nice system.

Edited by Rakancito
  • Confused 1
Link to comment
Share on other sites

  • Management
27 minutes ago, Rakancito said:

Now how do I remove notifications from this topic?, I have SPAM.

203052Sans-titre-1.png

or " Unfollow "

  • Love 1
  • Love 1
Link to comment
Share on other sites

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