Catnip Meteor

Catnip Meteor

Lv 1AttackMagic

Range: 20

Formula

1function CommonFun.calcDamage_15202(srcUser, targetUser, params, damageParam, logger)
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 MDamIncrease = CommonFun.calcMDamIncrease(srcUser, targetUser)
7  local IgnoreMDef = srcUser:GetProperty("IgnoreMDef")
8  if 1 <= IgnoreMDef then
9    IgnoreMDef = 1
10  end
11  local Str = srcUser:GetProperty("Str")
12  local Dex = srcUser:GetProperty("Dex")
13  local Luk = srcUser:GetProperty("Luk")
14  local Atk = srcUser:GetProperty("Atk")
15  local AtkPer = srcUser:GetProperty("AtkPer")
16  local BaseAtk = Dex * 2 + math.floor(Str * Str / 100) + math.floor(Dex / 5) + math.floor(Luk / 5)
17  local AtkFinal = (Atk - BaseAtk) * (1 + AtkPer) + BaseAtk
18  local MRefine = srcUser:GetProperty("MRefine")
19  local RangeDam = srcUser:GetProperty("RangeDam")
20  local srcAtkElement = CommonFun.GetUserAtkAttr(srcUser, targetUser, params, damageParam)
21  local targetDefElement = targetUser:GetProperty("DefAttr")
22  local elementparam2 = CommonFun.CalcElementParam2(srcUser, targetUser, params, damageParam, logger)
23  local raceparam = CommonFun.CalcRaceParam(srcUser, targetUser, params, damageParam, logger)
24  local raceparam2 = CommonFun.CalcRaceParam2(srcUser, targetUser, params, damageParam, logger)
25  local bossparam = CommonFun.CalcBossParam(srcUser, targetUser, params, damageParam, logger)
26  local bossparam2 = CommonFun.CalcBossParam2(srcUser, targetUser, params, damageParam, logger)
27  local MDef2 = targetUser:GetProperty("MDef")
28  local MDefPer2 = targetUser:GetProperty("MDefPer")
29  local Vit2 = targetUser:GetProperty("Vit")
30  local VitPer2 = targetUser:GetProperty("VitPer")
31  local Int2 = targetUser:GetProperty("Int")
32  local IntPer2 = targetUser:GetProperty("IntPer")
33  local MDamReduc2 = CommonFun.calcMDamReDuc(srcUser, targetUser)
34  local RefineMDamReduc = CommonFun.calcRefineMDamReduc(srcUser, targetUser)
35  local damChangePer = damageParam.damChangePer
36  local BaseMAtk = Int + math.floor(Int * Int / 100)
37  local MAtkFinal = ((MAtk - BaseMAtk) * (1 + MAtkPer) + BaseMAtk + AtkFinal) * raceparam * bossparam * bossparam2
38  local MDefReduc = CommonFun.CalcMDef(srcUser, targetUser)
39  local Num_sf = 0
40  if targetUser:HasBuffID(123240_CAT_MINT_POWDER_:MAX_STACK_0) then
41    Num_sf = srcUser:GetRunePoint(153044_AESIR_CAT_MINT_POWDER_INFLICTS_EXTRA_DMG_OF_5_ON_ENEMY_UNITS_IN_RANGE_WHEN_ATTACKED_BY_CATNIP_METEOR)
42  end
43  local Num = srcUser:GetRunePoint(153030_AESIR_CATNIP_METEOR_DMG_6)
44  local RuneDam = 1 + Num * 0.06 + Num_sf * 0.05
45  local skilllv_1 = srcUser:GetLernedSkillLevel(1635_BLADE_SOUL:EARTH_SOUL)
46  local RefineLv5 = srcUser:GetEquipedRefineLv(5_ACCESSORY)
47  local RefineLv6 = srcUser:GetEquipedRefineLv(6_ACCESSORY)
48  local Ring1 = srcUser:GetEquipedID(5_ACCESSORY)
49  local Ring2 = srcUser:GetEquipedID(6_ACCESSORY)
50  local order1 = srcUser:getEquipLv(5)
51  local order2 = srcUser:getEquipLv(6)
52  local a = 0
53  local b = 0
54  local Talisman = 0
55  if (Ring1 == 44065_TALISMAN_GRASS_NECKLACE or Ring1 == 144065_TALISMAN_GRASS_NECKLACE_1) and 4 <= order1 then
56    a = RefineLv5 * 0.07
57  end
58  if (Ring2 == 44065_TALISMAN_GRASS_NECKLACE or Ring2 == 144065_TALISMAN_GRASS_NECKLACE_1) and 4 <= order2 then
59    b = RefineLv6 * 0.07
60  end
61  local equipRing5 = srcUser:getEquip(CommonFun.PackType.EPACKTYPE_EQUIP, CommonFun.EquipPos.EEQUIPPOS_ACCESSORY1)
62  if (equipRing5.id == 44066 or equipRing5.id == 144066) and equipRing5.refinelv >= 15 then
63    a = equipRing5.refinelv * 0.07 + 0.25
64  elseif equipRing5.id == 44066 or equipRing5.id == 144066 then
65    a = equipRing5.refinelv * 0.07
66  end
67  local equipRingSD5 = srcUser:getEquip(CommonFun.PackType.EPACKTYPE_SHADOWEQUIP, CommonFun.EquipPos.EEQUIPPOS_ACCESSORY1)
68  if (equipRingSD5.id == 44066 or equipRingSD5.id == 144066) and equipRingSD5.refinelv >= 15 then
69    a = (equipRingSD5.refinelv * 0.07 + 0.25) * equipRingSD5.quench_per / 100
70  elseif equipRingSD5.id == 44066 or equipRingSD5.id == 144066 then
71    a = equipRingSD5.refinelv * 0.07 * equipRingSD5.quench_per / 100
72  end
73  local equipRing6 = srcUser:getEquip(CommonFun.PackType.EPACKTYPE_EQUIP, CommonFun.EquipPos.EEQUIPPOS_ACCESSORY2)
74  if (equipRing6.id == 44066 or equipRing6.id == 144066) and equipRing6.refinelv >= 15 then
75    b = equipRing6.refinelv * 0.07 + 0.25
76  elseif equipRing6.id == 44066 or equipRing6.id == 144066 then
77    b = equipRing6.refinelv * 0.07
78  end
79  local equipRingSD6 = srcUser:getEquip(CommonFun.PackType.EPACKTYPE_SHADOWEQUIP, CommonFun.EquipPos.EEQUIPPOS_ACCESSORY2)
80  if (equipRingSD6.id == 44066 or equipRingSD6.id == 144066) and equipRingSD6.refinelv >= 15 then
81    b = (equipRingSD6.refinelv * 0.07 + 0.25) * equipRingSD6.quench_per / 100
82  elseif equipRingSD6.id == 44066 or equipRingSD6.id == 144066 then
83    b = equipRingSD6.refinelv * 0.07 * equipRingSD6.quench_per / 100
84  end
85  Talisman = Talisman + a + b
86  local Foxtail = 1
87  if (srcUser:HasBuffID(42810_MAGICAL_FOX_GRASS_:MAX_STACK_0) or srcUser:HasBuffID(42940_MAGICAL_YELLOW_FOX_GRASS_:MAX_STACK_0)) and (srcUser:HasBuffID(42770_TALISMAN_GRASS_NECKLACE_:MAX_STACK_0) or srcUser:HasBuffID(43140_FOUR_LEAF_CLOVER_NECKLACE_:MAX_STACK_0) or srcUser:HasBuffLayer(43140, EBUFFERLAYER_SHADOW)) then
88    Foxtail = Foxtail + 0.15
89  end
90  local RefineLv7 = srcUser:GetEquipedRefineLv(7_WEAPON)
91  local Ring7 = srcUser:GetEquipedID(7_WEAPON)
92  if (Ring7 == 44300 or Ring7 == 144300) and srcUser:HasBuffID(90002563_ADVANCED_FOX_GRASS_TIER_4_:MAX_STACK_0) then
93    Foxtail = Foxtail + RefineLv7 * 0.02
94  end
95  if Ring7 == 44303 or Ring7 == 144303 then
96    Foxtail = Foxtail + RefineLv7 * 0.02
97  end
98  if Ring7 == 44309 or Ring7 == 144309 then
99    Foxtail = Foxtail + RefineLv7 * 0.02
100  end
101  local A = ((MAtkFinal * MDefReduc * (1 - MDamReduc2) + MRefine) * (1 - RefineMDamReduc) * (damChangePer + Talisman) * (1 + MDamIncrease) * CommonFun.calcMagicElement(srcUser, targetUser, params, damageParam) * elementparam2 - Vit2 / 2 * (1 + VitPer2) - Int2 * (1 + IntPer2)) * (1 + RangeDam) * (1 + skilllv_1 * 0.015) * RuneDam * Foxtail
102  local skillID, skillLevel = CommonFun.UnmergeSkillID(params.skillIDAndLevel)
103  if skillID == 1652_BLADE_SOUL:CAT_FLYING_SAUCER_BOMBARDMENT then
104    local skilllv_mbh = srcUser:GetLernedSkillLevel(1614_BLADE_SOUL:CATNIP_METEOR)
105    local skill_zr = srcUser:GetLernedSkillLevel(4127_PROFESSOR:NATURAL_RAGE_BURST)
106    local zr = 1
107    if srcUser:HasBuffID(131580_NATURAL_RAGE_:MAX_STACK_0) then
108      zr = 1 + skill_zr * 0.05
109    end
110    local shucai = srcUser:GetBuffLayer(123350_VEGETABLE_FRIEND_:MAX_STACK_4)
111    local skill_sc = srcUser:GetLernedSkillLevel(1662_BLADE_SOUL:VEGETABLE_FRIEND)
112    local sc_dam = 1 + skill_sc * shucai * 0.04
113    damChangePer = (skilllv_mbh * 0.2 + 2.4) * sc_dam
114    local GemMFD = srcUser:GetGemValue(153021_GRANTS_THE_CAT_FLYING_SAUCER_BOMBARDMENT_SKILL_EACH_BOMBING_DEALS_PERCENTAGE_CATNIP_METEOR_DAMAGE)
115    A = ((MAtkFinal * MDefReduc * (1 - MDamReduc2) + MRefine) * (1 - RefineMDamReduc) * (damChangePer + Talisman) * zr * (1 + MDamIncrease) * CommonFun.calcMagicElement(srcUser, targetUser, params, damageParam) * elementparam2 - Vit2 / 2 * (1 + VitPer2) - Int2 * (1 + IntPer2)) * (1 + RangeDam) * (1 + skilllv_1 * 0.015) * RuneDam * (GemMFD / 100000) * Foxtail
116  end
117  if srcUser:HasBuffID(131571_VEGETABLE_SKILL_CRITICAL_:MAX_STACK_0) then
118    local skilllv_dd = srcUser:GetLernedSkillLevel(4113_PROFESSOR:CONCENTRIC_EARTH)
119    local GemNew = srcUser:GetGemValue(153151_WHEN_EARTH_CONCENTRIC_IS_TRIGGERED_VEGGIE_TYPE_SKILL_CRIT_DMG_PERCENTAGE)
120    local Luk = srcUser:GetProperty("Luk")
121    local Fifth = 0
122    if srcUser:HasBuffID(90004594_MAGICAL_YELLOW_FOX_GRASS_1_TIER_5_:MAX_STACK_0) then
123      Fifth = 0.15
124    end
125    return A * (1 + skilllv_dd * 0.05 + GemNew / 100000 + Luk / 300 + Fifth), CommonFun.DamageType.Crit
126  end
127  if A <= 1 then
128    return 1
129  end
130  return A
131end
Preserved HTML snapshot from ROM Handbook