summaryrefslogtreecommitdiff
path: root/doc/sample/npc_test_setitemx.txt
blob: 990c09bae4b90f0e5cdf9a953a56fd35b966feb9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//===== Hercules Script ======================================
//= Sample: Setiteminfo & Setitemscript
//===== By: ==================================================
//= Lupus
//===== Current Version: =====================================
//= 20131225
//===== Description: =========================================
//= Demonstrates 'setiteminfo' and 'setitemscript' commands.
//============================================================

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, ITEIMINFO_TYPE, IT_HEALING);
		setitemscript(Knife, "{dispbottom \"* You used Knife[3]\";}");
		break;
	case 2:
		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)
		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, ITEIMINFO_TYPE, IT_WEAPON);
		setitemscript(Knife, "{dispbottom \"* 1 Used\";}", 0);
		setitemscript(Knife, "{dispbottom \"* 2 Equipped\";}", 1);
		setitemscript(Knife, "{dispbottom \"* 3 Unequipped\";}", 2);
		break;
	}
	close;
}