Explore ROM internal Lua formulas

1,812 formulas archived

CommonFun.IsInRate

Lua
function CommonFun.IsInRate(rate, random)
  if rate == nil or random == nil then
    return false
  end
  return random < rate
6 linesView Formula

CommonFun.IsLongSkill

Lua
function CommonFun.IsLongSkill(launch_range)
  if launch_range == nil then
    return false
  end
  return 3 < launch_range
6 linesView Formula

CommonFun.IsMiss

Lua
function CommonFun.IsMiss(srcUser, targetUser, skillParams)
  local AttrEffect = srcUser:GetProperty("AttrEffect")
  local StateEffect2 = targetUser:GetProperty("StateEffect")
  local bits = CommonFun.getBits(AttrEffect)
  local bits2 = CommonFun.getBits(StateEffect2)
14 linesView Formula

CommonFun.IsSingleTargetSkill

Lua
function CommonFun.IsSingleTargetSkill(skillParams)
  if skillParams == nil or skillParams.Logic_Param == nil then
    return false
  end
  if skillParams.Logic ~= "SkillLockedTarget" then
15 linesView Formula

CommonFun.MergeSkillID

Lua
function CommonFun.MergeSkillID(skillID, skillLevel)
  return skillID * 1000 + skillLevel
end
3 linesView Formula

CommonFun.ModifyBaxieDamage

Lua
function CommonFun.ModifyBaxieDamage(srcUser, targetUser, skillParams, damage, skillID, isCanBlock)
  if CommonFun.RollType.Attack == skillParams.RollType and 0 < damage and skillID == 411_RUNE_KNIGHT:ACID_TERROR and skillID == 306_LORD_KNIGHT:ASURA_STRIKE and skillID == 3303_LIGHTBRINGER:SKY_BREAKING_DRAGON_FIST and skillID == 819_HIGH_WIZARD:SKY_BREAKING_DRAGON_FIST and skillID == 2741_SAINT:FIRE_STRIKE and skillID == 4718_SHADOW_CHASER:SOLAR_AURA_SKYFIRE and skillID == 4717_SHADOW_CHASER:SOLAR_AURA_SKYFIRE and skillID == 4702_SHADOW_CHASER:SCORCHING_REALM and skillID == 4714_SHADOW_CHASER:SOLAR_AURA then
    local Baxie = true
    if (skillID == 469_RUNEMASTER:STORM_GUST or skillID == 470_RUNEMASTER:STORM_GUST or skillID == 4228_SORCERER:STORM_GUST) and srcUser:HasBuffID(20910120_AUTO_ATTACKS_IGNORE_KYRIE_ELEISON_:MAX_STACK_0) then
      Baxie = false
23 linesView Formula

CommonFun.ModifyCriDamage

Lua
function CommonFun.ModifyCriDamage(srcUser, targetUser, params, logger, skillParams, damage)
  local skillID, skillLevel = CommonFun.UnmergeSkillID(params.skillIDAndLevel)
  local damageParam = skillParams.Damage
  if damageParam ~= nil and damageParam[1] ~= nil then
    damageParam = damageParam[1]
375 linesView Formula

CommonFun.ModifyDamageBySpecialNpc

Lua
function CommonFun.ModifyDamageBySpecialNpc(srcUser, damage, npcid, params)
  if 0 < damage and CommonFun.SpecialNpcCheck[npcid] ~= nil then
    local data = CommonFun.SpecialNpcCheck[npcid]
    local college = 0.01
    local skillok = false
31 linesView Formula

CommonFun.ModifyDamageBySpecialRaid

Lua
function CommonFun.ModifyDamageBySpecialRaid(srcUser, targetUser, damage, params)
  local RaidType = srcUser:GetRaidType()
  if RaidType == 32 then
    local ball66 = 1
    if srcUser:HasBuffID(210010_HOLD_ADDING_BUFF_:MAX_STACK_0) and targetUser:HasBuffID(107340_MASTER_TACKLER_LV_1_:MAX_STACK_0) then
73 linesView Formula

CommonFun.ModifyFinalDamage

Lua
function CommonFun.ModifyFinalDamage(srcUser, targetUser, params, logger, damage)
  if 0 < damage then
    local FinalDam = CommonFun.calcFinalDam(srcUser, targetUser, params, logger)
    local MonsterFinalDam = CommonFun.calcMonsterFinalDam(srcUser, targetUser, params, logger)
    local ResultDamInc = srcUser:GetProperty("ResultDamInc")
19 linesView Formula

CommonFun.ModifyMagicCriDam

