Skip to content

Instantly share code, notes, and snippets.

@aaei924
Created July 30, 2021 01:39
Show Gist options
  • Save aaei924/437dd3873c6dbe4961ed35a1e3845ed8 to your computer and use it in GitHub Desktop.
Save aaei924/437dd3873c6dbe4961ed35a1e3845ed8 to your computer and use it in GitHub Desktop.
HKDev 경험치 계산 함수
<?php
class HKDev{
public static function getTargetExp(int $lv){
return $lv * $lv + 5;
}
public static function getArrExp(int $lv, int $currentExp=0){
return 1 / 6 * $lv * (2 * $lv * $lv -(3 * $lv) + 31) + $currentExp;
}
public static function getLevel(int $exp){
$f = pow(sqrt(3) * sqrt(3888 * $exp * $exp -(19440 * $exp) + 229679) - (108 * $exp) + 270, 1/3);
return floor(-$f / (2 * pow(9,1/3)) + 59 / (2 * pow(3, 1/3) * $f) + 0.5);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment