DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • September 23, 2018, 05:52:28 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: New Day...fights  (Read 3006 times)
0 Members and 1 Guest are viewing this topic.
Odyssey
Guest
« 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.

Code:
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");
         $session['user']['turns']+=5;
         if ($session['user']['charm']<=0){
            output("`bWhen  you  wake  up, you find a note next to you, reading`n`5Dear ");
            output($session['user']['name']);
            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);
            $partner=$row[name];
            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){
               $session['user']['charisma']=0;
               $session['user']['marriedto']=0;
               $sql = "UPDATE accounts SET charisma=0,marriedto=0 WHERE acctid='$row[acctid]'";
               db_query($sql);
               systemmail($row['acctid'],"`\$Divorce!`0","`6You have left `&{$session['user']['name']}`6. Marriage wasn't what is was before.");
            }

         }
      }
Logged
lonnyl
Guest
« 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)
{
Logged
Odyssey
Guest
« 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.  

$session['user']['turns']+=5;

Logged
Excalibur
Member
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.  

$session['user']['turns']+=5;
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:
Code:
   $session['user']['turns'] = ($session['user']['bonusfight'] + $turnsperday + $spirits + $dkff);
After it add:
Code:
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.
anpera
Guest
« 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
Logged
Odyssey
Guest
« 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).

  So...

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

..and...

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
$session['user']['turns']+=5;
within the above block of code?

Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

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