From 13403ce099a014d2b2a10f21f1141af82eb2d79b Mon Sep 17 00:00:00 2001 From: gumi Date: Sat, 9 May 2020 20:16:51 -0400 Subject: remove the entire notion of marriage --- npc/000-2-1/dan.txt | 2 +- npc/functions/marriage.txt | 293 --------------------------------------------- npc/scripts.conf | 1 - npc/test/_import.txt | 1 - npc/test/npcmarriage.txt | 19 --- 5 files changed, 1 insertion(+), 315 deletions(-) delete mode 100644 npc/functions/marriage.txt delete mode 100644 npc/test/npcmarriage.txt diff --git a/npc/000-2-1/dan.txt b/npc/000-2-1/dan.txt index a60c88f1..31591734 100644 --- a/npc/000-2-1/dan.txt +++ b/npc/000-2-1/dan.txt @@ -63,7 +63,7 @@ L_QuestStory: L_She: mes ""; mesn; - mesq l("She is a good friend of mine... We wanted to marry a few weeks before her accident but..."); + mesq l("She is a good friend of mine... We wanted to move together a few weeks before her accident but..."); next; goto L_Quit2; diff --git a/npc/functions/marriage.txt b/npc/functions/marriage.txt deleted file mode 100644 index d9e48bf5..00000000 --- a/npc/functions/marriage.txt +++ /dev/null @@ -1,293 +0,0 @@ -// Evol functions. -// Author: -// 4144 -// Description: -// Functions for marriage - -// check is player is near marriage npc -// args: -// 0 - player name -// returns: -// true if player located near npc. -function script marriagecheckname { - .@name$ = getarg(0); - if (.@name$ == "") - { - // no other registrand - return false; - } - .@id = getcharid(0, .@name$); - .@accoundId = getcharid(3, .@name$); - if (isloggedin(.@accoundId, .@id) == false) - { - // registrant not logged in - return false; - } - getmapxy(.@mapname$, .@x, .@y, 0, .@name$); - if (.@mapname$ != strnpcinfo(4)) - { - // registrant on other map - return false; - } - if (distance(.@x, .@y, .x, .y) > .distance) - { - // registrant too far - return false; - } - return true; -} - -// return player name registered with same gender like attached player -function script getmarriageregistrant { - if (Sex) - { - .@name$ = getvariableofnpc(.maleName$, strnpcinfo(3)); - } - else - { - .@name$ = getvariableofnpc(.femaleName$, strnpcinfo(3)); - } - return .@name$; -} - -// return registered marriage partner name -function script getmarriagepartner { - if (Sex) - { - .@name$ = getvariableofnpc(.femaleName$, strnpcinfo(3)); - } - else - { - .@name$ = getvariableofnpc(.maleName$, strnpcinfo(3)); - } - if (marriagecheckname(.@name$)) - return .@name$; - return ""; -} - -// register attached player as partner for marriage -function script marriageregisterself { - if (Sex) - { - set getvariableofnpc(.maleName$, strnpcinfo(3)), strcharinfo(0); - set getvariableofnpc(.maleName_partner$, strnpcinfo(3)), ""; - } - else - { - set getvariableofnpc(.femaleName$, strnpcinfo(3)), strcharinfo(0); - set getvariableofnpc(.femaleName_partner$, strnpcinfo(3)), ""; - } - return; -} - -// return player name what was accepted by partner -function script getmarriagepartneraccepted { - if (Sex) - { - .@name$ = getvariableofnpc(.femaleName_partner$, strnpcinfo(3)); - } - else - { - .@name$ = getvariableofnpc(.maleName_partner$, strnpcinfo(3)); - } - return .@name$; -} - -// return true if partner present near and partner accepted you -function script ismarriagepartneraccepted { - .@partner$ = getmarriagepartner(); - if (.@partner$ == "") - return false; - .@name$ = getmarriagepartneraccepted(); - if (.@name$ == strcharinfo(0)) - return true; - return false; -} - -// accept for attached player his/her partner -// args: -// 0 - partner name -function script marriageacceptpartner { - .@name$ = getarg(0); - if (Sex) - { - set getvariableofnpc(.maleName_partner$, strnpcinfo(3)), .@name$; - } - else - { - set getvariableofnpc(.femaleName_partner$, strnpcinfo(3)), .@name$; - } - return; -} - -function script askmarry { - speech l("Do you want to marry @@?", getarg(0)); - if (askyesno() == ASK_YES) - return true; - return false; -} - -// start marriage registration process -function script marriageregister { - .@partner$ = getmarriagepartner(); - if (.@partner$ == "") - { // no partner registered - speech l("Ok I add your name... @@...", strcharinfo(0)); - marriageregisterself(); - next; - speech lg("Now wait for your partner, then talk to me again."); - npctalk l("@@ registered for marriage. Waiting for partner...", strcharinfo(0)); - close; - } - else - { // partner already registered - if (askmarry(.@partner$) == true) - { - marriageregisterself(); - marriageacceptpartner(.@partner$); - npctalk l("@@ registered for marriage and accepted partner @@!", strcharinfo(0), .@partner$); - npctalk l("Waiting for @@...", .@partner$); - close; - } - else - { - close; - } - } - return; -} - -// remove all marriage registations -function script marriageclear { - set getvariableofnpc(.maleName$, strnpcinfo(3)), ""; - set getvariableofnpc(.femaleName$, strnpcinfo(3)), ""; - set getvariableofnpc(.maleName_partner$, strnpcinfo(3)), ""; - set getvariableofnpc(.femaleName_partner$, strnpcinfo(3)), ""; - return; -} - -// do actual marriage -function script domarriage { - .@name$ = strcharinfo(0); - .@partner$ = getarg(0); - if (marriage(.@partner$)) - { - speech l("You got married to @@!", .@partner$); - npctalk l("@@ and @@ just got married!", .@name$, .@partner$); - } - else - { - npctalk l("Marriage failed."); - } - marriageclear(); - return; -} - -// marry main code -function script marriagemarry { - .@registrant$ = getmarriageregistrant(); - if (marriagecheckname(.@registrant$) == true) - { - if (.@registrant$ == strcharinfo(0)) - { - if (ismarriagepartneraccepted()) - { - .@partner$ = getmarriagepartner(); - if (marriagecheckname(.@partner$) == false) - { - speech l("Partner not ready."); - } - else if (askmarry(.@partner$) == true) - { - domarriage(.@partner$); - } - } - else - { - speech l("You already registered. Waiting for your partner..."); - } - } - else - { - speech l("Sorry, I'm busy with other registrations."), - l("Come after a little while."); - } - close; - } - - speech l("What can I do for you?"); - switch (select(l("I want to register for marriage."), - l("Nothing"))) - { - case 1: - marriageregister; - break; - case 2: - break; - } - return; -} - -// divorce main code -function script marriagedivorce { - speech l("What can I do for you?"); - switch (select(l("I want to divorce."), - l("Nothing"))) - { - case 1: - speech lg("Are you sure?"); - if (askyesno() == ASK_YES) - { - if (divorce()) - { - speech l("You are now 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; -} - -// check registration list by timer -function script marriagecheck { - .@name$ = getvariableofnpc(.maleName$, strnpcinfo(3)); - if (.@name$ != "" && marriagecheckname(.@name) == false) - { - set getvariableofnpc(.maleName$, strnpcinfo(3)), ""; - set getvariableofnpc(.maleName_partner$, strnpcinfo(3)), ""; - } - .@name$ = getvariableofnpc(.femaleName$, strnpcinfo(3)); - if (.@name$ != "" && marriagecheckname(.@name) == false) - { - set getvariableofnpc(.femaleName$, strnpcinfo(3)), ""; - set getvariableofnpc(.femaleName_partner$, strnpcinfo(3)), ""; - } -} diff --git a/npc/scripts.conf b/npc/scripts.conf index 29f1d588..f14c29d0 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -27,7 +27,6 @@ "npc/functions/hello.txt", "npc/functions/inventoryplace.txt", "npc/functions/legiontalk.txt", -"npc/functions/marriage.txt", "npc/functions/npcmove.txt", "npc/functions/masks.txt", "npc/functions/spotlight.txt", diff --git a/npc/test/_import.txt b/npc/test/_import.txt index 6c7f7e71..69324674 100644 --- a/npc/test/_import.txt +++ b/npc/test/_import.txt @@ -8,6 +8,5 @@ "npc/test/npc4.txt", "npc/test/npc5.txt", "npc/test/npc6.txt", -"npc/test/npcmarriage.txt", "npc/test/test1.txt", "npc/test/test2.txt", diff --git a/npc/test/npcmarriage.txt b/npc/test/npcmarriage.txt deleted file mode 100644 index 1b7497bd..00000000 --- a/npc/test/npcmarriage.txt +++ /dev/null @@ -1,19 +0,0 @@ -// Evol scripts. -// Author: -// 4144 -// Description: -// npc marriage - -test,25,14,0 script marriage1 NPC_PLAYER,{ - marriagemain(); - close; - -OnTimer30000: - marriagecheck(); - end; - -OnInit: - .sex = G_MALE; - .distance = 3; - initnpctimer; -} -- cgit v1.2.3-70-g09d2