viewing paste Unknown #22969 | C

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
void bg_team_rewards(int bg_id, int nameid, int amount, int kafrapoints, int quest_id, const char *var, int add_value, int bg_arena, int bg_result)
{
    struct battleground_data *bg;
    struct map_session_data *sd;
    struct item_data *id;
    struct item it;
    int j, flag;
 
    if( amount < 1 || (bg = bg_team_search(bg_id)) == NULL || (id = itemdb->exists(nameid)) == NULL )
        return;
 
    bg_result = cap_value(bg_result,0,2);
    memset(&it,0,sizeof(it));
    if( nameid == 7828 || nameid == 7829 || nameid == 7773 )
    {
        it.nameid = nameid;
        it.identify = 1;
    }
    else nameid = 0;
 
    for( j = 0; j < MAX_BG_MEMBERS; j++ )
    {
        if( (sd = bg->members[j].sd) == NULL )
            continue;
 
        if( quest_id ) quest->add(sd,quest_id);
        pc_setglobalreg(sd,script->add_str(var), add_value);
 
        if( kafrapoints > 0 )
            pc->getcash(sd,0,kafrapoints);
 
        if( nameid && amount > 0 )
        {
            if( (flag = pc->additem(sd,&it,amount,LOG_TYPE_NONE)) )
                clif->additem(sd,0,0,flag);
        }
    }
}
Viewed 730 times, submitted by Guest.