hxp
2019-03-19 922b9a9139f9c86cc48b14668f05615a6ea5fd21
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetNPCKillDrop.py
@@ -31,7 +31,7 @@
#  @remarks 函数详细说明.
def OnExec(curPlayer, msgList):
    if not msgList:
        GameWorld.DebugAnswer(curPlayer, "SetNPCKillDrop npcID 击杀次数")
        GameWorld.DebugAnswer(curPlayer, "设置次数: SetNPCKillDrop npcID 击杀次数")
        GameWorld.DebugAnswer(curPlayer, "重置所有: SetNPCKillDrop 0")
        return
    
@@ -41,10 +41,8 @@
        for i in xrange(ipyDataMgr.GetNPCDropItemCount()):
            ipyData = ipyDataMgr.GetNPCDropItemByIndex(i)
            npcID = ipyData.GetNPCID()
            if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_NPCKillCountDrop % npcID) \
                and not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_NPCKillCount % npcID):
            if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_NPCKillCount % npcID):
                continue
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_NPCKillCountDrop % npcID, 0)
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_NPCKillCount % npcID, 0)
            resetNPCIDList.append(npcID)
            
@@ -66,27 +64,14 @@
    if not ipyData:
        GameWorld.DebugAnswer(curPlayer, "没有配置掉落:%s" % npcID)
        return
    killCountDropInfo = ipyData.GetKillCountDrop()
    if killCountDropInfo:
        needKillCount = killCountDropInfo[0]
        killCount = min(msgList[1], needKillCount - 1) if len(msgList) > 1 else (needKillCount - 1)
        setValue = killCount * 10
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_NPCKillCountDrop % npcID, setValue)
        GameWorld.DebugAnswer(curPlayer, "击杀掉落值(%s)=%s" % (npcID, setValue))
    killCountDropEquipEx = ipyData.GetKillCountDropEquipEx()
    killCountDropEquipEx2 = ipyData.GetKillCountDropEquipEx2()
    if killCountDropEquipEx or killCountDropEquipEx2:
        if killCountDropEquipEx:
            needKillCount = killCountDropEquipEx[0]
        if killCountDropEquipEx2:
            needKillCount = min(needKillCount, killCountDropEquipEx2[0])
        killCount = min(msgList[1], needKillCount - 1) if len(msgList) > 1 else (needKillCount - 1)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_NPCKillCount % npcID, killCount)
        GameWorld.DebugAnswer(curPlayer, "击杀次数=%s" % (npcID, killCount))
    if not killCountDropInfo and not killCountDropEquipEx and not killCountDropEquipEx2:
    if not ipyData.GetKillCountDropPri() and not ipyData.GetKillCountDropEquipPub() and not ipyData.GetKillCountDropPub():
        GameWorld.DebugAnswer(curPlayer, "不需要设置击杀掉落次数信息!%s" % npcID)
    else:
        killCount = msgList[1] if len(msgList) > 1 else 0
        setValue = killCount * 10000 + killCount * 100 + killCount
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_NPCKillCount % npcID, setValue)
        GameWorld.DebugAnswer(curPlayer, "击杀掉落值(%s)=%s" % (npcID, killCount))
        
    return