| #!/usr/bin/python  | 
| # -*- coding: GBK -*-  | 
|   | 
| ##@package SummonNPCGroup  | 
| # ÔÚÉí±ßË¢ÕÙ»½NPC idÇø¼ä <NPCID>  | 
| #  | 
| # @author Mark  | 
| # @date 2010-4-23  | 
| # @version 1.0  | 
| #  | 
| # ÐÞ¸Äʱ¼ä ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ  | 
| # VER = "2010-05-12 18:30" zhengyang Ìí¼Ó×¢ÊÍ  | 
| #  | 
| # Ä£¿éÏêϸ˵Ã÷  | 
| import GameMap  | 
| import ChConfig  | 
| import GameWorld  | 
| import NPCCommon  | 
| #Â߼ʵÏÖ  | 
| ## ÔÚÉí±ßË¢ÕÙ»½NPC idÇø¼ä <NPCID>  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @param list ²ÎÊýÁбí [tagID, tagID]  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def OnExec(curPlayer, list):  | 
| #===============================================================================  | 
| #    #¼ì²âµ±Ç°Íæ¼ÒÊÇ·ñÓÐȨÏÞ  | 
| #    #if   | 
| #    #µÚÒ»½×¶Î²»´¦Àí  | 
| #===============================================================================  | 
|       | 
|     #ÊäÈëÃüÁî¸ñʽ´íÎó  | 
|     if len(list) != 2:  | 
|         return  | 
|       | 
|     for tagID in range(list[0],list[1]+1):  | 
|         if not GameWorld.GetGameData().FindNPCDataByID(tagID):  | 
|             continue  | 
|         #ÔÚÍæ¼ÒÖÜΧѡÔñÒ»¸öÎÞÍæ¼ÒµÄµã  | 
|         resultPos=GameMap.GetEmptyPlaceInArea(curPlayer.GetPosX(), curPlayer.GetPosY(), 6 )  | 
|         #Éú³ÉNPC  | 
|         summonNPC=curPlayer.SummonNewNPC()  | 
|         summonNPC.SetNPCTypeID(tagID)  | 
|         summonNPC.SetAIType(200)  | 
|         summonNPC.GetNPCAngry().Init(ChConfig.Def_SummonNPC_Angry_Count)  | 
|         #³õʼ»¯  | 
|         NPCCommon.InitNPC(summonNPC)   | 
|         summonNPC.SetOwner(curPlayer)  | 
|           | 
|         summonNPC.Reborn(resultPos.GetPosX(), resultPos.GetPosY())  | 
|           | 
|           | 
|       | 
|       | 
|   |