-- $Id: bot_Eti.lua,v 1.10 2009-04-15 08:47:39 vadim_b Exp $ --[[ AKEB (c) 16.05.2008 18:26 перед боем один раз: -проверяет максимальный уровень противника в бою, накладывает баф равный уровневой группе игрока. в ходе боя: проверяет уровень оппонента, -если на мобе есть баф, но он ниже уровневой группы игрока, накладывает новый, равный уровневой группе оппонента. -если на мобе баф нужного уровня ничего не делает. Скрипт: bot_Eti.lua Управляющая функция: bot_Eti --]] artikulIdGroup = {0,3741,3742,3743,3744} artikulIdGroup2 = {0,3752,3753,3754,3755} groupLevel = {0,0,0,0,1,1,2,2,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4} function bot_Eti() local botId = PERS_ID(my.persPtr) bot_EtiInitTable(botId) if bot_EtiCnt[botId] < 1 then local level = 0 for _,persPtr in pairs(PERS_LIST(aux.oppTeamNum(),true)) do local Pers_level = PERS_LEVEL(persPtr) if level < Pers_level then level = Pers_level end end local group = groupLevel[level] if group == nil then group = 0 end bot_EtiGrp[botId] = group local artikulId = artikulIdGroup[group+1] if artikulId == nil then artikulId = 0 end local artikulId2 = artikulIdGroup2[group+1] if artikulId2 == nil then artikulId2 = 0 end local status = aux.useEffect({artId = artikulId}) local status = aux.useEffect({artId = artikulId2}) if status == 0 then bot_EtiCnt[botId] = 1 end end if my.status ~= FS_PS_ACTIVE then -- если наш статус неактивный, ничего не делаем return end local lvl = PERS_LEVEL(my.oppPtr) local grp = groupLevel[lvl] if grp == nil then grp = 0 end if bot_EtiGrp[botId] < grp then local artikulId_ = artikulIdGroup[grp+1] if artikulId_ == nil then artikulId_ = 0 end local artikulId_2 = artikulIdGroup2[grp+1] if artikulId_2 == nil then artikulId_2 = 0 end local status = aux.useEffect({artId = artikulId_}) local status = aux.useEffect({artId = artikulId_2}) if status == 0 then bot_EtiGrp[botId] = grp end end ATTACK(math.random(3)) end function bot_EtiInitTable(botId) if bot_EtiCnt == nil then bot_EtiCnt = {} end if bot_EtiCnt[botId] == nil then bot_EtiCnt[botId] = 0 end if bot_EtiGrp == nil then bot_EtiGrp = {} end if bot_EtiGrp[botId] == nil then bot_EtiGrp[botId] = -1 end end