Jump to content
  • 0

Mr.Secrets DressRoom - Custom Request


Gabe D Stydian

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.15
  • Content Count:  4
  • Reputation:   0
  • Joined:  04/03/25
  • Last Seen:  

Spoiler
morocc,167,95,4	script	Dress Room#sc	2_M_DYEINGER,{
function RestrictClass;
function HasjROCostume;
function ChangeAppr;

function RestrictClass {
	.@eaj = eaclass();
	if(.@eaj&EAJ_BASEMASK == EAJ_NOVICE) return 0;
	if(.@eaj&EAJL_2 && roclass(.@eaj|EAJL_UPPER) != -1){
		return 1;
	}
	return 0;
}

function HasjROCostume {
	switch(roclass(eaclass()&EAJ_UPPERMASK|EAJL_THIRD)) {
		case Job_Guillotine_Cross:
		case Job_Genetic:
		case Job_Royal_Guard:
		case Job_Arch_Bishop:
		case Job_Mechanic:
		case Job_Ranger:
		case Job_Minstrel:
		case Job_Wanderer:
		case Job_Warlock:
		// Uncomment lines below to enable certain job when their respective jRO costume is released and you patched the sprite in your client.
		//case Job_Sorcerer:
		//case Job_Sura:
		//case Job_Rune_Knight:
			return 1;
		default:
			return 0;
	}
}

function ChangeAppr {
	if(Zeny < .cost_dressroom) {
		mes .n$;
		mes "You don't have enough Zeny.";
		close;
	}
	switch(getarg(1)){
		case 0: // Normal Mode
			setlook LOOK_BODY2,0;
			changebase getarg(0);
			set baselook, getarg(0);
			break;
		case 1: // jRO Mode
			if(!HasjROCostume()) return;
			changebase roclass(eaclass()|EAJL_THIRD);
			setlook LOOK_CLOTHES_COLOR,0;
			setlook LOOK_BODY2,!(getlook(LOOK_BODY2));
			//atcommand "@bodystyle " + !(getlook(LOOK_BODY2));
			baselook = 0;
			break;
	}
	Zeny -= .cost_dressroom;
	mes .n$;
	mes "Here you are!";
	close;
}

	.@TYPE_CHANGEBASE = 0;
	.@TYPE_SETLOOK = 1;
	
	mes .n$;
	if(!RestrictClass()){
		mes "Your class isn't allowed to use this NPC.";
		close;
	}
	mes "I can change your appearance to another class of your classline at a cost of ^FF0000" + callfunc("F_InsertComma",.cost_dressroom) + "^000000z!";
	if(HasjROCostume()){
		mes "I also have a brand new costume for your class!";
	}
	mes "Which class do you want to change your appearance to?";
	next;
	switch(select(jobname(roclass(eaclass()&EAJ_UPPERMASK)),jobname(roclass(eaclass()&EAJ_UPPERMASK|EAJL_UPPER)),jobname(roclass(eaclass()|EAJL_THIRD)),HasjROCostume() ? getlook(LOOK_BODY2) ? "Restore costume" : "New jRO costume" : "")) {
		case 1:
			ChangeAppr(roclass(eaclass()&EAJ_UPPERMASK),.@TYPE_CHANGEBASE);
			break;
		case 2:
			ChangeAppr(roclass(eaclass()&EAJ_UPPERMASK|EAJL_UPPER),.@TYPE_CHANGEBASE);
			break;
		case 3:
			ChangeAppr(roclass(eaclass()|EAJL_THIRD),.@TYPE_CHANGEBASE);
			break;
		case 4:
			ChangeAppr(0,.@TYPE_SETLOOK);
			break;
	}
	close;
		
OnPCLoginEvent:
	if(baselook && .dress_perma){
		changebase baselook;
	}
	end;
OnInit:
	.n$ = "[Dress Room]"; // NPC Name
	.cost_dressroom = 10000; // Cost
	.dress_perma = 1;
}

 

 

Hello everyone. The code above is Mr. Secrets "DressRoom" NPC which allows the players to change job sprite up to 3rd job. I'm requesting help to change it to where it allows up to 4th job sprites and requires item(s) and zeny before changing jobs.

