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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/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
import CrossRealmPlayer
#---------------------------------------------------------------------
#È«¾Ö±äÁ¿
#---------------------------------------------------------------------
 
#---------------------------------------------------------------------
#Âß¼­ÊµÏÖ
 
## 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
            
            if mapID in ChConfig.Def_CrossZoneMapTableName:
                tableName = ChConfig.Def_CrossZoneMapTableName[mapID]
                realMapID = GameWorld.GetGameWorld().GetRealMapID()
                copyMapID = GameWorld.GetGameWorld().GetCopyMapID()
                zoneIpyData = IpyGameDataPY.GetIpyGameData(tableName, realMapID, mapID, copyMapID)
                if not zoneIpyData:
                    continue
                zoneID = zoneIpyData.GetZoneID()
                key = ShareDefine.Def_Notify_WorldKey_GameWorldBossRebornCross % (zoneID, bossID)
            else:
                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_ActBossLastRebornSign % 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