warscript 0.0.1-dev.fd21394 → 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/binaryreader.d.ts +1 -0
- package/binaryreader.lua +3 -0
- 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 +8 -0
- package/core/types/frame.lua +93 -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/damage.d.ts +33 -11
- package/engine/behaviour/ability/damage.lua +89 -31
- package/engine/behaviour/ability/emulate-impact.d.ts +6 -0
- package/engine/behaviour/ability/emulate-impact.lua +28 -0
- package/engine/behaviour/ability/heal.d.ts +33 -6
- package/engine/behaviour/ability/heal.lua +89 -10
- 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/restore-mana.d.ts +15 -0
- package/engine/behaviour/ability/restore-mana.lua +29 -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 +95 -38
- package/engine/buff.lua +424 -200
- package/engine/game-map.d.ts +7 -0
- package/engine/game-map.lua +32 -0
- 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+transport.lua +4 -10
- 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/lualib_bundle.lua +7 -2
- 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/property.d.ts +55 -0
- package/property.lua +374 -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/core/mapbounds.d.ts +0 -8
- package/core/mapbounds.lua +0 -12
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,8 +117,26 @@ local buffParametersKeys = {
|
|
|
107
117
|
disablesAutoAttack = true,
|
|
108
118
|
destroysOnDamage = true,
|
|
109
119
|
maximumAutoAttackCount = true,
|
|
110
|
-
|
|
120
|
+
maximumDamageDealtEventCount = true,
|
|
121
|
+
maximumDamageReceivedEventCount = true,
|
|
122
|
+
uniqueGroup = true,
|
|
123
|
+
damageOnExpiration = true,
|
|
124
|
+
healingOnExpiration = true,
|
|
125
|
+
killsOnExpiration = true,
|
|
126
|
+
explodesOnExpiration = true
|
|
111
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
|
|
112
140
|
local function resolveNumberValue(ability, level, value)
|
|
113
141
|
if value == nil or type(value) == "number" then
|
|
114
142
|
return value
|
|
@@ -145,20 +173,33 @@ local function resolveAndSetNumberValue(buff, property, ability, level, value, d
|
|
|
145
173
|
buff[property] = resolvedValue
|
|
146
174
|
end
|
|
147
175
|
end
|
|
148
|
-
local buffBooleanParameters = {
|
|
176
|
+
local buffBooleanParameters = {
|
|
177
|
+
"stuns",
|
|
178
|
+
"ignoresStunImmunity",
|
|
179
|
+
"disablesAutoAttack",
|
|
180
|
+
"providesInvulnerability",
|
|
181
|
+
"killsOnExpiration",
|
|
182
|
+
"explodesOnExpiration"
|
|
183
|
+
}
|
|
149
184
|
local buffNumberParameters = {
|
|
150
185
|
"durationIncreaseOnAutoAttack",
|
|
151
186
|
"attackSpeedIncreaseFactor",
|
|
152
187
|
"movementSpeedIncreaseFactor",
|
|
188
|
+
"evasionProbability",
|
|
153
189
|
"armorIncrease",
|
|
190
|
+
"damageFactor",
|
|
154
191
|
"receivedDamageFactor",
|
|
155
192
|
"maximumAutoAttackCount",
|
|
193
|
+
"maximumDamageDealtEventCount",
|
|
194
|
+
"maximumDamageReceivedEventCount",
|
|
156
195
|
"damageInterval",
|
|
157
196
|
"damagePerInterval",
|
|
158
197
|
"damageOverDuration",
|
|
159
198
|
"healingInterval",
|
|
160
199
|
"healingPerInterval",
|
|
161
|
-
"healingOverDuration"
|
|
200
|
+
"healingOverDuration",
|
|
201
|
+
"damageOnExpiration",
|
|
202
|
+
"healingOnExpiration"
|
|
162
203
|
}
|
|
163
204
|
local unsuccessfulApplicationMarker = {}
|
|
164
205
|
local function selectBuffTypeIdWithLeastDuration(buffTypeIds, unit)
|
|
@@ -185,7 +226,7 @@ local function selectBuffTypeIdWithLeastDuration(buffTypeIds, unit)
|
|
|
185
226
|
return checkNotNull(firstNativeBuffTypeId)
|
|
186
227
|
end
|
|
187
228
|
local function destroyBuffIfItHasSameUniqueGroup(buff, uniqueGroup)
|
|
188
|
-
if buff[
|
|
229
|
+
if buff[104] == uniqueGroup then
|
|
189
230
|
buff:destroy()
|
|
190
231
|
end
|
|
191
232
|
end
|
|
@@ -193,73 +234,75 @@ local function destroyBuff(buff)
|
|
|
193
234
|
buff:destroy()
|
|
194
235
|
end
|
|
195
236
|
local function expireBuff(buff)
|
|
196
|
-
local remainingDamageOverDuration = buff[
|
|
197
|
-
local remainingHealingOverDuration = buff[
|
|
237
|
+
local remainingDamageOverDuration = buff[113] or 0
|
|
238
|
+
local remainingHealingOverDuration = buff[113] or 0
|
|
198
239
|
if remainingDamageOverDuration ~= 0 or remainingHealingOverDuration ~= 0 then
|
|
199
240
|
buff:flashSpecialEffect()
|
|
200
241
|
if remainingDamageOverDuration ~= 0 then
|
|
201
|
-
(buff[
|
|
202
|
-
buff[
|
|
242
|
+
(buff[102] or buff[101]):damageTarget(buff[101], remainingDamageOverDuration)
|
|
243
|
+
buff[113] = nil
|
|
203
244
|
end
|
|
204
245
|
if remainingHealingOverDuration ~= 0 then
|
|
205
|
-
(buff[
|
|
206
|
-
buff[
|
|
246
|
+
(buff[102] or buff[101]):healTarget(buff[101], remainingHealingOverDuration)
|
|
247
|
+
buff[118] = nil
|
|
207
248
|
end
|
|
208
249
|
end
|
|
209
250
|
Timer:run(destroyBuff, buff)
|
|
251
|
+
buff:onExpiration()
|
|
210
252
|
end
|
|
211
253
|
local function buffDamageIntervalInitialTimerCallback(buff)
|
|
212
254
|
buffDamageIntervalTimerCallback(buff)
|
|
213
|
-
local timer = buff[
|
|
214
|
-
local damageInterval = buff[
|
|
255
|
+
local timer = buff[114]
|
|
256
|
+
local damageInterval = buff[112]
|
|
215
257
|
if timer ~= nil and damageInterval ~= nil and damageInterval > 0 then
|
|
216
258
|
timer:start(damageInterval, true, buffDamageIntervalTimerCallback, buff)
|
|
217
259
|
end
|
|
218
260
|
end
|
|
219
261
|
buffDamageIntervalTimerCallback = function(buff)
|
|
220
262
|
buff:flashSpecialEffect()
|
|
221
|
-
local source = buff[
|
|
222
|
-
local remainingDamageOverDuration = buff[
|
|
263
|
+
local source = buff[102] or buff[101]
|
|
264
|
+
local remainingDamageOverDuration = buff[113] or 0
|
|
223
265
|
if remainingDamageOverDuration ~= 0 then
|
|
224
|
-
local damageInterval = buff[
|
|
266
|
+
local damageInterval = buff[112] or 0
|
|
225
267
|
if damageInterval ~= 0 then
|
|
226
268
|
local damage = remainingDamageOverDuration / (1 + buff.remainingDuration / damageInterval)
|
|
227
|
-
source:damageTarget(buff[
|
|
228
|
-
buff[
|
|
269
|
+
source:damageTarget(buff[101], damage)
|
|
270
|
+
buff[113] = remainingDamageOverDuration - damage
|
|
229
271
|
end
|
|
230
272
|
end
|
|
231
|
-
local damagePerInterval = buff[
|
|
273
|
+
local damagePerInterval = buff[111] or 0
|
|
232
274
|
if remainingDamageOverDuration == 0 or damagePerInterval ~= 0 then
|
|
233
|
-
source:damageTarget(buff[
|
|
275
|
+
source:damageTarget(buff[101], damagePerInterval)
|
|
234
276
|
end
|
|
235
277
|
end
|
|
236
278
|
local function buffHealingIntervalInitialTimerCallback(buff)
|
|
237
279
|
buffHealingIntervalTimerCallback(buff)
|
|
238
|
-
local timer = buff[
|
|
239
|
-
local healingInterval = buff[
|
|
280
|
+
local timer = buff[119]
|
|
281
|
+
local healingInterval = buff[117]
|
|
240
282
|
if timer ~= nil and healingInterval ~= nil and healingInterval > 0 then
|
|
241
283
|
timer:start(healingInterval, true, buffHealingIntervalTimerCallback, buff)
|
|
242
284
|
end
|
|
243
285
|
end
|
|
244
286
|
buffHealingIntervalTimerCallback = function(buff)
|
|
245
|
-
if buff[
|
|
287
|
+
if buff[117] ~= buff[112] then
|
|
246
288
|
buff:flashSpecialEffect()
|
|
247
289
|
end
|
|
248
|
-
local source = buff[
|
|
249
|
-
local remainingHealingOverDuration = buff[
|
|
290
|
+
local source = buff[102] or buff[101]
|
|
291
|
+
local remainingHealingOverDuration = buff[118] or 0
|
|
250
292
|
if remainingHealingOverDuration ~= 0 then
|
|
251
|
-
local healingInterval = buff[
|
|
293
|
+
local healingInterval = buff[117] or 0
|
|
252
294
|
if healingInterval ~= 0 then
|
|
253
295
|
local healing = remainingHealingOverDuration / (1 + buff.remainingDuration / healingInterval)
|
|
254
|
-
source:healTarget(buff[
|
|
255
|
-
buff[
|
|
296
|
+
source:healTarget(buff[101], healing)
|
|
297
|
+
buff[118] = remainingHealingOverDuration - healing
|
|
256
298
|
end
|
|
257
299
|
end
|
|
258
|
-
local healingPerInterval = buff[
|
|
300
|
+
local healingPerInterval = buff[116] or 0
|
|
259
301
|
if remainingHealingOverDuration == 0 or healingPerInterval ~= 0 then
|
|
260
|
-
source:healTarget(buff[
|
|
302
|
+
source:healTarget(buff[101], healingPerInterval)
|
|
261
303
|
end
|
|
262
304
|
end
|
|
305
|
+
local buffDestroyEvent = __TS__New(Event)
|
|
263
306
|
____exports.Buff = __TS__Class()
|
|
264
307
|
local Buff = ____exports.Buff
|
|
265
308
|
Buff.name = "Buff"
|
|
@@ -268,7 +311,8 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
268
311
|
UnitBehavior.prototype.____constructor(self, _unit)
|
|
269
312
|
self._unit = _unit
|
|
270
313
|
self.parameters = nil
|
|
271
|
-
self[100] =
|
|
314
|
+
self[100] = 0
|
|
315
|
+
self[101] = _unit
|
|
272
316
|
local typeId
|
|
273
317
|
local polarity
|
|
274
318
|
local resistanceType
|
|
@@ -296,8 +340,6 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
296
340
|
end
|
|
297
341
|
end
|
|
298
342
|
self.typeId = typeId
|
|
299
|
-
self.polarity = polarity
|
|
300
|
-
self.resistanceType = resistanceType
|
|
301
343
|
if not __TS__InstanceOf(ability, Ability) then
|
|
302
344
|
parameters = ability
|
|
303
345
|
ability = nil
|
|
@@ -324,14 +366,21 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
324
366
|
learnLevelMinimum = learnLevelMinimum or ability:getField(ABILITY_IF_REQUIRED_LEVEL)
|
|
325
367
|
duration = duration or getAbilityDuration(ability, _unit)
|
|
326
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
|
|
327
376
|
local buffByTypeId = buffByTypeIdByUnit[_unit]
|
|
328
377
|
if buffByTypeId == nil then
|
|
329
378
|
buffByTypeId = {}
|
|
330
379
|
buffByTypeIdByUnit[_unit] = buffByTypeId
|
|
331
380
|
end
|
|
332
|
-
local
|
|
333
|
-
if
|
|
334
|
-
|
|
381
|
+
local ____opt_15 = buffByTypeId[typeId]
|
|
382
|
+
if ____opt_15 ~= nil then
|
|
383
|
+
____opt_15:destroy()
|
|
335
384
|
end
|
|
336
385
|
local uniqueGroup = parameters and parameters.uniqueGroup or defaultParameters and defaultParameters.uniqueGroup
|
|
337
386
|
if uniqueGroup ~= nil then
|
|
@@ -340,18 +389,21 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
340
389
|
if not internalApplyBuff(
|
|
341
390
|
_unit,
|
|
342
391
|
typeId,
|
|
343
|
-
polarity,
|
|
344
|
-
resistanceType,
|
|
392
|
+
self.polarity,
|
|
393
|
+
self.resistanceType,
|
|
345
394
|
level,
|
|
346
395
|
duration,
|
|
347
396
|
spellStealPriority,
|
|
348
|
-
learnLevelMinimum
|
|
397
|
+
learnLevelMinimum,
|
|
398
|
+
missProbability
|
|
349
399
|
) then
|
|
400
|
+
self[100] = 1
|
|
350
401
|
UnitBehavior.prototype.destroy(self)
|
|
351
402
|
error(unsuccessfulApplicationMarker, 0)
|
|
352
403
|
end
|
|
353
404
|
local handle = BlzGetUnitAbility(_unit.handle, typeId)
|
|
354
405
|
if handle == nil then
|
|
406
|
+
self[100] = 1
|
|
355
407
|
UnitBehavior.prototype.destroy(self)
|
|
356
408
|
error(unsuccessfulApplicationMarker, 0)
|
|
357
409
|
end
|
|
@@ -360,20 +412,20 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
360
412
|
self._level = level
|
|
361
413
|
self._spellStealPriority = spellStealPriority
|
|
362
414
|
self._learnLevelMinimum = learnLevelMinimum
|
|
363
|
-
self[
|
|
364
|
-
self[
|
|
365
|
-
self[
|
|
366
|
-
self[
|
|
367
|
-
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)
|
|
368
420
|
if parameters ~= nil or (next(defaultParameters)) ~= nil then
|
|
369
421
|
for ____, buffBooleanParameter in ipairs(buffBooleanParameters) do
|
|
370
|
-
local
|
|
371
|
-
local
|
|
372
|
-
local
|
|
373
|
-
if
|
|
374
|
-
|
|
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]
|
|
375
427
|
end
|
|
376
|
-
if resolveBooleanValue(
|
|
428
|
+
if resolveBooleanValue(____ability_24, ____level_25, ____temp_23) then
|
|
377
429
|
self[buffBooleanParameter] = true
|
|
378
430
|
end
|
|
379
431
|
end
|
|
@@ -389,11 +441,11 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
389
441
|
end
|
|
390
442
|
local maximumDuration = parameters and parameters.maximumDuration or defaultParameters.maximumDuration
|
|
391
443
|
if maximumDuration ~= nil then
|
|
392
|
-
self[
|
|
444
|
+
self[108] = resolveNumberValue(ability, level, maximumDuration)
|
|
393
445
|
end
|
|
394
446
|
local maximumRemainingDuration = parameters and parameters.maximumRemainingDuration or defaultParameters.maximumRemainingDuration
|
|
395
447
|
if maximumRemainingDuration ~= nil then
|
|
396
|
-
self[
|
|
448
|
+
self[109] = resolveNumberValue(ability, level, maximumRemainingDuration)
|
|
397
449
|
end
|
|
398
450
|
local parametersAbilityTypeIds = parameters and parameters.abilityTypeIds or defaultParameters.abilityTypeIds
|
|
399
451
|
if parametersAbilityTypeIds ~= nil then
|
|
@@ -450,10 +502,12 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
450
502
|
timer:start(duration, false, expireBuff, self)
|
|
451
503
|
self._timer = timer
|
|
452
504
|
end
|
|
505
|
+
self:onCreate()
|
|
506
|
+
self[100] = 1
|
|
453
507
|
end
|
|
454
508
|
function Buff.prototype.getUnitBonus(self, bonusType)
|
|
455
|
-
local
|
|
456
|
-
local bonusId =
|
|
509
|
+
local ____opt_38 = self._bonusIdByBonusType
|
|
510
|
+
local bonusId = ____opt_38 and ____opt_38[bonusType]
|
|
457
511
|
return bonusId == nil and 0 or getUnitBonus(self._unit, bonusType, bonusId)
|
|
458
512
|
end
|
|
459
513
|
function Buff.prototype.addOrUpdateOrRemoveUnitBonus(self, bonusType, value)
|
|
@@ -464,63 +518,71 @@ function Buff.prototype.addOrUpdateOrRemoveUnitBonus(self, bonusType, value)
|
|
|
464
518
|
end
|
|
465
519
|
bonusIdByBonusType[bonusType] = addOrUpdateOrRemoveUnitBonus(self._unit, bonusType, bonusIdByBonusType[bonusType], value)
|
|
466
520
|
end
|
|
467
|
-
function Buff.prototype.flashEffect(self,
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
local ____Effect_flash_41 = Effect.flash
|
|
471
|
-
local ____array_39 = __TS__SparseArrayNew(
|
|
472
|
-
self[104],
|
|
473
|
-
isWidgetProvided and widgetOrDuration or self._unit,
|
|
474
|
-
stringValueByBuffTypeIdByFieldId[fourCC("feft")][self.typeId] or "origin"
|
|
475
|
-
)
|
|
476
|
-
local ____isWidgetProvided_38
|
|
477
|
-
if isWidgetProvided then
|
|
478
|
-
____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)
|
|
479
524
|
else
|
|
480
|
-
|
|
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
|
+
)
|
|
481
544
|
end
|
|
482
|
-
__TS__SparseArrayPush(____array_39, ____isWidgetProvided_38)
|
|
483
|
-
____Effect_flash_41(
|
|
484
|
-
____Effect_40,
|
|
485
|
-
__TS__SparseArraySpread(____array_39)
|
|
486
|
-
)
|
|
487
545
|
end
|
|
488
546
|
function Buff.prototype.flashSpecialEffect(self, widgetOrDuration, duration)
|
|
489
547
|
local isWidgetProvided = type(widgetOrDuration) == "table"
|
|
490
|
-
local
|
|
491
|
-
local
|
|
492
|
-
local
|
|
493
|
-
self[
|
|
548
|
+
local ____Effect_46 = Effect
|
|
549
|
+
local ____Effect_flash_47 = Effect.flash
|
|
550
|
+
local ____array_45 = __TS__SparseArrayNew(
|
|
551
|
+
self[106],
|
|
494
552
|
isWidgetProvided and widgetOrDuration or self._unit,
|
|
495
553
|
stringValueByBuffTypeIdByFieldId[fourCC("fspt")][self.typeId] or "origin"
|
|
496
554
|
)
|
|
497
|
-
local
|
|
555
|
+
local ____isWidgetProvided_44
|
|
498
556
|
if isWidgetProvided then
|
|
499
|
-
|
|
557
|
+
____isWidgetProvided_44 = duration
|
|
500
558
|
else
|
|
501
|
-
|
|
559
|
+
____isWidgetProvided_44 = widgetOrDuration
|
|
502
560
|
end
|
|
503
|
-
__TS__SparseArrayPush(
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
__TS__SparseArraySpread(
|
|
561
|
+
__TS__SparseArrayPush(____array_45, ____isWidgetProvided_44)
|
|
562
|
+
____Effect_flash_47(
|
|
563
|
+
____Effect_46,
|
|
564
|
+
__TS__SparseArraySpread(____array_45)
|
|
507
565
|
)
|
|
508
566
|
end
|
|
567
|
+
function Buff.prototype.onCreate(self)
|
|
568
|
+
end
|
|
509
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
|
|
510
572
|
local unit = self._unit
|
|
511
573
|
if getUnitAbility(unit.handle, self.typeId) == self.handle then
|
|
512
574
|
removeBuff(unit.handle, self.typeId)
|
|
513
575
|
end
|
|
514
576
|
buffByTypeIdByUnit[unit][self.typeId] = nil
|
|
515
|
-
local healingIntervalTimer = self[
|
|
577
|
+
local healingIntervalTimer = self[119]
|
|
516
578
|
if healingIntervalTimer ~= nil then
|
|
517
579
|
healingIntervalTimer:destroy()
|
|
518
|
-
self[
|
|
580
|
+
self[119] = nil
|
|
519
581
|
end
|
|
520
|
-
local damageIntervalTimer = self[
|
|
582
|
+
local damageIntervalTimer = self[114]
|
|
521
583
|
if damageIntervalTimer ~= nil then
|
|
522
584
|
damageIntervalTimer:destroy()
|
|
523
|
-
self[
|
|
585
|
+
self[114] = nil
|
|
524
586
|
end
|
|
525
587
|
if self._timer ~= nil then
|
|
526
588
|
self._timer:destroy()
|
|
@@ -530,11 +592,11 @@ function Buff.prototype.onDestroy(self)
|
|
|
530
592
|
behavior:destroy()
|
|
531
593
|
end
|
|
532
594
|
end
|
|
533
|
-
if self[
|
|
595
|
+
if self[137] then
|
|
534
596
|
unit:decrementDisableAutoAttackCounter()
|
|
535
597
|
end
|
|
536
|
-
if self[
|
|
537
|
-
if self[
|
|
598
|
+
if self[135] then
|
|
599
|
+
if self[136] then
|
|
538
600
|
unit:decrementStunCounter()
|
|
539
601
|
end
|
|
540
602
|
unit:decrementStunCounter()
|
|
@@ -549,6 +611,8 @@ function Buff.prototype.onDestroy(self)
|
|
|
549
611
|
removeUnitBonus(unit, bonusType, bonusId)
|
|
550
612
|
end
|
|
551
613
|
end
|
|
614
|
+
Event.invoke(buffDestroyEvent, self)
|
|
615
|
+
self[100] = 3
|
|
552
616
|
return UnitBehavior.prototype.onDestroy(self)
|
|
553
617
|
end
|
|
554
618
|
function Buff.apply(self, ...)
|
|
@@ -576,51 +640,81 @@ function Buff.apply(self, ...)
|
|
|
576
640
|
end
|
|
577
641
|
end
|
|
578
642
|
function Buff.getByTypeId(self, unit, typeId)
|
|
579
|
-
local
|
|
580
|
-
local buff =
|
|
643
|
+
local ____opt_48 = buffByTypeIdByUnit[unit]
|
|
644
|
+
local buff = ____opt_48 and ____opt_48[typeId]
|
|
581
645
|
if __TS__InstanceOf(buff, self) then
|
|
582
646
|
return buff
|
|
583
647
|
end
|
|
584
648
|
return nil
|
|
585
649
|
end
|
|
650
|
+
function Buff.prototype.onExpiration(self)
|
|
651
|
+
local unit = self.unit
|
|
652
|
+
if self[120] ~= nil then
|
|
653
|
+
(self[102] or unit):damageTarget(unit, self[120] or 0)
|
|
654
|
+
end
|
|
655
|
+
if self[121] ~= nil then
|
|
656
|
+
(self[102] or unit):healTarget(unit, self[120] or 0)
|
|
657
|
+
end
|
|
658
|
+
if self[140] then
|
|
659
|
+
unit:explode()
|
|
660
|
+
elseif self[139] then
|
|
661
|
+
unit:kill()
|
|
662
|
+
end
|
|
663
|
+
end
|
|
586
664
|
function Buff.prototype.onDeath(self, source)
|
|
587
665
|
local unit = self.unit
|
|
588
|
-
if self[
|
|
666
|
+
if self[122] ~= nil then
|
|
589
667
|
damageArea(
|
|
590
|
-
self[
|
|
591
|
-
self[
|
|
668
|
+
self[102] or unit,
|
|
669
|
+
self[122],
|
|
592
670
|
unit.x,
|
|
593
671
|
unit.y,
|
|
594
|
-
self[
|
|
595
|
-
self[120] or 0,
|
|
672
|
+
self[124] or 0,
|
|
596
673
|
self[123] or 0,
|
|
597
|
-
self[
|
|
674
|
+
self[126] or 0,
|
|
598
675
|
self[125] or 0,
|
|
599
|
-
self[
|
|
676
|
+
self[128] or 0,
|
|
677
|
+
self[127] or 0
|
|
600
678
|
)
|
|
601
679
|
end
|
|
602
680
|
end
|
|
603
681
|
function Buff.prototype.onDamageDealt(self, target, event)
|
|
604
682
|
if event.isAttack then
|
|
605
|
-
if self[
|
|
606
|
-
local durationIncrease = self[
|
|
607
|
-
local maximumDuration = self[
|
|
683
|
+
if self[107] ~= nil then
|
|
684
|
+
local durationIncrease = self[107]
|
|
685
|
+
local maximumDuration = self[108] or 0
|
|
608
686
|
if maximumDuration > 0 then
|
|
609
687
|
durationIncrease = min(
|
|
610
688
|
durationIncrease,
|
|
611
|
-
max(0, maximumDuration - self[
|
|
689
|
+
max(0, maximumDuration - self[103])
|
|
612
690
|
)
|
|
613
691
|
end
|
|
614
692
|
local remainingDuration = self.remainingDuration + durationIncrease
|
|
615
|
-
local maximumRemainingDuration = self[
|
|
693
|
+
local maximumRemainingDuration = self[109] or 0
|
|
616
694
|
if maximumRemainingDuration > 0 then
|
|
617
695
|
remainingDuration = min(remainingDuration, maximumRemainingDuration)
|
|
618
696
|
end
|
|
619
697
|
self.remainingDuration = remainingDuration
|
|
620
698
|
end
|
|
621
|
-
local autoAttackCount = (self[
|
|
622
|
-
self[
|
|
623
|
-
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
|
|
624
718
|
self:destroy()
|
|
625
719
|
end
|
|
626
720
|
end
|
|
@@ -630,7 +724,7 @@ __TS__SetDescriptor(
|
|
|
630
724
|
Buff.prototype,
|
|
631
725
|
"source",
|
|
632
726
|
{get = function(self)
|
|
633
|
-
return self[
|
|
727
|
+
return self[102] or self._unit
|
|
634
728
|
end},
|
|
635
729
|
true
|
|
636
730
|
)
|
|
@@ -647,13 +741,13 @@ __TS__SetDescriptor(
|
|
|
647
741
|
"remainingDamageOverDuration",
|
|
648
742
|
{
|
|
649
743
|
get = function(self)
|
|
650
|
-
return self[
|
|
744
|
+
return self[113] or 0
|
|
651
745
|
end,
|
|
652
746
|
set = function(self, remainingDamageOverDuration)
|
|
653
|
-
local remainingDamageOverDurationDelta = remainingDamageOverDuration - (self[
|
|
654
|
-
self[
|
|
655
|
-
local damageOverDuration = (self[
|
|
656
|
-
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
|
|
657
751
|
end
|
|
658
752
|
},
|
|
659
753
|
true
|
|
@@ -663,13 +757,13 @@ __TS__SetDescriptor(
|
|
|
663
757
|
"damageOverDuration",
|
|
664
758
|
{
|
|
665
759
|
get = function(self)
|
|
666
|
-
return self[
|
|
760
|
+
return self[110] or 0
|
|
667
761
|
end,
|
|
668
762
|
set = function(self, damageOverDuration)
|
|
669
|
-
local damageOverDurationDelta = damageOverDuration - (self[
|
|
670
|
-
self[
|
|
671
|
-
local remainingDamageOverDuration = (self[
|
|
672
|
-
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
|
|
673
767
|
end
|
|
674
768
|
},
|
|
675
769
|
true
|
|
@@ -679,10 +773,10 @@ __TS__SetDescriptor(
|
|
|
679
773
|
"damagePerInterval",
|
|
680
774
|
{
|
|
681
775
|
get = function(self)
|
|
682
|
-
return self[
|
|
776
|
+
return self[111] or 0
|
|
683
777
|
end,
|
|
684
778
|
set = function(self, damagePerInterval)
|
|
685
|
-
self[
|
|
779
|
+
self[111] = damagePerInterval ~= 0 and damagePerInterval or nil
|
|
686
780
|
end
|
|
687
781
|
},
|
|
688
782
|
true
|
|
@@ -692,25 +786,25 @@ __TS__SetDescriptor(
|
|
|
692
786
|
"damageInterval",
|
|
693
787
|
{
|
|
694
788
|
get = function(self)
|
|
695
|
-
return self[
|
|
789
|
+
return self[112] or 0
|
|
696
790
|
end,
|
|
697
791
|
set = function(self, damageInterval)
|
|
698
792
|
if damageInterval <= 0 then
|
|
699
|
-
self[
|
|
700
|
-
local timer = self[
|
|
793
|
+
self[112] = damageInterval ~= 0 and damageInterval or nil
|
|
794
|
+
local timer = self[114]
|
|
701
795
|
if timer ~= nil then
|
|
702
796
|
timer:destroy()
|
|
703
|
-
self[
|
|
797
|
+
self[114] = nil
|
|
704
798
|
end
|
|
705
799
|
return
|
|
706
800
|
end
|
|
707
|
-
self[
|
|
708
|
-
local
|
|
709
|
-
local elapsed =
|
|
710
|
-
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]
|
|
711
805
|
if timer == nil then
|
|
712
806
|
timer = Timer:create()
|
|
713
|
-
self[
|
|
807
|
+
self[114] = timer
|
|
714
808
|
end
|
|
715
809
|
local initialDelay = damageInterval - (elapsed >= damageInterval and math.fmod(elapsed, damageInterval) or elapsed)
|
|
716
810
|
if initialDelay == damageInterval then
|
|
@@ -727,13 +821,13 @@ __TS__SetDescriptor(
|
|
|
727
821
|
"remainingHealingOverDuration",
|
|
728
822
|
{
|
|
729
823
|
get = function(self)
|
|
730
|
-
return self[
|
|
824
|
+
return self[118] or 0
|
|
731
825
|
end,
|
|
732
826
|
set = function(self, remainingHealingOverDuration)
|
|
733
|
-
local remainingHealingOverDurationDelta = remainingHealingOverDuration - (self[
|
|
734
|
-
self[
|
|
735
|
-
local healingOverDuration = (self[
|
|
736
|
-
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
|
|
737
831
|
end
|
|
738
832
|
},
|
|
739
833
|
true
|
|
@@ -743,13 +837,13 @@ __TS__SetDescriptor(
|
|
|
743
837
|
"healingOverDuration",
|
|
744
838
|
{
|
|
745
839
|
get = function(self)
|
|
746
|
-
return self[
|
|
840
|
+
return self[115] or 0
|
|
747
841
|
end,
|
|
748
842
|
set = function(self, healingOverDuration)
|
|
749
|
-
local healingOverDurationDelta = healingOverDuration - (self[
|
|
750
|
-
self[
|
|
751
|
-
local remainingHealingOverDuration = (self[
|
|
752
|
-
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
|
|
753
847
|
end
|
|
754
848
|
},
|
|
755
849
|
true
|
|
@@ -759,10 +853,10 @@ __TS__SetDescriptor(
|
|
|
759
853
|
"healingPerInterval",
|
|
760
854
|
{
|
|
761
855
|
get = function(self)
|
|
762
|
-
return self[
|
|
856
|
+
return self[116] or 0
|
|
763
857
|
end,
|
|
764
858
|
set = function(self, healingPerInterval)
|
|
765
|
-
self[
|
|
859
|
+
self[116] = healingPerInterval ~= 0 and healingPerInterval or nil
|
|
766
860
|
end
|
|
767
861
|
},
|
|
768
862
|
true
|
|
@@ -772,25 +866,25 @@ __TS__SetDescriptor(
|
|
|
772
866
|
"healingInterval",
|
|
773
867
|
{
|
|
774
868
|
get = function(self)
|
|
775
|
-
return self[
|
|
869
|
+
return self[117] or 0
|
|
776
870
|
end,
|
|
777
871
|
set = function(self, healingInterval)
|
|
778
872
|
if healingInterval <= 0 then
|
|
779
|
-
self[
|
|
780
|
-
local timer = self[
|
|
873
|
+
self[117] = healingInterval ~= 0 and healingInterval or nil
|
|
874
|
+
local timer = self[119]
|
|
781
875
|
if timer ~= nil then
|
|
782
876
|
timer:destroy()
|
|
783
|
-
self[
|
|
877
|
+
self[119] = nil
|
|
784
878
|
end
|
|
785
879
|
return
|
|
786
880
|
end
|
|
787
|
-
self[
|
|
788
|
-
local
|
|
789
|
-
local elapsed =
|
|
790
|
-
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]
|
|
791
885
|
if timer == nil then
|
|
792
886
|
timer = Timer:create()
|
|
793
|
-
self[
|
|
887
|
+
self[119] = timer
|
|
794
888
|
end
|
|
795
889
|
local initialDelay = healingInterval - (elapsed >= healingInterval and math.fmod(elapsed, healingInterval) or elapsed)
|
|
796
890
|
if initialDelay == healingInterval then
|
|
@@ -802,6 +896,45 @@ __TS__SetDescriptor(
|
|
|
802
896
|
},
|
|
803
897
|
true
|
|
804
898
|
)
|
|
899
|
+
__TS__SetDescriptor(
|
|
900
|
+
Buff.prototype,
|
|
901
|
+
"damageOnExpiration",
|
|
902
|
+
{
|
|
903
|
+
get = function(self)
|
|
904
|
+
return self[120] or 0
|
|
905
|
+
end,
|
|
906
|
+
set = function(self, damageOnExpiration)
|
|
907
|
+
self[120] = damageOnExpiration ~= 0 and damageOnExpiration or nil
|
|
908
|
+
end
|
|
909
|
+
},
|
|
910
|
+
true
|
|
911
|
+
)
|
|
912
|
+
__TS__SetDescriptor(
|
|
913
|
+
Buff.prototype,
|
|
914
|
+
"healingOnExpiration",
|
|
915
|
+
{
|
|
916
|
+
get = function(self)
|
|
917
|
+
return self[121] or 0
|
|
918
|
+
end,
|
|
919
|
+
set = function(self, healingOnExpiration)
|
|
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)
|
|
934
|
+
end
|
|
935
|
+
},
|
|
936
|
+
true
|
|
937
|
+
)
|
|
805
938
|
__TS__SetDescriptor(
|
|
806
939
|
Buff.prototype,
|
|
807
940
|
"receivedDamageFactor",
|
|
@@ -833,25 +966,25 @@ __TS__SetDescriptor(
|
|
|
833
966
|
"stuns",
|
|
834
967
|
{
|
|
835
968
|
get = function(self)
|
|
836
|
-
local
|
|
837
|
-
if
|
|
838
|
-
|
|
969
|
+
local ____self__135_54 = self[135]
|
|
970
|
+
if ____self__135_54 == nil then
|
|
971
|
+
____self__135_54 = false
|
|
839
972
|
end
|
|
840
|
-
return
|
|
973
|
+
return ____self__135_54
|
|
841
974
|
end,
|
|
842
975
|
set = function(self, stuns)
|
|
843
|
-
if not stuns and self[
|
|
844
|
-
if self[
|
|
976
|
+
if not stuns and self[135] then
|
|
977
|
+
if self[136] then
|
|
845
978
|
self.object:decrementStunCounter()
|
|
846
979
|
end
|
|
847
980
|
self.object:decrementStunCounter()
|
|
848
|
-
self[
|
|
849
|
-
elseif stuns and not self[
|
|
850
|
-
if self[
|
|
981
|
+
self[135] = nil
|
|
982
|
+
elseif stuns and not self[135] then
|
|
983
|
+
if self[136] then
|
|
851
984
|
self.object:incrementStunCounter()
|
|
852
985
|
end
|
|
853
986
|
self.object:incrementStunCounter()
|
|
854
|
-
self[
|
|
987
|
+
self[135] = true
|
|
855
988
|
end
|
|
856
989
|
end
|
|
857
990
|
},
|
|
@@ -862,23 +995,23 @@ __TS__SetDescriptor(
|
|
|
862
995
|
"ignoresStunImmunity",
|
|
863
996
|
{
|
|
864
997
|
get = function(self)
|
|
865
|
-
local
|
|
866
|
-
if
|
|
867
|
-
|
|
998
|
+
local ____self__136_55 = self[136]
|
|
999
|
+
if ____self__136_55 == nil then
|
|
1000
|
+
____self__136_55 = false
|
|
868
1001
|
end
|
|
869
|
-
return
|
|
1002
|
+
return ____self__136_55
|
|
870
1003
|
end,
|
|
871
1004
|
set = function(self, ignoresStunImmunity)
|
|
872
|
-
if not ignoresStunImmunity and self[
|
|
873
|
-
if self[
|
|
1005
|
+
if not ignoresStunImmunity and self[136] then
|
|
1006
|
+
if self[135] then
|
|
874
1007
|
self.object:decrementStunCounter()
|
|
875
1008
|
end
|
|
876
|
-
self[
|
|
877
|
-
elseif ignoresStunImmunity and not self[
|
|
878
|
-
if self[
|
|
1009
|
+
self[136] = nil
|
|
1010
|
+
elseif ignoresStunImmunity and not self[136] then
|
|
1011
|
+
if self[135] then
|
|
879
1012
|
self.object:incrementStunCounter()
|
|
880
1013
|
end
|
|
881
|
-
self[
|
|
1014
|
+
self[136] = true
|
|
882
1015
|
end
|
|
883
1016
|
end
|
|
884
1017
|
},
|
|
@@ -889,19 +1022,19 @@ __TS__SetDescriptor(
|
|
|
889
1022
|
"disablesAutoAttack",
|
|
890
1023
|
{
|
|
891
1024
|
get = function(self)
|
|
892
|
-
local
|
|
893
|
-
if
|
|
894
|
-
|
|
1025
|
+
local ____self__137_56 = self[137]
|
|
1026
|
+
if ____self__137_56 == nil then
|
|
1027
|
+
____self__137_56 = false
|
|
895
1028
|
end
|
|
896
|
-
return
|
|
1029
|
+
return ____self__137_56
|
|
897
1030
|
end,
|
|
898
1031
|
set = function(self, disablesAutoAttack)
|
|
899
|
-
if not disablesAutoAttack and self[
|
|
1032
|
+
if not disablesAutoAttack and self[137] then
|
|
900
1033
|
self.object:decrementDisableAutoAttackCounter()
|
|
901
|
-
self[
|
|
902
|
-
elseif disablesAutoAttack and not self[
|
|
1034
|
+
self[137] = nil
|
|
1035
|
+
elseif disablesAutoAttack and not self[137] then
|
|
903
1036
|
self.object:incrementDisableAutoAttackCounter()
|
|
904
|
-
self[
|
|
1037
|
+
self[137] = true
|
|
905
1038
|
end
|
|
906
1039
|
end
|
|
907
1040
|
},
|
|
@@ -912,19 +1045,95 @@ __TS__SetDescriptor(
|
|
|
912
1045
|
"providesInvulnerability",
|
|
913
1046
|
{
|
|
914
1047
|
get = function(self)
|
|
915
|
-
local
|
|
916
|
-
if
|
|
917
|
-
|
|
1048
|
+
local ____self__138_57 = self[138]
|
|
1049
|
+
if ____self__138_57 == nil then
|
|
1050
|
+
____self__138_57 = false
|
|
918
1051
|
end
|
|
919
|
-
return
|
|
1052
|
+
return ____self__138_57
|
|
920
1053
|
end,
|
|
921
1054
|
set = function(self, providesInvulnerability)
|
|
922
|
-
if not providesInvulnerability and self[
|
|
1055
|
+
if not providesInvulnerability and self[138] then
|
|
923
1056
|
self.object:decrementInvulnerabilityCounter()
|
|
924
|
-
self[
|
|
925
|
-
elseif providesInvulnerability and not self[
|
|
1057
|
+
self[138] = nil
|
|
1058
|
+
elseif providesInvulnerability and not self[138] then
|
|
926
1059
|
self.object:incrementInvulnerabilityCounter()
|
|
927
|
-
self[
|
|
1060
|
+
self[138] = true
|
|
1061
|
+
end
|
|
1062
|
+
end
|
|
1063
|
+
},
|
|
1064
|
+
true
|
|
1065
|
+
)
|
|
1066
|
+
__TS__SetDescriptor(
|
|
1067
|
+
Buff.prototype,
|
|
1068
|
+
"killsOnExpiration",
|
|
1069
|
+
{
|
|
1070
|
+
get = function(self)
|
|
1071
|
+
local ____self__139_58 = self[139]
|
|
1072
|
+
if ____self__139_58 == nil then
|
|
1073
|
+
____self__139_58 = false
|
|
1074
|
+
end
|
|
1075
|
+
return ____self__139_58
|
|
1076
|
+
end,
|
|
1077
|
+
set = function(self, killsOnExpiration)
|
|
1078
|
+
if not killsOnExpiration and self[139] then
|
|
1079
|
+
self[139] = nil
|
|
1080
|
+
elseif killsOnExpiration and not self[139] then
|
|
1081
|
+
self[139] = true
|
|
1082
|
+
end
|
|
1083
|
+
end
|
|
1084
|
+
},
|
|
1085
|
+
true
|
|
1086
|
+
)
|
|
1087
|
+
__TS__SetDescriptor(
|
|
1088
|
+
Buff.prototype,
|
|
1089
|
+
"explodesOnExpiration",
|
|
1090
|
+
{
|
|
1091
|
+
get = function(self)
|
|
1092
|
+
local ____self__140_59 = self[140]
|
|
1093
|
+
if ____self__140_59 == nil then
|
|
1094
|
+
____self__140_59 = false
|
|
1095
|
+
end
|
|
1096
|
+
return ____self__140_59
|
|
1097
|
+
end,
|
|
1098
|
+
set = function(self, killsOnExpiration)
|
|
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
|
|
928
1137
|
end
|
|
929
1138
|
end
|
|
930
1139
|
},
|
|
@@ -935,13 +1144,13 @@ __TS__SetDescriptor(
|
|
|
935
1144
|
"maximumAutoAttackCount",
|
|
936
1145
|
{
|
|
937
1146
|
get = function(self)
|
|
938
|
-
return self[
|
|
1147
|
+
return self[130] or 0
|
|
939
1148
|
end,
|
|
940
1149
|
set = function(self, maximumAutoAttackCount)
|
|
941
1150
|
if maximumAutoAttackCount == 0 then
|
|
942
|
-
self[
|
|
1151
|
+
self[130] = nil
|
|
943
1152
|
else
|
|
944
|
-
self[
|
|
1153
|
+
self[130] = maximumAutoAttackCount
|
|
945
1154
|
end
|
|
946
1155
|
end
|
|
947
1156
|
},
|
|
@@ -952,10 +1161,10 @@ __TS__SetDescriptor(
|
|
|
952
1161
|
"durationIncreaseOnAutoAttack",
|
|
953
1162
|
{
|
|
954
1163
|
get = function(self)
|
|
955
|
-
return self[
|
|
1164
|
+
return self[107] or 0
|
|
956
1165
|
end,
|
|
957
1166
|
set = function(self, durationIncreaseOnAutoAttack)
|
|
958
|
-
self[
|
|
1167
|
+
self[107] = durationIncreaseOnAutoAttack
|
|
959
1168
|
end
|
|
960
1169
|
},
|
|
961
1170
|
true
|
|
@@ -986,11 +1195,24 @@ __TS__SetDescriptor(
|
|
|
986
1195
|
},
|
|
987
1196
|
true
|
|
988
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
|
+
)
|
|
989
1211
|
__TS__SetDescriptor(
|
|
990
1212
|
Buff.prototype,
|
|
991
1213
|
"duration",
|
|
992
1214
|
{get = function(self)
|
|
993
|
-
return self[
|
|
1215
|
+
return self[103]
|
|
994
1216
|
end},
|
|
995
1217
|
true
|
|
996
1218
|
)
|
|
@@ -999,15 +1221,15 @@ __TS__SetDescriptor(
|
|
|
999
1221
|
"remainingDuration",
|
|
1000
1222
|
{
|
|
1001
1223
|
get = function(self)
|
|
1002
|
-
local
|
|
1003
|
-
return
|
|
1224
|
+
local ____opt_60 = self._timer
|
|
1225
|
+
return ____opt_60 and ____opt_60.remaining or 0
|
|
1004
1226
|
end,
|
|
1005
1227
|
set = function(self, remainingDuration)
|
|
1006
|
-
local
|
|
1007
|
-
local
|
|
1008
|
-
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)
|
|
1009
1231
|
if remainingDurationDelta ~= 0 then
|
|
1010
|
-
self[
|
|
1232
|
+
self[103] = self[103] + remainingDurationDelta
|
|
1011
1233
|
if remainingDuration <= 0 then
|
|
1012
1234
|
Timer:run(destroyBuff, self)
|
|
1013
1235
|
else
|
|
@@ -1019,7 +1241,8 @@ __TS__SetDescriptor(
|
|
|
1019
1241
|
self._level,
|
|
1020
1242
|
remainingDuration,
|
|
1021
1243
|
self._spellStealPriority,
|
|
1022
|
-
self._learnLevelMinimum
|
|
1244
|
+
self._learnLevelMinimum,
|
|
1245
|
+
self[141]
|
|
1023
1246
|
) then
|
|
1024
1247
|
local timer = self._timer
|
|
1025
1248
|
if timer == nil then
|
|
@@ -1033,10 +1256,11 @@ __TS__SetDescriptor(
|
|
|
1033
1256
|
end
|
|
1034
1257
|
},
|
|
1035
1258
|
true
|
|
1036
|
-
)
|
|
1259
|
+
)
|
|
1260
|
+
Buff.destroyEvent = buffDestroyEvent;
|
|
1037
1261
|
(function(self)
|
|
1038
1262
|
local function destroyBuffIfNeeded(buff)
|
|
1039
|
-
if getUnitAbility(buff[
|
|
1263
|
+
if getUnitAbility(buff[101].handle, buff.typeId) ~= buff.handle and buff[100] == 1 then
|
|
1040
1264
|
buff:destroy()
|
|
1041
1265
|
end
|
|
1042
1266
|
end
|