SHOW:
|
|
- or go back to the newest paste.
1 | Index: src/common/mmo.h | |
2 | =================================================================== | |
3 | --- src/common/mmo.h (revision 14956) | |
4 | +++ src/common/mmo.h (working copy) | |
5 | @@ -111,7 +111,7 @@ | |
6 | ||
7 | // for produce | |
8 | #define MIN_ATTRIBUTE 0 | |
9 | -#define MAX_ATTRIBUTE 4 | |
10 | +#define MAX_ATTRIBUTE 5 | |
11 | #define ATTRIBUTE_NORMAL 0 | |
12 | #define MIN_STAR 0 | |
13 | #define MAX_STAR 3 | |
14 | Index: src/map/atcommand.c | |
15 | =================================================================== | |
16 | --- src/map/atcommand.c (revision 14956) | |
17 | +++ src/map/atcommand.c (working copy) | |
18 | @@ -1712,6 +1712,77 @@ | |
19 | return 0; | |
20 | } | |
21 | ||
22 | +// Costume Item System [GreenBox] | |
23 | +ACMD_FUNC(costumeitem) | |
24 | +{ | |
25 | + struct item item_tmp; | |
26 | + struct item_data *item_data; | |
27 | + char item_name[100]; | |
28 | + int item_id, number = 0; | |
29 | + int flag; | |
30 | + int loop, get_count, i; | |
31 | + nullpo_retr(-1, sd); | |
32 | + | |
33 | + memset(item_name, '\0', sizeof(item_name)); | |
34 | + | |
35 | + if (!message || !*message || ( | |
36 | + sscanf(message, "\"%99[^\"]\" %", item_name, &number) < 1 && | |
37 | + sscanf(message, "%99s %d", item_name, &number) < 1 | |
38 | + )) { | |
39 | + clif_displaymessage(fd, "Por favor, entre com todas as informações (uso: @costumeitem <nome/ID do item> <quantidade>)."); | |
40 | + return -1; | |
41 | + } | |
42 | + | |
43 | + if (number <= 0) | |
44 | + number = 1; | |
45 | + | |
46 | + item_id = 0; | |
47 | + if ((item_data = itemdb_searchname(item_name)) != NULL || | |
48 | + (item_data = itemdb_exists(atoi(item_name))) != NULL) | |
49 | + item_id = item_data->nameid; | |
50 | + | |
51 | + if (item_id > 500) { | |
52 | + loop = 1; | |
53 | + get_count = number; | |
54 | + if (!(item_data->equip&EQP_HEAD_LOW) && | |
55 | + !(item_data->equip&EQP_HEAD_LOW_C) && | |
56 | + !(item_data->equip&EQP_HEAD_MID) && | |
57 | + !(item_data->equip&EQP_HEAD_MID_C) && | |
58 | + !(item_data->equip&EQP_HEAD_TOP) && | |
59 | + !(item_data->equip&EQP_HEAD_TOP_C) | |
60 | + ) | |
61 | + { | |
62 | + clif_displaymessage(fd, "Este item não pode virar um costume."); | |
63 | + return; | |
64 | + } | |
65 | + | |
66 | + for (i = 0; i < loop; i++) { | |
67 | + memset(&item_tmp, 0, sizeof(item_tmp)); | |
68 | + item_tmp.nameid = item_id; | |
69 | + item_tmp.identify = 1; | |
70 | + item_tmp.refine = 0; | |
71 | + item_tmp.attribute = 5; | |
72 | + item_tmp.card[0] = 0; | |
73 | + item_tmp.card[1] = 0; | |
74 | + item_tmp.card[2] = 0; | |
75 | + item_tmp.card[3] = 0; | |
76 | + if ((flag = pc_additem(sd, &item_tmp, get_count))) | |
77 | + clif_additem(sd, 0, 0, flag); | |
78 | + } | |
79 | + | |
80 | + //Logs (A)dmins items [Lupus] | |
81 | + if(log_config.enable_logs&0x400) | |
82 | + log_pick_pc(sd, "A", item_tmp.nameid, number, &item_tmp); | |
83 | + | |
84 | + clif_displaymessage(fd, msg_txt(18)); // Item criado. | |
85 | + } else { | |
86 | + clif_displaymessage(fd, msg_txt(19)); // Nome/ID inválido. | |
87 | + return -1; | |
88 | + } | |
89 | + | |
90 | + return 0; | |
91 | +} | |
92 | + | |
93 | /*========================================== | |
94 | * | |
95 | *------------------------------------------*/ | |
96 | @@ -8704,6 +8775,7 @@ | |
97 | { "heal", 40,60, atcommand_heal }, | |
98 | { "item", 60,60, atcommand_item }, | |
99 | { "item2", 60,60, atcommand_item2 }, | |
100 | + { "costumeitem", 60,60, atcommand_costumeitem }, | |
101 | { "itemreset", 40,40, atcommand_itemreset }, | |
102 | { "blvl", 60,60, atcommand_baselevelup }, | |
103 | { "lvup", 60,60, atcommand_baselevelup }, | |
104 | Index: src/map/clif.c | |
105 | =================================================================== | |
106 | --- src/map/clif.c (revision 14956) | |
107 | +++ src/map/clif.c (working copy) | |
108 | @@ -1868,6 +1868,13 @@ | |
109 | WBUFW(buf,6) = item->card[3]; | |
110 | return; | |
111 | } | |
112 | + if( item->attribute == 5 ) { // Costume Item Check [GreenBox - Cronus] | |
113 | + WBUFW(buf,0) = CARD0_CREATE; | |
114 | + WBUFW(buf,2) = 0x0000; | |
115 | + WBUFW(buf,4) = 0x0007; | |
116 | + WBUFW(buf,6) = 0x0000; | |
117 | + return; | |
118 | + } | |
119 | //Client only receives four cards.. so randomly send them a set of cards. [Skotlex] | |
120 | if( MAX_SLOTS > 4 && (j = itemdb_slot(item->nameid)) > 4 ) | |
121 | i = rand()%(j-3); //eg: 6 slots, possible i values: 0->3, 1->4, 2->5 => i = rand()%3; | |
122 | @@ -1948,6 +1955,10 @@ | |
123 | WFIFOW(fd,6)=sd->status.inventory[n].nameid; | |
124 | WFIFOB(fd,8)=sd->status.inventory[n].identify; | |
125 | WFIFOB(fd,9)=sd->status.inventory[n].attribute; | |
126 | + if (sd->status.inventory[n].attribute==5) | |
127 | + WFIFOB(fd,9)=0; | |
128 | + else | |
129 | + WFIFOB(fd,9)=sd->status.inventory[n].attribute; | |
130 | WFIFOB(fd,10)=sd->status.inventory[n].refine; | |
131 | clif_addcards(WFIFOP(fd,11), &sd->status.inventory[n]); | |
132 | WFIFOW(fd,19)=pc_equippoint(sd,n); | |
133 | @@ -2033,7 +2044,10 @@ | |
134 | if (equip >= 0) { //Equippable item | |
135 | WBUFW(buf,n+4)=equip; | |
136 | WBUFW(buf,n+6)=i->equip; | |
137 | - WBUFB(buf,n+8)=i->attribute; | |
138 | + if (i->attribute == 5) | |
139 | + WBUFB(buf,n+8)=0; | |
140 | + else | |
141 | + WBUFB(buf,n+8)=i->attribute; | |
142 | WBUFB(buf,n+9)=i->refine; | |
143 | } else { //Stackable item. | |
144 | WBUFW(buf,n+4)=i->amount; | |
145 | Index: src/map/map.c | |
146 | =================================================================== | |
147 | --- src/map/map.c (revision 14956) | |
148 | +++ src/map/map.c (working copy) | |
149 | @@ -1471,6 +1471,13 @@ | |
150 | ||
151 | nullpo_retv(sd); | |
152 | ||
153 | + // Costume Item Name [GreenBox - Cronus] | |
154 | + if (charid == 0x7) | |
155 | + { | |
156 | + clif_solved_charname(sd->fd, charid, "Costume"); | |
157 | + return; | |
158 | + } | |
159 | + | |
160 | tsd = map_charid2sd(charid); | |
161 | if( tsd ) | |
162 | { | |
163 | Index: src/map/pc.c | |
164 | =================================================================== | |
165 | --- src/map/pc.c (revision 14956) | |
166 | +++ src/map/pc.c (working copy) | |
167 | @@ -59,7 +59,7 @@ | |
168 | struct fame_list chemist_fame_list[MAX_FAME_LIST]; | |
169 | struct fame_list taekwon_fame_list[MAX_FAME_LIST]; | |
170 | ||
171 | -static unsigned short equip_pos[EQI_MAX]={EQP_ACC_L,EQP_ACC_R,EQP_SHOES,EQP_GARMENT,EQP_HEAD_LOW,EQP_HEAD_MID,EQP_HEAD_TOP,EQP_ARMOR,EQP_HAND_L,EQP_HAND_R,EQP_AMMO}; | |
172 | +static unsigned short equip_pos[EQI_MAX]={EQP_ACC_L,EQP_ACC_R,EQP_SHOES,EQP_GARMENT,EQP_HEAD_LOW,EQP_HEAD_MID,EQP_HEAD_TOP,EQP_ARMOR,EQP_HAND_L,EQP_HAND_R,EQP_HEAD_TOP_C,EQP_HEAD_MID_C,EQP_HEAD_LOW_C,EQP_AMMO}; | |
173 | ||
174 | #define MOTD_LINE_SIZE 128 | |
175 | static char motd_text[MOTD_LINE_SIZE][CHAT_SIZE_MAX]; // Message of the day buffer [Valaris] | |
176 | @@ -516,6 +516,25 @@ | |
177 | if(ep == EQP_HAND_R && (pc_checkskill(sd,AS_LEFT) > 0 || (sd->class_&MAPID_UPPERMASK) == MAPID_ASSASSIN)) | |
178 | return EQP_ARMS; | |
179 | } | |
180 | + | |
181 | + if (ep&EQP_HEAD_TOP && sd->status.inventory[n].attribute == 5) | |
182 | + { | |
183 | + ep &= ~EQP_HEAD_TOP; | |
184 | + ep |= EQP_HEAD_TOP_C; | |
185 | + } | |
186 | + | |
187 | + if (ep&EQP_HEAD_LOW && sd->status.inventory[n].attribute == 5) | |
188 | + { | |
189 | + ep &= ~EQP_HEAD_LOW; | |
190 | + ep |= EQP_HEAD_LOW_C; | |
191 | + } | |
192 | + | |
193 | + if (ep&EQP_HEAD_MID && sd->status.inventory[n].attribute == 5) | |
194 | + { | |
195 | + ep &= ~EQP_HEAD_MID; | |
196 | + ep |= EQP_HEAD_MID_C; | |
197 | + } | |
198 | + | |
199 | return ep; | |
200 | } | |
201 | ||
202 | @@ -753,6 +772,9 @@ | |
203 | ||
204 | item = sd->inventory_data[n]; | |
205 | ||
206 | + if ( sd->status.inventory[n].attribute == 5 ) | |
207 | + return 1; | |
208 | + | |
209 | if( battle_config.gm_allequip>0 && pc_isGM(sd)>=battle_config.gm_allequip ) | |
210 | return 1; | |
211 | ||
212 | @@ -7477,6 +7499,24 @@ | |
213 | flag = id->range != sd->inventory_data[i]->range; | |
214 | } | |
215 | ||
216 | + if (pos&EQP_HEAD_TOP && sd->status.inventory[n].attribute == 5) | |
217 | + { | |
218 | + pos &= ~EQP_HEAD_TOP; | |
219 | + pos |= EQP_HEAD_TOP_C; | |
220 | + } | |
221 | + | |
222 | + if (pos&EQP_HEAD_LOW && sd->status.inventory[n].attribute == 5) | |
223 | + { | |
224 | + pos &= ~EQP_HEAD_LOW; | |
225 | + pos |= EQP_HEAD_LOW_C; | |
226 | + } | |
227 | + | |
228 | + if (pos&EQP_HEAD_MID && sd->status.inventory[n].attribute == 5) | |
229 | + { | |
230 | + pos &= ~EQP_HEAD_MID; | |
231 | + pos |= EQP_HEAD_MID_C; | |
232 | + } | |
233 | + | |
234 | for(i=0;i<EQI_MAX;i++) { | |
235 | if(pos & equip_pos[i]) { | |
236 | if(sd->equip_index[i] >= 0) //Slot taken, remove item from there. | |
237 | @@ -7538,11 +7578,35 @@ | |
238 | } | |
239 | if(pos & EQP_HEAD_MID) { | |
240 | if(id && !(pos&EQP_HEAD_TOP)) | |
241 | + sd->status.head_mid = id->look; | |
242 | + else | |
243 | + sd->status.head_mid = 0; | |
244 | + clif_changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid); | |
245 | + } | |
246 | + | |
247 | + // Costume Item System [GreenBox - Cronus] | |
248 | + if(pos & EQP_HEAD_LOW_C) { | |
249 | + if(id && !(pos&(EQP_HEAD_TOP_C|EQP_HEAD_MID_C))) | |
250 | + sd->status.head_bottom = id->look; | |
251 | + else | |
252 | + sd->status.head_bottom = 0; | |
253 | + clif_changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom); | |
254 | + } | |
255 | + if(pos & EQP_HEAD_TOP_C) { | |
256 | + if(id) | |
257 | + sd->status.head_top = id->look; | |
258 | + else | |
259 | + sd->status.head_top = 0; | |
260 | + clif_changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top); | |
261 | + } | |
262 | + if(pos & EQP_HEAD_MID_C) { | |
263 | + if(id && !(pos&EQP_HEAD_TOP_C)) | |
264 | sd->status.head_mid = id->look; | |
265 | else | |
266 | sd->status.head_mid = 0; | |
267 | clif_changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid); | |
268 | } | |
269 | + | |
270 | if(pos & EQP_SHOES) | |
271 | clif_changelook(&sd->bl,LOOK_SHOES,0); | |
272 | if( pos&EQP_GARMENT ) | |
273 | @@ -7559,7 +7623,8 @@ | |
274 | clif_skillinfoblock(sd); | |
275 | ||
276 | //OnEquip script [Skotlex] | |
277 | - if (id) { | |
278 | + // Costume Item Check [GreenBox - Cronus] | |
279 | + if (id && sd->status.inventory[n].attribute != 5) { | |
280 | int i; | |
281 | struct item_data *data; | |
282 | if (id->equip_script) | |
283 | @@ -7634,9 +7699,68 @@ | |
284 | sd->status.head_top = 0; | |
285 | clif_changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top); | |
286 | } | |
287 | - if(sd->status.inventory[n].equip & EQP_HEAD_MID) { | |
288 | - sd->status.head_mid = 0; | |
289 | - clif_changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid); | |
290 | + if(sd->status.inventory[n].equip & EQP_HEAD_MID) | |
291 | + { | |
292 | + sd->status.head_mid = 0; | |
293 | + clif_changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid); | |
294 | + } | |
295 | + | |
296 | + // Costume Item System [GreenBox - Cronus] | |
297 | + if( sd->status.inventory[n].equip & EQP_HEAD_LOW && sd->equip_index[EQI_HEAD_LOW_C] == -1 ) | |
298 | + { | |
299 | + if (sd->equip_index[EQI_HEAD_LOW] >= 0) | |
300 | + { | |
301 | + int d = sd->equip_index[EQI_HEAD_LOW]; | |
302 | + | |
303 | + if(sd->inventory_data[d] && !(sd->inventory_data[d]->equip&(EQP_HEAD_TOP|EQP_HEAD_MID))) | |
304 | + sd->status.head_bottom = sd->inventory_data[d]->look; | |
305 | + else | |
306 | + sd->status.head_bottom = 0; | |
307 | + clif_changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom); | |
308 | + } | |
309 | + else | |
310 | + { | |
311 | + sd->status.head_bottom = 0; | |
312 | + clif_changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom); | |
313 | + } | |
314 | + } | |
315 | + | |
316 | + if( sd->status.inventory[n].equip & EQP_HEAD_TOP && sd->equip_index[EQI_HEAD_TOP_C] == -1 ) | |
317 | + { | |
318 | + if (sd->equip_index[EQI_HEAD_TOP] >= 0) | |
319 | + { | |
320 | + int d = sd->equip_index[EQI_HEAD_TOP]; | |
321 | + | |
322 | + if(sd->inventory_data[d]) | |
323 | + sd->status.head_top = sd->inventory_data[d]->look; | |
324 | + else | |
325 | + sd->status.head_top = 0; | |
326 | + clif_changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top); | |
327 | + } | |
328 | + else | |
329 | + { | |
330 | + sd->status.head_top = 0; | |
331 | + clif_changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top); | |
332 | + } | |
333 | + } | |
334 | + | |
335 | + if( sd->status.inventory[n].equip & EQP_HEAD_MID && sd->equip_index[EQI_HEAD_MID_C] == -1 ) | |
336 | + { | |
337 | + if (sd->equip_index[EQI_HEAD_MID] >= 0) | |
338 | + { | |
339 | + int d = sd->equip_index[EQI_HEAD_MID]; | |
340 | + | |
341 | + if(sd->inventory_data[d] && !(sd->inventory_data[d]->equip&EQP_HEAD_TOP)) | |
342 | + sd->status.head_mid = sd->inventory_data[d]->look; | |
343 | + else | |
344 | + sd->status.head_mid = 0; | |
345 | + clif_changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid); | |
346 | + } | |
347 | + else | |
348 | + { | |
349 | + sd->status.head_mid = 0; | |
350 | + clif_changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid); | |
351 | + } | |
352 | } | |
353 | if(sd->status.inventory[n].equip & EQP_SHOES) | |
354 | clif_changelook(&sd->bl,LOOK_SHOES,0); | |
355 | @@ -7672,7 +7796,8 @@ | |
356 | status_change_end(&sd->bl, SC_SIGNUMCRUCIS, INVALID_TIMER); | |
357 | ||
358 | //OnUnEquip script [Skotlex] | |
359 | - if (sd->inventory_data[n]) { | |
360 | + // Costume Item Check [GreenBox - Cronus] | |
361 | + if (sd->inventory_data[n] && sd->status.inventory[n].attribute != 5) { | |
362 | struct item_data *data; | |
363 | if (sd->inventory_data[n]->unequip_script) | |
364 | run_script(sd->inventory_data[n]->unequip_script,0,sd->bl.id,fake_nd->bl.id); | |
365 | Index: src/map/pc.h | |
366 | =================================================================== | |
367 | --- src/map/pc.h (revision 14956) | |
368 | +++ src/map/pc.h (working copy) | |
369 | @@ -161,7 +161,7 @@ | |
370 | struct registry save_reg; | |
371 | ||
372 | struct item_data* inventory_data[MAX_INVENTORY]; // direct pointers to itemdb entries (faster than doing item_id lookups) | |
373 | - short equip_index[11]; | |
374 | + short equip_index[14]; | |
375 | unsigned int weight,max_weight; | |
376 | int cart_weight,cart_num; | |
377 | int fd; | |
378 | @@ -489,13 +489,16 @@ | |
379 | EQP_GARMENT = 0x0004, | |
380 | EQP_ACC_L = 0x0008, | |
381 | EQP_ACC_R = 0x0080, //128 | |
382 | + EQP_HEAD_TOP_C = 0x0400, | |
383 | + EQP_HEAD_MID_C = 0x0800, | |
384 | + EQP_HEAD_LOW_C = 0x1000, | |
385 | EQP_AMMO = 0x8000, //32768 | |
386 | }; | |
387 | ||
388 | #define EQP_WEAPON EQP_HAND_R | |
389 | #define EQP_SHIELD EQP_HAND_L | |
390 | #define EQP_ARMS (EQP_HAND_R|EQP_HAND_L) | |
391 | -#define EQP_HELM (EQP_HEAD_LOW|EQP_HEAD_MID|EQP_HEAD_TOP) | |
392 | +#define EQP_HELM (EQP_HEAD_LOW|EQP_HEAD_MID|EQP_HEAD_TOP|EQP_HEAD_LOW_C|EQP_HEAD_MID_C|EQP_HEAD_TOP_C) | |
393 | #define EQP_ACC (EQP_ACC_L|EQP_ACC_R) | |
394 | ||
395 | /// Equip positions that use a visible sprite | |
396 | @@ -518,6 +521,9 @@ | |
397 | EQI_ARMOR, | |
398 | EQI_HAND_L, | |
399 | EQI_HAND_R, | |
400 | + EQI_HEAD_TOP_C, | |
401 | + EQI_HEAD_MID_C, | |
402 | + EQI_HEAD_LOW_C, | |
403 | EQI_AMMO, | |
404 | EQI_MAX | |
405 | }; | |
406 | Index: src/map/script.c | |
407 | =================================================================== | |
408 | --- src/map/script.c (revision 14956) | |
409 | +++ src/map/script.c (working copy) | |
410 | @@ -5567,6 +5567,109 @@ | |
411 | return 0; | |
412 | } | |
413 | ||
414 | +// Costume Item System [GreenBox - Cronus] | |
415 | +BUILDIN_FUNC(getcostumeitem) | |
416 | +{ | |
417 | + int nameid,amount,get_count,i,flag = 0; | |
418 | + struct item it; | |
419 | + TBL_PC *sd; | |
420 | + struct script_data *data; | |
421 | + | |
422 | + data=script_getdata(st,2); | |
423 | + get_val(st,data); | |
424 | + if( data_isstring(data) ) | |
425 | + {// "<item name>" | |
426 | + const char *name=conv_str(st,data); | |
427 | + struct item_data *item_data = itemdb_searchname(name); | |
428 | + if( item_data == NULL ){ | |
429 | + ShowError("buildin_getcostumeitem: Nonexistant item %s requested.\n", name); | |
430 | + return 1; //No item created. | |
431 | + } | |
432 | + nameid=item_data->nameid; | |
433 | + } else if( data_isint(data) ) | |
434 | + {// <item id> | |
435 | + nameid=conv_num(st,data); | |
436 | + //Violet Box, Blue Box, etc - random item pick | |
437 | + if( nameid < 0 ) { | |
438 | + nameid=itemdb_searchrandomid(-nameid); | |
439 | + flag = 1; | |
440 | + } | |
441 | + if( nameid <= 0 || !itemdb_exists(nameid) ){ | |
442 | + ShowError("buildin_getcostumeitem: Nonexistant item %d requested.\n", nameid); | |
443 | + return 1; //No item created. | |
444 | + } | |
445 | + } else { | |
446 | + ShowError("buildin_getcostumeitem: invalid data type for argument #1 (%d).", data->type); | |
447 | + return 1; | |
448 | + } | |
449 | + | |
450 | + // <amount> | |
451 | + if( (amount=script_getnum(st,3)) <= 0) | |
452 | + return 0; //return if amount <=0, skip the useles iteration | |
453 | + | |
454 | + memset(&it,0,sizeof(it)); | |
455 | + it.nameid=nameid; | |
456 | + if(!flag) | |
457 | + it.identify=1; | |
458 | + else | |
459 | + it.identify=itemdb_isidentified(nameid); | |
460 | + | |
461 | + if (!(it.equip&EQP_HEAD_LOW) && | |
462 | + !(it.equip&EQP_HEAD_LOW_C) && | |
463 | + !(it.equip&EQP_HEAD_MID) && | |
464 | + !(it.equip&EQP_HEAD_MID_C) && | |
465 | + !(it.equip&EQP_HEAD_TOP) && | |
466 | + !(it.equip&EQP_HEAD_TOP_C) | |
467 | + ) | |
468 | + { | |
469 | + ShowError("buildin_getcostumeitem: this item can't be a costume."); | |
470 | + return 0; | |
471 | + } | |
472 | + | |
473 | + if( script_hasdata(st,4) ) | |
474 | + sd=map_id2sd(script_getnum(st,4)); // <Account ID> | |
475 | + else | |
476 | + sd=script_rid2sd(st); // Attached player | |
477 | + | |
478 | + if( sd == NULL ) // no target | |
479 | + return 0; | |
480 | + | |
481 | + //Check if it's stackable. | |
482 | + if (!itemdb_isstackable(nameid)) | |
483 | + get_count = 1; | |
484 | + else | |
485 | + get_count = amount; | |
486 | + | |
487 | + it.nameid=nameid; | |
488 | + it.identify=1; | |
489 | + it.refine=0; | |
490 | + it.attribute=5; | |
491 | + it.card[0]=0; | |
492 | + it.card[1]=0; | |
493 | + it.card[2]=0; | |
494 | + it.card[3]=0; | |
495 | + | |
496 | + for (i = 0; i < amount; i += get_count) | |
497 | + { | |
498 | + // if not pet egg | |
499 | + if (!pet_create_egg(sd, nameid)) | |
500 | + { | |
501 | + if ((flag = pc_additem(sd, &it, get_count))) | |
502 | + { | |
503 | + clif_additem(sd, 0, 0, flag); | |
504 | + if( pc_candrop(sd,&it) ) | |
505 | + map_addflooritem(&it,get_count,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0); | |
506 | + } | |
507 | + } | |
508 | + } | |
509 | + | |
510 | + //Logs items, got from (N)PC scripts [Lupus] | |
511 | + if(log_config.enable_logs&LOG_SCRIPT_TRANSACTIONS) | |
512 | + log_pick_pc(sd, "N", nameid, amount, NULL); | |
513 | + | |
514 | + return 0; | |
515 | +} | |
516 | + | |
517 | /*========================================== | |
518 | * getitem <item id>,<amount>{,<character ID>}; | |
519 | * getitem "<item name>",<amount>{,<character ID>}; | |
520 | @@ -10747,6 +10850,7 @@ | |
521 | script_pushstr(st,item_name); | |
522 | return 0; | |
523 | } | |
524 | + | |
525 | /*========================================== | |
526 | * Returns number of slots an item has. [Skotlex] | |
527 | *------------------------------------------*/ | |
528 | @@ -14970,6 +15074,7 @@ | |
529 | BUILDIN_DEF(deletearray,"r?"), | |
530 | BUILDIN_DEF(getelementofarray,"ri"), | |
531 | BUILDIN_DEF(getitem,"vi?"), | |
532 | + BUILDIN_DEF(getcostumeitem,"vi?"), | |
533 | BUILDIN_DEF(rentitem,"vi"), | |
534 | BUILDIN_DEF(getitem2,"viiiiiiii?"), | |
535 | BUILDIN_DEF(getnameditem,"vv"), | |
536 | Index: src/map/status.c | |
537 | =================================================================== | |
538 | --- src/map/status.c (revision 14956) | |
539 | +++ src/map/status.c (working copy) | |
540 | @@ -1910,6 +1910,8 @@ | |
541 | continue; | |
542 | if(!sd->inventory_data[index]) | |
543 | continue; | |
544 | + if( sd->status.inventory[index].attribute == 5 ) // Costume Item Check [GreenBox - Cronus] | |
545 | + continue; | |
546 | ||
547 | status->def += sd->inventory_data[index]->def; | |
548 | Index: src/map/script.c | |
549 | =================================================================== | |
550 | --- src/map/script.c (revision 14956) | |
551 | +++ src/map/script.c (working copy) | |
552 | @@ -6684,3 +6684,3 @@ | |
553 | for(i=0; i<MAX_INVENTORY; i++) { | |
554 | - if(sd->status.inventory[i].attribute){ | |
555 | + if(sd->status.inventory[i].attribute && sd->status.inventory[i].attribute != 5){ | |
556 | brokencounter++; | |
557 | @@ -6722,3 +6722,3 @@ | |
558 | for(i=0; i<MAX_INVENTORY; i++) { | |
559 | - if(sd->status.inventory[i].attribute){ | |
560 | + if(sd->status.inventory[i].attribute && sd->status.inventory[i].attribute != 5){ | |
561 | - | repaircounter++; |
561 | + | repaircounter++; |