| | |
| | | SetTJGTime(curPlayer, min(GetTJGTime(curPlayer) + addTime, maxTime))
|
| | | return
|
| | |
|
| | | def CalcTJGExp(curPlayer, times, npcData):
|
| | | def CalcTJGExp(curPlayer, times, npcData, realmNPCIpyData):
|
| | | lvIpyData = PlayerControl.GetPlayerLVIpyData(curPlayer.GetLV())
|
| | | if not lvIpyData:
|
| | | return 0
|
| | |
| | | aReFightPower = lvIpyData.GetReFightPower() # 等级表对应的战力
|
| | | aNPCHurtAddPer = PlayerControl.GetNPCHurtAddPer(curPlayer) #PVE 伤害加成万分率
|
| | |
|
| | | npcID = npcData.GetNPCID()
|
| | | if realmNPCIpyData:
|
| | | attrDict = NPCCommon.GetNPCStrengthenAttrDict(npcID, realmNPCIpyData.GetLV())
|
| | | npcExp = realmNPCIpyData.GetExp()
|
| | | npcMaxHP = attrDict.get("MaxHP", GameObj.GetHP(npcData))
|
| | | npcCommendFightPower = realmNPCIpyData.GetFireDef()
|
| | | GameWorld.DebugLog("CalcTJGExp realmNPC npcID=%s,npcExp=%s,npcMaxHP=%s,npcCommendFightPower=%s" % (npcID, npcExp, npcMaxHP, npcCommendFightPower))
|
| | | else:
|
| | | npcExp = npcData.GetExp()
|
| | | npcMaxHP = GameObj.GetHP(npcData)
|
| | | npcCommendFightPower = NPCCommon.GetCommendFightPower(npcData)
|
| | | GameWorld.DebugLog("CalcTJGExp npcID=%s,npcExp=%s,npcMaxHP=%s,npcCommendFightPower=%s" % (npcID, npcExp, npcMaxHP, npcCommendFightPower))
|
| | | |
| | | petSkillLV = 1
|
| | | petSkillPer = 10000
|
| | |
|
| | |
| | | aNPCHurtAddPer:%s, aFinalHurtPer:%s,
|
| | | aIceAtk:%s, aDamagePVE:%s, aSkillAtkRate:%s, petMinAtk:%s, petMaxAtk:%s, petDamPer:%s, atkSpeed:%s,
|
| | | aIgnoreDefRate:%s, aLuckyHit:%s, aLuckyHitRate:%s, aBleedDamage:%s, aFinalHurt:%s, npcExp:%s, npcMaxHP:%s, npcCommendFightPower:%s,
|
| | | petSkillLV:%s, petSkillPer:%s, skill:%s, petSkill:%s"""%(curPlayer.GetID(), curPlayer.GetLV(), times, npcData.GetNPCID(),
|
| | | petSkillLV:%s, petSkillPer:%s, skill:%s, petSkill:%s"""%(curPlayer.GetID(), curPlayer.GetLV(), times, npcID,
|
| | | reExp, attackEff, aMinAtk, aMaxAtk, aSuperHitRate, aSuperHit, aNPCHurtAddPer, aFinalHurtPer,
|
| | | aIceAtk, aDamagePVE, aSkillAtkRate, petMinAtk, petMaxAtk, petDamPer,
|
| | | atkSpeed, aIgnoreDefRate, aLuckyHit, aLuckyHitRate, aBleedDamage, aFinalHurt, npcExp, npcMaxHP, npcCommendFightPower, petSkillLV,
|
| | |
| | | if not npcData:
|
| | | return finalAddExp
|
| | |
|
| | | realmLV = PlayerControl.GetDifficultyRealmLV(PlayerControl.GetRealmDifficulty(curPlayer))
|
| | | realmNPCIpyData = IpyGameDataPY.GetIpyGameDataNotLog("NPCRealmStrengthen", npcID, realmLV)
|
| | | if realmNPCIpyData:
|
| | | mDef = realmNPCIpyData.GetMDef()
|
| | | npcLV = realmNPCIpyData.GetLV()
|
| | | sp = realmNPCIpyData.GetSP()
|
| | | GameWorld.DebugLog("OnTJGKillNPCByTimes npcID=%s,npcLV=%s,mDef=%s,sp=%s,realmLV=%s" % (npcID, npcLV, mDef, sp, realmLV))
|
| | | else:
|
| | | mDef = npcData.GetMDef()
|
| | | npcLV = npcData.GetLV()
|
| | | sp = npcData.GetSP()
|
| | | GameWorld.DebugLog("OnTJGKillNPCByTimes npcID=%s,npcLV=%s,mDef=%s,sp=%s" % (npcID, npcLV, mDef, sp))
|
| | | |
| | | # 1. 经验
|
| | | exp = CalcTJGExp(curPlayer, times, npcData)
|
| | | exp = CalcTJGExp(curPlayer, times, npcData, realmNPCIpyData)
|
| | | playerControl = PlayerControl.PlayerControl(curPlayer)
|
| | | if exp > 0:
|
| | | finalAddExp = playerControl.AddExp(exp, ShareDefine.Def_ViewExpType_KillNPC)
|
| | |
| | |
|
| | |
|
| | | # GetMDef 用于 NPC被击杀时间效率 毫秒
|
| | | if npcData.GetMDef() == 0:
|
| | | if mDef == 0:
|
| | | return finalAddExp
|
| | |
|
| | | killCnt = times*1000/npcData.GetMDef()
|
| | | killCnt = times*1000/mDef
|
| | | if not killCnt:
|
| | | return finalAddExp
|
| | |
|
| | |
| | | # 2.物品
|
| | | OnTJGDropItems(curPlayer, npcID, killCnt)
|
| | | #任务道具
|
| | | OnTJGDropTaskItems(curPlayer, npcData.GetLV(), killCnt)
|
| | | OnTJGDropTaskItems(curPlayer, npcLV, killCnt)
|
| | | # VIP杀怪加攻
|
| | | PlayerVip.DoAddVIPKillLVExp(curPlayer, npcData, killCnt)
|
| | | PlayerVip.DoAddVIPKillLVExp(curPlayer, npcLV, killCnt)
|
| | |
|
| | | # SPֵ
|
| | | PlayerControl.AddZhenQiByKillNPC(curPlayer, npcData.GetSP(), killCnt)
|
| | | PlayerControl.AddZhenQiByKillNPC(curPlayer, sp, killCnt)
|
| | |
|
| | | # 击杀特定NPC成就
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KillSpecificNPC, killCnt, [npcID])
|
| | | # 日常活动
|
| | | if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGOnDayEx):
|
| | | if npcData.GetLV()>=curPlayer.GetLV() - IpyGameDataPY.GetFuncCfg('DailyQuestKillMonster'):
|
| | | if npcLV>=curPlayer.GetLV() - IpyGameDataPY.GetFuncCfg('DailyQuestKillMonster'):
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_KillNPC, killCnt)
|
| | | # 击杀任务怪, 杀怪日常已经没有了,暂时屏蔽
|
| | | #for _ in xrange(killCnt):
|
| | |
| | | if not npcData:
|
| | | return
|
| | |
|
| | | realmLV = PlayerControl.GetDifficultyRealmLV(PlayerControl.GetRealmDifficulty(curPlayer))
|
| | | realmNPCIpyData = IpyGameDataPY.GetIpyGameDataNotLog("NPCRealmStrengthen", npcID, realmLV)
|
| | | |
| | | # 1. 经验
|
| | | exp = CalcTJGExp(curPlayer, times, npcData)
|
| | | exp = CalcTJGExp(curPlayer, times, npcData, realmNPCIpyData)
|
| | | expRate = PlayerControl.GetLimitExpRate(curPlayer, ChConfig.ExpRateLimitType_Recover)
|
| | | exp = int(exp * expRate / float(ChConfig.Def_MaxRateValue))
|
| | | # 通知脱机挂被杀是的时间 和 被杀后的脱机挂时间可获得的经验
|
| | |
| | |
|
| | | maxMapID = mapID
|
| | |
|
| | | GameWorld.DebugLog("FindTJGNPC maxMapID=%s" % maxMapID)
|
| | | if not maxMapID:
|
| | | return 0
|
| | |
|
| | | # ---找到挂机等级点---
|
| | | lv = curPlayer.GetLV()
|
| | | myPoint = None
|
| | | |
| | | # 注: NPCRealmStrengthen MapEventPoint 这两张配置表需要确保相关共用字段命名一样
|
| | | realmMapIDList = IpyGameDataPY.GetFuncEvalCfg("RealmDifficulty", 1)
|
| | | realmDifficulty = PlayerControl.GetRealmDifficulty(curPlayer)
|
| | | if maxMapID in realmMapIDList and realmDifficulty:
|
| | | realmLV = PlayerControl.GetDifficultyRealmLV(realmDifficulty)
|
| | | mapList = IpyGameDataPY.GetIpyGameDataByCondition("NPCRealmStrengthen", {"MapID":maxMapID, "RealmDifficulty":realmLV}, True)
|
| | | else:
|
| | | mapList = IpyGameDataPY.GetIpyGameDataByCondition("MapEventPoint", {"MapID":maxMapID}, True)
|
| | |
|
| | | mapEffList = [] # 有效挂机点,同地图中存在不需要挂机的NPC点
|