warscript 0.0.1-dev.82b83f9 → 0.0.1-dev.833c02f

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.
Files changed (108) hide show
  1. package/attributes.d.ts +5 -0
  2. package/attributes.lua +8 -1
  3. package/config.d.ts +5 -0
  4. package/config.lua +10 -0
  5. package/core/types/effect.d.ts +1 -3
  6. package/core/types/effect.lua +26 -29
  7. package/core/types/sound.d.ts +17 -24
  8. package/core/types/sound.lua +99 -24
  9. package/core/types/timer.d.ts +6 -7
  10. package/core/types/timer.lua +18 -21
  11. package/core/util.lua +6 -1
  12. package/decl/native.d.ts +840 -786
  13. package/engine/behaviour/ability/apply-unit-behavior.lua +1 -0
  14. package/engine/behaviour/ability/damage.d.ts +9 -3
  15. package/engine/behaviour/ability/damage.lua +26 -38
  16. package/engine/behaviour/ability/emulate-impact.lua +7 -0
  17. package/engine/behaviour/ability.d.ts +5 -1
  18. package/engine/behaviour/ability.lua +18 -4
  19. package/engine/behaviour/unit.d.ts +2 -0
  20. package/engine/buff.d.ts +51 -41
  21. package/engine/buff.lua +274 -227
  22. package/engine/internal/item.d.ts +2 -1
  23. package/engine/internal/mechanics/ability-duration.lua +1 -1
  24. package/engine/internal/misc/damage-metadata-by-target.d.ts +2 -0
  25. package/engine/internal/misc/damage-metadata-by-target.lua +5 -0
  26. package/engine/internal/unit+damage.d.ts +2 -11
  27. package/engine/internal/unit+damage.lua +10 -14
  28. package/engine/internal/unit+spellSteal.lua +1 -2
  29. package/engine/internal/unit.d.ts +19 -3
  30. package/engine/internal/unit.lua +96 -37
  31. package/engine/object-data/auxiliary/animation-name.d.ts +1 -0
  32. package/engine/object-data/auxiliary/animation-name.lua +16 -0
  33. package/engine/object-data/auxiliary/attachment-preset.d.ts +7 -2
  34. package/engine/object-data/auxiliary/attachment-preset.lua +4 -3
  35. package/engine/object-data/auxiliary/attack-type.d.ts +7 -8
  36. package/engine/object-data/auxiliary/attack-type.lua +42 -0
  37. package/engine/object-data/auxiliary/movement-type.d.ts +7 -7
  38. package/engine/object-data/auxiliary/movement-type.lua +22 -0
  39. package/engine/object-data/auxiliary/sound-eax.d.ts +10 -0
  40. package/engine/object-data/auxiliary/sound-eax.lua +2 -0
  41. package/engine/object-data/auxiliary/tech-tree-dependency.d.ts +1 -1
  42. package/engine/object-data/auxiliary/unit-attribute.d.ts +6 -0
  43. package/engine/object-data/auxiliary/unit-attribute.lua +9 -0
  44. package/engine/object-data/entry/ability-type/berserk.d.ts +2 -0
  45. package/engine/object-data/entry/ability-type/berserk.lua +13 -0
  46. package/engine/object-data/entry/ability-type/blank-configurable.lua +12 -1
  47. package/engine/object-data/entry/ability-type/carrion-swarm.d.ts +14 -0
  48. package/engine/object-data/entry/ability-type/carrion-swarm.lua +65 -0
  49. package/engine/object-data/entry/ability-type/disease-cloud.lua +2 -2
  50. package/engine/object-data/entry/ability-type/engineering-upgrade.lua +2 -2
  51. package/engine/object-data/entry/ability-type/ensnare.d.ts +12 -0
  52. package/engine/object-data/entry/ability-type/ensnare.lua +52 -0
  53. package/engine/object-data/entry/ability-type/feral-spirit.lua +2 -2
  54. package/engine/object-data/entry/ability-type/permanent-invisibility.d.ts +8 -0
  55. package/engine/object-data/entry/ability-type/permanent-invisibility.lua +26 -0
  56. package/engine/object-data/entry/ability-type/phase-shift.d.ts +10 -0
  57. package/engine/object-data/entry/ability-type/phase-shift.lua +39 -0
  58. package/engine/object-data/entry/ability-type/phoenix-morph.lua +4 -4
  59. package/engine/object-data/entry/ability-type/raise-dead.d.ts +17 -0
  60. package/engine/object-data/entry/ability-type/raise-dead.lua +78 -0
  61. package/engine/object-data/entry/ability-type/shock-wave.d.ts +4 -0
  62. package/engine/object-data/entry/ability-type/shock-wave.lua +26 -0
  63. package/engine/object-data/entry/ability-type/slow-poison.d.ts +10 -0
  64. package/engine/object-data/entry/ability-type/slow-poison.lua +58 -0
  65. package/engine/object-data/entry/ability-type/summon-quilbeast.lua +2 -2
  66. package/engine/object-data/entry/ability-type/summon-water-elemental.lua +2 -2
  67. package/engine/object-data/entry/ability-type/web.d.ts +12 -0
  68. package/engine/object-data/entry/ability-type/web.lua +52 -0
  69. package/engine/object-data/entry/ability-type.d.ts +19 -17
  70. package/engine/object-data/entry/ability-type.lua +81 -21
  71. package/engine/object-data/entry/buff-type/applicable.lua +18 -37
  72. package/engine/object-data/entry/buff-type.d.ts +6 -12
  73. package/engine/object-data/entry/buff-type.lua +13 -29
  74. package/engine/object-data/entry/destructible-type.d.ts +1 -1
  75. package/engine/object-data/entry/item-type.d.ts +1 -1
  76. package/engine/object-data/entry/item-type.lua +4 -4
  77. package/engine/object-data/entry/lightning-type.d.ts +1 -1
  78. package/engine/object-data/entry/sound-preset.d.ts +33 -0
  79. package/engine/object-data/entry/sound-preset.lua +140 -0
  80. package/engine/object-data/entry/unit-type.d.ts +10 -3
  81. package/engine/object-data/entry/unit-type.lua +155 -92
  82. package/engine/object-data/entry/upgrade.d.ts +1 -1
  83. package/engine/object-data/entry/upgrade.lua +4 -4
  84. package/engine/object-data/entry.d.ts +16 -14
  85. package/engine/object-data/entry.lua +60 -32
  86. package/engine/object-field/ability.d.ts +1 -1
  87. package/engine/object-field/unit.d.ts +46 -3
  88. package/engine/object-field/unit.lua +173 -7
  89. package/engine/object-field.d.ts +9 -1
  90. package/engine/object-field.lua +158 -76
  91. package/engine/standard/entries/buff-type.d.ts +3 -0
  92. package/engine/standard/entries/buff-type.lua +3 -0
  93. package/engine/standard/entries/sound-preset.d.ts +10 -0
  94. package/engine/standard/entries/sound-preset.lua +10 -0
  95. package/objutil/buff.lua +1 -2
  96. package/objutil/unit.lua +8 -0
  97. package/package.json +2 -2
  98. package/utility/arrays.d.ts +1 -0
  99. package/utility/arrays.lua +3 -0
  100. package/utility/functions.d.ts +1 -0
  101. package/utility/functions.lua +1 -0
  102. package/utility/linked-set.d.ts +1 -0
  103. package/utility/linked-set.lua +3 -0
  104. package/utility/lua-maps.d.ts +3 -0
  105. package/utility/lua-maps.lua +16 -0
  106. package/utility/lua-sets.d.ts +1 -0
  107. package/utility/lua-sets.lua +3 -0
  108. 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
