Jump to content

function experience


grant09

Recommended Posts

//level 2 - 500

 

//level 3 - 1500

 

//level 4 - 3500

 

//level 5 - 6000

 

 

 

 

 

function experience($L) {

  return $L * 495;

}

 

function Get_The_Level($exp) {

  return floor($exp / 495) + 60;

}

 

 

function Get_Max_Exp($L){

 

$end=0;

 

if ($exp == 0){

 

return 0;

 

$end =1;

 

  }

 

for($L=1;($L<1000 && $end==0);$L++) {

 

  $exp = experience($L);

 

  //echo $exp;

 

  if ($exp >= $user_class->exp){

 

return $exp;

 

$end=1;

 

  }

 

}

 

}

 

cant get over level 70 can any one help to get it like

 

level 1=200

level 2 =400

level 3= 600

and so on

any help

 

 

Link to comment
https://forums.phpfreaks.com/topic/225343-function-experience/
Share on other sites

define('EXP_MODIFIER', 200);

function getExperience($level) {
    if($level > 70) $level = 70;
    return $level * EXP_MODIFIER;
}

function getLevel($experience) {
    if($experience < 0) $experience = 0;
    return ceil($experience / 200);
}

 

What should getMaxExperience() do? You are going to have to tell us some details about these functions and what you want them to do.

Link to comment
https://forums.phpfreaks.com/topic/225343-function-experience/#findComment-1163735
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.