Also, if its not too much of a hassle, please include "// comments" so i can learn how to edit them and what is for what. If unable to, thats fine too. ❤️ thank you in advance.

 

If it matters, i am using 2022 full kRO client. 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  210
  • Reputation:   92
  • Joined:  06/02/12
  • Last Seen:  

Hello

//===== rAthena Script ===========================================|
//= Mr.Secrets DressRoom - Custom Request
//= 1.5 Added 4th job sprites and item requirements [Racaae]
//= https://rathena.org/board/topic/144504-mrsecrets-dressroom-custom-request

morocc,167,95,4	script	Dress Room#sc	2_M_DYEINGER,{
function RestrictClass;
function HasjROCostume;
function ChangeAppr;

function RestrictClass {
	.@eaj = eaclass();
	if(.@eaj&EAJ_BASEMASK == EAJ_NOVICE) return 0;
	if(.@eaj&EAJL_2 && roclass(.@eaj|EAJL_UPPER) != -1){
		return 1;
	}
	return 0;
}

function HasjROCostume {
	switch(roclass(eaclass()&EAJ_THIRDMASK|EAJL_THIRD)) {
		case Job_Guillotine_Cross:
		case Job_Genetic:
		case Job_Royal_Guard:
		case Job_Arch_Bishop:
		case Job_Mechanic:
		case Job_Ranger:
		case Job_Minstrel:
		case Job_Wanderer:
		case Job_Warlock:
		// Uncomment lines below to enable certain job when their respective jRO costume is released and you patched the sprite in your client.
		//case Job_Sorcerer:
		//case Job_Sura:
		//case Job_Rune_Knight:
			return 1;
		default:
			return 0;
	}
}

function ChangeAppr {
	mes .n$;
	if (Zeny < .cost_dressroom) {
		mes "You don't have enough Zeny.";
		.@missingzeny = true;
	}
	.@size = getarraysize(.cost_item);
	if (.@size > 1) {
		for ( .@i = 0; .@i < .@size; .@i += 2 ) {
			if (countitem(.cost_item[.@i]) < .cost_item[.@i+1]) {
				if (!.@missingitem) {
					mes "You didn't bring what I need. You're missing:";
					.@missingitem = true;
				}
				mes .cost_item[.@i+1] + "x " + mesitemlink(.cost_item[.@i]);				
			}
		}	
	}
	if (.@missingzeny || .@missingitem)
		close;

	switch(getarg(1)){
		case 0: // Normal Mode
			setlook LOOK_BODY2,0;
			changebase getarg(0);
			set baselook, getarg(0);
			break;
		case 1: // jRO Mode
			if(!HasjROCostume()) return;
			changebase roclass(eaclass()&EAJ_THIRDMASK|EAJL_THIRD);
			setlook LOOK_CLOTHES_COLOR,0;
			setlook LOOK_BODY2,!(getlook(LOOK_BODY2));
			//atcommand "@bodystyle " + !(getlook(LOOK_BODY2));
			baselook = 0;
			break;
	}
	Zeny -= .cost_dressroom;
	.@size = getarraysize(.cost_item);
	if (.@size > 1) {
		for ( .@i = 0; .@i < .@size; .@i += 2 )
			delitem .cost_item[.@i], .cost_item[.@i+1];
	}
	mes "Here you are!";
	close;
}

	.@TYPE_CHANGEBASE = 0;
	.@TYPE_SETLOOK = 1;
	
	mes .n$;
	if (!RestrictClass()){
		mes "Your class isn't allowed to use my services.";
		close;
	}
	mes "I can change your appearance to another class of your classline!";
	if (HasjROCostume()){
		mes "I also have a brand new costume for your class!";
	}
	next;
	mes .n$;
	if (.cost_dressroom)
		mes "At a cost of ^FF0000" + F_InsertComma(.cost_dressroom) + "^000000z";
	
	//displaying needed item list
	.@size = getarraysize(.cost_item);
	if (.@size > 1) {
		for ( .@i = 0; .@i < .@size; .@i += 2 )
			mes (.@i+3>.@size?"And ":"") + .cost_item[.@i+1] + "x " + mesitemlink(.cost_item[.@i]);
	}

	mes "Which class do you want to change your appearance to?";
	next;
	.@option[0] = roclass(eaclass()&EAJ_UPPERMASK);
	.@option[1] = roclass(eaclass()&EAJ_UPPERMASK|EAJL_UPPER);
	.@option[2] = roclass(eaclass()&EAJ_THIRDMASK|EAJL_THIRD);
	if (.4th) {
		.@job = roclass(eaclass()&EAJ_THIRDMASK|EAJL_THIRD);
		.@option[4] = roclass(eaclass(.@job)|EAJL_FOURTH|EAJL_UPPER);
	}

	for(.@i = 0; .@i < (.4th?5:4); .@i++) {
		if (!.@option[.@i] && HasjROCostume() && !getlook(LOOK_BODY2) && .@option[.@i] != baselook)
			.@menu$ += "New jRO " + jobname(.@option[2]) + " costume";
		else if (.@option[.@i] > 0 && .@option[.@i] != baselook) {
			if (roclass(eaclass()) == .@option[.@i])
				.@menu$ += "Restore " + jobname(.@option[.@i]) + " costume";
			else
				.@menu$ += jobname(.@option[.@i]);
		}
		.@menu$ += ":";
	}
	if(select(.@menu$)-1 == 3) { //jRO costume
		ChangeAppr(0,.@TYPE_SETLOOK);
	}
	ChangeAppr(.@option[@menu-1],.@TYPE_CHANGEBASE);
	end;

