warscript 0.0.1-dev.91da42b → 0.0.1-dev.9381e62
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 +1 -0
- package/core/types/frame.lua +112 -37
- 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/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/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/stun-immunity.d.ts +1 -1
- package/engine/behaviour/unit/stun-immunity.lua +5 -4
- package/engine/behaviour/unit.d.ts +1 -0
- package/engine/behaviour/unit.lua +14 -3
- package/engine/buff.d.ts +61 -25
- package/engine/buff.lua +330 -156
- package/engine/index.d.ts +2 -1
- package/engine/internal/ability.d.ts +4 -0
- package/engine/internal/ability.lua +56 -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/unit/ability.lua +15 -3
- 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/pseudo-passive-abilities.d.ts +2 -0
- package/engine/internal/unit/pseudo-passive-abilities.lua +11 -0
- 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 +2 -10
- package/engine/internal/unit.lua +92 -133
- 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-configurable.d.ts +3 -0
- package/engine/object-data/entry/ability-type/blank-configurable.lua +30 -0
- package/engine/object-data/entry/ability-type/breath-of-fire.d.ts +11 -0
- package/engine/object-data/entry/ability-type/breath-of-fire.lua +27 -0
- package/engine/object-data/entry/ability-type/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/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 +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/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
|
@@ -23,22 +23,22 @@ local issueTargetOrderById = IssueTargetOrderById
|
|
|
23
23
|
local queuePointOrderById = BlzQueuePointOrderById
|
|
24
24
|
local queueTargetOrderById = BlzQueueTargetOrderById
|
|
25
25
|
local rallyRouteByUnit = setmetatable({}, {__mode = "k"})
|
|
26
|
-
Unit.onPointOrder[
|
|
26
|
+
Unit.onPointOrder[851980]:addListener(function(unit, x, y)
|
|
27
27
|
processPoint(unit, x, y)
|
|
28
28
|
end)
|
|
29
|
-
Unit.onPointOrder[
|
|
29
|
+
Unit.onPointOrder[851971]:addListener(function(unit, x, y)
|
|
30
30
|
if unit:hasAbility(fourCC("ARal")) then
|
|
31
31
|
processPoint(unit, x, y)
|
|
32
32
|
end
|
|
33
33
|
end)
|
|
34
|
-
Unit.onTargetOrder[
|
|
34
|
+
Unit.onTargetOrder[851980]:addListener(function(unit, target)
|
|
35
35
|
if __TS__InstanceOf(target, Unit) then
|
|
36
36
|
processUnit(unit, target)
|
|
37
37
|
elseif __TS__InstanceOf(target, Destructable) then
|
|
38
38
|
processDestructible(unit, target)
|
|
39
39
|
end
|
|
40
40
|
end)
|
|
41
|
-
Unit.onTargetOrder[
|
|
41
|
+
Unit.onTargetOrder[851971]:addListener(function(unit, target)
|
|
42
42
|
if unit:hasAbility(fourCC("ARal")) then
|
|
43
43
|
if __TS__InstanceOf(target, Unit) then
|
|
44
44
|
processUnit(unit, target)
|
|
@@ -116,41 +116,19 @@ __TS__ObjectDefineProperty(
|
|
|
116
116
|
do
|
|
117
117
|
local rallyPoint = rallyRoute[1]
|
|
118
118
|
if __TS__InstanceOf(rallyPoint, Handle) then
|
|
119
|
-
issueTargetOrderById(
|
|
120
|
-
handle,
|
|
121
|
-
orderId("setrally"),
|
|
122
|
-
rallyPoint.handle
|
|
123
|
-
)
|
|
119
|
+
issueTargetOrderById(handle, 851980, rallyPoint.handle)
|
|
124
120
|
elseif rallyPoint ~= nil then
|
|
125
|
-
issuePointOrderById(
|
|
126
|
-
handle,
|
|
127
|
-
orderId("setrally"),
|
|
128
|
-
rallyPoint[1],
|
|
129
|
-
rallyPoint[2]
|
|
130
|
-
)
|
|
121
|
+
issuePointOrderById(handle, 851980, rallyPoint[1], rallyPoint[2])
|
|
131
122
|
else
|
|
132
|
-
issueTargetOrderById(
|
|
133
|
-
handle,
|
|
134
|
-
orderId("setrally"),
|
|
135
|
-
handle
|
|
136
|
-
)
|
|
123
|
+
issueTargetOrderById(handle, 851980, handle)
|
|
137
124
|
end
|
|
138
125
|
end
|
|
139
126
|
for i = 2, #rallyRoute do
|
|
140
127
|
local rallyPoint = rallyRoute[i]
|
|
141
128
|
if __TS__InstanceOf(rallyPoint, Handle) then
|
|
142
|
-
queueTargetOrderById(
|
|
143
|
-
handle,
|
|
144
|
-
orderId("setrally"),
|
|
145
|
-
rallyPoint.handle
|
|
146
|
-
)
|
|
129
|
+
queueTargetOrderById(handle, 851980, rallyPoint.handle)
|
|
147
130
|
else
|
|
148
|
-
queuePointOrderById(
|
|
149
|
-
handle,
|
|
150
|
-
orderId("setrally"),
|
|
151
|
-
rallyPoint[1],
|
|
152
|
-
rallyPoint[2]
|
|
153
|
-
)
|
|
131
|
+
queuePointOrderById(handle, 851980, rallyPoint[1], rallyPoint[2])
|
|
154
132
|
end
|
|
155
133
|
end
|
|
156
134
|
end
|
|
@@ -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;
|
|
@@ -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
|
@@ -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
|
|
@@ -64,6 +62,8 @@ local ____ability = require("engine.internal.item.ability")
|
|
|
64
62
|
local doUnitAbilityAction = ____ability.doUnitAbilityAction
|
|
65
63
|
local ____synchronization = require("engine.synchronization")
|
|
66
64
|
local synchronizer = ____synchronization.synchronizer
|
|
65
|
+
local ____linked_2Dmap = require("utility.linked-map")
|
|
66
|
+
local LinkedMap = ____linked_2Dmap.LinkedMap
|
|
67
67
|
local match = string.match
|
|
68
68
|
local ____tostring = _G.tostring
|
|
69
69
|
local setUnitAnimation = SetUnitAnimation
|
|
@@ -381,15 +381,27 @@ local modifiers = {
|
|
|
381
381
|
end,
|
|
382
382
|
armor = function(unit, value)
|
|
383
383
|
if UnitAddAbility(unit, armorBonusAbilityId) then
|
|
384
|
-
assert(
|
|
384
|
+
assert(
|
|
385
|
+
UnitMakeAbilityPermanent(unit, true, armorBonusAbilityId),
|
|
386
|
+
"armor bonus ability must be made permanent",
|
|
387
|
+
unit
|
|
388
|
+
)
|
|
385
389
|
end
|
|
386
|
-
local ability = assert(
|
|
387
|
-
|
|
388
|
-
ability,
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
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
|
+
)
|
|
393
405
|
end
|
|
394
406
|
}
|
|
395
407
|
local getters = {
|
|
@@ -578,8 +590,6 @@ __TS__SetDescriptor(
|
|
|
578
590
|
},
|
|
579
591
|
true
|
|
580
592
|
)
|
|
581
|
-
local unitInventorySize = UnitInventorySize
|
|
582
|
-
local unitItemInSlot = UnitItemInSlot
|
|
583
593
|
local getItemAbility = BlzGetItemAbility
|
|
584
594
|
local getUnitAbility = BlzGetUnitAbility
|
|
585
595
|
local getUnitAbilityByIndex = BlzGetUnitAbilityByIndex
|
|
@@ -597,8 +607,8 @@ local function retrieveAbility(unit, ability, abilityId)
|
|
|
597
607
|
____exports.Unit:of(unit)
|
|
598
608
|
)
|
|
599
609
|
end
|
|
600
|
-
for i = 0,
|
|
601
|
-
local item =
|
|
610
|
+
for i = 0, UnitInventorySize(unit) - 1 do
|
|
611
|
+
local item = UnitItemInSlot(unit, i)
|
|
602
612
|
if getItemAbility(item, abilityId) == ability then
|
|
603
613
|
return ItemAbility:of(
|
|
604
614
|
ability,
|
|
@@ -643,13 +653,17 @@ local fieldSetters = {
|
|
|
643
653
|
}
|
|
644
654
|
local dummies = {}
|
|
645
655
|
for ____, player in ipairs(Player.all) do
|
|
646
|
-
local dummy = assert(
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
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
|
+
)
|
|
653
667
|
ShowUnit(dummy, false)
|
|
654
668
|
dummies[player] = dummy
|
|
655
669
|
end
|
|
@@ -692,41 +706,57 @@ function Unit.prototype.____constructor(self, handle)
|
|
|
692
706
|
nextSyncId = ____nextSyncId_1 + 1
|
|
693
707
|
self.syncId = ____nextSyncId_1
|
|
694
708
|
self._owner = Player:of(getOwningPlayer(handle))
|
|
695
|
-
assert(
|
|
696
|
-
|
|
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
|
+
)
|
|
697
719
|
if unitAddAbility(
|
|
698
720
|
handle,
|
|
699
721
|
fourCC("Amrf")
|
|
700
722
|
) then
|
|
701
|
-
assert(
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
723
|
+
assert(
|
|
724
|
+
unitRemoveAbility(
|
|
725
|
+
handle,
|
|
726
|
+
fourCC("Amrf")
|
|
727
|
+
),
|
|
728
|
+
"fly ability must be removed after addition",
|
|
729
|
+
self
|
|
730
|
+
)
|
|
705
731
|
end
|
|
706
732
|
unitBySyncId[self.syncId] = self
|
|
707
733
|
local ____ = self.abilities
|
|
708
734
|
end
|
|
709
|
-
function Unit.prototype.getEvent(self,
|
|
710
|
-
self.events = self.events or (
|
|
711
|
-
local eventId = GetHandleId(
|
|
712
|
-
|
|
713
|
-
|
|
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(
|
|
714
741
|
TriggerEvent,
|
|
715
742
|
function(trigger)
|
|
716
|
-
TriggerRegisterUnitEvent(trigger, self.handle,
|
|
743
|
+
TriggerRegisterUnitEvent(trigger, self.handle, jevent)
|
|
717
744
|
end,
|
|
718
745
|
collector or (function() return {} end)
|
|
719
746
|
)
|
|
747
|
+
self.events:put(eventId, event)
|
|
720
748
|
end
|
|
721
|
-
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))
|
|
722
756
|
end
|
|
723
757
|
function Unit.prototype.onDestroy(self)
|
|
724
758
|
local handle = self.handle
|
|
725
|
-
self
|
|
726
|
-
self[109] = getUnitY(handle)
|
|
727
|
-
if not self._owner then
|
|
728
|
-
self._owner = Player:of(getOwningPlayer(handle))
|
|
729
|
-
end
|
|
759
|
+
self:saveData()
|
|
730
760
|
local abilities = self.abilities
|
|
731
761
|
for ____, ability in ipairs(abilities) do
|
|
732
762
|
ability:destroy()
|
|
@@ -744,7 +774,9 @@ function Unit.prototype.onDestroy(self)
|
|
|
744
774
|
end
|
|
745
775
|
local eventsToDestroy = self._eventsToDestroy
|
|
746
776
|
if eventsToDestroy ~= nil then
|
|
747
|
-
|
|
777
|
+
for ____, event in ipairs(eventsToDestroy) do
|
|
778
|
+
event:destroy()
|
|
779
|
+
end
|
|
748
780
|
end
|
|
749
781
|
if getUnitAbilityLevel(handle, leaveDetectAbilityId) > 0 then
|
|
750
782
|
unitRemoveAbility(handle, leaveDetectAbilityId)
|
|
@@ -762,7 +794,11 @@ function Unit.prototype.addAttackHandler(self, condition, action)
|
|
|
762
794
|
self._attackHandlers = handlers
|
|
763
795
|
if #handlers == 1 then
|
|
764
796
|
local handle = self.handle
|
|
765
|
-
assert(
|
|
797
|
+
assert(
|
|
798
|
+
unitAddAbility(handle, attackHandlerAbilityId) and UnitMakeAbilityPermanent(handle, true, attackHandlerAbilityId),
|
|
799
|
+
"attack handler ability must be added",
|
|
800
|
+
self
|
|
801
|
+
)
|
|
766
802
|
end
|
|
767
803
|
return handler
|
|
768
804
|
end
|
|
@@ -921,7 +957,7 @@ function Unit.prototype.dropItemSlot(self, item, slot)
|
|
|
921
957
|
return UnitDropItemSlot(self.handle, item.handle, slot)
|
|
922
958
|
end
|
|
923
959
|
function Unit.prototype.itemInSlot(self, slot)
|
|
924
|
-
return Item:of(
|
|
960
|
+
return Item:of(UnitItemInSlot(self.handle, slot))
|
|
925
961
|
end
|
|
926
962
|
function Unit.prototype.addAbility(self, abilityId)
|
|
927
963
|
local ability = UnitAbility:of(
|
|
@@ -1279,7 +1315,7 @@ __TS__SetDescriptor(
|
|
|
1279
1315
|
Unit.prototype,
|
|
1280
1316
|
"isStunned",
|
|
1281
1317
|
{get = function(self)
|
|
1282
|
-
return getUnitCurrentOrder(self.handle) ==
|
|
1318
|
+
return getUnitCurrentOrder(self.handle) == 851973
|
|
1283
1319
|
end},
|
|
1284
1320
|
true
|
|
1285
1321
|
)
|
|
@@ -1841,7 +1877,7 @@ __TS__SetDescriptor(
|
|
|
1841
1877
|
Unit.prototype,
|
|
1842
1878
|
"pathingCollisionRange",
|
|
1843
1879
|
{get = function(self)
|
|
1844
|
-
return 16 * (min(
|
|
1880
|
+
return 16 * (math.min(
|
|
1845
1881
|
getUnitCollisionSize(self.handle) // 16,
|
|
1846
1882
|
3
|
|
1847
1883
|
) + 1)
|
|
@@ -1951,30 +1987,6 @@ __TS__SetDescriptor(
|
|
|
1951
1987
|
end},
|
|
1952
1988
|
true
|
|
1953
1989
|
)
|
|
1954
|
-
__TS__SetDescriptor(
|
|
1955
|
-
Unit.prototype,
|
|
1956
|
-
"onUnitInRange",
|
|
1957
|
-
{get = function(self)
|
|
1958
|
-
local handle = self.handle
|
|
1959
|
-
local onUnitInRange = setmetatable(
|
|
1960
|
-
{},
|
|
1961
|
-
{__index = function(self, value)
|
|
1962
|
-
local event = __TS__New(
|
|
1963
|
-
TriggerEvent,
|
|
1964
|
-
function(trigger)
|
|
1965
|
-
TriggerRegisterUnitInRangeSimple(trigger, value, handle)
|
|
1966
|
-
end,
|
|
1967
|
-
function() return ____exports.Unit:of(handle) end
|
|
1968
|
-
)
|
|
1969
|
-
rawset(self, value, event)
|
|
1970
|
-
return event
|
|
1971
|
-
end}
|
|
1972
|
-
)
|
|
1973
|
-
rawset(self, "onUnitInRange", onUnitInRange)
|
|
1974
|
-
return onUnitInRange
|
|
1975
|
-
end},
|
|
1976
|
-
true
|
|
1977
|
-
)
|
|
1978
1990
|
__TS__SetDescriptor(
|
|
1979
1991
|
Unit.prototype,
|
|
1980
1992
|
"onManaEqual",
|
|
@@ -2132,7 +2144,7 @@ Unit.onResurrect = __TS__New(
|
|
|
2132
2144
|
____exports.Unit.deathEvent:addListener(function(unit)
|
|
2133
2145
|
dead[unit] = true
|
|
2134
2146
|
end)
|
|
2135
|
-
____exports.Unit.onImmediateOrder[
|
|
2147
|
+
____exports.Unit.onImmediateOrder[852056]:addListener(function(unit)
|
|
2136
2148
|
if dead[unit] and not IsUnitType(unit.handle, UNIT_TYPE_DEAD) then
|
|
2137
2149
|
dead[unit] = false
|
|
2138
2150
|
invoke(event, unit)
|
|
@@ -2149,7 +2161,7 @@ Unit.morphEvent = __TS__New(
|
|
|
2149
2161
|
invoke(event, unit)
|
|
2150
2162
|
end
|
|
2151
2163
|
end
|
|
2152
|
-
____exports.Unit.onImmediateOrder[
|
|
2164
|
+
____exports.Unit.onImmediateOrder[852056]:addListener(function(unit)
|
|
2153
2165
|
if getUnitAbilityLevel(unit.handle, morphDetectAbilityId) == 0 then
|
|
2154
2166
|
Timer:run(ifNotLeft, unit)
|
|
2155
2167
|
end
|
|
@@ -2616,7 +2628,7 @@ Unit.itemDroppedEvent = __TS__New(
|
|
|
2616
2628
|
function()
|
|
2617
2629
|
local unit = getTriggerUnit()
|
|
2618
2630
|
local item = getManipulatedItem()
|
|
2619
|
-
if getUnitTypeId(unit) ~= dummyUnitId and not (
|
|
2631
|
+
if getUnitTypeId(unit) ~= dummyUnitId and not isItemIgnoredInEvents(item) then
|
|
2620
2632
|
return ____exports.Unit:of(unit), Item:of(item)
|
|
2621
2633
|
end
|
|
2622
2634
|
return IgnoreEvent
|
|
@@ -2628,10 +2640,10 @@ Unit.itemPickedUpEvent = __TS__New(
|
|
|
2628
2640
|
function()
|
|
2629
2641
|
local unitHandle = getTriggerUnit()
|
|
2630
2642
|
local itemHandle = getManipulatedItem()
|
|
2631
|
-
if getUnitTypeId(unitHandle) ~= dummyUnitId and not (
|
|
2643
|
+
if getUnitTypeId(unitHandle) ~= dummyUnitId and not isItemIgnoredInEvents(itemHandle) then
|
|
2632
2644
|
local unit = ____exports.Unit:of(unitHandle)
|
|
2633
2645
|
local item = Item:of(itemHandle)
|
|
2634
|
-
if item
|
|
2646
|
+
if ownerByItem[item] ~= unit then
|
|
2635
2647
|
return unit, item
|
|
2636
2648
|
end
|
|
2637
2649
|
end
|
|
@@ -2644,17 +2656,12 @@ Unit.itemUsedEvent = __TS__New(
|
|
|
2644
2656
|
function()
|
|
2645
2657
|
local unit = getTriggerUnit()
|
|
2646
2658
|
local item = getManipulatedItem()
|
|
2647
|
-
if getUnitTypeId(unit) ~= dummyUnitId and not (
|
|
2659
|
+
if getUnitTypeId(unit) ~= dummyUnitId and not isItemIgnoredInEvents(item) then
|
|
2648
2660
|
return ____exports.Unit:of(unit), Item:of(item)
|
|
2649
2661
|
end
|
|
2650
2662
|
return IgnoreEvent
|
|
2651
2663
|
end
|
|
2652
2664
|
)
|
|
2653
|
-
Unit.itemStackedEvent = __TS__New(
|
|
2654
|
-
____exports.UnitTriggerEvent,
|
|
2655
|
-
EVENT_PLAYER_UNIT_STACK_ITEM,
|
|
2656
|
-
function() return ____exports.Unit:of(getTriggerUnit()), Item:of(BlzGetStackingItemTarget()), Item:of(BlzGetStackingItemSource()) end
|
|
2657
|
-
)
|
|
2658
2665
|
__TS__ObjectDefineProperty(
|
|
2659
2666
|
Unit,
|
|
2660
2667
|
"itemChargesChangedEvent",
|
|
@@ -2670,51 +2677,6 @@ __TS__ObjectDefineProperty(
|
|
|
2670
2677
|
return event
|
|
2671
2678
|
end}
|
|
2672
2679
|
)
|
|
2673
|
-
__TS__ObjectDefineProperty(
|
|
2674
|
-
Unit,
|
|
2675
|
-
"itemUseOrderEvent",
|
|
2676
|
-
{get = function(self)
|
|
2677
|
-
local event = __TS__New(Event)
|
|
2678
|
-
for order = orderId("useslot0"), orderId("useslot5") do
|
|
2679
|
-
local slot = order - orderId("useslot0")
|
|
2680
|
-
local function listener(unit)
|
|
2681
|
-
local item = unit.items[slot + 1]
|
|
2682
|
-
if item ~= nil then
|
|
2683
|
-
invoke(event, unit, item)
|
|
2684
|
-
end
|
|
2685
|
-
end
|
|
2686
|
-
self.onImmediateOrder[order]:addListener(listener)
|
|
2687
|
-
self.onTargetOrder[order]:addListener(listener)
|
|
2688
|
-
self.onPointOrder[order]:addListener(listener)
|
|
2689
|
-
end
|
|
2690
|
-
rawset(self, "itemUseOrderEvent", event)
|
|
2691
|
-
return event
|
|
2692
|
-
end}
|
|
2693
|
-
)
|
|
2694
|
-
__TS__ObjectDefineProperty(
|
|
2695
|
-
Unit,
|
|
2696
|
-
"itemMoveOrderEvent",
|
|
2697
|
-
{get = function(self)
|
|
2698
|
-
local event = __TS__New(Event)
|
|
2699
|
-
for order = orderId("moveslot0"), orderId("moveslot5") do
|
|
2700
|
-
local slotTo = order - orderId("moveslot0")
|
|
2701
|
-
self.onTargetOrder[order]:addListener(function(unit, item)
|
|
2702
|
-
local slotFrom = unit.items:findSlot(item)
|
|
2703
|
-
if slotFrom ~= nil then
|
|
2704
|
-
invoke(
|
|
2705
|
-
event,
|
|
2706
|
-
unit,
|
|
2707
|
-
item,
|
|
2708
|
-
slotFrom,
|
|
2709
|
-
slotTo
|
|
2710
|
-
)
|
|
2711
|
-
end
|
|
2712
|
-
end)
|
|
2713
|
-
end
|
|
2714
|
-
rawset(self, "itemMoveOrderEvent", event)
|
|
2715
|
-
return event
|
|
2716
|
-
end}
|
|
2717
|
-
)
|
|
2718
2680
|
__TS__ObjectDefineProperty(
|
|
2719
2681
|
Unit,
|
|
2720
2682
|
"onCreate",
|
|
@@ -2761,11 +2723,7 @@ Unit.synchronize = synchronizer(
|
|
|
2761
2723
|
function(____, id) return fourCC(id) end
|
|
2762
2724
|
)
|
|
2763
2725
|
end)
|
|
2764
|
-
for ____, leaveOrderId in ipairs({
|
|
2765
|
-
orderId("undefend"),
|
|
2766
|
-
orderId("magicundefense"),
|
|
2767
|
-
orderId("unimmolation")
|
|
2768
|
-
}) do
|
|
2726
|
+
for ____, leaveOrderId in ipairs({852056, 852479, 852178}) do
|
|
2769
2727
|
____exports.Unit.onImmediateOrder[leaveOrderId]:addListener(function(unit)
|
|
2770
2728
|
local handle = unit.handle
|
|
2771
2729
|
for i = 1, #leaveAbilityIds do
|
|
@@ -2773,7 +2731,8 @@ Unit.synchronize = synchronizer(
|
|
|
2773
2731
|
return
|
|
2774
2732
|
end
|
|
2775
2733
|
end
|
|
2776
|
-
unit:
|
|
2734
|
+
unit:saveData()
|
|
2735
|
+
Timer:run(unit, "destroy")
|
|
2777
2736
|
end)
|
|
2778
2737
|
end
|
|
2779
2738
|
end)(Unit)
|