summaryrefslogtreecommitdiff
path: root/npc/008-1/andra.txt
blob: 1ae6f3001646a76bfd5e57cca7ee438e55b50894 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
// Andra asks for your help to keep the soil fertile. The best way to do it is planting, so she asks for water and seeds. When she plants the seeds, some plants are spawned.

008-1.gat,36,26,0	script	Andra	201,{
    set @water_amount, 1;
    set @seeds_amount, 4;
    if ($@andra_status == 1) goto L_Planting;
    if (baselevel < 30) goto L_TooYoung;
    if (FLAGS & FLAG_ANDRA_HELPED) goto L_Return;
    mes "[Andra]";
    mes "\"Hello, my name is Andra. You see those nice trees? I planted every single one of them! I'm very proud of my work!\"";
    next;
    menu
        "Nice! I imagine you planted them a long time ago, right?.", -,
        "Sorry, but I'm not interested in plants and trees.", L_DislikePlants;
    mes "[Andra]";
    mes "\"That is the fun part... It took only some months... and look how healthy and beautiful they are!\"";
    next;
    menu
        "How is that possible?", -;
    mes "[Andra]";
    mes "\"A few years ago, a nice woman from Tulimshar did something amazing to the land around here... I guess her name was Eomie. I have no idea what she did, but since she worked on this land, everything you plant here will grow really fast!\"";
    next;
    mes "\"But I am very worried about something she told me when she left... She warned me that this place needs constant care. If one small spot is not cultivated for a long time, it will become less and less fertile.\"";
    next;
    mes "And she also told me that this soil is so fertile because it has a lot of nutrients not only on this side, but everywhere. So it is certain that all soil in this place will become weaker if we let a lot of unfertilized spots...\"";
    next;
    menu
        "That sounds bad! But you just need to keep planting, right?", -;
    mes "[Andra]";
    mes "\"Exactly! But it is a big place. And I don't have too much money to buy seeds. If only I could find someone who could help me... ah... I know you are probably busy, but since you are here, would you like to help me in this noble task?\"";
    menu
        "Of course! What can I do to help you?", -,
        "Not right now, I'm really busy.", L_Busy;
    mes "[Andra]";
    mes "\"Yay! I knew you would help me! I just need seeds and water... I think " + @seeds_amount + " Grass Seeds and " + @water_amount + " Bottle(s) of Water should be enough to grow some plants on the place. If you give the items, you can let the rest with me.\"";
    next;
    menu
        "I don't have it right now, but I will come back later.", L_Close,
        "Here are the seeds and the water.", -;
    if (countitem("BottleOfWater") < @water_amount || countitem("GrassSeed") < @seeds_amount) goto L_NotEnough;
    if ($@spawned_plants >= $@MAX_GLOBAL_PLANTS) goto L_Gather;
    mes "[Andra]";
    mes "\"Great! Thank you for you help. If you have more items and want to help again, feel free to talk to me. We just have to be careful to not oversoak the soil with water.. but you don't need to worry, I will know when it is the right time to stop planting.";
    next;
    delitem "BottleOfWater", @water_amount;	
    delitem "GrassSeed", @seeds_amount;	
    set FLAGS, FLAGS | FLAG_ANDRA_HELPED;
    mes "Andra pours some water in a lot of different places and then throws some seeds to the sky. The wind carries some of them really far from her.";
    close2;

L_PreSummon:
    set $@andra_status, 1;
    set $@farmer$, strcharinfo(0);
    startnpctimer;
    end;

OnTimer1000:
    set $@plant_id, rand(1029,1032);
    areamonster "008-1.gat",44,18,135,46,"plant",$@plant_id,$@PLANTS_PER_SEED, "Andra::OnPlantDeath";
    npctalk "I think some plants will grow almost instantly! Just Watch...";
    set $@spawned_plants, $@spawned_plants + $@PLANTS_PER_SEED;
    end;

OnTimer3000:
    set $@plant_id, rand(1029,1032);
    areamonster "008-1.gat",44,18,135,46,"plant",$@plant_id,$@PLANTS_PER_SEED, "Andra::OnPlantDeath";
    set $@spawned_plants, $@spawned_plants + $@PLANTS_PER_SEED;
    end;

OnTimer5000:
    set $@plant_id, rand(1029,1032);
    areamonster "008-1.gat",44,18,135,46,"plant",$@plant_id,$@PLANTS_PER_SEED, "Andra::OnPlantDeath";
    set $@spawned_plants, $@spawned_plants + $@PLANTS_PER_SEED;
    end;

OnTimer7000:
    set $@plant_id, rand(1029,1032);
    areamonster "008-1.gat",44,18,135,46,"plant",$@plant_id,$@PLANTS_PER_SEED, "Andra::OnPlantDeath";
    npctalk "Good... Just take a walk and you will be able to see how your seeds turned into some nice looking plants.";
    set $@spawned_plants, $@spawned_plants + $@PLANTS_PER_SEED;
    set $@andra_status, 0;
    set $@farmer$, "";
    setnpctimer 0;
    stopnpctimer;
    end;

L_Return:
    mes "[Andra]";
    mes "\"Hi " + strcharinfo(0) + ", good to see you! You came back to help me again?\"";
    next;
    menu
        "Yes, and I already have the seeds and the water.", -,
        "No, I just wanted to say hello.", L_Bye;
    if ($@spawned_plants >= $@MAX_GLOBAL_PLANTS) goto L_Gather;
    if (countitem("BottleOfWater") < @water_amount || countitem("GrassSeed") < @seeds_amount) goto L_NotEnough;
    delitem "BottleOfWater", @water_amount;	
    delitem "GrassSeed", @seeds_amount;
    mes "Andra pours some water in a lot of different places and then throws the seeds to the sky. The wind carries some of them really far from her.";
    close2;
    goto L_PreSummon;

OnPlantDeath:
    set $@spawned_plants, $@spawned_plants - 1;
    end;

L_NotEnough:
    mes "[Andra]";
    mes "\"Sorry, but you don't have the items I need... Please, come back when you have them.\"";
    close;

L_Gather:
    mes "[Andra]";
    mes "\"Look at all those plants! I think we shoudn't plant more seeds until someone gather those herbs...\"";
    close;

L_Bye:
    mes "[Andra]";
    mes "\"Oh, you are a nice person... Thanks!\"";
    close;

L_Busy:
    mes "[Andra]";
    mes "\"Ok, I understand. Come back if have some free time!\"";
    close;

L_DislikePlants:
    mes "[Andra]";
    mes "\"Really? How can someone dislike plants and trees? What a strange thing...\"";
    close;

L_Planting:
    mes "[Andra]";
    mes "\"Sorry, I can't talk right now. I am planting some seeds " + $@farmer$ + " gave me.\"";
    close;

L_Close:
    close;

L_TooYoung:
    mes "[Andra]";
    mes "\"I'm sorry, I can't talk right now. I am really busy with those trees! If you feel like talking, maybe you should come back later.\"";
    close;

OnInit:
    set $@PLANTS_PER_SEED, 3;
    set $@MAX_GLOBAL_PLANTS, 100; // You can plant only if the amount of plants currently in the map is < than this value.
    initnpctimer;
    stopnpctimer;
}