function f20_OnPlayerEnter(MapID, InstanceID,RoleID) unit.AddBuff(MapID, InstanceID, RoleID, 9099801, RoleID) local bHave = map.GetMapScriptData(MapID,InstanceID, 1, 0) if bHave == 0 then local soul1 = map.MapCreateColCreature(MapID, InstanceID, 9010076, 1223, 2307, 1192, true, "") local soul2 = map.MapCreateColCreature(MapID, InstanceID, 9010076, 1225, 2270, 1166, true, "") local soul3 = map.MapCreateColCreature(MapID, InstanceID, 9010076, 1290, 2003, 1204, true, "") local soul4 = map.MapCreateColCreature(MapID, InstanceID, 9010076, 1282, 2045, 1095, true, "") local soul5 = map.MapCreateColCreature(MapID, InstanceID, 9010076, 1268, 2153, 1033, true, "") map.SetMapScriptData(MapID,InstanceID, 1, 1, soul1) map.SetMapScriptData(MapID,InstanceID, 1, 2, soul2) map.SetMapScriptData(MapID,InstanceID, 1, 3, soul3) map.SetMapScriptData(MapID,InstanceID, 1, 4, soul4) map.SetMapScriptData(MapID,InstanceID, 1, 5, soul5) map.SetMapScriptData(MapID,InstanceID, 1, 0, 1) end end aux.RegisterMapEvent("f20", 2, "f20_OnPlayerEnter") function f20_OnPlayerLeave(MapID, InstanceID, RoleID) if role.IsRoleHaveBuff(MapID, InstanceID, RoleID, 90998) == true then unit.CancelBuff(MapID, InstanceID, RoleID, 9099801) end local item1Num = role.GetRoleItemNum(RoleID, 6600209) role.RemoveFromRole(MapID, InstanceID, RoleID, 6600209, item1Num, 420) local item2Num = role.GetRoleItemNum(RoleID, 6600212) role.RemoveFromRole(MapID, InstanceID, RoleID, 6600212, item2Num, 420) end aux.RegisterMapEvent("f20", 3, "f20_OnPlayerLeave") aux.RegisterMapEvent("f20", 25, "f20_OnPlayerLeave") function f20_CanEnterWhenOnline(Map, RoleID) return 3373741864, 262, 2989, 174 end aux.RegisterMapEvent("f20", 12, "f20_CanEnterWhenOnline") function f20_GetExporMapAndCoord(MapID, InstanceID, RoleID) if role.IsRoleHaveBuff(MapID, InstanceID, RoleID, 90998) == true then unit.CancelBuff(MapID, InstanceID, RoleID, 9099801) end return 1, 3373741864, 262, 2989, 174 end aux.RegisterMapEvent("f20", 13, "f20_GetExporMapAndCoord") function f20_CanEnter(MapID, InstanceID, RoleID) return 1 end aux.RegisterMapEvent("f20", 15, "f20_CanEnter") function c9010072_OnTalk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex) if TalkIndex == -1 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 930206) msg.AddMsgEvent(MsgID, 24, TargetID) msg.AddMsgEvent(MsgID, 21, 4) msg.AddMsgEvent(MsgID, 1, 930204) msg.AddMsgEvent(MsgID, 21, 9) msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) elseif TalkIndex == 4 then local TeamID = role.IsRoleHaveTeam(MapID, InstanceID, RoleID) if TeamID and TeamID ~= 4294967295 then if familyInstancePartyCheck(MapID, InstanceID, TeamID) ~= true then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 930208) msg.AddMsgEvent(MsgID, 24, TargetID) msg.AddMsgEvent(MsgID, 21, 9) msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) else local Player = {} Player[1], Player[2], Player[3], Player[4], Player[5], Player[6] = role.GetRoleTeamMemID(TeamID) for i=1, 6 do if Player[i] and Player[i]~= 4294967295 then role.RoleGotoNewMap(MapID, InstanceID, Player[i], 1232817742, 1271, 2180, 1281) end end end else local Level = role.GetRoleLevel(MapID, InstanceID, RoleID) local EquipID = role.GetEquipIDOnPos(RoleID, 14) if Level < 60 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 930208) msg.AddMsgEvent(MsgID, 24, TargetID) msg.AddMsgEvent(MsgID, 21, 9) msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) elseif role.IsRoleHaveBuff(MapID, InstanceID, RoleID, 90997) ~= true then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 930207) msg.AddMsgEvent(MsgID, 24, TargetID) msg.AddMsgEvent(MsgID, 21, 9) msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) elseif (EquipID and EquipID ~= 4294967295) then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 930209) msg.AddMsgEvent(MsgID, 24, TargetID) msg.AddMsgEvent(MsgID, 21, 9) msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) elseif role.IsRoleHaveBuff(MapID, InstanceID, RoleID, 99996) == true then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 930209) msg.AddMsgEvent(MsgID, 24, TargetID) msg.AddMsgEvent(MsgID, 21, 9) msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) else local Weary = unit.GetAttValue(MapID, InstanceID, RoleID, 81) local WearyEffect = unit.GetAttValue(MapID, InstanceID, RoleID, 104) local MaxWeary = 200 if role.IsRoleHaveBuff(MapID, InstanceID, RoleID, 90034) ~= true then MaxWeary = 100 end if Weary + ( 30 + WearyEffect) > MaxWeary then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 930209) msg.AddMsgEvent(MsgID, 24, TargetID) msg.AddMsgEvent(MsgID, 21, 9) msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) else role.RoleGotoNewMap(MapID, InstanceID, RoleID, 1232817742, 1271, 2180, 1281) end end end end end aux.RegisterCreatureEvent(9010072, 7, "c9010072_OnTalk") function c9010076_OnTalk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex)-- ??????????????????????? if TalkIndex == -1 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 930201) msg.AddMsgEvent(MsgID, 24, TargetID) msg.AddMsgEvent(MsgID, 21, 4) msg.AddMsgEvent(MsgID, 1, 930202) msg.DispatchRoleMsgEvent(RoleID, MsgID) msg.AddMsgEvent(MsgID, 21, 9) msg.AddMsgEvent(MsgID, 1, 100002) elseif TalkIndex == 4 then map.MapDeleteCreature(MapID, InstanceID, map.GetMapScriptData(MapID,InstanceID, 1, 1)) map.MapDeleteCreature(MapID, InstanceID, map.GetMapScriptData(MapID,InstanceID, 1, 2)) map.MapDeleteCreature(MapID, InstanceID, map.GetMapScriptData(MapID,InstanceID, 1, 3)) map.MapDeleteCreature(MapID, InstanceID, map.GetMapScriptData(MapID,InstanceID, 1, 4)) map.MapDeleteCreature(MapID, InstanceID, map.GetMapScriptData(MapID,InstanceID, 1, 5)) local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 900101) -- ?????????????????? ??????????? ???????????? msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local boss = map.MapCreateColCreature(MapID, InstanceID, 9010075, 1267, 1957, 1178, true, "") map.SetMapScriptData(MapID,InstanceID, 1, 6, boss) map.MapCreateColCreature(MapID, InstanceID, 9010074, 1284, 2027, 1189, true, "") map.MapCreateColCreature(MapID, InstanceID, 9010074, 1255, 1996, 1162, true, "") map.MapCreateColCreature(MapID, InstanceID, 9010074, 1249, 2077, 1195, true, "") end end aux.RegisterCreatureEvent(9010076, 7, "c9010076_OnTalk") function c9010075_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) -- ??????????????? ???????????? ???????????? map.MapCreateColCreature(MapID, InstanceID, 9010073, 1182, 2557, 1068, true, "") local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 900102) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) map.SetMapScriptData(MapID,InstanceID, 1, 6, 0) local TeamID = role.IsRoleHaveTeam(MapID, InstanceID, RoleID) if TeamID and TeamID ~= 4294967295 then local Player = {} Player[1], Player[2], Player[3], Player[4], Player[5], Player[6] = role.GetRoleTeamMemID(TeamID) for i=1, 6 do if Player[i] and Player[i]~= 4294967295 then local itemNum = role.GetRoleItemNum(Player[i], 6600209) role.RemoveFromRole(MapID, InstanceID, Player[i], 6600209, itemNum, 420) end end else local itemNum = role.GetRoleItemNum(RoleID, 6600209) role.RemoveFromRole(MapID, InstanceID, RoleID, 6600209, itemNum, 420) end end aux.RegisterCreatureEvent(9010075, 4, "c9010075_OnDie") -- Функция, вызываемая при смерти существа function c9010074_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) -- Проверяем, есть ли данные на карте -- Генерируем случайное число от 1 до 200 if math.random(1, 200) > 100 then -- Создаем событие сообщения local MsgID = msg.BeginMsgEvent() -- Добавляем сообщение в событие msg.AddMsgEvent(MsgID, 102, 900103) -- Отправляем сообщение на карту msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) -- Добавляем предмет игроку role.AddRoleItem(MapID, InstanceID, RoleID, 6600209, 1, -1, 8, 420) end end -- Регистрируем событие смерти существа aux.RegisterCreatureEvent(9010074, 4, "c9010074_OnDie") function c9010073_OnTalk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex) -- ??-???????????? local FlowerSpawnPoints = {} FlowerSpawnPoints[1] = {1194, 2291, 1032} FlowerSpawnPoints[2] = {1209, 2270, 993} FlowerSpawnPoints[3] = {1270, 2147, 1033} FlowerSpawnPoints[4] = {1294, 2088, 1053} FlowerSpawnPoints[5] = {1205, 2376, 1099} FlowerSpawnPoints[6] = {1224, 2216, 1134} FlowerSpawnPoints[7] = {1211, 2496, 1248} FlowerSpawnPoints[8] = {1213, 2434, 1284} FlowerSpawnPoints[9] = {1308, 2189, 1313} FlowerSpawnPoints[10] = {1283, 1971, 1120} FlowerSpawnPoints[11] = {1297, 1929, 1178} FlowerSpawnPoints[12] = {1290, 2076, 1233} for i=0, 4 do local r = math.random(1,#FlowerSpawnPoints-i) map.MapCreateColCreature(MapID, InstanceID, 9010070, FlowerSpawnPoints[r][1], FlowerSpawnPoints[r][2], FlowerSpawnPoints[r][3], true, "") FlowerSpawnPoints[r] = FlowerSpawnPoints[#FlowerSpawnPoints-i] end local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 900107) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local TeamID = role.IsRoleHaveTeam(MapID, InstanceID, RoleID) if TeamID and TeamID ~= 4294967295 then local Player = {} Player[1], Player[2], Player[3], Player[4], Player[5], Player[6] = role.GetRoleTeamMemID(TeamID) for i=1, 6 do if Player[i] and Player[i]~= 4294967295 then unit.AddBuff(MapID, InstanceID, Player[i], 5947901, Player[i]) end end else unit.AddBuff(MapID, InstanceID, RoleID, 5947901, RoleID) end map.MapDeleteCreature(MapID, InstanceID, TargetID) end aux.RegisterCreatureEvent(9010073, 7, "c9010073_OnTalk") function c9010070_OnTalk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex) -- ???????????? local x, y, z = unit.GetPosition(MapID, InstanceID, TargetID) map.MapCreateColCreature(MapID, InstanceID, 9010069, x, y, z, true, "") local nFlowers = map.GetMapScriptData(MapID,InstanceID, 1, 7) + 1 map.SetMapScriptData(MapID,InstanceID, 1, 7, nFlowers) if nFlowers < 5 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 900104) msg.AddMsgEvent(MsgID, 9, nFlowers) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 900108) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) map.MapCreateColCreature(MapID, InstanceID, 9010068, 971, 2297, 1040, true, "") local TeamID = role.IsRoleHaveTeam(MapID, InstanceID, RoleID) if TeamID and TeamID ~= 4294967295 then local Player = {} Player[1], Player[2], Player[3], Player[4], Player[5], Player[6] = role.GetRoleTeamMemID(TeamID) for i=1, 6 do if Player[i] and Player[i]~= 4294967295 then if role.IsRoleHaveBuff(MapID, InstanceID, Player[i], 59479) == true then unit.CancelBuff(MapID, InstanceID, Player[i], 5947901) end end end else if role.IsRoleHaveBuff(MapID, InstanceID, RoleID, 59479) == true then unit.CancelBuff(MapID, InstanceID, RoleID, 5947901) end end end map.MapDeleteCreature(MapID, InstanceID, TargetID) end aux.RegisterCreatureEvent(9010070, 7, "c9010070_OnTalk") function c9010068_OnTalk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex) -- ????????????? if TalkIndex == -1 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 930211) msg.AddMsgEvent(MsgID, 24, TargetID) msg.AddMsgEvent(MsgID, 21, 4) msg.AddMsgEvent(MsgID, 1, 930212) msg.DispatchRoleMsgEvent(RoleID, MsgID) msg.AddMsgEvent(MsgID, 21, 9) msg.AddMsgEvent(MsgID, 1, 100002) elseif TalkIndex == 4 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 900105) -- ?????????????????? ????????? msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) map.MapCreateColCreature(MapID, InstanceID, 9010067, 1030, 2297, 950, true, "")--????????? map.MapCreateColCreature(MapID, InstanceID, 9010064, 994, 2297, 1264, true, "")--?????????? map.MapCreateColCreature(MapID, InstanceID, 9010064, 1005, 2297, 742, true, "")--?????????? map.MapCreateColCreature(MapID, InstanceID, 9010066, 999, 2297, 840, true, "")--??????????????????? map.MapCreateColCreature(MapID, InstanceID, 9010066, 1060, 2297, 840, true, "")--??????????????????? map.MapCreateColCreature(MapID, InstanceID, 9010066, 1083, 2297, 799, true, "")--??????????????????? map.MapCreateColCreature(MapID, InstanceID, 9010066, 1050, 2297, 750, true, "")--??????????????????? map.MapCreateColCreature(MapID, InstanceID, 9010066, 982, 2297, 788, true, "")--??????????????????? map.MapCreateColCreature(MapID, InstanceID, 9010066, 997, 2297, 938, true, "")--??????????????????? map.MapCreateColCreature(MapID, InstanceID, 9010066, 1062, 2297, 940, true, "")--??????????????????? map.MapCreateColCreature(MapID, InstanceID, 9010066, 1000, 2297, 1053, true, "")--??????????????????? map.MapCreateColCreature(MapID, InstanceID, 9010066, 1006, 2297, 1198, true, "")--??????????????????? map.MapCreateColCreature(MapID, InstanceID, 9010066, 1077, 2297, 1181, true, "")--??????????????????? map.MapCreateColCreature(MapID, InstanceID, 9010066, 1023, 2297, 1279, true, "")--??????????????????? map.MapDeleteCreature(MapID, InstanceID, TargetID) end end aux.RegisterCreatureEvent(9010068, 7, "c9010068_OnTalk") function c9010061_OnTalk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex) -- ????????????? local TeamID = role.IsRoleHaveTeam(MapID, InstanceID, RoleID) if TeamID and TeamID ~= 4294967295 then local Player = {} Player[1], Player[2], Player[3], Player[4], Player[5], Player[6] = role.GetRoleTeamMemID(TeamID) for i=1, 6 do if Player[i] and Player[i]~= 4294967295 then role.RoleGotoNewMap(MapID, InstanceID, Player[i], 3373741864, 262, 2989, 174) end end else role.RoleGotoNewMap(MapID, InstanceID, RoleID, 3373741864, 262, 2989, 174) end end aux.RegisterCreatureEvent(9010061, 7, "c9010061_OnTalk") function HaveElixirOfBuffCheck(MapID, InstanceID, RoleID) local class = role.GetRoleClass(RoleID) bRet = false if class == 2 or class == 6 or class == 7 or class == 3 or class == 8 or class == 9 then if role.GetRoleItemNum(RoleID, 6600603) > 0 then bRet = true end elseif class == 4 or class == 10 or class == 11 then if role.GetRoleItemNum(RoleID, 6600604) > 0 then bRet = true end elseif class == 5 or class == 12 or class == 13 then if role.GetRoleItemNum(RoleID, 6600605) > 0 then bRet = true end end return bRet end function AddElixirOfBuff(MapID, InstanceID, RoleID) local class = role.GetRoleClass(RoleID) if class == 2 or class == 6 or class == 7 or class == 3 or class == 8 or class == 9 then role.AddRoleItem(MapID, InstanceID, RoleID, 6600603, 1, -1, 8, 420) elseif class == 4 or class == 10 or class == 11 then role.AddRoleItem(MapID, InstanceID, RoleID, 6600604, 1, -1, 8, 420) elseif class == 5 or class == 12 or class == 13 then role.AddRoleItem(MapID, InstanceID, RoleID, 6600605, 1, -1, 8, 420) end end function c9010064_OnInvest(MapID, InstanceID, TargetID, TargetTypeID, RoleID) -- ??????????? local AngryState = map.GetMapScriptData(MapID,InstanceID, 1, 20) if (AngryState == 0) then map.SetMapScriptData(MapID,InstanceID, 1, 20, 1) map.MapCreateColCreature(MapID, InstanceID, 9010065, 1054, 2297, 996, true, "") map.MapCreateColCreature(MapID, InstanceID, 9010065, 1014, 2297, 996, true, "") map.MapCreateColCreature(MapID, InstanceID, 9010063, 1030, 2297, 950, true, "") local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 900109) -- ???????????????? ?? ???????????? msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) end if role.GetRoleItemNum(RoleID, 6600212) < 1 then role.AddRoleItem(MapID, InstanceID, RoleID, 6600212, 1, -1, 8, 420) end local x, y, z = unit.GetPosition(MapID, InstanceID, TargetID) map.MapCreateColCreature(MapID, InstanceID, 9010064, x, y, z, true, "") end aux.RegisterCreatureEvent(9010064, 6, "c9010064_OnInvest") function familyInstancePartyCheck(MapID, InstanceID, TeamID) local Player = {} Player[1], Player[2], Player[3], Player[4], Player[5], Player[6] = role.GetRoleTeamMemID(TeamID) for i=1, 6 do if Player[i] and Player[i]~= 4294967295 then local EquipID = role.GetEquipIDOnPos(Player[i], 14) if role.GetRoleLevel(MapID, InstanceID, Player[i]) < 60 then return false elseif role.IsRoleHaveBuff(MapID, InstanceID, Player[i], 90997) ~= true then return false elseif role.IsRoleHaveBuff(MapID, InstanceID, Player[i], 99996) == true then return false elseif EquipID and EquipID ~= 4294967295 then return false else local Weary = unit.GetAttValue(MapID, InstanceID, Player[i], 81) local WearyEffect = unit.GetAttValue(MapID, InstanceID, Player[i], 104) local MaxWeary = 200 if role.IsRoleHaveBuff(MapID, InstanceID, Player[i], 90034) ~= true then MaxWeary = 100 end if Weary + ( 30 + WearyEffect) > MaxWeary then return false end end end end return true end function I6600211_CanUse(MapID, InstanceID, ItemID, RoleID) local bRet, bIgnore = 0, false local FamilyID = role.GetRoleFamilyID(MapID, InstanceID, RoleID) if FamilyID and FamilyID ~= 4294967295 then bRet = 0 else bRet = 32 end return bRet, bIgnore end aux.RegisterItemEvent(6600211, 0, "I6600211_CanUse") function I6600211_OnUse(MapID, InstanceID, ItemID, RoleID) local UserFamilyID = role.GetRoleFamilyID(MapID, InstanceID, RoleID) local RoleTbl = map.GetMapAllRoleID(MapID, InstanceID) for i=1,#RoleTbl do if role.GetRoleFamilyID(MapID, InstanceID, RoleTbl[i]) == UserFamilyID then unit.AddBuff(MapID, InstanceID, RoleTbl[i], 9099701, RoleTbl[i]) end end end aux.RegisterItemEvent(6600211, 1, "I6600211_OnUse") function c9010067_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) local x, y, z = unit.GetPosition(MapID, InstanceID, TargetID) map.MapCreateColCreature(MapID, InstanceID, 9010061, x, y, z, true, "") local RuneID = 3020137 local HolyStoneID = 3500048 local DragonBloodNum = {3, 5} local RareNum = 15 -- Количество элементов в таблице RareLoot local RareLoot = { [1] = {3020001, 3}, [2] = {3560002, 3}, [3] = {3070022, 1}, [4] = {3020060, 1}, [5] = {3500048, 1}, [6] = {3020137, 1}, [7] = {5802612, 1}, [8] = {5802617, 1}, [9] = {5802622, 1}, [10] = {5802627, 1}, [11] = {5802632, 1}, [12] = {4820035, 1}, [13] = {6600980, 1}, [14] = {3500022, 1}, [15] = {3060057, 1} } local BottlesNum = 5 local FamilyBottles = { [1] = {6600230, 1}, [2] = {6600231, 1}, [3] = {6600232, 1}, [4] = {6600233, 1}, [5] = {6600234, 1} } local AngryState = map.GetMapScriptData(MapID, InstanceID, 1, 20) if AngryState == 1 then RuneID = 3020137 DragonBloodNum = {1, 3} end local TeamID = role.IsRoleHaveTeam(MapID, InstanceID, RoleID) if TeamID and TeamID ~= 4294967295 then local Player = {} local RoleNum = 0 Player[1], Player[2], Player[3], Player[4], Player[5], Player[6] = role.GetRoleTeamMemID(TeamID) for i = 1, 6 do if Player[i] and Player[i] ~= 4294967295 then if HaveElixirOfBuffCheck(MapID, InstanceID, Player[i]) ~= true and math.random(1, 300) > 150 then AddElixirOfBuff(MapID, InstanceID, Player[i]) end local itemNum = role.GetRoleItemNum(Player[i], 6600212) if itemNum > 0 then role.RemoveFromRole(MapID, InstanceID, Player[i], 6600212, itemNum, 420) end local s = math.random(BottlesNum) role.AddRoleItem(MapID, InstanceID, Player[i], FamilyBottles[s][1], FamilyBottles[s][2], -1, 8, 420) role.AddRoleItem(MapID, InstanceID, Player[i], RuneID, 1, -1, 8, 420) role.AddRoleItem(MapID, InstanceID, Player[i], 6600979, math.random(DragonBloodNum[1], DragonBloodNum[2]), -1, 8, 420) if math.random(1, 2) == 2 then role.AddRoleItem(MapID, InstanceID, Player[i], HolyStoneID, 1, -1, 8, 420) end if AngryState == 0 then local rareIndex = math.random(1, #RareLoot) -- Генерируем число от 1 до количества элементов в таблице RareLoot -- Rare Index: rareIndex - отладочное сообщение (удалено) role.AddRoleItem(MapID, InstanceID, Player[i], RareLoot[rareIndex][1], RareLoot[rareIndex][2], -1, 8, 420) end if math.random(1, 10) > 4 then role.AddRoleItem(MapID, InstanceID, Player[i], 3070018, 3, -1, 8, 420) end RoleNum = RoleNum + 1 end end if AngryState == 0 and math.random(10) > 7 then -- role.AddRoleItem(MapID, InstanceID, Player[math.random(RoleNum)], 5802131 + math.random(0, 2), 1, -1, 8, 420) end if math.random(10) > 2 then -- role.AddRoleItem(MapID, InstanceID, Player[math.random(RoleNum)], 4810109, 1, -1, 8, 420) end else if HaveElixirOfBuffCheck(MapID, InstanceID, RoleID) ~= true and math.random(1, 300) > 150 then AddElixirOfBuff(MapID, InstanceID, RoleID) end local itemNum = role.GetRoleItemNum(RoleID, 6600212) if itemNum > 0 then role.RemoveFromRole(MapID, InstanceID, RoleID, 6600212, itemNum, 420) end local s = math.random(BottlesNum) role.AddRoleItem(MapID, InstanceID, RoleID, FamilyBottles[s][1], FamilyBottles[s][2], -1, 8, 420) role.AddRoleItem(MapID, InstanceID, RoleID, RuneID, 1, -1, 8, 420) role.AddRoleItem(MapID, InstanceID, RoleID, 6600979, math.random(DragonBloodNum[1], DragonBloodNum[2]), -1, 8, 420) if math.random(1, 2) == 2 then role.AddRoleItem(MapID, InstanceID, RoleID, HolyStoneID, 1, -1, 8, 420) end if AngryState == 0 then local rareIndex = math.random(1, #RareLoot) -- Генерируем число от 1 до количества элементов в таблице RareLoot -- Rare Index: rareIndex - отладочное сообщение (удалено) role.AddRoleItem(MapID, InstanceID, RoleID, RareLoot[rareIndex][1], RareLoot[rareIndex][2], -1, 8, 420) end end end aux.RegisterCreatureEvent(9010067, 4, "c9010067_OnDie")