Jump to content
  • 0

R>NPC name & date of birth changer


aurelia

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   0
  • Joined:  06/08/12
  • Last Seen:  

hello i want to request npc name changer and date of birth changer

the npc who can change our nickname & date of birth

thanks before ^^

Edited by aurelia
Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  276
  • Reputation:   24
  • Joined:  07/06/13
  • Last Seen:  

Ok give me a bit, i must create a condition if you are a guild master.



I figure that you cannot change the name in your the Guild Listing, I think its because its client sided or something is preventing that, i tried changing the names in guild_member in query but everytime I char select and refresh the sql it returns back to original name. The best way is to prevent any player from changing name when they are in guild.

 

Now here is the script. Just modify the dialogues. :)

-Added if Char Name already exists restrictions.

-Added if Char is already in a guild restrictions.

(Use transfer Guild Leader first before changing name if character is a Guild Leader.)

prontera,158,182,0	script	Sample	100,{
	mes "Blahblah";
	menu "Change Name",one,"Change Birth",two;
		one:
			query_sql "SELECT `name` FROM `ragnarok`.`char` WHERE `name` = '"+strcharinfo(0)+"'",.@current$;	
			set @GID,getcharid(2);
			if(!@GID==0){
				mes "Please leave your guild first before you change name.";
				close;
			}
			mes "Input name...";
			input .@name$;
			if(getstrlen(.@name$)<4| getstrlen(.@name$)>23){
				mes "You cannot enter less than minimum of 4 and greater than maximum of 23 characters.";
				close;
			}
			if(.@name$ == strcharinfo(0)) {
				mes "You cannot enter same name.";
				close;
			}
			query_sql "SELECT `name` FROM `ragnarok`.`char` WHERE `name` = '"+.@name$+"'",.@existing$;
			if(.@name$ == .@existing$){
				mes "Name already exists.";
				close;
			}				
			mes "New name: "+.@name$+"";
			query_sql "UPDATE `char` SET `name` = '"+escape_sql(.@name$)+"' WHERE `name` = '"+strcharinfo(0)+"'";
			sleep2 1000;
			mes "Name successfully changed, please relog to see changes.";
			close;
		two:
			query_sql "SELECT `birthdate` FROM `ragnarok`.`login` WHERE `account_id` = '"+getcharid(3)+"'",.@birthdate$;
			mes "Birth Date: "+.@birthdate$+"";
			mes "Input Year of Birth.";
			input .@year;
			if(.@year==0){
				mes "You entered wrong number of month.";
				close;
			}
			mes "Input Month of Birth.";
			input .@month;
			if(.@month==0||.@month>12){
				mes "You entered wrong number of month.";
				close;
			}
			mes "Input Day of Birth.";
			input .@day;
			if(.@day==0||.@day>31){
				mes "You entered wrong number of day.";
				close;
			}
			mes "New B-D: "+.@year+"-"+.@month+"-"+.@day+"";
			query_sql "UPDATE `login` SET `birthdate` = '"+escape_sql(.@year)+"-"+escape_sql(.@month)+"-"+escape_sql(.@day)+"' WHERE `account_id` = '"+getcharid(3)+"'";
			sleep2 1000;
			mes "Birth Date successfully changed!";
			close;
}
Edited by Lil Troll
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  276
  • Reputation:   24
  • Joined:  07/06/13
  • Last Seen:  

