Browse Source

唤灵师经验公式

cyzhao 3 years ago
parent
commit
6c99cfa2fd
1 changed files with 21 additions and 1 deletions
  1. 21 1
      Gameserver/Amfphp/process/StoreProc.php

+ 21 - 1
Gameserver/Amfphp/process/StoreProc.php

@@ -112,7 +112,27 @@ class StoreProc {
         $mo = GameConfig::hero_getItem($mosterId);
         $mo = GameConfig::hero_getItem($mosterId);
         my_Assert($mo != null, ErrCode::err_const_no);
         my_Assert($mo != null, ErrCode::err_const_no);
         
         
-        $targetHero = HeroProc::HeroAddEXP($heroUID, $mo->exp);     
+        //经验修正率=1 + 0.05 × (怪物等级 - 角色(唤灵师)等级)
+        //角色所得经验 = 怪物经验 * 经验修正率
+        
+        $lv = substr($mo->heroId,-2);
+        $n = substr($lv,0,1);
+        if($n == 0){
+            $lv = substr($lv,1,1);
+        }
+        $collectHeros = $hero->collectHeros;
+        my_default_Obj($collectHeros);
+        my_Assert(CommUtil::isPropertyExists($collectHeros, $heroUID), ErrCode::hero_no); # 要升级的英雄不存在
+        $targetHero = new Ins_UserHero($collectHeros->$heroUID);                # 英雄对象
+        $heroLv = $targetHero->level;
+        $per = 1 + 0.05*($lv - $heroLv);
+                     
+        $totalExp = intval($mo->exp * $per);
+        if($totalExp<0){
+            $totalExp = 0;
+        }
+        
+        $targetHero = HeroProc::HeroAddEXP($heroUID,$totalExp);     
         
         
         UserProc::updateUserInfo();
         UserProc::updateUserInfo();