warscript 0.0.1-dev.ff2a62d → 0.0.1-dev.ff5dbcd
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/config.d.ts +5 -0
- package/config.lua +10 -0
- package/core/types/effect.d.ts +13 -3
- package/core/types/effect.lua +116 -17
- package/core/types/frame.d.ts +6 -0
- package/core/types/frame.lua +91 -1
- package/core/types/sound.d.ts +1 -0
- package/core/types/sound.lua +36 -2
- package/core/util.d.ts +1 -1
- package/core/util.lua +18 -1
- package/engine/behavior.d.ts +2 -2
- package/engine/behavior.lua +6 -6
- 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 +8 -5
- package/engine/behaviour/ability/apply-buff.lua +32 -0
- package/engine/behaviour/ability/emulate-impact.d.ts +6 -0
- package/engine/behaviour/ability/emulate-impact.lua +28 -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 +15 -3
- package/engine/behaviour/ability.lua +93 -34
- package/engine/behaviour/unit.d.ts +5 -0
- package/engine/behaviour/unit.lua +20 -0
- package/engine/buff.d.ts +78 -42
- package/engine/buff.lua +351 -223
- package/engine/internal/ability.d.ts +16 -13
- package/engine/internal/ability.lua +80 -76
- package/engine/internal/item/ability.lua +106 -0
- package/engine/internal/item+owner.lua +2 -2
- package/engine/internal/item.d.ts +2 -2
- package/engine/internal/item.lua +56 -25
- package/engine/internal/misc/ability-disable-counter.d.ts +2 -0
- package/engine/internal/misc/ability-disable-counter.lua +13 -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 +6 -2
- package/engine/internal/unit/bonus.lua +23 -1
- package/engine/internal/unit/ignore-events-items.d.ts +2 -0
- package/engine/internal/unit/ignore-events-items.lua +5 -0
- package/engine/internal/unit/item.d.ts +24 -0
- package/engine/internal/unit/item.lua +78 -0
- package/engine/internal/unit/main-selected.d.ts +13 -0
- package/engine/internal/unit/main-selected.lua +51 -0
- package/engine/internal/unit+ability.lua +2 -2
- package/engine/internal/unit-missile-launch.lua +24 -5
- package/engine/internal/unit.d.ts +26 -10
- package/engine/internal/unit.lua +162 -81
- package/engine/internal/utility.lua +12 -0
- package/engine/lightning.d.ts +12 -5
- package/engine/lightning.lua +48 -14
- package/engine/local-client.d.ts +7 -2
- package/engine/local-client.lua +82 -0
- package/engine/object-data/auxiliary/animation-name.d.ts +1 -0
- package/engine/object-data/auxiliary/animation-name.lua +16 -0
- package/engine/object-data/auxiliary/sound-preset-name.d.ts +5 -1
- package/engine/object-data/auxiliary/tech-tree-dependency.d.ts +1 -1
- package/engine/object-data/entry/ability-type/blank-configurable.lua +12 -1
- 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/feral-spirit.lua +2 -2
- package/engine/object-data/entry/ability-type/phoenix-morph.lua +4 -4
- 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.d.ts +8 -6
- package/engine/object-data/entry/ability-type.lua +62 -27
- package/engine/object-data/entry/buff-type/applicable.lua +13 -37
- package/engine/object-data/entry/buff-type.d.ts +1 -1
- package/engine/object-data/entry/buff-type.lua +2 -2
- package/engine/object-data/entry/destructible-type.d.ts +1 -1
- package/engine/object-data/entry/item-type.d.ts +15 -1
- package/engine/object-data/entry/item-type.lua +93 -2
- package/engine/object-data/entry/lightning-type.d.ts +1 -1
- package/engine/object-data/entry/sound-preset.d.ts +16 -0
- package/engine/object-data/entry/sound-preset.lua +36 -0
- package/engine/object-data/entry/unit-type.d.ts +8 -1
- package/engine/object-data/entry/unit-type.lua +61 -8
- 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 +26 -3
- package/engine/object-field/ability.lua +54 -1
- package/engine/object-field.d.ts +2 -2
- package/engine/object-field.lua +4 -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 +3 -0
- package/engine/unit.lua +3 -0
- package/index.d.ts +1 -0
- package/index.lua +1 -0
- package/net/socket.d.ts +7 -1
- package/net/socket.lua +45 -4
- package/network.d.ts +1 -0
- package/network.lua +3 -2
- package/objutil/buff.lua +1 -1
- package/objutil/unit.lua +8 -0
- package/package.json +2 -2
- package/patch-lua.d.ts +0 -0
- package/patch-lua.lua +10 -0
- package/utility/arrays.d.ts +8 -1
- package/utility/arrays.lua +34 -3
- package/utility/lazy.d.ts +2 -0
- package/utility/lazy.lua +14 -0
- package/utility/linked-set.d.ts +11 -2
- package/utility/linked-set.lua +5 -2
- package/utility/reflection.lua +11 -7
- package/utility/types.d.ts +1 -0
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,6 +101,9 @@ local buffParametersKeys = {
|
|
|
94
101
|
armorIncreaseFactor = true,
|
|
95
102
|
attackSpeedIncreaseFactor = true,
|
|
96
103
|
movementSpeedIncreaseFactor = true,
|
|
104
|
+
evasionProbability = true,
|
|
105
|
+
missProbability = true,
|
|
106
|
+
damageFactor = true,
|
|
97
107
|
receivedDamageFactor = true,
|
|
98
108
|
receivedMagicDamageFactor = true,
|
|
99
109
|
durationIncreaseOnAutoAttack = true,
|
|
@@ -107,12 +117,26 @@ local buffParametersKeys = {
|
|
|
107
117
|
disablesAutoAttack = true,
|
|
108
118
|
destroysOnDamage = true,
|
|
109
119
|
maximumAutoAttackCount = true,
|
|
120
|
+
maximumDamageDealtEventCount = true,
|
|
121
|
+
maximumDamageReceivedEventCount = true,
|
|
110
122
|
uniqueGroup = true,
|
|
111
123
|
damageOnExpiration = true,
|
|
112
124
|
healingOnExpiration = true,
|
|
113
125
|
killsOnExpiration = true,
|
|
114
126
|
explodesOnExpiration = true
|
|
115
127
|
}
|
|
128
|
+
local function resolveEnumValue(ability, level, value)
|
|
129
|
+
if value == nil or type(value) == "number" then
|
|
130
|
+
return value
|
|
131
|
+
end
|
|
132
|
+
if ability == nil then
|
|
133
|
+
error(
|
|
134
|
+
__TS__New(IllegalArgumentException),
|
|
135
|
+
0
|
|
136
|
+
)
|
|
137
|
+
end
|
|
138
|
+
return value:getValue(ability, level or ability.level)
|
|
139
|
+
end
|
|
116
140
|
local function resolveNumberValue(ability, level, value)
|
|
117
141
|
if value == nil or type(value) == "number" then
|
|
118
142
|
return value
|
|
@@ -161,9 +185,13 @@ local buffNumberParameters = {
|
|
|
161
185
|
"durationIncreaseOnAutoAttack",
|
|
162
186
|
"attackSpeedIncreaseFactor",
|
|
163
187
|
"movementSpeedIncreaseFactor",
|
|
188
|
+
"evasionProbability",
|
|
164
189
|
"armorIncrease",
|
|
190
|
+
"damageFactor",
|
|
165
191
|
"receivedDamageFactor",
|
|
166
192
|
"maximumAutoAttackCount",
|
|
193
|
+
"maximumDamageDealtEventCount",
|
|
194
|
+
"maximumDamageReceivedEventCount",
|
|
167
195
|
"damageInterval",
|
|
168
196
|
"damagePerInterval",
|
|
169
197
|
"damageOverDuration",
|
|
@@ -198,7 +226,7 @@ local function selectBuffTypeIdWithLeastDuration(buffTypeIds, unit)
|
|
|
198
226
|
return checkNotNull(firstNativeBuffTypeId)
|
|
199
227
|
end
|
|
200
228
|
local function destroyBuffIfItHasSameUniqueGroup(buff, uniqueGroup)
|
|
201
|
-
if buff[
|
|
229
|
+
if buff[104] == uniqueGroup then
|
|
202
230
|
buff:destroy()
|
|
203
231
|
end
|
|
204
232
|
end
|
|
@@ -206,17 +234,17 @@ local function destroyBuff(buff)
|
|
|
206
234
|
buff:destroy()
|
|
207
235
|
end
|
|
208
236
|
local function expireBuff(buff)
|
|
209
|
-
local remainingDamageOverDuration = buff[
|
|
210
|
-
local remainingHealingOverDuration = buff[
|
|
237
|
+
local remainingDamageOverDuration = buff[113] or 0
|
|
238
|
+
local remainingHealingOverDuration = buff[113] or 0
|
|
211
239
|
if remainingDamageOverDuration ~= 0 or remainingHealingOverDuration ~= 0 then
|
|
212
240
|
buff:flashSpecialEffect()
|
|
213
241
|
if remainingDamageOverDuration ~= 0 then
|
|
214
|
-
(buff[
|
|
215
|
-
buff[
|
|
242
|
+
(buff[102] or buff[101]):damageTarget(buff[101], remainingDamageOverDuration)
|
|
243
|
+
buff[113] = nil
|
|
216
244
|
end
|
|
217
245
|
if remainingHealingOverDuration ~= 0 then
|
|
218
|
-
(buff[
|
|
219
|
-
buff[
|
|
246
|
+
(buff[102] or buff[101]):healTarget(buff[101], remainingHealingOverDuration)
|
|
247
|
+
buff[118] = nil
|
|
220
248
|
end
|
|
221
249
|
end
|
|
222
250
|
Timer:run(destroyBuff, buff)
|
|
@@ -224,56 +252,57 @@ local function expireBuff(buff)
|
|
|
224
252
|
end
|
|
225
253
|
local function buffDamageIntervalInitialTimerCallback(buff)
|
|
226
254
|
buffDamageIntervalTimerCallback(buff)
|
|
227
|
-
local timer = buff[
|
|
228
|
-
local damageInterval = buff[
|
|
255
|
+
local timer = buff[114]
|
|
256
|
+
local damageInterval = buff[112]
|
|
229
257
|
if timer ~= nil and damageInterval ~= nil and damageInterval > 0 then
|
|
230
258
|
timer:start(damageInterval, true, buffDamageIntervalTimerCallback, buff)
|
|
231
259
|
end
|
|
232
260
|
end
|
|
233
261
|
buffDamageIntervalTimerCallback = function(buff)
|
|
234
262
|
buff:flashSpecialEffect()
|
|
235
|
-
local source = buff[
|
|
236
|
-
local remainingDamageOverDuration = buff[
|
|
263
|
+
local source = buff[102] or buff[101]
|
|
264
|
+
local remainingDamageOverDuration = buff[113] or 0
|
|
237
265
|
if remainingDamageOverDuration ~= 0 then
|
|
238
|
-
local damageInterval = buff[
|
|
266
|
+
local damageInterval = buff[112] or 0
|
|
239
267
|
if damageInterval ~= 0 then
|
|
240
268
|
local damage = remainingDamageOverDuration / (1 + buff.remainingDuration / damageInterval)
|
|
241
|
-
source:damageTarget(buff[
|
|
242
|
-
buff[
|
|
269
|
+
source:damageTarget(buff[101], damage)
|
|
270
|
+
buff[113] = remainingDamageOverDuration - damage
|
|
243
271
|
end
|
|
244
272
|
end
|
|
245
|
-
local damagePerInterval = buff[
|
|
273
|
+
local damagePerInterval = buff[111] or 0
|
|
246
274
|
if remainingDamageOverDuration == 0 or damagePerInterval ~= 0 then
|
|
247
|
-
source:damageTarget(buff[
|
|
275
|
+
source:damageTarget(buff[101], damagePerInterval)
|
|
248
276
|
end
|
|
249
277
|
end
|
|
250
278
|
local function buffHealingIntervalInitialTimerCallback(buff)
|
|
251
279
|
buffHealingIntervalTimerCallback(buff)
|
|
252
|
-
local timer = buff[
|
|
253
|
-
local healingInterval = buff[
|
|
280
|
+
local timer = buff[119]
|
|
281
|
+
local healingInterval = buff[117]
|
|
254
282
|
if timer ~= nil and healingInterval ~= nil and healingInterval > 0 then
|
|
255
283
|
timer:start(healingInterval, true, buffHealingIntervalTimerCallback, buff)
|
|
256
284
|
end
|
|
257
285
|
end
|
|
258
286
|
buffHealingIntervalTimerCallback = function(buff)
|
|
259
|
-
if buff[
|
|
287
|
+
if buff[117] ~= buff[112] then
|
|
260
288
|
buff:flashSpecialEffect()
|
|
261
289
|
end
|
|
262
|
-
local source = buff[
|
|
263
|
-
local remainingHealingOverDuration = buff[
|
|
290
|
+
local source = buff[102] or buff[101]
|
|
291
|
+
local remainingHealingOverDuration = buff[118] or 0
|
|
264
292
|
if remainingHealingOverDuration ~= 0 then
|
|
265
|
-
local healingInterval = buff[
|
|
293
|
+
local healingInterval = buff[117] or 0
|
|
266
294
|
if healingInterval ~= 0 then
|
|
267
295
|
local healing = remainingHealingOverDuration / (1 + buff.remainingDuration / healingInterval)
|
|
268
|
-
source:healTarget(buff[
|
|
269
|
-
buff[
|
|
296
|
+
source:healTarget(buff[101], healing)
|
|
297
|
+
buff[118] = remainingHealingOverDuration - healing
|
|
270
298
|
end
|
|
271
299
|
end
|
|
272
|
-
local healingPerInterval = buff[
|
|
300
|
+
local healingPerInterval = buff[116] or 0
|
|
273
301
|
if remainingHealingOverDuration == 0 or healingPerInterval ~= 0 then
|
|
274
|
-
source:healTarget(buff[
|
|
302
|
+
source:healTarget(buff[101], healingPerInterval)
|
|
275
303
|
end
|
|
276
304
|
end
|
|
305
|
+
local buffDestroyEvent = __TS__New(Event)
|
|
277
306
|
____exports.Buff = __TS__Class()
|
|
278
307
|
local Buff = ____exports.Buff
|
|
279
308
|
Buff.name = "Buff"
|
|
@@ -282,7 +311,8 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
282
311
|
UnitBehavior.prototype.____constructor(self, _unit)
|
|
283
312
|
self._unit = _unit
|
|
284
313
|
self.parameters = nil
|
|
285
|
-
self[100] =
|
|
314
|
+
self[100] = 0
|
|
315
|
+
self[101] = _unit
|
|
286
316
|
local typeId
|
|
287
317
|
local polarity
|
|
288
318
|
local resistanceType
|
|
@@ -310,8 +340,6 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
310
340
|
end
|
|
311
341
|
end
|
|
312
342
|
self.typeId = typeId
|
|
313
|
-
self.polarity = polarity
|
|
314
|
-
self.resistanceType = resistanceType
|
|
315
343
|
if not __TS__InstanceOf(ability, Ability) then
|
|
316
344
|
parameters = ability
|
|
317
345
|
ability = nil
|
|
@@ -338,14 +366,21 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
338
366
|
learnLevelMinimum = learnLevelMinimum or ability:getField(ABILITY_IF_REQUIRED_LEVEL)
|
|
339
367
|
duration = duration or getAbilityDuration(ability, _unit)
|
|
340
368
|
end
|
|
369
|
+
self.polarity = resolveEnumValue(ability, level, polarity)
|
|
370
|
+
self.resistanceType = resolveEnumValue(ability, level, resistanceType)
|
|
371
|
+
local missProbability = parameters and parameters.missProbability or defaultParameters.missProbability
|
|
372
|
+
if missProbability ~= nil then
|
|
373
|
+
missProbability = resolveNumberValue(ability, level, missProbability)
|
|
374
|
+
self[141] = missProbability
|
|
375
|
+
end
|
|
341
376
|
local buffByTypeId = buffByTypeIdByUnit[_unit]
|
|
342
377
|
if buffByTypeId == nil then
|
|
343
378
|
buffByTypeId = {}
|
|
344
379
|
buffByTypeIdByUnit[_unit] = buffByTypeId
|
|
345
380
|
end
|
|
346
|
-
local
|
|
347
|
-
if
|
|
348
|
-
|
|
381
|
+
local ____opt_15 = buffByTypeId[typeId]
|
|
382
|
+
if ____opt_15 ~= nil then
|
|
383
|
+
____opt_15:destroy()
|
|
349
384
|
end
|
|
350
385
|
local uniqueGroup = parameters and parameters.uniqueGroup or defaultParameters and defaultParameters.uniqueGroup
|
|
351
386
|
if uniqueGroup ~= nil then
|
|
@@ -354,18 +389,21 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
354
389
|
if not internalApplyBuff(
|
|
355
390
|
_unit,
|
|
356
391
|
typeId,
|
|
357
|
-
polarity,
|
|
358
|
-
resistanceType,
|
|
392
|
+
self.polarity,
|
|
393
|
+
self.resistanceType,
|
|
359
394
|
level,
|
|
360
395
|
duration,
|
|
361
396
|
spellStealPriority,
|
|
362
|
-
learnLevelMinimum
|
|
397
|
+
learnLevelMinimum,
|
|
398
|
+
missProbability
|
|
363
399
|
) then
|
|
400
|
+
self[100] = 1
|
|
364
401
|
UnitBehavior.prototype.destroy(self)
|
|
365
402
|
error(unsuccessfulApplicationMarker, 0)
|
|
366
403
|
end
|
|
367
404
|
local handle = BlzGetUnitAbility(_unit.handle, typeId)
|
|
368
405
|
if handle == nil then
|
|
406
|
+
self[100] = 1
|
|
369
407
|
UnitBehavior.prototype.destroy(self)
|
|
370
408
|
error(unsuccessfulApplicationMarker, 0)
|
|
371
409
|
end
|
|
@@ -374,20 +412,20 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
374
412
|
self._level = level
|
|
375
413
|
self._spellStealPriority = spellStealPriority
|
|
376
414
|
self._learnLevelMinimum = learnLevelMinimum
|
|
377
|
-
self[
|
|
378
|
-
self[
|
|
379
|
-
self[
|
|
380
|
-
self[
|
|
381
|
-
self[
|
|
415
|
+
self[102] = source
|
|
416
|
+
self[103] = duration or 0
|
|
417
|
+
self[104] = uniqueGroup
|
|
418
|
+
self[105] = BlzGetAbilityStringLevelField(self.handle, ABILITY_SLF_EFFECT, 0)
|
|
419
|
+
self[106] = BlzGetAbilityStringLevelField(self.handle, ABILITY_SLF_SPECIAL, 0)
|
|
382
420
|
if parameters ~= nil or (next(defaultParameters)) ~= nil then
|
|
383
421
|
for ____, buffBooleanParameter in ipairs(buffBooleanParameters) do
|
|
384
|
-
local
|
|
385
|
-
local
|
|
386
|
-
local
|
|
387
|
-
if
|
|
388
|
-
|
|
422
|
+
local ____ability_24 = ability
|
|
423
|
+
local ____level_25 = level
|
|
424
|
+
local ____temp_23 = parameters and parameters[buffBooleanParameter]
|
|
425
|
+
if ____temp_23 == nil then
|
|
426
|
+
____temp_23 = defaultParameters[buffBooleanParameter]
|
|
389
427
|
end
|
|
390
|
-
if resolveBooleanValue(
|
|
428
|
+
if resolveBooleanValue(____ability_24, ____level_25, ____temp_23) then
|
|
391
429
|
self[buffBooleanParameter] = true
|
|
392
430
|
end
|
|
393
431
|
end
|
|
@@ -403,11 +441,11 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
403
441
|
end
|
|
404
442
|
local maximumDuration = parameters and parameters.maximumDuration or defaultParameters.maximumDuration
|
|
405
443
|
if maximumDuration ~= nil then
|
|
406
|
-
self[
|
|
444
|
+
self[108] = resolveNumberValue(ability, level, maximumDuration)
|
|
407
445
|
end
|
|
408
446
|
local maximumRemainingDuration = parameters and parameters.maximumRemainingDuration or defaultParameters.maximumRemainingDuration
|
|
409
447
|
if maximumRemainingDuration ~= nil then
|
|
410
|
-
self[
|
|
448
|
+
self[109] = resolveNumberValue(ability, level, maximumRemainingDuration)
|
|
411
449
|
end
|
|
412
450
|
local parametersAbilityTypeIds = parameters and parameters.abilityTypeIds or defaultParameters.abilityTypeIds
|
|
413
451
|
if parametersAbilityTypeIds ~= nil then
|
|
@@ -464,10 +502,12 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
464
502
|
timer:start(duration, false, expireBuff, self)
|
|
465
503
|
self._timer = timer
|
|
466
504
|
end
|
|
505
|
+
self:onCreate()
|
|
506
|
+
self[100] = 1
|
|
467
507
|
end
|
|
468
508
|
function Buff.prototype.getUnitBonus(self, bonusType)
|
|
469
|
-
local
|
|
470
|
-
local bonusId =
|
|
509
|
+
local ____opt_38 = self._bonusIdByBonusType
|
|
510
|
+
local bonusId = ____opt_38 and ____opt_38[bonusType]
|
|
471
511
|
return bonusId == nil and 0 or getUnitBonus(self._unit, bonusType, bonusId)
|
|
472
512
|
end
|
|
473
513
|
function Buff.prototype.addOrUpdateOrRemoveUnitBonus(self, bonusType, value)
|
|
@@ -478,63 +518,71 @@ function Buff.prototype.addOrUpdateOrRemoveUnitBonus(self, bonusType, value)
|
|
|
478
518
|
end
|
|
479
519
|
bonusIdByBonusType[bonusType] = addOrUpdateOrRemoveUnitBonus(self._unit, bonusType, bonusIdByBonusType[bonusType], value)
|
|
480
520
|
end
|
|
481
|
-
function Buff.prototype.flashEffect(self,
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
local ____Effect_flash_41 = Effect.flash
|
|
485
|
-
local ____array_39 = __TS__SparseArrayNew(
|
|
486
|
-
self[104],
|
|
487
|
-
isWidgetProvided and widgetOrDuration or self._unit,
|
|
488
|
-
stringValueByBuffTypeIdByFieldId[fourCC("feft")][self.typeId] or "origin"
|
|
489
|
-
)
|
|
490
|
-
local ____isWidgetProvided_38
|
|
491
|
-
if isWidgetProvided then
|
|
492
|
-
____isWidgetProvided_38 = duration
|
|
521
|
+
function Buff.prototype.flashEffect(self, widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
522
|
+
if type(widgetOrXOrParametersOrDuration) == "number" and type(yOrParametersOrDuration) == "number" then
|
|
523
|
+
Effect:flash(self[105], widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
493
524
|
else
|
|
494
|
-
|
|
525
|
+
local isWidgetProvided = __TS__InstanceOf(widgetOrXOrParametersOrDuration, Unit) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Item) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Destructable)
|
|
526
|
+
local ____Effect_42 = Effect
|
|
527
|
+
local ____Effect_flash_43 = Effect.flash
|
|
528
|
+
local ____array_41 = __TS__SparseArrayNew(
|
|
529
|
+
self[105],
|
|
530
|
+
isWidgetProvided and widgetOrXOrParametersOrDuration or self._unit,
|
|
531
|
+
stringValueByBuffTypeIdByFieldId[fourCC("feft")][self.typeId] or "origin"
|
|
532
|
+
)
|
|
533
|
+
local ____isWidgetProvided_40
|
|
534
|
+
if isWidgetProvided then
|
|
535
|
+
____isWidgetProvided_40 = yOrParametersOrDuration
|
|
536
|
+
else
|
|
537
|
+
____isWidgetProvided_40 = widgetOrXOrParametersOrDuration
|
|
538
|
+
end
|
|
539
|
+
__TS__SparseArrayPush(____array_41, ____isWidgetProvided_40)
|
|
540
|
+
____Effect_flash_43(
|
|
541
|
+
____Effect_42,
|
|
542
|
+
__TS__SparseArraySpread(____array_41)
|
|
543
|
+
)
|
|
495
544
|
end
|
|
496
|
-
__TS__SparseArrayPush(____array_39, ____isWidgetProvided_38)
|
|
497
|
-
____Effect_flash_41(
|
|
498
|
-
____Effect_40,
|
|
499
|
-
__TS__SparseArraySpread(____array_39)
|
|
500
|
-
)
|
|
501
545
|
end
|
|
502
546
|
function Buff.prototype.flashSpecialEffect(self, widgetOrDuration, duration)
|
|
503
547
|
local isWidgetProvided = type(widgetOrDuration) == "table"
|
|
504
|
-
local
|
|
505
|
-
local
|
|
506
|
-
local
|
|
507
|
-
self[
|
|
548
|
+
local ____Effect_46 = Effect
|
|
549
|
+
local ____Effect_flash_47 = Effect.flash
|
|
550
|
+
local ____array_45 = __TS__SparseArrayNew(
|
|
551
|
+
self[106],
|
|
508
552
|
isWidgetProvided and widgetOrDuration or self._unit,
|
|
509
553
|
stringValueByBuffTypeIdByFieldId[fourCC("fspt")][self.typeId] or "origin"
|
|
510
554
|
)
|
|
511
|
-
local
|
|
555
|
+
local ____isWidgetProvided_44
|
|
512
556
|
if isWidgetProvided then
|
|
513
|
-
|
|
557
|
+
____isWidgetProvided_44 = duration
|
|
514
558
|
else
|
|
515
|
-
|
|
559
|
+
____isWidgetProvided_44 = widgetOrDuration
|
|
516
560
|
end
|
|
517
|
-
__TS__SparseArrayPush(
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
__TS__SparseArraySpread(
|
|
561
|
+
__TS__SparseArrayPush(____array_45, ____isWidgetProvided_44)
|
|
562
|
+
____Effect_flash_47(
|
|
563
|
+
____Effect_46,
|
|
564
|
+
__TS__SparseArraySpread(____array_45)
|
|
521
565
|
)
|
|
522
566
|
end
|
|
567
|
+
function Buff.prototype.onCreate(self)
|
|
568
|
+
end
|
|
523
569
|
function Buff.prototype.onDestroy(self)
|
|
570
|
+
check(self[100] ~= 0, "Cannot destroy a buff that has not finished creating yet.")
|
|
571
|
+
self[100] = 2
|
|
524
572
|
local unit = self._unit
|
|
525
573
|
if getUnitAbility(unit.handle, self.typeId) == self.handle then
|
|
526
574
|
removeBuff(unit.handle, self.typeId)
|
|
527
575
|
end
|
|
528
576
|
buffByTypeIdByUnit[unit][self.typeId] = nil
|
|
529
|
-
local healingIntervalTimer = self[
|
|
577
|
+
local healingIntervalTimer = self[119]
|
|
530
578
|
if healingIntervalTimer ~= nil then
|
|
531
579
|
healingIntervalTimer:destroy()
|
|
532
|
-
self[
|
|
580
|
+
self[119] = nil
|
|
533
581
|
end
|
|
534
|
-
local damageIntervalTimer = self[
|
|
582
|
+
local damageIntervalTimer = self[114]
|
|
535
583
|
if damageIntervalTimer ~= nil then
|
|
536
584
|
damageIntervalTimer:destroy()
|
|
537
|
-
self[
|
|
585
|
+
self[114] = nil
|
|
538
586
|
end
|
|
539
587
|
if self._timer ~= nil then
|
|
540
588
|
self._timer:destroy()
|
|
@@ -544,11 +592,11 @@ function Buff.prototype.onDestroy(self)
|
|
|
544
592
|
behavior:destroy()
|
|
545
593
|
end
|
|
546
594
|
end
|
|
547
|
-
if self[
|
|
595
|
+
if self[137] then
|
|
548
596
|
unit:decrementDisableAutoAttackCounter()
|
|
549
597
|
end
|
|
550
|
-
if self[
|
|
551
|
-
if self[
|
|
598
|
+
if self[135] then
|
|
599
|
+
if self[136] then
|
|
552
600
|
unit:decrementStunCounter()
|
|
553
601
|
end
|
|
554
602
|
unit:decrementStunCounter()
|
|
@@ -563,6 +611,8 @@ function Buff.prototype.onDestroy(self)
|
|
|
563
611
|
removeUnitBonus(unit, bonusType, bonusId)
|
|
564
612
|
end
|
|
565
613
|
end
|
|
614
|
+
Event.invoke(buffDestroyEvent, self)
|
|
615
|
+
self[100] = 3
|
|
566
616
|
return UnitBehavior.prototype.onDestroy(self)
|
|
567
617
|
end
|
|
568
618
|
function Buff.apply(self, ...)
|
|
@@ -590,8 +640,8 @@ function Buff.apply(self, ...)
|
|
|
590
640
|
end
|
|
591
641
|
end
|
|
592
642
|
function Buff.getByTypeId(self, unit, typeId)
|
|
593
|
-
local
|
|
594
|
-
local buff =
|
|
643
|
+
local ____opt_48 = buffByTypeIdByUnit[unit]
|
|
644
|
+
local buff = ____opt_48 and ____opt_48[typeId]
|
|
595
645
|
if __TS__InstanceOf(buff, self) then
|
|
596
646
|
return buff
|
|
597
647
|
end
|
|
@@ -599,56 +649,72 @@ function Buff.getByTypeId(self, unit, typeId)
|
|
|
599
649
|
end
|
|
600
650
|
function Buff.prototype.onExpiration(self)
|
|
601
651
|
local unit = self.unit
|
|
602
|
-
if self[119] ~= nil then
|
|
603
|
-
(self[101] or unit):damageTarget(unit, self[119] or 0)
|
|
604
|
-
end
|
|
605
652
|
if self[120] ~= nil then
|
|
606
|
-
(self[
|
|
653
|
+
(self[102] or unit):damageTarget(unit, self[120] or 0)
|
|
607
654
|
end
|
|
608
|
-
if self[
|
|
655
|
+
if self[121] ~= nil then
|
|
656
|
+
(self[102] or unit):healTarget(unit, self[120] or 0)
|
|
657
|
+
end
|
|
658
|
+
if self[140] then
|
|
609
659
|
unit:explode()
|
|
610
|
-
elseif self[
|
|
660
|
+
elseif self[139] then
|
|
611
661
|
unit:kill()
|
|
612
662
|
end
|
|
613
663
|
end
|
|
614
664
|
function Buff.prototype.onDeath(self, source)
|
|
615
665
|
local unit = self.unit
|
|
616
|
-
if self[
|
|
666
|
+
if self[122] ~= nil then
|
|
617
667
|
damageArea(
|
|
618
|
-
self[
|
|
619
|
-
self[
|
|
668
|
+
self[102] or unit,
|
|
669
|
+
self[122],
|
|
620
670
|
unit.x,
|
|
621
671
|
unit.y,
|
|
672
|
+
self[124] or 0,
|
|
622
673
|
self[123] or 0,
|
|
623
|
-
self[
|
|
674
|
+
self[126] or 0,
|
|
624
675
|
self[125] or 0,
|
|
625
|
-
self[
|
|
626
|
-
self[127] or 0
|
|
627
|
-
self[126] or 0
|
|
676
|
+
self[128] or 0,
|
|
677
|
+
self[127] or 0
|
|
628
678
|
)
|
|
629
679
|
end
|
|
630
680
|
end
|
|
631
681
|
function Buff.prototype.onDamageDealt(self, target, event)
|
|
632
682
|
if event.isAttack then
|
|
633
|
-
if self[
|
|
634
|
-
local durationIncrease = self[
|
|
635
|
-
local maximumDuration = self[
|
|
683
|
+
if self[107] ~= nil then
|
|
684
|
+
local durationIncrease = self[107]
|
|
685
|
+
local maximumDuration = self[108] or 0
|
|
636
686
|
if maximumDuration > 0 then
|
|
637
687
|
durationIncrease = min(
|
|
638
688
|
durationIncrease,
|
|
639
|
-
max(0, maximumDuration - self[
|
|
689
|
+
max(0, maximumDuration - self[103])
|
|
640
690
|
)
|
|
641
691
|
end
|
|
642
692
|
local remainingDuration = self.remainingDuration + durationIncrease
|
|
643
|
-
local maximumRemainingDuration = self[
|
|
693
|
+
local maximumRemainingDuration = self[109] or 0
|
|
644
694
|
if maximumRemainingDuration > 0 then
|
|
645
695
|
remainingDuration = min(remainingDuration, maximumRemainingDuration)
|
|
646
696
|
end
|
|
647
697
|
self.remainingDuration = remainingDuration
|
|
648
698
|
end
|
|
649
|
-
local autoAttackCount = (self[
|
|
650
|
-
self[
|
|
651
|
-
if autoAttackCount == self[
|
|
699
|
+
local autoAttackCount = (self[129] or 0) + 1
|
|
700
|
+
self[129] = autoAttackCount
|
|
701
|
+
if autoAttackCount == self[130] then
|
|
702
|
+
self:destroy()
|
|
703
|
+
end
|
|
704
|
+
end
|
|
705
|
+
if event.originalAmount ~= 0 then
|
|
706
|
+
local damageDealtEventCount = (self[131] or 0) + 1
|
|
707
|
+
self[131] = damageDealtEventCount
|
|
708
|
+
if damageDealtEventCount == self[132] then
|
|
709
|
+
self:destroy()
|
|
710
|
+
end
|
|
711
|
+
end
|
|
712
|
+
end
|
|
713
|
+
function Buff.prototype.onDamageReceived(self, source, event)
|
|
714
|
+
if event.originalAmount ~= 0 then
|
|
715
|
+
local damageReceivedEventCount = (self[133] or 0) + 1
|
|
716
|
+
self[133] = damageReceivedEventCount
|
|
717
|
+
if damageReceivedEventCount == self[134] then
|
|
652
718
|
self:destroy()
|
|
653
719
|
end
|
|
654
720
|
end
|
|
@@ -658,7 +724,7 @@ __TS__SetDescriptor(
|
|
|
658
724
|
Buff.prototype,
|
|
659
725
|
"source",
|
|
660
726
|
{get = function(self)
|
|
661
|
-
return self[
|
|
727
|
+
return self[102] or self._unit
|
|
662
728
|
end},
|
|
663
729
|
true
|
|
664
730
|
)
|
|
@@ -675,13 +741,13 @@ __TS__SetDescriptor(
|
|
|
675
741
|
"remainingDamageOverDuration",
|
|
676
742
|
{
|
|
677
743
|
get = function(self)
|
|
678
|
-
return self[
|
|
744
|
+
return self[113] or 0
|
|
679
745
|
end,
|
|
680
746
|
set = function(self, remainingDamageOverDuration)
|
|
681
|
-
local remainingDamageOverDurationDelta = remainingDamageOverDuration - (self[
|
|
682
|
-
self[
|
|
683
|
-
local damageOverDuration = (self[
|
|
684
|
-
self[
|
|
747
|
+
local remainingDamageOverDurationDelta = remainingDamageOverDuration - (self[113] or 0)
|
|
748
|
+
self[113] = remainingDamageOverDuration ~= 0 and remainingDamageOverDuration or nil
|
|
749
|
+
local damageOverDuration = (self[110] or 0) + remainingDamageOverDurationDelta
|
|
750
|
+
self[110] = damageOverDuration ~= 0 and damageOverDuration or nil
|
|
685
751
|
end
|
|
686
752
|
},
|
|
687
753
|
true
|
|
@@ -691,13 +757,13 @@ __TS__SetDescriptor(
|
|
|
691
757
|
"damageOverDuration",
|
|
692
758
|
{
|
|
693
759
|
get = function(self)
|
|
694
|
-
return self[
|
|
760
|
+
return self[110] or 0
|
|
695
761
|
end,
|
|
696
762
|
set = function(self, damageOverDuration)
|
|
697
|
-
local damageOverDurationDelta = damageOverDuration - (self[
|
|
698
|
-
self[
|
|
699
|
-
local remainingDamageOverDuration = (self[
|
|
700
|
-
self[
|
|
763
|
+
local damageOverDurationDelta = damageOverDuration - (self[110] or 0)
|
|
764
|
+
self[110] = damageOverDuration ~= 0 and damageOverDuration or nil
|
|
765
|
+
local remainingDamageOverDuration = (self[113] or 0) + damageOverDurationDelta
|
|
766
|
+
self[113] = remainingDamageOverDuration ~= 0 and remainingDamageOverDuration or nil
|
|
701
767
|
end
|
|
702
768
|
},
|
|
703
769
|
true
|
|
@@ -707,10 +773,10 @@ __TS__SetDescriptor(
|
|
|
707
773
|
"damagePerInterval",
|
|
708
774
|
{
|
|
709
775
|
get = function(self)
|
|
710
|
-
return self[
|
|
776
|
+
return self[111] or 0
|
|
711
777
|
end,
|
|
712
778
|
set = function(self, damagePerInterval)
|
|
713
|
-
self[
|
|
779
|
+
self[111] = damagePerInterval ~= 0 and damagePerInterval or nil
|
|
714
780
|
end
|
|
715
781
|
},
|
|
716
782
|
true
|
|
@@ -720,25 +786,25 @@ __TS__SetDescriptor(
|
|
|
720
786
|
"damageInterval",
|
|
721
787
|
{
|
|
722
788
|
get = function(self)
|
|
723
|
-
return self[
|
|
789
|
+
return self[112] or 0
|
|
724
790
|
end,
|
|
725
791
|
set = function(self, damageInterval)
|
|
726
792
|
if damageInterval <= 0 then
|
|
727
|
-
self[
|
|
728
|
-
local timer = self[
|
|
793
|
+
self[112] = damageInterval ~= 0 and damageInterval or nil
|
|
794
|
+
local timer = self[114]
|
|
729
795
|
if timer ~= nil then
|
|
730
796
|
timer:destroy()
|
|
731
|
-
self[
|
|
797
|
+
self[114] = nil
|
|
732
798
|
end
|
|
733
799
|
return
|
|
734
800
|
end
|
|
735
|
-
self[
|
|
736
|
-
local
|
|
737
|
-
local elapsed =
|
|
738
|
-
local timer = self[
|
|
801
|
+
self[112] = damageInterval
|
|
802
|
+
local ____opt_50 = self._timer
|
|
803
|
+
local elapsed = ____opt_50 and ____opt_50.elapsed or 0
|
|
804
|
+
local timer = self[114]
|
|
739
805
|
if timer == nil then
|
|
740
806
|
timer = Timer:create()
|
|
741
|
-
self[
|
|
807
|
+
self[114] = timer
|
|
742
808
|
end
|
|
743
809
|
local initialDelay = damageInterval - (elapsed >= damageInterval and math.fmod(elapsed, damageInterval) or elapsed)
|
|
744
810
|
if initialDelay == damageInterval then
|
|
@@ -755,13 +821,13 @@ __TS__SetDescriptor(
|
|
|
755
821
|
"remainingHealingOverDuration",
|
|
756
822
|
{
|
|
757
823
|
get = function(self)
|
|
758
|
-
return self[
|
|
824
|
+
return self[118] or 0
|
|
759
825
|
end,
|
|
760
826
|
set = function(self, remainingHealingOverDuration)
|
|
761
|
-
local remainingHealingOverDurationDelta = remainingHealingOverDuration - (self[
|
|
762
|
-
self[
|
|
763
|
-
local healingOverDuration = (self[
|
|
764
|
-
self[
|
|
827
|
+
local remainingHealingOverDurationDelta = remainingHealingOverDuration - (self[118] or 0)
|
|
828
|
+
self[113] = remainingHealingOverDuration ~= 0 and remainingHealingOverDuration or nil
|
|
829
|
+
local healingOverDuration = (self[115] or 0) + remainingHealingOverDurationDelta
|
|
830
|
+
self[115] = healingOverDuration ~= 0 and healingOverDuration or nil
|
|
765
831
|
end
|
|
766
832
|
},
|
|
767
833
|
true
|
|
@@ -771,13 +837,13 @@ __TS__SetDescriptor(
|
|
|
771
837
|
"healingOverDuration",
|
|
772
838
|
{
|
|
773
839
|
get = function(self)
|
|
774
|
-
return self[
|
|
840
|
+
return self[115] or 0
|
|
775
841
|
end,
|
|
776
842
|
set = function(self, healingOverDuration)
|
|
777
|
-
local healingOverDurationDelta = healingOverDuration - (self[
|
|
778
|
-
self[
|
|
779
|
-
local remainingHealingOverDuration = (self[
|
|
780
|
-
self[
|
|
843
|
+
local healingOverDurationDelta = healingOverDuration - (self[115] or 0)
|
|
844
|
+
self[115] = healingOverDuration ~= 0 and healingOverDuration or nil
|
|
845
|
+
local remainingHealingOverDuration = (self[118] or 0) + healingOverDurationDelta
|
|
846
|
+
self[118] = remainingHealingOverDuration ~= 0 and remainingHealingOverDuration or nil
|
|
781
847
|
end
|
|
782
848
|
},
|
|
783
849
|
true
|
|
@@ -787,10 +853,10 @@ __TS__SetDescriptor(
|
|
|
787
853
|
"healingPerInterval",
|
|
788
854
|
{
|
|
789
855
|
get = function(self)
|
|
790
|
-
return self[
|
|
856
|
+
return self[116] or 0
|
|
791
857
|
end,
|
|
792
858
|
set = function(self, healingPerInterval)
|
|
793
|
-
self[
|
|
859
|
+
self[116] = healingPerInterval ~= 0 and healingPerInterval or nil
|
|
794
860
|
end
|
|
795
861
|
},
|
|
796
862
|
true
|
|
@@ -800,25 +866,25 @@ __TS__SetDescriptor(
|
|
|
800
866
|
"healingInterval",
|
|
801
867
|
{
|
|
802
868
|
get = function(self)
|
|
803
|
-
return self[
|
|
869
|
+
return self[117] or 0
|
|
804
870
|
end,
|
|
805
871
|
set = function(self, healingInterval)
|
|
806
872
|
if healingInterval <= 0 then
|
|
807
|
-
self[
|
|
808
|
-
local timer = self[
|
|
873
|
+
self[117] = healingInterval ~= 0 and healingInterval or nil
|
|
874
|
+
local timer = self[119]
|
|
809
875
|
if timer ~= nil then
|
|
810
876
|
timer:destroy()
|
|
811
|
-
self[
|
|
877
|
+
self[119] = nil
|
|
812
878
|
end
|
|
813
879
|
return
|
|
814
880
|
end
|
|
815
|
-
self[
|
|
816
|
-
local
|
|
817
|
-
local elapsed =
|
|
818
|
-
local timer = self[
|
|
881
|
+
self[117] = healingInterval
|
|
882
|
+
local ____opt_52 = self._timer
|
|
883
|
+
local elapsed = ____opt_52 and ____opt_52.elapsed or 0
|
|
884
|
+
local timer = self[119]
|
|
819
885
|
if timer == nil then
|
|
820
886
|
timer = Timer:create()
|
|
821
|
-
self[
|
|
887
|
+
self[119] = timer
|
|
822
888
|
end
|
|
823
889
|
local initialDelay = healingInterval - (elapsed >= healingInterval and math.fmod(elapsed, healingInterval) or elapsed)
|
|
824
890
|
if initialDelay == healingInterval then
|
|
@@ -835,10 +901,10 @@ __TS__SetDescriptor(
|
|
|
835
901
|
"damageOnExpiration",
|
|
836
902
|
{
|
|
837
903
|
get = function(self)
|
|
838
|
-
return self[
|
|
904
|
+
return self[120] or 0
|
|
839
905
|
end,
|
|
840
906
|
set = function(self, damageOnExpiration)
|
|
841
|
-
self[
|
|
907
|
+
self[120] = damageOnExpiration ~= 0 and damageOnExpiration or nil
|
|
842
908
|
end
|
|
843
909
|
},
|
|
844
910
|
true
|
|
@@ -848,10 +914,23 @@ __TS__SetDescriptor(
|
|
|
848
914
|
"healingOnExpiration",
|
|
849
915
|
{
|
|
850
916
|
get = function(self)
|
|
851
|
-
return self[
|
|
917
|
+
return self[121] or 0
|
|
852
918
|
end,
|
|
853
919
|
set = function(self, healingOnExpiration)
|
|
854
|
-
self[
|
|
920
|
+
self[121] = healingOnExpiration ~= 0 and healingOnExpiration or nil
|
|
921
|
+
end
|
|
922
|
+
},
|
|
923
|
+
true
|
|
924
|
+
)
|
|
925
|
+
__TS__SetDescriptor(
|
|
926
|
+
Buff.prototype,
|
|
927
|
+
"damageFactor",
|
|
928
|
+
{
|
|
929
|
+
get = function(self)
|
|
930
|
+
return self:getUnitBonus(UnitBonusType.DAMAGE_FACTOR)
|
|
931
|
+
end,
|
|
932
|
+
set = function(self, damageFactor)
|
|
933
|
+
self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.DAMAGE_FACTOR, damageFactor)
|
|
855
934
|
end
|
|
856
935
|
},
|
|
857
936
|
true
|
|
@@ -887,25 +966,25 @@ __TS__SetDescriptor(
|
|
|
887
966
|
"stuns",
|
|
888
967
|
{
|
|
889
968
|
get = function(self)
|
|
890
|
-
local
|
|
891
|
-
if
|
|
892
|
-
|
|
969
|
+
local ____self__135_54 = self[135]
|
|
970
|
+
if ____self__135_54 == nil then
|
|
971
|
+
____self__135_54 = false
|
|
893
972
|
end
|
|
894
|
-
return
|
|
973
|
+
return ____self__135_54
|
|
895
974
|
end,
|
|
896
975
|
set = function(self, stuns)
|
|
897
|
-
if not stuns and self[
|
|
898
|
-
if self[
|
|
976
|
+
if not stuns and self[135] then
|
|
977
|
+
if self[136] then
|
|
899
978
|
self.object:decrementStunCounter()
|
|
900
979
|
end
|
|
901
980
|
self.object:decrementStunCounter()
|
|
902
|
-
self[
|
|
903
|
-
elseif stuns and not self[
|
|
904
|
-
if self[
|
|
981
|
+
self[135] = nil
|
|
982
|
+
elseif stuns and not self[135] then
|
|
983
|
+
if self[136] then
|
|
905
984
|
self.object:incrementStunCounter()
|
|
906
985
|
end
|
|
907
986
|
self.object:incrementStunCounter()
|
|
908
|
-
self[
|
|
987
|
+
self[135] = true
|
|
909
988
|
end
|
|
910
989
|
end
|
|
911
990
|
},
|
|
@@ -916,23 +995,23 @@ __TS__SetDescriptor(
|
|
|
916
995
|
"ignoresStunImmunity",
|
|
917
996
|
{
|
|
918
997
|
get = function(self)
|
|
919
|
-
local
|
|
920
|
-
if
|
|
921
|
-
|
|
998
|
+
local ____self__136_55 = self[136]
|
|
999
|
+
if ____self__136_55 == nil then
|
|
1000
|
+
____self__136_55 = false
|
|
922
1001
|
end
|
|
923
|
-
return
|
|
1002
|
+
return ____self__136_55
|
|
924
1003
|
end,
|
|
925
1004
|
set = function(self, ignoresStunImmunity)
|
|
926
|
-
if not ignoresStunImmunity and self[
|
|
927
|
-
if self[
|
|
1005
|
+
if not ignoresStunImmunity and self[136] then
|
|
1006
|
+
if self[135] then
|
|
928
1007
|
self.object:decrementStunCounter()
|
|
929
1008
|
end
|
|
930
|
-
self[
|
|
931
|
-
elseif ignoresStunImmunity and not self[
|
|
932
|
-
if self[
|
|
1009
|
+
self[136] = nil
|
|
1010
|
+
elseif ignoresStunImmunity and not self[136] then
|
|
1011
|
+
if self[135] then
|
|
933
1012
|
self.object:incrementStunCounter()
|
|
934
1013
|
end
|
|
935
|
-
self[
|
|
1014
|
+
self[136] = true
|
|
936
1015
|
end
|
|
937
1016
|
end
|
|
938
1017
|
},
|
|
@@ -943,19 +1022,19 @@ __TS__SetDescriptor(
|
|
|
943
1022
|
"disablesAutoAttack",
|
|
944
1023
|
{
|
|
945
1024
|
get = function(self)
|
|
946
|
-
local
|
|
947
|
-
if
|
|
948
|
-
|
|
1025
|
+
local ____self__137_56 = self[137]
|
|
1026
|
+
if ____self__137_56 == nil then
|
|
1027
|
+
____self__137_56 = false
|
|
949
1028
|
end
|
|
950
|
-
return
|
|
1029
|
+
return ____self__137_56
|
|
951
1030
|
end,
|
|
952
1031
|
set = function(self, disablesAutoAttack)
|
|
953
|
-
if not disablesAutoAttack and self[
|
|
1032
|
+
if not disablesAutoAttack and self[137] then
|
|
954
1033
|
self.object:decrementDisableAutoAttackCounter()
|
|
955
|
-
self[
|
|
956
|
-
elseif disablesAutoAttack and not self[
|
|
1034
|
+
self[137] = nil
|
|
1035
|
+
elseif disablesAutoAttack and not self[137] then
|
|
957
1036
|
self.object:incrementDisableAutoAttackCounter()
|
|
958
|
-
self[
|
|
1037
|
+
self[137] = true
|
|
959
1038
|
end
|
|
960
1039
|
end
|
|
961
1040
|
},
|
|
@@ -966,19 +1045,19 @@ __TS__SetDescriptor(
|
|
|
966
1045
|
"providesInvulnerability",
|
|
967
1046
|
{
|
|
968
1047
|
get = function(self)
|
|
969
|
-
local
|
|
970
|
-
if
|
|
971
|
-
|
|
1048
|
+
local ____self__138_57 = self[138]
|
|
1049
|
+
if ____self__138_57 == nil then
|
|
1050
|
+
____self__138_57 = false
|
|
972
1051
|
end
|
|
973
|
-
return
|
|
1052
|
+
return ____self__138_57
|
|
974
1053
|
end,
|
|
975
1054
|
set = function(self, providesInvulnerability)
|
|
976
|
-
if not providesInvulnerability and self[
|
|
1055
|
+
if not providesInvulnerability and self[138] then
|
|
977
1056
|
self.object:decrementInvulnerabilityCounter()
|
|
978
|
-
self[
|
|
979
|
-
elseif providesInvulnerability and not self[
|
|
1057
|
+
self[138] = nil
|
|
1058
|
+
elseif providesInvulnerability and not self[138] then
|
|
980
1059
|
self.object:incrementInvulnerabilityCounter()
|
|
981
|
-
self[
|
|
1060
|
+
self[138] = true
|
|
982
1061
|
end
|
|
983
1062
|
end
|
|
984
1063
|
},
|
|
@@ -989,17 +1068,17 @@ __TS__SetDescriptor(
|
|
|
989
1068
|
"killsOnExpiration",
|
|
990
1069
|
{
|
|
991
1070
|
get = function(self)
|
|
992
|
-
local
|
|
993
|
-
if
|
|
994
|
-
|
|
1071
|
+
local ____self__139_58 = self[139]
|
|
1072
|
+
if ____self__139_58 == nil then
|
|
1073
|
+
____self__139_58 = false
|
|
995
1074
|
end
|
|
996
|
-
return
|
|
1075
|
+
return ____self__139_58
|
|
997
1076
|
end,
|
|
998
1077
|
set = function(self, killsOnExpiration)
|
|
999
|
-
if not killsOnExpiration and self[
|
|
1000
|
-
self[
|
|
1001
|
-
elseif killsOnExpiration and not self[
|
|
1002
|
-
self[
|
|
1078
|
+
if not killsOnExpiration and self[139] then
|
|
1079
|
+
self[139] = nil
|
|
1080
|
+
elseif killsOnExpiration and not self[139] then
|
|
1081
|
+
self[139] = true
|
|
1003
1082
|
end
|
|
1004
1083
|
end
|
|
1005
1084
|
},
|
|
@@ -1010,17 +1089,51 @@ __TS__SetDescriptor(
|
|
|
1010
1089
|
"explodesOnExpiration",
|
|
1011
1090
|
{
|
|
1012
1091
|
get = function(self)
|
|
1013
|
-
local
|
|
1014
|
-
if
|
|
1015
|
-
|
|
1092
|
+
local ____self__140_59 = self[140]
|
|
1093
|
+
if ____self__140_59 == nil then
|
|
1094
|
+
____self__140_59 = false
|
|
1016
1095
|
end
|
|
1017
|
-
return
|
|
1096
|
+
return ____self__140_59
|
|
1018
1097
|
end,
|
|
1019
1098
|
set = function(self, killsOnExpiration)
|
|
1020
|
-
if not killsOnExpiration and self[
|
|
1021
|
-
self[
|
|
1022
|
-
elseif killsOnExpiration and not self[
|
|
1023
|
-
self[
|
|
1099
|
+
if not killsOnExpiration and self[140] then
|
|
1100
|
+
self[140] = nil
|
|
1101
|
+
elseif killsOnExpiration and not self[140] then
|
|
1102
|
+
self[140] = true
|
|
1103
|
+
end
|
|
1104
|
+
end
|
|
1105
|
+
},
|
|
1106
|
+
true
|
|
1107
|
+
)
|
|
1108
|
+
__TS__SetDescriptor(
|
|
1109
|
+
Buff.prototype,
|
|
1110
|
+
"maximumDamageDealtEventCount",
|
|
1111
|
+
{
|
|
1112
|
+
get = function(self)
|
|
1113
|
+
return self[132] or 0
|
|
1114
|
+
end,
|
|
1115
|
+
set = function(self, maximumDamageDealtEventCount)
|
|
1116
|
+
if maximumDamageDealtEventCount == 0 then
|
|
1117
|
+
self[132] = nil
|
|
1118
|
+
else
|
|
1119
|
+
self[132] = maximumDamageDealtEventCount
|
|
1120
|
+
end
|
|
1121
|
+
end
|
|
1122
|
+
},
|
|
1123
|
+
true
|
|
1124
|
+
)
|
|
1125
|
+
__TS__SetDescriptor(
|
|
1126
|
+
Buff.prototype,
|
|
1127
|
+
"maximumDamageReceivedEventCount",
|
|
1128
|
+
{
|
|
1129
|
+
get = function(self)
|
|
1130
|
+
return self[134] or 0
|
|
1131
|
+
end,
|
|
1132
|
+
set = function(self, maximumDamageReceivedEventCount)
|
|
1133
|
+
if maximumDamageReceivedEventCount == 0 then
|
|
1134
|
+
self[134] = nil
|
|
1135
|
+
else
|
|
1136
|
+
self[134] = maximumDamageReceivedEventCount
|
|
1024
1137
|
end
|
|
1025
1138
|
end
|
|
1026
1139
|
},
|
|
@@ -1031,13 +1144,13 @@ __TS__SetDescriptor(
|
|
|
1031
1144
|
"maximumAutoAttackCount",
|
|
1032
1145
|
{
|
|
1033
1146
|
get = function(self)
|
|
1034
|
-
return self[
|
|
1147
|
+
return self[130] or 0
|
|
1035
1148
|
end,
|
|
1036
1149
|
set = function(self, maximumAutoAttackCount)
|
|
1037
1150
|
if maximumAutoAttackCount == 0 then
|
|
1038
|
-
self[
|
|
1151
|
+
self[130] = nil
|
|
1039
1152
|
else
|
|
1040
|
-
self[
|
|
1153
|
+
self[130] = maximumAutoAttackCount
|
|
1041
1154
|
end
|
|
1042
1155
|
end
|
|
1043
1156
|
},
|
|
@@ -1048,10 +1161,10 @@ __TS__SetDescriptor(
|
|
|
1048
1161
|
"durationIncreaseOnAutoAttack",
|
|
1049
1162
|
{
|
|
1050
1163
|
get = function(self)
|
|
1051
|
-
return self[
|
|
1164
|
+
return self[107] or 0
|
|
1052
1165
|
end,
|
|
1053
1166
|
set = function(self, durationIncreaseOnAutoAttack)
|
|
1054
|
-
self[
|
|
1167
|
+
self[107] = durationIncreaseOnAutoAttack
|
|
1055
1168
|
end
|
|
1056
1169
|
},
|
|
1057
1170
|
true
|
|
@@ -1082,11 +1195,24 @@ __TS__SetDescriptor(
|
|
|
1082
1195
|
},
|
|
1083
1196
|
true
|
|
1084
1197
|
)
|
|
1198
|
+
__TS__SetDescriptor(
|
|
1199
|
+
Buff.prototype,
|
|
1200
|
+
"evasionProbability",
|
|
1201
|
+
{
|
|
1202
|
+
get = function(self)
|
|
1203
|
+
return self:getUnitBonus(UnitBonusType.EVASION_PROBABILITY)
|
|
1204
|
+
end,
|
|
1205
|
+
set = function(self, evasionProbability)
|
|
1206
|
+
self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.EVASION_PROBABILITY, evasionProbability)
|
|
1207
|
+
end
|
|
1208
|
+
},
|
|
1209
|
+
true
|
|
1210
|
+
)
|
|
1085
1211
|
__TS__SetDescriptor(
|
|
1086
1212
|
Buff.prototype,
|
|
1087
1213
|
"duration",
|
|
1088
1214
|
{get = function(self)
|
|
1089
|
-
return self[
|
|
1215
|
+
return self[103]
|
|
1090
1216
|
end},
|
|
1091
1217
|
true
|
|
1092
1218
|
)
|
|
@@ -1095,15 +1221,15 @@ __TS__SetDescriptor(
|
|
|
1095
1221
|
"remainingDuration",
|
|
1096
1222
|
{
|
|
1097
1223
|
get = function(self)
|
|
1098
|
-
local
|
|
1099
|
-
return
|
|
1224
|
+
local ____opt_60 = self._timer
|
|
1225
|
+
return ____opt_60 and ____opt_60.remaining or 0
|
|
1100
1226
|
end,
|
|
1101
1227
|
set = function(self, remainingDuration)
|
|
1102
|
-
local
|
|
1103
|
-
local
|
|
1104
|
-
local remainingDurationDelta =
|
|
1228
|
+
local ____remainingDuration_64 = remainingDuration
|
|
1229
|
+
local ____opt_62 = self._timer
|
|
1230
|
+
local remainingDurationDelta = ____remainingDuration_64 - (____opt_62 and ____opt_62.remaining or 0)
|
|
1105
1231
|
if remainingDurationDelta ~= 0 then
|
|
1106
|
-
self[
|
|
1232
|
+
self[103] = self[103] + remainingDurationDelta
|
|
1107
1233
|
if remainingDuration <= 0 then
|
|
1108
1234
|
Timer:run(destroyBuff, self)
|
|
1109
1235
|
else
|
|
@@ -1115,7 +1241,8 @@ __TS__SetDescriptor(
|
|
|
1115
1241
|
self._level,
|
|
1116
1242
|
remainingDuration,
|
|
1117
1243
|
self._spellStealPriority,
|
|
1118
|
-
self._learnLevelMinimum
|
|
1244
|
+
self._learnLevelMinimum,
|
|
1245
|
+
self[141]
|
|
1119
1246
|
) then
|
|
1120
1247
|
local timer = self._timer
|
|
1121
1248
|
if timer == nil then
|
|
@@ -1129,10 +1256,11 @@ __TS__SetDescriptor(
|
|
|
1129
1256
|
end
|
|
1130
1257
|
},
|
|
1131
1258
|
true
|
|
1132
|
-
)
|
|
1259
|
+
)
|
|
1260
|
+
Buff.destroyEvent = buffDestroyEvent;
|
|
1133
1261
|
(function(self)
|
|
1134
1262
|
local function destroyBuffIfNeeded(buff)
|
|
1135
|
-
if getUnitAbility(buff[
|
|
1263
|
+
if getUnitAbility(buff[101].handle, buff.typeId) ~= buff.handle and buff[100] == 1 then
|
|
1136
1264
|
buff:destroy()
|
|
1137
1265
|
end
|
|
1138
1266
|
end
|