HP/MP/EXP-Hack

Du hast Probleme beim Einbau oder bei der Benutzung eines Mods? In diesem Forum bist du richtig.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Gast

Beitrag von Gast »

wegen dem MP

im meinem board funktioniert das mp bei admins und moderatoren auch nicht , bei allen anderen Users funktioniert es. Ist das im demfall normal?

gruss peter
Benutzeravatar
Firestarter
Mitglied
Beiträge: 1162
Registriert: 09.06.2003 15:21

Beitrag von Firestarter »

das versuche ich auch gerade mal herauszufinden, wo der Fehler liegt!^^
Gast

Beitrag von Gast »

habe leider auch noch nichts gefunden
Benutzeravatar
Firestarter
Mitglied
Beiträge: 1162
Registriert: 09.06.2003 15:21

Beitrag von Firestarter »

*schubs*

hab immer noch das Problem, das MP-Zeile bei Admins und Mods nicht richtig angezeigt wird, hat einer von euch eine Idee dazu woran es liegen kann?
Benutzeravatar
Firestarter
Mitglied
Beiträge: 1162
Registriert: 09.06.2003 15:21

Beitrag von Firestarter »

*hoppla* Bitte hilft mir,ich kann doch nicht der einzige sein, bei dem es nur so angezeigt wird?
AWSW
Ehemaliges Teammitglied
Beiträge: 3365
Registriert: 26.05.2002 12:20

Beitrag von AWSW »

LEIDER DAUERHAFT OFFLINE & Ich beantworte keine Fragen zu phpBB per Mail oder PN !
Hinweis: awsw.de ist nun dauerhaft offline. Die MODs könnt Ihr hier in der Datenbank finden.
Bitte keine Anfragen senden, ob ich die MODs anderweitig senden kann - es geht nicht - Danke für Euer Verständnis !
Benutzeravatar
doctormord
Mitglied
Beiträge: 152
Registriert: 27.04.2003 16:11

Beitrag von doctormord »

das problem hatte ich auch mal und auch einen work-around eingebaut. der wurde mal auf phpbb.com gepostet. die berechnung von mp is buggy und wird durch eine andere ersetzt.

Code: Alles auswählen

/* Determine MP
 *
 * MP is calculated by how long the user has been around
 * and how often they post.
 *
 * Max MP is based on level, and increases with level
 * Each post a user makes costs them mp,
 * and a user regenerates mp proportional to how
 * many days they have been registered
 *
 */

//Number of days the user has been at the forums.
$level_user_days = max(1, round( ( time() - $postrow[$i]['user_regdate'] ) / 86400 ));

/* The mp cost for one post.
 * Raising this value will generally decrease the current
 * mp for most posters.
 * This may be set to a decimal value (eg, 2, 2.1, 3.141596)
 * This should NOT be set to 0
 */
$level_post_mp_cost = 2.5;

/* This determines how much mp a user regenerates per day
 * Raising this value will generally increase the current
 * mp for most posters.
 * This may be set to a decimal value (eg, 3, 3.5, 2.71828)
 * This should NOT be set to 0
 */
$level_mp_regen_per_day = 4;

if($level_level < 1)
{
        $level_mp = '0 / 0';
        $level_mp_percent = 0;
}
else
{
        $level_max_mp = floor( (pow( $level_level, (1/4) ) ) * (pow( 10, pow( $level_level+2, (1/3) ) ) ) / (pi()) );

        $level_mp_cost = $postrow[$i]['user_posts'] * $level_post_mp_cost;
        $level_mp_regen = max(1, $level_user_days * $level_mp_regen_per_day);

        $level_cur_mp = floor($level_max_mp - $level_mp_cost + $level_mp_regen);
        $level_cur_mp = max(0, $level_cur_mp);
        $level_cur_mp = min($level_max_mp, $level_cur_mp);

        $level_mp = $level_cur_mp . ' / ' . $level_max_mp;
        $level_mp_percent = floor($level_cur_mp / $level_max_mp * 100 );

}
ka ob das jetzt die gefixte version oder die original version ist, hab ich in einem älteren backup gefunden.

mfg

doc
Zensiert
Benutzeravatar
Ratte
Mitglied
Beiträge: 621
Registriert: 18.06.2003 13:47
Wohnort: Nbg
Kontaktdaten:

Beitrag von Ratte »

Hab irgendnen fehler in meiner viewtopic.php
kann mal einer neischaun??
hier der link zur TXT

des stand in der anleitung:

Code: Alles auswählen

#-----[ OPEN ]------------------------------------------ 
# 

