OSDN Git Service

First version
[st-ro/stro.git] / npc / other / arena / arena_point.txt
1 //===== rAthena Script =======================================
2 //= Point Exchanger
3 //===== By: ==================================================
4 //= L0ne_W0lf
5 //===== Current Version: =====================================
6 //= 1.0
7 //===== Compatible With: =====================================
8 //= rAthena Project
9 //===== Description: ========================================= 
10 //= [Official Conversion]
11 //= Point exchanger: Turbo track points -> Arena Points
12 //===== Additional Comments: =================================
13 //= 1.0 First version. [L0ne_W0lf]
14 //============================================================
15
16 prt_are_in,103,11,3     script  Arena Point Manager     732,{
17         mes "[Arena Point Manager]";
18         mes "I hope you're having a good";
19         mes "time in the Arena. If you've";
20         mes "earned Turbo Track Points at";
21         mes "Al De Baran's Turbo Track, I can,";
22         mes "convert them into Arena Points.";
23         next;
24         switch(select("Point Check:Convert Points:^660000Conversion Info^000000")) {
25         case 1:
26                 mes "[Arena Point Manager]";
27                 mes "" + strcharinfo(0) + ",";
28                 mes "you currently have";
29                 mes "" + arena_point + " Arena Points";
30                 mes "and " + tt_point + " Turbo Track Points.";
31                 close;
32         case 2:
33                 mes "[Arena Point Manager]";
34                 mes "" + strcharinfo(0) + ",";
35                 mes "you currently have";
36                 mes "" + arena_point + " Arena Points";
37                 mes "and " + tt_point + " Turbo Track Points.";
38                 next;
39                 mes "[Arena Point Manager]";
40                 mes "Please choose from among";
41                 mes "the Track Point to Arena Point";
42                 mes "conversions. Keep in mind that";
43                 mes "when you convert more than 10";
44                 mes "Track Points at one time, you can only convert in ^4D4DFFmultiples of 10^000000.";
45                 next;
46                 switch(select("2 TP -> 1 AP:4 TP -> 2 AP:6 TP -> 3 AP:8 TP -> 4 AP:10 TP and more:Cancel")) {
47                 case 1:
48                         callsub S_ExchangePoints,28999,2,1;
49                 case 2:
50                         callsub S_ExchangePoints,28998,4,2;
51                 case 3:
52                         callsub S_ExchangePoints,28997,6,2;
53                 case 4:
54                         callsub S_ExchangePoints,28996,8,4;
55                 case 5:
56                         mes "[Arena Point Manager]";
57                         mes "Please enter the number";
58                         mes "of times you wish to convert";
59                         mes "10 Turbo Track Points into";
60                         mes "Arena Points. The largest";
61                         mes "value you may enter is 20.";
62                         mes "To cancel, enter ''^3355FF0^000000.''";
63                         next;
64                         input .@input;
65                         if (.@input == 0) {
66                                 mes "[Arena Point Manager]";
67                                 mes "You have";
68                                 mes "canceled";
69                                 mes "this service.";
70                                 close;
71                         }
72                         else if (.@input > 20) {
73                                 mes "[Arena Point Manager]";
74                                 mes "Your request exceeds";
75                                 mes "the maximum limit. Please";
76                                 mes "enter a value no greater than 20.";
77                                 close;
78                         }
79                         else {
80                                 set .@want_point1,10 * .@input;
81                                 set .@want_point,5 * .@input;
82                                 set .@my_arena_all,arena_point + .@want_point;
83                                 set .@my_turbo_all,tt_point - .@want_point1;
84                                 if (.@my_arena_all > 28999) {
85                                         mes "[Arena Point Manager]";
86                                         mes "You will exceed the";
87                                         mes "maximum amount of";
88                                         mes "Arena Points if we proceed";
89                                         mes "with this conversion of your";
90                                         mes "Turbo Track Points. You cannot";
91                                         mes "have more than 29,000 Arena Points.";
92                                         next;
93                                         mes "[Arena Point Manager]";
94                                         mes "Please spend some of";
95                                         mes "your Arena Points before";
96                                         mes "using this service again.";
97                                         mes "Thank you for your patronage.";
98                                         close;
99                                 }
100                                 if (.@my_turbo_all < 0) {
101                                         mes "[Arena Point Manager]";
102                                         mes "I'm sorry, but";
103                                         mes "you don't have enough";
104                                         mes "Turbo Track Points to";
105                                         mes "perform this Arena";
106                                         mes "Point conversion.";
107                                         close;
108                                 }
109                                 else {
110                                         mes "[Arena Point Manager]";
111                                         mes "You have converted";
112                                         mes "10 Turbo Track Points";
113                                         mes "into 5 Arena Points " + .@input + " times.";
114                                         mes "A total of " + .@want_point1 + " Turbo Track Points were converted into";
115                                         mes "" + .@want_point +" Arena Points.";
116                                         set tt_point,tt_point - .@want_point1;
117                                         set arena_point,arena_point+.@want_point;
118                                         next;
119                                         mes "[Arena Point Manager]";
120                                         mes "" + strcharinfo(0) + ",";
121                                         mes "you now have";
122                                         mes "^4682B4" + arena_point + "^000000 Arena Points";
123                                         mes "and ^00688B" + tt_point + "^000000 Turbo Track Points.";
124                                         mes "Thank you for your patronage.";
125                                         close;
126                                 }
127                         }
128                 case 6:
129                         mes "[Arena Point Manager]";
130                         mes "You have";
131                         mes "canceled";
132                         mes "this service.";
133                         close;
134                 }
135         case 3:
136                 // Again. no dialog for this option.
137                 close;
138         }
139         close;
140
141 S_ExchangePoints:
142         if (arena_point > getarg(0) ) {
143                 mes "[Arena Point Manager]";
144                 mes "You will exceed the";
145                 mes "maximum amount of";
146                 mes "Arena Points if we proceed";
147                 mes "with this conversion of your";
148                 mes "Turbo Track Points. You cannot";
149                 mes "have more than 29,000 Arena Points.";
150                 next;
151                 mes "[Arena Point Manager]";
152                 mes "Please spend some of";
153                 mes "your Arena Points before";
154                 mes "using this service again.";
155                 mes "Thank you for your patronage.";
156                 close;
157         }
158         .@track_point = getarg(1);
159         if (tt_point >= .@track_point) {
160                 .@arena_point = getarg(2);
161                 mes "[Arena Point Manager]";
162                 mes "" + strcharinfo(0) + ",";
163                 mes "you've converted "+ .@track_point +" Track";
164                 mes "Points into "+ .@arena_point +" Arena Point.";
165                 tt_point = tt_point - .@track_point;
166                 arena_point = arena_point + .@arena_point;
167                 next;
168                 mes "[Arena Point Manager]";
169                 mes "" + strcharinfo(0) + ",";
170                 mes "you now have";
171                 mes "^4682B4" + arena_point + "^000000 Arena Points";
172                 mes "and ^00688B" + tt_point + "^000000 Turbo Track Points.";
173                 mes "Thank you for your patronage.";
174                 close;
175         }
176         else {
177                 mes "[Arena Point Manager]";
178                 mes "I'm sorry, but you don't have";
179                 mes "enough Turbo Track Points.";
180                 mes "You need at least 2 Turbo Track Points for this conversion service.";
181                 close;
182         }
183 }