warscript 0.0.1-dev.29630c5 → 0.0.1-dev.29e90d8
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 +6 -0
- package/attributes.lua +17 -1
- package/config.d.ts +5 -0
- package/config.lua +10 -0
- package/core/dummy.lua +4 -2
- package/core/types/effect.d.ts +12 -4
- package/core/types/effect.lua +67 -104
- package/core/types/frame.d.ts +21 -2
- package/core/types/frame.lua +165 -87
- package/core/types/handle.lua +9 -9
- package/core/types/item.d.ts +1 -0
- package/core/types/item.lua +1 -0
- package/core/types/missile.lua +6 -11
- 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 +5 -0
- package/core/util.d.ts +3 -1
- package/core/util.lua +115 -4
- package/decl/native.d.ts +1719 -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/behavior.d.ts +14 -1
- package/engine/behavior.lua +230 -70
- package/engine/behaviour/ability/apply-buff.d.ts +5 -0
- package/engine/behaviour/ability/apply-buff.lua +36 -4
- package/engine/behaviour/ability/apply-unit-behavior.lua +6 -0
- package/engine/behaviour/ability/damage.d.ts +15 -4
- package/engine/behaviour/ability/damage.lua +41 -49
- package/engine/behaviour/ability/emulate-impact.d.ts +15 -1
- package/engine/behaviour/ability/emulate-impact.lua +96 -7
- package/engine/behaviour/ability/instant-impact.d.ts +12 -1
- package/engine/behaviour/ability/instant-impact.lua +17 -2
- package/engine/behaviour/ability/on-command-impact.d.ts +1 -0
- package/engine/behaviour/ability/on-command-impact.lua +1 -0
- package/engine/behaviour/ability/remove-buffs.d.ts +9 -0
- package/engine/behaviour/ability/remove-buffs.lua +21 -0
- package/engine/behaviour/ability/restore-mana.d.ts +1 -1
- package/engine/behaviour/ability/restore-mana.lua +6 -6
- package/engine/behaviour/ability.d.ts +23 -6
- package/engine/behaviour/ability.lua +151 -32
- package/engine/behaviour/unit/stun-immunity.d.ts +12 -6
- package/engine/behaviour/unit/stun-immunity.lua +57 -31
- package/engine/behaviour/unit.d.ts +41 -2
- package/engine/behaviour/unit.lua +270 -6
- package/engine/buff.d.ts +139 -59
- package/engine/buff.lua +678 -308
- package/engine/index.d.ts +2 -1
- package/engine/internal/ability.d.ts +14 -1
- package/engine/internal/ability.lua +113 -44
- package/engine/internal/item/ability.lua +63 -11
- 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.lua +1 -1
- package/engine/internal/mechanics/cast-ability.lua +6 -3
- 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/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 +35 -0
- package/engine/internal/unit/ability.lua +114 -9
- package/engine/internal/unit/add-item-to-slot-init.lua +3 -14
- package/engine/internal/unit/add-item-to-slot.lua +57 -14
- 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 +17 -0
- package/engine/internal/unit/bonus.lua +113 -8
- package/engine/internal/unit/buff.d.ts +2 -2
- package/engine/internal/unit/buff.lua +34 -19
- 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.lua +10 -1
- package/engine/internal/unit/interrupts.d.ts +12 -0
- package/engine/internal/unit/interrupts.lua +28 -0
- package/engine/internal/unit/{item.d.ts → inventory.d.ts} +7 -3
- 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.lua +12 -27
- 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/shared-vision-counter.d.ts +18 -0
- package/engine/internal/unit/shared-vision-counter.lua +31 -0
- package/engine/internal/unit+ability.d.ts +2 -1
- package/engine/internal/unit+ability.lua +83 -3
- package/engine/internal/unit+bonus.lua +3 -3
- package/engine/internal/unit+damage.d.ts +12 -38
- package/engine/internal/unit+damage.lua +48 -45
- package/engine/internal/unit+rally.lua +9 -31
- package/engine/internal/unit+spellSteal.lua +1 -2
- package/engine/internal/unit-missile-data.lua +96 -68
- package/engine/internal/unit-missile-launch.lua +69 -27
- package/engine/internal/unit.d.ts +51 -35
- package/engine/internal/unit.lua +434 -326
- package/engine/lightning.d.ts +4 -3
- package/engine/lightning.lua +25 -16
- package/engine/local-client.d.ts +28 -0
- package/engine/local-client.lua +324 -54
- 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 -2
- 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/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-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/auxiliary/weapon-sound-type.d.ts +20 -14
- package/engine/object-data/auxiliary/weapon-sound-type.lua +58 -0
- package/engine/object-data/auxiliary/weapon-type.d.ts +25 -0
- package/engine/object-data/auxiliary/weapon-type.lua +2 -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/barrage.d.ts +12 -0
- package/engine/object-data/entry/ability-type/barrage.lua +52 -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.lua +14 -3
- 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 -0
- package/engine/object-data/entry/ability-type/blank-passive.lua +27 -7
- 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 +2 -2
- package/engine/object-data/entry/ability-type/channel.lua +3 -3
- 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/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/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 +50 -21
- package/engine/object-data/entry/ability-type.lua +384 -35
- package/engine/object-data/entry/buff-type/applicable.lua +131 -139
- package/engine/object-data/entry/buff-type.d.ts +10 -12
- package/engine/object-data/entry/buff-type.lua +39 -29
- package/engine/object-data/entry/destructible-type.d.ts +32 -2
- package/engine/object-data/entry/destructible-type.lua +181 -0
- package/engine/object-data/entry/item-type.d.ts +18 -3
- package/engine/object-data/entry/item-type.lua +88 -4
- package/engine/object-data/entry/lightning-type.d.ts +6 -8
- 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 +81 -6
- package/engine/object-data/entry/unit-type.lua +619 -99
- package/engine/object-data/entry/upgrade.d.ts +2 -2
- package/engine/object-data/entry/upgrade.lua +4 -4
- package/engine/object-data/entry.d.ts +21 -14
- package/engine/object-data/entry.lua +68 -32
- package/engine/object-field/ability.d.ts +4 -4
- package/engine/object-field/ability.lua +9 -8
- 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 -3
- package/engine/object-field/unit.lua +268 -7
- package/engine/object-field.d.ts +26 -7
- package/engine/object-field.lua +360 -119
- package/engine/random.d.ts +10 -0
- package/engine/random.lua +21 -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 +5 -0
- package/engine/standard/entries/unit-type.lua +5 -0
- package/engine/standard/fields/ability.d.ts +4 -4
- package/engine/standard/fields/ability.lua +4 -4
- 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 +48 -2
- package/engine/text-tag.lua +287 -10
- package/engine/unit.d.ts +12 -1
- package/engine/unit.lua +12 -1
- package/event.d.ts +1 -1
- package/lualib_bundle.lua +1 -1
- package/math.d.ts +2 -0
- package/math.lua +14 -0
- package/net/socket.lua +1 -1
- package/network.lua +25 -1
- package/objutil/buff.lua +12 -11
- package/objutil/object.lua +1 -1
- package/objutil/unit.lua +8 -0
- package/operation.d.ts +8 -1
- package/operation.lua +38 -18
- package/package.json +3 -23
- package/patch-lua.lua +15 -0
- package/patch-lualib.lua +1 -1
- package/patch-natives.lua +3 -0
- package/utility/arrays.d.ts +9 -1
- package/utility/arrays.lua +28 -0
- 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/linked-map.d.ts +35 -0
- package/utility/linked-map.lua +107 -0
- package/utility/linked-set.d.ts +5 -1
- package/utility/linked-set.lua +49 -1
- package/utility/lua-maps.d.ts +15 -2
- package/utility/lua-maps.lua +53 -2
- package/utility/lua-sets.d.ts +2 -0
- 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 +3 -0
- package/utility/unordered-map.d.ts +27 -0
- package/utility/unordered-map.lua +99 -0
- package/core/types/order.d.ts +0 -25
- package/core/types/order.lua +0 -55
- package/engine/internal/unit/item.lua +0 -78
- /package/engine/internal/{object-data/armor-increase.d.ts → misc/damage-metadata-by-target.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
|
@@ -14,8 +14,10 @@ local Unit = ____unit.Unit
|
|
|
14
14
|
local ____applicable = require("engine.object-data.entry.buff-type.applicable")
|
|
15
15
|
local internalApplyBuff = ____applicable.internalApplyBuff
|
|
16
16
|
local removeBuff = ____applicable.removeBuff
|
|
17
|
+
local removeBuffApplicator = ____applicable.removeBuffApplicator
|
|
17
18
|
local ____ability = require("engine.internal.ability")
|
|
18
19
|
local Ability = ____ability.Ability
|
|
20
|
+
local UnitAbility = ____ability.UnitAbility
|
|
19
21
|
local ____ability = require("engine.object-field.ability")
|
|
20
22
|
local AbilityBooleanField = ____ability.AbilityBooleanField
|
|
21
23
|
local AbilityNumberField = ____ability.AbilityNumberField
|
|
@@ -28,13 +30,11 @@ local ____math = require("math")
|
|
|
28
30
|
local max = ____math.max
|
|
29
31
|
local min = ____math.min
|
|
30
32
|
local ____bonus = require("engine.internal.unit.bonus")
|
|
31
|
-
local addOrUpdateOrRemoveUnitBonus = ____bonus.addOrUpdateOrRemoveUnitBonus
|
|
32
|
-
local getUnitBonus = ____bonus.getUnitBonus
|
|
33
|
-
local removeUnitBonus = ____bonus.removeUnitBonus
|
|
34
33
|
local UnitBonusType = ____bonus.UnitBonusType
|
|
35
34
|
local ____area_2Ddamage = require("engine.internal.mechanics.area-damage")
|
|
36
35
|
local damageArea = ____area_2Ddamage.damageArea
|
|
37
36
|
local ____preconditions = require("utility.preconditions")
|
|
37
|
+
local check = ____preconditions.check
|
|
38
38
|
local checkNotNull = ____preconditions.checkNotNull
|
|
39
39
|
local ____effect = require("core.types.effect")
|
|
40
40
|
local Effect = ____effect.Effect
|
|
@@ -43,13 +43,25 @@ local BuffType = ____buff_2Dtype.BuffType
|
|
|
43
43
|
local ____unit = require("engine.behaviour.unit")
|
|
44
44
|
local UnitBehavior = ____unit.UnitBehavior
|
|
45
45
|
local ____arrays = require("utility.arrays")
|
|
46
|
+
local emptyArray = ____arrays.emptyArray
|
|
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
|
|
49
52
|
local ____item = require("engine.internal.item")
|
|
50
53
|
local Item = ____item.Item
|
|
51
54
|
local ____destructable = require("core.types.destructable")
|
|
52
55
|
local Destructable = ____destructable.Destructable
|
|
56
|
+
local ____ability = require("engine.standard.fields.ability")
|
|
57
|
+
local COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD = ____ability.COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD
|
|
58
|
+
local ____ability = require("engine.behaviour.ability")
|
|
59
|
+
local AbilityBehavior = ____ability.AbilityBehavior
|
|
60
|
+
local ____records = require("utility.records")
|
|
61
|
+
local sortedKeysUnnested = ____records.sortedKeysUnnested
|
|
62
|
+
local ____sound = require("core.types.sound")
|
|
63
|
+
local Sound3D = ____sound.Sound3D
|
|
64
|
+
local SoundSettings = ____sound.SoundSettings
|
|
53
65
|
local getUnitAbility = BlzGetUnitAbility
|
|
54
66
|
local stringValueByBuffTypeIdByFieldId = postcompile(function()
|
|
55
67
|
local stringValueByBuffTypeIdByFieldId = {}
|
|
@@ -95,16 +107,21 @@ local buffParametersKeys = {
|
|
|
95
107
|
damageIncrease = true,
|
|
96
108
|
damageIncreaseFactor = true,
|
|
97
109
|
armorIncrease = true,
|
|
98
|
-
|
|
110
|
+
maxHealthIncrease = true,
|
|
111
|
+
maxManaIncrease = true,
|
|
99
112
|
attackSpeedIncreaseFactor = true,
|
|
100
113
|
movementSpeedIncreaseFactor = true,
|
|
114
|
+
manaRegenerationRateIncreaseFactor = true,
|
|
101
115
|
evasionProbability = true,
|
|
116
|
+
missProbability = true,
|
|
102
117
|
damageFactor = true,
|
|
103
118
|
receivedDamageFactor = true,
|
|
119
|
+
returnedMeleeDamageFactor = true,
|
|
104
120
|
receivedMagicDamageFactor = true,
|
|
105
121
|
durationIncreaseOnAutoAttack = true,
|
|
106
122
|
maximumDuration = true,
|
|
107
123
|
maximumRemainingDuration = true,
|
|
124
|
+
turnsIntoGhost = true,
|
|
108
125
|
stuns = true,
|
|
109
126
|
ignoresStunImmunity = true,
|
|
110
127
|
providesStunImmunity = true,
|
|
@@ -115,11 +132,17 @@ local buffParametersKeys = {
|
|
|
115
132
|
maximumAutoAttackCount = true,
|
|
116
133
|
maximumDamageDealtEventCount = true,
|
|
117
134
|
maximumDamageReceivedEventCount = true,
|
|
135
|
+
absorbedDamageFactor = true,
|
|
136
|
+
maximumDamageAbsorbed = true,
|
|
137
|
+
destroysOnMaximumDamageAbsorbed = true,
|
|
118
138
|
uniqueGroup = true,
|
|
139
|
+
destructionSoundPresetId = true,
|
|
119
140
|
damageOnExpiration = true,
|
|
120
141
|
healingOnExpiration = true,
|
|
121
142
|
killsOnExpiration = true,
|
|
122
|
-
explodesOnExpiration = true
|
|
143
|
+
explodesOnExpiration = true,
|
|
144
|
+
abilityCooldownFactor = true,
|
|
145
|
+
sharesVisionWithSource = true
|
|
123
146
|
}
|
|
124
147
|
local function resolveEnumValue(ability, level, value)
|
|
125
148
|
if value == nil or type(value) == "number" then
|
|
@@ -170,21 +193,28 @@ local function resolveAndSetNumberValue(buff, property, ability, level, value, d
|
|
|
170
193
|
end
|
|
171
194
|
end
|
|
172
195
|
local buffBooleanParameters = {
|
|
196
|
+
"destroysOnMaximumDamageAbsorbed",
|
|
197
|
+
"turnsIntoGhost",
|
|
173
198
|
"stuns",
|
|
174
199
|
"ignoresStunImmunity",
|
|
175
200
|
"disablesAutoAttack",
|
|
176
201
|
"providesInvulnerability",
|
|
177
202
|
"killsOnExpiration",
|
|
178
|
-
"explodesOnExpiration"
|
|
203
|
+
"explodesOnExpiration",
|
|
204
|
+
"sharesVisionWithSource"
|
|
179
205
|
}
|
|
180
206
|
local buffNumberParameters = {
|
|
181
207
|
"durationIncreaseOnAutoAttack",
|
|
182
208
|
"attackSpeedIncreaseFactor",
|
|
183
209
|
"movementSpeedIncreaseFactor",
|
|
210
|
+
"manaRegenerationRateIncreaseFactor",
|
|
184
211
|
"evasionProbability",
|
|
185
212
|
"armorIncrease",
|
|
213
|
+
"maxHealthIncrease",
|
|
214
|
+
"maxManaIncrease",
|
|
186
215
|
"damageFactor",
|
|
187
216
|
"receivedDamageFactor",
|
|
217
|
+
"returnedMeleeDamageFactor",
|
|
188
218
|
"maximumAutoAttackCount",
|
|
189
219
|
"maximumDamageDealtEventCount",
|
|
190
220
|
"maximumDamageReceivedEventCount",
|
|
@@ -195,7 +225,10 @@ local buffNumberParameters = {
|
|
|
195
225
|
"healingPerInterval",
|
|
196
226
|
"healingOverDuration",
|
|
197
227
|
"damageOnExpiration",
|
|
198
|
-
"healingOnExpiration"
|
|
228
|
+
"healingOnExpiration",
|
|
229
|
+
"absorbedDamageFactor",
|
|
230
|
+
"maximumDamageAbsorbed",
|
|
231
|
+
"abilityCooldownFactor"
|
|
199
232
|
}
|
|
200
233
|
local unsuccessfulApplicationMarker = {}
|
|
201
234
|
local function selectBuffTypeIdWithLeastDuration(buffTypeIds, unit)
|
|
@@ -222,25 +255,51 @@ local function selectBuffTypeIdWithLeastDuration(buffTypeIds, unit)
|
|
|
222
255
|
return checkNotNull(firstNativeBuffTypeId)
|
|
223
256
|
end
|
|
224
257
|
local function destroyBuffIfItHasSameUniqueGroup(buff, uniqueGroup)
|
|
225
|
-
if buff[
|
|
258
|
+
if buff[104] == uniqueGroup then
|
|
226
259
|
buff:destroy()
|
|
227
260
|
end
|
|
228
261
|
end
|
|
229
262
|
local function destroyBuff(buff)
|
|
230
263
|
buff:destroy()
|
|
231
264
|
end
|
|
265
|
+
local function destroyBuffOnDeath(buff)
|
|
266
|
+
if buff[100] == 0 then
|
|
267
|
+
Timer:run(destroyBuff, buff)
|
|
268
|
+
else
|
|
269
|
+
buff:destroy()
|
|
270
|
+
end
|
|
271
|
+
end
|
|
272
|
+
local function shareVisionWithSource(buff)
|
|
273
|
+
local source = buff[102]
|
|
274
|
+
if source ~= nil then
|
|
275
|
+
local player = source.owner
|
|
276
|
+
buff[101]:incrementSharedVisionCounter(player)
|
|
277
|
+
buff[151] = player
|
|
278
|
+
end
|
|
279
|
+
end
|
|
280
|
+
local function unshareVisionWithSource(buff)
|
|
281
|
+
local player = buff[151]
|
|
282
|
+
if player ~= nil then
|
|
283
|
+
buff[101]:decrementSharedVisionCounter(player)
|
|
284
|
+
buff[151] = nil
|
|
285
|
+
end
|
|
286
|
+
end
|
|
232
287
|
local function expireBuff(buff)
|
|
233
|
-
|
|
234
|
-
|
|
288
|
+
if buff.isDestroyed or buff[100] ~= 1 then
|
|
289
|
+
return
|
|
290
|
+
end
|
|
291
|
+
buff[100] = 2
|
|
292
|
+
local remainingDamageOverDuration = buff[114] or 0
|
|
293
|
+
local remainingHealingOverDuration = buff[114] or 0
|
|
235
294
|
if remainingDamageOverDuration ~= 0 or remainingHealingOverDuration ~= 0 then
|
|
236
295
|
buff:flashSpecialEffect()
|
|
237
296
|
if remainingDamageOverDuration ~= 0 then
|
|
238
|
-
(buff[
|
|
239
|
-
buff[
|
|
297
|
+
(buff[102] or buff[101]):damageTarget(buff[101], remainingDamageOverDuration)
|
|
298
|
+
buff[114] = nil
|
|
240
299
|
end
|
|
241
300
|
if remainingHealingOverDuration ~= 0 then
|
|
242
|
-
(buff[
|
|
243
|
-
buff[
|
|
301
|
+
(buff[102] or buff[101]):healTarget(buff[101], remainingHealingOverDuration)
|
|
302
|
+
buff[119] = nil
|
|
244
303
|
end
|
|
245
304
|
end
|
|
246
305
|
Timer:run(destroyBuff, buff)
|
|
@@ -248,56 +307,58 @@ local function expireBuff(buff)
|
|
|
248
307
|
end
|
|
249
308
|
local function buffDamageIntervalInitialTimerCallback(buff)
|
|
250
309
|
buffDamageIntervalTimerCallback(buff)
|
|
251
|
-
local timer = buff[
|
|
252
|
-
local damageInterval = buff[
|
|
310
|
+
local timer = buff[115]
|
|
311
|
+
local damageInterval = buff[113]
|
|
253
312
|
if timer ~= nil and damageInterval ~= nil and damageInterval > 0 then
|
|
254
313
|
timer:start(damageInterval, true, buffDamageIntervalTimerCallback, buff)
|
|
255
314
|
end
|
|
256
315
|
end
|
|
257
316
|
buffDamageIntervalTimerCallback = function(buff)
|
|
258
317
|
buff:flashSpecialEffect()
|
|
259
|
-
local source = buff[
|
|
260
|
-
local remainingDamageOverDuration = buff[
|
|
318
|
+
local source = buff[102] or buff[101]
|
|
319
|
+
local remainingDamageOverDuration = buff[114] or 0
|
|
261
320
|
if remainingDamageOverDuration ~= 0 then
|
|
262
|
-
local damageInterval = buff[
|
|
321
|
+
local damageInterval = buff[113] or 0
|
|
263
322
|
if damageInterval ~= 0 then
|
|
264
323
|
local damage = remainingDamageOverDuration / (1 + buff.remainingDuration / damageInterval)
|
|
265
|
-
source:damageTarget(buff[
|
|
266
|
-
buff[
|
|
324
|
+
source:damageTarget(buff[101], damage)
|
|
325
|
+
buff[114] = remainingDamageOverDuration - damage
|
|
267
326
|
end
|
|
268
327
|
end
|
|
269
|
-
local damagePerInterval = buff[
|
|
328
|
+
local damagePerInterval = buff[112] or 0
|
|
270
329
|
if remainingDamageOverDuration == 0 or damagePerInterval ~= 0 then
|
|
271
|
-
source:damageTarget(buff[
|
|
330
|
+
source:damageTarget(buff[101], damagePerInterval)
|
|
272
331
|
end
|
|
273
332
|
end
|
|
274
333
|
local function buffHealingIntervalInitialTimerCallback(buff)
|
|
275
334
|
buffHealingIntervalTimerCallback(buff)
|
|
276
|
-
local timer = buff[
|
|
277
|
-
local healingInterval = buff[
|
|
335
|
+
local timer = buff[120]
|
|
336
|
+
local healingInterval = buff[118]
|
|
278
337
|
if timer ~= nil and healingInterval ~= nil and healingInterval > 0 then
|
|
279
338
|
timer:start(healingInterval, true, buffHealingIntervalTimerCallback, buff)
|
|
280
339
|
end
|
|
281
340
|
end
|
|
282
341
|
buffHealingIntervalTimerCallback = function(buff)
|
|
283
|
-
if buff[
|
|
342
|
+
if buff[118] ~= buff[113] then
|
|
284
343
|
buff:flashSpecialEffect()
|
|
285
344
|
end
|
|
286
|
-
local source = buff[
|
|
287
|
-
local remainingHealingOverDuration = buff[
|
|
345
|
+
local source = buff[102] or buff[101]
|
|
346
|
+
local remainingHealingOverDuration = buff[119] or 0
|
|
288
347
|
if remainingHealingOverDuration ~= 0 then
|
|
289
|
-
local healingInterval = buff[
|
|
348
|
+
local healingInterval = buff[118] or 0
|
|
290
349
|
if healingInterval ~= 0 then
|
|
291
350
|
local healing = remainingHealingOverDuration / (1 + buff.remainingDuration / healingInterval)
|
|
292
|
-
source:healTarget(buff[
|
|
293
|
-
buff[
|
|
351
|
+
source:healTarget(buff[101], healing)
|
|
352
|
+
buff[119] = remainingHealingOverDuration - healing
|
|
294
353
|
end
|
|
295
354
|
end
|
|
296
|
-
local healingPerInterval = buff[
|
|
355
|
+
local healingPerInterval = buff[117] or 0
|
|
297
356
|
if remainingHealingOverDuration == 0 or healingPerInterval ~= 0 then
|
|
298
|
-
source:healTarget(buff[
|
|
357
|
+
source:healTarget(buff[101], healingPerInterval)
|
|
299
358
|
end
|
|
300
359
|
end
|
|
360
|
+
local buffCreatedEvent = __TS__New(Event)
|
|
361
|
+
local buffBeingDestroyedEvent = __TS__New(Event)
|
|
301
362
|
____exports.Buff = __TS__Class()
|
|
302
363
|
local Buff = ____exports.Buff
|
|
303
364
|
Buff.name = "Buff"
|
|
@@ -306,38 +367,44 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
306
367
|
UnitBehavior.prototype.____constructor(self, _unit)
|
|
307
368
|
self._unit = _unit
|
|
308
369
|
self.parameters = nil
|
|
309
|
-
self[100] =
|
|
370
|
+
self[100] = 0
|
|
371
|
+
self[101] = _unit
|
|
310
372
|
local typeId
|
|
311
373
|
local polarity
|
|
312
374
|
local resistanceType
|
|
313
375
|
local ability
|
|
376
|
+
local abilityBehavior
|
|
314
377
|
if type(typeIdOrTypeIds) ~= "number" then
|
|
315
378
|
typeId = selectBuffTypeIdWithLeastDuration(typeIdOrTypeIds, _unit)
|
|
316
379
|
polarity = resistanceTypeOrPolarity
|
|
317
380
|
resistanceType = abilityOrParametersOrResistanceType
|
|
318
|
-
if __TS__InstanceOf(parametersOrAbility,
|
|
381
|
+
if __TS__InstanceOf(parametersOrAbility, AbilityBehavior) then
|
|
382
|
+
abilityBehavior = parametersOrAbility
|
|
383
|
+
ability = abilityBehavior.ability
|
|
384
|
+
elseif __TS__InstanceOf(parametersOrAbility, Ability) then
|
|
319
385
|
ability = parametersOrAbility
|
|
320
|
-
|
|
321
|
-
ability = nil
|
|
386
|
+
elseif parametersOrAbility ~= nil then
|
|
322
387
|
parameters = parametersOrAbility
|
|
323
388
|
end
|
|
324
389
|
else
|
|
325
390
|
typeId = typeIdOrTypeIds
|
|
326
391
|
polarity = polarityOrTypeIdSelectionPolicy
|
|
327
392
|
resistanceType = resistanceTypeOrPolarity
|
|
328
|
-
if __TS__InstanceOf(abilityOrParametersOrResistanceType,
|
|
393
|
+
if __TS__InstanceOf(abilityOrParametersOrResistanceType, AbilityBehavior) then
|
|
394
|
+
abilityBehavior = abilityOrParametersOrResistanceType
|
|
395
|
+
ability = abilityBehavior.ability
|
|
396
|
+
parameters = parametersOrAbility
|
|
397
|
+
elseif __TS__InstanceOf(abilityOrParametersOrResistanceType, Ability) then
|
|
329
398
|
ability = abilityOrParametersOrResistanceType
|
|
330
399
|
parameters = parametersOrAbility
|
|
331
|
-
|
|
332
|
-
ability = nil
|
|
400
|
+
elseif abilityOrParametersOrResistanceType ~= nil then
|
|
333
401
|
parameters = abilityOrParametersOrResistanceType
|
|
402
|
+
else
|
|
403
|
+
parameters = parametersOrAbility
|
|
334
404
|
end
|
|
335
405
|
end
|
|
406
|
+
self.sourceAbilityBehavior = abilityBehavior
|
|
336
407
|
self.typeId = typeId
|
|
337
|
-
if not __TS__InstanceOf(ability, Ability) then
|
|
338
|
-
parameters = ability
|
|
339
|
-
ability = nil
|
|
340
|
-
end
|
|
341
408
|
local defaultParameters = self.constructor.defaultParameters
|
|
342
409
|
local level = parameters and parameters.level or defaultParameters.level
|
|
343
410
|
local spellStealPriority = parameters and parameters.spellStealPriority or defaultParameters.spellStealPriority
|
|
@@ -362,14 +429,20 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
362
429
|
end
|
|
363
430
|
self.polarity = resolveEnumValue(ability, level, polarity)
|
|
364
431
|
self.resistanceType = resolveEnumValue(ability, level, resistanceType)
|
|
432
|
+
local missProbability = parameters and parameters.missProbability or defaultParameters.missProbability
|
|
433
|
+
if missProbability ~= nil then
|
|
434
|
+
missProbability = resolveNumberValue(ability, level, missProbability)
|
|
435
|
+
self[147] = missProbability
|
|
436
|
+
end
|
|
365
437
|
local buffByTypeId = buffByTypeIdByUnit[_unit]
|
|
366
438
|
if buffByTypeId == nil then
|
|
367
439
|
buffByTypeId = {}
|
|
368
440
|
buffByTypeIdByUnit[_unit] = buffByTypeId
|
|
369
441
|
end
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
442
|
+
self.previousBuff = buffByTypeId[typeId]
|
|
443
|
+
local ____opt_15 = self.previousBuff
|
|
444
|
+
if ____opt_15 ~= nil then
|
|
445
|
+
____opt_15:destroy()
|
|
373
446
|
end
|
|
374
447
|
local uniqueGroup = parameters and parameters.uniqueGroup or defaultParameters and defaultParameters.uniqueGroup
|
|
375
448
|
if uniqueGroup ~= nil then
|
|
@@ -383,13 +456,16 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
383
456
|
level,
|
|
384
457
|
duration,
|
|
385
458
|
spellStealPriority,
|
|
386
|
-
learnLevelMinimum
|
|
459
|
+
learnLevelMinimum,
|
|
460
|
+
missProbability
|
|
387
461
|
) then
|
|
462
|
+
self[100] = 1
|
|
388
463
|
UnitBehavior.prototype.destroy(self)
|
|
389
464
|
error(unsuccessfulApplicationMarker, 0)
|
|
390
465
|
end
|
|
391
466
|
local handle = BlzGetUnitAbility(_unit.handle, typeId)
|
|
392
467
|
if handle == nil then
|
|
468
|
+
self[100] = 1
|
|
393
469
|
UnitBehavior.prototype.destroy(self)
|
|
394
470
|
error(unsuccessfulApplicationMarker, 0)
|
|
395
471
|
end
|
|
@@ -398,20 +474,21 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
398
474
|
self._level = level
|
|
399
475
|
self._spellStealPriority = spellStealPriority
|
|
400
476
|
self._learnLevelMinimum = learnLevelMinimum
|
|
401
|
-
self[
|
|
402
|
-
self[
|
|
403
|
-
self[
|
|
404
|
-
self[
|
|
405
|
-
self[
|
|
477
|
+
self[102] = source
|
|
478
|
+
self[103] = duration or 0
|
|
479
|
+
self[104] = uniqueGroup
|
|
480
|
+
self[105] = parameters and parameters.destructionSoundPresetId or defaultParameters and defaultParameters.destructionSoundPresetId
|
|
481
|
+
self[106] = BlzGetAbilityStringLevelField(self.handle, ABILITY_SLF_EFFECT, 0)
|
|
482
|
+
self[107] = BlzGetAbilityStringLevelField(self.handle, ABILITY_SLF_SPECIAL, 0)
|
|
406
483
|
if parameters ~= nil or (next(defaultParameters)) ~= nil then
|
|
407
484
|
for ____, buffBooleanParameter in ipairs(buffBooleanParameters) do
|
|
408
|
-
local
|
|
409
|
-
local
|
|
410
|
-
local
|
|
411
|
-
if
|
|
412
|
-
|
|
485
|
+
local ____ability_28 = ability
|
|
486
|
+
local ____level_29 = level
|
|
487
|
+
local ____temp_27 = parameters and parameters[buffBooleanParameter]
|
|
488
|
+
if ____temp_27 == nil then
|
|
489
|
+
____temp_27 = defaultParameters[buffBooleanParameter]
|
|
413
490
|
end
|
|
414
|
-
if resolveBooleanValue(
|
|
491
|
+
if resolveBooleanValue(____ability_28, ____level_29, ____temp_27) then
|
|
415
492
|
self[buffBooleanParameter] = true
|
|
416
493
|
end
|
|
417
494
|
end
|
|
@@ -427,11 +504,11 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
427
504
|
end
|
|
428
505
|
local maximumDuration = parameters and parameters.maximumDuration or defaultParameters.maximumDuration
|
|
429
506
|
if maximumDuration ~= nil then
|
|
430
|
-
self[
|
|
507
|
+
self[109] = resolveNumberValue(ability, level, maximumDuration)
|
|
431
508
|
end
|
|
432
509
|
local maximumRemainingDuration = parameters and parameters.maximumRemainingDuration or defaultParameters.maximumRemainingDuration
|
|
433
510
|
if maximumRemainingDuration ~= nil then
|
|
434
|
-
self[
|
|
511
|
+
self[110] = resolveNumberValue(ability, level, maximumRemainingDuration)
|
|
435
512
|
end
|
|
436
513
|
local parametersAbilityTypeIds = parameters and parameters.abilityTypeIds or defaultParameters.abilityTypeIds
|
|
437
514
|
if parametersAbilityTypeIds ~= nil then
|
|
@@ -440,24 +517,22 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
440
517
|
abilityTypeIds = {}
|
|
441
518
|
self._abilityTypeIds = abilityTypeIds
|
|
442
519
|
end
|
|
443
|
-
for
|
|
520
|
+
for ____, abilityTypeId in ipairs(sortedKeysUnnested(parametersAbilityTypeIds)) do
|
|
521
|
+
local abilityParameters = checkNotNull(parametersAbilityTypeIds[abilityTypeId])
|
|
444
522
|
local addedAbility = _unit:addAbility(abilityTypeId)
|
|
445
523
|
if addedAbility ~= nil then
|
|
446
524
|
_unit:makeAbilityPermanent(abilityTypeId, true)
|
|
447
525
|
_unit:setAbilityLevel(abilityTypeId, 1 + (abilityParameters.level or ability and ability.level or 0))
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
resolveNumberValue(ability, level, abilityParameterValue)
|
|
457
|
-
)
|
|
458
|
-
end
|
|
526
|
+
if abilityParameters.isButtonVisible == false then
|
|
527
|
+
_unit:hideAbility(abilityTypeId, true)
|
|
528
|
+
end
|
|
529
|
+
for ____, field in ipairs(abilityParameters.fields or emptyArray()) do
|
|
530
|
+
field[1]:setValue(
|
|
531
|
+
addedAbility,
|
|
532
|
+
resolveNumberValue(ability, level, field[2])
|
|
533
|
+
)
|
|
459
534
|
end
|
|
460
|
-
abilityTypeIds[
|
|
535
|
+
abilityTypeIds[#abilityTypeIds + 1] = abilityTypeId
|
|
461
536
|
end
|
|
462
537
|
end
|
|
463
538
|
local behaviorConstructors = parameters and parameters.behaviorConstructors or defaultParameters.behaviorConstructors
|
|
@@ -469,18 +544,20 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
469
544
|
self._behaviors = behaviors
|
|
470
545
|
end
|
|
471
546
|
end
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
if
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
547
|
+
if parameters ~= nil then
|
|
548
|
+
local additionalParameters = {}
|
|
549
|
+
for ____, key in ipairs(sortedKeysUnnested(parameters)) do
|
|
550
|
+
if not buffParametersKeys[key] then
|
|
551
|
+
if ability then
|
|
552
|
+
additionalParameters[key] = resolveCurrentAbilityDependentValue(ability, parameters[key])
|
|
553
|
+
else
|
|
554
|
+
additionalParameters[key] = parameters[key]
|
|
555
|
+
end
|
|
479
556
|
end
|
|
480
557
|
end
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
558
|
+
if (next(additionalParameters)) ~= nil then
|
|
559
|
+
self.parameters = additionalParameters
|
|
560
|
+
end
|
|
484
561
|
end
|
|
485
562
|
end
|
|
486
563
|
if duration ~= nil and duration > 0 then
|
|
@@ -489,83 +566,106 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
489
566
|
self._timer = timer
|
|
490
567
|
end
|
|
491
568
|
self:onCreate()
|
|
569
|
+
self[100] = 1
|
|
570
|
+
Event.invoke(buffCreatedEvent, self)
|
|
492
571
|
end
|
|
493
|
-
function Buff.prototype.
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
572
|
+
function Buff.prototype.onAbilityGained(self, ability)
|
|
573
|
+
if __TS__InstanceOf(ability, UnitAbility) then
|
|
574
|
+
local abilityCooldownModifier = self[149]
|
|
575
|
+
if abilityCooldownModifier then
|
|
576
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:applyModifier(ability, abilityCooldownModifier)
|
|
577
|
+
end
|
|
578
|
+
end
|
|
497
579
|
end
|
|
498
|
-
function Buff.prototype.
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
580
|
+
function Buff.prototype.onAbilityLost(self, ability)
|
|
581
|
+
if __TS__InstanceOf(ability, UnitAbility) then
|
|
582
|
+
local abilityCooldownModifier = self[149]
|
|
583
|
+
if abilityCooldownModifier then
|
|
584
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:removeModifier(ability, abilityCooldownModifier)
|
|
585
|
+
end
|
|
503
586
|
end
|
|
504
|
-
bonusIdByBonusType[bonusType] = addOrUpdateOrRemoveUnitBonus(self._unit, bonusType, bonusIdByBonusType[bonusType], value)
|
|
505
587
|
end
|
|
506
588
|
function Buff.prototype.flashEffect(self, widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
589
|
+
self:flash(
|
|
590
|
+
self[106],
|
|
591
|
+
stringValueByBuffTypeIdByFieldId[fourCC("feft")][self.typeId] or "origin",
|
|
592
|
+
widgetOrXOrParametersOrDuration,
|
|
593
|
+
yOrParametersOrDuration,
|
|
594
|
+
parametersOrDuration
|
|
595
|
+
)
|
|
596
|
+
end
|
|
597
|
+
function Buff.prototype.flashSpecialEffect(self, widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
598
|
+
self:flash(
|
|
599
|
+
self[107],
|
|
600
|
+
stringValueByBuffTypeIdByFieldId[fourCC("fspt")][self.typeId] or "origin",
|
|
601
|
+
widgetOrXOrParametersOrDuration,
|
|
602
|
+
yOrParametersOrDuration,
|
|
603
|
+
parametersOrDuration
|
|
604
|
+
)
|
|
605
|
+
end
|
|
606
|
+
function Buff.prototype.flash(self, modelPath, attachmentPoint, widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
507
607
|
if type(widgetOrXOrParametersOrDuration) == "number" and type(yOrParametersOrDuration) == "number" then
|
|
508
|
-
Effect:flash(
|
|
608
|
+
Effect:flash(modelPath, widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
509
609
|
else
|
|
510
610
|
local isWidgetProvided = __TS__InstanceOf(widgetOrXOrParametersOrDuration, Unit) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Item) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Destructable)
|
|
511
|
-
local
|
|
512
|
-
local
|
|
513
|
-
local
|
|
514
|
-
|
|
515
|
-
isWidgetProvided and widgetOrXOrParametersOrDuration or self._unit,
|
|
516
|
-
stringValueByBuffTypeIdByFieldId[fourCC("feft")][self.typeId] or "origin"
|
|
517
|
-
)
|
|
518
|
-
local ____isWidgetProvided_38
|
|
611
|
+
local ____Effect_44 = Effect
|
|
612
|
+
local ____Effect_flash_45 = Effect.flash
|
|
613
|
+
local ____array_43 = __TS__SparseArrayNew(modelPath, isWidgetProvided and widgetOrXOrParametersOrDuration or self._unit, attachmentPoint)
|
|
614
|
+
local ____isWidgetProvided_42
|
|
519
615
|
if isWidgetProvided then
|
|
520
|
-
|
|
616
|
+
____isWidgetProvided_42 = yOrParametersOrDuration
|
|
521
617
|
else
|
|
522
|
-
|
|
618
|
+
____isWidgetProvided_42 = widgetOrXOrParametersOrDuration
|
|
523
619
|
end
|
|
524
|
-
__TS__SparseArrayPush(
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
__TS__SparseArraySpread(
|
|
620
|
+
__TS__SparseArrayPush(____array_43, ____isWidgetProvided_42)
|
|
621
|
+
____Effect_flash_45(
|
|
622
|
+
____Effect_44,
|
|
623
|
+
__TS__SparseArraySpread(____array_43)
|
|
528
624
|
)
|
|
529
625
|
end
|
|
530
626
|
end
|
|
531
|
-
function Buff.prototype.
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
627
|
+
function Buff.prototype.expire(self)
|
|
628
|
+
expireBuff(self)
|
|
629
|
+
end
|
|
630
|
+
function Buff.prototype.dispel(self, source)
|
|
631
|
+
if self.isDestroyed or self[100] ~= 1 then
|
|
632
|
+
return
|
|
633
|
+
end
|
|
634
|
+
self[100] = 2
|
|
635
|
+
do
|
|
636
|
+
pcall(function()
|
|
637
|
+
self:onDispel(source)
|
|
638
|
+
end)
|
|
639
|
+
do
|
|
640
|
+
self:destroy()
|
|
641
|
+
end
|
|
545
642
|
end
|
|
546
|
-
__TS__SparseArrayPush(____array_43, ____isWidgetProvided_42)
|
|
547
|
-
____Effect_flash_45(
|
|
548
|
-
____Effect_44,
|
|
549
|
-
__TS__SparseArraySpread(____array_43)
|
|
550
|
-
)
|
|
551
643
|
end
|
|
552
644
|
function Buff.prototype.onCreate(self)
|
|
553
645
|
end
|
|
554
646
|
function Buff.prototype.onDestroy(self)
|
|
647
|
+
check(self[100] ~= 0, "Cannot destroy a buff that has not finished creating yet.")
|
|
648
|
+
self[100] = 2
|
|
555
649
|
local unit = self._unit
|
|
650
|
+
local destructionSoundPresetId = self[105]
|
|
651
|
+
if destructionSoundPresetId ~= nil then
|
|
652
|
+
Sound3D:playFromLabel(destructionSoundPresetId, SoundSettings.Ability, unit)
|
|
653
|
+
end
|
|
556
654
|
if getUnitAbility(unit.handle, self.typeId) == self.handle then
|
|
557
655
|
removeBuff(unit.handle, self.typeId)
|
|
656
|
+
else
|
|
657
|
+
removeBuffApplicator(unit.handle, self.typeId)
|
|
558
658
|
end
|
|
559
659
|
buffByTypeIdByUnit[unit][self.typeId] = nil
|
|
560
|
-
local healingIntervalTimer = self[
|
|
660
|
+
local healingIntervalTimer = self[120]
|
|
561
661
|
if healingIntervalTimer ~= nil then
|
|
562
662
|
healingIntervalTimer:destroy()
|
|
563
|
-
self[
|
|
663
|
+
self[120] = nil
|
|
564
664
|
end
|
|
565
|
-
local damageIntervalTimer = self[
|
|
665
|
+
local damageIntervalTimer = self[115]
|
|
566
666
|
if damageIntervalTimer ~= nil then
|
|
567
667
|
damageIntervalTimer:destroy()
|
|
568
|
-
self[
|
|
668
|
+
self[115] = nil
|
|
569
669
|
end
|
|
570
670
|
if self._timer ~= nil then
|
|
571
671
|
self._timer:destroy()
|
|
@@ -575,25 +675,35 @@ function Buff.prototype.onDestroy(self)
|
|
|
575
675
|
behavior:destroy()
|
|
576
676
|
end
|
|
577
677
|
end
|
|
578
|
-
|
|
678
|
+
local previousAbilityCooldownModifier = self[149]
|
|
679
|
+
if previousAbilityCooldownModifier then
|
|
680
|
+
for ____, ability in ipairs(self._unit.abilities) do
|
|
681
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:removeModifier(ability, previousAbilityCooldownModifier)
|
|
682
|
+
end
|
|
683
|
+
end
|
|
684
|
+
if self[144] then
|
|
685
|
+
unit:decrementInvulnerabilityCounter()
|
|
686
|
+
end
|
|
687
|
+
if self[143] then
|
|
579
688
|
unit:decrementDisableAutoAttackCounter()
|
|
580
689
|
end
|
|
581
|
-
if self[
|
|
582
|
-
if self[
|
|
583
|
-
unit:
|
|
690
|
+
if self[141] then
|
|
691
|
+
if self[142] then
|
|
692
|
+
unit:decrementForceStunCounter()
|
|
584
693
|
end
|
|
585
694
|
unit:decrementStunCounter()
|
|
586
695
|
end
|
|
696
|
+
if self[140] then
|
|
697
|
+
unit:decrementGhostCounter()
|
|
698
|
+
end
|
|
699
|
+
unshareVisionWithSource(self)
|
|
587
700
|
if self._abilityTypeIds ~= nil then
|
|
588
|
-
for abilityTypeId in
|
|
701
|
+
for ____, abilityTypeId in ipairs(self._abilityTypeIds) do
|
|
589
702
|
unit:removeAbility(abilityTypeId)
|
|
590
703
|
end
|
|
591
704
|
end
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
removeUnitBonus(unit, bonusType, bonusId)
|
|
595
|
-
end
|
|
596
|
-
end
|
|
705
|
+
Event.invoke(buffBeingDestroyedEvent, self)
|
|
706
|
+
self[100] = 3
|
|
597
707
|
return UnitBehavior.prototype.onDestroy(self)
|
|
598
708
|
end
|
|
599
709
|
function Buff.apply(self, ...)
|
|
@@ -628,74 +738,88 @@ function Buff.getByTypeId(self, unit, typeId)
|
|
|
628
738
|
end
|
|
629
739
|
return nil
|
|
630
740
|
end
|
|
741
|
+
function Buff.prototype.onDispel(self, source)
|
|
742
|
+
end
|
|
631
743
|
function Buff.prototype.onExpiration(self)
|
|
632
744
|
local unit = self.unit
|
|
633
|
-
if self[
|
|
634
|
-
(self[
|
|
745
|
+
if self[121] ~= nil then
|
|
746
|
+
(self[102] or unit):damageTarget(unit, self[121] or 0)
|
|
635
747
|
end
|
|
636
|
-
if self[
|
|
637
|
-
(self[
|
|
748
|
+
if self[122] ~= nil then
|
|
749
|
+
(self[102] or unit):healTarget(unit, self[121] or 0)
|
|
638
750
|
end
|
|
639
|
-
if self[
|
|
751
|
+
if self[146] then
|
|
640
752
|
unit:explode()
|
|
641
|
-
elseif self[
|
|
753
|
+
elseif self[145] then
|
|
642
754
|
unit:kill()
|
|
643
755
|
end
|
|
644
756
|
end
|
|
645
757
|
function Buff.prototype.onDeath(self, source)
|
|
646
758
|
local unit = self.unit
|
|
647
|
-
if self[
|
|
759
|
+
if self[123] ~= nil then
|
|
648
760
|
damageArea(
|
|
649
|
-
self[
|
|
650
|
-
self[
|
|
761
|
+
self[102] or unit,
|
|
762
|
+
self[123],
|
|
651
763
|
unit.x,
|
|
652
764
|
unit.y,
|
|
653
|
-
self[123] or 0,
|
|
654
|
-
self[122] or 0,
|
|
655
765
|
self[125] or 0,
|
|
656
766
|
self[124] or 0,
|
|
657
767
|
self[127] or 0,
|
|
658
|
-
self[126] or 0
|
|
768
|
+
self[126] or 0,
|
|
769
|
+
self[129] or 0,
|
|
770
|
+
self[128] or 0
|
|
659
771
|
)
|
|
660
772
|
end
|
|
661
773
|
end
|
|
662
774
|
function Buff.prototype.onDamageDealt(self, target, event)
|
|
663
775
|
if event.isAttack then
|
|
664
|
-
if self[
|
|
665
|
-
local durationIncrease = self[
|
|
666
|
-
local maximumDuration = self[
|
|
776
|
+
if self[108] ~= nil then
|
|
777
|
+
local durationIncrease = self[108]
|
|
778
|
+
local maximumDuration = self[109] or 0
|
|
667
779
|
if maximumDuration > 0 then
|
|
668
780
|
durationIncrease = min(
|
|
669
781
|
durationIncrease,
|
|
670
|
-
max(0, maximumDuration - self[
|
|
782
|
+
max(0, maximumDuration - self[103])
|
|
671
783
|
)
|
|
672
784
|
end
|
|
673
785
|
local remainingDuration = self.remainingDuration + durationIncrease
|
|
674
|
-
local maximumRemainingDuration = self[
|
|
786
|
+
local maximumRemainingDuration = self[110] or 0
|
|
675
787
|
if maximumRemainingDuration > 0 then
|
|
676
788
|
remainingDuration = min(remainingDuration, maximumRemainingDuration)
|
|
677
789
|
end
|
|
678
790
|
self.remainingDuration = remainingDuration
|
|
679
791
|
end
|
|
680
|
-
local autoAttackCount = (self[
|
|
681
|
-
self[
|
|
682
|
-
if autoAttackCount == self[
|
|
792
|
+
local autoAttackCount = (self[130] or 0) + 1
|
|
793
|
+
self[130] = autoAttackCount
|
|
794
|
+
if autoAttackCount == self[131] then
|
|
683
795
|
self:destroy()
|
|
684
796
|
end
|
|
685
797
|
end
|
|
686
798
|
if event.originalAmount ~= 0 then
|
|
687
|
-
local damageDealtEventCount = (self[
|
|
688
|
-
self[
|
|
689
|
-
if damageDealtEventCount == self[
|
|
799
|
+
local damageDealtEventCount = (self[132] or 0) + 1
|
|
800
|
+
self[132] = damageDealtEventCount
|
|
801
|
+
if damageDealtEventCount == self[133] then
|
|
690
802
|
self:destroy()
|
|
691
803
|
end
|
|
692
804
|
end
|
|
693
805
|
end
|
|
694
806
|
function Buff.prototype.onDamageReceived(self, source, event)
|
|
695
807
|
if event.originalAmount ~= 0 then
|
|
696
|
-
local
|
|
697
|
-
|
|
698
|
-
|
|
808
|
+
local absorbedDamage = min(event.amount * (self[136] or 1), (self[137] or 0) - (self[138] or 0))
|
|
809
|
+
if absorbedDamage > 0 then
|
|
810
|
+
event.amount = event.amount - absorbedDamage
|
|
811
|
+
self[138] = (self[138] or 0) + absorbedDamage
|
|
812
|
+
local ____self__139_48 = self[139]
|
|
813
|
+
if ____self__139_48 == nil then
|
|
814
|
+
____self__139_48 = true
|
|
815
|
+
end
|
|
816
|
+
if ____self__139_48 and self[138] >= (self[137] or 0) then
|
|
817
|
+
self:destroy()
|
|
818
|
+
end
|
|
819
|
+
end
|
|
820
|
+
local damageReceivedEventCount = (self[134] or 0) + 1
|
|
821
|
+
self[134] = damageReceivedEventCount
|
|
822
|
+
if damageReceivedEventCount == self[135] then
|
|
699
823
|
self:destroy()
|
|
700
824
|
end
|
|
701
825
|
end
|
|
@@ -705,7 +829,7 @@ __TS__SetDescriptor(
|
|
|
705
829
|
Buff.prototype,
|
|
706
830
|
"source",
|
|
707
831
|
{get = function(self)
|
|
708
|
-
return self[
|
|
832
|
+
return self[102] or self._unit
|
|
709
833
|
end},
|
|
710
834
|
true
|
|
711
835
|
)
|
|
@@ -722,13 +846,13 @@ __TS__SetDescriptor(
|
|
|
722
846
|
"remainingDamageOverDuration",
|
|
723
847
|
{
|
|
724
848
|
get = function(self)
|
|
725
|
-
return self[
|
|
849
|
+
return self[114] or 0
|
|
726
850
|
end,
|
|
727
851
|
set = function(self, remainingDamageOverDuration)
|
|
728
|
-
local remainingDamageOverDurationDelta = remainingDamageOverDuration - (self[
|
|
729
|
-
self[
|
|
730
|
-
local damageOverDuration = (self[
|
|
731
|
-
self[
|
|
852
|
+
local remainingDamageOverDurationDelta = remainingDamageOverDuration - (self[114] or 0)
|
|
853
|
+
self[114] = remainingDamageOverDuration ~= 0 and remainingDamageOverDuration or nil
|
|
854
|
+
local damageOverDuration = (self[111] or 0) + remainingDamageOverDurationDelta
|
|
855
|
+
self[111] = damageOverDuration ~= 0 and damageOverDuration or nil
|
|
732
856
|
end
|
|
733
857
|
},
|
|
734
858
|
true
|
|
@@ -738,13 +862,13 @@ __TS__SetDescriptor(
|
|
|
738
862
|
"damageOverDuration",
|
|
739
863
|
{
|
|
740
864
|
get = function(self)
|
|
741
|
-
return self[
|
|
865
|
+
return self[111] or 0
|
|
742
866
|
end,
|
|
743
867
|
set = function(self, damageOverDuration)
|
|
744
|
-
local damageOverDurationDelta = damageOverDuration - (self[
|
|
745
|
-
self[
|
|
746
|
-
local remainingDamageOverDuration = (self[
|
|
747
|
-
self[
|
|
868
|
+
local damageOverDurationDelta = damageOverDuration - (self[111] or 0)
|
|
869
|
+
self[111] = damageOverDuration ~= 0 and damageOverDuration or nil
|
|
870
|
+
local remainingDamageOverDuration = (self[114] or 0) + damageOverDurationDelta
|
|
871
|
+
self[114] = remainingDamageOverDuration ~= 0 and remainingDamageOverDuration or nil
|
|
748
872
|
end
|
|
749
873
|
},
|
|
750
874
|
true
|
|
@@ -754,10 +878,10 @@ __TS__SetDescriptor(
|
|
|
754
878
|
"damagePerInterval",
|
|
755
879
|
{
|
|
756
880
|
get = function(self)
|
|
757
|
-
return self[
|
|
881
|
+
return self[112] or 0
|
|
758
882
|
end,
|
|
759
883
|
set = function(self, damagePerInterval)
|
|
760
|
-
self[
|
|
884
|
+
self[112] = damagePerInterval ~= 0 and damagePerInterval or nil
|
|
761
885
|
end
|
|
762
886
|
},
|
|
763
887
|
true
|
|
@@ -767,25 +891,25 @@ __TS__SetDescriptor(
|
|
|
767
891
|
"damageInterval",
|
|
768
892
|
{
|
|
769
893
|
get = function(self)
|
|
770
|
-
return self[
|
|
894
|
+
return self[113] or 0
|
|
771
895
|
end,
|
|
772
896
|
set = function(self, damageInterval)
|
|
773
897
|
if damageInterval <= 0 then
|
|
774
|
-
self[
|
|
775
|
-
local timer = self[
|
|
898
|
+
self[113] = damageInterval ~= 0 and damageInterval or nil
|
|
899
|
+
local timer = self[115]
|
|
776
900
|
if timer ~= nil then
|
|
777
901
|
timer:destroy()
|
|
778
|
-
self[
|
|
902
|
+
self[115] = nil
|
|
779
903
|
end
|
|
780
904
|
return
|
|
781
905
|
end
|
|
782
|
-
self[
|
|
783
|
-
local
|
|
784
|
-
local elapsed =
|
|
785
|
-
local timer = self[
|
|
906
|
+
self[113] = damageInterval
|
|
907
|
+
local ____opt_49 = self._timer
|
|
908
|
+
local elapsed = ____opt_49 and ____opt_49.elapsed or 0
|
|
909
|
+
local timer = self[115]
|
|
786
910
|
if timer == nil then
|
|
787
911
|
timer = Timer:create()
|
|
788
|
-
self[
|
|
912
|
+
self[115] = timer
|
|
789
913
|
end
|
|
790
914
|
local initialDelay = damageInterval - (elapsed >= damageInterval and math.fmod(elapsed, damageInterval) or elapsed)
|
|
791
915
|
if initialDelay == damageInterval then
|
|
@@ -802,13 +926,13 @@ __TS__SetDescriptor(
|
|
|
802
926
|
"remainingHealingOverDuration",
|
|
803
927
|
{
|
|
804
928
|
get = function(self)
|
|
805
|
-
return self[
|
|
929
|
+
return self[119] or 0
|
|
806
930
|
end,
|
|
807
931
|
set = function(self, remainingHealingOverDuration)
|
|
808
|
-
local remainingHealingOverDurationDelta = remainingHealingOverDuration - (self[
|
|
809
|
-
self[
|
|
810
|
-
local healingOverDuration = (self[
|
|
811
|
-
self[
|
|
932
|
+
local remainingHealingOverDurationDelta = remainingHealingOverDuration - (self[119] or 0)
|
|
933
|
+
self[114] = remainingHealingOverDuration ~= 0 and remainingHealingOverDuration or nil
|
|
934
|
+
local healingOverDuration = (self[116] or 0) + remainingHealingOverDurationDelta
|
|
935
|
+
self[116] = healingOverDuration ~= 0 and healingOverDuration or nil
|
|
812
936
|
end
|
|
813
937
|
},
|
|
814
938
|
true
|
|
@@ -818,13 +942,13 @@ __TS__SetDescriptor(
|
|
|
818
942
|
"healingOverDuration",
|
|
819
943
|
{
|
|
820
944
|
get = function(self)
|
|
821
|
-
return self[
|
|
945
|
+
return self[116] or 0
|
|
822
946
|
end,
|
|
823
947
|
set = function(self, healingOverDuration)
|
|
824
|
-
local healingOverDurationDelta = healingOverDuration - (self[
|
|
825
|
-
self[
|
|
826
|
-
local remainingHealingOverDuration = (self[
|
|
827
|
-
self[
|
|
948
|
+
local healingOverDurationDelta = healingOverDuration - (self[116] or 0)
|
|
949
|
+
self[116] = healingOverDuration ~= 0 and healingOverDuration or nil
|
|
950
|
+
local remainingHealingOverDuration = (self[119] or 0) + healingOverDurationDelta
|
|
951
|
+
self[119] = remainingHealingOverDuration ~= 0 and remainingHealingOverDuration or nil
|
|
828
952
|
end
|
|
829
953
|
},
|
|
830
954
|
true
|
|
@@ -834,10 +958,10 @@ __TS__SetDescriptor(
|
|
|
834
958
|
"healingPerInterval",
|
|
835
959
|
{
|
|
836
960
|
get = function(self)
|
|
837
|
-
return self[
|
|
961
|
+
return self[117] or 0
|
|
838
962
|
end,
|
|
839
963
|
set = function(self, healingPerInterval)
|
|
840
|
-
self[
|
|
964
|
+
self[117] = healingPerInterval ~= 0 and healingPerInterval or nil
|
|
841
965
|
end
|
|
842
966
|
},
|
|
843
967
|
true
|
|
@@ -847,25 +971,25 @@ __TS__SetDescriptor(
|
|
|
847
971
|
"healingInterval",
|
|
848
972
|
{
|
|
849
973
|
get = function(self)
|
|
850
|
-
return self[
|
|
974
|
+
return self[118] or 0
|
|
851
975
|
end,
|
|
852
976
|
set = function(self, healingInterval)
|
|
853
977
|
if healingInterval <= 0 then
|
|
854
|
-
self[
|
|
855
|
-
local timer = self[
|
|
978
|
+
self[118] = healingInterval ~= 0 and healingInterval or nil
|
|
979
|
+
local timer = self[120]
|
|
856
980
|
if timer ~= nil then
|
|
857
981
|
timer:destroy()
|
|
858
|
-
self[
|
|
982
|
+
self[120] = nil
|
|
859
983
|
end
|
|
860
984
|
return
|
|
861
985
|
end
|
|
862
|
-
self[
|
|
863
|
-
local
|
|
864
|
-
local elapsed =
|
|
865
|
-
local timer = self[
|
|
986
|
+
self[118] = healingInterval
|
|
987
|
+
local ____opt_51 = self._timer
|
|
988
|
+
local elapsed = ____opt_51 and ____opt_51.elapsed or 0
|
|
989
|
+
local timer = self[120]
|
|
866
990
|
if timer == nil then
|
|
867
991
|
timer = Timer:create()
|
|
868
|
-
self[
|
|
992
|
+
self[120] = timer
|
|
869
993
|
end
|
|
870
994
|
local initialDelay = healingInterval - (elapsed >= healingInterval and math.fmod(elapsed, healingInterval) or elapsed)
|
|
871
995
|
if initialDelay == healingInterval then
|
|
@@ -882,10 +1006,10 @@ __TS__SetDescriptor(
|
|
|
882
1006
|
"damageOnExpiration",
|
|
883
1007
|
{
|
|
884
1008
|
get = function(self)
|
|
885
|
-
return self[
|
|
1009
|
+
return self[121] or 0
|
|
886
1010
|
end,
|
|
887
1011
|
set = function(self, damageOnExpiration)
|
|
888
|
-
self[
|
|
1012
|
+
self[121] = damageOnExpiration ~= 0 and damageOnExpiration or nil
|
|
889
1013
|
end
|
|
890
1014
|
},
|
|
891
1015
|
true
|
|
@@ -895,10 +1019,10 @@ __TS__SetDescriptor(
|
|
|
895
1019
|
"healingOnExpiration",
|
|
896
1020
|
{
|
|
897
1021
|
get = function(self)
|
|
898
|
-
return self[
|
|
1022
|
+
return self[122] or 0
|
|
899
1023
|
end,
|
|
900
1024
|
set = function(self, healingOnExpiration)
|
|
901
|
-
self[
|
|
1025
|
+
self[122] = healingOnExpiration ~= 0 and healingOnExpiration or nil
|
|
902
1026
|
end
|
|
903
1027
|
},
|
|
904
1028
|
true
|
|
@@ -929,6 +1053,19 @@ __TS__SetDescriptor(
|
|
|
929
1053
|
},
|
|
930
1054
|
true
|
|
931
1055
|
)
|
|
1056
|
+
__TS__SetDescriptor(
|
|
1057
|
+
Buff.prototype,
|
|
1058
|
+
"returnedMeleeDamageFactor",
|
|
1059
|
+
{
|
|
1060
|
+
get = function(self)
|
|
1061
|
+
return self:getUnitBonus(UnitBonusType.RETURNED_MELEE_DAMAGE_FACTOR)
|
|
1062
|
+
end,
|
|
1063
|
+
set = function(self, returnedMeleeDamageFactor)
|
|
1064
|
+
self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.RETURNED_MELEE_DAMAGE_FACTOR, returnedMeleeDamageFactor)
|
|
1065
|
+
end
|
|
1066
|
+
},
|
|
1067
|
+
true
|
|
1068
|
+
)
|
|
932
1069
|
__TS__SetDescriptor(
|
|
933
1070
|
Buff.prototype,
|
|
934
1071
|
"armorIncrease",
|
|
@@ -942,30 +1079,79 @@ __TS__SetDescriptor(
|
|
|
942
1079
|
},
|
|
943
1080
|
true
|
|
944
1081
|
)
|
|
1082
|
+
__TS__SetDescriptor(
|
|
1083
|
+
Buff.prototype,
|
|
1084
|
+
"maxHealthIncrease",
|
|
1085
|
+
{
|
|
1086
|
+
get = function(self)
|
|
1087
|
+
return self:getUnitBonus(UnitBonusType.HEALTH)
|
|
1088
|
+
end,
|
|
1089
|
+
set = function(self, maxHealthIncrease)
|
|
1090
|
+
self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.HEALTH, maxHealthIncrease)
|
|
1091
|
+
end
|
|
1092
|
+
},
|
|
1093
|
+
true
|
|
1094
|
+
)
|
|
1095
|
+
__TS__SetDescriptor(
|
|
1096
|
+
Buff.prototype,
|
|
1097
|
+
"maxManaIncrease",
|
|
1098
|
+
{
|
|
1099
|
+
get = function(self)
|
|
1100
|
+
return self:getUnitBonus(UnitBonusType.MANA)
|
|
1101
|
+
end,
|
|
1102
|
+
set = function(self, maxManaIncrease)
|
|
1103
|
+
self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.MANA, maxManaIncrease)
|
|
1104
|
+
end
|
|
1105
|
+
},
|
|
1106
|
+
true
|
|
1107
|
+
)
|
|
1108
|
+
__TS__SetDescriptor(
|
|
1109
|
+
Buff.prototype,
|
|
1110
|
+
"turnsIntoGhost",
|
|
1111
|
+
{
|
|
1112
|
+
get = function(self)
|
|
1113
|
+
local ____self__140_53 = self[140]
|
|
1114
|
+
if ____self__140_53 == nil then
|
|
1115
|
+
____self__140_53 = false
|
|
1116
|
+
end
|
|
1117
|
+
return ____self__140_53
|
|
1118
|
+
end,
|
|
1119
|
+
set = function(self, turnsIntoGhost)
|
|
1120
|
+
if not turnsIntoGhost and self[140] then
|
|
1121
|
+
self.object:decrementGhostCounter()
|
|
1122
|
+
self[140] = nil
|
|
1123
|
+
elseif turnsIntoGhost and not self[140] then
|
|
1124
|
+
self.object:incrementGhostCounter()
|
|
1125
|
+
self[140] = true
|
|
1126
|
+
end
|
|
1127
|
+
end
|
|
1128
|
+
},
|
|
1129
|
+
true
|
|
1130
|
+
)
|
|
945
1131
|
__TS__SetDescriptor(
|
|
946
1132
|
Buff.prototype,
|
|
947
1133
|
"stuns",
|
|
948
1134
|
{
|
|
949
1135
|
get = function(self)
|
|
950
|
-
local
|
|
951
|
-
if
|
|
952
|
-
|
|
1136
|
+
local ____self__141_54 = self[141]
|
|
1137
|
+
if ____self__141_54 == nil then
|
|
1138
|
+
____self__141_54 = false
|
|
953
1139
|
end
|
|
954
|
-
return
|
|
1140
|
+
return ____self__141_54
|
|
955
1141
|
end,
|
|
956
1142
|
set = function(self, stuns)
|
|
957
|
-
if not stuns and self[
|
|
958
|
-
if self[
|
|
959
|
-
self.object:
|
|
1143
|
+
if not stuns and self[141] then
|
|
1144
|
+
if self[142] then
|
|
1145
|
+
self.object:decrementForceStunCounter()
|
|
960
1146
|
end
|
|
961
1147
|
self.object:decrementStunCounter()
|
|
962
|
-
self[
|
|
963
|
-
elseif stuns and not self[
|
|
964
|
-
if self[
|
|
965
|
-
self.object:
|
|
1148
|
+
self[141] = nil
|
|
1149
|
+
elseif stuns and not self[141] then
|
|
1150
|
+
if self[142] then
|
|
1151
|
+
self.object:incrementForceStunCounter()
|
|
966
1152
|
end
|
|
967
1153
|
self.object:incrementStunCounter()
|
|
968
|
-
self[
|
|
1154
|
+
self[141] = true
|
|
969
1155
|
end
|
|
970
1156
|
end
|
|
971
1157
|
},
|
|
@@ -976,23 +1162,23 @@ __TS__SetDescriptor(
|
|
|
976
1162
|
"ignoresStunImmunity",
|
|
977
1163
|
{
|
|
978
1164
|
get = function(self)
|
|
979
|
-
local
|
|
980
|
-
if
|
|
981
|
-
|
|
1165
|
+
local ____self__142_55 = self[142]
|
|
1166
|
+
if ____self__142_55 == nil then
|
|
1167
|
+
____self__142_55 = false
|
|
982
1168
|
end
|
|
983
|
-
return
|
|
1169
|
+
return ____self__142_55
|
|
984
1170
|
end,
|
|
985
1171
|
set = function(self, ignoresStunImmunity)
|
|
986
|
-
if not ignoresStunImmunity and self[
|
|
987
|
-
if self[
|
|
988
|
-
self.object:
|
|
1172
|
+
if not ignoresStunImmunity and self[142] then
|
|
1173
|
+
if self[141] then
|
|
1174
|
+
self.object:decrementForceStunCounter()
|
|
989
1175
|
end
|
|
990
|
-
self[
|
|
991
|
-
elseif ignoresStunImmunity and not self[
|
|
992
|
-
if self[
|
|
993
|
-
self.object:
|
|
1176
|
+
self[142] = nil
|
|
1177
|
+
elseif ignoresStunImmunity and not self[142] then
|
|
1178
|
+
if self[141] then
|
|
1179
|
+
self.object:incrementForceStunCounter()
|
|
994
1180
|
end
|
|
995
|
-
self[
|
|
1181
|
+
self[142] = true
|
|
996
1182
|
end
|
|
997
1183
|
end
|
|
998
1184
|
},
|
|
@@ -1003,19 +1189,19 @@ __TS__SetDescriptor(
|
|
|
1003
1189
|
"disablesAutoAttack",
|
|
1004
1190
|
{
|
|
1005
1191
|
get = function(self)
|
|
1006
|
-
local
|
|
1007
|
-
if
|
|
1008
|
-
|
|
1192
|
+
local ____self__143_56 = self[143]
|
|
1193
|
+
if ____self__143_56 == nil then
|
|
1194
|
+
____self__143_56 = false
|
|
1009
1195
|
end
|
|
1010
|
-
return
|
|
1196
|
+
return ____self__143_56
|
|
1011
1197
|
end,
|
|
1012
1198
|
set = function(self, disablesAutoAttack)
|
|
1013
|
-
if not disablesAutoAttack and self[
|
|
1199
|
+
if not disablesAutoAttack and self[143] then
|
|
1014
1200
|
self.object:decrementDisableAutoAttackCounter()
|
|
1015
|
-
self[
|
|
1016
|
-
elseif disablesAutoAttack and not self[
|
|
1201
|
+
self[143] = nil
|
|
1202
|
+
elseif disablesAutoAttack and not self[143] then
|
|
1017
1203
|
self.object:incrementDisableAutoAttackCounter()
|
|
1018
|
-
self[
|
|
1204
|
+
self[143] = true
|
|
1019
1205
|
end
|
|
1020
1206
|
end
|
|
1021
1207
|
},
|
|
@@ -1026,19 +1212,19 @@ __TS__SetDescriptor(
|
|
|
1026
1212
|
"providesInvulnerability",
|
|
1027
1213
|
{
|
|
1028
1214
|
get = function(self)
|
|
1029
|
-
local
|
|
1030
|
-
if
|
|
1031
|
-
|
|
1215
|
+
local ____self__144_57 = self[144]
|
|
1216
|
+
if ____self__144_57 == nil then
|
|
1217
|
+
____self__144_57 = false
|
|
1032
1218
|
end
|
|
1033
|
-
return
|
|
1219
|
+
return ____self__144_57
|
|
1034
1220
|
end,
|
|
1035
1221
|
set = function(self, providesInvulnerability)
|
|
1036
|
-
if not providesInvulnerability and self[
|
|
1222
|
+
if not providesInvulnerability and self[144] then
|
|
1037
1223
|
self.object:decrementInvulnerabilityCounter()
|
|
1038
|
-
self[
|
|
1039
|
-
elseif providesInvulnerability and not self[
|
|
1224
|
+
self[144] = nil
|
|
1225
|
+
elseif providesInvulnerability and not self[144] then
|
|
1040
1226
|
self.object:incrementInvulnerabilityCounter()
|
|
1041
|
-
self[
|
|
1227
|
+
self[144] = true
|
|
1042
1228
|
end
|
|
1043
1229
|
end
|
|
1044
1230
|
},
|
|
@@ -1049,17 +1235,17 @@ __TS__SetDescriptor(
|
|
|
1049
1235
|
"killsOnExpiration",
|
|
1050
1236
|
{
|
|
1051
1237
|
get = function(self)
|
|
1052
|
-
local
|
|
1053
|
-
if
|
|
1054
|
-
|
|
1238
|
+
local ____self__145_58 = self[145]
|
|
1239
|
+
if ____self__145_58 == nil then
|
|
1240
|
+
____self__145_58 = false
|
|
1055
1241
|
end
|
|
1056
|
-
return
|
|
1242
|
+
return ____self__145_58
|
|
1057
1243
|
end,
|
|
1058
1244
|
set = function(self, killsOnExpiration)
|
|
1059
|
-
if not killsOnExpiration and self[
|
|
1060
|
-
self[
|
|
1061
|
-
elseif killsOnExpiration and not self[
|
|
1062
|
-
self[
|
|
1245
|
+
if not killsOnExpiration and self[145] then
|
|
1246
|
+
self[145] = nil
|
|
1247
|
+
elseif killsOnExpiration and not self[145] then
|
|
1248
|
+
self[145] = true
|
|
1063
1249
|
end
|
|
1064
1250
|
end
|
|
1065
1251
|
},
|
|
@@ -1070,17 +1256,40 @@ __TS__SetDescriptor(
|
|
|
1070
1256
|
"explodesOnExpiration",
|
|
1071
1257
|
{
|
|
1072
1258
|
get = function(self)
|
|
1073
|
-
local
|
|
1074
|
-
if
|
|
1075
|
-
|
|
1259
|
+
local ____self__146_59 = self[146]
|
|
1260
|
+
if ____self__146_59 == nil then
|
|
1261
|
+
____self__146_59 = false
|
|
1076
1262
|
end
|
|
1077
|
-
return
|
|
1263
|
+
return ____self__146_59
|
|
1078
1264
|
end,
|
|
1079
1265
|
set = function(self, killsOnExpiration)
|
|
1080
|
-
if not killsOnExpiration and self[
|
|
1081
|
-
self[
|
|
1082
|
-
elseif killsOnExpiration and not self[
|
|
1083
|
-
self[
|
|
1266
|
+
if not killsOnExpiration and self[146] then
|
|
1267
|
+
self[146] = nil
|
|
1268
|
+
elseif killsOnExpiration and not self[146] then
|
|
1269
|
+
self[146] = true
|
|
1270
|
+
end
|
|
1271
|
+
end
|
|
1272
|
+
},
|
|
1273
|
+
true
|
|
1274
|
+
)
|
|
1275
|
+
__TS__SetDescriptor(
|
|
1276
|
+
Buff.prototype,
|
|
1277
|
+
"sharesVisionWithSource",
|
|
1278
|
+
{
|
|
1279
|
+
get = function(self)
|
|
1280
|
+
local ____self__150_60 = self[150]
|
|
1281
|
+
if ____self__150_60 == nil then
|
|
1282
|
+
____self__150_60 = false
|
|
1283
|
+
end
|
|
1284
|
+
return ____self__150_60
|
|
1285
|
+
end,
|
|
1286
|
+
set = function(self, sharesVisionWithSource)
|
|
1287
|
+
if not sharesVisionWithSource and self[150] then
|
|
1288
|
+
unshareVisionWithSource(self)
|
|
1289
|
+
self[150] = nil
|
|
1290
|
+
elseif sharesVisionWithSource and not self[150] then
|
|
1291
|
+
self[150] = true
|
|
1292
|
+
shareVisionWithSource(self)
|
|
1084
1293
|
end
|
|
1085
1294
|
end
|
|
1086
1295
|
},
|
|
@@ -1091,13 +1300,13 @@ __TS__SetDescriptor(
|
|
|
1091
1300
|
"maximumDamageDealtEventCount",
|
|
1092
1301
|
{
|
|
1093
1302
|
get = function(self)
|
|
1094
|
-
return self[
|
|
1303
|
+
return self[133] or 0
|
|
1095
1304
|
end,
|
|
1096
1305
|
set = function(self, maximumDamageDealtEventCount)
|
|
1097
1306
|
if maximumDamageDealtEventCount == 0 then
|
|
1098
|
-
self[
|
|
1307
|
+
self[133] = nil
|
|
1099
1308
|
else
|
|
1100
|
-
self[
|
|
1309
|
+
self[133] = maximumDamageDealtEventCount
|
|
1101
1310
|
end
|
|
1102
1311
|
end
|
|
1103
1312
|
},
|
|
@@ -1108,13 +1317,13 @@ __TS__SetDescriptor(
|
|
|
1108
1317
|
"maximumDamageReceivedEventCount",
|
|
1109
1318
|
{
|
|
1110
1319
|
get = function(self)
|
|
1111
|
-
return self[
|
|
1320
|
+
return self[135] or 0
|
|
1112
1321
|
end,
|
|
1113
1322
|
set = function(self, maximumDamageReceivedEventCount)
|
|
1114
1323
|
if maximumDamageReceivedEventCount == 0 then
|
|
1115
|
-
self[
|
|
1324
|
+
self[135] = nil
|
|
1116
1325
|
else
|
|
1117
|
-
self[
|
|
1326
|
+
self[135] = maximumDamageReceivedEventCount
|
|
1118
1327
|
end
|
|
1119
1328
|
end
|
|
1120
1329
|
},
|
|
@@ -1125,13 +1334,13 @@ __TS__SetDescriptor(
|
|
|
1125
1334
|
"maximumAutoAttackCount",
|
|
1126
1335
|
{
|
|
1127
1336
|
get = function(self)
|
|
1128
|
-
return self[
|
|
1337
|
+
return self[131] or 0
|
|
1129
1338
|
end,
|
|
1130
1339
|
set = function(self, maximumAutoAttackCount)
|
|
1131
1340
|
if maximumAutoAttackCount == 0 then
|
|
1132
|
-
self[
|
|
1341
|
+
self[131] = nil
|
|
1133
1342
|
else
|
|
1134
|
-
self[
|
|
1343
|
+
self[131] = maximumAutoAttackCount
|
|
1135
1344
|
end
|
|
1136
1345
|
end
|
|
1137
1346
|
},
|
|
@@ -1142,10 +1351,10 @@ __TS__SetDescriptor(
|
|
|
1142
1351
|
"durationIncreaseOnAutoAttack",
|
|
1143
1352
|
{
|
|
1144
1353
|
get = function(self)
|
|
1145
|
-
return self[
|
|
1354
|
+
return self[108] or 0
|
|
1146
1355
|
end,
|
|
1147
1356
|
set = function(self, durationIncreaseOnAutoAttack)
|
|
1148
|
-
self[
|
|
1357
|
+
self[108] = durationIncreaseOnAutoAttack
|
|
1149
1358
|
end
|
|
1150
1359
|
},
|
|
1151
1360
|
true
|
|
@@ -1189,12 +1398,39 @@ __TS__SetDescriptor(
|
|
|
1189
1398
|
},
|
|
1190
1399
|
true
|
|
1191
1400
|
)
|
|
1401
|
+
__TS__SetDescriptor(
|
|
1402
|
+
Buff.prototype,
|
|
1403
|
+
"manaRegenerationRateIncreaseFactor",
|
|
1404
|
+
{
|
|
1405
|
+
get = function(self)
|
|
1406
|
+
return self:getUnitBonus(UnitBonusType.MANA_REGENERATION_RATE_FACTOR)
|
|
1407
|
+
end,
|
|
1408
|
+
set = function(self, manaRegenerationRateIncreaseFactor)
|
|
1409
|
+
self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.MANA_REGENERATION_RATE_FACTOR, manaRegenerationRateIncreaseFactor)
|
|
1410
|
+
end
|
|
1411
|
+
},
|
|
1412
|
+
true
|
|
1413
|
+
)
|
|
1192
1414
|
__TS__SetDescriptor(
|
|
1193
1415
|
Buff.prototype,
|
|
1194
1416
|
"duration",
|
|
1195
|
-
{
|
|
1196
|
-
|
|
1197
|
-
|
|
1417
|
+
{
|
|
1418
|
+
get = function(self)
|
|
1419
|
+
return self[103]
|
|
1420
|
+
end,
|
|
1421
|
+
set = function(self, duration)
|
|
1422
|
+
if duration <= 0 then
|
|
1423
|
+
local timer = self._timer
|
|
1424
|
+
if timer ~= nil then
|
|
1425
|
+
timer:destroy()
|
|
1426
|
+
self._timer = nil
|
|
1427
|
+
end
|
|
1428
|
+
self[103] = 0
|
|
1429
|
+
else
|
|
1430
|
+
self.remainingDuration = self.remainingDuration + (duration - self[103])
|
|
1431
|
+
end
|
|
1432
|
+
end
|
|
1433
|
+
},
|
|
1198
1434
|
true
|
|
1199
1435
|
)
|
|
1200
1436
|
__TS__SetDescriptor(
|
|
@@ -1202,15 +1438,15 @@ __TS__SetDescriptor(
|
|
|
1202
1438
|
"remainingDuration",
|
|
1203
1439
|
{
|
|
1204
1440
|
get = function(self)
|
|
1205
|
-
local
|
|
1206
|
-
return
|
|
1441
|
+
local ____opt_61 = self._timer
|
|
1442
|
+
return ____opt_61 and ____opt_61.remaining or 0
|
|
1207
1443
|
end,
|
|
1208
1444
|
set = function(self, remainingDuration)
|
|
1209
|
-
local
|
|
1210
|
-
local
|
|
1211
|
-
local remainingDurationDelta =
|
|
1445
|
+
local ____remainingDuration_65 = remainingDuration
|
|
1446
|
+
local ____opt_63 = self._timer
|
|
1447
|
+
local remainingDurationDelta = ____remainingDuration_65 - (____opt_63 and ____opt_63.remaining or 0)
|
|
1212
1448
|
if remainingDurationDelta ~= 0 then
|
|
1213
|
-
self[
|
|
1449
|
+
self[103] = self[103] + remainingDurationDelta
|
|
1214
1450
|
if remainingDuration <= 0 then
|
|
1215
1451
|
Timer:run(destroyBuff, self)
|
|
1216
1452
|
else
|
|
@@ -1222,7 +1458,8 @@ __TS__SetDescriptor(
|
|
|
1222
1458
|
self._level,
|
|
1223
1459
|
remainingDuration,
|
|
1224
1460
|
self._spellStealPriority,
|
|
1225
|
-
self._learnLevelMinimum
|
|
1461
|
+
self._learnLevelMinimum,
|
|
1462
|
+
self[147]
|
|
1226
1463
|
) then
|
|
1227
1464
|
local timer = self._timer
|
|
1228
1465
|
if timer == nil then
|
|
@@ -1236,37 +1473,135 @@ __TS__SetDescriptor(
|
|
|
1236
1473
|
end
|
|
1237
1474
|
},
|
|
1238
1475
|
true
|
|
1239
|
-
)
|
|
1476
|
+
)
|
|
1477
|
+
__TS__SetDescriptor(
|
|
1478
|
+
Buff.prototype,
|
|
1479
|
+
"absorbedDamageFactor",
|
|
1480
|
+
{
|
|
1481
|
+
get = function(self)
|
|
1482
|
+
return self[136] or 1
|
|
1483
|
+
end,
|
|
1484
|
+
set = function(self, absorbedDamageFactor)
|
|
1485
|
+
if absorbedDamageFactor == 1 then
|
|
1486
|
+
self[136] = nil
|
|
1487
|
+
else
|
|
1488
|
+
self[136] = absorbedDamageFactor
|
|
1489
|
+
end
|
|
1490
|
+
end
|
|
1491
|
+
},
|
|
1492
|
+
true
|
|
1493
|
+
)
|
|
1494
|
+
__TS__SetDescriptor(
|
|
1495
|
+
Buff.prototype,
|
|
1496
|
+
"maximumDamageAbsorbed",
|
|
1497
|
+
{
|
|
1498
|
+
get = function(self)
|
|
1499
|
+
return self[137] or 0
|
|
1500
|
+
end,
|
|
1501
|
+
set = function(self, maximumDamageAbsorbed)
|
|
1502
|
+
if maximumDamageAbsorbed == 0 then
|
|
1503
|
+
self[137] = nil
|
|
1504
|
+
else
|
|
1505
|
+
self[137] = maximumDamageAbsorbed
|
|
1506
|
+
end
|
|
1507
|
+
end
|
|
1508
|
+
},
|
|
1509
|
+
true
|
|
1510
|
+
)
|
|
1511
|
+
__TS__SetDescriptor(
|
|
1512
|
+
Buff.prototype,
|
|
1513
|
+
"damageAbsorbed",
|
|
1514
|
+
{get = function(self)
|
|
1515
|
+
return self[138] or 0
|
|
1516
|
+
end},
|
|
1517
|
+
true
|
|
1518
|
+
)
|
|
1519
|
+
__TS__SetDescriptor(
|
|
1520
|
+
Buff.prototype,
|
|
1521
|
+
"destroysOnMaximumDamageAbsorbed",
|
|
1522
|
+
{
|
|
1523
|
+
get = function(self)
|
|
1524
|
+
local ____self__139_66 = self[139]
|
|
1525
|
+
if ____self__139_66 == nil then
|
|
1526
|
+
____self__139_66 = true
|
|
1527
|
+
end
|
|
1528
|
+
return ____self__139_66
|
|
1529
|
+
end,
|
|
1530
|
+
set = function(self, destroysOnMaximumDamageAbsorbed)
|
|
1531
|
+
local ____destroysOnMaximumDamageAbsorbed_67
|
|
1532
|
+
if destroysOnMaximumDamageAbsorbed then
|
|
1533
|
+
____destroysOnMaximumDamageAbsorbed_67 = nil
|
|
1534
|
+
else
|
|
1535
|
+
____destroysOnMaximumDamageAbsorbed_67 = false
|
|
1536
|
+
end
|
|
1537
|
+
self[139] = ____destroysOnMaximumDamageAbsorbed_67
|
|
1538
|
+
end
|
|
1539
|
+
},
|
|
1540
|
+
true
|
|
1541
|
+
)
|
|
1542
|
+
__TS__SetDescriptor(
|
|
1543
|
+
Buff.prototype,
|
|
1544
|
+
"abilityCooldownFactor",
|
|
1545
|
+
{
|
|
1546
|
+
get = function(self)
|
|
1547
|
+
return self[148] or 1
|
|
1548
|
+
end,
|
|
1549
|
+
set = function(self, abilityCooldownFactor)
|
|
1550
|
+
local previousAbilityCooldownModifier = self[149]
|
|
1551
|
+
if previousAbilityCooldownModifier then
|
|
1552
|
+
for ____, ability in ipairs(self._unit.abilities) do
|
|
1553
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:removeModifier(ability, previousAbilityCooldownModifier)
|
|
1554
|
+
end
|
|
1555
|
+
end
|
|
1556
|
+
local function modifier(ability, level, cooldown)
|
|
1557
|
+
return cooldown * abilityCooldownFactor
|
|
1558
|
+
end
|
|
1559
|
+
for ____, ability in ipairs(self._unit.abilities) do
|
|
1560
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:applyModifier(ability, modifier)
|
|
1561
|
+
end
|
|
1562
|
+
self[149] = modifier
|
|
1563
|
+
self[148] = abilityCooldownFactor
|
|
1564
|
+
end
|
|
1565
|
+
},
|
|
1566
|
+
true
|
|
1567
|
+
)
|
|
1568
|
+
Buff.createdEvent = buffCreatedEvent
|
|
1569
|
+
Buff.beingDestroyedEvent = buffBeingDestroyedEvent;
|
|
1240
1570
|
(function(self)
|
|
1241
|
-
local function destroyBuffIfNeeded(buff)
|
|
1242
|
-
|
|
1243
|
-
|
|
1571
|
+
local function destroyBuffIfNeeded(buff, isDispel, source)
|
|
1572
|
+
local currentHandle = getUnitAbility(buff[101].handle, buff.typeId)
|
|
1573
|
+
if currentHandle ~= buff.handle and buff[100] == 1 then
|
|
1574
|
+
if isDispel and currentHandle == nil and buff.unit.isAlive and buff.resistanceType == 1 and (buff._timer == nil or buff.remainingDuration > 0) then
|
|
1575
|
+
buff:dispel(source)
|
|
1576
|
+
else
|
|
1577
|
+
buff:destroy()
|
|
1578
|
+
end
|
|
1244
1579
|
end
|
|
1245
1580
|
end
|
|
1246
|
-
____exports.checkBuff = function(unit, buffTypeId)
|
|
1581
|
+
____exports.checkBuff = function(unit, buffTypeId, isDispel, source)
|
|
1247
1582
|
local buffByTypeId = buffByTypeIdByUnit[unit]
|
|
1248
1583
|
if buffByTypeId ~= nil then
|
|
1249
1584
|
local buff = buffByTypeId[buffTypeId]
|
|
1250
1585
|
if buff ~= nil then
|
|
1251
|
-
destroyBuffIfNeeded(buff)
|
|
1586
|
+
destroyBuffIfNeeded(buff, isDispel, source)
|
|
1252
1587
|
end
|
|
1253
1588
|
end
|
|
1254
1589
|
end
|
|
1255
|
-
____exports.checkBuffs = function(unit)
|
|
1256
|
-
____exports.Buff:forAll(unit, destroyBuffIfNeeded)
|
|
1590
|
+
____exports.checkBuffs = function(unit, isDispel, source)
|
|
1591
|
+
____exports.Buff:forAll(unit, destroyBuffIfNeeded, isDispel, source)
|
|
1257
1592
|
end
|
|
1258
1593
|
Unit.abilityChannelingStartEvent:addListener(
|
|
1259
1594
|
0,
|
|
1260
1595
|
function(caster)
|
|
1261
|
-
____exports.checkBuffs(caster)
|
|
1262
|
-
Timer:run(____exports.checkBuffs, caster)
|
|
1596
|
+
____exports.checkBuffs(caster, true, caster)
|
|
1597
|
+
Timer:run(____exports.checkBuffs, caster, true, caster)
|
|
1263
1598
|
end
|
|
1264
1599
|
)
|
|
1265
1600
|
Unit.abilityUnitTargetChannelingStartEvent:addListener(
|
|
1266
1601
|
0,
|
|
1267
1602
|
function(caster, ability, target)
|
|
1268
|
-
____exports.checkBuffs(target)
|
|
1269
|
-
Timer:run(____exports.checkBuffs, target)
|
|
1603
|
+
____exports.checkBuffs(target, true, caster)
|
|
1604
|
+
Timer:run(____exports.checkBuffs, target, true, caster)
|
|
1270
1605
|
end
|
|
1271
1606
|
)
|
|
1272
1607
|
Unit.abilityPointTargetChannelingStartEvent:addListener(
|
|
@@ -1277,18 +1612,53 @@ __TS__SetDescriptor(
|
|
|
1277
1612
|
y,
|
|
1278
1613
|
ability:getField(ABILITY_RLF_AREA_OF_EFFECT)
|
|
1279
1614
|
)
|
|
1280
|
-
forEach(units, ____exports.checkBuffs)
|
|
1281
|
-
Timer:run(
|
|
1615
|
+
forEach(units, ____exports.checkBuffs, true, caster)
|
|
1616
|
+
Timer:run(
|
|
1617
|
+
forEach,
|
|
1618
|
+
units,
|
|
1619
|
+
____exports.checkBuffs,
|
|
1620
|
+
true,
|
|
1621
|
+
caster
|
|
1622
|
+
)
|
|
1623
|
+
end
|
|
1624
|
+
)
|
|
1625
|
+
Unit.abilityNoTargetChannelingStartEvent:addListener(
|
|
1626
|
+
0,
|
|
1627
|
+
function(caster, ability)
|
|
1628
|
+
local radius = ability:getField(ABILITY_RLF_AREA_OF_EFFECT)
|
|
1629
|
+
if radius > 0 then
|
|
1630
|
+
local units = Unit:getInCollisionRange(caster.x, caster.y, radius)
|
|
1631
|
+
forEach(units, ____exports.checkBuffs, true, caster)
|
|
1632
|
+
Timer:run(
|
|
1633
|
+
forEach,
|
|
1634
|
+
units,
|
|
1635
|
+
____exports.checkBuffs,
|
|
1636
|
+
true,
|
|
1637
|
+
caster
|
|
1638
|
+
)
|
|
1639
|
+
end
|
|
1282
1640
|
end
|
|
1283
1641
|
)
|
|
1284
1642
|
Unit.onDamage:addListener(
|
|
1285
1643
|
0,
|
|
1286
1644
|
function(source, target)
|
|
1287
1645
|
if source ~= nil then
|
|
1288
|
-
____exports.checkBuffs
|
|
1646
|
+
Timer:run(____exports.checkBuffs, source, false)
|
|
1289
1647
|
end
|
|
1290
|
-
____exports.checkBuffs
|
|
1648
|
+
Timer:run(____exports.checkBuffs, target, false)
|
|
1649
|
+
end
|
|
1650
|
+
)
|
|
1651
|
+
Unit.deathEvent:addListener(
|
|
1652
|
+
-999999,
|
|
1653
|
+
function(unit)
|
|
1654
|
+
____exports.Buff:forAll(unit, destroyBuffOnDeath)
|
|
1291
1655
|
end
|
|
1292
1656
|
)
|
|
1657
|
+
buffCreatedEvent:addListener(function(buff)
|
|
1658
|
+
UnitBehavior:forAll(buff.unit, "onBuffGained", buff)
|
|
1659
|
+
end)
|
|
1660
|
+
buffBeingDestroyedEvent:addListener(function(buff)
|
|
1661
|
+
UnitBehavior:forAll(buff.unit, "onBuffLost", buff)
|
|
1662
|
+
end)
|
|
1293
1663
|
end)(Buff)
|
|
1294
1664
|
return ____exports
|