OnPCLoginEvent:
	if(baselook && .dress_perma){
		changebase baselook;
	}
	end;

OnInit:
	.n$ = "[Dress Room]"; // NPC Name
	.dress_perma = 1; //Changes are saved when player logout (1=Yes / 0=No)
	.4th = true;    //Enable changing to 4th job sprite (True / False)
	.cost_dressroom = 10000; 	// Zeny Cost
	setarray .cost_item,6959,1,982,3,983,2;	// Item cost - item ID,Amount,item ID,Amount...
	
	end;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.15
  • Content Count:  4
  • Reputation:   0
  • Joined:  04/03/25
  • Last Seen:  

Thank you very much sir! I appreciate. Will try ASAP.

 

57 minutes ago, Racaae said:

Hello

//===== rAthena Script ===========================================|
//= Mr.Secrets DressRoom - Custom Request
//= 1.5 Added 4th job sprites and item requirements [Racaae]
//= https://rathena.org/board/topic/144504-mrsecrets-dressroom-custom-request

morocc,167,95,4	script	Dress Room#sc	2_M_DYEINGER,{
function RestrictClass;
function HasjROCostume;
function ChangeAppr;

function RestrictClass {
	.@eaj = eaclass();
	if(.@eaj&EAJ_BASEMASK == EAJ_NOVICE) return 0;
	if(.@eaj&EAJL_2 && roclass(.@eaj|EAJL_UPPER) != -1){
		return 1;
	}
	return 0;
}

function HasjROCostume {
	switch(roclass(eaclass()&EAJ_THIRDMASK|EAJL_THIRD)) {
		case Job_Guillotine_Cross:
		case Job_Genetic:
		case Job_Royal_Guard:
		case Job_Arch_Bishop:
		case Job_Mechanic:
		case Job_Ranger:
		case Job_Minstrel:
		case Job_Wanderer:
		case Job_Warlock:
		// Uncomment lines below to enable certain job when their respective jRO costume is released and you patched the sprite in your client.
		//case Job_Sorcerer:
		//case Job_Sura:
		//case Job_Rune_Knight:
			return 1;
		default:
			return 0;
	}
}

