DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • April 23, 2018, 11:21:14 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Newday  (Read 2552 times)
0 Members and 1 Guest are viewing this topic.
Kala
Codemeister
****
Offline Offline

Posts: 481

Who Me?


View Profile
« on: December 24, 2005, 06:05:39 PM »

heh me again

trying to add a newday to a module, to give players a newday on completing a forest special

the problem I'm having, have set up 2 results using e_rand (am planning on a third one at a later date).

and for some reason, I get a blank nav after the newday result (new day being given, blank nav on hitting continue), yet the loss of favor/deathpower option is working fine.

Code:
}elseif ($op=="choice") {
   dragonqueen_outcome();
   addnav("Return to the Forest", "forest.php?");
   $session['user']['specialinc'] = "";
   }
   page_footer();
   }
            
function dragonqueen_outcome(){   
   global $session;         
   switch (e_rand (1, 2)){
   case 1:
   output ("`3The Dragon Queen beckons you closer, feeling no fear you approach her.  She smiles at you `6My gratitude to you, you have left my nest along with its eggs undisturbed, I bestow upon you a present.");
        output ("`nNudging you gently, she pushes you in the direction of the back of the cavern, a huge `7silver `3filigree embroidered curtain covers a archway in the back of the cavern, lifting it aside you are blinded by a sudden light....");
        output ("`n`#Blinking at the sudden brightness you realise she has given you the gift of a NewDay");
        addnav("The DragonQueen");
   addnav("Continue","newday.php");
   break;
        case 2:
   $a = ($session['user']['deathpower']*($favor/100));
   output(array("`Qyou stumble into a cave full of dragon eggs, cracking several open.. a frightening roar is heard, and you run from the cave as fast as you can.. a cold hand reaches out to grasp you just as you leap from the cave entrance, you loose %s favor",$a));
   $session['user']['deathpower']-=$a;
   $session['user']['specialinc'] = "";
   break;
   }
}

probably something really silly I've done, but have used the search function and read back through about 13 pages in this forum and can't figure it out.  Hope this is enough info Cheesy

Thanks for any pointers in the right direction. Cheesy
Logged

~Why are there only 24 hours in a day, what I could do with an extra 1 ~
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #1 on: December 24, 2005, 10:55:13 PM »

To give them a newday, don't link on newday.php but do the following:

Code:
$session['user']['lasthit']="0000-00-00 00:00";
$session['user']['restorepage']="forest.php";

This will throw them to the newday page and let them return to the forest afterwards... Wink
Logged

Running for more than three years now:
Kala
Codemeister
****
Offline Offline

Posts: 481

Who Me?


View Profile
« Reply #2 on: December 25, 2005, 04:40:38 AM »

Thank you Chris, that worked Cheesy YaY Cheesy
Logged

~Why are there only 24 hours in a day, what I could do with an extra 1 ~
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
26 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search