Jump to content

Recommended Posts

thanks :D nice idea.

 

could you add an item-VNUM function?

example: the max level Weapon 10010-10019 reached+9 - "User XYZ reached Soul-Sword+9, congratulations!"

 

you must not do this, it is only a question s:

 

you know what i mean? ^^

Maybe i am noob, or my english not help me again.

Already this function made check if vnum >= 7, so means he will show u announce like when u upgrade something, only if new item is >=+7.

  • <Refine> Player [Jorila] upgraded item [Soul-Sword+7] with succes!
  • <Refine> Player [Jorila] upgraded item [Soul-Sword+8] with succes!
  • <Refine> Player [Jorila] upgraded item [Soul-Sword+9] with succes!

m4pDc.png

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

Yes, but your system shout ALL refine +7/8/9

 

i ask it is possible used this via item-vnum:

example2: User XYZ upgraded the max level Weapon "Soul-Sword +9, NICE"

 

nobody interests when a level 10 sword reached+9 :D you know what i mean? ^^

 

	static int arg[2] = {147, 149};
				
	if (arg[0] <= pkNewItem->GetVnum() && pkNewItem->GetVnum() <= arg[1])
	{
		if (pkNewItem->GetRefineLevel() >= 7)
		{			
			char szUpgradeAnnouncement[QUERY_MAX_LEN];
			snprintf(szUpgradeAnnouncement, sizeof(szUpgradeAnnouncement), "<Refine> Player %s upgraded item [%s] with succes!", GetName(), pkNewItem->GetName()); 
			BroadcastNotice(szUpgradeAnnouncement);
		}
	}
  •  
  • <Refine> Player [Jorila] upgraded item [Battle-Sword+7] with succes!
  • <Refine> Player [Jorila] upgraded item [Battle-Sword+8] with succes!
  • <Refine> Player [Jorila] upgraded item [Battle-Sword+9] with succes!

 

	static int arg[2] = {141, 149};
				
	if (arg[0] <= pkNewItem->GetVnum() && pkNewItem->GetVnum() <= arg[1])
	{		
		char szUpgradeAnnouncement[QUERY_MAX_LEN];
		snprintf(szUpgradeAnnouncement, sizeof(szUpgradeAnnouncement), "<Refine> Player %s upgraded item [%s] with succes!", GetName(), pkNewItem->GetName()); 
		BroadcastNotice(szUpgradeAnnouncement);
	}

 

  • <Refine> Player [Jorila] upgraded item [Battle-Sword+1] with succes!
  • <Refine> Player [Jorila] upgraded item [Battle-Sword+2] with succes!
  • <Refine> Player [Jorila] upgraded item [Battle-Sword+3] with succes!
  • <Refine> Player [Jorila] upgraded item [Battle-Sword+4] with succes!
  • <Refine> Player [Jorila] upgraded item [Battle-Sword+5] with succes!
  • <Refine> Player [Jorila] upgraded item [Battle-Sword+6] with succes!
  • <Refine> Player [Jorila] upgraded item [Battle-Sword+7] with succes!
  • <Refine> Player [Jorila] upgraded item [Battle-Sword+8] with succes!
  • <Refine> Player [Jorila] upgraded item [Battle-Sword+9] with succes!
  • Love 1
4 minutes ago, VegaS said:

 


	static int arg[2] = {140, 149}; // MIN - MAX
				
	if (arg[0] <= item->GetVnum() && item->GetVnum() <= arg[1])
	{
		// Do something
	}

 

thanks :D i have 2 very little  question. oh my gosh, i ask to much, but i am a c++ noob s:

 

where i must add the 

static int arg[2] = {140, 149}; // MIN - MAX

and it is possible when i write like this: static int arg[2] = {140, 149, 10010, 10019, 20010, 20019}; // 3 different items

 

