DragonPrime - LoGD Resource Community

Modules, Themes and other customizations for your game => Completed Modules for version 1.x.x => Topic started by: Ironman on February 09, 2006, 07:19:47 PM



Title: Another Lovers Mod
Post by: Ironman on February 09, 2006, 07:19:47 PM
I know that there are other alternative versions of lovers.php out there, but I've been working on this one since November, and I figured maybe someone else would like it.

Features:

* Only one male player can be married to Violet and only one female to Seth
* Required charm for each level of flirting admin configurable
* Amount of charm lost when divorced admin configurable
* Violet/Seth will divorce when aplayer is in very low spirits  (this is to keep one player from being married forever, not allowing others the oppertunity)

There are a couple of things I would like to add yet, so any suggestions are appreciated.  The things I would like to add:

* A way to have Violet/Seth divorce their partner if said partner has not logged into the game in an configurable number of days
* Save the married player by acctid, since I currently have it saved by name, which can change in the game w/o being changed in the module settings

Download link:  http://dragonprime.net/users/Ironman/lovers2.zip


Title: Re:Another Lovers Mod
Post by: robert on February 10, 2006, 01:40:05 AM
Copy/paste is a terrible thing. Copying a flawed file also copies its flaws. This is not your fault Ironman, it is a flaw in the core file.

The names of the barmaid and bard are game settings and should not be hard coded into any file which refers to them.

I posted a fix for one such use here:
http://dragonprime.net/index.php?board=16;action=display;threadid=3504

Looking over the file, I see more places where 'violet' and 'seth' needs to be replaced.


Title: Re:Another Lovers Mod
Post by: Ironman on February 10, 2006, 03:48:17 AM
Fixed in version 2.01.  Same link as above.


Title: Re:Another Lovers Mod
Post by: Zanzaras on February 10, 2006, 06:42:07 AM
I actually like this. It's closer to the original Legend of the Red Dragon. I never have been fond of the fact that every player in the game can be married to Seth or Violet at the same time. This puts the "special" back into the marriage, knowing that you beat out all the other players and won Seth's/Violet's hand.

Although I can see how it would be frustrating to a player on a server with a large player base.


Title: Re:Another Lovers Mod
Post by: XChrisX on February 10, 2006, 07:00:27 AM
I always loved the thought of a Casanova-Seth and bitchy-Violet... ;) Has something of "Bard's Tale" ;)


Title: Re:Another Lovers Mod
Post by: Nightborn on February 10, 2006, 07:28:36 AM
^^ well, in the next release this will be fixed.


Title: Re:Another Lovers Mod
Post by: Ironman on February 10, 2006, 12:56:18 PM
I actually like this. It's closer to the original Legend of the Red Dragon. I never have been fond of the fact that every player in the game can be married to Seth or Violet at the same time. This puts the "special" back into the marriage, knowing that you beat out all the other players and won Seth's/Violet's hand.

Although I can see how it would be frustrating to a player on a server with a large player base.

That was exactly what I was going for -- the old LORD way of doing it. :)


Title: Re:Another Lovers Mod
Post by: Ironman on February 10, 2006, 01:01:50 PM
^^ well, in the next release this will be fixed.
What features, exactly?  All of the above?  What about the changes I plan on making (seen in the first post)?  If this is already done, I may as well not spend any more time working on it.


Title: Re:Another Lovers Mod
Post by: Nightborn on February 10, 2006, 01:49:24 PM
Ah, nono.

The fixes = fixed seth/violet in the lovers module...

it was obviously forgotten to fix the entire module... parts are done, parts are left out.

I rewrote those passages and posted them in.

I don't know the exact outcome yet.


Title: Re:Another Lovers Mod
Post by: Ironman on February 10, 2006, 02:29:53 PM
Okay, cool.  I'm sure the changes I made wouldn't be appropriate for some servers.

Can anyone offer me some advice on how I would have the module check how many days either Seth or Violet's spouse has not played so that they can be auto divorced?

Thanks!
Any other suggestions welcome, as well.


Title: Re:Another Lovers Mod
Post by: Nightborn on February 10, 2006, 02:48:01 PM
only a bad one.

on all newday_runonce, increase a pref "daysoff" by +1 (just one sql query would suffice).

then, on every newday (user called) set the pref to 0.

this should work. if you get the pref, you have the days he hasn't logged in.


