Rumor 2604 Posted February 22, 2014 Share Posted February 22, 2014 M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) This problem didn't exist in the 2089 core but once I started using 34083 my players kept getting really long names like "ooooooooommmmmmmmmmmgggg" and "KissOfDeathAndSweetNight". Thanks to Shogun, HaveBeen™ and PACIFICADOR for quest edit and MySQL query. Go to the player database and player table and run this query: SELECT name FROM player WHERE CHAR_LENGTH(name) > 12; This will show you all the names that are longer than the maximum that can be typed into a PM window. Go and edit all their names to something, I set all the names to "ShortName1", "ShortName2", "ShortName3" and so on. I dumped a list of names and player IDs so that players can be given a free name change scroll, and the log of player IDs will ensure that nobody renames to these names to receive a free one. If you have several players with long names it may be better to just credit all their accounts with what's necessary for the name change item. Here's the updated quest to prevent users from selecting long names (tested and works): quest change_name_item begin state start begin function isLongName(name) return string.len(name) < 13 end when 71055.use begin say_title("Change of Name List") if pc.is_married() then say("") say("You can't change names when you're married.") say("") return elseif pc.is_polymorphed() then say("") say("You can't change names when you're transformed.") say("") return elseif pc.has_guild() then say("") say("You can't change names when you're in a guild.") say("") return elseif party.is_party() then say("") say("You can't change names when you're in a party.") say("") return elseif pc.get_level() < 80 then say("") say("You can't change names before level 80.") say("") return elseif get_time() < pc.getqf("next_time") then say("") say("You've recently changed your name.") say("You can't change your name right now.") say("") return end say("Please enter the name you want.") local name = pc.name local str = input() if(change_name_item.isLongName(tostring(str)) == false) then say_title("Change of Name List") say("") say("The entered name is too long.") say("Please select another name.") say("") char_log(0, "CHANGE_NAME", "NAME TOO LONG") return end local ret = pc.change_name(str) say_title("Change of Name List") if ret == 0 then say("") say("You have not relogged since the last time you") say("changed your name. Please relog now.") say("") char_log(0, "CHANGE_NAME", "HAVE NOT RE-LOGIN") elseif ret == 1 then say("") say("There was a problem. Please try again.") say("") char_log(0, "CHANGE_NAME", "ITEM USE PROBLEM") elseif ret == 2 then say("") say("This name is not avaliable.") say("Please select another name.") say("") char_log(0, "CHANGE_NAME", "CAN NOT USE NAME") elseif ret == 3 then say("") say("This name is not avaliable.") say("Please select another name.") say("") char_log(0, "CHANGE_NAME", "ALREADY USING NAME") elseif ret == 4 then say("") say("Successful name change!") say("You cannot change your name again for") say("another 24 hours.") say("") pc.remove_item("71055", 1) pc.setqf("next_time", get_time() + time_hour_to_sec(24*1)) horse.set_name(""..str"'s Horse") char_log(0, "CHANGE_NAME", "SUCCESS: from "..name.." to "..str) wait() pc.warp(pc.get_x()*100, pc.get_y()*100) else say("") say("Unknown error.") say("Please notify Rumor with this number:") say(ret) say("and he will take a look at the issue.") say("") char_log(0, "CHANGE_NAME", "UNKNOWN NAME") end end end end 5 1 5 Link to comment Share on other sites More sharing options...
Cilindro 14 Posted February 25, 2014 Share Posted February 25, 2014 i try it but its not work same help Link to comment Share on other sites More sharing options...
Rumor 2604 Posted February 26, 2014 Author Share Posted February 26, 2014 What about it doesn't work for you? Give some details please Link to comment Share on other sites More sharing options...
DevelopeR 0 Posted February 26, 2014 Share Posted February 26, 2014 Well the erro is one say("") say("Unknown error.") say("Please notify Rumor with this number:") say(ret) say("and he will take a look at the issue." Somthing like: Unknown error. Please notify Rumor with this number: 5 ... like that! Link to comment Share on other sites More sharing options...
Rumor 2604 Posted February 27, 2014 Author Share Posted February 27, 2014 Well the erro is one say("") say("Unknown error.") say("Please notify Rumor with this number:") say(ret) say("and he will take a look at the issue." Somthing like: Unknown error. Please notify Rumor with this number: 5 ... like that! well, no.. there's nothing wrong with that.. it's returning whatever it can return because it's a miscellaneous error. The guy is saying he has a problem but not explaining what the problem is ^^. It does for sure work the way it's shown in this thread. Link to comment Share on other sites More sharing options...
DevelopeR 0 Posted February 27, 2014 Share Posted February 27, 2014 I have this erro to.. put the diff. for the function Link to comment Share on other sites More sharing options...
Rumor 2604 Posted February 27, 2014 Author Share Posted February 27, 2014 what do you mean you "have this error too" ? Nobody else has "this error" or any error as far as I know.. atleast nobody has said they have some error related to that part of the quest, or anywhere at all in the quest. You and the other guy are really hard to understand because you don't really make sense with your replies. I tested this and it works fine, and 6 people have changed their names since I've added this updated version of the quest to my server. Link to comment Share on other sites More sharing options...
Premium Shogun 4586 Posted February 27, 2014 Premium Share Posted February 27, 2014 here is mine... quest chagne_name begin state start begin when 71055.use begin if pc.is_married() then say("You cannot change your name if you are married.") say("") return end if pc.is_polymorphed() then say("You cannot change your name if you are transformed.") say("") return end if pc.has_guild() then say("You cannot change your name if you are in a guild. ") say("") return end if party.is_party() then say("You cannot change your name if you are in a party.") say("") return end if pc.get_level() < 35 then say("You need level 35 to change your name!") say("") return end if get_time() < pc.getqf("next_time") then say("You can not use it now.") say("") if is_test_server() == true then say("Since it's test server, you can go") say("") else return end end say("Please enter the name you want to have") ; local name = pc.name ; local str = input() ; if string.len(str) > 16 then say("This name is too long. Please try again.") say("") return end local ret = pc.change_name(str) ; if ret == 0 then say("You didn't log in after you have changed your name.") say("please re-log in.") say("") char_log(0, "CHANGE_NAME", "HAVE NOT RE-LOGIN") elseif ret == 1 then say("The problem occured while using the item.") say("Please use again.") say("") char_log(0, "CHANGE_NAME", "ITEM USE PROBLEM") elseif ret == 2 then say("The name is not available.") say("Please enter other name.") say("") char_log(0, "CHANGE_NAME", "CAN NOT USE NAME") elseif ret == 3 then say("The name is not available.") say("Please enter other name.") say("") char_log(0, "CHANGE_NAME", "ALREADY USING NAME") elseif ret == 4 then say("You have changed your name successfully.") say("Please log in again.") say("") item.remove() ; pc.setqf("next_time", get_time() + time_hour_to_sec(24*15)) char_log(0, "CHANGE_NAME", "SUCCESS: from "..name.." to "..str) else say("Unknown error occured.") say("") char_log(0, "CHANGE_NAME", "UNKNOWN NAME") end end end end 1 1 Link to comment Share on other sites More sharing options...
DevelopeR 0 Posted February 27, 2014 Share Posted February 27, 2014 (edited) Rumor one my server your quest not work, I talking with PACIFICADOR I ask him if he know something about the erro ( : 5 ) and he tell me that you'r use diff for the function, that you use in this quest.. Thanks Shogun I go test it. well no work.. and in-game.. Edited August 15, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Bot Metin2 Dev 4873 Posted February 27, 2014 Bot Share Posted February 27, 2014 game 00173930: E8 B8 00173931: 6B 00 00173932: 8A 00 00173933: FA 00 00173934: FF 00 This should help 34k pc.change_name fix. On LC_isEurope it always returns 5 IDA HexRays pseudocode. if ( (unsigned __int8)LC_IsEurope(a1, 0) ) { lua_pushnumber(a3, 5.0); } Kind Regards MartPwnS Link to comment Share on other sites More sharing options...
Premium Shogun 4586 Posted February 27, 2014 Premium Share Posted February 27, 2014 Oh, that's right, change_name is disabled in Gameforge locales Link to comment Share on other sites More sharing options...
Rumor 2604 Posted February 27, 2014 Author Share Posted February 27, 2014 yeah I didn't use any DIF, it works fine the way the 34083 files came Link to comment Share on other sites More sharing options...
loyein 18 Posted January 3, 2016 Share Posted January 3, 2016 Works, thx Link to comment Share on other sites More sharing options...
mdxyz 240 Posted March 17, 2016 Share Posted March 17, 2016 thank you 1 Link to comment Share on other sites More sharing options...
Recommended Posts