int m_nTableMin[] = {141, 151, 161, 171, 181, 191};
int m_nTableMax[] = {149, 159, 169, 179, 189, 199};	
	
	for (int i = 0; i < _countof(m_nTableMin); i++)
	{
		for (int j = 0; j < _countof(m_nTableMax); j++)
		{		
			if (m_nTableMin[i] <= pkNewItem->GetVnum() && pkNewItem->GetVnum() <= m_nTableMax[j])
			{
				char szUpgradeAnnouncement[QUERY_MAX_LEN];
				snprintf(szUpgradeAnnouncement, sizeof(szUpgradeAnnouncement), "<Refine> Player [%s] upgraded item [%s] with succes!", GetName(), pkNewItem->GetName()); 
				BroadcastNotice(szUpgradeAnnouncement);
				// i have big dick omg ->  Do something -> BlowJob
			}
		}	
	}	

 

  • Love 1

d0fc1cc03bcb6e0daf4f077c9e660dbd.png

@VegaS

hmm i add the refine-system...

 

code:

Spoiler

#ifndef ENABLE_ANNOUNCEMENT_REFINE_SUCCES
    #define ENABLE_ANNOUNCEMENT_REFINE_SUCCES
    #define ENABLE_ANNOUNCEMENT_REFINE_SUCCES_MIN_LEVEL 8

Spoiler

#ifdef ENABLE_ANNOUNCEMENT_REFINE_SUCCES
//mefunction745
    int m_nTableMin[] = {148, 158, 168, 178, 188, 198};
    int m_nTableMax[] = {149, 159, 169, 179, 189, 199};    
    
    for (int i = 0; i < _countof(m_nTableMin); i++)
    {
        for (int j = 0; j < _countof(m_nTableMax); j++)
        {        
            if (m_nTableMin <= pkNewItem->GetVnum() && pkNewItem->GetVnum() <= m_nTableMax[j])
            {
                char szUpgradeAnnouncement[QUERY_MAX_LEN];
                snprintf(szUpgradeAnnouncement, sizeof(szUpgradeAnnouncement), "<Refine> Player [%s] upgraded item [%s] with succes!", GetName(), pkNewItem->GetName()); 
                BroadcastNotice(szUpgradeAnnouncement);
                // lalala
            }
        }    
    }
#endif

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Active Member

13c02e7177184ddc8dc82906e5d3f9ff.png

Don't look at difference in item names, I used wrong item_proto in client. xd


http://paste.ubuntu.com/23166279/

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
  • Love 2
20 minutes ago, Endymion said:

13c02e7177184ddc8dc82906e5d3f9ff.png

Don't look at difference in item names, I used wrong item_proto in client. xd


http://paste.ubuntu.com/23166279/

Rainbow ftw haha

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

@Endymion Where is break? Information displays many times when we have a few in inventory e.g 10x Poison Sword+8.

Under:

                        BroadcastNotice(szUpgradeAnnouncement);

Add:

                        break;

  • Love 2
  • Active+ Member
On 11. 9. 2016 at 10:03 PM, Endymion said:

13c02e7177184ddc8dc82906e5d3f9ff.png

Don't look at difference in item names, I used wrong item_proto in client. xd


http://paste.ubuntu.com/23166279/

Can you share your icons of stones? They are amazing!

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

I'll be always helpful!  😉

ok nice Now I want to translate the text

Spoiler

snprintf(szUpgradeAnnouncement, sizeof(szUpgradeAnnouncement), "<Refine> Player [%s] upgraded item %s with succes!", GetName(), buf);

And convert it to a file locale_string.txt hoooow :)

  • Active Member
2 hours ago, xRooT said:

ok nice Now I want to translate the text

  Reveal hidden contents

snprintf(szUpgradeAnnouncement, sizeof(szUpgradeAnnouncement), "<Refine> Player [%s] upgraded item %s with succes!", GetName(), buf);

And convert it to a file locale_string.txt hoooow :)

snprintf(szUpgradeAnnouncement, sizeof(szUpgradeAnnouncement), LC_TEXT("Refine info %s %s"), GetName(), buf);

"Refine info %s %s";
"<Refine> Player [%s] upgraded item %s with succes!";

1 hour ago, Endymion said:

snprintf(szUpgradeAnnouncement, sizeof(szUpgradeAnnouncement), LC_TEXT("Refine info %s %s"), GetName(), buf);

"Refine info %s %s";
"<Refine> Player [%s] upgraded item %s with succes!";

ok nice but i can click name

