summaryrefslogtreecommitdiff
path: root/npc/merchants
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-11-12 01:46:40 +0100
committerHaru <haru@dotalux.com>2017-11-12 01:46:40 +0100
commitab1c84c8586b18ebb194d2f67120df7307399712 (patch)
tree35dc8320db48da8d26ba7c9aee9bfeef04933f80 /npc/merchants
parent82da003c98d1525b6302cb7c753959a3b3e8c10d (diff)
downloadhercules-ab1c84c8586b18ebb194d2f67120df7307399712.tar.gz
hercules-ab1c84c8586b18ebb194d2f67120df7307399712.tar.bz2
hercules-ab1c84c8586b18ebb194d2f67120df7307399712.tar.xz
hercules-ab1c84c8586b18ebb194d2f67120df7307399712.zip
Add type constants for the getiteminfo()/setiteminfo() buildins
Replacements are as follows: 0 => ITEMINFO_BUYPRICE 1 => ITEMINFO_SELLPRICE 2 => ITEMINFO_TYPE 3 => ITEMINFO_MAXCHANCE 4 => ITEMINFO_SEX 5 => ITEMINFO_LOC 6 => ITEMINFO_WEIGHT 7 => ITEMINFO_ATK 8 => ITEMINFO_DEF 9 => ITEMINFO_RANGE 10 => ITEMINFO_SLOTS 11 (Subtype, for weapons and ammunitions) => ITEMINFO_SUBTYPE 11 (ViewSprite, for other item types) => ITEMINFO_VIEWSPRITE (NOT AVAILABLE YET) 12 => ITEMINFO_ELV 13 => ITEMINFO_WLV 14 => ITEMINFO_VIEWID 15 => ITEMINFO_MATK (NOT AVAILABLE YET - this was documented but never implemented) Calls to getiteminfo() and setiteminfo() have been replaced with the newly introduced constants. Other constants (such as W_ weapon subtypes) in related code have been replaced as well, to improve code readability. This fixes an issue in the Eden Tutorial script "Tutorial Goal", where ITEMINFO_ATK was accidentally used instead of ITEMINFO_WEIGHT. Note: calls to getiteminfo or setiteminfo with numeric type arguments in third party scripts must be replaced with the respective constants. The use of numeric literals is no longer recommended, and those values may change in the future without notice. See the getiteminfo documentation for details. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'npc/merchants')
-rw-r--r--npc/merchants/socket_enchant.txt9
-rw-r--r--npc/merchants/socket_enchant2.txt4
2 files changed, 6 insertions, 7 deletions
diff --git a/npc/merchants/socket_enchant.txt b/npc/merchants/socket_enchant.txt
index 279aaf0ba..599d41564 100644
--- a/npc/merchants/socket_enchant.txt
+++ b/npc/merchants/socket_enchant.txt
@@ -268,17 +268,16 @@ function script Func_Socket {
mes "Ah, and don't forget to bring that " + getitemname(getarg(0)) + "!";
next;
mes "[Seiyablem]";
- if (getiteminfo(getarg(0),5)&2) // EQP_HAND_R = 2, it's a weapon
- {
+ if (getiteminfo(getarg(0), ITEMINFO_LOC) & EQP_HAND_R) {
+ // EQP_HAND_R = 2, it's a weapon
mes "I can try to add a slot now if you have the required items and zeny.";
mes "However, you should know that there's a chance that I might fail.";
mes "Therefore, I need to give you a fair warning...";
next;
mes "[Seiyablem]";
mes "If this attempt to add a Slot to your Weapon fails, then the ^FF0000Weapon^000000, ^FF0000and any Cards compounded to it will be destroyed^000000.";
- }
- else // armor
- {
+ } else {
+ // armor
mes "If you have all the required materials, my zeny service fee and the Armor, then we can go ahead with the Slot Addition attempt.";
mes "But before that, I must warn you of the risk.";
next;
diff --git a/npc/merchants/socket_enchant2.txt b/npc/merchants/socket_enchant2.txt
index 98d33b01c..29573970d 100644
--- a/npc/merchants/socket_enchant2.txt
+++ b/npc/merchants/socket_enchant2.txt
@@ -425,8 +425,8 @@ function script Func_Socket2 {
mes "[Leablem]";
mes "Did you already bring all of them?";
mes "For your information, if you fail to create a slot,";
- mes "you will lose all the item requirement as well as the target " + (getiteminfo(getarg(0),5)&2 ? "weapon" : "armor") + "."; // EQP_HAND_R = 2, it's a weapon, otherwise armor
- mes "Also remember, if the " + (getiteminfo(getarg(0),5)&2 ? "weapon" : "armor") + " has been upgraded, and has been inserted with a card,";
+ mes "you will lose all the item requirement as well as the target " + ((getiteminfo(getarg(0), ITEMINFO_LOC) & EQP_HAND_R) ? "weapon" : "armor") + "."; // EQP_HAND_R = 2, it's a weapon, otherwise armor
+ mes "Also remember, if the " + ((getiteminfo(getarg(0), ITEMINFO_LOC) & EQP_HAND_R) ? "weapon" : "armor") + " has been upgraded, and has been inserted with a card,";
mes "you will lose them even if you succeed in creating a slot.";
next;
switch(select("Ask for slot creation.", "Try next time."))