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

Revision 1, 1.7 kB (checked in by jinshiro, 17 years ago)
Line 
1//===== eAthena Script =======================================
2//= Kafra Express - Portable Shop Module
3//===== By: ==================================================
4//= Skotlex
5//===== Current Version: =====================================
6//= 0.1
7//===== Compatible With: =====================================
8//= eAthena SVN R5195+
9//===== Description: =========================================
10//= Part of the Kafra Express Script Package.
11//= Offers buying/selling shop.
12//===== Additional Comments: =================================
13//= See config.txt for configuration.
14//============================================================
15
16-       script  keInit_shop     -1,{
17OnInit: //Load Config
18        donpcevent "keConfig::OnLoadShop";
19        end;
20}
21
22//Sample shops, adjust as needed!
23-       shop    ke_townshop     -,611:-1,1750:-1,501:-1,502:-1,503:-1,504:-1,506:-1,525:-1,601:-1,602:-1,1065:-1,645:-1,656:-1,657:-1
24-       shop    ke_dunshop      -,611:-1,1750:-1,501:-1,502:-1,503:-1,504:-1,506:-1,525:-1,601:-1,602:-1,1065:-1
25
26function        script  F_keShop        {
27
28        if (getarg(0) == 0) { //Town shop
29                set @type, $@kesh_towntype;
30                set @shop$, $@kesh_townshop$;
31        } else {
32                set @type, $@kesh_duntype;
33                set @shop$, $@kesh_dunshop$;
34        }
35
36        switch (@type) {
37                case 1:
38                        set @kmenu, select(
39                                "- Return",
40                                "- Buy items"
41                        );
42                        break;
43                case 2:
44                        set @kmenu, select(
45                                "- Return",
46                                "- Sell items"
47                        );
48                        if (@kmenu > 1)
49                                set @kmenu,3;
50                        break;
51                default:
52                        set @kmenu, select(
53                                "- Return",
54                                "- Buy items",
55                                "- Sell items"
56                        );
57                        break;         
58        }
59        if (@kmenu == 1)
60                return;
61        mes "Thank you for using Kafra Services.";
62        close2;
63        cutin getarg(1), 255;
64        callshop @shop$, @kmenu-1;
65        end;
66}
Note: See TracBrowser for help on using the browser.