Author Topic: Experience Calculator  (Read 5215 times)

0 Members and 1 Guest are viewing this topic.

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Experience Calculator
« on: January 19, 2007, 05:50:01 pm »
http://www.joetheodd.com/random/xp.php

I don't garauntee it to be correct, but of course I'm not coming right out and saying it'll always be wrong, either. As you'll see from my comment at the top, I don't claim full credit.

Code: [Select]
<?PHP
/*************************
* Mob Level Calculator   *
* Function from WoWWiki  *
* Wrapper by Joe[x86]    *
*************************/
?>

<HTML>
<HEAD>
<TITLE>Experience Calculator</TITLE>
</HEAD>

<BODY>
<?PHP
if (array_key_exists('charLevel', $_POST) && array_key_exists('mobLevel', $_POST))
{
echo("At level " . $_POST['charLevel'] . " you will receive " . calculateXP($_POST['charLevel'], $_POST['mobLevel'], $_POST['elite'], $_POST['rested']) .
" experience from fighting a " . $_POST['mobLevel'] . " mob (elite: " . $_POST['elite'] . ").");
}
?>
<FORM METHOD="POST" ACTION="<?PHP echo($_SERVER['PHP_SELF']); ?>">
<TABLE><TBODY>
<TR><TD>Character Level:</TD> <TD><INPUT NAME="charLevel" TYPE="text" /></TD></TR>
<TR><TD>Mob Level:</TD>       <TD><INPUT NAME="mobLevel"  TYPE="text" /></TD></TR>
<TR><TD>Elite:</TD>           <TD><INPUT NAME="elite"     TYPE="checkbox" /></TD></TR>
<INPUT TYPE="SUBMIT" NAME="Calculate Experience" />
</TBODY></TABLE>
</FORM>
</BODY>
</HTML>

<?PHP

function calculateXP($playerlevel, $moblevel, $elite, $rested = false)
{
if($playerlevel < $moblevel)
{
if($moblevel - $playerlevel > 4)
$moblevel = $playerlevel + 4;
$xp = ($playerlevel * 5 + 45) * (1 + 0.05 * ($moblevel - $playerlevel));
}
elseif($playerlevel == $moblevel)
{
$xp = $playerlevel * 5 + 45;
}
elseif($playerlevel > $moblevel)
{
if($moblevel <= calculateGrayLevel($playerlevel))
$xp = 0;
else
{
if($playerlevel >= 1 && $playerlevel <= 7)
$zd = 5;
elseif($playerlevel >= 8 && $playerlevel <= 9)
$zd = 6;
elseif($playerlevel >= 10 && $playerlevel <= 11)
$zd = 7;
elseif($playerlevel >= 12 && $playerlevel <= 15)
$zd = 8;
elseif($playerlevel >= 16 && $playerlevel <= 19)
$zd = 9;
elseif($playerlevel >= 20 && $playerlevel <= 29)
$zd = 11;
elseif($playerlevel >= 30 && $playerlevel <= 39)
$zd = 12;
elseif($playerlevel >= 40 && $playerlevel <= 44)
$zd = 13;
elseif($playerlevel >= 45 && $playerlevel <= 49)
$zd = 14;
elseif($playerlevel >= 50 && $playerlevel <= 54)
$zd = 15;
elseif($playerlevel >= 55 && $playerlevel <= 59)
$zd = 16;
elseif($playerlevel == 60)
$zd = 17;
$xp = ($playerlevel * 5 + 45) * (1 - ($playerlevel - $moblevel) / $zd);
}
}
if($elite == true)
$xp *= 2;
if($rested == true)
$xp *= 2;
return round($xp);
}

/**
function calculateGrayLevel($playerlevel)
{
if($playerlevel >= 1 && $playerlevel <= 5)
return 0;
elseif($playerlevel >= 6 && $playerlevel <= 39)
return $playerlevel - 5 - floor($playerlevel / 10);
elseif($playerlevel >= 40 && $playerlevel <= 60)
return $playerlevel - 1 - floor($playerlevel / 5);
}
function calculateDifficulty($playerlevel, $moblevel)
{
$leveldiff = $moblevel - $playerlevel;
if($moblevel <= calculateGrayLevel($playerlevel))
return 'Gray';
else
{
if($leveldiff >= 5)
return 'Red';
elseif($leveldiff >= 3 && $leveldiff <= 4)
return 'Orange';
elseif($leveldiff >= -2 && $leveldiff <= 2)
return 'Yello';
elseif($leveldiff <= -3)
return 'Green';
}
}
*/
?>
« Last Edit: May 30, 2007, 03:18:24 pm by Joe[x86/64] »
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline kalaka

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Experience Calculator
« Reply #1 on: January 28, 2007, 03:15:00 pm »
Looks like a good tool. I'm getting this error though:
Code: [Select]
Fatal error: Call to undefined function calculateGrayLevel() in /home/joe/public_html/xp.php on line 49

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: Experience Calculator
« Reply #2 on: January 28, 2007, 03:37:46 pm »
Fixed, I think.
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline warz

  • Hero Member
  • *****
  • Posts: 1134
    • View Profile
    • chyea.org
