Prechádzať zdrojové kódy

唤灵师经验接口

cyzhao 3 rokov pred
rodič
commit
43c0a7d56c

+ 5 - 0
Gameserver/Amfphp/base/CmdCode.php

@@ -711,6 +711,11 @@ class CmdCode {
      */
     public const cmd_store_removeItem = 6437;
     
+    /*
+     * 击杀怪,唤灵师获得的信息加成,暂时是经验
+     */
+    public const cmd_store_killMosterAddData = 6438;
+    
 // </editor-fold>
     //
     // <editor-fold defaultstate="collapsed" desc="活动操作码 - 65xx">

+ 1 - 1
Gameserver/Amfphp/model/Const/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-05-11 15:09:27
+ // 日期: 2022-05-17 12:03:33
 ////////////////////
 
 /**

+ 6 - 1
Gameserver/Amfphp/model/Const/globalsettings.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-04-27 15:52:16
+ // 日期: 2022-05-16 14:24:14
 ////////////////////
 
 
@@ -495,5 +495,10 @@ class globalsettings
     */
     public $YaoPingAttrInitVal;
 
+    /**
+    * @var Object 每日任务等级限制解锁  
+    */
+    public $DailyTaskLevelLimitLock;
+
 }
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_gate_zone.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-04-28 11:45:07
+ // 日期: 2022-05-17 12:02:38
 ////////////////////
 
 

+ 6 - 1
Gameserver/Amfphp/model/Const/sm_hero.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-04-27 12:11:32
+ // 日期: 2022-05-16 17:42:46
 ////////////////////
 
 
@@ -368,5 +368,10 @@ class sm_hero
     */
     public $weak_phy;
 
+    /**
+    * @var String 唤灵师经验  
+    */
+    public $exp;
+
 }
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_base.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-05-09 15:05:19
+ // 日期: 2022-05-16 17:27:12
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_stones.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-12-21 14:42:33
+ // 日期: 2022-05-16 09:29:50
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_stones_type.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-12-21 14:42:33
+ // 日期: 2022-05-16 09:29:50
 ////////////////////
 
 

+ 7 - 0
Gameserver/Amfphp/model/User/Info_NewMap.php

@@ -71,6 +71,13 @@ class Info_NewMap extends Object_ext {
             $this->unlockedFootholds->$dixiachengId = $footHold; 
             
             
+            $dixiachengId = 503002;
+            $mo = GameConfig::gate_getItem($dixiachengId);
+            $footHold = new Ins_FootHold();
+            $footHold->mapId = $mo->gateId;
+            $footHold->curMapType = $mo->mapType;
+            $this->unlockedFootholds->$dixiachengId = $footHold;
+            
             $this->unlockMapTypeList = ObjectInit();                            #初始化--已经解锁的地图上的区域、npc、道具等等信息      
             $this->huichengquanRecord = ObjectInit();                                #                      
         } else {

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

@@ -91,13 +91,35 @@ class StoreProc {
                 return self::useBettleItem();
             case CmdCode::cmd_store_setBettleItemUseVal:                        # 6436cmd_store_removeItem
                 return self::setBettleItemUseVal();
-            case CmdCode::cmd_store_removeItem:                                 # 6437 删除所有类型道具
+            case CmdCode::cmd_store_removeItem:                                 # 6437 删除所有类型道具cmd_store_killMosterAddData
                 return self::removeItem();
+            case CmdCode::cmd_store_killMosterAddData:                          # 6438 击杀怪,唤灵师获得的信息加成,暂时是经验
+                return self::killMosterAddData();
             default:
                 Err(ErrCode::cmd_err);
         }
     }
     