@@ -101,12 +102,14 @@ local buffParametersKeys = {
101
102
  attackSpeedIncreaseFactor = true,
102
103
  movementSpeedIncreaseFactor = true,
103
104
  evasionProbability = true,
105
+ missProbability = true,
104
106
  damageFactor = true,
105
107
  receivedDamageFactor = true,
106
108
  receivedMagicDamageFactor = true,
107
109
  durationIncreaseOnAutoAttack = true,
108
110
  maximumDuration = true,
109
111
  maximumRemainingDuration = true,
112
+ turnsIntoGhost = true,
110
113
  stuns = true,
111
114
  ignoresStunImmunity = true,
112
115
  providesStunImmunity = true,
@@ -172,6 +175,7 @@ local function resolveAndSetNumberValue(buff, property, ability, level, value, d
172
175
  end
173
176
  end
174
177
  local buffBooleanParameters = {
178
+ "turnsIntoGhost",
175
179
  "stuns",
176
180
  "ignoresStunImmunity",
177
181
  "disablesAutoAttack",
@@ -224,7 +228,7 @@ local function selectBuffTypeIdWithLeastDuration(buffTypeIds, unit)
224
228
  return checkNotNull(firstNativeBuffTypeId)
225
229
  end
226
230
  local function destroyBuffIfItHasSameUniqueGroup(buff, uniqueGroup)
227
- if buff[103] == uniqueGroup then
231
+ if buff[104] == uniqueGroup then
228
232
  buff:destroy()
229
233
  end
230
234
  end
@@ -232,17 +236,17 @@ local function destroyBuff(buff)
232
236
  buff:destroy()
233
237
  end
234
238
  local function expireBuff(buff)
235
- local remainingDamageOverDuration = buff[112] or 0
236
- local remainingHealingOverDuration = buff[112] or 0
239
+ local remainingDamageOverDuration = buff[113] or 0
240
+ local remainingHealingOverDuration = buff[113] or 0
237
241
  if remainingDamageOverDuration ~= 0 or remainingHealingOverDuration ~= 0 then
238
242
  buff:flashSpecialEffect()
239
243
  if remainingDamageOverDuration ~= 0 then
240
- (buff[101] or buff[100]):damageTarget(buff[100], remainingDamageOverDuration)
241
- buff[112] = nil
244
+ (buff[102] or buff[101]):damageTarget(buff[101], remainingDamageOverDuration)
245
+ buff[113] = nil
242
246
  end
243
247
  if remainingHealingOverDuration ~= 0 then
244
- (buff[101] or buff[100]):healTarget(buff[100], remainingHealingOverDuration)
245
- buff[117] = nil
248
+ (buff[102] or buff[101]):healTarget(buff[101], remainingHealingOverDuration)
249
+ buff[118] = nil
246
250
  end
247
251
  end
248
252
  Timer:run(destroyBuff, buff)
@@ -250,54 +254,54 @@ local function expireBuff(buff)
250
254
  end
251
255
  local function buffDamageIntervalInitialTimerCallback(buff)
252
256
  buffDamageIntervalTimerCallback(buff)
253
- local timer = buff[113]
254
- local damageInterval = buff[111]
257
+ local timer = buff[114]
258
+ local damageInterval = buff[112]
255
259
  if timer ~= nil and damageInterval ~= nil and damageInterval > 0 then
256
260
  timer:start(damageInterval, true, buffDamageIntervalTimerCallback, buff)
257
261
  end
258
262
  end
259
263
  buffDamageIntervalTimerCallback = function(buff)
260
264
  buff:flashSpecialEffect()
261
- local source = buff[101] or buff[100]
262
- local remainingDamageOverDuration = buff[112] or 0
265
+ local source = buff[102] or buff[101]
266
+ local remainingDamageOverDuration = buff[113] or 0
263
267
  if remainingDamageOverDuration ~= 0 then
264
- local damageInterval = buff[111] or 0
268
+ local damageInterval = buff[112] or 0
265
269
  if damageInterval ~= 0 then
266
270
  local damage = remainingDamageOverDuration / (1 + buff.remainingDuration / damageInterval)
267
- source:damageTarget(buff[100], damage)
268
- buff[112] = remainingDamageOverDuration - damage
271
+ source:damageTarget(buff[101], damage)
272
+ buff[113] = remainingDamageOverDuration - damage
269
273
  end
270
274
  end
271
- local damagePerInterval = buff[110] or 0
275
+ local damagePerInterval = buff[111] or 0
272
276
  if remainingDamageOverDuration == 0 or damagePerInterval ~= 0 then
273
- source:damageTarget(buff[100], damagePerInterval)
277
+ source:damageTarget(buff[101], damagePerInterval)
274
278
  end
275
279
  end
276
280
  local function buffHealingIntervalInitialTimerCallback(buff)
277
281
  buffHealingIntervalTimerCallback(buff)
278
- local timer = buff[118]
279
- local healingInterval = buff[116]
282
+ local timer = buff[119]
283
+ local healingInterval = buff[117]
280
284
  if timer ~= nil and healingInterval ~= nil and healingInterval > 0 then
281
285
  timer:start(healingInterval, true, buffHealingIntervalTimerCallback, buff)
282
286
  end
283
287
  end
284
288
  buffHealingIntervalTimerCallback = function(buff)
285
- if buff[116] ~= buff[111] then
289
+ if buff[117] ~= buff[112] then
286
290
  buff:flashSpecialEffect()
287
291
  end
288
- local source = buff[101] or buff[100]
289
- local remainingHealingOverDuration = buff[117] or 0
292
+ local source = buff[102] or buff[101]
293
+ local remainingHealingOverDuration = buff[118] or 0
290
294
  if remainingHealingOverDuration ~= 0 then
291
- local healingInterval = buff[116] or 0
295
+ local healingInterval = buff[117] or 0
292
296
  if healingInterval ~= 0 then
293
297
  local healing = remainingHealingOverDuration / (1 + buff.remainingDuration / healingInterval)
294
- source:healTarget(buff[100], healing)
295
- buff[117] = remainingHealingOverDuration - healing
298
+ source:healTarget(buff[101], healing)
299
+ buff[118] = remainingHealingOverDuration - healing
296
300
  end
297
301
  end
298
- local healingPerInterval = buff[115] or 0
302
+ local healingPerInterval = buff[116] or 0
299
303
  if remainingHealingOverDuration == 0 or healingPerInterval ~= 0 then
300
- source:healTarget(buff[100], healingPerInterval)
304
+ source:healTarget(buff[101], healingPerInterval)
301
305
  end
302
306
  end
303
307
  local buffDestroyEvent = __TS__New(Event)
@@ -309,7 +313,8 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
309
313
  UnitBehavior.prototype.____constructor(self, _unit)
310
314
  self._unit = _unit
311
315
  self.parameters = nil
312
- self[100] = _unit
316
+ self[100] = 0
317
+ self[101] = _unit
313
318
  local typeId
314
319
  local polarity
315
320
  local resistanceType
@@ -318,7 +323,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
318
323
  typeId = selectBuffTypeIdWithLeastDuration(typeIdOrTypeIds, _unit)
319
324
  polarity = resistanceTypeOrPolarity
320
325
  resistanceType = abilityOrParametersOrResistanceType
321
- if __TS__InstanceOf(parametersOrAbility, Ability) then
326
+ if __TS__InstanceOf(parametersOrAbility, Ability) or parametersOrAbility == nil then
322
327
  ability = parametersOrAbility
323
328
  else
324
329
  ability = nil
@@ -328,7 +333,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
328
333
  typeId = typeIdOrTypeIds
329
334
  polarity = polarityOrTypeIdSelectionPolicy
330
335
  resistanceType = resistanceTypeOrPolarity
331
- if __TS__InstanceOf(abilityOrParametersOrResistanceType, Ability) then
336
+ if __TS__InstanceOf(abilityOrParametersOrResistanceType, Ability) or abilityOrParametersOrResistanceType == nil then
332
337
  ability = abilityOrParametersOrResistanceType
333
338
  parameters = parametersOrAbility
334
339
  else
@@ -337,7 +342,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
337
342
  end
338
343
  end
339
344
  self.typeId = typeId
340
- if not __TS__InstanceOf(ability, Ability) then
345
+ if not (__TS__InstanceOf(ability, Ability) or ability == nil) then
341
346
  parameters = ability
342
347
  ability = nil
343
348
  end
@@ -365,14 +370,19 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
365
370
  end
366
371
  self.polarity = resolveEnumValue(ability, level, polarity)
367
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
368
378
  local buffByTypeId = buffByTypeIdByUnit[_unit]
369
379
  if buffByTypeId == nil then
370
380
  buffByTypeId = {}
371
381
  buffByTypeIdByUnit[_unit] = buffByTypeId
372
382
  end
373
- local ____opt_13 = buffByTypeId[typeId]
374
- if ____opt_13 ~= nil then
375
- ____opt_13:destroy()
383
+ local ____opt_15 = buffByTypeId[typeId]
384
+ if ____opt_15 ~= nil then
385
+ ____opt_15:destroy()
376
386
  end
377
387
  local uniqueGroup = parameters and parameters.uniqueGroup or defaultParameters and defaultParameters.uniqueGroup
378
388
  if uniqueGroup ~= nil then
@@ -386,13 +396,16 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
386
396
  level,
387
397
  duration,
388
398
  spellStealPriority,
389
- learnLevelMinimum
399
+ learnLevelMinimum,
400
+ missProbability
390
401
  ) then
402
+ self[100] = 1
391
403
  UnitBehavior.prototype.destroy(self)
392
404
  error(unsuccessfulApplicationMarker, 0)
393
405
  end
394
406
  local handle = BlzGetUnitAbility(_unit.handle, typeId)
395
407
  if handle == nil then
408
+ self[100] = 1
396
409
  UnitBehavior.prototype.destroy(self)
397
410
  error(unsuccessfulApplicationMarker, 0)
398
411
  end
@@ -401,20 +414,20 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
401
414
  self._level = level
402
415
  self._spellStealPriority = spellStealPriority
403
416
  self._learnLevelMinimum = learnLevelMinimum
404
- self[101] = source
405
- self[102] = duration or 0
406
- self[103] = uniqueGroup
407
- self[104] = BlzGetAbilityStringLevelField(self.handle, ABILITY_SLF_EFFECT, 0)
408
- self[105] = BlzGetAbilityStringLevelField(self.handle, ABILITY_SLF_SPECIAL, 0)
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)
409
422
  if parameters ~= nil or (next(defaultParameters)) ~= nil then
410
423
  for ____, buffBooleanParameter in ipairs(buffBooleanParameters) do
411
- local ____ability_22 = ability
412
- local ____level_23 = level
413
- local ____temp_21 = parameters and parameters[buffBooleanParameter]
414
- if ____temp_21 == nil then
415
- ____temp_21 = defaultParameters[buffBooleanParameter]
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]
416
429
  end
