summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-19 21:09:38 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-19 21:09:38 +0300
commite1ca11a950b7553cbafff6902a26c6a4023f9df9 (patch)
tree1c78eeb01157f7df66b42130716b1a1928f93911
parent1c644eea65083558fc029345a8b4d2b81d0625e1 (diff)
downloadserverdata-e1ca11a950b7553cbafff6902a26c6a4023f9df9.tar.gz
serverdata-e1ca11a950b7553cbafff6902a26c6a4023f9df9.tar.bz2
serverdata-e1ca11a950b7553cbafff6902a26c6a4023f9df9.tar.xz
serverdata-e1ca11a950b7553cbafff6902a26c6a4023f9df9.zip
Replace select with yes/no to askyesno function.
-rw-r--r--db/constants.conf5
-rw-r--r--npc/001-1/enora.txt10
-rw-r--r--npc/001-1/qpid.txt9
-rw-r--r--npc/001-2-28/plush.txt24
-rw-r--r--npc/functions/beds.txt2
-rw-r--r--npc/functions/main.txt5
-rw-r--r--npc/functions/marriage.txt4
7 files changed, 27 insertions, 32 deletions
diff --git a/db/constants.conf b/db/constants.conf
index efa08ca8..2e32325d 100644
--- a/db/constants.conf
+++ b/db/constants.conf
@@ -3859,4 +3859,9 @@ constants_db: {
ACTION_DEAD: 5
ACTION_HURT: 6
ACTION_SPAWN: 7
+
+ comment__: "Ask constants"
+ ASK_YES: 1
+ ASK_NO: 2
+ ASK_EXIT: 255
}
diff --git a/npc/001-1/enora.txt b/npc/001-1/enora.txt
index e27cd4a1..00e88ca8 100644
--- a/npc/001-1/enora.txt
+++ b/npc/001-1/enora.txt
@@ -341,14 +341,10 @@
speech 5,
l("Are you sure that they are my potions?");
- switch (select (menuaction(l("Yes")), menuaction(l("No"))))
+ if (askyesno() == ASK_YES)
{
- case 1:
- delitem PibberiesInfusion, 5;
- enora_fourth_quest;
- break;
- case 2:
- break;
+ delitem PibberiesInfusion, 5;
+ enora_fourth_quest;
}
return;
diff --git a/npc/001-1/qpid.txt b/npc/001-1/qpid.txt
index 6f3a2883..6ffc954a 100644
--- a/npc/001-1/qpid.txt
+++ b/npc/001-1/qpid.txt
@@ -128,14 +128,9 @@
l("But if you fail, you will have to get them from the alchemist."),
l("Deal?");
- switch (select (menuaction(l("Yes")),
- menuaction(l("No"))))
+ if (askyesno() == ASK_YES)
{
- case 1:
- riddle_enigma;
- break;
- case 2:
- break;
+ riddle_enigma;
}
return;
}
diff --git a/npc/001-2-28/plush.txt b/npc/001-2-28/plush.txt
index 8480fc1b..62199467 100644
--- a/npc/001-2-28/plush.txt
+++ b/npc/001-2-28/plush.txt
@@ -65,16 +65,14 @@
l("This will remain your respawn point until set elsewhere."),
l("Is that okay?");
- switch (select (menuaction(l("Yes")),
- menuaction(l("No"))))
+ if (askyesno() == ASK_YES)
{
- case 1:
- accepted_room (.@price);
- break;
- case 2:
- speech 5,
- l("Come back later if you changed your mind!");
- break;
+ accepted_room (.@price);
+ }
+ else
+ {
+ speech 5,
+ l("Come back later if you changed your mind!");
}
return;
@@ -97,13 +95,9 @@
l("If you are registered somewhere else you will loose that reservation."),
l("Do you still want to lodge here?");
- switch (select (menuaction(l("Yes")), menuaction(l("No"))))
+ if (askyesno() == ASK_YES)
{
- case 1:
- register_room;
- break;
- case 2:
- break;
+ register_room;
}
}
return;
diff --git a/npc/functions/beds.txt b/npc/functions/beds.txt
index 299ceda8..8fa1e4b1 100644
--- a/npc/functions/beds.txt
+++ b/npc/functions/beds.txt
@@ -21,7 +21,7 @@ function script bedTouch {
function script bedClic {
narrator 4, l("Do you want to use this place as save point?");
- if (select (menuaction(l("Yes")), menuaction(l("No"))) == 1)
+ if (askyesno() == ASK_YES)
{
savepointparticle (getarg (0), getarg (1), getarg (2), getarg (3));
}
diff --git a/npc/functions/main.txt b/npc/functions/main.txt
index 0632bcec..f2dad770 100644
--- a/npc/functions/main.txt
+++ b/npc/functions/main.txt
@@ -167,3 +167,8 @@ function script abs {
.@n = getarg(0);
return .@n >= 0 ? .@n : -.@n;
}
+
+function script askyesno {
+ return select (menuaction(l("Yes")),
+ menuaction(l("No")));
+}
diff --git a/npc/functions/marriage.txt b/npc/functions/marriage.txt
index 222d4934..bb24f439 100644
--- a/npc/functions/marriage.txt
+++ b/npc/functions/marriage.txt
@@ -122,7 +122,7 @@ function script marriageacceptpartner {
function script askmarry {
speech l("Do you want to marry @@?", getarg(0));
- if (select(menuaction(l("Yes")), menuaction(l("No"))) == 1)
+ if (askyesno() == ASK_YES)
return true;
return false;
}
@@ -236,7 +236,7 @@ function script marriagedivorce {
{
case 1:
speech l("Are you sure?");
- if (select(menuaction(l("Yes")), menuaction(l("No"))) == 1)
+ if (askyesno() == ASK_YES)
{
if (divorce())
{