hxp
2025-06-12 edc3910a9d090e5df4deb2dbc37709a740375938
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/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