+    /**
+     * 6438 击杀怪,唤灵师获得的信息加成,暂时是经验
+     */
+    public static function killMosterAddData() {
+        $heroUID = req()->paras[0];
+        $mosterId = req()->paras[1];      # 提取参数      
+        
+        $hero = ctx()->heros(true);
+        
+        $mo = GameConfig::hero_getItem($mosterId);
+        my_Assert($mo != null, ErrCode::err_const_no);
+        
+        $targetHero = HeroProc::HeroAddEXP($heroUID, $mo->exp);     
+        
+        UserProc::updateUserInfo();
+
+        return Resp::ok(array('hero' => $targetHero,));
+    }
+    
+    
     /**
      * 删除所有类型道具
      */

+ 42 - 17
Gameserver/Amfphp/process/TaskProc.php

@@ -648,26 +648,51 @@ class TaskProc {
         }
         $dailyCards = (array) $dailyCards;
         ksort($dailyCards);
-
         foreach ($dailyCards as $id => $cardMo) {
-            foreach ($store->taskcards as $uid => $card) {
-                $cardVo = new Ins_TaskCard($card);
-                if ($cardVo->typeId == $id) {                                   # 找到对应的实例.
-                    unset($store->taskcards->$uid);                             # 删除昨日未完成日常
+                foreach ($store->taskcards as $uid => $card) {
+                    $cardVo = new Ins_TaskCard($card);
+                    if ($cardVo->typeId == $id) {                                   # 找到对应的实例.
+                        unset($store->taskcards->$uid);                             # 删除昨日未完成日常
+                    }
                 }
-            }
         }
         ctx()->store = $store;
-        // 再遍历一遍, 添加今日日常任务.
-        $cid = 0;
-        foreach ($dailyCards as $id => $cardMo) {
-            $cid = StoreProc::PutTaskCardInStore($id);                                 # 添加任务卡到背包
-        }
-        $pri = ctx()->privateData();                            # 私有数据
+        
+        if (count($dailyCards) < 4) {                                 
+            // 再遍历一遍, 添加今日日常任务.
+            $cid = 0;
+            foreach ($dailyCards as $id => $cardMo) {
+                $cid = StoreProc::PutTaskCardInStore($id);                                 # 添加任务卡到背包
+            }
+            $pri = ctx()->privateData();                            # 私有数据
 
-        $cardType = 2;                                                          # 日常任务,设置追踪
-        my_default_Obj($pri->taskCardTracing);                                  # 确保 tracing数据结构是否完整.
-        $pri->taskCardTracing->$cardType = $cid;                                # 更新tracing数据.
+            $cardType = 2;                                                          # 日常任务,设置追踪
+            my_default_Obj($pri->taskCardTracing);                                  # 确保 tracing数据结构是否完整.
+            $pri->taskCardTracing->$cardType = $cid;                                # 更新tracing数据
+        } else {
+            $count = count($dailyCards);
+            $temp = array();
+            while (true) {
+                $num = rand(0,$count);
+                if(in_array($num, $temp)){
+                    continue;
+                }
+                $index = 0;
+                foreach ($dailyCards as $id => $cardMo) {
+                    if($index >= $num){
+                        $cid = StoreProc::PutTaskCardInStore($id);# 添加任务卡到背包
+                        break;
+                    }  
+                    $index+=1;
+                }
+                
+                $temp[] = $num;
+                if(count($temp)>=4){
+                    break;
+                }
+            }
+                    
+        }
         UserProc::updateUserInfo();                                             # 回存数据.(不管从哪里调用的, 更新肯定没错.)
     }
 
@@ -1038,12 +1063,12 @@ class TaskProc {
         $tasks = ctx()->store->taskcards;
         $pri = ctx()->privateData();
         for ($tp = 1; $tp < 5; $tp++) {
-            if(StlUtil::dictHasProperty($pri->taskCardTracing, $tp)){
+            if (StlUtil::dictHasProperty($pri->taskCardTracing, $tp)) {
                 $curId = $pri->taskCardTracing->$tp;
             } else {
                 $curId = 0;
             }
-            
+
             //$curId = my_null_default($pri->taskCardTracing->$tp, 0);            # 当前追踪中的任务卡id
 
             $needRefresh = false;