| | |
| | | import PlayerBossReborn
|
| | | import PlayerFairyCeremony
|
| | | import PlayerNewFairyCeremony
|
| | | import GameLogic_CrossDemonKing
|
| | | import GameLogic_CrossGrassland
|
| | | import PlayerWeekParty
|
| | | import PlayerActLogin
|
| | |
| | | itemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
|
| | | if not itemData:
|
| | | continue
|
| | | itemJob = itemData.GetJobLimit() / 100
|
| | | itemJob = itemData.GetJobLimit()
|
| | | if itemJob and itemJob != curPlayer.GetJob():
|
| | | # 非本职业可用,不掉落
|
| | | GameWorld.DebugLog("全服击杀次数必掉,非本职业可用,不掉落! itemID=%s" % itemID)
|
| | |
| | | itemData = GameWorld.GetGameData().GetItemByTypeID(rItemID)
|
| | | if not itemData:
|
| | | continue
|
| | | itemJob = itemData.GetJobLimit() / 100
|
| | | itemJob = itemData.GetJobLimit()
|
| | | if itemJob and itemJob != curPlayer.GetJob():
|
| | | # 非本职业可用,不掉落
|
| | | GameWorld.DebugLog("全服击杀次数必掉随机,非本职业可用,不掉落! rItemID=%s" % rItemID)
|
| | |
| | | if itemData.GetItemColor() != color:
|
| | | continue
|
| | | suiteID = itemData.GetSuiteID()
|
| | | itemJob = itemData.GetJobLimit() / 100
|
| | | itemJob = itemData.GetJobLimit()
|
| | | itemPlace = itemData.GetEquipPlace()
|
| | | itemID = itemData.GetItemTypeID()
|
| | | if itemPlace not in filterItemIDDict:
|
| | |
| | | if not itemData:
|
| | | GameWorld.ErrLog("掉落物品ID不存在, dropItemID=%s" % dropItemID)
|
| | | continue
|
| | | itemJob = itemData.GetJobLimit() / 100
|
| | | itemJob = itemData.GetJobLimit()
|
| | | if isJobLimit and itemJob and itemJob != curPlayer.GetJob():
|
| | | # 非本职业可用,不掉落
|
| | | #GameWorld.DebugLog("非本职业可用,不掉落! dropItemID=%s" % dropItemID)
|
| | |
| | |
|
| | | return
|
| | |
|
| | | #// B4 0C 召唤私有专属木桩怪 #tagCMSummonPriWoodPile
|
| | | #
|
| | | #struct tagCMSummonPriWoodPile
|
| | | #{
|
| | | # tagHead Head;
|
| | | # DWORD NPCID;
|
| | | # BYTE Count; //默认1个,最多5个
|
| | | #};
|
| | | def OnSummonPriWoodPile(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | npcID = clientData.NPCID
|
| | | count = clientData.Count
|
| | | SummonPriWoodPile(curPlayer, npcID, count)
|
| | | return
|
| | |
|
| | | def SummonPriWoodPile(curPlayer, npcID, count):
|
| | | ''' 召唤私有专属木桩怪
|
| | | '''
|
| | | |
| | | maxCount = 5
|
| | | nowCount = 0
|
| | | # 只允许存在一个私有木桩
|
| | | indexList = range(curPlayer.GetSummonCount())
|
| | | for index in indexList[::-1]:
|
| | | summonNPC = curPlayer.GetSummonNPCAt(index)
|
| | | if not summonNPC:
|
| | | continue
|
| | | npcType = summonNPC.GetType()
|
| | | if npcType not in [ChConfig.ntPriWoodPilePVE, ChConfig.ntPriWoodPilePVP]:
|
| | | continue
|
| | | if nowCount >= maxCount or summonNPC.GetNPCID() != npcID:
|
| | | SetDeadEx(summonNPC)
|
| | | else:
|
| | | nowCount += 1
|
| | | |
| | | summonCount = min(count, maxCount - nowCount)
|
| | | #GameWorld.DebugLog("召唤: count=%s,maxCount=%s,nowCount=%s,summonCount=%s" |
| | | # % (count, maxCount, nowCount, summonCount))
|
| | | if summonCount <= 0:
|
| | | return
|
| | | |
| | | for _ in xrange(summonCount):
|
| | | summonNPC = curPlayer.SummonNewNPC()
|
| | | |
| | | #设置召唤兽基础信息
|
| | | summonNPC.SetNPCTypeID(npcID)
|
| | | #初始化
|
| | | InitNPC(summonNPC)
|
| | | |
| | | #玩家召唤兽列表添加召唤兽,召唤兽添加主人
|
| | | summonNPC.SetOwner(curPlayer)
|
| | | summonNPC.SetDict(ChConfig.Def_NPC_Dict_SummonMapNPCPlayerID, curPlayer.GetPlayerID())
|
| | | |
| | | #将召唤兽召唤出来
|
| | | #玩家周围随机出生点
|
| | | #技能召唤坐标 ChConfig.Def_SummonAppearDist
|
| | | summonPos = GameMap.GetEmptyPlaceInArea(curPlayer.GetPosX(), curPlayer.GetPosY(), 3)
|
| | | summonNPC.Reborn(summonPos.GetPosX(), summonPos.GetPosY())
|
| | | |
| | | return
|
| | |
|
| | | ## 设置npc死亡及自身处理(请不要将游戏逻辑加在此函数中)
|
| | | # @param curNPC:npc实例
|
| | | # @return
|
| | |
| | | return
|
| | | zoneID = zoneIpyData.GetZoneID()
|
| | | GameWorld.GetGameWorld().SetGameWorldDict(ShareDefine.Def_Notify_WorldKey_GameWorldBossRebornCross % (zoneID, bossID), 0)
|
| | | elif mapID == ChConfig.Def_FBMapID_CrossDemonKing:
|
| | | zoneID = GameLogic_CrossDemonKing.GetCurFBLineZoneID()
|
| | | elif mapID in ChConfig.Def_CrossDynamicLineMap:
|
| | | zoneID = FBCommon.GetCrossDynamicLineMapZoneID()
|
| | | GameWorld.GetGameWorld().SetGameWorldDict(ShareDefine.Def_Notify_WorldKey_GameWorldBossRebornCross % (zoneID, bossID), 0)
|
| | | else:
|
| | | GameWorld.GetGameWorld().SetGameWorldDict(ShareDefine.Def_Notify_WorldKey_GameWorldBossReborn % bossID, 0)
|
| | |
| | | def DoHPPerLogic(self, dropType, ownerID):
|
| | | curNPC = self.__Instance
|
| | | curNPCID = curNPC.GetNPCID()
|
| | | hpPerLogicNPCIDList = ReadChConfig.GetEvalChConfig('HPPerLogicNPCIDList')
|
| | | if curNPCID not in hpPerLogicNPCIDList:
|
| | | |
| | | hpPerLogicNPCIDDict = IpyGameDataPY.GetFuncEvalCfg('BossHPInformation', 1, {})
|
| | | hpPerLogicList = GameWorld.GetDictValueByKey(hpPerLogicNPCIDDict, curNPCID)
|
| | | if not hpPerLogicList:
|
| | | return
|
| | | |
| | | hpPerLogicDict = ReadChConfig.GetEvalChConfig('HPPerLogic_%s' % curNPCID)
|
| | | |
| | | hpPerList = sorted(hpPerLogicDict.keys(), reverse=True)
|
| | | |
| | | hpPerList, sysMark = hpPerLogicList
|
| | | hpPerList = sorted(hpPerList, reverse=True)
|
| | | nowHPPer = GameObj.GetHP(curNPC) * 100 / GameObj.GetMaxHP(curNPC) # 当前百分比
|
| | | hpPerLogicMark = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_HPPerLogicMark)
|
| | | logicHPPerList = hpPerList[hpPerLogicMark:]
|
| | |
| | | #GameWorld.DebugLog("DoHPPerLogic npcID=%s,hpPerLogicDict=%s,nowHPPer=%s,hpPerLogicMark=%s,logicHPPerList=%s"
|
| | | # % (curNPCID, str(hpPerLogicDict), nowHPPer, hpPerLogicMark, str(logicHPPerList)))
|
| | |
|
| | | isNotify, dropItemTemplate, addPrestigeFormat = hpPerLogicDict[hpPer]
|
| | | if isNotify:
|
| | | PlayerControl.WorldNotify(0, "FB_liubo_0", [GameWorld.GetMap().GetMapID(), curNPCID, hpPer])
|
| | |
|
| | | PlayerControl.WorldNotify(0, sysMark, [curNPCID, hpPer])
|
| | |
|
| | | # if dropItemTemplate > 0:
|
| | | # self.__DropItemByTemplate(dropItemTemplate, dropType, ownerID)
|
| | | # PlayerControl.WorldNotify(0, "GeRen_admin_481766", [GameWorld.GetMap().GetMapID(), curNPCID, curNPCID])
|
| | | |
| | | if addPrestigeFormat != '':
|
| | | self.__GiveNearbyPlayerPrestige(addPrestigeFormat, ChConfig.Def_Matrix_Six)
|
| | |
|
| | | hpPerLogicMark += 1
|
| | | #GameWorld.DebugLog("DoHPPerLogic update hpPerLogicMark=%s" % (hpPerLogicMark))
|
| | |
| | | #杀死NPC, 触发任务
|
| | | self.__EventKillNpc()
|
| | |
|
| | | #mapID = GameWorld.GetMap().GetMapID()
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | killerName = "" if not self.__Killer else self.__Killer.GetPlayerName()
|
| | | # 记录boss击杀信息的NPC
|
| | | bossIpyData = IpyGameDataPY.GetIpyGameDataListNotLog('BOSSInfo', npcID)
|
| | | if bossIpyData:
|
| | | if bossIpyData and mapID not in [ChConfig.Def_FBMapID_ZhuXianBoss, ChConfig.Def_FBMapID_SealDemon]:
|
| | | if GetDropOwnerType(curNPC) == ChConfig.DropOwnerType_Family:
|
| | | killerName = FamilyRobBoss.FamilyOwnerBossOnKilled(curNPC, self.__OwnerHurtID)
|
| | | #KillerJob = 0 if not self.__Killer else self.__Killer.GetJob()
|