#!/usr/bin/python # -*- coding: GBK -*- #--------------------------------------------------------------------- ##@package SkillModule_16 # Ⱥ¹¥¼¼ÄÜ£ºÕÙ»½ ¼Ì³ÐÖ÷ÈË # # @author Alee # @date 2011-03-23 17:30 # @version 1.2 # #Ä£¿éÏêϸ˵Ã÷£ºÕÙ»½ ¼Ì³ÐÖ÷ÈË ¸ù¾Ý1013¾ö¶¨ÐÐΪ #--------------------------------------------------------------------- """Version = 2013-10-31 14:45""" #µ¼Èë import GameWorld import ChConfig import GameMap import NPCCommon import BaseAttack import IPY_GameWorld import ItemControler import GameObj import SkillCommon ##¼Ì³ÐÍæ¼ÒÊôÐÔµÄÕÙ»½ # @param attacker ¹¥»÷ÕßʵÀý # @param defender ·ÀÊØÕßʵÀý # @param curSkill ¼¼ÄÜʵÀý # @param tagRoundPosX ÇøÓò×ø±êX # @param tagRoundPosY ÇøÓò×ø±êY # @param isEnhanceSkill ÊÇ·ñΪ¸½¼Ó¼¼ÄÜ # @param tick ʱ¼ä´Á # @return ·µ»ØÖµÎªÕæ, Êͷųɹ¦ # @remarks ¼Ì³ÐÍæ¼ÒÊôÐÔµÄÕÙ»½ def UseSkill(attacker, defender, curSkill, tagRoundPosX, tagRoundPosY, isEnhanceSkill, tick): curSummonID = curSkill.GetEffect(0).GetEffectValue(0) if curSummonID == 0: GameWorld.Log("Ìî±í´íÎó,ÕÙ»½IDΪ0", attacker.GetPlayerID()) return #---¹¥»÷±éÀúÆðµãÓÅÏȼ¶ 1.ÕÒÖ¸¶¨µã 2.·ÀÊØÕߣ¨°üÀ¨×Ô¼º£©--- if tagRoundPosX == -1 or tagRoundPosY == -1: #ÆðµãÊǹ¥»÷·½£¬»¹ÊÇÊܺ¦·½£¬»¹ÊÇµãµØ tagRoundPosX = defender.GetPosX() tagRoundPosY = defender.GetPosY() if attacker.GetGameObjType() == IPY_GameWorld.gotPlayer: #ÕÙ»½Áé PlayerSummonNPC(attacker, curSkill, curSummonID, tagRoundPosX, tagRoundPosY, tick) else: DoLogic_NPC_UseSkill_SummonNPC(attacker, curSkill, curSummonID, defender.GetPosX(), defender.GetPosY(), tick) #GameWorld.Log("¼Ì³ÐÍæ¼ÒÊôÐÔÕÙ»½ËÑÊÞ£¬Ê¹Óóɹ¦") return BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill) ## Íæ¼ÒÕÙ»½NPC ¼Ì³ÐÍæ¼ÒÊôÐÔµÄÕÙ»½ # @param curPlayer µ±Ç°Íæ¼Ò # @param curSkill ÕÙ»½¼¼ÄÜ # @param summonID ÕÙ»½ÊÞID # @param summonDist ÕÙ»½ÊÞÊôÐÔÁбí # @param tick ÕÙ»½ÊÞÀë×Ô¼ºµÄ¾àÀë # @return Noneµ±Ç°Ê±¼ä # @remarks º¯ÊýÏêϸ˵Ã÷. ÌØÊâ´¦Àí£¬ÒòΪÊǼÙÕÙ»½²»×ßͨÓÃÂß¼­ def PlayerSummonNPC(curPlayer, curSkill, summonID, tagRoundPosX, tagRoundPosY, tick): #½«ÒªÕÙ»½³öµÄNPC summonNPC = curPlayer.SummonNewNPC() #ÉèÖÃÕÙ»½ÊÞ»ù´¡ÐÅÏ¢ summonNPC.SetNPCTypeID(summonID) # ¼´ÉèÖÃÁË»ù´¡ÊôÐÔ£¬¼¼ÄÜµÈ lvSummonNPC = curPlayer.GetLV() summonNPC.SetLV(lvSummonNPC) summonNPC.SetCountry(curPlayer.GetCountry()) summonNPC.GetNPCAngry().Init(ChConfig.Def_SummonNPC_Angry_Count) #³õʼ»¯ NPCCommon.InitNPC(summonNPC) #Íæ¼ÒÕÙ»½ÊÞÁбíÌí¼ÓÕÙ»½ÊÞ,ÕÙ»½ÊÞÌí¼ÓÖ÷ÈË summonNPC.SetOwner(curPlayer) if summonNPC.GetOrgSpeed(): summonPos = GameMap.GetEmptyPlaceInArea(curPlayer.GetPosX(), curPlayer.GetPosY(), 3) tagRoundPosX = summonPos.GetPosX() tagRoundPosY = summonPos.GetPosY() #½«ÕÙ»½ÊÞÕÙ»½³öÀ´ summonNPC.Reborn(tagRoundPosX, tagRoundPosY) summonNPC.SetBornTime(tick) summonNPC.SetLastTime(curSkill.GetLastTime()) atkper = 10000 # ĬÈϰٷְټ̳ÐÊôÐÔ findEffect = SkillCommon.GetSkillEffectByEffectID(curSkill, ChConfig.Def_Skill_Effect_SummonAttr) if findEffect: atkper = findEffect.GetEffectValue(0) if findEffect.GetEffectValue(1) == 0: # ¸úËæÈËÎï¹¥»÷ summonNPC.SetDict(ChConfig.Def_PlayerKey_AttackFollowMaster, 1) # ÕÙ»½Ê޼̳ÐÖ÷ÈËËùÓÐÊôÐÔ±êʶ£¬¼ÆËãʱֱ½ÓÈ¡Ö÷ÈËÊôÐÔ summonNPC.SetDict(ChConfig.Def_GameObjKey_InheritOwner, atkper) #---ÉèÖûù´¡Öµ--- #summonNPC.SetBaseMinAtk(int(curPlayer.GetMinAtk()*atkper)) #summonNPC.SetBaseMaxAtk(int(curPlayer.GetMaxAtk()*atkper)) summonNPC.SetBaseHit(curPlayer.GetHit()) #È¡È˵Ĺ¥»÷¼ä¸ô summonNPC.SetBaseAtkInterval(curPlayer.GetAtkInterval()) summonNPC.SetBaseMissRate(curPlayer.GetMiss()) summonNPC.SetBaseSuperHiteRate(curPlayer.GetSuperHitRate()) # ¼Ì³Ð¼¼Äܵȼ¶ SkillCommon.SetSummonNPCSkillLV(summonNPC, curSkill) summonNPC.SetVisible(True) summonNPC.SetCanAttack(False) return True def DoLogic_NPC_UseSkill_SummonNPC(curNPC, curSkill, summonNPCID, tagRoundPosX, tagRoundPosY, tick): # Ô¤¾¯ÕÙ»½ if curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_SkillWarnSkillID) == curSkill.GetSkillID(): tagRoundPosX = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_SkillWarnPosX % 0) tagRoundPosY = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_SkillWarnPosY % 0) #ÐÂÔöÕÙ»½ÊÞ ÕÒ²»µ½ÔòÌí¼Ó curNPC.AddSummonCount(1, summonNPCID, 3) for i in range(0, curNPC.GetSummonCount()): summonNPC = curNPC.GetSummonNPCAt(i) if not summonNPC: continue if summonNPC.GetNPCID() != summonNPCID: continue #ÒÑÕÙ»½ if GameObj.GetHP(summonNPC) > 0: continue return SummonNPCByInstance(curNPC, summonNPC, curSkill, tagRoundPosX, tagRoundPosY, tick) return # ÕÙ»½ÊÞʵÀý def SummonNPCByInstance(curNPC, summonNPC, curSkill, tagRoundPosX, tagRoundPosY, tick): #ÉèÖÃÕÙ»½ÊÞ»ù´¡ÐÅÏ¢ lvSummonNPC = NPCCommon.GetNPCLV(curNPC) summonNPC.SetLV(lvSummonNPC) #³õʼ»¯ NPCCommon.InitNPC(summonNPC) if summonNPC.GetOrgSpeed(): summonPos = GameMap.GetEmptyPlaceInArea(curNPC.GetPosX(), curNPC.GetPosY(), 3) tagRoundPosX = summonPos.GetPosX() tagRoundPosY = summonPos.GetPosY() #½«ÕÙ»½ÊÞÕÙ»½³öÀ´ summonNPC.Reborn(tagRoundPosX, tagRoundPosY) summonNPC.SetBornTime(tick) summonNPC.SetLastTime(curSkill.GetLastTime()) atkper = 10000 findEffect = SkillCommon.GetSkillEffectByEffectID(curSkill, ChConfig.Def_Skill_Effect_SummonAttr) if findEffect: atkper = findEffect.GetEffectValue(0) # ÕÙ»½Ê޼̳ÐÖ÷ÈËËùÓÐÊôÐÔ±êʶ£¬¼ÆËãʱֱ½ÓÈ¡Ö÷ÈËÊôÐÔ summonNPC.SetDict(ChConfig.Def_GameObjKey_InheritOwner, atkper) #---ÉèÖûù´¡Öµ--- #summonNPC.SetBaseMinAtk(int(curNPC.GetMinAtk()*atkper)) #summonNPC.SetBaseMaxAtk(int(curNPC.GetMaxAtk()*atkper)) summonNPC.SetBaseHit(curNPC.GetHit()) #NPCCommon.SetRealmLV(summonNPC, NPCCommon.GetRealmLV(curNPC)) # ¼Ì³Ð¾³½ç #NPCCommon.SetFinalHurt(summonNPC, NPCCommon.GetFinalHurt(curNPC)) # ×îÖÕÉ˺¦ #summonNPC.SetBaseAtkInterval(500) summonNPC.SetBaseMissRate(curNPC.GetMiss()) summonNPC.SetVisible(True) summonNPC.SetCanAttack(False)