warscript 0.0.1-dev.f967846 → 0.0.1-dev.fa24390
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 +5 -0
- package/attributes.lua +8 -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/order.d.ts +1 -0
- package/core/types/order.lua +11 -1
- package/core/types/sound.d.ts +17 -24
- package/core/types/sound.lua +99 -24
- package/core/types/timer.d.ts +6 -7
- package/core/types/timer.lua +18 -21
- package/core/util.d.ts +1 -1
- package/core/util.lua +12 -1
- package/decl/native.d.ts +840 -786
- 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 +35 -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 +16 -0
- package/engine/behaviour/ability/remove-buffs.lua +28 -0
- package/engine/behaviour/ability.d.ts +20 -4
- package/engine/behaviour/ability.lua +111 -38
- package/engine/behaviour/unit.d.ts +2 -0
- package/engine/buff.d.ts +62 -42
- package/engine/buff.lua +312 -234
- package/engine/internal/ability.d.ts +15 -2
- package/engine/internal/ability.lua +84 -4
- package/engine/internal/item/ability.lua +106 -0
- package/engine/internal/item.d.ts +4 -3
- package/engine/internal/item.lua +56 -25
- 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/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 +10 -1
- package/engine/internal/unit/ability.lua +36 -14
- 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/bonus.d.ts +2 -0
- package/engine/internal/unit/bonus.lua +17 -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.d.ts +6 -0
- package/engine/internal/unit/main-selected.lua +12 -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.d.ts +25 -5
- package/engine/internal/unit.lua +208 -78
- package/engine/internal/utility.lua +12 -0
- package/engine/lightning.d.ts +12 -5
- package/engine/lightning.lua +48 -14
- 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/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 +89 -33
- 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 +10 -3
- package/engine/object-data/entry/unit-type.lua +155 -92
- 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 +10 -4
- package/engine/object-field/ability.lua +3 -0
- package/engine/object-field/unit.d.ts +46 -3
- package/engine/object-field/unit.lua +173 -7
- package/engine/object-field.d.ts +11 -3
- package/engine/object-field.lua +162 -76
- 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/unit.d.ts +1 -0
- package/engine/unit.lua +1 -0
- package/objutil/buff.lua +1 -2
- package/objutil/unit.lua +8 -0
- package/package.json +2 -2
- package/utility/arrays.d.ts +9 -1
- package/utility/arrays.lua +37 -3
- package/utility/functions.d.ts +1 -0
- package/utility/functions.lua +1 -0
- package/utility/lazy.d.ts +2 -0
- package/utility/lazy.lua +14 -0
- package/utility/linked-set.d.ts +1 -0
- package/utility/linked-set.lua +3 -0
- package/utility/lua-maps.d.ts +3 -0
- package/utility/lua-maps.lua +16 -0
- package/utility/lua-sets.d.ts +1 -0
- package/utility/lua-sets.lua +3 -0
- package/utility/reflection.lua +11 -7
package/engine/buff.lua
CHANGED
|
@@ -35,6 +35,7 @@ local UnitBonusType = ____bonus.UnitBonusType
|
|
|
35
35
|
local ____area_2Ddamage = require("engine.internal.mechanics.area-damage")
|
|
36
36
|
local damageArea = ____area_2Ddamage.damageArea
|
|
37
37
|
local ____preconditions = require("utility.preconditions")
|
|
38
|
+
local check = ____preconditions.check
|
|
38
39
|
local checkNotNull = ____preconditions.checkNotNull
|
|
39
40
|
local ____effect = require("core.types.effect")
|
|
40
41
|
local Effect = ____effect.Effect
|
|
@@ -44,8 +45,14 @@ local ____unit = require("engine.behaviour.unit")
|
|
|
44
45
|
local UnitBehavior = ____unit.UnitBehavior
|
|
45
46
|
local ____arrays = require("utility.arrays")
|
|
46
47
|
local forEach = ____arrays.forEach
|
|
48
|
+
local ____event = require("event")
|
|
49
|
+
local Event = ____event.Event
|
|
47
50
|
local ____ability_2Dduration = require("engine.internal.mechanics.ability-duration")
|
|
48
51
|
local getAbilityDuration = ____ability_2Dduration.getAbilityDuration
|
|
52
|
+
local ____item = require("engine.internal.item")
|
|
53
|
+
local Item = ____item.Item
|
|
54
|
+
local ____destructable = require("core.types.destructable")
|
|
55
|
+
local Destructable = ____destructable.Destructable
|
|
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,
|
|
@@ -165,6 +175,7 @@ local function resolveAndSetNumberValue(buff, property, ability, level, value, d
|
|
|
165
175
|
end
|
|
166
176
|
end
|
|
167
177
|
local buffBooleanParameters = {
|
|
178
|
+
"turnsIntoGhost",
|
|
168
179
|
"stuns",
|
|
169
180
|
"ignoresStunImmunity",
|
|
170
181
|
"disablesAutoAttack",
|
|
@@ -176,6 +187,7 @@ local buffNumberParameters = {
|
|
|
176
187
|
"durationIncreaseOnAutoAttack",
|
|
177
188
|
"attackSpeedIncreaseFactor",
|
|
178
189
|
"movementSpeedIncreaseFactor",
|
|
190
|
+
"evasionProbability",
|
|
179
191
|
"armorIncrease",
|
|
180
192
|
"damageFactor",
|
|
181
193
|
"receivedDamageFactor",
|
|
@@ -216,7 +228,7 @@ local function selectBuffTypeIdWithLeastDuration(buffTypeIds, unit)
|
|
|
216
228
|
return checkNotNull(firstNativeBuffTypeId)
|
|
217
229
|
end
|
|
218
230
|
local function destroyBuffIfItHasSameUniqueGroup(buff, uniqueGroup)
|
|
219
|
-
if buff[
|
|
231
|
+
if buff[104] == uniqueGroup then
|
|
220
232
|
buff:destroy()
|
|
221
233
|
end
|
|
222
234
|
end
|
|
@@ -224,17 +236,17 @@ local function destroyBuff(buff)
|
|
|
224
236
|
buff:destroy()
|
|
225
237
|
end
|
|
226
238
|
local function expireBuff(buff)
|
|
227
|
-
local remainingDamageOverDuration = buff[
|
|
228
|
-
local remainingHealingOverDuration = buff[
|
|
239
|
+
local remainingDamageOverDuration = buff[113] or 0
|
|
240
|
+
local remainingHealingOverDuration = buff[113] or 0
|
|
229
241
|
if remainingDamageOverDuration ~= 0 or remainingHealingOverDuration ~= 0 then
|
|
230
242
|
buff:flashSpecialEffect()
|
|
231
243
|
if remainingDamageOverDuration ~= 0 then
|
|
232
|
-
(buff[
|
|
233
|
-
buff[
|
|
244
|
+
(buff[102] or buff[101]):damageTarget(buff[101], remainingDamageOverDuration)
|
|
245
|
+
buff[113] = nil
|
|
234
246
|
end
|
|
235
247
|
if remainingHealingOverDuration ~= 0 then
|
|
236
|
-
(buff[
|
|
237
|
-
buff[
|
|
248
|
+
(buff[102] or buff[101]):healTarget(buff[101], remainingHealingOverDuration)
|
|
249
|
+
buff[118] = nil
|
|
238
250
|
end
|
|
239
251
|
end
|
|
240
252
|
Timer:run(destroyBuff, buff)
|
|
@@ -242,56 +254,57 @@ local function expireBuff(buff)
|
|
|
242
254
|
end
|
|
243
255
|
local function buffDamageIntervalInitialTimerCallback(buff)
|
|
244
256
|
buffDamageIntervalTimerCallback(buff)
|
|
245
|
-
local timer = buff[
|
|
246
|
-
local damageInterval = buff[
|
|
257
|
+
local timer = buff[114]
|
|
258
|
+
local damageInterval = buff[112]
|
|
247
259
|
if timer ~= nil and damageInterval ~= nil and damageInterval > 0 then
|
|
248
260
|
timer:start(damageInterval, true, buffDamageIntervalTimerCallback, buff)
|
|
249
261
|
end
|
|
250
262
|
end
|
|
251
263
|
buffDamageIntervalTimerCallback = function(buff)
|
|
252
264
|
buff:flashSpecialEffect()
|
|
253
|
-
local source = buff[
|
|
254
|
-
local remainingDamageOverDuration = buff[
|
|
265
|
+
local source = buff[102] or buff[101]
|
|
266
|
+
local remainingDamageOverDuration = buff[113] or 0
|
|
255
267
|
if remainingDamageOverDuration ~= 0 then
|
|
256
|
-
local damageInterval = buff[
|
|
268
|
+
local damageInterval = buff[112] or 0
|
|
257
269
|
if damageInterval ~= 0 then
|
|
258
270
|
local damage = remainingDamageOverDuration / (1 + buff.remainingDuration / damageInterval)
|
|
259
|
-
source:damageTarget(buff[
|
|
260
|
-
buff[
|
|
271
|
+
source:damageTarget(buff[101], damage)
|
|
272
|
+
buff[113] = remainingDamageOverDuration - damage
|
|
261
273
|
end
|
|
262
274
|
end
|
|
263
|
-
local damagePerInterval = buff[
|
|
275
|
+
local damagePerInterval = buff[111] or 0
|
|
264
276
|
if remainingDamageOverDuration == 0 or damagePerInterval ~= 0 then
|
|
265
|
-
source:damageTarget(buff[
|
|
277
|
+
source:damageTarget(buff[101], damagePerInterval)
|
|
266
278
|
end
|
|
267
279
|
end
|
|
268
280
|
local function buffHealingIntervalInitialTimerCallback(buff)
|
|
269
281
|
buffHealingIntervalTimerCallback(buff)
|
|
270
|
-
local timer = buff[
|
|
271
|
-
local healingInterval = buff[
|
|
282
|
+
local timer = buff[119]
|
|
283
|
+
local healingInterval = buff[117]
|
|
272
284
|
if timer ~= nil and healingInterval ~= nil and healingInterval > 0 then
|
|
273
285
|
timer:start(healingInterval, true, buffHealingIntervalTimerCallback, buff)
|
|
274
286
|
end
|
|
275
287
|
end
|
|
276
288
|
buffHealingIntervalTimerCallback = function(buff)
|
|
277
|
-
if buff[
|
|
289
|
+
if buff[117] ~= buff[112] then
|
|
278
290
|
buff:flashSpecialEffect()
|
|
279
291
|
end
|
|
280
|
-
local source = buff[
|
|
281
|
-
local remainingHealingOverDuration = buff[
|
|
292
|
+
local source = buff[102] or buff[101]
|
|
293
|
+
local remainingHealingOverDuration = buff[118] or 0
|
|
282
294
|
if remainingHealingOverDuration ~= 0 then
|
|
283
|
-
local healingInterval = buff[
|
|
295
|
+
local healingInterval = buff[117] or 0
|
|
284
296
|
if healingInterval ~= 0 then
|
|
285
297
|
local healing = remainingHealingOverDuration / (1 + buff.remainingDuration / healingInterval)
|
|
286
|
-
source:healTarget(buff[
|
|
287
|
-
buff[
|
|
298
|
+
source:healTarget(buff[101], healing)
|
|
299
|
+
buff[118] = remainingHealingOverDuration - healing
|
|
288
300
|
end
|
|
289
301
|
end
|
|
290
|
-
local healingPerInterval = buff[
|
|
302
|
+
local healingPerInterval = buff[116] or 0
|
|
291
303
|
if remainingHealingOverDuration == 0 or healingPerInterval ~= 0 then
|
|
292
|
-
source:healTarget(buff[
|
|
304
|
+
source:healTarget(buff[101], healingPerInterval)
|
|
293
305
|
end
|
|
294
306
|
end
|
|
307
|
+
local buffDestroyEvent = __TS__New(Event)
|
|
295
308
|
____exports.Buff = __TS__Class()
|
|
296
309
|
local Buff = ____exports.Buff
|
|
297
310
|
Buff.name = "Buff"
|
|
@@ -300,7 +313,8 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
300
313
|
UnitBehavior.prototype.____constructor(self, _unit)
|
|
301
314
|
self._unit = _unit
|
|
302
315
|
self.parameters = nil
|
|
303
|
-
self[100] =
|
|
316
|
+
self[100] = 0
|
|
317
|
+
self[101] = _unit
|
|
304
318
|
local typeId
|
|
305
319
|
local polarity
|
|
306
320
|
local resistanceType
|
|
@@ -309,7 +323,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
309
323
|
typeId = selectBuffTypeIdWithLeastDuration(typeIdOrTypeIds, _unit)
|
|
310
324
|
polarity = resistanceTypeOrPolarity
|
|
311
325
|
resistanceType = abilityOrParametersOrResistanceType
|
|
312
|
-
if __TS__InstanceOf(parametersOrAbility, Ability) then
|
|
326
|
+
if __TS__InstanceOf(parametersOrAbility, Ability) or parametersOrAbility == nil then
|
|
313
327
|
ability = parametersOrAbility
|
|
314
328
|
else
|
|
315
329
|
ability = nil
|
|
@@ -319,7 +333,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
319
333
|
typeId = typeIdOrTypeIds
|
|
320
334
|
polarity = polarityOrTypeIdSelectionPolicy
|
|
321
335
|
resistanceType = resistanceTypeOrPolarity
|
|
322
|
-
if __TS__InstanceOf(abilityOrParametersOrResistanceType, Ability) then
|
|
336
|
+
if __TS__InstanceOf(abilityOrParametersOrResistanceType, Ability) or abilityOrParametersOrResistanceType == nil then
|
|
323
337
|
ability = abilityOrParametersOrResistanceType
|
|
324
338
|
parameters = parametersOrAbility
|
|
325
339
|
else
|
|
@@ -328,7 +342,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
328
342
|
end
|
|
329
343
|
end
|
|
330
344
|
self.typeId = typeId
|
|
331
|
-
if not __TS__InstanceOf(ability, Ability) then
|
|
345
|
+
if not (__TS__InstanceOf(ability, Ability) or ability == nil) then
|
|
332
346
|
parameters = ability
|
|
333
347
|
ability = nil
|
|
334
348
|
end
|
|
@@ -356,14 +370,19 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
356
370
|
end
|
|
357
371
|
self.polarity = resolveEnumValue(ability, level, polarity)
|
|
358
372
|
self.resistanceType = resolveEnumValue(ability, level, resistanceType)
|
|
373
|
+
local missProbability = parameters and parameters.missProbability or defaultParameters.missProbability
|
|
374
|
+
if missProbability ~= nil then
|
|
375
|
+
missProbability = resolveNumberValue(ability, level, missProbability)
|
|
376
|
+
self[142] = missProbability
|
|
377
|
+
end
|
|
359
378
|
local buffByTypeId = buffByTypeIdByUnit[_unit]
|
|
360
379
|
if buffByTypeId == nil then
|
|
361
380
|
buffByTypeId = {}
|
|
362
381
|
buffByTypeIdByUnit[_unit] = buffByTypeId
|
|
363
382
|
end
|
|
364
|
-
local
|
|
365
|
-
if
|
|
366
|
-
|
|
383
|
+
local ____opt_15 = buffByTypeId[typeId]
|
|
384
|
+
if ____opt_15 ~= nil then
|
|
385
|
+
____opt_15:destroy()
|
|
367
386
|
end
|
|
368
387
|
local uniqueGroup = parameters and parameters.uniqueGroup or defaultParameters and defaultParameters.uniqueGroup
|
|
369
388
|
if uniqueGroup ~= nil then
|
|
@@ -377,13 +396,16 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
377
396
|
level,
|
|
378
397
|
duration,
|
|
379
398
|
spellStealPriority,
|
|
380
|
-
learnLevelMinimum
|
|
399
|
+
learnLevelMinimum,
|
|
400
|
+
missProbability
|
|
381
401
|
) then
|
|
402
|
+
self[100] = 1
|
|
382
403
|
UnitBehavior.prototype.destroy(self)
|
|
383
404
|
error(unsuccessfulApplicationMarker, 0)
|
|
384
405
|
end
|
|
385
406
|
local handle = BlzGetUnitAbility(_unit.handle, typeId)
|
|
386
407
|
if handle == nil then
|
|
408
|
+
self[100] = 1
|
|
387
409
|
UnitBehavior.prototype.destroy(self)
|
|
388
410
|
error(unsuccessfulApplicationMarker, 0)
|
|
389
411
|
end
|
|
@@ -392,20 +414,20 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
392
414
|
self._level = level
|
|
393
415
|
self._spellStealPriority = spellStealPriority
|
|
394
416
|
self._learnLevelMinimum = learnLevelMinimum
|
|
395
|
-
self[
|
|
396
|
-
self[
|
|
397
|
-
self[
|
|
398
|
-
self[
|
|
399
|
-
self[
|
|
417
|
+
self[102] = source
|
|
418
|
+
self[103] = duration or 0
|
|
419
|
+
self[104] = uniqueGroup
|
|
420
|
+
self[105] = BlzGetAbilityStringLevelField(self.handle, ABILITY_SLF_EFFECT, 0)
|
|
421
|
+
self[106] = BlzGetAbilityStringLevelField(self.handle, ABILITY_SLF_SPECIAL, 0)
|
|
400
422
|
if parameters ~= nil or (next(defaultParameters)) ~= nil then
|
|
401
423
|
for ____, buffBooleanParameter in ipairs(buffBooleanParameters) do
|
|
402
|
-
local
|
|
403
|
-
local
|
|
404
|
-
local
|
|
405
|
-
if
|
|
406
|
-
|
|
424
|
+
local ____ability_24 = ability
|
|
425
|
+
local ____level_25 = level
|
|
426
|
+
local ____temp_23 = parameters and parameters[buffBooleanParameter]
|
|
427
|
+
if ____temp_23 == nil then
|
|
428
|
+
____temp_23 = defaultParameters[buffBooleanParameter]
|
|
407
429
|
end
|
|
408
|
-
if resolveBooleanValue(
|
|
430
|
+
if resolveBooleanValue(____ability_24, ____level_25, ____temp_23) then
|
|
409
431
|
self[buffBooleanParameter] = true
|
|
410
432
|
end
|
|
411
433
|
end
|
|
@@ -421,11 +443,11 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
421
443
|
end
|
|
422
444
|
local maximumDuration = parameters and parameters.maximumDuration or defaultParameters.maximumDuration
|
|
423
445
|
if maximumDuration ~= nil then
|
|
424
|
-
self[
|
|
446
|
+
self[108] = resolveNumberValue(ability, level, maximumDuration)
|
|
425
447
|
end
|
|
426
448
|
local maximumRemainingDuration = parameters and parameters.maximumRemainingDuration or defaultParameters.maximumRemainingDuration
|
|
427
449
|
if maximumRemainingDuration ~= nil then
|
|
428
|
-
self[
|
|
450
|
+
self[109] = resolveNumberValue(ability, level, maximumRemainingDuration)
|
|
429
451
|
end
|
|
430
452
|
local parametersAbilityTypeIds = parameters and parameters.abilityTypeIds or defaultParameters.abilityTypeIds
|
|
431
453
|
if parametersAbilityTypeIds ~= nil then
|
|
@@ -482,10 +504,12 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
482
504
|
timer:start(duration, false, expireBuff, self)
|
|
483
505
|
self._timer = timer
|
|
484
506
|
end
|
|
507
|
+
self:onCreate()
|
|
508
|
+
self[100] = 1
|
|
485
509
|
end
|
|
486
510
|
function Buff.prototype.getUnitBonus(self, bonusType)
|
|
487
|
-
local
|
|
488
|
-
local bonusId =
|
|
511
|
+
local ____opt_38 = self._bonusIdByBonusType
|
|
512
|
+
local bonusId = ____opt_38 and ____opt_38[bonusType]
|
|
489
513
|
return bonusId == nil and 0 or getUnitBonus(self._unit, bonusType, bonusId)
|
|
490
514
|
end
|
|
491
515
|
function Buff.prototype.addOrUpdateOrRemoveUnitBonus(self, bonusType, value)
|
|
@@ -496,63 +520,71 @@ function Buff.prototype.addOrUpdateOrRemoveUnitBonus(self, bonusType, value)
|
|
|
496
520
|
end
|
|
497
521
|
bonusIdByBonusType[bonusType] = addOrUpdateOrRemoveUnitBonus(self._unit, bonusType, bonusIdByBonusType[bonusType], value)
|
|
498
522
|
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
|
|
523
|
+
function Buff.prototype.flashEffect(self, widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
524
|
+
if type(widgetOrXOrParametersOrDuration) == "number" and type(yOrParametersOrDuration) == "number" then
|
|
525
|
+
Effect:flash(self[105], widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
511
526
|
else
|
|
512
|
-
|
|
527
|
+
local isWidgetProvided = __TS__InstanceOf(widgetOrXOrParametersOrDuration, Unit) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Item) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Destructable)
|
|
528
|
+
local ____Effect_42 = Effect
|
|
529
|
+
local ____Effect_flash_43 = Effect.flash
|
|
530
|
+
local ____array_41 = __TS__SparseArrayNew(
|
|
531
|
+
self[105],
|
|
532
|
+
isWidgetProvided and widgetOrXOrParametersOrDuration or self._unit,
|
|
533
|
+
stringValueByBuffTypeIdByFieldId[fourCC("feft")][self.typeId] or "origin"
|
|
534
|
+
)
|
|
535
|
+
local ____isWidgetProvided_40
|
|
536
|
+
if isWidgetProvided then
|
|
537
|
+
____isWidgetProvided_40 = yOrParametersOrDuration
|
|
538
|
+
else
|
|
539
|
+
____isWidgetProvided_40 = widgetOrXOrParametersOrDuration
|
|
540
|
+
end
|
|
541
|
+
__TS__SparseArrayPush(____array_41, ____isWidgetProvided_40)
|
|
542
|
+
____Effect_flash_43(
|
|
543
|
+
____Effect_42,
|
|
544
|
+
__TS__SparseArraySpread(____array_41)
|
|
545
|
+
)
|
|
513
546
|
end
|
|
514
|
-
__TS__SparseArrayPush(____array_39, ____isWidgetProvided_38)
|
|
515
|
-
____Effect_flash_41(
|
|
516
|
-
____Effect_40,
|
|
517
|
-
__TS__SparseArraySpread(____array_39)
|
|
518
|
-
)
|
|
519
547
|
end
|
|
520
548
|
function Buff.prototype.flashSpecialEffect(self, widgetOrDuration, duration)
|
|
521
549
|
local isWidgetProvided = type(widgetOrDuration) == "table"
|
|
522
|
-
local
|
|
523
|
-
local
|
|
524
|
-
local
|
|
525
|
-
self[
|
|
550
|
+
local ____Effect_46 = Effect
|
|
551
|
+
local ____Effect_flash_47 = Effect.flash
|
|
552
|
+
local ____array_45 = __TS__SparseArrayNew(
|
|
553
|
+
self[106],
|
|
526
554
|
isWidgetProvided and widgetOrDuration or self._unit,
|
|
527
555
|
stringValueByBuffTypeIdByFieldId[fourCC("fspt")][self.typeId] or "origin"
|
|
528
556
|
)
|
|
529
|
-
local
|
|
557
|
+
local ____isWidgetProvided_44
|
|
530
558
|
if isWidgetProvided then
|
|
531
|
-
|
|
559
|
+
____isWidgetProvided_44 = duration
|
|
532
560
|
else
|
|
533
|
-
|
|
561
|
+
____isWidgetProvided_44 = widgetOrDuration
|
|
534
562
|
end
|
|
535
|
-
__TS__SparseArrayPush(
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
__TS__SparseArraySpread(
|
|
563
|
+
__TS__SparseArrayPush(____array_45, ____isWidgetProvided_44)
|
|
564
|
+
____Effect_flash_47(
|
|
565
|
+
____Effect_46,
|
|
566
|
+
__TS__SparseArraySpread(____array_45)
|
|
539
567
|
)
|
|
540
568
|
end
|
|
569
|
+
function Buff.prototype.onCreate(self)
|
|
570
|
+
end
|
|
541
571
|
function Buff.prototype.onDestroy(self)
|
|
572
|
+
check(self[100] ~= 0, "Cannot destroy a buff that has not finished creating yet.")
|
|
573
|
+
self[100] = 2
|
|
542
574
|
local unit = self._unit
|
|
543
575
|
if getUnitAbility(unit.handle, self.typeId) == self.handle then
|
|
544
576
|
removeBuff(unit.handle, self.typeId)
|
|
545
577
|
end
|
|
546
578
|
buffByTypeIdByUnit[unit][self.typeId] = nil
|
|
547
|
-
local healingIntervalTimer = self[
|
|
579
|
+
local healingIntervalTimer = self[119]
|
|
548
580
|
if healingIntervalTimer ~= nil then
|
|
549
581
|
healingIntervalTimer:destroy()
|
|
550
|
-
self[
|
|
582
|
+
self[119] = nil
|
|
551
583
|
end
|
|
552
|
-
local damageIntervalTimer = self[
|
|
584
|
+
local damageIntervalTimer = self[114]
|
|
553
585
|
if damageIntervalTimer ~= nil then
|
|
554
586
|
damageIntervalTimer:destroy()
|
|
555
|
-
self[
|
|
587
|
+
self[114] = nil
|
|
556
588
|
end
|
|
557
589
|
if self._timer ~= nil then
|
|
558
590
|
self._timer:destroy()
|
|
@@ -562,15 +594,21 @@ function Buff.prototype.onDestroy(self)
|
|
|
562
594
|
behavior:destroy()
|
|
563
595
|
end
|
|
564
596
|
end
|
|
565
|
-
if self[
|
|
597
|
+
if self[139] then
|
|
598
|
+
unit:decrementInvulnerabilityCounter()
|
|
599
|
+
end
|
|
600
|
+
if self[138] then
|
|
566
601
|
unit:decrementDisableAutoAttackCounter()
|
|
567
602
|
end
|
|
568
|
-
if self[
|
|
569
|
-
if self[
|
|
603
|
+
if self[136] then
|
|
604
|
+
if self[137] then
|
|
570
605
|
unit:decrementStunCounter()
|
|
571
606
|
end
|
|
572
607
|
unit:decrementStunCounter()
|
|
573
608
|
end
|
|
609
|
+
if self[135] then
|
|
610
|
+
unit:decrementGhostCounter()
|
|
611
|
+
end
|
|
574
612
|
if self._abilityTypeIds ~= nil then
|
|
575
613
|
for abilityTypeId in pairs(self._abilityTypeIds) do
|
|
576
614
|
unit:removeAbility(abilityTypeId)
|
|
@@ -581,6 +619,8 @@ function Buff.prototype.onDestroy(self)
|
|
|
581
619
|
removeUnitBonus(unit, bonusType, bonusId)
|
|
582
620
|
end
|
|
583
621
|
end
|
|
622
|
+
Event.invoke(buffDestroyEvent, self)
|
|
623
|
+
self[100] = 3
|
|
584
624
|
return UnitBehavior.prototype.onDestroy(self)
|
|
585
625
|
end
|
|
586
626
|
function Buff.apply(self, ...)
|
|
@@ -608,8 +648,8 @@ function Buff.apply(self, ...)
|
|
|
608
648
|
end
|
|
609
649
|
end
|
|
610
650
|
function Buff.getByTypeId(self, unit, typeId)
|
|
611
|
-
local
|
|
612
|
-
local buff =
|
|
651
|
+
local ____opt_48 = buffByTypeIdByUnit[unit]
|
|
652
|
+
local buff = ____opt_48 and ____opt_48[typeId]
|
|
613
653
|
if __TS__InstanceOf(buff, self) then
|
|
614
654
|
return buff
|
|
615
655
|
end
|
|
@@ -617,72 +657,72 @@ function Buff.getByTypeId(self, unit, typeId)
|
|
|
617
657
|
end
|
|
618
658
|
function Buff.prototype.onExpiration(self)
|
|
619
659
|
local unit = self.unit
|
|
620
|
-
if self[119] ~= nil then
|
|
621
|
-
(self[101] or unit):damageTarget(unit, self[119] or 0)
|
|
622
|
-
end
|
|
623
660
|
if self[120] ~= nil then
|
|
624
|
-
(self[
|
|
661
|
+
(self[102] or unit):damageTarget(unit, self[120] or 0)
|
|
625
662
|
end
|
|
626
|
-
if self[
|
|
663
|
+
if self[121] ~= nil then
|
|
664
|
+
(self[102] or unit):healTarget(unit, self[120] or 0)
|
|
665
|
+
end
|
|
666
|
+
if self[141] then
|
|
627
667
|
unit:explode()
|
|
628
|
-
elseif self[
|
|
668
|
+
elseif self[140] then
|
|
629
669
|
unit:kill()
|
|
630
670
|
end
|
|
631
671
|
end
|
|
632
672
|
function Buff.prototype.onDeath(self, source)
|
|
633
673
|
local unit = self.unit
|
|
634
|
-
if self[
|
|
674
|
+
if self[122] ~= nil then
|
|
635
675
|
damageArea(
|
|
636
|
-
self[
|
|
637
|
-
self[
|
|
676
|
+
self[102] or unit,
|
|
677
|
+
self[122],
|
|
638
678
|
unit.x,
|
|
639
679
|
unit.y,
|
|
680
|
+
self[124] or 0,
|
|
640
681
|
self[123] or 0,
|
|
641
|
-
self[
|
|
682
|
+
self[126] or 0,
|
|
642
683
|
self[125] or 0,
|
|
643
|
-
self[
|
|
644
|
-
self[127] or 0
|
|
645
|
-
self[126] or 0
|
|
684
|
+
self[128] or 0,
|
|
685
|
+
self[127] or 0
|
|
646
686
|
)
|
|
647
687
|
end
|
|
648
688
|
end
|
|
649
689
|
function Buff.prototype.onDamageDealt(self, target, event)
|
|
650
690
|
if event.isAttack then
|
|
651
|
-
if self[
|
|
652
|
-
local durationIncrease = self[
|
|
653
|
-
local maximumDuration = self[
|
|
691
|
+
if self[107] ~= nil then
|
|
692
|
+
local durationIncrease = self[107]
|
|
693
|
+
local maximumDuration = self[108] or 0
|
|
654
694
|
if maximumDuration > 0 then
|
|
655
695
|
durationIncrease = min(
|
|
656
696
|
durationIncrease,
|
|
657
|
-
max(0, maximumDuration - self[
|
|
697
|
+
max(0, maximumDuration - self[103])
|
|
658
698
|
)
|
|
659
699
|
end
|
|
660
700
|
local remainingDuration = self.remainingDuration + durationIncrease
|
|
661
|
-
local maximumRemainingDuration = self[
|
|
701
|
+
local maximumRemainingDuration = self[109] or 0
|
|
662
702
|
if maximumRemainingDuration > 0 then
|
|
663
703
|
remainingDuration = min(remainingDuration, maximumRemainingDuration)
|
|
664
704
|
end
|
|
665
705
|
self.remainingDuration = remainingDuration
|
|
666
706
|
end
|
|
667
|
-
local autoAttackCount = (self[
|
|
668
|
-
self[
|
|
669
|
-
if autoAttackCount == self[
|
|
707
|
+
local autoAttackCount = (self[129] or 0) + 1
|
|
708
|
+
self[129] = autoAttackCount
|
|
709
|
+
if autoAttackCount == self[130] then
|
|
670
710
|
self:destroy()
|
|
671
711
|
end
|
|
672
712
|
end
|
|
673
713
|
if event.originalAmount ~= 0 then
|
|
674
|
-
local damageDealtEventCount = (self[
|
|
675
|
-
self[
|
|
676
|
-
if damageDealtEventCount == self[
|
|
714
|
+
local damageDealtEventCount = (self[131] or 0) + 1
|
|
715
|
+
self[131] = damageDealtEventCount
|
|
716
|
+
if damageDealtEventCount == self[132] then
|
|
677
717
|
self:destroy()
|
|
678
718
|
end
|
|
679
719
|
end
|
|
680
720
|
end
|
|
681
721
|
function Buff.prototype.onDamageReceived(self, source, event)
|
|
682
722
|
if event.originalAmount ~= 0 then
|
|
683
|
-
local damageReceivedEventCount = (self[
|
|
684
|
-
self[
|
|
685
|
-
if damageReceivedEventCount == self[
|
|
723
|
+
local damageReceivedEventCount = (self[133] or 0) + 1
|
|
724
|
+
self[133] = damageReceivedEventCount
|
|
725
|
+
if damageReceivedEventCount == self[134] then
|
|
686
726
|
self:destroy()
|
|
687
727
|
end
|
|
688
728
|
end
|
|
@@ -692,7 +732,7 @@ __TS__SetDescriptor(
|
|
|
692
732
|
Buff.prototype,
|
|
693
733
|
"source",
|
|
694
734
|
{get = function(self)
|
|
695
|
-
return self[
|
|
735
|
+
return self[102] or self._unit
|
|
696
736
|
end},
|
|
697
737
|
true
|
|
698
738
|
)
|
|
@@ -709,13 +749,13 @@ __TS__SetDescriptor(
|
|
|
709
749
|
"remainingDamageOverDuration",
|
|
710
750
|
{
|
|
711
751
|
get = function(self)
|
|
712
|
-
return self[
|
|
752
|
+
return self[113] or 0
|
|
713
753
|
end,
|
|
714
754
|
set = function(self, remainingDamageOverDuration)
|
|
715
|
-
local remainingDamageOverDurationDelta = remainingDamageOverDuration - (self[
|
|
716
|
-
self[
|
|
717
|
-
local damageOverDuration = (self[
|
|
718
|
-
self[
|
|
755
|
+
local remainingDamageOverDurationDelta = remainingDamageOverDuration - (self[113] or 0)
|
|
756
|
+
self[113] = remainingDamageOverDuration ~= 0 and remainingDamageOverDuration or nil
|
|
757
|
+
local damageOverDuration = (self[110] or 0) + remainingDamageOverDurationDelta
|
|
758
|
+
self[110] = damageOverDuration ~= 0 and damageOverDuration or nil
|
|
719
759
|
end
|
|
720
760
|
},
|
|
721
761
|
true
|
|
@@ -725,13 +765,13 @@ __TS__SetDescriptor(
|
|
|
725
765
|
"damageOverDuration",
|
|
726
766
|
{
|
|
727
767
|
get = function(self)
|
|
728
|
-
return self[
|
|
768
|
+
return self[110] or 0
|
|
729
769
|
end,
|
|
730
770
|
set = function(self, damageOverDuration)
|
|
731
|
-
local damageOverDurationDelta = damageOverDuration - (self[
|
|
732
|
-
self[
|
|
733
|
-
local remainingDamageOverDuration = (self[
|
|
734
|
-
self[
|
|
771
|
+
local damageOverDurationDelta = damageOverDuration - (self[110] or 0)
|
|
772
|
+
self[110] = damageOverDuration ~= 0 and damageOverDuration or nil
|
|
773
|
+
local remainingDamageOverDuration = (self[113] or 0) + damageOverDurationDelta
|
|
774
|
+
self[113] = remainingDamageOverDuration ~= 0 and remainingDamageOverDuration or nil
|
|
735
775
|
end
|
|
736
776
|
},
|
|
737
777
|
true
|
|
@@ -741,10 +781,10 @@ __TS__SetDescriptor(
|
|
|
741
781
|
"damagePerInterval",
|
|
742
782
|
{
|
|
743
783
|
get = function(self)
|
|
744
|
-
return self[
|
|
784
|
+
return self[111] or 0
|
|
745
785
|
end,
|
|
746
786
|
set = function(self, damagePerInterval)
|
|
747
|
-
self[
|
|
787
|
+
self[111] = damagePerInterval ~= 0 and damagePerInterval or nil
|
|
748
788
|
end
|
|
749
789
|
},
|
|
750
790
|
true
|
|
@@ -754,25 +794,25 @@ __TS__SetDescriptor(
|
|
|
754
794
|
"damageInterval",
|
|
755
795
|
{
|
|
756
796
|
get = function(self)
|
|
757
|
-
return self[
|
|
797
|
+
return self[112] or 0
|
|
758
798
|
end,
|
|
759
799
|
set = function(self, damageInterval)
|
|
760
800
|
if damageInterval <= 0 then
|
|
761
|
-
self[
|
|
762
|
-
local timer = self[
|
|
801
|
+
self[112] = damageInterval ~= 0 and damageInterval or nil
|
|
802
|
+
local timer = self[114]
|
|
763
803
|
if timer ~= nil then
|
|
764
804
|
timer:destroy()
|
|
765
|
-
self[
|
|
805
|
+
self[114] = nil
|
|
766
806
|
end
|
|
767
807
|
return
|
|
768
808
|
end
|
|
769
|
-
self[
|
|
770
|
-
local
|
|
771
|
-
local elapsed =
|
|
772
|
-
local timer = self[
|
|
809
|
+
self[112] = damageInterval
|
|
810
|
+
local ____opt_50 = self._timer
|
|
811
|
+
local elapsed = ____opt_50 and ____opt_50.elapsed or 0
|
|
812
|
+
local timer = self[114]
|
|
773
813
|
if timer == nil then
|
|
774
814
|
timer = Timer:create()
|
|
775
|
-
self[
|
|
815
|
+
self[114] = timer
|
|
776
816
|
end
|
|
777
817
|
local initialDelay = damageInterval - (elapsed >= damageInterval and math.fmod(elapsed, damageInterval) or elapsed)
|
|
778
818
|
if initialDelay == damageInterval then
|
|
@@ -789,13 +829,13 @@ __TS__SetDescriptor(
|
|
|
789
829
|
"remainingHealingOverDuration",
|
|
790
830
|
{
|
|
791
831
|
get = function(self)
|
|
792
|
-
return self[
|
|
832
|
+
return self[118] or 0
|
|
793
833
|
end,
|
|
794
834
|
set = function(self, remainingHealingOverDuration)
|
|
795
|
-
local remainingHealingOverDurationDelta = remainingHealingOverDuration - (self[
|
|
796
|
-
self[
|
|
797
|
-
local healingOverDuration = (self[
|
|
798
|
-
self[
|
|
835
|
+
local remainingHealingOverDurationDelta = remainingHealingOverDuration - (self[118] or 0)
|
|
836
|
+
self[113] = remainingHealingOverDuration ~= 0 and remainingHealingOverDuration or nil
|
|
837
|
+
local healingOverDuration = (self[115] or 0) + remainingHealingOverDurationDelta
|
|
838
|
+
self[115] = healingOverDuration ~= 0 and healingOverDuration or nil
|
|
799
839
|
end
|
|
800
840
|
},
|
|
801
841
|
true
|
|
@@ -805,13 +845,13 @@ __TS__SetDescriptor(
|
|
|
805
845
|
"healingOverDuration",
|
|
806
846
|
{
|
|
807
847
|
get = function(self)
|
|
808
|
-
return self[
|
|
848
|
+
return self[115] or 0
|
|
809
849
|
end,
|
|
810
850
|
set = function(self, healingOverDuration)
|
|
811
|
-
local healingOverDurationDelta = healingOverDuration - (self[
|
|
812
|
-
self[
|
|
813
|
-
local remainingHealingOverDuration = (self[
|
|
814
|
-
self[
|
|
851
|
+
local healingOverDurationDelta = healingOverDuration - (self[115] or 0)
|
|
852
|
+
self[115] = healingOverDuration ~= 0 and healingOverDuration or nil
|
|
853
|
+
local remainingHealingOverDuration = (self[118] or 0) + healingOverDurationDelta
|
|
854
|
+
self[118] = remainingHealingOverDuration ~= 0 and remainingHealingOverDuration or nil
|
|
815
855
|
end
|
|
816
856
|
},
|
|
817
857
|
true
|
|
@@ -821,10 +861,10 @@ __TS__SetDescriptor(
|
|
|
821
861
|
"healingPerInterval",
|
|
822
862
|
{
|
|
823
863
|
get = function(self)
|
|
824
|
-
return self[
|
|
864
|
+
return self[116] or 0
|
|
825
865
|
end,
|
|
826
866
|
set = function(self, healingPerInterval)
|
|
827
|
-
self[
|
|
867
|
+
self[116] = healingPerInterval ~= 0 and healingPerInterval or nil
|
|
828
868
|
end
|
|
829
869
|
},
|
|
830
870
|
true
|
|
@@ -834,25 +874,25 @@ __TS__SetDescriptor(
|
|
|
834
874
|
"healingInterval",
|
|
835
875
|
{
|
|
836
876
|
get = function(self)
|
|
837
|
-
return self[
|
|
877
|
+
return self[117] or 0
|
|
838
878
|
end,
|
|
839
879
|
set = function(self, healingInterval)
|
|
840
880
|
if healingInterval <= 0 then
|
|
841
|
-
self[
|
|
842
|
-
local timer = self[
|
|
881
|
+
self[117] = healingInterval ~= 0 and healingInterval or nil
|
|
882
|
+
local timer = self[119]
|
|
843
883
|
if timer ~= nil then
|
|
844
884
|
timer:destroy()
|
|
845
|
-
self[
|
|
885
|
+
self[119] = nil
|
|
846
886
|
end
|
|
847
887
|
return
|
|
848
888
|
end
|
|
849
|
-
self[
|
|
850
|
-
local
|
|
851
|
-
local elapsed =
|
|
852
|
-
local timer = self[
|
|
889
|
+
self[117] = healingInterval
|
|
890
|
+
local ____opt_52 = self._timer
|
|
891
|
+
local elapsed = ____opt_52 and ____opt_52.elapsed or 0
|
|
892
|
+
local timer = self[119]
|
|
853
893
|
if timer == nil then
|
|
854
894
|
timer = Timer:create()
|
|
855
|
-
self[
|
|
895
|
+
self[119] = timer
|
|
856
896
|
end
|
|
857
897
|
local initialDelay = healingInterval - (elapsed >= healingInterval and math.fmod(elapsed, healingInterval) or elapsed)
|
|
858
898
|
if initialDelay == healingInterval then
|
|
@@ -869,10 +909,10 @@ __TS__SetDescriptor(
|
|
|
869
909
|
"damageOnExpiration",
|
|
870
910
|
{
|
|
871
911
|
get = function(self)
|
|
872
|
-
return self[
|
|
912
|
+
return self[120] or 0
|
|
873
913
|
end,
|
|
874
914
|
set = function(self, damageOnExpiration)
|
|
875
|
-
self[
|
|
915
|
+
self[120] = damageOnExpiration ~= 0 and damageOnExpiration or nil
|
|
876
916
|
end
|
|
877
917
|
},
|
|
878
918
|
true
|
|
@@ -882,10 +922,10 @@ __TS__SetDescriptor(
|
|
|
882
922
|
"healingOnExpiration",
|
|
883
923
|
{
|
|
884
924
|
get = function(self)
|
|
885
|
-
return self[
|
|
925
|
+
return self[121] or 0
|
|
886
926
|
end,
|
|
887
927
|
set = function(self, healingOnExpiration)
|
|
888
|
-
self[
|
|
928
|
+
self[121] = healingOnExpiration ~= 0 and healingOnExpiration or nil
|
|
889
929
|
end
|
|
890
930
|
},
|
|
891
931
|
true
|
|
@@ -929,30 +969,53 @@ __TS__SetDescriptor(
|
|
|
929
969
|
},
|
|
930
970
|
true
|
|
931
971
|
)
|
|
972
|
+
__TS__SetDescriptor(
|
|
973
|
+
Buff.prototype,
|
|
974
|
+
"turnsIntoGhost",
|
|
975
|
+
{
|
|
976
|
+
get = function(self)
|
|
977
|
+
local ____self__135_54 = self[135]
|
|
978
|
+
if ____self__135_54 == nil then
|
|
979
|
+
____self__135_54 = false
|
|
980
|
+
end
|
|
981
|
+
return ____self__135_54
|
|
982
|
+
end,
|
|
983
|
+
set = function(self, turnsIntoGhost)
|
|
984
|
+
if not turnsIntoGhost and self[135] then
|
|
985
|
+
self.object:decrementGhostCounter()
|
|
986
|
+
self[135] = nil
|
|
987
|
+
elseif turnsIntoGhost and not self[135] then
|
|
988
|
+
self.object:incrementGhostCounter()
|
|
989
|
+
self[135] = true
|
|
990
|
+
end
|
|
991
|
+
end
|
|
992
|
+
},
|
|
993
|
+
true
|
|
994
|
+
)
|
|
932
995
|
__TS__SetDescriptor(
|
|
933
996
|
Buff.prototype,
|
|
934
997
|
"stuns",
|
|
935
998
|
{
|
|
936
999
|
get = function(self)
|
|
937
|
-
local
|
|
938
|
-
if
|
|
939
|
-
|
|
1000
|
+
local ____self__136_55 = self[136]
|
|
1001
|
+
if ____self__136_55 == nil then
|
|
1002
|
+
____self__136_55 = false
|
|
940
1003
|
end
|
|
941
|
-
return
|
|
1004
|
+
return ____self__136_55
|
|
942
1005
|
end,
|
|
943
1006
|
set = function(self, stuns)
|
|
944
|
-
if not stuns and self[
|
|
945
|
-
if self[
|
|
1007
|
+
if not stuns and self[136] then
|
|
1008
|
+
if self[137] then
|
|
946
1009
|
self.object:decrementStunCounter()
|
|
947
1010
|
end
|
|
948
1011
|
self.object:decrementStunCounter()
|
|
949
|
-
self[
|
|
950
|
-
elseif stuns and not self[
|
|
951
|
-
if self[
|
|
1012
|
+
self[136] = nil
|
|
1013
|
+
elseif stuns and not self[136] then
|
|
1014
|
+
if self[137] then
|
|
952
1015
|
self.object:incrementStunCounter()
|
|
953
1016
|
end
|
|
954
1017
|
self.object:incrementStunCounter()
|
|
955
|
-
self[
|
|
1018
|
+
self[136] = true
|
|
956
1019
|
end
|
|
957
1020
|
end
|
|
958
1021
|
},
|
|
@@ -963,23 +1026,23 @@ __TS__SetDescriptor(
|
|
|
963
1026
|
"ignoresStunImmunity",
|
|
964
1027
|
{
|
|
965
1028
|
get = function(self)
|
|
966
|
-
local
|
|
967
|
-
if
|
|
968
|
-
|
|
1029
|
+
local ____self__137_56 = self[137]
|
|
1030
|
+
if ____self__137_56 == nil then
|
|
1031
|
+
____self__137_56 = false
|
|
969
1032
|
end
|
|
970
|
-
return
|
|
1033
|
+
return ____self__137_56
|
|
971
1034
|
end,
|
|
972
1035
|
set = function(self, ignoresStunImmunity)
|
|
973
|
-
if not ignoresStunImmunity and self[
|
|
974
|
-
if self[
|
|
1036
|
+
if not ignoresStunImmunity and self[137] then
|
|
1037
|
+
if self[136] then
|
|
975
1038
|
self.object:decrementStunCounter()
|
|
976
1039
|
end
|
|
977
|
-
self[
|
|
978
|
-
elseif ignoresStunImmunity and not self[
|
|
979
|
-
if self[
|
|
1040
|
+
self[137] = nil
|
|
1041
|
+
elseif ignoresStunImmunity and not self[137] then
|
|
1042
|
+
if self[136] then
|
|
980
1043
|
self.object:incrementStunCounter()
|
|
981
1044
|
end
|
|
982
|
-
self[
|
|
1045
|
+
self[137] = true
|
|
983
1046
|
end
|
|
984
1047
|
end
|
|
985
1048
|
},
|
|
@@ -990,19 +1053,19 @@ __TS__SetDescriptor(
|
|
|
990
1053
|
"disablesAutoAttack",
|
|
991
1054
|
{
|
|
992
1055
|
get = function(self)
|
|
993
|
-
local
|
|
994
|
-
if
|
|
995
|
-
|
|
1056
|
+
local ____self__138_57 = self[138]
|
|
1057
|
+
if ____self__138_57 == nil then
|
|
1058
|
+
____self__138_57 = false
|
|
996
1059
|
end
|
|
997
|
-
return
|
|
1060
|
+
return ____self__138_57
|
|
998
1061
|
end,
|
|
999
1062
|
set = function(self, disablesAutoAttack)
|
|
1000
|
-
if not disablesAutoAttack and self[
|
|
1063
|
+
if not disablesAutoAttack and self[138] then
|
|
1001
1064
|
self.object:decrementDisableAutoAttackCounter()
|
|
1002
|
-
self[
|
|
1003
|
-
elseif disablesAutoAttack and not self[
|
|
1065
|
+
self[138] = nil
|
|
1066
|
+
elseif disablesAutoAttack and not self[138] then
|
|
1004
1067
|
self.object:incrementDisableAutoAttackCounter()
|
|
1005
|
-
self[
|
|
1068
|
+
self[138] = true
|
|
1006
1069
|
end
|
|
1007
1070
|
end
|
|
1008
1071
|
},
|
|
@@ -1013,19 +1076,19 @@ __TS__SetDescriptor(
|
|
|
1013
1076
|
"providesInvulnerability",
|
|
1014
1077
|
{
|
|
1015
1078
|
get = function(self)
|
|
1016
|
-
local
|
|
1017
|
-
if
|
|
1018
|
-
|
|
1079
|
+
local ____self__139_58 = self[139]
|
|
1080
|
+
if ____self__139_58 == nil then
|
|
1081
|
+
____self__139_58 = false
|
|
1019
1082
|
end
|
|
1020
|
-
return
|
|
1083
|
+
return ____self__139_58
|
|
1021
1084
|
end,
|
|
1022
1085
|
set = function(self, providesInvulnerability)
|
|
1023
|
-
if not providesInvulnerability and self[
|
|
1086
|
+
if not providesInvulnerability and self[139] then
|
|
1024
1087
|
self.object:decrementInvulnerabilityCounter()
|
|
1025
|
-
self[
|
|
1026
|
-
elseif providesInvulnerability and not self[
|
|
1088
|
+
self[139] = nil
|
|
1089
|
+
elseif providesInvulnerability and not self[139] then
|
|
1027
1090
|
self.object:incrementInvulnerabilityCounter()
|
|
1028
|
-
self[
|
|
1091
|
+
self[139] = true
|
|
1029
1092
|
end
|
|
1030
1093
|
end
|
|
1031
1094
|
},
|
|
@@ -1036,17 +1099,17 @@ __TS__SetDescriptor(
|
|
|
1036
1099
|
"killsOnExpiration",
|
|
1037
1100
|
{
|
|
1038
1101
|
get = function(self)
|
|
1039
|
-
local
|
|
1040
|
-
if
|
|
1041
|
-
|
|
1102
|
+
local ____self__140_59 = self[140]
|
|
1103
|
+
if ____self__140_59 == nil then
|
|
1104
|
+
____self__140_59 = false
|
|
1042
1105
|
end
|
|
1043
|
-
return
|
|
1106
|
+
return ____self__140_59
|
|
1044
1107
|
end,
|
|
1045
1108
|
set = function(self, killsOnExpiration)
|
|
1046
|
-
if not killsOnExpiration and self[
|
|
1047
|
-
self[
|
|
1048
|
-
elseif killsOnExpiration and not self[
|
|
1049
|
-
self[
|
|
1109
|
+
if not killsOnExpiration and self[140] then
|
|
1110
|
+
self[140] = nil
|
|
1111
|
+
elseif killsOnExpiration and not self[140] then
|
|
1112
|
+
self[140] = true
|
|
1050
1113
|
end
|
|
1051
1114
|
end
|
|
1052
1115
|
},
|
|
@@ -1057,17 +1120,17 @@ __TS__SetDescriptor(
|
|
|
1057
1120
|
"explodesOnExpiration",
|
|
1058
1121
|
{
|
|
1059
1122
|
get = function(self)
|
|
1060
|
-
local
|
|
1061
|
-
if
|
|
1062
|
-
|
|
1123
|
+
local ____self__141_60 = self[141]
|
|
1124
|
+
if ____self__141_60 == nil then
|
|
1125
|
+
____self__141_60 = false
|
|
1063
1126
|
end
|
|
1064
|
-
return
|
|
1127
|
+
return ____self__141_60
|
|
1065
1128
|
end,
|
|
1066
1129
|
set = function(self, killsOnExpiration)
|
|
1067
|
-
if not killsOnExpiration and self[
|
|
1068
|
-
self[
|
|
1069
|
-
elseif killsOnExpiration and not self[
|
|
1070
|
-
self[
|
|
1130
|
+
if not killsOnExpiration and self[141] then
|
|
1131
|
+
self[141] = nil
|
|
1132
|
+
elseif killsOnExpiration and not self[141] then
|
|
1133
|
+
self[141] = true
|
|
1071
1134
|
end
|
|
1072
1135
|
end
|
|
1073
1136
|
},
|
|
@@ -1078,13 +1141,13 @@ __TS__SetDescriptor(
|
|
|
1078
1141
|
"maximumDamageDealtEventCount",
|
|
1079
1142
|
{
|
|
1080
1143
|
get = function(self)
|
|
1081
|
-
return self[
|
|
1144
|
+
return self[132] or 0
|
|
1082
1145
|
end,
|
|
1083
1146
|
set = function(self, maximumDamageDealtEventCount)
|
|
1084
1147
|
if maximumDamageDealtEventCount == 0 then
|
|
1085
|
-
self[
|
|
1148
|
+
self[132] = nil
|
|
1086
1149
|
else
|
|
1087
|
-
self[
|
|
1150
|
+
self[132] = maximumDamageDealtEventCount
|
|
1088
1151
|
end
|
|
1089
1152
|
end
|
|
1090
1153
|
},
|
|
@@ -1095,13 +1158,13 @@ __TS__SetDescriptor(
|
|
|
1095
1158
|
"maximumDamageReceivedEventCount",
|
|
1096
1159
|
{
|
|
1097
1160
|
get = function(self)
|
|
1098
|
-
return self[
|
|
1161
|
+
return self[134] or 0
|
|
1099
1162
|
end,
|
|
1100
1163
|
set = function(self, maximumDamageReceivedEventCount)
|
|
1101
1164
|
if maximumDamageReceivedEventCount == 0 then
|
|
1102
|
-
self[
|
|
1165
|
+
self[134] = nil
|
|
1103
1166
|
else
|
|
1104
|
-
self[
|
|
1167
|
+
self[134] = maximumDamageReceivedEventCount
|
|
1105
1168
|
end
|
|
1106
1169
|
end
|
|
1107
1170
|
},
|
|
@@ -1112,13 +1175,13 @@ __TS__SetDescriptor(
|
|
|
1112
1175
|
"maximumAutoAttackCount",
|
|
1113
1176
|
{
|
|
1114
1177
|
get = function(self)
|
|
1115
|
-
return self[
|
|
1178
|
+
return self[130] or 0
|
|
1116
1179
|
end,
|
|
1117
1180
|
set = function(self, maximumAutoAttackCount)
|
|
1118
1181
|
if maximumAutoAttackCount == 0 then
|
|
1119
|
-
self[
|
|
1182
|
+
self[130] = nil
|
|
1120
1183
|
else
|
|
1121
|
-
self[
|
|
1184
|
+
self[130] = maximumAutoAttackCount
|
|
1122
1185
|
end
|
|
1123
1186
|
end
|
|
1124
1187
|
},
|
|
@@ -1129,10 +1192,10 @@ __TS__SetDescriptor(
|
|
|
1129
1192
|
"durationIncreaseOnAutoAttack",
|
|
1130
1193
|
{
|
|
1131
1194
|
get = function(self)
|
|
1132
|
-
return self[
|
|
1195
|
+
return self[107] or 0
|
|
1133
1196
|
end,
|
|
1134
1197
|
set = function(self, durationIncreaseOnAutoAttack)
|
|
1135
|
-
self[
|
|
1198
|
+
self[107] = durationIncreaseOnAutoAttack
|
|
1136
1199
|
end
|
|
1137
1200
|
},
|
|
1138
1201
|
true
|
|
@@ -1163,11 +1226,24 @@ __TS__SetDescriptor(
|
|
|
1163
1226
|
},
|
|
1164
1227
|
true
|
|
1165
1228
|
)
|
|
1229
|
+
__TS__SetDescriptor(
|
|
1230
|
+
Buff.prototype,
|
|
1231
|
+
"evasionProbability",
|
|
1232
|
+
{
|
|
1233
|
+
get = function(self)
|
|
1234
|
+
return self:getUnitBonus(UnitBonusType.EVASION_PROBABILITY)
|
|
1235
|
+
end,
|
|
1236
|
+
set = function(self, evasionProbability)
|
|
1237
|
+
self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.EVASION_PROBABILITY, evasionProbability)
|
|
1238
|
+
end
|
|
1239
|
+
},
|
|
1240
|
+
true
|
|
1241
|
+
)
|
|
1166
1242
|
__TS__SetDescriptor(
|
|
1167
1243
|
Buff.prototype,
|
|
1168
1244
|
"duration",
|
|
1169
1245
|
{get = function(self)
|
|
1170
|
-
return self[
|
|
1246
|
+
return self[103]
|
|
1171
1247
|
end},
|
|
1172
1248
|
true
|
|
1173
1249
|
)
|
|
@@ -1176,15 +1252,15 @@ __TS__SetDescriptor(
|
|
|
1176
1252
|
"remainingDuration",
|
|
1177
1253
|
{
|
|
1178
1254
|
get = function(self)
|
|
1179
|
-
local
|
|
1180
|
-
return
|
|
1255
|
+
local ____opt_61 = self._timer
|
|
1256
|
+
return ____opt_61 and ____opt_61.remaining or 0
|
|
1181
1257
|
end,
|
|
1182
1258
|
set = function(self, remainingDuration)
|
|
1183
|
-
local
|
|
1184
|
-
local
|
|
1185
|
-
local remainingDurationDelta =
|
|
1259
|
+
local ____remainingDuration_65 = remainingDuration
|
|
1260
|
+
local ____opt_63 = self._timer
|
|
1261
|
+
local remainingDurationDelta = ____remainingDuration_65 - (____opt_63 and ____opt_63.remaining or 0)
|
|
1186
1262
|
if remainingDurationDelta ~= 0 then
|
|
1187
|
-
self[
|
|
1263
|
+
self[103] = self[103] + remainingDurationDelta
|
|
1188
1264
|
if remainingDuration <= 0 then
|
|
1189
1265
|
Timer:run(destroyBuff, self)
|
|
1190
1266
|
else
|
|
@@ -1196,7 +1272,8 @@ __TS__SetDescriptor(
|
|
|
1196
1272
|
self._level,
|
|
1197
1273
|
remainingDuration,
|
|
1198
1274
|
self._spellStealPriority,
|
|
1199
|
-
self._learnLevelMinimum
|
|
1275
|
+
self._learnLevelMinimum,
|
|
1276
|
+
self[142]
|
|
1200
1277
|
) then
|
|
1201
1278
|
local timer = self._timer
|
|
1202
1279
|
if timer == nil then
|
|
@@ -1210,10 +1287,11 @@ __TS__SetDescriptor(
|
|
|
1210
1287
|
end
|
|
1211
1288
|
},
|
|
1212
1289
|
true
|
|
1213
|
-
)
|
|
1290
|
+
)
|
|
1291
|
+
Buff.destroyEvent = buffDestroyEvent;
|
|
1214
1292
|
(function(self)
|
|
1215
1293
|
local function destroyBuffIfNeeded(buff)
|
|
1216
|
-
if getUnitAbility(buff[
|
|
1294
|
+
if getUnitAbility(buff[101].handle, buff.typeId) ~= buff.handle and buff[100] == 1 then
|
|
1217
1295
|
buff:destroy()
|
|
1218
1296
|
end
|
|
1219
1297
|
end
|