root/npc/custom/eAAC_Scripts/kafraExpress/ke_rent.txt

Revision 1, 2.5 kB (checked in by jinshiro, 17 years ago)
Line 
1//===== eAthena Script =======================================
2//= Kafra Express - Rental Module
3//===== By: ==================================================
4//= Skotlex
5//===== Current Version: =====================================
6//= 1.8
7//===== Compatible With: =====================================
8//= eAthena SVN R3424+
9//===== Description: =========================================
10//= Part of the Kafra Express Script Package.
11//= Rents PecoPecos, Falcons, Carts
12//===== Additional Comments: =================================
13//= See config.txt for configuration.
14//============================================================
15
16-       script  keInit_rent     -1,{
17OnInit: //Load Config
18        donpcevent "keConfig::OnLoadRent";
19        end;
20}
21
22function        script  F_keRent        {
23        set @cartCost,callfunc("F_keCost",$@kert_cartCost,100);
24        if(@kert_cartOnly) {
25                set @kmenu, 2;
26        } else {
27                set @falconCost,callfunc("F_keCost",$@kert_falconCost,100);
28                set @pecoCost,callfunc("F_keCost",$@kert_pecoCost,100);
29                set @kmenu, select (
30                        "- Cancel",
31                        "- Rent a Cart ("+@cartCost+"z)",
32                        "- Rent a Falcon ("+@falconCost+"z)",
33                        "- Rent a PecoPeco ("+@pecoCost+"z)"
34                );
35        }
36        switch (@kmenu) {
37        case 2: //Cart
38                if (getskilllv("MC_PUSHCART")==0) {
39                        callfunc "F_keIntro", -1, "Sorry, only those with the skill 'Pushcart' may rent a Cart.";
40                } else
41                if (checkcart()) {
42                        callfunc "F_keIntro", -1, "You are already equipped.";
43                } else
44                if (!(callfunc("F_keCharge",$@kert_cartCost,100,1))) {
45                        callfunc "F_keIntro", e_an, "Sorry, but you don't have enough Zeny.";
46                } else {
47                        setcart;
48                        emotion e_ok;
49                }
50                break;
51        case 3: //Falcon
52                if (getskilllv("HT_FALCON")==0) {
53                        callfunc "F_keIntro", -1, "Sorry, only those with the skill 'Falcon Taming' may rent a Falcon.";
54                } else
55                if (checkfalcon()) {
56                        callfunc "F_keIntro", -1, "You are already equipped.";
57                } else
58                if (!(callfunc("F_keCharge",$@kert_falconCost,100,1))) {
59                        callfunc "F_keIntro", e_an, "Sorry, but you don't have enough Zeny.";
60                } else {
61                        setfalcon;
62                        emotion e_ok;
63                }
64                break;
65        case 4: //pecopeco
66                if (getskilllv("KN_RIDING")==0) {
67                        callfunc "F_keIntro", -1, "Sorry, only those with the skill 'PecoPeco Riding' may rent a PecoPeco.";
68                } else
69                if (checkriding()) {
70                        callfunc "F_keIntro", -1, "You are already equipped.";
71                } else
72                if (!(callfunc("F_keCharge",$@kert_pecoCost,100,1))) {
73                        callfunc "F_keIntro", e_an, "Sorry, but you don't have enough Zeny.";
74                } else {
75                        setriding;
76                        emotion e_ok;
77                }
78                break;
79        }
80        return;
81}
Note: See TracBrowser for help on using the browser.