417
- if resolveBooleanValue(____ability_22, ____level_23, ____temp_21) then
430
+ if resolveBooleanValue(____ability_24, ____level_25, ____temp_23) then
418
431
  self[buffBooleanParameter] = true
419
432
  end
420
433
  end
@@ -430,11 +443,11 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
430
443
  end
431
444
  local maximumDuration = parameters and parameters.maximumDuration or defaultParameters.maximumDuration
432
445
  if maximumDuration ~= nil then
433
- self[107] = resolveNumberValue(ability, level, maximumDuration)
446
+ self[108] = resolveNumberValue(ability, level, maximumDuration)
434
447
  end
435
448
  local maximumRemainingDuration = parameters and parameters.maximumRemainingDuration or defaultParameters.maximumRemainingDuration
436
449
  if maximumRemainingDuration ~= nil then
437
- self[108] = resolveNumberValue(ability, level, maximumRemainingDuration)
450
+ self[109] = resolveNumberValue(ability, level, maximumRemainingDuration)
438
451
  end
439
452
  local parametersAbilityTypeIds = parameters and parameters.abilityTypeIds or defaultParameters.abilityTypeIds
440
453
  if parametersAbilityTypeIds ~= nil then
@@ -492,10 +505,11 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
492
505
  self._timer = timer
