Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script.c
- find:
- // declarations that were supposed to be exported from npc_chat.c
- #ifdef PCRE_SUPPORT
- BUILDIN_FUNC(defpattern);
- BUILDIN_FUNC(activatepset);
- BUILDIN_FUNC(deactivatepset);
- BUILDIN_FUNC(deletepset);
- #endif
- add before:
- // rentitem2 ID, refine,attrib, card1, card2, card3, card4, seconds, { account_id }
- // rentitem2 name, refine, attrib, card1, card2, card3, card4, seconds, { account_id }
- // added by [黑白照]
- BUILDIN_FUNC(rentitem2) // added by [黑白照]
- {
- int nameid,ref,attr,c1,c2,c3,c4,seconds,flag; // 名字id,精炼,属性,卡1,卡2,卡3,卡4,时间,标记
- //struct item_data *item_data;
- struct item it;
- TBL_PC *sd;
- struct script_data *data;
- if( script_hasdata(st,10) )
- sd=map_id2sd(script_getnum(st,10)); // <Account ID>
- else
- sd=script_rid2sd(st); // Attached player
- if( sd == NULL ) // no target
- return 0;
- data=script_getdata(st,2);
- get_val(st,data);
- if( data_isstring(data) ){
- const char *name=conv_str(st,data);
- struct item_data *item_data = itemdb_searchname(name);
- if( item_data )
- nameid=item_data->nameid;
- else
- nameid=UNKNOWN_ITEM_ID;
- }else
- nameid=conv_num(st,data);
- ref = script_getnum(st,3);
- attr = script_getnum(st,4);
- c1=(short)script_getnum(st,5);
- c2=(short)script_getnum(st,6);
- c3=(short)script_getnum(st,7);
- c4=(short)script_getnum(st,8);
- seconds = script_getnum(st,9);
- memset(&it, 0, sizeof(it));
- it.nameid = nameid;
- it.identify = 1;
- it.attribute = attr;
- it.refine = ref;
- it.card[0] = (short)c1;
- it.card[1] = (short)c2;
- it.card[2] = (short)c3;
- it.card[3] = (short)c4;
- it.expire_time = (unsigned int)(time(NULL) + seconds);
- if( (flag = pc_additem(sd, &it, 1)) )
- {
- clif_additem(sd, 0, 0, flag);
- return 1;
- }
- clif_rental_time(sd->fd, nameid, seconds);
- pc_inventory_rental_add(sd, seconds);
- if( log_config.enable_logs&LOG_SCRIPT_TRANSACTIONS )
- log_pick_pc(sd, "N", nameid, 1, NULL);
- return 0;
- }
- find:
- //Quest Log System [Inkfish]
- BUILDIN_DEF(setquest, "i"),
- BUILDIN_DEF(erasequest, "i"),
- BUILDIN_DEF(completequest, "i"),
- BUILDIN_DEF(checkquest, "i?"),
- BUILDIN_DEF(changequest, "ii"),
- BUILDIN_DEF(showevent, "ii"),
- add after:
- BUILDIN_DEF(rentitem2,"viiiiiii?"),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement