--[[ a.abolishin - Оккультист. ]] function bot_Occultist_r(A, R, botArtId, h2l, pvp) local bot = PERS(my.persPtr) local fight = FIGHT(my.fightPtr) if bot_OccultistFight == nil then bot_OccultistFight = {} end if bot_OccultistFight[fight.id] == nil then bot_OccultistFight[fight.id] = 0 end if h2l then -- понижение противников local oppList = aux.getPersList(aux.oppTeamNum(), true, nil, false) if oppList then bot_CheckHiLevelPers(oppList, h2l, bot_HiLevel2LowLevel) end if pvp then -- и своих (для честного pvp) local myList = aux.getPersList(my.teamNum, true, true, false) if myList then bot_CheckHiLevelPers(myList, h2l, bot_HiLevel2LowLevel) end end end if (my.status ~= FS_PS_ACTIVE) or (not my.oppPtr) then return end -- пытаемся найти призванного Бальтазара local myTeam = aux.getPersList(my.teamNum, true, true, true) local A6bot = false if myTeam then for _,persPtr in pairs(myTeam) do local p = PERS(persPtr) if p and (p.artId == botArtId) then A6bot = true break end end end -- проверяем не сдох ли кто-нить из противников local deadList = aux.getPersList(aux.oppTeamNum(), false, nil, nil) if deadList then local deadCount = 0 for _, persPtr in pairs(deadList) do if PERS_LEVEL(persPtr) > 3 then deadCount = deadCount + 1 end end local deadDiff = deadCount - bot_OccultistFight[fight.id] if deadDiff > 0 then for i=1, deadDiff do aux.useEffect({artId = A[6]}) end bot_OccultistFight[fight.id] = bot_OccultistFight[fight.id] + deadDiff A6bot = true end end -- у нас есть бальтазар - бафаемся if A6bot then aux.useEffect({artId = A[7]}) end local r = math.random() local hasParasites = #aux.activeEffects(my.oppPtr, {artId = A[4]}) > 0 if r <= R[1] then aux.useEffect({artId = A[1]}, my.oppPtr) -- с шансом R1 бот применяет А1 на противника вместо удара elseif r <= R[1]+R[2] then aux.useEffect({artId = A[2]}, my.oppPtr) -- с шансом R2 бот применяет А2 на противника вместо удара elseif r <= R[1]+R[2]+R[3] then aux.useEffect({artId = A[8]}) -- заряжаемся на крит aux.useEffect({artId = A[3]}, my.oppPtr) -- с шансом R3 бот применяет А3 на противника вместо удара elseif (r <= R[1]+R[2]+R[3]+R[4]) and (not hasParasites) then aux.useEffect({artId = A[4]}, my.oppPtr) -- с шансом R4 бот применяет А4 на противника вместо удара else if hasParasites then -- если на противнике есть эффект А4, то бот применяет перед ударом на себя абилку А5. aux.useEffect({artId = A[5]}) end ATTACK(2) -- в противном случае бот бьет в корпус end end function bot_Occultist_5() local A = {4308, 4310, 4312, 4317, 4316, 4314, 4315, 4627} local R = {0.2, 0.2, 0.2, 0.1} local botArtId = 873 bot_Occultist_r(A, R, botArtId) end function bot_Occultist_7() local A = {4309, 4311, 4313, 4628, 4316, 4314, 4315, 4627} local R = {0.2, 0.1, 0.3, 0.1} local botArtId = 873 bot_Occultist_r(A, R, botArtId) end function bot_Occultist_7_H2L_10() local A = {4309, 4311, 4313, 4628, 4316, 4314, 4315, 4627} local R = {0.2, 0.1, 0.3, 0.1} local botArtId = 873 bot_Occultist_r(A, R, botArtId, 10) end function bot_Occultist_7_H2L_PVP_10() local A = {4309, 4311, 4313, 4628, 4316, 4314, 4315, 4627} local R = {0.2, 0.1, 0.3, 0.1} local botArtId = 873 bot_Occultist_r(A, R, botArtId, 10, true) end