function c9010596_On_Talk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex) local rolelevel = role.GetRoleLevel(MapID, InstanceID, RoleID) local MsgID = msg.BeginMsgEvent() if TalkIndex == -1 then msg.AddMsgEvent(MsgID, 20, 950925) --Кристалл питает энергия древних повелителей. Надпись гласит: 'Только сильный духом может пройти в древнюю усыпальницу.' msg.AddMsgEvent(MsgID, 24, TargetID) msg.AddMsgEvent(MsgID, 21, 4) msg.AddMsgEvent(MsgID, 1, 950926) --Положить руку на кристалл msg.AddMsgEvent(MsgID, 21, 99) msg.AddMsgEvent(MsgID, 1, 100002) --Отмена msg.DispatchRoleMsgEvent(RoleID, MsgID) elseif TalkIndex == 4 then map.OpenCloseDoor(MapID, InstanceID, 2402, 1) msg.AddMsgEvent(MsgID, 101, 950930) --Вы слышите скрип дверей гробницы msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) end end aux.RegisterCreatureEvent(9010596, 7, "c9010596_On_Talk") function c9010583_Die(MapID, InstanceID, CreatureID, CreatureTypeID, KillerID) local monsterNum = map.GetMapScriptData(2453654675, InstanceID, 1, 1) if monsterNum == nil or monsterNum < 0 then monsterNum = 0 end local num = 1 - monsterNum if num > 0 then map.SetMapScriptData(2453654675, InstanceID, 1, 1, monsterNum + 1) else map.MapCreateCreature(MapID, InstanceID, 9010596, 79, 14115, 199) local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 101, 950929) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) --Анубис local anubis = map.MapCreateCreature(MapID, InstanceID, 9010584, 170, 14114, 493) map.SetMapScriptData(2453654675, InstanceID, 1, 3, anubis) end end aux.RegisterCreatureEvent(9010583, 4, "c9010583_Die") function s9101801_Cast(MapID, InstanceID, SkillID, OwnerID) local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 101, 950911) --Сокрушительный топот! Отбегите на безопасное расстояние. msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local anubis = map.GetMapScriptData(2453654675, InstanceID, 1, 3) unit.AddBuff(2453654675, InstanceID, anubis, 9834401, anubis) unit.AddBuff(2453654675, InstanceID, anubis, 9837201, anubis) end aux.RegisterSkillEvent(9101801, 1, "s9101801_Cast") function c9010584_Die(MapID, InstanceID, CreatureID, CreatureTypeID, KillerID) local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 101, 950931) -- Смерть распорядителя сняла магическую печать с дверей msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) map.OpenCloseDoor(MapID, InstanceID, 2405, 1) end aux.RegisterCreatureEvent(9010584, 4, "c9010584_Die") function c9010577_Die(MapID, InstanceID, CreatureID, CreatureTypeID, KillerID) local monsterNum2 = map.GetMapScriptData(2453654675, InstanceID, 1, 4) if monsterNum2 == nil or monsterNum2 < 0 then monsterNum2 = 0 end local num = 3 - monsterNum2 if num > 0 then map.SetMapScriptData(2453654675, InstanceID, 1, 4, monsterNum2 + 1) else map.MapCreateCreature(MapID, InstanceID, 9010597, 364, 13782, 590) end end aux.RegisterCreatureEvent(9010577, 4, "c9010577_Die") function c9010597_On_Talk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex) local rolelevel = role.GetRoleLevel(MapID, InstanceID, RoleID) local MsgID = msg.BeginMsgEvent() if TalkIndex == -1 then msg.AddMsgEvent(MsgID, 20, 950927) --В кристалле заключена сущность одного из повелителей древнего мира. Надпись гласит: 'Не беспокой усопших, если хочешь жить. msg.AddMsgEvent(MsgID, 24, TargetID) msg.AddMsgEvent(MsgID, 21, 4) msg.AddMsgEvent(MsgID, 1, 950926) --Положить руку на кристалл msg.AddMsgEvent(MsgID, 21, 99) msg.AddMsgEvent(MsgID, 1, 100002) --Отмена msg.DispatchRoleMsgEvent(RoleID, MsgID) elseif TalkIndex == 4 then msg.AddMsgEvent(MsgID, 101, 950934) --Резонанс кристалла привлек внимание Осириуса. msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local Osir = map.MapCreateCreature(MapID, InstanceID, 9010585, 463, 13802, 425) map.SetMapScriptData(2453654675, InstanceID, 1, 5, Osir) map.MapDeleteCreature(MapID, InstanceID, TargetID) end end aux.RegisterCreatureEvent(9010597, 7, "c9010597_On_Talk") function m9010585_Atak(MapID, InstanceID, CreatureID, GetID) HpPercent = unit.GetAttValue(MapID, InstanceID, CreatureID, 9) * 100 / unit.GetAttValue(MapID, InstanceID, CreatureID, 8) HpPercent = math.floor(HpPercent) local script = map.GetMapScriptData(MapID, InstanceID, 1, 10) if script == 0 then if HpPercent <= 80 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 101, 950915) --Сферы появились. Подберите их, чтобы снять неуязвимость с Сефу. msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local Osir = map.GetMapScriptData(2453654675, InstanceID, 1, 5) unit.AddBuff(2453654675, InstanceID, Osir, 9834501, Osir) local svet = map.MapCreateCreature(MapID, InstanceID, 9010587, 440, 13802, 439) local tma = map.MapCreateCreature(MapID, InstanceID, 9010588, 479, 13802, 442) map.SetMapScriptData(MapID, InstanceID, 1, 10, 1) end local script = map.GetMapScriptData(MapID, InstanceID, 1, 10) elseif script == 1 then if HpPercent <= 60 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 101, 950915) --Сферы появились. Подберите их, чтобы снять неуязвимость с Сефу. msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local Osir = map.GetMapScriptData(2453654675, InstanceID, 1, 5) unit.AddBuff(2453654675, InstanceID, Osir, 9834501, Osir) local svet = map.MapCreateCreature(MapID, InstanceID, 9010587, 440, 13802, 439) local tma = map.MapCreateCreature(MapID, InstanceID, 9010588, 479, 13802, 442) map.SetMapScriptData(MapID, InstanceID, 1, 10, 2) end local script = map.GetMapScriptData(MapID, InstanceID, 1, 10) elseif script == 2 then if HpPercent <= 40 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 101, 950915) --Сферы появились. Подберите их, чтобы снять неуязвимость с Сефу. msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local Osir = map.GetMapScriptData(2453654675, InstanceID, 1, 5) unit.AddBuff(2453654675, InstanceID, Osir, 9834501, Osir) local svet = map.MapCreateCreature(MapID, InstanceID, 9010587, 440, 13802, 439) local tma = map.MapCreateCreature(MapID, InstanceID, 9010588, 479, 13802, 442) map.SetMapScriptData(MapID, InstanceID, 1, 10, 3) end local script = map.GetMapScriptData(MapID, InstanceID, 1, 10) elseif script == 3 then if HpPercent <= 20 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 101, 950915) --Сферы появились. Подберите их, чтобы снять неуязвимость с Сефу. msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local Osir = map.GetMapScriptData(2453654675, InstanceID, 1, 5) unit.AddBuff(2453654675, InstanceID, Osir, 9834501, Osir) local svet = map.MapCreateCreature(MapID, InstanceID, 9010587, 440, 13802, 439) local tma = map.MapCreateCreature(MapID, InstanceID, 9010588, 479, 13802, 442) map.SetMapScriptData(MapID, InstanceID, 1, 10, 4) end elseif script == 4 then if HpPercent <= 3 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 101, 950915) --Сферы появились. Подберите их, чтобы снять неуязвимость с Сефу. msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local Osir = map.GetMapScriptData(2453654675, InstanceID, 1, 5) unit.AddBuff(2453654675, InstanceID, Osir, 9834501, Osir) local svet = map.MapCreateCreature(MapID, InstanceID, 9010587, 440, 13802, 439) local tma = map.MapCreateCreature(MapID, InstanceID, 9010588, 479, 13802, 442) map.SetMapScriptData(MapID, InstanceID, 1, 10, 5) end end end aux.RegisterCreatureEvent(9010585, 14, "m9010585_Atak") function c9010587_On_Talk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex) unit.AddBuff(MapID, InstanceID, RoleID, 9834901, RoleID) map.MapDeleteCreature(2453654675, InstanceID, TargetID) end aux.RegisterCreatureEvent(9010587, 7, "c9010587_On_Talk") function c9010588_On_Talk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex) local Osir = map.GetMapScriptData(2453654675, InstanceID, 1, 5) unit.AddBuff(MapID, InstanceID, RoleID, 9835001, RoleID) map.MapDeleteCreature(2453654675, InstanceID, TargetID) unit.CancelBuff(2453654675, InstanceID, Osir, 9834501) end aux.RegisterCreatureEvent(9010588, 7, "c9010588_On_Talk") function c9010585_Die(MapID, InstanceID, CreatureID, CreatureTypeID, KillerID) map.OpenCloseDoor(MapID, InstanceID, 2406, 1) map.MapCreateCreature(MapID, InstanceID, 9010602, 459, 13481, 331) local kord = { { 459, 318 }, { 459, 305 }, { 459, 291 }, { 459, 277 }, { 459, 263 }, { 459, 249 }, { 459, 235 }, { 453, 324 }, { 453, 310 }, { 453, 296 }, { 453, 282 }, { 453, 268 }, { 453, 254 }, { 453, 240 }, { 465, 324 }, { 465, 310 }, { 465, 296 }, { 465, 282 }, { 465, 268 }, { 465, 254 }, { 465, 240 } } for i = 1, 21 do map.MapCreateCreature(MapID, InstanceID, 9010601, kord[i][1], 13481, kord[i][2]) end local Menes = map.MapCreateCreature(MapID, InstanceID, 9010586, 462, 13815, 64) map.SetMapScriptData(2453654675, InstanceID, 1, 6, Menes) map.SetMapScriptData(2453654675, InstanceID, 1, 8, 1) end aux.RegisterCreatureEvent(9010585, 4, "c9010585_Die") function c9010602_On_Disappear(MapID, InstanceID, TargetID, TargetTypeID) map.MapCreateCreature(MapID, InstanceID, 9010603, 459, 13481, 331) end aux.RegisterCreatureEvent(9010602, 13, "c9010602_On_Disappear") function c9010603_On_Disappear(MapID, InstanceID, TargetID, TargetTypeID) local lovushka = map.GetMapScriptData(2453654675, InstanceID, 1, 7) if lovushka == 0 or lovushka == nil then map.MapCreateCreature(MapID, InstanceID, 9010602, 459, 13481, 331) local kord = { { 459, 317 }, { 459, 305 }, { 459, 291 }, { 459, 277 }, { 459, 263 }, { 459, 249 }, { 459, 235 }, { 453, 324 }, { 453, 310 }, { 453, 296 }, { 453, 282 }, { 453, 268 }, { 453, 254 }, { 453, 240 }, { 465, 324 }, { 465, 310 }, { 465, 296 }, { 465, 282 }, { 465, 268 }, { 465, 254 }, { 465, 240 } } for i = 1, 21 do map.MapCreateCreature(MapID, InstanceID, 9010601, kord[i][1], 13481, kord[i][2]) end map.SetMapScriptData(2453654675, InstanceID, 1, 7, 1) else map.MapCreateCreature(MapID, InstanceID, 9010602, 465, 13481, 331) local kord = { { 465, 317 }, { 465, 305 }, { 465, 291 }, { 465, 277 }, { 465, 263 }, { 465, 249 }, { 465, 235 }, { 453, 317 }, { 453, 305 }, { 453, 291 }, { 453, 277 }, { 453, 263 }, { 453, 249 }, { 453, 235 }, { 459, 324 }, { 459, 310 }, { 459, 296 }, { 459, 282 }, { 459, 268 }, { 459, 254 }, { 459, 240 }, { 453, 331 } } for i = 1, 22 do map.MapCreateCreature(MapID, InstanceID, 9010601, kord[i][1], 13481, kord[i][2]) end map.SetMapScriptData(2453654675, InstanceID, 1, 7, 0) end end aux.RegisterCreatureEvent(9010603, 13, "c9010603_On_Disappear") function m9010586_Atak(MapID, InstanceID, CreatureID, GetID) local x, y, z = unit.GetPosition(MapID, InstanceID, CreatureID) local monsterNum = map.GetMapScriptData(2453654675, InstanceID, 1, 8) local b = math.random(100) if monsterNum ~= 0 then if monsterNum > 0 and monsterNum < 11 then if b <= 20 then map.SetMapScriptData(2453654675, InstanceID, 1, 8, monsterNum + 1) map.MapCreateCreature(MapID, InstanceID, 9010589, x, y, z) end else map.SetMapScriptData(2453654675, InstanceID, 1, 8, 0) end end end aux.RegisterCreatureEvent(9010586, 14, "m9010586_Atak") function c9010589_Die(MapID, InstanceID, CreatureID, CreatureTypeID, KillerID) local x, y, z = unit.GetPosition(MapID, InstanceID, CreatureID) map.MapCreateCreature(MapID, InstanceID, 9010590, x, y, z) local Menes = map.GetMapScriptData(2453654675, InstanceID, 1, 6) unit.AddBuff(2453654675, InstanceID, Menes, 9835901, Menes) end aux.RegisterCreatureEvent(9010589, 4, "c9010589_Die") function c9010586_Die(MapID, InstanceID, CreatureID, CreatureTypeID, KillerID) local x, y, z = unit.GetPosition(MapID, InstanceID, CreatureID) map.MapCreateCreature(MapID, InstanceID, 9010591, x, y, z) map.MapCreateCreature(MapID, InstanceID, 9010598, 440, 13815, 60) end aux.RegisterCreatureEvent(9010586, 4, "c9010586_Die") function c9010598_On_Talk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex) if TalkIndex == -1 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 950928) --Покинуть гробницу msg.AddMsgEvent(MsgID, 24, TargetID) msg.AddMsgEvent(MsgID, 21, 4) msg.AddMsgEvent(MsgID, 1, 100001) --OK msg.AddMsgEvent(MsgID, 21, 99) msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) elseif TalkIndex == 4 then role.RoleGotoNewMap(MapID, InstanceID, RoleID, 3424073512, 630, 23094, 630) end end aux.RegisterCreatureEvent(9010598, 7, "c9010598_On_Talk") function pg01_LeaveMap(MapID, InstanceID, RoleID) map.DeleteInstance(MapID,InstanceID) end aux.RegisterMapEvent("pg01", 3, "pg01_LeaveMap") aux.RegisterMapEvent("pg01", 25, "pg01_LeaveMap")