Formula

CommonFun.calcProduceRate

function CommonFun.calcProduceRate(srcUser, etype, category, composeid)
if srcUser == nil then
return 0
end
if etype == 3 and category == 5 then
local skilllv_1 = srcUser:GetLernedSkillLevel(261_LORD_KNIGHT:WEAPON_MAKING)
local skilllv_2 = srcUser:GetLernedSkillLevel(214_KNIGHT:WEAPONRY_RESEARCH)
local skilllv_3 = srcUser:GetLernedSkillLevel(221_LORD_KNIGHT:MANUFACTURING_MASTER)
local Dex = srcUser:GetProperty("Dex")
local Luk = srcUser:GetProperty("Luk")
local A1 = skilllv_1 * 75 + 450 + skilllv_2 * 50 + (Dex / 8 + Luk / 8) * (1 + skilllv_3 * 0.05) * 100
if 8000 <= A1 then
A1 = 8000
end
if skilllv_1 <= 0 then
A1 = 0
end
return A1
end
if etype == 3 and category == 4 then
local skilllv_3 = srcUser:GetLernedSkillLevel(221_LORD_KNIGHT:MANUFACTURING_MASTER)
local skilllv_6 = srcUser:GetLernedSkillLevel(218_KNIGHT:ELITE_ALLOY_CRAFT)
local Dex = srcUser:GetProperty("Dex")
local Luk = srcUser:GetProperty("Luk")
local A2 = skilllv_6 * 100 + 700 + (Dex / 8 + Luk / 8) * (1 + skilllv_3 * 0.05) * 100
if 8500 <= A2 then
A2 = 8500
end
if skilllv_6 <= 0 then
A2 = 0
end
return A2
end
if etype == 3 and category == 3 then
local skilllv_3 = srcUser:GetLernedSkillLevel(221_LORD_KNIGHT:MANUFACTURING_MASTER)
local skilllv_4 = srcUser:GetLernedSkillLevel(269_LORD_KNIGHT:ENCHANTED_STONE_CRAFT)
local Dex = srcUser:GetProperty("Dex")
local Luk = srcUser:GetProperty("Luk")
local A3 = skilllv_4 * 220 + 1810 + (Dex / 8 + Luk / 8) * (1 + skilllv_3 * 0.05) * 100
if 9000 <= A3 then
A3 = 9000
end
if skilllv_4 <= 0 then
A3 = 0
end
return A3
end
if etype == 4 and (category == 8 or category == 9) then
local BaseRate = {
[1310] = 5000,
[1320] = 5000,
[1330] = 5000,
[1340] = 3000,
[1350] = 3000,
[1360] = 3000,
[1370] = 3000,
[1380] = 5000,
[1390] = 5000,
[1400] = 0
}
local skilllv_5 = srcUser:GetLernedSkillLevel(418_RUNE_KNIGHT:PHARMACY)
local skilllv_6 = srcUser:GetLernedSkillLevel(419_RUNE_KNIGHT:LEARNING_POTION)
local Dex = srcUser:GetProperty("Dex")
local Luk = srcUser:GetProperty("Luk")
local AttrRate = (Dex + Luk) * 25
if 3000 < AttrRate then
AttrRate = 3000
end
if BaseRate[composeid] == nil then
BaseRate[composeid] = 0
end
local A4 = BaseRate[composeid] + skilllv_5 * 200 + skilllv_6 * 200 + AttrRate
if 10000 < A4 then
A4 = 10000
end
return A4
end
if etype == 5 and category == 11 then
local BaseRate = {
[1420] = 0,
[1421] = 1000,
[1422] = 2000,
[1423] = 0,
[1424] = 1000,
[1425] = 500
}
local skilllv_fuwen = srcUser:GetLernedSkillLevel(1268_ASSASSIN:RUNE_MASTERY)
local Str = srcUser:GetProperty("Str")
local Int = srcUser:GetProperty("Int")
local Attr = Str * 5 + Int * 10
if 2000 < Attr then
Attr = 2000
end
if BaseRate[composeid] == nil then
BaseRate[composeid] = 0
end
local A5 = BaseRate[composeid] + skilllv_fuwen * 1000 + Attr
if 10000 < A5 then
A5 = 10000
end
return A5
end
if etype == 6 and category == 12 then
local BaseRate = {
[2010] = 1000,
[2020] = 1000,
[2030] = 1000,
[2040] = 1000,
[2050] = 500,
[2060] = 500,
[2070] = 0,
[2080] = 1500
}
local skilllv_hkl = srcUser:GetLernedSkillLevel(2659_ARCHBISHOP:ALLOY_SMELTING)
local Luk = srcUser:GetProperty("Luk")
local Dex = srcUser:GetProperty("Dex")
local Attr = Luk * 8 + Dex * 2
if 6000 < Attr then
Attr = 6000
end
if BaseRate[composeid] == nil then
BaseRate[composeid] = 0
end
local A6 = BaseRate[composeid] + skilllv_hkl * 800 + Attr
if 10000 < A6 then
A6 = 10000
end
return A6
end
return 0
end