warscript 0.0.1-dev.9c98c3a → 0.0.1-dev.9d07b64
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/core/dummy.lua +4 -2
- package/core/types/effect.d.ts +11 -1
- package/core/types/effect.lua +43 -77
- package/core/types/frame.d.ts +16 -2
- package/core/types/frame.lua +128 -67
- 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/player.d.ts +18 -1
- package/core/types/player.lua +73 -25
- package/core/types/playerColor.lua +4 -3
- package/core/types/sound.d.ts +1 -1
- package/core/types/sound.lua +14 -9
- package/core/types/tileCell.d.ts +9 -3
- package/core/types/tileCell.lua +16 -0
- 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 +109 -3
- package/decl/native.d.ts +705 -7
- 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 +10 -2
- package/engine/behavior.lua +157 -76
- package/engine/behaviour/ability/apply-buff.lua +4 -4
- package/engine/behaviour/ability/apply-unit-behavior.lua +5 -0
- package/engine/behaviour/ability/damage.d.ts +4 -0
- package/engine/behaviour/ability/damage.lua +19 -15
- package/engine/behaviour/ability/emulate-impact.lua +5 -4
- 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.d.ts +13 -6
- package/engine/behaviour/ability.lua +102 -9
- package/engine/behaviour/unit/stun-immunity.d.ts +7 -5
- package/engine/behaviour/unit/stun-immunity.lua +6 -5
- package/engine/behaviour/unit.d.ts +8 -3
- package/engine/behaviour/unit.lua +102 -24
- package/engine/buff.d.ts +112 -54
- package/engine/buff.lua +559 -280
- package/engine/index.d.ts +2 -1
- package/engine/internal/ability.d.ts +7 -0
- package/engine/internal/ability.lua +65 -36
- 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 +27 -4
- package/engine/internal/item.d.ts +20 -5
- package/engine/internal/item.lua +146 -57
- package/engine/internal/mechanics/cast-ability.lua +6 -3
- 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/add-item-to-slot-init.lua +3 -14
- package/engine/internal/unit/add-item-to-slot.lua +53 -12
- 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 +3 -3
- package/engine/internal/unit/order.lua +10 -10
- 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 +63 -2
- package/engine/internal/unit+bonus.lua +3 -3
- package/engine/internal/unit+damage.d.ts +9 -0
- package/engine/internal/unit+damage.lua +33 -0
- package/engine/internal/unit+rally.lua +9 -31
- package/engine/internal/unit-missile-data.lua +58 -32
- package/engine/internal/unit-missile-launch.lua +29 -19
- package/engine/internal/unit.d.ts +15 -29
- package/engine/internal/unit.lua +192 -272
- package/engine/local-client.d.ts +28 -0
- package/engine/local-client.lua +324 -54
- package/engine/object-data/auxiliary/attachment-preset.d.ts +7 -0
- package/engine/object-data/auxiliary/attachment-preset.lua +7 -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/order-type.d.ts +939 -0
- package/engine/object-data/auxiliary/order-type.lua +2 -0
- package/engine/object-data/auxiliary/sound-set-name.d.ts +14 -3
- package/engine/object-data/auxiliary/unit-attribute.lua +1 -1
- 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/blank-configurable.lua +2 -2
- 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/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/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/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/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-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/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/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/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 +33 -8
- package/engine/object-data/entry/ability-type.lua +286 -11
- package/engine/object-data/entry/buff-type/applicable.lua +122 -111
- package/engine/object-data/entry/buff-type.d.ts +6 -2
- package/engine/object-data/entry/buff-type.lua +26 -0
- 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 +84 -0
- 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 +2 -2
- package/engine/object-data/entry/unit-type.d.ts +61 -2
- package/engine/object-data/entry/unit-type.lua +444 -52
- package/engine/object-data/entry/upgrade.d.ts +2 -2
- package/engine/object-data/entry.d.ts +6 -1
- package/engine/object-data/entry.lua +8 -0
- package/engine/object-field/ability.lua +2 -2
- package/engine/object-field/item.d.ts +22 -0
- package/engine/object-field/item.lua +118 -0
- package/engine/object-field/unit.d.ts +20 -5
- package/engine/object-field/unit.lua +61 -0
- package/engine/object-field.d.ts +10 -2
- package/engine/object-field.lua +268 -123
- package/engine/random.d.ts +1 -0
- package/engine/random.lua +8 -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 +45 -0
- package/engine/standard/entries/buff-type.lua +43 -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/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 +11 -3
- package/engine/standard/fields/unit.lua +15 -2
- package/engine/synchronization.d.ts +11 -0
- package/engine/synchronization.lua +77 -0
- package/engine/text-tag.lua +2 -1
- package/engine/unit.d.ts +10 -1
- package/engine/unit.lua +10 -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 +10 -8
- package/objutil/object.lua +1 -1
- package/operation.d.ts +8 -1
- package/operation.lua +38 -18
- package/package.json +3 -23
- package/patch-lua.lua +15 -0
- package/utility/arrays.d.ts +7 -1
- package/utility/arrays.lua +17 -0
- package/utility/linked-map.d.ts +35 -0
- package/utility/linked-map.lua +107 -0
- package/utility/linked-set.d.ts +3 -1
- package/utility/linked-set.lua +27 -0
- package/utility/random.d.ts +102 -0
- package/utility/random.lua +273 -0
- package/utility/records.lua +20 -1
- package/utility/unordered-map.d.ts +27 -0
- package/utility/unordered-map.lua +99 -0
- package/engine/internal/unit/item.lua +0 -78
- /package/engine/internal/{object-data/armor-increase.d.ts → misc/unit-ability-level-natives.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/internal/unit.lua
CHANGED
|
@@ -7,10 +7,10 @@ local __TS__Class = ____lualib.__TS__Class
|
|
|
7
7
|
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
8
8
|
local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
|
|
9
9
|
local __TS__ArraySetLength = ____lualib.__TS__ArraySetLength
|
|
10
|
+
local __TS__InstanceOf = ____lualib.__TS__InstanceOf
|
|
10
11
|
local __TS__SparseArrayNew = ____lualib.__TS__SparseArrayNew
|
|
11
12
|
local __TS__SparseArrayPush = ____lualib.__TS__SparseArrayPush
|
|
12
13
|
local __TS__SparseArraySpread = ____lualib.__TS__SparseArraySpread
|
|
13
|
-
local __TS__InstanceOf = ____lualib.__TS__InstanceOf
|
|
14
14
|
local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
|
|
15
15
|
local Set = ____lualib.Set
|
|
16
16
|
local __TS__Spread = ____lualib.__TS__Spread
|
|
@@ -47,12 +47,10 @@ local checkNotNull = ____preconditions.checkNotNull
|
|
|
47
47
|
local ____constants = require("engine.constants")
|
|
48
48
|
local HEALTH_REGENERATION_RATE_BONUS_PER_STRENGTH_POINT = ____constants.HEALTH_REGENERATION_RATE_BONUS_PER_STRENGTH_POINT
|
|
49
49
|
local MANA_REGENERATION_RATE_BONUS_PER_INTELLIGENCE_POINT = ____constants.MANA_REGENERATION_RATE_BONUS_PER_INTELLIGENCE_POINT
|
|
50
|
-
local ____arrays = require("utility.arrays")
|
|
51
|
-
local forEach = ____arrays.forEach
|
|
52
|
-
local ____math = require("math")
|
|
53
|
-
local min = ____math.min
|
|
54
50
|
local ____ignore_2Devents_2Ditems = require("engine.internal.unit.ignore-events-items")
|
|
55
|
-
local
|
|
51
|
+
local isItemIgnoredInEvents = ____ignore_2Devents_2Ditems.isItemIgnoredInEvents
|
|
52
|
+
local ____owner_2Dcache = require("engine.internal.item.owner-cache")
|
|
53
|
+
local ownerByItem = ____owner_2Dcache.ownerByItem
|
|
56
54
|
local ____attack_2Dtype = require("engine.object-data.auxiliary.attack-type")
|
|
57
55
|
local attackTypeToNative = ____attack_2Dtype.attackTypeToNative
|
|
58
56
|
local nativeToAttackType = ____attack_2Dtype.nativeToAttackType
|
|
@@ -62,6 +60,10 @@ local ____attributes = require("attributes")
|
|
|
62
60
|
local isAttribute = ____attributes.isAttribute
|
|
63
61
|
local ____ability = require("engine.internal.item.ability")
|
|
64
62
|
local doUnitAbilityAction = ____ability.doUnitAbilityAction
|
|
63
|
+
local ____synchronization = require("engine.synchronization")
|
|
64
|
+
local synchronizer = ____synchronization.synchronizer
|
|
65
|
+
local ____linked_2Dmap = require("utility.linked-map")
|
|
66
|
+
local LinkedMap = ____linked_2Dmap.LinkedMap
|
|
65
67
|
local match = string.match
|
|
66
68
|
local ____tostring = _G.tostring
|
|
67
69
|
local setUnitAnimation = SetUnitAnimation
|
|
@@ -71,16 +73,12 @@ local getUnitRealField = BlzGetUnitRealField
|
|
|
71
73
|
local getHeroStr = GetHeroStr
|
|
72
74
|
local getHeroAgi = GetHeroAgi
|
|
73
75
|
local getHeroInt = GetHeroInt
|
|
74
|
-
local setHeroStr = SetHeroStr
|
|
75
|
-
local setHeroAgi = SetHeroAgi
|
|
76
|
-
local setHeroInt = SetHeroInt
|
|
77
76
|
local getUnitBooleanField = BlzGetUnitBooleanField
|
|
78
77
|
local getUnitStringField = BlzGetUnitStringField
|
|
79
78
|
local setUnitIntegerField = BlzSetUnitIntegerField
|
|
80
79
|
local setUnitRealField = BlzSetUnitRealField
|
|
81
80
|
local setUnitBooleanField = BlzSetUnitBooleanField
|
|
82
81
|
local setUnitStringField = BlzSetUnitStringField
|
|
83
|
-
local setUnitScale = SetUnitScale
|
|
84
82
|
local setUnitPosition = SetUnitPosition
|
|
85
83
|
local setUnitTimeScale = SetUnitTimeScale
|
|
86
84
|
local getHandleId = GetHandleId
|
|
@@ -108,7 +106,6 @@ local getUnitWeaponStringField = BlzGetUnitWeaponStringField
|
|
|
108
106
|
local setUnitWeaponStringField = BlzSetUnitWeaponStringField
|
|
109
107
|
local getUnitAbilityLevel = GetUnitAbilityLevel
|
|
110
108
|
local unitDisableAbility = BlzUnitDisableAbility
|
|
111
|
-
local unitInterruptAttack = BlzUnitInterruptAttack
|
|
112
109
|
local isUnitInvisible = IsUnitInvisible
|
|
113
110
|
local isUnitVisible = IsUnitVisible
|
|
114
111
|
local getUnitX = GetUnitX
|
|
@@ -384,15 +381,27 @@ local modifiers = {
|
|
|
384
381
|
end,
|
|
385
382
|
armor = function(unit, value)
|
|
386
383
|
if UnitAddAbility(unit, armorBonusAbilityId) then
|
|
387
|
-
assert(
|
|
384
|
+
assert(
|
|
385
|
+
UnitMakeAbilityPermanent(unit, true, armorBonusAbilityId),
|
|
386
|
+
"armor bonus ability must be made permanent",
|
|
387
|
+
unit
|
|
388
|
+
)
|
|
388
389
|
end
|
|
389
|
-
local ability = assert(
|
|
390
|
-
|
|
391
|
-
ability,
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
390
|
+
local ability = assert(
|
|
391
|
+
BlzGetUnitAbility(unit, armorBonusAbilityId),
|
|
392
|
+
"armor bonus ability must be existing",
|
|
393
|
+
unit
|
|
394
|
+
)
|
|
395
|
+
assert(
|
|
396
|
+
BlzSetAbilityRealLevelField(
|
|
397
|
+
ability,
|
|
398
|
+
armorBonusField,
|
|
399
|
+
0,
|
|
400
|
+
BlzGetAbilityRealLevelField(ability, armorBonusField, 0) + value
|
|
401
|
+
),
|
|
402
|
+
"armor bonus ability field must be set",
|
|
403
|
+
unit
|
|
404
|
+
)
|
|
396
405
|
end
|
|
397
406
|
}
|
|
398
407
|
local getters = {
|
|
@@ -581,8 +590,6 @@ __TS__SetDescriptor(
|
|
|
581
590
|
},
|
|
582
591
|
true
|
|
583
592
|
)
|
|
584
|
-
local unitInventorySize = UnitInventorySize
|
|
585
|
-
local unitItemInSlot = UnitItemInSlot
|
|
586
593
|
local getItemAbility = BlzGetItemAbility
|
|
587
594
|
local getUnitAbility = BlzGetUnitAbility
|
|
588
595
|
local getUnitAbilityByIndex = BlzGetUnitAbilityByIndex
|
|
@@ -600,8 +607,8 @@ local function retrieveAbility(unit, ability, abilityId)
|
|
|
600
607
|
____exports.Unit:of(unit)
|
|
601
608
|
)
|
|
602
609
|
end
|
|
603
|
-
for i = 0,
|
|
604
|
-
local item =
|
|
610
|
+
for i = 0, UnitInventorySize(unit) - 1 do
|
|
611
|
+
local item = UnitItemInSlot(unit, i)
|
|
605
612
|
if getItemAbility(item, abilityId) == ability then
|
|
606
613
|
return ItemAbility:of(
|
|
607
614
|
ability,
|
|
@@ -646,26 +653,30 @@ local fieldSetters = {
|
|
|
646
653
|
}
|
|
647
654
|
local dummies = {}
|
|
648
655
|
for ____, player in ipairs(Player.all) do
|
|
649
|
-
local dummy = assert(
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
+
local dummy = assert(
|
|
657
|
+
createUnit(
|
|
658
|
+
player.handle,
|
|
659
|
+
dummyUnitId,
|
|
660
|
+
0,
|
|
661
|
+
0,
|
|
662
|
+
270
|
|
663
|
+
),
|
|
664
|
+
"dummy must be created",
|
|
665
|
+
player
|
|
666
|
+
)
|
|
656
667
|
ShowUnit(dummy, false)
|
|
657
668
|
dummies[player] = dummy
|
|
658
669
|
end
|
|
659
670
|
local function delayHealthChecksCallback(unit)
|
|
660
|
-
local counter = (unit[
|
|
671
|
+
local counter = (unit[104] or 0) - 1
|
|
661
672
|
if counter ~= 0 then
|
|
662
|
-
unit[
|
|
673
|
+
unit[104] = counter
|
|
663
674
|
return
|
|
664
675
|
end
|
|
665
|
-
unit[
|
|
666
|
-
local healthBonus = unit[
|
|
676
|
+
unit[104] = nil
|
|
677
|
+
local healthBonus = unit[105]
|
|
667
678
|
if healthBonus ~= nil then
|
|
668
|
-
unit[
|
|
679
|
+
unit[105] = nil
|
|
669
680
|
local handle = unit.handle
|
|
670
681
|
BlzSetUnitMaxHP(
|
|
671
682
|
handle,
|
|
@@ -695,41 +706,57 @@ function Unit.prototype.____constructor(self, handle)
|
|
|
695
706
|
nextSyncId = ____nextSyncId_1 + 1
|
|
696
707
|
self.syncId = ____nextSyncId_1
|
|
697
708
|
self._owner = Player:of(getOwningPlayer(handle))
|
|
698
|
-
assert(
|
|
699
|
-
|
|
709
|
+
assert(
|
|
710
|
+
unitAddAbility(handle, leaveDetectAbilityId) and UnitMakeAbilityPermanent(handle, true, leaveDetectAbilityId),
|
|
711
|
+
"leave detection ability must be added",
|
|
712
|
+
self
|
|
713
|
+
)
|
|
714
|
+
assert(
|
|
715
|
+
unitAddAbility(handle, morphDetectAbilityId),
|
|
716
|
+
"morph detection ability must be added",
|
|
717
|
+
self
|
|
718
|
+
)
|
|
700
719
|
if unitAddAbility(
|
|
701
720
|
handle,
|
|
702
721
|
fourCC("Amrf")
|
|
703
722
|
) then
|
|
704
|
-
assert(
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
723
|
+
assert(
|
|
724
|
+
unitRemoveAbility(
|
|
725
|
+
handle,
|
|
726
|
+
fourCC("Amrf")
|
|
727
|
+
),
|
|
728
|
+
"fly ability must be removed after addition",
|
|
729
|
+
self
|
|
730
|
+
)
|
|
708
731
|
end
|
|
709
732
|
unitBySyncId[self.syncId] = self
|
|
710
733
|
local ____ = self.abilities
|
|
711
734
|
end
|
|
712
|
-
function Unit.prototype.getEvent(self,
|
|
713
|
-
self.events = self.events or (
|
|
714
|
-
local eventId = GetHandleId(
|
|
715
|
-
|
|
716
|
-
|
|
735
|
+
function Unit.prototype.getEvent(self, jevent, collector)
|
|
736
|
+
self.events = self.events or __TS__New(LinkedMap)
|
|
737
|
+
local eventId = GetHandleId(jevent)
|
|
738
|
+
local event = self.events:get(eventId)
|
|
739
|
+
if event == nil then
|
|
740
|
+
event = __TS__New(
|
|
717
741
|
TriggerEvent,
|
|
718
742
|
function(trigger)
|
|
719
|
-
TriggerRegisterUnitEvent(trigger, self.handle,
|
|
743
|
+
TriggerRegisterUnitEvent(trigger, self.handle, jevent)
|
|
720
744
|
end,
|
|
721
745
|
collector or (function() return {} end)
|
|
722
746
|
)
|
|
747
|
+
self.events:put(eventId, event)
|
|
723
748
|
end
|
|
724
|
-
return
|
|
749
|
+
return event
|
|
750
|
+
end
|
|
751
|
+
function Unit.prototype.saveData(self)
|
|
752
|
+
local handle = self.handle
|
|
753
|
+
self[108] = self[108] or getUnitX(handle)
|
|
754
|
+
self[109] = self[109] or getUnitY(handle)
|
|
755
|
+
self._owner = self._owner or Player:of(getOwningPlayer(handle))
|
|
725
756
|
end
|
|
726
757
|
function Unit.prototype.onDestroy(self)
|
|
727
758
|
local handle = self.handle
|
|
728
|
-
self
|
|
729
|
-
self[108] = getUnitY(handle)
|
|
730
|
-
if not self._owner then
|
|
731
|
-
self._owner = Player:of(getOwningPlayer(handle))
|
|
732
|
-
end
|
|
759
|
+
self:saveData()
|
|
733
760
|
local abilities = self.abilities
|
|
734
761
|
for ____, ability in ipairs(abilities) do
|
|
735
762
|
ability:destroy()
|
|
@@ -747,7 +774,9 @@ function Unit.prototype.onDestroy(self)
|
|
|
747
774
|
end
|
|
748
775
|
local eventsToDestroy = self._eventsToDestroy
|
|
749
776
|
if eventsToDestroy ~= nil then
|
|
750
|
-
|
|
777
|
+
for ____, event in ipairs(eventsToDestroy) do
|
|
778
|
+
event:destroy()
|
|
779
|
+
end
|
|
751
780
|
end
|
|
752
781
|
if getUnitAbilityLevel(handle, leaveDetectAbilityId) > 0 then
|
|
753
782
|
unitRemoveAbility(handle, leaveDetectAbilityId)
|
|
@@ -765,7 +794,11 @@ function Unit.prototype.addAttackHandler(self, condition, action)
|
|
|
765
794
|
self._attackHandlers = handlers
|
|
766
795
|
if #handlers == 1 then
|
|
767
796
|
local handle = self.handle
|
|
768
|
-
assert(
|
|
797
|
+
assert(
|
|
798
|
+
unitAddAbility(handle, attackHandlerAbilityId) and UnitMakeAbilityPermanent(handle, true, attackHandlerAbilityId),
|
|
799
|
+
"attack handler ability must be added",
|
|
800
|
+
self
|
|
801
|
+
)
|
|
769
802
|
end
|
|
770
803
|
return handler
|
|
771
804
|
end
|
|
@@ -813,13 +846,19 @@ function Unit.prototype.isInvisibleTo(self, player)
|
|
|
813
846
|
return isUnitInvisible(self.handle, player.handle)
|
|
814
847
|
end
|
|
815
848
|
function Unit.prototype.isInRangeOf(self, x, y, range)
|
|
816
|
-
local
|
|
849
|
+
local ____temp_4
|
|
817
850
|
if type(x) == "number" then
|
|
818
|
-
|
|
851
|
+
____temp_4 = isUnitInRangeXY(self.handle, x, y, range)
|
|
819
852
|
else
|
|
820
|
-
____temp_3
|
|
853
|
+
local ____temp_3
|
|
854
|
+
if __TS__InstanceOf(x, ____exports.Unit) then
|
|
855
|
+
____temp_3 = isUnitInRange(self.handle, x.handle, y)
|
|
856
|
+
else
|
|
857
|
+
____temp_3 = isUnitInRangeXY(self.handle, x.x, x.y, range)
|
|
858
|
+
end
|
|
859
|
+
____temp_4 = ____temp_3
|
|
821
860
|
end
|
|
822
|
-
return
|
|
861
|
+
return ____temp_4
|
|
823
862
|
end
|
|
824
863
|
function Unit.prototype.isAllyOf(self, unit)
|
|
825
864
|
return isUnitAlly(
|
|
@@ -860,7 +899,7 @@ function Unit.prototype.chooseWeapon(self, target)
|
|
|
860
899
|
return nil
|
|
861
900
|
end
|
|
862
901
|
function Unit.prototype.delayHealthChecks(self)
|
|
863
|
-
self[
|
|
902
|
+
self[104] = (self[104] or 0) + 1
|
|
864
903
|
Timer:run(delayHealthChecksCallback, self)
|
|
865
904
|
end
|
|
866
905
|
function Unit.prototype.setPosition(self, x, y)
|
|
@@ -877,14 +916,14 @@ function Unit.prototype.kill(self)
|
|
|
877
916
|
killUnit(self.handle)
|
|
878
917
|
end
|
|
879
918
|
function Unit.prototype.revive(self, x, y, doEffect)
|
|
880
|
-
local
|
|
881
|
-
local
|
|
882
|
-
local
|
|
883
|
-
if
|
|
884
|
-
|
|
919
|
+
local ____ReviveHero_7 = ReviveHero
|
|
920
|
+
local ____array_6 = __TS__SparseArrayNew(self.handle, x, y)
|
|
921
|
+
local ____doEffect_5 = doEffect
|
|
922
|
+
if ____doEffect_5 == nil then
|
|
923
|
+
____doEffect_5 = false
|
|
885
924
|
end
|
|
886
|
-
__TS__SparseArrayPush(
|
|
887
|
-
|
|
925
|
+
__TS__SparseArrayPush(____array_6, ____doEffect_5)
|
|
926
|
+
____ReviveHero_7(__TS__SparseArraySpread(____array_6))
|
|
888
927
|
end
|
|
889
928
|
function Unit.prototype.healTarget(self, target, amount)
|
|
890
929
|
if __TS__InstanceOf(target, ____exports.Unit) and target:hasAbility(fourCC("BIhm")) then
|
|
@@ -924,7 +963,7 @@ function Unit.prototype.dropItemSlot(self, item, slot)
|
|
|
924
963
|
return UnitDropItemSlot(self.handle, item.handle, slot)
|
|
925
964
|
end
|
|
926
965
|
function Unit.prototype.itemInSlot(self, slot)
|
|
927
|
-
return Item:of(
|
|
966
|
+
return Item:of(UnitItemInSlot(self.handle, slot))
|
|
928
967
|
end
|
|
929
968
|
function Unit.prototype.addAbility(self, abilityId)
|
|
930
969
|
local ability = UnitAbility:of(
|
|
@@ -960,6 +999,9 @@ function Unit.prototype.removeAbility(self, abilityTypeId)
|
|
|
960
999
|
if abilities[i].typeId == abilityTypeId then
|
|
961
1000
|
local ability = abilities[i]
|
|
962
1001
|
tremove(abilities, i)
|
|
1002
|
+
if ability.state == 2 then
|
|
1003
|
+
break
|
|
1004
|
+
end
|
|
963
1005
|
ability:destroy()
|
|
964
1006
|
return true
|
|
965
1007
|
end
|
|
@@ -978,24 +1020,6 @@ end
|
|
|
978
1020
|
function Unit.prototype.endAbilityCooldown(self, abilityId)
|
|
979
1021
|
BlzEndUnitAbilityCooldown(self.handle, abilityId)
|
|
980
1022
|
end
|
|
981
|
-
function Unit.prototype.interruptMovement(self)
|
|
982
|
-
local handle = self.handle
|
|
983
|
-
unitDisableAbility(
|
|
984
|
-
handle,
|
|
985
|
-
fourCC("Amov"),
|
|
986
|
-
true,
|
|
987
|
-
false
|
|
988
|
-
)
|
|
989
|
-
unitDisableAbility(
|
|
990
|
-
handle,
|
|
991
|
-
fourCC("Amov"),
|
|
992
|
-
false,
|
|
993
|
-
false
|
|
994
|
-
)
|
|
995
|
-
end
|
|
996
|
-
function Unit.prototype.interruptAttack(self)
|
|
997
|
-
unitInterruptAttack(self.handle)
|
|
998
|
-
end
|
|
999
1023
|
function Unit.prototype.interruptCast(self, abilityId)
|
|
1000
1024
|
local handle = self.handle
|
|
1001
1025
|
unitDisableAbility(handle, abilityId, true, false)
|
|
@@ -1066,18 +1090,44 @@ function Unit.prototype.unpauseEx(self)
|
|
|
1066
1090
|
end
|
|
1067
1091
|
function Unit.prototype.incrementStunCounter(self)
|
|
1068
1092
|
local stunCounter = self[102] or 0
|
|
1069
|
-
if not self[101] or stunCounter >= 0 then
|
|
1093
|
+
if not self[101] and (self[103] or 0) <= 0 or stunCounter >= 0 then
|
|
1070
1094
|
BlzPauseUnitEx(self.handle, true)
|
|
1071
1095
|
end
|
|
1072
1096
|
self[102] = stunCounter + 1
|
|
1073
1097
|
end
|
|
1074
1098
|
function Unit.prototype.decrementStunCounter(self)
|
|
1075
1099
|
local stunCounter = self[102] or 0
|
|
1076
|
-
if not self[101] or stunCounter >= 1 then
|
|
1100
|
+
if not self[101] and (self[103] or 0) <= 0 or stunCounter >= 1 then
|
|
1077
1101
|
BlzPauseUnitEx(self.handle, false)
|
|
1078
1102
|
end
|
|
1079
1103
|
self[102] = stunCounter - 1
|
|
1080
1104
|
end
|
|
1105
|
+
function Unit.prototype.incrementForceStunCounter(self)
|
|
1106
|
+
local forceStunCounter = self[103] or 0
|
|
1107
|
+
if forceStunCounter == 0 then
|
|
1108
|
+
local handle = self.handle
|
|
1109
|
+
if not self[101] then
|
|
1110
|
+
for _ = self[102] or 0, -1 do
|
|
1111
|
+
BlzPauseUnitEx(handle, true)
|
|
1112
|
+
end
|
|
1113
|
+
end
|
|
1114
|
+
BlzPauseUnitEx(handle, true)
|
|
1115
|
+
end
|
|
1116
|
+
self[103] = forceStunCounter + 1
|
|
1117
|
+
end
|
|
1118
|
+
function Unit.prototype.decrementForceStunCounter(self)
|
|
1119
|
+
local forceStunCounter = self[103] or 0
|
|
1120
|
+
if forceStunCounter == 1 then
|
|
1121
|
+
local handle = self.handle
|
|
1122
|
+
if not self[101] then
|
|
1123
|
+
for _ = self[102] or 0, -1 do
|
|
1124
|
+
BlzPauseUnitEx(handle, false)
|
|
1125
|
+
end
|
|
1126
|
+
end
|
|
1127
|
+
BlzPauseUnitEx(handle, false)
|
|
1128
|
+
end
|
|
1129
|
+
self[103] = forceStunCounter - 1
|
|
1130
|
+
end
|
|
1081
1131
|
function Unit.create(self, owner, id, x, y, facing, skinId)
|
|
1082
1132
|
local handle = skinId and BlzCreateUnitWithSkin(
|
|
1083
1133
|
owner.handle,
|
|
@@ -1274,7 +1324,7 @@ __TS__SetDescriptor(
|
|
|
1274
1324
|
Unit.prototype,
|
|
1275
1325
|
"isStunned",
|
|
1276
1326
|
{get = function(self)
|
|
1277
|
-
return getUnitCurrentOrder(self.handle) ==
|
|
1327
|
+
return getUnitCurrentOrder(self.handle) == 851973
|
|
1278
1328
|
end},
|
|
1279
1329
|
true
|
|
1280
1330
|
)
|
|
@@ -1364,19 +1414,6 @@ __TS__SetDescriptor(
|
|
|
1364
1414
|
},
|
|
1365
1415
|
true
|
|
1366
1416
|
)
|
|
1367
|
-
__TS__SetDescriptor(
|
|
1368
|
-
Unit.prototype,
|
|
1369
|
-
"strengthBase",
|
|
1370
|
-
{
|
|
1371
|
-
get = function(self)
|
|
1372
|
-
return getHeroStr(self.handle, false)
|
|
1373
|
-
end,
|
|
1374
|
-
set = function(self, strengthBase)
|
|
1375
|
-
setHeroStr(self.handle, strengthBase, true)
|
|
1376
|
-
end
|
|
1377
|
-
},
|
|
1378
|
-
true
|
|
1379
|
-
)
|
|
1380
1417
|
__TS__SetDescriptor(
|
|
1381
1418
|
Unit.prototype,
|
|
1382
1419
|
"strengthBonus",
|
|
@@ -1394,19 +1431,6 @@ __TS__SetDescriptor(
|
|
|
1394
1431
|
end},
|
|
1395
1432
|
true
|
|
1396
1433
|
)
|
|
1397
|
-
__TS__SetDescriptor(
|
|
1398
|
-
Unit.prototype,
|
|
1399
|
-
"agilityBase",
|
|
1400
|
-
{
|
|
1401
|
-
get = function(self)
|
|
1402
|
-
return getHeroAgi(self.handle, false)
|
|
1403
|
-
end,
|
|
1404
|
-
set = function(self, agilityBase)
|
|
1405
|
-
setHeroAgi(self.handle, agilityBase, true)
|
|
1406
|
-
end
|
|
1407
|
-
},
|
|
1408
|
-
true
|
|
1409
|
-
)
|
|
1410
1434
|
__TS__SetDescriptor(
|
|
1411
1435
|
Unit.prototype,
|
|
1412
1436
|
"agilityBonus",
|
|
@@ -1424,19 +1448,6 @@ __TS__SetDescriptor(
|
|
|
1424
1448
|
end},
|
|
1425
1449
|
true
|
|
1426
1450
|
)
|
|
1427
|
-
__TS__SetDescriptor(
|
|
1428
|
-
Unit.prototype,
|
|
1429
|
-
"intelligenceBase",
|
|
1430
|
-
{
|
|
1431
|
-
get = function(self)
|
|
1432
|
-
return getHeroInt(self.handle, false)
|
|
1433
|
-
end,
|
|
1434
|
-
set = function(self, intelligenceBase)
|
|
1435
|
-
setHeroInt(self.handle, intelligenceBase, true)
|
|
1436
|
-
end
|
|
1437
|
-
},
|
|
1438
|
-
true
|
|
1439
|
-
)
|
|
1440
1451
|
__TS__SetDescriptor(
|
|
1441
1452
|
Unit.prototype,
|
|
1442
1453
|
"intelligenceBonus",
|
|
@@ -1485,17 +1496,17 @@ __TS__SetDescriptor(
|
|
|
1485
1496
|
"isTeamGlowVisible",
|
|
1486
1497
|
{
|
|
1487
1498
|
get = function(self)
|
|
1488
|
-
return not self[
|
|
1499
|
+
return not self[107]
|
|
1489
1500
|
end,
|
|
1490
1501
|
set = function(self, isTeamGlowVisible)
|
|
1491
1502
|
BlzShowUnitTeamGlow(self.handle, isTeamGlowVisible)
|
|
1492
|
-
local
|
|
1503
|
+
local ____temp_8
|
|
1493
1504
|
if not isTeamGlowVisible then
|
|
1494
|
-
|
|
1505
|
+
____temp_8 = true
|
|
1495
1506
|
else
|
|
1496
|
-
|
|
1507
|
+
____temp_8 = nil
|
|
1497
1508
|
end
|
|
1498
|
-
self[
|
|
1509
|
+
self[107] = ____temp_8
|
|
1499
1510
|
end
|
|
1500
1511
|
},
|
|
1501
1512
|
true
|
|
@@ -1505,7 +1516,7 @@ __TS__SetDescriptor(
|
|
|
1505
1516
|
"color",
|
|
1506
1517
|
{set = function(self, color)
|
|
1507
1518
|
SetUnitColor(self.handle, color.handle)
|
|
1508
|
-
if self[
|
|
1519
|
+
if self[107] then
|
|
1509
1520
|
BlzShowUnitTeamGlow(self.handle, false)
|
|
1510
1521
|
end
|
|
1511
1522
|
end},
|
|
@@ -1529,14 +1540,14 @@ __TS__SetDescriptor(
|
|
|
1529
1540
|
"maxHealth",
|
|
1530
1541
|
{
|
|
1531
1542
|
get = function(self)
|
|
1532
|
-
return BlzGetUnitMaxHP(self.handle) - (self[
|
|
1543
|
+
return BlzGetUnitMaxHP(self.handle) - (self[105] or 0) - (self[106] or 0)
|
|
1533
1544
|
end,
|
|
1534
1545
|
set = function(self, maxHealth)
|
|
1535
|
-
if maxHealth < 1 and self[
|
|
1536
|
-
self[
|
|
1546
|
+
if maxHealth < 1 and self[104] ~= nil then
|
|
1547
|
+
self[105] = (self[105] or 0) + (1 - maxHealth)
|
|
1537
1548
|
maxHealth = 1
|
|
1538
1549
|
end
|
|
1539
|
-
BlzSetUnitMaxHP(self.handle, maxHealth + (self[
|
|
1550
|
+
BlzSetUnitMaxHP(self.handle, maxHealth + (self[106] or 0))
|
|
1540
1551
|
end
|
|
1541
1552
|
},
|
|
1542
1553
|
true
|
|
@@ -1578,10 +1589,10 @@ __TS__SetDescriptor(
|
|
|
1578
1589
|
"health",
|
|
1579
1590
|
{
|
|
1580
1591
|
get = function(self)
|
|
1581
|
-
return GetWidgetLife(self.handle) - (self[
|
|
1592
|
+
return GetWidgetLife(self.handle) - (self[106] or 0)
|
|
1582
1593
|
end,
|
|
1583
1594
|
set = function(self, health)
|
|
1584
|
-
SetWidgetLife(self.handle, health + (self[
|
|
1595
|
+
SetWidgetLife(self.handle, health + (self[106] or 0))
|
|
1585
1596
|
end
|
|
1586
1597
|
},
|
|
1587
1598
|
true
|
|
@@ -1657,25 +1668,12 @@ __TS__SetDescriptor(
|
|
|
1657
1668
|
},
|
|
1658
1669
|
true
|
|
1659
1670
|
)
|
|
1660
|
-
__TS__SetDescriptor(
|
|
1661
|
-
Unit.prototype,
|
|
1662
|
-
"flyHeight",
|
|
1663
|
-
{
|
|
1664
|
-
get = function(self)
|
|
1665
|
-
return getUnitFlyHeight(self.handle)
|
|
1666
|
-
end,
|
|
1667
|
-
set = function(self, v)
|
|
1668
|
-
SetUnitFlyHeight(self.handle, v, 100000)
|
|
1669
|
-
end
|
|
1670
|
-
},
|
|
1671
|
-
true
|
|
1672
|
-
)
|
|
1673
1671
|
__TS__SetDescriptor(
|
|
1674
1672
|
Unit.prototype,
|
|
1675
1673
|
"x",
|
|
1676
1674
|
{
|
|
1677
1675
|
get = function(self)
|
|
1678
|
-
return self[
|
|
1676
|
+
return self[108] or getUnitX(self.handle)
|
|
1679
1677
|
end,
|
|
1680
1678
|
set = function(self, v)
|
|
1681
1679
|
SetUnitX(self.handle, v)
|
|
@@ -1688,7 +1686,7 @@ __TS__SetDescriptor(
|
|
|
1688
1686
|
"y",
|
|
1689
1687
|
{
|
|
1690
1688
|
get = function(self)
|
|
1691
|
-
return self[
|
|
1689
|
+
return self[109] or getUnitY(self.handle)
|
|
1692
1690
|
end,
|
|
1693
1691
|
set = function(self, v)
|
|
1694
1692
|
SetUnitY(self.handle, v)
|
|
@@ -1793,14 +1791,18 @@ __TS__SetDescriptor(
|
|
|
1793
1791
|
local handle = self.handle
|
|
1794
1792
|
if isPaused and not IsUnitPaused(handle) then
|
|
1795
1793
|
self[101] = true
|
|
1796
|
-
|
|
1797
|
-
|
|
1794
|
+
if (self[103] or 0) <= 0 then
|
|
1795
|
+
for _ = self[102] or 0, -1 do
|
|
1796
|
+
BlzPauseUnitEx(handle, true)
|
|
1797
|
+
end
|
|
1798
1798
|
end
|
|
1799
1799
|
PauseUnit(handle, true)
|
|
1800
1800
|
elseif not isPaused and IsUnitPaused(handle) then
|
|
1801
1801
|
PauseUnit(handle, false)
|
|
1802
|
-
|
|
1803
|
-
|
|
1802
|
+
if (self[103] or 0) <= 0 then
|
|
1803
|
+
for _ = self[102] or 0, -1 do
|
|
1804
|
+
BlzPauseUnitEx(handle, false)
|
|
1805
|
+
end
|
|
1804
1806
|
end
|
|
1805
1807
|
self[101] = nil
|
|
1806
1808
|
end
|
|
@@ -1858,20 +1860,6 @@ __TS__SetDescriptor(
|
|
|
1858
1860
|
},
|
|
1859
1861
|
true
|
|
1860
1862
|
)
|
|
1861
|
-
__TS__SetDescriptor(
|
|
1862
|
-
Unit.prototype,
|
|
1863
|
-
"scale",
|
|
1864
|
-
{
|
|
1865
|
-
get = function(self)
|
|
1866
|
-
return getUnitRealField(self.handle, UNIT_RF_SCALING_VALUE)
|
|
1867
|
-
end,
|
|
1868
|
-
set = function(self, v)
|
|
1869
|
-
setUnitScale(self.handle, v, v, v)
|
|
1870
|
-
setUnitRealField(self.handle, UNIT_RF_SCALING_VALUE, v)
|
|
1871
|
-
end
|
|
1872
|
-
},
|
|
1873
|
-
true
|
|
1874
|
-
)
|
|
1875
1863
|
__TS__SetDescriptor(
|
|
1876
1864
|
Unit.prototype,
|
|
1877
1865
|
"timeScale",
|
|
@@ -1898,7 +1886,7 @@ __TS__SetDescriptor(
|
|
|
1898
1886
|
Unit.prototype,
|
|
1899
1887
|
"pathingCollisionRange",
|
|
1900
1888
|
{get = function(self)
|
|
1901
|
-
return 16 * (min(
|
|
1889
|
+
return 16 * (math.min(
|
|
1902
1890
|
getUnitCollisionSize(self.handle) // 16,
|
|
1903
1891
|
3
|
|
1904
1892
|
) + 1)
|
|
@@ -2008,30 +1996,6 @@ __TS__SetDescriptor(
|
|
|
2008
1996
|
end},
|
|
2009
1997
|
true
|
|
2010
1998
|
)
|
|
2011
|
-
__TS__SetDescriptor(
|
|
2012
|
-
Unit.prototype,
|
|
2013
|
-
"onUnitInRange",
|
|
2014
|
-
{get = function(self)
|
|
2015
|
-
local handle = self.handle
|
|
2016
|
-
local onUnitInRange = setmetatable(
|
|
2017
|
-
{},
|
|
2018
|
-
{__index = function(self, value)
|
|
2019
|
-
local event = __TS__New(
|
|
2020
|
-
TriggerEvent,
|
|
2021
|
-
function(trigger)
|
|
2022
|
-
TriggerRegisterUnitInRangeSimple(trigger, value, handle)
|
|
2023
|
-
end,
|
|
2024
|
-
function() return ____exports.Unit:of(handle) end
|
|
2025
|
-
)
|
|
2026
|
-
rawset(self, value, event)
|
|
2027
|
-
return event
|
|
2028
|
-
end}
|
|
2029
|
-
)
|
|
2030
|
-
rawset(self, "onUnitInRange", onUnitInRange)
|
|
2031
|
-
return onUnitInRange
|
|
2032
|
-
end},
|
|
2033
|
-
true
|
|
2034
|
-
)
|
|
2035
1999
|
__TS__SetDescriptor(
|
|
2036
2000
|
Unit.prototype,
|
|
2037
2001
|
"onManaEqual",
|
|
@@ -2167,6 +2131,11 @@ __TS__SetDescriptor(
|
|
|
2167
2131
|
end},
|
|
2168
2132
|
true
|
|
2169
2133
|
)
|
|
2134
|
+
Unit.levelChangedEvent = __TS__New(
|
|
2135
|
+
____exports.UnitTriggerEvent,
|
|
2136
|
+
EVENT_PLAYER_HERO_LEVEL,
|
|
2137
|
+
function() return ____exports.Unit:of(getTriggerUnit()) end
|
|
2138
|
+
)
|
|
2170
2139
|
Unit.deathEvent = __TS__New(
|
|
2171
2140
|
____exports.UnitTriggerEvent,
|
|
2172
2141
|
EVENT_PLAYER_UNIT_DEATH,
|
|
@@ -2184,7 +2153,7 @@ Unit.onResurrect = __TS__New(
|
|
|
2184
2153
|
____exports.Unit.deathEvent:addListener(function(unit)
|
|
2185
2154
|
dead[unit] = true
|
|
2186
2155
|
end)
|
|
2187
|
-
____exports.Unit.onImmediateOrder[
|
|
2156
|
+
____exports.Unit.onImmediateOrder[852056]:addListener(function(unit)
|
|
2188
2157
|
if dead[unit] and not IsUnitType(unit.handle, UNIT_TYPE_DEAD) then
|
|
2189
2158
|
dead[unit] = false
|
|
2190
2159
|
invoke(event, unit)
|
|
@@ -2201,7 +2170,7 @@ Unit.morphEvent = __TS__New(
|
|
|
2201
2170
|
invoke(event, unit)
|
|
2202
2171
|
end
|
|
2203
2172
|
end
|
|
2204
|
-
____exports.Unit.onImmediateOrder[
|
|
2173
|
+
____exports.Unit.onImmediateOrder[852056]:addListener(function(unit)
|
|
2205
2174
|
if getUnitAbilityLevel(unit.handle, morphDetectAbilityId) == 0 then
|
|
2206
2175
|
Timer:run(ifNotLeft, unit)
|
|
2207
2176
|
end
|
|
@@ -2242,25 +2211,25 @@ Unit.onTargetCast = dispatchId(__TS__New(
|
|
|
2242
2211
|
InitializingEvent,
|
|
2243
2212
|
function(event)
|
|
2244
2213
|
local function listener(unit, id)
|
|
2245
|
-
local
|
|
2214
|
+
local ____GetSpellTargetUnit_result_11
|
|
2246
2215
|
if GetSpellTargetUnit() then
|
|
2247
|
-
|
|
2216
|
+
____GetSpellTargetUnit_result_11 = ____exports.Unit:of(GetSpellTargetUnit())
|
|
2248
2217
|
else
|
|
2249
|
-
local
|
|
2218
|
+
local ____GetSpellTargetItem_result_10
|
|
2250
2219
|
if GetSpellTargetItem() then
|
|
2251
|
-
|
|
2220
|
+
____GetSpellTargetItem_result_10 = Item:of(GetSpellTargetItem())
|
|
2252
2221
|
else
|
|
2253
|
-
local
|
|
2222
|
+
local ____GetSpellTargetDestructable_result_9
|
|
2254
2223
|
if GetSpellTargetDestructable() then
|
|
2255
|
-
|
|
2224
|
+
____GetSpellTargetDestructable_result_9 = Destructable:of(GetSpellTargetDestructable())
|
|
2256
2225
|
else
|
|
2257
|
-
|
|
2226
|
+
____GetSpellTargetDestructable_result_9 = nil
|
|
2258
2227
|
end
|
|
2259
|
-
|
|
2228
|
+
____GetSpellTargetItem_result_10 = ____GetSpellTargetDestructable_result_9
|
|
2260
2229
|
end
|
|
2261
|
-
|
|
2230
|
+
____GetSpellTargetUnit_result_11 = ____GetSpellTargetItem_result_10
|
|
2262
2231
|
end
|
|
2263
|
-
local target =
|
|
2232
|
+
local target = ____GetSpellTargetUnit_result_11
|
|
2264
2233
|
if target then
|
|
2265
2234
|
invoke(event, unit, id, target)
|
|
2266
2235
|
end
|
|
@@ -2628,7 +2597,7 @@ Unit.onDamage = __TS__New(
|
|
|
2628
2597
|
invoke(event, source, target, evData)
|
|
2629
2598
|
if evData[0] ~= nil and target.health - evData.amount < 0.405 then
|
|
2630
2599
|
local bonusHealth = math.ceil(evData.amount)
|
|
2631
|
-
target[
|
|
2600
|
+
target[106] = (target[106] or 0) + bonusHealth
|
|
2632
2601
|
BlzSetUnitMaxHP(
|
|
2633
2602
|
target.handle,
|
|
2634
2603
|
BlzGetUnitMaxHP(target.handle) + bonusHealth
|
|
@@ -2642,7 +2611,7 @@ Unit.onDamage = __TS__New(
|
|
|
2642
2611
|
evData[0],
|
|
2643
2612
|
table.unpack(evData, 1 + 1, 1 + (evData[1] or 0))
|
|
2644
2613
|
)
|
|
2645
|
-
target[
|
|
2614
|
+
target[106] = (target[106] or 0) - bonusHealth
|
|
2646
2615
|
SetWidgetLife(
|
|
2647
2616
|
target.handle,
|
|
2648
2617
|
GetWidgetLife(target.handle) - bonusHealth
|
|
@@ -2668,7 +2637,7 @@ Unit.itemDroppedEvent = __TS__New(
|
|
|
2668
2637
|
function()
|
|
2669
2638
|
local unit = getTriggerUnit()
|
|
2670
2639
|
local item = getManipulatedItem()
|
|
2671
|
-
if getUnitTypeId(unit) ~= dummyUnitId and not (
|
|
2640
|
+
if getUnitTypeId(unit) ~= dummyUnitId and not isItemIgnoredInEvents(item) then
|
|
2672
2641
|
return ____exports.Unit:of(unit), Item:of(item)
|
|
2673
2642
|
end
|
|
2674
2643
|
return IgnoreEvent
|
|
@@ -2680,10 +2649,10 @@ Unit.itemPickedUpEvent = __TS__New(
|
|
|
2680
2649
|
function()
|
|
2681
2650
|
local unitHandle = getTriggerUnit()
|
|
2682
2651
|
local itemHandle = getManipulatedItem()
|
|
2683
|
-
if getUnitTypeId(unitHandle) ~= dummyUnitId and not (
|
|
2652
|
+
if getUnitTypeId(unitHandle) ~= dummyUnitId and not isItemIgnoredInEvents(itemHandle) then
|
|
2684
2653
|
local unit = ____exports.Unit:of(unitHandle)
|
|
2685
2654
|
local item = Item:of(itemHandle)
|
|
2686
|
-
if item
|
|
2655
|
+
if ownerByItem[item] ~= unit then
|
|
2687
2656
|
return unit, item
|
|
2688
2657
|
end
|
|
2689
2658
|
end
|
|
@@ -2696,17 +2665,12 @@ Unit.itemUsedEvent = __TS__New(
|
|
|
2696
2665
|
function()
|
|
2697
2666
|
local unit = getTriggerUnit()
|
|
2698
2667
|
local item = getManipulatedItem()
|
|
2699
|
-
if getUnitTypeId(unit) ~= dummyUnitId and not (
|
|
2668
|
+
if getUnitTypeId(unit) ~= dummyUnitId and not isItemIgnoredInEvents(item) then
|
|
2700
2669
|
return ____exports.Unit:of(unit), Item:of(item)
|
|
2701
2670
|
end
|
|
2702
2671
|
return IgnoreEvent
|
|
2703
2672
|
end
|
|
2704
2673
|
)
|
|
2705
|
-
Unit.itemStackedEvent = __TS__New(
|
|
2706
|
-
____exports.UnitTriggerEvent,
|
|
2707
|
-
EVENT_PLAYER_UNIT_STACK_ITEM,
|
|
2708
|
-
function() return ____exports.Unit:of(getTriggerUnit()), Item:of(BlzGetStackingItemTarget()), Item:of(BlzGetStackingItemSource()) end
|
|
2709
|
-
)
|
|
2710
2674
|
__TS__ObjectDefineProperty(
|
|
2711
2675
|
Unit,
|
|
2712
2676
|
"itemChargesChangedEvent",
|
|
@@ -2722,51 +2686,6 @@ __TS__ObjectDefineProperty(
|
|
|
2722
2686
|
return event
|
|
2723
2687
|
end}
|
|
2724
2688
|
)
|
|
2725
|
-
__TS__ObjectDefineProperty(
|
|
2726
|
-
Unit,
|
|
2727
|
-
"itemUseOrderEvent",
|
|
2728
|
-
{get = function(self)
|
|
2729
|
-
local event = __TS__New(Event)
|
|
2730
|
-
for order = orderId("useslot0"), orderId("useslot5") do
|
|
2731
|
-
local slot = order - orderId("useslot0")
|
|
2732
|
-
local function listener(unit)
|
|
2733
|
-
local item = unit.items[slot + 1]
|
|
2734
|
-
if item ~= nil then
|
|
2735
|
-
invoke(event, unit, item)
|
|
2736
|
-
end
|
|
2737
|
-
end
|
|
2738
|
-
self.onImmediateOrder[order]:addListener(listener)
|
|
2739
|
-
self.onTargetOrder[order]:addListener(listener)
|
|
2740
|
-
self.onPointOrder[order]:addListener(listener)
|
|
2741
|
-
end
|
|
2742
|
-
rawset(self, "itemUseOrderEvent", event)
|
|
2743
|
-
return event
|
|
2744
|
-
end}
|
|
2745
|
-
)
|
|
2746
|
-
__TS__ObjectDefineProperty(
|
|
2747
|
-
Unit,
|
|
2748
|
-
"itemMoveOrderEvent",
|
|
2749
|
-
{get = function(self)
|
|
2750
|
-
local event = __TS__New(Event)
|
|
2751
|
-
for order = orderId("moveslot0"), orderId("moveslot5") do
|
|
2752
|
-
local slotTo = order - orderId("moveslot0")
|
|
2753
|
-
self.onTargetOrder[order]:addListener(function(unit, item)
|
|
2754
|
-
local slotFrom = unit.items:findSlot(item)
|
|
2755
|
-
if slotFrom ~= nil then
|
|
2756
|
-
invoke(
|
|
2757
|
-
event,
|
|
2758
|
-
unit,
|
|
2759
|
-
item,
|
|
2760
|
-
slotFrom,
|
|
2761
|
-
slotTo
|
|
2762
|
-
)
|
|
2763
|
-
end
|
|
2764
|
-
end)
|
|
2765
|
-
end
|
|
2766
|
-
rawset(self, "itemMoveOrderEvent", event)
|
|
2767
|
-
return event
|
|
2768
|
-
end}
|
|
2769
|
-
)
|
|
2770
2689
|
__TS__ObjectDefineProperty(
|
|
2771
2690
|
Unit,
|
|
2772
2691
|
"onCreate",
|
|
@@ -2792,6 +2711,10 @@ __TS__ObjectDefineProperty(
|
|
|
2792
2711
|
rawset(self, "destroyEvent", destroyEvent)
|
|
2793
2712
|
return destroyEvent
|
|
2794
2713
|
end}
|
|
2714
|
+
)
|
|
2715
|
+
Unit.synchronize = synchronizer(
|
|
2716
|
+
function(unit) return unit.syncId end,
|
|
2717
|
+
function(syncId) return unitBySyncId[syncId] end
|
|
2795
2718
|
);
|
|
2796
2719
|
(function(self)
|
|
2797
2720
|
local leaveAbilityIds = postcompile(function()
|
|
@@ -2809,11 +2732,7 @@ __TS__ObjectDefineProperty(
|
|
|
2809
2732
|
function(____, id) return fourCC(id) end
|
|
2810
2733
|
)
|
|
2811
2734
|
end)
|
|
2812
|
-
for ____, leaveOrderId in ipairs({
|
|
2813
|
-
orderId("undefend"),
|
|
2814
|
-
orderId("magicundefense"),
|
|
2815
|
-
orderId("unimmolation")
|
|
2816
|
-
}) do
|
|
2735
|
+
for ____, leaveOrderId in ipairs({852056, 852479, 852178}) do
|
|
2817
2736
|
____exports.Unit.onImmediateOrder[leaveOrderId]:addListener(function(unit)
|
|
2818
2737
|
local handle = unit.handle
|
|
2819
2738
|
for i = 1, #leaveAbilityIds do
|
|
@@ -2821,7 +2740,8 @@ __TS__ObjectDefineProperty(
|
|
|
2821
2740
|
return
|
|
2822
2741
|
end
|
|
2823
2742
|
end
|
|
2824
|
-
unit:
|
|
2743
|
+
unit:saveData()
|
|
2744
|
+
Timer:run(unit, "destroy")
|
|
2825
2745
|
end)
|
|
2826
2746
|
end
|
|
2827
2747
|
end)(Unit)
|