viewing paste Unknown #15510 | Athena
Posted on the
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
| //===== eAthena Script =======================================
//= Item Rewards NPC
//===== By: ==================================================
//= Euphy
//===== Current Version: =====================================
//= 2.0
//===== Description: =========================================
//= Useful for event rewards, when a player is not necessarily online.
//= Logging is available, if needed (holds 128 names).
//= Note: Unclaimed rewards are limited to 64 at a time.
//= Modified to support multiple formats for rewards. (Skorm)
//============================================================
prontera,142,168,6 script Reward & Gpack Manager 958,{
if (getgmlevel() >= .GMAccess) goto GM_Menu;
Main_M:
mes "[Item Rewards]";
set .@i,0;
while (.@i < getarraysize($itemreward$)) {
if (strcharinfo(0) == $itemreward$[.@i]) goto GetReward;
set .@i, .@i+2; }
mes "I am in charge with all the item rewards that GMs will be granting you either as a bonus or event prize.";
mes " ";
mes "Right now, you have no rewards pending.";
close;
GetReward:
.@tmp$ = ".Package"+$itemreward$[.@i+1];
copyarray .@pkg_ary, getd(.@tmp$), getarraysize( getd(.@tmp$) );
.@len = getarraysize( .@pkg_ary );
switch ( getd(".Package"+$itemreward$[.@i+1]) ) {
case 1:
for( .@a = 1; .@a < .@len; .@a = .@a + 2 )
getitem .@pkg_ary[.@a], .@pkg_ary[.@a+1];
break;
case 2:
for( .@a = 1; .@a < .@len; .@a = .@a + 9 )
getitem2 .@pkg_ary[.@a], .@pkg_ary[.@a+1], .@pkg_ary[.@a+2], .@pkg_ary[.@a+3], .@pkg_ary[.@a+4], .@pkg_ary[.@a+5], .@pkg_ary[.@a+6], .@pkg_ary[.@a+7], .@pkg_ary[.@a+8];
break;
case 3:
for( .@a = 1; .@a < .@len; .@a++ )
set Zeny, Zeny + .@pkg_ary[.@a];
break;
case 4:
if( !getcharid(2) ) {
mes "I'm sorry but you need a guild to accept this package.";
close;
}
for( .@a = 1; .@a < .@len; .@a = .@a + 9 ) {
query_sql( "SELECT FLOOR( 1 + RAND( ) * 2147483647 ) AS 'random_number' FROM `guild_storage` WHERE 'random_number' NOT IN ( SELECT `unique_id` FROM `guild_storage` ) LIMIT 1;", .@r );
query_sql( "INSERT INTO `guild_storage` ( `guild_id`, `nameid`, `amount`, `identify`, `refine`, `attribute`, `card0`, `card1`, `card2`, `card3`, `unique_id` ) VALUES ( "+getcharid(2)+", "+.@pkg_ary[.@a]+", "+.@pkg_ary[.@a+1]+", "+.@pkg_ary[.@a+2]+", "+.@pkg_ary[.@a+3]+", "+.@pkg_ary[.@a+4]+", "+.@pkg_ary[.@a+5]+", "+.@pkg_ary[.@a+6]+", "+.@pkg_ary[.@a+7]+", "+.@pkg_ary[.@a+8]+", "+.@r+" ) " );
.@r = 0;
}
dispbottom "Your package has been sent to your guild's storage.";
default:
}
specialeffect2 248;
deletearray $itemreward$[.@i],2;
mes "Here you go!";
close;
OnMinute00:
OnMinute30:
if (!getarraysize($itemreward$)) end;
set .@i,0;
while (.@i < getarraysize($itemreward$)) {
message $itemreward$[.@i],"[You have either a reward or gpack pending. See the Reward & Gpack Manager.]";
sleep 10;
set .@i, .@i+2; }
end;
GM_Menu:
mes "[Item Rewards]";
mes "What would you like to do?";
next;
switch(select(" ~ ^FF55FFPackage or prize information^000000: ~ ^FF55FFList unclaimed rewards^000000: ~ ^00D900Give a reward^000000: ~ "+((getgmlevel()<.GMDelete)?"^777777":"^DE0000")+"Delete a reward^000000: ~ "+((getgmlevel()<.GMDelete)?"^777777":"^DE0000")+"Delete all unclaimed rewards^000000: ~ "+((getgmlevel()<.GMLogging)?"^777777":"^55AAFF")+"Manage logs^000000: ~ [Close]: ~ Player Menu")) {
case 1:
mes "[Item Rewards]";
set .@j,1;
while ( getd(".Package"+.@j) ) {
mes "^660099Package " + .@j + ":^000000";
.@tmp$ = ".Package"+.@j;
copyarray .@pkg_ary, getd( .@tmp$ ), getarraysize( getd(.@tmp$) );
.@len = getarraysize( .@pkg_ary );
switch ( getd(".Package"+.@j) ) {
case 1:
for( .@a = 1; .@a < .@len; .@a = .@a + 2 )
mes " ~ " + .@pkg_ary[.@a+1] + "x " + getitemname(.@pkg_ary[.@a])+".";
break;
case 2:
for( .@a = 1; .@a < .@len; .@a = .@a + 9 )
mes " ~ " + .@pkg_ary[.@a+1] + "x " + getitemname(.@pkg_ary[.@a]) +", REF "+.@pkg_ary[.@a+3]+", ELE "+.@pkg_ary[.@a+4]+", CRD1 "+.@pkg_ary[.@a+5]+", CRD2 "+.@pkg_ary[.@a+6]+", CRD3 "+.@pkg_ary[.@a+7]+", CRD4 "+.@pkg_ary[.@a+8]+".";
break;
case 3:
for( .@a = 1; .@a < .@len; .@a++ )
mes " ~ Zeny +" + .@pkg_ary[.@a]+".";
break;
case 4:
for( .@a = 1; .@a < .@len; .@a = .@a + 9 )
mes " ~ G " + .@pkg_ary[.@a+1] + "x " + getitemname(.@pkg_ary[.@a]) +", REF "+.@pkg_ary[.@a+3]+", ELE "+.@pkg_ary[.@a+4]+", CRD1 "+.@pkg_ary[.@a+5]+", CRD2 "+.@pkg_ary[.@a+6]+", CRD3 "+.@pkg_ary[.@a+7]+", CRD4 "+.@pkg_ary[.@a+8]+".";
default:
}
deletearray( .@pkg_ary );
set .@j, .@j+1; }
next;
goto GM_Menu;
case 2:
mes "[Item Rewards]";
mes "Used space: ^F52887" + (getarraysize($itemreward$)/2) + "^000000/64";
mes "--------------------------------";
set .@i,0;
while (.@i < getarraysize($itemreward$)) {
mes "^B041FF" + $itemreward$[.@i] + "^000000: package #" + $itemreward$[.@i+1];
set .@i, .@i+2; }
next;
goto GM_Menu;
case 3:
mes "[Item Rewards]";
if (getarraysize($itemreward$) > 127) {
mes "No more names can be stored.";
mes "Delete some values and try again.";
next;
goto GM_Menu; }
mes "Input the player's name, then a package or prize number.";
input .@name$;
query_sql "SELECT `char_id` FROM `char` WHERE `name` = '"+.@name$+"'",.@charid;
if (!.@charid) { mes "The name is invalid."; next; goto GM_Menu; }
else set .@charid,0;
input .@package,1,.pkg;
next;
mes "[Item Rewards]";
mes "Player: ^B041FF" + .@name$ + "^000000";
mes "Package: ^B041FF#" + .@package + "^000000";
mes " ";
mes "Are you sure?";
if (select("Yes:No") == 2) { mes "Request cancelled."; next; goto GM_Menu; }
setarray $itemreward$[getarraysize($itemreward$)],.@name$,.@package;
message .@name$,"[You have a guild package pending. See the Reward & Gpack Manager.]";
if ($itemlog) {
if (getarraysize($itemlog1$) > 127) {
deletearray $itemlog1$[0],1;
deletearray $itemlog2$[0],1; }
setarray $itemlog1$[getarraysize($itemlog1$)],strcharinfo(0);
setarray $itemlog2$[getarraysize($itemlog2$)],.@name$; }
mes "Reward added.";
next;
goto GM_Menu;
case 4:
mes "[Item Rewards]";
if (getgmlevel() < .GMDelete) {
mes "You are not permitted to delete entries."; next; goto GM_Menu; }
mes "Input a name to cancel a reward.";
input .@name$;
set .@i,0;
while (.@i < getarraysize($itemreward$)) {
if ($itemreward$[.@i] == .@name$) {
deletearray $itemreward$[.@i],2;
mes "Name cleared."; next; goto GM_Menu; }
set .@i, .@i+2; }
mes "The name is invalid.";
next;
goto GM_Menu;
case 5:
mes "[Item Rewards]";
if (getgmlevel() < .GMDelete) {
mes "You are not permitted to delete entries."; next; goto GM_Menu; }
mes "^FF0000This action cannot be undone.^000000";
mes "Are you sure?";
mes " ";
if (select("Yes:No") == 2) { mes "Request cancelled."; next; goto GM_Menu; }
deletearray $itemreward$[0],getarraysize($itemreward$);
mes "All entries cleared.";
next;
goto GM_Menu;
case 6:
Log_Menu:
mes "[Item Rewards]";
if (getgmlevel() < .GMLogging) {
mes "You are not permitted to manage logs."; next; goto GM_Menu; }
mes "Logs are currently "+(($itemlog)?"^00D900enabled^000000":"^FF0000disabled^000000")+".";
next;
switch(select(" ~ ^55AAFFView Logs^000000: ~ "+((!$itemlog)?"^00D900Enable":"^777777Disable")+" logging^000000: ~ ^DE0000Delete all logs^000000: ~ [Go back]")) {
case 1:
mes "[Item Rewards]";
mes "Used space: ^F52887" + (getarraysize($itemlog1$)) + "^000000/128";
mes "--------------------------------";
set .@i,0;
while (.@i < getarraysize($itemlog1$)) {
mes "^B041FF" + $itemlog1$[.@i] + "^000000: sent to ^55AAFF" + $itemlog2$[.@i] + "^000000";
set .@i, .@i+1; }
next;
goto Log_Menu;
case 2:
set $itemlog, ((!$itemlog)?1:0);
goto Log_Menu;
case 3:
mes "[Item Rewards]";
mes "^FF0000This action cannot be undone.^000000";
mes "Are you sure?";
mes " ";
if (select("Yes:No") == 2) { mes "Request cancelled."; next; goto Log_Menu; }
deletearray $itemlog1$[0],getarraysize($itemlog1$);
deletearray $itemlog2$[0],getarraysize($itemlog2$);
mes "Logs cleared.";
next;
goto Log_Menu;
case 4:
next;
goto GM_Menu;
}
case 7:
close;
case 8:
goto Main_M;
}
end;
OnInit:
// --------------------- Config ---------------------
// GM Access: Level required to open the GM menu.
// GM Delete: Level required to erase entries.
// GM Logging: Level required to manage logs.
// Package Modes...
// 1 - Getitem | Package format is "Mode,ID1,Count1,ID2,Count2,..."
// 2 - Getitem2 | Package format is "Mode,ID1,Count1,Identify1,Refine1,Attribute1,Card1-1,Card2-1,Card3-1,Card4-1,ID2,Count2,..."
// 3 - Zeny | Package format is "Mode,Zeny1,Zeny2,..."
// 4 - Guild Storage Getitem | Package format is "Mode,ID1,Count1,ID2,Count2,..."
set .GMAccess,2;
set .GMDelete,80;
set .GMLogging,99;
callsub Add_Package, 2, 1218, 5, 1, 1, 10, 4305, 0, 0, 0, /*|*/ 502, 10, 0, 0, 0, 0, 0, 0, 0; // Would give them 501 x5 and 502 x10 with getitem2. @Package 1
callsub Add_Package, 3, 1000, 1000; // Would give them 2 sets of 1000 zeny totalling 2000. @Package 2
callsub Add_Package, 1, 501, 5, 502, 10; // Would give them 501 x5 and 502 x10 with getitem. @Package 3
callsub Add_Package, 4, 13989, 30, 1, 0, 0, 0, 0, 0, 0, /*|*/ 14004, 30, 1, 0, 0, 0, 0, 0, 0, /*|*/ 13813, 20, 1, 0, 0, 0, 0, 0, 0, /*|*/ 14003, 30, 1, 0, 0, 0, 0, 0, 0, /*|*/ 12918, 4, 1, 0, 0, 0, 0, 0, 0, /*|*/ 12915, 4, 1, 0, 0, 0, 0, 0, 0, /*|*/ 12916, 4, 1, 0, 0, 0, 0, 0, 0, /*|*/ 12534, 15, 1, 0, 0, 0, 0, 0, 0, /*|*/ 13889, 10, 1, 0, 0, 0, 0, 0, 0, /*|*/ 13890, 10, 1, 0, 0, 0, 0, 0, 0, /*|*/ 1358, 3, 1, 0, 0, 0, 0, 0, 0, /*|*/ 12031, 10, 1, 0, 0, 0, 0, 0, 0, /*|*/ 12030, 10, 1, 0, 0, 0, 0, 0, 0; // Would give there guild storage 501 x5. @Package 4
callsub Add_Package, 4, 13989, 40, 1, 0, 0, 0, 0, 0, 0, /*|*/ 14004, 40, 1, 0, 0, 0, 0, 0, 0, /*|*/ 14607, 30, 1, 0, 0, 0, 0, 0, 0, /*|*/ 14003, 35, 1, 0, 0, 0, 0, 0, 0, /*|*/ 12918, 6, 1, 0, 0, 0, 0, 0, 0, /*|*/ 12915, 6, 1, 0, 0, 0, 0, 0, 0, /*|*/ 12916, 6, 1, 0, 0, 0, 0, 0, 0, /*|*/ 12534, 25, 1, 0, 0, 0, 0, 0, 0, /*|*/ 13889, 15, 1, 0, 0, 0, 0, 0, 0, /*|*/ 13890, 15, 1, 0, 0, 0, 0, 0, 0, /*|*/ 1358, 4, 1, 0, 0, 0, 0, 0, 0, /*|*/ 12031, 20, 1, 0, 0, 0, 0, 0, 0, /*|*/ 12030, 20, 1, 0, 0, 0, 0, 0, 0; // Would give there guild storage 501 x5. @Package 5
callsub Add_Package, 4, 13989, 50, 1, 0, 0, 0, 0, 0, 0, /*|*/ 14004, 50, 1, 0, 0, 0, 0, 0, 0, /*|*/ 14608, 40, 1, 0, 0, 0, 0, 0, 0, /*|*/ 14003, 40, 1, 0, 0, 0, 0, 0, 0, /*|*/ 12918, 8, 1, 0, 0, 0, 0, 0, 0, /*|*/ 12915, 8, 1, 0, 0, 0, 0, 0, 0, /*|*/ 12916, 8, 1, 0, 0, 0, 0, 0, 0, /*|*/ 12534, 35, 1, 0, 0, 0, 0, 0, 0, /*|*/ 13889, 20, 1, 0, 0, 0, 0, 0, 0, /*|*/ 13890, 20, 1, 0, 0, 0, 0, 0, 0, /*|*/ 1358, 5, 1, 0, 0, 0, 0, 0, 0, /*|*/ 12031, 30, 1, 0, 0, 0, 0, 0, 0, /*|*/ 12030, 30, 1, 0, 0, 0, 0, 0, 0; // Would give there guild storage 501 x5. @Package 6
end;
Add_Package:
.pkg++;
.@len = getargcount();
switch ( getarg(0) ) {
setarray getd( ".Package"+.pkg ), getarg(0);
case 1:
for( .@a = 1; .@a < .@len; .@a = .@a + 2 )
setarray getd( ".Package"+.pkg+"["+.@a+"]" ), getarg(.@a), getarg(.@a+1,1);
return;
case 2: case 4:
for( .@a = 1; .@a < .@len; .@a = .@a + 9 )
setarray getd( ".Package"+.pkg+"["+.@a+"]" ), getarg(.@a), getarg(.@a+1,1), getarg(.@a+2,0), getarg(.@a+3,0), getarg(.@a+4,0), getarg(.@a+5,0), getarg(.@a+6,0), getarg(.@a+7,0), getarg(.@a+8,0);
return;
case 3:
for( .@a = 1; .@a < .@len; .@a++ )
setarray getd( ".Package"+.pkg+"["+.@a+"]" ), getarg(.@a);
return;
default:
}
end;
// --------------------------------------------------
} |
Viewed 581 times, submitted by Guest.