Jump to content
  • 0

Limit clothing/palette choices


Rain408

Question


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  77
  • Reputation:   0
  • Joined:  05/23/15
  • Last Seen:  

I was looking at this script, and was wondering how to do either or.

1) limit options through the script.

2) locate file in server where it pulling information for clothing/hair/color and self adjust.

 

With that said, where is getbattleflag located or is it possible to adjust options w/in the script?

 

prontera,170,180,1 script Stylist#custom_stylist 122,{
setarray .@Styles[1],
getbattleflag("max_cloth_color"),
getbattleflag("max_hair_style"),
getbattleflag("max_hair_color");
setarray .@Look[1],
LOOK_CLOTHES_COLOR,
LOOK_HAIR,
LOOK_HAIR_COLOR;
set .@s, select(" ~ Cloth color: ~ Hairstyle: ~ Hair color");
set .@Revert, getlook(.@Look[.@s]);
set .@Style,1;
while(1) {
setlook .@Look[.@s], .@Style;
message strcharinfo(0),"This is style #"+.@Style+".";
set .@menu$, " ~ Next (^0055FF"+((.@Style!=.@Styles[.@s])?.@Style+1:1)+"^000000): ~ Previous (^0055FF"+((.@Style!=1)?.@Style-1:.@Styles[.@s])+"^000000): ~ Jump to...: ~ Revert to original (^0055FF"+.@Revert+"^000000)";
switch(select(.@menu$)) {
case 1:
set .@Style, ((.@Style != .@Styles[.@s]) ? .@Style+1 : 1);
break;
case 2:
set .@Style, ((.@Style != 1) ? .@Style-1 : .@Styles[.@s]);
break;
case 3:
message strcharinfo(0),"Choose a style between 1 - "+.@Styles[.@s]+".";
input .@Style,0,.@Styles[.@s];
if (!.@Style)
set .@Style, rand(1,.@Styles[.@s]);
break;
case 4:
set .@Style, .@Revert;
setlook .@Look[.@s], .@Revert;
break;
}
}
}
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  265
  • Reputation:   96
  • Joined:  09/30/14
  • Last Seen:  

Easiest way is to hard set the values in the stylist itself.

setarray .@Styles[1],

getbattleflag("max_cloth_color"),

getbattleflag("max_hair_style"),

getbattleflag("max_hair_color");

Becomes

setarray .@Styles[1],25,29,10;

Or whatever your respective max styles are.

Though it is also easy to change the conf files, this method allows you to have additional styles locked out. So your max cloth color could be 300 and this NPC would manage only the first 25.

Link to comment
Share on other sites


  • Group:  Content Moderator
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  639
  • Reputation:   609
  • Joined:  11/25/11
  • Last Seen:  

The battleflags are all found in the conf/battle/ folder.
This one is specifically the client.conf.

 

About your npc (i suggest you to use the [ code ] box function (withe the <> icon) to make it easy so we can help you.

So, let's get to it:

prontera,170,180,1	script	Stylist#custom_stylist	122,{
	setarray .@Styles[1], 
		getbattleflag("max_cloth_color"), 
		getbattleflag("max_hair_style"), 
		getbattleflag("max_hair_color");
		
	setarray .@Look[1],
		LOOK_CLOTHES_COLOR,
		LOOK_HAIR,
		LOOK_HAIR_COLOR;
		
	set .@s, select(" ~ Cloth color: ~ Hairstyle: ~ Hair color");
	set .@Revert, getlook(.@Look[.@s]);
	set .@Style,1;
	
	while(1){
		setlook .@Look[.@s], .@Style;
		message strcharinfo(0)," this is style #"+.@Style+".";
		set .@menu$, " ~ Next (^0055FF"+((.@Style!=.@Styles[.@s])?.@Style+1:1)+"^000000): ~ Previous (^0055FF"+((.@Style!=1)?.@Style-1:.@Styles[.@s])+"^000000): ~ Jump to...: ~ Revert to original (^0055FF"+.@Revert+"^000000)";
		
		switch(select(.@menu$)){
			case 1:
				set .@Style, ((.@Style != .@Styles[.@s]) ? .@Style+1 : 1);
				break;
			
			case 2:
				set .@Style, ((.@Style != 1) ? .@Style-1 : .@Styles[.@s]);
				break;

			case 3:
				message strcharinfo(0),"Choose a style between 1 - "+.@Styles[.@s]+".";
				input .@Style,0,.@Styles[.@s];
				
				if (!.@Style)
					set .@Style, rand(1,.@Styles[.@s]);
					break;
					
			case 4:
				set .@Style, .@Revert;
				setlook .@Look[.@s], .@Revert;
				break;
		}
	}
}

What is defining the max value of each look is this variable:

setarray .@Styles[1], 
	getbattleflag("max_cloth_color"), 
	getbattleflag("max_hair_style"), 
	getbattleflag("max_hair_color");

Which is getting the values direct from the previous mentioned .conf file, so you can directly edit it or make an If according with what you want to limit the looks.

if (getgmlevel() > 1) 
    setarray .@Styles[1], 
        getbattleflag("max_cloth_color"), 
        getbattleflag("max_hair_style"), 
        getbattleflag("max_hair_color");
else 
    setarray .@Styles[1], 
        72, 
        23, 
        20;

In my example, I put a limit based on their GM Level, usually used to differ VIPs from non-VIPs.

Edited by Haziel
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...