warscript 0.0.1-dev.d1328b7 → 0.0.1-dev.d1499df
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.d.ts +6 -0
- package/attributes.lua +17 -1
- package/config.d.ts +5 -0
- package/config.lua +10 -0
- package/core/types/effect.d.ts +14 -6
- package/core/types/effect.lua +131 -35
- package/core/types/frame.d.ts +3 -0
- package/core/types/frame.lua +83 -21
- package/core/types/player.d.ts +15 -0
- package/core/types/player.lua +56 -14
- package/core/types/playerCamera.d.ts +2 -0
- package/core/types/playerCamera.lua +123 -5
- package/core/types/sound.d.ts +17 -24
- package/core/types/sound.lua +99 -24
- package/core/types/tileCell.d.ts +11 -1
- package/core/types/tileCell.lua +97 -0
- package/core/types/timer.d.ts +9 -8
- package/core/types/timer.lua +45 -23
- package/core/util.d.ts +1 -1
- package/core/util.lua +12 -1
- package/decl/native.d.ts +846 -790
- package/engine/behavior.d.ts +5 -0
- package/engine/behavior.lua +106 -27
- package/engine/behaviour/ability/always-enabled.d.ts +7 -0
- package/engine/behaviour/ability/always-enabled.lua +31 -0
- package/engine/behaviour/ability/apply-buff.d.ts +5 -0
- package/engine/behaviour/ability/apply-buff.lua +32 -0
- package/engine/behaviour/ability/apply-unit-behavior.lua +1 -0
- package/engine/behaviour/ability/damage.d.ts +9 -3
- package/engine/behaviour/ability/damage.lua +26 -38
- package/engine/behaviour/ability/emulate-impact.d.ts +6 -0
- package/engine/behaviour/ability/emulate-impact.lua +43 -0
- package/engine/behaviour/ability/instant-impact.d.ts +2 -2
- package/engine/behaviour/ability/instant-impact.lua +4 -19
- package/engine/behaviour/ability/on-command-impact.d.ts +8 -0
- package/engine/behaviour/ability/on-command-impact.lua +25 -0
- package/engine/behaviour/ability/remove-buffs.d.ts +25 -0
- package/engine/behaviour/ability/remove-buffs.lua +49 -0
- package/engine/behaviour/ability/restore-mana.d.ts +1 -1
- package/engine/behaviour/ability/restore-mana.lua +6 -6
- package/engine/behaviour/ability.d.ts +20 -4
- package/engine/behaviour/ability.lua +111 -47
- package/engine/behaviour/unit/stun-immunity.d.ts +7 -3
- package/engine/behaviour/unit/stun-immunity.lua +52 -27
- package/engine/behaviour/unit.d.ts +34 -0
- package/engine/behaviour/unit.lua +190 -4
- package/engine/buff.d.ts +72 -45
- package/engine/buff.lua +357 -241
- package/engine/internal/ability.d.ts +20 -3
- package/engine/internal/ability.lua +126 -13
- package/engine/internal/item/ability.lua +162 -4
- package/engine/internal/item+owner.lua +12 -6
- package/engine/internal/item.d.ts +20 -19
- package/engine/internal/item.lua +191 -74
- package/engine/internal/mechanics/ability-duration.lua +1 -1
- package/engine/internal/misc/ability-disable-counter.d.ts +2 -0
- package/engine/internal/misc/ability-disable-counter.lua +13 -0
- package/engine/internal/misc/damage-metadata-by-target.d.ts +2 -0
- package/engine/internal/misc/damage-metadata-by-target.lua +5 -0
- package/engine/internal/misc/frame-coordinates.d.ts +2 -0
- package/engine/internal/misc/frame-coordinates.lua +21 -0
- package/engine/internal/misc/get-terrain-z.d.ts +2 -0
- package/engine/internal/misc/get-terrain-z.lua +11 -0
- package/engine/internal/misc/player-local-handle.d.ts +2 -0
- package/engine/internal/misc/player-local-handle.lua +5 -0
- package/engine/internal/object-data/auto-attack-speed-increase.d.ts +1 -1
- package/engine/internal/object-data/auto-attack-speed-increase.lua +2 -0
- package/engine/internal/object-data/evasion-probability.d.ts +2 -0
- package/engine/internal/object-data/evasion-probability.lua +16 -0
- package/engine/internal/unit/ability.d.ts +45 -1
- package/engine/internal/unit/ability.lua +128 -17
- package/engine/internal/unit/add-item-to-slot-init.d.ts +2 -0
- package/engine/internal/unit/add-item-to-slot-init.lua +23 -0
- package/engine/internal/unit/add-item-to-slot.d.ts +2 -0
- package/engine/internal/unit/add-item-to-slot.lua +52 -0
- package/engine/internal/unit/allowed-targets.d.ts +1 -1
- package/engine/internal/unit/allowed-targets.lua +9 -1
- package/engine/internal/unit/bonus.d.ts +2 -0
- package/engine/internal/unit/bonus.lua +17 -0
- package/engine/internal/unit/fly-height.d.ts +7 -0
- package/engine/internal/unit/fly-height.lua +20 -0
- package/engine/internal/unit/ignore-events-items.d.ts +2 -0
- package/engine/internal/unit/ignore-events-items.lua +5 -0
- package/engine/internal/unit/item.d.ts +1 -0
- package/engine/internal/unit/item.lua +8 -4
- package/engine/internal/unit/main-selected.d.ts +6 -0
- package/engine/internal/unit/main-selected.lua +18 -22
- package/engine/internal/unit/order.d.ts +20 -0
- package/engine/internal/unit/order.lua +136 -0
- package/engine/internal/unit+ability.lua +10 -1
- package/engine/internal/unit+damage.d.ts +2 -11
- package/engine/internal/unit+damage.lua +10 -14
- package/engine/internal/unit+spellSteal.lua +1 -2
- package/engine/internal/unit-missile-launch.lua +45 -14
- package/engine/internal/unit.d.ts +50 -15
- package/engine/internal/unit.lua +413 -170
- package/engine/internal/utility.lua +12 -0
- package/engine/lightning.d.ts +12 -5
- package/engine/lightning.lua +48 -14
- package/engine/local-client.d.ts +2 -0
- package/engine/local-client.lua +30 -0
- package/engine/object-data/auxiliary/animation-name.d.ts +1 -0
- package/engine/object-data/auxiliary/animation-name.lua +16 -0
- package/engine/object-data/auxiliary/armor-type.d.ts +11 -0
- package/engine/object-data/auxiliary/armor-type.lua +46 -0
- package/engine/object-data/auxiliary/attachment-preset.d.ts +7 -2
- package/engine/object-data/auxiliary/attachment-preset.lua +4 -3
- package/engine/object-data/auxiliary/attack-type.d.ts +7 -8
- package/engine/object-data/auxiliary/attack-type.lua +42 -0
- package/engine/object-data/auxiliary/movement-type.d.ts +7 -7
- package/engine/object-data/auxiliary/movement-type.lua +22 -0
- package/engine/object-data/auxiliary/sound-eax.d.ts +10 -0
- package/engine/object-data/auxiliary/sound-eax.lua +2 -0
- package/engine/object-data/auxiliary/sound-preset-name.d.ts +5 -1
- package/engine/object-data/auxiliary/tech-tree-dependency.d.ts +1 -1
- package/engine/object-data/auxiliary/unit-attribute.d.ts +6 -0
- package/engine/object-data/auxiliary/unit-attribute.lua +9 -0
- package/engine/object-data/entry/ability-type/berserk.d.ts +2 -0
- package/engine/object-data/entry/ability-type/berserk.lua +13 -0
- package/engine/object-data/entry/ability-type/blank-configurable.lua +12 -1
- package/engine/object-data/entry/ability-type/carrion-swarm.d.ts +14 -0
- package/engine/object-data/entry/ability-type/carrion-swarm.lua +65 -0
- package/engine/object-data/entry/ability-type/disease-cloud.lua +2 -2
- package/engine/object-data/entry/ability-type/engineering-upgrade.lua +2 -2
- package/engine/object-data/entry/ability-type/ensnare.d.ts +12 -0
- package/engine/object-data/entry/ability-type/ensnare.lua +52 -0
- package/engine/object-data/entry/ability-type/feral-spirit.lua +2 -2
- package/engine/object-data/entry/ability-type/permanent-invisibility.d.ts +8 -0
- package/engine/object-data/entry/ability-type/permanent-invisibility.lua +26 -0
- package/engine/object-data/entry/ability-type/phase-shift.d.ts +10 -0
- package/engine/object-data/entry/ability-type/phase-shift.lua +39 -0
- package/engine/object-data/entry/ability-type/phoenix-morph.lua +4 -4
- package/engine/object-data/entry/ability-type/raise-dead.d.ts +17 -0
- package/engine/object-data/entry/ability-type/raise-dead.lua +78 -0
- package/engine/object-data/entry/ability-type/shock-wave.d.ts +4 -0
- package/engine/object-data/entry/ability-type/shock-wave.lua +26 -0
- package/engine/object-data/entry/ability-type/slow-poison.d.ts +10 -0
- package/engine/object-data/entry/ability-type/slow-poison.lua +58 -0
- package/engine/object-data/entry/ability-type/summon-quilbeast.lua +2 -2
- package/engine/object-data/entry/ability-type/summon-water-elemental.lua +2 -2
- package/engine/object-data/entry/ability-type/web.d.ts +12 -0
- package/engine/object-data/entry/ability-type/web.lua +52 -0
- package/engine/object-data/entry/ability-type.d.ts +19 -17
- package/engine/object-data/entry/ability-type.lua +93 -36
- package/engine/object-data/entry/buff-type/applicable.lua +18 -37
- package/engine/object-data/entry/buff-type.d.ts +6 -12
- package/engine/object-data/entry/buff-type.lua +13 -29
- package/engine/object-data/entry/destructible-type.d.ts +1 -1
- package/engine/object-data/entry/item-type.d.ts +3 -1
- package/engine/object-data/entry/item-type.lua +15 -2
- package/engine/object-data/entry/lightning-type.d.ts +1 -1
- package/engine/object-data/entry/sound-preset.d.ts +33 -0
- package/engine/object-data/entry/sound-preset.lua +140 -0
- package/engine/object-data/entry/unit-type.d.ts +21 -5
- package/engine/object-data/entry/unit-type.lua +214 -93
- package/engine/object-data/entry/upgrade.d.ts +1 -1
- package/engine/object-data/entry/upgrade.lua +4 -4
- package/engine/object-data/entry.d.ts +16 -14
- package/engine/object-data/entry.lua +60 -32
- package/engine/object-data/utility/object-data-entry-id-generator.lua +7 -0
- package/engine/object-field/ability.d.ts +12 -6
- package/engine/object-field/ability.lua +8 -4
- package/engine/object-field/unit.d.ts +61 -3
- package/engine/object-field/unit.lua +220 -7
- package/engine/object-field.d.ts +23 -6
- package/engine/object-field.lua +303 -114
- package/engine/random.d.ts +9 -0
- package/engine/random.lua +13 -0
- package/engine/standard/entries/buff-type.d.ts +3 -0
- package/engine/standard/entries/buff-type.lua +3 -0
- package/engine/standard/entries/sound-preset.d.ts +10 -0
- package/engine/standard/entries/sound-preset.lua +10 -0
- package/engine/standard/fields/ability.d.ts +2 -0
- package/engine/standard/fields/ability.lua +2 -0
- package/engine/standard/fields/unit.d.ts +5 -0
- package/engine/standard/fields/unit.lua +9 -0
- package/engine/synchronization.d.ts +11 -0
- package/engine/synchronization.lua +77 -0
- package/engine/text-tag.d.ts +36 -2
- package/engine/text-tag.lua +250 -10
- package/engine/unit.d.ts +3 -0
- package/engine/unit.lua +3 -0
- package/net/socket.lua +1 -1
- package/objutil/buff.lua +2 -3
- package/objutil/unit.lua +8 -0
- package/package.json +2 -2
- package/patch-lualib.lua +1 -1
- package/utility/arrays.d.ts +10 -1
- package/utility/arrays.lua +45 -3
- package/utility/callback-array.d.ts +17 -0
- package/utility/callback-array.lua +61 -0
- package/utility/functions.d.ts +8 -0
- package/utility/functions.lua +13 -0
- package/utility/lazy.d.ts +2 -0
- package/utility/lazy.lua +14 -0
- package/utility/linked-set.d.ts +2 -0
- package/utility/linked-set.lua +22 -1
- package/utility/lua-maps.d.ts +15 -2
- package/utility/lua-maps.lua +53 -2
- package/utility/lua-sets.d.ts +2 -0
- package/utility/lua-sets.lua +7 -0
- package/utility/reflection.lua +11 -7
- package/utility/types.d.ts +3 -0
- package/core/types/order.d.ts +0 -25
- package/core/types/order.lua +0 -55
package/engine/buff.lua
CHANGED
|
@@ -16,6 +16,7 @@ local internalApplyBuff = ____applicable.internalApplyBuff
|
|
|
16
16
|
local removeBuff = ____applicable.removeBuff
|
|
17
17
|
local ____ability = require("engine.internal.ability")
|
|
18
18
|
local Ability = ____ability.Ability
|
|
19
|
+
local UnitAbility = ____ability.UnitAbility
|
|
19
20
|
local ____ability = require("engine.object-field.ability")
|
|
20
21
|
local AbilityBooleanField = ____ability.AbilityBooleanField
|
|
21
22
|
local AbilityNumberField = ____ability.AbilityNumberField
|
|
@@ -28,13 +29,11 @@ local ____math = require("math")
|
|
|
28
29
|
local max = ____math.max
|
|
29
30
|
local min = ____math.min
|
|
30
31
|
local ____bonus = require("engine.internal.unit.bonus")
|
|
31
|
-
local addOrUpdateOrRemoveUnitBonus = ____bonus.addOrUpdateOrRemoveUnitBonus
|
|
32
|
-
local getUnitBonus = ____bonus.getUnitBonus
|
|
33
|
-
local removeUnitBonus = ____bonus.removeUnitBonus
|
|
34
32
|
local UnitBonusType = ____bonus.UnitBonusType
|
|
35
33
|
local ____area_2Ddamage = require("engine.internal.mechanics.area-damage")
|
|
36
34
|
local damageArea = ____area_2Ddamage.damageArea
|
|
37
35
|
local ____preconditions = require("utility.preconditions")
|
|
36
|
+
local check = ____preconditions.check
|
|
38
37
|
local checkNotNull = ____preconditions.checkNotNull
|
|
39
38
|
local ____effect = require("core.types.effect")
|
|
40
39
|
local Effect = ____effect.Effect
|
|
@@ -44,8 +43,16 @@ local ____unit = require("engine.behaviour.unit")
|
|
|
44
43
|
local UnitBehavior = ____unit.UnitBehavior
|
|
45
44
|
local ____arrays = require("utility.arrays")
|
|
46
45
|
local forEach = ____arrays.forEach
|
|
46
|
+
local ____event = require("event")
|
|
47
|
+
local Event = ____event.Event
|
|
47
48
|
local ____ability_2Dduration = require("engine.internal.mechanics.ability-duration")
|
|
48
49
|
local getAbilityDuration = ____ability_2Dduration.getAbilityDuration
|
|
50
|
+
local ____item = require("engine.internal.item")
|
|
51
|
+
local Item = ____item.Item
|
|
52
|
+
local ____destructable = require("core.types.destructable")
|
|
53
|
+
local Destructable = ____destructable.Destructable
|
|
54
|
+
local ____ability = require("engine.standard.fields.ability")
|
|
55
|
+
local COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD = ____ability.COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD
|
|
49
56
|
local getUnitAbility = BlzGetUnitAbility
|
|
50
57
|
local stringValueByBuffTypeIdByFieldId = postcompile(function()
|
|
51
58
|
local stringValueByBuffTypeIdByFieldId = {}
|
|
@@ -94,12 +101,15 @@ local buffParametersKeys = {
|
|
|
94
101
|
armorIncreaseFactor = true,
|
|
95
102
|
attackSpeedIncreaseFactor = true,
|
|
96
103
|
movementSpeedIncreaseFactor = true,
|
|
104
|
+
evasionProbability = true,
|
|
105
|
+
missProbability = true,
|
|
97
106
|
damageFactor = true,
|
|
98
107
|
receivedDamageFactor = true,
|
|
99
108
|
receivedMagicDamageFactor = true,
|
|
100
109
|
durationIncreaseOnAutoAttack = true,
|
|
101
110
|
maximumDuration = true,
|
|
102
111
|
maximumRemainingDuration = true,
|
|
112
|
+
turnsIntoGhost = true,
|
|
103
113
|
stuns = true,
|
|
104
114
|
ignoresStunImmunity = true,
|
|
105
115
|
providesStunImmunity = true,
|
|
@@ -114,7 +124,8 @@ local buffParametersKeys = {
|
|
|
114
124
|
damageOnExpiration = true,
|
|
115
125
|
healingOnExpiration = true,
|
|
116
126
|
killsOnExpiration = true,
|
|
117
|
-
explodesOnExpiration = true
|
|
127
|
+
explodesOnExpiration = true,
|
|
128
|
+
abilityCooldownFactor = true
|
|
118
129
|
}
|
|
119
130
|
local function resolveEnumValue(ability, level, value)
|
|
120
131
|
if value == nil or type(value) == "number" then
|
|
@@ -165,6 +176,7 @@ local function resolveAndSetNumberValue(buff, property, ability, level, value, d
|
|
|
165
176
|
end
|
|
166
177
|
end
|
|
167
178
|
local buffBooleanParameters = {
|
|
179
|
+
"turnsIntoGhost",
|
|
168
180
|
"stuns",
|
|
169
181
|
"ignoresStunImmunity",
|
|
170
182
|
"disablesAutoAttack",
|
|
@@ -176,6 +188,7 @@ local buffNumberParameters = {
|
|
|
176
188
|
"durationIncreaseOnAutoAttack",
|
|
177
189
|
"attackSpeedIncreaseFactor",
|
|
178
190
|
"movementSpeedIncreaseFactor",
|
|
191
|
+
"evasionProbability",
|
|
179
192
|
"armorIncrease",
|
|
180
193
|
"damageFactor",
|
|
181
194
|
"receivedDamageFactor",
|
|
@@ -189,7 +202,8 @@ local buffNumberParameters = {
|
|
|
189
202
|
"healingPerInterval",
|
|
190
203
|
"healingOverDuration",
|
|
191
204
|
"damageOnExpiration",
|
|
192
|
-
"healingOnExpiration"
|
|
205
|
+
"healingOnExpiration",
|
|
206
|
+
"abilityCooldownFactor"
|
|
193
207
|
}
|
|
194
208
|
local unsuccessfulApplicationMarker = {}
|
|
195
209
|
local function selectBuffTypeIdWithLeastDuration(buffTypeIds, unit)
|
|
@@ -216,7 +230,7 @@ local function selectBuffTypeIdWithLeastDuration(buffTypeIds, unit)
|
|
|
216
230
|
return checkNotNull(firstNativeBuffTypeId)
|
|
217
231
|
end
|
|
218
232
|
local function destroyBuffIfItHasSameUniqueGroup(buff, uniqueGroup)
|
|
219
|
-
if buff[
|
|
233
|
+
if buff[104] == uniqueGroup then
|
|
220
234
|
buff:destroy()
|
|
221
235
|
end
|
|
222
236
|
end
|
|
@@ -224,17 +238,17 @@ local function destroyBuff(buff)
|
|
|
224
238
|
buff:destroy()
|
|
225
239
|
end
|
|
226
240
|
local function expireBuff(buff)
|
|
227
|
-
local remainingDamageOverDuration = buff[
|
|
228
|
-
local remainingHealingOverDuration = buff[
|
|
241
|
+
local remainingDamageOverDuration = buff[113] or 0
|
|
242
|
+
local remainingHealingOverDuration = buff[113] or 0
|
|
229
243
|
if remainingDamageOverDuration ~= 0 or remainingHealingOverDuration ~= 0 then
|
|
230
244
|
buff:flashSpecialEffect()
|
|
231
245
|
if remainingDamageOverDuration ~= 0 then
|
|
232
|
-
(buff[
|
|
233
|
-
buff[
|
|
246
|
+
(buff[102] or buff[101]):damageTarget(buff[101], remainingDamageOverDuration)
|
|
247
|
+
buff[113] = nil
|
|
234
248
|
end
|
|
235
249
|
if remainingHealingOverDuration ~= 0 then
|
|
236
|
-
(buff[
|
|
237
|
-
buff[
|
|
250
|
+
(buff[102] or buff[101]):healTarget(buff[101], remainingHealingOverDuration)
|
|
251
|
+
buff[118] = nil
|
|
238
252
|
end
|
|
239
253
|
end
|
|
240
254
|
Timer:run(destroyBuff, buff)
|
|
@@ -242,56 +256,58 @@ local function expireBuff(buff)
|
|
|
242
256
|
end
|
|
243
257
|
local function buffDamageIntervalInitialTimerCallback(buff)
|
|
244
258
|
buffDamageIntervalTimerCallback(buff)
|
|
245
|
-
local timer = buff[
|
|
246
|
-
local damageInterval = buff[
|
|
259
|
+
local timer = buff[114]
|
|
260
|
+
local damageInterval = buff[112]
|
|
247
261
|
if timer ~= nil and damageInterval ~= nil and damageInterval > 0 then
|
|
248
262
|
timer:start(damageInterval, true, buffDamageIntervalTimerCallback, buff)
|
|
249
263
|
end
|
|
250
264
|
end
|
|
251
265
|
buffDamageIntervalTimerCallback = function(buff)
|
|
252
266
|
buff:flashSpecialEffect()
|
|
253
|
-
local source = buff[
|
|
254
|
-
local remainingDamageOverDuration = buff[
|
|
267
|
+
local source = buff[102] or buff[101]
|
|
268
|
+
local remainingDamageOverDuration = buff[113] or 0
|
|
255
269
|
if remainingDamageOverDuration ~= 0 then
|
|
256
|
-
local damageInterval = buff[
|
|
270
|
+
local damageInterval = buff[112] or 0
|
|
257
271
|
if damageInterval ~= 0 then
|
|
258
272
|
local damage = remainingDamageOverDuration / (1 + buff.remainingDuration / damageInterval)
|
|
259
|
-
source:damageTarget(buff[
|
|
260
|
-
buff[
|
|
273
|
+
source:damageTarget(buff[101], damage)
|
|
274
|
+
buff[113] = remainingDamageOverDuration - damage
|
|
261
275
|
end
|
|
262
276
|
end
|
|
263
|
-
local damagePerInterval = buff[
|
|
277
|
+
local damagePerInterval = buff[111] or 0
|
|
264
278
|
if remainingDamageOverDuration == 0 or damagePerInterval ~= 0 then
|
|
265
|
-
source:damageTarget(buff[
|
|
279
|
+
source:damageTarget(buff[101], damagePerInterval)
|
|
266
280
|
end
|
|
267
281
|
end
|
|
268
282
|
local function buffHealingIntervalInitialTimerCallback(buff)
|
|
269
283
|
buffHealingIntervalTimerCallback(buff)
|
|
270
|
-
local timer = buff[
|
|
271
|
-
local healingInterval = buff[
|
|
284
|
+
local timer = buff[119]
|
|
285
|
+
local healingInterval = buff[117]
|
|
272
286
|
if timer ~= nil and healingInterval ~= nil and healingInterval > 0 then
|
|
273
287
|
timer:start(healingInterval, true, buffHealingIntervalTimerCallback, buff)
|
|
274
288
|
end
|
|
275
289
|
end
|
|
276
290
|
buffHealingIntervalTimerCallback = function(buff)
|
|
277
|
-
if buff[
|
|
291
|
+
if buff[117] ~= buff[112] then
|
|
278
292
|
buff:flashSpecialEffect()
|
|
279
293
|
end
|
|
280
|
-
local source = buff[
|
|
281
|
-
local remainingHealingOverDuration = buff[
|
|
294
|
+
local source = buff[102] or buff[101]
|
|
295
|
+
local remainingHealingOverDuration = buff[118] or 0
|
|
282
296
|
if remainingHealingOverDuration ~= 0 then
|
|
283
|
-
local healingInterval = buff[
|
|
297
|
+
local healingInterval = buff[117] or 0
|
|
284
298
|
if healingInterval ~= 0 then
|
|
285
299
|
local healing = remainingHealingOverDuration / (1 + buff.remainingDuration / healingInterval)
|
|
286
|
-
source:healTarget(buff[
|
|
287
|
-
buff[
|
|
300
|
+
source:healTarget(buff[101], healing)
|
|
301
|
+
buff[118] = remainingHealingOverDuration - healing
|
|
288
302
|
end
|
|
289
303
|
end
|
|
290
|
-
local healingPerInterval = buff[
|
|
304
|
+
local healingPerInterval = buff[116] or 0
|
|
291
305
|
if remainingHealingOverDuration == 0 or healingPerInterval ~= 0 then
|
|
292
|
-
source:healTarget(buff[
|
|
306
|
+
source:healTarget(buff[101], healingPerInterval)
|
|
293
307
|
end
|
|
294
308
|
end
|
|
309
|
+
local buffCreatedEvent = __TS__New(Event)
|
|
310
|
+
local buffBeingDestroyedEvent = __TS__New(Event)
|
|
295
311
|
____exports.Buff = __TS__Class()
|
|
296
312
|
local Buff = ____exports.Buff
|
|
297
313
|
Buff.name = "Buff"
|
|
@@ -300,7 +316,8 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
300
316
|
UnitBehavior.prototype.____constructor(self, _unit)
|
|
301
317
|
self._unit = _unit
|
|
302
318
|
self.parameters = nil
|
|
303
|
-
self[100] =
|
|
319
|
+
self[100] = 0
|
|
320
|
+
self[101] = _unit
|
|
304
321
|
local typeId
|
|
305
322
|
local polarity
|
|
306
323
|
local resistanceType
|
|
@@ -309,7 +326,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
309
326
|
typeId = selectBuffTypeIdWithLeastDuration(typeIdOrTypeIds, _unit)
|
|
310
327
|
polarity = resistanceTypeOrPolarity
|
|
311
328
|
resistanceType = abilityOrParametersOrResistanceType
|
|
312
|
-
if __TS__InstanceOf(parametersOrAbility, Ability) then
|
|
329
|
+
if __TS__InstanceOf(parametersOrAbility, Ability) or parametersOrAbility == nil then
|
|
313
330
|
ability = parametersOrAbility
|
|
314
331
|
else
|
|
315
332
|
ability = nil
|
|
@@ -319,7 +336,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
319
336
|
typeId = typeIdOrTypeIds
|
|
320
337
|
polarity = polarityOrTypeIdSelectionPolicy
|
|
321
338
|
resistanceType = resistanceTypeOrPolarity
|
|
322
|
-
if __TS__InstanceOf(abilityOrParametersOrResistanceType, Ability) then
|
|
339
|
+
if __TS__InstanceOf(abilityOrParametersOrResistanceType, Ability) or abilityOrParametersOrResistanceType == nil then
|
|
323
340
|
ability = abilityOrParametersOrResistanceType
|
|
324
341
|
parameters = parametersOrAbility
|
|
325
342
|
else
|
|
@@ -328,7 +345,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
328
345
|
end
|
|
329
346
|
end
|
|
330
347
|
self.typeId = typeId
|
|
331
|
-
if not __TS__InstanceOf(ability, Ability) then
|
|
348
|
+
if not (__TS__InstanceOf(ability, Ability) or ability == nil) then
|
|
332
349
|
parameters = ability
|
|
333
350
|
ability = nil
|
|
334
351
|
end
|
|
@@ -356,14 +373,19 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
356
373
|
end
|
|
357
374
|
self.polarity = resolveEnumValue(ability, level, polarity)
|
|
358
375
|
self.resistanceType = resolveEnumValue(ability, level, resistanceType)
|
|
376
|
+
local missProbability = parameters and parameters.missProbability or defaultParameters.missProbability
|
|
377
|
+
if missProbability ~= nil then
|
|
378
|
+
missProbability = resolveNumberValue(ability, level, missProbability)
|
|
379
|
+
self[142] = missProbability
|
|
380
|
+
end
|
|
359
381
|
local buffByTypeId = buffByTypeIdByUnit[_unit]
|
|
360
382
|
if buffByTypeId == nil then
|
|
361
383
|
buffByTypeId = {}
|
|
362
384
|
buffByTypeIdByUnit[_unit] = buffByTypeId
|
|
363
385
|
end
|
|
364
|
-
local
|
|
365
|
-
if
|
|
366
|
-
|
|
386
|
+
local ____opt_15 = buffByTypeId[typeId]
|
|
387
|
+
if ____opt_15 ~= nil then
|
|
388
|
+
____opt_15:destroy()
|
|
367
389
|
end
|
|
368
390
|
local uniqueGroup = parameters and parameters.uniqueGroup or defaultParameters and defaultParameters.uniqueGroup
|
|
369
391
|
if uniqueGroup ~= nil then
|
|
@@ -377,13 +399,16 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
377
399
|
level,
|
|
378
400
|
duration,
|
|
379
401
|
spellStealPriority,
|
|
380
|
-
learnLevelMinimum
|
|
402
|
+
learnLevelMinimum,
|
|
403
|
+
missProbability
|
|
381
404
|
) then
|
|
405
|
+
self[100] = 1
|
|
382
406
|
UnitBehavior.prototype.destroy(self)
|
|
383
407
|
error(unsuccessfulApplicationMarker, 0)
|
|
384
408
|
end
|
|
385
409
|
local handle = BlzGetUnitAbility(_unit.handle, typeId)
|
|
386
410
|
if handle == nil then
|
|
411
|
+
self[100] = 1
|
|
387
412
|
UnitBehavior.prototype.destroy(self)
|
|
388
413
|
error(unsuccessfulApplicationMarker, 0)
|
|
389
414
|
end
|
|
@@ -392,20 +417,20 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
392
417
|
self._level = level
|
|
393
418
|
self._spellStealPriority = spellStealPriority
|
|
394
419
|
self._learnLevelMinimum = learnLevelMinimum
|
|
395
|
-
self[
|
|
396
|
-
self[
|
|
397
|
-
self[
|
|
398
|
-
self[
|
|
399
|
-
self[
|
|
420
|
+
self[102] = source
|
|
421
|
+
self[103] = duration or 0
|
|
422
|
+
self[104] = uniqueGroup
|
|
423
|
+
self[105] = BlzGetAbilityStringLevelField(self.handle, ABILITY_SLF_EFFECT, 0)
|
|
424
|
+
self[106] = BlzGetAbilityStringLevelField(self.handle, ABILITY_SLF_SPECIAL, 0)
|
|
400
425
|
if parameters ~= nil or (next(defaultParameters)) ~= nil then
|
|
401
426
|
for ____, buffBooleanParameter in ipairs(buffBooleanParameters) do
|
|
402
|
-
local
|
|
403
|
-
local
|
|
404
|
-
local
|
|
405
|
-
if
|
|
406
|
-
|
|
427
|
+
local ____ability_24 = ability
|
|
428
|
+
local ____level_25 = level
|
|
429
|
+
local ____temp_23 = parameters and parameters[buffBooleanParameter]
|
|
430
|
+
if ____temp_23 == nil then
|
|
431
|
+
____temp_23 = defaultParameters[buffBooleanParameter]
|
|
407
432
|
end
|
|
408
|
-
if resolveBooleanValue(
|
|
433
|
+
if resolveBooleanValue(____ability_24, ____level_25, ____temp_23) then
|
|
409
434
|
self[buffBooleanParameter] = true
|
|
410
435
|
end
|
|
411
436
|
end
|
|
@@ -421,11 +446,11 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
421
446
|
end
|
|
422
447
|
local maximumDuration = parameters and parameters.maximumDuration or defaultParameters.maximumDuration
|
|
423
448
|
if maximumDuration ~= nil then
|
|
424
|
-
self[
|
|
449
|
+
self[108] = resolveNumberValue(ability, level, maximumDuration)
|
|
425
450
|
end
|
|
426
451
|
local maximumRemainingDuration = parameters and parameters.maximumRemainingDuration or defaultParameters.maximumRemainingDuration
|
|
427
452
|
if maximumRemainingDuration ~= nil then
|
|
428
|
-
self[
|
|
453
|
+
self[109] = resolveNumberValue(ability, level, maximumRemainingDuration)
|
|
429
454
|
end
|
|
430
455
|
local parametersAbilityTypeIds = parameters and parameters.abilityTypeIds or defaultParameters.abilityTypeIds
|
|
431
456
|
if parametersAbilityTypeIds ~= nil then
|
|
@@ -482,47 +507,57 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
482
507
|
timer:start(duration, false, expireBuff, self)
|
|
483
508
|
self._timer = timer
|
|
484
509
|
end
|
|
510
|
+
self:onCreate()
|
|
511
|
+
self[100] = 1
|
|
512
|
+
Event.invoke(buffCreatedEvent, self)
|
|
485
513
|
end
|
|
486
|
-
function Buff.prototype.
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
514
|
+
function Buff.prototype.onAbilityGained(self, ability)
|
|
515
|
+
if __TS__InstanceOf(ability, UnitAbility) then
|
|
516
|
+
local abilityCooldownModifier = self[144]
|
|
517
|
+
if abilityCooldownModifier then
|
|
518
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:applyModifier(ability, abilityCooldownModifier)
|
|
519
|
+
end
|
|
520
|
+
end
|
|
490
521
|
end
|
|
491
|
-
function Buff.prototype.
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
522
|
+
function Buff.prototype.onAbilityLost(self, ability)
|
|
523
|
+
if __TS__InstanceOf(ability, UnitAbility) then
|
|
524
|
+
local abilityCooldownModifier = self[144]
|
|
525
|
+
if abilityCooldownModifier then
|
|
526
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:removeModifier(ability, abilityCooldownModifier)
|
|
527
|
+
end
|
|
496
528
|
end
|
|
497
|
-
bonusIdByBonusType[bonusType] = addOrUpdateOrRemoveUnitBonus(self._unit, bonusType, bonusIdByBonusType[bonusType], value)
|
|
498
529
|
end
|
|
499
|
-
function Buff.prototype.flashEffect(self,
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
local ____Effect_flash_41 = Effect.flash
|
|
503
|
-
local ____array_39 = __TS__SparseArrayNew(
|
|
504
|
-
self[104],
|
|
505
|
-
isWidgetProvided and widgetOrDuration or self._unit,
|
|
506
|
-
stringValueByBuffTypeIdByFieldId[fourCC("feft")][self.typeId] or "origin"
|
|
507
|
-
)
|
|
508
|
-
local ____isWidgetProvided_38
|
|
509
|
-
if isWidgetProvided then
|
|
510
|
-
____isWidgetProvided_38 = duration
|
|
530
|
+
function Buff.prototype.flashEffect(self, widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
531
|
+
if type(widgetOrXOrParametersOrDuration) == "number" and type(yOrParametersOrDuration) == "number" then
|
|
532
|
+
Effect:flash(self[105], widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
511
533
|
else
|
|
512
|
-
|
|
534
|
+
local isWidgetProvided = __TS__InstanceOf(widgetOrXOrParametersOrDuration, Unit) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Item) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Destructable)
|
|
535
|
+
local ____Effect_40 = Effect
|
|
536
|
+
local ____Effect_flash_41 = Effect.flash
|
|
537
|
+
local ____array_39 = __TS__SparseArrayNew(
|
|
538
|
+
self[105],
|
|
539
|
+
isWidgetProvided and widgetOrXOrParametersOrDuration or self._unit,
|
|
540
|
+
stringValueByBuffTypeIdByFieldId[fourCC("feft")][self.typeId] or "origin"
|
|
541
|
+
)
|
|
542
|
+
local ____isWidgetProvided_38
|
|
543
|
+
if isWidgetProvided then
|
|
544
|
+
____isWidgetProvided_38 = yOrParametersOrDuration
|
|
545
|
+
else
|
|
546
|
+
____isWidgetProvided_38 = widgetOrXOrParametersOrDuration
|
|
547
|
+
end
|
|
548
|
+
__TS__SparseArrayPush(____array_39, ____isWidgetProvided_38)
|
|
549
|
+
____Effect_flash_41(
|
|
550
|
+
____Effect_40,
|
|
551
|
+
__TS__SparseArraySpread(____array_39)
|
|
552
|
+
)
|
|
513
553
|
end
|
|
514
|
-
__TS__SparseArrayPush(____array_39, ____isWidgetProvided_38)
|
|
515
|
-
____Effect_flash_41(
|
|
516
|
-
____Effect_40,
|
|
517
|
-
__TS__SparseArraySpread(____array_39)
|
|
518
|
-
)
|
|
519
554
|
end
|
|
520
555
|
function Buff.prototype.flashSpecialEffect(self, widgetOrDuration, duration)
|
|
521
556
|
local isWidgetProvided = type(widgetOrDuration) == "table"
|
|
522
557
|
local ____Effect_44 = Effect
|
|
523
558
|
local ____Effect_flash_45 = Effect.flash
|
|
524
559
|
local ____array_43 = __TS__SparseArrayNew(
|
|
525
|
-
self[
|
|
560
|
+
self[106],
|
|
526
561
|
isWidgetProvided and widgetOrDuration or self._unit,
|
|
527
562
|
stringValueByBuffTypeIdByFieldId[fourCC("fspt")][self.typeId] or "origin"
|
|
528
563
|
)
|
|
@@ -538,21 +573,25 @@ function Buff.prototype.flashSpecialEffect(self, widgetOrDuration, duration)
|
|
|
538
573
|
__TS__SparseArraySpread(____array_43)
|
|
539
574
|
)
|
|
540
575
|
end
|
|
576
|
+
function Buff.prototype.onCreate(self)
|
|
577
|
+
end
|
|
541
578
|
function Buff.prototype.onDestroy(self)
|
|
579
|
+
check(self[100] ~= 0, "Cannot destroy a buff that has not finished creating yet.")
|
|
580
|
+
self[100] = 2
|
|
542
581
|
local unit = self._unit
|
|
543
582
|
if getUnitAbility(unit.handle, self.typeId) == self.handle then
|
|
544
583
|
removeBuff(unit.handle, self.typeId)
|
|
545
584
|
end
|
|
546
585
|
buffByTypeIdByUnit[unit][self.typeId] = nil
|
|
547
|
-
local healingIntervalTimer = self[
|
|
586
|
+
local healingIntervalTimer = self[119]
|
|
548
587
|
if healingIntervalTimer ~= nil then
|
|
549
588
|
healingIntervalTimer:destroy()
|
|
550
|
-
self[
|
|
589
|
+
self[119] = nil
|
|
551
590
|
end
|
|
552
|
-
local damageIntervalTimer = self[
|
|
591
|
+
local damageIntervalTimer = self[114]
|
|
553
592
|
if damageIntervalTimer ~= nil then
|
|
554
593
|
damageIntervalTimer:destroy()
|
|
555
|
-
self[
|
|
594
|
+
self[114] = nil
|
|
556
595
|
end
|
|
557
596
|
if self._timer ~= nil then
|
|
558
597
|
self._timer:destroy()
|
|
@@ -562,25 +601,34 @@ function Buff.prototype.onDestroy(self)
|
|
|
562
601
|
behavior:destroy()
|
|
563
602
|
end
|
|
564
603
|
end
|
|
565
|
-
|
|
604
|
+
local previousAbilityCooldownModifier = self[144]
|
|
605
|
+
if previousAbilityCooldownModifier then
|
|
606
|
+
for ____, ability in ipairs(self._unit.abilities) do
|
|
607
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:removeModifier(ability, previousAbilityCooldownModifier)
|
|
608
|
+
end
|
|
609
|
+
end
|
|
610
|
+
if self[139] then
|
|
611
|
+
unit:decrementInvulnerabilityCounter()
|
|
612
|
+
end
|
|
613
|
+
if self[138] then
|
|
566
614
|
unit:decrementDisableAutoAttackCounter()
|
|
567
615
|
end
|
|
568
|
-
if self[
|
|
569
|
-
if self[
|
|
570
|
-
unit:
|
|
616
|
+
if self[136] then
|
|
617
|
+
if self[137] then
|
|
618
|
+
unit:decrementForceStunCounter()
|
|
571
619
|
end
|
|
572
620
|
unit:decrementStunCounter()
|
|
573
621
|
end
|
|
622
|
+
if self[135] then
|
|
623
|
+
unit:decrementGhostCounter()
|
|
624
|
+
end
|
|
574
625
|
if self._abilityTypeIds ~= nil then
|
|
575
626
|
for abilityTypeId in pairs(self._abilityTypeIds) do
|
|
576
627
|
unit:removeAbility(abilityTypeId)
|
|
577
628
|
end
|
|
578
629
|
end
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
removeUnitBonus(unit, bonusType, bonusId)
|
|
582
|
-
end
|
|
583
|
-
end
|
|
630
|
+
Event.invoke(buffBeingDestroyedEvent, self)
|
|
631
|
+
self[100] = 3
|
|
584
632
|
return UnitBehavior.prototype.onDestroy(self)
|
|
585
633
|
end
|
|
586
634
|
function Buff.apply(self, ...)
|
|
@@ -617,72 +665,72 @@ function Buff.getByTypeId(self, unit, typeId)
|
|
|
617
665
|
end
|
|
618
666
|
function Buff.prototype.onExpiration(self)
|
|
619
667
|
local unit = self.unit
|
|
620
|
-
if self[119] ~= nil then
|
|
621
|
-
(self[101] or unit):damageTarget(unit, self[119] or 0)
|
|
622
|
-
end
|
|
623
668
|
if self[120] ~= nil then
|
|
624
|
-
(self[
|
|
669
|
+
(self[102] or unit):damageTarget(unit, self[120] or 0)
|
|
625
670
|
end
|
|
626
|
-
if self[
|
|
671
|
+
if self[121] ~= nil then
|
|
672
|
+
(self[102] or unit):healTarget(unit, self[120] or 0)
|
|
673
|
+
end
|
|
674
|
+
if self[141] then
|
|
627
675
|
unit:explode()
|
|
628
|
-
elseif self[
|
|
676
|
+
elseif self[140] then
|
|
629
677
|
unit:kill()
|
|
630
678
|
end
|
|
631
679
|
end
|
|
632
680
|
function Buff.prototype.onDeath(self, source)
|
|
633
681
|
local unit = self.unit
|
|
634
|
-
if self[
|
|
682
|
+
if self[122] ~= nil then
|
|
635
683
|
damageArea(
|
|
636
|
-
self[
|
|
637
|
-
self[
|
|
684
|
+
self[102] or unit,
|
|
685
|
+
self[122],
|
|
638
686
|
unit.x,
|
|
639
687
|
unit.y,
|
|
688
|
+
self[124] or 0,
|
|
640
689
|
self[123] or 0,
|
|
641
|
-
self[
|
|
690
|
+
self[126] or 0,
|
|
642
691
|
self[125] or 0,
|
|
643
|
-
self[
|
|
644
|
-
self[127] or 0
|
|
645
|
-
self[126] or 0
|
|
692
|
+
self[128] or 0,
|
|
693
|
+
self[127] or 0
|
|
646
694
|
)
|
|
647
695
|
end
|
|
648
696
|
end
|
|
649
697
|
function Buff.prototype.onDamageDealt(self, target, event)
|
|
650
698
|
if event.isAttack then
|
|
651
|
-
if self[
|
|
652
|
-
local durationIncrease = self[
|
|
653
|
-
local maximumDuration = self[
|
|
699
|
+
if self[107] ~= nil then
|
|
700
|
+
local durationIncrease = self[107]
|
|
701
|
+
local maximumDuration = self[108] or 0
|
|
654
702
|
if maximumDuration > 0 then
|
|
655
703
|
durationIncrease = min(
|
|
656
704
|
durationIncrease,
|
|
657
|
-
max(0, maximumDuration - self[
|
|
705
|
+
max(0, maximumDuration - self[103])
|
|
658
706
|
)
|
|
659
707
|
end
|
|
660
708
|
local remainingDuration = self.remainingDuration + durationIncrease
|
|
661
|
-
local maximumRemainingDuration = self[
|
|
709
|
+
local maximumRemainingDuration = self[109] or 0
|
|
662
710
|
if maximumRemainingDuration > 0 then
|
|
663
711
|
remainingDuration = min(remainingDuration, maximumRemainingDuration)
|
|
664
712
|
end
|
|
665
713
|
self.remainingDuration = remainingDuration
|
|
666
714
|
end
|
|
667
|
-
local autoAttackCount = (self[
|
|
668
|
-
self[
|
|
669
|
-
if autoAttackCount == self[
|
|
715
|
+
local autoAttackCount = (self[129] or 0) + 1
|
|
716
|
+
self[129] = autoAttackCount
|
|
717
|
+
if autoAttackCount == self[130] then
|
|
670
718
|
self:destroy()
|
|
671
719
|
end
|
|
672
720
|
end
|
|
673
721
|
if event.originalAmount ~= 0 then
|
|
674
|
-
local damageDealtEventCount = (self[
|
|
675
|
-
self[
|
|
676
|
-
if damageDealtEventCount == self[
|
|
722
|
+
local damageDealtEventCount = (self[131] or 0) + 1
|
|
723
|
+
self[131] = damageDealtEventCount
|
|
724
|
+
if damageDealtEventCount == self[132] then
|
|
677
725
|
self:destroy()
|
|
678
726
|
end
|
|
679
727
|
end
|
|
680
728
|
end
|
|
681
729
|
function Buff.prototype.onDamageReceived(self, source, event)
|
|
682
730
|
if event.originalAmount ~= 0 then
|
|
683
|
-
local damageReceivedEventCount = (self[
|
|
684
|
-
self[
|
|
685
|
-
if damageReceivedEventCount == self[
|
|
731
|
+
local damageReceivedEventCount = (self[133] or 0) + 1
|
|
732
|
+
self[133] = damageReceivedEventCount
|
|
733
|
+
if damageReceivedEventCount == self[134] then
|
|
686
734
|
self:destroy()
|
|
687
735
|
end
|
|
688
736
|
end
|
|
@@ -692,7 +740,7 @@ __TS__SetDescriptor(
|
|
|
692
740
|
Buff.prototype,
|
|
693
741
|
"source",
|
|
694
742
|
{get = function(self)
|
|
695
|
-
return self[
|
|
743
|
+
return self[102] or self._unit
|
|
696
744
|
end},
|
|
697
745
|
true
|
|
698
746
|
)
|
|
@@ -709,13 +757,13 @@ __TS__SetDescriptor(
|
|
|
709
757
|
"remainingDamageOverDuration",
|
|
710
758
|
{
|
|
711
759
|
get = function(self)
|
|
712
|
-
return self[
|
|
760
|
+
return self[113] or 0
|
|
713
761
|
end,
|
|
714
762
|
set = function(self, remainingDamageOverDuration)
|
|
715
|
-
local remainingDamageOverDurationDelta = remainingDamageOverDuration - (self[
|
|
716
|
-
self[
|
|
717
|
-
local damageOverDuration = (self[
|
|
718
|
-
self[
|
|
763
|
+
local remainingDamageOverDurationDelta = remainingDamageOverDuration - (self[113] or 0)
|
|
764
|
+
self[113] = remainingDamageOverDuration ~= 0 and remainingDamageOverDuration or nil
|
|
765
|
+
local damageOverDuration = (self[110] or 0) + remainingDamageOverDurationDelta
|
|
766
|
+
self[110] = damageOverDuration ~= 0 and damageOverDuration or nil
|
|
719
767
|
end
|
|
720
768
|
},
|
|
721
769
|
true
|
|
@@ -725,13 +773,13 @@ __TS__SetDescriptor(
|
|
|
725
773
|
"damageOverDuration",
|
|
726
774
|
{
|
|
727
775
|
get = function(self)
|
|
728
|
-
return self[
|
|
776
|
+
return self[110] or 0
|
|
729
777
|
end,
|
|
730
778
|
set = function(self, damageOverDuration)
|
|
731
|
-
local damageOverDurationDelta = damageOverDuration - (self[
|
|
732
|
-
self[
|
|
733
|
-
local remainingDamageOverDuration = (self[
|
|
734
|
-
self[
|
|
779
|
+
local damageOverDurationDelta = damageOverDuration - (self[110] or 0)
|
|
780
|
+
self[110] = damageOverDuration ~= 0 and damageOverDuration or nil
|
|
781
|
+
local remainingDamageOverDuration = (self[113] or 0) + damageOverDurationDelta
|
|
782
|
+
self[113] = remainingDamageOverDuration ~= 0 and remainingDamageOverDuration or nil
|
|
735
783
|
end
|
|
736
784
|
},
|
|
737
785
|
true
|
|
@@ -741,10 +789,10 @@ __TS__SetDescriptor(
|
|
|
741
789
|
"damagePerInterval",
|
|
742
790
|
{
|
|
743
791
|
get = function(self)
|
|
744
|
-
return self[
|
|
792
|
+
return self[111] or 0
|
|
745
793
|
end,
|
|
746
794
|
set = function(self, damagePerInterval)
|
|
747
|
-
self[
|
|
795
|
+
self[111] = damagePerInterval ~= 0 and damagePerInterval or nil
|
|
748
796
|
end
|
|
749
797
|
},
|
|
750
798
|
true
|
|
@@ -754,25 +802,25 @@ __TS__SetDescriptor(
|
|
|
754
802
|
"damageInterval",
|
|
755
803
|
{
|
|
756
804
|
get = function(self)
|
|
757
|
-
return self[
|
|
805
|
+
return self[112] or 0
|
|
758
806
|
end,
|
|
759
807
|
set = function(self, damageInterval)
|
|
760
808
|
if damageInterval <= 0 then
|
|
761
|
-
self[
|
|
762
|
-
local timer = self[
|
|
809
|
+
self[112] = damageInterval ~= 0 and damageInterval or nil
|
|
810
|
+
local timer = self[114]
|
|
763
811
|
if timer ~= nil then
|
|
764
812
|
timer:destroy()
|
|
765
|
-
self[
|
|
813
|
+
self[114] = nil
|
|
766
814
|
end
|
|
767
815
|
return
|
|
768
816
|
end
|
|
769
|
-
self[
|
|
817
|
+
self[112] = damageInterval
|
|
770
818
|
local ____opt_48 = self._timer
|
|
771
819
|
local elapsed = ____opt_48 and ____opt_48.elapsed or 0
|
|
772
|
-
local timer = self[
|
|
820
|
+
local timer = self[114]
|
|
773
821
|
if timer == nil then
|
|
774
822
|
timer = Timer:create()
|
|
775
|
-
self[
|
|
823
|
+
self[114] = timer
|
|
776
824
|
end
|
|
777
825
|
local initialDelay = damageInterval - (elapsed >= damageInterval and math.fmod(elapsed, damageInterval) or elapsed)
|
|
778
826
|
if initialDelay == damageInterval then
|
|
@@ -789,13 +837,13 @@ __TS__SetDescriptor(
|
|
|
789
837
|
"remainingHealingOverDuration",
|
|
790
838
|
{
|
|
791
839
|
get = function(self)
|
|
792
|
-
return self[
|
|
840
|
+
return self[118] or 0
|
|
793
841
|
end,
|
|
794
842
|
set = function(self, remainingHealingOverDuration)
|
|
795
|
-
local remainingHealingOverDurationDelta = remainingHealingOverDuration - (self[
|
|
796
|
-
self[
|
|
797
|
-
local healingOverDuration = (self[
|
|
798
|
-
self[
|
|
843
|
+
local remainingHealingOverDurationDelta = remainingHealingOverDuration - (self[118] or 0)
|
|
844
|
+
self[113] = remainingHealingOverDuration ~= 0 and remainingHealingOverDuration or nil
|
|
845
|
+
local healingOverDuration = (self[115] or 0) + remainingHealingOverDurationDelta
|
|
846
|
+
self[115] = healingOverDuration ~= 0 and healingOverDuration or nil
|
|
799
847
|
end
|
|
800
848
|
},
|
|
801
849
|
true
|
|
@@ -805,13 +853,13 @@ __TS__SetDescriptor(
|
|
|
805
853
|
"healingOverDuration",
|
|
806
854
|
{
|
|
807
855
|
get = function(self)
|
|
808
|
-
return self[
|
|
856
|
+
return self[115] or 0
|
|
809
857
|
end,
|
|
810
858
|
set = function(self, healingOverDuration)
|
|
811
|
-
local healingOverDurationDelta = healingOverDuration - (self[
|
|
812
|
-
self[
|
|
813
|
-
local remainingHealingOverDuration = (self[
|
|
814
|
-
self[
|
|
859
|
+
local healingOverDurationDelta = healingOverDuration - (self[115] or 0)
|
|
860
|
+
self[115] = healingOverDuration ~= 0 and healingOverDuration or nil
|
|
861
|
+
local remainingHealingOverDuration = (self[118] or 0) + healingOverDurationDelta
|
|
862
|
+
self[118] = remainingHealingOverDuration ~= 0 and remainingHealingOverDuration or nil
|
|
815
863
|
end
|
|
816
864
|
},
|
|
817
865
|
true
|
|
@@ -821,10 +869,10 @@ __TS__SetDescriptor(
|
|
|
821
869
|
"healingPerInterval",
|
|
822
870
|
{
|
|
823
871
|
get = function(self)
|
|
824
|
-
return self[
|
|
872
|
+
return self[116] or 0
|
|
825
873
|
end,
|
|
826
874
|
set = function(self, healingPerInterval)
|
|
827
|
-
self[
|
|
875
|
+
self[116] = healingPerInterval ~= 0 and healingPerInterval or nil
|
|
828
876
|
end
|
|
829
877
|
},
|
|
830
878
|
true
|
|
@@ -834,25 +882,25 @@ __TS__SetDescriptor(
|
|
|
834
882
|
"healingInterval",
|
|
835
883
|
{
|
|
836
884
|
get = function(self)
|
|
837
|
-
return self[
|
|
885
|
+
return self[117] or 0
|
|
838
886
|
end,
|
|
839
887
|
set = function(self, healingInterval)
|
|
840
888
|
if healingInterval <= 0 then
|
|
841
|
-
self[
|
|
842
|
-
local timer = self[
|
|
889
|
+
self[117] = healingInterval ~= 0 and healingInterval or nil
|
|
890
|
+
local timer = self[119]
|
|
843
891
|
if timer ~= nil then
|
|
844
892
|
timer:destroy()
|
|
845
|
-
self[
|
|
893
|
+
self[119] = nil
|
|
846
894
|
end
|
|
847
895
|
return
|
|
848
896
|
end
|
|
849
|
-
self[
|
|
897
|
+
self[117] = healingInterval
|
|
850
898
|
local ____opt_50 = self._timer
|
|
851
899
|
local elapsed = ____opt_50 and ____opt_50.elapsed or 0
|
|
852
|
-
local timer = self[
|
|
900
|
+
local timer = self[119]
|
|
853
901
|
if timer == nil then
|
|
854
902
|
timer = Timer:create()
|
|
855
|
-
self[
|
|
903
|
+
self[119] = timer
|
|
856
904
|
end
|
|
857
905
|
local initialDelay = healingInterval - (elapsed >= healingInterval and math.fmod(elapsed, healingInterval) or elapsed)
|
|
858
906
|
if initialDelay == healingInterval then
|
|
@@ -869,10 +917,10 @@ __TS__SetDescriptor(
|
|
|
869
917
|
"damageOnExpiration",
|
|
870
918
|
{
|
|
871
919
|
get = function(self)
|
|
872
|
-
return self[
|
|
920
|
+
return self[120] or 0
|
|
873
921
|
end,
|
|
874
922
|
set = function(self, damageOnExpiration)
|
|
875
|
-
self[
|
|
923
|
+
self[120] = damageOnExpiration ~= 0 and damageOnExpiration or nil
|
|
876
924
|
end
|
|
877
925
|
},
|
|
878
926
|
true
|
|
@@ -882,10 +930,10 @@ __TS__SetDescriptor(
|
|
|
882
930
|
"healingOnExpiration",
|
|
883
931
|
{
|
|
884
932
|
get = function(self)
|
|
885
|
-
return self[
|
|
933
|
+
return self[121] or 0
|
|
886
934
|
end,
|
|
887
935
|
set = function(self, healingOnExpiration)
|
|
888
|
-
self[
|
|
936
|
+
self[121] = healingOnExpiration ~= 0 and healingOnExpiration or nil
|
|
889
937
|
end
|
|
890
938
|
},
|
|
891
939
|
true
|
|
@@ -929,30 +977,53 @@ __TS__SetDescriptor(
|
|
|
929
977
|
},
|
|
930
978
|
true
|
|
931
979
|
)
|
|
980
|
+
__TS__SetDescriptor(
|
|
981
|
+
Buff.prototype,
|
|
982
|
+
"turnsIntoGhost",
|
|
983
|
+
{
|
|
984
|
+
get = function(self)
|
|
985
|
+
local ____self__135_52 = self[135]
|
|
986
|
+
if ____self__135_52 == nil then
|
|
987
|
+
____self__135_52 = false
|
|
988
|
+
end
|
|
989
|
+
return ____self__135_52
|
|
990
|
+
end,
|
|
991
|
+
set = function(self, turnsIntoGhost)
|
|
992
|
+
if not turnsIntoGhost and self[135] then
|
|
993
|
+
self.object:decrementGhostCounter()
|
|
994
|
+
self[135] = nil
|
|
995
|
+
elseif turnsIntoGhost and not self[135] then
|
|
996
|
+
self.object:incrementGhostCounter()
|
|
997
|
+
self[135] = true
|
|
998
|
+
end
|
|
999
|
+
end
|
|
1000
|
+
},
|
|
1001
|
+
true
|
|
1002
|
+
)
|
|
932
1003
|
__TS__SetDescriptor(
|
|
933
1004
|
Buff.prototype,
|
|
934
1005
|
"stuns",
|
|
935
1006
|
{
|
|
936
1007
|
get = function(self)
|
|
937
|
-
local
|
|
938
|
-
if
|
|
939
|
-
|
|
1008
|
+
local ____self__136_53 = self[136]
|
|
1009
|
+
if ____self__136_53 == nil then
|
|
1010
|
+
____self__136_53 = false
|
|
940
1011
|
end
|
|
941
|
-
return
|
|
1012
|
+
return ____self__136_53
|
|
942
1013
|
end,
|
|
943
1014
|
set = function(self, stuns)
|
|
944
|
-
if not stuns and self[
|
|
945
|
-
if self[
|
|
946
|
-
self.object:
|
|
1015
|
+
if not stuns and self[136] then
|
|
1016
|
+
if self[137] then
|
|
1017
|
+
self.object:decrementForceStunCounter()
|
|
947
1018
|
end
|
|
948
1019
|
self.object:decrementStunCounter()
|
|
949
|
-
self[
|
|
950
|
-
elseif stuns and not self[
|
|
951
|
-
if self[
|
|
952
|
-
self.object:
|
|
1020
|
+
self[136] = nil
|
|
1021
|
+
elseif stuns and not self[136] then
|
|
1022
|
+
if self[137] then
|
|
1023
|
+
self.object:incrementForceStunCounter()
|
|
953
1024
|
end
|
|
954
1025
|
self.object:incrementStunCounter()
|
|
955
|
-
self[
|
|
1026
|
+
self[136] = true
|
|
956
1027
|
end
|
|
957
1028
|
end
|
|
958
1029
|
},
|
|
@@ -963,23 +1034,23 @@ __TS__SetDescriptor(
|
|
|
963
1034
|
"ignoresStunImmunity",
|
|
964
1035
|
{
|
|
965
1036
|
get = function(self)
|
|
966
|
-
local
|
|
967
|
-
if
|
|
968
|
-
|
|
1037
|
+
local ____self__137_54 = self[137]
|
|
1038
|
+
if ____self__137_54 == nil then
|
|
1039
|
+
____self__137_54 = false
|
|
969
1040
|
end
|
|
970
|
-
return
|
|
1041
|
+
return ____self__137_54
|
|
971
1042
|
end,
|
|
972
1043
|
set = function(self, ignoresStunImmunity)
|
|
973
|
-
if not ignoresStunImmunity and self[
|
|
974
|
-
if self[
|
|
975
|
-
self.object:
|
|
1044
|
+
if not ignoresStunImmunity and self[137] then
|
|
1045
|
+
if self[136] then
|
|
1046
|
+
self.object:decrementForceStunCounter()
|
|
976
1047
|
end
|
|
977
|
-
self[
|
|
978
|
-
elseif ignoresStunImmunity and not self[
|
|
979
|
-
if self[
|
|
980
|
-
self.object:
|
|
1048
|
+
self[137] = nil
|
|
1049
|
+
elseif ignoresStunImmunity and not self[137] then
|
|
1050
|
+
if self[136] then
|
|
1051
|
+
self.object:incrementForceStunCounter()
|
|
981
1052
|
end
|
|
982
|
-
self[
|
|
1053
|
+
self[137] = true
|
|
983
1054
|
end
|
|
984
1055
|
end
|
|
985
1056
|
},
|
|
@@ -990,19 +1061,19 @@ __TS__SetDescriptor(
|
|
|
990
1061
|
"disablesAutoAttack",
|
|
991
1062
|
{
|
|
992
1063
|
get = function(self)
|
|
993
|
-
local
|
|
994
|
-
if
|
|
995
|
-
|
|
1064
|
+
local ____self__138_55 = self[138]
|
|
1065
|
+
if ____self__138_55 == nil then
|
|
1066
|
+
____self__138_55 = false
|
|
996
1067
|
end
|
|
997
|
-
return
|
|
1068
|
+
return ____self__138_55
|
|
998
1069
|
end,
|
|
999
1070
|
set = function(self, disablesAutoAttack)
|
|
1000
|
-
if not disablesAutoAttack and self[
|
|
1071
|
+
if not disablesAutoAttack and self[138] then
|
|
1001
1072
|
self.object:decrementDisableAutoAttackCounter()
|
|
1002
|
-
self[
|
|
1003
|
-
elseif disablesAutoAttack and not self[
|
|
1073
|
+
self[138] = nil
|
|
1074
|
+
elseif disablesAutoAttack and not self[138] then
|
|
1004
1075
|
self.object:incrementDisableAutoAttackCounter()
|
|
1005
|
-
self[
|
|
1076
|
+
self[138] = true
|
|
1006
1077
|
end
|
|
1007
1078
|
end
|
|
1008
1079
|
},
|
|
@@ -1013,19 +1084,19 @@ __TS__SetDescriptor(
|
|
|
1013
1084
|
"providesInvulnerability",
|
|
1014
1085
|
{
|
|
1015
1086
|
get = function(self)
|
|
1016
|
-
local
|
|
1017
|
-
if
|
|
1018
|
-
|
|
1087
|
+
local ____self__139_56 = self[139]
|
|
1088
|
+
if ____self__139_56 == nil then
|
|
1089
|
+
____self__139_56 = false
|
|
1019
1090
|
end
|
|
1020
|
-
return
|
|
1091
|
+
return ____self__139_56
|
|
1021
1092
|
end,
|
|
1022
1093
|
set = function(self, providesInvulnerability)
|
|
1023
|
-
if not providesInvulnerability and self[
|
|
1094
|
+
if not providesInvulnerability and self[139] then
|
|
1024
1095
|
self.object:decrementInvulnerabilityCounter()
|
|
1025
|
-
self[
|
|
1026
|
-
elseif providesInvulnerability and not self[
|
|
1096
|
+
self[139] = nil
|
|
1097
|
+
elseif providesInvulnerability and not self[139] then
|
|
1027
1098
|
self.object:incrementInvulnerabilityCounter()
|
|
1028
|
-
self[
|
|
1099
|
+
self[139] = true
|
|
1029
1100
|
end
|
|
1030
1101
|
end
|
|
1031
1102
|
},
|
|
@@ -1036,17 +1107,17 @@ __TS__SetDescriptor(
|
|
|
1036
1107
|
"killsOnExpiration",
|
|
1037
1108
|
{
|
|
1038
1109
|
get = function(self)
|
|
1039
|
-
local
|
|
1040
|
-
if
|
|
1041
|
-
|
|
1110
|
+
local ____self__140_57 = self[140]
|
|
1111
|
+
if ____self__140_57 == nil then
|
|
1112
|
+
____self__140_57 = false
|
|
1042
1113
|
end
|
|
1043
|
-
return
|
|
1114
|
+
return ____self__140_57
|
|
1044
1115
|
end,
|
|
1045
1116
|
set = function(self, killsOnExpiration)
|
|
1046
|
-
if not killsOnExpiration and self[
|
|
1047
|
-
self[
|
|
1048
|
-
elseif killsOnExpiration and not self[
|
|
1049
|
-
self[
|
|
1117
|
+
if not killsOnExpiration and self[140] then
|
|
1118
|
+
self[140] = nil
|
|
1119
|
+
elseif killsOnExpiration and not self[140] then
|
|
1120
|
+
self[140] = true
|
|
1050
1121
|
end
|
|
1051
1122
|
end
|
|
1052
1123
|
},
|
|
@@ -1057,17 +1128,17 @@ __TS__SetDescriptor(
|
|
|
1057
1128
|
"explodesOnExpiration",
|
|
1058
1129
|
{
|
|
1059
1130
|
get = function(self)
|
|
1060
|
-
local
|
|
1061
|
-
if
|
|
1062
|
-
|
|
1131
|
+
local ____self__141_58 = self[141]
|
|
1132
|
+
if ____self__141_58 == nil then
|
|
1133
|
+
____self__141_58 = false
|
|
1063
1134
|
end
|
|
1064
|
-
return
|
|
1135
|
+
return ____self__141_58
|
|
1065
1136
|
end,
|
|
1066
1137
|
set = function(self, killsOnExpiration)
|
|
1067
|
-
if not killsOnExpiration and self[
|
|
1068
|
-
self[
|
|
1069
|
-
elseif killsOnExpiration and not self[
|
|
1070
|
-
self[
|
|
1138
|
+
if not killsOnExpiration and self[141] then
|
|
1139
|
+
self[141] = nil
|
|
1140
|
+
elseif killsOnExpiration and not self[141] then
|
|
1141
|
+
self[141] = true
|
|
1071
1142
|
end
|
|
1072
1143
|
end
|
|
1073
1144
|
},
|
|
@@ -1078,13 +1149,13 @@ __TS__SetDescriptor(
|
|
|
1078
1149
|
"maximumDamageDealtEventCount",
|
|
1079
1150
|
{
|
|
1080
1151
|
get = function(self)
|
|
1081
|
-
return self[
|
|
1152
|
+
return self[132] or 0
|
|
1082
1153
|
end,
|
|
1083
1154
|
set = function(self, maximumDamageDealtEventCount)
|
|
1084
1155
|
if maximumDamageDealtEventCount == 0 then
|
|
1085
|
-
self[
|
|
1156
|
+
self[132] = nil
|
|
1086
1157
|
else
|
|
1087
|
-
self[
|
|
1158
|
+
self[132] = maximumDamageDealtEventCount
|
|
1088
1159
|
end
|
|
1089
1160
|
end
|
|
1090
1161
|
},
|
|
@@ -1095,13 +1166,13 @@ __TS__SetDescriptor(
|
|
|
1095
1166
|
"maximumDamageReceivedEventCount",
|
|
1096
1167
|
{
|
|
1097
1168
|
get = function(self)
|
|
1098
|
-
return self[
|
|
1169
|
+
return self[134] or 0
|
|
1099
1170
|
end,
|
|
1100
1171
|
set = function(self, maximumDamageReceivedEventCount)
|
|
1101
1172
|
if maximumDamageReceivedEventCount == 0 then
|
|
1102
|
-
self[
|
|
1173
|
+
self[134] = nil
|
|
1103
1174
|
else
|
|
1104
|
-
self[
|
|
1175
|
+
self[134] = maximumDamageReceivedEventCount
|
|
1105
1176
|
end
|
|
1106
1177
|
end
|
|
1107
1178
|
},
|
|
@@ -1112,13 +1183,13 @@ __TS__SetDescriptor(
|
|
|
1112
1183
|
"maximumAutoAttackCount",
|
|
1113
1184
|
{
|
|
1114
1185
|
get = function(self)
|
|
1115
|
-
return self[
|
|
1186
|
+
return self[130] or 0
|
|
1116
1187
|
end,
|
|
1117
1188
|
set = function(self, maximumAutoAttackCount)
|
|
1118
1189
|
if maximumAutoAttackCount == 0 then
|
|
1119
|
-
self[
|
|
1190
|
+
self[130] = nil
|
|
1120
1191
|
else
|
|
1121
|
-
self[
|
|
1192
|
+
self[130] = maximumAutoAttackCount
|
|
1122
1193
|
end
|
|
1123
1194
|
end
|
|
1124
1195
|
},
|
|
@@ -1129,10 +1200,10 @@ __TS__SetDescriptor(
|
|
|
1129
1200
|
"durationIncreaseOnAutoAttack",
|
|
1130
1201
|
{
|
|
1131
1202
|
get = function(self)
|
|
1132
|
-
return self[
|
|
1203
|
+
return self[107] or 0
|
|
1133
1204
|
end,
|
|
1134
1205
|
set = function(self, durationIncreaseOnAutoAttack)
|
|
1135
|
-
self[
|
|
1206
|
+
self[107] = durationIncreaseOnAutoAttack
|
|
1136
1207
|
end
|
|
1137
1208
|
},
|
|
1138
1209
|
true
|
|
@@ -1163,11 +1234,24 @@ __TS__SetDescriptor(
|
|
|
1163
1234
|
},
|
|
1164
1235
|
true
|
|
1165
1236
|
)
|
|
1237
|
+
__TS__SetDescriptor(
|
|
1238
|
+
Buff.prototype,
|
|
1239
|
+
"evasionProbability",
|
|
1240
|
+
{
|
|
1241
|
+
get = function(self)
|
|
1242
|
+
return self:getUnitBonus(UnitBonusType.EVASION_PROBABILITY)
|
|
1243
|
+
end,
|
|
1244
|
+
set = function(self, evasionProbability)
|
|
1245
|
+
self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.EVASION_PROBABILITY, evasionProbability)
|
|
1246
|
+
end
|
|
1247
|
+
},
|
|
1248
|
+
true
|
|
1249
|
+
)
|
|
1166
1250
|
__TS__SetDescriptor(
|
|
1167
1251
|
Buff.prototype,
|
|
1168
1252
|
"duration",
|
|
1169
1253
|
{get = function(self)
|
|
1170
|
-
return self[
|
|
1254
|
+
return self[103]
|
|
1171
1255
|
end},
|
|
1172
1256
|
true
|
|
1173
1257
|
)
|
|
@@ -1176,15 +1260,15 @@ __TS__SetDescriptor(
|
|
|
1176
1260
|
"remainingDuration",
|
|
1177
1261
|
{
|
|
1178
1262
|
get = function(self)
|
|
1179
|
-
local
|
|
1180
|
-
return
|
|
1263
|
+
local ____opt_59 = self._timer
|
|
1264
|
+
return ____opt_59 and ____opt_59.remaining or 0
|
|
1181
1265
|
end,
|
|
1182
1266
|
set = function(self, remainingDuration)
|
|
1183
|
-
local
|
|
1184
|
-
local
|
|
1185
|
-
local remainingDurationDelta =
|
|
1267
|
+
local ____remainingDuration_63 = remainingDuration
|
|
1268
|
+
local ____opt_61 = self._timer
|
|
1269
|
+
local remainingDurationDelta = ____remainingDuration_63 - (____opt_61 and ____opt_61.remaining or 0)
|
|
1186
1270
|
if remainingDurationDelta ~= 0 then
|
|
1187
|
-
self[
|
|
1271
|
+
self[103] = self[103] + remainingDurationDelta
|
|
1188
1272
|
if remainingDuration <= 0 then
|
|
1189
1273
|
Timer:run(destroyBuff, self)
|
|
1190
1274
|
else
|
|
@@ -1196,7 +1280,8 @@ __TS__SetDescriptor(
|
|
|
1196
1280
|
self._level,
|
|
1197
1281
|
remainingDuration,
|
|
1198
1282
|
self._spellStealPriority,
|
|
1199
|
-
self._learnLevelMinimum
|
|
1283
|
+
self._learnLevelMinimum,
|
|
1284
|
+
self[142]
|
|
1200
1285
|
) then
|
|
1201
1286
|
local timer = self._timer
|
|
1202
1287
|
if timer == nil then
|
|
@@ -1210,10 +1295,38 @@ __TS__SetDescriptor(
|
|
|
1210
1295
|
end
|
|
1211
1296
|
},
|
|
1212
1297
|
true
|
|
1213
|
-
)
|
|
1298
|
+
)
|
|
1299
|
+
__TS__SetDescriptor(
|
|
1300
|
+
Buff.prototype,
|
|
1301
|
+
"abilityCooldownFactor",
|
|
1302
|
+
{
|
|
1303
|
+
get = function(self)
|
|
1304
|
+
return self[143] or 1
|
|
1305
|
+
end,
|
|
1306
|
+
set = function(self, abilityCooldownFactor)
|
|
1307
|
+
local previousAbilityCooldownModifier = self[144]
|
|
1308
|
+
if previousAbilityCooldownModifier then
|
|
1309
|
+
for ____, ability in ipairs(self._unit.abilities) do
|
|
1310
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:removeModifier(ability, previousAbilityCooldownModifier)
|
|
1311
|
+
end
|
|
1312
|
+
end
|
|
1313
|
+
local function modifier(ability, level, cooldown)
|
|
1314
|
+
return cooldown * abilityCooldownFactor
|
|
1315
|
+
end
|
|
1316
|
+
for ____, ability in ipairs(self._unit.abilities) do
|
|
1317
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:applyModifier(ability, modifier)
|
|
1318
|
+
end
|
|
1319
|
+
self[144] = modifier
|
|
1320
|
+
self[143] = abilityCooldownFactor
|
|
1321
|
+
end
|
|
1322
|
+
},
|
|
1323
|
+
true
|
|
1324
|
+
)
|
|
1325
|
+
Buff.createdEvent = buffCreatedEvent
|
|
1326
|
+
Buff.beingDestroyedEvent = buffBeingDestroyedEvent;
|
|
1214
1327
|
(function(self)
|
|
1215
1328
|
local function destroyBuffIfNeeded(buff)
|
|
1216
|
-
if getUnitAbility(buff[
|
|
1329
|
+
if getUnitAbility(buff[101].handle, buff.typeId) ~= buff.handle and buff[100] == 1 then
|
|
1217
1330
|
buff:destroy()
|
|
1218
1331
|
end
|
|
1219
1332
|
end
|
|
@@ -1264,5 +1377,8 @@ __TS__SetDescriptor(
|
|
|
1264
1377
|
____exports.checkBuffs(target)
|
|
1265
1378
|
end
|
|
1266
1379
|
)
|
|
1380
|
+
buffCreatedEvent:addListener(function(buff)
|
|
1381
|
+
UnitBehavior:forAll(buff.unit, "onBuffGained", buff)
|
|
1382
|
+
end)
|
|
1267
1383
|
end)(Buff)
|
|
1268
1384
|
return ____exports
|