root/npc/custom/eAAC_Scripts/kafraExpress/ke_dye.txt @ 1

Revision 1, 3.4 kB (checked in by jinshiro, 17 years ago)
Line 
1//===== eAthena Script =======================================
2//= Kafra Express - Stylist Module
3//===== By: ==================================================
4//= Skotlex
5//===== Current Version: =====================================
6//= 2.0
7//===== Compatible With: =====================================
8//= eAthena SVN8637+
9//===== Description: =========================================
10//= Part of the Kafra Express Script Package.
11//= Offers dying of hair, clothes and hair-style adjusts
12//===== Additional Comments: =================================
13//= See config.txt for configuration.
14//============================================================
15
16-       script  keInit_dye      -1,{
17OnInit: //Load Config
18        donpcevent "keConfig::OnLoadDye";
19        end;
20}
21
22function        script  F_keStylist     {
23
24        function SF_inputpalette;
25        function SF_wheelpalette;
26
27        set @jobClass,eaclass(class);
28        if (@jobClass == -1)
29                set @maxCDye,0;
30        else {
31        if ((@jobClass&EAJ_BASEMASK) == EAJ_NOVICE) {
32                if (@jobClass&EAJL_2)
33                        set @maxCDye, $@kedy_clothJSN;
34                else
35                        set @maxCDye, $@kedy_clothJN;
36        } else {
37                if (@jobClass&EAJL_2)
38                        set @maxCDye, $@kedy_clothJ2ND;
39                else
40                        set @maxCDye, $@kedy_clothJ1ST;
41        } }
42        do {
43                if ($@kedy_enableHairstyle) {
44                        set @kmenu, select(
45                                "- Return",
46                                "- Change hairstyle (current is "+getlook(1)+"/max is "+$@kedy_styles+")",
47                                "- Change hairstyle (by wheel)",
48                                "- Dye hair (current is "+getlook(6)+"/max is "+$@kedy_hair+")",
49                                "- Dye hair (by wheel)",
50                                "- Dye clothes (current is "+getlook(7)+"/max is "+@maxCDye+")",
51                                "- Dye clothes (by wheel)"
52                        );
53                } else {
54                        set @kmenu, select(
55                                "- Return",
56                                "- Dye hair (current is "+getlook(6)+"/max is "+$@kedy_hair+")",
57                                "- Dye hair (by wheel)",
58                                "- Dye clothes (current is "+getlook(7)+"/max is "+@maxCDye+")",
59                                "- Dye clothes (by wheel)"
60                        );
61                        if (@kmenu > 1)
62                                set @kmenu, @kmenu+2;
63                }
64                switch (@kmenu) {
65                case 2: //Hair Style Input
66                        SF_inputpalette 1,$@kedy_styles;
67                        break;
68                case 3: //Hair Style Wheel
69                        SF_wheelpalette 1,$@kedy_styles;
70                        break;
71                case 4: //Hair Dye Input
72                        SF_inputpalette 6,$@kedy_hair;
73                        break;
74                case 5: //Hair Dye Wheel
75                        SF_wheelpalette 6,$@kedy_hair;
76                        break;
77                case 6: //Clothes Input
78                        SF_inputpalette 7,@maxCDye;
79                        break;
80                case 7: //Clothes Wheel
81                        SF_wheelpalette 7,@maxCDye ;
82                        break;
83                }
84        } while (@kmenu > 1);
85        return;
86       
87//Subfunction: SF_inputpalette(int part, int maxPalette)
88//Sets a palette from the user's request.
89function        SF_inputpalette {
90        input @pal;
91        if (@pal < 0 || @pal > getarg(1)) {
92                callfunc "F_keIntro", e_swt2, "Sorry, we do not have that dye available.";
93                return;
94        }
95        setlook getarg(0),@pal;
96        emotion e_lv;
97}       //SF_ end
98
99//Subfunction: SF_wheelpalette(int part, int maxPalette)
100//Sets a palette through browsing.
101function        SF_wheelpalette {
102        set @loc, getarg(0);
103        set @max, getarg(1);
104        set @pal, getlook(@loc);
105        set @dir, 1;
106        do {
107                if (@dir > 0)
108                        set @submenu, select(
109                                "Next",
110                                "Previous",
111                                "Done (current is "+@pal+")"
112                        );
113                else
114                        set @submenu, select(
115                                "Previous",
116                                "Next",
117                                "Done (current is "+@pal+")"
118                        );
119                switch (@submenu) {
120                case 2: //Swap direction
121                        set @dir, @dir*-1;
122                case 1:
123                        set @pal, @pal+@dir;
124                        if (@pal < 0)
125                                set @pal, @max;
126                        else if (@pal > @max)
127                                set @pal, 0;
128                        setlook @loc,@pal;
129                }
130        } while (@submenu != 3);
131        emotion e_lv2;
132}       //SF_ end
133
134}
Note: See TracBrowser for help on using the browser.