summaryrefslogtreecommitdiff
path: root/npc/006-2-1/piouchef.txt
blob: 3c3fea984fd7eda8e7d27ec261faea6574d0ac70 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// TMW2 Script
// Author:
//   dangerDuck
//   +seeds
// Description:
//   Piou chef who asks you to check on a missing delivery.

006-2-1,35,75,0	script	Piou Chef	NPC_PIOU_COOK,{
	function chefAssign;
	function chefSupplyList;
	function chefGiveDelivery;
	function chefClose;

	.@q1 = getq(PiouQuest_PiouChef);

	if (.q1 == 1) {
		mesn;
		mesq l("Did you bring the supplies?");
		next;
	}

	mesn;
	mesc l("The chef is muttering under his breath while kneading a pile of soft dough.");
	next;
	select
		rif(.@q1 == 0, l("Do you need help with anything?")),
		rif(.@q1 == 1, l("What did you want? I've forgotten.")),
		rif(.@q1 == 1, l("Yes, I have them right here.")),
		rif(.@q1 != 1, l("I better leave him to his work."));

	mes "";

	switch (@menu) {
	case 1:
		chefAssign();
		break;
	case 2:
		chefSupplyList();
		break;
	case 3:
		chefGiveDelivery();
		break;
	default:
		chefClose();
		break;
	}
	close;

function chefAssign {
	if (BaseLevel < 50) {
		mesn;
		mesq l("Unfortunately, a mere fledgling like you is not strong enough to help us.");
		next;
		chefClose();
		return;
	}
	mesn;
	mesq l("Your information is correct, %s. Pirates have been plaguing our shores and cutting off our supply lines.", get_race());
	next;
	mesn;
	mesq l("We are in desperate need of food and nesting material, as well as our sacred supply of @@.", getitemlink(CrystallizedMaggot));
	next;
	setq PiouQuest_PiouChef, 1;
	chefSupplyList();
	chefClose();
	return;
}

function chefSupplyList {
	mesn;
	mesq l("We need %d %s, %d %s, and %d %s for our regular stores and nesting materials, and %d %s for the royal kitchen.",
	       300, getitemlink(Moss),
	       250, getitemlink(RoastedMaggot),
	       20, getitemlink(FishBox),
	       1, getitemlink(CrystallizedMaggot));
	next;
	mesn;
	mesq l("Please hurry, our citizens are going hungry, and you do NOT want to find out what a crowd of hungry pious will do!");
	close;
	return;
}

function chefGiveDelivery {
	if (countitem(Moss) < 300 ||
		countitem(RoastedMaggot) < 250 ||
		countitem(FishBox) < 20 ||
		countitem(CrystallizedMaggot) < 1
	) {
		mesn;
		mesq l("This isn't what I requested!!! Perhaps you should count your items more carefully.");
		next;
		mesn;
		mesq l("If you aren't more careful, we might... accidentally... mistake you for an agent of the Duck Side.");
		percentheal -99, 0;
		close;
	}

	delitem(Moss, 300);
	delitem(RoastedMaggot, 250);
	delitem(FishBox, 20);
	delitem(CrystallizedMaggot, 1);

	getexp(100000, 1226);
	setq(PiouQuest_PiouChef, 2);

	mes "";
	next;
	mesn;
	mesq l("I appreciate the help, %s. Come back anytime for a tasty dish!", get_race());
	close;
}

function chefClose {
	mesn;
	mesq l("Keep your eye out for pesky ducks, %s. I have a new sauce I want to try out...", strcharinfo(0));
	next;
	mesn;
	if (BaseLevel < 50) {
		mesq l("Perhaps you may be of assistance later.");
	} else {
		mesq l("Now go away, %s! Can't you see I'm busy?", get_race());
	}
	close;
	return;
}

OnInit:
	.sex = G_OTHER;
	.distance = 4;
	end;
}