Ver código fonte

添加触发移除道具事件.

gwang 4 anos atrás
pai
commit
05473f7956

+ 54 - 25
Gameserver/Amfphp/process/EventProc/NormalEventProc.php

@@ -18,15 +18,20 @@ class EEventType {
      */
      */
     const AddItem = "AddItem";
     const AddItem = "AddItem";
 
 
-//    /**
-//     * 给予道具
-//     */
-//    const AddWeapon = "AddWeapon";
-//
-//    /**
-//     * 给予道具
-//     */
-//    const AddYanling = "AddYanling";
+    /**
+     * 移除道具
+     */
+    const RemoveItem = "RemoveItem";
+
+    /**
+     * 给予任务
+     */
+    const AddTaskItem = "AddTaskItem";
+
+    /**
+     * 移除任务
+     */
+    const RemoveTaskItem = "RemoveTaskItem";
 
 
     /**
     /**
      * 完成任务步骤
      * 完成任务步骤
@@ -43,6 +48,11 @@ class EEventType {
      */
      */
     const StartPlot = "StartPlot";
     const StartPlot = "StartPlot";
 
 
+    /**
+     * 开启npc对话
+     */
+    const NpcDialog = "NpcDialog";
+
 }
 }
 
 
 /**
 /**
@@ -66,23 +76,33 @@ class NormalEventProc {
         Resp::AddEvent(EEventType::AddItem, $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_Remove_Item($arg1, $arg2) {
+        Resp::AddEvent(EEventType::RemoveItem, $arg1, $arg2);
+    }
+
+    /**
+     * 任务卡包裹--获得新的任务卡
+     * @param type $arg1
+     * @param type $arg2
+     */
+    public static function OnTaskBag_new_Card($arg1, $arg2) {
+        Resp::AddEvent(EEventType::AddTaskItem, $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 OnTaskBag_remove_Card($arg1, $arg2) {
+        Resp::AddEvent(EEventType::AddYanling, $arg1, $arg2);
+    }
 
 
     /**
     /**
      * 任务卡-任务步骤完成
      * 任务卡-任务步骤完成
@@ -111,4 +131,13 @@ class NormalEventProc {
         Resp::AddEvent(EEventType::StartPlot, $arg1, $arg2);
         Resp::AddEvent(EEventType::StartPlot, $arg1, $arg2);
     }
     }
 
 
+    /**
+     * 剧情-开启一段NPC对话
+     * @param type $arg1
+     * @param type $arg2 
+     */
+    public static function OnNpcDialog_startNew($arg1, $arg2) {
+        Resp::AddEvent(EEventType::NpcDialog, $arg1, $arg2);
+    }
+
 }
 }

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

@@ -200,6 +200,7 @@ class StoreProc {
                 if ($store->items->$itemId == 0) {
                 if ($store->items->$itemId == 0) {
                     unset($store->items->$itemId);
                     unset($store->items->$itemId);
                 }
                 }
+                NormalEventProc::OnBag_Remove_Item($itemId, $itemcount);        # 插入事件
                 return ErrCode::ok;
                 return ErrCode::ok;
             } else {
             } else {
                 return ErrCode::store_itemnotenough;                            # 道具数量不足
                 return ErrCode::store_itemnotenough;                            # 道具数量不足

+ 6 - 8
Gameserver/nbproject/private/private.xml

@@ -12,17 +12,15 @@
     </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/util/Event.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/AutoLoad.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/base/ErrCode.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/util/UtilInclude.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/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/Resp.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/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>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/process/StoreProc.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/Services/AppServer.php</file>
         </group>
         </group>
     </open-files>
     </open-files>
 </project-private>
 </project-private>