--[[dmap4_Baoxiang_ID1 = 0 dmap4_Baoxiang_ID2 = 0 dmap4_Baoxiang_ID3 = 0 dmap4_Baoxiang_ID4 = 0 dmap4_Baoxiang_ID5 = 0 dmap4_Baoxiang_ID6 = 0 dmap4_Baoxiang_ID7 = 0 dmap4_Baoxiang_ID8 = 0 dmap4_Baoxiang_ID9 = 0 dmap4_Baoxiang_ID10 = 0 dmap4_Baoxiang_ID11 = 0 dmap4_Baoxiang_ID12 = 0 dmap4_Baoxiang_ID13 = 0 dmap4_Baoxiang_ID14 = 0 dmap4_Baoxiang_ID15 = 0 dmap4_Baoxiang_ID16 = 0 dmap4_Baoxiang_ID17 = 0 dmap4_Baoxiang_ID18 = 0 dmap4_Baoxiang_ID19 = 0 dmap4_Baoxiang_ID20 = 0 dmap4_Baoxiang_ID21 = 0 dmap4_Baoxiang_ID22 = 0 dmap4_Baoxiang_ID23 = 0 dmap4_Baoxiang_ID24 = 0 dmap4_Baoxiang_ID25 = 0 dmap4_Baoxiang_ID26 = 0 dmap4_Baoxiang_ID27 = 0 dmap4_Baoxiang_ID28 = 0 dmap4_Baoxiang_ID29 = 0 dmap4_Baoxiang_ID30 = 0 dmap4_Baoxiang_ID31 = 0 dmap4_Baoxiang_ID32 = 0 dmap4_Baoxiang_ID33 = 0 dmap4_Baoxiang_ID34 = 0 dmap4_Baoxiang_ID35 = 0 dmap4_Baoxiang_ID36 = 0 ]] --地图位数占用:1 function BaoZangDebugLog(MapID, InstanceID, Text) end function BaoZangValidCreatureID(CreatureID) if CreatureID ~= nil and CreatureID ~= 0 and CreatureID ~= -1 then return true end return false end function BaoZangCreateCreatureSafe(MapID, InstanceID, CreatureID, X, Y, Z) local NewCreatureID = map.MapCreateCreature(MapID, InstanceID, CreatureID, X, Y, Z) if BaoZangValidCreatureID(NewCreatureID) == false then BaoZangDebugLog(MapID, InstanceID, "create_creature_failed_" .. CreatureID) end return NewCreatureID end function BaoZangTryEventGuard(MapID, InstanceID, GuardIndex, LogName) local OldGuard = map.GetMapScriptData(MapID, InstanceID, 1, GuardIndex) if OldGuard == 1 then BaoZangDebugLog(MapID, InstanceID, "skip_duplicate_event_" .. LogName) return false end map.SetMapScriptData(MapID, InstanceID, 1, GuardIndex, 1) return true end function BaoZangSpawnThief(MapID, InstanceID, X, Y, Z, ThiefFlag, NoticeID) local OldThiefFlag = map.GetMapScriptData(MapID, InstanceID, 1, 1) if OldThiefFlag ~= nil and OldThiefFlag ~= 0 then BaoZangDebugLog(MapID, InstanceID, "skip_duplicate_thief_active_" .. OldThiefFlag) return end local guaiID = BaoZangCreateCreatureSafe(MapID, InstanceID, 1086027, X/50, Y, Z/50) if BaoZangValidCreatureID(guaiID) then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 101, NoticeID) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) map.SetMapScriptData(MapID, InstanceID, 1, 1, ThiefFlag) else BaoZangDebugLog(MapID, InstanceID, "skip_thief_buff_invalid_id") end end function BaoZangForceNextMarker(MapID, InstanceID, Step) local MarkerID = 0 if Step == 1 then MarkerID = 1086122 elseif Step == 2 then MarkerID = 1086127 elseif Step == 3 then MarkerID = 1086132 elseif Step == 4 then MarkerID = 1086137 elseif Step == 5 then MarkerID = 1086141 elseif Step == 6 then MarkerID = 1086145 end if MarkerID ~= 0 then BaoZangDebugLog(MapID, InstanceID, "force_next_marker_" .. MarkerID) BaoZangCreateCreatureSafe(MapID, InstanceID, MarkerID, 13300/50, 4740, 15400/50) end end function BaoZangManualGuardIndex(GuardID) if GuardID == 1086133 then return 23 elseif GuardID == 1086134 then return 24 elseif GuardID == 1086135 then return 25 elseif GuardID == 1086138 then return 26 elseif GuardID == 1086139 then return 27 elseif GuardID == 1086140 then return 28 elseif GuardID == 1086142 then return 29 elseif GuardID == 1086143 then return 30 elseif GuardID == 1086022 then return 41 elseif GuardID == 1086023 then return 42 elseif GuardID == 1086024 then return 31 elseif GuardID == 1086025 then return 32 elseif GuardID == 1086026 then return 33 elseif GuardID == 1086020 then return 34 elseif GuardID == 1086123 then return 35 elseif GuardID == 1086124 then return 36 elseif GuardID == 1086125 then return 37 elseif GuardID == 1086128 then return 38 elseif GuardID == 1086129 then return 39 elseif GuardID == 1086130 then return 40 end return 0 end function BaoZangTryManualGuard(MapID, InstanceID, GuardID, LogName) local GuardIndex = BaoZangManualGuardIndex(GuardID) if GuardIndex == 0 then return true end local OldGuard = map.GetMapScriptData(MapID, InstanceID, 1, GuardIndex) if OldGuard == 1 then BaoZangDebugLog(MapID, InstanceID, "skip_duplicate_manual_spawn_" .. LogName) return false end map.SetMapScriptData(MapID, InstanceID, 1, GuardIndex, 1) return true end function BaoZangForceManualCreature(MapID, InstanceID, CreatureID, LogName) if BaoZangTryManualGuard(MapID, InstanceID, CreatureID, LogName) then BaoZangDebugLog(MapID, InstanceID, LogName) BaoZangCreateCreatureSafe(MapID, InstanceID, CreatureID, 13300/50, 4740, 15400/50) end end function BaoZangSpawnManualMobs(MapID, InstanceID, LogName, NextMarkerID, MonsterID1, MonsterID2, MonsterID3) if BaoZangTryManualGuard(MapID, InstanceID, NextMarkerID, LogName) == false then return end BaoZangDebugLog(MapID, InstanceID, "manual_spawn_" .. LogName) map.SetMapScriptData(MapID, InstanceID, 1, 21, 0) map.SetMapScriptData(MapID, InstanceID, 1, 22, NextMarkerID) for i = 1, 5 do local x = math.random(4050, 22600) local z = math.random(14800, 16000) BaoZangCreateCreatureSafe(MapID, InstanceID, MonsterID1, x/50, 4740, z/50) end for i = 1, 5 do local x = math.random(4050, 22600) local z = math.random(14800, 16000) BaoZangCreateCreatureSafe(MapID, InstanceID, MonsterID2, x/50, 4740, z/50) end for i = 1, 5 do local x = math.random(4050, 22600) local z = math.random(14800, 16000) BaoZangCreateCreatureSafe(MapID, InstanceID, MonsterID3, x/50, 4740, z/50) end end function BaoZangManualMobDie(MapID, InstanceID, MonsterID) local NextMarkerID = map.GetMapScriptData(MapID, InstanceID, 1, 22) if NextMarkerID ~= nil and NextMarkerID ~= 0 then local OldDeadCount = map.GetMapScriptData(MapID, InstanceID, 1, 21) if OldDeadCount == nil then OldDeadCount = 0 end local DeadCount = OldDeadCount + 1 map.SetMapScriptData(MapID, InstanceID, 1, 21, DeadCount) BaoZangDebugLog(MapID, InstanceID, "manual_wave_dead_next_" .. NextMarkerID .. "_count_" .. DeadCount) if DeadCount >= 15 then map.SetMapScriptData(MapID, InstanceID, 1, 21, 0) map.SetMapScriptData(MapID, InstanceID, 1, 22, 0) BaoZangDebugLog(MapID, InstanceID, "manual_force_next_marker_" .. NextMarkerID) BaoZangCreateCreatureSafe(MapID, InstanceID, NextMarkerID, 13300/50, 4740, 15400/50) end end end function BaoZangRestartWave(MapID, InstanceID, Step) local oldStep = map.GetMapScriptData(MapID, InstanceID, 1, 20) if oldStep ~= Step then map.SetMapScriptData(MapID, InstanceID, 1, 20, Step) BaoZangDebugLog(MapID, InstanceID, "restart_gen_state_2_step_" .. Step) map.SetMonsterGenState(MapID, InstanceID, 2) BaoZangForceNextMarker(MapID, InstanceID, Step) else BaoZangDebugLog(MapID, InstanceID, "skip_duplicate_restart_step_" .. Step) end end function BaoZangStartNextWaveNoTimer(MapID, InstanceID, Step) BaoZangDebugLog(MapID, InstanceID, "no_timer_restart_step_" .. Step) map.SetMonsterGenState(MapID, InstanceID, 2) end function c1086004_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) BaoZangManualMobDie(MapID, InstanceID, 1086004) end aux.RegisterCreatureEvent(1086004, 4, "c1086004_OnDie") function c1086005_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) BaoZangManualMobDie(MapID, InstanceID, 1086005) end aux.RegisterCreatureEvent(1086005, 4, "c1086005_OnDie") function c1086006_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) BaoZangManualMobDie(MapID, InstanceID, 1086006) end aux.RegisterCreatureEvent(1086006, 4, "c1086006_OnDie") function c1086007_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) BaoZangManualMobDie(MapID, InstanceID, 1086007) end aux.RegisterCreatureEvent(1086007, 4, "c1086007_OnDie") function c1086008_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) BaoZangManualMobDie(MapID, InstanceID, 1086008) end aux.RegisterCreatureEvent(1086008, 4, "c1086008_OnDie") function c1086009_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) BaoZangManualMobDie(MapID, InstanceID, 1086009) end aux.RegisterCreatureEvent(1086009, 4, "c1086009_OnDie") function c1086010_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) BaoZangManualMobDie(MapID, InstanceID, 1086010) end aux.RegisterCreatureEvent(1086010, 4, "c1086010_OnDie") function c1086011_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) BaoZangManualMobDie(MapID, InstanceID, 1086011) end aux.RegisterCreatureEvent(1086011, 4, "c1086011_OnDie") function c1086012_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) BaoZangManualMobDie(MapID, InstanceID, 1086012) end aux.RegisterCreatureEvent(1086012, 4, "c1086012_OnDie") function c1086013_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) BaoZangManualMobDie(MapID, InstanceID, 1086013) end aux.RegisterCreatureEvent(1086013, 4, "c1086013_OnDie") function c1086014_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) BaoZangManualMobDie(MapID, InstanceID, 1086014) end aux.RegisterCreatureEvent(1086014, 4, "c1086014_OnDie") function c1086015_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) BaoZangManualMobDie(MapID, InstanceID, 1086015) end aux.RegisterCreatureEvent(1086015, 4, "c1086015_OnDie") function c1086016_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) BaoZangManualMobDie(MapID, InstanceID, 1086016) end aux.RegisterCreatureEvent(1086016, 4, "c1086016_OnDie") function c1086017_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) BaoZangManualMobDie(MapID, InstanceID, 1086017) end aux.RegisterCreatureEvent(1086017, 4, "c1086017_OnDie") function c1086018_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) BaoZangManualMobDie(MapID, InstanceID, 1086018) end aux.RegisterCreatureEvent(1086018, 4, "c1086018_OnDie") function c1086019_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) BaoZangManualMobDie(MapID, InstanceID, 1086019) end aux.RegisterCreatureEvent(1086019, 4, "c1086019_OnDie") function c1086117_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第一波透明怪死亡 local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207330) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local g = math.random(100) if g <= 10 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 1, 207373) --记录第一只盗宝怪 end end aux.RegisterCreatureEvent(1086117, 13, "c1086117_OnDie") function c1086118_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第二波透明怪死亡 local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207331) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local m = map.GetMapScriptData(MapID,InstanceID,1,1) if m ~= 1 then local g = math.random(100) if g <= 30 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 1, 207373) --记录第一只盗宝怪 end end end aux.RegisterCreatureEvent(1086118, 13, "c1086118_OnDie") function c1086119_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第三波透明怪死亡 local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207332) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local m = map.GetMapScriptData(MapID,InstanceID,1,1) if m ~= 1 then local g = math.random(100) if g <= 60 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 1, 207373) --记录第一只盗宝怪 end end end aux.RegisterCreatureEvent(1086119, 13, "c1086119_OnDie") function c1086120_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第四波透明怪死亡 local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207348) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local m = map.GetMapScriptData(MapID,InstanceID,1,1) if m ~= 1 then local g = math.random(100) if g <= 90 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 1, 207373) --记录第一只盗宝怪 end end end aux.RegisterCreatureEvent(1086120, 13, "c1086120_OnDie") function c1086121_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第一只特殊怪出现时的透明怪消失 --暂停兵线怪刷新 BaoZangDebugLog(MapID, InstanceID, "marker_disappear_1086121_no_pause") end aux.RegisterCreatureEvent(1086121, 13, "c1086121_OnDie") function c1086021_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) --第一只特殊怪死亡 if BaoZangTryEventGuard(MapID, InstanceID, 43, "special_dead_1086021") == false then return end BaoZangDebugLog(MapID, InstanceID, "special_dead_1086021") BaoZangDebugLog(MapID, InstanceID, "pause_gen_state_3_special_1086021") map.SetMonsterGenState(MapID, InstanceID, 3) BaoZangCreateCreatureSafe(MapID, InstanceID, 1086146, 9919/50, 3456, 7437/50) BaoZangCreateCreatureSafe(MapID, InstanceID, 1086147, 9919/50, 3456, 7437/50) --开启第一个宝库门,通告30s时间开箱子 map.OpenCloseDoor(MapID, InstanceID, 174, 1) local boxID = {1086159, 1086160, 1086161, 1086162, 1086163, 1086164} local x = {17600, 18600, 16600, 17600, 18600, 16600} local z = {11000, 11000, 11000, 12000, 12000, 12000} local a = math.random(1,6) local b = math.random(1,6) for i = 0, 5 do BaoZangCreateCreatureSafe(MapID, InstanceID, boxID[b], x[a]/50, 4790, z[a]/50) --召唤宝箱1 --unit.SetFaceTo(MapID, InstanceID, boxID[a], (x[a]+ 110)/50, z[a]/50) --改变朝向 if a <= 5 then a = a+ 1 else a = 1 end if b <= 5 then b = b+ 1 else b = 1 end end local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207349) --“一号宝库已开启,现在有30秒前去挑选天神给予你们的奖励” msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) end aux.RegisterCreatureEvent(1086021, 4, "c1086021_OnDie") function c1086146_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第一只特殊怪死亡时的透明怪消失 --通告5s后重新刷怪 local MsgID = msg.BeginMsgEvent() --距离下一波怪物来袭还有5秒,请尽快做好准备 msg.AddMsgEvent(MsgID,101,207350) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) end aux.RegisterCreatureEvent(1086146, 13, "c1086146_OnDie") function c1086147_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --重新刷怪的透明怪消失 BaoZangDebugLog(MapID, InstanceID, "timer_disappear_1086147") BaoZangRestartWave(MapID, InstanceID, 1) local MsgID1 = msg.BeginMsgEvent() --宝箱通知 msg.AddMsgEvent(MsgID1, 101, 207192) msg.DispatchMapMsgEvent(MsgID1, MapID, InstanceID) end aux.RegisterCreatureEvent(1086147, 13, "c1086147_OnDie") function c1086122_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第五波透明怪死亡 BaoZangDebugLog(MapID, InstanceID, "wave_marker_dead_1086122") BaoZangDebugLog(MapID, InstanceID, "continue_gen_after_marker_1086122") map.SetMonsterGenState(MapID, InstanceID, 2) BaoZangSpawnManualMobs(MapID, InstanceID, "after_1086122", 1086123, 1086004, 1086005, 1086006) local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207333) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local g = math.random(100) if g <= 10 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 2, 207330) --记录第二只盗宝怪 end end aux.RegisterCreatureEvent(1086122, 13, "c1086122_OnDie") function c1086123_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第六波透明怪死亡 BaoZangDebugLog(MapID, InstanceID, "wave_marker_dead_1086123") BaoZangSpawnManualMobs(MapID, InstanceID, "after_1086123", 1086124, 1086007, 1086008, 1086009) local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207334) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local m = map.GetMapScriptData(MapID,InstanceID,1,1) if m ~= 2 then local g = math.random(100) if g <= 30 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 2, 207373) --记录第二只盗宝怪 end end end aux.RegisterCreatureEvent(1086123, 13, "c1086123_OnDie") function c1086124_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第七波透明怪死亡 BaoZangDebugLog(MapID, InstanceID, "wave_marker_dead_1086124") BaoZangSpawnManualMobs(MapID, InstanceID, "after_1086124", 1086125, 1086008, 1086009, 1086010) local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207335) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local m = map.GetMapScriptData(MapID,InstanceID,1,1) if m ~= 2 then local g = math.random(100) if g <= 60 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 2, 207373) --记录第二只盗宝怪 end end end aux.RegisterCreatureEvent(1086124, 13, "c1086124_OnDie") function c1086125_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第八波透明怪死亡 BaoZangDebugLog(MapID, InstanceID, "wave_marker_dead_1086125") BaoZangForceManualCreature(MapID, InstanceID, 1086022, "manual_force_special_1086022") local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207351) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local m = map.GetMapScriptData(MapID,InstanceID,1,1) if m ~= 2 then local g = math.random(100) if g <= 90 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 2, 207373) --记录第二只盗宝怪 end end end aux.RegisterCreatureEvent(1086125, 13, "c1086125_OnDie") function c1086126_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第二只特殊怪出现时的透明怪消失 --暂停兵线怪刷新 BaoZangDebugLog(MapID, InstanceID, "marker_disappear_1086126_no_pause") end aux.RegisterCreatureEvent(1086126, 13, "c1086126_OnDie") function c1086022_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) --第二只特殊怪死亡 if BaoZangTryEventGuard(MapID, InstanceID, 44, "special_dead_1086022") == false then return end BaoZangDebugLog(MapID, InstanceID, "special_dead_1086022") BaoZangDebugLog(MapID, InstanceID, "pause_gen_state_3_special_1086022") map.SetMonsterGenState(MapID, InstanceID, 3) BaoZangCreateCreatureSafe(MapID, InstanceID, 1086148, 9919/50, 3456, 7437/50) BaoZangCreateCreatureSafe(MapID, InstanceID, 1086149, 9919/50, 3456, 7437/50) --开启第2个宝库门,通告30s时间开箱子 map.OpenCloseDoor(MapID, InstanceID, 177, 1) local boxID = {1086165, 1086166, 1086167, 1086168, 1086169, 1086170} local x = {8300, 9300, 7300, 8300, 9300, 7300} local z = {11000, 11000, 11000, 12000, 12000, 12000} local a = math.random(1,6) local b = math.random(1,6) for i = 0, 5 do BaoZangCreateCreatureSafe(MapID, InstanceID, boxID[b], x[a]/50, 4790, z[a]/50) --召唤宝箱1 --unit.SetFaceTo(MapID, InstanceID, boxID[a], (x[a]- 110)/50, z[a]/50) --改变朝向 if a <= 5 then a = a+ 1 else a = 1 end if b <= 5 then b = b+ 1 else b = 1 end end local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207352) --“二号宝库已开启,现在有30秒前去挑选天神给予你们的奖励” msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) end aux.RegisterCreatureEvent(1086022, 4, "c1086022_OnDie") function c1086148_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第二只特殊怪死亡时的透明怪消失 --通告5s后重新刷怪 local MsgID = msg.BeginMsgEvent() --距离下一波怪物来袭还有5秒,请尽快做好准备 msg.AddMsgEvent(MsgID,101,207350) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) end aux.RegisterCreatureEvent(1086148, 13, "c1086148_OnDie") function c1086149_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --重新刷怪的透明怪消失 BaoZangDebugLog(MapID, InstanceID, "timer_disappear_1086149") BaoZangRestartWave(MapID, InstanceID, 2) end aux.RegisterCreatureEvent(1086149, 13, "c1086149_OnDie") function c1086127_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第九波透明怪死亡 BaoZangDebugLog(MapID, InstanceID, "wave_marker_dead_1086127") BaoZangDebugLog(MapID, InstanceID, "continue_gen_after_marker_1086127") map.SetMonsterGenState(MapID, InstanceID, 2) BaoZangSpawnManualMobs(MapID, InstanceID, "after_1086127", 1086128, 1086007, 1086008, 1086009) local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207336) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local g = math.random(100) if g <= 10 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 3, 207373) --记录第三只盗宝怪 end end aux.RegisterCreatureEvent(1086127, 13, "c1086127_OnDie") function c1086128_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第十波透明怪死亡 BaoZangDebugLog(MapID, InstanceID, "wave_marker_dead_1086128") BaoZangSpawnManualMobs(MapID, InstanceID, "after_1086128", 1086129, 1086008, 1086009, 1086010) local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207337) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local m = map.GetMapScriptData(MapID,InstanceID,1,1) if m ~= 3 then local g = math.random(100) if g <= 30 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 3, 207373) --记录第三只盗宝怪 end end end aux.RegisterCreatureEvent(1086128, 13, "c1086128_OnDie") function c1086129_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第十一波透明怪死亡 BaoZangDebugLog(MapID, InstanceID, "wave_marker_dead_1086129") BaoZangSpawnManualMobs(MapID, InstanceID, "after_1086129", 1086130, 1086011, 1086012, 1086013) local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207338) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local m = map.GetMapScriptData(MapID,InstanceID,1,1) if m ~= 3 then local g = math.random(100) if g <= 60 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 3, 207373) --记录第三只盗宝怪 end end end aux.RegisterCreatureEvent(1086129, 13, "c1086129_OnDie") function c1086130_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第十二波透明怪死亡 BaoZangDebugLog(MapID, InstanceID, "wave_marker_dead_1086130") BaoZangForceManualCreature(MapID, InstanceID, 1086023, "manual_force_special_1086023") local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207353) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local m = map.GetMapScriptData(MapID,InstanceID,1,1) if m ~= 3 then local g = math.random(100) if g <= 90 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 3, 207373) --记录第三只盗宝怪 end end end aux.RegisterCreatureEvent(1086130, 13, "c1086130_OnDie") function c1086131_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第三只特殊怪出现时的透明怪消失 --暂停兵线怪刷新 BaoZangDebugLog(MapID, InstanceID, "marker_disappear_1086131_no_pause") end aux.RegisterCreatureEvent(1086131, 13, "c1086131_OnDie") function c1086023_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) --第三只特殊怪死亡 if BaoZangTryEventGuard(MapID, InstanceID, 45, "special_dead_1086023") == false then return end BaoZangDebugLog(MapID, InstanceID, "special_dead_1086023") BaoZangDebugLog(MapID, InstanceID, "pause_gen_state_3_special_1086023") map.SetMonsterGenState(MapID, InstanceID, 3) BaoZangCreateCreatureSafe(MapID, InstanceID, 1086150, 9919/50, 3456, 7437/50) BaoZangCreateCreatureSafe(MapID, InstanceID, 1086151, 9919/50, 3456, 7437/50) --开启第3个宝库门,通告30s时间开箱子 map.OpenCloseDoor(MapID, InstanceID, 175, 1) local boxID = {1086171, 1086172, 1086173, 1086174, 1086175, 1086176} local x = {21000, 22000, 20000, 21000, 22000, 20000} local z = {19900, 19900, 19900, 18900, 18900, 18900} local a = math.random(1,6) local b = math.random(1,6) for i = 0, 5 do BaoZangCreateCreatureSafe(MapID, InstanceID, boxID[b], x[a]/50, 4790, z[a]/50) --召唤宝箱1 --unit.SetFaceTo(MapID, InstanceID, boxID[a], (x[a]+ 110)/50, z[a]/50) --改变朝向 if a <= 5 then a = a+ 1 else a = 1 end if b <= 5 then b = b+ 1 else b = 1 end end local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207354) --“三号宝库已开启,现在有30秒前去挑选天神给予你们的奖励” msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) end aux.RegisterCreatureEvent(1086023, 4, "c1086023_OnDie") function c1086150_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第三只特殊怪死亡时的透明怪消失 --通告5s后重新刷怪 local MsgID = msg.BeginMsgEvent() --距离下一波怪物来袭还有5秒,请尽快做好准备 msg.AddMsgEvent(MsgID,101,207350) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) end aux.RegisterCreatureEvent(1086150, 13, "c1086150_OnDie") function c1086151_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --重新刷怪的透明怪消失 BaoZangDebugLog(MapID, InstanceID, "timer_disappear_1086151") BaoZangRestartWave(MapID, InstanceID, 3) end aux.RegisterCreatureEvent(1086151, 13, "c1086151_OnDie") function c1086132_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第十三波透明怪死亡 BaoZangDebugLog(MapID, InstanceID, "wave_marker_dead_1086132") BaoZangDebugLog(MapID, InstanceID, "continue_gen_after_marker_1086132") map.SetMonsterGenState(MapID, InstanceID, 2) BaoZangSpawnManualMobs(MapID, InstanceID, "after_1086132", 1086133, 1086012, 1086013, 1086014) local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207339) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local g = math.random(100) if g <= 10 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 4, 207373) --记录第四只盗宝怪 end end aux.RegisterCreatureEvent(1086132, 13, "c1086132_OnDie") function c1086133_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第十四波透明怪死亡 BaoZangDebugLog(MapID, InstanceID, "wave_marker_dead_1086133") BaoZangSpawnManualMobs(MapID, InstanceID, "after_1086133", 1086134, 1086011, 1086012, 1086013) local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207340) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local m = map.GetMapScriptData(MapID,InstanceID,1,1) if m ~= 4 then local g = math.random(100) if g <= 30 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 4, 207373) --记录第四只盗宝怪 end end end aux.RegisterCreatureEvent(1086133, 13, "c1086133_OnDie") function c1086134_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第十五波透明怪死亡 BaoZangDebugLog(MapID, InstanceID, "wave_marker_dead_1086134") BaoZangSpawnManualMobs(MapID, InstanceID, "after_1086134", 1086135, 1086012, 1086013, 1086014) local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207341) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local m = map.GetMapScriptData(MapID,InstanceID,1,1) if m ~= 4 then local g = math.random(100) if g <= 60 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 4, 207373) --记录第四只盗宝怪 end end end aux.RegisterCreatureEvent(1086134, 13, "c1086134_OnDie") function c1086135_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第十六波透明怪死亡 BaoZangDebugLog(MapID, InstanceID, "wave_marker_dead_1086135") BaoZangForceManualCreature(MapID, InstanceID, 1086024, "manual_force_special_1086024") local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207355) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local m = map.GetMapScriptData(MapID,InstanceID,1,1) if m ~= 4 then local g = math.random(100) if g <= 90 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 4, 207373) --记录第四只盗宝怪 end end end aux.RegisterCreatureEvent(1086135, 13, "c1086135_OnDie") function c1086136_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第四只特殊怪出现时的透明怪消失 --暂停兵线怪刷新 BaoZangDebugLog(MapID, InstanceID, "marker_disappear_1086136_no_pause") end aux.RegisterCreatureEvent(1086136, 13, "c1086136_OnDie") function c1086024_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) --第四只特殊怪死亡 if BaoZangTryEventGuard(MapID, InstanceID, 46, "special_dead_1086024") == false then return end BaoZangDebugLog(MapID, InstanceID, "special_dead_1086024") BaoZangDebugLog(MapID, InstanceID, "pause_gen_state_3_special_1086024") map.SetMonsterGenState(MapID, InstanceID, 3) BaoZangCreateCreatureSafe(MapID, InstanceID, 1086152, 9919/50, 3456, 7437/50) BaoZangCreateCreatureSafe(MapID, InstanceID, 1086153, 9919/50, 3456, 7437/50) --开启第4个宝库门,通告30s时间开箱子 map.OpenCloseDoor(MapID, InstanceID, 178, 1) local boxID = {1086177, 1086178, 1086179, 1086180, 1086181, 1086182} local x = {5000, 6000, 4000, 5000, 6000, 4000} local z = {19900, 19900, 19900, 18900, 18900, 18900} local a = math.random(1,6) local b = math.random(1,6) for i = 0, 5 do BaoZangCreateCreatureSafe(MapID, InstanceID, boxID[b], x[a]/50, 4790, z[a]/50) --召唤宝箱1 --unit.SetFaceTo(MapID, InstanceID, boxID[a], (x[a]- 110)/50, z[a]/50) --改变朝向 if a <= 5 then a = a+ 1 else a = 1 end if b <= 5 then b = b+ 1 else b = 1 end end local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207356) --“四号宝库已开启,现在有30秒前去挑选天神给予你们的奖励” msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) end aux.RegisterCreatureEvent(1086024, 4, "c1086024_OnDie") function c1086152_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第四只特殊怪死亡时透明怪消失 --通告5s后重新刷怪 local MsgID = msg.BeginMsgEvent() --距离下一波怪物来袭还有5秒,请尽快做好准备 msg.AddMsgEvent(MsgID,101,207350) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) end aux.RegisterCreatureEvent(1086152, 13, "c1086152_OnDie") function c1086153_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --重新刷怪的透明怪消失 BaoZangDebugLog(MapID, InstanceID, "timer_disappear_1086153") BaoZangRestartWave(MapID, InstanceID, 4) end aux.RegisterCreatureEvent(1086153, 13, "c1086153_OnDie") function c1086137_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第十七波透明怪死亡 BaoZangDebugLog(MapID, InstanceID, "wave_marker_dead_1086137") BaoZangDebugLog(MapID, InstanceID, "continue_gen_after_marker_1086137") map.SetMonsterGenState(MapID, InstanceID, 2) BaoZangSpawnManualMobs(MapID, InstanceID, "after_1086137", 1086138, 1086015, 1086016, 1086017) local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207342) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local g = math.random(100) if g <= 10 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 5, 207373) --记录第五只盗宝怪 end end aux.RegisterCreatureEvent(1086137, 13, "c1086137_OnDie") function c1086138_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第十八波透明怪死亡 BaoZangDebugLog(MapID, InstanceID, "wave_marker_dead_1086138") BaoZangSpawnManualMobs(MapID, InstanceID, "after_1086138", 1086139, 1086015, 1086016, 1086017) local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207343) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local m = map.GetMapScriptData(MapID,InstanceID,1,1) if m ~= 5 then local g = math.random(100) if g <= 30 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 5, 207373) --记录第五只盗宝怪 end end end aux.RegisterCreatureEvent(1086138, 13, "c1086138_OnDie") function c1086139_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第十九波透明怪死亡 BaoZangDebugLog(MapID, InstanceID, "wave_marker_dead_1086139") BaoZangSpawnManualMobs(MapID, InstanceID, "after_1086139", 1086140, 1086015, 1086016, 1086017) local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207344) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local m = map.GetMapScriptData(MapID,InstanceID,1,1) if m ~= 5 then local g = math.random(100) if g <= 60 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 5, 207373) --记录第五只盗宝怪 end end end aux.RegisterCreatureEvent(1086139, 13, "c1086139_OnDie") function c1086140_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第二十波透明怪死亡 BaoZangDebugLog(MapID, InstanceID, "wave_marker_dead_1086140") BaoZangForceManualCreature(MapID, InstanceID, 1086025, "manual_force_special_1086025") local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207357) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local m = map.GetMapScriptData(MapID,InstanceID,1,1) if m ~= 5 then local g = math.random(100) if g <= 90 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 5, 207373) --记录第五只盗宝怪 end end end aux.RegisterCreatureEvent(1086140, 13, "c1086140_OnDie") function c1086158_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第五只特殊怪出现时的透明怪消失 --暂停兵线怪刷新 BaoZangDebugLog(MapID, InstanceID, "marker_disappear_1086158_no_pause") end aux.RegisterCreatureEvent(1086158, 13, "c1086158_OnDie") function c1086025_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) --第五只特殊怪死亡 if BaoZangTryEventGuard(MapID, InstanceID, 47, "special_dead_1086025") == false then return end BaoZangDebugLog(MapID, InstanceID, "special_dead_1086025") BaoZangDebugLog(MapID, InstanceID, "pause_gen_state_3_special_1086025") map.SetMonsterGenState(MapID, InstanceID, 3) BaoZangCreateCreatureSafe(MapID, InstanceID, 1086154, 9919/50, 3456, 7437/50) BaoZangCreateCreatureSafe(MapID, InstanceID, 1086155, 9919/50, 3456, 7437/50) --开启第5个宝库门,通告30s时间开箱子 map.OpenCloseDoor(MapID, InstanceID, 176, 1) local boxID = {1086183, 1086184, 1086185, 1086186, 1086187, 1086188} local x = {22400, 23400, 21400, 22400, 23400, 21400} local z = {11000, 11000, 11000, 12000, 12000, 12000} local a = math.random(1,6) local b = math.random(1,6) for i = 0, 5 do BaoZangCreateCreatureSafe(MapID, InstanceID, boxID[b], x[a]/50, 4790, z[a]/50) --召唤宝箱1 --unit.SetFaceTo(MapID, InstanceID, boxID[a], (x[a]+ 110)/50, z[a]/50) --改变朝向 if a <= 5 then a = a+ 1 else a = 1 end if b <= 5 then b = b+ 1 else b = 1 end end local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207358) --“五号宝库已开启,现在有30秒前去挑选天神给予你们的奖励” msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) end aux.RegisterCreatureEvent(1086025, 4, "c1086025_OnDie") function c1086154_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第五只特殊怪死亡时的透明怪消失 --通告5s后重新刷怪 local MsgID = msg.BeginMsgEvent() --距离下一波怪物来袭还有5秒,请尽快做好准备 msg.AddMsgEvent(MsgID,101,207350) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) end aux.RegisterCreatureEvent(1086154, 13, "c1086154_OnDie") function c1086155_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --重新刷怪的透明怪消失 BaoZangDebugLog(MapID, InstanceID, "timer_disappear_1086155") BaoZangRestartWave(MapID, InstanceID, 5) end aux.RegisterCreatureEvent(1086155, 13, "c1086155_OnDie") function c1086141_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第二十一波透明怪死亡 BaoZangDebugLog(MapID, InstanceID, "wave_marker_dead_1086141") BaoZangDebugLog(MapID, InstanceID, "continue_gen_after_marker_1086141") map.SetMonsterGenState(MapID, InstanceID, 2) BaoZangSpawnManualMobs(MapID, InstanceID, "after_1086141", 1086142, 1086018, 1086019, 1086016) local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207345) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local g = math.random(100) if g <= 10 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 6, 207373) --记录第六只盗宝怪 end end aux.RegisterCreatureEvent(1086141, 13, "c1086141_OnDie") function c1086142_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第二十二波透明怪死亡 BaoZangDebugLog(MapID, InstanceID, "wave_marker_dead_1086142") BaoZangSpawnManualMobs(MapID, InstanceID, "after_1086142", 1086143, 1086018, 1086019, 1086015) local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207346) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local m = map.GetMapScriptData(MapID,InstanceID,1,1) if m ~= 6 then local g = math.random(100) if g <= 30 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 6, 207373) --记录第六只盗宝怪 end end end aux.RegisterCreatureEvent(1086142, 13, "c1086142_OnDie") function c1086143_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第二十三波透明怪死亡 BaoZangDebugLog(MapID, InstanceID, "wave_marker_dead_1086143") BaoZangForceManualCreature(MapID, InstanceID, 1086026, "manual_force_special_1086026") local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207359) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local m = map.GetMapScriptData(MapID,InstanceID,1,1) if m ~= 6 then local g = math.random(100) if g <= 60 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 6, 207373) --记录第六只盗宝怪 end end end aux.RegisterCreatureEvent(1086143, 13, "c1086143_OnDie") function c1086144_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第六只特殊怪出现时的透明怪消失 --暂停兵线怪刷新 BaoZangDebugLog(MapID, InstanceID, "marker_disappear_1086144_no_pause") end aux.RegisterCreatureEvent(1086144, 13, "c1086144_OnDie") function c1086026_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) --第六只特殊怪死亡 if BaoZangTryEventGuard(MapID, InstanceID, 48, "special_dead_1086026") == false then return end BaoZangDebugLog(MapID, InstanceID, "special_dead_1086026") BaoZangDebugLog(MapID, InstanceID, "pause_gen_state_3_special_1086026") map.SetMonsterGenState(MapID, InstanceID, 3) BaoZangCreateCreatureSafe(MapID, InstanceID, 1086156, 9919/50, 3456, 7437/50) BaoZangCreateCreatureSafe(MapID, InstanceID, 1086157, 9919/50, 3456, 7437/50) --开启第6个宝库门,通告30s时间开箱子 map.OpenCloseDoor(MapID, InstanceID, 179, 1) local boxID = {1086189, 1086190, 1086191, 1086192, 1086193, 1086194} local x = {3500, 4500, 2500, 3500, 4500, 2500} local z = {11000, 11000, 11000, 12000, 12000, 12000} local a = math.random(1,6) local b = math.random(1,6) for i = 0, 5 do BaoZangCreateCreatureSafe(MapID, InstanceID, boxID[b], x[a]/50, 4790, z[a]/50) --召唤宝箱1 --unit.SetFaceTo(MapID, InstanceID, boxID[a], (x[a]- 110)/50, z[a]/50) --改变朝向 if a <= 5 then a = a+ 1 else a = 1 end if b <= 5 then b = b+ 1 else b = 1 end end local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207360) --“六号宝库已开启,现在有30秒前去挑选天神给予你们的奖励” msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) end aux.RegisterCreatureEvent(1086026, 4, "c1086026_OnDie") function c1086156_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第六只特殊怪死亡时的透明怪消失 --通告5s后重新刷怪 local MsgID = msg.BeginMsgEvent() --距离下一波怪物来袭还有5秒,请尽快做好准备 msg.AddMsgEvent(MsgID,101,207350) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) end aux.RegisterCreatureEvent(1086156, 13, "c1086156_OnDie") function c1086157_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --重新刷怪的透明怪消失 BaoZangDebugLog(MapID, InstanceID, "timer_disappear_1086157") BaoZangRestartWave(MapID, InstanceID, 6) end aux.RegisterCreatureEvent(1086157, 13, "c1086157_OnDie") function c1086145_OnDie(MapID, InstanceID, TargetID, TargetTypeID) --第二十四波透明怪死亡 BaoZangDebugLog(MapID, InstanceID, "wave_marker_dead_1086145") BaoZangDebugLog(MapID, InstanceID, "continue_gen_after_marker_1086145") map.SetMonsterGenState(MapID, InstanceID, 2) BaoZangForceManualCreature(MapID, InstanceID, 1086020, "manual_force_final_1086020") local MsgID = msg.BeginMsgEvent() --波数通知 msg.AddMsgEvent(MsgID,101,207347) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local m = map.GetMapScriptData(MapID,InstanceID,1,1) if m ~= 6 then local g = math.random(100) if g <= 90 then local x = math.random(4050, 22600) local y = 4740 local z = math.random(14800, 16000) BaoZangSpawnThief(MapID, InstanceID, x, y, z, 6, 207373) --记录第六只盗宝怪 end end end aux.RegisterCreatureEvent(1086145, 13, "c1086145_OnDie") function c1086027_OnDisappear(MapID, InstanceID, TargetID, TargetTypeID) --盗宝怪消失 local m = map.GetMapScriptData(MapID,InstanceID,1,1) if m == nil then m = 0 end BaoZangDebugLog(MapID, InstanceID, "thief_disappear_1086027_flag_" .. m) map.SetMapScriptData(MapID,InstanceID,1,1,0) local MsgID = msg.BeginMsgEvent() --盗宝怪跑了 msg.AddMsgEvent(MsgID,101,207371) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) end aux.RegisterCreatureEvent(1086027, 13, "c1086027_OnDisappear") function c1086027_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) --盗宝怪死亡 BaoZangDebugLog(MapID, InstanceID, "thief_dead_1086027") map.SetMapScriptData(MapID,InstanceID,1,1,0) local MsgID = msg.BeginMsgEvent() --盗宝怪被XXX击杀了 msg.AddMsgEvent(MsgID,101,207372) if RoleID ~= nil and RoleID ~= 0 and RoleID ~= -1 then msg.AddMsgEvent(MsgID,2,RoleID) end msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) end aux.RegisterCreatureEvent(1086027, 4, "c1086027_OnDie")