warscript 0.0.1-dev.8895ff6 → 0.0.1-dev.89bc33b
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 +2 -1
- package/core/types/player.lua +18 -13
- 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 +7 -2
- package/core/types/tileCell.lua +11 -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/engine/ability-type-extended-tooltip.d.ts +8 -0
- package/engine/ability-type-extended-tooltip.lua +44 -0
- 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.d.ts +11 -5
- package/engine/behaviour/ability.lua +54 -0
- package/engine/behaviour/unit.d.ts +1 -0
- package/engine/behaviour/unit.lua +1 -0
- package/engine/buff.d.ts +61 -27
- package/engine/buff.lua +304 -133
- 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/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/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/bonus.d.ts +12 -0
- package/engine/internal/unit/bonus.lua +92 -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/ignore-events-items.lua +10 -1
- 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/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+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 +13 -13
- package/engine/internal/unit.d.ts +3 -11
- package/engine/internal/unit.lua +113 -152
- package/engine/local-client.d.ts +26 -0
- package/engine/local-client.lua +294 -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/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-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/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/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 +25 -6
- package/engine/object-data/entry/ability-type.lua +244 -8
- package/engine/object-data/entry/buff-type/applicable.lua +113 -109
- 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 +6 -2
- package/engine/object-data/entry/destructible-type.lua +26 -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 +47 -2
- package/engine/object-data/entry/unit-type.lua +383 -49
- 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.d.ts +1 -1
- package/engine/object-field.lua +9 -7
- 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/item.d.ts +4 -0
- package/engine/standard/fields/item.lua +6 -0
- package/engine/unit.d.ts +6 -1
- package/engine/unit.lua +6 -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/network.lua +25 -1
- package/objutil/buff.lua +1 -1
- 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 +11 -2
- package/utility/linked-map.lua +41 -0
- package/utility/linked-set.d.ts +3 -1
- package/utility/linked-set.lua +23 -0
- package/utility/random.d.ts +102 -0
- package/utility/random.lua +273 -0
- 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
|
@@ -44,58 +44,84 @@ ____exports.MISSILE_DATA_BY_UNIT_TYPE_ID = (function()
|
|
|
44
44
|
UnitType:getAll(),
|
|
45
45
|
function(unitType) return unitType.id end,
|
|
46
46
|
function(unitType)
|
|
47
|
-
local ____ = unitType.missileImpactOffsetZSD
|
|
48
|
-
local ____ = unitType.missileImpactOffsetZHD
|
|
49
47
|
return {
|
|
50
48
|
[0] = unitType.missileImpactOffsetZSD ~= ____exports.DEFAULT_MISSILE_IMPACT_OFFSET_Z and unitType.missileImpactOffsetZSD or nil,
|
|
51
49
|
[1] = unitType.missileImpactOffsetZHD ~= unitType.missileImpactOffsetZSD and unitType.missileImpactOffsetZHD or nil,
|
|
52
|
-
[2] = unitType.
|
|
53
|
-
[3] = unitType.
|
|
54
|
-
[4] = unitType.
|
|
55
|
-
[5] = unitType.
|
|
56
|
-
[6] = unitType.
|
|
57
|
-
[7] = unitType.
|
|
58
|
-
[8] = unitType.
|
|
59
|
-
[9] = unitType.
|
|
50
|
+
[2] = unitType.missileImpactOffsetZDE ~= unitType.missileImpactOffsetZSD and unitType.missileImpactOffsetZDE or nil,
|
|
51
|
+
[3] = unitType.missileLaunchOffsetX ~= ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_X and unitType.missileLaunchOffsetX or nil,
|
|
52
|
+
[4] = unitType.missileLaunchOffsetY ~= ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_Y and unitType.missileLaunchOffsetY or nil,
|
|
53
|
+
[5] = unitType.missileLaunchOffsetZSD ~= ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_Z and unitType.missileLaunchOffsetZSD or nil,
|
|
54
|
+
[6] = unitType.missileLaunchOffsetZHD ~= unitType.missileLaunchOffsetZSD and unitType.missileLaunchOffsetZHD or nil,
|
|
55
|
+
[7] = unitType.missileLaunchOffsetZDE ~= unitType.missileLaunchOffsetZSD and unitType.missileLaunchOffsetZDE or nil,
|
|
56
|
+
[8] = unitType.missileLaunchVisualOffsetXSD ~= ____exports.DEFAULT_MISSILE_LAUNCH_VISUAL_OFFSET_X and unitType.missileLaunchVisualOffsetXSD or nil,
|
|
57
|
+
[9] = unitType.missileLaunchVisualOffsetXHD ~= unitType.missileLaunchVisualOffsetXSD and unitType.missileLaunchVisualOffsetXHD or nil,
|
|
58
|
+
[10] = unitType.missileLaunchVisualOffsetXDE ~= unitType.missileLaunchVisualOffsetXSD and unitType.missileLaunchVisualOffsetXDE or nil,
|
|
59
|
+
[11] = unitType.missileLaunchVisualOffsetYSD ~= ____exports.DEFAULT_MISSILE_LAUNCH_VISUAL_OFFSET_Y and unitType.missileLaunchVisualOffsetYSD or nil,
|
|
60
|
+
[12] = unitType.missileLaunchVisualOffsetYHD ~= unitType.missileLaunchVisualOffsetYSD and unitType.missileLaunchVisualOffsetYHD or nil,
|
|
61
|
+
[13] = unitType.missileLaunchVisualOffsetYDE ~= unitType.missileLaunchVisualOffsetYSD and unitType.missileLaunchVisualOffsetYDE or nil
|
|
60
62
|
}
|
|
61
63
|
end
|
|
62
64
|
)
|
|
63
65
|
end),
|
|
64
66
|
function(data)
|
|
65
|
-
local
|
|
66
|
-
local
|
|
67
|
+
local ____setmetatable_10 = setmetatable
|
|
68
|
+
local ____LocalClient_isHD_1
|
|
67
69
|
if LocalClient.isHD then
|
|
68
|
-
|
|
70
|
+
____LocalClient_isHD_1 = data[1] or data[0]
|
|
69
71
|
else
|
|
70
|
-
|
|
72
|
+
local ____LocalClient_isDE_0
|
|
73
|
+
if LocalClient.isDE then
|
|
74
|
+
____LocalClient_isDE_0 = data[2] or data[0]
|
|
75
|
+
else
|
|
76
|
+
____LocalClient_isDE_0 = data[0]
|
|
77
|
+
end
|
|
78
|
+
____LocalClient_isHD_1 = ____LocalClient_isDE_0
|
|
71
79
|
end
|
|
72
|
-
local
|
|
73
|
-
local
|
|
74
|
-
local
|
|
80
|
+
local ____data__3_8 = data[3]
|
|
81
|
+
local ____data__4_9 = data[4]
|
|
82
|
+
local ____LocalClient_isHD_3
|
|
75
83
|
if LocalClient.isHD then
|
|
76
|
-
|
|
84
|
+
____LocalClient_isHD_3 = data[6] or data[5]
|
|
77
85
|
else
|
|
78
|
-
|
|
86
|
+
local ____LocalClient_isDE_2
|
|
87
|
+
if LocalClient.isDE then
|
|
88
|
+
____LocalClient_isDE_2 = data[7] or data[5]
|
|
89
|
+
else
|
|
90
|
+
____LocalClient_isDE_2 = data[5]
|
|
91
|
+
end
|
|
92
|
+
____LocalClient_isHD_3 = ____LocalClient_isDE_2
|
|
79
93
|
end
|
|
80
|
-
local
|
|
94
|
+
local ____LocalClient_isHD_5
|
|
81
95
|
if LocalClient.isHD then
|
|
82
|
-
|
|
96
|
+
____LocalClient_isHD_5 = data[9] or data[8]
|
|
83
97
|
else
|
|
84
|
-
|
|
98
|
+
local ____LocalClient_isDE_4
|
|
99
|
+
if LocalClient.isDE then
|
|
100
|
+
____LocalClient_isDE_4 = data[10] or data[8]
|
|
101
|
+
else
|
|
102
|
+
____LocalClient_isDE_4 = data[8]
|
|
103
|
+
end
|
|
104
|
+
____LocalClient_isHD_5 = ____LocalClient_isDE_4
|
|
85
105
|
end
|
|
86
|
-
local
|
|
106
|
+
local ____LocalClient_isHD_7
|
|
87
107
|
if LocalClient.isHD then
|
|
88
|
-
|
|
108
|
+
____LocalClient_isHD_7 = data[12] or data[11]
|
|
89
109
|
else
|
|
90
|
-
|
|
110
|
+
local ____LocalClient_isDE_6
|
|
111
|
+
if LocalClient.isDE then
|
|
112
|
+
____LocalClient_isDE_6 = data[13] or data[11]
|
|
113
|
+
else
|
|
114
|
+
____LocalClient_isDE_6 = data[11]
|
|
115
|
+
end
|
|
116
|
+
____LocalClient_isHD_7 = ____LocalClient_isDE_6
|
|
91
117
|
end
|
|
92
|
-
return
|
|
93
|
-
impactOffsetZ =
|
|
94
|
-
launchOffsetX =
|
|
95
|
-
launchOffsetY =
|
|
96
|
-
launchOffsetZ =
|
|
97
|
-
launchVisualOffsetX =
|
|
98
|
-
launchVisualOffsetY =
|
|
118
|
+
return ____setmetatable_10({
|
|
119
|
+
impactOffsetZ = ____LocalClient_isHD_1,
|
|
120
|
+
launchOffsetX = ____data__3_8,
|
|
121
|
+
launchOffsetY = ____data__4_9,
|
|
122
|
+
launchOffsetZ = ____LocalClient_isHD_3,
|
|
123
|
+
launchVisualOffsetX = ____LocalClient_isHD_5,
|
|
124
|
+
launchVisualOffsetY = ____LocalClient_isHD_7
|
|
99
125
|
}, METATABLE)
|
|
100
126
|
end
|
|
101
127
|
),
|
|
@@ -22,19 +22,19 @@ local targetAttribute = attribute()
|
|
|
22
22
|
local impactDelayAttribute = attribute()
|
|
23
23
|
local passedTimeAttribute = attribute()
|
|
24
24
|
local instantOrderIds = luaSetOf(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
25
|
+
852086,
|
|
26
|
+
852100,
|
|
27
|
+
852090,
|
|
28
|
+
852177,
|
|
29
|
+
852002,
|
|
30
|
+
852003,
|
|
31
|
+
852004,
|
|
32
|
+
852005,
|
|
33
|
+
852006,
|
|
34
|
+
852007,
|
|
35
|
+
852087,
|
|
36
|
+
852091,
|
|
37
|
+
852178
|
|
38
38
|
)
|
|
39
39
|
---
|
|
40
40
|
-- @internal For use by internal systems only.
|
|
@@ -139,6 +139,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
139
139
|
private _fields?;
|
|
140
140
|
private getEvent;
|
|
141
141
|
constructor(handle: junit);
|
|
142
|
+
private saveData;
|
|
142
143
|
protected onDestroy(): HandleDestructor;
|
|
143
144
|
addAttackHandler(condition: AttackHandlerCondition, action: AttackHandlerAction): AttackHandler;
|
|
144
145
|
removeAttackHandler(handler: AttackHandler): boolean;
|
|
@@ -161,7 +162,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
161
162
|
isVisibleTo(player: Player): boolean;
|
|
162
163
|
isInvisibleTo(player: Player): boolean;
|
|
163
164
|
isInRangeOf(x: number, y: number, range: number): boolean;
|
|
164
|
-
isInRangeOf(
|
|
165
|
+
isInRangeOf(widget: Widget, range: number): boolean;
|
|
165
166
|
isAllyOf(unit: Unit): boolean;
|
|
166
167
|
isEnemyOf(unit: Unit): boolean;
|
|
167
168
|
playAnimation(...parameters: [animation: number] | [animation: string, rarity?: jraritycontrol]): void;
|
|
@@ -291,7 +292,6 @@ export declare class Unit extends Handle<junit> {
|
|
|
291
292
|
set waygateDestination(v: Vec2);
|
|
292
293
|
get waygateDestination(): Vec2;
|
|
293
294
|
get abilities(): ReadonlyArray<UnitAbility>;
|
|
294
|
-
get onUnitInRange(): Record<number, Event<[Unit]>>;
|
|
295
295
|
get onManaEqual(): Record<number, Event<[Unit, number]>>;
|
|
296
296
|
get manaEvent(): Record<Operator, Record<number, Event<[Unit]>>>;
|
|
297
297
|
get targetAcquiredEvent(): Event;
|
|
@@ -321,7 +321,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
321
321
|
static readonly constructionStartEvent: UnitTriggerEvent<[]>;
|
|
322
322
|
static readonly onUpgradeFinish: UnitTriggerEvent<[]>;
|
|
323
323
|
static readonly onSpellEffect: EventDispatcher<[Unit, number], [Unit]>;
|
|
324
|
-
static readonly onTargetCast: EventDispatcher<[Unit, number,
|
|
324
|
+
static readonly onTargetCast: EventDispatcher<[Unit, number, Destructable | Unit | Item], [Unit, Destructable | Unit | Item]>;
|
|
325
325
|
static readonly onCastPrepare: AbilityEventDispatcher<[]>;
|
|
326
326
|
static readonly onCast: AbilityEventDispatcher<[]>;
|
|
327
327
|
static readonly onPointCastPrepare: AbilityEventDispatcher<[number, number]>;
|
|
@@ -348,15 +348,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
348
348
|
static itemDroppedEvent: UnitTriggerEvent<[Item]>;
|
|
349
349
|
static itemPickedUpEvent: UnitTriggerEvent<[Item]>;
|
|
350
350
|
static itemUsedEvent: UnitTriggerEvent<[Item]>;
|
|
351
|
-
static itemStackedEvent: UnitTriggerEvent<[target: Item, source: Item]>;
|
|
352
351
|
static get itemChargesChangedEvent(): Event<[unit: Unit, item: Item]>;
|
|
353
|
-
static get itemUseOrderEvent(): Event<[unit: Unit, item: Item]>;
|
|
354
|
-
static get itemMoveOrderEvent(): Event<[
|
|
355
|
-
unit: Unit,
|
|
356
|
-
item: Item,
|
|
357
|
-
slotFrom: 0 | 1 | 2 | 3 | 4 | 5,
|
|
358
|
-
slotTo: 0 | 1 | 2 | 3 | 4 | 5
|
|
359
|
-
]>;
|
|
360
352
|
static get onCreate(): EventDispatcher<[Unit], [Unit]>;
|
|
361
353
|
static get destroyEvent(): EventDispatcher<[Unit], [Unit]>;
|
|
362
354
|
getField(field: junitintegerfield | junitrealfield): number;
|
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
|
|
@@ -383,15 +381,27 @@ local modifiers = {
|
|
|
383
381
|
end,
|
|
384
382
|
armor = function(unit, value)
|
|
385
383
|
if UnitAddAbility(unit, armorBonusAbilityId) then
|
|
386
|
-
assert(
|
|
384
|
+
assert(
|
|
385
|
+
UnitMakeAbilityPermanent(unit, true, armorBonusAbilityId),
|
|
386
|
+
"armor bonus ability must be made permanent",
|
|
387
|
+
unit
|
|
388
|
+
)
|
|
387
389
|
end
|
|
388
|
-
local ability = assert(
|
|
389
|
-
|
|
390
|
-
ability,
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
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
|
+
)
|
|
395
405
|
end
|
|
396
406
|
}
|
|
397
407
|
local getters = {
|
|
@@ -580,8 +590,6 @@ __TS__SetDescriptor(
|
|
|
580
590
|
},
|
|
581
591
|
true
|
|
582
592
|
)
|
|
583
|
-
local unitInventorySize = UnitInventorySize
|
|
584
|
-
local unitItemInSlot = UnitItemInSlot
|
|
585
593
|
local getItemAbility = BlzGetItemAbility
|
|
586
594
|
local getUnitAbility = BlzGetUnitAbility
|
|
587
595
|
local getUnitAbilityByIndex = BlzGetUnitAbilityByIndex
|
|
@@ -599,8 +607,8 @@ local function retrieveAbility(unit, ability, abilityId)
|
|
|
599
607
|
____exports.Unit:of(unit)
|
|
600
608
|
)
|
|
601
609
|
end
|
|
602
|
-
for i = 0,
|
|
603
|
-
local item =
|
|
610
|
+
for i = 0, UnitInventorySize(unit) - 1 do
|
|
611
|
+
local item = UnitItemInSlot(unit, i)
|
|
604
612
|
if getItemAbility(item, abilityId) == ability then
|
|
605
613
|
return ItemAbility:of(
|
|
606
614
|
ability,
|
|
@@ -645,13 +653,17 @@ local fieldSetters = {
|
|
|
645
653
|
}
|
|
646
654
|
local dummies = {}
|
|
647
655
|
for ____, player in ipairs(Player.all) do
|
|
648
|
-
local dummy = assert(
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
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
|
+
)
|
|
655
667
|
ShowUnit(dummy, false)
|
|
656
668
|
dummies[player] = dummy
|
|
657
669
|
end
|
|
@@ -694,16 +706,28 @@ function Unit.prototype.____constructor(self, handle)
|
|
|
694
706
|
nextSyncId = ____nextSyncId_1 + 1
|
|
695
707
|
self.syncId = ____nextSyncId_1
|
|
696
708
|
self._owner = Player:of(getOwningPlayer(handle))
|
|
697
|
-
assert(
|
|
698
|
-
|
|
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
|
+
)
|
|
699
719
|
if unitAddAbility(
|
|
700
720
|
handle,
|
|
701
721
|
fourCC("Amrf")
|
|
702
722
|
) then
|
|
703
|
-
assert(
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
723
|
+
assert(
|
|
724
|
+
unitRemoveAbility(
|
|
725
|
+
handle,
|
|
726
|
+
fourCC("Amrf")
|
|
727
|
+
),
|
|
728
|
+
"fly ability must be removed after addition",
|
|
729
|
+
self
|
|
730
|
+
)
|
|
707
731
|
end
|
|
708
732
|
unitBySyncId[self.syncId] = self
|
|
709
733
|
local ____ = self.abilities
|
|
@@ -724,13 +748,15 @@ function Unit.prototype.getEvent(self, jevent, collector)
|
|
|
724
748
|
end
|
|
725
749
|
return event
|
|
726
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))
|
|
756
|
+
end
|
|
727
757
|
function Unit.prototype.onDestroy(self)
|
|
728
758
|
local handle = self.handle
|
|
729
|
-
self
|
|
730
|
-
self[109] = getUnitY(handle)
|
|
731
|
-
if not self._owner then
|
|
732
|
-
self._owner = Player:of(getOwningPlayer(handle))
|
|
733
|
-
end
|
|
759
|
+
self:saveData()
|
|
734
760
|
local abilities = self.abilities
|
|
735
761
|
for ____, ability in ipairs(abilities) do
|
|
736
762
|
ability:destroy()
|
|
@@ -748,7 +774,9 @@ function Unit.prototype.onDestroy(self)
|
|
|
748
774
|
end
|
|
749
775
|
local eventsToDestroy = self._eventsToDestroy
|
|
750
776
|
if eventsToDestroy ~= nil then
|
|
751
|
-
|
|
777
|
+
for ____, event in ipairs(eventsToDestroy) do
|
|
778
|
+
event:destroy()
|
|
779
|
+
end
|
|
752
780
|
end
|
|
753
781
|
if getUnitAbilityLevel(handle, leaveDetectAbilityId) > 0 then
|
|
754
782
|
unitRemoveAbility(handle, leaveDetectAbilityId)
|
|
@@ -766,7 +794,11 @@ function Unit.prototype.addAttackHandler(self, condition, action)
|
|
|
766
794
|
self._attackHandlers = handlers
|
|
767
795
|
if #handlers == 1 then
|
|
768
796
|
local handle = self.handle
|
|
769
|
-
assert(
|
|
797
|
+
assert(
|
|
798
|
+
unitAddAbility(handle, attackHandlerAbilityId) and UnitMakeAbilityPermanent(handle, true, attackHandlerAbilityId),
|
|
799
|
+
"attack handler ability must be added",
|
|
800
|
+
self
|
|
801
|
+
)
|
|
770
802
|
end
|
|
771
803
|
return handler
|
|
772
804
|
end
|
|
@@ -814,13 +846,19 @@ function Unit.prototype.isInvisibleTo(self, player)
|
|
|
814
846
|
return isUnitInvisible(self.handle, player.handle)
|
|
815
847
|
end
|
|
816
848
|
function Unit.prototype.isInRangeOf(self, x, y, range)
|
|
817
|
-
local
|
|
849
|
+
local ____temp_4
|
|
818
850
|
if type(x) == "number" then
|
|
819
|
-
|
|
851
|
+
____temp_4 = isUnitInRangeXY(self.handle, x, y, range)
|
|
820
852
|
else
|
|
821
|
-
____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
|
|
822
860
|
end
|
|
823
|
-
return
|
|
861
|
+
return ____temp_4
|
|
824
862
|
end
|
|
825
863
|
function Unit.prototype.isAllyOf(self, unit)
|
|
826
864
|
return isUnitAlly(
|
|
@@ -878,14 +916,14 @@ function Unit.prototype.kill(self)
|
|
|
878
916
|
killUnit(self.handle)
|
|
879
917
|
end
|
|
880
918
|
function Unit.prototype.revive(self, x, y, doEffect)
|
|
881
|
-
local
|
|
882
|
-
local
|
|
883
|
-
local
|
|
884
|
-
if
|
|
885
|
-
|
|
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
|
|
886
924
|
end
|
|
887
|
-
__TS__SparseArrayPush(
|
|
888
|
-
|
|
925
|
+
__TS__SparseArrayPush(____array_6, ____doEffect_5)
|
|
926
|
+
____ReviveHero_7(__TS__SparseArraySpread(____array_6))
|
|
889
927
|
end
|
|
890
928
|
function Unit.prototype.healTarget(self, target, amount)
|
|
891
929
|
if __TS__InstanceOf(target, ____exports.Unit) and target:hasAbility(fourCC("BIhm")) then
|
|
@@ -925,7 +963,7 @@ function Unit.prototype.dropItemSlot(self, item, slot)
|
|
|
925
963
|
return UnitDropItemSlot(self.handle, item.handle, slot)
|
|
926
964
|
end
|
|
927
965
|
function Unit.prototype.itemInSlot(self, slot)
|
|
928
|
-
return Item:of(
|
|
966
|
+
return Item:of(UnitItemInSlot(self.handle, slot))
|
|
929
967
|
end
|
|
930
968
|
function Unit.prototype.addAbility(self, abilityId)
|
|
931
969
|
local ability = UnitAbility:of(
|
|
@@ -1283,7 +1321,7 @@ __TS__SetDescriptor(
|
|
|
1283
1321
|
Unit.prototype,
|
|
1284
1322
|
"isStunned",
|
|
1285
1323
|
{get = function(self)
|
|
1286
|
-
return getUnitCurrentOrder(self.handle) ==
|
|
1324
|
+
return getUnitCurrentOrder(self.handle) == 851973
|
|
1287
1325
|
end},
|
|
1288
1326
|
true
|
|
1289
1327
|
)
|
|
@@ -1459,13 +1497,13 @@ __TS__SetDescriptor(
|
|
|
1459
1497
|
end,
|
|
1460
1498
|
set = function(self, isTeamGlowVisible)
|
|
1461
1499
|
BlzShowUnitTeamGlow(self.handle, isTeamGlowVisible)
|
|
1462
|
-
local
|
|
1500
|
+
local ____temp_8
|
|
1463
1501
|
if not isTeamGlowVisible then
|
|
1464
|
-
|
|
1502
|
+
____temp_8 = true
|
|
1465
1503
|
else
|
|
1466
|
-
|
|
1504
|
+
____temp_8 = nil
|
|
1467
1505
|
end
|
|
1468
|
-
self[107] =
|
|
1506
|
+
self[107] = ____temp_8
|
|
1469
1507
|
end
|
|
1470
1508
|
},
|
|
1471
1509
|
true
|
|
@@ -1845,7 +1883,7 @@ __TS__SetDescriptor(
|
|
|
1845
1883
|
Unit.prototype,
|
|
1846
1884
|
"pathingCollisionRange",
|
|
1847
1885
|
{get = function(self)
|
|
1848
|
-
return 16 * (min(
|
|
1886
|
+
return 16 * (math.min(
|
|
1849
1887
|
getUnitCollisionSize(self.handle) // 16,
|
|
1850
1888
|
3
|
|
1851
1889
|
) + 1)
|
|
@@ -1955,30 +1993,6 @@ __TS__SetDescriptor(
|
|
|
1955
1993
|
end},
|
|
1956
1994
|
true
|
|
1957
1995
|
)
|
|
1958
|
-
__TS__SetDescriptor(
|
|
1959
|
-
Unit.prototype,
|
|
1960
|
-
"onUnitInRange",
|
|
1961
|
-
{get = function(self)
|
|
1962
|
-
local handle = self.handle
|
|
1963
|
-
local onUnitInRange = setmetatable(
|
|
1964
|
-
{},
|
|
1965
|
-
{__index = function(self, value)
|
|
1966
|
-
local event = __TS__New(
|
|
1967
|
-
TriggerEvent,
|
|
1968
|
-
function(trigger)
|
|
1969
|
-
TriggerRegisterUnitInRangeSimple(trigger, value, handle)
|
|
1970
|
-
end,
|
|
1971
|
-
function() return ____exports.Unit:of(handle) end
|
|
1972
|
-
)
|
|
1973
|
-
rawset(self, value, event)
|
|
1974
|
-
return event
|
|
1975
|
-
end}
|
|
1976
|
-
)
|
|
1977
|
-
rawset(self, "onUnitInRange", onUnitInRange)
|
|
1978
|
-
return onUnitInRange
|
|
1979
|
-
end},
|
|
1980
|
-
true
|
|
1981
|
-
)
|
|
1982
1996
|
__TS__SetDescriptor(
|
|
1983
1997
|
Unit.prototype,
|
|
1984
1998
|
"onManaEqual",
|
|
@@ -2136,7 +2150,7 @@ Unit.onResurrect = __TS__New(
|
|
|
2136
2150
|
____exports.Unit.deathEvent:addListener(function(unit)
|
|
2137
2151
|
dead[unit] = true
|
|
2138
2152
|
end)
|
|
2139
|
-
____exports.Unit.onImmediateOrder[
|
|
2153
|
+
____exports.Unit.onImmediateOrder[852056]:addListener(function(unit)
|
|
2140
2154
|
if dead[unit] and not IsUnitType(unit.handle, UNIT_TYPE_DEAD) then
|
|
2141
2155
|
dead[unit] = false
|
|
2142
2156
|
invoke(event, unit)
|
|
@@ -2153,7 +2167,7 @@ Unit.morphEvent = __TS__New(
|
|
|
2153
2167
|
invoke(event, unit)
|
|
2154
2168
|
end
|
|
2155
2169
|
end
|
|
2156
|
-
____exports.Unit.onImmediateOrder[
|
|
2170
|
+
____exports.Unit.onImmediateOrder[852056]:addListener(function(unit)
|
|
2157
2171
|
if getUnitAbilityLevel(unit.handle, morphDetectAbilityId) == 0 then
|
|
2158
2172
|
Timer:run(ifNotLeft, unit)
|
|
2159
2173
|
end
|
|
@@ -2194,25 +2208,25 @@ Unit.onTargetCast = dispatchId(__TS__New(
|
|
|
2194
2208
|
InitializingEvent,
|
|
2195
2209
|
function(event)
|
|
2196
2210
|
local function listener(unit, id)
|
|
2197
|
-
local
|
|
2211
|
+
local ____GetSpellTargetUnit_result_11
|
|
2198
2212
|
if GetSpellTargetUnit() then
|
|
2199
|
-
|
|
2213
|
+
____GetSpellTargetUnit_result_11 = ____exports.Unit:of(GetSpellTargetUnit())
|
|
2200
2214
|
else
|
|
2201
|
-
local
|
|
2215
|
+
local ____GetSpellTargetItem_result_10
|
|
2202
2216
|
if GetSpellTargetItem() then
|
|
2203
|
-
|
|
2217
|
+
____GetSpellTargetItem_result_10 = Item:of(GetSpellTargetItem())
|
|
2204
2218
|
else
|
|
2205
|
-
local
|
|
2219
|
+
local ____GetSpellTargetDestructable_result_9
|
|
2206
2220
|
if GetSpellTargetDestructable() then
|
|
2207
|
-
|
|
2221
|
+
____GetSpellTargetDestructable_result_9 = Destructable:of(GetSpellTargetDestructable())
|
|
2208
2222
|
else
|
|
2209
|
-
|
|
2223
|
+
____GetSpellTargetDestructable_result_9 = nil
|
|
2210
2224
|
end
|
|
2211
|
-
|
|
2225
|
+
____GetSpellTargetItem_result_10 = ____GetSpellTargetDestructable_result_9
|
|
2212
2226
|
end
|
|
2213
|
-
|
|
2227
|
+
____GetSpellTargetUnit_result_11 = ____GetSpellTargetItem_result_10
|
|
2214
2228
|
end
|
|
2215
|
-
local target =
|
|
2229
|
+
local target = ____GetSpellTargetUnit_result_11
|
|
2216
2230
|
if target then
|
|
2217
2231
|
invoke(event, unit, id, target)
|
|
2218
2232
|
end
|
|
@@ -2620,7 +2634,7 @@ Unit.itemDroppedEvent = __TS__New(
|
|
|
2620
2634
|
function()
|
|
2621
2635
|
local unit = getTriggerUnit()
|
|
2622
2636
|
local item = getManipulatedItem()
|
|
2623
|
-
if getUnitTypeId(unit) ~= dummyUnitId and not (
|
|
2637
|
+
if getUnitTypeId(unit) ~= dummyUnitId and not isItemIgnoredInEvents(item) then
|
|
2624
2638
|
return ____exports.Unit:of(unit), Item:of(item)
|
|
2625
2639
|
end
|
|
2626
2640
|
return IgnoreEvent
|
|
@@ -2632,10 +2646,10 @@ Unit.itemPickedUpEvent = __TS__New(
|
|
|
2632
2646
|
function()
|
|
2633
2647
|
local unitHandle = getTriggerUnit()
|
|
2634
2648
|
local itemHandle = getManipulatedItem()
|
|
2635
|
-
if getUnitTypeId(unitHandle) ~= dummyUnitId and not (
|
|
2649
|
+
if getUnitTypeId(unitHandle) ~= dummyUnitId and not isItemIgnoredInEvents(itemHandle) then
|
|
2636
2650
|
local unit = ____exports.Unit:of(unitHandle)
|
|
2637
2651
|
local item = Item:of(itemHandle)
|
|
2638
|
-
if item
|
|
2652
|
+
if ownerByItem[item] ~= unit then
|
|
2639
2653
|
return unit, item
|
|
2640
2654
|
end
|
|
2641
2655
|
end
|
|
@@ -2648,17 +2662,12 @@ Unit.itemUsedEvent = __TS__New(
|
|
|
2648
2662
|
function()
|
|
2649
2663
|
local unit = getTriggerUnit()
|
|
2650
2664
|
local item = getManipulatedItem()
|
|
2651
|
-
if getUnitTypeId(unit) ~= dummyUnitId and not (
|
|
2665
|
+
if getUnitTypeId(unit) ~= dummyUnitId and not isItemIgnoredInEvents(item) then
|
|
2652
2666
|
return ____exports.Unit:of(unit), Item:of(item)
|
|
2653
2667
|
end
|
|
2654
2668
|
return IgnoreEvent
|
|
2655
2669
|
end
|
|
2656
2670
|
)
|
|
2657
|
-
Unit.itemStackedEvent = __TS__New(
|
|
2658
|
-
____exports.UnitTriggerEvent,
|
|
2659
|
-
EVENT_PLAYER_UNIT_STACK_ITEM,
|
|
2660
|
-
function() return ____exports.Unit:of(getTriggerUnit()), Item:of(BlzGetStackingItemTarget()), Item:of(BlzGetStackingItemSource()) end
|
|
2661
|
-
)
|
|
2662
2671
|
__TS__ObjectDefineProperty(
|
|
2663
2672
|
Unit,
|
|
2664
2673
|
"itemChargesChangedEvent",
|
|
@@ -2674,51 +2683,6 @@ __TS__ObjectDefineProperty(
|
|
|
2674
2683
|
return event
|
|
2675
2684
|
end}
|
|
2676
2685
|
)
|
|
2677
|
-
__TS__ObjectDefineProperty(
|
|
2678
|
-
Unit,
|
|
2679
|
-
"itemUseOrderEvent",
|
|
2680
|
-
{get = function(self)
|
|
2681
|
-
local event = __TS__New(Event)
|
|
2682
|
-
for order = orderId("useslot0"), orderId("useslot5") do
|
|
2683
|
-
local slot = order - orderId("useslot0")
|
|
2684
|
-
local function listener(unit)
|
|
2685
|
-
local item = unit.items[slot + 1]
|
|
2686
|
-
if item ~= nil then
|
|
2687
|
-
invoke(event, unit, item)
|
|
2688
|
-
end
|
|
2689
|
-
end
|
|
2690
|
-
self.onImmediateOrder[order]:addListener(listener)
|
|
2691
|
-
self.onTargetOrder[order]:addListener(listener)
|
|
2692
|
-
self.onPointOrder[order]:addListener(listener)
|
|
2693
|
-
end
|
|
2694
|
-
rawset(self, "itemUseOrderEvent", event)
|
|
2695
|
-
return event
|
|
2696
|
-
end}
|
|
2697
|
-
)
|
|
2698
|
-
__TS__ObjectDefineProperty(
|
|
2699
|
-
Unit,
|
|
2700
|
-
"itemMoveOrderEvent",
|
|
2701
|
-
{get = function(self)
|
|
2702
|
-
local event = __TS__New(Event)
|
|
2703
|
-
for order = orderId("moveslot0"), orderId("moveslot5") do
|
|
2704
|
-
local slotTo = order - orderId("moveslot0")
|
|
2705
|
-
self.onTargetOrder[order]:addListener(function(unit, item)
|
|
2706
|
-
local slotFrom = unit.items:findSlot(item)
|
|
2707
|
-
if slotFrom ~= nil then
|
|
2708
|
-
invoke(
|
|
2709
|
-
event,
|
|
2710
|
-
unit,
|
|
2711
|
-
item,
|
|
2712
|
-
slotFrom,
|
|
2713
|
-
slotTo
|
|
2714
|
-
)
|
|
2715
|
-
end
|
|
2716
|
-
end)
|
|
2717
|
-
end
|
|
2718
|
-
rawset(self, "itemMoveOrderEvent", event)
|
|
2719
|
-
return event
|
|
2720
|
-
end}
|
|
2721
|
-
)
|
|
2722
2686
|
__TS__ObjectDefineProperty(
|
|
2723
2687
|
Unit,
|
|
2724
2688
|
"onCreate",
|
|
@@ -2765,11 +2729,7 @@ Unit.synchronize = synchronizer(
|
|
|
2765
2729
|
function(____, id) return fourCC(id) end
|
|
2766
2730
|
)
|
|
2767
2731
|
end)
|
|
2768
|
-
for ____, leaveOrderId in ipairs({
|
|
2769
|
-
orderId("undefend"),
|
|
2770
|
-
orderId("magicundefense"),
|
|
2771
|
-
orderId("unimmolation")
|
|
2772
|
-
}) do
|
|
2732
|
+
for ____, leaveOrderId in ipairs({852056, 852479, 852178}) do
|
|
2773
2733
|
____exports.Unit.onImmediateOrder[leaveOrderId]:addListener(function(unit)
|
|
2774
2734
|
local handle = unit.handle
|
|
2775
2735
|
for i = 1, #leaveAbilityIds do
|
|
@@ -2777,7 +2737,8 @@ Unit.synchronize = synchronizer(
|
|
|
2777
2737
|
return
|
|
2778
2738
|
end
|
|
2779
2739
|
end
|
|
2780
|
-
unit:
|
|
2740
|
+
unit:saveData()
|
|
2741
|
+
Timer:run(unit, "destroy")
|
|
2781
2742
|
end)
|
|
2782
2743
|
end
|
|
2783
2744
|
end)(Unit)
|