Demon King's Reflection
Lvl: 10 Buff CD: 15 sec Skill Delay: 1 sec SP: 150 Range: 7 Cast Time: 4 Fixed Cast Time: 0.5

Summons Demon's Reflections of enemies in the target area to attack them. The reflections inherit Morroc's stats, and attack once every 2s, dealing M.ATK*1600% as Dark M.DMG, inflicting one stack of [Demon King's Wrath], and removing one buff from the target. They attack 5 times.

Lvl: 9 Buff CD: 15 sec Skill Delay: 1 sec SP: 140 Range: 7 Cast Time: 4 Fixed Cast Time: 0.5
• Summons Demon's Reflections of enemies in the target area to attack them. The reflections inherit Morroc's stats, and attack once every 2s, dealing M.ATK*1500% as Dark M.DMG, inflicting one stack of [Demon King's Wrath], and removing one buff from the target. They attack 5 times.
Lvl: 8 Buff CD: 15 sec Skill Delay: 1 sec SP: 130 Range: 7 Cast Time: 4 Fixed Cast Time: 0.5
• Summons Demon's Reflections of enemies in the target area to attack them. The reflections inherit Morroc's stats, and attack once every 2s, dealing M.ATK*1400% as Dark M.DMG, inflicting one stack of [Demon King's Wrath], and removing one buff from the target. They attack 5 times.
Lvl: 7 Buff CD: 15 sec Skill Delay: 1 sec SP: 120 Range: 7 Cast Time: 4 Fixed Cast Time: 0.5
• Summons Demon's Reflections of enemies in the target area to attack them. The reflections inherit Morroc's stats, and attack once every 2s, dealing M.ATK*1300% as Dark M.DMG, inflicting one stack of [Demon King's Wrath], and removing one buff from the target. They attack 5 times.
Lvl: 6 Buff CD: 15 sec Skill Delay: 1 sec SP: 110 Range: 7 Cast Time: 4 Fixed Cast Time: 0.5
• Summons Demon's Reflections of enemies in the target area to attack them. The reflections inherit Morroc's stats, and attack once every 2s, dealing M.ATK*1200% as Dark M.DMG, inflicting one stack of [Demon King's Wrath], and removing one buff from the target. They attack 5 times.
Lvl: 5 Buff CD: 15 sec Skill Delay: 1 sec SP: 100 Range: 7 Cast Time: 4 Fixed Cast Time: 0.5
• Summons Demon's Reflections of enemies in the target area to attack them. The reflections inherit Morroc's stats, and attack once every 2s, dealing M.ATK*1100% as Dark M.DMG, inflicting one stack of [Demon King's Wrath], and removing one buff from the target. They attack 5 times.
Lvl: 4 Buff CD: 15 sec Skill Delay: 1 sec SP: 90 Range: 7 Cast Time: 4 Fixed Cast Time: 0.5
• Summons Demon's Reflections of enemies in the target area to attack them. The reflections inherit Morroc's stats, and attack once every 2s, dealing M.ATK*1000% as Dark M.DMG, inflicting one stack of [Demon King's Wrath], and removing one buff from the target. They attack 5 times.
Lvl: 3 Buff CD: 15 sec Skill Delay: 1 sec SP: 80 Range: 7 Cast Time: 4 Fixed Cast Time: 0.5
• Summons Demon's Reflections of enemies in the target area to attack them. The reflections inherit Morroc's stats, and attack once every 2s, dealing M.ATK*900% as Dark M.DMG, inflicting one stack of [Demon King's Wrath], and removing one buff from the target. They attack 5 times.
Lvl: 2 Buff CD: 15 sec Skill Delay: 1 sec SP: 70 Range: 7 Cast Time: 4 Fixed Cast Time: 0.5
• Summons Demon's Reflections of enemies in the target area to attack them. The reflections inherit Morroc's stats, and attack once every 2s, dealing M.ATK*800% as Dark M.DMG, inflicting one stack of [Demon King's Wrath], and removing one buff from the target. They attack 5 times.
Lvl: 1 Buff CD: 15 sec Skill Delay: 1 sec SP: 60 Range: 7 Cast Time: 4 Fixed Cast Time: 0.5
• Summons Demon's Reflections of enemies in the target area to attack them. The reflections inherit Morroc's stats, and attack once every 2s, dealing M.ATK*700% as Dark M.DMG, inflicting one stack of [Demon King's Wrath], and removing one buff from the target. They attack 5 times.

Enemy 8930

function CommonFun.calcBuff_8930(srcUser, targetUser, a, b, c, d, lv)
  local Int = srcUser:GetProperty("Int")
  local Vit = srcUser:GetProperty("Vit")
  local MAtk = srcUser:GetProperty("MAtk")
  local MAtkPer = srcUser:GetProperty("MAtkPer")
  local MaxHp = targetUser:GetProperty("MaxHp")
  local MDamIncrease = CommonFun.calcMDamIncrease(srcUser, targetUser)
  local IgnoreMDef = srcUser:GetProperty("IgnoreMDef")
  if 1 <= IgnoreMDef then
    IgnoreMDef = 1
  end
  local GemValue = srcUser:GetGemValue(216151_REFLECTIONS_OF_DEMON_KING_S_REFLECTION_INHERIT_PERCENTAGE_OF_THE_TARGET_S_M_ATK_M_PIERCE_AND_M_DMG_IN_ADDITION_DOESN_T_WORK_ON_MONSTERS) / 100000
  if targetUser:GetNpcID() ~= 0 then
    GemValue = 0
  end
  local MRefine = srcUser:GetProperty("MRefine")
  local MDamSpike1 = targetUser:GetProperty("MDamSpike_MPEN") * GemValue
  MAtk = MAtk + targetUser:GetProperty("MAtk") * GemValue
  MDamIncrease = MDamIncrease + targetUser:GetProperty("MDamIncrease") * GemValue
  local MDef2 = targetUser:GetProperty("MDef")
  local MDefPer2 = targetUser:GetProperty("MDefPer")
  local Vit2 = targetUser:GetProperty("Vit")
  local VitPer2 = targetUser:GetProperty("VitPer")
  local Int2 = targetUser:GetProperty("Int")
  local IntPer2 = targetUser:GetProperty("IntPer")
  local MDamReduc2 = CommonFun.calcMDamReDuc(srcUser, targetUser)
  local RefineMDamReduc = targetUser:GetProperty("RefineMDamReduc")
  local raceparam = 1
  local srcRace = srcUser.race
  local targetRace = targetUser.race
  if targetUser:HasBuffID(139410_TWO_FACE_DEMON_KING_HUMAN_:MAX_STACK_0) then
    targetRace = 3
  end
  if srcUser:HasBuffID(139411_TWO_FACE_DEMON_KING_DEMON_:MAX_STACK_0) then
    srcRace = 3
  end
  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 = 7
  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 srcUser:HasBuffID(77480_48193_VICTORY_SWALLOW_1_:MAX_STACK_0) then
    ElementRate = ElementRate + 0.1
  end
  if srcUser:HasBuffID(139351_1225_:MAX_STACK_0) then
    local MoroccField = srcUser:GetProperty("DarkJudgePer")
    ElementRate = ElementRate + MoroccField
  end
  if nil == CommonFun.NatureProps[srcAtkElement] or nil == CommonFun.NatureProps[targetDefElement] or nil == targetDefElement then
    return 0
  end
  local elementRed = targetUser:GetProperty(CommonFun.NatureProps[srcAtkElement][2])
  local elementAtk = srcUser:GetProperty(CommonFun.NatureProps[srcAtkElement][3])
  local elementThrough = srcUser:GetProperty(CommonFun.NatureProps[srcAtkElement][4])
  local elementResistance = targetUser:GetProperty(CommonFun.NatureProps[srcAtkElement][5])
  if 0 <= elementRed then
    elementRed = elementRed * math.max(1 - elementThrough, 0)
  end
  if 0 <= elementAtk then
    elementAtk = elementAtk * math.max(1 - elementResistance, 0)
  end
  local elementparam = 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
  if elementparam2 <= 0.1 then
    elementparam2 = 0.1
  end
  local ele = elementparam * elementparam2
  if targetDefElement == nil or ElementRate == nil or elementRed == nil or elementAtk == nil then
    ele = 1
  end
  local skilllv_1 = srcUser:GetLernedSkillLevel(2953_MERCHANT:DEMON_KING_S_REFLECTION)
  local NpcParam = CommonFun.NpcParam(srcUser, targetUser, params, damageParam, logger)
  local BaseMAtk = Int + math.floor(Int * Int / 100)
  local MAtkFinal = ((MAtk - BaseMAtk) * (1 + MAtkPer) + BaseMAtk) * ele * raceparam * NpcParam
  local MDefReduc = CommonFun.CalcMDef(srcUser, targetUser)
  local A = -((MAtkFinal * MDefReduc * (1 - MDamReduc2 + MDamSpike1) + MRefine) * (skilllv_1 * 1 + 6) * (1 - RefineMDamReduc) * (1 + MDamIncrease) - Vit2 / 2 * (1 + VitPer2) - Int2 * (1 + IntPer2))
  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 CommonFun.checkAttrFunctionMiss(targetUser, srcUser) 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
  return A
end

Enemy

{
  "id": 139300,
  "BuffName": "Demon King's Taunt",
  "BuffRate": {
    "Odds": {
      "a": 100,
      "b": 0,
      "type": 8920
    }
  },
  "BuffType": {
    "isgain": 0,
    "isdisperse": 1
  },
  "LayerBuff": [
    [
      139304
    ]
  ],
  "BuffEffect": {
    "type": "AttrChange",
    "MoveSpdPer": 0,
    "end_extra_buff": [
      139308,
      139303,
      139490
    ]
  }
}

Enemy

{
  "id": 139320,
  "BuffDesc": "Targeted by the reflection",
  "BuffIcon": "skillbuff_2953001",
  "BuffName": "Demon's Reflection",
  "BuffRate": {
    "Odds": 100
  },
  "IconType": 2,
  "BuffEffect": {
    "id": [
      139321,
      139309,
      139322
    ],
    "type": "AddBuff"
  }
}

Enemy

{
  "id": 139430,
  "BuffName": "Torturing Ritual",
  "BuffRate": {
    "Odds": {
      "type": 8980
    }
  },
  "BuffEffect": {
    "id": [
      139431,
      139432,
      139433,
      139434
    ],
    "Odds": 100,
    "type": "AddBuff",
    "random": 1
  }
}

Enemy

{
  "id": 139471,
  "BuffName": "1225",
  "BuffRate": {
    "Odds": {
      "a": 100,
      "b": 0,
      "type": 9000
    }
  },
  "BuffEffect": {
    "type": "AddBuff",
    "layer": [
      {
        "id": 139301,
        "layer": 2
      }
    ]
  }
}

Enemy

{
  "id": 139321,
  "BuffName": "Demon's Reflection",
  "BuffRate": {
    "Odds": 100
  },
  "BuffEffect": {
    "Hp": {
      "type": 8930
    },
    "type": "HSPChange"
  },
  "BuffStateID": 139320
}

Enemy

{
  "id": 139322,
  "BuffName": "Demon's Reflection",
  "BuffRate": {
    "Odds": 100
  },
  "BuffEffect": {
    "num": 1,
    "type": "Disperse",
    "value": "GainBuff"
  }
}

Enemy

{
  "id": 139436,
  "BuffName": "Torturing Ritual",
  "BuffRate": {
    "Odds": 100
  },
  "Condition": {
    "type": "HasBuff",
    "buffid": [
      139301
    ],
    "delWhenInvalid": 1
  },
  "BuffEffect": {
    "id": [
      139430
    ],
    "type": "AddBuff"
  }
}

Enemy

{
  "id": 139431,
  "BuffDesc": "Silence: disable all skills except auto attacks",
  "BuffIcon": "skillbuff_231001",
  "BuffName": "Silence Effect [Silence]",
  "BuffRate": {
    "Odds": {
      "a": 0,
      "b": 100,
      "type": 100
    }
  },
  "BuffType": {
    "isgain": 0,
    "isdisperse": 1
  },
  "IconType": 1,
  "BuffEffect": {
    "type": "StatusChange",
    "NoSkill": 1,
    "StateEffect": "10_Silence"
  },
  "BuffStateID": 96040
}

Enemy

{
  "id": 139432,
  "BuffDesc": "Curse: Decrease Atk, Move Speed, Luck",
  "BuffIcon": "skillbuff_1614001",
  "BuffName": "Curse Effect [Curse]",
  "BuffRate": {
    "Odds": {
      "a": 0,
      "b": 100,
      "type": 180
    }
  },
  "BuffType": {
    "isgain": 0,
    "isdisperse": 1
  },
  "IconType": 1,
  "BuffEffect": {
    "type": "StatusChange",
    "AtkPer": -0.25,
    "MoveSpdPer": -0.5,
    "StateEffect": "11_Curse"
  }
}

Enemy

{
  "id": 139433,
  "BuffDesc": "Darkness: Decrease Hit & Flee",
  "BuffIcon": "skillbuff_commonbuff",
  "BuffName": "Darkness Effect [Darkness]",
  "BuffRate": {
    "Odds": {
      "a": 0,
      "b": 100,
      "type": 186
    }
  },
  "BuffType": {
    "isgain": 0,
    "isdisperse": 1
  },
  "IconType": 1,
  "BuffEffect": {
    "type": "StatusChange",
    "HitPer": -0.5,
    "FleePer": -0.5,
    "AttrEffect3": [
      17
    ],
    "StateEffect": "12_Dark"
  }
}

Enemy

{
  "id": 139434,
  "BuffDesc": "Fear: free of control",
  "BuffIcon": "skillbuff_commonbuff",
  "BuffName": "Fearing Effect [Fear]",
  "BuffRate": {
    "Odds": {
      "a": 0,
      "b": 100,
      "type": 170
    }
  },
  "BuffType": {
    "isgain": 0,
    "isdisperse": 1
  },
  "IconType": 1,
  "BuffEffect": {
    "Flee": -20,
    "type": "StatusChange",
    "FearRun": 1,
    "NoSkill": 1,
    "NoAttack": 1,
    "StateEffect": "8_Fear"
  }
}

Enemy

{
  "id": 139435,
  "BuffName": "Torturing Ritual",
  "BuffRate": {
    "Odds": 100
  },
  "Condition": {
    "type": "HasBuff",
    "buffid": [
      139300
    ],
    "delWhenInvalid": 1
  },
  "BuffEffect": {
    "id": [
      139430
    ],
    "type": "AddBuff"
  }
}

Enemy

{
  "id": 139301,
  "BuffName": "1225",
  "BuffRate": {
    "Odds": {
      "a": 0,
      "b": 100,
      "type": 8920
    }
  },
  "BuffType": {
    "isgain": 0,
    "isdisperse": 0
  },
  "LayerBuff": [
    [
      139305
    ]
  ],
  "BuffEffect": {
    "type": "AttrChange",
    "MoveSpdPer": 0,
    "end_extra_buff": [
      139308,
      139303,
      139470,
      139490
    ]
  }
}

Enemy

{
  "id": 139309,
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "BuffEffect": {
    "id": [
      139300,
      139301,
      139435,
      139436,
      139471
    ],
    "Odds": 100,
    "type": "AddBuff"
  }
}

Formula

{
  "CD": 15,
  "id": 2953010,
  "Buff": {
    "enemy": [
      139320
    ]
  },
  "Cost": 1,
  "Desc": [
    {
      "id": 2953000,
      "params": [
        1600
      ]
    }
  ],
  "Icon": "skill_2953001",
  "Camps": "Enemy",
  "Level": 10,
  "Logic": "SkillPointRange",
  "DescId": "##42531620",
  "NameZh": "##42531526",
  "DelayCD": 1,
  "Fire_EP": 3,
  "Pvp_buff": {
    "enemy": [
      139320
    ]
  },
  "AttackAct": [
    "use_skill4"
  ],
  "Attack_EP": 2,
  "Lead_Type": {
    "CCT": 0.5,
    "FCT": 4,
    "type": 2
  },
  "SE_attack": "Skill/sfx_skill_mengluoke_army_attack_01",
  "SkillCost": {
    "sp": 150
  },
  "SkillType": "Buff",
  "Target_EP": 3,
  "DamageType": 4,
  "Logic_Param": {
    "loop": false,
    "count": 1,
    "range": 3,
    "effect": "sfx_morocc_emdy_ground_prf,LowRange_B2",
    "interval": 1,
    "no_select": 1,
    "team_range": 3,
    "isCountTrap": 1,
    "fieldarea_cannot_immune": 1
  },
  "Launch_Range": 7,
  "FashionAttackAct": "use_skill3_staff"
}