Magic Trap
Lvl: 15 Buff CD: 2 sec Skill Delay: 2 sec SP: 49 Range: 6 Cast Time: 1.5

Draws a Magic Trap on the ground. Enemy units fall into it receive (Own Atk + target's INT * 40) *600%% Neutral Damage each sec and lose 200 SP each sec. The SP cost of enemies within the trap is increased by 100%. Up to 2 traps can be present at any one time for 15s. Their localized effect can be stacked

Lvl: 14 Buff CD: 2 sec Skill Delay: 2 sec SP: 47 Range: 6 Cast Time: 1.5
• Draws a Magic Trap on the ground. Enemy units fall into it receive (Own Atk + target's INT * 40) *600%% Neutral Damage each sec and lose 200 SP each sec. The SP cost of enemies within the trap is increased by 80%. Up to 2 traps can be present at any one time for 15s. Their localized effect can be stacked
Lvl: 13 Buff CD: 2 sec Skill Delay: 2 sec SP: 45 Range: 6 Cast Time: 1.5
• Draws a Magic Trap on the ground. Enemy units fall into it receive (Own Atk + target's INT * 40) *600%% Neutral Damage each sec and lose 200 SP each sec. The SP cost of enemies within the trap is increased by 60%. Up to 2 traps can be present at any one time for 15s. Their localized effect can be stacked
Lvl: 12 Buff CD: 2 sec Skill Delay: 2 sec SP: 43 Range: 6 Cast Time: 1.5
• Draws a Magic Trap on the ground. Enemy units fall into it receive (Own Atk + target's INT * 40) *600%% Neutral Damage each sec and lose 200 SP each sec. The SP cost of enemies within the trap is increased by 40%. Up to 2 traps can be present at any one time for 15s. Their localized effect can be stacked
Lvl: 11 Buff CD: 2 sec Skill Delay: 2 sec SP: 41 Range: 6 Cast Time: 1.5
• Draws a Magic Trap on the ground. Enemy units fall into it receive (Own Atk + target's INT * 40) *600%% Neutral Damage each sec and lose 200 SP each sec. The SP cost of enemies within the trap is increased by 20%. Up to 2 traps can be present at any one time for 15s. Their localized effect can be stacked
Lvl: 10 Buff CD: 2 sec Skill Delay: 2 sec SP: 39 Range: 6 Cast Time: 1.5
• Draws a Magic Trap on the ground. Enemy units that fall into it receive (Own Atk + target's INT *40) *600% Neutral Damage each sec and lose 200 SP each sec. Up to 2 traps can be present at any one time for 15s. Their localized effect can be stacked
Lvl: 9 Buff CD: 2 sec Skill Delay: 2 sec SP: 37 Range: 6 Cast Time: 1.5
• Draws a Magic Trap on the ground. Enemy units that fall into it receive (Own Atk + target's INT *36) *570% Neutral Damage each sec and lose 180 SP each sec. Up to 2 traps can be present at any one time for 15s. Their localized effect can be stacked
Lvl: 8 Buff CD: 2 sec Skill Delay: 2 sec SP: 35 Range: 6 Cast Time: 1.5
• Draws a Magic Trap on the ground. Enemy units that fall into it receive (Own Atk + target's INT *32) *540% Neutral Damage each sec and lose 160 SP each sec. Up to 2 traps can be present at any one time for 15s. Their localized effect can be stacked
Lvl: 7 Buff CD: 2 sec Skill Delay: 2 sec SP: 33 Range: 6 Cast Time: 1.5
• Draws a Magic Trap on the ground. Enemy units that fall into it receive (Own Atk + target's INT *28) *510% Neutral Damage each sec and lose 140 SP each sec. Up to 2 traps can be present at any one time for 15s. Their localized effect can be stacked
Lvl: 6 Buff CD: 2 sec Skill Delay: 2 sec SP: 31 Range: 6 Cast Time: 1.5
• Draws a Magic Trap on the ground. Enemy units that fall into it receive (Own Atk + target's INT *24) *480% Neutral Damage each sec and lose 120 SP each sec. Up to 2 traps can be present at any one time for 15s. Their localized effect can be stacked
Lvl: 5 Buff CD: 2 sec Skill Delay: 2 sec SP: 29 Range: 6 Cast Time: 1.5
• Draws a Magic Trap on the ground. Enemy units that fall into it receive (Own Atk + target's INT *20) *450% Neutral Damage each sec and lose 100 SP each sec. Up to 2 traps can be present at any one time for 15s. Their localized effect can be stacked
Lvl: 4 Buff CD: 2 sec Skill Delay: 2 sec SP: 27 Range: 6 Cast Time: 1.5
• Draws a Magic Trap on the ground. Enemy units that fall into it receive (Own Atk + target's INT *16) *420% Neutral Damage each sec and lose 80 SP each sec. Up to 2 traps can be present at any one time for 15s. Their localized effect can be stacked
Lvl: 3 Buff CD: 2 sec Skill Delay: 2 sec SP: 25 Range: 6 Cast Time: 1.5
• Draws a Magic Trap on the ground. Enemy units that fall into it receive (Own Atk + target's INT *12) *390% Neutral Damage each sec and lose 60 SP each sec. Up to 2 traps can be present at any one time for 15s. Their localized effect can be stacked
Lvl: 2 Buff CD: 2 sec Skill Delay: 2 sec SP: 23 Range: 6 Cast Time: 1.5
• Draws a Magic Trap on the ground. Enemy units that fall into it receive (Own Atk + target's INT *8) *360% Neutral Damage each sec and lose 40 SP each sec. Up to 2 traps can be present at any one time for 15s. Their localized effect can be stacked
Lvl: 1 Buff CD: 2 sec Skill Delay: 2 sec SP: 21 Range: 6 Cast Time: 1.5
• Draws a Magic Trap on the ground. Enemy units that fall into it receive (Own Atk + target's INT *4) *330% Neutral Damage each sec and lose 20 SP each sec. Up to 2 traps can be present at any one time for 15s. Their localized effect can be stacked

Aesir

• Magic Trap - Exorcism [Magic Trap] SP lost +
• Magic Trap - Enhance [Magic Trap] damage + 10%

Enemy 3540

function CommonFun.calcBuff_3540(srcUser, targetUser, a, b, c, d, lv)
  local Str = srcUser:GetProperty("Str")
  local Dex = srcUser:GetProperty("Dex")
  local Luk = srcUser:GetProperty("Luk")
  local Atk = srcUser:GetProperty("Atk")
  local AtkPer = srcUser:GetProperty("AtkPer")
  local DamIncrease = srcUser:GetProperty("DamIncrease")
  local IgnoreDef = 0
  local IgnoreDef1 = srcUser:GetProperty("IgnoreDef")
  local IgnoreDef2 = srcUser:GetProperty("IgnoreEquipDef")
  if targetUser.boss or targetUser.mini then
    IgnoreDef = IgnoreDef1
  else
    IgnoreDef = IgnoreDef1 + IgnoreDef2
  end
  if 1 <= IgnoreDef then
    IgnoreDef = 1
  end
  local Refine = srcUser:GetProperty("Refine")
  local Def2 = targetUser:GetProperty("Def")
  local DefPer2 = targetUser:GetProperty("DefPer")
  local Vit2 = targetUser:GetProperty("Vit")
  local VitPer2 = targetUser:GetProperty("VitPer")
  local DamReduc2 = CommonFun.calcDamReDuc(srcUser, targetUser)
  local RefineDamReduc = targetUser:GetProperty("RefineDamReduc")
  local Hp2 = targetUser:GetProperty("Hp")
  local MaxHp2 = targetUser:GetProperty("MaxHp")
  lv = math.min(lv, 10)
  local damChangePer = 0.3 * lv + 3
  local damChangePer1 = 4 * lv
  local AttrEffect = srcUser:GetProperty("AttrEffect")
  local bits = CommonFun.getBits(AttrEffect)
  local raceparam = 1
  local srcRace = srcUser.race
  local targetRace = targetUser.race
  if srcUser:HasBuffID(49320_RACIAL_ANCIENT_RELICS_PERMANENT_:MAX_STACK_0) and srcUser:HasBuffID(49325_RACIAL_ANCIENT_RELICS_CD_:MAX_STACK_0) then
  elseif srcUser:HasBuffID(49320_RACIAL_ANCIENT_RELICS_PERMANENT_:MAX_STACK_0) then
    targetRace = 2
  end
  if targetUser:HasBuffID(49320_RACIAL_ANCIENT_RELICS_PERMANENT_:MAX_STACK_0) and targetUser:HasBuffID(49325_RACIAL_ANCIENT_RELICS_CD_:MAX_STACK_0) then
  elseif targetUser:HasBuffID(49320_RACIAL_ANCIENT_RELICS_PERMANENT_:MAX_STACK_0) then
    srcRace = 2
  end
  if nil == CommonFun.RaceProps[targetRace] then
    return 0
  end
  if nil == CommonFun.RaceProps[srcRace] then
    return 0
  end
  local raceInc = srcUser:GetProperty(CommonFun.RaceProps[targetRace][1])
  local raceRed = targetUser:GetProperty(CommonFun.RaceProps[srcRace][2])
  local raceparam = 1 + raceInc - raceRed
  local mapid, maptype = srcUser:GetMapInfo()
  if maptype == PVP_MAPS then
    local B = raceRed - raceInc
    B = B < -1 and -1 or 1 < B and 1 or B
    B = math.floor(B * 1000) / 1000
    B = B + 0.3 * (1 - math.sin(B * 3.14 / 2))
    raceparam = 1 - B
  end
  if raceparam <= 0.1 then
    raceparam = 0.1
  end
  local srcAtkElement = 5
  local targetDefElement = targetUser:GetProperty("DefAttr")
  local ElementRate = CommonFun.GetElementRate(srcUser, srcAtkElement, targetUser, targetDefElement)
  if (srcUser:HasBuffID(69650_8608_:MAX_STACK_0) or srcUser:HasBuffID(71090_10658_:MAX_STACK_0)) and 1 < ElementRate then
    ElementRate = ElementRate * 1.1
  end
  if targetUser:HasBuffID(49130_DIVINE_HYMN_CARVER_:MAX_STACK_0) then
    ElementRate = math.min(ElementRate, 1)
  end
  if srcUser:HasBuffID(49210_7892_:MAX_STACK_0) then
    ElementRate = ElementRate + 0.15
  end
  if nil == CommonFun.NatureProps[srcAtkElement] or nil == CommonFun.NatureProps[targetDefElement] or nil == targetDefElement then
    return 0
  end
  local elementInc = srcUser:GetProperty(CommonFun.NatureProps[targetDefElement][1])
  local elementRed = targetUser:GetProperty(CommonFun.NatureProps[srcAtkElement][2])
  local elementAtk = srcUser:GetProperty(CommonFun.NatureProps[srcAtkElement][3])
  local elementparam = (1 + elementInc) * ElementRate
  local elementparam2 = 1 + elementAtk - elementRed
  local mapid, maptype = srcUser:GetMapInfo()
  if maptype == PVP_MAPS then
    local B = elementRed - elementAtk
    B = B < -1 and -1 or 1 < B and 1 or B
    B = math.floor(B * 1000) / 1000
    B = B + 0.3 * (1 - math.sin(B * 3.14 / 2))
    elementparam2 = 1 - B
  end
  if elementparam2 <= 0.1 then
    elementparam2 = 0.1
  end
  local ele = elementparam * elementparam2
  if targetDefElement == nil or ElementRate == nil or elementInc == nil or elementRed == nil or elementAtk == nil then
    ele = 1
  end
  local NpcParam = CommonFun.NpcParam(srcUser, targetUser, params, damageParam, logger)
  local BaseAtk = Str * 2 + math.floor(Str * Str / 100) + math.floor(Dex / 5) + math.floor(Luk / 5)
  local AtkFinal = ((Atk - BaseAtk) * (1 + AtkPer) * CommonFun.ShapeCorrection(srcUser, targetUser) * ele + BaseAtk) * raceparam * NpcParam
  local DefReduc = CommonFun.CalcDef(srcUser, targetUser)
  local Int2 = targetUser:GetProperty("Int")
  local Numxp = srcUser:GetRunePoint(94050_AESIR_MAGIC_TRAP_DAMAGE_10)
  local RuneDamage = 1 + Numxp * 0.1
  local GemValue = srcUser:GetGemValue(91022_MAGIC_TRAP_DMG_PERCENTAGE)
  local GemDam = 1 + GemValue / 100000
  local bloodrain = 1
  local StateEffect = targetUser:GetProperty("StateEffect")
  local bits3 = CommonFun.getBits(StateEffect)
  if bits3[CommonFun.StateEffect.Poison] == 1 and srcUser:HasBuffID(64350_2982_:MAX_STACK_0) then
    bloodrain = bloodrain + 0.1
  end
  local A = -(((AtkFinal + Int2 * damChangePer1) * DefReduc * (1 - DamReduc2) + Refine) * damChangePer * (1 - RefineDamReduc) * (1 + DamIncrease) - Vit2 * (1 + VitPer2)) * RuneDamage * GemDam * bloodrain
  if bits[CommonFun.AttrEffect.Hualiduanjian] == 1 then
    return A * 1.5
  end
  local AttrFunction = srcUser:GetProperty("AttrFunction")
  local bitfunc = CommonFun.getBits(AttrFunction)
  if (targetUser.boss or targetUser.mini or targetUser.changelinepunish) and (targetUser.zoneType == 1 or targetUser.zoneType == 22) and targetUser.noPunishBoss == false and bitfunc[CommonFun.AttrFunction.JustInViceZone] == 1 and targetUser.isBossFromBranch == false then
    A = 0
  end
  if targetUser.boss and targetUser.zoneType == 22 and CommonFun.CheckStormBossMiss(targetUser, srcUser) then
    A = 0
  end
  if targetUser:GetNpcID() == 30043_YEAR or targetUser:GetNpcID() == 280303_WILDNESS_SPIRIT_BEAST or targetUser:GetNpcID() == 56008_GOMORA or targetUser:GetNpcID() == 56009_BALTAN or targetUser:GetNpcID() == 56010_GOLZA or targetUser:GetNpcID() == 56011_BEMSTAR or targetUser:GetNpcID() == 56012_ELEKING or targetUser:GetNpcID() == 56013_KING_JOE then
    A = -1
  end
  if targetUser:DamageAlways1() then
    A = -1
  end
  if GetNpcID == 280711_DENSE_FOREST_SQUIRREL or GetNpcID == 280413_KLULU or GetNpcID == 280708_DENSE_FOREST_SQUIRREL or GetNpcID == 280434_KLULU then
    A = math.floor(A / 100)
  end
  return A
end

Enemy

{
  "id": 116441,
  "BuffName": "Magic Trap [Peak 2.0]",
  "BuffRate": {
    "Odds": 100
  },
  "BuffEffect": {
    "Hp": {
      "type": 3540
    },
    "Sp": {
      "a": 0,
      "b": -200,
      "c": 94040,
      "d": -20,
      "type": 3250
    },
    "type": "HSPChange"
  },
  "BuffStateID": 116440
}

Enemy

{
  "id": 116442,
  "BuffName": "Magic Trap [Peak 2.0]",
  "BuffRate": {
    "Odds": 100
  },
  "BuffEffect": {
    "type": "AttrChange",
    "SpCostPer": {
      "a": 0.2,
      "b": -2,
      "type": 1
    }
  }
}

Enemy

{
  "id": 116443,
  "BuffName": "Silence Effect [Silence] Forced Silence",
  "BuffRate": {
    "Odds": {
      "a": 0,
      "b": 1,
      "type": 5200
    }
  },
  "BuffType": {
    "isgain": 0,
    "isdisperse": 1
  },
  "BuffEffect": {
    "type": "StatusChange",
    "NoSkill": 1,
    "StateEffect": "10_Silence",
    "force_status": 1
  },
  "BuffStateID": 96040
}

Enemy

{
  "id": 116444,
  "BuffName": "Silence Effect [Silence]",
  "BuffRate": {
    "Odds": {
      "a": 1,
      "b": -1,
      "type": 5200
    }
  },
  "BuffType": {
    "isgain": 0,
    "isdisperse": 1
  },
  "BuffEffect": {
    "type": "StatusChange",
    "NoSkill": 1,
    "StateEffect": "10_Silence"
  },
  "BuffStateID": 96040
}

Formula

{
  "CD": 2,
  "id": 1143015,
  "Buff": {
    "enemy": [
      116441,
      116442,
      116443,
      116444
    ]
  },
  "Cost": 1,
  "Desc": [
    {
      "id": 1143001,
      "params": [
        100
      ]
    }
  ],
  "Icon": "skill_1143001",
  "Camps": "Enemy",
  "Level": 15,
  "Logic": "SkillPointRange",
  "DescId": "##170419",
  "NameZh": "##103548",
  "SE_hit": "Skill/skill_magic_magic_hit",
  "CastAct": "reading",
  "DelayCD": 2,
  "Fire_EP": 3,
  "Pvp_buff": {
    "enemy": [
      116441,
      116442,
      116443,
      116444
    ]
  },
  "AttackAct": [
    "use_skill"
  ],
  "Attack_EP": 3,
  "Lead_Type": {
    "CCT": 0,
    "FCT": 1.5,
    "type": 2
  },
  "SE_attack": "Skill/skill_magic_magictrap_attack",
  "SkillCost": {
    "sp": 49
  },
  "SkillType": "Buff",
  "Target_EP": 3,
  "DamageType": 4,
  "Logic_Param": {
    "count": 15,
    "range": 3,
    "interval": 1,
    "max_count": 2,
    "no_select": 1,
    "isCountTrap": 1,
    "trap_effect": "MagicTrap_buff,LowRange_B",
    "suspend_can_immune": 1
  },
  "Launch_Range": 6
}