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.
Question
Gabe D Stydian
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.