From 5d9a338c76eba9fd98f95bdff77b78e4c657382e Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 23 五月 2019 21:17:16 +0800
Subject: [PATCH] 6805 【后端】【2.0】副本前端化(增加过滤炼丹等级通用配置)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SummonNPC.py | 54 ++++++++++++++++++++++++++++++++----------------------
1 files changed, 32 insertions(+), 22 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SummonNPC.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SummonNPC.py
index c93835a..d37ba58 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SummonNPC.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SummonNPC.py
@@ -16,45 +16,54 @@
import ChConfig
import GameWorld
import NPCCommon
+import PlayerFB
#
#逻辑实现
## 在身边刷召唤NPC <NPCID> [数量] 默认数量:1
# @param curPlayer 当前玩家
-# @param list 参数列表 [tagID, NPCCount]
+# @param paramList 参数列表 [tagID, NPCCount]
# @return None
# @remarks 函数详细说明.
-def OnExec(curPlayer, list):
-#===============================================================================
-# #检测当前玩家是否有权限
-# #if
-# #第一阶段不处理
-#===============================================================================
-
+def OnExec(curPlayer, paramList):
#输入命令格式错误
- if len(list)<1 or len(list)>2:
+ if not paramList:
+ GameWorld.DebugAnswer(curPlayer, "SummonNPC npcID 个数")
+ GameWorld.DebugAnswer(curPlayer, "SummonNPC npcID 个数 前端场景ID lineID")
return
+
#NPC对象ID
- tagID=list[0]
+ npcID = paramList[0]
+ npcCount = max(paramList[1] if len(paramList) > 1 else 1, 1)
+ npcData = GameWorld.GetGameData().FindNPCDataByID(npcID)
- if not GameWorld.GetGameData().FindNPCDataByID(tagID):
+ if not npcData:
return
+
+ npcType = npcData.GetType()
+ if npcType in [ChConfig.ntPriWoodPilePVE, ChConfig.ntPriWoodPilePVP]:
+ mapID = paramList[2] if len(paramList) > 2 else 0
+ lineID = paramList[3] if len(paramList) > 3 else 0
+ if not mapID:
+ GameWorld.DebugAnswer(curPlayer, "木桩怪必须指定地图ID才能召唤!")
+ return
+ sceneMapID = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomSceneMapID)
+ sceneLineID = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomSceneLineID)
+ if mapID != sceneMapID or lineID != sceneLineID:
+ if sceneMapID:
+ PlayerFB.DoExitCustomScene(curPlayer)
+ tick = GameWorld.GetGameWorld().GetTick()
+ PlayerFB.DoEnterCustomScene(curPlayer, mapID, lineID, tick)
+ NPCCommon.SummonPriWoodPile(curPlayer, npcID, npcCount)
+ return
- #NPC刷新数量
- if len(list)==1:
- #默认数量1
- NPCCount=1
- else:
- #GM输入的数量
- NPCCount=list[1]
-
- for i in range(0,NPCCount):
+ for _ in range(npcCount):
#在玩家周围选择一个无玩家的点
- resultPos=GameMap.GetEmptyPlaceInArea(curPlayer.GetPosX(),curPlayer.GetPosY(),6)
+ resultPos = GameMap.GetEmptyPlaceInArea(curPlayer.GetPosX(), curPlayer.GetPosY(), 6)
#生成NPC
summonNPC = curPlayer.SummonNewNPC()
- summonNPC.SetNPCTypeID(tagID)
+ summonNPC.SetNPCTypeID(npcID)
summonNPC.SetAIType(200)
summonNPC.GetNPCAngry().Init(ChConfig.Def_SummonNPC_Angry_Count)
#初始化
@@ -63,6 +72,7 @@
#玩家召唤兽列表添加召唤兽,召唤兽添加主人
summonNPC.Reborn(resultPos.GetPosX(), resultPos.GetPosY())
+ return
--
Gitblit v1.8.0