From ab1c84c8586b18ebb194d2f67120df7307399712 Mon Sep 17 00:00:00 2001 From: Haru Date: Sun, 12 Nov 2017 01:46:40 +0100 Subject: 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 --- npc/re/quests/eden/eden_tutorial.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'npc/re/quests/eden/eden_tutorial.txt') diff --git a/npc/re/quests/eden/eden_tutorial.txt b/npc/re/quests/eden/eden_tutorial.txt index 45d7c6f1e..902db7945 100644 --- a/npc/re/quests/eden/eden_tutorial.txt +++ b/npc/re/quests/eden/eden_tutorial.txt @@ -290,7 +290,7 @@ moc_para01,34,178,3 script Tutorial Instructor 4_M_KHMAN,{ close; } else if (questprogress(9168) == 1) { if (checkweight(Yggdrasilberry,1) == 0) { - if (MaxWeight - Weight < getiteminfo(607,6)) { + if (MaxWeight - Weight < getiteminfo(Yggdrasilberry, ITEMINFO_WEIGHT)) { mes "[Tutorial Instructor]"; mes "You seemed to be sluggish with a lot of items"; mes "in your inventory making you heavy..."; @@ -492,7 +492,7 @@ moc_para01,34,178,3 script Tutorial Instructor 4_M_KHMAN,{ } } if (checkweight(Yggdrasilberry,6) == 0) { - if (MaxWeight - Weight < getiteminfo(607,6)) { + if (MaxWeight - Weight < getiteminfo(Yggdrasilberry, ITEMINFO_WEIGHT)) { mes "[Tutorial Instructor]"; mes "Your inventory seems to be really full"; mes "with various stuff... Do you think"; @@ -591,7 +591,7 @@ moc_para01,34,178,3 script Tutorial Instructor 4_M_KHMAN,{ moc_para01,32,179,4 script Tutorial Goal 4_F_KHELLY,{ if (checkweight(Seed_Of_Yggdrasil,7) == 0) { - if (MaxWeight - Weight < getiteminfo(608,7)) { + if (MaxWeight - Weight < getiteminfo(Seed_Of_Yggdrasil, ITEMINFO_WEIGHT)) { mes "[Tutorial Goal]"; mes "You seem to be overweight with items. Go put some stuff away then come back."; close; -- cgit v1.2.3-60-g2f50