Title: Re:Another Lovers Mod
Post by: Sichae on February 10, 2006, 02:56:13 PM
You can always use an SQL call (at newday-runonce) to get the laston of the player. It would look something like this:
Code:
$married_id = get_module_setting("violetspouse");
// once you switch it to acctid
$sql = "SELECT laston FROM ".db_prefix("accounts")." WHERE acctid='$married_id'";
$res = db_query($sql);
$row = db_fetch_assoc($res);
if ($row['laston'] < date("Y-m-d H:i:s",strtotime("-".get_module_setting("daystilldivorce")." days"))){
// do what you want
}
Looking over your code, I'd suggest storing the spouse of Violet/Seth as their acctid, and not their name. Change text to int in the settings, and then when you set it, just have:
Code:
set_module_setting("violetspouse",$session['user']['acctid']);
Then, to call the name:
Code:
$sql = "SELECT name FROM ".db_prefix("accounts")." WHERE acctid='".get_module_setting("violetspouse")."'";
$res = db_qeury($sql);
$row = db_fetch_assoc($res);
$name = $row['name'];
I hope that is all understandable.


Title: Re:Another Lovers Mod
Post by: Nightborn on February 10, 2006, 02:59:41 PM
Mhm, this is another option, yes. ^^

using the laston function. I don't know if he meant real days or game days.


Title: Re:Another Lovers Mod
Post by: Sichae on February 10, 2006, 03:00:38 PM
using the laston function. I don't know if he meant real days or game days.

Ah, okay. Ironman, if you meant game days, then I suggest going with Nightborn's method. If you mean real days, then you can use my method.


Title: Re:Another Lovers Mod
Post by: Ironman on February 10, 2006, 04:41:13 PM
Sorry I wasn't more specific.  I was thinking real days.  I had considered game days, but calling someone absent based on game days can be a little unfair, depending on when new days reset.

Thanks for the suggestions.  Going to work now...



Title: Re:Another Lovers Mod
Post by: Ironman on February 11, 2006, 10:24:51 PM
Here it is:

* Admin configurable setting for autodivorce of absentee spouses
* Spouse info now saved by acctid
* Fixed a minor display bug introduced in v2.01

http://dragonprime.net/users/Ironman/lovers2.zip


Title: Re: Another Lovers Mod
Post by: Trevoke on April 21, 2006, 08:13:36 AM
How about an "auto divorce" without loss of charm or anything when a dragon kill happens?


Title: Re: Another Lovers Mod
Post by: Ironman on April 23, 2006, 02:29:32 PM
How about an "auto divorce" without loss of charm or anything when a dragon kill happens?

I liked the idea, and put it in as an option.  Version 2.2:

  http://legendarydragons.com/files/lovers_alt2.2.zip


Title: Re: Another Lovers Mod
Post by: DarQness on April 24, 2006, 02:03:27 PM
I still get this when I click on the button... any other modules/core stuff I needed to modify?

Code:
SELECT name FROM accounts WHERE acctid=

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Call Stack:
1: db_query("SELECT name FROM accounts...") called from /home/sthought/public_html/lotgd/modules/lovers.php on line 345
2: lovers_seth() called from /home/sthought/public_html/lotgd/modules/lovers.php on line 224
3: lovers_run() called from /home/sthought/public_html/lotgd/runmodule.php on line 32


Title: Re: Another Lovers Mod
Post by: Zanzaras on April 24, 2006, 02:14:26 PM
I too recieved this error message after first dropping this mod into the module folder then testing the mod in game. I went in to the Module Manager and completely uninstalled the mod. I then re-installed it and every thing was worked fine. Give that a try and see if it works.

If this fixes your problem, Ironman may want to inform anyone who uses the module to uninstall the Core lovers.php module first.


Title: Re: Another Lovers Mod
Post by: DarQness on April 24, 2006, 04:00:49 PM
Whoa you're right! It worked! Thanks :D


Title: Re: Another Lovers Mod
Post by: Zanzaras on April 24, 2006, 07:12:13 PM
Any time.  :)


Title: Re: Another Lovers Mod
Post by: Trevoke on April 25, 2006, 06:19:23 AM
*scratches head*
I need to learn PHP...

On my test server, gave myself 100 charm, married Violet, new day rolls around (aka '/') ... Boar's Head Inn, flirt with Violet.
You stare dreamily across the room at Violet, who leans across a table to serve a patron a drink. You turn when you feel a tap on your shoulder. Cedrik reminds you that Violet is now married to Admin Trevoke. You curse Admin Trevoke.

That's ME!


Title: Re: Another Lovers Mod
Post by: Trevoke on April 25, 2006, 02:35:55 PM
Oh, and, hrm, if you activate the "auto-divorce on dragon kill", does it deactivate the divorce on "wake up with really low spirits" ?


Title: Re: Another Lovers Mod
Post by: DarQness on April 25, 2006, 04:32:13 PM
Oh, and, hrm, if you activate the "auto-divorce on dragon kill", does it deactivate the divorce on "wake up with really low spirits" ?

I don't think so.

About your other problem, I haven't encountered that yet... so can't help you there, sorry. =/