a3223203ac.jpg

 

764026b61d.jpg

Edited by Metin2 Dev
Core X - External 2 Internal

You code is bad vegas and you should feel bad too.

As i saw  here you always have a big mouth, but you codes is very bad.  I think is better and more simple like this.

int m_nTableMin[] = {141, 151, 161, 171, 181, 191};
int m_nTableMax[] = {149, 159, 169, 179, 189, 199};	

auto const &num = pkNewItem->GetVnum();

for (int i : m_nTableMin)
{
	for (int j : m_nTableMax)
	{
		if (i <= num && num <= j)
		{
			char szUpgradeAnnouncement[QUERY_MAX_LEN];
			
			snprintf(
				szUpgradeAnnouncement,
				sizeof(szUpgradeAnnouncement),
				"<Refine> "
				"Player [%s] "
				"upgraded item [%s] "
				"with succes! ",
				GetName(),
				pkNewItem->GetName()
				); 
			
			BroadcastNotice(szUpgradeAnnouncement);
		}
	}
}

 

:) I can review all of you codes if you want.

Please be friendly with me  Here i try to show you that you codes is bad  :D 

 

Regads

  • Love 1
  • Premium
8 minutes ago, Asha said:

You code is bad vegas and you should feel bad too.

As i saw  here you always have a big mouth, but you codes is very bad.  I think is better and more simple like this.


int m_nTableMin[] = {141, 151, 161, 171, 181, 191};
int m_nTableMax[] = {149, 159, 169, 179, 189, 199};	

auto const &num = pkNewItem->GetVnum();

for (int i : m_nTableMin)
{
	for (int j : m_nTableMax)
	{
		if (i <= num && num <= j)
		{
			char szUpgradeAnnouncement[QUERY_MAX_LEN];
			
			snprintf(
				szUpgradeAnnouncement,
				sizeof(szUpgradeAnnouncement),
				"<Refine> "
				"Player [%s] "
				"upgraded item [%s] "
				"with succes! ",
				GetName(),
				pkNewItem->GetName()
				); 
			
			BroadcastNotice(szUpgradeAnnouncement);
		}
	}
}

 

:) I can review all of you codes if you want.

Please be friendly with me  Here i try to show you that you codes is bad  :D 

 

Regads

You're code seems really clean, btw you need at least c++11 to make it work as it uses "auto" for the pointer

@VegaS

And master vegas  , here is some advices for you

Naming :

At least in my opinion, the pseudo-hungarian names like m_nTableMax and pkNewItem are much more problematic. Hungarian naming was originally invented for assembly language, back in the days of extremely primitive assemblers that did essentially no type enforcement. They were marginally useful with early C compilers that did minimal type enforcement as well.

In C++, Hungarian Notation is beyond useless, well into the range of being detrimental to your code's health.

Readibility :
You should worry less about length and more about readability. The code above does happen to be shorter, but the real improvement (IMO) is in readability and dependability. Range-based for loops (in particular) can do quite a lot to help eliminate off-by-one errors and such.
 
Best regards. :D  Be friendly with me please
 
Well, you can replace the auto with DWORD
DWORD &num = pkNewItem->GetVnum();
if you don't want to use modern programming things.
 
EDIT: why DWORD ? Because  GetVnum is DWORD
  • Love 1
  • Premium

Yes I know about the pointer (btw I'm currently using c++11 soon c++14 or even 17 but there's no need for me right now) and I use a lot of "auto" in my code, either for replacing some boost features introduced in modern c++ versions or for better code using modern standarts

  • Love 1
1 minute ago, galet said:

Yes I know about the pointer (btw I'm currently using c++11 soon c++14 or even 17 but there's no need for me right now) and I use a lot of "auto" in my code, either for replacing some boost features introduced in modern c++ versions or for better code using modern standarts

Good luck :D  With time you will improve.

  • Love 1
  • 3 months later...

THIS POST FOR @Asha

Why do you guy second loop!? Your function will be bugging when we use different ranges id...

 

The function should look like this, Mr. Developer :lol::lol:

Sorry for my bad eng. Have a nice day!

http://wklej.to/Z4922

  • Love 2

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.