#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#
|
##@package Boss
|
# ¸´»îµØÍ¼ÖÐ,ÒѾËÀÍöµÄÆÕͨNPC( ²¼¹ÖÆ÷²¼µÄ )
|
#
|
# @author Mark
|
# @date 2010-4-21
|
# @version 1.2
|
#
|
# ÐÞ¸Äʱ¼ä ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ
|
# @change: "2013-01-16 19:00" wdb ·À·¶ËÀÍöµÄÕÙ»½ÊÞ±»reborn
|
# @change: "2014-10-29 23:30" hxp Ôö¼Ó¿ÉˢбêʶµãˢеÄÊÀ½çboss
|
#------------------------------------------------------------------------------
|
"""Version = 2014-10-29 23:30"""
|
#---------------------------------------------------------------------
|
# Ä£¿éÏêϸ˵Ã÷
|
|
#µ¼Èë
|
import GameWorld
|
import ChConfig
|
import IPY_GameWorld
|
import NPCCommon
|
import ShareDefine
|
import IpyGameDataPY
|
#---------------------------------------------------------------------
|
#È«¾Ö±äÁ¿
|
#---------------------------------------------------------------------
|
|
#---------------------------------------------------------------------
|
#Â߼ʵÏÖ
|
|
## GMÃüÁîÖ´ÐÐÈë¿Ú
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @param msgList ²ÎÊýÁбí []
|
# @return None
|
# @remarks º¯ÊýÏêϸ˵Ã÷.
|
def OnExec( curPlayer, msgList ):
|
# ˢбêʶµãˢеÄbossÖØÉú
|
mapID = GameWorld.GetMap().GetMapID()
|
|
dataList = IpyGameDataPY.GetIpyGameDataByCondition('BOSSInfo', {"MapID":mapID}, returnList=True)
|
if dataList:
|
for ipyData in dataList:
|
bossID = ipyData.GetNPCID()
|
if not bossID:
|
continue
|
|
key = ShareDefine.Def_Notify_WorldKey_GameWorldBossReborn % bossID
|
GameWorld.GetGameWorld().SetGameWorldDict(key, 1)
|
|
bossKey = ChConfig.Map_NPC_WorldBossLastReBornTick % bossID
|
GameWorld.GetGameFB().SetGameFBDict(bossKey, 0)
|
|
bossKey = ChConfig.Map_NPC_WorldBossLastReBornTick % ipyData.GetStoneNPCID()
|
GameWorld.GetGameFB().SetGameFBDict(bossKey, 0)
|
|
GameWorld.GetGameFB().SetGameFBDict(ChConfig.Map_NPC_ActivityBossRebornCount % ipyData.GetRefreshMark(), 0)
|
|
gameNPCManager = GameWorld.GetNPCManager()
|
tick = GameWorld.GetGameWorld().GetTick()
|
|
for index in range( 0, gameNPCManager.GetNPCCount() ):
|
curNPC = gameNPCManager.GetNPCByIndex( index )
|
|
if not curNPC.GetID() or not curNPC.GetNPCID():
|
return
|
|
if not ChConfig.IsGameBoss(curNPC):
|
continue
|
|
#ÒѾËÀÍöµÄNPC
|
if curNPC.GetCurAction() == IPY_GameWorld.laNPCDie or not curNPC.IsAlive():
|
npcControl = NPCCommon.NPCControl(curNPC)
|
npcControl.DoNPCReborn( tick )
|
|
return
|
|
## ¸øÓè¿Í»§¶ËDEBUGÌáʾ
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @param msg logÐÅÏ¢
|
# @return None
|
# @remarks º¯ÊýÏêϸ˵Ã÷.
|
def Log( curPlayer, msg ):
|
GameWorld.DebugAnswer(curPlayer, msg )
|
return
|