Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /nfs/c01/h06/mnt/10927/domains/ : runtime-created function on line 3
New Day...fights
DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • September 17, 2019, 03:18:47 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Resource Pages

Pages: [1]   Go Down
Author Topic: New Day...fights  (Read 3532 times)
0 Members and 1 Guest are viewing this topic.
« on: June 22, 2004, 04:52:55 PM »

Why can't I get this to work?  This is the entire code block, but what I'm having trouble is with the 3 lines - the 'marriedto' part.  I have it to where the players can marry other players, so I want the >=1 to cover all players, including Seth and Violet.  Everytime I upload it like that, I get a parse error on those lines.

If I keep:

if ($session['user']['marriedto']==4294967295 || $session['user']['charisma']==4294967295){
Which is the original code, it works fine....but, the forest fights do not get added.  So, I've got two things wrong here.

if ($session['user']['marriedto']>=1
         output("`n`%Now that you are married, you realize that you have a family to provide for.  You get 5 extra forest fights for today.`n");
         if ($session['user']['charm']<=0){
            output("`bWhen  you  wake  up, you find a note next to you, reading`n`5Dear ");
            output("`5,`nDespite  many  great  kisses, I find that I'm simply no longer attracted to you the way I used to be.`n`n");
            output("Call  me fickle, call me flakey, but I need to move on.  There are other warriors in the village, and I think");
            output("some of them are really hot.  So it's not you, it's me, etcetera etceterea.");
            $sql = "SELECT name FROM accounts WHERE locked=0 AND acctid=".$session[user][marriedto]."";
              $result = db_query($sql) or die(db_error(LINK));
            $row = db_fetch_assoc($result);
            if ($partner=="") $partner = $session[user][sex]?"Seth":"Violet";
            output("`n`nNo hard feelings, Love, $partner`b`n");
            addnews("`\$$partner has left {$session['user']['name']}`\$ to pursue \"other interests.\"");
            if ($session['user']['marriedto']>=1) $session['user']['marriedto']=0;
            if ($session['user']['charisma']==4294967295){
               $sql = "UPDATE accounts SET charisma=0,marriedto=0 WHERE acctid='$row[acctid]'";
               systemmail($row['acctid'],"`\$Divorce!`0","`6You have left `&{$session['user']['name']}`6. Marriage wasn't what is was before.");

« Reply #1 on: June 22, 2004, 05:45:47 PM »

right off  I see

if ($session['user']['marriedto']>=1

Should be
if ($session['user']['marriedto']>=1)
« Reply #2 on: June 23, 2004, 04:09:58 AM »

Thanks for noticing that.

  Ok, I added in the missing ), and the code isn't breaking anymore.  I still can't get the Forest Fights to add in though.  


Mod God
Offline Offline

Posts: 573

I'm a newbie, plz forgive me!

View Profile WWW
« Reply #3 on: June 23, 2004, 04:51:35 AM »

I still can't get the Forest Fights to add in though.  

This happens because the calculation for the FF/day is made after the marriage question.

You need to add after the final statement regarding FF, so find this line:
   $session['user']['turns'] = ($session['user']['bonusfight'] + $turnsperday + $spirits + $dkff);
After it add:
if ($session[user][marriedto] > 0) $session['user']['turns']+=5;

That should work.

Rgds Excalibur

*** EDIT ***
I'd move the output about the FF gain about the marriage AFTER the check for divorce, else you'd get the message about the gain, then if you divorce you'll never get the 5 turns  Wink
« Last Edit: June 23, 2004, 04:56:28 AM by Excalibur » Logged

Spock: Random chance seems to have operated in our favor.
McCoy: In plain, non-Vulcan English, we've been lucky.
Spock: I believe I said that, Doctor.
« Reply #4 on: June 23, 2004, 06:22:29 AM »

Uh, this looks like my gardenflirt script. One little note for that: If if $session['user']['marriedto']>=1 is TRUE, this does NOT mean that two people are married!!

Here is what I use "marriedto" and "charisma" for:
  • marriedto>0, charisma<4294967295 : Player flirts with acctid in field marriedto, but they are NOT married yet.
  • marriedto = 4294967295 : Player is married to Violeth / Seth ('charisma' doesn't do anything in that case)
  • charisma = 4294967295 : Player is married to acctid in field marriedto.
So in your modification all players who flirtet at least once with another player would get +5 FF.

Just let the original
if ($session['user']['marriedto']==4294967295 || $session['user']['charisma']==4294967295){
in there, because it does cover all players, including Violet and Seth. And replace the
if ($session[user][marriedto] > 0)
in Excaliburs suggestion with
if ($session['user']['marriedto']==4294967295 || $session['user']['charisma']==4294967295) Wink
« Reply #5 on: June 23, 2004, 10:22:53 AM »

Yes, your garden flirt mod is installed.  However, players are getting married through the GreyStone Chapel mod.  The problem that I kept on getting with the Garden/Flirt, is that people would be married after only one flirt, and also that a character would be married to him/herself.

  I still have to code in there, but the flirt option is commented out.  Seth/Violet are the only ones you can flirt with.  You can marry either of them, and the other characters (through the Chapel).


if ($session['user']['marriedto']==4294967295 || $session['user']['charisma']==4294967295){


if ($session['user']['marriedto']==4294967295 || $session['user']['charisma']==4294967295)

...would still work in that situation?

And then as far as the FF...  I would still add in a
within the above block of code?

Pages: [1]   Go Up
Jump to:  

DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
88 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search