| | |
| | | useSkill = changeSkill
|
| | | #GameWorld.DebugLog("----随机技能 %s"%useSkill.GetSkillID())
|
| | |
|
| | | if PetControl.IsPet(curNPC):
|
| | | petOwner = PetControl.GetPetOwner(curNPC)
|
| | | |
| | | if petOwner == None:
|
| | | GameWorld.ErrLog("宠物(%s)找不到主人"%curNPC.GetRolePet().PetID)
|
| | | return False
|
| | | |
| | | #血量条件判定
|
| | | effect = SkillCommon.GetSkillEffectByEffectID(useSkill, ChConfig.Def_Skill_Effect_HPPerLimit)
|
| | | if effect:
|
| | | if GameObj.GetHP(petOwner)*ChConfig.Def_MaxRateValue/GameObj.GetMaxHP(petOwner) >= effect.GetEffectValue(0):
|
| | | return False
|
| | | #===========================================================================
|
| | | # 改成被动触发
|
| | | # if PetControl.IsPet(curNPC):
|
| | | # petOwner = PetControl.GetPetOwner(curNPC)
|
| | | # |
| | | # if petOwner == None:
|
| | | # GameWorld.ErrLog("宠物(%s)找不到主人"%curNPC.GetRolePet().PetID)
|
| | | # return False
|
| | | # |
| | | # #血量条件判定
|
| | | # effect = SkillCommon.GetSkillEffectByEffectID(useSkill, ChConfig.Def_Skill_Effect_HPPerLimit)
|
| | | # if effect:
|
| | | # if GameObj.GetHP(petOwner)*ChConfig.Def_MaxRateValue/GameObj.GetMaxHP(petOwner) >= effect.GetEffectValue(0):
|
| | | # return False
|
| | | #===========================================================================
|
| | |
|
| | | skillTag = SkillShell.GetSkillAffectTag(useSkill)
|
| | | skillAim = SkillShell.GetSkillFireAim(useSkill)
|
| | |
| | |
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | |
|
| | | def GetCanUseRealmSuppressSkll(curNPC, curSkill):
|
| | | if curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_RealmSuppress:
|
| | | # 非境界压制技能返回可用
|
| | | return True
|
| | | |
| | | # 境界压制技能需判断 周围是否有低境界玩家
|
| | | npcRealmLV = NPCCommon.GetRealmLV(curNPC)
|
| | | angryManager = curNPC.GetNPCAngry()
|
| | | |
| | | for i in range(0, angryManager.GetAngryCount()) :
|
| | | curAngry = angryManager.GetAngryValueTag(i)
|
| | | if curAngry == None or curAngry.GetObjID() == 0:
|
| | | continue
|
| | | |
| | | #仇恨值
|
| | | curAngryValue = curAngry.GetAngryValue()
|
| | | if curAngryValue == 0:
|
| | | continue
|
| | | |
| | | if curAngry.GetIsDisable():
|
| | | continue
|
| | | |
| | | angryID = curAngry.GetObjID()
|
| | | angryObjType = curAngry.GetObjType()
|
| | | if angryObjType != IPY_GameWorld.gotPlayer:
|
| | | continue
|
| | | |
| | | curTag = GameWorld.GetObj(angryID, angryObjType)
|
| | | if not curTag:
|
| | | continue
|
| | | if curTag.GetOfficialRank() < npcRealmLV:
|
| | | return True
|
| | | |
| | | return False
|
| | | |
| | | |
| | | ##NPC自动释放技能
|
| | | # @param curNPC NPC实例
|
| | | # @param curTag 攻击目标
|
| | |
| | | if SkillShell.GetSkillFireAim(useSkill) == ChConfig.Def_UseSkillAim_Obj:
|
| | | # 主目标对象判定, 不能释放则不进入队列
|
| | | curSkillUseTag = SkillShell.GetSkillAffectTag(useSkill)
|
| | | hurtTypeList = ChConfig.Def_Dict_UseSkillTag_ObjType.get(curSkillUseTag)
|
| | | if not hurtTypeList:
|
| | | continue
|
| | | |
| | | if tagObjType not in hurtTypeList:
|
| | | continue
|
| | | if curSkillUseTag != ChConfig.Def_UseSkillTag_AppointNPC:
|
| | | hurtTypeList = ChConfig.Def_Dict_UseSkillTag_ObjType.get(curSkillUseTag)
|
| | | if not hurtTypeList:
|
| | | continue
|
| | | |
| | | if tagObjType not in hurtTypeList:
|
| | | continue
|
| | |
|
| | | if triggerDict != {}:
|
| | | if not CheckSkillTrigger(curNPC, triggerDict, index, tick):
|
| | | continue
|
| | |
|
| | | # 境界压制需要根据仇恨列表中的玩家是否有压制
|
| | | if not GetCanUseRealmSuppressSkll(curNPC, useSkill):
|
| | | continue
|
| | | |
| | | useCnt = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_SkillUseCnt % useSkill.GetSkillTypeID()) # 该技能已使用次数
|
| | | useSkillList.append([useCnt, index, useSkill])
|
| | |
|
| | |
| | | # @return 布尔值
|
| | | def CheckSkillTrigger(curNPC, triggerDict, npcSkillindex, tick):
|
| | | skillInfo = triggerDict.get(npcSkillindex)
|
| | |
|
| | | if skillInfo != None:
|
| | | #当前血量
|
| | | hpPercent = int(curNPC.GetHP()/float(GameObj.GetMaxHP(curNPC))*100)
|
| | | hpPercent = int(GameObj.GetHP(curNPC)/float(GameObj.GetMaxHP(curNPC))*100)
|
| | | checkHP = skillInfo[0]
|
| | |
|
| | | #血量未到
|