summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoffee <coffee@coffee-EP45-UD3L.(none)>2011-06-03 08:18:22 -0300
committerCoffee <coffee@coffee-EP45-UD3L.(none)>2011-06-03 08:18:22 -0300
commit7de9756f34d759f087f3a9c698911a5499814972 (patch)
tree69faf1097aaa3805f24824d456c34abbc77f89c9
parent84cdf52dcf52131c57389e1def928d4cd0b8789b (diff)
downloadserverdata-7de9756f34d759f087f3a9c698911a5499814972.tar.gz
serverdata-7de9756f34d759f087f3a9c698911a5499814972.tar.bz2
serverdata-7de9756f34d759f087f3a9c698911a5499814972.tar.xz
serverdata-7de9756f34d759f087f3a9c698911a5499814972.zip
Proposing a planting function to Andra NPC
-rw-r--r--db/const.txt1
-rw-r--r--npc/008-1/andra.txt167
2 files changed, 147 insertions, 21 deletions
diff --git a/db/const.txt b/db/const.txt
index ceb76095..502efcab 100644
--- a/db/const.txt
+++ b/db/const.txt
@@ -257,6 +257,7 @@ FLAG_GOT_NAEM_GLOVES 4 // this replaces Naem_Quest_Done, which was used as a boo
FLAG_GOT_GRADUATIONCAP 8 // this is a bit which was to be found in Tut_var second bit
FLAG_TOWEL_HELPED 16 // gave the towel npc the stuff he wants
FLAG_TOWEL_COMPLETED 32 // got the towel from the towel npc
+FLAG_ANDRA_HELPED 64 // Knows Andra and agreed to help her
DOCK_tulimshar 1
DOCK_hurnscald 2
diff --git a/npc/008-1/andra.txt b/npc/008-1/andra.txt
index e56cbbf5..1ae6f300 100644
--- a/npc/008-1/andra.txt
+++ b/npc/008-1/andra.txt
@@ -1,24 +1,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,{
- mes "[Andra]";
- mes "\"Hello, my name is Andra, what's yours?\"";
- next;
- input @name$;
-
- mes "[Andra]";
- mes "\"Hello, " + @name$ + "! What is your favorite number?\"";
- next;
- input @num;
-
- if (@num == 5) goto L_Same;
-
- mes "[Andra]";
- mes "\"I don't like that one.\"";
- close;
-
-L_Same:
- mes "[Andra]";
- mes "\"Mine too!\"";
- close;
+ 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;
}