|
5 | 5 | ---@type TMobEntity |
6 | 6 | local entity = {} |
7 | 7 |
|
| 8 | +local drawInPositions = |
| 9 | +{ |
| 10 | + { 330.166, -23.909, -89.456 }, |
| 11 | + { 314.186, -24.180, -89.331 }, |
| 12 | + { 314.372, -23.985, -82.1 }, |
| 13 | + { 321.629, -24, -90.936 }, |
| 14 | + { 329.969, -24, -73.665 }, |
| 15 | + { 322.330, -24, -82.168 }, |
| 16 | + { 331.026, -24, -81.093 }, |
| 17 | + { 321.795, -23.978, -73.724 }, |
| 18 | +} |
| 19 | + |
| 20 | +entity.spawnPoints = |
| 21 | +{ |
| 22 | + { x = 310.427, y = -24.142, z = -86.671 }, |
| 23 | + { x = 319.374, y = -24.007, z = -88.509 }, |
| 24 | + { x = 319.599, y = -23.992, z = -82.799 }, |
| 25 | + { x = 313.390, y = -23.871, z = -78.151 }, |
| 26 | + { x = 318.662, y = -23.890, z = -73.773 }, |
| 27 | + { x = 324.362, y = -24.269, z = -75.149 }, |
| 28 | + { x = 323.935, y = -24.000, z = -80.289 }, |
| 29 | + { x = 323.565, y = -24.000, z = -84.583 }, |
| 30 | + { x = 323.058, y = -23.995, z = -90.231 }, |
| 31 | + { x = 328.670, y = -23.984, z = -90.623 }, |
| 32 | + { x = 331.835, y = -23.889, z = -89.472 }, |
| 33 | + { x = 330.609, y = -24.054, z = -84.279 }, |
| 34 | + { x = 330.292, y = -24.000, z = -79.809 }, |
| 35 | + { x = 329.868, y = -24.109, z = -76.046 }, |
| 36 | +} |
| 37 | + |
| 38 | +entity.onMobInitialize = function(mob) |
| 39 | + mob:setRespawnTime(math.randomInt(48, 72) * 3600) -- 48 - 72 hours with 1 hour windows |
| 40 | + xi.mob.updateNMSpawnPoint(mob) |
| 41 | + |
| 42 | + mob:addImmunity(xi.immunity.LIGHT_SLEEP) |
| 43 | + mob:addImmunity(xi.immunity.DARK_SLEEP) |
| 44 | + mob:addImmunity(xi.immunity.PLAGUE) |
| 45 | + mob:addImmunity(xi.immunity.SILENCE) |
| 46 | + |
| 47 | + mob:setMobMod(xi.mobMod.GIL_MIN, 20000) |
| 48 | + mob:setMobMod(xi.mobMod.GIL_MAX, 20000) |
| 49 | + |
| 50 | + mob:addListener('TAKE_DAMAGE', 'CERBERUS_TAKE_DAMAGE', function(mobArg, damage, attacker, attackType, damageType) |
| 51 | + local damageAmount = damage |
| 52 | + local damageThreshold = math.max(1, math.floor(mob:getMaxHP() * 0.005)) |
| 53 | + |
| 54 | + if damageAmount < damageThreshold then |
| 55 | + return |
| 56 | + end |
| 57 | + |
| 58 | + local dmgPhysical = mobArg:getMod(xi.mod.UDMGPHYS) |
| 59 | + local dmgRanged = mobArg:getMod(xi.mod.UDMGRANGE) |
| 60 | + local dmgMagical = mobArg:getMod(xi.mod.UDMGMAGIC) |
| 61 | + local dmgBreath = mobArg:getMod(xi.mod.UDMGBREATH) |
| 62 | + |
| 63 | + local modifierAdjustment = math.floor(damageAmount / damageThreshold) * 50 |
| 64 | + |
| 65 | + if |
| 66 | + attackType == xi.attackType.PHYSICAL or |
| 67 | + attackType == xi.attackType.RANGED |
| 68 | + then |
| 69 | + dmgPhysical = utils.clamp(dmgPhysical - modifierAdjustment, -8500, 8500) |
| 70 | + dmgRanged = utils.clamp(dmgRanged - modifierAdjustment, -8500, 8500) |
| 71 | + dmgMagical = utils.clamp(dmgMagical + modifierAdjustment, -8500, 8500) |
| 72 | + dmgBreath = utils.clamp(dmgBreath + modifierAdjustment, -8500, 8500) |
| 73 | + elseif |
| 74 | + attackType == xi.attackType.MAGICAL or |
| 75 | + attackType == xi.attackType.BREATH |
| 76 | + then |
| 77 | + dmgPhysical = utils.clamp(dmgPhysical + modifierAdjustment, -8500, 8500) |
| 78 | + dmgRanged = utils.clamp(dmgRanged + modifierAdjustment, -8500, 8500) |
| 79 | + dmgMagical = utils.clamp(dmgMagical - modifierAdjustment, -8500, 8500) |
| 80 | + dmgBreath = utils.clamp(dmgBreath - modifierAdjustment, -8500, 8500) |
| 81 | + end |
| 82 | + |
| 83 | + mobArg:setMod(xi.mod.UDMGPHYS, dmgPhysical) |
| 84 | + mobArg:setMod(xi.mod.UDMGRANGE, dmgRanged) |
| 85 | + mobArg:setMod(xi.mod.UDMGMAGIC, dmgMagical) |
| 86 | + mobArg:setMod(xi.mod.UDMGBREATH, dmgBreath) |
| 87 | + end) |
| 88 | +end |
| 89 | + |
8 | 90 | entity.onMobSpawn = function(mob) |
9 | 91 | mob:setMobMod(xi.mobMod.NO_MOVE, 0) |
10 | 92 | mob:setMobMod(xi.mobMod.AOE_HIT_ALL, 1) |
| 93 | + |
| 94 | + mob:setMobMod(xi.mobMod.BASE_DAMAGE_MULTIPLIER, 200) |
| 95 | + mob:setMod(xi.mod.DOUBLE_ATTACK, 15) |
| 96 | + mob:setMod(xi.mod.DEF, 486) |
| 97 | + mob:setMod(xi.mod.ATT, 615) |
| 98 | + mob:setMod(xi.mod.REGAIN, 10) |
| 99 | + |
| 100 | + mob:setMod(xi.mod.FIRE_RES_RANK, 7) |
| 101 | + mob:setMod(xi.mod.ICE_RES_RANK, 7) |
| 102 | + mob:setMod(xi.mod.WIND_RES_RANK, 7) |
| 103 | + mob:setMod(xi.mod.EARTH_RES_RANK, 7) |
| 104 | + mob:setMod(xi.mod.THUNDER_RES_RANK, 7) |
| 105 | + mob:setMod(xi.mod.WATER_RES_RANK, 7) |
| 106 | + mob:setMod(xi.mod.LIGHT_RES_RANK, 7) |
| 107 | + mob:setMod(xi.mod.DARK_RES_RANK, 7) |
| 108 | + |
| 109 | + mob:setMod(xi.mod.BIND_RES_RANK, 7) |
| 110 | + mob:setMod(xi.mod.BLIND_RES_RANK, 7) |
| 111 | + mob:setMod(xi.mod.GRAVITY_RES_RANK, 7) |
| 112 | + mob:setMod(xi.mod.PARALYZE_RES_RANK, 7) |
| 113 | + mob:setMod(xi.mod.POISON_RES_RANK, 7) |
| 114 | + mob:setMod(xi.mod.SLOW_RES_RANK, 7) |
| 115 | + |
| 116 | + mob:setMod(xi.mod.UDMGBREATH, -1250) |
| 117 | + mob:setMod(xi.mod.UDMGMAGIC, -1250) |
| 118 | + |
| 119 | + mob:setMod(xi.mod.CURSE_MEVA, 1000) |
| 120 | +end |
| 121 | + |
| 122 | +entity.onMobRoam = function(mob) |
| 123 | + local currentTime = GetSystemTime() |
| 124 | + if currentTime < mob:getLocalVar('roarTimer') then |
| 125 | + return |
| 126 | + end |
| 127 | + |
| 128 | + mob:useMobAbility(xi.mobSkill.ROAR_CERBERUS) |
| 129 | + mob:setLocalVar('roarTimer', currentTime + math.random(150, 210)) |
11 | 130 | end |
12 | 131 |
|
13 | 132 | entity.onMobFight = function(mob, target) |
14 | | - local targetPos = target:getPos() |
15 | | - local spawnPos = mob:getSpawnPos() |
16 | | - local arenaBoundaries = |
17 | | - { |
18 | | - { { 335, -92 }, { 332, -94 } }, |
19 | | - } |
| 133 | + if mob:getHPP() > 25 then |
| 134 | + mob:setMod(xi.mod.REGAIN, 10) |
| 135 | + else |
| 136 | + mob:setMod(xi.mod.REGAIN, 60) |
| 137 | + end |
20 | 138 |
|
21 | | - local drawInPositions = |
22 | | - { |
23 | | - { 330.166, -23.909, -89.456, targetPos.rot }, |
24 | | - { 314.186, -24.180, -89.331, targetPos.rot }, |
25 | | - { 314.372, -23.985, -82.1, targetPos.rot }, |
26 | | - { 321.629, -24, -90.936, targetPos.rot }, |
27 | | - { 329.969, -24, -73.665, targetPos.rot }, |
28 | | - { 322.330, -24, -82.168, targetPos.rot }, |
29 | | - { 331.026, -24, -81.093, targetPos.rot }, |
30 | | - { 321.795, -23.978, -73.724, targetPos.rot }, |
31 | | - } |
| 139 | + if |
| 140 | + target:getZPos() <= -70 and |
| 141 | + target:getXPos() >= 310 and |
| 142 | + utils.sameSideOfLine({ { 335, -92 }, { 332, -94 } }, target:getPos(), mob:getSpawnPos()) |
| 143 | + then |
| 144 | + mob:setMobMod(xi.mobMod.NO_MOVE, 0) |
| 145 | + return |
| 146 | + end |
| 147 | + |
| 148 | + mob:setMobMod(xi.mobMod.NO_MOVE, 1) |
32 | 149 |
|
33 | | - local drawInTable = |
| 150 | + local pos = utils.randomEntry(drawInPositions) |
| 151 | + utils.drawIn(target, { position = { pos[1], pos[2], pos[3], target:getRotPos() }, wait = 2 }) |
| 152 | +end |
| 153 | + |
| 154 | +entity.onMobMobskillChoose = function(mob, target, skillId) |
| 155 | + local skillList = |
34 | 156 | { |
35 | | - conditions = |
36 | | - { |
37 | | - target:getZPos() > -70, |
38 | | - target:getXPos() < 310, |
39 | | - not utils.sameSideOfLine(arenaBoundaries[1], targetPos, spawnPos), |
40 | | - }, |
41 | | - position = utils.randomEntry(drawInPositions), |
42 | | - wait = 2, |
| 157 | + xi.mobSkill.ULULATION, |
| 158 | + xi.mobSkill.MAGMA_HOPLON, |
43 | 159 | } |
44 | | - for _, condition in ipairs(drawInTable.conditions) do |
45 | | - if condition then |
46 | | - mob:setMobMod(xi.mobMod.NO_MOVE, 1) |
47 | | - utils.drawIn(target, drawInTable) |
48 | | - break |
49 | | - else |
50 | | - mob:setMobMod(xi.mobMod.NO_MOVE, 0) |
51 | | - end |
| 160 | + |
| 161 | + if target:isInfront(mob, 128) then |
| 162 | + table.insert(skillList, xi.mobSkill.LAVA_SPIT) |
| 163 | + table.insert(skillList, xi.mobSkill.SULFUROUS_BREATH) |
| 164 | + table.insert(skillList, xi.mobSkill.SCORCHING_LASH) |
52 | 165 | end |
53 | 166 |
|
54 | | - if mob:getHPP() > 25 then |
55 | | - mob:setMod(xi.mod.REGAIN, 10) |
56 | | - else |
57 | | - mob:setMod(xi.mod.REGAIN, 70) |
| 167 | + if mob:getHPP() < 25 then |
| 168 | + table.insert(skillList, xi.mobSkill.GATES_OF_HADES) |
58 | 169 | end |
| 170 | + |
| 171 | + return skillList[math.randomInt(1, #skillList)] |
59 | 172 | end |
60 | 173 |
|
61 | 174 | entity.onMobDisengage = function(mob) |
|
0 commit comments