Demon King's Arrival
Lvl: 1 Buff CD: 60 sec Skill Delay: 1 sec

Assumes Morroc's form, increasing final DMG down by 30%% and receiving the following effects for 30s:
●[Demon King's Array] and [Dark Night Shroud] continue around Morroc, with an increased radius of 12m.
●[Dark Night Storm] becomes a targeted homing skill that deals DMG every 0.5s.
●[Orderless Shackle] inflicts chains on all enemies within 12m.
●Clears all debuffs on self and restores HP to full. The cooldown is fixed.

Self 6

function CommonFun.calcBuff_6(srcUser, targetUser, a, b, c, d, lv)
  if srcUser == nil or targetUser == nil then
    return 0
  end
  local MaxHp = targetUser:GetProperty("MaxHp")
  local A = MaxHp * (a + c) + b
  if 0 < A or a == 0 then
    return A
  end
  if srcUser:GetNpcID() == 0 and targetUser:HasBuffID(160000_BOSS_IMMUNE_EFFECT_:MAX_STACK_0) and targetUser.boss == false and targetUser.mini == false then
    return 0
  end
  if srcUser:GetNpcID() == 0 and (targetUser.boss or targetUser.mini) then
    local Vit = srcUser:GetProperty("Vit")
    local MAtk = srcUser:GetProperty("MAtk")
    local MAtkPer = srcUser:GetProperty("MAtkPer")
    local Refine = srcUser:GetProperty("Refine")
    local MRefine = srcUser:GetProperty("MRefine")
    local Def2 = targetUser:GetProperty("Def")
    local DefPer2 = targetUser:GetProperty("DefPer")
    local MDef2 = targetUser:GetProperty("MDef")
    local MDefPer2 = targetUser:GetProperty("MDefPer")
    local Vit2 = targetUser:GetProperty("Vit")
    local VitPer2 = targetUser:GetProperty("VitPer")
    local DamReduc2 = CommonFun.calcDamReDuc(srcUser, targetUser)
    local RefineDamReduc = targetUser:GetProperty("RefineDamReduc")
    local Int2 = targetUser:GetProperty("Int")
    local IntPer2 = targetUser:GetProperty("IntPer")
    local MDamReduc2 = CommonFun.calcMDamReDuc(srcUser, targetUser)
    local RefineMDamReduc = targetUser:GetProperty("RefineMDamReduc")
    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 MDamIncrease = CommonFun.calcMDamIncrease(srcUser, targetUser)
    local IgnoreDef = srcUser:GetProperty("IgnoreDef")
    if 1 <= IgnoreDef then
      IgnoreDef = 1
    end
    local IgnoreMDef = srcUser:GetProperty("IgnoreMDef")
    if 1 <= IgnoreMDef then
      IgnoreMDef = 1
    end
    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
    if raceparam <= 0.1 then
      raceparam = 0.1
    end
    local MAtkFinal = MAtk * (1 + MAtkPer) * CommonFun.ShapeCorrection(srcUser, targetUser) * raceparam
    local AtkFinal = Atk * (1 + AtkPer) * CommonFun.ShapeCorrection(srcUser, targetUser) * raceparam
    if MAtkFinal <= AtkFinal then
      local DefReduc = CommonFun.CalcDef(srcUser, targetUser)
      A = (AtkFinal * DefReduc * (1 - DamReduc2) + Refine) * a * 100 * (1 - RefineDamReduc) * (1 + DamIncrease) - Vit2 * (1 + VitPer2) + b
    else
      local MDefReduc = CommonFun.CalcMDef(srcUser, targetUser)
      A = (MAtkFinal * MDefReduc * (1 - MDamReduc2) + MRefine) * a * 100 * (1 - RefineMDamReduc) * (1 + MDamIncrease) - Vit2 / 2 * (1 + VitPer2) - Int2 * (1 + IntPer2) + b
    end
  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 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

Self

{
  "id": 139360,
  "BuffDesc": "Transforms into Morroc",
  "BuffIcon": "skillbuff_2957001",
  "BuffName": "Morroc's Form",
  "BuffRate": {
    "Odds": 100
  },
  "IconType": 1,
  "BuffEffect": {
    "Back": 0,
    "Body": 30064,
    "Face": 0,
    "Hair": 0,
    "Head": 0,
    "Tail": 0,
    "type": "PartTransform",
    "Mount": 0,
    "Mouth": 0,
    "Crystal": 0,
    "LeftHand": 0,
    "priority": 1,
    "RightHand": 0,
    "noDelByType": 1,
    "NoHandInHand": 1,
    "during_no_transform": 1
  }
}

Self

{
  "id": 139443,
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "BuffEffect": {
    "type": "ImmuneAttack"
  }
}

Self

{
  "id": 139362,
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "BuffEffect": {
    "type": "ReplaceSkill",
    "newid": 2967,
    "oldid": 2954
  }
}

Self

{
  "id": 139365,
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "Condition": {
    "type": "HasBuff",
    "buffid": [
      139411
    ]
  },
  "BuffEffect": {
    "type": "AttrChange",
    "DemiHumanDamPer": {
      "a": 2961,
      "b": 0.06,
      "c": 0,
      "type": 8
    }
  }
}

Self

{
  "id": 139444,
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "BuffEffect": {
    "type": "ImmuneHPChange"
  }
}

Self

{
  "id": 139440,
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "BuffEffect": {
    "Hp": {
      "a": 1,
      "b": 0,
      "type": 6
    },
    "type": "HSPChange"
  }
}

Self

{
  "id": 139340,
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "Condition": {
    "type": "HasBuff",
    "buffid": [
      139360
    ],
    "delWhenInvalid": 1
  },
  "BuffEffect": {
    "id": [
      139312,
      139313
    ],
    "type": "AddBuff"
  },
  "BuffStateID": 139340
}

Self

{
  "id": 139363,
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "BuffEffect": {
    "race": 3,
    "type": "ChangeRace"
  }
}

Self

{
  "id": 139361,
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "BuffEffect": {
    "type": "ReplaceSkill",
    "newid": 2966,
    "oldid": 2951
  }
}

Self

{
  "id": 139341,
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "Condition": {
    "type": "HasBuff",
    "buffid": [
      139360
    ],
    "delWhenInvalid": 1
  },
  "BuffEffect": {
    "id": [
      139314,
      139315
    ],
    "type": "AddBuff"
  }
}

Self

{
  "id": 139350,
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "Condition": {
    "type": "HasBuff",
    "buffid": [
      139360
    ],
    "delWhenInvalid": 1
  },
  "BuffEffect": {
    "id": [
      139351
    ],
    "type": "AddBuff"
  }
}

Self

{
  "id": 139312,
  "BuffDesc": "Increases M.DMG bonus and HP Loss",
  "BuffIcon": "skillbuff_2952001",
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "BuffType": {
    "isgain": 1,
    "isdisperse": 0
  },
  "IconType": 2,
  "BuffEffect": {
    "type": "AttrChange",
    "MDamIncrease": {
      "a": 2952,
      "b": 0.02,
      "c": 0.05,
      "type": 8
    }
  }
}

Self

{
  "id": 139314,
  "BuffDesc": "When using skills, takes DMG",
  "BuffIcon": "skillbuff_2952001",
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "IconType": 2,
  "Condition": {
    "type": "UseSkill",
    "all_skill": 1,
    "no_normalSkill": 1
  },
  "BuffEffect": {
    "id": [
      139316
    ],
    "type": "AddBuff"
  }
}

Self

{
  "id": 139315,
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "BuffEffect": {
    "type": "AttrChange",
    "StateDef": {
      "a": 0,
      "b": 0,
      "c": 216111,
      "type": 5020
    }
  }
}
Discerning Aura (Trigger)

Self

{
  "id": 139316,
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "BuffEffect": {
    "id": 2963001,
    "Odds": 100,
    "type": "UseSkill",
    "IsActive": 0
  }
}

Self

{
  "id": 139351,
  "BuffDesc": "Increases Dark DMG down",
  "BuffIcon": "skillbuff_2955001",
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "IconType": 2,
  "BuffEffect": {
    "type": "AttrChange",
    "DarkJudgePer": {
      "a": 0,
      "b": 0,
      "c": 216121,
      "type": 5010
    },
    "BeShadowDamPer": {
      "a": 2955,
      "b": 0.03,
      "c": 0.2,
      "type": 8
    }
  }
}

Self

{
  "id": 139352,
  "BuffDesc": "Forces the attack type to change to Dark",
  "BuffIcon": "skillbuff_2955001",
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "IconType": 2,
  "BuffEffect": {
    "type": "ForceTotalAttr",
    "ForceAtkAttr": 7
  }
}

Self

{
  "id": 139353,
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "Condition": {
    "type": "HasBuff",
    "buffid": [
      139360
    ],
    "delWhenInvalid": 1
  },
  "BuffEffect": {
    "id": [
      139352
    ],
    "type": "AddBuff"
  },
  "BuffStateID": 139350
}

Self

{
  "id": 139364,
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "Condition": {
    "type": "HasBuff",
    "buffid": [
      139410
    ]
  },
  "BuffEffect": {
    "type": "AttrChange",
    "DemiHumanResPer": {
      "a": 2961,
      "b": 0.06,
      "c": 0,
      "type": 8
    }
  }
}

Self

{
  "id": 139441,
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "BuffEffect": {
    "num": 99,
    "type": "Disperse"
  }
}

Self

{
  "id": 139445,
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  }
}