Title: Re: Another Lovers Mod
Post by: Ironman on April 25, 2006, 08:27:24 PM
Oh, and, hrm, if you activate the "auto-divorce on dragon kill", does it deactivate the divorce on "wake up with really low spirits" ?

Nope.


Title: Re: Another Lovers Mod
Post by: Ironman on April 25, 2006, 08:31:28 PM
*scratches head*
I need to learn PHP...

On my test server, gave myself 100 charm, married Violet, new day rolls around (aka '/') ... Boar's Head Inn, flirt with Violet.
You stare dreamily across the room at Violet, who leans across a table to serve a patron a drink. You turn when you feel a tap on your shoulder. Cedrik reminds you that Violet is now married to Admin Trevoke. You curse Admin Trevoke.

That's ME!

Hmmm, I can't reproduce this.  I have no idea. :(


Title: Re: Another Lovers Mod
Post by: Trevoke on April 26, 2006, 05:36:09 AM
If you can't reproduce it, I guess it must be tied to something I've done.. but damn if I know what it is. *grmbl*

Shall I bother you and ask you if you can set up the option for auto divorce on either DK or Really Low Spirits?


Title: Re: Another Lovers Mod
Post by: Ironman on April 26, 2006, 06:25:17 AM
If you can't reproduce it, I guess it must be tied to something I've done.. but damn if I know what it is. *grmbl*

Shall I bother you and ask you if you can set up the option for auto divorce on either DK or Really Low Spirits?

No bother.  I'll make the auto divorce on very low spirits an optional setting.  I'll try to get to that tonight, but it may not be until the weekend.


Title: Re: Another Lovers Mod
Post by: Trevoke on April 26, 2006, 07:40:06 PM
Great. Thanks. I'll try to get to the bottom of my problem.


Title: Re: Another Lovers Mod
Post by: Ironman on May 03, 2006, 05:48:38 PM
Version 2.3: added the ability to turn on or off auto-divorce on very low spirits.  Default is on.

  http://www.legendarydragons.com/files/lovers_alt2.3.zip


Title: Re: Another Lovers Mod
Post by: Trevoke on May 04, 2006, 12:59:09 PM
Great. Thank you!
I still don't understand my problem at all. After all, it should check the account ID, no? Why would that check fail, or be unconditionally false? ...


Title: Re: Another Lovers Mod
Post by: Ironman on May 05, 2006, 06:05:38 AM
I'm at a total loss. :(

Does anybody else have this problem or have any ideas what is going on with Trevoke?


Title: Re: Another Lovers Mod
Post by: Trevoke on May 05, 2006, 07:39:44 AM
I can offer you access to my test server if you like.. ?
The problem happens both if the PC is female or male, so it's not a coding error.

Did anyone else try it with CortalUX's marriage module? It has a "convert flirtpoints" function which I used without actually understanding it (shame on me)..


Title: Re: Another Lovers Mod
Post by: Nightborn on May 05, 2006, 08:12:28 AM
do you mean the overhauled one?

yes, I implemented it.

if you activated it & converted it just means that if you HAD already the marriage installed (old version) you can just convert the flirtpoints to the new version.

you can't break something except if you do it afterwards just overwrite newer flirtpoints.


Title: Re: Another Lovers Mod
Post by: Trevoke on May 06, 2006, 12:26:28 PM
Nightborn -

So you're saying that if I do the conversion after I activate the lovers module I can break something?

Since I installed and uninstalled and reinstalled the lovers module I don't think it counts..

It looks like it's not ready the account ID properly, no?


edit : is there a way to give you guys some output code or something to look at?


Title: Re: Another Lovers Mod
Post by: Nightborn on May 06, 2006, 01:22:41 PM
no, not break in the sense of "killing my server"

you could replace the present flirtpoints your users have with the old ones... when you copied the overhauled marriage to your directory.

you can give code here.


Title: Re: Another Lovers Mod
Post by: Rudey on January 26, 2008, 09:28:31 AM
*pushing old threads*

In case there is still interest in this mod, here's some instructions fixing a small bug in the code version posted above.
The lines 533 to 615 in the lovers.php have to be replaced by:

