Would you like to react to this message? Create an account in a few clicks or log in to continue.

Stylist NPC Changes

3 posters

Go down

Stylist NPC Changes Empty Stylist NPC Changes

Post by Radical Sun Jan 10, 2010 2:36 pm

While the Stylist NPC is functional as it is...
How about adding a "Forwards" and "Backwards" feature.
As in

Hello, welcome to the stylist? How may i help you?


-Root menu-


-When section is chosen-
"I want to start from the beginning"
"I know what i want"
"Surprise me"



When "I want to start from the beginning" is chosen.

Next hairstyle
Previous Hairstyle
I like this one



It saves you the trouble of having to scroll all the way through the palettes, and doesnt require that you remember any tedious palette numbers.

Also, an extra option is to have the palette number displayed next to "I like this one"
As in...

"I like this one"(214)

I dont know, i just know certain NPC's can be tedious if you dont add in shortcuts ^^

I can probobally get you guys a working version of this NPC if you would like.
Radical
Radical
Moderator

Posts : 43
Join date : 2010-01-10
Age : 37
Location : Texas, USA

Back to top Go down

Stylist NPC Changes Empty Re: Stylist NPC Changes

Post by PhoenixTrainer Sun Jan 10, 2010 4:19 pm

yeah this is a good idea

still I have a lot of works these days with my exams and the few time I have for the server is usually devoted to complete the new pvp system.

but as soon as my exams are over (in one week) I'll have much more time to spend on the server so things will (I hope) go faster and I'll hope to have more time for little details like this one ^^ (yeah sorry but even though it's a good idea, it's still a detail ^^)
PhoenixTrainer
PhoenixTrainer
Administrator

Posts : 112
Join date : 2009-11-09
Age : 35
Location : Morges, Switzerland

Back to top Go down

Stylist NPC Changes Empty Re: Stylist NPC Changes

Post by Radical Sun Jan 10, 2010 6:30 pm

I can actually handle this script for you. May i email it to you?
Radical
Radical
Moderator

Posts : 43
Join date : 2010-01-10
Age : 37
Location : Texas, USA

Back to top Go down

Stylist NPC Changes Empty Re: Stylist NPC Changes

Post by Radical Sun Jan 10, 2010 6:33 pm

How about something like this....


Code:
prontera.gat,-coordinates here-   script   Stylist   122,{

   set @name$,"[^FF8000Stylist^000000]";
   setarray @max[1],300,251,24;   // Number of cloths, haircolors, hairstyles in client
   setarray @blacklist[0],188,143,261;      // NPC will skip any cloth colors in this array
                           //     use for palettes that cause errors or just plain look bad.
                           //      Leave first value at 0 to disable.
   setarray @type[1],7,6,1;      // Do not touch
   set @style,0;
   
   mes @name$;
   mes "I can change your appearance for you if you'd like.";
   mes " ";
   mes "Just choose what you'd like to change:";
   next;
   set @s,select("Clothes color",
            "Hair color",
            "Hair style");
   
   mes @name$;
   mes "Alright, how would you like to search?";
   next;
   menu "Start at the beginning",L_start,
      "Choose where to start",-;
   
   // CHOOSE WHERE TO START =====================================================
   mes @name$;
   mes "Alright, choose a style between ^0000FF0 and " +@max[@s]+ "^000000.";
   next;
   input @style;
   
   if (@style < 0 || @style > @max[@s]) {
      mes @name$;
      mes "Style chosen is out of range.";
      close;
   }

  L_start:
   setarray @revert[1],getlook(@type[@s]),0,0;
   mes @name$;
   mes "Alright here we go, starting at style ^007700" +@style+ "^000000.";
   next;
   
  // BEGINNING OF STYLE MENU LOOP ================================================
  L_menuloop:
   if (@blacklist[0]) {
      for (set @f,0; @f < getarraysize(@blacklist); set @f,@f+1) {
         if (@style == @blacklist[@f] && @previous == 1 && @s == 1) {
            message strcharinfo(0),"GM Message - Cloth " +@style+ " was removed.";
            set @style, @style - 1;
            goto L_menuloop;
         } else if (@style == @blacklist[@f] && @s == 1) {
            message strcharinfo(0),"GM Message - Cloth " +@style+ " was removed.";
            set @style, @style +1;
            goto L_menuloop;
         }
      }
   }
   setlook @type[@s],@style;
   mes "This is style number ^007700" +@style+ "^000000.";
   
   set @next, @style + 1;
   set @prev, @style - 1;
   
   // MAXIMUM MENU
   if (@style == @max[@s]) {
      set @next,0;
      message strcharinfo(0),"Limit Reached";
   }
   
   // MINIMUM MENU ==============================================================
   if (@style == 0) {
      set @prev,@max[@s];
      message strcharinfo(0),"Beginning Reached";
   }
   
   // PREVIOUS MENU =============================================================
   if (@previous) {
      menu "^FF0000Previous - " +@prev+ "^000000",L_prev,
         "^0000FFNext - " +@next+ "^000000",L_next,
         "Jump to",L_jump,
         "Save",L_save,
         "Load",L_load;
   }
   
   // DEFAULT MENU ==============================================================
   menu "^0000FFNext - " +@next+ "^000000",L_next,
      "^FF0000Previous - " +@prev+ "^000000",L_prev,
      "Jump to",L_jump,
      "Save",L_save,
      "Load",L_load;
      
  L_next:
   set @previous,0;
   set @style, @next;
   goto L_menuloop;

  L_prev:
   set @previous,1;
   set @style, @prev;
   goto L_menuloop;
   
  L_jump:
   next;
   mes @name$;
   mes "Choose which style you'd like to jump to:";
   next;
   input @style;
   if (@style < 0 || @style > @max[@s]) {
      mes @name$;
      mes "Style chosen is out of range.";
      close;
   }
   goto L_menuloop;
   
  L_save:
   next;
   mes @name$;
   mes "Choose which slot you'd like to save to:";
   set @x, select("Slot 1 - [" +@revert[1]+ "]",
               "Slot 2 - [" +@revert[2]+ "]",
               "Slot 3 - [" +@revert[3]+ "]");
               
   setarray @revert[@x], @style;
   goto L_menuloop;
   
  L_load:
   next;
   mes @name$;
   mes "Choose which slot you'd like to load from:";
   set @x, select("Slot 1 - [" +@revert[1]+ "]",
               "Slot 2 - [" +@revert[2]+ "]",
               "Slot 3 - [" +@revert[3]+ "]");
               
   set @style, @revert[@x];
   goto L_menuloop;
}