Lua
function CommonFun.ModifyMagicCriDam(srcUser, targetUser, params, skillParams, damage)
  local skilllv_1 = skillParams.id
  if 0 < damage and (CommonFun.RollType.Magic == skillParams.RollType and srcUser:IsAttackSkill(params.skillIDAndLevel) == false or math.floor(skilllv_1 / 1000) == 4787) and (srcUser:HasBuffID(35600_WHEEL_OF_FORTUNE_FOUR_LEAF_CLOVER_1_:MAX_STACK_0) or srcUser:HasBuffID(43230_EXORCISM_SACHET_:MAX_STACK_0) or srcUser:HasBuffID(55170_SHELL_CHEPET_CARD_:MAX_STACK_0) or srcUser:HasBuffID(66730_5672_:MAX_STACK_0) or srcUser:HasBuffID(55890_SHELL_CHEPET_CARD_:MAX_STACK_0) or srcUser:HasBuffID(70450_9586_:MAX_STACK_0) or srcUser:HasBuffID(56700_11924_:MAX_STACK_0) or srcUser:HasBuffID(56730_11927_:MAX_STACK_0) or srcUser:HasBuffID(55710_10355_:MAX_STACK_0) or srcUser:HasBuffID(73550_1_:MAX_STACK_0) or srcUser:HasBuffID(57700_WHISPER_LEGION_CARD_:MAX_STACK_0) or srcUser:HasBuffID(74870_23_:MAX_STACK_0) or srcUser:HasBuffID(57170_CAMORRA_CARD_:MAX_STACK_0) or srcUser:HasBuffID(23200_EXORCISM_SACHET_INFUSE_:MAX_STACK_0) or srcUser:HasBuffLayer(23200, EBUFFERLAYER_SHADOW) or srcUser:HasBuffID(59160_ALIEN_PRIEST_MAGALETA_CARD_:MAX_STACK_0) or srcUser:HasBuffID(140800_THE_HESTIA_KNIFE_:MAX_STACK_0) or srcUser:HasBuffID(59510_23455_DUNGEON_COLLABORATION_BELLE_CARD_:MAX_STACK_0) or srcUser:HasBuffID(700850_3033965_PUSS_IN_BOOTS_RED_:MAX_STACK_0)) then
    local Luk = srcUser:GetProperty("Luk")
    local CriDamNum = 1.5 + math.floor(Luk / 6) / 100
157 linesView Formula

CommonFun.ModifyMetalNpcDamage

Lua
function CommonFun.ModifyMetalNpcDamage(srcUser, targetUser, params, damage, skillID, GetNpcID)
  if GetNpcID == 40021_EMPERIUM or GetNpcID == 40023_SHADOW_OF_MORROC then
    if srcUser:IsAttackSkill(params.skillIDAndLevel) == false and skillID == 151_KNIGHT:SANCTUARY or srcUser:InGvgZone() == false or srcUser:NoAttackMetal() == true then
      return 0, CommonFun.DamageType.Miss
    end
30 linesView Formula

CommonFun.ModifyNumberDamage

Lua
function CommonFun.ModifyNumberDamage(srcUser, targetUser, params, logger, damage)
  if 0 < damage then
    local Count = params.hitedCount
    local SingleTargetDam = srcUser:GetProperty("SingleTargetDam")
    local MultipleTargetsDam = srcUser:GetProperty("MultipleTargetsDam")
19 linesView Formula

CommonFun.ModifyRealDam

Lua
function CommonFun.ModifyRealDam(srcUser, targetUser, params, skillParams, damage, skillID, maptype)
  local NormalAtkDam = srcUser:GetProperty("NormalAtkDam")
  local NormalAtkRes = targetUser:GetProperty("NormalAtkRes")
  local SkillDam = srcUser:GetProperty("SkillDam")
  local SkillRes = targetUser:GetProperty("SkillRes")
50 linesView Formula

CommonFun.ModifyShapeDamage

Lua
function CommonFun.ModifyShapeDamage(srcUser, targetUser, skillParams, damage)
  if CommonFun.Shape.L == targetUser.shape and CommonFun.RollType.Magic == skillParams.RollType and 0 < damage then
    local largedam = 1
    if srcUser:HasBuffID(71930_11895_:MAX_STACK_0) then
      largedam = largedam + 0.25
66 linesView Formula

CommonFun.NpcParam

Lua
function CommonFun.NpcParam(srcUser, targetUser, params, damageParam, logger)
  local NpcDamPer = 0
  local NpcResPer = 0
  if targetUser:GetNpcID() == 0 or targetUser:GetNpcID() == 580210_MIND_BODY then
    NpcDamPer = srcUser:GetProperty("NpcDamPer")
13 linesView Formula

CommonFun.ParseNature

Lua
function CommonFun.ParseNature(str)
  if "Wind" == str then
    return CommonFun.Nature.Wind
  elseif "Earth" == str then
    return CommonFun.Nature.Earth
23 linesView Formula

CommonFun.ParseRace

Lua
function CommonFun.ParseRace(str)
  if "Brute" == str then
    return CommonFun.Race.Brute
  elseif "DemiHuman" == str then
    return CommonFun.Race.DemiHuman
23 linesView Formula

CommonFun.PetAttrShow

Lua
function CommonFun.PetAttrShow(PetLv, classtype)
  local result = {}
  local QualityRatio = 0
  if classtype == 11 or classtype == 21 or classtype == 31 or classtype == 41 or classtype == 51 or classtype == 61 then
    QualityRatio = 1.4
318 linesView Formula

CommonFun.Print

Lua
function CommonFun.Print(...)
  local args = {
    ...
  }
  for i, v in pairs(args) do
15 linesView Formula