VegaS 1086 Posted September 11, 2016 Share Posted September 11, 2016 (edited) A guy asked me to do this to them, so I said to share with you. I think this is good for pvm server. Download link: This is the hidden content, please Sign In or Sign Up Edited August 20, 2022 by Metin2 Dev Core X - External 2 Internal 35 1 1 1 4 24 Link to comment Share on other sites More sharing options...
Premium Galet 509 Posted September 11, 2016 Premium Share Posted September 11, 2016 Nice idea mate Link to comment Share on other sites More sharing options...
Jorila 3 Posted September 11, 2016 Share Posted September 11, 2016 thanks 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? ^^ Link to comment Share on other sites More sharing options...
VegaS 1086 Posted September 11, 2016 Author Share Posted September 11, 2016 (edited) 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! Edited August 20, 2022 by Metin2 Dev Core X - External 2 Internal 1 Link to comment Share on other sites More sharing options...
Jorila 3 Posted September 11, 2016 Share Posted September 11, 2016 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 you know what i mean? ^^ Link to comment Share on other sites More sharing options...
VegaS 1086 Posted September 11, 2016 Author Share Posted September 11, 2016 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! 1 Link to comment Share on other sites More sharing options...
Jorila 3 Posted September 11, 2016 Share Posted September 11, 2016 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 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 Link to comment Share on other sites More sharing options...
VegaS 1086 Posted September 11, 2016 Author Share Posted September 11, 2016 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 } } } 1 Link to comment Share on other sites More sharing options...
Honorable Member xP3NG3Rx 19658 Posted September 11, 2016 Honorable Member Share Posted September 11, 2016 Soo sexy 2 Link to comment Share on other sites More sharing options...
z35 170 Posted September 11, 2016 Share Posted September 11, 2016 Vegas you amaze me every time ! Thanks for this, it's wonderful! Link to comment Share on other sites More sharing options...
Jorila 3 Posted September 11, 2016 Share Posted September 11, 2016 (edited) @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 August 20, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Endymion 319 Posted September 11, 2016 Share Posted September 11, 2016 (edited) Don't look at difference in item names, I used wrong item_proto in client. xd http://paste.ubuntu.com/23166279/ Edited August 20, 2022 by Metin2 Dev Core X - External 2 Internal 1 2 Link to comment Share on other sites More sharing options...
VegaS 1086 Posted September 11, 2016 Author Share Posted September 11, 2016 (edited) 3 hours ago, xP3NG3Rx said: Soo sexy 6 minutes ago, Endymion said: Nice kurwa Edited August 20, 2022 by Metin2 Dev Core X - External 2 Internal 3 Link to comment Share on other sites More sharing options...
Denis 1474 Posted September 11, 2016 Share Posted September 11, 2016 (edited) 20 minutes ago, Endymion said: 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 August 20, 2022 by Metin2 Dev Core X - External 2 Internal 3 Link to comment Share on other sites More sharing options...
Quai 6 Posted September 17, 2016 Share Posted September 17, 2016 @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; 2 Link to comment Share on other sites More sharing options...
Active Member ReFresh 2339 Posted September 17, 2016 Active Member Share Posted September 17, 2016 (edited) On 11. 9. 2016 at 10:03 PM, Endymion said: 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 August 24, 2022 by Metin2 Dev Core X - External 2 Internal 1 1 I'll be always helpful! Link to comment Share on other sites More sharing options...
xRooT 24 Posted September 17, 2016 Share Posted September 17, 2016 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 Link to comment Share on other sites More sharing options...
Endymion 319 Posted September 17, 2016 Share Posted September 17, 2016 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!"; Link to comment Share on other sites More sharing options...
xRooT 24 Posted September 17, 2016 Share Posted September 17, 2016 (edited) 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 Edited August 20, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Asha 8 Posted September 21, 2016 Share Posted September 21, 2016 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 Regads 1 Link to comment Share on other sites More sharing options...
Premium Galet 509 Posted September 21, 2016 Premium Share Posted September 21, 2016 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 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 Link to comment Share on other sites More sharing options...
Asha 8 Posted September 21, 2016 Share Posted September 21, 2016 @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. Be friendly with me please @galet 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 1 Link to comment Share on other sites More sharing options...
Premium Galet 509 Posted September 21, 2016 Premium Share Posted September 21, 2016 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 1 Link to comment Share on other sites More sharing options...
Asha 8 Posted September 21, 2016 Share Posted September 21, 2016 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 With time you will improve. 1 Link to comment Share on other sites More sharing options...
Quai 6 Posted January 13, 2017 Share Posted January 13, 2017 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 Sorry for my bad eng. Have a nice day! http://wklej.to/Z4922 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now