warscript 0.0.1-dev.9b0216a → 0.0.1-dev.9bcb501
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.d.ts +6 -0
- package/attributes.lua +17 -1
- package/config.d.ts +5 -0
- package/config.lua +10 -0
- package/core/dummy.lua +4 -2
- package/core/types/effect.d.ts +12 -4
- package/core/types/effect.lua +67 -104
- package/core/types/frame.d.ts +16 -2
- package/core/types/frame.lua +141 -77
- package/core/types/handle.lua +9 -9
- package/core/types/item.d.ts +1 -0
- package/core/types/item.lua +1 -0
- package/core/types/missile.lua +8 -7
- package/core/types/player.d.ts +18 -1
- package/core/types/player.lua +76 -26
- package/core/types/playerCamera.d.ts +2 -0
- package/core/types/playerCamera.lua +123 -5
- package/core/types/playerColor.lua +4 -3
- package/core/types/sound.d.ts +18 -25
- package/core/types/sound.lua +113 -33
- package/core/types/tileCell.d.ts +18 -3
- package/core/types/tileCell.lua +108 -0
- package/core/types/timer.d.ts +9 -8
- package/core/types/timer.lua +45 -23
- package/core/types/unit.d.ts +5 -0
- package/core/types/unit.lua +5 -0
- package/core/util.d.ts +3 -1
- package/core/util.lua +115 -4
- package/decl/native.d.ts +1719 -964
- package/destroyable.d.ts +1 -0
- package/destroyable.lua +9 -0
- package/engine/ability-type-extended-tooltip.d.ts +8 -0
- package/engine/ability-type-extended-tooltip.lua +44 -0
- package/engine/behavior.d.ts +14 -1
- package/engine/behavior.lua +230 -70
- package/engine/behaviour/ability/apply-buff.d.ts +5 -0
- package/engine/behaviour/ability/apply-buff.lua +36 -4
- package/engine/behaviour/ability/apply-unit-behavior.lua +6 -0
- package/engine/behaviour/ability/damage.d.ts +13 -3
- package/engine/behaviour/ability/damage.lua +41 -49
- package/engine/behaviour/ability/emulate-impact.d.ts +15 -1
- package/engine/behaviour/ability/emulate-impact.lua +92 -4
- package/engine/behaviour/ability/instant-impact.d.ts +12 -1
- package/engine/behaviour/ability/instant-impact.lua +17 -2
- package/engine/behaviour/ability/on-command-impact.d.ts +1 -0
- package/engine/behaviour/ability/on-command-impact.lua +1 -0
- package/engine/behaviour/ability/remove-buffs.d.ts +9 -0
- package/engine/behaviour/ability/remove-buffs.lua +21 -0
- package/engine/behaviour/ability/restore-mana.d.ts +1 -1
- package/engine/behaviour/ability/restore-mana.lua +6 -6
- package/engine/behaviour/ability.d.ts +28 -6
- package/engine/behaviour/ability.lua +188 -27
- package/engine/behaviour/unit/stun-immunity.d.ts +12 -6
- package/engine/behaviour/unit/stun-immunity.lua +57 -31
- package/engine/behaviour/unit.d.ts +41 -2
- package/engine/behaviour/unit.lua +270 -6
- package/engine/buff.d.ts +130 -59
- package/engine/buff.lua +638 -307
- package/engine/index.d.ts +2 -1
- package/engine/internal/ability.d.ts +14 -1
- package/engine/internal/ability.lua +112 -42
- package/engine/internal/item/ability.lua +92 -15
- package/engine/internal/item/fields.d.ts +12 -0
- package/engine/internal/item/fields.lua +33 -0
- package/engine/internal/item/owner-cache.d.ts +5 -0
- package/engine/internal/item/owner-cache.lua +4 -0
- package/engine/internal/item+owner.d.ts +2 -0
- package/engine/internal/item+owner.lua +37 -8
- package/engine/internal/item.d.ts +34 -18
- package/engine/internal/item.lua +308 -102
- package/engine/internal/mechanics/ability-duration.lua +1 -1
- package/engine/internal/mechanics/cast-ability.lua +6 -3
- package/engine/internal/misc/damage-metadata-by-target.lua +5 -0
- package/engine/internal/misc/frame-coordinates.d.ts +2 -0
- package/engine/internal/misc/frame-coordinates.lua +21 -0
- package/engine/internal/misc/get-terrain-z.d.ts +2 -0
- package/engine/internal/misc/get-terrain-z.lua +11 -0
- package/engine/internal/misc/player-local-handle.d.ts +2 -0
- package/engine/internal/misc/player-local-handle.lua +5 -0
- package/engine/internal/misc/unit-ability-level-natives.d.ts +2 -0
- package/engine/internal/misc/unit-ability-level-natives.lua +12 -0
- package/engine/internal/object-data/armor-bonus.d.ts +2 -0
- package/engine/internal/object-data/attribute-bonus.lua +2 -2
- package/engine/internal/object-data/auto-attack-speed-increase.d.ts +1 -1
- package/engine/internal/object-data/auto-attack-speed-increase.lua +2 -0
- package/engine/internal/object-data/evasion-probability.d.ts +2 -0
- package/engine/internal/object-data/evasion-probability.lua +16 -0
- package/engine/internal/object-data/health-bonus.d.ts +2 -0
- package/engine/internal/object-data/health-bonus.lua +16 -0
- package/engine/internal/object-data/health-regeneration-rate-increase.d.ts +2 -0
- package/engine/internal/object-data/health-regeneration-rate-increase.lua +48 -0
- package/engine/internal/object-data/mana-bonus.d.ts +2 -0
- package/engine/internal/object-data/mana-bonus.lua +16 -0
- package/engine/internal/object-data/mana-regeneration-rate-increase-factor.d.ts +2 -0
- package/engine/internal/object-data/mana-regeneration-rate-increase-factor.lua +16 -0
- package/engine/internal/object-data/returned-melee-damage-factor.d.ts +2 -0
- package/engine/internal/object-data/returned-melee-damage-factor.lua +21 -0
- package/engine/internal/unit/ability.d.ts +35 -0
- package/engine/internal/unit/ability.lua +114 -9
- package/engine/internal/unit/add-item-to-slot-init.d.ts +2 -0
- package/engine/internal/unit/add-item-to-slot-init.lua +12 -0
- package/engine/internal/unit/add-item-to-slot.d.ts +2 -0
- package/engine/internal/unit/add-item-to-slot.lua +93 -0
- package/engine/internal/unit/allowed-targets.d.ts +1 -1
- package/engine/internal/unit/allowed-targets.lua +9 -1
- package/engine/internal/unit/appearance.d.ts +15 -0
- package/engine/internal/unit/appearance.lua +85 -0
- package/engine/internal/unit/attributes.d.ts +17 -0
- package/engine/internal/unit/attributes.lua +46 -0
- package/engine/internal/unit/bonus.d.ts +19 -0
- package/engine/internal/unit/bonus.lua +130 -8
- package/engine/internal/unit/buff.d.ts +2 -2
- package/engine/internal/unit/buff.lua +34 -19
- package/engine/internal/unit/equipment-inventory.d.ts +44 -0
- package/engine/internal/unit/equipment-inventory.lua +233 -0
- package/engine/internal/unit/expiration-timer.lua +1 -1
- package/engine/internal/unit/extended-inventory.d.ts +25 -0
- package/engine/internal/unit/extended-inventory.lua +99 -0
- package/engine/internal/unit/fly-height.d.ts +7 -0
- package/engine/internal/unit/fly-height.lua +20 -0
- package/engine/internal/unit/ignore-events-items.d.ts +2 -0
- package/engine/internal/unit/ignore-events-items.lua +14 -0
- package/engine/internal/unit/interrupts.d.ts +12 -0
- package/engine/internal/unit/interrupts.lua +28 -0
- package/engine/internal/unit/{item.d.ts → inventory.d.ts} +7 -3
- package/engine/internal/unit/inventory.lua +87 -0
- package/engine/internal/unit/item-container.d.ts +25 -0
- package/engine/internal/unit/item-container.lua +11 -0
- package/engine/internal/unit/item-order-events.d.ts +17 -0
- package/engine/internal/unit/item-order-events.lua +67 -0
- package/engine/internal/unit/item-slot.d.ts +27 -0
- package/engine/internal/unit/item-slot.lua +92 -0
- package/engine/internal/unit/main-selected.lua +12 -27
- package/engine/internal/unit/order.d.ts +20 -0
- package/engine/internal/unit/order.lua +136 -0
- package/engine/internal/unit/range-event.d.ts +12 -0
- package/engine/internal/unit/range-event.lua +90 -0
- package/engine/internal/unit/scale.d.ts +7 -0
- package/engine/internal/unit/scale.lua +20 -0
- package/engine/internal/unit+ability.d.ts +2 -1
- package/engine/internal/unit+ability.lua +83 -3
- package/engine/internal/unit+bonus.lua +3 -3
- package/engine/internal/unit+damage.d.ts +11 -11
- package/engine/internal/unit+damage.lua +43 -14
- package/engine/internal/unit+rally.lua +9 -31
- package/engine/internal/unit+spellSteal.lua +1 -2
- package/engine/internal/unit-missile-data.lua +96 -68
- package/engine/internal/unit-missile-launch.lua +65 -27
- package/engine/internal/unit.d.ts +45 -34
- package/engine/internal/unit.lua +433 -327
- package/engine/lightning.d.ts +12 -5
- package/engine/lightning.lua +52 -18
- package/engine/local-client.d.ts +28 -0
- package/engine/local-client.lua +324 -54
- package/engine/object-data/auxiliary/animation-name.d.ts +1 -0
- package/engine/object-data/auxiliary/animation-name.lua +16 -0
- package/engine/object-data/auxiliary/armor-type.d.ts +11 -0
- package/engine/object-data/auxiliary/armor-type.lua +46 -0
- package/engine/object-data/auxiliary/attachment-preset.d.ts +14 -2
- package/engine/object-data/auxiliary/attachment-preset.lua +11 -3
- package/engine/object-data/auxiliary/attack-type.d.ts +7 -8
- package/engine/object-data/auxiliary/attack-type.lua +42 -0
- package/engine/object-data/auxiliary/equipment-slot.d.ts +12 -0
- package/engine/object-data/auxiliary/equipment-slot.lua +2 -0
- package/engine/object-data/auxiliary/equipment-type.d.ts +12 -0
- package/engine/object-data/auxiliary/equipment-type.lua +26 -0
- package/engine/object-data/auxiliary/health-regeneration-type.d.ts +8 -0
- package/engine/object-data/auxiliary/health-regeneration-type.lua +2 -0
- package/engine/object-data/auxiliary/item-class.d.ts +11 -0
- package/engine/object-data/auxiliary/item-class.lua +2 -0
- package/engine/object-data/auxiliary/item-tag.d.ts +12 -0
- package/engine/object-data/auxiliary/item-tag.lua +2 -0
- package/engine/object-data/auxiliary/movement-type.d.ts +7 -7
- package/engine/object-data/auxiliary/movement-type.lua +22 -0
- package/engine/object-data/auxiliary/order-type.d.ts +939 -0
- package/engine/object-data/auxiliary/order-type.lua +2 -0
- package/engine/object-data/auxiliary/sound-eax.d.ts +10 -0
- package/engine/object-data/auxiliary/sound-eax.lua +2 -0
- package/engine/object-data/auxiliary/sound-set-name.d.ts +14 -3
- package/engine/object-data/auxiliary/tech-tree-dependency.d.ts +1 -1
- package/engine/object-data/auxiliary/unit-attribute.d.ts +6 -0
- package/engine/object-data/auxiliary/unit-attribute.lua +9 -0
- package/engine/object-data/entry/ability-type/apprehend.d.ts +22 -0
- package/engine/object-data/entry/ability-type/apprehend.lua +66 -0
- package/engine/object-data/entry/ability-type/armor-bonus.d.ts +8 -0
- package/engine/object-data/entry/ability-type/{armor-increase.lua → armor-bonus.lua} +9 -9
- package/engine/object-data/entry/ability-type/aura-of-blight.d.ts +13 -0
- package/engine/object-data/entry/ability-type/aura-of-blight.lua +39 -0
- package/engine/object-data/entry/ability-type/banshee.d.ts +8 -0
- package/engine/object-data/entry/ability-type/banshee.lua +13 -0
- package/engine/object-data/entry/ability-type/banshees-wail-damage-amp.d.ts +12 -0
- package/engine/object-data/entry/ability-type/banshees-wail-damage-amp.lua +27 -0
- package/engine/object-data/entry/ability-type/banshees-wail.d.ts +31 -0
- package/engine/object-data/entry/ability-type/banshees-wail.lua +117 -0
- package/engine/object-data/entry/ability-type/barrage.d.ts +12 -0
- package/engine/object-data/entry/ability-type/barrage.lua +52 -0
- package/engine/object-data/entry/ability-type/battering-ram.d.ts +33 -0
- package/engine/object-data/entry/ability-type/battering-ram.lua +130 -0
- package/engine/object-data/entry/ability-type/berserk.d.ts +2 -0
- package/engine/object-data/entry/ability-type/berserk.lua +13 -0
- package/engine/object-data/entry/ability-type/blank-configurable.lua +14 -3
- package/engine/object-data/entry/ability-type/blank-passive-with-cooldown.d.ts +23 -0
- package/engine/object-data/entry/ability-type/blank-passive-with-cooldown.lua +112 -0
- package/engine/object-data/entry/ability-type/blank-passive.d.ts +4 -0
- package/engine/object-data/entry/ability-type/blank-passive.lua +27 -7
- package/engine/object-data/entry/ability-type/breath-of-fire.d.ts +11 -0
- package/engine/object-data/entry/ability-type/breath-of-fire.lua +27 -0
- package/engine/object-data/entry/ability-type/carrion-swarm.d.ts +14 -0
- package/engine/object-data/entry/ability-type/carrion-swarm.lua +65 -0
- package/engine/object-data/entry/ability-type/channel.d.ts +2 -2
- package/engine/object-data/entry/ability-type/channel.lua +3 -3
- package/engine/object-data/entry/ability-type/cleansing-fire.d.ts +27 -0
- package/engine/object-data/entry/ability-type/cleansing-fire.lua +104 -0
- package/engine/object-data/entry/ability-type/consecration.d.ts +15 -0
- package/engine/object-data/entry/ability-type/consecration.lua +52 -0
- package/engine/object-data/entry/ability-type/cooldown-reduction.d.ts +12 -0
- package/engine/object-data/entry/ability-type/cooldown-reduction.lua +39 -0
- package/engine/object-data/entry/ability-type/critical-strike-system.d.ts +18 -0
- package/engine/object-data/entry/ability-type/critical-strike-system.lua +65 -0
- package/engine/object-data/entry/ability-type/deathseeker-arrows.d.ts +21 -0
- package/engine/object-data/entry/ability-type/deathseeker-arrows.lua +78 -0
- package/engine/object-data/entry/ability-type/disease-cloud.lua +2 -2
- package/engine/object-data/entry/ability-type/engineering-upgrade.lua +2 -2
- package/engine/object-data/entry/ability-type/ensnare.d.ts +12 -0
- package/engine/object-data/entry/ability-type/ensnare.lua +52 -0
- package/engine/object-data/entry/ability-type/equipment-inventory-interface.d.ts +8 -0
- package/engine/object-data/entry/ability-type/equipment-inventory-interface.lua +13 -0
- package/engine/object-data/entry/ability-type/equipment-inventory.d.ts +13 -0
- package/engine/object-data/entry/ability-type/equipment-inventory.lua +27 -0
- package/engine/object-data/entry/ability-type/equipment.d.ts +13 -0
- package/engine/object-data/entry/ability-type/equipment.lua +27 -0
- package/engine/object-data/entry/ability-type/exhume-corpses.d.ts +14 -0
- package/engine/object-data/entry/ability-type/exhume-corpses.lua +40 -0
- package/engine/object-data/entry/ability-type/feral-spirit.lua +2 -2
- package/engine/object-data/entry/ability-type/firebolt.d.ts +7 -0
- package/engine/object-data/entry/ability-type/firebolt.lua +13 -0
- package/engine/object-data/entry/ability-type/flame-strike.d.ts +25 -0
- package/engine/object-data/entry/ability-type/flame-strike.lua +92 -0
- package/engine/object-data/entry/ability-type/grant-talent-point.d.ts +8 -0
- package/engine/object-data/entry/ability-type/grant-talent-point.lua +13 -0
- package/engine/object-data/entry/ability-type/grim-conviction.d.ts +36 -0
- package/engine/object-data/entry/ability-type/grim-conviction.lua +131 -0
- package/engine/object-data/entry/ability-type/grit.d.ts +18 -0
- package/engine/object-data/entry/ability-type/grit.lua +65 -0
- package/engine/object-data/entry/ability-type/guiding-hand.d.ts +27 -0
- package/engine/object-data/entry/ability-type/guiding-hand.lua +104 -0
- package/engine/object-data/entry/ability-type/headsplitter.d.ts +27 -0
- package/engine/object-data/entry/ability-type/headsplitter.lua +104 -0
- package/engine/object-data/entry/ability-type/{armor-increase.d.ts → healing-modifier.d.ts} +4 -3
- package/engine/object-data/entry/ability-type/healing-modifier.lua +26 -0
- package/engine/object-data/entry/ability-type/healing-ward-aura.d.ts +13 -0
- package/engine/object-data/entry/ability-type/healing-ward-aura.lua +39 -0
- package/engine/object-data/entry/ability-type/health-bonus.d.ts +8 -0
- package/engine/object-data/entry/ability-type/health-bonus.lua +26 -0
- package/engine/object-data/entry/ability-type/heroic-slash.d.ts +18 -0
- package/engine/object-data/entry/ability-type/heroic-slash.lua +65 -0
- package/engine/object-data/entry/ability-type/holy-wrath.d.ts +30 -0
- package/engine/object-data/entry/ability-type/holy-wrath.lua +117 -0
- package/engine/object-data/entry/ability-type/inspire-courage.d.ts +18 -0
- package/engine/object-data/entry/ability-type/inspire-courage.lua +65 -0
- package/engine/object-data/entry/ability-type/item-life-regeneration.d.ts +10 -0
- package/engine/object-data/entry/ability-type/item-life-regeneration.lua +26 -0
- package/engine/object-data/entry/ability-type/life-drain.d.ts +37 -0
- package/engine/object-data/entry/ability-type/life-drain.lua +144 -0
- package/engine/object-data/entry/ability-type/lights-mercy.d.ts +27 -0
- package/engine/object-data/entry/ability-type/lights-mercy.lua +104 -0
- package/engine/object-data/entry/ability-type/mana-bonus.d.ts +8 -0
- package/engine/object-data/entry/ability-type/mana-bonus.lua +26 -0
- package/engine/object-data/entry/ability-type/mana-efficiency.d.ts +12 -0
- package/engine/object-data/entry/ability-type/mana-efficiency.lua +39 -0
- package/engine/object-data/entry/ability-type/mana-regeneration.d.ts +8 -0
- package/engine/object-data/entry/ability-type/mana-regeneration.lua +26 -0
- package/engine/object-data/entry/ability-type/mind-control.d.ts +21 -0
- package/engine/object-data/entry/ability-type/mind-control.lua +78 -0
- package/engine/object-data/entry/ability-type/on-attack-cast-spell.d.ts +21 -0
- package/engine/object-data/entry/ability-type/on-attack-cast-spell.lua +52 -0
- package/engine/object-data/entry/ability-type/on-basic-attack-cast-spell.d.ts +19 -0
- package/engine/object-data/entry/ability-type/on-basic-attack-cast-spell.lua +65 -0
- package/engine/object-data/entry/ability-type/on-hit-cast-spell.d.ts +15 -0
- package/engine/object-data/entry/ability-type/on-hit-cast-spell.lua +26 -0
- package/engine/object-data/entry/ability-type/on-magic-attack-cast-spell.d.ts +6 -0
- package/engine/object-data/entry/ability-type/on-magic-attack-cast-spell.lua +12 -0
- package/engine/object-data/entry/ability-type/permanent-invisibility.d.ts +8 -0
- package/engine/object-data/entry/ability-type/permanent-invisibility.lua +26 -0
- package/engine/object-data/entry/ability-type/phase-shift.d.ts +10 -0
- package/engine/object-data/entry/ability-type/phase-shift.lua +39 -0
- package/engine/object-data/entry/ability-type/phoenix-morph.lua +4 -4
- package/engine/object-data/entry/ability-type/provoke.d.ts +21 -0
- package/engine/object-data/entry/ability-type/provoke.lua +66 -0
- package/engine/object-data/entry/ability-type/rain-of-fire.d.ts +7 -0
- package/engine/object-data/entry/ability-type/rain-of-fire.lua +13 -0
- package/engine/object-data/entry/ability-type/raise-dead.d.ts +17 -0
- package/engine/object-data/entry/ability-type/raise-dead.lua +78 -0
- package/engine/object-data/entry/ability-type/raise-the-banner.d.ts +9 -0
- package/engine/object-data/entry/ability-type/raise-the-banner.lua +26 -0
- package/engine/object-data/entry/ability-type/reincarnation.d.ts +8 -0
- package/engine/object-data/entry/ability-type/reincarnation.lua +26 -0
- package/engine/object-data/entry/ability-type/resolve.d.ts +12 -0
- package/engine/object-data/entry/ability-type/resolve.lua +39 -0
- package/engine/object-data/entry/ability-type/righteous-fury.d.ts +33 -0
- package/engine/object-data/entry/ability-type/righteous-fury.lua +130 -0
- package/engine/object-data/entry/ability-type/sacred-aura.d.ts +27 -0
- package/engine/object-data/entry/ability-type/sacred-aura.lua +104 -0
- package/engine/object-data/entry/ability-type/shock-wave.d.ts +4 -0
- package/engine/object-data/entry/ability-type/shock-wave.lua +26 -0
- package/engine/object-data/entry/ability-type/slow-poison.d.ts +10 -0
- package/engine/object-data/entry/ability-type/slow-poison.lua +58 -0
- package/engine/object-data/entry/ability-type/soul-burn.d.ts +22 -0
- package/engine/object-data/entry/ability-type/soul-burn.lua +79 -0
- package/engine/object-data/entry/ability-type/soul-lantern.d.ts +30 -0
- package/engine/object-data/entry/ability-type/soul-lantern.lua +117 -0
- package/engine/object-data/entry/ability-type/spell-amp.d.ts +15 -0
- package/engine/object-data/entry/ability-type/spell-amp.lua +52 -0
- package/engine/object-data/entry/ability-type/spell-critical-strike.d.ts +12 -0
- package/engine/object-data/entry/ability-type/spell-critical-strike.lua +39 -0
- package/engine/object-data/entry/ability-type/spell-vamp.d.ts +12 -0
- package/engine/object-data/entry/ability-type/spell-vamp.lua +39 -0
- package/engine/object-data/entry/ability-type/stackable-evasion.d.ts +9 -0
- package/engine/object-data/entry/ability-type/stackable-evasion.lua +13 -0
- package/engine/object-data/entry/ability-type/stackable-hardened-skin.d.ts +21 -0
- package/engine/object-data/entry/ability-type/stackable-hardened-skin.lua +78 -0
- package/engine/object-data/entry/ability-type/stackable-life-steal.d.ts +9 -0
- package/engine/object-data/entry/ability-type/stackable-life-steal.lua +26 -0
- package/engine/object-data/entry/ability-type/stackable-spell-damage-reduction.d.ts +9 -0
- package/engine/object-data/entry/ability-type/stackable-spell-damage-reduction.lua +13 -0
- package/engine/object-data/entry/ability-type/stackable-thorn-shield.d.ts +9 -0
- package/engine/object-data/entry/ability-type/stackable-thorn-shield.lua +13 -0
- package/engine/object-data/entry/ability-type/stat-details.d.ts +12 -0
- package/engine/object-data/entry/ability-type/stat-details.lua +27 -0
- package/engine/object-data/entry/ability-type/summon-quilbeast.lua +2 -2
- package/engine/object-data/entry/ability-type/summon-water-elemental.lua +2 -2
- package/engine/object-data/entry/ability-type/surge-of-light.d.ts +33 -0
- package/engine/object-data/entry/ability-type/surge-of-light.lua +130 -0
- package/engine/object-data/entry/ability-type/sweeping-strike.d.ts +57 -0
- package/engine/object-data/entry/ability-type/sweeping-strike.lua +234 -0
- package/engine/object-data/entry/ability-type/talents.d.ts +12 -0
- package/engine/object-data/entry/ability-type/talents.lua +27 -0
- package/engine/object-data/entry/ability-type/unyielding-guard.d.ts +30 -0
- package/engine/object-data/entry/ability-type/unyielding-guard.lua +117 -0
- package/engine/object-data/entry/ability-type/valiant-charge.d.ts +27 -0
- package/engine/object-data/entry/ability-type/valiant-charge.lua +104 -0
- package/engine/object-data/entry/ability-type/warcry.d.ts +9 -0
- package/engine/object-data/entry/ability-type/warcry.lua +26 -0
- package/engine/object-data/entry/ability-type/web.d.ts +12 -0
- package/engine/object-data/entry/ability-type/web.lua +52 -0
- package/engine/object-data/entry/ability-type/withering-fire.d.ts +21 -0
- package/engine/object-data/entry/ability-type/withering-fire.lua +78 -0
- package/engine/object-data/entry/ability-type.d.ts +50 -21
- package/engine/object-data/entry/ability-type.lua +384 -35
- package/engine/object-data/entry/buff-type/applicable.lua +131 -139
- package/engine/object-data/entry/buff-type.d.ts +10 -12
- package/engine/object-data/entry/buff-type.lua +39 -29
- package/engine/object-data/entry/destructible-type.d.ts +32 -2
- package/engine/object-data/entry/destructible-type.lua +181 -0
- package/engine/object-data/entry/item-type.d.ts +18 -3
- package/engine/object-data/entry/item-type.lua +88 -4
- package/engine/object-data/entry/lightning-type.d.ts +6 -8
- package/engine/object-data/entry/lightning-type.lua +1 -1
- package/engine/object-data/entry/sound-preset.d.ts +33 -0
- package/engine/object-data/entry/sound-preset.lua +140 -0
- package/engine/object-data/entry/unit-type.d.ts +81 -6
- package/engine/object-data/entry/unit-type.lua +606 -93
- package/engine/object-data/entry/upgrade.d.ts +2 -2
- package/engine/object-data/entry/upgrade.lua +4 -4
- package/engine/object-data/entry.d.ts +21 -14
- package/engine/object-data/entry.lua +68 -32
- package/engine/object-field/ability.d.ts +8 -5
- package/engine/object-field/ability.lua +10 -6
- package/engine/object-field/item.d.ts +22 -0
- package/engine/object-field/item.lua +118 -0
- package/engine/object-field/unit.d.ts +72 -3
- package/engine/object-field/unit.lua +268 -7
- package/engine/object-field.d.ts +26 -7
- package/engine/object-field.lua +362 -117
- package/engine/random.d.ts +10 -0
- package/engine/random.lua +21 -0
- package/engine/standard/entries/ability-type.d.ts +3102 -7
- package/engine/standard/entries/ability-type.lua +0 -6
- package/engine/standard/entries/buff-type.d.ts +48 -0
- package/engine/standard/entries/buff-type.lua +46 -0
- package/engine/standard/entries/item-type.d.ts +1299 -0
- package/engine/standard/entries/item-type.lua +2 -0
- package/engine/standard/entries/lightning-type.d.ts +42 -15
- package/engine/standard/entries/lightning-type.lua +0 -14
- package/engine/standard/entries/sound-preset.d.ts +10 -0
- package/engine/standard/entries/sound-preset.lua +10 -0
- package/engine/standard/entries/unit-type.d.ts +5 -0
- package/engine/standard/entries/unit-type.lua +5 -0
- package/engine/standard/fields/ability.d.ts +4 -4
- package/engine/standard/fields/ability.lua +4 -4
- package/engine/standard/fields/item.d.ts +4 -0
- package/engine/standard/fields/item.lua +6 -0
- package/engine/standard/fields/unit.d.ts +12 -0
- package/engine/standard/fields/unit.lua +20 -0
- package/engine/synchronization.d.ts +11 -0
- package/engine/synchronization.lua +77 -0
- package/engine/text-tag.d.ts +36 -2
- package/engine/text-tag.lua +250 -10
- package/engine/unit.d.ts +12 -1
- package/engine/unit.lua +12 -1
- package/event.d.ts +1 -1
- package/lualib_bundle.lua +1 -1
- package/math.d.ts +2 -0
- package/math.lua +14 -0
- package/net/socket.lua +1 -1
- package/network.lua +25 -1
- package/objutil/buff.lua +12 -11
- package/objutil/object.lua +1 -1
- package/objutil/unit.lua +8 -0
- package/operation.d.ts +8 -1
- package/operation.lua +38 -18
- package/package.json +3 -23
- package/patch-lua.lua +15 -0
- package/patch-lualib.lua +1 -1
- package/utility/arrays.d.ts +9 -1
- package/utility/arrays.lua +28 -0
- package/utility/callback-array.d.ts +17 -0
- package/utility/callback-array.lua +61 -0
- package/utility/functions.d.ts +8 -0
- package/utility/functions.lua +13 -0
- package/utility/linked-map.d.ts +35 -0
- package/utility/linked-map.lua +107 -0
- package/utility/linked-set.d.ts +5 -1
- package/utility/linked-set.lua +49 -1
- package/utility/lua-maps.d.ts +15 -2
- package/utility/lua-maps.lua +53 -2
- package/utility/lua-sets.d.ts +2 -0
- package/utility/lua-sets.lua +7 -0
- package/utility/random.d.ts +102 -0
- package/utility/random.lua +273 -0
- package/utility/records.lua +20 -1
- package/utility/reflection.lua +11 -7
- package/utility/types.d.ts +3 -0
- package/utility/unordered-map.d.ts +27 -0
- package/utility/unordered-map.lua +99 -0
- package/core/types/order.d.ts +0 -25
- package/core/types/order.lua +0 -55
- package/engine/internal/unit/item.lua +0 -79
- /package/engine/internal/{object-data/armor-increase.d.ts → misc/damage-metadata-by-target.d.ts} +0 -0
- /package/engine/internal/object-data/{armor-increase.lua → armor-bonus.lua} +0 -0
- /package/engine/object-data/entry/ability-type/{attribute-increase.d.ts → attribute-bonus.d.ts} +0 -0
- /package/engine/object-data/entry/ability-type/{attribute-increase.lua → attribute-bonus.lua} +0 -0
package/engine/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
|
-
import { Handle } from "../../core/types/handle";
|
|
2
|
+
import { Handle, HandleDestructor } from "../../core/types/handle";
|
|
3
3
|
import { Event } from "../../event";
|
|
4
4
|
import type { Item } from "../../core/types/item";
|
|
5
5
|
import type { Unit } from "./unit";
|
|
@@ -37,6 +37,7 @@ export declare abstract class Ability extends Handle<jability> {
|
|
|
37
37
|
abstract get level(): number;
|
|
38
38
|
abstract get cooldownRemaining(): number;
|
|
39
39
|
abstract set cooldownRemaining(cooldownRemaining: number);
|
|
40
|
+
abstract startCooldown(cooldown: number): void;
|
|
40
41
|
abstract interruptCast(): void;
|
|
41
42
|
static get onCreate(): Event<[Ability]>;
|
|
42
43
|
static get destroyEvent(): Event<[Ability]>;
|
|
@@ -50,19 +51,29 @@ export declare class UnrecognizedAbility extends Ability {
|
|
|
50
51
|
get level(): number;
|
|
51
52
|
get cooldownRemaining(): number;
|
|
52
53
|
set cooldownRemaining(_: number);
|
|
54
|
+
startCooldown(_: number): void;
|
|
53
55
|
interruptCast(): void;
|
|
54
56
|
}
|
|
55
57
|
export declare class UnitAbility extends Ability {
|
|
56
58
|
readonly owner: Unit;
|
|
57
59
|
private readonly u;
|
|
60
|
+
private d?;
|
|
58
61
|
constructor(handle: jability, typeId: number, owner: Unit);
|
|
59
62
|
incrementHideCounter(): void;
|
|
60
63
|
decrementHideCounter(): void;
|
|
64
|
+
incrementDisableCounter(): void;
|
|
65
|
+
decrementDisableCounter(): void;
|
|
66
|
+
get isDisabled(): boolean;
|
|
61
67
|
get level(): number;
|
|
62
68
|
set level(v: number);
|
|
69
|
+
/** Uses the native percentage scale. */
|
|
70
|
+
get cooldownRemainingPercent(): number;
|
|
71
|
+
set cooldownRemainingPercent(percent: number);
|
|
63
72
|
get cooldownRemaining(): number;
|
|
64
73
|
set cooldownRemaining(cooldownRemaining: number);
|
|
74
|
+
startCooldown(cooldown: number): void;
|
|
65
75
|
interruptCast(): void;
|
|
76
|
+
protected onDestroy(): HandleDestructor;
|
|
66
77
|
static get onCreate(): Event<[UnitAbility]>;
|
|
67
78
|
static get onDestroy(): Event<[UnitAbility]>;
|
|
68
79
|
}
|
|
@@ -88,7 +99,9 @@ export declare class ItemAbility extends Ability {
|
|
|
88
99
|
get level(): number;
|
|
89
100
|
get cooldownRemaining(): number;
|
|
90
101
|
set cooldownRemaining(cooldownRemaining: number);
|
|
102
|
+
startCooldown(cooldown: number): void;
|
|
91
103
|
interruptCast(): void;
|
|
104
|
+
protected onDestroy(): HandleDestructor;
|
|
92
105
|
static get onCreate(): Event<[ItemAbility]>;
|
|
93
106
|
static get onDestroy(): Event<[ItemAbility]>;
|
|
94
107
|
}
|
|
@@ -14,27 +14,33 @@ local abilityActionDummy = ____ability.abilityActionDummy
|
|
|
14
14
|
local doAbilityAction = ____ability.doAbilityAction
|
|
15
15
|
local doAbilityActionForceDummy = ____ability.doAbilityActionForceDummy
|
|
16
16
|
local startItemCooldown = ____ability.startItemCooldown
|
|
17
|
-
local
|
|
18
|
-
local
|
|
19
|
-
local setAbilityIntegerField = BlzSetAbilityIntegerField
|
|
20
|
-
local setAbilityRealField = BlzSetAbilityRealField
|
|
21
|
-
local setAbilityBooleanField = BlzSetAbilityBooleanField
|
|
22
|
-
local setAbilityStringField = BlzSetAbilityStringField
|
|
23
|
-
local setAbilityIntegerLevelField = BlzSetAbilityIntegerLevelField
|
|
24
|
-
local setAbilityRealLevelField = BlzSetAbilityRealLevelField
|
|
25
|
-
local setAbilityBooleanLevelField = BlzSetAbilityBooleanLevelField
|
|
26
|
-
local setAbilityStringLevelField = BlzSetAbilityStringLevelField
|
|
27
|
-
local getAbilityIntegerField = BlzGetAbilityIntegerField
|
|
28
|
-
local getAbilityRealField = BlzGetAbilityRealField
|
|
17
|
+
local ____unit_2Dability_2Dlevel_2Dnatives = require("engine.internal.misc.unit-ability-level-natives")
|
|
18
|
+
local rawSetUnitAbilityLevel = ____unit_2Dability_2Dlevel_2Dnatives.rawSetUnitAbilityLevel
|
|
29
19
|
local getAbilityBooleanField = BlzGetAbilityBooleanField
|
|
30
|
-
local
|
|
20
|
+
local getAbilityBooleanLevelField = BlzGetAbilityBooleanLevelField
|
|
21
|
+
local getAbilityIntegerField = BlzGetAbilityIntegerField
|
|
31
22
|
local getAbilityIntegerLevelField = BlzGetAbilityIntegerLevelField
|
|
23
|
+
local getAbilityRealField = BlzGetAbilityRealField
|
|
32
24
|
local getAbilityRealLevelField = BlzGetAbilityRealLevelField
|
|
33
|
-
local
|
|
25
|
+
local getAbilityStringField = BlzGetAbilityStringField
|
|
34
26
|
local getAbilityStringLevelField = BlzGetAbilityStringLevelField
|
|
27
|
+
local getHandleId = GetHandleId
|
|
28
|
+
local getUnitAbilityCooldownPercent = BlzGetUnitAbilityCooldownPercent
|
|
35
29
|
local getUnitAbilityCooldownRemaining = BlzGetUnitAbilityCooldownRemaining
|
|
30
|
+
local getUnitAbilityLevel = GetUnitAbilityLevel
|
|
31
|
+
local order2orderId = _G.OrderId
|
|
32
|
+
local setAbilityBooleanField = BlzSetAbilityBooleanField
|
|
33
|
+
local setAbilityBooleanLevelField = BlzSetAbilityBooleanLevelField
|
|
34
|
+
local setAbilityIntegerField = BlzSetAbilityIntegerField
|
|
35
|
+
local setAbilityIntegerLevelField = BlzSetAbilityIntegerLevelField
|
|
36
|
+
local setAbilityRealField = BlzSetAbilityRealField
|
|
37
|
+
local setAbilityRealLevelField = BlzSetAbilityRealLevelField
|
|
38
|
+
local setAbilityStringField = BlzSetAbilityStringField
|
|
39
|
+
local setAbilityStringLevelField = BlzSetAbilityStringLevelField
|
|
40
|
+
local setUnitAbilityCooldownPercent = BlzSetUnitAbilityCooldownPercent
|
|
41
|
+
local setUnitAbilityCooldownRemaining = BlzSetUnitAbilityCooldownRemaining
|
|
36
42
|
local startUnitAbilityCooldown = BlzStartUnitAbilityCooldown
|
|
37
|
-
local
|
|
43
|
+
local unitDisableAbility = BlzUnitDisableAbility
|
|
38
44
|
local unitHideAbility = BlzUnitHideAbility
|
|
39
45
|
local match = string.match
|
|
40
46
|
local ____type = _G.type
|
|
@@ -212,7 +218,6 @@ local levelRefreshFields = {
|
|
|
212
218
|
[fourCC("Neg1")] = true
|
|
213
219
|
}
|
|
214
220
|
local levelsField = ABILITY_IF_LEVELS
|
|
215
|
-
local order2orderId = _G.OrderId
|
|
216
221
|
local orderIdFieldByParentTypeId = {
|
|
217
222
|
[fourCC("ANcl")] = ABILITY_SLF_BASE_ORDER_ID_NCL6,
|
|
218
223
|
[fourCC("Aspb")] = ABILITY_SLF_BASE_ORDER_ID_SPB5,
|
|
@@ -229,6 +234,19 @@ ____exports.getOrderIdByAbilityTypeId = function(abilityTypeId)
|
|
|
229
234
|
local parentTypeId = availableFields[abilityTypeId]
|
|
230
235
|
return order2orderId(orders[____type(parentTypeId) == "number" and parentTypeId or abilityTypeId] or "")
|
|
231
236
|
end
|
|
237
|
+
---
|
|
238
|
+
-- @internal For use by internal systems only.
|
|
239
|
+
____exports.abilityTypeHasField = function(abilityTypeId, field)
|
|
240
|
+
field = ____type(field) == "number" and field or getHandleId(field)
|
|
241
|
+
if commonFields[field] then
|
|
242
|
+
return true
|
|
243
|
+
end
|
|
244
|
+
local id = availableFields[abilityTypeId]
|
|
245
|
+
if ____type(id) == "number" then
|
|
246
|
+
id = availableFields[id]
|
|
247
|
+
end
|
|
248
|
+
return not not (id and id[field])
|
|
249
|
+
end
|
|
232
250
|
____exports.Ability = __TS__Class()
|
|
233
251
|
local Ability = ____exports.Ability
|
|
234
252
|
Ability.name = "Ability"
|
|
@@ -244,15 +262,7 @@ function Ability.prototype.getSnapshot(self)
|
|
|
244
262
|
return nil
|
|
245
263
|
end
|
|
246
264
|
function Ability.prototype.hasField(self, field)
|
|
247
|
-
|
|
248
|
-
if commonFields[field] then
|
|
249
|
-
return true
|
|
250
|
-
end
|
|
251
|
-
local id = availableFields[self.typeId]
|
|
252
|
-
if ____type(id) == "number" then
|
|
253
|
-
id = availableFields[id]
|
|
254
|
-
end
|
|
255
|
-
return not not (id and id[field])
|
|
265
|
+
return ____exports.abilityTypeHasField(self.typeId, field)
|
|
256
266
|
end
|
|
257
267
|
function Ability.prototype.getField(self, field, level)
|
|
258
268
|
local fieldType = match(
|
|
@@ -280,8 +290,8 @@ function Ability.prototype.setField(self, field, levelOrValue, value)
|
|
|
280
290
|
local levels = getAbilityIntegerField(ability, levelsField)
|
|
281
291
|
setAbilityIntegerField(ability, levelsField, levels + 1)
|
|
282
292
|
local level = getUnitAbilityLevel(unit, typeId)
|
|
283
|
-
|
|
284
|
-
|
|
293
|
+
rawSetUnitAbilityLevel(unit, typeId, levels + 1)
|
|
294
|
+
rawSetUnitAbilityLevel(unit, typeId, level)
|
|
285
295
|
setAbilityIntegerField(ability, levelsField, levels)
|
|
286
296
|
end
|
|
287
297
|
return success
|
|
@@ -363,6 +373,8 @@ function UnrecognizedAbility.prototype.____constructor(self, typeId, owner)
|
|
|
363
373
|
UnrecognizedAbility.____super.prototype.____constructor(self, nil, typeId)
|
|
364
374
|
self.owner = owner
|
|
365
375
|
end
|
|
376
|
+
function UnrecognizedAbility.prototype.startCooldown(self, _)
|
|
377
|
+
end
|
|
366
378
|
function UnrecognizedAbility.prototype.interruptCast(self)
|
|
367
379
|
end
|
|
368
380
|
__TS__SetDescriptor(
|
|
@@ -400,9 +412,40 @@ end
|
|
|
400
412
|
function UnitAbility.prototype.decrementHideCounter(self)
|
|
401
413
|
unitHideAbility(self.u, self.typeId, false)
|
|
402
414
|
end
|
|
415
|
+
function UnitAbility.prototype.incrementDisableCounter(self)
|
|
416
|
+
local unit = self.u
|
|
417
|
+
local typeId = self.typeId
|
|
418
|
+
unitHideAbility(unit, typeId, true)
|
|
419
|
+
unitDisableAbility(unit, typeId, true, false)
|
|
420
|
+
self.d = (self.d or 0) + 1
|
|
421
|
+
end
|
|
422
|
+
function UnitAbility.prototype.decrementDisableCounter(self)
|
|
423
|
+
local unit = self.u
|
|
424
|
+
local typeId = self.typeId
|
|
425
|
+
unitDisableAbility(unit, typeId, false, false)
|
|
426
|
+
unitHideAbility(unit, typeId, true)
|
|
427
|
+
self.d = (self.d or 0) - 1
|
|
428
|
+
end
|
|
429
|
+
function UnitAbility.prototype.startCooldown(self, cooldown)
|
|
430
|
+
startUnitAbilityCooldown(self.u, self.typeId, cooldown)
|
|
431
|
+
end
|
|
403
432
|
function UnitAbility.prototype.interruptCast(self)
|
|
404
433
|
self.owner:interruptCast(self.typeId)
|
|
405
434
|
end
|
|
435
|
+
function UnitAbility.prototype.onDestroy(self)
|
|
436
|
+
if self.owner.state ~= 2 then
|
|
437
|
+
self.owner:removeAbility(self.typeId)
|
|
438
|
+
end
|
|
439
|
+
return UnitAbility.____super.prototype.onDestroy(self)
|
|
440
|
+
end
|
|
441
|
+
__TS__SetDescriptor(
|
|
442
|
+
UnitAbility.prototype,
|
|
443
|
+
"isDisabled",
|
|
444
|
+
{get = function(self)
|
|
445
|
+
return self.d ~= nil and self.d > 0
|
|
446
|
+
end},
|
|
447
|
+
true
|
|
448
|
+
)
|
|
406
449
|
__TS__SetDescriptor(
|
|
407
450
|
UnitAbility.prototype,
|
|
408
451
|
"level",
|
|
@@ -411,7 +454,20 @@ __TS__SetDescriptor(
|
|
|
411
454
|
return getUnitAbilityLevel(self.u, self.typeId) - 1
|
|
412
455
|
end,
|
|
413
456
|
set = function(self, v)
|
|
414
|
-
|
|
457
|
+
SetUnitAbilityLevel(self.u, self.typeId, v + 1)
|
|
458
|
+
end
|
|
459
|
+
},
|
|
460
|
+
true
|
|
461
|
+
)
|
|
462
|
+
__TS__SetDescriptor(
|
|
463
|
+
UnitAbility.prototype,
|
|
464
|
+
"cooldownRemainingPercent",
|
|
465
|
+
{
|
|
466
|
+
get = function(self)
|
|
467
|
+
return getUnitAbilityCooldownPercent(self.u, self.typeId)
|
|
468
|
+
end,
|
|
469
|
+
set = function(self, percent)
|
|
470
|
+
setUnitAbilityCooldownPercent(self.u, self.typeId, percent)
|
|
415
471
|
end
|
|
416
472
|
},
|
|
417
473
|
true
|
|
@@ -424,7 +480,7 @@ __TS__SetDescriptor(
|
|
|
424
480
|
return getUnitAbilityCooldownRemaining(self.u, self.typeId)
|
|
425
481
|
end,
|
|
426
482
|
set = function(self, cooldownRemaining)
|
|
427
|
-
|
|
483
|
+
setUnitAbilityCooldownRemaining(self.u, self.typeId, cooldownRemaining)
|
|
428
484
|
end
|
|
429
485
|
},
|
|
430
486
|
true
|
|
@@ -452,8 +508,6 @@ end
|
|
|
452
508
|
local function getAbilityCooldown(_, abilityTypeId)
|
|
453
509
|
return getUnitAbilityCooldownRemaining(abilityActionDummy, abilityTypeId)
|
|
454
510
|
end
|
|
455
|
-
local function doNothing()
|
|
456
|
-
end
|
|
457
511
|
____exports.ItemAbility = __TS__Class()
|
|
458
512
|
local ItemAbility = ____exports.ItemAbility
|
|
459
513
|
ItemAbility.name = "ItemAbility"
|
|
@@ -481,12 +535,28 @@ function ItemAbility.prototype.setField(self, field, levelOrValue, value)
|
|
|
481
535
|
value
|
|
482
536
|
)
|
|
483
537
|
end
|
|
484
|
-
function ItemAbility.prototype.
|
|
538
|
+
function ItemAbility.prototype.startCooldown(self, cooldown)
|
|
485
539
|
local item = self.owner
|
|
486
|
-
local
|
|
540
|
+
local ____startItemCooldown_4 = startItemCooldown
|
|
487
541
|
local ____item_handle_3 = item.handle
|
|
488
542
|
local ____opt_1 = item.owner
|
|
489
|
-
|
|
543
|
+
____startItemCooldown_4(____item_handle_3, ____opt_1 and ____opt_1.handle, cooldown)
|
|
544
|
+
end
|
|
545
|
+
function ItemAbility.prototype.interruptCast(self)
|
|
546
|
+
local item = self.owner
|
|
547
|
+
local itemHandle = item.handle
|
|
548
|
+
local ____opt_5 = item.owner
|
|
549
|
+
local itemOwnerHandle = ____opt_5 and ____opt_5.handle
|
|
550
|
+
local cooldownRemaining = doAbilityActionForceDummy(itemHandle, itemOwnerHandle, getAbilityCooldown, self.typeId)
|
|
551
|
+
if cooldownRemaining == 0 then
|
|
552
|
+
startItemCooldown(itemHandle, itemOwnerHandle, 0.015625)
|
|
553
|
+
end
|
|
554
|
+
end
|
|
555
|
+
function ItemAbility.prototype.onDestroy(self)
|
|
556
|
+
if self.owner.state ~= 2 then
|
|
557
|
+
self.owner:removeAbility(self.typeId)
|
|
558
|
+
end
|
|
559
|
+
return ItemAbility.____super.prototype.onDestroy(self)
|
|
490
560
|
end
|
|
491
561
|
__TS__SetDescriptor(
|
|
492
562
|
ItemAbility.prototype,
|
|
@@ -502,17 +572,17 @@ __TS__SetDescriptor(
|
|
|
502
572
|
{
|
|
503
573
|
get = function(self)
|
|
504
574
|
local item = self.owner
|
|
505
|
-
local
|
|
506
|
-
local
|
|
507
|
-
local
|
|
508
|
-
return
|
|
575
|
+
local ____doAbilityActionForceDummy_10 = doAbilityActionForceDummy
|
|
576
|
+
local ____item_handle_9 = item.handle
|
|
577
|
+
local ____opt_7 = item.owner
|
|
578
|
+
return ____doAbilityActionForceDummy_10(____item_handle_9, ____opt_7 and ____opt_7.handle, getAbilityCooldown, self.typeId)
|
|
509
579
|
end,
|
|
510
580
|
set = function(self, cooldownRemaining)
|
|
511
581
|
local item = self.owner
|
|
512
|
-
local
|
|
513
|
-
local
|
|
514
|
-
local
|
|
515
|
-
|
|
582
|
+
local ____startItemCooldown_14 = startItemCooldown
|
|
583
|
+
local ____item_handle_13 = item.handle
|
|
584
|
+
local ____opt_11 = item.owner
|
|
585
|
+
____startItemCooldown_14(____item_handle_13, ____opt_11 and ____opt_11.handle, cooldownRemaining)
|
|
516
586
|
end
|
|
517
587
|
},
|
|
518
588
|
true
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
|
+
local restoreCooldownGroup
|
|
2
3
|
local ____player = require("core.types.player")
|
|
3
4
|
local Player = ____player.Player
|
|
4
5
|
local ____dummy = require("objutil.dummy")
|
|
@@ -11,8 +12,15 @@ local ____object_2Ddata_2Dentry_2Did_2Dgenerator = require("engine.object-data.u
|
|
|
11
12
|
local abilityTypeIdGenerator = ____object_2Ddata_2Dentry_2Did_2Dgenerator.abilityTypeIdGenerator
|
|
12
13
|
local ____math = require("math")
|
|
13
14
|
local MINIMUM_POSITIVE_NORMALIZED_FLOAT = ____math.MINIMUM_POSITIVE_NORMALIZED_FLOAT
|
|
15
|
+
local ____timer = require("core.types.timer")
|
|
16
|
+
local Timer = ____timer.Timer
|
|
17
|
+
local ____ignore_2Devents_2Ditems = require("engine.internal.unit.ignore-events-items")
|
|
18
|
+
local ignoreEventsItems = ____ignore_2Devents_2Ditems.ignoreEventsItems
|
|
19
|
+
local ____add_2Ditem_2Dto_2Dslot = require("engine.internal.unit.add-item-to-slot")
|
|
20
|
+
local unitAddItemToSlot = ____add_2Ditem_2Dto_2Dslot.unitAddItemToSlot
|
|
14
21
|
local isItemOwned = IsItemOwned
|
|
15
22
|
local isItemPowerup = IsItemPowerup
|
|
23
|
+
local getItemAbility = BlzGetItemAbility
|
|
16
24
|
local getItemX = GetItemX
|
|
17
25
|
local getItemY = GetItemY
|
|
18
26
|
local setAbilityRealLevelField = BlzSetAbilityRealLevelField
|
|
@@ -21,10 +29,11 @@ local getItemIntegerField = BlzGetItemIntegerField
|
|
|
21
29
|
local setItemBooleanField = BlzSetItemBooleanField
|
|
22
30
|
local setItemPosition = SetItemPosition
|
|
23
31
|
local unitAddItem = UnitAddItem
|
|
24
|
-
local unitDropItemSlot = UnitDropItemSlot
|
|
25
32
|
local unitRemoveItem = UnitRemoveItem
|
|
26
33
|
local unitUseItem = UnitUseItem
|
|
27
34
|
local unitResetCooldown = UnitResetCooldown
|
|
35
|
+
local unitInventorySize = UnitInventorySize
|
|
36
|
+
local unitItemInSlot = UnitItemInSlot
|
|
28
37
|
local COOLDOWN_STARTER_ABILITY_TYPE_ID = compiletime(function()
|
|
29
38
|
if not currentMap then
|
|
30
39
|
return 0
|
|
@@ -43,28 +52,36 @@ local COOLDOWN_STARTER_ABILITY_TYPE_ID = compiletime(function()
|
|
|
43
52
|
end)
|
|
44
53
|
local COOLDOWN_STARTER_ITEM_TYPE_ID = compiletime(function()
|
|
45
54
|
local itemType = BlankItemType:create()
|
|
55
|
+
itemType.name = "[Warscript/Dummy] Item Cooldown Starter"
|
|
46
56
|
itemType.abilityTypeIds = {COOLDOWN_STARTER_ABILITY_TYPE_ID}
|
|
47
57
|
itemType.cooldownGroupId = COOLDOWN_STARTER_ABILITY_TYPE_ID
|
|
48
58
|
itemType.activelyUsed = true
|
|
49
59
|
return itemType.id
|
|
50
60
|
end)
|
|
51
|
-
|
|
61
|
+
---
|
|
62
|
+
-- @internal For use by internal systems only.
|
|
63
|
+
____exports.itemAbilityDummy = assert(CreateUnit(
|
|
52
64
|
Player.neutralVictim.handle,
|
|
53
65
|
dummyUnitId,
|
|
54
66
|
0,
|
|
55
67
|
0,
|
|
56
68
|
270
|
|
57
69
|
))
|
|
58
|
-
local cooldownStarterItem = UnitAddItemById(
|
|
59
|
-
local cooldownStarterAbility =
|
|
60
|
-
ShowUnit(
|
|
70
|
+
local cooldownStarterItem = UnitAddItemById(____exports.itemAbilityDummy, COOLDOWN_STARTER_ITEM_TYPE_ID)
|
|
71
|
+
local cooldownStarterAbility = getItemAbility(cooldownStarterItem, COOLDOWN_STARTER_ABILITY_TYPE_ID)
|
|
72
|
+
ShowUnit(____exports.itemAbilityDummy, false)
|
|
61
73
|
local function startItemCooldownInternal(handle, cooldown)
|
|
62
74
|
local cooldownGroup = getItemIntegerField(handle, ITEM_IF_COOLDOWN_GROUP)
|
|
63
75
|
setItemIntegerField(handle, ITEM_IF_COOLDOWN_GROUP, COOLDOWN_STARTER_ABILITY_TYPE_ID)
|
|
64
76
|
setAbilityRealLevelField(cooldownStarterAbility, ABILITY_RLF_COOLDOWN, 0, cooldown)
|
|
65
|
-
unitResetCooldown(
|
|
66
|
-
unitUseItem(
|
|
67
|
-
|
|
77
|
+
unitResetCooldown(____exports.itemAbilityDummy)
|
|
78
|
+
unitUseItem(____exports.itemAbilityDummy, cooldownStarterItem)
|
|
79
|
+
Timer:run(restoreCooldownGroup, handle, cooldownGroup)
|
|
80
|
+
end
|
|
81
|
+
restoreCooldownGroup = function(handle, cooldownGroup)
|
|
82
|
+
if getItemIntegerField(handle, ITEM_IF_COOLDOWN_GROUP) == COOLDOWN_STARTER_ABILITY_TYPE_ID then
|
|
83
|
+
setItemIntegerField(handle, ITEM_IF_COOLDOWN_GROUP, cooldownGroup)
|
|
84
|
+
end
|
|
68
85
|
end
|
|
69
86
|
---
|
|
70
87
|
-- @internal For use by internal systems only.
|
|
@@ -73,10 +90,14 @@ ____exports.startItemCooldown = function(handle, owner, cooldown)
|
|
|
73
90
|
end
|
|
74
91
|
---
|
|
75
92
|
-- @internal For use by internal systems only.
|
|
76
|
-
____exports.abilityActionDummy =
|
|
93
|
+
____exports.abilityActionDummy = ____exports.itemAbilityDummy
|
|
77
94
|
---
|
|
78
95
|
-- @internal For use by internal systems only.
|
|
79
96
|
____exports.doAbilityAction = function(handle, action, ...)
|
|
97
|
+
local isAlreadyIgnoredInEvents = ignoreEventsItems[handle] ~= nil
|
|
98
|
+
if not isAlreadyIgnoredInEvents then
|
|
99
|
+
ignoreEventsItems[handle] = true
|
|
100
|
+
end
|
|
80
101
|
local isOwned = isItemOwned(handle)
|
|
81
102
|
local isPowerup
|
|
82
103
|
local x
|
|
@@ -88,16 +109,19 @@ ____exports.doAbilityAction = function(handle, action, ...)
|
|
|
88
109
|
end
|
|
89
110
|
x = getItemX(handle)
|
|
90
111
|
y = getItemY(handle)
|
|
91
|
-
unitAddItem(
|
|
112
|
+
unitAddItem(____exports.itemAbilityDummy, handle)
|
|
92
113
|
end
|
|
93
114
|
local result = action(handle, ...)
|
|
94
115
|
if not isOwned then
|
|
95
|
-
unitRemoveItem(
|
|
116
|
+
unitRemoveItem(____exports.itemAbilityDummy, handle)
|
|
96
117
|
setItemPosition(handle, x, y)
|
|
97
118
|
if isPowerup then
|
|
98
119
|
setItemBooleanField(handle, ITEM_BF_USE_AUTOMATICALLY_WHEN_ACQUIRED, true)
|
|
99
120
|
end
|
|
100
121
|
end
|
|
122
|
+
if not isAlreadyIgnoredInEvents then
|
|
123
|
+
ignoreEventsItems[handle] = nil
|
|
124
|
+
end
|
|
101
125
|
return result
|
|
102
126
|
end
|
|
103
127
|
---
|
|
@@ -110,20 +134,73 @@ ____exports.doAbilityActionForceDummy = function(handle, owner, action, ...)
|
|
|
110
134
|
if slot == nil then
|
|
111
135
|
return ____exports.doAbilityAction(handle, action, ...)
|
|
112
136
|
end
|
|
137
|
+
local isAlreadyIgnoredInEvents = ignoreEventsItems[handle] ~= nil
|
|
138
|
+
if not isAlreadyIgnoredInEvents then
|
|
139
|
+
ignoreEventsItems[handle] = true
|
|
140
|
+
end
|
|
113
141
|
local isPowerup
|
|
114
142
|
if isItemPowerup(handle) then
|
|
115
143
|
setItemBooleanField(handle, ITEM_BF_USE_AUTOMATICALLY_WHEN_ACQUIRED, false)
|
|
116
144
|
isPowerup = true
|
|
117
145
|
end
|
|
118
146
|
unitRemoveItem(owner, handle)
|
|
119
|
-
unitAddItem(
|
|
147
|
+
unitAddItem(____exports.itemAbilityDummy, handle)
|
|
120
148
|
local result = action(handle, ...)
|
|
121
|
-
unitRemoveItem(
|
|
122
|
-
|
|
123
|
-
unitDropItemSlot(owner, handle, slot)
|
|
149
|
+
unitRemoveItem(____exports.itemAbilityDummy, handle)
|
|
150
|
+
unitAddItemToSlot(owner, handle, slot)
|
|
124
151
|
if isPowerup then
|
|
125
152
|
setItemBooleanField(handle, ITEM_BF_USE_AUTOMATICALLY_WHEN_ACQUIRED, true)
|
|
126
153
|
end
|
|
154
|
+
if not isAlreadyIgnoredInEvents then
|
|
155
|
+
ignoreEventsItems[handle] = nil
|
|
156
|
+
end
|
|
157
|
+
return result
|
|
158
|
+
end
|
|
159
|
+
local depth = 0
|
|
160
|
+
local itemBySlot = {}
|
|
161
|
+
---
|
|
162
|
+
-- @internal For use by internal systems only.
|
|
163
|
+
____exports.doUnitAbilityAction = function(unit, abilityTypeId, action, ...)
|
|
164
|
+
local ____depth_0 = depth
|
|
165
|
+
depth = ____depth_0 + 1
|
|
166
|
+
local offset = 6 * ____depth_0
|
|
167
|
+
for slot = 0, unitInventorySize(unit) - 1 do
|
|
168
|
+
local item = unitItemInSlot(unit, slot)
|
|
169
|
+
if getItemAbility(item, abilityTypeId) ~= nil then
|
|
170
|
+
local isAlreadyIgnoredInEvents = ignoreEventsItems[item] ~= nil
|
|
171
|
+
if not isAlreadyIgnoredInEvents then
|
|
172
|
+
ignoreEventsItems[item] = true
|
|
173
|
+
end
|
|
174
|
+
unitRemoveItem(unit, item)
|
|
175
|
+
if not isAlreadyIgnoredInEvents then
|
|
176
|
+
ignoreEventsItems[item] = nil
|
|
177
|
+
end
|
|
178
|
+
itemBySlot[offset + slot] = item
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
local result = action(unit, ...)
|
|
182
|
+
for slot = 0, unitInventorySize(unit) - 1 do
|
|
183
|
+
local item = itemBySlot[offset + slot]
|
|
184
|
+
if item ~= nil then
|
|
185
|
+
local isAlreadyIgnoredInEvents = ignoreEventsItems[item] ~= nil
|
|
186
|
+
if not isAlreadyIgnoredInEvents then
|
|
187
|
+
ignoreEventsItems[item] = true
|
|
188
|
+
end
|
|
189
|
+
local isPowerup = isItemPowerup(item)
|
|
190
|
+
if isPowerup then
|
|
191
|
+
setItemBooleanField(item, ITEM_BF_USE_AUTOMATICALLY_WHEN_ACQUIRED, false)
|
|
192
|
+
end
|
|
193
|
+
unitAddItemToSlot(unit, item, slot)
|
|
194
|
+
if isPowerup then
|
|
195
|
+
setItemBooleanField(item, ITEM_BF_USE_AUTOMATICALLY_WHEN_ACQUIRED, true)
|
|
196
|
+
end
|
|
197
|
+
if not isAlreadyIgnoredInEvents then
|
|
198
|
+
ignoreEventsItems[item] = nil
|
|
199
|
+
end
|
|
200
|
+
itemBySlot[offset + slot] = nil
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
depth = depth - 1
|
|
127
204
|
return result
|
|
128
205
|
end
|
|
129
206
|
return ____exports
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
|
|
3
|
+
local ____exports = {}
|
|
4
|
+
local ____item = require("engine.internal.item")
|
|
5
|
+
local Item = ____item.Item
|
|
6
|
+
local ____item = require("engine.standard.fields.item")
|
|
7
|
+
local CAN_BE_SOLD_TO_MERCHANTS_ITEM_FIELD = ____item.CAN_BE_SOLD_TO_MERCHANTS_ITEM_FIELD
|
|
8
|
+
local IS_ACTIVELY_USED_ITEM_FIELD = ____item.IS_ACTIVELY_USED_ITEM_FIELD
|
|
9
|
+
__TS__ObjectDefineProperty(
|
|
10
|
+
Item.prototype,
|
|
11
|
+
"canBeSold",
|
|
12
|
+
{
|
|
13
|
+
get = function(self)
|
|
14
|
+
return CAN_BE_SOLD_TO_MERCHANTS_ITEM_FIELD:getValue(self)
|
|
15
|
+
end,
|
|
16
|
+
set = function(self, value)
|
|
17
|
+
CAN_BE_SOLD_TO_MERCHANTS_ITEM_FIELD:setValue(self, value)
|
|
18
|
+
end
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
__TS__ObjectDefineProperty(
|
|
22
|
+
Item.prototype,
|
|
23
|
+
"isActivelyUsed",
|
|
24
|
+
{
|
|
25
|
+
get = function(self)
|
|
26
|
+
return IS_ACTIVELY_USED_ITEM_FIELD:getValue(self)
|
|
27
|
+
end,
|
|
28
|
+
set = function(self, value)
|
|
29
|
+
IS_ACTIVELY_USED_ITEM_FIELD:setValue(self, value)
|
|
30
|
+
end
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
return ____exports
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
2
|
import { Unit } from "./unit";
|
|
3
|
+
import "./unit/equipment-inventory";
|
|
3
4
|
declare module "./item" {
|
|
4
5
|
interface Item {
|
|
6
|
+
/** The unit carrying the item in any of its inventories (regular, extended or equipment), if any. */
|
|
5
7
|
readonly owner?: Unit;
|
|
6
8
|
}
|
|
7
9
|
}
|
|
@@ -5,18 +5,47 @@ local ____item = require("engine.internal.item")
|
|
|
5
5
|
local Item = ____item.Item
|
|
6
6
|
local ____unit = require("engine.internal.unit")
|
|
7
7
|
local Unit = ____unit.Unit
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
require("engine.internal.unit.equipment-inventory")
|
|
9
|
+
local ____owner_2Dcache = require("engine.internal.item.owner-cache")
|
|
10
|
+
local ownerByItem = ____owner_2Dcache.ownerByItem
|
|
11
|
+
local ____item_2Dcontainer = require("engine.internal.unit.item-container")
|
|
12
|
+
local unitOwnsItem = ____item_2Dcontainer.unitOwnsItem
|
|
13
|
+
Unit.itemPickedUpEvent:addListener(
|
|
14
|
+
999999,
|
|
15
|
+
function(unit, item)
|
|
16
|
+
ownerByItem[item] = unit
|
|
17
|
+
end
|
|
18
|
+
)
|
|
19
|
+
Unit.itemEquippedEvent:addListener(
|
|
20
|
+
999999,
|
|
21
|
+
function(unit, item)
|
|
22
|
+
ownerByItem[item] = unit
|
|
23
|
+
end
|
|
24
|
+
)
|
|
25
|
+
Unit.itemUnequippedEvent:addListener(
|
|
26
|
+
999999,
|
|
27
|
+
function(unit, item)
|
|
28
|
+
if not unitOwnsItem(unit.handle, item.handle) then
|
|
29
|
+
ownerByItem[item] = nil
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
)
|
|
33
|
+
Unit.itemDroppedEvent:addListener(
|
|
34
|
+
999999,
|
|
35
|
+
function(unit, item)
|
|
36
|
+
ownerByItem[item] = nil
|
|
37
|
+
end
|
|
38
|
+
)
|
|
15
39
|
__TS__ObjectDefineProperty(
|
|
16
40
|
Item.prototype,
|
|
17
41
|
"owner",
|
|
18
42
|
{get = function(self)
|
|
19
|
-
|
|
43
|
+
local owner = ownerByItem[self]
|
|
44
|
+
if owner ~= nil and not unitOwnsItem(owner.handle, self.handle) then
|
|
45
|
+
ownerByItem[self] = nil
|
|
46
|
+
return nil
|
|
47
|
+
end
|
|
48
|
+
return owner
|
|
20
49
|
end}
|
|
21
50
|
)
|
|
22
51
|
return ____exports
|