function ChangeAppr {
	mes .n$;
	if (Zeny < .cost_dressroom) {
		mes "You don't have enough Zeny.";
		.@missingzeny = true;
	}
	.@size = getarraysize(.cost_item);
	if (.@size > 1) {
		for ( .@i = 0; .@i < .@size; .@i += 2 ) {
			if (countitem(.cost_item[.@i]) < .cost_item[.@i+1]) {
				if (!.@missingitem) {
					mes "You didn't bring what I need. You're missing:";
					.@missingitem = true;
				}
				mes .cost_item[.@i+1] + "x " + mesitemlink(.cost_item[.@i]);				
			}
		}	
	}
	if (.@missingzeny || .@missingitem)
		close;

	switch(getarg(1)){
		case 0: // Normal Mode
			setlook LOOK_BODY2,0;
			changebase getarg(0);
			set baselook, getarg(0);
			break;
		case 1: // jRO Mode
			if(!HasjROCostume()) return;
			changebase roclass(eaclass()&EAJ_THIRDMASK|EAJL_THIRD);
			setlook LOOK_CLOTHES_COLOR,0;
			setlook LOOK_BODY2,!(getlook(LOOK_BODY2));
			//atcommand "@bodystyle " + !(getlook(LOOK_BODY2));
			baselook = 0;
			break;
	}
	Zeny -= .cost_dressroom;
	.@size = getarraysize(.cost_item);
	if (.@size > 1) {
		for ( .@i = 0; .@i < .@size; .@i += 2 )
			delitem .cost_item[.@i], .cost_item[.@i+1];
	}
	mes "Here you are!";
	close;
}

	.@TYPE_CHANGEBASE = 0;
	.@TYPE_SETLOOK = 1;
	
	mes .n$;
	if (!RestrictClass()){
		mes "Your class isn't allowed to use my services.";
		close;
	}
	mes "I can change your appearance to another class of your classline!";
	if (HasjROCostume()){
		mes "I also have a brand new costume for your class!";
	}
	next;
	mes .n$;
	if (.cost_dressroom)
		mes "At a cost of ^FF0000" + F_InsertComma(.cost_dressroom) + "^000000z";
	
	//displaying needed item list
	.@size = getarraysize(.cost_item);
	if (.@size > 1) {
		for ( .@i = 0; .@i < .@size; .@i += 2 )
			mes (.@i+3>.@size?"And ":"") + .cost_item[.@i+1] + "x " + mesitemlink(.cost_item[.@i]);
	}

	mes "Which class do you want to change your appearance to?";
	next;
	.@option[0] = roclass(eaclass()&EAJ_UPPERMASK);
	.@option[1] = roclass(eaclass()&EAJ_UPPERMASK|EAJL_UPPER);
	.@option[2] = roclass(eaclass()&EAJ_THIRDMASK|EAJL_THIRD);
	if (.4th) {
		.@job = roclass(eaclass()&EAJ_THIRDMASK|EAJL_THIRD);
		.@option[4] = roclass(eaclass(.@job)|EAJL_FOURTH|EAJL_UPPER);
	}

	for(.@i = 0; .@i < (.4th?5:4); .@i++) {
		if (!.@option[.@i] && HasjROCostume() && !getlook(LOOK_BODY2) && .@option[.@i] != baselook)
			.@menu$ += "New jRO " + jobname(.@option[2]) + " costume";
		else if (.@option[.@i] > 0 && .@option[.@i] != baselook) {
			if (roclass(eaclass()) == .@option[.@i])
				.@menu$ += "Restore " + jobname(.@option[.@i]) + " costume";
			else
				.@menu$ += jobname(.@option[.@i]);
		}
		.@menu$ += ":";
	}
	if(select(.@menu$)-1 == 3) { //jRO costume
		ChangeAppr(0,.@TYPE_SETLOOK);
	}
	ChangeAppr(.@option[@menu-1],.@TYPE_CHANGEBASE);
	end;

OnPCLoginEvent:
	if(baselook && .dress_perma){
		changebase baselook;
	}
	end;

OnInit:
	.n$ = "[Dress Room]"; // NPC Name
	.dress_perma = 1; //Changes are saved when player logout (1=Yes / 0=No)
	.4th = true;    //Enable changing to 4th job sprite (True / False)
	.cost_dressroom = 10000; 	// Zeny Cost
	setarray .cost_item,6959,1,982,3,983,2;	// Item cost - item ID,Amount,item ID,Amount...
	
	end;
}

 

 

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