summaryrefslogtreecommitdiff
path: root/doc/sample/npc_test_setitemx.txt
diff options
context:
space:
mode:
Diffstat (limited to 'doc/sample/npc_test_setitemx.txt')
-rw-r--r--doc/sample/npc_test_setitemx.txt49
1 files changed, 49 insertions, 0 deletions
diff --git a/doc/sample/npc_test_setitemx.txt b/doc/sample/npc_test_setitemx.txt
new file mode 100644
index 000000000..eba53e008
--- /dev/null
+++ b/doc/sample/npc_test_setitemx.txt
@@ -0,0 +1,49 @@
+//===== rAthena Script =======================================
+//= Sample: Setiteminfo & Setitemscript
+//===== By: ==================================================
+//= Lupus
+//===== Current Version: =====================================
+//= 20121003
+//===== Description: =========================================
+//= Demonstrates 'setiteminfo' and 'setitemscript' commands.
+//============================================================
+
+prontera,164,161,5 script Lupus 1013,{
+ menu
+ "Make Knife[3] Edible",M_1,
+ "Make Apple Equippable",M_2,
+ "Edible Knife = Full SP",M_3,
+ "Knife = Weapon + 3 Notes",M_4;
+ close;
+
+M_1:
+ mes "Ok. We made Knife[3] edible.";
+ setiteminfo(1201,2,0); //type = 0 : potion
+ setitemscript(1201,"{dispbottom \"* You used Knife[3]\";}");
+ close;
+
+M_2:
+ mes "Ok. We made Apple equippable.";
+ setiteminfo(512,2,5); //item type -> headgear (type = 5)
+ setiteminfo(512,5,512); //where to equip to (equip = 512)
+ setiteminfo(512,11,256); //set as headgear location (loc = 256)
+ setiteminfo(512,14,85); //set Headgear Sprite ID (view id = 85)
+ setitemscript(512,"{dispbottom \"* Other item's changed\";}",0);
+ setitemscript(512,"{dispbottom \"* Equipped\";}",1);
+ setitemscript(512,"{dispbottom \"* Unequipped\";}",2);
+ close;
+
+M_3:
+ mes "Ok. Now edible Knife[3] restores your SP.";
+ setitemscript(1201,2,0);
+ setitemscript(1201,"{dispbottom \"* You ate Knife[3] + Full SP\"; percentheal 0,100;}");
+ close;
+
+M_4:
+ mes "Ok. We made Knife a weapon, but added 3 notes.";
+ setiteminfo(1201,2,4); //type = 4 : weapon again
+ setitemscript(1201,"{dispbottom \"* 1 Used\";}",0);
+ setitemscript(1201,"{dispbottom \"* 2 Equipped\";}",1);
+ setitemscript(1201,"{dispbottom \"* 3 Unequipped\";}",2);
+ close;
+}