-- Fallback: в некоторых сборках движка нет C-функции SGuildScriptData. -- Эмуляция через map.GetMapScriptData / map.SetMapScriptData для гильдийного инстанса g01. if SGuildScriptData == nil then function SGuildScriptData(InstanceID, Index, Opt, Value) local GUILD_DUNGEON_MAP_ID = 2573373074 if map == nil then return nil end if Opt == 0 then local ok, result = pcall(map.GetMapScriptData, GUILD_DUNGEON_MAP_ID, InstanceID, 1, Index) if ok then return result end return nil elseif Opt == 1 then pcall(map.SetMapScriptData, GUILD_DUNGEON_MAP_ID, InstanceID, 1, Index, Value) return Value end return nil end end item_guild_dangeon = { {3100254, 3100242, 3100243, 3100244, 3100245, 3100246, 3100247, 3100248, 3100249, 3100250, 3100251, 3100252, 3100253, 3100256, 3100257, 4820139, 4820140, 4820159, 4820160, 4999004, 4820260, 4100901, 4530110, 4999005, 3010041, 4530109, 4400024, 4820083, 6600302, 6600304, 4820263, 4820039, 4820079, 3050068, 3050069, 3050070, 3060059}, -- Mobs1 {3100254, 3100242, 3100243, 3100244, 3100245, 3100246, 3100247, 3100248, 3100249, 3100250, 3100251, 3100252, 3100253, 3100256, 3100257, 4820139, 4820140, 4820159, 4820160, 4999004, 4820260, 4100901, 4530110, 4999005, 3010041, 4530109, 4400024, 4820083, 6600302, 6600304, 4820263, 4820039, 4820079, 3050068, 3050069, 3050070, 3060059}, -- Mobs2 {3100254, 3100242, 3100243, 3100244, 3100245, 3100246, 3100247, 3100248, 3100249, 3100250, 3100251, 3100252, 3100253, 3100256, 3100257, 4820139, 4820140, 4820159, 4820160, 4999004, 4820260, 4100901, 4530110, 4999005, 3010041, 4530109, 4400024, 4820083, 6600302, 6600304, 4820263, 4820039, 4820079, 3050068, 3050069, 3050070, 3060059}, -- Mobs3 {3100254, 3100242, 3100243, 3100244, 3100245, 3100246, 3100247, 3100248, 3100249, 3100250, 3100251, 3100252, 3100253, 3100256, 3100257, 4820139, 4820140, 4820159, 4820160, 4999004, 4820260, 4100901, 4530110, 4999005, 3010041, 4530109, 4400024, 4820083, 6600302, 6600304, 4820263, 4820039, 4820079, 3050068, 3050069, 3050070, 3060059}, -- Mobs4 {0, 4820049, 4700230, 4700231, 4820035, 3500061, 4820141, 4820161, 3110011, 3110016, 3500208, 4820084, 4810109}, -- Boss1 {0, 4820049, 4700230, 4700231, 4820035, 3500061, 4820141, 4820161, 3110011, 3110016, 3500208, 4820084, 4810109}, -- Boss2 {0, 4820049, 4700230, 4700231, 4820035, 3500061, 4820141, 4820161, 3110011, 3110016, 3500208, 4820084, 4810109}, -- Boss3 {0, 4820049, 4700230, 4700231, 4820035, 3500061, 4820141, 4820161, 3110011, 3110016, 3500208, 4820084, 4810109} -- Boss4 } function m9010466_Atak(MapID, InstanceID, CreatureID, GetID) local chek1 = SGuildScriptData(InstanceID, 10, 0, 0) local chek2 = SGuildScriptData(InstanceID, 11, 0, 0) local HpPercent = unit.GetAttValue(MapID, InstanceID, CreatureID, 9) * 100 / unit.GetAttValue(MapID, InstanceID, CreatureID, 8) HpPercent = math.floor(HpPercent) local x, y, z = unit.GetPosition(MapID, InstanceID, CreatureID) if HpPercent <= 50 then unit.AddBuff(MapID, InstanceID, CreatureID, 5950901) unit.AddBuff(MapID, InstanceID, CreatureID, 5951401) end if HpPercent <= 80 then if tonumber(chek1) == 0 then unit.AddBuff(MapID, InstanceID, CreatureID, 5950901) unit.AddBuff(MapID, InstanceID, CreatureID, 5951401) SGuildScriptData(InstanceID, 10, 1, 1) end if tonumber(chek1) == 1 and tonumber(chek2) == 0 then local b = math.random(100) if b <= 30 then map.MapCreateColCreature(MapID, InstanceID, 9010469, x + math.random(50), y, z + math.random(50), "") SGuildScriptData(InstanceID, 11, 1, 1) end end end end aux.RegisterCreatureEvent(9010466, 14, "m9010466_Atak") function m9010470_Atak(MapID, InstanceID, CreatureID, GetID) local RoleTbl = map.GetMapAllRoleID(MapID, InstanceID) local x, y, z = unit.GetPosition(MapID, InstanceID, CreatureID) local b = math.random(100) if b <= 30 then map.MapCreateColCreature(MapID, InstanceID, 9010471, x + math.random(100), y, z + math.random(100), "") end local HpPercent = unit.GetAttValue(MapID, InstanceID, CreatureID, 9) * 100 / unit.GetAttValue(MapID, InstanceID, CreatureID, 8) HpPercent = math.floor(HpPercent) local c = math.random(100) if HpPercent <= 50 then if c <= 30 then unit.AddBuff(MapID, InstanceID, CreatureID, 5952201) end end end aux.RegisterCreatureEvent(9010470, 14, "m9010470_Atak") function m9010472_Atak(MapID, InstanceID, CreatureID, GetID) local x, y, z = unit.GetPosition(MapID, InstanceID, CreatureID) local b = math.random(100) if b <= 30 then map.MapCreateColCreature(MapID, InstanceID, 9010473, x + math.random(100), y, z + math.random(100), "") end local HpPercent = unit.GetAttValue(MapID, InstanceID, CreatureID, 9) * 100 / unit.GetAttValue(MapID, InstanceID, CreatureID, 8) HpPercent = math.floor(HpPercent) local e = math.random(100) if HpPercent <= 50 then if e <= 20 then map.MapCreateColCreature(MapID, InstanceID, 9010474, x, y, z, "") end end end aux.RegisterCreatureEvent(9010472, 14, "m9010472_Atak") function m9010475_Atak(MapID, InstanceID, CreatureID, GetID) local x, y, z = unit.GetPosition(MapID, InstanceID, CreatureID) local b = math.random(100) if b <= 30 then map.MapCreateColCreature(MapID, InstanceID, 9010476, x + math.random(100), y, z + math.random(100), "") end local HpPercent = unit.GetAttValue(MapID, InstanceID, CreatureID, 9) * 100 / unit.GetAttValue(MapID, InstanceID, CreatureID, 8) HpPercent = math.floor(HpPercent) local e = math.random(100) if HpPercent <= 99 then if e <= 20 then unit.AddBuff(MapID, InstanceID, CreatureID, 5953701) end end end aux.RegisterCreatureEvent(9010475, 14, "m9010475_Atak")