function ostorov_OnPlayerEnter(MapID, InstanceID, RoleID) local bhave = role.IsRoleHaveBuff(MapID, InstanceID, RoleID, 99996) if bhave == true then unit.CancelBuff(MapID, InstanceID, RoleID, 9999601) end local freshmonster = map.GetMapScriptData(MapID, InstanceID, 1,9) if freshmonster ==0 then map.MapCreateCreature(MapID, InstanceID, 9010076, 1278, 2126, 1255) som_ostrov = 0 djet_angry = 0 djet_go = 0 local djet_go = 0 local som_ostrov = 0 local djet_angry = 0 map.SetMapScriptData(MapID, InstanceID, 1,9,1) map.SetMapScriptData(1232817742,InstanceID,1,3,0) end --副本统计 --instanceData(3, RoleID, 26, 33) --玩家统计 --UpdateRoleData(RoleID, 15, 1) --加体验buff if experienceTeams ~= nil then local TeamID = role.IsRoleHaveTeam(MapID, InstanceID, RoleID) for k in pairs(experienceTeams) do if experienceTeams[k].teamid == TeamID then local lev = math.floor(role.GetRoleLevel(MapID, InstanceID, RoleID)/10) if lev == 4 then unit.AddBuff(MapID, InstanceID, RoleID, 6109601, RoleID) unit.AddBuff(MapID, InstanceID, RoleID, 6109701, RoleID) end break end end end end --注册 aux.RegisterMapEvent("f20", 2, "ostorov_OnPlayerEnter") function c9010076_On_Talk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex) --- культ начало local MsgID = msg.BeginMsgEvent() if TalkIndex == -1 then msg.AddMsgEvent(MsgID, 20, 930201) msg.AddMsgEvent(MsgID, 24, TargetID) msg.AddMsgEvent(MsgID, 21, 4) msg.AddMsgEvent(MsgID, 1, 930202) msg.AddMsgEvent(MsgID, 21, -1) msg.AddMsgEvent(MsgID, 1, 100002) elseif TalkIndex == 4 then local mob1 = map.MapCreateColCreature(1232817742, InstanceID, 9010074, 1263, 2040, 1227, 1) local mob2 = map.MapCreateColCreature(1232817742, InstanceID, 9010074, 1276, 1982, 1219, 1) local mob3 = map.MapCreateColCreature(1232817742, InstanceID, 9010074, 1279, 1955, 1195, 1) local mob4 = map.MapCreateColCreature(1232817742, InstanceID, 9010074, 1266, 1968, 1187, 1) local mob5 = map.MapCreateColCreature(1232817742, InstanceID, 9010074, 1261, 1974, 1170, 1) local mob6 = map.MapCreateColCreature(1232817742, InstanceID, 9010074, 1273, 1930, 1158, 1) local mob7 = map.MapCreateColCreature(1232817742, InstanceID, 9010074, 1271, 1924, 1141, 1) local mob8 = map.MapCreateColCreature(1232817742, InstanceID, 9010074, 1256, 1959, 1135, 1) local mob9 = map.MapCreateColCreature(1232817742, InstanceID, 9010074, 1265, 1988, 1111, 1) local mob10 = map.MapCreateColCreature(1232817742, InstanceID, 9010074, 1246, 2106, 1106, 1) local mob11 = map.MapCreateColCreature(1232817742, InstanceID, 9010074, 1253, 2155, 1087, 1) local gerda = map.MapCreateColCreature(1232817742, InstanceID, 9010075, 1273, 2059, 1089, 1) --- Герда НПС som_ostrov = 0 djet_angry = 0 local som_ostrov = 0 local djet_angry = 0 djet_go = 0 local djet_go = 0 map.SetMapScriptData(1232817742, InstanceID, 1, 1, gerda) unit.AddBuff(1232817742, InstanceID, gerda, 6104901, gerda) map.MapDeleteCreature(MapID, InstanceID, TargetID) end msg.DispatchRoleMsgEvent(RoleID, MsgID) end aux.RegisterCreatureEvent(9010076, 7, "c9010076_On_Talk") function c9010310_On_Disappear(MapID, InstanceID, TargetID, TargetTypeID) --- культ if som_ostrov == 0 then local x, y ,z = unit.GetPosition(MapID, InstanceID, TargetID) map.MapCreateColCreature(MapID, InstanceID, 9010074, x, y ,z, 1) end end aux.RegisterCreatureEvent(9010310, 13, "c9010310_On_Disappear") function c9010074_Die(MapID, InstanceID, CreatureID, CreatureTypeID, KillerID) --- таймер map.MapCreateColCreature(MapID, InstanceID, 9010310, x, y ,z, 1) local x, y ,z = unit.GetPosition(MapID, InstanceID, CreatureID) if math.random(10) == 1 and role.GetRoleItemNum(KillerID, 6600209) <= 1 and som_ostrov == 0 then role.AddRoleItem(MapID, InstanceID, KillerID, 6600209, 1, 6, 8, 420) end end aux.RegisterCreatureEvent(9010074, 4, "c9010074_Die") function c9010073_On_Talk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex) --- ловушка if TalkIndex == -1 then local RoleTbl = map.GetMapAllRoleID(MapID, InstanceID) if RoleTbl ~= nil then for k, v in pairs(RoleTbl) do map.MapDeleteCreature(MapID, InstanceID, TargetID) map.MapCreateColCreature(MapID, InstanceID, 9010070, 1276, 2000, 1106, 1) --- цветок map.MapCreateColCreature(MapID, InstanceID, 9010070, 1286, 1945, 1147, 1) --- цветок map.MapCreateColCreature(MapID, InstanceID, 9010070, 1245, 2031, 1143, 1) --- цветок map.MapCreateColCreature(MapID, InstanceID, 9010070, 1243, 2154, 1208, 1) --- цветок map.MapCreateColCreature(MapID, InstanceID, 9010070, 1301, 2154, 1217, 1) --- цветок unit.AddBuff(MapID, InstanceID, v,9805101,v) local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 900107) -- Ваше тело отравлено. Ищите лекарственные цветы в окрестностях. Нужно найти 5 шт. msg.DispatchRoleMsgEvent(RoleID, MsgID) end end end end aux.RegisterCreatureEvent(9010073, 7, "c9010073_On_Talk") function c9010070_On_Talk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex) local monsterNum = map.GetMapScriptData(1232817742,InstanceID,1,4) local x, y ,z = unit.GetPosition(MapID, InstanceID, RoleID) if monsterNum == nil or monsterNum < 1 then monsterNum = 1 end local num = 6 - monsterNum if num > 1 then map.SetMapScriptData(1232817742,InstanceID,1,4,monsterNum+1) map.MapDeleteCreature(MapID, InstanceID, TargetID) local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 900104) -- Собрано <p1> лекарственных цветов из 5. msg.AddMsgEvent(MsgID, 9, monsterNum) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID, -1) map.MapDeleteCreature(MapID, InstanceID, TargetID) map.MapCreateColCreature(MapID, InstanceID, 9010069, x, y ,z, 1) else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 900104) -- Собрано <p1> лекарственных цветов из 5. msg.AddMsgEvent(MsgID, 9, monsterNum) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID, -1) map.MapDeleteCreature(MapID, InstanceID, TargetID) local djert = map.MapCreateColCreature(1232817742, InstanceID, 9010068, 976, 2297, 1026, 1) --- Джераж НПС map.MapCreateColCreature(MapID, InstanceID, 9010069, x, y ,z, 1) map.SetMapScriptData(1232817742,InstanceID,1,1,djert) map.SetMapScriptData(1232817742,InstanceID,1,3,1) map.SetMapScriptData(1232817742,InstanceID,1,4,0) local RoleTbl = map.GetMapAllRoleID(MapID, InstanceID) if RoleTbl ~= nil then for k, v in pairs(RoleTbl) do unit.CancelBuff(MapID, InstanceID, v, 9805101) end end end end aux.RegisterCreatureEvent(9010070, 7, "c9010070_On_Talk") function c9010068_On_Talk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex) if TalkIndex == -1 then if djet_go == 0 then local vacu = map.MapCreateColCreature(1232817742, InstanceID, 9010067, 1032, 2297, 957, 1) --- Викария map.MapCreateColCreature(1232817742, InstanceID, 1086541, 968, 2297, 1010, 1) --- Викария map.MapCreateColCreature(1232817742, InstanceID, 1086541, 991, 2297, 1084, 1) --- Викария map.MapCreateColCreature(1232817742, InstanceID, 1086541, 1021, 2297, 1091, 1) --- Викария map.MapCreateColCreature(1232817742, InstanceID, 1086541, 1088, 2297, 1151, 1) --- Викария local MsgID = msg.BeginMsgEvent() djet_go = 1 msg.AddMsgEvent(MsgID, 102, 900105) -- Чёрный кардинал заметил вас и созвал всех своих прихвостней. К слову, на корабле есть бочки с бомбами, но Джерад запретил вам к ним приближаться. msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID, -1) end end end aux.RegisterCreatureEvent(9010068, 7, "c9010068_On_Talk") function c9010075_Die(MapID, InstanceID, CreatureID, CreatureTypeID, KillerID) --- Герда local x, y ,z = unit.GetPosition(MapID, InstanceID, CreatureID) som_ostrov = 1 local som_ostrov = 1 map.MapCreateColCreature(MapID, InstanceID, 9010073, 1190, 2556, 1064, 1) map.MapDeleteCreature(1232817742, InstanceID, mob1) map.MapDeleteCreature(1232817742, InstanceID, mob2) map.MapDeleteCreature(1232817742, InstanceID, mob3) map.MapDeleteCreature(1232817742, InstanceID, mob4) map.MapDeleteCreature(1232817742, InstanceID, mob5) map.MapDeleteCreature(1232817742, InstanceID, mob6) map.MapDeleteCreature(1232817742, InstanceID, mob7) map.MapDeleteCreature(1232817742, InstanceID, mob8) map.MapDeleteCreature(1232817742, InstanceID, mob9) map.MapDeleteCreature(1232817742, InstanceID, mob10) map.MapDeleteCreature(1232817742, InstanceID, mob11) local RoleTbl = map.GetMapAllRoleID(MapID, InstanceID) if RoleTbl ~= nil then for k, v in pairs(RoleTbl) do role.RemoveFromRole(MapID, InstanceID, v, 6600209, 9999, 420) end end local RoleTbl = map.GetMapAllRoleID(MapID, InstanceID) if RoleTbl ~= nil then for k, v in pairs(RoleTbl) do role.AddRoleItem(MapID, InstanceID, v, 3500208, 2, 6, 8, 420) if math.random(100) == 1 then local yzor = {} yzor[1] = {9999070} yzor[2] = {9999071} yzor[3] = {9999072} local r = math.random(1,3) role.AddRoleItem(MapID, InstanceID, KillerID, yzor[r][1], 1, 6, 8, 420) elseif math.random(1000) == 1 then local yzor2 = {} yzor2[1] = {9999073} yzor2[2] = {9999074} yzor2[3] = {9999075} local r = math.random(1,3) role.AddRoleItem(MapID, InstanceID, KillerID, yzor2[r][1], 1, 6, 8, 420) end end end end aux.RegisterCreatureEvent(9010075, 4, "c9010075_Die") function c1086541_OnInvest(MapID, InstanceID, TargetID, TargetTypeID, RoleID) local x, y ,z = unit.GetPosition(MapID, InstanceID, TargetID) map.MapCreateColCreature(1232817742, InstanceID, 1086541, x, y ,z, 1) map.MapCreateColCreature(1232817742, InstanceID, 9010066, x, y ,z, 1) --- создать моба if role.GetRoleItemNum(RoleID, 6600212) == 1 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 900106) --Одновременно можно носить только 1 бомбу в инвентаре msg.DispatchRoleMsgEvent(RoleID, MsgID) elseif role.GetRoleItemNum(RoleID, 6600212) < 1 then role.AddRoleItem(MapID, InstanceID, RoleID, 6600212, 1, 6, 8, 420) end if djet_angry == 0 then map.MapDeleteCreature(MapID, InstanceID, TargetID) --- Удаление сундука map.MapDeleteCreature(MapID, InstanceID, 9010068)--- Удаление нпс map.MapDeleteCreature(MapID, InstanceID, djert)--- Удаление нпс local djert_zloy = map.MapCreateColCreature(1232817742, InstanceID, 9010063, 976, 2297, 1026, 1) --- Оживление НПС djet_angry = 1 --- Сделать нпс врагом local djet_angry = 1 end end aux.RegisterCreatureEvent(1086541, 6, "c1086541_OnInvest")