summaryrefslogtreecommitdiff
path: root/npc/functions/villagertalk.txt
diff options
context:
space:
mode:
authorReid <reidyaro@gmail.com>2016-06-20 03:21:11 +0200
committerReid <reidyaro@gmail.com>2016-06-20 03:27:31 +0200
commit32736a72197fff2942df58f88971925ea9f46d56 (patch)
tree1eddd366543fbd90fe5d172626e740d253a1174e /npc/functions/villagertalk.txt
parent8ca2baf6b75d49989818ae292d792ca6821bbaad (diff)
downloadserverdata-32736a72197fff2942df58f88971925ea9f46d56.tar.gz
serverdata-32736a72197fff2942df58f88971925ea9f46d56.tar.bz2
serverdata-32736a72197fff2942df58f88971925ea9f46d56.tar.xz
serverdata-32736a72197fff2942df58f88971925ea9f46d56.zip
Rewrite the villagertalk with a switch.
Diffstat (limited to 'npc/functions/villagertalk.txt')
-rw-r--r--npc/functions/villagertalk.txt65
1 files changed, 35 insertions, 30 deletions
diff --git a/npc/functions/villagertalk.txt b/npc/functions/villagertalk.txt
index 95f70c87..0627b5e7 100644
--- a/npc/functions/villagertalk.txt
+++ b/npc/functions/villagertalk.txt
@@ -2,24 +2,20 @@
// Authors:
// Reid
// Qwerty Dragon
-// Contributors:
// Akko Teru
// Description:
// Tell a random sentence. || There ought to be a law!
-// Variables:
-// .@rand = Random number between the number of sentence choice.
-// .@darn = Separatly chosen value for silly antics.
function script villagertalk {
- .@rand = rand(5);
- .@darn = rand(42);
- if (.@rand == 0)
+ function darn_or_smile
{
+ .@darn = rand(42);
+
if (.@darn < 26)
{
emotion 103; // ^.^
- goodbye;
+ hello;
}
else if (.@darn > 26)
{
@@ -30,30 +26,39 @@ function script villagertalk {
{
npctalk3 l("Stop it!");
}
+
+ return;
}
- else if (.@rand == 1)
- {
- speech 4,
- l("Do you feel too weak even to do damage to this areas wishy-washy wildlife?"),
- l("Then concentrate your anger upon the trees hereabouts, you will gain experience whilst leveling your sword skill on them."),
- l("Oh, and a fruit may even fall for you if you are lucky! But stay alert to pick up your drops.");
- }
- else if (.@rand == 2)
- {
- npctalk3 l("It is a sunny day, don't you think?");
- }
- else if (.@rand == 3)
- {
- npctalk3 l("Go fly a kite.");
- }
- else if ((.@rand == 4) && (.@darn == 2))
- {
- npctalk3 l("I just want to live my life in peace.");
- }
- else if (.@rand == 4)
+
+ switch (rand(4))
{
- npctalk3 l("It's difficult to distinguish good villagers from bad ones; keep your guard up, and stay away from me.");
- emotion 6;
+ case 0:
+ debugmes "0";
+ darn_or_smile();
+ break;
+ case 1:
+ debugmes "1";
+ speech 4,
+ l("Do you feel too weak even to do damage to this areas wishy-washy wildlife?"),
+ l("Then concentrate your anger upon the trees hereabouts, you will gain experience whilst leveling your sword skill on them."),
+ l("Oh, and a fruit may even fall for you if you are lucky! But stay alert to pick up your drops.");
+ break;
+ case 2:
+ debugmes "2";
+ npctalk3 l("It is a sunny day, don't you think?");
+ break;
+ case 3:
+ debugmes "3";
+ npctalk3 l("Go fly a kite.");
+ break;
+ case 4:
+ debugmes "4";
+ npctalk3 l("I just want to live my life in peace.");
+ break;
+ default:
+ debugmes "def";
+ emotion 3;
+ break;
}
return;