#!/usr/bin/python  
 | 
# -*- coding: GBK -*-  
 | 
  
 | 
##@package KillNPCByID  
 | 
# É±ËÀNPC <NPCID> [ÊýÁ¿]  
 | 
#  
 | 
# @author ifo  
 | 
# @date 2010-4-22  
 | 
# @version 1.0  
 | 
#  
 | 
# ÐÞ¸Äʱ¼ä ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ  
 | 
# VER = "2010-05-12 18:30" zhengyang Ìí¼Ó×¢ÊÍ  
 | 
#  
 | 
# Ä£¿éÏêϸ˵Ã÷  
 | 
  
 | 
import NPCCommon  
 | 
import GameWorld  
 | 
## GMÃüÁîÖ´ÐÐÈë¿Ú  
 | 
#  @param curPlayer µ±Ç°Íæ¼Ò  
 | 
#  @param playerList ²ÎÊýÁбí [<NPCID> [ÊýÁ¿]]  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def OnExec(curPlayer,playerList):  
 | 
    if len(playerList) < 1 or len(playerList) >2:  
 | 
        #²ÎÊý²»ÕýÈ·  
 | 
        return  
 | 
      
 | 
    gameNPC = GameWorld.GetNPCManager()    
 | 
    if len(playerList) == 1:  
 | 
        #ɱËÀÖ¸¶¨ID NPC  
 | 
        for i in range(0,gameNPC.GetNPCCount()):  
 | 
            curNpc = gameNPC.GetNPCByIndex(i)  
 | 
            if curNpc.GetNPCID() == playerList[0]:  
 | 
                npcControl = NPCCommon.NPCControl(curNpc)  
 | 
                npcControl.SetKilled()  
 | 
          
 | 
    if len(playerList) == 2:  
 | 
        #ɱËÀÖ¸¶¨ID Ö¸¶¨ÊýÁ¿NPC  
 | 
        killNPC=0  
 | 
        for i in range(0,gameNPC.GetNPCCount()):  
 | 
            curNpc = gameNPC.GetNPCByIndex(i)  
 | 
            if curNpc.GetNPCID() == playerList[0]:  
 | 
                npcControl = NPCCommon.NPCControl(curNpc)  
 | 
                npcControl.SetKilled()  
 | 
                killNPC += 1  
 | 
                if killNPC == playerList[1]:  
 | 
                    return  
 | 
         
 |