summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-19 19:36:52 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-19 19:36:52 +0300
commit9dbe2872d4ab59c39b3d94a6c840d5f98e8f064a (patch)
treea7c45540467c23e7a21094b2750315c15bc4fc2f
parent975e6d81790ae847b10f31dc65060d08ac51702b (diff)
downloadserverdata-9dbe2872d4ab59c39b3d94a6c840d5f98e8f064a.tar.gz
serverdata-9dbe2872d4ab59c39b3d94a6c840d5f98e8f064a.tar.bz2
serverdata-9dbe2872d4ab59c39b3d94a6c840d5f98e8f064a.tar.xz
serverdata-9dbe2872d4ab59c39b3d94a6c840d5f98e8f064a.zip
Add support for divorce in marriage script.
-rw-r--r--npc/functions/marriage.txt61
1 files changed, 52 insertions, 9 deletions
diff --git a/npc/functions/marriage.txt b/npc/functions/marriage.txt
index 673ce620..8cf8a297 100644
--- a/npc/functions/marriage.txt
+++ b/npc/functions/marriage.txt
@@ -31,7 +31,7 @@ function script marriagecheckname {
}
if (distance(.@x, .@y, .x, .y) > .distance)
{
- // registrand too far
+ // registrant too far
return false;
}
return true;
@@ -183,14 +183,8 @@ function script domarriage {
return;
}
-// main function for marriage
-function script marriagemain {
- if (Sex > 1)
- {
- speech l("Sorry i can't help you. Go away!");
- close;
- }
-
+// marry main code
+function script marriagemarry {
.@registrant$ = getmarriageregistrant();
if (marriagecheckname(.@registrant$) == true)
{
@@ -227,8 +221,57 @@ function script marriagemain {
{
case 1:
marriageregister;
+ break;
case 2:
break;
}
return;
}
+
+// divorce main code
+function script marriagedivorce {
+ speech l("What a can do for you?");
+ switch (select(l("I want divorce"),
+ l("Nothing")))
+ {
+ case 1:
+ speech l("Are you sure?");
+ if (select(l("Yes"), l("No")) == 1)
+ {
+ if (divorce())
+ {
+ speech l("Now you divorced!"),
+ l("Good look.");
+ npctalk l("@@ divorced!", strcharinfo(0));
+ }
+ else
+ {
+ speech l("Divorce error!");
+ }
+ }
+ break;
+ case 2:
+ break;
+ }
+ return;
+}
+
+// main function for marriage
+function script marriagemain {
+ if (Sex > 1)
+ {
+ speech l("Sorry i can't help you. Go away!");
+ close;
+ }
+
+ if (getpartnerid() != 0)
+ { // have partner
+ marriagedivorce();
+ }
+ else
+ { // no partner
+ marriagemarry();
+ }
+
+ return;
+}