prontera,158,182,0	script	Sample	100,{
	mes "Blahblah";
	menu "Change Name",one,"Change Birth",two;
		one:
			query_sql "SELECT `name` FROM `ragnarok`.`char` WHERE `name` = '"+strcharinfo(0)+"'",.@current$;	
			mes "Input name...";
			input .@name$;
			if(getstrlen(.@name$)<4| getstrlen(.@name$)>23){
				mes "You cannot enter less than minimum of 4 and greater than maximum of 23 characters.";
			}
			if(.@name$ == strcharinfo(0)) {
				mes "You cannot enter same name.";
				close;
			}
			mes "New name: "+.@name$+"";
			query_sql "UPDATE `char` SET `name` = '"+escape_sql(.@name$)+"' WHERE `name` = '"+strcharinfo(0)+"'";
                        query_sql "UPDATE `guild_member` SET `name` = '"+escape_sql(.@name$)+"' WHERE `name` = '"+strcharinfo(0)+"'";
			sleep2 1000;
			mes "Name successfully changed, please relog to see changes.";
			close;
		two:
			query_sql "SELECT `birthdate` FROM `ragnarok`.`login` WHERE `account_id` = '"+getcharid(3)+"'",.@birthdate$;
			mes "Birth Date: "+.@birthdate$+"";
			mes "Input Year of Birth.";
			input .@year;
			if(.@year==0){
				mes "You entered wrong number of month.";
				close;
			}
			mes "Input Month of Birth.";
			input .@month;
			if(.@month==0||.@month>12){
				mes "You entered wrong number of month.";
				close;
			}
			mes "Input Day of Birth.";
			input .@day;
			if(.@day==0||.@day>31){
				mes "You entered wrong number of day.";
				close;
			}
			mes "New B-D: "+.@year+"-"+.@month+"-"+.@day+"";
			query_sql "UPDATE `login` SET `birthdate` = '"+escape_sql(.@year)+"-"+escape_sql(.@month)+"-"+escape_sql(.@day)+"' WHERE `account_id` = '"+getcharid(3)+"'";
			sleep2 1000;
			mes "Birth Date successfully changed!";
			close;
}

Here you go. You just need a lil modification. :)

Edited by Lil Troll
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   0
  • Joined:  06/08/12
  • Last Seen:  

your script very helpful but i confused if player have a guild

 

i've tested your script and it's work but........

 

a.jpg

 

Untitled.jpg

 

 

this is my script

 

payon,164,232,1	script	[Changer] Kenshin	523,{
	mes "Hello";
	menu "Change Name",one,"Change Birth",two;
		one:
			query_sql "SELECT `name` FROM `ragnarok`.`char` WHERE `name` = '"+strcharinfo(0)+"'",.@current$;
			query_sql "SELECT `name` FROM `ragnarok`.`guild` WHERE `master` = '"+strcharinfo(0)+"'",.@current$;	
			mes "Input name...";
			input .@name$;
			if(getstrlen(.@name$)<4| getstrlen(.@name$)>23){
				mes "You cannot enter less than minimum of 4 and greater than maximum of 23 characters.";
			}
			if(.@name$ == strcharinfo(0)) {
				mes "You cannot enter same name.";
				close;
			}
			mes "New name: "+.@name$+"";
			query_sql "UPDATE `char` SET `name` = '"+escape_sql(.@name$)+"' WHERE `name` = '"+strcharinfo(0)+"'";
			query_sql "UPDATE `guild` SET `master` = '"+escape_sql(.@name$)+"' WHERE `name` = '"+strcharinfo(0)+"'";
			sleep2 1000;
			mes "Name successfully changed, please relog to see changes.";
			close;
		two:
			query_sql "SELECT `birthdate` FROM `ragnarok`.`login` WHERE `account_id` = '"+getcharid(3)+"'",.@birthdate$;
			mes "Birth Date: "+.@birthdate$+"";
			mes "Input Year of Birth. (Hanya memakai 2 digit terakhir untuk mendelete char)";
			input .@year;
			if(.@year==0){
				mes "You entered wrong number of month.";
				close;
			}
			mes "Input Month of Birth.";
			input .@month;
			if(.@month==0||.@month>12){
				mes "You entered wrong number of month.";
				close;
			}
			mes "Input Day of Birth.";
			input .@day;
			if(.@day==0||.@day>31){
				mes "You entered wrong number of day.";
				close;
			}
			mes "New B-D: "+.@year+"-"+.@month+"-"+.@day+"";
			query_sql "UPDATE `login` SET `birthdate` = '"+escape_sql(.@year)+"-"+escape_sql(.@month)+"-"+escape_sql(.@day)+"' WHERE `account_id` = '"+getcharid(3)+"'";
			sleep2 1000;
			mes "Tanggal lahir sukses diganti";
			mes "Untuk menghapus karakter formatnya : yymmdd";
			mes "Misal 1945-08-17";
			mes "Maka saat mendelete karakter cukup ketik";
			mes "450817";
			mes "Terima kasih.";
			close;
}
Edited by aurelia
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  276
  • Reputation:   24
  • Joined:  07/06/13
  • Last Seen:  

