summaryrefslogtreecommitdiff
path: root/npc/custom/eAAC_Scripts/kafraExpress/ke_shop.txt
blob: e627d0c619c225d9ad51779f153e8fdf54ad5a39 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//===== rAthena Script =======================================
//= Kafra Express - Portable Shop Module
//===== By: ==================================================
//= Skotlex
//===== Current Version: =====================================
//= 0.1
//===== Compatible With: =====================================
//= rAthena SVN R5195+
//===== Description: =========================================
//= Part of the Kafra Express Script Package.
//= Offers buying/selling shop.
//===== Additional Comments: =================================
//= See config.txt for configuration.
//============================================================

-	script	keInit_shop	-1,{
OnInit:	//Load Config
	donpcevent "keConfig::OnLoadShop";
	end;
}

//Sample shops, adjust as needed!
-	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
-	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

function	script	F_keShop	{

	if (getarg(0) == 0) { //Town shop
		set @type, $@kesh_towntype;
		set @shop$, $@kesh_townshop$;
	} else {
		set @type, $@kesh_duntype;
		set @shop$, $@kesh_dunshop$;
	}

	switch (@type) {
		case 1:
			set @kmenu, select(
				"- Return",
				"- Buy items"
			);
			break;
		case 2:
			set @kmenu, select(
				"- Return",
				"- Sell items"
			);
			if (@kmenu > 1)
				set @kmenu,3;
			break;
		default:
			set @kmenu, select(
				"- Return",
				"- Buy items",
				"- Sell items"
			);
			break;
	}
	if (@kmenu == 1)
		return;
	mes "Thank you for using Kafra Services.";
	close2;
	cutin getarg(1), 255;
	callshop @shop$, @kmenu-1;
	end;
}