Re: Experience Calculator
« Reply #3 on: January 28, 2007, 07:31:46 pm »
so, the function is from wowwiki, and the html form is yours? i dont think you can claim any credit :p
http://www.chyea.org/ - web based markup debugger

Offline kalaka

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Experience Calculator
« Reply #4 on: January 29, 2007, 07:15:29 pm »
How about you do a number of characters and number of monsters thing, which could be set all at different levels. If you do that a friend of mine could make an add-on, I think

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Experience Calculator
« Reply #5 on: January 29, 2007, 07:30:38 pm »
It would be a trivial task (in php, lua (wow addon), javascript, whatever).  I'm pretty sure all of the equations are on wowwiki.

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: Experience Calculator
« Reply #6 on: January 30, 2007, 09:49:51 pm »
so, the function is from wowwiki, and the html form is yours? i dont think you can claim any credit :p

I had to write PHP to make sure it called the function correctly! :P
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline ZeroX

  • Hero Member
  • *****
  • Posts: 1933
  • Pirating Your software since 1998
    • View Profile
    • Crap
Re: Experience Calculator
« Reply #7 on: February 07, 2007, 12:11:18 am »
Quote
At level 1 you will receive 120 experience from fighting a 60 mob (elite: on).

How do you figure that?
Zeroforce
Zeroforce
Zeroforce





Quote
mutsumibear: David's coming over Sunday so we can have mad sex all day.
zxdropoff: lucky you
mutsumibear: :D I know.
mutsumibear: I just pray I don't start my period before then.
zxdropoff: omfg
zxdropoff: stfu
zxdropoff: now please
mutsumibear: HAHA
mutsumibear: I love disturbing you.

Offline Blaze

  • Moderator
  • Hero Member
  • *****
  • Posts: 7136
  • Canadian
    • View Profile
    • Maide
Re: Experience Calculator
« Reply #8 on: February 07, 2007, 01:24:07 am »
Quote
At level 1 you will receive 120 experience from fighting a 60 mob (elite: on).

How do you figure that?

At level 1 you will receive 120 experience from fighting a 70 mob (elite: on).
And like a fool I believed myself, and thought I was somebody else...

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: Experience Calculator
« Reply #9 on: February 07, 2007, 03:40:55 am »
Yeah. You don't get any more benefit from killing a 70 elite than you would a level 6 elite, if you're level 1. Blizzard got tired of you damn power-levelers and reflected it in their algorithm (read the code).

I assure you they actually did that. If you can find a way to aggro a level 60 mob at level 1, tap it, and then have a buddy kill it (without you dying in the process), I assure you that it will give you 120 experience.
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Omen

  • Newbie
  • *
  • Posts: 92
  • kill to believe..
    • View Profile
    • Dark 0men
Re: Experience Calculator
« Reply #10 on: February 08, 2007, 08:54:20 am »
Run with a priest and get shielded when they come near you so there might be a chance he catches the aggo.
- Omen of The Order
- Priest of Dark Elements

Offline Krazed

  • x86
  • Hero Member
  • *****
  • Posts: 1822
    • View Profile
Re: Experience Calculator
« Reply #11 on: February 08, 2007, 09:15:39 am »
Any ranged magic creature. Greater Fire/Shadow/Frost/Nature protection potion ftw.
It is good to be good, but it is better to be lucky.

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: Experience Calculator
« Reply #12 on: February 16, 2007, 04:57:51 pm »
Any ranged magic creature. Greater Fire/Shadow/Frost/Nature protection potion ftw.

Requires level 45.

Run with a priest and get shielded when they come near you so there might be a chance he catches the aggo.

Any level 60 elite could bash through Power Word: Shield rank 1 easily. Each rank has a minimum target level.
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline ZeroX

  • Hero Member
  • *****
  • Posts: 1933
  • Pirating Your software since 1998
    • View Profile
    • Crap
Re: Experience Calculator
« Reply #13 on: February 22, 2007, 04:36:32 pm »
Any ranged magic creature. Greater Fire/Shadow/Frost/Nature protection potion ftw.

Requires level 45.

Run with a priest and get shielded when they come near you so there might be a chance he catches the aggo.

Any level 60 elite could bash through Power Word: Shield rank 1 easily. Each rank has a minimum target level.

Roll a mage. Get a warlock to summon you to like the tainted scar or something. Run close to a 60 elite mob and then hit it with your rank 1 bullshit that you get. As he runs towards you have a warrior Charge the dude and there you go you taped him =].
« Last Edit: February 23, 2007, 06:19:55 am by Joe[x86] »
Zeroforce
Zeroforce
Zeroforce





Quote
mutsumibear: David's coming over Sunday so we can have mad sex all day.
zxdropoff: lucky you
mutsumibear: :D I know.
mutsumibear: I just pray I don't start my period before then.
zxdropoff: omfg
zxdropoff: stfu
zxdropoff: now please
mutsumibear: HAHA
mutsumibear: I love disturbing you.

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: Experience Calculator
« Reply #14 on: February 23, 2007, 06:20:30 am »
A level 1 mage would aggro the entire tainted scar from Nethergarde Keep, lol.

By the way, you totally fux0vered your quote. I fixed it for you.
I'd personally do as Joe suggests

You might be right about that, Joe.