summaryrefslogtreecommitdiff
path: root/doc/sample/npc_test_setitemx.txt
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2013-12-26 01:34:12 +0100
committerHaru <haru@dotalux.com>2013-12-30 16:08:20 +0100
commit21fa0901dc8723627c6970aa6eff97bc27e36533 (patch)
tree8890d4191c1ea44af96b6e51d8e149b1e885f043 /doc/sample/npc_test_setitemx.txt
parenta9156de759bc444a5f7256b86f6c4bac6a1ab47d (diff)
downloadhercules-21fa0901dc8723627c6970aa6eff97bc27e36533.tar.gz
hercules-21fa0901dc8723627c6970aa6eff97bc27e36533.tar.bz2
hercules-21fa0901dc8723627c6970aa6eff97bc27e36533.tar.xz
hercules-21fa0901dc8723627c6970aa6eff97bc27e36533.zip
Modernized syntax and fixed errors in the sample scripts
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'doc/sample/npc_test_setitemx.txt')
-rw-r--r--doc/sample/npc_test_setitemx.txt75
1 files changed, 35 insertions, 40 deletions
diff --git a/doc/sample/npc_test_setitemx.txt b/doc/sample/npc_test_setitemx.txt
index 10d8daaaa..a06f0dc9f 100644
--- a/doc/sample/npc_test_setitemx.txt
+++ b/doc/sample/npc_test_setitemx.txt
@@ -1,49 +1,44 @@
-//===== Hercules Script =======================================
+//===== Hercules Script ======================================
//= Sample: Setiteminfo & Setitemscript
//===== By: ==================================================
//= Lupus
//===== Current Version: =====================================
-//= 20121003
-//===== Description: =========================================
+//= 20131225
+//===== 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);
+prontera,164,161,5 script Lupus WOLF,{
+ mes "Please choose an option:";
+ next;
+ switch (select("Make Knife[3] Edible", "Make Apple Equippable", "Edible Knife = Full SP", "Knife = Weapon + 3 Notes")) {
+ case 1:
+ mes "Ok. We made Knife[3] edible.";
+ setiteminfo(Knife, 2, IT_HEALING); //type = 0 : potion
+ setitemscript(Knife, "{dispbottom \"* You used Knife[3]\";}");
+ break;
+ case 2:
+ mes "Ok. We made Apple equippable.";
+ setiteminfo(Apple, 2, IT_ARMOR); //item type -> headgear (type = 5 -> IT_ARMOR)
+ setiteminfo(Apple, 5, 512); //where to equip to (equip = 512)
+ setiteminfo(Apple, 11, 256); //set as headgear location (loc = 256)
+ setiteminfo(Apple, 14, 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);
+ break;
+ case 3:
+ mes "Ok. Now edible Knife[3] restores your SP.";
+ setitemscript(Knife, 2, 0);
+ setitemscript(Knife, "{dispbottom \"* You ate Knife[3] + Full SP\"; percentheal 0,100;}");
+ break;
+ case 4:
+ mes "Ok. We made Knife a weapon, but added 3 notes.";
+ setiteminfo(Knife, 2, IT_WEAPON); //type = 4 -> IT_WEAPON
+ setitemscript(Knife, "{dispbottom \"* 1 Used\";}", 0);
+ setitemscript(Knife, "{dispbottom \"* 2 Equipped\";}", 1);
+ setitemscript(Knife, "{dispbottom \"* 3 Unequipped\";}", 2);
+ break;
+ }
close;
}