
Demon King's Reflection
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.
Skill Levels
• 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.
• 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.
• 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.
• 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.
• 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.
• 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.
• 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.
• 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.
• 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.
Formula
1function CommonFun.calcBuff_8930(srcUser, targetUser, a, b, c, d, lv)
2 local Int = srcUser:GetProperty("Int")
3 local Vit = srcUser:GetProperty("Vit")
4 local MAtk = srcUser:GetProperty("MAtk")
5 local MAtkPer = srcUser:GetProperty("MAtkPer")
6 local MaxHp = targetUser:GetProperty("MaxHp")
7 local MDamIncrease = CommonFun.calcMDamIncrease(srcUser, targetUser)
8 local IgnoreMDef = srcUser:GetProperty("IgnoreMDef")
9 if 1 <= IgnoreMDef then
10 IgnoreMDef = 1
11 end
12 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
13 if targetUser:GetNpcID() ~= 0 then
14 GemValue = 0
15 end
16 local MRefine = srcUser:GetProperty("MRefine")
17 local MDamSpike1 = targetUser:GetProperty("MDamSpike_MPEN") * GemValue
18 MAtk = MAtk + targetUser:GetProperty("MAtk") * GemValue
19 MDamIncrease = MDamIncrease + targetUser:GetProperty("MDamIncrease") * GemValue
20 local MDef2 = targetUser:GetProperty("MDef")
21 local MDefPer2 = targetUser:GetProperty("MDefPer")
22 local Vit2 = targetUser:GetProperty("Vit")
23 local VitPer2 = targetUser:GetProperty("VitPer")
24 local Int2 = targetUser:GetProperty("Int")
25 local IntPer2 = targetUser:GetProperty("IntPer")
26 local MDamReduc2 = CommonFun.calcMDamReDuc(srcUser, targetUser)
27 local RefineMDamReduc = CommonFun.calcRefineMDamReduc(srcUser, targetUser)
28 local raceparam = 1
29 local srcRace = srcUser.race
30 local targetRace = targetUser.race
31 if targetUser:HasBuffID(139410_TWO_FACE_DEMON_KING_HUMAN_:MAX_STACK_0) then
32 targetRace = 3
33 end
34 if srcUser:HasBuffID(139411_TWO_FACE_DEMON_KING_DEMON_:MAX_STACK_0) then
35 srcRace = 3
36 end
37 if srcUser:HasBuffID(49320_RACIAL_ANCIENT_RELICS_PERMANENT_:MAX_STACK_0) and srcUser:HasBuffID(49325_RACIAL_ANCIENT_RELICS_CD_:MAX_STACK_0) then
38 elseif srcUser:HasBuffID(49320_RACIAL_ANCIENT_RELICS_PERMANENT_:MAX_STACK_0) then
39 targetRace = 2
40 end
41 if targetUser:HasBuffID(49320_RACIAL_ANCIENT_RELICS_PERMANENT_:MAX_STACK_0) and targetUser:HasBuffID(49325_RACIAL_ANCIENT_RELICS_CD_:MAX_STACK_0) then
42 elseif targetUser:HasBuffID(49320_RACIAL_ANCIENT_RELICS_PERMANENT_:MAX_STACK_0) then
43 srcRace = 2
44 end
45 if nil == CommonFun.RaceProps[targetRace] then
46 return 0
47 end
48 if nil == CommonFun.RaceProps[srcRace] then
49 return 0
50 end
51 local raceInc = srcUser:GetProperty(CommonFun.RaceProps[targetRace][1])
52 local raceRed = targetUser:GetProperty(CommonFun.RaceProps[srcRace][2])
53 local raceRedThrough = srcUser:GetProperty(CommonFun.RaceProps[srcRace][3])
54 local raceIncResistance = targetUser:GetProperty(CommonFun.RaceProps[targetRace][4])
55 if nil == raceRedThrough then
56 raceRedThrough = 0
57 end
58 if nil == raceIncResistance then
59 raceIncResistance = 0
60 end
61 if 0 <= raceInc then
62 raceInc = raceInc * math.max(1 - raceIncResistance, 0)
63 end
64 if 0 <= raceRed then
65 raceRed = raceRed * math.max(1 - raceRedThrough, 0)
66 end
67 local raceparam = 1 + raceInc - raceRed
68 local mapid, maptype = srcUser:GetMapInfo()
69 if maptype == PVP_MAPS then
70 local B = raceRed - raceInc
71 B = B < -1 and -1 or 1 < B and 1 or B
72 B = math.floor(B * 1000) / 1000
73 B = B + 0.3 * (1 - math.sin(B * 3.14 / 2))
74 raceparam = 1 - B
75 end
76 if raceparam <= 0.1 then
77 raceparam = 0.1
78 end
79 local srcAtkElement = 7
80 local targetDefElement = targetUser:GetProperty("DefAttr")
81 local ElementRate = CommonFun.GetElementRate(srcUser, srcAtkElement, targetUser, targetDefElement)
82 if (srcUser:HasBuffID(69650_8608_:MAX_STACK_0) or srcUser:HasBuffID(71090_10658_:MAX_STACK_0)) and 1 < ElementRate then
83 ElementRate = ElementRate * 1.1
84 end
85 if targetUser:HasBuffID(49130_DIVINE_HYMN_CARVER_:MAX_STACK_0) then
86 ElementRate = math.min(ElementRate, 1)
87 end
88 if srcUser:HasBuffID(49210_7892_:MAX_STACK_0) then
89 ElementRate = ElementRate + 0.15
90 end
91 if srcUser:HasBuffID(77480_48193_VICTORY_SWALLOW_1_:MAX_STACK_0) then
92 ElementRate = ElementRate + 0.1
93 end
94 if srcUser:HasBuffID(59630_DINGGUI_SYNERGY_CARD_:MAX_STACK_0) and (srcAtkElement == 3 or srcAtkElement == 4) then
95 ElementRate = ElementRate + 0.1
96 end
97 if srcUser:HasBuffID(59670_RESENTFUL_THOR_SOL_CARD_:MAX_STACK_0) and srcAtkElement == 1 then
98 ElementRate = ElementRate + 0.1
99 end
100 if srcUser:HasBuffID(700680_3013155_TWNPC_REMOVE_WINGS_:MAX_STACK_0) then
101 local RefineLv11 = srcUser:GetEquipedRefineLv(11)
102 ElementRate = ElementRate + 0.01 * RefineLv11
103 end
104 if srcUser:HasBuffID(139351_DEMON_KING_FIELD_FRIENDLY_:MAX_STACK_0) then
105 local MoroccField = srcUser:GetProperty("DarkJudgePer")
106 ElementRate = ElementRate + MoroccField
107 end
108 if nil == CommonFun.NatureProps[srcAtkElement] or nil == CommonFun.NatureProps[targetDefElement] or nil == targetDefElement then
109 return 0
110 end
111 local elementRed = targetUser:GetProperty(CommonFun.NatureProps[srcAtkElement][2])
112 local elementAtk = srcUser:GetProperty(CommonFun.NatureProps[srcAtkElement][3])
113 local elementThrough = srcUser:GetProperty(CommonFun.NatureProps[srcAtkElement][4])
114 local elementResistance = targetUser:GetProperty(CommonFun.NatureProps[srcAtkElement][5])
115 if 0 <= elementRed then
116 elementRed = elementRed * math.max(1 - elementThrough, 0)
117 end
118 if 0 <= elementAtk then
119 elementAtk = elementAtk * math.max(1 - elementResistance, 0)
120 end
121 local elementparam = ElementRate
122 local elementparam2 = 1 + elementAtk - elementRed
123 local mapid, maptype = srcUser:GetMapInfo()
124 if maptype == PVP_MAPS then
125 local B = elementRed - elementAtk
126 B = B < -1 and -1 or 1 < B and 1 or B
127 B = math.floor(B * 1000) / 1000
128 B = B + 0.3 * (1 - math.sin(B * 3.14 / 2))
129 elementparam2 = 1 - B
130 end
131 if elementparam2 <= 0.1 then
132 elementparam2 = 0.1
133 end
134 if elementparam2 <= 0.1 then
135 elementparam2 = 0.1
136 end
137 local ele = elementparam * elementparam2
138 if targetDefElement == nil or ElementRate == nil or elementRed == nil or elementAtk == nil then
139 ele = 1
140 end
141 local skilllv_1 = srcUser:GetLernedSkillLevel(2953_MERCHANT:DEMON_KING_S_REFLECTION)
142 local NpcParam = CommonFun.NpcParam(srcUser, targetUser, params, damageParam, logger)
143 local BaseMAtk = Int + math.floor(Int * Int / 100)
144 local MAtkFinal = ((MAtk - BaseMAtk) * (1 + MAtkPer) + BaseMAtk) * ele * raceparam * NpcParam
145 local MDefReduc = CommonFun.CalcMDef(srcUser, targetUser)
146 local A = -((MAtkFinal * MDefReduc * (1 - MDamReduc2 + MDamSpike1) + MRefine) * (skilllv_1 * 1 + 6) * (1 - RefineMDamReduc) * (1 + MDamIncrease) - Vit2 / 2 * (1 + VitPer2) - Int2 * (1 + IntPer2))
147 local AttrFunction = srcUser:GetProperty("AttrFunction")
148 local bitfunc = CommonFun.getBits(AttrFunction)
149 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
150 A = 0
151 end
152 if CommonFun.checkAttrFunctionMiss(targetUser, srcUser) then
153 A = 0
154 end
155 if targetUser.boss and targetUser.zoneType == 22 and CommonFun.CheckStormBossMiss(targetUser, srcUser) then
156 A = 0
157 end
158 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
159 A = -1
160 end
161 if targetUser:DamageAlways1() then
162 A = -1
163 end
164 return A
165end