Do you mean it does`nt change name in guild?

 

First revert your name back to original then,

Find this line:

query_sql "UPDATE `char` SET `name` = '"+escape_sql(.@name$)+"' WHERE `name` = '"+strcharinfo(0)+"'";

And below add this.

query_sql "UPDATE `guild_member` SET `name` = '"+escape_sql(.@name$)+"' WHERE `name` = '"+strcharinfo(0)+"'";
Edited by Lil Troll
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   0
  • Joined:  06/08/12
  • Last Seen:  

yes, the name in guild didn't change

if I shut down the server then the name still changed but the character out from guild

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  276
  • Reputation:   24
  • Joined:  07/06/13
  • Last Seen:  

yes, the name in guild didn't change

if I shut down the server then the name still changed but the character out from guild

Follow my instruction above post. Then tell me it that works. :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   0
  • Joined:  06/08/12
  • Last Seen:  

payon,164,232,1	script	[Changer] Kenshin	523,{
	mes "Hello";
	menu "Change Name",one,"Change Birth",two;
		one:
			query_sql "SELECT `name` FROM `ragnarok`.`char` WHERE `name` = '"+strcharinfo(0)+"'",.@current$;	
			mes "Input name...";
			input .@name$;
			if(getstrlen(.@name$)<4| getstrlen(.@name$)>23){
				mes "You cannot enter less than minimum of 4 and greater than maximum of 23 characters.";
			}
			if(.@name$ == strcharinfo(0)) {
				mes "You cannot enter same name.";
				close;
			}
			mes "New name: "+.@name$+"";
			query_sql "UPDATE `char` SET `name` = '"+escape_sql(.@name$)+"' WHERE `name` = '"+strcharinfo(0)+"'";
			query_sql "UPDATE `guild_member` SET `name` = '"+escape_sql(.@name$)+"' WHERE `name` = '"+strcharinfo(0)+"'";
			query_sql "UPDATE `guild` SET `master` = '"+escape_sql(.@name$)+"' WHERE `name` = '"+strcharinfo(0)+"'";
			sleep2 1000;
			mes "Name successfully changed, please relog to see changes.";
			close;
		two:
			query_sql "SELECT `birthdate` FROM `ragnarok`.`login` WHERE `account_id` = '"+getcharid(3)+"'",.@birthdate$;
			mes "Birth Date: "+.@birthdate$+"";
			mes "Input Year of Birth. (Hanya memakai 2 digit terakhir untuk mendelete char)";
			input .@year;
			if(.@year==0){
				mes "You entered wrong number of month.";
				close;
			}
			mes "Input Month of Birth.";
			input .@month;
			if(.@month==0||.@month>12){
				mes "You entered wrong number of month.";
				close;
			}
			mes "Input Day of Birth.";
			input .@day;
			if(.@day==0||.@day>31){
				mes "You entered wrong number of day.";
				close;
			}
			mes "New B-D: "+.@year+"-"+.@month+"-"+.@day+"";
			query_sql "UPDATE `login` SET `birthdate` = '"+escape_sql(.@year)+"-"+escape_sql(.@month)+"-"+escape_sql(.@day)+"' WHERE `account_id` = '"+getcharid(3)+"'";
			sleep2 1000;
			mes "Tanggal lahir sukses diganti";
			mes "Untuk menghapus karakter formatnya : yymmdd";
			mes "Misal 1945-08-17";
			mes "Maka saat mendelete karakter cukup ketik";
			mes "450817";
			mes "Terima kasih.";
			close;
}

 

still didn't work :(

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...