瀏覽代碼

fixed: 杀死怪物事件更新任务卡进度.

gwang 4 年之前
父節點
當前提交
34db0a0188

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

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2020-11-19 15:23:20
+ // 日期: 2020-11-19 17:41:44
 ////////////////////
 
 /**

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

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2020-11-19 15:17:22
+ // 日期: 2020-11-19 16:05:52
 ////////////////////
 
 

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

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2020-11-19 15:15:58
+ // 日期: 2020-11-19 17:38:25
 ////////////////////
 
 

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

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2020-11-19 15:22:46
+ // 日期: 2020-11-19 17:32:06
 ////////////////////
 
 

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

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2020-11-17 10:14:55
+ // 日期: 2020-11-19 16:44:54
 ////////////////////
 
 

+ 2 - 2
Gameserver/Amfphp/model/Const/sm_task_step.php

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2020-11-18 19:47:14
+ // 日期: 2020-11-19 17:40:41
 ////////////////////
 
 
@@ -35,7 +35,7 @@ class sm_task_step
     public $desc;
 
     /**
-    * @var Int32 任务类型: 201 杀怪 202 获得道具 203 跟NPC交谈  
+    * @var Int32 任务类型: 201 杀怪 202 获得道具 203 跟NPC交谈  204 言灵召唤  
     */
     public $tasktype;
 

+ 7 - 1
Gameserver/Amfphp/model/User/TaskStepVo.php

@@ -64,18 +64,23 @@ class TaskStepVo extends Object_ext {
             return true;
         }
 
+
         if ($taskParam->taskType == $this->mo()->tasktype) {
-            if (isNull($this->mo()->canshu1)) {
+
+            if (null == $this->mo()->canshu1) {
                 $this->progress = 1;
                 return true;
             }
+
             if ($this->mo()->canshu1 == $taskParam->canshu1) {
+
                 $this->tag1 = $taskParam->canshu1;
                 if (null == $this->mo()->canshu2 || 0 == $this->mo()->canshu2) {
                     $this->progress = 1;
                     $this->tag2 = $taskParam->canshu2;
                     return true;
                 } else {
+
                     if (is_numeric($this->mo()->canshu2)) {
                         $this->tag2 = max($this->tag2, $taskParam->canshu2);
                         if ($this->mo()->canshu2 <= $taskParam->canshu2) {
@@ -83,6 +88,7 @@ class TaskStepVo extends Object_ext {
                             return true;
                         }
                     } else {
+
                         $this->tag2 = $taskParam->canshu2;
                         if ($this->mo()->canshu2 == $taskParam->canshu2) {
                             $this->progress = 1;

+ 14 - 1
Gameserver/Amfphp/process/TaskProc.php

@@ -502,6 +502,16 @@ class TaskProc {
                 $n = $task->curStepIndex;
                 $taskStep = new TaskStepVo($taskSteps[$n]);
                 $bUpdate = $taskStep->check($taskParam);
+                if ($bUpdate) {
+                    $taskSteps[$n] = $taskStep;
+                    $task->curSteps = $taskSteps;
+                    $n++;
+                    if (count($task->curSteps) <= $n) {
+                        $task->state = 1;                                       # 任务已完成
+                    } else {
+                        $task->curStepIndex = $n;
+                    }
+                }
             } else {                                                            # 并
                 foreach ($task->curSteps as $stp) {
                     $tsp = new TaskStepVo($stp);
@@ -509,13 +519,16 @@ class TaskProc {
                 }
             }
         }
+        if ($bUpdate) {
+            UserProc::updateUserInfo();
+        }
 
         return $bUpdate;
     }
 
     static function OnKillMonster($monsterID, $num) {
         $taskParam = new TaskParams(EnumTaskType::KillMonster, $monsterID, $num);
-        self::CheckTaskCardConditions($taskParam);
+        return self::CheckTaskCardConditions($taskParam);
     }
 
     /**