SoD HP/Mana/End Calculations
I posted a few changes to allow CharBrowser to use the new SoD client calculations. For some reason, I still can't get the code tags on this forum to show all of my code (it tends to cut off before -> or randomly at a $), so I submitted it there if anyone wants to use it.
http://www.eqemulator.org/forums/showpost.php?p=193814&postcount=2
Sat Oct 30, 2010 1:09 pm
Can you post the chunk that is causing errors on the boards, I'll look into it.
Sat Oct 30, 2010 1:53 pm
Project Lead
From my post on Bots, this is all that comes in for /searchbots.php. It cuts off everything before the arrow in $template->set_filenames(array()). I had this problem with any section that contained the -> in it.
and in this submission, it cut out half of GetMaxHP, but everything else was fine:
it cut this out:
else if ($mlevel < 81) {
$base_hp = (5 + (40 * hp_factor / 12) + (($mlevel - 40) * $hp_factor / 6) +
(($sta- $SoDPost255) * $hp_factor / 90) +
(($sta- $SoDPost255) * ($mlevel - 40) * $hp_factor / 1800));
}
else {
$base_hp = (5 + (80 * $hp_factor / 8) + (($mlevel - 80) * $hp_factor / 10) +
(($sta- $SoDPost255) * $hp_factor / 90) +
(($sta- $SoDPost255) * $hp_factor / 45));
}
$base_hp += $ihp;
}
else
{
$lm = GetClassLevelFactor($mlevel,$class);
$Post255 = 0;
php
and in this submission, it cut out half of GetMaxHP, but everything else was fine:
php
it cut this out:
else if ($mlevel < 81) {
$base_hp = (5 + (40 * hp_factor / 12) + (($mlevel - 40) * $hp_factor / 6) +
(($sta- $SoDPost255) * $hp_factor / 90) +
(($sta- $SoDPost255) * ($mlevel - 40) * $hp_factor / 1800));
}
else {
$base_hp = (5 + (80 * $hp_factor / 8) + (($mlevel - 80) * $hp_factor / 10) +
(($sta- $SoDPost255) * $hp_factor / 90) +
(($sta- $SoDPost255) * $hp_factor / 45));
}
$base_hp += $ihp;
}
else
{
$lm = GetClassLevelFactor($mlevel,$class);
$Post255 = 0;
Sat Oct 30, 2010 2:59 pm
I'll look in the DB when i get home and see if it's cutting it off during the posting or viewing. Hopefully I'll have it sorted out soon.
Sat Oct 30, 2010 3:15 pm
Project Lead
it's wrong in the database so its getting chopped off during posting, i'll do a quick walkthrough of the code to see if I can spot it
oh, in the top of your functions use
that will make the variable available at the function scope
oh, in the top of your functions use
php
that will make the variable available at the function scope
Last edited by Maudigan on Sun Dec 05, 2010 8:54 pm; edited 2 times in total
Sun Oct 31, 2010 8:31 am
Project Lead
Fixed, I traced it back to the HTML parser. Something in the default regex was detecting the less than 81, and the greater than 0 a few lines lower as an html tag... it turned that whole chunk of code into <81>. Instead of jacking around with phpbb's default regex I just disabled HTML on the boards. The only tag that was available was <center>, I'll just add some bbcode to use [center] in the future.
Edit: i forgot to mention, this was something I had planned on adding so i may merge this in when I do gaeorns security patch.
Edit: i forgot to mention, this was something I had planned on adding so i may merge this in when I do gaeorns security patch.
php
Last edited by Maudigan on Sun Dec 05, 2010 8:52 pm; edited 1 time in total
Sun Oct 31, 2010 9:35 am
Project Lead