diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/script.c | 67 | ||||
-rw-r--r-- | src/map/skill.c | 4 |
2 files changed, 55 insertions, 16 deletions
diff --git a/src/map/script.c b/src/map/script.c index eb1876008..84b9b3140 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -7008,10 +7008,10 @@ BUILDIN_FUNC(repair) *------------------------------------------*/ BUILDIN_FUNC(getequipisequiped) { - int i=-1,num; + int i = -1,num; TBL_PC *sd; - num=script_getnum(st,2); + num = script_getnum(st,2); sd = script_rid2sd(st); if( sd == NULL ) return 0; @@ -7031,10 +7031,10 @@ BUILDIN_FUNC(getequipisequiped) *------------------------------------------*/ BUILDIN_FUNC(getequipisenableref) { - int i=-1,num; + int i = -1,num; TBL_PC *sd; - num=script_getnum(st,2); + num = script_getnum(st,2); sd = script_rid2sd(st); if( sd == NULL ) return 0; @@ -7054,10 +7054,10 @@ BUILDIN_FUNC(getequipisenableref) *------------------------------------------*/ BUILDIN_FUNC(getequipisidentify) { - int i=-1,num; + int i = -1,num; TBL_PC *sd; - num=script_getnum(st,2); + num = script_getnum(st,2); sd = script_rid2sd(st); if( sd == NULL ) return 0; @@ -7077,10 +7077,10 @@ BUILDIN_FUNC(getequipisidentify) *------------------------------------------*/ BUILDIN_FUNC(getequiprefinerycnt) { - int i=-1,num; + int i = -1,num; TBL_PC *sd; - num=script_getnum(st,2); + num = script_getnum(st,2); sd = script_rid2sd(st); if( sd == NULL ) return 0; @@ -7100,10 +7100,10 @@ BUILDIN_FUNC(getequiprefinerycnt) *------------------------------------------*/ BUILDIN_FUNC(getequipweaponlv) { - int i=-1,num; + int i = -1,num; TBL_PC *sd; - num=script_getnum(st,2); + num = script_getnum(st,2); sd = script_rid2sd(st); if( sd == NULL ) return 0; @@ -7123,10 +7123,10 @@ BUILDIN_FUNC(getequipweaponlv) *------------------------------------------*/ BUILDIN_FUNC(getequippercentrefinery) { - int i=-1,num; + int i = -1,num; TBL_PC *sd; - num=script_getnum(st,2); + num = script_getnum(st,2); sd = script_rid2sd(st); if( sd == NULL ) return 0; @@ -7149,7 +7149,7 @@ BUILDIN_FUNC(successrefitem) int i=-1,num,ep; TBL_PC *sd; - num=script_getnum(st,2); + num = script_getnum(st,2); sd = script_rid2sd(st); if( sd == NULL ) return 0; @@ -7203,7 +7203,7 @@ BUILDIN_FUNC(failedrefitem) int i=-1,num; TBL_PC *sd; - num=script_getnum(st,2); + num = script_getnum(st,2); sd = script_rid2sd(st); if( sd == NULL ) return 0; @@ -7225,6 +7225,44 @@ BUILDIN_FUNC(failedrefitem) } /*========================================== + * Downgrades an Equipment Part by -1 . [Masao] + *------------------------------------------*/ +BUILDIN_FUNC(downrefitem) +{ + int i = -1,num,ep; + TBL_PC *sd; + + num = script_getnum(st,2); + 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 + + clif_refine(sd->fd,2,i,sd->status.inventory[i].refine = sd->status.inventory[i].refine - 2); + 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,2); + } + + return 0; +} + +/*========================================== * *------------------------------------------*/ BUILDIN_FUNC(statusup) @@ -16254,6 +16292,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF(getequippercentrefinery,"i"), BUILDIN_DEF(successrefitem,"i"), BUILDIN_DEF(failedrefitem,"i"), + BUILDIN_DEF(downrefitem,"i"), BUILDIN_DEF(statusup,"i"), BUILDIN_DEF(statusup2,"ii"), BUILDIN_DEF(bonus,"iv"), diff --git a/src/map/skill.c b/src/map/skill.c index 44e28860f..f4305d5f8 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -13307,7 +13307,7 @@ void skill_weaponrefine (struct map_session_data *sd, int idx) if(item->nameid > 0 && ditem->type == IT_WEAPON) { if( item->refine >= sd->menuskill_val - || item->refine >= MAX_REFINE // if it's no longer refineable + || item->refine >= 10 // if it's no longer refineable || ditem->flag.no_refine // if the item isn't refinable || (i = pc_search_inventory(sd, material [ditem->wlv])) < 0 ) { @@ -13333,7 +13333,7 @@ void skill_weaponrefine (struct map_session_data *sd, int idx) if (ep) pc_equipitem(sd,idx,ep); clif_misceffect(&sd->bl,3); - if(item->refine == MAX_REFINE && + if(item->refine == 10 && item->card[0] == CARD0_FORGE && (int)MakeDWord(item->card[2],item->card[3]) == sd->status.char_id) { // Fame point system [DracoRPG] |