Be sure to put in the NPC coordinates
Radical
Radical
Moderator

Posts : 43
Join date : 2010-01-10
Age : 37
Location : Texas, USA

Back to top Go down

Stylist NPC Changes Empty Re: Stylist NPC Changes

Post by Radical Sun Jan 10, 2010 6:36 pm

And a newer version of the same script.

Code:
prontera.gat,164,171,1   script   Stylist   122,{

   set .@name$,"[^FF8000Stylist^000000]";
   setarray .@max[1],300,251,24;      // Number of cloths, haircolors, hairstyles in client
   setarray .@blacklist[0],188,143,261;   // NPC will skip any cloth colors in this array.
                              //     Use for palettes that cause errors or just plain look bad.
                              //      Leave first value at 0 to disable.
   setarray .@type[1],7,6,1;         // DO NOT EDIT
   set .@style,0;
   
   mes .@name$;
   mes "I can change your appearance for you if you'd like.";
   mes " ";
   mes "Just choose what you'd like to change:";
   next;
   set .@s,select("Clothes color",
            "Hair color",
            "Hair style");
   
   mes .@name$;
   mes "Alright, how would you like to search?";
   next;
   menu "Start at the beginning",L_start,
      "Choose where to start",-;
   
   // CHOOSE WHERE TO START =====================================================
   mes .@name$;
   mes "Alright, choose a style between ^0000FF0 and " +.@max[.@s]+ "^000000.";
   next;
   input .@style;
   
   if (.@style < 0 || .@style > .@max[.@s]) {
      mes .@name$;
      mes "Style chosen is out of range.";
      close;
   }

  L_start:
   setarray @revert[1],getlook(.@type[.@s]),0,0;
   mes .@name$;
   mes "Alright here we go, starting at style ^007700" +.@style+ "^000000.";
   next;
   
  // BEGINNING OF STYLE MENU LOOP ================================================
  L_menuloop:
   if (.@blacklist[0]) {
      for (set .@f,0; .@f < getarraysize(.@blacklist); set .@f,.@f+1) {
         if (.@style == .@blacklist[.@f] && .@previous == 1 && .@s == 1) {
            message strcharinfo(0),"GM Message - Cloth " +.@style+ " was removed.";
            set .@style, .@style - 1;
            goto L_menuloop;
         } else if (.@style == .@blacklist[.@f] && .@s == 1) {
            message strcharinfo(0),"GM Message - Cloth " +.@style+ " was removed.";
            set .@style, .@style +1;
            goto L_menuloop;
         }
      }
   }
   setlook .@type[.@s],.@style;
   mes "This is style number ^007700" +.@style+ "^000000.";
   
   set .@next, .@style + 1;
   set .@prev, .@style - 1;
   
   // MAXIMUM MENU
   if (.@style == .@max[.@s]) {
      set .@next,0;
      message strcharinfo(0),"Limit Reached";
   }
   
   // MINIMUM MENU ==============================================================
   if (.@style == 0) {
      set .@prev,.@max[.@s];
      message strcharinfo(0),"Beginning Reached";
   }
   
   // PREVIOUS MENU =============================================================
   if (.@previous) {
      menu "^FF0000Previous - " +.@prev+ "^000000",L_prev,
         "^0000FFNext - " +.@next+ "^000000",L_next,
         "Jump to",L_jump,
         "Save",L_save,
         "Load",L_load;
   }
   
   // DEFAULT MENU ==============================================================
   menu "^0000FFNext - " +.@next+ "^000000",L_next,
      "^FF0000Previous - " +.@prev+ "^000000",L_prev,
      "Jump to",L_jump,
      "Save",L_save,
      "Load",L_load;
      
  L_next:
   set .@previous,0;
   set .@style, .@next;
   goto L_menuloop;

  L_prev:
   set .@previous,1;
   set .@style, .@prev;
   goto L_menuloop;
   
  L_jump:
   next;
   mes .@name$;
   mes "Choose which style you'd like to jump to:";
   next;
   input .@style;
   if (.@style < 0 || .@style > .@max[.@s]) {
      mes .@name$;
      mes "Style chosen is out of range.";
      close;
   }
   goto L_menuloop;
   
  L_save:
   next;
   mes .@name$;
   mes "Choose which slot you'd like to save to:";
   set .@x, select("Slot 1 - [" +@revert[1]+ "]",
               "Slot 2 - [" +@revert[2]+ "]",
               "Slot 3 - [" +@revert[3]+ "]");
               
   setarray @revert[.@x], .@style;
   goto L_menuloop;
   
  L_load:
   next;
   mes .@name$;
   mes "Choose which slot you'd like to load from:";
   set .@x, select("Slot 1 - [" +@revert[1]+ "]",
               "Slot 2 - [" +@revert[2]+ "]",
               "Slot 3 - [" +@revert[3]+ "]");
               
   set .@style, @revert[.@x];
   goto L_menuloop;
}
Radical
Radical
Moderator

