summaryrefslogtreecommitdiff
path: root/npc/re
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/re
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/re')
-rw-r--r--npc/re/merchants/coin_exchange.txt2
-rw-r--r--npc/re/merchants/enchan_mal.txt42
-rw-r--r--npc/re/quests/eden/eden_tutorial.txt6
-rw-r--r--npc/re/quests/quests_dewata.txt2
4 files changed, 30 insertions, 22 deletions
diff --git a/npc/re/merchants/coin_exchange.txt b/npc/re/merchants/coin_exchange.txt
index be9f1dbee..f35c722f7 100644
--- a/npc/re/merchants/coin_exchange.txt
+++ b/npc/re/merchants/coin_exchange.txt
@@ -569,7 +569,7 @@ function script F_mal_coin {
mes "I'm sorry, you need more "+.@str$+".";
close;
}
- if (MaxWeight - Weight < getiteminfo(getarg(3),6)) {
+ if (MaxWeight - Weight < getiteminfo(getarg(3), ITEMINFO_WEIGHT)) {
mes getarg(1);
mes "Sorry, you've purchased too many.";
mes "You need to make more space in your inventory. Please come back later.";
diff --git a/npc/re/merchants/enchan_mal.txt b/npc/re/merchants/enchan_mal.txt
index bea4c6e03..e921a7336 100644
--- a/npc/re/merchants/enchan_mal.txt
+++ b/npc/re/merchants/enchan_mal.txt
@@ -84,11 +84,11 @@ malangdo,213,167,4 script Mayomayo#mal 4_CAT_3COLOR,{
close;
}
@mal_equip_id = getequipid(EQI_HAND_R);
- .@equip_type = getiteminfo(@mal_equip_id,11);
+ .@equip_type = getiteminfo(@mal_equip_id, ITEMINFO_SUBTYPE);
//callsub L_Socket,<cost multiplier>,<4-x enchants possible>;
switch(.@equip_type) { // Check weapon type first to speed up the checks.
- case 1: // Daggers
+ case W_DAGGER: // Daggers
switch(@mal_equip_id) {
case 1224: callsub L_Socket,1,2; //Sword_Breaker
case 1225: callsub L_Socket,1,2; //Mail_Breaker
@@ -114,7 +114,7 @@ malangdo,213,167,4 script Mayomayo#mal 4_CAT_3COLOR,{
case 13062: callsub L_Socket,4,2; //Ancient_Dagger
}
break;
- case 16: // Katars
+ case W_KATAR: // Katars
switch(@mal_equip_id) {
case 1271: callsub L_Socket,1,2; //Blood_Tears
case 1263: callsub L_Socket,1,2; //Unholy_Touch
@@ -128,13 +128,13 @@ malangdo,213,167,4 script Mayomayo#mal 4_CAT_3COLOR,{
case 1266: callsub L_Socket,4,2; //Infiltrator_
}
break;
- case 6: // 1-H Axes
+ case W_1HAXE: // 1-H Axes
switch(@mal_equip_id) {
case 1305: callsub L_Socket,1,2; //Cleaver
case 1311: callsub L_Socket,1,2; //Vecer_Axe
}
break;
- case 7: // 2-H Axes
+ case W_2HAXE: // 2-H Axes
switch(@mal_equip_id) {
case 1364: callsub L_Socket,1,2; //Great_Axe
case 1365: callsub L_Socket,1,2; //Sabbath
@@ -151,7 +151,7 @@ malangdo,213,167,4 script Mayomayo#mal 4_CAT_3COLOR,{
case 1371: callsub L_Socket,4,2; //Doom_Slayer_
}
break;
- case 2: // 1-H Swords
+ case W_1HSWORD: // 1-H Swords
switch(@mal_equip_id) {
case 1131: callsub L_Socket,1,2; //Ice_Falchon
case 1133: callsub L_Socket,1,2; //Fire_Brand
@@ -170,7 +170,7 @@ malangdo,213,167,4 script Mayomayo#mal 4_CAT_3COLOR,{
case 1132: callsub L_Socket,4,2; //Edge
}
break;
- case 3: // 2-H Swords
+ case W_2HSWORD: // 2-H Swords
switch(@mal_equip_id) {
case 1164: callsub L_Socket,1,2; //Muramasa
case 1166: callsub L_Socket,1,2; //Dragon_Slayer
@@ -194,7 +194,7 @@ malangdo,213,167,4 script Mayomayo#mal 4_CAT_3COLOR,{
case 1186: callsub L_Socket,4,2; //Death_Guidance
}
break;
- case 4: // 1-H Spears
+ case W_1HSPEAR: // 1-H Spears
switch(@mal_equip_id) {
case 1420: callsub L_Socket,1,2; //Long_Horn
case 1413: callsub L_Socket,1,2; //Gungnir
@@ -207,7 +207,7 @@ malangdo,213,167,4 script Mayomayo#mal 4_CAT_3COLOR,{
case 1422: callsub L_Socket,4,2; //Hunting_Spear
}
break;
- case 5: // 2-H Spears
+ case W_2HSPEAR: // 2-H Spears
switch(@mal_equip_id) {
case 1466: callsub L_Socket,1,2; //Crescent_Scythe
case 1467: callsub L_Socket,1,2; //Bill_Guisarme
@@ -224,7 +224,7 @@ malangdo,213,167,4 script Mayomayo#mal 4_CAT_3COLOR,{
case 1484: callsub L_Socket,2,2; //Cardo
}
break;
- case 10: // Staves
+ case W_STAFF: // Staves
switch(@mal_equip_id) {
case 1616: callsub L_Socket,1,2; //Staff_Of_Wing
case 1629: callsub L_Socket,1,2; //Walking_Stick
@@ -236,7 +236,7 @@ malangdo,213,167,4 script Mayomayo#mal 4_CAT_3COLOR,{
case 1473: callsub L_Socket,1,2; //Wizardy_Staff
}
break;
- case 23: // New 2-H Staves
+ case W_2HSTAFF: // New 2-H Staves
switch(@mal_equip_id) {
case 2004: callsub L_Socket,1,2; //Kronos
case 2005: callsub L_Socket,1,2; //Dea_Staff
@@ -244,7 +244,7 @@ malangdo,213,167,4 script Mayomayo#mal 4_CAT_3COLOR,{
case 2000: callsub L_Socket,4,2; //Destruction_Rod
}
break;
- case 8: // Maces
+ case W_MACE: // Maces
switch(@mal_equip_id) {
case 1524: callsub L_Socket,1,2; //Golden_Mace
case 1525: callsub L_Socket,1,2; //Long_Mace
@@ -261,7 +261,7 @@ malangdo,213,167,4 script Mayomayo#mal 4_CAT_3COLOR,{
case 1540: callsub L_Socket,4,2; //Grand_Cross_
}
break;
- case 15: // Books
+ case W_BOOK: // Books
switch(@mal_equip_id) {
case 1557: callsub L_Socket,1,2; //Book_Of_The_Apocalypse
case 1558: callsub L_Socket,1,2; //Girls_Diary
@@ -271,7 +271,7 @@ malangdo,213,167,4 script Mayomayo#mal 4_CAT_3COLOR,{
case 1565: callsub L_Socket,4,2; //Death_Note
}
break;
- case 12: // Knuckles
+ case W_KNUCKLE: // Knuckles
switch(@mal_equip_id) {
case 1813: callsub L_Socket,1,2; //Kaiser_Knuckle
case 1814: callsub L_Socket,1,2; //Berserk
@@ -280,7 +280,7 @@ malangdo,213,167,4 script Mayomayo#mal 4_CAT_3COLOR,{
case 1830: callsub L_Socket,2,2; //Sura_Rampage
}
break;
- case 11: // Bows
+ case W_BOW: // Bows
switch(@mal_equip_id) {
case 1719: callsub L_Socket,1,2; //Bow_Of_Roguemaster
case 1722: callsub L_Socket,1,2; //Balistar
@@ -295,7 +295,7 @@ malangdo,213,167,4 script Mayomayo#mal 4_CAT_3COLOR,{
case 1720: callsub L_Socket,2,2; //Bow_Of_Rudra
}
break;
- case 13: // Musical Instruments
+ case W_MUSICAL: // Musical Instruments
switch(@mal_equip_id) {
case 1913: callsub L_Socket,1,2; //Electronic_Guitar
case 1918: callsub L_Socket,1,2; //Oriental_Lute
@@ -305,7 +305,7 @@ malangdo,213,167,4 script Mayomayo#mal 4_CAT_3COLOR,{
case 1930: callsub L_Socket,2,2; //Green_Whistle
}
break;
- case 14: // Whips
+ case W_WHIP: // Whips
switch(@mal_equip_id) {
case 1962: callsub L_Socket,1,2; //Lariat
case 1963: callsub L_Socket,1,2; //Rapture_Rose
@@ -321,6 +321,14 @@ malangdo,213,167,4 script Mayomayo#mal 4_CAT_3COLOR,{
case 1985: callsub L_Socket,4,2; //Rosebine
}
break;
+ case W_2HMACE:
+ case W_REVOLVER:
+ case W_RIFLE:
+ case W_GATLING:
+ case W_SHOTGUN:
+ case W_GRENADE:
+ case W_HUUMA:
+ break;
}
mes "[Mayomayo]";
if (@mal_enchant_select == 1)
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;
diff --git a/npc/re/quests/quests_dewata.txt b/npc/re/quests/quests_dewata.txt
index ef1352e1e..1b57e4397 100644
--- a/npc/re/quests/quests_dewata.txt
+++ b/npc/re/quests/quests_dewata.txt
@@ -191,7 +191,7 @@ dew_in01,22,48,3 script Sage Kasyapa#dew 4_M_DEWZATIMAN,{
mes "Please, it would honor us if you would take it.";
next;
if (checkweight(Cendrawasih_SF,1) == 0) {
- if (Weight + getiteminfo(6406,6) > MaxWeight) {
+ if (Weight + getiteminfo(Cendrawasih_SF, ITEMINFO_WEIGHT) > MaxWeight) {
mes "[Sage Kasyapa]";
mes "You are carrying too much weight over the limit.";
mes "I cannot get you your reward unless you reduce the amount of weighty items you are carrying.";