浏览代码

唤灵师经验公式

cyzhao 3 年之前
父节点
当前提交
6c99cfa2fd
共有 1 个文件被更改,包括 21 次插入1 次删除
  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);
         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();