Formulas
Open Graph ExplorerExplore ROM internal Lua formulas
1,812 formulas archived
CommonFun.RandomRange
Lua
function CommonFun.RandomRange(min, max, random)
if random == nil then
return 0
end
local p = random / 1008 linesView Formula
CommonFun.RemoveTrap
Lua
function CommonFun.RemoveTrap(srcUser, targetUser) local skilllv_1 = srcUser:GetLernedSkillLevel(489_RUNEMASTER:REMOVE_TRAP) return skilllv_1 end
4 linesView Formula
CommonFun.ResetTripleSeasonScore
Lua
function CommonFun.ResetTripleSeasonScore(score)
if score == nil then
return 0
end
local A = 012 linesView Formula
CommonFun.ShapeCorrection
Lua
function CommonFun.ShapeCorrection(srcUser, targetUser)
local value = 2
local WeaponType = srcUser:GetEquipedWeaponType()
local ShapeAtkPer = srcUser:GetProperty("ShapeAtkPer")
local AttrEffect = srcUser:GetProperty("AttrEffect")24 linesView Formula
CommonFun.StealMoney
Lua
function CommonFun.StealMoney(srcUser, targetUser)
local skilllv_1 = srcUser:GetLernedSkillLevel(474_RUNEMASTER:SNATCH)
local skilllv_2 = srcUser:GetLernedSkillLevel(473_RUNEMASTER:SNATCHER)
local Dex = srcUser:GetProperty("Dex")
local Luk = srcUser:GetProperty("Luk")13 linesView Formula
CommonFun.TableHasValue
Lua
function CommonFun.TableHasValue(t, v)
for key, value in pairs(t) do
if v == value then
return true
end8 linesView Formula
CommonFun.UnmergeSkillID
Lua
function CommonFun.UnmergeSkillID(skillIDAndLevel) return math.floor(skillIDAndLevel / 1000), skillIDAndLevel % 1000 end
3 linesView Formula
CommonFun.WeaponAtkSpd
Lua
function CommonFun.WeaponAtkSpd(type, profession)
if type == 170 then
return SpearAtkSpd[profession]
elseif type == 180 then
return SwordAtkSpd[profession]24 linesView Formula
CommonFun.calAttrPoint
Lua
function CommonFun.calAttrPoint(curPoint, joblv, job, attr)
local result = {}
if job == 0 then
if joblv == 1 then
return curPoint + joblv135 linesView Formula
CommonFun.calHeroAttrPoint
Lua
function CommonFun.calHeroAttrPoint(joblv, job, attr)
if GameConfig.HeroAttrValue[job] == nil then
return 0
end
return math.floor(math.min(joblv, 30) / 5) * GameConfig.HeroAttrValue[job][attr]6 linesView Formula
CommonFun.calProfessionPropValue
Lua
function CommonFun.calProfessionPropValue(joblv, job, attr)
if GameConfig.AttrRatio[job] == nil then
return 0
end
if GameConfig.AttrValue[job] == nil then20 linesView Formula
CommonFun.calcATMDam
Lua
function CommonFun.calcATMDam(srcUser, targetUser, params, logger)
local A = 111111
local base = 1
if targetUser:GetNpcID() == 81000_GOMORA and srcUser:HasBuffID(120350_GOMORA_S_DEMISE_:MAX_STACK_0) then
base = 223 linesView Formula
CommonFun.calcAdventureGuideBaseExp
Lua
function CommonFun.calcAdventureGuideBaseExp(BaseLv) return 3024 * BaseLv end
3 linesView Formula
CommonFun.calcAdventureGuideJobExp
Lua
function CommonFun.calcAdventureGuideJobExp(BaseLv) return 1728 * BaseLv end
3 linesView Formula
CommonFun.calcArtifactMaterialItemCount
Lua
function CommonFun.calcArtifactMaterialItemCount(type, num, count)
if type == 1 then
return num
elseif type == 2 then
if count == 0 then23 linesView Formula
CommonFun.calcAttrBlindRate
Lua
function CommonFun.calcAttrBlindRate(srcUser, targetUser)
local Int = srcUser:GetProperty("Int")
local Vit = targetUser:GetProperty("Vit")
local Int2 = targetUser:GetProperty("Int")
local A = math.min(0.8, Int * 0.3 / 100)12 linesView Formula
CommonFun.calcAttrBlindTime
Lua
function CommonFun.calcAttrBlindTime(srcUser, targetUser)
local Int = srcUser:GetProperty("Int")
local Vit = targetUser:GetProperty("Vit")
local StateTimeAtk = srcUser:GetProperty("StateTimeAtk")
local StateTimeDef2 = targetUser:GetProperty("StateTimeDef")13 linesView Formula
CommonFun.calcAttrBurnRate
Lua
function CommonFun.calcAttrBurnRate(srcUser, targetUser)
local Int = srcUser:GetProperty("Int")
local Vit = targetUser:GetProperty("Vit")
local Agi = targetUser:GetProperty("Agi")
local A = math.min(0.8, Int * 0.3 / 100)12 linesView Formula
CommonFun.calcAttrBurnTime
Lua
function CommonFun.calcAttrBurnTime(srcUser, targetUser)
local Int = srcUser:GetProperty("Int")
local Vit = targetUser:GetProperty("Vit")
local StateTimeAtk = srcUser:GetProperty("StateTimeAtk")
local StateTimeDef2 = targetUser:GetProperty("StateTimeDef")13 linesView Formula
CommonFun.calcAttrCurseRate
Lua
function CommonFun.calcAttrCurseRate(srcUser, targetUser)
local Str = srcUser:GetProperty("Str")
local Int = targetUser:GetProperty("Int")
local Dex = targetUser:GetProperty("Dex")
local A = math.min(1, Str * 0.3 / 100)12 linesView Formula