Code:
switch(httpget('flirt')){
case 1:
if (e_rand($c,$cs1)>=$cs1){
output("You wink at %s`0, and she gives you a warm smile in return.",$partner);
if ($c<$cs2) $c++;
}else{
output("You wink at %s`0, but she pretends not to notice.",$partner);
}
break;
case 2:
output("You stroll confidently across the room toward %s`0.",$partner);
if (e_rand($c,$cs2)>=$cs2){
output("Taking hold of her hand, you kiss it gently, your lips remaining for only a few seconds.");
output("%s`0 blushes and tucks a strand of hair behind her ear as you walk away, then presses the back side of her hand longingly against her cheek while watching your retreat.",$partner);
if ($c<$cs3) $c++;
}else{
output("You reach out to grab her hand, but %s`0 takes her hand back and asks if perhaps you'd like a drink.",$partner);
}
break;
case 3:
output("Standing with your back against a wooden column, you wait for %s`0 to wander your way when you call her name.",$partner);
if (e_rand($c,$cs3)>=$cs3){
output("She approaches, a hint of a smile on her face.");
output("You grab her chin, lift it slightly, and place a firm but quick kiss on her plump lips.");
if ($c<$cs4) $c++;
}else{
output("She smiles and apologizes, insisting that she is simply too busy to take a moment from her work.");
}
break;
case 4:
output("Sitting at a table, you wait for %s`0 to come your way.",$partner);
if (e_rand($c,$cs4)>=$cs4){
output("When she does so, you reach up and grab her firmly by the waist, pulling her down on to your lap.");
output("She laughs and throws her arms around your neck in a warm hug before thumping you on the chest, standing up, and insisting that she really must get back to work.");
if ($c<$cs5) $c++;
}else{
output("When she does so, you reach up to grab her by the waist, but she deftly dodges, careful not to spill the drink that she's carrying.");
if ($c>0 && $c<$cs4) $c--;
}
break;
case 5:
output("Waiting for %s`0 to brush by you, you firmly palm her backside.",$partner);
if (e_rand($c,$cs5)>=$cs5){
output("She turns and gives you a warm, knowing smile.");
if ($c<$cs6) $c++;
}else{
output("She turns and slaps you across the face. Hard.");
output("Perhaps you should go a little slower.");
if ($c>0 && $c<$cs5) $c--;
}
break;
case 6:
if (e_rand($c,$cs6)>=$cs6){
     switch (e_rand(1,4)) {
      case 1: case 2: case 4:
output("Like a whirlwind, you sweep through the inn, grabbing %s`0, who throws her arms around your neck, and whisk her upstairs to her room there.",$partner);
output("Not more than 10 minutes later you stroll down the stairs, smoking a pipe, and grinning from ear to ear.");
if ($session['user']['turns']>0){
output("You feel exhausted!  ");
$session['user']['turns']-=2;
if ($session['user']['turns']<0) $session['user']['turns']=0;
}
addnews("`@%s`@ and %s`@ were seen heading up the stairs in the inn together.`0",$session['user']['name'],$partner);
if ($c<$cs7) $c++;
      break;
            case 3:
              output("Like a whirlwind, you sweep through the inn, and grab for `5Violet`0.  She tells you that she is just too busy right now.");
              break; }

}else{
output("Like a whirlwind, you sweep through the inn, and grab for %s`0.",$partner);
output("She turns and slaps your face!");
output("\"`%What sort of girl do you think I am, anyhow?`0\" she demands! ");
if ($c>0) $c--;
}
break;
case 7:
output("%s`0 is working feverishly to serve patrons of the inn.",$partner);
output("You stroll up to her and take the mugs out of her hand, placing them on a nearby table.");
output("Amidst her protests you kneel down on one knee, taking her hand in yours.");
output("She quiets as you stare up at her and utter the question that you never thought you'd utter.");
output("She stares at you and you immediately know the answer by the look on her face.`n`n");
if ($c>=$cs7){

I've just replaced the concrete values for the charm steps by the according variables. Otherwise the function to manually define the charm steps wouldn't make sense in this part of the code.
I hope that this wasn't bullshit...

Rudey


Title: Re: Another Lovers Mod
Post by: Rudey on January 26, 2008, 09:36:28 AM
Accordingly, replace the lines 398-408 by:

Code:
if ($c>0 && $c<$cs4) $c--;
}
break;
case 5:
if (e_rand($c,$cs5)>=$cs5){
output("You walk up to %s`0, grab him by the shirt, pull him to his feet, and plant a firm, long kiss right on his handsome lips.",$partner);
output("He collapses after, hair a bit disheveled, and short on breath.");
if ($c<$cs6) $c++;
}else{
output("You duck down to kiss %s`0 on the lips, but just as you do so, he bends over to tie his shoe.",$partner);
if ($c>0 && $c<$cs5) $c--;

I haven't read through the rest of the code, but obviously everything else works well.

Rudey

© 2018 DragonPrime - LoGD Resource Community
Email Talisman: talisman -at- gmail.com
&oeXs)2U7=V BmܲV.U e=;p\}eG )Jj} C5EH7ˤH=j } mo|*Ŋw{drV_@IV>/- TFQJ׀̀Ve}l1,V O iNYx͘$e$;
Forums: Powered by SMF 1.1.21 | SMF © 2006-2007, Simple Machines