warscript 0.0.1-dev.e1acea3 → 0.0.1-dev.e3899e3
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 +2 -3
- package/core/types/effect.lua +95 -48
- package/core/types/frame.lua +24 -21
- package/core/types/player.d.ts +16 -0
- package/core/types/player.lua +60 -15
- 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/destroyable.d.ts +1 -0
- package/destroyable.lua +9 -0
- package/engine/behavior.d.ts +14 -1
- package/engine/behavior.lua +230 -70
- 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 +36 -4
- 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 +1 -1
- package/engine/behaviour/ability/emulate-impact.lua +22 -8
- package/engine/behaviour/ability/on-command-impact.lua +7 -0
- package/engine/behaviour/ability/remove-buffs.d.ts +13 -1
- package/engine/behaviour/ability/remove-buffs.lua +29 -2
- 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 +17 -4
- package/engine/behaviour/ability.lua +87 -23
- package/engine/behaviour/unit/stun-immunity.d.ts +11 -5
- package/engine/behaviour/unit/stun-immunity.lua +53 -28
- package/engine/behaviour/unit.d.ts +40 -2
- package/engine/behaviour/unit.lua +259 -6
- package/engine/buff.d.ts +70 -44
- package/engine/buff.lua +362 -232
- package/engine/internal/ability.d.ts +18 -2
- package/engine/internal/ability.lua +116 -11
- 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/object-data/mana-regeneration-rate-increase-factor.d.ts +2 -0
- package/engine/internal/object-data/mana-regeneration-rate-increase-factor.lua +16 -0
- package/engine/internal/unit/ability.d.ts +35 -0
- package/engine/internal/unit/ability.lua +98 -9
- 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 +4 -0
- package/engine/internal/unit/bonus.lua +27 -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.lua +6 -12
- package/engine/internal/unit/main-selected.lua +12 -27
- package/engine/internal/unit/order.d.ts +20 -0
- package/engine/internal/unit/order.lua +136 -0
- package/engine/internal/unit/scale.d.ts +7 -0
- package/engine/internal/unit/scale.lua +20 -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 +45 -18
- package/engine/internal/unit.lua +391 -175
- 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/health-regeneration-type.d.ts +8 -0
- package/engine/object-data/auxiliary/health-regeneration-type.lua +2 -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/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/mana-regeneration.d.ts +8 -0
- package/engine/object-data/entry/ability-type/mana-regeneration.lua +26 -0
- 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 +28 -2
- package/engine/object-data/entry/destructible-type.lua +155 -0
- 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 +25 -5
- package/engine/object-data/entry/unit-type.lua +258 -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 +72 -3
- package/engine/object-field/unit.lua +268 -7
- package/engine/object-field.d.ts +23 -6
- package/engine/object-field.lua +337 -116
- 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 +4 -2
- package/engine/standard/fields/ability.lua +4 -2
- package/engine/standard/fields/unit.d.ts +7 -0
- package/engine/standard/fields/unit.lua +13 -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 +4 -0
- package/engine/unit.lua +4 -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 +2 -0
- package/utility/arrays.lua +11 -0
- 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/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,12 +43,18 @@ 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
|
|
49
50
|
local ____item = require("engine.internal.item")
|
|
50
51
|
local Item = ____item.Item
|
|
51
52
|
local ____destructable = require("core.types.destructable")
|
|
52
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
|
|
56
|
+
local ____ability = require("engine.behaviour.ability")
|
|
57
|
+
local AbilityBehavior = ____ability.AbilityBehavior
|
|
53
58
|
local getUnitAbility = BlzGetUnitAbility
|
|
54
59
|
local stringValueByBuffTypeIdByFieldId = postcompile(function()
|
|
55
60
|
local stringValueByBuffTypeIdByFieldId = {}
|
|
@@ -98,12 +103,16 @@ local buffParametersKeys = {
|
|
|
98
103
|
armorIncreaseFactor = true,
|
|
99
104
|
attackSpeedIncreaseFactor = true,
|
|
100
105
|
movementSpeedIncreaseFactor = true,
|
|
106
|
+
manaRegenerationRateIncreaseFactor = true,
|
|
107
|
+
evasionProbability = true,
|
|
108
|
+
missProbability = true,
|
|
101
109
|
damageFactor = true,
|
|
102
110
|
receivedDamageFactor = true,
|
|
103
111
|
receivedMagicDamageFactor = true,
|
|
104
112
|
durationIncreaseOnAutoAttack = true,
|
|
105
113
|
maximumDuration = true,
|
|
106
114
|
maximumRemainingDuration = true,
|
|
115
|
+
turnsIntoGhost = true,
|
|
107
116
|
stuns = true,
|
|
108
117
|
ignoresStunImmunity = true,
|
|
109
118
|
providesStunImmunity = true,
|
|
@@ -118,7 +127,8 @@ local buffParametersKeys = {
|
|
|
118
127
|
damageOnExpiration = true,
|
|
119
128
|
healingOnExpiration = true,
|
|
120
129
|
killsOnExpiration = true,
|
|
121
|
-
explodesOnExpiration = true
|
|
130
|
+
explodesOnExpiration = true,
|
|
131
|
+
abilityCooldownFactor = true
|
|
122
132
|
}
|
|
123
133
|
local function resolveEnumValue(ability, level, value)
|
|
124
134
|
if value == nil or type(value) == "number" then
|
|
@@ -169,6 +179,7 @@ local function resolveAndSetNumberValue(buff, property, ability, level, value, d
|
|
|
169
179
|
end
|
|
170
180
|
end
|
|
171
181
|
local buffBooleanParameters = {
|
|
182
|
+
"turnsIntoGhost",
|
|
172
183
|
"stuns",
|
|
173
184
|
"ignoresStunImmunity",
|
|
174
185
|
"disablesAutoAttack",
|
|
@@ -180,6 +191,8 @@ local buffNumberParameters = {
|
|
|
180
191
|
"durationIncreaseOnAutoAttack",
|
|
181
192
|
"attackSpeedIncreaseFactor",
|
|
182
193
|
"movementSpeedIncreaseFactor",
|
|
194
|
+
"manaRegenerationRateIncreaseFactor",
|
|
195
|
+
"evasionProbability",
|
|
183
196
|
"armorIncrease",
|
|
184
197
|
"damageFactor",
|
|
185
198
|
"receivedDamageFactor",
|
|
@@ -193,7 +206,8 @@ local buffNumberParameters = {
|
|
|
193
206
|
"healingPerInterval",
|
|
194
207
|
"healingOverDuration",
|
|
195
208
|
"damageOnExpiration",
|
|
196
|
-
"healingOnExpiration"
|
|
209
|
+
"healingOnExpiration",
|
|
210
|
+
"abilityCooldownFactor"
|
|
197
211
|
}
|
|
198
212
|
local unsuccessfulApplicationMarker = {}
|
|
199
213
|
local function selectBuffTypeIdWithLeastDuration(buffTypeIds, unit)
|
|
@@ -220,7 +234,7 @@ local function selectBuffTypeIdWithLeastDuration(buffTypeIds, unit)
|
|
|
220
234
|
return checkNotNull(firstNativeBuffTypeId)
|
|
221
235
|
end
|
|
222
236
|
local function destroyBuffIfItHasSameUniqueGroup(buff, uniqueGroup)
|
|
223
|
-
if buff[
|
|
237
|
+
if buff[104] == uniqueGroup then
|
|
224
238
|
buff:destroy()
|
|
225
239
|
end
|
|
226
240
|
end
|
|
@@ -228,17 +242,17 @@ local function destroyBuff(buff)
|
|
|
228
242
|
buff:destroy()
|
|
229
243
|
end
|
|
230
244
|
local function expireBuff(buff)
|
|
231
|
-
local remainingDamageOverDuration = buff[
|
|
232
|
-
local remainingHealingOverDuration = buff[
|
|
245
|
+
local remainingDamageOverDuration = buff[113] or 0
|
|
246
|
+
local remainingHealingOverDuration = buff[113] or 0
|
|
233
247
|
if remainingDamageOverDuration ~= 0 or remainingHealingOverDuration ~= 0 then
|
|
234
248
|
buff:flashSpecialEffect()
|
|
235
249
|
if remainingDamageOverDuration ~= 0 then
|
|
236
|
-
(buff[
|
|
237
|
-
buff[
|
|
250
|
+
(buff[102] or buff[101]):damageTarget(buff[101], remainingDamageOverDuration)
|
|
251
|
+
buff[113] = nil
|
|
238
252
|
end
|
|
239
253
|
if remainingHealingOverDuration ~= 0 then
|
|
240
|
-
(buff[
|
|
241
|
-
buff[
|
|
254
|
+
(buff[102] or buff[101]):healTarget(buff[101], remainingHealingOverDuration)
|
|
255
|
+
buff[118] = nil
|
|
242
256
|
end
|
|
243
257
|
end
|
|
244
258
|
Timer:run(destroyBuff, buff)
|
|
@@ -246,56 +260,58 @@ local function expireBuff(buff)
|
|
|
246
260
|
end
|
|
247
261
|
local function buffDamageIntervalInitialTimerCallback(buff)
|
|
248
262
|
buffDamageIntervalTimerCallback(buff)
|
|
249
|
-
local timer = buff[
|
|
250
|
-
local damageInterval = buff[
|
|
263
|
+
local timer = buff[114]
|
|
264
|
+
local damageInterval = buff[112]
|
|
251
265
|
if timer ~= nil and damageInterval ~= nil and damageInterval > 0 then
|
|
252
266
|
timer:start(damageInterval, true, buffDamageIntervalTimerCallback, buff)
|
|
253
267
|
end
|
|
254
268
|
end
|
|
255
269
|
buffDamageIntervalTimerCallback = function(buff)
|
|
256
270
|
buff:flashSpecialEffect()
|
|
257
|
-
local source = buff[
|
|
258
|
-
local remainingDamageOverDuration = buff[
|
|
271
|
+
local source = buff[102] or buff[101]
|
|
272
|
+
local remainingDamageOverDuration = buff[113] or 0
|
|
259
273
|
if remainingDamageOverDuration ~= 0 then
|
|
260
|
-
local damageInterval = buff[
|
|
274
|
+
local damageInterval = buff[112] or 0
|
|
261
275
|
if damageInterval ~= 0 then
|
|
262
276
|
local damage = remainingDamageOverDuration / (1 + buff.remainingDuration / damageInterval)
|
|
263
|
-
source:damageTarget(buff[
|
|
264
|
-
buff[
|
|
277
|
+
source:damageTarget(buff[101], damage)
|
|
278
|
+
buff[113] = remainingDamageOverDuration - damage
|
|
265
279
|
end
|
|
266
280
|
end
|
|
267
|
-
local damagePerInterval = buff[
|
|
281
|
+
local damagePerInterval = buff[111] or 0
|
|
268
282
|
if remainingDamageOverDuration == 0 or damagePerInterval ~= 0 then
|
|
269
|
-
source:damageTarget(buff[
|
|
283
|
+
source:damageTarget(buff[101], damagePerInterval)
|
|
270
284
|
end
|
|
271
285
|
end
|
|
272
286
|
local function buffHealingIntervalInitialTimerCallback(buff)
|
|
273
287
|
buffHealingIntervalTimerCallback(buff)
|
|
274
|
-
local timer = buff[
|
|
275
|
-
local healingInterval = buff[
|
|
288
|
+
local timer = buff[119]
|
|
289
|
+
local healingInterval = buff[117]
|
|
276
290
|
if timer ~= nil and healingInterval ~= nil and healingInterval > 0 then
|
|
277
291
|
timer:start(healingInterval, true, buffHealingIntervalTimerCallback, buff)
|
|
278
292
|
end
|
|
279
293
|
end
|
|
280
294
|
buffHealingIntervalTimerCallback = function(buff)
|
|
281
|
-
if buff[
|
|
295
|
+
if buff[117] ~= buff[112] then
|
|
282
296
|
buff:flashSpecialEffect()
|
|
283
297
|
end
|
|
284
|
-
local source = buff[
|
|
285
|
-
local remainingHealingOverDuration = buff[
|
|
298
|
+
local source = buff[102] or buff[101]
|
|
299
|
+
local remainingHealingOverDuration = buff[118] or 0
|
|
286
300
|
if remainingHealingOverDuration ~= 0 then
|
|
287
|
-
local healingInterval = buff[
|
|
301
|
+
local healingInterval = buff[117] or 0
|
|
288
302
|
if healingInterval ~= 0 then
|
|
289
303
|
local healing = remainingHealingOverDuration / (1 + buff.remainingDuration / healingInterval)
|
|
290
|
-
source:healTarget(buff[
|
|
291
|
-
buff[
|
|
304
|
+
source:healTarget(buff[101], healing)
|
|
305
|
+
buff[118] = remainingHealingOverDuration - healing
|
|
292
306
|
end
|
|
293
307
|
end
|
|
294
|
-
local healingPerInterval = buff[
|
|
308
|
+
local healingPerInterval = buff[116] or 0
|
|
295
309
|
if remainingHealingOverDuration == 0 or healingPerInterval ~= 0 then
|
|
296
|
-
source:healTarget(buff[
|
|
310
|
+
source:healTarget(buff[101], healingPerInterval)
|
|
297
311
|
end
|
|
298
312
|
end
|
|
313
|
+
local buffCreatedEvent = __TS__New(Event)
|
|
314
|
+
local buffBeingDestroyedEvent = __TS__New(Event)
|
|
299
315
|
____exports.Buff = __TS__Class()
|
|
300
316
|
local Buff = ____exports.Buff
|
|
301
317
|
Buff.name = "Buff"
|
|
@@ -304,38 +320,44 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
304
320
|
UnitBehavior.prototype.____constructor(self, _unit)
|
|
305
321
|
self._unit = _unit
|
|
306
322
|
self.parameters = nil
|
|
307
|
-
self[100] =
|
|
323
|
+
self[100] = 0
|
|
324
|
+
self[101] = _unit
|
|
308
325
|
local typeId
|
|
309
326
|
local polarity
|
|
310
327
|
local resistanceType
|
|
311
328
|
local ability
|
|
329
|
+
local abilityBehavior
|
|
312
330
|
if type(typeIdOrTypeIds) ~= "number" then
|
|
313
331
|
typeId = selectBuffTypeIdWithLeastDuration(typeIdOrTypeIds, _unit)
|
|
314
332
|
polarity = resistanceTypeOrPolarity
|
|
315
333
|
resistanceType = abilityOrParametersOrResistanceType
|
|
316
|
-
if __TS__InstanceOf(parametersOrAbility,
|
|
334
|
+
if __TS__InstanceOf(parametersOrAbility, AbilityBehavior) then
|
|
335
|
+
abilityBehavior = parametersOrAbility
|
|
336
|
+
ability = abilityBehavior.ability
|
|
337
|
+
elseif __TS__InstanceOf(parametersOrAbility, Ability) then
|
|
317
338
|
ability = parametersOrAbility
|
|
318
|
-
|
|
319
|
-
ability = nil
|
|
339
|
+
elseif parametersOrAbility ~= nil then
|
|
320
340
|
parameters = parametersOrAbility
|
|
321
341
|
end
|
|
322
342
|
else
|
|
323
343
|
typeId = typeIdOrTypeIds
|
|
324
344
|
polarity = polarityOrTypeIdSelectionPolicy
|
|
325
345
|
resistanceType = resistanceTypeOrPolarity
|
|
326
|
-
if __TS__InstanceOf(abilityOrParametersOrResistanceType,
|
|
346
|
+
if __TS__InstanceOf(abilityOrParametersOrResistanceType, AbilityBehavior) then
|
|
347
|
+
abilityBehavior = abilityOrParametersOrResistanceType
|
|
348
|
+
ability = abilityBehavior.ability
|
|
349
|
+
parameters = parametersOrAbility
|
|
350
|
+
elseif __TS__InstanceOf(abilityOrParametersOrResistanceType, Ability) then
|
|
327
351
|
ability = abilityOrParametersOrResistanceType
|
|
328
352
|
parameters = parametersOrAbility
|
|
329
|
-
|
|
330
|
-
ability = nil
|
|
353
|
+
elseif abilityOrParametersOrResistanceType ~= nil then
|
|
331
354
|
parameters = abilityOrParametersOrResistanceType
|
|
355
|
+
else
|
|
356
|
+
parameters = parametersOrAbility
|
|
332
357
|
end
|
|
333
358
|
end
|
|
359
|
+
self.sourceAbilityBehavior = abilityBehavior
|
|
334
360
|
self.typeId = typeId
|
|
335
|
-
if not __TS__InstanceOf(ability, Ability) then
|
|
336
|
-
parameters = ability
|
|
337
|
-
ability = nil
|
|
338
|
-
end
|
|
339
361
|
local defaultParameters = self.constructor.defaultParameters
|
|
340
362
|
local level = parameters and parameters.level or defaultParameters.level
|
|
341
363
|
local spellStealPriority = parameters and parameters.spellStealPriority or defaultParameters.spellStealPriority
|
|
@@ -360,14 +382,19 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
360
382
|
end
|
|
361
383
|
self.polarity = resolveEnumValue(ability, level, polarity)
|
|
362
384
|
self.resistanceType = resolveEnumValue(ability, level, resistanceType)
|
|
385
|
+
local missProbability = parameters and parameters.missProbability or defaultParameters.missProbability
|
|
386
|
+
if missProbability ~= nil then
|
|
387
|
+
missProbability = resolveNumberValue(ability, level, missProbability)
|
|
388
|
+
self[142] = missProbability
|
|
389
|
+
end
|
|
363
390
|
local buffByTypeId = buffByTypeIdByUnit[_unit]
|
|
364
391
|
if buffByTypeId == nil then
|
|
365
392
|
buffByTypeId = {}
|
|
366
393
|
buffByTypeIdByUnit[_unit] = buffByTypeId
|
|
367
394
|
end
|
|
368
|
-
local
|
|
369
|
-
if
|
|
370
|
-
|
|
395
|
+
local ____opt_15 = buffByTypeId[typeId]
|
|
396
|
+
if ____opt_15 ~= nil then
|
|
397
|
+
____opt_15:destroy()
|
|
371
398
|
end
|
|
372
399
|
local uniqueGroup = parameters and parameters.uniqueGroup or defaultParameters and defaultParameters.uniqueGroup
|
|
373
400
|
if uniqueGroup ~= nil then
|
|
@@ -381,13 +408,16 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
381
408
|
level,
|
|
382
409
|
duration,
|
|
383
410
|
spellStealPriority,
|
|
384
|
-
learnLevelMinimum
|
|
411
|
+
learnLevelMinimum,
|
|
412
|
+
missProbability
|
|
385
413
|
) then
|
|
414
|
+
self[100] = 1
|
|
386
415
|
UnitBehavior.prototype.destroy(self)
|
|
387
416
|
error(unsuccessfulApplicationMarker, 0)
|
|
388
417
|
end
|
|
389
418
|
local handle = BlzGetUnitAbility(_unit.handle, typeId)
|
|
390
419
|
if handle == nil then
|
|
420
|
+
self[100] = 1
|
|
391
421
|
UnitBehavior.prototype.destroy(self)
|
|
392
422
|
error(unsuccessfulApplicationMarker, 0)
|
|
393
423
|
end
|
|
@@ -396,20 +426,20 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
396
426
|
self._level = level
|
|
397
427
|
self._spellStealPriority = spellStealPriority
|
|
398
428
|
self._learnLevelMinimum = learnLevelMinimum
|
|
399
|
-
self[
|
|
400
|
-
self[
|
|
401
|
-
self[
|
|
402
|
-
self[
|
|
403
|
-
self[
|
|
429
|
+
self[102] = source
|
|
430
|
+
self[103] = duration or 0
|
|
431
|
+
self[104] = uniqueGroup
|
|
432
|
+
self[105] = BlzGetAbilityStringLevelField(self.handle, ABILITY_SLF_EFFECT, 0)
|
|
433
|
+
self[106] = BlzGetAbilityStringLevelField(self.handle, ABILITY_SLF_SPECIAL, 0)
|
|
404
434
|
if parameters ~= nil or (next(defaultParameters)) ~= nil then
|
|
405
435
|
for ____, buffBooleanParameter in ipairs(buffBooleanParameters) do
|
|
406
|
-
local
|
|
407
|
-
local
|
|
408
|
-
local
|
|
409
|
-
if
|
|
410
|
-
|
|
436
|
+
local ____ability_24 = ability
|
|
437
|
+
local ____level_25 = level
|
|
438
|
+
local ____temp_23 = parameters and parameters[buffBooleanParameter]
|
|
439
|
+
if ____temp_23 == nil then
|
|
440
|
+
____temp_23 = defaultParameters[buffBooleanParameter]
|
|
411
441
|
end
|
|
412
|
-
if resolveBooleanValue(
|
|
442
|
+
if resolveBooleanValue(____ability_24, ____level_25, ____temp_23) then
|
|
413
443
|
self[buffBooleanParameter] = true
|
|
414
444
|
end
|
|
415
445
|
end
|
|
@@ -425,11 +455,11 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
425
455
|
end
|
|
426
456
|
local maximumDuration = parameters and parameters.maximumDuration or defaultParameters.maximumDuration
|
|
427
457
|
if maximumDuration ~= nil then
|
|
428
|
-
self[
|
|
458
|
+
self[108] = resolveNumberValue(ability, level, maximumDuration)
|
|
429
459
|
end
|
|
430
460
|
local maximumRemainingDuration = parameters and parameters.maximumRemainingDuration or defaultParameters.maximumRemainingDuration
|
|
431
461
|
if maximumRemainingDuration ~= nil then
|
|
432
|
-
self[
|
|
462
|
+
self[109] = resolveNumberValue(ability, level, maximumRemainingDuration)
|
|
433
463
|
end
|
|
434
464
|
local parametersAbilityTypeIds = parameters and parameters.abilityTypeIds or defaultParameters.abilityTypeIds
|
|
435
465
|
if parametersAbilityTypeIds ~= nil then
|
|
@@ -487,29 +517,34 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
487
517
|
self._timer = timer
|
|
488
518
|
end
|
|
489
519
|
self:onCreate()
|
|
520
|
+
self[100] = 1
|
|
521
|
+
Event.invoke(buffCreatedEvent, self)
|
|
490
522
|
end
|
|
491
|
-
function Buff.prototype.
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
523
|
+
function Buff.prototype.onAbilityGained(self, ability)
|
|
524
|
+
if __TS__InstanceOf(ability, UnitAbility) then
|
|
525
|
+
local abilityCooldownModifier = self[144]
|
|
526
|
+
if abilityCooldownModifier then
|
|
527
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:applyModifier(ability, abilityCooldownModifier)
|
|
528
|
+
end
|
|
529
|
+
end
|
|
495
530
|
end
|
|
496
|
-
function Buff.prototype.
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
531
|
+
function Buff.prototype.onAbilityLost(self, ability)
|
|
532
|
+
if __TS__InstanceOf(ability, UnitAbility) then
|
|
533
|
+
local abilityCooldownModifier = self[144]
|
|
534
|
+
if abilityCooldownModifier then
|
|
535
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:removeModifier(ability, abilityCooldownModifier)
|
|
536
|
+
end
|
|
501
537
|
end
|
|
502
|
-
bonusIdByBonusType[bonusType] = addOrUpdateOrRemoveUnitBonus(self._unit, bonusType, bonusIdByBonusType[bonusType], value)
|
|
503
538
|
end
|
|
504
539
|
function Buff.prototype.flashEffect(self, widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
505
540
|
if type(widgetOrXOrParametersOrDuration) == "number" and type(yOrParametersOrDuration) == "number" then
|
|
506
|
-
Effect:flash(self[
|
|
541
|
+
Effect:flash(self[105], widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
507
542
|
else
|
|
508
543
|
local isWidgetProvided = __TS__InstanceOf(widgetOrXOrParametersOrDuration, Unit) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Item) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Destructable)
|
|
509
544
|
local ____Effect_40 = Effect
|
|
510
545
|
local ____Effect_flash_41 = Effect.flash
|
|
511
546
|
local ____array_39 = __TS__SparseArrayNew(
|
|
512
|
-
self[
|
|
547
|
+
self[105],
|
|
513
548
|
isWidgetProvided and widgetOrXOrParametersOrDuration or self._unit,
|
|
514
549
|
stringValueByBuffTypeIdByFieldId[fourCC("feft")][self.typeId] or "origin"
|
|
515
550
|
)
|
|
@@ -531,7 +566,7 @@ function Buff.prototype.flashSpecialEffect(self, widgetOrDuration, duration)
|
|
|
531
566
|
local ____Effect_44 = Effect
|
|
532
567
|
local ____Effect_flash_45 = Effect.flash
|
|
533
568
|
local ____array_43 = __TS__SparseArrayNew(
|
|
534
|
-
self[
|
|
569
|
+
self[106],
|
|
535
570
|
isWidgetProvided and widgetOrDuration or self._unit,
|
|
536
571
|
stringValueByBuffTypeIdByFieldId[fourCC("fspt")][self.typeId] or "origin"
|
|
537
572
|
)
|
|
@@ -550,20 +585,22 @@ end
|
|
|
550
585
|
function Buff.prototype.onCreate(self)
|
|
551
586
|
end
|
|
552
587
|
function Buff.prototype.onDestroy(self)
|
|
588
|
+
check(self[100] ~= 0, "Cannot destroy a buff that has not finished creating yet.")
|
|
589
|
+
self[100] = 2
|
|
553
590
|
local unit = self._unit
|
|
554
591
|
if getUnitAbility(unit.handle, self.typeId) == self.handle then
|
|
555
592
|
removeBuff(unit.handle, self.typeId)
|
|
556
593
|
end
|
|
557
594
|
buffByTypeIdByUnit[unit][self.typeId] = nil
|
|
558
|
-
local healingIntervalTimer = self[
|
|
595
|
+
local healingIntervalTimer = self[119]
|
|
559
596
|
if healingIntervalTimer ~= nil then
|
|
560
597
|
healingIntervalTimer:destroy()
|
|
561
|
-
self[
|
|
598
|
+
self[119] = nil
|
|
562
599
|
end
|
|
563
|
-
local damageIntervalTimer = self[
|
|
600
|
+
local damageIntervalTimer = self[114]
|
|
564
601
|
if damageIntervalTimer ~= nil then
|
|
565
602
|
damageIntervalTimer:destroy()
|
|
566
|
-
self[
|
|
603
|
+
self[114] = nil
|
|
567
604
|
end
|
|
568
605
|
if self._timer ~= nil then
|
|
569
606
|
self._timer:destroy()
|
|
@@ -573,25 +610,34 @@ function Buff.prototype.onDestroy(self)
|
|
|
573
610
|
behavior:destroy()
|
|
574
611
|
end
|
|
575
612
|
end
|
|
576
|
-
|
|
613
|
+
local previousAbilityCooldownModifier = self[144]
|
|
614
|
+
if previousAbilityCooldownModifier then
|
|
615
|
+
for ____, ability in ipairs(self._unit.abilities) do
|
|
616
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:removeModifier(ability, previousAbilityCooldownModifier)
|
|
617
|
+
end
|
|
618
|
+
end
|
|
619
|
+
if self[139] then
|
|
620
|
+
unit:decrementInvulnerabilityCounter()
|
|
621
|
+
end
|
|
622
|
+
if self[138] then
|
|
577
623
|
unit:decrementDisableAutoAttackCounter()
|
|
578
624
|
end
|
|
579
|
-
if self[
|
|
580
|
-
if self[
|
|
581
|
-
unit:
|
|
625
|
+
if self[136] then
|
|
626
|
+
if self[137] then
|
|
627
|
+
unit:decrementForceStunCounter()
|
|
582
628
|
end
|
|
583
629
|
unit:decrementStunCounter()
|
|
584
630
|
end
|
|
631
|
+
if self[135] then
|
|
632
|
+
unit:decrementGhostCounter()
|
|
633
|
+
end
|
|
585
634
|
if self._abilityTypeIds ~= nil then
|
|
586
635
|
for abilityTypeId in pairs(self._abilityTypeIds) do
|
|
587
636
|
unit:removeAbility(abilityTypeId)
|
|
588
637
|
end
|
|
589
638
|
end
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
removeUnitBonus(unit, bonusType, bonusId)
|
|
593
|
-
end
|
|
594
|
-
end
|
|
639
|
+
Event.invoke(buffBeingDestroyedEvent, self)
|
|
640
|
+
self[100] = 3
|
|
595
641
|
return UnitBehavior.prototype.onDestroy(self)
|
|
596
642
|
end
|
|
597
643
|
function Buff.apply(self, ...)
|
|
@@ -628,72 +674,72 @@ function Buff.getByTypeId(self, unit, typeId)
|
|
|
628
674
|
end
|
|
629
675
|
function Buff.prototype.onExpiration(self)
|
|
630
676
|
local unit = self.unit
|
|
631
|
-
if self[119] ~= nil then
|
|
632
|
-
(self[101] or unit):damageTarget(unit, self[119] or 0)
|
|
633
|
-
end
|
|
634
677
|
if self[120] ~= nil then
|
|
635
|
-
(self[
|
|
678
|
+
(self[102] or unit):damageTarget(unit, self[120] or 0)
|
|
636
679
|
end
|
|
637
|
-
if self[
|
|
680
|
+
if self[121] ~= nil then
|
|
681
|
+
(self[102] or unit):healTarget(unit, self[120] or 0)
|
|
682
|
+
end
|
|
683
|
+
if self[141] then
|
|
638
684
|
unit:explode()
|
|
639
|
-
elseif self[
|
|
685
|
+
elseif self[140] then
|
|
640
686
|
unit:kill()
|
|
641
687
|
end
|
|
642
688
|
end
|
|
643
689
|
function Buff.prototype.onDeath(self, source)
|
|
644
690
|
local unit = self.unit
|
|
645
|
-
if self[
|
|
691
|
+
if self[122] ~= nil then
|
|
646
692
|
damageArea(
|
|
647
|
-
self[
|
|
648
|
-
self[
|
|
693
|
+
self[102] or unit,
|
|
694
|
+
self[122],
|
|
649
695
|
unit.x,
|
|
650
696
|
unit.y,
|
|
697
|
+
self[124] or 0,
|
|
651
698
|
self[123] or 0,
|
|
652
|
-
self[
|
|
699
|
+
self[126] or 0,
|
|
653
700
|
self[125] or 0,
|
|
654
|
-
self[
|
|
655
|
-
self[127] or 0
|
|
656
|
-
self[126] or 0
|
|
701
|
+
self[128] or 0,
|
|
702
|
+
self[127] or 0
|
|
657
703
|
)
|
|
658
704
|
end
|
|
659
705
|
end
|
|
660
706
|
function Buff.prototype.onDamageDealt(self, target, event)
|
|
661
707
|
if event.isAttack then
|
|
662
|
-
if self[
|
|
663
|
-
local durationIncrease = self[
|
|
664
|
-
local maximumDuration = self[
|
|
708
|
+
if self[107] ~= nil then
|
|
709
|
+
local durationIncrease = self[107]
|
|
710
|
+
local maximumDuration = self[108] or 0
|
|
665
711
|
if maximumDuration > 0 then
|
|
666
712
|
durationIncrease = min(
|
|
667
713
|
durationIncrease,
|
|
668
|
-
max(0, maximumDuration - self[
|
|
714
|
+
max(0, maximumDuration - self[103])
|
|
669
715
|
)
|
|
670
716
|
end
|
|
671
717
|
local remainingDuration = self.remainingDuration + durationIncrease
|
|
672
|
-
local maximumRemainingDuration = self[
|
|
718
|
+
local maximumRemainingDuration = self[109] or 0
|
|
673
719
|
if maximumRemainingDuration > 0 then
|
|
674
720
|
remainingDuration = min(remainingDuration, maximumRemainingDuration)
|
|
675
721
|
end
|
|
676
722
|
self.remainingDuration = remainingDuration
|
|
677
723
|
end
|
|
678
|
-
local autoAttackCount = (self[
|
|
679
|
-
self[
|
|
680
|
-
if autoAttackCount == self[
|
|
724
|
+
local autoAttackCount = (self[129] or 0) + 1
|
|
725
|
+
self[129] = autoAttackCount
|
|
726
|
+
if autoAttackCount == self[130] then
|
|
681
727
|
self:destroy()
|
|
682
728
|
end
|
|
683
729
|
end
|
|
684
730
|
if event.originalAmount ~= 0 then
|
|
685
|
-
local damageDealtEventCount = (self[
|
|
686
|
-
self[
|
|
687
|
-
if damageDealtEventCount == self[
|
|
731
|
+
local damageDealtEventCount = (self[131] or 0) + 1
|
|
732
|
+
self[131] = damageDealtEventCount
|
|
733
|
+
if damageDealtEventCount == self[132] then
|
|
688
734
|
self:destroy()
|
|
689
735
|
end
|
|
690
736
|
end
|
|
691
737
|
end
|
|
692
738
|
function Buff.prototype.onDamageReceived(self, source, event)
|
|
693
739
|
if event.originalAmount ~= 0 then
|
|
694
|
-
local damageReceivedEventCount = (self[
|
|
695
|
-
self[
|
|
696
|
-
if damageReceivedEventCount == self[
|
|
740
|
+
local damageReceivedEventCount = (self[133] or 0) + 1
|
|
741
|
+
self[133] = damageReceivedEventCount
|
|
742
|
+
if damageReceivedEventCount == self[134] then
|
|
697
743
|
self:destroy()
|
|
698
744
|
end
|
|
699
745
|
end
|
|
@@ -703,7 +749,7 @@ __TS__SetDescriptor(
|
|
|
703
749
|
Buff.prototype,
|
|
704
750
|
"source",
|
|
705
751
|
{get = function(self)
|
|
706
|
-
return self[
|
|
752
|
+
return self[102] or self._unit
|
|
707
753
|
end},
|
|
708
754
|
true
|
|
709
755
|
)
|
|
@@ -720,13 +766,13 @@ __TS__SetDescriptor(
|
|
|
720
766
|
"remainingDamageOverDuration",
|
|
721
767
|
{
|
|
722
768
|
get = function(self)
|
|
723
|
-
return self[
|
|
769
|
+
return self[113] or 0
|
|
724
770
|
end,
|
|
725
771
|
set = function(self, remainingDamageOverDuration)
|
|
726
|
-
local remainingDamageOverDurationDelta = remainingDamageOverDuration - (self[
|
|
727
|
-
self[
|
|
728
|
-
local damageOverDuration = (self[
|
|
729
|
-
self[
|
|
772
|
+
local remainingDamageOverDurationDelta = remainingDamageOverDuration - (self[113] or 0)
|
|
773
|
+
self[113] = remainingDamageOverDuration ~= 0 and remainingDamageOverDuration or nil
|
|
774
|
+
local damageOverDuration = (self[110] or 0) + remainingDamageOverDurationDelta
|
|
775
|
+
self[110] = damageOverDuration ~= 0 and damageOverDuration or nil
|
|
730
776
|
end
|
|
731
777
|
},
|
|
732
778
|
true
|
|
@@ -736,13 +782,13 @@ __TS__SetDescriptor(
|
|
|
736
782
|
"damageOverDuration",
|
|
737
783
|
{
|
|
738
784
|
get = function(self)
|
|
739
|
-
return self[
|
|
785
|
+
return self[110] or 0
|
|
740
786
|
end,
|
|
741
787
|
set = function(self, damageOverDuration)
|
|
742
|
-
local damageOverDurationDelta = damageOverDuration - (self[
|
|
743
|
-
self[
|
|
744
|
-
local remainingDamageOverDuration = (self[
|
|
745
|
-
self[
|
|
788
|
+
local damageOverDurationDelta = damageOverDuration - (self[110] or 0)
|
|
789
|
+
self[110] = damageOverDuration ~= 0 and damageOverDuration or nil
|
|
790
|
+
local remainingDamageOverDuration = (self[113] or 0) + damageOverDurationDelta
|
|
791
|
+
self[113] = remainingDamageOverDuration ~= 0 and remainingDamageOverDuration or nil
|
|
746
792
|
end
|
|
747
793
|
},
|
|
748
794
|
true
|
|
@@ -752,10 +798,10 @@ __TS__SetDescriptor(
|
|
|
752
798
|
"damagePerInterval",
|
|
753
799
|
{
|
|
754
800
|
get = function(self)
|
|
755
|
-
return self[
|
|
801
|
+
return self[111] or 0
|
|
756
802
|
end,
|
|
757
803
|
set = function(self, damagePerInterval)
|
|
758
|
-
self[
|
|
804
|
+
self[111] = damagePerInterval ~= 0 and damagePerInterval or nil
|
|
759
805
|
end
|
|
760
806
|
},
|
|
761
807
|
true
|
|
@@ -765,25 +811,25 @@ __TS__SetDescriptor(
|
|
|
765
811
|
"damageInterval",
|
|
766
812
|
{
|
|
767
813
|
get = function(self)
|
|
768
|
-
return self[
|
|
814
|
+
return self[112] or 0
|
|
769
815
|
end,
|
|
770
816
|
set = function(self, damageInterval)
|
|
771
817
|
if damageInterval <= 0 then
|
|
772
|
-
self[
|
|
773
|
-
local timer = self[
|
|
818
|
+
self[112] = damageInterval ~= 0 and damageInterval or nil
|
|
819
|
+
local timer = self[114]
|
|
774
820
|
if timer ~= nil then
|
|
775
821
|
timer:destroy()
|
|
776
|
-
self[
|
|
822
|
+
self[114] = nil
|
|
777
823
|
end
|
|
778
824
|
return
|
|
779
825
|
end
|
|
780
|
-
self[
|
|
826
|
+
self[112] = damageInterval
|
|
781
827
|
local ____opt_48 = self._timer
|
|
782
828
|
local elapsed = ____opt_48 and ____opt_48.elapsed or 0
|
|
783
|
-
local timer = self[
|
|
829
|
+
local timer = self[114]
|
|
784
830
|
if timer == nil then
|
|
785
831
|
timer = Timer:create()
|
|
786
|
-
self[
|
|
832
|
+
self[114] = timer
|
|
787
833
|
end
|
|
788
834
|
local initialDelay = damageInterval - (elapsed >= damageInterval and math.fmod(elapsed, damageInterval) or elapsed)
|
|
789
835
|
if initialDelay == damageInterval then
|
|
@@ -800,13 +846,13 @@ __TS__SetDescriptor(
|
|
|
800
846
|
"remainingHealingOverDuration",
|
|
801
847
|
{
|
|
802
848
|
get = function(self)
|
|
803
|
-
return self[
|
|
849
|
+
return self[118] or 0
|
|
804
850
|
end,
|
|
805
851
|
set = function(self, remainingHealingOverDuration)
|
|
806
|
-
local remainingHealingOverDurationDelta = remainingHealingOverDuration - (self[
|
|
807
|
-
self[
|
|
808
|
-
local healingOverDuration = (self[
|
|
809
|
-
self[
|
|
852
|
+
local remainingHealingOverDurationDelta = remainingHealingOverDuration - (self[118] or 0)
|
|
853
|
+
self[113] = remainingHealingOverDuration ~= 0 and remainingHealingOverDuration or nil
|
|
854
|
+
local healingOverDuration = (self[115] or 0) + remainingHealingOverDurationDelta
|
|
855
|
+
self[115] = healingOverDuration ~= 0 and healingOverDuration or nil
|
|
810
856
|
end
|
|
811
857
|
},
|
|
812
858
|
true
|
|
@@ -816,13 +862,13 @@ __TS__SetDescriptor(
|
|
|
816
862
|
"healingOverDuration",
|
|
817
863
|
{
|
|
818
864
|
get = function(self)
|
|
819
|
-
return self[
|
|
865
|
+
return self[115] or 0
|
|
820
866
|
end,
|
|
821
867
|
set = function(self, healingOverDuration)
|
|
822
|
-
local healingOverDurationDelta = healingOverDuration - (self[
|
|
823
|
-
self[
|
|
824
|
-
local remainingHealingOverDuration = (self[
|
|
825
|
-
self[
|
|
868
|
+
local healingOverDurationDelta = healingOverDuration - (self[115] or 0)
|
|
869
|
+
self[115] = healingOverDuration ~= 0 and healingOverDuration or nil
|
|
870
|
+
local remainingHealingOverDuration = (self[118] or 0) + healingOverDurationDelta
|
|
871
|
+
self[118] = remainingHealingOverDuration ~= 0 and remainingHealingOverDuration or nil
|
|
826
872
|
end
|
|
827
873
|
},
|
|
828
874
|
true
|
|
@@ -832,10 +878,10 @@ __TS__SetDescriptor(
|
|
|
832
878
|
"healingPerInterval",
|
|
833
879
|
{
|
|
834
880
|
get = function(self)
|
|
835
|
-
return self[
|
|
881
|
+
return self[116] or 0
|
|
836
882
|
end,
|
|
837
883
|
set = function(self, healingPerInterval)
|
|
838
|
-
self[
|
|
884
|
+
self[116] = healingPerInterval ~= 0 and healingPerInterval or nil
|
|
839
885
|
end
|
|
840
886
|
},
|
|
841
887
|
true
|
|
@@ -845,25 +891,25 @@ __TS__SetDescriptor(
|
|
|
845
891
|
"healingInterval",
|
|
846
892
|
{
|
|
847
893
|
get = function(self)
|
|
848
|
-
return self[
|
|
894
|
+
return self[117] or 0
|
|
849
895
|
end,
|
|
850
896
|
set = function(self, healingInterval)
|
|
851
897
|
if healingInterval <= 0 then
|
|
852
|
-
self[
|
|
853
|
-
local timer = self[
|
|
898
|
+
self[117] = healingInterval ~= 0 and healingInterval or nil
|
|
899
|
+
local timer = self[119]
|
|
854
900
|
if timer ~= nil then
|
|
855
901
|
timer:destroy()
|
|
856
|
-
self[
|
|
902
|
+
self[119] = nil
|
|
857
903
|
end
|
|
858
904
|
return
|
|
859
905
|
end
|
|
860
|
-
self[
|
|
906
|
+
self[117] = healingInterval
|
|
861
907
|
local ____opt_50 = self._timer
|
|
862
908
|
local elapsed = ____opt_50 and ____opt_50.elapsed or 0
|
|
863
|
-
local timer = self[
|
|
909
|
+
local timer = self[119]
|
|
864
910
|
if timer == nil then
|
|
865
911
|
timer = Timer:create()
|
|
866
|
-
self[
|
|
912
|
+
self[119] = timer
|
|
867
913
|
end
|
|
868
914
|
local initialDelay = healingInterval - (elapsed >= healingInterval and math.fmod(elapsed, healingInterval) or elapsed)
|
|
869
915
|
if initialDelay == healingInterval then
|
|
@@ -880,10 +926,10 @@ __TS__SetDescriptor(
|
|
|
880
926
|
"damageOnExpiration",
|
|
881
927
|
{
|
|
882
928
|
get = function(self)
|
|
883
|
-
return self[
|
|
929
|
+
return self[120] or 0
|
|
884
930
|
end,
|
|
885
931
|
set = function(self, damageOnExpiration)
|
|
886
|
-
self[
|
|
932
|
+
self[120] = damageOnExpiration ~= 0 and damageOnExpiration or nil
|
|
887
933
|
end
|
|
888
934
|
},
|
|
889
935
|
true
|
|
@@ -893,10 +939,10 @@ __TS__SetDescriptor(
|
|
|
893
939
|
"healingOnExpiration",
|
|
894
940
|
{
|
|
895
941
|
get = function(self)
|
|
896
|
-
return self[
|
|
942
|
+
return self[121] or 0
|
|
897
943
|
end,
|
|
898
944
|
set = function(self, healingOnExpiration)
|
|
899
|
-
self[
|
|
945
|
+
self[121] = healingOnExpiration ~= 0 and healingOnExpiration or nil
|
|
900
946
|
end
|
|
901
947
|
},
|
|
902
948
|
true
|
|
@@ -940,30 +986,53 @@ __TS__SetDescriptor(
|
|
|
940
986
|
},
|
|
941
987
|
true
|
|
942
988
|
)
|
|
989
|
+
__TS__SetDescriptor(
|
|
990
|
+
Buff.prototype,
|
|
991
|
+
"turnsIntoGhost",
|
|
992
|
+
{
|
|
993
|
+
get = function(self)
|
|
994
|
+
local ____self__135_52 = self[135]
|
|
995
|
+
if ____self__135_52 == nil then
|
|
996
|
+
____self__135_52 = false
|
|
997
|
+
end
|
|
998
|
+
return ____self__135_52
|
|
999
|
+
end,
|
|
1000
|
+
set = function(self, turnsIntoGhost)
|
|
1001
|
+
if not turnsIntoGhost and self[135] then
|
|
1002
|
+
self.object:decrementGhostCounter()
|
|
1003
|
+
self[135] = nil
|
|
1004
|
+
elseif turnsIntoGhost and not self[135] then
|
|
1005
|
+
self.object:incrementGhostCounter()
|
|
1006
|
+
self[135] = true
|
|
1007
|
+
end
|
|
1008
|
+
end
|
|
1009
|
+
},
|
|
1010
|
+
true
|
|
1011
|
+
)
|
|
943
1012
|
__TS__SetDescriptor(
|
|
944
1013
|
Buff.prototype,
|
|
945
1014
|
"stuns",
|
|
946
1015
|
{
|
|
947
1016
|
get = function(self)
|
|
948
|
-
local
|
|
949
|
-
if
|
|
950
|
-
|
|
1017
|
+
local ____self__136_53 = self[136]
|
|
1018
|
+
if ____self__136_53 == nil then
|
|
1019
|
+
____self__136_53 = false
|
|
951
1020
|
end
|
|
952
|
-
return
|
|
1021
|
+
return ____self__136_53
|
|
953
1022
|
end,
|
|
954
1023
|
set = function(self, stuns)
|
|
955
|
-
if not stuns and self[
|
|
956
|
-
if self[
|
|
957
|
-
self.object:
|
|
1024
|
+
if not stuns and self[136] then
|
|
1025
|
+
if self[137] then
|
|
1026
|
+
self.object:decrementForceStunCounter()
|
|
958
1027
|
end
|
|
959
1028
|
self.object:decrementStunCounter()
|
|
960
|
-
self[
|
|
961
|
-
elseif stuns and not self[
|
|
962
|
-
if self[
|
|
963
|
-
self.object:
|
|
1029
|
+
self[136] = nil
|
|
1030
|
+
elseif stuns and not self[136] then
|
|
1031
|
+
if self[137] then
|
|
1032
|
+
self.object:incrementForceStunCounter()
|
|
964
1033
|
end
|
|
965
1034
|
self.object:incrementStunCounter()
|
|
966
|
-
self[
|
|
1035
|
+
self[136] = true
|
|
967
1036
|
end
|
|
968
1037
|
end
|
|
969
1038
|
},
|
|
@@ -974,23 +1043,23 @@ __TS__SetDescriptor(
|
|
|
974
1043
|
"ignoresStunImmunity",
|
|
975
1044
|
{
|
|
976
1045
|
get = function(self)
|
|
977
|
-
local
|
|
978
|
-
if
|
|
979
|
-
|
|
1046
|
+
local ____self__137_54 = self[137]
|
|
1047
|
+
if ____self__137_54 == nil then
|
|
1048
|
+
____self__137_54 = false
|
|
980
1049
|
end
|
|
981
|
-
return
|
|
1050
|
+
return ____self__137_54
|
|
982
1051
|
end,
|
|
983
1052
|
set = function(self, ignoresStunImmunity)
|
|
984
|
-
if not ignoresStunImmunity and self[
|
|
985
|
-
if self[
|
|
986
|
-
self.object:
|
|
1053
|
+
if not ignoresStunImmunity and self[137] then
|
|
1054
|
+
if self[136] then
|
|
1055
|
+
self.object:decrementForceStunCounter()
|
|
987
1056
|
end
|
|
988
|
-
self[
|
|
989
|
-
elseif ignoresStunImmunity and not self[
|
|
990
|
-
if self[
|
|
991
|
-
self.object:
|
|
1057
|
+
self[137] = nil
|
|
1058
|
+
elseif ignoresStunImmunity and not self[137] then
|
|
1059
|
+
if self[136] then
|
|
1060
|
+
self.object:incrementForceStunCounter()
|
|
992
1061
|
end
|
|
993
|
-
self[
|
|
1062
|
+
self[137] = true
|
|
994
1063
|
end
|
|
995
1064
|
end
|
|
996
1065
|
},
|
|
@@ -1001,19 +1070,19 @@ __TS__SetDescriptor(
|
|
|
1001
1070
|
"disablesAutoAttack",
|
|
1002
1071
|
{
|
|
1003
1072
|
get = function(self)
|
|
1004
|
-
local
|
|
1005
|
-
if
|
|
1006
|
-
|
|
1073
|
+
local ____self__138_55 = self[138]
|
|
1074
|
+
if ____self__138_55 == nil then
|
|
1075
|
+
____self__138_55 = false
|
|
1007
1076
|
end
|
|
1008
|
-
return
|
|
1077
|
+
return ____self__138_55
|
|
1009
1078
|
end,
|
|
1010
1079
|
set = function(self, disablesAutoAttack)
|
|
1011
|
-
if not disablesAutoAttack and self[
|
|
1080
|
+
if not disablesAutoAttack and self[138] then
|
|
1012
1081
|
self.object:decrementDisableAutoAttackCounter()
|
|
1013
|
-
self[
|
|
1014
|
-
elseif disablesAutoAttack and not self[
|
|
1082
|
+
self[138] = nil
|
|
1083
|
+
elseif disablesAutoAttack and not self[138] then
|
|
1015
1084
|
self.object:incrementDisableAutoAttackCounter()
|
|
1016
|
-
self[
|
|
1085
|
+
self[138] = true
|
|
1017
1086
|
end
|
|
1018
1087
|
end
|
|
1019
1088
|
},
|
|
@@ -1024,19 +1093,19 @@ __TS__SetDescriptor(
|
|
|
1024
1093
|
"providesInvulnerability",
|
|
1025
1094
|
{
|
|
1026
1095
|
get = function(self)
|
|
1027
|
-
local
|
|
1028
|
-
if
|
|
1029
|
-
|
|
1096
|
+
local ____self__139_56 = self[139]
|
|
1097
|
+
if ____self__139_56 == nil then
|
|
1098
|
+
____self__139_56 = false
|
|
1030
1099
|
end
|
|
1031
|
-
return
|
|
1100
|
+
return ____self__139_56
|
|
1032
1101
|
end,
|
|
1033
1102
|
set = function(self, providesInvulnerability)
|
|
1034
|
-
if not providesInvulnerability and self[
|
|
1103
|
+
if not providesInvulnerability and self[139] then
|
|
1035
1104
|
self.object:decrementInvulnerabilityCounter()
|
|
1036
|
-
self[
|
|
1037
|
-
elseif providesInvulnerability and not self[
|
|
1105
|
+
self[139] = nil
|
|
1106
|
+
elseif providesInvulnerability and not self[139] then
|
|
1038
1107
|
self.object:incrementInvulnerabilityCounter()
|
|
1039
|
-
self[
|
|
1108
|
+
self[139] = true
|
|
1040
1109
|
end
|
|
1041
1110
|
end
|
|
1042
1111
|
},
|
|
@@ -1047,17 +1116,17 @@ __TS__SetDescriptor(
|
|
|
1047
1116
|
"killsOnExpiration",
|
|
1048
1117
|
{
|
|
1049
1118
|
get = function(self)
|
|
1050
|
-
local
|
|
1051
|
-
if
|
|
1052
|
-
|
|
1119
|
+
local ____self__140_57 = self[140]
|
|
1120
|
+
if ____self__140_57 == nil then
|
|
1121
|
+
____self__140_57 = false
|
|
1053
1122
|
end
|
|
1054
|
-
return
|
|
1123
|
+
return ____self__140_57
|
|
1055
1124
|
end,
|
|
1056
1125
|
set = function(self, killsOnExpiration)
|
|
1057
|
-
if not killsOnExpiration and self[
|
|
1058
|
-
self[
|
|
1059
|
-
elseif killsOnExpiration and not self[
|
|
1060
|
-
self[
|
|
1126
|
+
if not killsOnExpiration and self[140] then
|
|
1127
|
+
self[140] = nil
|
|
1128
|
+
elseif killsOnExpiration and not self[140] then
|
|
1129
|
+
self[140] = true
|
|
1061
1130
|
end
|
|
1062
1131
|
end
|
|
1063
1132
|
},
|
|
@@ -1068,17 +1137,17 @@ __TS__SetDescriptor(
|
|
|
1068
1137
|
"explodesOnExpiration",
|
|
1069
1138
|
{
|
|
1070
1139
|
get = function(self)
|
|
1071
|
-
local
|
|
1072
|
-
if
|
|
1073
|
-
|
|
1140
|
+
local ____self__141_58 = self[141]
|
|
1141
|
+
if ____self__141_58 == nil then
|
|
1142
|
+
____self__141_58 = false
|
|
1074
1143
|
end
|
|
1075
|
-
return
|
|
1144
|
+
return ____self__141_58
|
|
1076
1145
|
end,
|
|
1077
1146
|
set = function(self, killsOnExpiration)
|
|
1078
|
-
if not killsOnExpiration and self[
|
|
1079
|
-
self[
|
|
1080
|
-
elseif killsOnExpiration and not self[
|
|
1081
|
-
self[
|
|
1147
|
+
if not killsOnExpiration and self[141] then
|
|
1148
|
+
self[141] = nil
|
|
1149
|
+
elseif killsOnExpiration and not self[141] then
|
|
1150
|
+
self[141] = true
|
|
1082
1151
|
end
|
|
1083
1152
|
end
|
|
1084
1153
|
},
|
|
@@ -1089,13 +1158,13 @@ __TS__SetDescriptor(
|
|
|
1089
1158
|
"maximumDamageDealtEventCount",
|
|
1090
1159
|
{
|
|
1091
1160
|
get = function(self)
|
|
1092
|
-
return self[
|
|
1161
|
+
return self[132] or 0
|
|
1093
1162
|
end,
|
|
1094
1163
|
set = function(self, maximumDamageDealtEventCount)
|
|
1095
1164
|
if maximumDamageDealtEventCount == 0 then
|
|
1096
|
-
self[
|
|
1165
|
+
self[132] = nil
|
|
1097
1166
|
else
|
|
1098
|
-
self[
|
|
1167
|
+
self[132] = maximumDamageDealtEventCount
|
|
1099
1168
|
end
|
|
1100
1169
|
end
|
|
1101
1170
|
},
|
|
@@ -1106,13 +1175,13 @@ __TS__SetDescriptor(
|
|
|
1106
1175
|
"maximumDamageReceivedEventCount",
|
|
1107
1176
|
{
|
|
1108
1177
|
get = function(self)
|
|
1109
|
-
return self[
|
|
1178
|
+
return self[134] or 0
|
|
1110
1179
|
end,
|
|
1111
1180
|
set = function(self, maximumDamageReceivedEventCount)
|
|
1112
1181
|
if maximumDamageReceivedEventCount == 0 then
|
|
1113
|
-
self[
|
|
1182
|
+
self[134] = nil
|
|
1114
1183
|
else
|
|
1115
|
-
self[
|
|
1184
|
+
self[134] = maximumDamageReceivedEventCount
|
|
1116
1185
|
end
|
|
1117
1186
|
end
|
|
1118
1187
|
},
|
|
@@ -1123,13 +1192,13 @@ __TS__SetDescriptor(
|
|
|
1123
1192
|
"maximumAutoAttackCount",
|
|
1124
1193
|
{
|
|
1125
1194
|
get = function(self)
|
|
1126
|
-
return self[
|
|
1195
|
+
return self[130] or 0
|
|
1127
1196
|
end,
|
|
1128
1197
|
set = function(self, maximumAutoAttackCount)
|
|
1129
1198
|
if maximumAutoAttackCount == 0 then
|
|
1130
|
-
self[
|
|
1199
|
+
self[130] = nil
|
|
1131
1200
|
else
|
|
1132
|
-
self[
|
|
1201
|
+
self[130] = maximumAutoAttackCount
|
|
1133
1202
|
end
|
|
1134
1203
|
end
|
|
1135
1204
|
},
|
|
@@ -1140,10 +1209,10 @@ __TS__SetDescriptor(
|
|
|
1140
1209
|
"durationIncreaseOnAutoAttack",
|
|
1141
1210
|
{
|
|
1142
1211
|
get = function(self)
|
|
1143
|
-
return self[
|
|
1212
|
+
return self[107] or 0
|
|
1144
1213
|
end,
|
|
1145
1214
|
set = function(self, durationIncreaseOnAutoAttack)
|
|
1146
|
-
self[
|
|
1215
|
+
self[107] = durationIncreaseOnAutoAttack
|
|
1147
1216
|
end
|
|
1148
1217
|
},
|
|
1149
1218
|
true
|
|
@@ -1174,11 +1243,37 @@ __TS__SetDescriptor(
|
|
|
1174
1243
|
},
|
|
1175
1244
|
true
|
|
1176
1245
|
)
|
|
1246
|
+
__TS__SetDescriptor(
|
|
1247
|
+
Buff.prototype,
|
|
1248
|
+
"evasionProbability",
|
|
1249
|
+
{
|
|
1250
|
+
get = function(self)
|
|
1251
|
+
return self:getUnitBonus(UnitBonusType.EVASION_PROBABILITY)
|
|
1252
|
+
end,
|
|
1253
|
+
set = function(self, evasionProbability)
|
|
1254
|
+
self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.EVASION_PROBABILITY, evasionProbability)
|
|
1255
|
+
end
|
|
1256
|
+
},
|
|
1257
|
+
true
|
|
1258
|
+
)
|
|
1259
|
+
__TS__SetDescriptor(
|
|
1260
|
+
Buff.prototype,
|
|
1261
|
+
"manaRegenerationRateIncreaseFactor",
|
|
1262
|
+
{
|
|
1263
|
+
get = function(self)
|
|
1264
|
+
return self:getUnitBonus(UnitBonusType.MANA_REGENERATION_RATE_FACTOR)
|
|
1265
|
+
end,
|
|
1266
|
+
set = function(self, manaRegenerationRateIncreaseFactor)
|
|
1267
|
+
self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.MANA_REGENERATION_RATE_FACTOR, manaRegenerationRateIncreaseFactor)
|
|
1268
|
+
end
|
|
1269
|
+
},
|
|
1270
|
+
true
|
|
1271
|
+
)
|
|
1177
1272
|
__TS__SetDescriptor(
|
|
1178
1273
|
Buff.prototype,
|
|
1179
1274
|
"duration",
|
|
1180
1275
|
{get = function(self)
|
|
1181
|
-
return self[
|
|
1276
|
+
return self[103]
|
|
1182
1277
|
end},
|
|
1183
1278
|
true
|
|
1184
1279
|
)
|
|
@@ -1187,15 +1282,15 @@ __TS__SetDescriptor(
|
|
|
1187
1282
|
"remainingDuration",
|
|
1188
1283
|
{
|
|
1189
1284
|
get = function(self)
|
|
1190
|
-
local
|
|
1191
|
-
return
|
|
1285
|
+
local ____opt_59 = self._timer
|
|
1286
|
+
return ____opt_59 and ____opt_59.remaining or 0
|
|
1192
1287
|
end,
|
|
1193
1288
|
set = function(self, remainingDuration)
|
|
1194
|
-
local
|
|
1195
|
-
local
|
|
1196
|
-
local remainingDurationDelta =
|
|
1289
|
+
local ____remainingDuration_63 = remainingDuration
|
|
1290
|
+
local ____opt_61 = self._timer
|
|
1291
|
+
local remainingDurationDelta = ____remainingDuration_63 - (____opt_61 and ____opt_61.remaining or 0)
|
|
1197
1292
|
if remainingDurationDelta ~= 0 then
|
|
1198
|
-
self[
|
|
1293
|
+
self[103] = self[103] + remainingDurationDelta
|
|
1199
1294
|
if remainingDuration <= 0 then
|
|
1200
1295
|
Timer:run(destroyBuff, self)
|
|
1201
1296
|
else
|
|
@@ -1207,7 +1302,8 @@ __TS__SetDescriptor(
|
|
|
1207
1302
|
self._level,
|
|
1208
1303
|
remainingDuration,
|
|
1209
1304
|
self._spellStealPriority,
|
|
1210
|
-
self._learnLevelMinimum
|
|
1305
|
+
self._learnLevelMinimum,
|
|
1306
|
+
self[142]
|
|
1211
1307
|
) then
|
|
1212
1308
|
local timer = self._timer
|
|
1213
1309
|
if timer == nil then
|
|
@@ -1221,10 +1317,38 @@ __TS__SetDescriptor(
|
|
|
1221
1317
|
end
|
|
1222
1318
|
},
|
|
1223
1319
|
true
|
|
1224
|
-
)
|
|
1320
|
+
)
|
|
1321
|
+
__TS__SetDescriptor(
|
|
1322
|
+
Buff.prototype,
|
|
1323
|
+
"abilityCooldownFactor",
|
|
1324
|
+
{
|
|
1325
|
+
get = function(self)
|
|
1326
|
+
return self[143] or 1
|
|
1327
|
+
end,
|
|
1328
|
+
set = function(self, abilityCooldownFactor)
|
|
1329
|
+
local previousAbilityCooldownModifier = self[144]
|
|
1330
|
+
if previousAbilityCooldownModifier then
|
|
1331
|
+
for ____, ability in ipairs(self._unit.abilities) do
|
|
1332
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:removeModifier(ability, previousAbilityCooldownModifier)
|
|
1333
|
+
end
|
|
1334
|
+
end
|
|
1335
|
+
local function modifier(ability, level, cooldown)
|
|
1336
|
+
return cooldown * abilityCooldownFactor
|
|
1337
|
+
end
|
|
1338
|
+
for ____, ability in ipairs(self._unit.abilities) do
|
|
1339
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:applyModifier(ability, modifier)
|
|
1340
|
+
end
|
|
1341
|
+
self[144] = modifier
|
|
1342
|
+
self[143] = abilityCooldownFactor
|
|
1343
|
+
end
|
|
1344
|
+
},
|
|
1345
|
+
true
|
|
1346
|
+
)
|
|
1347
|
+
Buff.createdEvent = buffCreatedEvent
|
|
1348
|
+
Buff.beingDestroyedEvent = buffBeingDestroyedEvent;
|
|
1225
1349
|
(function(self)
|
|
1226
1350
|
local function destroyBuffIfNeeded(buff)
|
|
1227
|
-
if getUnitAbility(buff[
|
|
1351
|
+
if getUnitAbility(buff[101].handle, buff.typeId) ~= buff.handle and buff[100] == 1 then
|
|
1228
1352
|
buff:destroy()
|
|
1229
1353
|
end
|
|
1230
1354
|
end
|
|
@@ -1275,5 +1399,11 @@ __TS__SetDescriptor(
|
|
|
1275
1399
|
____exports.checkBuffs(target)
|
|
1276
1400
|
end
|
|
1277
1401
|
)
|
|
1402
|
+
buffCreatedEvent:addListener(function(buff)
|
|
1403
|
+
UnitBehavior:forAll(buff.unit, "onBuffGained", buff)
|
|
1404
|
+
end)
|
|
1405
|
+
buffBeingDestroyedEvent:addListener(function(buff)
|
|
1406
|
+
UnitBehavior:forAll(buff.unit, "onBuffLost", buff)
|
|
1407
|
+
end)
|
|
1278
1408
|
end)(Buff)
|
|
1279
1409
|
return ____exports
|