-- $Id: pets.lua,v 1.23 2009-11-12 14:44:41 a.abolishin Exp $ --[[ AKEB (c) 30.09.2009 16:26 —крипт: pets.lua ”правл¤юща¤ функци¤: pets --]] -- серые абилки ArtifactsGrey = { [1]={5257}, [2]={5257,5260,5263}, [3]={5257,5260,5263,5265,5272}, [4]={5257,5260,5263,5265,5272,5274,5278}, [5]={5257,5260,5263,5266,5272,5274,5278,5280,5276}, [6]={5258,5261,5263,5266,5272,5275,5278,5280,5276}, [7]={5258,5261,5264,5267,5272,5275,5278,5280,5276}, [8]={5258,5261,5264,5267,5273,5283,5278,5280,5276}, [9]={5258,5261,5264,5268,5273,5283,5279,5281,5276}, [10]={5258,5261,5264,5268,5273,5284,5279,5281,5277}, [11]={5259,5261,5264,5269,5273,5284,5279,5281,5277}, [12]={5259,5262,5264,5269,5273,5285,5279,5281,5277}, [13]={5259,5262,5264,5270,5273,5285,5279,5281,5277}, [14]={5259,5262,5264,5270,5273,5286,5241,5281,5277}, [15]={5259,5262,5264,5271,5273,5286,5241,5282,5277}, } ArtifactsTargetGrey = { [5257] = 0, [5258] = 0, [5259] = 0, [5260] = 1, [5261] = 1, [5262] = 1, [5263] = 0, [5264] = 0, [5265] = 0, [5266] = 0, [5267] = 0, [5268] = 0, [5269] = 0, [5270] = 0, [5271] = 0, [5272] = 1, [5273] = 1, [5274] = 0, [5275] = 0, [5283] = 0, [5284] = 0, [5285] = 0, [5286] = 0, [5278] = 1, [5279] = 1, [5280] = 0, [5281] = 0, [5282] = 0, [5276] = 0, [5277] = 0, [5241] = 1, } -- зеленые абилки ArtifactsGreen = { [1]={5406}, [2]={5406,5409,5412}, [3]={5406,5409,5412,5414,5421}, [4]={5406,5409,5412,5414,5421,5423,5428}, [5]={5406,5409,5412,5415,5421,5423,5428,5431,5434}, [6]={5407,5410,5412,5415,5421,5424,5428,5431,5434}, [7]={5407,5410,5413,5416,5421,5424,5428,5431,5434}, [8]={5407,5410,5413,5416,5422,5425,5428,5431,5434}, [9]={5407,5410,5413,5417,5422,5425,5429,5432,5434}, [10]={5407,5410,5413,5417,5422,5426,5429,5432,5435}, [11]={5408,5410,5413,5418,5422,5426,5429,5432,5435}, [12]={5408,5411,5413,5418,5422,5427,5429,5432,5435}, [13]={5408,5411,5413,5419,5422,5427,5429,5432,5435}, [14]={5408,5411,5413,5419,5422,5467,5430,5432,5435}, [15]={5408,5411,5413,5420,5422,5467,5430,5433,5435}, } ArtifactsTargetGreen = { [5406] = 0, [5407] = 0, [5408] = 0, [5409] = 1, [5410] = 1, [5411] = 1, [5412] = 0, [5413] = 0, [5414] = 0, [5415] = 0, [5416] = 0, [5417] = 0, [5418] = 0, [5419] = 0, [5420] = 0, [5421] = 1, [5422] = 1, [5423] = 0, [5424] = 0, [5425] = 0, [5426] = 0, [5427] = 0, [5467] = 0, [5428] = 1, [5429] = 1, [5431] = 0, [5432] = 0, [5433] = 0, [5434] = 0, [5435] = 0, [5430] = 1, } -- синие абилки ArtifactsBlue = { [1]={5436}, [2]={5436,5439,5442}, [3]={5436,5439,5442,5444,5451}, [4]={5436,5439,5442,5444,5451,5453,5459}, [5]={5436,5439,5442,5445,5451,5453,5459,5462,5465}, [6]={5437,5440,5442,5445,5451,5454,5459,5462,5465}, [7]={5437,5440,5443,5446,5451,5454,5459,5462,5465}, [8]={5437,5440,5443,5446,5452,5455,5459,5462,5465}, [9]={5437,5440,5443,5447,5452,5455,5460,5463,5465}, [10]={5437,5440,5443,5447,5452,5456,5460,5463,5466}, [11]={5438,5440,5443,5448,5452,5456,5460,5463,5466}, [12]={5438,5441,5443,5448,5452,5457,5460,5463,5466}, [13]={5438,5441,5443,5449,5452,5457,5460,5463,5466}, [14]={5438,5441,5443,5449,5452,5458,5461,5463,5466}, [15]={5438,5441,5443,5450,5452,5458,5461,5464,5466}, } ArtifactsTargetBlue = { [5436] = 0, [5437] = 0, [5438] = 0, [5439] = 1, [5440] = 1, [5441] = 1, [5442] = 0, [5443] = 0, [5444] = 0, [5445] = 0, [5446] = 0, [5447] = 0, [5448] = 0, [5449] = 0, [5450] = 0, [5451] = 1, [5452] = 1, [5453] = 0, [5454] = 0, [5455] = 0, [5456] = 0, [5457] = 0, [5458] = 0, [5459] = 1, [5460] = 1, [5462] = 0, [5463] = 0, [5464] = 0, [5465] = 0, [5466] = 0, [5461] = 1, } -- период каста пета в зависимости от его состо¤ни¤ -- в данный момент учитываетс¤ только флаг "отдохнувший" function pet_GetCastPeriod(rested) if rested then return 4 else return 7 end end function pets(artIds, artTargets) local Pers = PERS(my.persPtr) local petReady = Pers.petReady or false local PET_LEVEL = my.petLevel or Pers.petLevel --if PET_LEVEL == 1 then --aux.useEffect({artId = 5257},my.persPtr) --end if my.oppPtr then -- FIXME!!! убрать эту проверку как только будет нормальна¤ анимаци¤ local Art = aux.getRandVal(artIds[PET_LEVEL]) local Target = my.oppPtr if artTargets[Art] == 0 then Target = my.persPtr end local used = #aux.activeEffects(Target, {artId = Art}) if (Art ~= nil and used == 0) then local status = aux.useEffect({artId = Art},Target) if status == 0 then pets_table[Pers.id][0] = 0 pets_table[Pers.id][1] = 0 end end end end function pets_test(artIds, artTargets) local Pers = PERS(my.persPtr) pets_InitTable(Pers.id) local PET_LEVEL = lookupParam("Pers", "petLevel", Pers.id) or Pers.level local Art = artIds[PET_LEVEL][pets_table[Pers.id][0]] if (#artIds[PET_LEVEL] > pets_table[Pers.id][0]) then pets_table[Pers.id][0] = pets_table[Pers.id][0] + 1 else pets_table[Pers.id][0] = 0 end local Target = my.oppPtr if artTargets[Art] == 0 then Target = my.persPtr end if (Art ~= nil) then aux.useEffect({artId = Art}, Target) end end function pets_InitTable(persId) if pets_table == nil then pets_table = {} end if pets_table[persId] == nil then pets_table[persId] = {} end if pets_table[persId][1] == nil then pets_table[persId][1] = 0 end if pets_table[persId][0] == nil then pets_table[persId][0] = 0 end end function pets_grey() --pets(ArtifactsGreen, ArtifactsTargetGreen) --aux.useEffect({artId = 1259},my.persPtr) --aux.useEffect({artId = 5257},my.persPtr) pets(ArtifactsGrey, ArtifactsTargetGrey) end function pets_green() pets(ArtifactsGreen, ArtifactsTargetGreen) end function pets_blue() pets(ArtifactsBlue, ArtifactsTargetBlue) end