warscript 0.0.1-dev.c37d12c → 0.0.1-dev.c47d565
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.d.ts +18 -0
- package/attributes.lua +32 -0
- package/binaryreader.d.ts +1 -0
- package/binaryreader.lua +3 -0
- package/config.d.ts +5 -0
- package/config.lua +10 -0
- package/core/dummy.lua +4 -2
- package/core/types/effect.d.ts +24 -6
- package/core/types/effect.lua +169 -107
- package/core/types/frame.d.ts +24 -3
- package/core/types/frame.lua +198 -42
- package/core/types/group.d.ts +0 -1
- package/core/types/handle.d.ts +2 -1
- package/core/types/handle.lua +14 -9
- package/core/types/image.d.ts +0 -1
- package/core/types/item.d.ts +1 -0
- package/core/types/item.lua +1 -0
- package/core/types/missile.d.ts +2 -2
- package/core/types/missile.lua +8 -2
- package/core/types/player.d.ts +18 -1
- package/core/types/player.lua +76 -26
- package/core/types/playerCamera.d.ts +2 -0
- package/core/types/playerCamera.lua +123 -5
- package/core/types/playerColor.lua +4 -3
- package/core/types/sound.d.ts +18 -25
- package/core/types/sound.lua +113 -33
- package/core/types/tileCell.d.ts +18 -3
- package/core/types/tileCell.lua +108 -0
- package/core/types/timer.d.ts +9 -8
- package/core/types/timer.lua +45 -23
- package/core/types/unit.d.ts +5 -0
- package/core/types/unit.lua +13 -0
- package/core/util.d.ts +3 -1
- package/core/util.lua +127 -4
- package/decl/index.d.ts +1 -0
- package/decl/native.d.ts +1718 -964
- package/destroyable.d.ts +1 -0
- package/destroyable.lua +9 -0
- package/engine/ability-type-extended-tooltip.d.ts +8 -0
- package/engine/ability-type-extended-tooltip.lua +44 -0
- package/engine/ability.d.ts +1 -1
- package/engine/behavior.d.ts +24 -11
- package/engine/behavior.lua +233 -73
- 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 +36 -4
- package/engine/behaviour/ability/apply-unit-behavior.d.ts +13 -4
- package/engine/behaviour/ability/apply-unit-behavior.lua +37 -9
- package/engine/behaviour/ability/damage.d.ts +43 -11
- package/engine/behaviour/ability/damage.lua +89 -39
- package/engine/behaviour/ability/emulate-impact.d.ts +6 -0
- package/engine/behaviour/ability/emulate-impact.lua +44 -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 -15
- package/engine/behaviour/ability/on-command-impact.d.ts +9 -0
- package/engine/behaviour/ability/on-command-impact.lua +26 -0
- package/engine/behaviour/ability/remove-buffs.d.ts +25 -0
- package/engine/behaviour/ability/remove-buffs.lua +49 -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 +37 -7
- package/engine/behaviour/ability.lua +208 -27
- package/engine/behaviour/unit/stun-immunity.d.ts +12 -7
- package/engine/behaviour/unit/stun-immunity.lua +57 -31
- package/engine/behaviour/unit.d.ts +49 -4
- package/engine/behaviour/unit.lua +293 -2
- package/engine/buff.d.ts +177 -59
- package/engine/buff.lua +795 -281
- package/engine/game-map.d.ts +7 -0
- package/engine/game-map.lua +32 -0
- package/engine/index.d.ts +2 -1
- package/engine/internal/ability.d.ts +31 -15
- package/engine/internal/ability.lua +177 -104
- package/engine/internal/item/ability.lua +162 -4
- package/engine/internal/item/fields.d.ts +12 -0
- package/engine/internal/item/fields.lua +33 -0
- package/engine/internal/item/owner-cache.d.ts +5 -0
- package/engine/internal/item/owner-cache.lua +4 -0
- package/engine/internal/item+owner.d.ts +2 -0
- package/engine/internal/item+owner.lua +37 -8
- package/engine/internal/item.d.ts +34 -18
- package/engine/internal/item.lua +308 -102
- package/engine/internal/mechanics/ability-duration.d.ts +1 -3
- package/engine/internal/mechanics/ability-duration.lua +3 -1
- package/engine/internal/mechanics/cast-ability.lua +89 -0
- package/engine/internal/misc/ability-disable-counter.d.ts +2 -0
- package/engine/internal/misc/ability-disable-counter.lua +13 -0
- package/engine/internal/misc/damage-metadata-by-target.d.ts +2 -0
- package/engine/internal/misc/damage-metadata-by-target.lua +5 -0
- package/engine/internal/misc/frame-coordinates.d.ts +2 -0
- package/engine/internal/misc/frame-coordinates.lua +21 -0
- package/engine/internal/misc/get-terrain-z.d.ts +2 -0
- package/engine/internal/misc/get-terrain-z.lua +11 -0
- package/engine/internal/misc/player-local-handle.d.ts +2 -0
- package/engine/internal/misc/player-local-handle.lua +5 -0
- package/engine/internal/misc/unit-ability-level-natives.d.ts +2 -0
- package/engine/internal/misc/unit-ability-level-natives.lua +12 -0
- package/engine/internal/object-data/armor-bonus.d.ts +2 -0
- package/engine/internal/object-data/attribute-bonus.lua +2 -2
- package/engine/internal/object-data/auto-attack-speed-increase.d.ts +1 -1
- package/engine/internal/object-data/auto-attack-speed-increase.lua +2 -0
- package/engine/internal/object-data/evasion-probability.d.ts +2 -0
- package/engine/internal/object-data/evasion-probability.lua +16 -0
- package/engine/internal/object-data/health-bonus.d.ts +2 -0
- package/engine/internal/object-data/health-bonus.lua +16 -0
- package/engine/internal/object-data/health-regeneration-rate-increase.d.ts +2 -0
- package/engine/internal/object-data/health-regeneration-rate-increase.lua +48 -0
- package/engine/internal/object-data/mana-bonus.d.ts +2 -0
- package/engine/internal/object-data/mana-bonus.lua +16 -0
- package/engine/internal/object-data/mana-regeneration-rate-increase-factor.d.ts +2 -0
- package/engine/internal/object-data/mana-regeneration-rate-increase-factor.lua +16 -0
- package/engine/internal/object-data/returned-melee-damage-factor.d.ts +2 -0
- package/engine/internal/object-data/returned-melee-damage-factor.lua +21 -0
- package/engine/internal/unit/ability.d.ts +45 -1
- package/engine/internal/unit/ability.lua +128 -17
- package/engine/internal/unit/add-item-to-slot-init.d.ts +2 -0
- package/engine/internal/unit/add-item-to-slot-init.lua +12 -0
- package/engine/internal/unit/add-item-to-slot.d.ts +2 -0
- package/engine/internal/unit/add-item-to-slot.lua +93 -0
- package/engine/internal/unit/allowed-targets.d.ts +1 -1
- package/engine/internal/unit/allowed-targets.lua +9 -1
- package/engine/internal/unit/appearance.d.ts +15 -0
- package/engine/internal/unit/appearance.lua +85 -0
- package/engine/internal/unit/attributes.d.ts +17 -0
- package/engine/internal/unit/attributes.lua +46 -0
- package/engine/internal/unit/bonus.d.ts +28 -8
- package/engine/internal/unit/bonus.lua +136 -9
- package/engine/internal/unit/buff.d.ts +2 -2
- package/engine/internal/unit/buff.lua +34 -19
- package/engine/internal/unit/detach-missiles.d.ts +7 -0
- package/engine/internal/unit/detach-missiles.lua +30 -0
- package/engine/internal/unit/equipment-inventory.d.ts +44 -0
- package/engine/internal/unit/equipment-inventory.lua +233 -0
- package/engine/internal/unit/expiration-timer.lua +1 -1
- package/engine/internal/unit/extended-inventory.d.ts +25 -0
- package/engine/internal/unit/extended-inventory.lua +99 -0
- package/engine/internal/unit/fly-height.d.ts +7 -0
- package/engine/internal/unit/fly-height.lua +20 -0
- package/engine/internal/unit/ignore-events-items.d.ts +2 -0
- package/engine/internal/unit/ignore-events-items.lua +14 -0
- package/engine/internal/unit/interrupts.d.ts +12 -0
- package/engine/internal/unit/interrupts.lua +28 -0
- package/engine/internal/unit/inventory.d.ts +28 -0
- package/engine/internal/unit/inventory.lua +87 -0
- package/engine/internal/unit/item-container.d.ts +25 -0
- package/engine/internal/unit/item-container.lua +11 -0
- package/engine/internal/unit/item-order-events.d.ts +17 -0
- package/engine/internal/unit/item-order-events.lua +67 -0
- package/engine/internal/unit/item-slot.d.ts +27 -0
- package/engine/internal/unit/item-slot.lua +92 -0
- package/engine/internal/unit/main-selected.d.ts +13 -0
- package/engine/internal/unit/main-selected.lua +36 -0
- package/engine/internal/unit/order.d.ts +20 -0
- package/engine/internal/unit/order.lua +136 -0
- package/engine/internal/unit/range-event.d.ts +12 -0
- package/engine/internal/unit/range-event.lua +90 -0
- package/engine/internal/unit/scale.d.ts +7 -0
- package/engine/internal/unit/scale.lua +20 -0
- package/engine/internal/unit+ability.d.ts +2 -1
- package/engine/internal/unit+ability.lua +75 -5
- package/engine/internal/unit+bonus.lua +3 -3
- package/engine/internal/unit+damage.d.ts +11 -11
- package/engine/internal/unit+damage.lua +43 -14
- package/engine/internal/unit+rally.lua +9 -31
- package/engine/internal/unit+spellSteal.lua +1 -2
- package/engine/internal/unit+transport.lua +4 -10
- package/engine/internal/unit-missile-data.lua +58 -32
- package/engine/internal/unit-missile-launch.lua +70 -13
- package/engine/internal/unit.d.ts +91 -38
- package/engine/internal/unit.lua +669 -351
- 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 +35 -2
- package/engine/local-client.lua +367 -15
- package/engine/object-data/auxiliary/animation-name.d.ts +1 -0
- package/engine/object-data/auxiliary/animation-name.lua +16 -0
- package/engine/object-data/auxiliary/armor-type.d.ts +11 -0
- package/engine/object-data/auxiliary/armor-type.lua +46 -0
- package/engine/object-data/auxiliary/attachment-preset.d.ts +14 -3
- package/engine/object-data/auxiliary/attachment-preset.lua +11 -3
- package/engine/object-data/auxiliary/attack-type.d.ts +7 -8
- package/engine/object-data/auxiliary/attack-type.lua +42 -0
- package/engine/object-data/auxiliary/combat-classification.d.ts +0 -2
- package/engine/object-data/auxiliary/equipment-slot.d.ts +12 -0
- package/engine/object-data/auxiliary/equipment-slot.lua +2 -0
- package/engine/object-data/auxiliary/equipment-type.d.ts +12 -0
- package/engine/object-data/auxiliary/equipment-type.lua +26 -0
- package/engine/object-data/auxiliary/health-regeneration-type.d.ts +8 -0
- package/engine/object-data/auxiliary/health-regeneration-type.lua +2 -0
- package/engine/object-data/auxiliary/item-class.d.ts +11 -0
- package/engine/object-data/auxiliary/item-class.lua +2 -0
- package/engine/object-data/auxiliary/item-tag.d.ts +12 -0
- package/engine/object-data/auxiliary/item-tag.lua +2 -0
- package/engine/object-data/auxiliary/movement-type.d.ts +7 -7
- package/engine/object-data/auxiliary/movement-type.lua +22 -0
- package/engine/object-data/auxiliary/order-type.d.ts +939 -0
- package/engine/object-data/auxiliary/order-type.lua +2 -0
- package/engine/object-data/auxiliary/sound-eax.d.ts +10 -0
- package/engine/object-data/auxiliary/sound-eax.lua +2 -0
- package/engine/object-data/auxiliary/sound-preset-name.d.ts +5 -1
- package/engine/object-data/auxiliary/sound-set-name.d.ts +14 -3
- package/engine/object-data/auxiliary/tech-tree-dependency.d.ts +1 -1
- package/engine/object-data/auxiliary/unit-attribute.d.ts +6 -0
- package/engine/object-data/auxiliary/unit-attribute.lua +9 -0
- package/engine/object-data/entry/ability-type/apprehend.d.ts +22 -0
- package/engine/object-data/entry/ability-type/apprehend.lua +66 -0
- package/engine/object-data/entry/ability-type/armor-bonus.d.ts +8 -0
- package/engine/object-data/entry/ability-type/{armor-increase.lua → armor-bonus.lua} +9 -9
- package/engine/object-data/entry/ability-type/aura-of-blight.d.ts +13 -0
- package/engine/object-data/entry/ability-type/aura-of-blight.lua +39 -0
- package/engine/object-data/entry/ability-type/banshee.d.ts +8 -0
- package/engine/object-data/entry/ability-type/banshee.lua +13 -0
- package/engine/object-data/entry/ability-type/banshees-wail-damage-amp.d.ts +12 -0
- package/engine/object-data/entry/ability-type/banshees-wail-damage-amp.lua +27 -0
- package/engine/object-data/entry/ability-type/banshees-wail.d.ts +31 -0
- package/engine/object-data/entry/ability-type/banshees-wail.lua +117 -0
- package/engine/object-data/entry/ability-type/battering-ram.d.ts +33 -0
- package/engine/object-data/entry/ability-type/battering-ram.lua +130 -0
- package/engine/object-data/entry/ability-type/berserk.d.ts +2 -0
- package/engine/object-data/entry/ability-type/berserk.lua +13 -0
- package/engine/object-data/entry/ability-type/blank-configurable.d.ts +0 -1
- package/engine/object-data/entry/ability-type/blank-configurable.lua +12 -1
- package/engine/object-data/entry/ability-type/blank-passive-with-cooldown.d.ts +23 -0
- package/engine/object-data/entry/ability-type/blank-passive-with-cooldown.lua +112 -0
- package/engine/object-data/entry/ability-type/blank-passive.d.ts +4 -1
- package/engine/object-data/entry/ability-type/blank-passive.lua +27 -7
- package/engine/object-data/entry/ability-type/blink.d.ts +10 -0
- package/engine/object-data/entry/ability-type/blink.lua +39 -0
- package/engine/object-data/entry/ability-type/breath-of-fire.d.ts +11 -0
- package/engine/object-data/entry/ability-type/breath-of-fire.lua +27 -0
- package/engine/object-data/entry/ability-type/carrion-swarm.d.ts +14 -0
- package/engine/object-data/entry/ability-type/carrion-swarm.lua +65 -0
- package/engine/object-data/entry/ability-type/channel.d.ts +0 -1
- package/engine/object-data/entry/ability-type/cleansing-fire.d.ts +27 -0
- package/engine/object-data/entry/ability-type/cleansing-fire.lua +104 -0
- package/engine/object-data/entry/ability-type/consecration.d.ts +15 -0
- package/engine/object-data/entry/ability-type/consecration.lua +52 -0
- package/engine/object-data/entry/ability-type/cooldown-reduction.d.ts +12 -0
- package/engine/object-data/entry/ability-type/cooldown-reduction.lua +39 -0
- package/engine/object-data/entry/ability-type/critical-strike-system.d.ts +18 -0
- package/engine/object-data/entry/ability-type/critical-strike-system.lua +65 -0
- package/engine/object-data/entry/ability-type/deathseeker-arrows.d.ts +21 -0
- package/engine/object-data/entry/ability-type/deathseeker-arrows.lua +78 -0
- package/engine/object-data/entry/ability-type/disease-cloud.lua +2 -2
- package/engine/object-data/entry/ability-type/engineering-upgrade.lua +2 -2
- package/engine/object-data/entry/ability-type/ensnare.d.ts +12 -0
- package/engine/object-data/entry/ability-type/ensnare.lua +52 -0
- package/engine/object-data/entry/ability-type/equipment-inventory-interface.d.ts +8 -0
- package/engine/object-data/entry/ability-type/equipment-inventory-interface.lua +13 -0
- package/engine/object-data/entry/ability-type/equipment-inventory.d.ts +13 -0
- package/engine/object-data/entry/ability-type/equipment-inventory.lua +27 -0
- package/engine/object-data/entry/ability-type/equipment.d.ts +13 -0
- package/engine/object-data/entry/ability-type/equipment.lua +27 -0
- package/engine/object-data/entry/ability-type/exhume-corpses.d.ts +14 -0
- package/engine/object-data/entry/ability-type/exhume-corpses.lua +40 -0
- package/engine/object-data/entry/ability-type/feral-spirit.lua +2 -2
- package/engine/object-data/entry/ability-type/firebolt.d.ts +7 -0
- package/engine/object-data/entry/ability-type/firebolt.lua +13 -0
- package/engine/object-data/entry/ability-type/flame-strike.d.ts +25 -0
- package/engine/object-data/entry/ability-type/flame-strike.lua +92 -0
- package/engine/object-data/entry/ability-type/grant-talent-point.d.ts +8 -0
- package/engine/object-data/entry/ability-type/grant-talent-point.lua +13 -0
- package/engine/object-data/entry/ability-type/grim-conviction.d.ts +36 -0
- package/engine/object-data/entry/ability-type/grim-conviction.lua +131 -0
- package/engine/object-data/entry/ability-type/grit.d.ts +18 -0
- package/engine/object-data/entry/ability-type/grit.lua +65 -0
- package/engine/object-data/entry/ability-type/guiding-hand.d.ts +27 -0
- package/engine/object-data/entry/ability-type/guiding-hand.lua +104 -0
- package/engine/object-data/entry/ability-type/headsplitter.d.ts +27 -0
- package/engine/object-data/entry/ability-type/headsplitter.lua +104 -0
- package/engine/object-data/entry/ability-type/{armor-increase.d.ts → healing-modifier.d.ts} +4 -3
- package/engine/object-data/entry/ability-type/healing-modifier.lua +26 -0
- package/engine/object-data/entry/ability-type/healing-ward-aura.d.ts +13 -0
- package/engine/object-data/entry/ability-type/healing-ward-aura.lua +39 -0
- package/engine/object-data/entry/ability-type/health-bonus.d.ts +8 -0
- package/engine/object-data/entry/ability-type/health-bonus.lua +26 -0
- package/engine/object-data/entry/ability-type/heroic-slash.d.ts +18 -0
- package/engine/object-data/entry/ability-type/heroic-slash.lua +65 -0
- package/engine/object-data/entry/ability-type/holy-wrath.d.ts +30 -0
- package/engine/object-data/entry/ability-type/holy-wrath.lua +117 -0
- package/engine/object-data/entry/ability-type/inspire-courage.d.ts +18 -0
- package/engine/object-data/entry/ability-type/inspire-courage.lua +65 -0
- package/engine/object-data/entry/ability-type/item-life-regeneration.d.ts +10 -0
- package/engine/object-data/entry/ability-type/item-life-regeneration.lua +26 -0
- package/engine/object-data/entry/ability-type/life-drain.d.ts +37 -0
- package/engine/object-data/entry/ability-type/life-drain.lua +144 -0
- package/engine/object-data/entry/ability-type/lights-mercy.d.ts +27 -0
- package/engine/object-data/entry/ability-type/lights-mercy.lua +104 -0
- package/engine/object-data/entry/ability-type/mana-bonus.d.ts +8 -0
- package/engine/object-data/entry/ability-type/mana-bonus.lua +26 -0
- package/engine/object-data/entry/ability-type/mana-efficiency.d.ts +12 -0
- package/engine/object-data/entry/ability-type/mana-efficiency.lua +39 -0
- package/engine/object-data/entry/ability-type/mana-regeneration.d.ts +8 -0
- package/engine/object-data/entry/ability-type/mana-regeneration.lua +26 -0
- package/engine/object-data/entry/ability-type/mind-control.d.ts +21 -0
- package/engine/object-data/entry/ability-type/mind-control.lua +78 -0
- package/engine/object-data/entry/ability-type/mine.d.ts +10 -0
- package/engine/object-data/entry/ability-type/mine.lua +39 -0
- package/engine/object-data/entry/ability-type/on-attack-cast-spell.d.ts +21 -0
- package/engine/object-data/entry/ability-type/on-attack-cast-spell.lua +52 -0
- package/engine/object-data/entry/ability-type/on-basic-attack-cast-spell.d.ts +19 -0
- package/engine/object-data/entry/ability-type/on-basic-attack-cast-spell.lua +65 -0
- package/engine/object-data/entry/ability-type/on-hit-cast-spell.d.ts +15 -0
- package/engine/object-data/entry/ability-type/on-hit-cast-spell.lua +26 -0
- package/engine/object-data/entry/ability-type/on-magic-attack-cast-spell.d.ts +6 -0
- package/engine/object-data/entry/ability-type/on-magic-attack-cast-spell.lua +12 -0
- package/engine/object-data/entry/ability-type/permanent-invisibility.d.ts +8 -0
- package/engine/object-data/entry/ability-type/permanent-invisibility.lua +26 -0
- package/engine/object-data/entry/ability-type/phase-shift.d.ts +10 -0
- package/engine/object-data/entry/ability-type/phase-shift.lua +39 -0
- package/engine/object-data/entry/ability-type/phoenix-morph.lua +4 -4
- package/engine/object-data/entry/ability-type/provoke.d.ts +21 -0
- package/engine/object-data/entry/ability-type/provoke.lua +66 -0
- package/engine/object-data/entry/ability-type/rain-of-fire.d.ts +7 -0
- package/engine/object-data/entry/ability-type/rain-of-fire.lua +13 -0
- package/engine/object-data/entry/ability-type/raise-dead.d.ts +17 -0
- package/engine/object-data/entry/ability-type/raise-dead.lua +78 -0
- package/engine/object-data/entry/ability-type/raise-the-banner.d.ts +9 -0
- package/engine/object-data/entry/ability-type/raise-the-banner.lua +26 -0
- package/engine/object-data/entry/ability-type/reincarnation.d.ts +8 -0
- package/engine/object-data/entry/ability-type/reincarnation.lua +26 -0
- package/engine/object-data/entry/ability-type/resolve.d.ts +12 -0
- package/engine/object-data/entry/ability-type/resolve.lua +39 -0
- package/engine/object-data/entry/ability-type/righteous-fury.d.ts +33 -0
- package/engine/object-data/entry/ability-type/righteous-fury.lua +130 -0
- package/engine/object-data/entry/ability-type/sacred-aura.d.ts +27 -0
- package/engine/object-data/entry/ability-type/sacred-aura.lua +104 -0
- package/engine/object-data/entry/ability-type/shock-wave.d.ts +4 -0
- package/engine/object-data/entry/ability-type/shock-wave.lua +26 -0
- package/engine/object-data/entry/ability-type/slow-poison.d.ts +10 -0
- package/engine/object-data/entry/ability-type/slow-poison.lua +58 -0
- package/engine/object-data/entry/ability-type/soul-burn.d.ts +22 -0
- package/engine/object-data/entry/ability-type/soul-burn.lua +79 -0
- package/engine/object-data/entry/ability-type/soul-lantern.d.ts +30 -0
- package/engine/object-data/entry/ability-type/soul-lantern.lua +117 -0
- package/engine/object-data/entry/ability-type/spell-amp.d.ts +15 -0
- package/engine/object-data/entry/ability-type/spell-amp.lua +52 -0
- package/engine/object-data/entry/ability-type/spell-critical-strike.d.ts +12 -0
- package/engine/object-data/entry/ability-type/spell-critical-strike.lua +39 -0
- package/engine/object-data/entry/ability-type/spell-vamp.d.ts +12 -0
- package/engine/object-data/entry/ability-type/spell-vamp.lua +39 -0
- package/engine/object-data/entry/ability-type/spirit-touch.d.ts +2 -2
- package/engine/object-data/entry/ability-type/spirit-touch.lua +6 -6
- package/engine/object-data/entry/ability-type/stackable-evasion.d.ts +9 -0
- package/engine/object-data/entry/ability-type/stackable-evasion.lua +13 -0
- package/engine/object-data/entry/ability-type/stackable-hardened-skin.d.ts +21 -0
- package/engine/object-data/entry/ability-type/stackable-hardened-skin.lua +78 -0
- package/engine/object-data/entry/ability-type/stackable-life-steal.d.ts +9 -0
- package/engine/object-data/entry/ability-type/stackable-life-steal.lua +26 -0
- package/engine/object-data/entry/ability-type/stackable-spell-damage-reduction.d.ts +9 -0
- package/engine/object-data/entry/ability-type/stackable-spell-damage-reduction.lua +13 -0
- package/engine/object-data/entry/ability-type/stackable-thorn-shield.d.ts +9 -0
- package/engine/object-data/entry/ability-type/stackable-thorn-shield.lua +13 -0
- package/engine/object-data/entry/ability-type/stat-details.d.ts +12 -0
- package/engine/object-data/entry/ability-type/stat-details.lua +27 -0
- package/engine/object-data/entry/ability-type/summon-quilbeast.lua +2 -2
- package/engine/object-data/entry/ability-type/summon-water-elemental.lua +2 -2
- package/engine/object-data/entry/ability-type/surge-of-light.d.ts +33 -0
- package/engine/object-data/entry/ability-type/surge-of-light.lua +130 -0
- package/engine/object-data/entry/ability-type/sweeping-strike.d.ts +57 -0
- package/engine/object-data/entry/ability-type/sweeping-strike.lua +234 -0
- package/engine/object-data/entry/ability-type/talents.d.ts +12 -0
- package/engine/object-data/entry/ability-type/talents.lua +27 -0
- package/engine/object-data/entry/ability-type/unyielding-guard.d.ts +30 -0
- package/engine/object-data/entry/ability-type/unyielding-guard.lua +117 -0
- package/engine/object-data/entry/ability-type/valiant-charge.d.ts +27 -0
- package/engine/object-data/entry/ability-type/valiant-charge.lua +104 -0
- package/engine/object-data/entry/ability-type/warcry.d.ts +9 -0
- package/engine/object-data/entry/ability-type/warcry.lua +26 -0
- package/engine/object-data/entry/ability-type/web.d.ts +12 -0
- package/engine/object-data/entry/ability-type/web.lua +52 -0
- package/engine/object-data/entry/ability-type/withering-fire.d.ts +21 -0
- package/engine/object-data/entry/ability-type/withering-fire.lua +78 -0
- package/engine/object-data/entry/ability-type.d.ts +48 -21
- package/engine/object-data/entry/ability-type.lua +377 -44
- package/engine/object-data/entry/buff-type/applicable.d.ts +0 -1
- package/engine/object-data/entry/buff-type/applicable.lua +143 -202
- package/engine/object-data/entry/buff-type/blank.d.ts +0 -1
- package/engine/object-data/entry/buff-type.d.ts +10 -13
- package/engine/object-data/entry/buff-type.lua +39 -29
- package/engine/object-data/entry/destructible-type.d.ts +32 -3
- package/engine/object-data/entry/destructible-type.lua +181 -0
- package/engine/object-data/entry/item-type/blank.d.ts +0 -1
- package/engine/object-data/entry/item-type.d.ts +32 -4
- package/engine/object-data/entry/item-type.lua +177 -2
- package/engine/object-data/entry/lightning-type.d.ts +6 -9
- package/engine/object-data/entry/lightning-type.lua +1 -1
- package/engine/object-data/entry/sound-preset.d.ts +33 -0
- package/engine/object-data/entry/sound-preset.lua +140 -0
- package/engine/object-data/entry/unit-type.d.ts +121 -6
- package/engine/object-data/entry/unit-type.lua +959 -118
- package/engine/object-data/entry/upgrade/blank.d.ts +0 -1
- package/engine/object-data/entry/upgrade.d.ts +2 -3
- package/engine/object-data/entry/upgrade.lua +4 -4
- package/engine/object-data/entry.d.ts +23 -17
- package/engine/object-data/entry.lua +68 -32
- package/engine/object-data/utility/object-data-entry-id-generator.lua +7 -0
- package/engine/object-field/ability.d.ts +33 -8
- package/engine/object-field/ability.lua +63 -3
- package/engine/object-field/item.d.ts +22 -0
- package/engine/object-field/item.lua +118 -0
- package/engine/object-field/unit.d.ts +72 -2
- package/engine/object-field/unit.lua +268 -4
- package/engine/object-field.d.ts +30 -11
- package/engine/object-field.lua +386 -122
- package/engine/random.d.ts +11 -0
- package/engine/random.lua +30 -0
- package/engine/standard/entries/ability-type.d.ts +3102 -7
- package/engine/standard/entries/ability-type.lua +0 -6
- package/engine/standard/entries/buff-type.d.ts +48 -0
- package/engine/standard/entries/buff-type.lua +46 -0
- package/engine/standard/entries/item-type.d.ts +1299 -0
- package/engine/standard/entries/item-type.lua +2 -0
- package/engine/standard/entries/lightning-type.d.ts +42 -15
- package/engine/standard/entries/lightning-type.lua +0 -14
- package/engine/standard/entries/sound-preset.d.ts +10 -0
- package/engine/standard/entries/sound-preset.lua +10 -0
- package/engine/standard/entries/unit-type.d.ts +47 -1
- package/engine/standard/entries/unit-type.lua +47 -1
- package/engine/standard/fields/ability.d.ts +5 -3
- package/engine/standard/fields/ability.lua +5 -3
- package/engine/standard/fields/item.d.ts +4 -0
- package/engine/standard/fields/item.lua +6 -0
- package/engine/standard/fields/unit.d.ts +12 -0
- package/engine/standard/fields/unit.lua +20 -0
- package/engine/synchronization.d.ts +11 -0
- package/engine/synchronization.lua +77 -0
- package/engine/text-tag.d.ts +36 -2
- package/engine/text-tag.lua +250 -10
- package/engine/unit.d.ts +14 -0
- package/engine/unit.lua +23 -2
- package/event.d.ts +3 -4
- package/event.lua +9 -5
- package/global/vec2.lua +1 -0
- package/index.d.ts +1 -0
- package/index.lua +1 -0
- package/lualib_bundle.lua +147 -43
- package/math/vec2.d.ts +2 -9
- package/math.d.ts +2 -2
- package/math.lua +14 -0
- package/net/socket.d.ts +7 -1
- package/net/socket.lua +45 -4
- package/network.d.ts +1 -0
- package/network.lua +28 -3
- package/objutil/ability.d.ts +0 -1
- package/objutil/buff.d.ts +0 -1
- package/objutil/buff.lua +13 -12
- package/objutil/object.d.ts +0 -1
- package/objutil/object.lua +1 -1
- package/objutil/unit.d.ts +0 -1
- package/objutil/unit.lua +8 -0
- package/operation.d.ts +8 -1
- package/operation.lua +38 -18
- package/package.json +3 -24
- package/patch-lua.d.ts +0 -0
- package/patch-lua.lua +25 -0
- package/patch-lualib.lua +1 -1
- package/property.d.ts +55 -0
- package/property.lua +374 -0
- package/string.d.ts +30 -0
- package/string.lua +14 -0
- package/util/stream.d.ts +0 -1
- package/utility/arrays.d.ts +20 -6
- package/utility/arrays.lua +62 -3
- package/utility/bit-set.d.ts +0 -2
- package/utility/callback-array.d.ts +17 -0
- package/utility/callback-array.lua +61 -0
- package/utility/functions.d.ts +8 -0
- package/utility/functions.lua +13 -0
- package/utility/lazy.d.ts +2 -0
- package/utility/lazy.lua +14 -0
- package/utility/linked-map.d.ts +35 -0
- package/utility/linked-map.lua +107 -0
- package/utility/linked-set.d.ts +17 -4
- package/utility/linked-set.lua +70 -3
- package/utility/lua-maps.d.ts +16 -4
- package/utility/lua-maps.lua +53 -2
- package/utility/lua-sets.d.ts +3 -2
- package/utility/lua-sets.lua +7 -0
- package/utility/random.d.ts +102 -0
- package/utility/random.lua +273 -0
- package/utility/records.lua +20 -1
- package/utility/reflection.lua +11 -7
- package/utility/types.d.ts +6 -2
- package/utility/unordered-map.d.ts +27 -0
- package/utility/unordered-map.lua +99 -0
- package/core/mapbounds.d.ts +0 -8
- package/core/mapbounds.lua +0 -12
- package/core/types/order.d.ts +0 -25
- package/core/types/order.lua +0 -55
- /package/engine/internal/{object-data/armor-increase.d.ts → mechanics/cast-ability.d.ts} +0 -0
- /package/engine/internal/object-data/{armor-increase.lua → armor-bonus.lua} +0 -0
- /package/engine/object-data/entry/ability-type/{attribute-increase.d.ts → attribute-bonus.d.ts} +0 -0
- /package/engine/object-data/entry/ability-type/{attribute-increase.lua → attribute-bonus.lua} +0 -0
package/engine/buff.lua
CHANGED
|
@@ -16,6 +16,7 @@ local internalApplyBuff = ____applicable.internalApplyBuff
|
|
|
16
16
|
local removeBuff = ____applicable.removeBuff
|
|
17
17
|
local ____ability = require("engine.internal.ability")
|
|
18
18
|
local Ability = ____ability.Ability
|
|
19
|
+
local UnitAbility = ____ability.UnitAbility
|
|
19
20
|
local ____ability = require("engine.object-field.ability")
|
|
20
21
|
local AbilityBooleanField = ____ability.AbilityBooleanField
|
|
21
22
|
local AbilityNumberField = ____ability.AbilityNumberField
|
|
@@ -28,13 +29,11 @@ local ____math = require("math")
|
|
|
28
29
|
local max = ____math.max
|
|
29
30
|
local min = ____math.min
|
|
30
31
|
local ____bonus = require("engine.internal.unit.bonus")
|
|
31
|
-
local addOrUpdateOrRemoveUnitBonus = ____bonus.addOrUpdateOrRemoveUnitBonus
|
|
32
|
-
local getUnitBonus = ____bonus.getUnitBonus
|
|
33
|
-
local removeUnitBonus = ____bonus.removeUnitBonus
|
|
34
32
|
local UnitBonusType = ____bonus.UnitBonusType
|
|
35
33
|
local ____area_2Ddamage = require("engine.internal.mechanics.area-damage")
|
|
36
34
|
local damageArea = ____area_2Ddamage.damageArea
|
|
37
35
|
local ____preconditions = require("utility.preconditions")
|
|
36
|
+
local check = ____preconditions.check
|
|
38
37
|
local checkNotNull = ____preconditions.checkNotNull
|
|
39
38
|
local ____effect = require("core.types.effect")
|
|
40
39
|
local Effect = ____effect.Effect
|
|
@@ -43,9 +42,25 @@ local BuffType = ____buff_2Dtype.BuffType
|
|
|
43
42
|
local ____unit = require("engine.behaviour.unit")
|
|
44
43
|
local UnitBehavior = ____unit.UnitBehavior
|
|
45
44
|
local ____arrays = require("utility.arrays")
|
|
45
|
+
local emptyArray = ____arrays.emptyArray
|
|
46
46
|
local forEach = ____arrays.forEach
|
|
47
|
+
local ____event = require("event")
|
|
48
|
+
local Event = ____event.Event
|
|
47
49
|
local ____ability_2Dduration = require("engine.internal.mechanics.ability-duration")
|
|
48
50
|
local getAbilityDuration = ____ability_2Dduration.getAbilityDuration
|
|
51
|
+
local ____item = require("engine.internal.item")
|
|
52
|
+
local Item = ____item.Item
|
|
53
|
+
local ____destructable = require("core.types.destructable")
|
|
54
|
+
local Destructable = ____destructable.Destructable
|
|
55
|
+
local ____ability = require("engine.standard.fields.ability")
|
|
56
|
+
local COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD = ____ability.COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD
|
|
57
|
+
local ____ability = require("engine.behaviour.ability")
|
|
58
|
+
local AbilityBehavior = ____ability.AbilityBehavior
|
|
59
|
+
local ____records = require("utility.records")
|
|
60
|
+
local sortedKeysUnnested = ____records.sortedKeysUnnested
|
|
61
|
+
local ____sound = require("core.types.sound")
|
|
62
|
+
local Sound3D = ____sound.Sound3D
|
|
63
|
+
local SoundSettings = ____sound.SoundSettings
|
|
49
64
|
local getUnitAbility = BlzGetUnitAbility
|
|
50
65
|
local stringValueByBuffTypeIdByFieldId = postcompile(function()
|
|
51
66
|
local stringValueByBuffTypeIdByFieldId = {}
|
|
@@ -91,14 +106,21 @@ local buffParametersKeys = {
|
|
|
91
106
|
damageIncrease = true,
|
|
92
107
|
damageIncreaseFactor = true,
|
|
93
108
|
armorIncrease = true,
|
|
94
|
-
|
|
109
|
+
maxHealthIncrease = true,
|
|
110
|
+
maxManaIncrease = true,
|
|
95
111
|
attackSpeedIncreaseFactor = true,
|
|
96
112
|
movementSpeedIncreaseFactor = true,
|
|
113
|
+
manaRegenerationRateIncreaseFactor = true,
|
|
114
|
+
evasionProbability = true,
|
|
115
|
+
missProbability = true,
|
|
116
|
+
damageFactor = true,
|
|
97
117
|
receivedDamageFactor = true,
|
|
118
|
+
returnedMeleeDamageFactor = true,
|
|
98
119
|
receivedMagicDamageFactor = true,
|
|
99
120
|
durationIncreaseOnAutoAttack = true,
|
|
100
121
|
maximumDuration = true,
|
|
101
122
|
maximumRemainingDuration = true,
|
|
123
|
+
turnsIntoGhost = true,
|
|
102
124
|
stuns = true,
|
|
103
125
|
ignoresStunImmunity = true,
|
|
104
126
|
providesStunImmunity = true,
|
|
@@ -107,8 +129,31 @@ local buffParametersKeys = {
|
|
|
107
129
|
disablesAutoAttack = true,
|
|
108
130
|
destroysOnDamage = true,
|
|
109
131
|
maximumAutoAttackCount = true,
|
|
110
|
-
|
|
132
|
+
maximumDamageDealtEventCount = true,
|
|
133
|
+
maximumDamageReceivedEventCount = true,
|
|
134
|
+
absorbedDamageFactor = true,
|
|
135
|
+
maximumDamageAbsorbed = true,
|
|
136
|
+
destroysOnMaximumDamageAbsorbed = true,
|
|
137
|
+
uniqueGroup = true,
|
|
138
|
+
destructionSoundPresetId = true,
|
|
139
|
+
damageOnExpiration = true,
|
|
140
|
+
healingOnExpiration = true,
|
|
141
|
+
killsOnExpiration = true,
|
|
142
|
+
explodesOnExpiration = true,
|
|
143
|
+
abilityCooldownFactor = true
|
|
111
144
|
}
|
|
145
|
+
local function resolveEnumValue(ability, level, value)
|
|
146
|
+
if value == nil or type(value) == "number" then
|
|
147
|
+
return value
|
|
148
|
+
end
|
|
149
|
+
if ability == nil then
|
|
150
|
+
error(
|
|
151
|
+
__TS__New(IllegalArgumentException),
|
|
152
|
+
0
|
|
153
|
+
)
|
|
154
|
+
end
|
|
155
|
+
return value:getValue(ability, level or ability.level)
|
|
156
|
+
end
|
|
112
157
|
local function resolveNumberValue(ability, level, value)
|
|
113
158
|
if value == nil or type(value) == "number" then
|
|
114
159
|
return value
|
|
@@ -145,20 +190,42 @@ local function resolveAndSetNumberValue(buff, property, ability, level, value, d
|
|
|
145
190
|
buff[property] = resolvedValue
|
|
146
191
|
end
|
|
147
192
|
end
|
|
148
|
-
local buffBooleanParameters = {
|
|
193
|
+
local buffBooleanParameters = {
|
|
194
|
+
"destroysOnMaximumDamageAbsorbed",
|
|
195
|
+
"turnsIntoGhost",
|
|
196
|
+
"stuns",
|
|
197
|
+
"ignoresStunImmunity",
|
|
198
|
+
"disablesAutoAttack",
|
|
199
|
+
"providesInvulnerability",
|
|
200
|
+
"killsOnExpiration",
|
|
201
|
+
"explodesOnExpiration"
|
|
202
|
+
}
|
|
149
203
|
local buffNumberParameters = {
|
|
150
204
|
"durationIncreaseOnAutoAttack",
|
|
151
205
|
"attackSpeedIncreaseFactor",
|
|
152
206
|
"movementSpeedIncreaseFactor",
|
|
207
|
+
"manaRegenerationRateIncreaseFactor",
|
|
208
|
+
"evasionProbability",
|
|
153
209
|
"armorIncrease",
|
|
210
|
+
"maxHealthIncrease",
|
|
211
|
+
"maxManaIncrease",
|
|
212
|
+
"damageFactor",
|
|
154
213
|
"receivedDamageFactor",
|
|
214
|
+
"returnedMeleeDamageFactor",
|
|
155
215
|
"maximumAutoAttackCount",
|
|
216
|
+
"maximumDamageDealtEventCount",
|
|
217
|
+
"maximumDamageReceivedEventCount",
|
|
156
218
|
"damageInterval",
|
|
157
219
|
"damagePerInterval",
|
|
158
220
|
"damageOverDuration",
|
|
159
221
|
"healingInterval",
|
|
160
222
|
"healingPerInterval",
|
|
161
|
-
"healingOverDuration"
|
|
223
|
+
"healingOverDuration",
|
|
224
|
+
"damageOnExpiration",
|
|
225
|
+
"healingOnExpiration",
|
|
226
|
+
"absorbedDamageFactor",
|
|
227
|
+
"maximumDamageAbsorbed",
|
|
228
|
+
"abilityCooldownFactor"
|
|
162
229
|
}
|
|
163
230
|
local unsuccessfulApplicationMarker = {}
|
|
164
231
|
local function selectBuffTypeIdWithLeastDuration(buffTypeIds, unit)
|
|
@@ -185,7 +252,7 @@ local function selectBuffTypeIdWithLeastDuration(buffTypeIds, unit)
|
|
|
185
252
|
return checkNotNull(firstNativeBuffTypeId)
|
|
186
253
|
end
|
|
187
254
|
local function destroyBuffIfItHasSameUniqueGroup(buff, uniqueGroup)
|
|
188
|
-
if buff[
|
|
255
|
+
if buff[104] == uniqueGroup then
|
|
189
256
|
buff:destroy()
|
|
190
257
|
end
|
|
191
258
|
end
|
|
@@ -193,73 +260,80 @@ local function destroyBuff(buff)
|
|
|
193
260
|
buff:destroy()
|
|
194
261
|
end
|
|
195
262
|
local function expireBuff(buff)
|
|
196
|
-
|
|
197
|
-
|
|
263
|
+
if buff.isDestroyed or buff[100] ~= 1 then
|
|
264
|
+
return
|
|
265
|
+
end
|
|
266
|
+
buff[100] = 2
|
|
267
|
+
local remainingDamageOverDuration = buff[114] or 0
|
|
268
|
+
local remainingHealingOverDuration = buff[114] or 0
|
|
198
269
|
if remainingDamageOverDuration ~= 0 or remainingHealingOverDuration ~= 0 then
|
|
199
270
|
buff:flashSpecialEffect()
|
|
200
271
|
if remainingDamageOverDuration ~= 0 then
|
|
201
|
-
(buff[
|
|
202
|
-
buff[
|
|
272
|
+
(buff[102] or buff[101]):damageTarget(buff[101], remainingDamageOverDuration)
|
|
273
|
+
buff[114] = nil
|
|
203
274
|
end
|
|
204
275
|
if remainingHealingOverDuration ~= 0 then
|
|
205
|
-
(buff[
|
|
206
|
-
buff[
|
|
276
|
+
(buff[102] or buff[101]):healTarget(buff[101], remainingHealingOverDuration)
|
|
277
|
+
buff[119] = nil
|
|
207
278
|
end
|
|
208
279
|
end
|
|
209
280
|
Timer:run(destroyBuff, buff)
|
|
281
|
+
buff:onExpiration()
|
|
210
282
|
end
|
|
211
283
|
local function buffDamageIntervalInitialTimerCallback(buff)
|
|
212
284
|
buffDamageIntervalTimerCallback(buff)
|
|
213
|
-
local timer = buff[
|
|
214
|
-
local damageInterval = buff[
|
|
285
|
+
local timer = buff[115]
|
|
286
|
+
local damageInterval = buff[113]
|
|
215
287
|
if timer ~= nil and damageInterval ~= nil and damageInterval > 0 then
|
|
216
288
|
timer:start(damageInterval, true, buffDamageIntervalTimerCallback, buff)
|
|
217
289
|
end
|
|
218
290
|
end
|
|
219
291
|
buffDamageIntervalTimerCallback = function(buff)
|
|
220
292
|
buff:flashSpecialEffect()
|
|
221
|
-
local source = buff[
|
|
222
|
-
local remainingDamageOverDuration = buff[
|
|
293
|
+
local source = buff[102] or buff[101]
|
|
294
|
+
local remainingDamageOverDuration = buff[114] or 0
|
|
223
295
|
if remainingDamageOverDuration ~= 0 then
|
|
224
|
-
local damageInterval = buff[
|
|
296
|
+
local damageInterval = buff[113] or 0
|
|
225
297
|
if damageInterval ~= 0 then
|
|
226
298
|
local damage = remainingDamageOverDuration / (1 + buff.remainingDuration / damageInterval)
|
|
227
|
-
source:damageTarget(buff[
|
|
228
|
-
buff[
|
|
299
|
+
source:damageTarget(buff[101], damage)
|
|
300
|
+
buff[114] = remainingDamageOverDuration - damage
|
|
229
301
|
end
|
|
230
302
|
end
|
|
231
|
-
local damagePerInterval = buff[
|
|
303
|
+
local damagePerInterval = buff[112] or 0
|
|
232
304
|
if remainingDamageOverDuration == 0 or damagePerInterval ~= 0 then
|
|
233
|
-
source:damageTarget(buff[
|
|
305
|
+
source:damageTarget(buff[101], damagePerInterval)
|
|
234
306
|
end
|
|
235
307
|
end
|
|
236
308
|
local function buffHealingIntervalInitialTimerCallback(buff)
|
|
237
309
|
buffHealingIntervalTimerCallback(buff)
|
|
238
|
-
local timer = buff[
|
|
239
|
-
local healingInterval = buff[
|
|
310
|
+
local timer = buff[120]
|
|
311
|
+
local healingInterval = buff[118]
|
|
240
312
|
if timer ~= nil and healingInterval ~= nil and healingInterval > 0 then
|
|
241
313
|
timer:start(healingInterval, true, buffHealingIntervalTimerCallback, buff)
|
|
242
314
|
end
|
|
243
315
|
end
|
|
244
316
|
buffHealingIntervalTimerCallback = function(buff)
|
|
245
|
-
if buff[
|
|
317
|
+
if buff[118] ~= buff[113] then
|
|
246
318
|
buff:flashSpecialEffect()
|
|
247
319
|
end
|
|
248
|
-
local source = buff[
|
|
249
|
-
local remainingHealingOverDuration = buff[
|
|
320
|
+
local source = buff[102] or buff[101]
|
|
321
|
+
local remainingHealingOverDuration = buff[119] or 0
|
|
250
322
|
if remainingHealingOverDuration ~= 0 then
|
|
251
|
-
local healingInterval = buff[
|
|
323
|
+
local healingInterval = buff[118] or 0
|
|
252
324
|
if healingInterval ~= 0 then
|
|
253
325
|
local healing = remainingHealingOverDuration / (1 + buff.remainingDuration / healingInterval)
|
|
254
|
-
source:healTarget(buff[
|
|
255
|
-
buff[
|
|
326
|
+
source:healTarget(buff[101], healing)
|
|
327
|
+
buff[119] = remainingHealingOverDuration - healing
|
|
256
328
|
end
|
|
257
329
|
end
|
|
258
|
-
local healingPerInterval = buff[
|
|
330
|
+
local healingPerInterval = buff[117] or 0
|
|
259
331
|
if remainingHealingOverDuration == 0 or healingPerInterval ~= 0 then
|
|
260
|
-
source:healTarget(buff[
|
|
332
|
+
source:healTarget(buff[101], healingPerInterval)
|
|
261
333
|
end
|
|
262
334
|
end
|
|
335
|
+
local buffCreatedEvent = __TS__New(Event)
|
|
336
|
+
local buffBeingDestroyedEvent = __TS__New(Event)
|
|
263
337
|
____exports.Buff = __TS__Class()
|
|
264
338
|
local Buff = ____exports.Buff
|
|
265
339
|
Buff.name = "Buff"
|
|
@@ -268,40 +342,44 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
268
342
|
UnitBehavior.prototype.____constructor(self, _unit)
|
|
269
343
|
self._unit = _unit
|
|
270
344
|
self.parameters = nil
|
|
271
|
-
self[100] =
|
|
345
|
+
self[100] = 0
|
|
346
|
+
self[101] = _unit
|
|
272
347
|
local typeId
|
|
273
348
|
local polarity
|
|
274
349
|
local resistanceType
|
|
275
350
|
local ability
|
|
351
|
+
local abilityBehavior
|
|
276
352
|
if type(typeIdOrTypeIds) ~= "number" then
|
|
277
353
|
typeId = selectBuffTypeIdWithLeastDuration(typeIdOrTypeIds, _unit)
|
|
278
354
|
polarity = resistanceTypeOrPolarity
|
|
279
355
|
resistanceType = abilityOrParametersOrResistanceType
|
|
280
|
-
if __TS__InstanceOf(parametersOrAbility,
|
|
356
|
+
if __TS__InstanceOf(parametersOrAbility, AbilityBehavior) then
|
|
357
|
+
abilityBehavior = parametersOrAbility
|
|
358
|
+
ability = abilityBehavior.ability
|
|
359
|
+
elseif __TS__InstanceOf(parametersOrAbility, Ability) then
|
|
281
360
|
ability = parametersOrAbility
|
|
282
|
-
|
|
283
|
-
ability = nil
|
|
361
|
+
elseif parametersOrAbility ~= nil then
|
|
284
362
|
parameters = parametersOrAbility
|
|
285
363
|
end
|
|
286
364
|
else
|
|
287
365
|
typeId = typeIdOrTypeIds
|
|
288
366
|
polarity = polarityOrTypeIdSelectionPolicy
|
|
289
367
|
resistanceType = resistanceTypeOrPolarity
|
|
290
|
-
if __TS__InstanceOf(abilityOrParametersOrResistanceType,
|
|
368
|
+
if __TS__InstanceOf(abilityOrParametersOrResistanceType, AbilityBehavior) then
|
|
369
|
+
abilityBehavior = abilityOrParametersOrResistanceType
|
|
370
|
+
ability = abilityBehavior.ability
|
|
371
|
+
parameters = parametersOrAbility
|
|
372
|
+
elseif __TS__InstanceOf(abilityOrParametersOrResistanceType, Ability) then
|
|
291
373
|
ability = abilityOrParametersOrResistanceType
|
|
292
374
|
parameters = parametersOrAbility
|
|
293
|
-
|
|
294
|
-
ability = nil
|
|
375
|
+
elseif abilityOrParametersOrResistanceType ~= nil then
|
|
295
376
|
parameters = abilityOrParametersOrResistanceType
|
|
377
|
+
else
|
|
378
|
+
parameters = parametersOrAbility
|
|
296
379
|
end
|
|
297
380
|
end
|
|
381
|
+
self.sourceAbilityBehavior = abilityBehavior
|
|
298
382
|
self.typeId = typeId
|
|
299
|
-
self.polarity = polarity
|
|
300
|
-
self.resistanceType = resistanceType
|
|
301
|
-
if not __TS__InstanceOf(ability, Ability) then
|
|
302
|
-
parameters = ability
|
|
303
|
-
ability = nil
|
|
304
|
-
end
|
|
305
383
|
local defaultParameters = self.constructor.defaultParameters
|
|
306
384
|
local level = parameters and parameters.level or defaultParameters.level
|
|
307
385
|
local spellStealPriority = parameters and parameters.spellStealPriority or defaultParameters.spellStealPriority
|
|
@@ -324,14 +402,22 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
324
402
|
learnLevelMinimum = learnLevelMinimum or ability:getField(ABILITY_IF_REQUIRED_LEVEL)
|
|
325
403
|
duration = duration or getAbilityDuration(ability, _unit)
|
|
326
404
|
end
|
|
405
|
+
self.polarity = resolveEnumValue(ability, level, polarity)
|
|
406
|
+
self.resistanceType = resolveEnumValue(ability, level, resistanceType)
|
|
407
|
+
local missProbability = parameters and parameters.missProbability or defaultParameters.missProbability
|
|
408
|
+
if missProbability ~= nil then
|
|
409
|
+
missProbability = resolveNumberValue(ability, level, missProbability)
|
|
410
|
+
self[147] = missProbability
|
|
411
|
+
end
|
|
327
412
|
local buffByTypeId = buffByTypeIdByUnit[_unit]
|
|
328
413
|
if buffByTypeId == nil then
|
|
329
414
|
buffByTypeId = {}
|
|
330
415
|
buffByTypeIdByUnit[_unit] = buffByTypeId
|
|
331
416
|
end
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
417
|
+
self.previousBuff = buffByTypeId[typeId]
|
|
418
|
+
local ____opt_15 = self.previousBuff
|
|
419
|
+
if ____opt_15 ~= nil then
|
|
420
|
+
____opt_15:destroy()
|
|
335
421
|
end
|
|
336
422
|
local uniqueGroup = parameters and parameters.uniqueGroup or defaultParameters and defaultParameters.uniqueGroup
|
|
337
423
|
if uniqueGroup ~= nil then
|
|
@@ -340,18 +426,21 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
340
426
|
if not internalApplyBuff(
|
|
341
427
|
_unit,
|
|
342
428
|
typeId,
|
|
343
|
-
polarity,
|
|
344
|
-
resistanceType,
|
|
429
|
+
self.polarity,
|
|
430
|
+
self.resistanceType,
|
|
345
431
|
level,
|
|
346
432
|
duration,
|
|
347
433
|
spellStealPriority,
|
|
348
|
-
learnLevelMinimum
|
|
434
|
+
learnLevelMinimum,
|
|
435
|
+
missProbability
|
|
349
436
|
) then
|
|
437
|
+
self[100] = 1
|
|
350
438
|
UnitBehavior.prototype.destroy(self)
|
|
351
439
|
error(unsuccessfulApplicationMarker, 0)
|
|
352
440
|
end
|
|
353
441
|
local handle = BlzGetUnitAbility(_unit.handle, typeId)
|
|
354
442
|
if handle == nil then
|
|
443
|
+
self[100] = 1
|
|
355
444
|
UnitBehavior.prototype.destroy(self)
|
|
356
445
|
error(unsuccessfulApplicationMarker, 0)
|
|
357
446
|
end
|
|
@@ -360,20 +449,21 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
360
449
|
self._level = level
|
|
361
450
|
self._spellStealPriority = spellStealPriority
|
|
362
451
|
self._learnLevelMinimum = learnLevelMinimum
|
|
363
|
-
self[
|
|
364
|
-
self[
|
|
365
|
-
self[
|
|
366
|
-
self[
|
|
367
|
-
self[
|
|
452
|
+
self[102] = source
|
|
453
|
+
self[103] = duration or 0
|
|
454
|
+
self[104] = uniqueGroup
|
|
455
|
+
self[105] = parameters and parameters.destructionSoundPresetId or defaultParameters and defaultParameters.destructionSoundPresetId
|
|
456
|
+
self[106] = BlzGetAbilityStringLevelField(self.handle, ABILITY_SLF_EFFECT, 0)
|
|
457
|
+
self[107] = BlzGetAbilityStringLevelField(self.handle, ABILITY_SLF_SPECIAL, 0)
|
|
368
458
|
if parameters ~= nil or (next(defaultParameters)) ~= nil then
|
|
369
459
|
for ____, buffBooleanParameter in ipairs(buffBooleanParameters) do
|
|
370
|
-
local
|
|
371
|
-
local
|
|
372
|
-
local
|
|
373
|
-
if
|
|
374
|
-
|
|
460
|
+
local ____ability_28 = ability
|
|
461
|
+
local ____level_29 = level
|
|
462
|
+
local ____temp_27 = parameters and parameters[buffBooleanParameter]
|
|
463
|
+
if ____temp_27 == nil then
|
|
464
|
+
____temp_27 = defaultParameters[buffBooleanParameter]
|
|
375
465
|
end
|
|
376
|
-
if resolveBooleanValue(
|
|
466
|
+
if resolveBooleanValue(____ability_28, ____level_29, ____temp_27) then
|
|
377
467
|
self[buffBooleanParameter] = true
|
|
378
468
|
end
|
|
379
469
|
end
|
|
@@ -389,11 +479,11 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
389
479
|
end
|
|
390
480
|
local maximumDuration = parameters and parameters.maximumDuration or defaultParameters.maximumDuration
|
|
391
481
|
if maximumDuration ~= nil then
|
|
392
|
-
self[
|
|
482
|
+
self[109] = resolveNumberValue(ability, level, maximumDuration)
|
|
393
483
|
end
|
|
394
484
|
local maximumRemainingDuration = parameters and parameters.maximumRemainingDuration or defaultParameters.maximumRemainingDuration
|
|
395
485
|
if maximumRemainingDuration ~= nil then
|
|
396
|
-
self[
|
|
486
|
+
self[110] = resolveNumberValue(ability, level, maximumRemainingDuration)
|
|
397
487
|
end
|
|
398
488
|
local parametersAbilityTypeIds = parameters and parameters.abilityTypeIds or defaultParameters.abilityTypeIds
|
|
399
489
|
if parametersAbilityTypeIds ~= nil then
|
|
@@ -402,24 +492,22 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
402
492
|
abilityTypeIds = {}
|
|
403
493
|
self._abilityTypeIds = abilityTypeIds
|
|
404
494
|
end
|
|
405
|
-
for
|
|
495
|
+
for ____, abilityTypeId in ipairs(sortedKeysUnnested(parametersAbilityTypeIds)) do
|
|
496
|
+
local abilityParameters = checkNotNull(parametersAbilityTypeIds[abilityTypeId])
|
|
406
497
|
local addedAbility = _unit:addAbility(abilityTypeId)
|
|
407
498
|
if addedAbility ~= nil then
|
|
408
499
|
_unit:makeAbilityPermanent(abilityTypeId, true)
|
|
409
500
|
_unit:setAbilityLevel(abilityTypeId, 1 + (abilityParameters.level or ability and ability.level or 0))
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
resolveNumberValue(ability, level, abilityParameterValue)
|
|
419
|
-
)
|
|
420
|
-
end
|
|
501
|
+
if abilityParameters.isButtonVisible == false then
|
|
502
|
+
_unit:hideAbility(abilityTypeId, true)
|
|
503
|
+
end
|
|
504
|
+
for ____, field in ipairs(abilityParameters.fields or emptyArray()) do
|
|
505
|
+
field[1]:setValue(
|
|
506
|
+
addedAbility,
|
|
507
|
+
resolveNumberValue(ability, level, field[2])
|
|
508
|
+
)
|
|
421
509
|
end
|
|
422
|
-
abilityTypeIds[
|
|
510
|
+
abilityTypeIds[#abilityTypeIds + 1] = abilityTypeId
|
|
423
511
|
end
|
|
424
512
|
end
|
|
425
513
|
local behaviorConstructors = parameters and parameters.behaviorConstructors or defaultParameters.behaviorConstructors
|
|
@@ -431,18 +519,20 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
431
519
|
self._behaviors = behaviors
|
|
432
520
|
end
|
|
433
521
|
end
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
if
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
522
|
+
if parameters ~= nil then
|
|
523
|
+
local additionalParameters = {}
|
|
524
|
+
for ____, key in ipairs(sortedKeysUnnested(parameters)) do
|
|
525
|
+
if not buffParametersKeys[key] then
|
|
526
|
+
if ability then
|
|
527
|
+
additionalParameters[key] = resolveCurrentAbilityDependentValue(ability, parameters[key])
|
|
528
|
+
else
|
|
529
|
+
additionalParameters[key] = parameters[key]
|
|
530
|
+
end
|
|
441
531
|
end
|
|
442
532
|
end
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
533
|
+
if (next(additionalParameters)) ~= nil then
|
|
534
|
+
self.parameters = additionalParameters
|
|
535
|
+
end
|
|
446
536
|
end
|
|
447
537
|
end
|
|
448
538
|
if duration ~= nil and duration > 0 then
|
|
@@ -450,77 +540,105 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
450
540
|
timer:start(duration, false, expireBuff, self)
|
|
451
541
|
self._timer = timer
|
|
452
542
|
end
|
|
543
|
+
self:onCreate()
|
|
544
|
+
self[100] = 1
|
|
545
|
+
Event.invoke(buffCreatedEvent, self)
|
|
453
546
|
end
|
|
454
|
-
function Buff.prototype.
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
local bonusIdByBonusType = self._bonusIdByBonusType
|
|
461
|
-
if bonusIdByBonusType == nil then
|
|
462
|
-
bonusIdByBonusType = {}
|
|
463
|
-
self._bonusIdByBonusType = bonusIdByBonusType
|
|
547
|
+
function Buff.prototype.onAbilityGained(self, ability)
|
|
548
|
+
if __TS__InstanceOf(ability, UnitAbility) then
|
|
549
|
+
local abilityCooldownModifier = self[149]
|
|
550
|
+
if abilityCooldownModifier then
|
|
551
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:applyModifier(ability, abilityCooldownModifier)
|
|
552
|
+
end
|
|
464
553
|
end
|
|
465
|
-
bonusIdByBonusType[bonusType] = addOrUpdateOrRemoveUnitBonus(self._unit, bonusType, bonusIdByBonusType[bonusType], value)
|
|
466
554
|
end
|
|
467
|
-
function Buff.prototype.
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
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
|
|
479
|
-
else
|
|
480
|
-
____isWidgetProvided_38 = widgetOrDuration
|
|
555
|
+
function Buff.prototype.onAbilityLost(self, ability)
|
|
556
|
+
if __TS__InstanceOf(ability, UnitAbility) then
|
|
557
|
+
local abilityCooldownModifier = self[149]
|
|
558
|
+
if abilityCooldownModifier then
|
|
559
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:removeModifier(ability, abilityCooldownModifier)
|
|
560
|
+
end
|
|
481
561
|
end
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
562
|
+
end
|
|
563
|
+
function Buff.prototype.flashEffect(self, widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
564
|
+
self:flash(
|
|
565
|
+
self[106],
|
|
566
|
+
stringValueByBuffTypeIdByFieldId[fourCC("feft")][self.typeId] or "origin",
|
|
567
|
+
widgetOrXOrParametersOrDuration,
|
|
568
|
+
yOrParametersOrDuration,
|
|
569
|
+
parametersOrDuration
|
|
486
570
|
)
|
|
487
571
|
end
|
|
488
|
-
function Buff.prototype.flashSpecialEffect(self,
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
stringValueByBuffTypeIdByFieldId[fourCC("fspt")][self.typeId] or "origin"
|
|
572
|
+
function Buff.prototype.flashSpecialEffect(self, widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
573
|
+
self:flash(
|
|
574
|
+
self[107],
|
|
575
|
+
stringValueByBuffTypeIdByFieldId[fourCC("fspt")][self.typeId] or "origin",
|
|
576
|
+
widgetOrXOrParametersOrDuration,
|
|
577
|
+
yOrParametersOrDuration,
|
|
578
|
+
parametersOrDuration
|
|
496
579
|
)
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
580
|
+
end
|
|
581
|
+
function Buff.prototype.flash(self, modelPath, attachmentPoint, widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
582
|
+
if type(widgetOrXOrParametersOrDuration) == "number" and type(yOrParametersOrDuration) == "number" then
|
|
583
|
+
Effect:flash(modelPath, widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
500
584
|
else
|
|
501
|
-
|
|
585
|
+
local isWidgetProvided = __TS__InstanceOf(widgetOrXOrParametersOrDuration, Unit) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Item) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Destructable)
|
|
586
|
+
local ____Effect_44 = Effect
|
|
587
|
+
local ____Effect_flash_45 = Effect.flash
|
|
588
|
+
local ____array_43 = __TS__SparseArrayNew(modelPath, isWidgetProvided and widgetOrXOrParametersOrDuration or self._unit, attachmentPoint)
|
|
589
|
+
local ____isWidgetProvided_42
|
|
590
|
+
if isWidgetProvided then
|
|
591
|
+
____isWidgetProvided_42 = yOrParametersOrDuration
|
|
592
|
+
else
|
|
593
|
+
____isWidgetProvided_42 = widgetOrXOrParametersOrDuration
|
|
594
|
+
end
|
|
595
|
+
__TS__SparseArrayPush(____array_43, ____isWidgetProvided_42)
|
|
596
|
+
____Effect_flash_45(
|
|
597
|
+
____Effect_44,
|
|
598
|
+
__TS__SparseArraySpread(____array_43)
|
|
599
|
+
)
|
|
600
|
+
end
|
|
601
|
+
end
|
|
602
|
+
function Buff.prototype.expire(self)
|
|
603
|
+
expireBuff(self)
|
|
604
|
+
end
|
|
605
|
+
function Buff.prototype.dispel(self, source)
|
|
606
|
+
if self.isDestroyed or self[100] ~= 1 then
|
|
607
|
+
return
|
|
608
|
+
end
|
|
609
|
+
self[100] = 2
|
|
610
|
+
do
|
|
611
|
+
pcall(function()
|
|
612
|
+
self:onDispel(source)
|
|
613
|
+
end)
|
|
614
|
+
do
|
|
615
|
+
self:destroy()
|
|
616
|
+
end
|
|
502
617
|
end
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
____Effect_44,
|
|
506
|
-
__TS__SparseArraySpread(____array_43)
|
|
507
|
-
)
|
|
618
|
+
end
|
|
619
|
+
function Buff.prototype.onCreate(self)
|
|
508
620
|
end
|
|
509
621
|
function Buff.prototype.onDestroy(self)
|
|
622
|
+
check(self[100] ~= 0, "Cannot destroy a buff that has not finished creating yet.")
|
|
623
|
+
self[100] = 2
|
|
510
624
|
local unit = self._unit
|
|
625
|
+
local destructionSoundPresetId = self[105]
|
|
626
|
+
if destructionSoundPresetId ~= nil then
|
|
627
|
+
Sound3D:playFromLabel(destructionSoundPresetId, SoundSettings.Ability, unit)
|
|
628
|
+
end
|
|
511
629
|
if getUnitAbility(unit.handle, self.typeId) == self.handle then
|
|
512
630
|
removeBuff(unit.handle, self.typeId)
|
|
513
631
|
end
|
|
514
632
|
buffByTypeIdByUnit[unit][self.typeId] = nil
|
|
515
|
-
local healingIntervalTimer = self[
|
|
633
|
+
local healingIntervalTimer = self[120]
|
|
516
634
|
if healingIntervalTimer ~= nil then
|
|
517
635
|
healingIntervalTimer:destroy()
|
|
518
|
-
self[
|
|
636
|
+
self[120] = nil
|
|
519
637
|
end
|
|
520
|
-
local damageIntervalTimer = self[
|
|
638
|
+
local damageIntervalTimer = self[115]
|
|
521
639
|
if damageIntervalTimer ~= nil then
|
|
522
640
|
damageIntervalTimer:destroy()
|
|
523
|
-
self[
|
|
641
|
+
self[115] = nil
|
|
524
642
|
end
|
|
525
643
|
if self._timer ~= nil then
|
|
526
644
|
self._timer:destroy()
|
|
@@ -530,25 +648,34 @@ function Buff.prototype.onDestroy(self)
|
|
|
530
648
|
behavior:destroy()
|
|
531
649
|
end
|
|
532
650
|
end
|
|
533
|
-
|
|
651
|
+
local previousAbilityCooldownModifier = self[149]
|
|
652
|
+
if previousAbilityCooldownModifier then
|
|
653
|
+
for ____, ability in ipairs(self._unit.abilities) do
|
|
654
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:removeModifier(ability, previousAbilityCooldownModifier)
|
|
655
|
+
end
|
|
656
|
+
end
|
|
657
|
+
if self[144] then
|
|
658
|
+
unit:decrementInvulnerabilityCounter()
|
|
659
|
+
end
|
|
660
|
+
if self[143] then
|
|
534
661
|
unit:decrementDisableAutoAttackCounter()
|
|
535
662
|
end
|
|
536
|
-
if self[
|
|
537
|
-
if self[
|
|
538
|
-
unit:
|
|
663
|
+
if self[141] then
|
|
664
|
+
if self[142] then
|
|
665
|
+
unit:decrementForceStunCounter()
|
|
539
666
|
end
|
|
540
667
|
unit:decrementStunCounter()
|
|
541
668
|
end
|
|
669
|
+
if self[140] then
|
|
670
|
+
unit:decrementGhostCounter()
|
|
671
|
+
end
|
|
542
672
|
if self._abilityTypeIds ~= nil then
|
|
543
|
-
for abilityTypeId in
|
|
673
|
+
for ____, abilityTypeId in ipairs(self._abilityTypeIds) do
|
|
544
674
|
unit:removeAbility(abilityTypeId)
|
|
545
675
|
end
|
|
546
676
|
end
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
removeUnitBonus(unit, bonusType, bonusId)
|
|
550
|
-
end
|
|
551
|
-
end
|
|
677
|
+
Event.invoke(buffBeingDestroyedEvent, self)
|
|
678
|
+
self[100] = 3
|
|
552
679
|
return UnitBehavior.prototype.onDestroy(self)
|
|
553
680
|
end
|
|
554
681
|
function Buff.apply(self, ...)
|
|
@@ -583,44 +710,88 @@ function Buff.getByTypeId(self, unit, typeId)
|
|
|
583
710
|
end
|
|
584
711
|
return nil
|
|
585
712
|
end
|
|
713
|
+
function Buff.prototype.onDispel(self, source)
|
|
714
|
+
end
|
|
715
|
+
function Buff.prototype.onExpiration(self)
|
|
716
|
+
local unit = self.unit
|
|
717
|
+
if self[121] ~= nil then
|
|
718
|
+
(self[102] or unit):damageTarget(unit, self[121] or 0)
|
|
719
|
+
end
|
|
720
|
+
if self[122] ~= nil then
|
|
721
|
+
(self[102] or unit):healTarget(unit, self[121] or 0)
|
|
722
|
+
end
|
|
723
|
+
if self[146] then
|
|
724
|
+
unit:explode()
|
|
725
|
+
elseif self[145] then
|
|
726
|
+
unit:kill()
|
|
727
|
+
end
|
|
728
|
+
end
|
|
586
729
|
function Buff.prototype.onDeath(self, source)
|
|
587
730
|
local unit = self.unit
|
|
588
|
-
if self[
|
|
731
|
+
if self[123] ~= nil then
|
|
589
732
|
damageArea(
|
|
590
|
-
self[
|
|
591
|
-
self[
|
|
733
|
+
self[102] or unit,
|
|
734
|
+
self[123],
|
|
592
735
|
unit.x,
|
|
593
736
|
unit.y,
|
|
594
|
-
self[121] or 0,
|
|
595
|
-
self[120] or 0,
|
|
596
|
-
self[123] or 0,
|
|
597
|
-
self[122] or 0,
|
|
598
737
|
self[125] or 0,
|
|
599
|
-
self[124] or 0
|
|
738
|
+
self[124] or 0,
|
|
739
|
+
self[127] or 0,
|
|
740
|
+
self[126] or 0,
|
|
741
|
+
self[129] or 0,
|
|
742
|
+
self[128] or 0
|
|
600
743
|
)
|
|
601
744
|
end
|
|
602
745
|
end
|
|
603
746
|
function Buff.prototype.onDamageDealt(self, target, event)
|
|
604
747
|
if event.isAttack then
|
|
605
|
-
if self[
|
|
606
|
-
local durationIncrease = self[
|
|
607
|
-
local maximumDuration = self[
|
|
748
|
+
if self[108] ~= nil then
|
|
749
|
+
local durationIncrease = self[108]
|
|
750
|
+
local maximumDuration = self[109] or 0
|
|
608
751
|
if maximumDuration > 0 then
|
|
609
752
|
durationIncrease = min(
|
|
610
753
|
durationIncrease,
|
|
611
|
-
max(0, maximumDuration - self[
|
|
754
|
+
max(0, maximumDuration - self[103])
|
|
612
755
|
)
|
|
613
756
|
end
|
|
614
757
|
local remainingDuration = self.remainingDuration + durationIncrease
|
|
615
|
-
local maximumRemainingDuration = self[
|
|
758
|
+
local maximumRemainingDuration = self[110] or 0
|
|
616
759
|
if maximumRemainingDuration > 0 then
|
|
617
760
|
remainingDuration = min(remainingDuration, maximumRemainingDuration)
|
|
618
761
|
end
|
|
619
762
|
self.remainingDuration = remainingDuration
|
|
620
763
|
end
|
|
621
|
-
local autoAttackCount = (self[
|
|
622
|
-
self[
|
|
623
|
-
if autoAttackCount == self[
|
|
764
|
+
local autoAttackCount = (self[130] or 0) + 1
|
|
765
|
+
self[130] = autoAttackCount
|
|
766
|
+
if autoAttackCount == self[131] then
|
|
767
|
+
self:destroy()
|
|
768
|
+
end
|
|
769
|
+
end
|
|
770
|
+
if event.originalAmount ~= 0 then
|
|
771
|
+
local damageDealtEventCount = (self[132] or 0) + 1
|
|
772
|
+
self[132] = damageDealtEventCount
|
|
773
|
+
if damageDealtEventCount == self[133] then
|
|
774
|
+
self:destroy()
|
|
775
|
+
end
|
|
776
|
+
end
|
|
777
|
+
end
|
|
778
|
+
function Buff.prototype.onDamageReceived(self, source, event)
|
|
779
|
+
if event.originalAmount ~= 0 then
|
|
780
|
+
local absorbedDamage = min(event.amount * (self[136] or 1), (self[137] or 0) - (self[138] or 0))
|
|
781
|
+
if absorbedDamage > 0 then
|
|
782
|
+
event.amount = event.amount - absorbedDamage
|
|
783
|
+
self[138] = (self[138] or 0) + absorbedDamage
|
|
784
|
+
local ____self__139_48 = self[139]
|
|
785
|
+
if ____self__139_48 == nil then
|
|
786
|
+
____self__139_48 = true
|
|
787
|
+
end
|
|
788
|
+
if ____self__139_48 and self[138] >= (self[137] or 0) then
|
|
789
|
+
self:destroy()
|
|
790
|
+
end
|
|
791
|
+
end
|
|
792
|
+
local damageReceivedEventCount = (self[134] or 0) + 1
|
|
793
|
+
self[134] = damageReceivedEventCount
|
|
794
|
+
if damageReceivedEventCount == self[135] then
|
|
624
795
|
self:destroy()
|
|
625
796
|
end
|
|
626
797
|
end
|
|
@@ -630,7 +801,7 @@ __TS__SetDescriptor(
|
|
|
630
801
|
Buff.prototype,
|
|
631
802
|
"source",
|
|
632
803
|
{get = function(self)
|
|
633
|
-
return self[
|
|
804
|
+
return self[102] or self._unit
|
|
634
805
|
end},
|
|
635
806
|
true
|
|
636
807
|
)
|
|
@@ -647,13 +818,13 @@ __TS__SetDescriptor(
|
|
|
647
818
|
"remainingDamageOverDuration",
|
|
648
819
|
{
|
|
649
820
|
get = function(self)
|
|
650
|
-
return self[
|
|
821
|
+
return self[114] or 0
|
|
651
822
|
end,
|
|
652
823
|
set = function(self, remainingDamageOverDuration)
|
|
653
|
-
local remainingDamageOverDurationDelta = remainingDamageOverDuration - (self[
|
|
654
|
-
self[
|
|
655
|
-
local damageOverDuration = (self[
|
|
656
|
-
self[
|
|
824
|
+
local remainingDamageOverDurationDelta = remainingDamageOverDuration - (self[114] or 0)
|
|
825
|
+
self[114] = remainingDamageOverDuration ~= 0 and remainingDamageOverDuration or nil
|
|
826
|
+
local damageOverDuration = (self[111] or 0) + remainingDamageOverDurationDelta
|
|
827
|
+
self[111] = damageOverDuration ~= 0 and damageOverDuration or nil
|
|
657
828
|
end
|
|
658
829
|
},
|
|
659
830
|
true
|
|
@@ -663,13 +834,13 @@ __TS__SetDescriptor(
|
|
|
663
834
|
"damageOverDuration",
|
|
664
835
|
{
|
|
665
836
|
get = function(self)
|
|
666
|
-
return self[
|
|
837
|
+
return self[111] or 0
|
|
667
838
|
end,
|
|
668
839
|
set = function(self, damageOverDuration)
|
|
669
|
-
local damageOverDurationDelta = damageOverDuration - (self[
|
|
670
|
-
self[
|
|
671
|
-
local remainingDamageOverDuration = (self[
|
|
672
|
-
self[
|
|
840
|
+
local damageOverDurationDelta = damageOverDuration - (self[111] or 0)
|
|
841
|
+
self[111] = damageOverDuration ~= 0 and damageOverDuration or nil
|
|
842
|
+
local remainingDamageOverDuration = (self[114] or 0) + damageOverDurationDelta
|
|
843
|
+
self[114] = remainingDamageOverDuration ~= 0 and remainingDamageOverDuration or nil
|
|
673
844
|
end
|
|
674
845
|
},
|
|
675
846
|
true
|
|
@@ -679,10 +850,10 @@ __TS__SetDescriptor(
|
|
|
679
850
|
"damagePerInterval",
|
|
680
851
|
{
|
|
681
852
|
get = function(self)
|
|
682
|
-
return self[
|
|
853
|
+
return self[112] or 0
|
|
683
854
|
end,
|
|
684
855
|
set = function(self, damagePerInterval)
|
|
685
|
-
self[
|
|
856
|
+
self[112] = damagePerInterval ~= 0 and damagePerInterval or nil
|
|
686
857
|
end
|
|
687
858
|
},
|
|
688
859
|
true
|
|
@@ -692,25 +863,25 @@ __TS__SetDescriptor(
|
|
|
692
863
|
"damageInterval",
|
|
693
864
|
{
|
|
694
865
|
get = function(self)
|
|
695
|
-
return self[
|
|
866
|
+
return self[113] or 0
|
|
696
867
|
end,
|
|
697
868
|
set = function(self, damageInterval)
|
|
698
869
|
if damageInterval <= 0 then
|
|
699
|
-
self[
|
|
700
|
-
local timer = self[
|
|
870
|
+
self[113] = damageInterval ~= 0 and damageInterval or nil
|
|
871
|
+
local timer = self[115]
|
|
701
872
|
if timer ~= nil then
|
|
702
873
|
timer:destroy()
|
|
703
|
-
self[
|
|
874
|
+
self[115] = nil
|
|
704
875
|
end
|
|
705
876
|
return
|
|
706
877
|
end
|
|
707
|
-
self[
|
|
708
|
-
local
|
|
709
|
-
local elapsed =
|
|
710
|
-
local timer = self[
|
|
878
|
+
self[113] = damageInterval
|
|
879
|
+
local ____opt_49 = self._timer
|
|
880
|
+
local elapsed = ____opt_49 and ____opt_49.elapsed or 0
|
|
881
|
+
local timer = self[115]
|
|
711
882
|
if timer == nil then
|
|
712
883
|
timer = Timer:create()
|
|
713
|
-
self[
|
|
884
|
+
self[115] = timer
|
|
714
885
|
end
|
|
715
886
|
local initialDelay = damageInterval - (elapsed >= damageInterval and math.fmod(elapsed, damageInterval) or elapsed)
|
|
716
887
|
if initialDelay == damageInterval then
|
|
@@ -727,13 +898,13 @@ __TS__SetDescriptor(
|
|
|
727
898
|
"remainingHealingOverDuration",
|
|
728
899
|
{
|
|
729
900
|
get = function(self)
|
|
730
|
-
return self[
|
|
901
|
+
return self[119] or 0
|
|
731
902
|
end,
|
|
732
903
|
set = function(self, remainingHealingOverDuration)
|
|
733
|
-
local remainingHealingOverDurationDelta = remainingHealingOverDuration - (self[
|
|
734
|
-
self[
|
|
735
|
-
local healingOverDuration = (self[
|
|
736
|
-
self[
|
|
904
|
+
local remainingHealingOverDurationDelta = remainingHealingOverDuration - (self[119] or 0)
|
|
905
|
+
self[114] = remainingHealingOverDuration ~= 0 and remainingHealingOverDuration or nil
|
|
906
|
+
local healingOverDuration = (self[116] or 0) + remainingHealingOverDurationDelta
|
|
907
|
+
self[116] = healingOverDuration ~= 0 and healingOverDuration or nil
|
|
737
908
|
end
|
|
738
909
|
},
|
|
739
910
|
true
|
|
@@ -743,13 +914,13 @@ __TS__SetDescriptor(
|
|
|
743
914
|
"healingOverDuration",
|
|
744
915
|
{
|
|
745
916
|
get = function(self)
|
|
746
|
-
return self[
|
|
917
|
+
return self[116] or 0
|
|
747
918
|
end,
|
|
748
919
|
set = function(self, healingOverDuration)
|
|
749
|
-
local healingOverDurationDelta = healingOverDuration - (self[
|
|
750
|
-
self[
|
|
751
|
-
local remainingHealingOverDuration = (self[
|
|
752
|
-
self[
|
|
920
|
+
local healingOverDurationDelta = healingOverDuration - (self[116] or 0)
|
|
921
|
+
self[116] = healingOverDuration ~= 0 and healingOverDuration or nil
|
|
922
|
+
local remainingHealingOverDuration = (self[119] or 0) + healingOverDurationDelta
|
|
923
|
+
self[119] = remainingHealingOverDuration ~= 0 and remainingHealingOverDuration or nil
|
|
753
924
|
end
|
|
754
925
|
},
|
|
755
926
|
true
|
|
@@ -759,10 +930,10 @@ __TS__SetDescriptor(
|
|
|
759
930
|
"healingPerInterval",
|
|
760
931
|
{
|
|
761
932
|
get = function(self)
|
|
762
|
-
return self[
|
|
933
|
+
return self[117] or 0
|
|
763
934
|
end,
|
|
764
935
|
set = function(self, healingPerInterval)
|
|
765
|
-
self[
|
|
936
|
+
self[117] = healingPerInterval ~= 0 and healingPerInterval or nil
|
|
766
937
|
end
|
|
767
938
|
},
|
|
768
939
|
true
|
|
@@ -772,25 +943,25 @@ __TS__SetDescriptor(
|
|
|
772
943
|
"healingInterval",
|
|
773
944
|
{
|
|
774
945
|
get = function(self)
|
|
775
|
-
return self[
|
|
946
|
+
return self[118] or 0
|
|
776
947
|
end,
|
|
777
948
|
set = function(self, healingInterval)
|
|
778
949
|
if healingInterval <= 0 then
|
|
779
|
-
self[
|
|
780
|
-
local timer = self[
|
|
950
|
+
self[118] = healingInterval ~= 0 and healingInterval or nil
|
|
951
|
+
local timer = self[120]
|
|
781
952
|
if timer ~= nil then
|
|
782
953
|
timer:destroy()
|
|
783
|
-
self[
|
|
954
|
+
self[120] = nil
|
|
784
955
|
end
|
|
785
956
|
return
|
|
786
957
|
end
|
|
787
|
-
self[
|
|
788
|
-
local
|
|
789
|
-
local elapsed =
|
|
790
|
-
local timer = self[
|
|
958
|
+
self[118] = healingInterval
|
|
959
|
+
local ____opt_51 = self._timer
|
|
960
|
+
local elapsed = ____opt_51 and ____opt_51.elapsed or 0
|
|
961
|
+
local timer = self[120]
|
|
791
962
|
if timer == nil then
|
|
792
963
|
timer = Timer:create()
|
|
793
|
-
self[
|
|
964
|
+
self[120] = timer
|
|
794
965
|
end
|
|
795
966
|
local initialDelay = healingInterval - (elapsed >= healingInterval and math.fmod(elapsed, healingInterval) or elapsed)
|
|
796
967
|
if initialDelay == healingInterval then
|
|
@@ -802,6 +973,45 @@ __TS__SetDescriptor(
|
|
|
802
973
|
},
|
|
803
974
|
true
|
|
804
975
|
)
|
|
976
|
+
__TS__SetDescriptor(
|
|
977
|
+
Buff.prototype,
|
|
978
|
+
"damageOnExpiration",
|
|
979
|
+
{
|
|
980
|
+
get = function(self)
|
|
981
|
+
return self[121] or 0
|
|
982
|
+
end,
|
|
983
|
+
set = function(self, damageOnExpiration)
|
|
984
|
+
self[121] = damageOnExpiration ~= 0 and damageOnExpiration or nil
|
|
985
|
+
end
|
|
986
|
+
},
|
|
987
|
+
true
|
|
988
|
+
)
|
|
989
|
+
__TS__SetDescriptor(
|
|
990
|
+
Buff.prototype,
|
|
991
|
+
"healingOnExpiration",
|
|
992
|
+
{
|
|
993
|
+
get = function(self)
|
|
994
|
+
return self[122] or 0
|
|
995
|
+
end,
|
|
996
|
+
set = function(self, healingOnExpiration)
|
|
997
|
+
self[122] = healingOnExpiration ~= 0 and healingOnExpiration or nil
|
|
998
|
+
end
|
|
999
|
+
},
|
|
1000
|
+
true
|
|
1001
|
+
)
|
|
1002
|
+
__TS__SetDescriptor(
|
|
1003
|
+
Buff.prototype,
|
|
1004
|
+
"damageFactor",
|
|
1005
|
+
{
|
|
1006
|
+
get = function(self)
|
|
1007
|
+
return self:getUnitBonus(UnitBonusType.DAMAGE_FACTOR)
|
|
1008
|
+
end,
|
|
1009
|
+
set = function(self, damageFactor)
|
|
1010
|
+
self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.DAMAGE_FACTOR, damageFactor)
|
|
1011
|
+
end
|
|
1012
|
+
},
|
|
1013
|
+
true
|
|
1014
|
+
)
|
|
805
1015
|
__TS__SetDescriptor(
|
|
806
1016
|
Buff.prototype,
|
|
807
1017
|
"receivedDamageFactor",
|
|
@@ -815,6 +1025,19 @@ __TS__SetDescriptor(
|
|
|
815
1025
|
},
|
|
816
1026
|
true
|
|
817
1027
|
)
|
|
1028
|
+
__TS__SetDescriptor(
|
|
1029
|
+
Buff.prototype,
|
|
1030
|
+
"returnedMeleeDamageFactor",
|
|
1031
|
+
{
|
|
1032
|
+
get = function(self)
|
|
1033
|
+
return self:getUnitBonus(UnitBonusType.RETURNED_MELEE_DAMAGE_FACTOR)
|
|
1034
|
+
end,
|
|
1035
|
+
set = function(self, returnedMeleeDamageFactor)
|
|
1036
|
+
self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.RETURNED_MELEE_DAMAGE_FACTOR, returnedMeleeDamageFactor)
|
|
1037
|
+
end
|
|
1038
|
+
},
|
|
1039
|
+
true
|
|
1040
|
+
)
|
|
818
1041
|
__TS__SetDescriptor(
|
|
819
1042
|
Buff.prototype,
|
|
820
1043
|
"armorIncrease",
|
|
@@ -828,30 +1051,79 @@ __TS__SetDescriptor(
|
|
|
828
1051
|
},
|
|
829
1052
|
true
|
|
830
1053
|
)
|
|
1054
|
+
__TS__SetDescriptor(
|
|
1055
|
+
Buff.prototype,
|
|
1056
|
+
"maxHealthIncrease",
|
|
1057
|
+
{
|
|
1058
|
+
get = function(self)
|
|
1059
|
+
return self:getUnitBonus(UnitBonusType.HEALTH)
|
|
1060
|
+
end,
|
|
1061
|
+
set = function(self, maxHealthIncrease)
|
|
1062
|
+
self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.HEALTH, maxHealthIncrease)
|
|
1063
|
+
end
|
|
1064
|
+
},
|
|
1065
|
+
true
|
|
1066
|
+
)
|
|
1067
|
+
__TS__SetDescriptor(
|
|
1068
|
+
Buff.prototype,
|
|
1069
|
+
"maxManaIncrease",
|
|
1070
|
+
{
|
|
1071
|
+
get = function(self)
|
|
1072
|
+
return self:getUnitBonus(UnitBonusType.MANA)
|
|
1073
|
+
end,
|
|
1074
|
+
set = function(self, maxManaIncrease)
|
|
1075
|
+
self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.MANA, maxManaIncrease)
|
|
1076
|
+
end
|
|
1077
|
+
},
|
|
1078
|
+
true
|
|
1079
|
+
)
|
|
1080
|
+
__TS__SetDescriptor(
|
|
1081
|
+
Buff.prototype,
|
|
1082
|
+
"turnsIntoGhost",
|
|
1083
|
+
{
|
|
1084
|
+
get = function(self)
|
|
1085
|
+
local ____self__140_53 = self[140]
|
|
1086
|
+
if ____self__140_53 == nil then
|
|
1087
|
+
____self__140_53 = false
|
|
1088
|
+
end
|
|
1089
|
+
return ____self__140_53
|
|
1090
|
+
end,
|
|
1091
|
+
set = function(self, turnsIntoGhost)
|
|
1092
|
+
if not turnsIntoGhost and self[140] then
|
|
1093
|
+
self.object:decrementGhostCounter()
|
|
1094
|
+
self[140] = nil
|
|
1095
|
+
elseif turnsIntoGhost and not self[140] then
|
|
1096
|
+
self.object:incrementGhostCounter()
|
|
1097
|
+
self[140] = true
|
|
1098
|
+
end
|
|
1099
|
+
end
|
|
1100
|
+
},
|
|
1101
|
+
true
|
|
1102
|
+
)
|
|
831
1103
|
__TS__SetDescriptor(
|
|
832
1104
|
Buff.prototype,
|
|
833
1105
|
"stuns",
|
|
834
1106
|
{
|
|
835
1107
|
get = function(self)
|
|
836
|
-
local
|
|
837
|
-
if
|
|
838
|
-
|
|
1108
|
+
local ____self__141_54 = self[141]
|
|
1109
|
+
if ____self__141_54 == nil then
|
|
1110
|
+
____self__141_54 = false
|
|
839
1111
|
end
|
|
840
|
-
return
|
|
1112
|
+
return ____self__141_54
|
|
841
1113
|
end,
|
|
842
1114
|
set = function(self, stuns)
|
|
843
|
-
if not stuns and self[
|
|
844
|
-
if self[
|
|
845
|
-
self.object:
|
|
1115
|
+
if not stuns and self[141] then
|
|
1116
|
+
if self[142] then
|
|
1117
|
+
self.object:decrementForceStunCounter()
|
|
846
1118
|
end
|
|
847
1119
|
self.object:decrementStunCounter()
|
|
848
|
-
self[
|
|
849
|
-
elseif stuns and not self[
|
|
850
|
-
if self[
|
|
851
|
-
self.object:
|
|
1120
|
+
self[141] = nil
|
|
1121
|
+
elseif stuns and not self[141] then
|
|
1122
|
+
if self[142] then
|
|
1123
|
+
self.object:incrementForceStunCounter()
|
|
852
1124
|
end
|
|
853
1125
|
self.object:incrementStunCounter()
|
|
854
|
-
self[
|
|
1126
|
+
self[141] = true
|
|
855
1127
|
end
|
|
856
1128
|
end
|
|
857
1129
|
},
|
|
@@ -862,23 +1134,23 @@ __TS__SetDescriptor(
|
|
|
862
1134
|
"ignoresStunImmunity",
|
|
863
1135
|
{
|
|
864
1136
|
get = function(self)
|
|
865
|
-
local
|
|
866
|
-
if
|
|
867
|
-
|
|
1137
|
+
local ____self__142_55 = self[142]
|
|
1138
|
+
if ____self__142_55 == nil then
|
|
1139
|
+
____self__142_55 = false
|
|
868
1140
|
end
|
|
869
|
-
return
|
|
1141
|
+
return ____self__142_55
|
|
870
1142
|
end,
|
|
871
1143
|
set = function(self, ignoresStunImmunity)
|
|
872
|
-
if not ignoresStunImmunity and self[
|
|
873
|
-
if self[
|
|
874
|
-
self.object:
|
|
1144
|
+
if not ignoresStunImmunity and self[142] then
|
|
1145
|
+
if self[141] then
|
|
1146
|
+
self.object:decrementForceStunCounter()
|
|
875
1147
|
end
|
|
876
|
-
self[
|
|
877
|
-
elseif ignoresStunImmunity and not self[
|
|
878
|
-
if self[
|
|
879
|
-
self.object:
|
|
1148
|
+
self[142] = nil
|
|
1149
|
+
elseif ignoresStunImmunity and not self[142] then
|
|
1150
|
+
if self[141] then
|
|
1151
|
+
self.object:incrementForceStunCounter()
|
|
880
1152
|
end
|
|
881
|
-
self[
|
|
1153
|
+
self[142] = true
|
|
882
1154
|
end
|
|
883
1155
|
end
|
|
884
1156
|
},
|
|
@@ -889,19 +1161,19 @@ __TS__SetDescriptor(
|
|
|
889
1161
|
"disablesAutoAttack",
|
|
890
1162
|
{
|
|
891
1163
|
get = function(self)
|
|
892
|
-
local
|
|
893
|
-
if
|
|
894
|
-
|
|
1164
|
+
local ____self__143_56 = self[143]
|
|
1165
|
+
if ____self__143_56 == nil then
|
|
1166
|
+
____self__143_56 = false
|
|
895
1167
|
end
|
|
896
|
-
return
|
|
1168
|
+
return ____self__143_56
|
|
897
1169
|
end,
|
|
898
1170
|
set = function(self, disablesAutoAttack)
|
|
899
|
-
if not disablesAutoAttack and self[
|
|
1171
|
+
if not disablesAutoAttack and self[143] then
|
|
900
1172
|
self.object:decrementDisableAutoAttackCounter()
|
|
901
|
-
self[
|
|
902
|
-
elseif disablesAutoAttack and not self[
|
|
1173
|
+
self[143] = nil
|
|
1174
|
+
elseif disablesAutoAttack and not self[143] then
|
|
903
1175
|
self.object:incrementDisableAutoAttackCounter()
|
|
904
|
-
self[
|
|
1176
|
+
self[143] = true
|
|
905
1177
|
end
|
|
906
1178
|
end
|
|
907
1179
|
},
|
|
@@ -912,19 +1184,95 @@ __TS__SetDescriptor(
|
|
|
912
1184
|
"providesInvulnerability",
|
|
913
1185
|
{
|
|
914
1186
|
get = function(self)
|
|
915
|
-
local
|
|
916
|
-
if
|
|
917
|
-
|
|
1187
|
+
local ____self__144_57 = self[144]
|
|
1188
|
+
if ____self__144_57 == nil then
|
|
1189
|
+
____self__144_57 = false
|
|
918
1190
|
end
|
|
919
|
-
return
|
|
1191
|
+
return ____self__144_57
|
|
920
1192
|
end,
|
|
921
1193
|
set = function(self, providesInvulnerability)
|
|
922
|
-
if not providesInvulnerability and self[
|
|
1194
|
+
if not providesInvulnerability and self[144] then
|
|
923
1195
|
self.object:decrementInvulnerabilityCounter()
|
|
924
|
-
self[
|
|
925
|
-
elseif providesInvulnerability and not self[
|
|
1196
|
+
self[144] = nil
|
|
1197
|
+
elseif providesInvulnerability and not self[144] then
|
|
926
1198
|
self.object:incrementInvulnerabilityCounter()
|
|
927
|
-
self[
|
|
1199
|
+
self[144] = true
|
|
1200
|
+
end
|
|
1201
|
+
end
|
|
1202
|
+
},
|
|
1203
|
+
true
|
|
1204
|
+
)
|
|
1205
|
+
__TS__SetDescriptor(
|
|
1206
|
+
Buff.prototype,
|
|
1207
|
+
"killsOnExpiration",
|
|
1208
|
+
{
|
|
1209
|
+
get = function(self)
|
|
1210
|
+
local ____self__145_58 = self[145]
|
|
1211
|
+
if ____self__145_58 == nil then
|
|
1212
|
+
____self__145_58 = false
|
|
1213
|
+
end
|
|
1214
|
+
return ____self__145_58
|
|
1215
|
+
end,
|
|
1216
|
+
set = function(self, killsOnExpiration)
|
|
1217
|
+
if not killsOnExpiration and self[145] then
|
|
1218
|
+
self[145] = nil
|
|
1219
|
+
elseif killsOnExpiration and not self[145] then
|
|
1220
|
+
self[145] = true
|
|
1221
|
+
end
|
|
1222
|
+
end
|
|
1223
|
+
},
|
|
1224
|
+
true
|
|
1225
|
+
)
|
|
1226
|
+
__TS__SetDescriptor(
|
|
1227
|
+
Buff.prototype,
|
|
1228
|
+
"explodesOnExpiration",
|
|
1229
|
+
{
|
|
1230
|
+
get = function(self)
|
|
1231
|
+
local ____self__146_59 = self[146]
|
|
1232
|
+
if ____self__146_59 == nil then
|
|
1233
|
+
____self__146_59 = false
|
|
1234
|
+
end
|
|
1235
|
+
return ____self__146_59
|
|
1236
|
+
end,
|
|
1237
|
+
set = function(self, killsOnExpiration)
|
|
1238
|
+
if not killsOnExpiration and self[146] then
|
|
1239
|
+
self[146] = nil
|
|
1240
|
+
elseif killsOnExpiration and not self[146] then
|
|
1241
|
+
self[146] = true
|
|
1242
|
+
end
|
|
1243
|
+
end
|
|
1244
|
+
},
|
|
1245
|
+
true
|
|
1246
|
+
)
|
|
1247
|
+
__TS__SetDescriptor(
|
|
1248
|
+
Buff.prototype,
|
|
1249
|
+
"maximumDamageDealtEventCount",
|
|
1250
|
+
{
|
|
1251
|
+
get = function(self)
|
|
1252
|
+
return self[133] or 0
|
|
1253
|
+
end,
|
|
1254
|
+
set = function(self, maximumDamageDealtEventCount)
|
|
1255
|
+
if maximumDamageDealtEventCount == 0 then
|
|
1256
|
+
self[133] = nil
|
|
1257
|
+
else
|
|
1258
|
+
self[133] = maximumDamageDealtEventCount
|
|
1259
|
+
end
|
|
1260
|
+
end
|
|
1261
|
+
},
|
|
1262
|
+
true
|
|
1263
|
+
)
|
|
1264
|
+
__TS__SetDescriptor(
|
|
1265
|
+
Buff.prototype,
|
|
1266
|
+
"maximumDamageReceivedEventCount",
|
|
1267
|
+
{
|
|
1268
|
+
get = function(self)
|
|
1269
|
+
return self[135] or 0
|
|
1270
|
+
end,
|
|
1271
|
+
set = function(self, maximumDamageReceivedEventCount)
|
|
1272
|
+
if maximumDamageReceivedEventCount == 0 then
|
|
1273
|
+
self[135] = nil
|
|
1274
|
+
else
|
|
1275
|
+
self[135] = maximumDamageReceivedEventCount
|
|
928
1276
|
end
|
|
929
1277
|
end
|
|
930
1278
|
},
|
|
@@ -935,13 +1283,13 @@ __TS__SetDescriptor(
|
|
|
935
1283
|
"maximumAutoAttackCount",
|
|
936
1284
|
{
|
|
937
1285
|
get = function(self)
|
|
938
|
-
return self[
|
|
1286
|
+
return self[131] or 0
|
|
939
1287
|
end,
|
|
940
1288
|
set = function(self, maximumAutoAttackCount)
|
|
941
1289
|
if maximumAutoAttackCount == 0 then
|
|
942
|
-
self[
|
|
1290
|
+
self[131] = nil
|
|
943
1291
|
else
|
|
944
|
-
self[
|
|
1292
|
+
self[131] = maximumAutoAttackCount
|
|
945
1293
|
end
|
|
946
1294
|
end
|
|
947
1295
|
},
|
|
@@ -952,10 +1300,10 @@ __TS__SetDescriptor(
|
|
|
952
1300
|
"durationIncreaseOnAutoAttack",
|
|
953
1301
|
{
|
|
954
1302
|
get = function(self)
|
|
955
|
-
return self[
|
|
1303
|
+
return self[108] or 0
|
|
956
1304
|
end,
|
|
957
1305
|
set = function(self, durationIncreaseOnAutoAttack)
|
|
958
|
-
self[
|
|
1306
|
+
self[108] = durationIncreaseOnAutoAttack
|
|
959
1307
|
end
|
|
960
1308
|
},
|
|
961
1309
|
true
|
|
@@ -986,12 +1334,52 @@ __TS__SetDescriptor(
|
|
|
986
1334
|
},
|
|
987
1335
|
true
|
|
988
1336
|
)
|
|
1337
|
+
__TS__SetDescriptor(
|
|
1338
|
+
Buff.prototype,
|
|
1339
|
+
"evasionProbability",
|
|
1340
|
+
{
|
|
1341
|
+
get = function(self)
|
|
1342
|
+
return self:getUnitBonus(UnitBonusType.EVASION_PROBABILITY)
|
|
1343
|
+
end,
|
|
1344
|
+
set = function(self, evasionProbability)
|
|
1345
|
+
self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.EVASION_PROBABILITY, evasionProbability)
|
|
1346
|
+
end
|
|
1347
|
+
},
|
|
1348
|
+
true
|
|
1349
|
+
)
|
|
1350
|
+
__TS__SetDescriptor(
|
|
1351
|
+
Buff.prototype,
|
|
1352
|
+
"manaRegenerationRateIncreaseFactor",
|
|
1353
|
+
{
|
|
1354
|
+
get = function(self)
|
|
1355
|
+
return self:getUnitBonus(UnitBonusType.MANA_REGENERATION_RATE_FACTOR)
|
|
1356
|
+
end,
|
|
1357
|
+
set = function(self, manaRegenerationRateIncreaseFactor)
|
|
1358
|
+
self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.MANA_REGENERATION_RATE_FACTOR, manaRegenerationRateIncreaseFactor)
|
|
1359
|
+
end
|
|
1360
|
+
},
|
|
1361
|
+
true
|
|
1362
|
+
)
|
|
989
1363
|
__TS__SetDescriptor(
|
|
990
1364
|
Buff.prototype,
|
|
991
1365
|
"duration",
|
|
992
|
-
{
|
|
993
|
-
|
|
994
|
-
|
|
1366
|
+
{
|
|
1367
|
+
get = function(self)
|
|
1368
|
+
return self[103]
|
|
1369
|
+
end,
|
|
1370
|
+
set = function(self, duration)
|
|
1371
|
+
if duration <= 0 then
|
|
1372
|
+
local timer = self._timer
|
|
1373
|
+
if timer ~= nil then
|
|
1374
|
+
timer:destroy()
|
|
1375
|
+
self._timer = nil
|
|
1376
|
+
end
|
|
1377
|
+
self[103] = 0
|
|
1378
|
+
else
|
|
1379
|
+
self.remainingDuration = self.remainingDuration + (duration - self[103])
|
|
1380
|
+
end
|
|
1381
|
+
end
|
|
1382
|
+
},
|
|
995
1383
|
true
|
|
996
1384
|
)
|
|
997
1385
|
__TS__SetDescriptor(
|
|
@@ -999,15 +1387,15 @@ __TS__SetDescriptor(
|
|
|
999
1387
|
"remainingDuration",
|
|
1000
1388
|
{
|
|
1001
1389
|
get = function(self)
|
|
1002
|
-
local
|
|
1003
|
-
return
|
|
1390
|
+
local ____opt_60 = self._timer
|
|
1391
|
+
return ____opt_60 and ____opt_60.remaining or 0
|
|
1004
1392
|
end,
|
|
1005
1393
|
set = function(self, remainingDuration)
|
|
1006
|
-
local
|
|
1007
|
-
local
|
|
1008
|
-
local remainingDurationDelta =
|
|
1394
|
+
local ____remainingDuration_64 = remainingDuration
|
|
1395
|
+
local ____opt_62 = self._timer
|
|
1396
|
+
local remainingDurationDelta = ____remainingDuration_64 - (____opt_62 and ____opt_62.remaining or 0)
|
|
1009
1397
|
if remainingDurationDelta ~= 0 then
|
|
1010
|
-
self[
|
|
1398
|
+
self[103] = self[103] + remainingDurationDelta
|
|
1011
1399
|
if remainingDuration <= 0 then
|
|
1012
1400
|
Timer:run(destroyBuff, self)
|
|
1013
1401
|
else
|
|
@@ -1019,7 +1407,8 @@ __TS__SetDescriptor(
|
|
|
1019
1407
|
self._level,
|
|
1020
1408
|
remainingDuration,
|
|
1021
1409
|
self._spellStealPriority,
|
|
1022
|
-
self._learnLevelMinimum
|
|
1410
|
+
self._learnLevelMinimum,
|
|
1411
|
+
self[147]
|
|
1023
1412
|
) then
|
|
1024
1413
|
local timer = self._timer
|
|
1025
1414
|
if timer == nil then
|
|
@@ -1033,39 +1422,135 @@ __TS__SetDescriptor(
|
|
|
1033
1422
|
end
|
|
1034
1423
|
},
|
|
1035
1424
|
true
|
|
1036
|
-
)
|
|
1425
|
+
)
|
|
1426
|
+
__TS__SetDescriptor(
|
|
1427
|
+
Buff.prototype,
|
|
1428
|
+
"absorbedDamageFactor",
|
|
1429
|
+
{
|
|
1430
|
+
get = function(self)
|
|
1431
|
+
return self[136] or 1
|
|
1432
|
+
end,
|
|
1433
|
+
set = function(self, absorbedDamageFactor)
|
|
1434
|
+
if absorbedDamageFactor == 1 then
|
|
1435
|
+
self[136] = nil
|
|
1436
|
+
else
|
|
1437
|
+
self[136] = absorbedDamageFactor
|
|
1438
|
+
end
|
|
1439
|
+
end
|
|
1440
|
+
},
|
|
1441
|
+
true
|
|
1442
|
+
)
|
|
1443
|
+
__TS__SetDescriptor(
|
|
1444
|
+
Buff.prototype,
|
|
1445
|
+
"maximumDamageAbsorbed",
|
|
1446
|
+
{
|
|
1447
|
+
get = function(self)
|
|
1448
|
+
return self[137] or 0
|
|
1449
|
+
end,
|
|
1450
|
+
set = function(self, maximumDamageAbsorbed)
|
|
1451
|
+
if maximumDamageAbsorbed == 0 then
|
|
1452
|
+
self[137] = nil
|
|
1453
|
+
else
|
|
1454
|
+
self[137] = maximumDamageAbsorbed
|
|
1455
|
+
end
|
|
1456
|
+
end
|
|
1457
|
+
},
|
|
1458
|
+
true
|
|
1459
|
+
)
|
|
1460
|
+
__TS__SetDescriptor(
|
|
1461
|
+
Buff.prototype,
|
|
1462
|
+
"damageAbsorbed",
|
|
1463
|
+
{get = function(self)
|
|
1464
|
+
return self[138] or 0
|
|
1465
|
+
end},
|
|
1466
|
+
true
|
|
1467
|
+
)
|
|
1468
|
+
__TS__SetDescriptor(
|
|
1469
|
+
Buff.prototype,
|
|
1470
|
+
"destroysOnMaximumDamageAbsorbed",
|
|
1471
|
+
{
|
|
1472
|
+
get = function(self)
|
|
1473
|
+
local ____self__139_65 = self[139]
|
|
1474
|
+
if ____self__139_65 == nil then
|
|
1475
|
+
____self__139_65 = true
|
|
1476
|
+
end
|
|
1477
|
+
return ____self__139_65
|
|
1478
|
+
end,
|
|
1479
|
+
set = function(self, destroysOnMaximumDamageAbsorbed)
|
|
1480
|
+
local ____destroysOnMaximumDamageAbsorbed_66
|
|
1481
|
+
if destroysOnMaximumDamageAbsorbed then
|
|
1482
|
+
____destroysOnMaximumDamageAbsorbed_66 = nil
|
|
1483
|
+
else
|
|
1484
|
+
____destroysOnMaximumDamageAbsorbed_66 = false
|
|
1485
|
+
end
|
|
1486
|
+
self[139] = ____destroysOnMaximumDamageAbsorbed_66
|
|
1487
|
+
end
|
|
1488
|
+
},
|
|
1489
|
+
true
|
|
1490
|
+
)
|
|
1491
|
+
__TS__SetDescriptor(
|
|
1492
|
+
Buff.prototype,
|
|
1493
|
+
"abilityCooldownFactor",
|
|
1494
|
+
{
|
|
1495
|
+
get = function(self)
|
|
1496
|
+
return self[148] or 1
|
|
1497
|
+
end,
|
|
1498
|
+
set = function(self, abilityCooldownFactor)
|
|
1499
|
+
local previousAbilityCooldownModifier = self[149]
|
|
1500
|
+
if previousAbilityCooldownModifier then
|
|
1501
|
+
for ____, ability in ipairs(self._unit.abilities) do
|
|
1502
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:removeModifier(ability, previousAbilityCooldownModifier)
|
|
1503
|
+
end
|
|
1504
|
+
end
|
|
1505
|
+
local function modifier(ability, level, cooldown)
|
|
1506
|
+
return cooldown * abilityCooldownFactor
|
|
1507
|
+
end
|
|
1508
|
+
for ____, ability in ipairs(self._unit.abilities) do
|
|
1509
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:applyModifier(ability, modifier)
|
|
1510
|
+
end
|
|
1511
|
+
self[149] = modifier
|
|
1512
|
+
self[148] = abilityCooldownFactor
|
|
1513
|
+
end
|
|
1514
|
+
},
|
|
1515
|
+
true
|
|
1516
|
+
)
|
|
1517
|
+
Buff.createdEvent = buffCreatedEvent
|
|
1518
|
+
Buff.beingDestroyedEvent = buffBeingDestroyedEvent;
|
|
1037
1519
|
(function(self)
|
|
1038
|
-
|
|
1039
|
-
local
|
|
1040
|
-
if
|
|
1041
|
-
|
|
1042
|
-
|
|
1520
|
+
local function destroyBuffIfNeeded(buff, isDispel, source)
|
|
1521
|
+
local currentHandle = getUnitAbility(buff[101].handle, buff.typeId)
|
|
1522
|
+
if currentHandle ~= buff.handle and buff[100] == 1 then
|
|
1523
|
+
if isDispel and currentHandle == nil and buff.unit.isAlive and buff.resistanceType == 1 and (buff._timer == nil or buff.remainingDuration > 0) then
|
|
1524
|
+
buff:dispel(source)
|
|
1525
|
+
else
|
|
1043
1526
|
buff:destroy()
|
|
1044
1527
|
end
|
|
1045
1528
|
end
|
|
1046
1529
|
end
|
|
1047
|
-
____exports.
|
|
1530
|
+
____exports.checkBuff = function(unit, buffTypeId, isDispel, source)
|
|
1048
1531
|
local buffByTypeId = buffByTypeIdByUnit[unit]
|
|
1049
1532
|
if buffByTypeId ~= nil then
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
end
|
|
1533
|
+
local buff = buffByTypeId[buffTypeId]
|
|
1534
|
+
if buff ~= nil then
|
|
1535
|
+
destroyBuffIfNeeded(buff, isDispel, source)
|
|
1054
1536
|
end
|
|
1055
1537
|
end
|
|
1056
1538
|
end
|
|
1539
|
+
____exports.checkBuffs = function(unit, isDispel, source)
|
|
1540
|
+
____exports.Buff:forAll(unit, destroyBuffIfNeeded, isDispel, source)
|
|
1541
|
+
end
|
|
1057
1542
|
Unit.abilityChannelingStartEvent:addListener(
|
|
1058
1543
|
0,
|
|
1059
1544
|
function(caster)
|
|
1060
|
-
____exports.checkBuffs(caster)
|
|
1061
|
-
Timer:run(____exports.checkBuffs, caster)
|
|
1545
|
+
____exports.checkBuffs(caster, true, caster)
|
|
1546
|
+
Timer:run(____exports.checkBuffs, caster, true, caster)
|
|
1062
1547
|
end
|
|
1063
1548
|
)
|
|
1064
1549
|
Unit.abilityUnitTargetChannelingStartEvent:addListener(
|
|
1065
1550
|
0,
|
|
1066
1551
|
function(caster, ability, target)
|
|
1067
|
-
____exports.checkBuffs(target)
|
|
1068
|
-
Timer:run(____exports.checkBuffs, target)
|
|
1552
|
+
____exports.checkBuffs(target, true, caster)
|
|
1553
|
+
Timer:run(____exports.checkBuffs, target, true, caster)
|
|
1069
1554
|
end
|
|
1070
1555
|
)
|
|
1071
1556
|
Unit.abilityPointTargetChannelingStartEvent:addListener(
|
|
@@ -1076,18 +1561,47 @@ __TS__SetDescriptor(
|
|
|
1076
1561
|
y,
|
|
1077
1562
|
ability:getField(ABILITY_RLF_AREA_OF_EFFECT)
|
|
1078
1563
|
)
|
|
1079
|
-
forEach(units, ____exports.checkBuffs)
|
|
1080
|
-
Timer:run(
|
|
1564
|
+
forEach(units, ____exports.checkBuffs, true, caster)
|
|
1565
|
+
Timer:run(
|
|
1566
|
+
forEach,
|
|
1567
|
+
units,
|
|
1568
|
+
____exports.checkBuffs,
|
|
1569
|
+
true,
|
|
1570
|
+
caster
|
|
1571
|
+
)
|
|
1572
|
+
end
|
|
1573
|
+
)
|
|
1574
|
+
Unit.abilityNoTargetChannelingStartEvent:addListener(
|
|
1575
|
+
0,
|
|
1576
|
+
function(caster, ability)
|
|
1577
|
+
local radius = ability:getField(ABILITY_RLF_AREA_OF_EFFECT)
|
|
1578
|
+
if radius > 0 then
|
|
1579
|
+
local units = Unit:getInCollisionRange(caster.x, caster.y, radius)
|
|
1580
|
+
forEach(units, ____exports.checkBuffs, true, caster)
|
|
1581
|
+
Timer:run(
|
|
1582
|
+
forEach,
|
|
1583
|
+
units,
|
|
1584
|
+
____exports.checkBuffs,
|
|
1585
|
+
true,
|
|
1586
|
+
caster
|
|
1587
|
+
)
|
|
1588
|
+
end
|
|
1081
1589
|
end
|
|
1082
1590
|
)
|
|
1083
1591
|
Unit.onDamage:addListener(
|
|
1084
1592
|
0,
|
|
1085
1593
|
function(source, target)
|
|
1086
1594
|
if source ~= nil then
|
|
1087
|
-
____exports.checkBuffs
|
|
1595
|
+
Timer:run(____exports.checkBuffs, source, false)
|
|
1088
1596
|
end
|
|
1089
|
-
____exports.checkBuffs
|
|
1597
|
+
Timer:run(____exports.checkBuffs, target, false)
|
|
1090
1598
|
end
|
|
1091
1599
|
)
|
|
1600
|
+
buffCreatedEvent:addListener(function(buff)
|
|
1601
|
+
UnitBehavior:forAll(buff.unit, "onBuffGained", buff)
|
|
1602
|
+
end)
|
|
1603
|
+
buffBeingDestroyedEvent:addListener(function(buff)
|
|
1604
|
+
UnitBehavior:forAll(buff.unit, "onBuffLost", buff)
|
|
1605
|
+
end)
|
|
1092
1606
|
end)(Buff)
|
|
1093
1607
|
return ____exports
|