summaryrefslogtreecommitdiff
path: root/world/map/npc/013-3/barrier.txt
blob: 410bc8822411b639f3c259aee3356d2564ab575a (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
//

013-3.gat,71,21,0|script|#DemonMineBarrier1#_M|45,1,1,{
    callfunc "ClearVariables";

    set @state, ((QUEST_Hurnscald & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT);

    if (@state >= 2) goto L_Close;
    if (@state == 1 && countitem("JackOSoul") >= 1) goto L_Has_Jack_O_Soul;

    mes "A barrier around the opening pushes you back as you approach.";

    warp "013-3.gat", 71, 25;
    goto L_Close;

L_Has_Jack_O_Soul:
    mes "The barrier around the opening allows you passage.";
    set @state, 2;
    callsub S_Update_Mask;
    delitem "JackOSoul", 1;
    goto L_Close;

L_Close:
    set @state, 0;
    close;

S_Update_Mask:
    set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_2_MASK)) | (@state << NIBBLE_2_SHIFT);
    return;
}