Posts : 43
Join date : 2010-01-10
Age : 37
Location : Texas, USA

Back to top Go down

Stylist NPC Changes Empty Re: Stylist NPC Changes

Post by PhoenixTrainer Mon Jan 11, 2010 2:17 am

damn! another fan of menu and goto! =O

Except for the fact that I noticed you used those two guys I don't have time right now to examine it right now but I'll try to find some time this evening when i get back home.... =)
PhoenixTrainer
PhoenixTrainer
Administrator

Posts : 112
Join date : 2009-11-09
Age : 35
Location : Morges, Switzerland

Back to top Go down

Stylist NPC Changes Empty Re: Stylist NPC Changes

Post by Radical Mon Jan 11, 2010 7:28 pm

These are both from eathena.ws
I believe they are fully functional, from what i read.
Radical
Radical
Moderator

Posts : 43
Join date : 2010-01-10
Age : 37
Location : Texas, USA

Back to top Go down

Stylist NPC Changes Empty Re: Stylist NPC Changes

Post by PhoenixTrainer Tue Jan 12, 2010 8:18 am

ow ok I see.

but still, I don't like "functionnal" being the target level of a script.

even if you can do 100% functionnal bug-free scripts with goto, it makes the code messy and hard to read for a human eye. The ea script implements more advanced structured functions, like loops, switch and so on...

Using goto can and should always be avoided ^^.

Now about that ea script, if can be a temporary solution, because I'd like to have something better, at least on the Alpha server...
PhoenixTrainer
PhoenixTrainer
Administrator

Posts : 112
Join date : 2009-11-09
Age : 35
Location : Morges, Switzerland

Back to top Go down

Stylist NPC Changes Empty Re: Stylist NPC Changes

Post by Radical Tue Jan 12, 2010 10:07 pm

Agreed.
I know using fully unique scripts is preferable, but a temporary solution works as well, until you have the time.
Radical
Radical
Moderator

Posts : 43
Join date : 2010-01-10
Age : 37
Location : Texas, USA

Back to top Go down

Stylist NPC Changes Empty Re: Stylist NPC Changes

Post by Mirrors Thu Jan 14, 2010 6:50 pm

PhoenixTrainer wrote:damn! another fan of menu and goto! =O

>.> (goto FTW)

I liked the "Surprise Me" thing.
Mirrors
Mirrors
Administrator

Posts : 47
Join date : 2009-11-08
Age : 30
Location : Black Box

http://twitter.com/BlackBoxRO

Back to top Go down

Stylist NPC Changes Empty Re: Stylist NPC Changes

Post by Radical Thu Jan 14, 2010 7:43 pm

Also... is this server running the satan morroc episode?
Or is it pre-SM?
I notice morroc is not destroyed... but that would mean this server is 2 episodes behind.
I'm guessing there is a way to return to satan morroc's time?
Radical
Radical
Moderator

Posts : 43
Join date : 2010-01-10
Age : 37
Location : Texas, USA

Back to top Go down

Stylist NPC Changes Empty Re: Stylist NPC Changes

Post by Mirrors Thu Jan 14, 2010 7:49 pm

Not sure, but yeah our SVN is too old though...
Mirrors
Mirrors
Administrator

Posts : 47
Join date : 2009-11-08
Age : 30
Location : Black Box

http://twitter.com/BlackBoxRO

Back to top Go down

Stylist NPC Changes Empty Re: Stylist NPC Changes

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum