summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-07-28 19:25:56 +0200
committerGitHub <noreply@github.com>2019-07-28 19:25:56 +0200
commit65a7c731d228c059daf042c75d919453e4daa687 (patch)
treefbeb793e3f385487137b34c754f9a47de50a12c2
parent69fb0fe4a3dfda93fbe6a4dc742dad55cc1c1d77 (diff)
parent14092f307adad3fc03c157531d76102bee2259e2 (diff)
downloadhercules-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
-rw-r--r--conf/messages.conf31
-rw-r--r--doc/atcommands.txt29
-rw-r--r--src/map/atcommand.c81
-rw-r--r--src/map/atcommand.h2
4 files changed, 106 insertions, 37 deletions
diff --git a/conf/messages.conf b/conf/messages.conf
index 2788f264d..bff4829c8 100644
--- a/conf/messages.conf
+++ b/conf/messages.conf
@@ -759,18 +759,18 @@
//995 FREE
-// @refine
+// @refine - Part 1
996: Please enter a position bitmask and an amount (usage: @refine <equip position> <+/- amount>).
-997: %d: Lower Headgear
-998: %d: Right Hand
+997: %d: Headgear (Low)
+998: %d: Hand (Right)
999: %d: Garment
-1000: %d: Left Accessory
+1000: %d: Accessory (Left)
1001: %d: Body Armor
-1002: %d: Left Hand
+1002: %d: Hand (Left)
1003: %d: Shoes
-1004: %d: Right Accessory
-1005: %d: Top Headgear
-1006: %d: Mid Headgear
+1004: %d: Accessory (Right)
+1005: %d: Headgear (Top)
+1006: %d: Headgear (Mid)
// @produce
1007: Please enter at least one item name/ID (usage: @produce <equip name/ID> <element> <# of very's>).
@@ -1575,5 +1575,20 @@
1501: Type List: (default) all = -1, healing = 0, usable = 2, etc = 3, weapon = 4, armor = 5, card = 6, petegg = 7, petarmor = 8, ammo = 10, delayed-consumable = 11, cash = 18
1502: %d items are dropped!
+// @refine - Part 2
+1503: %d: Costume Headgear (Top)
+1504: %d: Costume Headgear (Mid)
+1505: %d: Costume Headgear (Low)
+1506: %d: Costume Garment
+1507: %d: Shadow Armor
+1508: %d: Shadow Weapon
+1509: %d: Shadow Shield
+1510: %d: Shadow Shoes
+1511: %d: Shadow Accessory (Right)
+1512: %d: Shadow Accessory (Left)
+1513: %d: Refine All Equip (General)
+1514: %d: Refine All Equip (Costume)
+1515: %d: Refine All Equip (Shadow)
+
//Custom translations
import: conf/import/msg_conf.txt
diff --git a/doc/atcommands.txt b/doc/atcommands.txt
index c909440a7..139295973 100644
--- a/doc/atcommands.txt
+++ b/doc/atcommands.txt
@@ -678,17 +678,30 @@ Example:
@refine <equip position> <+/- amount>
Refines an equipped item by the specified amount.
-0: All Equipment
-1: Lower Headgear
-2: Right Hand
+-3: Refine All Equip (Shadow)
+-2: Refine All Equip (Costume)
+-1: Refine All Equip (General)
+1: Headgear (Low)
+2: Hand (Right)
4: Garment
-8: Left Accessory
+8: Accessory (Left)
16: Body Armor
-32: Left Hand
+32: Hand (Left)
64: Shoes
-128: Right Accessory
-256: Top Headgear
-512: Mid Headgear
+128: Accessory (Right)
+256: Headgear (Top)
+256: Headgear (Mid)
+1024: Costume Headgear (Top)
+2048: Costume Headgear (Mid)
+4096: Costume Headgear (Low)
+8192: Costume Garment
+65536: Shadow Armor
+131072: Shadow Weapon
+262144: Shadow Shield
+524288: Shadow Shoes
+1048576: Shadow Accessory (Right)
+2097152: Shadow Accessory (Left)
+2097152: Shadow Accessory (Left)
---------------------------------------
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))