--[[ a.abolishin Драконы. Копия bot_Inst11_15_Dragons.lua, чтобы случайно не пофачились квестовые драконы, если вдруг кто-то будет править инстовых. ]] -- получить уровень противника function bot_Dragon_GetOppLevel() local oppList = aux.getPersList(aux.oppTeamNum(), true) if oppList and (#oppList > 0) then table.sort(oppList, function(p1, p2) -- сортируем по убыванию return PERS_LEVEL(p1) > PERS_LEVEL(p2) end) return PERS_LEVEL(oppList[1]) else return 0 end end -- проверка на частоту мощного удара против игроков высокого уровня function bot_Dragon_CheckPowerAttackRate() local oppLevel = bot_Dragon_GetOppLevel() if oppLevel > 0 then local rate = math.max(5 - (oppLevel - PERS_LEVEL(my.persPtr)), 0) if rate < 4 then return rate end end return 0 end function bot_Dragon_r(A, C, R, RD, wizards, attacks, critAttack, summonA) local bot = PERS(my.persPtr) local fight = FIGHT(my.fightPtr) -- призыв ботов в начале боя if bot_DragonBaf == nil then bot_DragonBaf = {} end if bot_DragonBaf[bot.id] == nil then bot_DragonBaf[bot.id] = 0 end -- номер хода, для проверки возможности применения "орбовых" абилок if bot_DragonTurn == nil then bot_DragonTurn = {} end if bot_DragonTurn[bot.id] == nil then bot_DragonTurn[bot.id] = 0 end -- считалка для второго бафа (3 раза за бой) if bot_DragonBaf2 == nil then bot_DragonBaf2 = {} end if bot_DragonBaf2[bot.id] == nil then bot_DragonBaf2[bot.id] = 3 end -- считалка для мощного удара против игроков высоких уровней if bot_DragonCrit == nil then bot_DragonCrit = {} end if bot_DragonCrit[bot.id] == nil then bot_DragonCrit[bot.id] = {0, 0} end -- считалка дохлых магов if bot_DeadWizards == nil then bot_DeadWizards = {} end if bot_DeadWizards[fight.id] == nil then bot_DeadWizards[fight.id] = 0 end -- призываем ботов if summonA and (bot_DragonBaf[bot.id] == 0) then -- Призываем 2ух драконов и 2ух рандомных магов for i=0, 1 do aux.useEffect({artId = summonA[1]}) if #summonA > 2 then aux.useEffect({artId = aux.getRandVal(summonA[2+i])}) else aux.useEffect({artId = aux.getRandVal(summonA[2])}) end end bot_DragonBaf[bot.id] = 1 end -- можем ли ходить? if (my.status ~= FS_PS_ACTIVE) or (not my.oppPtr) then return end -- 2. 3 раза за бой отлечка/зарядка local hpC = bot.hp/bot.hpMax if hpC < (bot_DragonBaf2[bot.id] * C[1]) then for i, art in ipairs(A[2]) do aux.useEffect({artId = art}) end bot_DragonBaf2[bot.id] = bot_DragonBaf2[bot.id] - 1 end -- 5. проверяем смерть мага if A[4] and (bot_DeadWizards[fight.id] < 2) then local deadWizards = 0 local deadList = aux.getPersList(my.teamNum, false, true, true) if deadList then for _, deadPersPtr in pairs(deadList) do local deadPers = PERS(deadPersPtr) if aux.inTable(deadPers.artId, wizards) then deadWizards = deadWizards + 1 end end end if deadWizards > bot_DeadWizards[fight.id] then if #aux.activeEffects(my.persPtr, {grpId = RD}) < 1 then aux.useEffect({artId = A[4]}, my.oppPtr) end bot_DeadWizards[fight.id] = deadWizards bot_DragonTurn[bot.id] = bot_DragonTurn[bot.id] + 1 return end end -- 3. смотрим на противника, обновляем счетчик мощного удара... bot_DragonCrit[bot.id][1] = bot_DragonCrit[bot.id][1] + 1 if bot_DragonCrit[bot.id][2] ~= 1 then bot_DragonCrit[bot.id][2] = bot_Dragon_CheckPowerAttackRate() end -- ...и дамажим если пришло время if (bot_DragonCrit[bot.id][1] >= bot_DragonCrit[bot.id][2]) and (bot_DragonCrit[bot.id][2] > 0) then aux.useEffect({artId = A[1]}) ATTACK(critAttack) bot_DragonCrit[bot.id][1] = 0 bot_DragonTurn[bot.id] = bot_DragonTurn[bot.id] + 1 return end -- 4. магическая атака if A[3] and -- если есть такая абилка (ее нету у диких драконов) (not PERS_ISBOT(my.oppPtr)) and -- если противник не бот (бот не может кинуть орб) (bot_DragonTurn[bot.id] > 0) and aux.randRoll(R[1]) and -- если прошел рандом (#aux.activeEffects(my.persPtr, {grpId = RD}) < 1) -- и если нет активного орба then aux.useEffect({artId = A[3]}, my.oppPtr) else ATTACK(aux.getRandVal(attacks)) end bot_DragonTurn[bot.id] = bot_DragonTurn[bot.id] + 1 end -- botID = 878 function bot_Dragon_11() -- мощный удар с антивампом, лечилка, мощный магический урон, аое дамаг local A = {4672, {4670}, 4669, 4671} local C = {0.2} local R = {0.9} local RD = 5 -- 11ые маги local wizards = {879, 880, 886, 887, 888, 889, 911, 912, 913} local attacks = {1, 3} bot_Dragon_r(A, C, R, RD, wizards, attacks, 2) end -- botID = 1077 function bot_Dragon_11_Morok() -- мощный удар с антивампом, лечилка, мощный магический урон local A = {6273, {4670}, 6274} local C = {0.2} local R = {0.9} local RD = 5 local attacks = {1, 3} bot_Dragon_r(A, C, R, RD, nil, attacks, 2) end -- botID = function bot_Dragon_11_Wild() -- мощный удар с антивампом, лечилка local A = {6273, {4670}} local C = {0.2} local R = {0.9} local RD = 5 local attacks = {1, 3} bot_Dragon_r(A, C, R, RD, nil, attacks, 2) end function bot_Dragon_11_t() -- мощный удар с антивампом, лечилка, мощный магический урон, аое дамаг local A = {4672, {4670}, 4669, 4671} local C = {0.2} local R = {0.9} local RD = 5 local wizards = {875, 876} local attacks = {1, 3} -- дракон 11, 11ые маги local summonA = {4812, {4817, 4818}} bot_Dragon_r(A, C, R, RD, wizards, attacks, 2) end -- botID = 943 function bot_Dragon_11_Summoner() -- мощный удар с антивампом, лечилка, мощный магический урон, аое дамаг local A = {4672, {4670}, 4669, 4671} local C = {0.2} local R = {0.9} local RD = 5 -- 11ые маги local wizards = {879, 880, 886, 887, 888, 889, 911, 912, 913} local attacks = {1, 3} -- дракон 11, 11ые маги local summonA = {4812, {4817, 4818, 4819, 4820, 4821, 4822}} bot_Dragon_r(A, C, R, RD, wizards, attacks, 2, summonA) end -- botID = 882 function bot_Dragon_12() -- мощный удар с антивампом, вампиризм, мощный магический урон, аое дамаг local A = {4672, {4710}, 4702, 4706} local C = {0.25} local R = {0.9} local RD = 5 local wizards = {879, 880, 886, 887, 888, 889, 911, 912, 913, -- 11ые маги 890, 891, 892, 893, 894, 895, 914, 915, 916} -- 13ые маги local attacks = {1, 3} bot_Dragon_r(A, C, R, RD, wizards, attacks, 2) end -- botID = 1078 function bot_Dragon_12_Morok() -- мощный удар с антивампом, вампиризм, мощный магический урон local A = {6273, {4710}, 6275} local C = {0.25} local R = {0.9} local RD = 5 local attacks = {1, 3} bot_Dragon_r(A, C, R, RD, nil, attacks, 2) end -- botID = function bot_Dragon_12_Wild() -- мощный удар с антивампом, вампиризм local A = {6273, {4710}} local C = {0.25} local R = {0.9} local RD = 5 local attacks = {1, 3} bot_Dragon_r(A, C, R, RD, nil, attacks, 2) end -- botID = 944 function bot_Dragon_12_Summoner() -- мощный удар с антивампом, вампиризм, мощный магический урон, аое дамаг local A = {4672, {4710}, 4702, 4706} local C = {0.25} local R = {0.9} local RD = 5 local wizards = {879, 880, 886, 887, 888, 889, 911, 912, 913, -- 11ые маги 890, 891, 892, 893, 894, 895, 914, 915, 916} -- 13ые маги local attacks = {1, 3} local summonA = {4813, -- дракон 12 {4817, 4818, 4819, 4820, 4821, 4822}, -- 11ые маги {4823, 4824, 4825, 4826, 4827, 4828}} -- 13ые маги bot_Dragon_r(A, C, R, RD, wizards, attacks, 2, summonA) end -- botID = 883 function bot_Dragon_13() -- мощный удар с антивампом, очищение, мощный магический урон, аое дамаг+травля local A = {4672, {4711}, 4703, 4707} local C = {0.2} local R = {0.9} local RD = 5 -- 13ые маги local wizards = {890, 891, 892, 893, 894, 895, 914, 915, 916} local attacks = {1, 3} bot_Dragon_r(A, C, R, RD, wizards, attacks, 2) end -- botID = 1079 function bot_Dragon_13_Morok() -- мощный удар с антивампом, очищение, мощный магический урон local A = {6273, {4711}, 6276} local C = {0.2} local R = {0.9} local RD = 5 local attacks = {1, 3} bot_Dragon_r(A, C, R, RD, nil, attacks, 2) end -- botID = function bot_Dragon_13_Wild() -- мощный удар с антивампом, очищение local A = {6273, {4711}} local C = {0.2} local R = {0.9} local RD = 5 local attacks = {1, 3} bot_Dragon_r(A, C, R, RD, nil, attacks, 2) end -- botID = 945 function bot_Dragon_13_Summoner() -- мощный удар с антивампом, очищение, мощный магический урон, аое дамаг+травля local A = {4672, {4711}, 4703, 4707} local C = {0.2} local R = {0.9} local RD = 5 -- 13ые маги local wizards = {890, 891, 892, 893, 894, 895, 914, 915, 916} local attacks = {1, 3} -- дракон 13, 13ые маги local summonA = {4814, {4823, 4824, 4825, 4826, 4827, 4828}} bot_Dragon_r(A, C, R, RD, wizards, attacks, 2, summonA) end -- botID = 884 function bot_Dragon_14() -- мощный удар с антивампом, лечилка+вамп, мощный магический урон, аое дамаг local A = {4672, {4712, 4670}, 4704, 4708} local C = {0.2} local R = {0.9} local RD = 5 local wizards = {890, 891, 892, 893, 894, 895, 914, 915, 916, -- 13ые маги 896, 897, 898, 899, 900, 901, 917, 918, 919} -- 15ые маги local attacks = {1, 2} bot_Dragon_r(A, C, R, RD, wizards, attacks, 3) end -- botID = 1080 function bot_Dragon_14_Morok() -- мощный удар с антивампом, лечилка+вамп, мощный магический урон local A = {6273, {4712, 4670}, 6277} local C = {0.2} local R = {0.9} local RD = 5 local attacks = {1, 2} bot_Dragon_r(A, C, R, RD, nil, attacks, 3) end -- botID = function bot_Dragon_14_Wild() -- мощный удар с антивампом, лечилка+вамп local A = {6273, {4712, 4670}} local C = {0.2} local R = {0.9} local RD = 5 local attacks = {1, 2} bot_Dragon_r(A, C, R, RD, nil, attacks, 3) end -- botID = 946 function bot_Dragon_14_Summoner() -- мощный удар с антивампом, лечилка+вамп, мощный магический урон, аое дамаг local A = {4672, {4712, 4670}, 4704, 4708} local C = {0.2} local R = {0.9} local RD = 5 local wizards = {890, 891, 892, 893, 894, 895, 914, 915, 916, -- 13ые маги 896, 897, 898, 899, 900, 901, 917, 918, 919} -- 15ые маги local attacks = {1, 2} local summonA = {4815, -- дракон 14 {4823, 4824, 4825, 4826, 4827, 4828}, -- 13ые маги {4829, 4830, 4831, 4832, 4833, 4834}} -- 15ые маги bot_Dragon_r(A, C, R, RD, wizards, attacks, 3, summonA) end -- botID = 885 function bot_Dragon_15() -- мощный удар с антивампом, лечилка+вамп+очищение, мощный магический урон, аое дамаг+травля local A = {4672, {4713, 4670}, 4705, 4709} local C = {0.2} local R = {0.9} local RD = 5 -- 15ые маги local wizards = {896, 897, 898, 899, 900, 901, 917, 918, 919} local attacks = {1, 2} bot_Dragon_r(A, C, R, RD, wizards, attacks, 3) end -- botID = 1081 function bot_Dragon_15_Morok() -- мощный удар с антивампом, лечилка+вамп+очищение, мощный магический урон local A = {6273, {4713, 4670}, 6278} local C = {0.2} local R = {0.9} local RD = 5 local attacks = {1, 2} bot_Dragon_r(A, C, R, RD, nil, attacks, 3) end -- botID = function bot_Dragon_15_Wild() -- мощный удар с антивампом, лечилка+вамп+очищение local A = {6273, {4713, 4670}} local C = {0.2} local R = {0.9} local RD = 5 local attacks = {1, 2} bot_Dragon_r(A, C, R, RD, nil, attacks, 3) end -- botID = 947 function bot_Dragon_15_Summoner() -- мощный удар с антивампом, лечилка+вамп+очищение, мощный магический урон, аое дамаг+травля local A = {4672, {4713, 4670}, 4705, 4709} local C = {0.2} local R = {0.9} local RD = 5 -- 15ые маги local wizards = {896, 897, 898, 899, 900, 901, 917, 918, 919} local attacks = {1, 2} -- дракон 15, 15ые маги local summonA = {4816, {4829, 4830, 4831, 4832, 4833, 4834}} bot_Dragon_r(A, C, R, RD, wizards, attacks, 3, summonA) end