summaryrefslogtreecommitdiff
path: root/npc/other/arena/arena_point.txt
blob: 5292ebab31b83d67541cf9072797d747eda03797 (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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
//================= 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)  L0ne_W0lf
//=
//= 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/>.
//=========================================================================
//= Point Exchanger
//================= Description ===========================================
//= Point exchanger: Turbo track points -> Arena Points
//================= Current Version =======================================
//= 1.0
//=========================================================================

prt_are_in,103,11,3	script	Arena Point Manager	4_M_JOB_HUNTER,{
	mes "[Arena Point Manager]";
	mes "I hope you're having a good";
	mes "time in the Arena. If you've";
	mes "earned Turbo Track Points at";
	mes "Al De Baran's Turbo Track, I can,";
	mes "convert them into Arena Points.";
	next;
	switch(select("Point Check", "Convert Points", "^660000Conversion Info^000000")) {
	case 1:
		mes "[Arena Point Manager]";
		mes "" + strcharinfo(PC_NAME) + ",";
		mes "you currently have";
		mes "" + arena_point + " Arena Points";
		mes "and " + tt_point + " Turbo Track Points.";
		close;
	case 2:
		mes "[Arena Point Manager]";
		mes "" + strcharinfo(PC_NAME) + ",";
		mes "you currently have";
		mes "" + arena_point + " Arena Points";
		mes "and " + tt_point + " Turbo Track Points.";
		next;
		mes "[Arena Point Manager]";
		mes "Please choose from among";
		mes "the Track Point to Arena Point";
		mes "conversions. Keep in mind that";
		mes "when you convert more than 10";
		mes "Track Points at one time, you can only convert in ^4D4DFFmultiples of 10^000000.";
		next;
		switch(select("2 TP -> 1 AP", "4 TP -> 2 AP", "6 TP -> 3 AP", "8 TP -> 4 AP", "10 TP and more", "Cancel")) {
		case 1:
			callsub S_ExchangePoints,28999,2,1;
		case 2:
			callsub S_ExchangePoints,28998,4,2;
		case 3:
			callsub S_ExchangePoints,28997,6,2;
		case 4:
			callsub S_ExchangePoints,28996,8,4;
		case 5:
			mes "[Arena Point Manager]";
			mes "Please enter the number";
			mes "of times you wish to convert";
			mes "10 Turbo Track Points into";
			mes "Arena Points. The largest";
			mes "value you may enter is 20.";
			mes "To cancel, enter ''^3355FF0^000000.''";
			next;
			input .@input;
			if (.@input == 0) {
				mes "[Arena Point Manager]";
				mes "You have";
				mes "canceled";
				mes "this service.";
				close;
			}
			else if (.@input > 20) {
				mes "[Arena Point Manager]";
				mes "Your request exceeds";
				mes "the maximum limit. Please";
				mes "enter a value no greater than 20.";
				close;
			}
			else {
				.@want_point1 = 10 * .@input;
				.@want_point = 5 * .@input;
				.@my_arena_all = arena_point + .@want_point;
				.@my_turbo_all = tt_point - .@want_point1;
				if (.@my_arena_all > 28999) {
					mes "[Arena Point Manager]";
					mes "You will exceed the";
					mes "maximum amount of";
					mes "Arena Points if we proceed";
					mes "with this conversion of your";
					mes "Turbo Track Points. You cannot";
					mes "have more than 29,000 Arena Points.";
					next;
					mes "[Arena Point Manager]";
					mes "Please spend some of";
					mes "your Arena Points before";
					mes "using this service again.";
					mes "Thank you for your patronage.";
					close;
				}
				if (.@my_turbo_all < 0) {
					mes "[Arena Point Manager]";
					mes "I'm sorry, but";
					mes "you don't have enough";
					mes "Turbo Track Points to";
					mes "perform this Arena";
					mes "Point conversion.";
					close;
				}
				else {
					mes "[Arena Point Manager]";
					mes "You have converted";
					mes "10 Turbo Track Points";
					mes "into 5 Arena Points " + .@input + " times.";
					mes "A total of " + .@want_point1 + " Turbo Track Points were converted into";
					mes "" + .@want_point +" Arena Points.";
					tt_point -= .@want_point1;
					arena_point += .@want_point;
					next;
					mes "[Arena Point Manager]";
					mes "" + strcharinfo(PC_NAME) + ",";
					mes "you now have";
					mes "^4682B4" + arena_point + "^000000 Arena Points";
					mes "and ^00688B" + tt_point + "^000000 Turbo Track Points.";
					mes "Thank you for your patronage.";
					close;
				}
			}
		case 6:
			mes "[Arena Point Manager]";
			mes "You have";
			mes "canceled";
			mes "this service.";
			close;
		}
	case 3:
		// Again. no dialog for this option.
		close;
	}
	close;

S_ExchangePoints:
	if (arena_point > getarg(0) ) {
		mes "[Arena Point Manager]";
		mes "You will exceed the";
		mes "maximum amount of";
		mes "Arena Points if we proceed";
		mes "with this conversion of your";
		mes "Turbo Track Points. You cannot";
		mes "have more than 29,000 Arena Points.";
		next;
		mes "[Arena Point Manager]";
		mes "Please spend some of";
		mes "your Arena Points before";
		mes "using this service again.";
		mes "Thank you for your patronage.";
		close;
	}
	if (tt_point >= getarg(1)) {
		mes "[Arena Point Manager]";
		mes "" + strcharinfo(PC_NAME) + ",";
		mes "you've converted "+getarg(1)+" Track";
		mes "Points into "+getarg(2)+" Arena Point.";
		tt_point -= getarg(1);
		arena_point += getarg(2);
		next;
		mes "[Arena Point Manager]";
		mes "" + strcharinfo(PC_NAME) + ",";
		mes "you now have";
		mes "^4682B4" + arena_point + "^000000 Arena Points";
		mes "and ^00688B" + tt_point + "^000000 Turbo Track Points.";
		mes "Thank you for your patronage.";
		close;
	}
	else {
		mes "[Arena Point Manager]";
		mes "I'm sorry, but you don't have";
		mes "enough Turbo Track Points.";
		mes "You need at least 2 Turbo Track Points for this conversion service.";
		close;
	}
}