Jump to content
  • 0

Stylist with save style feature


Question

Posted

Im trying to modify this hairstyler npc to do the following things . 

1. Upon selecting the confirmation for new hairstyle, the npc will ask (Do you want to save this style on your wardrobe?), if you select NO your hairstyle will just change, if YES there will be 3 slots to choose to save your style and your appearance will change as well...

2. If the slots are full, the npc will ask to overwrite the slot ..

3. You can view or choose from your wardrobe which style to switch on .. and you can also delete saved style one by one ..

 

I need help ... Thankyou ! 

 

Quote

prontera,76,96,1    script    Stylist#custom_stylist    122,{
set .@Styles, getbattleflag("max_hair_style");
set .@Look, LOOK_HAIR;
set .@Revert, getlook(.@Look);
set .@Style,1    ;
    @stylist_look_type = .@Look;
    @stylist_look_value = getlook(@stylist_look_type);
    addtimer 1, strnpcinfo(0) + "::OnPCLogoutEvent";

    switch(select("Change Hairstyle:Open Wardrobe:Quit")) {
        case 1:
            while(1) {
                ignoretimeout 1;
                setlook .@Look, .@Style;
                mes "This is style #"+.@Style+".";
                set .@menu$, "Next:Previous:I know what I want:I want this style";
                switch(prompt(.@menu$)) {
                case 1:
                    set .@Style, .@Style+1;
                    break;
                case 2:
                    set .@Style, .@Style-1;
                    break;
                case 3:
                    message strcharinfo(0),"Choose a style between 1 - "+.@Styles[.@s]+".";
                    input .@Style,0,.@Styles[.@s];
                    if (.@Style <= 0) {
                        mes "Invalid";
                        end;
                    }
                    if (!.@Style)
                        set .@Style, rand(1,.@Styles[.@s]);
                    break;
                case 4:
                    // You have to set the values to 0 and remove the timer event once the colors are chosen and confirmed
                    // Your code currently doesn't have a way out of your loops, so I added this one.
                    @stylist_look_type = @stylist_look_value = 0;
                    deltimer strnpcinfo(0) + "::OnPCLogoutEvent";
                    end;
                default:
                    set .@Style, .@Revert;
                    setlook .@Look[.@s], .@Revert;
                    end;
                }
            }    
        case 2:
            end;
    }
    end;
    
OnPCLogoutEvent:
    if (@stylist_look_type != 0) {
        setlook @stylist_look_type, @stylist_look_value;
    }
    
    deltimer strnpcinfo(0) + "::OnPCLogoutEvent";
    end;    
}

 

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...