viewing paste Unknown #378 | 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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
/*==========================================
 * ¸˜B¬Œ÷
 *------------------------------------------*/
BUILDIN_FUNC(successrefitem)
{
    int i = -1,num,ep,type;
    TBL_PC *sd;
 
    num = script_getnum(st,2);
    type = script_getnum(st,3);
    sd = script_rid2sd(st);
    if( sd == NULL )
        return 0;
 
    if (num > 0 && num <= ARRAYLENGTH(equip))
        i=pc_checkequip(sd,equip[num-1]);
    if(i >= 0) {
        ep = sd->status.inventory[i].equip;
 
        //Logs items, got from (N)PC scripts [Lupus]
        log_pick_pc(sd, LOG_TYPE_SCRIPT, -1, &sd->status.inventory[i]);
 
        sd->status.inventory[i].refine++;
        pc_unequipitem(sd,i,2); // status calc will happen in pc_equipitem() below
        
        if(type)
            clif_refine(sd->fd,0,i,sd->status.inventory[i].refine = sd->status.inventory[i].refine + type);
            clif_delitem(sd,i,1,3);
        else
            clif_refine(sd->fd,0,i,sd->status.inventory[i].refine);
            clif_delitem(sd,i,1,3);
 
        //Logs items, got from (N)PC scripts [Lupus]
        log_pick_pc(sd, LOG_TYPE_SCRIPT, 1, &sd->status.inventory[i]);
 
        clif_additem(sd,i,1,0);
        pc_equipitem(sd,i,ep);
        clif_misceffect(&sd->bl,3);
        if(sd->status.inventory[i].refine == MAX_REFINE &&
            sd->status.inventory[i].card[0] == CARD0_FORGE &&
            sd->status.char_id == (int)MakeDWord(sd->status.inventory[i].card[2],sd->status.inventory[i].card[3])
        ){ // Fame point system [DracoRPG]
            switch (sd->inventory_data[i]->wlv){
                case 1:
                    pc_addfame(sd,1); // Success to refine to +10 a lv1 weapon you forged = +1 fame point
                    break;
                case 2:
                    pc_addfame(sd,25); // Success to refine to +10 a lv2 weapon you forged = +25 fame point
                    break;
                case 3:
                    pc_addfame(sd,1000); // Success to refine to +10 a lv3 weapon you forged = +1000 fame point
                    break;
             }
        }
    }
 
    return 0;
}
Viewed 703 times, submitted by Guest.