Need help to update this source edit..
BUILDIN_FUNC(bg_getitem) {
struct map_session_data *sd;
struct battleground_data *bg = bg_team_search( script_getnum(st,2) );
struct item it;
int i,j,flag , nameid = 0, amount = script_getnum(st,4), get_count = 1;
if ( amount <= 0 ) return 0;
if ( bg == NULL ) {
ShowError("bggetitem: Non-existant bg team %d requested.\n", script_getnum(st,2) );
return 0;
}
if ( script_isstring(st,3) ) {
const char *name = script_getstr(st,3);
struct item_data *item_data = itemdb_searchname(name);
if ( item_data == NULL ) {
ShowError("bggetitem: Non-existant item %s requested.\n", name);
return 0;
}
nameid = item_data->nameid;
}
else {
nameid = script_getnum(st,3);
if ( nameid < 0 ) {
nameid = itemdb_searchrandomid(-nameid);
}
if ( nameid <= 0 || itemdb_exists(nameid) == 0 ) {
ShowError("bggetitem: Non-existant item %d requested.\n", nameid);
return 0;
}
}
memset( &it, 0, sizeof(it) );
it.nameid = nameid;
it.identify = 1;
if ( itemdb_isstackable(nameid) )
get_count = amount;
for( i = 0; i < MAX_BG_MEMBERS; i++ ) {
if ( ( sd = bg->members[i].sd ) == NULL )
continue;
for ( j = 0; j < amount; j += get_count ) {
if ( !pet_create_egg(sd, nameid) ) {
if ( ( flag = pc_additem( sd, &it, get_count) ) ) {
clif_additem(sd, 0, 0, flag);
if ( pc_candrop( sd,&it ) )
map_addflooritem( &it, get_count, sd->bl.m, sd->bl.x, sd->bl.y, 0,0,0,0 );
}
}
}
if ( log_config.enable_logs & LOG_TYPE_SCRIPT )
log_pick_pc(sd, "N", nameid, amount, NULL);
}
return 0;
}
Error:
2>rathena\src\map\script.c(15313): error C2198: 'pc_additem' : too few arguments for call
2>rathena\src\map\script.c(15321): error C2440: 'function' : cannot convert from 'char [2]' to 'e_log_pick_type'
2>rathena\src\map\script.c(15321): warning C4024: 'log_pick_pc' : different types for formal and actual parameter 2
2>rathena\src\map\script.c(15321): warning C4047: 'function' : 'item *' differs in levels of indirection from 'int'
2>rathena\src\map\script.c(15321): warning C4024: 'log_pick_pc' : different types for formal and actual parameter 4
2>rathena\src\map\script.c(15321): warning C4020: 'log_pick_pc' : too many actual parameters
2>rathena\src\map\script.c(16421): error C2065: 'buildin_bggetitem' : undeclared identifier
2>rathena\src\map\script.c(16421): error C2099: initializer is not a constant
2>rathena\src\map\script.c(16421): warning C4047: 'initializing' : 'int (__cdecl *)(script_state *)' differs in levels of indirection from 'char [10]'
Thanks in advance!