Jump to content
Sign in to follow this  
Rumor

How to fix the name change scroll on 34083

Recommended Posts

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
  • Love 3

Share this post


Link to post

What about it doesn't work for you? Give some details please

Share this post


Link to post

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!

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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

Share this post


Link to post

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..

 

KgcPe.png

 

and in-game..

 

CgM7f.png

Share this post


Link to post
Guest
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

Share this post


Link to post

Oh, that's right, change_name is disabled in Gameforge locales :)

Share this post


Link to post

yeah I didn't use any DIF, it works fine the way the 34083 files came :)

Share this post


Link to post

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
Sign in to follow this  
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • 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.