493
506
  end
494
507
  self:onCreate()
508
+ self[100] = 1
495
509
  end
496
510
  function Buff.prototype.getUnitBonus(self, bonusType)
497
- local ____opt_36 = self._bonusIdByBonusType
498
- local bonusId = ____opt_36 and ____opt_36[bonusType]
511
+ local ____opt_38 = self._bonusIdByBonusType
512
+ local bonusId = ____opt_38 and ____opt_38[bonusType]
499
513
  return bonusId == nil and 0 or getUnitBonus(self._unit, bonusType, bonusId)
500
514
  end
501
515
  function Buff.prototype.addOrUpdateOrRemoveUnitBonus(self, bonusType, value)
@@ -508,67 +522,69 @@ function Buff.prototype.addOrUpdateOrRemoveUnitBonus(self, bonusType, value)
508
522
  end
509
523
  function Buff.prototype.flashEffect(self, widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
510
524
  if type(widgetOrXOrParametersOrDuration) == "number" and type(yOrParametersOrDuration) == "number" then
511
- Effect:flash(self[104], widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
525
+ Effect:flash(self[105], widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
512
526
  else
513
527
  local isWidgetProvided = __TS__InstanceOf(widgetOrXOrParametersOrDuration, Unit) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Item) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Destructable)
514
- local ____Effect_40 = Effect
515
- local ____Effect_flash_41 = Effect.flash
516
- local ____array_39 = __TS__SparseArrayNew(
517
- self[104],
528
+ local ____Effect_42 = Effect
529
+ local ____Effect_flash_43 = Effect.flash
530
+ local ____array_41 = __TS__SparseArrayNew(
531
+ self[105],
518
532
  isWidgetProvided and widgetOrXOrParametersOrDuration or self._unit,
519
533
  stringValueByBuffTypeIdByFieldId[fourCC("feft")][self.typeId] or "origin"
520
534
  )
521
- local ____isWidgetProvided_38
535
+ local ____isWidgetProvided_40
522
536
  if isWidgetProvided then
523
- ____isWidgetProvided_38 = yOrParametersOrDuration
537
+ ____isWidgetProvided_40 = yOrParametersOrDuration
524
538
  else
525
- ____isWidgetProvided_38 = widgetOrXOrParametersOrDuration
539
+ ____isWidgetProvided_40 = widgetOrXOrParametersOrDuration
526
540
  end
527
- __TS__SparseArrayPush(____array_39, ____isWidgetProvided_38)
528
- ____Effect_flash_41(
529
- ____Effect_40,
530
- __TS__SparseArraySpread(____array_39)
541
+ __TS__SparseArrayPush(____array_41, ____isWidgetProvided_40)
542
+ ____Effect_flash_43(
543
+ ____Effect_42,
544
+ __TS__SparseArraySpread(____array_41)
531
545
  )
532
546
  end
533
547
  end
534
548
  function Buff.prototype.flashSpecialEffect(self, widgetOrDuration, duration)
535
549
  local isWidgetProvided = type(widgetOrDuration) == "table"
536
- local ____Effect_44 = Effect
537
- local ____Effect_flash_45 = Effect.flash
538
- local ____array_43 = __TS__SparseArrayNew(
539
- self[105],
550
+ local ____Effect_46 = Effect
551
+ local ____Effect_flash_47 = Effect.flash
552
+ local ____array_45 = __TS__SparseArrayNew(
553
+ self[106],
540
554
  isWidgetProvided and widgetOrDuration or self._unit,
541
555
  stringValueByBuffTypeIdByFieldId[fourCC("fspt")][self.typeId] or "origin"
542
556
  )
543
- local ____isWidgetProvided_42
557
+ local ____isWidgetProvided_44
544
558
  if isWidgetProvided then
545
- ____isWidgetProvided_42 = duration
559
+ ____isWidgetProvided_44 = duration
546
560
  else
547
- ____isWidgetProvided_42 = widgetOrDuration
561
+ ____isWidgetProvided_44 = widgetOrDuration
548
562
  end
549
- __TS__SparseArrayPush(____array_43, ____isWidgetProvided_42)
550
- ____Effect_flash_45(
551
- ____Effect_44,
552
- __TS__SparseArraySpread(____array_43)
563
+ __TS__SparseArrayPush(____array_45, ____isWidgetProvided_44)
564
+ ____Effect_flash_47(
565
+ ____Effect_46,
566
+ __TS__SparseArraySpread(____array_45)
553
567
  )
554
568
  end
555
569
  function Buff.prototype.onCreate(self)
556
570
  end
557
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
558
574
  local unit = self._unit
559
575
  if getUnitAbility(unit.handle, self.typeId) == self.handle then
560
576
  removeBuff(unit.handle, self.typeId)
561
577
  end
562
578
  buffByTypeIdByUnit[unit][self.typeId] = nil
563
- local healingIntervalTimer = self[118]
579
+ local healingIntervalTimer = self[119]
564
580
  if healingIntervalTimer ~= nil then
565
581
  healingIntervalTimer:destroy()
566
- self[118] = nil
582
+ self[119] = nil
567
583
  end
568
- local damageIntervalTimer = self[113]
584
+ local damageIntervalTimer = self[114]
569
585
  if damageIntervalTimer ~= nil then
570
586
  damageIntervalTimer:destroy()
571
- self[113] = nil
587
+ self[114] = nil
572
588
  end
573
589
  if self._timer ~= nil then
574
590
  self._timer:destroy()
@@ -578,15 +594,21 @@ function Buff.prototype.onDestroy(self)
578
594
  behavior:destroy()
579
595
  end
580
596
  end
581
- if self[136] then
597
+ if self[139] then
598
+ unit:decrementInvulnerabilityCounter()
599
+ end
600
+ if self[138] then
582
601
  unit:decrementDisableAutoAttackCounter()
583
602
  end
584
- if self[134] then
585
- if self[135] then
603
+ if self[136] then
604
+ if self[137] then
586
605
  unit:decrementStunCounter()
587
606
  end
588
607
  unit:decrementStunCounter()
589
608
  end
609
+ if self[135] then
610
+ unit:decrementGhostCounter()
611
+ end
590
612
  if self._abilityTypeIds ~= nil then
591
613
  for abilityTypeId in pairs(self._abilityTypeIds) do
592
614
  unit:removeAbility(abilityTypeId)
@@ -598,6 +620,7 @@ function Buff.prototype.onDestroy(self)
598
620
  end
599
621
  end
600
622
  Event.invoke(buffDestroyEvent, self)
623
+ self[100] = 3
601
624
  return UnitBehavior.prototype.onDestroy(self)
602
625
  end
603
626
  function Buff.apply(self, ...)
@@ -625,8 +648,8 @@ function Buff.apply(self, ...)
625
648
  end
626
649
  end
627
650
  function Buff.getByTypeId(self, unit, typeId)
628
- local ____opt_46 = buffByTypeIdByUnit[unit]
629
- local buff = ____opt_46 and ____opt_46[typeId]
651
+ local ____opt_48 = buffByTypeIdByUnit[unit]
652
+ local buff = ____opt_48 and ____opt_48[typeId]
630
653
  if __TS__InstanceOf(buff, self) then
631
654
  return buff
632
655
  end
@@ -634,72 +657,72 @@ function Buff.getByTypeId(self, unit, typeId)
634
657
  end
635
658
  function Buff.prototype.onExpiration(self)
636
659
  local unit = self.unit
637
- if self[119] ~= nil then
638
- (self[101] or unit):damageTarget(unit, self[119] or 0)
639
- end
640
660
  if self[120] ~= nil then
641
- (self[101] or unit):healTarget(unit, self[119] or 0)
661
+ (self[102] or unit):damageTarget(unit, self[120] or 0)
642
662
  end
643
- if self[139] then
663
+ if self[121] ~= nil then
664
+ (self[102] or unit):healTarget(unit, self[120] or 0)
665
+ end
666
+ if self[141] then
644
667
  unit:explode()
645
- elseif self[138] then
668
+ elseif self[140] then
646
669
  unit:kill()
647
670
  end
648
671
  end
649
672
  function Buff.prototype.onDeath(self, source)
650
673
  local unit = self.unit
651
- if self[121] ~= nil then
674
+ if self[122] ~= nil then
652
675
  damageArea(
653
- self[101] or unit,
654
- self[121],
676
+ self[102] or unit,
677
+ self[122],
655
678
  unit.x,
656
679
  unit.y,
680
+ self[124] or 0,
657
681
  self[123] or 0,
658
- self[122] or 0,
682
+ self[126] or 0,
659
683
  self[125] or 0,
660
- self[124] or 0,
661
- self[127] or 0,
662
- self[126] or 0
684
+ self[128] or 0,
685
+ self[127] or 0
663
686
  )
664
687
  end
665
688
  end
666
689
  function Buff.prototype.onDamageDealt(self, target, event)
667
690
  if event.isAttack then
668
- if self[106] ~= nil then
669
- local durationIncrease = self[106]
670
- local maximumDuration = self[107] or 0
691
+ if self[107] ~= nil then
692
+ local durationIncrease = self[107]
693
+ local maximumDuration = self[108] or 0
671
694
  if maximumDuration > 0 then
672
695
  durationIncrease = min(
673
696
  durationIncrease,
674
- max(0, maximumDuration - self[102])
697
+ max(0, maximumDuration - self[103])
675
698
  )
676
699
  end
677
700
  local remainingDuration = self.remainingDuration + durationIncrease
678
- local maximumRemainingDuration = self[108] or 0
701
+ local maximumRemainingDuration = self[109] or 0
679
702
  if maximumRemainingDuration > 0 then
680
703
  remainingDuration = min(remainingDuration, maximumRemainingDuration)
681
704
  end
682
705
  self.remainingDuration = remainingDuration
683
706
  end
684
- local autoAttackCount = (self[128] or 0) + 1
685
- self[128] = autoAttackCount
686
- if autoAttackCount == self[129] then
707
+ local autoAttackCount = (self[129] or 0) + 1
708
+ self[129] = autoAttackCount
709
+ if autoAttackCount == self[130] then
687
710
  self:destroy()
688
711
  end
689
712
  end
690
713
  if event.originalAmount ~= 0 then
691
- local damageDealtEventCount = (self[130] or 0) + 1
692
- self[130] = damageDealtEventCount
693
- if damageDealtEventCount == self[131] then
714
+ local damageDealtEventCount = (self[131] or 0) + 1
715
+ self[131] = damageDealtEventCount
716
+ if damageDealtEventCount == self[132] then
694
717
  self:destroy()
695
718
  end
696
719
  end
697
720
  end
698
721
  function Buff.prototype.onDamageReceived(self, source, event)
699
722
  if event.originalAmount ~= 0 then
700
- local damageReceivedEventCount = (self[132] or 0) + 1
701
- self[132] = damageReceivedEventCount
702
- if damageReceivedEventCount == self[133] then
723
+ local damageReceivedEventCount = (self[133] or 0) + 1
724
+ self[133] = damageReceivedEventCount
725
+ if damageReceivedEventCount == self[134] then
703
726
  self:destroy()
704
727
  end
705
728
  end
@@ -709,7 +732,7 @@ __TS__SetDescriptor(
709
732
  Buff.prototype,
710
733
  "source",
711
734
  {get = function(self)
712
- return self[101] or self._unit
735
+ return self[102] or self._unit
713
736
  end},
714
737
  true
715
738
  )
@@ -726,13 +749,13 @@ __TS__SetDescriptor(
726
749
  "remainingDamageOverDuration",
727
750
  {
728
751
  get = function(self)
729
- return self[112] or 0
752
+ return self[113] or 0
730
753
  end,
731
754
  set = function(self, remainingDamageOverDuration)
732
- local remainingDamageOverDurationDelta = remainingDamageOverDuration - (self[112] or 0)
733
- self[112] = remainingDamageOverDuration ~= 0 and remainingDamageOverDuration or nil
734
- local damageOverDuration = (self[109] or 0) + remainingDamageOverDurationDelta
735
- self[109] = damageOverDuration ~= 0 and damageOverDuration or nil
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
736
759
  end
737
760
  },
738
761
  true
@@ -742,13 +765,13 @@ __TS__SetDescriptor(
742
765
  "damageOverDuration",
743
766
  {
744
767
  get = function(self)
745
- return self[109] or 0
768
+ return self[110] or 0
746
769
  end,
747
770
  set = function(self, damageOverDuration)
748
- local damageOverDurationDelta = damageOverDuration - (self[109] or 0)
749
- self[109] = damageOverDuration ~= 0 and damageOverDuration or nil
750
- local remainingDamageOverDuration = (self[112] or 0) + damageOverDurationDelta
751
- self[112] = remainingDamageOverDuration ~= 0 and remainingDamageOverDuration or nil
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
752
775
  end
753
776
  },
754
777
  true
@@ -758,10 +781,10 @@ __TS__SetDescriptor(
758
781
  "damagePerInterval",
759
782
  {
760
783
  get = function(self)
761
- return self[110] or 0
784
+ return self[111] or 0
762
785
  end,
763
786
  set = function(self, damagePerInterval)
764
- self[110] = damagePerInterval ~= 0 and damagePerInterval or nil
787
+ self[111] = damagePerInterval ~= 0 and damagePerInterval or nil
765
788
  end
766
789
  },
767
790
  true
@@ -771,25 +794,25 @@ __TS__SetDescriptor(
771
794
  "damageInterval",
772
795
  {
773
796
  get = function(self)
774
- return self[111] or 0
797
+ return self[112] or 0
775
798
  end,
776
799
  set = function(self, damageInterval)
777
800
  if damageInterval <= 0 then
778
- self[111] = damageInterval ~= 0 and damageInterval or nil
779
- local timer = self[113]
801
+ self[112] = damageInterval ~= 0 and damageInterval or nil
802
+ local timer = self[114]
780
803
  if timer ~= nil then
781
804
  timer:destroy()
782
- self[113] = nil
805
+ self[114] = nil
783
806
  end
784
807
  return
785
808
  end
786
- self[111] = damageInterval
787
- local ____opt_48 = self._timer
788
- local elapsed = ____opt_48 and ____opt_48.elapsed or 0
789
- local timer = self[113]
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]
790
813
  if timer == nil then
791
814
  timer = Timer:create()
792
- self[113] = timer
815
+ self[114] = timer
793
816
  end
794
817
  local initialDelay = damageInterval - (elapsed >= damageInterval and math.fmod(elapsed, damageInterval) or elapsed)
795
818
  if initialDelay == damageInterval then
@@ -806,13 +829,13 @@ __TS__SetDescriptor(
806
829
  "remainingHealingOverDuration",
807
830
  {
808
831
  get = function(self)
809
- return self[117] or 0
832
+ return self[118] or 0
810
833
  end,
811
834
  set = function(self, remainingHealingOverDuration)
812
- local remainingHealingOverDurationDelta = remainingHealingOverDuration - (self[117] or 0)
813
- self[112] = remainingHealingOverDuration ~= 0 and remainingHealingOverDuration or nil
814
- local healingOverDuration = (self[114] or 0) + remainingHealingOverDurationDelta
815
- self[114] = healingOverDuration ~= 0 and healingOverDuration or nil
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
816
839
  end
817
840
  },
818
841
  true
@@ -822,13 +845,13 @@ __TS__SetDescriptor(
822
845
  "healingOverDuration",
823
846
  {
824
847
  get = function(self)
825
- return self[114] or 0
848
+ return self[115] or 0
826
849
  end,
827
850
  set = function(self, healingOverDuration)
828
- local healingOverDurationDelta = healingOverDuration - (self[114] or 0)
829
- self[114] = healingOverDuration ~= 0 and healingOverDuration or nil
830
- local remainingHealingOverDuration = (self[117] or 0) + healingOverDurationDelta
831
- self[117] = remainingHealingOverDuration ~= 0 and remainingHealingOverDuration or nil
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
832
855
  end
833
856
  },
834
857
  true
@@ -838,10 +861,10 @@ __TS__SetDescriptor(
838
861
  "healingPerInterval",
839
862
  {
840
863
  get = function(self)
841
- return self[115] or 0
864
+ return self[116] or 0
842
865
  end,
843
866
  set = function(self, healingPerInterval)
844
- self[115] = healingPerInterval ~= 0 and healingPerInterval or nil
867
+ self[116] = healingPerInterval ~= 0 and healingPerInterval or nil
845
868
  end
846
869
  },
847
870
  true
@@ -851,25 +874,25 @@ __TS__SetDescriptor(
851
874
  "healingInterval",
852
875
  {
853
876
  get = function(self)
854
- return self[116] or 0
877
+ return self[117] or 0
855
878
  end,
856
879
  set = function(self, healingInterval)
857
880
  if healingInterval <= 0 then
858
- self[116] = healingInterval ~= 0 and healingInterval or nil
859
- local timer = self[118]
881
+ self[117] = healingInterval ~= 0 and healingInterval or nil
882
+ local timer = self[119]
860
883
  if timer ~= nil then
861
884
  timer:destroy()
862
- self[118] = nil
885
+ self[119] = nil
863
886
  end
864
887
  return
865
888
  end
866
- self[116] = healingInterval
867
- local ____opt_50 = self._timer
868
- local elapsed = ____opt_50 and ____opt_50.elapsed or 0
869
- local timer = self[118]
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]
870
893
  if timer == nil then
871
894
  timer = Timer:create()
872
- self[118] = timer
895
+ self[119] = timer
873
896
  end
874
897
  local initialDelay = healingInterval - (elapsed >= healingInterval and math.fmod(elapsed, healingInterval) or elapsed)
875
898
  if initialDelay == healingInterval then
@@ -886,10 +909,10 @@ __TS__SetDescriptor(
886
909
  "damageOnExpiration",
887
910
  {
888
911
  get = function(self)
889
- return self[119] or 0
912
+ return self[120] or 0
890
913
  end,
891
914
  set = function(self, damageOnExpiration)
892
- self[119] = damageOnExpiration ~= 0 and damageOnExpiration or nil
915
+ self[120] = damageOnExpiration ~= 0 and damageOnExpiration or nil
893
916
  end
894
917
  },
895
918
  true
@@ -899,10 +922,10 @@ __TS__SetDescriptor(
899
922
  "healingOnExpiration",
900
923
  {
901
924
  get = function(self)
902
- return self[120] or 0
925
+ return self[121] or 0
903
926
  end,
904
927
  set = function(self, healingOnExpiration)
905
- self[120] = healingOnExpiration ~= 0 and healingOnExpiration or nil
928
+ self[121] = healingOnExpiration ~= 0 and healingOnExpiration or nil
906
929
  end
907
930
  },
908
931
  true
@@ -946,30 +969,53 @@ __TS__SetDescriptor(
946
969
  },
947
970
  true
948
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
+ )
949
995
  __TS__SetDescriptor(
950
996
  Buff.prototype,
951
997
  "stuns",
952
998
  {
953
999
  get = function(self)
954
- local ____self__134_52 = self[134]
955
- if ____self__134_52 == nil then
956
- ____self__134_52 = false
1000
+ local ____self__136_55 = self[136]
1001
+ if ____self__136_55 == nil then
1002
+ ____self__136_55 = false
957
1003
  end
958
- return ____self__134_52
1004
+ return ____self__136_55
959
1005
  end,
960
1006
  set = function(self, stuns)
961
- if not stuns and self[134] then
962
- if self[135] then
1007
+ if not stuns and self[136] then
1008
+ if self[137] then
963
1009
  self.object:decrementStunCounter()
964
1010
  end
965
1011
  self.object:decrementStunCounter()
966
- self[134] = nil
967
- elseif stuns and not self[134] then
968
- if self[135] then
1012
+ self[136] = nil
1013
+ elseif stuns and not self[136] then
1014
+ if self[137] then
969
1015
  self.object:incrementStunCounter()
970
1016
  end
971
1017
  self.object:incrementStunCounter()
972
- self[134] = true
1018
+ self[136] = true
973
1019
  end
974
1020
  end
975
1021
  },
@@ -980,23 +1026,23 @@ __TS__SetDescriptor(
980
1026
  "ignoresStunImmunity",
981
1027
  {
982
1028
  get = function(self)
983
- local ____self__135_53 = self[135]
984
- if ____self__135_53 == nil then
985
- ____self__135_53 = false
1029
+ local ____self__137_56 = self[137]
1030
+ if ____self__137_56 == nil then
1031
+ ____self__137_56 = false
986
1032
  end
987
- return ____self__135_53
1033
+ return ____self__137_56
988
1034
  end,
989
1035
  set = function(self, ignoresStunImmunity)
990
- if not ignoresStunImmunity and self[135] then
991
- if self[134] then
1036
+ if not ignoresStunImmunity and self[137] then
1037
+ if self[136] then
992
1038
  self.object:decrementStunCounter()
993
1039
  end
994
- self[135] = nil
995
- elseif ignoresStunImmunity and not self[135] then
996
- if self[134] then
1040
+ self[137] = nil
1041
+ elseif ignoresStunImmunity and not self[137] then
1042
+ if self[136] then
997
1043
  self.object:incrementStunCounter()
998
1044
  end
999
- self[135] = true
1045
+ self[137] = true
1000
1046
  end
1001
1047
  end
1002
1048
  },
@@ -1007,19 +1053,19 @@ __TS__SetDescriptor(
1007
1053
  "disablesAutoAttack",
1008
1054
  {
1009
1055
  get = function(self)
1010
- local ____self__136_54 = self[136]
1011
- if ____self__136_54 == nil then
1012
- ____self__136_54 = false
1056
+ local ____self__138_57 = self[138]
1057
+ if ____self__138_57 == nil then
1058
+ ____self__138_57 = false
1013
1059
  end
1014
- return ____self__136_54
1060
+ return ____self__138_57
1015
1061
  end,
1016
1062
  set = function(self, disablesAutoAttack)
1017
- if not disablesAutoAttack and self[136] then
1063
+ if not disablesAutoAttack and self[138] then
1018
1064
  self.object:decrementDisableAutoAttackCounter()
1019
- self[136] = nil
1020
- elseif disablesAutoAttack and not self[136] then
1065
+ self[138] = nil
1066
+ elseif disablesAutoAttack and not self[138] then
1021
1067
  self.object:incrementDisableAutoAttackCounter()
1022
- self[136] = true
1068
+ self[138] = true
1023
1069
  end
1024
1070
  end
1025
1071
  },
@@ -1030,19 +1076,19 @@ __TS__SetDescriptor(
1030
1076
  "providesInvulnerability",
1031
1077
  {
1032
1078
  get = function(self)
1033
- local ____self__137_55 = self[137]
1034
- if ____self__137_55 == nil then
1035
- ____self__137_55 = false
1079
+ local ____self__139_58 = self[139]
1080
+ if ____self__139_58 == nil then
1081
+ ____self__139_58 = false
1036
1082
  end
1037
- return ____self__137_55
1083
+ return ____self__139_58
1038
1084
  end,
1039
1085
  set = function(self, providesInvulnerability)
1040
- if not providesInvulnerability and self[137] then
1086
+ if not providesInvulnerability and self[139] then
1041
1087
  self.object:decrementInvulnerabilityCounter()
1042
- self[137] = nil
1043
- elseif providesInvulnerability and not self[137] then
1088
+ self[139] = nil
1089
+ elseif providesInvulnerability and not self[139] then
1044
1090
  self.object:incrementInvulnerabilityCounter()
1045
- self[137] = true
1091
+ self[139] = true
1046
1092
  end
1047
1093
  end
1048
1094
  },
@@ -1053,17 +1099,17 @@ __TS__SetDescriptor(
1053
1099
  "killsOnExpiration",
1054
1100
  {
1055
1101
  get = function(self)
1056
- local ____self__138_56 = self[138]
1057
- if ____self__138_56 == nil then
1058
- ____self__138_56 = false
1102
+ local ____self__140_59 = self[140]
1103
+ if ____self__140_59 == nil then
1104
+ ____self__140_59 = false
1059
1105
  end
1060
- return ____self__138_56
1106
+ return ____self__140_59
1061
1107
  end,
1062
1108
  set = function(self, killsOnExpiration)
1063
- if not killsOnExpiration and self[138] then
1064
- self[138] = nil
1065
- elseif killsOnExpiration and not self[138] then
1066
- self[138] = true
1109
+ if not killsOnExpiration and self[140] then
1110
+ self[140] = nil
1111
+ elseif killsOnExpiration and not self[140] then
1112
+ self[140] = true
1067
1113
  end
1068
1114
  end
1069
1115
  },
@@ -1074,17 +1120,17 @@ __TS__SetDescriptor(
1074
1120
  "explodesOnExpiration",
1075
1121
  {
1076
1122
  get = function(self)
1077
- local ____self__139_57 = self[139]
1078
- if ____self__139_57 == nil then
1079
- ____self__139_57 = false
1123
+ local ____self__141_60 = self[141]
1124
+ if ____self__141_60 == nil then
1125
+ ____self__141_60 = false
1080
1126
  end
1081
- return ____self__139_57
1127
+ return ____self__141_60
1082
1128
  end,
1083
1129
  set = function(self, killsOnExpiration)
1084
- if not killsOnExpiration and self[139] then
1085
- self[139] = nil
1086
- elseif killsOnExpiration and not self[139] then
1087
- self[139] = true
1130
+ if not killsOnExpiration and self[141] then
1131
+ self[141] = nil
1132
+ elseif killsOnExpiration and not self[141] then
1133
+ self[141] = true
1088
1134
  end
1089
1135
  end
1090
1136
  },
@@ -1095,13 +1141,13 @@ __TS__SetDescriptor(
1095
1141
  "maximumDamageDealtEventCount",
1096
1142
  {
1097
1143
  get = function(self)
1098
- return self[131] or 0
1144
+ return self[132] or 0
1099
1145
  end,
1100
1146
  set = function(self, maximumDamageDealtEventCount)
1101
1147
  if maximumDamageDealtEventCount == 0 then
1102
- self[131] = nil
1148
+ self[132] = nil
1103
1149
  else
1104
- self[131] = maximumDamageDealtEventCount
1150
+ self[132] = maximumDamageDealtEventCount
1105
1151
  end
1106
1152
  end
1107
1153
  },
@@ -1112,13 +1158,13 @@ __TS__SetDescriptor(
1112
1158
  "maximumDamageReceivedEventCount",
1113
1159
  {
1114
1160
  get = function(self)
1115
- return self[133] or 0
1161
+ return self[134] or 0
1116
1162
  end,
1117
1163
  set = function(self, maximumDamageReceivedEventCount)
1118
1164
  if maximumDamageReceivedEventCount == 0 then
1119
- self[133] = nil
1165
+ self[134] = nil
1120
1166
  else
1121
- self[133] = maximumDamageReceivedEventCount
1167
+ self[134] = maximumDamageReceivedEventCount
1122
1168
  end
1123
1169
  end
1124
1170
  },
@@ -1129,13 +1175,13 @@ __TS__SetDescriptor(
1129
1175
  "maximumAutoAttackCount",
1130
1176
  {
1131
1177
  get = function(self)
1132
- return self[129] or 0
1178
+ return self[130] or 0
1133
1179
  end,
1134
1180
  set = function(self, maximumAutoAttackCount)
1135
1181
  if maximumAutoAttackCount == 0 then
1136
- self[129] = nil
1182
+ self[130] = nil
1137
1183
  else
1138
- self[129] = maximumAutoAttackCount
1184
+ self[130] = maximumAutoAttackCount
1139
1185
  end
1140
1186
  end
1141
1187
  },
@@ -1146,10 +1192,10 @@ __TS__SetDescriptor(
1146
1192
  "durationIncreaseOnAutoAttack",
1147
1193
  {
1148
1194
  get = function(self)
1149
- return self[106] or 0
1195
+ return self[107] or 0
1150
1196
  end,
1151
1197
  set = function(self, durationIncreaseOnAutoAttack)
1152
- self[106] = durationIncreaseOnAutoAttack
1198
+ self[107] = durationIncreaseOnAutoAttack
1153
1199
  end
1154
1200
  },
1155
1201
  true
@@ -1197,7 +1243,7 @@ __TS__SetDescriptor(
1197
1243
  Buff.prototype,
1198
1244
  "duration",
1199
1245
  {get = function(self)
1200
- return self[102]
1246
+ return self[103]
1201
1247
  end},
1202
1248
  true
1203
1249
  )
@@ -1206,15 +1252,15 @@ __TS__SetDescriptor(
1206
1252
  "remainingDuration",
1207
1253
  {
1208
1254
  get = function(self)
1209
- local ____opt_58 = self._timer
1210
- return ____opt_58 and ____opt_58.remaining or 0
1255
+ local ____opt_61 = self._timer
1256
+ return ____opt_61 and ____opt_61.remaining or 0
1211
1257
  end,
1212
1258
  set = function(self, remainingDuration)
1213
- local ____remainingDuration_62 = remainingDuration
1214
- local ____opt_60 = self._timer
1215
- local remainingDurationDelta = ____remainingDuration_62 - (____opt_60 and ____opt_60.remaining or 0)
1259
+ local ____remainingDuration_65 = remainingDuration
1260
+ local ____opt_63 = self._timer
1261
+ local remainingDurationDelta = ____remainingDuration_65 - (____opt_63 and ____opt_63.remaining or 0)
1216
1262
  if remainingDurationDelta ~= 0 then
1217
- self[102] = self[102] + remainingDurationDelta
1263
+ self[103] = self[103] + remainingDurationDelta
1218
1264
  if remainingDuration <= 0 then
1219
1265
  Timer:run(destroyBuff, self)
1220
1266
  else
@@ -1226,7 +1272,8 @@ __TS__SetDescriptor(
1226
1272
  self._level,
1227
1273
  remainingDuration,
1228
1274
  self._spellStealPriority,
1229
- self._learnLevelMinimum
1275
+ self._learnLevelMinimum,
1276
+ self[142]
1230
1277
  ) then
1231
1278
  local timer = self._timer
1232
1279
  if timer == nil then
@@ -1244,7 +1291,7 @@ __TS__SetDescriptor(
1244
1291
  Buff.destroyEvent = buffDestroyEvent;
1245
1292
  (function(self)
1246
1293
  local function destroyBuffIfNeeded(buff)
1247
- if getUnitAbility(buff[100].handle, buff.typeId) ~= buff.handle then
1294
+ if getUnitAbility(buff[101].handle, buff.typeId) ~= buff.handle and buff[100] == 1 then
1248
1295
  buff:destroy()
1249
1296
  end
1250
1297
  end