summaryrefslogtreecommitdiff
path: root/npc/merchants/ammo_dealer.txt
blob: 490be66ba0e045d92df97c0f7bf9bdc53f8170b7 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
//================= Hercules Script =======================================
//=       _   _                     _
//=      | | | |                   | |
//=      | |_| | ___ _ __ ___ _   _| | ___  ___
//=      |  _  |/ _ \ '__/ __| | | | |/ _ \/ __|
//=      | | | |  __/ | | (__| |_| | |  __/\__ \
//=      \_| |_/\___|_|  \___|\__,_|_|\___||___/
//================= License ===============================================
//= This file is part of Hercules.
//= http://herc.ws - http://github.com/HerculesWS/Hercules
//=
//= Copyright (C) 2012-2015  Hercules Dev Team
//= Copyright (C)  Euphy
//= Copyright (C)  Masao
//= Copyright (C)  Kisuka
//= Copyright (C)  Lupus
//= Copyright (C)  Legionaire
//= Copyright (C)  Paradox924X
//= Copyright (C)  Playtester
//=
//= Hercules is free software: you can redistribute it and/or modify
//= it under the terms of the GNU General Public License as published by
//= the Free Software Foundation, either version 3 of the License, or
//= (at your option) any later version.
//=
//= This program is distributed in the hope that it will be useful,
//= but WITHOUT ANY WARRANTY; without even the implied warranty of
//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//= GNU General Public License for more details.
//=
//= You should have received a copy of the GNU General Public License
//= along with this program.  If not, see <http://www.gnu.org/licenses/>.
//=========================================================================
//= Bullet Dealers
//================= Description ===========================================
//= Bullet trader.
//================= Current Version =======================================
//= 1.5
//=========================================================================

alberta,118,160,3	script	Bullet Dealer Tony#alb::bdt	4_M_04,{
	if (BaseJob == Job_Gunslinger) {
		mes "[Tony]";
		mes "I'm Tony, the Bullet Dealer.";
		mes "Come to me whenever you're";
		mes "short on ammo. Just bring me";
		mes "the materials, and I'll make";
		mes "you the bullets you need.";
		next;
		switch(select("Poison Sphere", "Flare Sphere", "Lighting Sphere", "Blind Sphere", "Freezing Sphere", "Cancel")) {
		case 1: callfunc "Bullet_Trade",937,10,13205; break;
		case 2: callfunc "Bullet_Trade",7097,2,13203; break;
		case 3: callfunc "Bullet_Trade",7053,3,13204; break;
		case 4: callfunc "Bullet_Trade",1024,5,13206; break;
		case 5: callfunc "Bullet_Trade",7054,2,13207; break;
		case 6:
			mes "[Tony]";
			mes "Changed your mind?";
			mes "Well, if you ever need";
			mes "any bullets, I'll be right";
			mes "here. Come back whenever";
			mes "you think you'll need more";
			mes "ammunition, Gunslinger.";
			close;
		}
	}
	mes "[Tony]";
	mes "Hey, I'm Tony. I'm in";
	mes "charge of distributing";
	mes "and making bullets for";
	mes "Gunslingers. It's just";
	mes "how our guild likes";
	mes "to do things.";
	next;
	mes "[Tony]";
	mes "I'm sorry if you came";
	mes "here to buy some bullets.";
	mes "I can only do business with";
	mes "fully fledged Gunslingers.";
	close;
}

function	script	Bullet_Trade	{
	mes "[Tony]";
	mes "For every set of";
	mes "30 "+getitemname(getarg(2))+"s,";
	mes "you must give me";
	mes "1 Emveretarcon,";
	mes "1 Phracon, and";
	mes ""+getarg(1)+" "+getitemname(getarg(0))+".";
	next;
	mes "[Tony]";
	mes "Remember that I can give";
	mes "a maximum of 500 sets of";
	mes "30 bullets at a time. Please";
	mes "enter the number of bullet sets";
	mes "that you'd like. If you want to";
	mes "cancel, then just enter ''0.''";
	next;
	input .@amount;
	if (.@amount < 1 || .@amount > 500) {
		mes "[Tony]";
		mes "Hey, I can't give you";
		mes "that many bullets. Don't";
		mes "forget to enter a number";
		mes "that's no higher than 500";
		mes "if you want to trade your";
		mes "items for some bullets.";
		close;
	}
	if (countitem(Phracon) >= .@amount && countitem(Emveretarcon) >= .@amount && countitem(getarg(0)) >= (.@amount*getarg(1))) {
		if (checkweight(getarg(2),.@amount * 30) == 0) {
			mes "[Tony]";
			mes "Eh? Your Inventory doesn't";
			mes "have enough space for this";
			mes "many bullets. Come back later";
			mes "after you make more space";
			mes "available. Try putting some of";
			mes "your things into Kafra Storage.";
			close;
		} else {
			mes "[Tony]";
			mes "Great, everything seems";
			mes "to be in order. Let me take";
			mes "these materials, and here are";
			mes "your bullets. It's a pleasure";
			mes "to do business with you~";
			delitem 1010,.@amount;
			delitem 1011,.@amount;
			delitem getarg(0),.@amount * getarg(1);
			getitem getarg(2),.@amount * 30;
			close;
		}
	} else {
		mes "[Tony]";
		mes "Huh. It looks like you";
		mes "don't have enough materials";
		mes "for that many bullets. Well,";
		mes "it's no problem. Just come";
		mes "back after gathering everything";
		mes "that you need, okay?";
		close;
	}
}