summaryrefslogtreecommitdiff
path: root/npc/items/croconut.txt
blob: eececb0f76817b7a881d1aa46058ae85a0f2c13f (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
// Evol scripts.
// Authors:
//    4144
//    Reid
//    Jesusalva
// Description:
//    Allows to break a Croconut into multiple parts.

-	script	Croconut	NPC_HIDDEN,{
    close;

OnUse:
    mesc l("Do you want to break open this %s?", getitemlink(Croconut));

    select
        l("Yes."),
        l("No.");
    mes "";
    closeclientdialog;
    switch (@menu) {
    case 1:
        goto L_Weapon;
    case 2:
        getitem Croconut, 1;
        close;
    }
    close;

L_Weapon:
    .@r=rand2(1,5);
    switch (.@r) {
        case 1:
        case 2:
        case 3:
            goto L_TooWeak; break;
        case 4:
            goto L_Weak; break;
        case 5:
            goto L_Good; break;
    }

L_TooWeak:
    // Croconuts do not heal much. So opening them without fail should be possible at relatively low strength levels.
    .@q = rand2(5);
    if (readparam2(bStr) > 10)
        .@q = .@q + 1;
    if (readparam2(bStr) > 25)
        .@q = .@q + 1;
    if (readparam2(bStr) > 35)
        .@q = .@q + 1;

    if (.@q == 0) goto L_TooWeakLost;
    if ( (.@q == 1) || (.@q == 2) ) goto L_TooWeakFail;
    if ( (.@q >= 3) && (.@q <= 6) ) goto L_Weak;
    if ( (.@q > 6) ) goto L_Good;

L_TooWeakLost:
    dispbottom l("Oops! You destroyed your %s.", getitemlink(Croconut));
    close;

L_TooWeakFail:
    dispbottom l("Well... you did not succeed in opening this %s.", getitemlink(Croconut));

    getitem Croconut, 1;
    close;

L_Weak:
    dispbottom l("You broke the %s into two parts, but you crushed one of them.", getitemlink(Croconut));

    getitem HalfCroconut, 1;
    close;

L_Good:
     dispbottom l("You perfectly cut your %s into two edible parts.", getitemlink(Croconut));

    getitem HalfCroconut, 2;
    close;
}