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

Pages: [1] 2 3 4   Go Down
  Print  
Author Topic: Flawless Reward Cap  (Read 14708 times)
0 Members and 1 Guest are viewing this topic.
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« on: May 13, 2005, 04:05:16 PM »

http://dragonprime.net/users/sixf00t4/flawlesscap.zip

Allows you to set a max amount of times that players will receive a turn for flawless victories.  This requires some core changes until the next version is released.  Thanks to Kendaer and XChrisX.

in lib/forestoutcomes.php at link 50 add:
Code:
if (!$denyflawless && isset($badguy['denyflawless']) && $badguy['denyflawless'])
            $denyflawless = $badguy['denyflawless'];

in battle.php at line 268 replace:
Code:
   if ($victory) modulehook("battle-victory",$badguy);
   if ($defeat) modulehook("battle-defeat",$badguy);

with:
Code:
if ($victory) $badguy = modulehook("battle-victory",$badguy);
if ($defeat) $badguy = modulehook("battle-defeat",$badguy);
Logged

RPGSL
Guest
« Reply #1 on: May 13, 2005, 04:50:46 PM »

Installed as detailed and the cap does work, but there is a superficial error that shows after you reach the cap and get additional flawless fights.

Quote
~~ Flawless Fight! ~~
1
[/b][/color]

The number one always shows under the "Flawless Fight!" text.
Logged
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #2 on: May 13, 2005, 05:03:52 PM »

ah, i'll have to check with Kendaer on it's purpose, but for now, just comment out lines 52 and 53.

Code:
      //if ($denyflawless){
      //   output("`c`\$%s`0`c", translate_inline($denyflawless));
Logged

XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #3 on: May 14, 2005, 12:57:38 AM »

You have to set $args['denyflawless'] to the message you want to show... It's no boolean value...

It checks whether you have a message or not...
Logged

Running for more than three years now:
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #4 on: May 14, 2005, 06:21:53 AM »

ah, that was my first solution to it, but then i remembered, line 10 in forestoutcomes.php

Code:
function forestvictory($badguy,$denyflawless=false){

so i thought it best to keep it boolean.  as well as Kendaer just telling me to set it to 1 in the other thread.
Logged

sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #5 on: June 10, 2005, 10:31:04 PM »

hmmm...for some reason, flawless fights are being rewarded in city travel...ideas on how to prevent that?
Logged

Kendaer
Guest
« Reply #6 on: June 13, 2005, 10:29:08 AM »

Check if the type of the fight is 'travel' ($args['type'] == 'travel') and if so, don't reward.

« Last Edit: June 13, 2005, 10:30:02 AM by Kendaer » Logged
SpaceDoG
Guest
« Reply #7 on: June 16, 2005, 02:09:04 PM »

I just did this to fix the output thing of 1.
Quote
if ($denyflawless != 1) {
        output("`c`b`&~~ Flawless Fight! ~~`0`b`c");
        if ($denyflawless) {
            output("`c`\$%s`0`c", translate_inline($denyflawless));
        }elseif ($session['user']['level']>=getsetting("lowslumlevel",4) || $session['user']['level']<=$creaturelevel){
            output("`c`b`\$You receive an extra turn!`0`b`c`n");
            $session['user']['turns']++;
        }
Logged
SaucyWench
Mod God
*****
Offline Offline

Posts: 2238


I'm a good girl.


View Profile WWW
« Reply #8 on: July 24, 2005, 10:02:38 AM »

ah, i'll have to check with Kendaer on it's purpose, but for now, just comment out lines 52 and 53.

Code:
     //if ($denyflawless){
      //   output("`c`\$%s`0`c", translate_inline($denyflawless));

Let me explain... you either set a message or it's set off. That will give one of two values for $denyflawless:

"You would have received an extra fight, but you've had too many today"

OR

"" which is an empty string. A nothing.

The code you quoted there says, "If there is some text in there, then print it." If the setting is off, it does not print anything on the screen. The setting of
Code:
function forestvictory($badguy,$denyflawless=false){
is to effectively remove anything from the variable (that is, it becomes a nothing).

If you want it boolean you would also need a seperate value for the message and have translate_inline($denyflawlesstext) instead.

Does it make sense now?
« Last Edit: July 24, 2005, 10:06:37 AM by SaucyWench » Logged

SaucyWench
Owner of GemDust.com and Darton City proudly hosted by LunarPages
kickme
Global Moderator
Mod God
*****
Offline Offline

Posts: 1589


Yay for elephants!


View Profile WWW
« Reply #9 on: March 03, 2006, 11:05:16 AM »

You use short opening tags.

Could you please replace the <? with <?php ?
Logged

Waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka
Ernesto
Captain of the Guard
***
Offline Offline

Posts: 115


View Profile WWW
« Reply #10 on: November 09, 2006, 01:41:48 AM »

Have any fix for this?

(World Map - Revised)
Quote
I think the travel should stay pretty much as it is, however, if you fight while on a journey now and get a flawless fight you will get an extra turn, even if you have allready gotten the max ammount of extra turns from forest fights..

So my suggestion is to remove the extra turns from Journey fights..if that is possible.
Logged

kickme
Global Moderator
Mod God
*****
Offline Offline

Posts: 1589


Yay for elephants!


View Profile WWW
« Reply #11 on: January 17, 2007, 11:45:04 PM »

The version in 1.1.1 still uses short opening tags
Logged

Waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka
Powermogri
Militia
**
Offline Offline

Posts: 42



View Profile
« Reply #12 on: June 13, 2007, 11:26:36 PM »

I am using the Cap in the Coreset, on my v1.1.1 Server.
But it just do not work.

No Errormessage, no crash, it simply tp not work.

I tryed out a few things now.. wothout results. -_-
Logged
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #13 on: June 14, 2007, 12:16:52 AM »

Do you use the updated version? (Redownload the core module package. Several files from 1.1.0 will not work properly with 1.1.1 ...)
Logged

Running for more than three years now:
Powermogri
Militia
**
Offline Offline

Posts: 42



View Profile
« Reply #14 on: June 14, 2007, 12:25:35 PM »

Do you use the updated version? (Redownload the core module package. Several files from 1.1.0 will not work properly with 1.1.1 ...)

I should have the latest version, i just downloaded lotgd v1.1.1 and the Core Modules yesterday.

My Server is still not a running game, i am still preaparing everything.
Logged
Pages: [1] 2 3 4   Go Up
  Print  
 
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
29 Guests, 1 User
Anharat
Home Forums News Downloads Login Register Advanced Search