-- $Id: bot_Sheara.lua,v 1.8 2009-08-11 06:49:25 a.abolishin Exp $ --[[ AKEB (c) 21.08.2008 2:46 Бот Шеара ПЕРЕД УДАРОМ: - 1. Раз в TIME секунд, если хоть на одном игроке из своей команды не висит абилка А1, бот использует ее на себя. - 2. Использовать на себя абилку «отступление» (2608), если с момента начала боя прошло 7 минут и в своей команде нет живых союзников. ВМЕСТО УДАРА: - Делается рандомный удар. ДЛЯ ТЕСТА: А1 - АоЕ баф на всю команду, он не будет ложиться на ботов и ложиться повторно за счет настроек абилки. А1 - [3924] А2 - [2608] TIME = 10 Скрипт: bot_Sheara.lua Управляющая функция: bot_Sheara bot_Sheara_t --]] function bot_Sheara_r(a1, a2, a3, time, rtime) -- static bot init bot_ShearaInitTable(my.persId, rtime) -- rule 1 if bot_ShearaTime[my.persId]-my.stime < 0 then for _,persPtr in pairs(PERS_LIST(my.teamNum,true,true)) do local pers = PERS(persPtr) if pers.artId == 0 and #aux.activeEffects(persPtr,{artId = a1}) < 1 then aux.useEffect({artId = a1},persPtr) break end end bot_ShearaTime[my.persId] = my.stime + time end if my.status ~= FS_PS_ACTIVE then -- если наш статус неактивный, ничего не делаем return end -- hp check local bot = PERS(my.persPtr) local hpC = bot.hp/bot.hpMax if hpC < 0.8 then aux.useEffect({artId = a3}) end -- rule 2 if (PERS_COUNT(my.teamNum, true) < 2) and (bot_ShearaRTime[my.persId]-my.stime < 0) then aux.useEffect({artId = a2}) end -- attack ATTACK(math.random(3)) end function bot_ShearaInitTable(botId, rtime) if botId == nil then return; end if bot_ShearaTime == nil then bot_ShearaTime = {} end if bot_ShearaTime[botId] == nil then bot_ShearaTime[botId] = 0 end if bot_ShearaRTime == nil then bot_ShearaRTime = {} end if bot_ShearaRTime[botId] == nil then bot_ShearaRTime[botId] = my.stime+rtime end end ----------------------------------------------------------------------------- function bot_Sheara_t() return bot_Sheara_r(3924,2608, 4974, 10, 60) end function bot_Sheara() return bot_Sheara_r(3924,2608, 5021, 10, 420) end