gwang 4 жил өмнө
parent
commit
d20ca6486f

+ 114 - 0
Gameserver/Amfphp/process/EventProc/NormalEventProc.php

@@ -0,0 +1,114 @@
+<?php
+
+namespace loyalsoft;
+
+/**
+ *  事件类型定义
+ *  author: gwang, 2020年11月30日17:56:01
+ */
+class EEventType {
+
+    /**
+     * hello world
+     */
+    const HelloWorld = "HelloWorld";
+
+    /**
+     * 给予道具
+     */
+    const AddItem = "AddItem";
+
+//    /**
+//     * 给予道具
+//     */
+//    const AddWeapon = "AddWeapon";
+//
+//    /**
+//     * 给予道具
+//     */
+//    const AddYanling = "AddYanling";
+
+    /**
+     * 完成任务步骤
+     */
+    const MissionStepComplete = "MissionStepComplete";
+
+    /**
+     * 任务卡完成
+     */
+    const TaskCardFinished = "TaskCardFinished";
+
+    /**
+     * 开启一段剧情对话
+     */
+    const StartPlot = "StartPlot";
+
+}
+
+/**
+ * 系统事件处理模块
+ * @author gwang
+ */
+class NormalEventProc {
+
+    //put your code here
+
+    public static function OnHelloWorld($arg1, $arg2) {
+        Resp::AddEvent(EEventType::HelloWorld, $arg1, $arg2);
+    }
+
+    /**
+     * 包裹--获得新的道具
+     * @param type $arg1
+     * @param type $arg2
+     */
+    public static function OnBag_new_Item($arg1, $arg2) {
+        Resp::AddEvent(EEventType::AddItem, $arg1, $arg2);
+    }
+
+//    /**
+//     * 包裹--获得新的武器
+//     * @param type $arg1
+//     * @param type $arg2
+//     */
+//    public static function OnBag_new_Weapon($arg1, $arg2) {
+//        Resp::AddEvent(EEventType::AddWeapon, $arg1, $arg2);
+//    }
+//
+//    /**
+//     * 包裹--获得新的言灵
+//     * @param type $arg1
+//     * @param type $arg2
+//     */
+//    public static function OnBag_new_Yanling($arg1, $arg2) {
+//        Resp::AddEvent(EEventType::AddYanling, $arg1, $arg2);
+//    }
+
+    /**
+     * 任务卡-任务步骤完成
+     * @param type $arg1
+     * @param type $arg2
+     */
+    public static function OnTaskCardStep_Complete($arg1, $arg2) {
+        Resp::AddEvent(EEventType::MissionStepComplete, $arg1, $arg2);
+    }
+
+    /**
+     * 任务卡-完成
+     * @param type $arg1
+     * @param type $arg2
+     */
+    public static function OnTaskCard_Finish($arg1, $arg2) {
+        Resp::AddEvent(EEventType::TaskCardFinished, $arg1, $arg2);
+    }
+
+    /**
+     * 剧情-开启一段新对话
+     * @param type $arg1
+     * @param type $arg2 
+     */
+    public static function OnPlot_startNew($arg1, $arg2) {
+        Resp::AddEvent(EEventType::StartPlot, $arg1, $arg2);
+    }
+
+}

+ 3 - 0
Gameserver/Amfphp/process/TaskProc.php

@@ -503,11 +503,13 @@ class TaskProc {
                 $taskStep = new TaskStepVo($taskSteps[$n]);
                 $taskStep = new TaskStepVo($taskSteps[$n]);
                 $bUpdate = $taskStep->check($taskParam);
                 $bUpdate = $taskStep->check($taskParam);
                 if ($bUpdate) {
                 if ($bUpdate) {
+                    NormalEventProc::OnTaskCardStep_Complete($task->typeId, $taskStep->typeId);
                     $taskSteps[$n] = $taskStep;
                     $taskSteps[$n] = $taskStep;
                     $task->curSteps = $taskSteps;
                     $task->curSteps = $taskSteps;
                     $n++;
                     $n++;
                     if (count($task->curSteps) <= $n) {
                     if (count($task->curSteps) <= $n) {
                         $task->state = 1;                                       # 任务已完成
                         $task->state = 1;                                       # 任务已完成
+                        NormalEventProc::OnTaskCard_Finish($task->typeId, null);
                     } else {
                     } else {
                         $task->curStepIndex = $n;
                         $task->curStepIndex = $n;
                     }
                     }
@@ -537,6 +539,7 @@ class TaskProc {
     static function OnGainItem($itemId, $num) {
     static function OnGainItem($itemId, $num) {
         $taskParam = new TaskParams(EnumTaskType::GainItem, $itemId, $num);
         $taskParam = new TaskParams(EnumTaskType::GainItem, $itemId, $num);
         self::CheckTaskCardConditions($taskParam);
         self::CheckTaskCardConditions($taskParam);
+        NormalEventProc::OnBag_new_Item($itemId, $num);
     }
     }
 
 
     static function OnPlotOver($gate_or_npc_id, $stage) {
     static function OnPlotOver($gate_or_npc_id, $stage) {

+ 13 - 1
Gameserver/nbproject/private/private.xml

@@ -11,6 +11,18 @@
         </file>
         </file>
     </editor-bookmarks>
     </editor-bookmarks>
     <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
     <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
-        <group/>
+        <group>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/base/Resp.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/Services/AppServer.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/util/Event.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/index.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/process/EventProc/CornerSignEventProc.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/process/StoreProc.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/base/CmdCode.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/process/EventProc/NormalEventProc.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/process/TaskProc.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/process/EventProc.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/util/UtilInclude.php</file>
+        </group>
     </open-files>
     </open-files>
 </project-private>
 </project-private>