
Counter Attack Halo
Lv 1Buff
Deals (Atk100%) Dmg to the target
Formula
1function CommonFun.calcBuff_6220(srcUser, targetUser, a, b, c, d, lv)
2 if srcUser == nil or targetUser == nil then
3 return 0
4 end
5 local Hp = srcUser:GetProperty("Hp")
6 if srcUser:HasBuffID(20720160_COUNTER_ATTACK_HALO_USES_MAX_HP_:MAX_STACK_0) then
7 Hp = srcUser:GetProperty("MaxHp")
8 end
9 local mapid, maptype = srcUser:GetMapInfo()
10 if maptype == PVP_MAPS then
11 Hp = Hp * 0.25
12 end
13 local DefReduc = CommonFun.CalcDef(srcUser, targetUser)
14 local DamReduc2 = CommonFun.calcDamReDuc(srcUser, targetUser)
15 local RefineDamReduc = CommonFun.calcRefineDamReduc(srcUser, targetUser)
16 local DamIncrease = srcUser:GetProperty("DamIncrease")
17 local skilllv = srcUser:GetLernedSkillLevel(3807_ROYAL_GUARD:COUNTER_ATTACK_HALO)
18 local GemValue = srcUser:GetGemValue(72142_COUNTER_ATTACK_HALO_DMG_PERCENTAGE)
19 local A = -(Hp * (skilllv * 0.1 + 0.1)) * DefReduc * (1 - DamReduc2) * (1 - RefineDamReduc) * (1 + DamIncrease) * (1 + GemValue / 100000)
20 local AttrFunction = srcUser:GetProperty("AttrFunction")
21 local bitfunc = CommonFun.getBits(AttrFunction)
22 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
23 A = 0
24 end
25 if CommonFun.checkAttrFunctionMiss(targetUser, srcUser) then
26 A = 0
27 end
28 if targetUser.boss and targetUser.zoneType == 22 and CommonFun.CheckStormBossMiss(targetUser, srcUser) then
29 A = 0
30 end
31 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
32 A = -1
33 end
34 if targetUser:DamageAlways1() then
35 A = -1
36 end
37 return A
38endPreserved HTML snapshot from ROM Handbook
