summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/sample/getiteminfo.txt1
-rw-r--r--doc/sample/npc_test_setitemx.txt2
-rw-r--r--doc/script_commands.txt1
-rw-r--r--src/map/script.c7
-rw-r--r--src/map/script.h1
5 files changed, 11 insertions, 1 deletions
diff --git a/doc/sample/getiteminfo.txt b/doc/sample/getiteminfo.txt
index 63a6e7928..57407c072 100644
--- a/doc/sample/getiteminfo.txt
+++ b/doc/sample/getiteminfo.txt
@@ -33,5 +33,6 @@ prontera,156,179,6 script test_getiteminfo 4_F_KAFRA1,{
mesf("Weapon Level: %d", getiteminfo(.@value, ITEMINFO_WLV));
mesf("View ID: %d", getiteminfo(.@value, ITEMINFO_VIEWID));
mesf("MATK: %d", getiteminfo(.@value, ITEMINFO_MATK));
+ mesf("View Sprite: %d", getiteminfo(.@value, ITEMINFO_VIEWSPRITE));
close;
}
diff --git a/doc/sample/npc_test_setitemx.txt b/doc/sample/npc_test_setitemx.txt
index 990c09bae..519cfa363 100644
--- a/doc/sample/npc_test_setitemx.txt
+++ b/doc/sample/npc_test_setitemx.txt
@@ -21,7 +21,7 @@ prontera,164,161,5 script Lupus WOLF,{
mes "Ok. We made Apple equippable.";
setiteminfo(Apple, ITEMINFO_TYPE, IT_ARMOR);
setiteminfo(Apple, ITEMINFO_LOC, EQP_HEAD_MID); //where to equip to (equip = 512)
- //setiteminfo(Apple, 14, 85); //set Headgear Sprite ID (view id = 85)
+ setiteminfo(Apple, ITEMINFO_VIEWID, 85); //set Headgear Sprite ID (view id = 85)
setitemscript(Apple, "{dispbottom \"* Other item's changed\";}", 0);
setitemscript(Apple, "{dispbottom \"* Equipped\";}", 1);
setitemscript(Apple, "{dispbottom \"* Unequipped\";}", 2);
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 746eaea2b..465804061 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -3202,6 +3202,7 @@ Valid types are:
ITEMINFO_WLV - Weapon level
ITEMINFO_VIEWID - View ID ("Sprite" field in the Item DB)
ITEMINFO_MATK - MATK (only relevant if RENEWAL is set)
+ ITEMINFO_VIEWSPRITE - View Sprite ("ViewSprite" field in the Item DB)
Check sample in doc/sample/getiteminfo.txt
diff --git a/src/map/script.c b/src/map/script.c
index 133142625..68c4c7468 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -14129,6 +14129,9 @@ BUILDIN(getiteminfo)
case ITEMINFO_MATK:
script_pushint(st, it->matk);
break;
+ case ITEMINFO_VIEWSPRITE:
+ script_pushint(st, it->view_sprite);
+ break;
default:
ShowError("buildin_getiteminfo: Invalid item type %d.\n", n);
script_pushint(st,-1);
@@ -14392,6 +14395,9 @@ BUILDIN(setiteminfo)
case ITEMINFO_MATK:
it->matk = value;
break;
+ case ITEMINFO_VIEWSPRITE:
+ it->view_sprite = value;
+ break;
default:
ShowError("buildin_setiteminfo: invalid type %d.\n", n);
script_pushint(st,-1);
@@ -24837,6 +24843,7 @@ void script_hardcoded_constants(void)
script->set_constant("ITEMINFO_WLV", ITEMINFO_WLV, false, false);
script->set_constant("ITEMINFO_VIEWID", ITEMINFO_VIEWID, false, false);
script->set_constant("ITEMINFO_MATK", ITEMINFO_MATK, false, false);
+ script->set_constant("ITEMINFO_VIEWSPRITE", ITEMINFO_VIEWSPRITE, false, false);
script->constdb_comment("Renewal");
#ifdef RENEWAL
diff --git a/src/map/script.h b/src/map/script.h
index f9d86007b..14d20838d 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -448,6 +448,7 @@ enum script_iteminfo_types {
ITEMINFO_WLV,
ITEMINFO_VIEWID,
ITEMINFO_MATK,
+ ITEMINFO_VIEWSPRITE,
ITEMINFO_MAX
};