./viewtopic.php

# 
#-----[ FIND ]------------------------------------------ 
# 

$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

/* Begin HP/MP/EXP Mod
 *
 * Note: all new variables used created in this mod
 * are prefixed with level_ to be sure of not overwriting
 * other variables.
 *
 */
 
/* Calculate Level
 * A user's level is determined by their total number of posts.
 * A nice mathmatical formula is used to translate their post count
 * into an intager level.
 *
 * Note: A user with zero (0) posts is considered level 0, however
 * making one (1) post, raises them to level 1.
 *
 */

if($postrow[$i]['user_posts'] < 1)
{
	$level_level = 0;
}
else
{
	$level_level = floor( pow( log10( $postrow[$i]['user_posts'] ), 3 ) ) + 1;
}

/* Determine Hit Points (HP)
 * 
 * Hp is based on user activity.
 * Max HP is based on the user's level, and will generally
 * be the same for all users of the same level.
 *
 * A user's current HP is based on the user's posts per day.
 * A higher post per day (ppd), the more HP they will have. A 
 * user with an average PPD (set below) will have 50% of their 
 * max HP. As a user goes over the average PPD, they will have 
 * more HP, but the gains will decrease as the user's PPD increases.
 * This makes achieving 100% hp difficult, but not impossible.
 *
 * For users with under the average PPD, they will have HP equal
 * to 1/2 the percentage their ppd is of the average.
 * ie- a user with 2.5 ppd, and an average ppd of 5 will have
 * 25% of their max HP. This is because 2.5 is 50% of 5, and 1/2
 * of that, is 25%.
 *
 * Users who manage to post so far above the average that they have
 * more HP than their max will recieve a bonus to their max HP.
 *
 * Note that users at level 0 will always have 0 / 0 hp.
 *
 */

/*
 * This value determines the 'average' posts per day.
 * The admin may redefine this variable as he wishes. 
 * Higher values will generally decrease users' HP, and
 * lower values will generally increase users' HP.
 *
 * Note: Do NOT set this value to zero (0).
 * This -may- be set to a fractional value (eg, 5.1, 3.1415)
 *
 */

$level_avg_ppd = 5;

/* 
 * this value sets how hard it is to achieve 100%
 * hp. The higher you set it, the harder it is to
 * get full hp.
 *
 * to judge how high to set it, a user must have
 * posts per day equal to the $level_avg_ppd plus
 * the number set below.
 * 
 * This should NOT be zero.
 */
 
$level_bonus_redux = 5;

/*
 * We need to actually calculate the user's posts per day
 * because unlike in the profile, it's not done for us.
 *
 */
$level_user_ppd = ($postrow[$i]['user_posts'] / max(1, round( ( time() - $postrow[$i]['user_regdate'] ) / 86400 )));

if($level_level < 1)
{
	$level_hp = "0 / 0";
	$level_hp_percent = 0;
}
else
{
	$level_max_hp = floor( (pow( $level_level, (1/4) ) ) * (pow( 10, pow( $level_level+2, (1/3) ) ) ) / (1.5) );

	if($level_user_ppd >= $level_avg_ppd)
	{
		$level_hp_percent = floor( (.5 + (($level_user_ppd - $level_avg_ppd) / ($level_bonus_redux * 2)) ) * 100);
	}
	else
	{
		$level_hp_percent = floor( $level_user_ppd / ($level_avg_ppd / 50) );
	}
	
	if($level_hp_percent > 100)
	{
		//Give the user a bonus to max HP for greater than 100% hp.
		$level_max_hp += floor( ($level_hp_percent - 100) * pi() );
		$level_hp_percent = 100;
	}
	else
	{
		$level_hp_percent = max(0, $level_hp_percent);
	}
	
	$level_cur_hp = floor($level_max_hp * ($level_hp_percent / 100) );
	
	//Be sure a user has no more than max, and no less than zero hp.
	$level_cur_hp = max(0, $level_cur_hp);
	$level_cur_hp = min($level_max_hp, $level_cur_hp);
	
	$level_hp = $level_cur_hp . ' / ' . $level_max_hp;
}

/* Determine MP
 * 
 * MP is calculated by how long the user has been around
 * and how often they post.
 * 
 * Max MP is based on level, and increases with level
 * Each post a user makes costs them mp,
 * and a user regenerates mp proportional to how
 * many days they have been registered
 *
 */
 
//Number of days the user has been at the forums.
$level_user_days = max(1, round( ( time() - $postrow[$i]['user_regdate'] ) / 86400 ));

