Jump to content
×
×
  • Create New...

Official Enchant Item+


Recommended Posts

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

  • Love 1
  • Scream 1
  • Think 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

 

  • Good 2
Link to comment
Share on other sites

  • Sun

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

  • 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

  • Sun
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://gyazo.com/e87a161a1497f03f8e93a93a5eb4dab7

 

  • 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://gyazo.com/e87a161a1497f03f8e93a93a5eb4dab7

 

 

 

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 😞 

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

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

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


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.