| | |
| | | def SetSuppressFightPower(curNPC, value): return curNPC.SetThunderDef(min(value, ShareDefine.Def_UpperLimit_DWord))
|
| | | def GetCommendFightPower(curNPC): return curNPC.GetFireDef() # 火防代表推荐战力
|
| | | def GetDropOwnerType(curNPC): return curNPC.GetThunderAtk() # 雷攻代表掉落归属类型
|
| | | def GetFaction(curNPC): return curNPC.GetCountry()
|
| | | def GetFaction(curNPC): return GameObj.GetFaction(curNPC)
|
| | | def GetSkillAtkRate(curNPC): return curNPC.GetPoisionAtk() # 毒攻代表NPC技能伤害加成万分率
|
| | | def GetFinalHurt(curNPC): return curNPC.GetFireAtk() # 火攻代表NPC最终固定伤害加成, 普攻也有效果
|
| | | def SetFinalHurt(curNPC, hurt): return curNPC.SetFireAtk(hurt) # 火攻代表NPC最终固定伤害加成, 普攻也有效果
|
| | |
| | | # @return 如果召唤失败返回None 否则返回召唤的NPC的实例
|
| | | # @remarks 在地图里召唤NPC 根据NPCID 出生点 AI类型 和TICK
|
| | | def SummonMapNpc(npcId, rebornX, rebornY, aiType=0, lastTime=0, playerID=0, sightLevel=0, refreshID=0, pvpPlayerID=0):
|
| | | npcData = GameWorld.GetGameData().FindNPCDataByID(npcId)
|
| | | if not npcData:
|
| | | GameWorld.ErrLog("找不到该NPCID: %s" % npcId)
|
| | | return
|
| | | curSummon = GameWorld.GetNPCManager().AddPlayerSummonNPC()
|
| | | if not curSummon:
|
| | | return
|
| | |
| | | #__NotifyMapPlayerSummonMapNPC(npcId, rebornX, rebornY)
|
| | | return curSummon
|
| | |
|
| | | def SummonNPC(gameObj, npcID, rebornX, rebornY):
|
| | | ''' 某个实例进行召唤,有从属关系
|
| | | '''
|
| | | npcData = GameWorld.GetGameData().FindNPCDataByID(npcID)
|
| | | if not npcData:
|
| | | GameWorld.ErrLog("找不到该NPCID: %s" % npcID)
|
| | | return
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | curSummon = gameObj.SummonNewNPC()
|
| | | curSummon.SetLV(gameObj.GetLV())
|
| | | curSummon.SetCountry(gameObj.GetCountry())
|
| | | curSummon.GetNPCAngry().Init(ChConfig.Def_SummonNPC_Angry_Count)
|
| | | curSummon.SetOwner(gameObj)
|
| | | else:
|
| | | sumCount, angryCount = 1, 3
|
| | | if not gameObj.AddSummonCount(sumCount, npcID, angryCount):
|
| | | return
|
| | | #取新增的一只,最后一个
|
| | | index = gameObj.GetSummonCount() - 1
|
| | | if index < 0:
|
| | | return |
| | | curSummon = gameObj.GetSummonNPCAt(index)
|
| | | |
| | | if not curSummon:
|
| | | return
|
| | | |
| | | tick = GameWorld.GetGameWorld().GetTick()
|
| | | curSummon.SetNPCTypeID(npcID)
|
| | | curSummon.SetBornTime(tick)
|
| | | InitNPC(curSummon) |
| | | curSummon.SetSightLevel(gameObj.GetSightLevel())
|
| | | |
| | | curSummon.Reborn(rebornX, rebornY, False)
|
| | | NPCControl(curSummon).DoNPCRebornCommLogic(tick)
|
| | | #curSummon.RefreshView()
|
| | | return curSummon
|
| | |
|
| | | ## 通知地图内玩家,地图出现召唤NPC
|
| | | # @param npcId: NPCID
|
| | | # @param rebornX: 出生点X
|