/* The mp cost for one post.
 * Raising this value will generally decrease the current
 * mp for most posters.
 * This may be set to a decimal value (eg, 2, 2.1, 3.141596)
 * This should NOT be set to 0
 */
$level_post_mp_cost = 2.5;

/* This determines how much mp a user regenerates per day
 * Raising this value will generally increase the current
 * mp for most posters.
 * This may be set to a decimal value (eg, 3, 3.5, 2.71828)
 * This should NOT be set to 0
 */
$level_mp_regen_per_day = 4;

if($level_level < 1)
{
	$level_mp = '0 / 0';
	$level_mp_percent = 0;
}
else
{
	$level_max_mp = floor( (pow( $level_level, (1/4) ) ) * (pow( 10, pow( $level_level+2, (1/3) ) ) ) / (pi()) );
	
	$level_mp_cost = $postrow[$i]['user_posts'] * $level_post_mp_cost;
	$level_mp_regen = max(1, $level_user_days * $level_mp_regen_per_day);
	
	$level_cur_mp = floor($level_max_mp - $level_mp_cost + $level_mp_regen);
	$level_cur_mp = max(0, $level_cur_mp);
	$level_cur_mp = min($level_max_mp, $level_cur_mp);
	
	$level_mp = $level_cur_mp . ' / ' . $level_max_mp;
	$level_mp_percent = floor($level_cur_mp / $level_max_mp * 100 );
	
}

/* Determine EXP percentage
 *
 * Experience is determined by how far the user is away
 * from the next level. This is expressed as a percentage.
 * 
 * Note, a user of level 0 has 100% experience. Making one post
 * will put them at level 1. Also, a user that is shown to have 100%
 * experience, will go up a level on their next post.
 *
 */

if($level_level == 0)
{
	$level_exp = "0 / 0";
	$level_exp_percent = 100;
}
else
{
	$level_posts_for_next = floor( pow( 10, pow( $level_level, (1/3) ) ) );
	

	$level_posts_for_this = max(1, floor( pow( 10, pow( ($level_level - 1), (1/3) ) ) ) );
	

	
	$level_exp = ($postrow[$i]['user_posts'] - $level_posts_for_this) . " / " . ($level_posts_for_next - $level_posts_for_this);
	
	$level_exp_percent = floor( ( ($postrow[$i]['user_posts'] - $level_posts_for_this) / max( 1, ($level_posts_for_next - $level_posts_for_this ) ) ) * 100);
}

/* END HP/MP/EXP MOD */

Benutzeravatar
Dan
Mitglied
Beiträge: 139
Registriert: 31.05.2003 12:27

Beitrag von Dan »

hi

ok wegen dem problem mit dem MP habe ich mal den autor selber nach rat gefragt und folgendes hat er mir mittgeteilt.

do you mean that Mods and Admin have their HP and MP measured the same way as the users, and do not gain anything special? That's the way it's written right now.

I've updated this slightly, I consolidated the sql statements from two queries into a single query. A minor efficiancy boost probably, but it also makes it a bit easier to work with for me.

I've also done some looking into Q-Zar's problem, and I'm stumped, it's not any of hte mods you have installed, because I tried installing them, and my mod worked fine. Its got to be a problem with the sql statements, but I'm not sure what, or why. It's hard for me to try and fix it, because I can't reproduce the problem



kann mir das eventuell jemand übersetzten

danke gruss dan
Gast

Beitrag von Gast »

frei übersetzt nach: http://translation.lycos.com/lycos
bedeuten Sie, daß Mods und Admin ihr HP und Wartungstafel die gleiche
Weise wie die Benutzer gemessen haben, und gewinnen nicht spezielles
alles? Die ist die Weise, die es im Augenblick geschrieben wird.

Ich habe dieses etwas, ich vereinigte die sql Aussagen von zwei Fragen
in eine einzelne Frage aktualisiert. Eine kleine efficiancy Erhöhung
vermutlich, aber es auch Marken es ein wenig einfacher, mit für mir
zu arbeiten.

Ich habe auch einiges getan, das in Problem Q-Zars schaut, und ich bin
stumped, ist es nicht irgendwelche von hte mods, die Sie angebracht
haben, weil ich versuchte, sie anzubringen und mein Umb. adaequatWAR.
Seine erhalten, um ein Problem mit den sql Aussagen zu sein, aber ich
sind nicht sicher, was oder warum. Es ist hart für mich, ihn zu
versuchen und zu regeln, weil ich nicht das Problem reproduzieren
kann
Antworten

Zurück zu „phpBB 2.0: Mod Support“