diff options
author | Haru <haru@dotalux.com> | 2019-07-28 19:25:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-28 19:25:56 +0200 |
commit | 65a7c731d228c059daf042c75d919453e4daa687 (patch) | |
tree | fbeb793e3f385487137b34c754f9a47de50a12c2 /src | |
parent | 69fb0fe4a3dfda93fbe6a4dc742dad55cc1c1d77 (diff) | |
parent | 14092f307adad3fc03c157531d76102bee2259e2 (diff) | |
download | hercules-65a7c731d228c059daf042c75d919453e4daa687.tar.gz hercules-65a7c731d228c059daf042c75d919453e4daa687.tar.bz2 hercules-65a7c731d228c059daf042c75d919453e4daa687.tar.xz hercules-65a7c731d228c059daf042c75d919453e4daa687.zip |
Merge pull request #2504 from Emistry/atcommand_refine
Update refine atcommand
Diffstat (limited to 'src')
-rw-r--r-- | src/map/atcommand.c | 81 | ||||
-rw-r--r-- | src/map/atcommand.h | 2 |
2 files changed, 62 insertions, 21 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index ff71d97aa..2fac5b4a4 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -2232,26 +2232,56 @@ ACMD(refine) memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!*message || sscanf(message, "%12d %12d", &position, &refine_level) < 2) { - clif->message(fd, msg_fd(fd,996)); // Please enter a position and an amount (usage: @refine <equip position> <+/- amount>). - safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,997), EQP_HEAD_LOW); // %d: Lower Headgear + clif->message(fd, msg_fd(fd, 996)); // Please enter a position and an amount (usage: @refine <equip position> <+/- amount>). +#if PACKETVER > 20100707 + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1515), -3); // %d: Refine All Equip (Shadow) clif->message(fd, atcmd_output); - safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,998), EQP_HAND_R); // %d: Right Hand + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1514), -2); // %d: Refine All Equip (Costume) clif->message(fd, atcmd_output); - safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,999), EQP_GARMENT); // %d: Garment +#endif + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1513), -1); // %d: Refine All Equip (General) + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 997), EQP_HEAD_LOW); // %d: Headgear (Low) + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 998), EQP_HAND_R); // Hand (Right) + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 999), EQP_GARMENT); // %d: Garment + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1000), EQP_ACC_L); // Accessory (Left) + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1001), EQP_ARMOR); // %d: Body Armor + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1002), EQP_HAND_L); // Hand (Left) + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1003), EQP_SHOES); // %d: Shoes + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1004), EQP_ACC_R); // Accessory (Right) + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1005), EQP_HEAD_TOP); // %d: Headgear (Top) clif->message(fd, atcmd_output); - safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1000), EQP_ACC_L); // %d: Left Accessory + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1006), EQP_HEAD_MID); // %d: Headgear (Mid) +#if PACKETVER > 20100707 + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1503), EQP_COSTUME_HEAD_TOP); // %d: Costume Headgear (Top) clif->message(fd, atcmd_output); - safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1001), EQP_ARMOR); // %d: Body Armor + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1504), EQP_COSTUME_HEAD_MID); // %d: Costume Headgear (Mid) clif->message(fd, atcmd_output); - safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1002), EQP_HAND_L); // %d: Left Hand + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1505), EQP_COSTUME_HEAD_LOW); // %d: Costume Headgear (Low) clif->message(fd, atcmd_output); - safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1003), EQP_SHOES); // %d: Shoes + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1506), EQP_COSTUME_GARMENT); // %d: Costume Garment clif->message(fd, atcmd_output); - safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1004), EQP_ACC_R); // %d: Right Accessory + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1507), EQP_SHADOW_ARMOR); // %d: Shadow Armor clif->message(fd, atcmd_output); - safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1005), EQP_HEAD_TOP); // %d: Top Headgear + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1508), EQP_SHADOW_WEAPON); // %d: Shadow Weapon clif->message(fd, atcmd_output); - safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1006), EQP_HEAD_MID); // %d: Mid Headgear + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1509), EQP_SHADOW_SHIELD); // %d: Shadow Shield + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1510), EQP_SHADOW_SHOES); // %d: Shadow Shoes + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1511), EQP_SHADOW_ACC_R); // %d: Shadow Accessory (Right) + clif->message(fd, atcmd_output); + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1512), EQP_SHADOW_ACC_L); // %d: Shadow Accessory (Left) + clif->message(fd, atcmd_output); +#endif clif->message(fd, atcmd_output); return false; } @@ -2263,22 +2293,33 @@ ACMD(refine) int idx = sd->equip_index[j]; if (idx < 0) continue; - if(j == EQI_AMMO) continue; /* can't equip ammo */ - if(j == EQI_HAND_R && sd->equip_index[EQI_HAND_L] == idx) + if (j == EQI_AMMO) + continue; /* can't equip ammo */ + if (j == EQI_HAND_R && sd->equip_index[EQI_HAND_L] == idx) continue; - if(j == EQI_HEAD_MID && sd->equip_index[EQI_HEAD_LOW] == idx) + if (j == EQI_HEAD_MID && sd->equip_index[EQI_HEAD_LOW] == idx) continue; - if(j == EQI_HEAD_TOP && (sd->equip_index[EQI_HEAD_MID] == idx || sd->equip_index[EQI_HEAD_LOW] == idx)) + if (j == EQI_HEAD_TOP && (sd->equip_index[EQI_HEAD_MID] == idx || sd->equip_index[EQI_HEAD_LOW] == idx)) + continue; + if (j == EQI_COSTUME_MID && sd->equip_index[EQI_COSTUME_LOW] == idx) + continue; + if (j == EQI_COSTUME_TOP && (sd->equip_index[EQI_COSTUME_MID] == idx || sd->equip_index[EQI_COSTUME_LOW] == idx)) continue; - if(position && !(sd->status.inventory[idx].equip & position)) + if (position == -3 && !itemdb_is_shadowequip(sd->status.inventory[idx].equip)) + continue; + else if (position == -2 && !itemdb_is_costumeequip(sd->status.inventory[idx].equip)) + continue; + else if (position == -1 && (itemdb_is_costumeequip(sd->status.inventory[idx].equip) || itemdb_is_shadowequip(sd->status.inventory[idx].equip))) + continue; + else if (position && !(sd->status.inventory[idx].equip & position)) continue; final_refine = cap_value(sd->status.inventory[idx].refine + refine_level, 0, MAX_REFINE); if (sd->status.inventory[idx].refine != final_refine) { sd->status.inventory[idx].refine = final_refine; current_position = sd->status.inventory[idx].equip; - pc->unequipitem(sd, idx, PCUNEQUIPITEM_RECALC|PCUNEQUIPITEM_FORCE); + pc->unequipitem(sd, idx, PCUNEQUIPITEM_RECALC | PCUNEQUIPITEM_FORCE); clif->refine(fd, 0, idx, sd->status.inventory[idx].refine); clif->delitem(sd, idx, 1, DELITEM_MATERIALCHANGE); clif->additem(sd, idx, 1, 0); @@ -2289,11 +2330,11 @@ ACMD(refine) } if (count == 0) - clif->message(fd, msg_fd(fd,166)); // No item has been refined. + clif->message(fd, msg_fd(fd, 166)); // No item has been refined. else if (count == 1) - clif->message(fd, msg_fd(fd,167)); // 1 item has been refined. + clif->message(fd, msg_fd(fd, 167)); // 1 item has been refined. else { - safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,168), count); // %d items have been refined. + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 168), count); // %d items have been refined. clif->message(fd, atcmd_output); } diff --git a/src/map/atcommand.h b/src/map/atcommand.h index 4fbf6b93a..f1da2760a 100644 --- a/src/map/atcommand.h +++ b/src/map/atcommand.h @@ -41,7 +41,7 @@ struct config_setting_t; * Defines **/ #define ATCOMMAND_LENGTH 50 -#define MAX_MSG 1503 +#define MAX_MSG 1516 #define msg_txt(idx) atcommand->msg(idx) #define msg_sd(sd,msg_number) atcommand->msgsd((sd),(msg_number)) #define msg_fd(fd,msg_number) atcommand->msgfd((fd),(msg_number)) |