summaryrefslogtreecommitdiff
path: root/npc/001-1_Tulimshar/rewards_master.txt
blob: d2811f510c501edd08f858a0a827d340be550eed (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
//

001-1.gat,50,53,0	script	Ishi	106,{
	if (MPQUEST == 0) goto L_Register;
	if (tvis == 0) set tvis, 1;
	if (Mobpt < tvis) goto L_NotEnough;

	setarray @Items$, "AppleCake", "Arrow", "BatTeeth", "BatWing", "Beer", "BluePresentBox", "Boots", "BugLeg", "CactusDrink", "CactusPotion", "Cake", "Candy", "CandyCane", "CasinoCoins", "CaveSnakeLamp", "CaveSnakeTongue", "CherryCake", "ChickenLeg", "ChocolateBar", "ChocolateCake", "CottonBoots", "CottonCloth", "CottonShirt", "CottonShorts", "DecorCandy", "EasterEgg", "FancyHat", "GingerBreadMan", "GrassSnakeEgg", "GrassSnakeTongue", "GreenApple", "HardSpike", "IronOre", "Lifestone", "LightBlueDye", "MaggotSlime", "Milk", "MountainSnakeEgg", "MountainSnakeTongue", "Orange", "OrangeCake", "OrangeCupcake", "Petal", "PileOfAsh", "PinkAntenna", "PoltergeistPowder", "PurplePresentBox", "RawLog", "RedApple", "RedDye", "RedScorpionStinger", "ScorpionStinger", "SerfHat", "SmallHealingPotion", "SmallMushroom", "SnakeEgg", "SnakeSkin", "SnakeTongue", "SpectrePowder", "Steak", "TinyHealingPotion", "TreasureKey", "WhiteCake", "WhiteFur", "WispPowder", "XmasCake", "XmasCandyCane", "YellowDye";

	mes "[Ishi the Rewards Master]";
	mes "\"Welcome! I see you have " + Mobpt + " Monster Points. Would you like to exchange some of those for items?\"";
	next;
	
	set @i, 0;
	setarray @Menu$, "", "", "", "", "", "", "", "", "", "", "";
	callsub SUB_prep_menu;
	
	menu
		@Menu$[0], -,
		@Menu$[1], -,
		@Menu$[2], -,
		@Menu$[3], -,
		@Menu$[4], -,
		@Menu$[5], -,
		@Menu$[6], -,
		@Menu$[7], -,
		@Menu$[8], -,
		@Menu$[9], -,
		@Menu$[10], -;

	if (@menu > @i) close;
	
	set @req, @menu;
	set @rec, 0;
	
L_Item_Loop:
	if (@rec == @req || Mobpt < tvis) goto L_Item_Done;
	
	callsub SUB_give_item;
	set @rec, @rec + 1;
	goto L_Item_Loop;
	
L_Item_Done:
	if (@rec < @req) mes "It looks like your Monster Points were over estimated.";
	close;

L_Register:
	mes "[Ishi the Rewards Master]";
	mes "\"Hey, it seems like you didn't register as a quest participant yet! You can sign up with Aidan.\"";
	close;

L_NotEnough:
	mes "[Ishi the Rewards Master]";
	mes "\"You don't have enough Monster Points for a reward. You'll need to kill some more monsters first.\"";
	close;

//////////////////////////////////////////////////
// Subroutines
//////////////////////////////////////////////////

SUB_prep_menu:
	set @pts, Mobpt;
	set @dif, tvis;
	
L_Menu_Loop:
	if (@pts < @dif || @i == 10) goto L_Menu_Done;
	
	set @Menu$[@i], @i + 1;
	
	set @i, @i + 1;
	set @pts, @pts - @dif;
	set @dif, @dif + 1;
	
	goto L_Menu_Loop;
L_Menu_Done:
	set @Menu$[@i], "No thanks";
	return;

SUB_give_item:
	set Mobpt, Mobpt - tvis;
	set tvis, tvis + 1;
	set @item$, @Items$[rand(getarraysize(@Items$))];
	
	getitem @item$, 1;
	
	mes "You received one " + getitemname(@item$) + "!";
	
	return;
}