Files
2026-06-01 12:46:52 +02:00

89 lines
5.0 KiB
Lua

function get_module_name()
return 'etc_skillcard_combiner.lua'
end
function skillcard_combine(brood_type,new_enhance,cube_type)
local success = 0
local item_count,enhance,card_array
local _cube_type = cube_type
local success_percent = {}
local brood = {}
local brood_name = {"Deva","Asura","Gaia"}
local cube_array = {700401,700402}
brood[1] = {502001,502011,502012,502013,502014,502018,502019,502020,502021,502022,502061,502063,502064,502067,502068,502611,502615,502635,503001,503002,503003,503004,503005,503011,503037,503040,503201,503202,503203,503204,503205,503210,503401,503402,503454,503492,503621,503814,503815,504001,504002,504003,504012,504201,504202,504207,504402,506010,521124,521302,521304,521308,521320,521417,521427,521504,521506,521524,521525,521526,521527,522001,522002,522003,522004,522005,522006,522007,522008,523001,523002,523003,523004,523009,523010,523011,523012,523013,523014,523201,523202,523204,523205,523206,523401,523402,523403,523404,523405,523406,523407,523408,523409,523410,523411,523412,523413,523414,523415,523416,523417,523432,523433,523434,523435,523436,523437,523438,523439,523601,523606,524204,524401,524402,524403,524404,550101,550102,550401} -- Devaskills
brood[2] = {502001,502031,502032,502033,502034,502051,502060,502070,502071,502074,502075,502076,502077,502078,502303,502304,502331,502332,502333,502334,502337,502339,502340,502501,502502,502503,502601,502620,502621,502622,502623,502624,502626,502630,502637,502638,502639,502649,502671,502672,502673,502676,502677,502678,502679,503012,503013,503014,503015,503016,503017,503027,503030,503033,503035,503156,503185,503186,503211,503212,503411,503412,503435,503458,503460,503461,503601,503602,503603,503607,503608,503613,503614,503616,503750,503753,503803,503806,503810,503811,504001,504002,504003,504012,504211,504412,504413,504612,504613,504614,504801,504802,504901,506010,522011,522301,522302,522303,522304,522307,523005,523006,523007,523008,523017,523203,523428,523429,523430,523431,523444,523445,523605,523801,523802,524201,524405,524406,524407,524802,524803,524804,524805,531105,531108,531116,531117,531124,531204,531208,531308,531314,531315,531320,531329,531407,531504,531505,531512,531524,531526,550201,550401} -- Asuraskills
brood[3] = {502001,502041,502043,502044,502045,502046,502052,502053,502055,502056,502058,502082,502311,502312,502313,502315,502321,502322,502326,502328,502602,502616,502617,502631,502635,502641,502642,502645,502655,502656,502661,502662,502663,502664,502668,502681,502682,503021,503022,503023,503024,503025,503103,503151,503181,503183,503187,503188,503209,503220,503222,503224,503423,503424,503425,503426,503427,503428,503429,503430,503431,503472,503622,503751,503752,503754,503901,504001,504002,504003,504012,506010,522009,522010,522012,522305,522306,522501,523015,523016,523418,523419,523420,523421,523422,523423,523424,523425,523426,523427,523441,523442,523443,523602,523603,523604,524001,524002,524202,524203,524801,541107,541124,541211,541224,541225,541306,541315,541329,541330,541406,541413,541506,541513,541523,550301,550401} -- Gaiaskills
success_percent[1] = {100, 60, 50, 40, 30, 20, 15, 10, 5, 3}
success_percent[2] = {100, 90, 80, 70, 60, 50, 45, 40, 35, 33 }
if _cube_type == nil then
_cube_type = 1
end
for i, v in ipairs(brood[brood_type]) do
if find_item ( cube_array[_cube_type] ) < 1 then
private_notice('You need more skill cube to continue.')
break
end
card_array = get_item_handle_list(v)
for j, handle in ipairs(card_array) do
if find_item ( cube_array[_cube_type] ) < 1 then
break
end
if get_item_enhance(handle) == new_enhance - 1 and is_erasable_item(handle) == 1 then
while get_item_enhance(handle) > 0 do
if find_item ( cube_array[_cube_type] ) < 1 then
break
end
enhance = get_item_enhance(handle)
delete_item(handle,1)
if get_item_enhance(handle) > 0 then
delete_item( handle, 1)
delete_item(get_item_handle( cube_array[_cube_type] ),1)
if math.random( 1, 100) <= success_percent[_cube_type][new_enhance] then
insert_item( v,1,enhance + 1)
success = success + 1
end
else
insert_item( v,1,enhance)
end
end
end
end
end
if success > 1 then
message('<#B3EE3A>Congratulations! You have succeeded ' .. success .. ' +' .. new_enhance .. ' '..brood_name[brood_type]..'-Get skill cards!' )
elseif success == 1 then
message('<#B3EE3A>Congratulations! You have succeeded ' .. success .. ' +' .. new_enhance .. ' '..brood_name[brood_type]..'-Get skill cards!' )
elseif success == 0 then
message('<#FF0000>Too bad. Unfortunately you have no +' .. new_enhance .. ' '..brood_name[brood_type]..'-Get skill cards.' )
end
end
function skillcard_combine_all(max_enhance) ---uses only normal cube!!!
local _max_enhance = max_enhance
if _max_enhance == nil then
_max_enhance = 5
end
for i = 2,_max_enhance do
skillcard_combine(1,i)
skillcard_combine(2,i)
skillcard_combine(3,i)
end
end