Self

{
  "id": 139313,
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "BuffType": {
    "isgain": 1,
    "isdisperse": 0
  },
  "BuffEffect": {
    "type": "AddLoseHpRatio",
    "ratio": {
      "a": 2952,
      "b": 0.02,
      "c": 0.05,
      "type": 8
    }
  }
}

Self

{
  "id": 139366,
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "Condition": {
    "type": "HasBuff",
    "buffid": [
      139360
    ],
    "delWhenInvalid": 1
  },
  "BuffEffect": {
    "type": "AttrChange",
    "ResultDamRes": 0.3
  }
}

Self

{
  "id": 139442,
  "BuffDesc": "Invincible",
  "BuffIcon": "skillbuff_commonbuff",
  "BuffName": "1225",
  "BuffRate": {
    "Odds": 100
  },
  "IconType": 1,
  "BuffEffect": {
    "type": "AttrChange",
    "AttrEffect": [
      1,
      2
    ]
  },
  "BuffStateID": 124200
}

Formula

{
  "CD": 60,
  "id": 2957001,
  "Buff": {
    "self": [
      139340,
      139341,
      139350,
      139353,
      139360,
      139361,
      139362,
      139363,
      139364,
      139365,
      139440,
      139441,
      139442,
      139443,
      139444,
      139445,
      139366
    ]
  },
  "Cost": 1,
  "Desc": [
    {
      "id": 2957000
    }
  ],
  "Icon": "skill_2957001",
  "Camps": "Friend",
  "FixCD": 1,
  "Level": 1,
  "Logic": "SkillNone",
  "DescId": "##42531624",
  "NameZh": "##42531556",
  "DelayCD": 1,
  "Fire_EP": 3,
  "Pvp_buff": {
    "self": [
      139340,
      139341,
      139350,
      139353,
      139360,
      139361,
      139362,
      139363,
      139364,
      139365,
      139440,
      139441,
      139442,
      139443,
      139444,
      139445,
      139366
    ]
  },
  "AttackAct": [
    "use_skill5"
  ],
  "Attack_EP": 2,
  "Contidion": {
    "skillid": 2955005
  },
  "SE_attack": "Skill/sfx_skill_mengluoke_arrive_attack_01",
  "SkillType": "Buff",
  "Target_EP": 3,
  "Logic_Param": {
    "allSuperUse": 1
  },
  "Launch_Range": 0,
  "AutoCondition": [
    {
      "type": 8,
      "no_target": 1
    }
  ]
}