summaryrefslogtreecommitdiff
path: root/npc/items/valentine.txt
blob: 79a0a968be40803bfaf086e899e4711b334f35d5 (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
// TMW-2 script.
// Author:
//    Jesusalva
// Description:
//    Valentine eating

// Eats chocolate, returns bad ones if requested
// EatValentineChocolate()
function	script	EatValentineChocolate	{
	if ($EVENT$ != "Valentine") {
		dispbottom l("Past due date.");
	} else if (#VALENTINE_OPENED >= #VALENTINE_RECEIVED) {
        dispbottom l("This is not meant for me.");
        getitem BoxOfChocolates, 1;
	} else {
        .@pts=1;
        if (GSET_VALENTINE_EATALL) {
            .@pts=(#VALENTINE_RECEIVED-#VALENTINE_OPENED);
            delitem BoxOfChocolates, .@pts-1;
        }
		// I know technically this is wrong grammar, but I want fixed width
		#VALENTINE_OPENED=#VALENTINE_OPENED+.@pts;
		#VALENTINE_POINTS=#VALENTINE_POINTS+.@pts;
		if (rand2(0,1))
			dispbottom l("It's tasty ^.^");
		else
			dispbottom l("It's yummy ^.^");
	}
    return;
}