Pārlūkot izejas kodu

药瓶初始值

cyzhao 3 gadi atpakaļ
vecāks
revīzija
4cb1b2aa0f

+ 1 - 1
Gameserver/Amfphp/base/CmdCode.php

@@ -699,7 +699,7 @@ class CmdCode {
     /*
      * 道具全部使用,删除
      */
-    public const cmd_store_removeBettleItem = 6435;
+    public const cmd_store_useBettleItem = 6435;
     
     /**
      * 血瓶或蓝瓶自动使用条件设置

+ 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-21 14:19:31
+ // 日期: 2022-04-27 09:50:35
 ////////////////////
 
 
@@ -490,5 +490,10 @@ class globalsettings
     */
     public $caoWeiCoolTs;
 
+    /**
+    * @var Object 血瓶生命初始值和蓝瓶的魔法的初始值  
+    */
+    public $YaoPingAttrInitVal;
+
 }
 

+ 37 - 0
Gameserver/Amfphp/model/User/Enum_ExploreType.php

@@ -0,0 +1,37 @@
+<?php
+
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+namespace loyalsoft;
+
+/**
+ * Description of Enum_ExploreType
+ *
+ * @author c'y'zhao
+ */
+class Enum_ExploreType extends Enum{
+    const Area = 1;
+    const Npc  = 2;
+    const Item = 3;
+    const Plot = 4;
+    const Border = 5;
+    const Other = 6;
+}
+
+class Enum_ExploreSubType extends Enum{
+    const Default = 0;    // 默认
+  
+    const Store =1;        // 杂货店 
+    const Smithy=2;           // 铁匠铺     
+    const Storehouse=3;       // 储物箱   
+    const Teleporter=4;       // 传送点  
+    const Reword=5;           // 悬赏商人   
+    const Email=6;            // 邮箱      
+    const Entry=7;            // 副本入口       
+    const Export=8;           // 副本出口
+    const paihangbang=9;         //排行榜
+}

+ 5 - 5
Gameserver/Amfphp/process/MapProc.php

@@ -15,13 +15,13 @@ class MapProc {
      */
     static function procMain() {
         switch (req()->cmd) {
-            case CmdCode::map_EnterFootHold:                                    #  [7501] 进入据点
+            case CmdCode::map_EnterFootHold:                                    #  [7501] 进入地图
                 return self::EnterFootHold();
             case CmdCode::map_FixUpTransmission:                                #  [7502] 开启传送阵
                 return self::FixUpTransmision();
             case CmdCode::map_UpdateExplorerationProgress:                      #  [7503] 更新探索进度
                 return self::UpdateExplorationProgress();
-            case CmdCode::map_UnlockMap:                                        #  [7504] 解锁据点
+            case CmdCode::map_UnlockMap:                                        #  [7504] 解锁地图
                 return self::UnlockMap();
 //            case CmdCode::map_getUnlockInfoList:                              #  [7505] 获取mapid下已经解锁的列表
 //                return self::getUnlockInfoList();
@@ -145,9 +145,9 @@ class MapProc {
             $num = $arr[1];
             $newMap->unlockedFootholds->$mapid->curExploreProgress = $explorerNum;
 
-            if ($type == 2 && $newMap->unlockedFootholds->$mapid->transmissionIsOk == false) {
+            if ($type == Enum_ExploreType::Npc && $newMap->unlockedFootholds->$mapid->transmissionIsOk == false) {
                 $subtype = GameConfig::npc_getItem($typeid)->subtype;
-                if ($subtype == 4) {//传送带
+                if ($subtype == Enum_ExploreSubType::Teleporter) {//传送带
                     $newMap->unlockedFootholds->$mapid->transmissionIsOk = true;
                 }
             }
@@ -204,7 +204,7 @@ class MapProc {
     }
 
     /**
-     * 7504 解锁据点
+     * 7504 解锁地图
      * @return Resp 
      */
     public static function UnlockMap() {

+ 18 - 4
Gameserver/Amfphp/process/StoreProc.php

@@ -87,8 +87,8 @@ class StoreProc {
                 return self::changeStorage();
             case CmdCode::cmd_store_changeBettleItem:                           # 6434
                 return self::changeBettleItem();    
-            case CmdCode::cmd_store_removeBettleItem:                           # 6435
-                return self::removeBettleItem();
+            case CmdCode::cmd_store_useBettleItem:                              # 6435
+                return self::useBettleItem();
             case CmdCode::cmd_store_setBettleItemUseVal:                        # 6436
                 return self::setBettleItemUseVal();
             default:
@@ -119,7 +119,7 @@ class StoreProc {
      * 6435
      * @return type
      */
-    public static function removeBettleItem() {
+    public static function useBettleItem() {
         $index = req()->paras[0];        # 提取参数      
         
         $store = ctx()->store(true);
@@ -152,11 +152,25 @@ class StoreProc {
         $itemid = req()->paras[2];      # 提取参数
                
         $store = ctx()->store(true);
-        if($type == 0){//添加          
+        
+        $str = GameConfig::globalsettings()->YaoPingAttrInitVal;
+        $slist = explode(';', $str);
+        $hp = explode(',', $slist[0])[0];
+        $mp = explode(',', $slist[1])[0];
+        
+        if($type == 0){//添加   
             $item = new Ins_battleItem();
             $item->index = $index;
             $item->id = $itemid;
             $item->num = $store->items->$itemid;
+            
+            $subType = GameConfig::item_base_getItem($itemid)->subType;
+            if($subType == 341){
+                $item->attrVal = $hp;
+            } else {
+                $item->attrVal = $mp;
+            }
+                       
             $store->battleItem->$index = $item;           
         } else {                     
             unset($store->battleItem->$index);