1 |
event_inherited(); |
2 |
if (interact) |
3 |
{ |
4 |
can_talk = true; |
5 |
is_talking = true; |
6 |
} |
7 |
if (can_talk == true) |
8 |
{ |
9 |
scr_textscr_textfunction scr_text()
{
if (!instance_exists(obj_dialogue))
msg = instance_create(x, y, obj_dialogue);
} (); |
10 |
with (msg) |
11 |
{ |
12 |
talker[0] = other.id; |
13 |
if (other.npc_flag >= 3) |
14 |
{ |
15 |
message[0] = "* I am very sorry but we are out# of stock!"; |
16 |
message[1] = "* I'll make sure to bake a fresh# batch as soon as I can!"; |
17 |
other.can_talk = false; |
18 |
exit; |
19 |
} |
20 |
message[0] = "* Bake sale! Bake sale! "; |
21 |
message[1] = "* Come eat food made by spiders,# for spiders, of spiders!"; |
22 |
message[2] = "* All proceeds go to spiders in# need!"; |
23 |
message[3] = "* Will you buy a Spider Donut for# 7G?"; |
24 |
ch_msg = 3; |
25 |
ch[1] = "Yes"; |
26 |
ch[2] = "No"; |
27 |
if (outcome == 1) |
28 |
{ |
29 |
other.is_talking = false; |
30 |
talker[5] = other.id; |
31 |
if (global.player_gold < 7) |
32 |
{ |
33 |
talker[4] = other.id; |
34 |
message[4] = "* It seems this transaction# can't be completed."; |
35 |
message[5] = "* Come back when you're ready!"; |
36 |
audio_play_sound(snd_fail, 1, 0); |
37 |
} |
38 |
else if (scr_itemscr_itemfunction scr_item(arg0)
{
nm = arg0;
for (var i = 1; i <= 8; i++)
{
if (global.item_slot[i] == "Nothing")
{
global.item_slot[i] = nm;
return true;
break;
}
else if (i == 8)
{
return false;
}
}
} ("Spider Donut")) |
39 |
{ |
40 |
message[4] = "* (You got a Spider Donut!)"; |
41 |
message[5] = "* You are most gracious! Have a# nice day!"; |
42 |
other.npc_flag += 1; |
43 |
global.player_gold -= 7; |
44 |
} |
45 |
else |
46 |
{ |
47 |
talker[4] = other.id; |
48 |
message[4] = "* It seems this transaction# can't be completed."; |
49 |
message[5] = "* Come back when you're ready!"; |
50 |
audio_play_sound(snd_fail, 1, 0); |
51 |
} |
52 |
other.can_talk = false; |
53 |
} |
54 |
if (outcome == 2) |
55 |
other.can_talk = false; |
56 |
} |
57 |
} |