warscript 0.0.1-dev.724bf08 → 0.0.1-dev.78d01a4

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.
@@ -8,6 +8,7 @@ declare const enum EffectPropertyKey {
8
8
  ROLL = 102
9
9
  }
10
10
  export type EffectParameters = {
11
+ readonly delay?: number;
11
12
  readonly scale?: number;
12
13
  readonly color?: PlayerColor;
13
14
  readonly pitch?: number;
@@ -1,10 +1,10 @@
1
1
  local ____lualib = require("lualib_bundle")
2
2
  local __TS__Class = ____lualib.__TS__Class
3
3
  local __TS__ClassExtends = ____lualib.__TS__ClassExtends
4
- local __TS__InstanceOf = ____lualib.__TS__InstanceOf
5
4
  local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
5
+ local __TS__InstanceOf = ____lualib.__TS__InstanceOf
6
6
  local ____exports = {}
7
- local dummyPlayer
7
+ local dummyPlayer, flash
8
8
  local ____handle = require("core.types.handle")
9
9
  local Handle = ____handle.Handle
10
10
  local ____playerColor = require("core.types.playerColor")
@@ -157,36 +157,25 @@ function Effect.flash(self, modelPath, xOrWidget, yOrOrAttachmentPoint, paramete
157
157
  parameters = parametersOrDuration
158
158
  parametersOrDuration = nil
159
159
  end
160
- local coordinatesProvided = type(xOrWidget) == "number"
161
- local isPositional = coordinatesProvided or (parameters and parameters.detached) == true
162
- local x = not isPositional and 0 or (coordinatesProvided and xOrWidget or xOrWidget.x)
163
- local y = not isPositional and 0 or (coordinatesProvided and yOrOrAttachmentPoint or xOrWidget.y)
164
- local effect = isPositional and addSpecialEffect(modelPath, x, y) or addSpecialEffectTarget(modelPath, xOrWidget.handle, yOrOrAttachmentPoint or "origin")
165
- if isPositional and not coordinatesProvided and (parameters and parameters.scale) == nil and __TS__InstanceOf(xOrWidget, Unit) then
166
- setSpecialEffectScale(effect, xOrWidget.scale)
167
- end
168
- if parameters ~= nil then
169
- for key, value in ____pairs(parameters) do
170
- if key ~= "zOffset" and key ~= "detached" and key ~= "scaleZOffset" then
171
- setters[key](effect, value)
172
- end
173
- end
174
- if isPositional and parameters.zOffset ~= nil then
175
- moveLocation(location, x, y)
176
- local z = __TS__InstanceOf(xOrWidget, Unit) and getLocationZ(location) + xOrWidget.flyHeight or getLocationZ(location)
177
- BlzSetSpecialEffectZ(
178
- effect,
179
- z + parameters.zOffset * (parameters.scaleZOffset and getSpecialEffectScale(effect) or 1)
180
- )
181
- end
182
- end
183
- if parametersOrDuration ~= nil and parametersOrDuration > 0 then
184
- temporaryEffectsCount = temporaryEffectsCount + 1
185
- temporaryEffects[temporaryEffectsCount] = effect
186
- temporaryEffectsDurations[temporaryEffectsCount] = parametersOrDuration
160
+ if parameters and parameters.delay ~= nil then
161
+ Timer:simple(
162
+ parameters.delay,
163
+ flash,
164
+ modelPath,
165
+ xOrWidget,
166
+ yOrOrAttachmentPoint,
167
+ parametersOrDuration,
168
+ parameters
169
+ )
187
170
  return
188
171
  end
189
- destroyEffect(effect)
172
+ flash(
173
+ modelPath,
174
+ xOrWidget,
175
+ yOrOrAttachmentPoint,
176
+ parametersOrDuration,
177
+ parameters
178
+ )
190
179
  end
191
180
  function Effect.flashTarget(self, model, target, attachPoint, duration)
192
181
  local effect = addSpecialEffectTarget(model, target.handle, attachPoint)
@@ -255,4 +244,36 @@ __TS__SetDescriptor(
255
244
  },
256
245
  true
257
246
  )
247
+ flash = function(modelPath, xOrWidget, yOrOrAttachmentPoint, duration, parameters)
248
+ local coordinatesProvided = type(xOrWidget) == "number"
249
+ local isPositional = coordinatesProvided or (parameters and parameters.detached) == true
250
+ local x = not isPositional and 0 or (coordinatesProvided and xOrWidget or xOrWidget.x)
251
+ local y = not isPositional and 0 or (coordinatesProvided and yOrOrAttachmentPoint or xOrWidget.y)
252
+ local effect = isPositional and addSpecialEffect(modelPath, x, y) or addSpecialEffectTarget(modelPath, xOrWidget.handle, yOrOrAttachmentPoint or "origin")
253
+ if isPositional and not coordinatesProvided and (parameters and parameters.scale) == nil and __TS__InstanceOf(xOrWidget, Unit) then
254
+ setSpecialEffectScale(effect, xOrWidget.scale)
255
+ end
256
+ if parameters ~= nil then
257
+ for key, value in ____pairs(parameters) do
258
+ if key ~= "zOffset" and key ~= "detached" and key ~= "scaleZOffset" and key ~= "delay" then
259
+ setters[key](effect, value)
260
+ end
261
+ end
262
+ if isPositional and parameters.zOffset ~= nil then
263
+ moveLocation(location, x, y)
264
+ local z = __TS__InstanceOf(xOrWidget, Unit) and getLocationZ(location) + xOrWidget.flyHeight or getLocationZ(location)
265
+ BlzSetSpecialEffectZ(
266
+ effect,
267
+ z + parameters.zOffset * (parameters.scaleZOffset and getSpecialEffectScale(effect) or 1)
268
+ )
269
+ end
270
+ end
271
+ if duration ~= nil and duration > 0 then
272
+ temporaryEffectsCount = temporaryEffectsCount + 1
273
+ temporaryEffects[temporaryEffectsCount] = effect
274
+ temporaryEffectsDurations[temporaryEffectsCount] = duration
275
+ return
276
+ end
277
+ destroyEffect(effect)
278
+ end
258
279
  return ____exports
package/core/util.d.ts CHANGED
@@ -54,7 +54,7 @@ declare global {
54
54
  function fourCC(id: string): number;
55
55
  }
56
56
  declare namespace inner {
57
- const orderId: (id: "blink" | "stop" | "load" | "sleep" | "absorb" | "acidbomb" | "acolyteharvest" | "ambush" | "ancestralspirit" | "ancestralspirittarget" | "animatedead" | "antimagicshell" | "attack" | "attackground" | "attackonce" | "attributemodskill" | "auraunholy" | "auravampiric" | "autodispel" | "autodispeloff" | "autodispelon" | "autoentangle" | "autoentangleinstant" | "autoharvestgold" | "autoharvestlumber" | "avatar" | "avengerform" | "awaken" | "banish" | "barkskin" | "barkskinoff" | "barkskinon" | "battleroar" | "battlestations" | "bearform" | "berserk" | "blackarrow" | "blackarrowoff" | "blackarrowon" | "blight" | "blizzard" | "bloodlust" | "bloodlustoff" | "bloodluston" | "board" | "breathoffire" | "breathoffrost" | "build" | "burrow" | "cannibalize" | "carrionscarabs" | "carrionscarabsinstant" | "carrionscarabsoff" | "carrionscarabson" | "carrionswarm" | "chainlightning" | "channel" | "charm" | "chemicalrage" | "cloudoffog" | "clusterrockets" | "coldarrows" | "coldarrowstarg" | "controlmagic" | "corporealform" | "corrosivebreath" | "coupleinstant" | "coupletarget" | "creepanimatedead" | "creepdevour" | "creepheal" | "creephealoff" | "creephealon" | "creepthunderbolt" | "creepthunderclap" | "cripple" | "curse" | "curseoff" | "curseon" | "cyclone" | "darkconversion" | "darkportal" | "darkritual" | "darksummoning" | "deathanddecay" | "deathcoil" | "deathpact" | "decouple" | "defend" | "detectaoe" | "detonate" | "devour" | "devourmagic" | "disassociate" | "disenchant" | "dismount" | "dispel" | "divineshield" | "doom" | "drain" | "dreadlordinferno" | "dropitem" | "moveslot0" | "moveslot1" | "moveslot2" | "moveslot3" | "moveslot4" | "moveslot5" | "drunkenhaze" | "earthquake" | "eattree" | "elementalfury" | "ensnare" | "ensnareoff" | "ensnareon" | "entangle" | "entangleinstant" | "entanglingroots" | "etherealform" | "evileye" | "faeriefire" | "faeriefireoff" | "faeriefireon" | "fanofknives" | "farsight" | "fingerofdeath" | "firebolt" | "flamestrike" | "flamingarrows" | "flamingarrowstarg" | "flamingattack" | "flamingattacktarg" | "flare" | "forceboard" | "forceofnature" | "forkedlightning" | "freezingbreath" | "frenzy" | "frenzyoff" | "frenzyon" | "frostarmor" | "frostarmoroff" | "frostarmoron" | "frostnova" | "getitem" | "gold2lumber" | "grabtree" | "harvest" | "heal" | "healingspray" | "healingward" | "healingwave" | "healoff" | "healon" | "hex" | "holdposition" | "holybolt" | "howlofterror" | "humanbuild" | "immolation" | "impale" | "incineratearrow" | "incineratearrowoff" | "incineratearrowon" | "inferno" | "innerfire" | "innerfireoff" | "innerfireon" | "instant" | "invisibility" | "lavamonster" | "lightningshield" | "loadarcher" | "loadcorpse" | "loadcorpseinstant" | "locustswarm" | "lumber2gold" | "magicdefense" | "magicleash" | "magicundefense" | "manaburn" | "manaflareoff" | "manaflareon" | "manashieldoff" | "manashieldon" | "massteleport" | "mechanicalcritter" | "metamorphosis" | "militia" | "militiaconvert" | "militiaoff" | "militiaunconvert" | "mindrot" | "mirrorimage" | "monsoon" | "mount" | "mounthippogryph" | "move" | "moveAI" | "nagabuild" | "neutraldetectaoe" | "neutralinteract" | "neutralspell" | "nightelfbuild" | "orcbuild" | "parasite" | "parasiteoff" | "parasiteon" | "patrol" | "patrolAI" | "phaseshift" | "phaseshiftinstant" | "phaseshiftoff" | "phaseshifton" | "phoenixfire" | "phoenixmorph" | "poisonarrows" | "poisonarrowstarg" | "polymorph" | "possession" | "preservation" | "purge" | "rainofchaos" | "rainoffire" | "raisedead" | "raisedeadoff" | "raisedeadon" | "ravenform" | "recharge" | "rechargeoff" | "rechargeon" | "rejuvination" | "renew" | "renewoff" | "renewon" | "repair" | "repairoff" | "repairon" | "replenish" | "replenishlife" | "replenishlifeoff" | "replenishlifeon" | "replenishmana" | "replenishmanaoff" | "replenishmanaon" | "replenishoff" | "replenishon" | "request_hero" | "requestsacrifice" | "restoration" | "restorationoff" | "restorationon" | "resumebuild" | "resumeharvesting" | "resurrection" | "returnresources" | "revenge" | "revive" | "roar" | "robogoblin" | "root" | "sacrifice" | "sanctuary" | "scout" | "selfdestruct" | "selfdestructoff" | "selfdestructon" | "sentinel" | "follow" | "smart" | "setrally" | "shadowsight" | "shadowstrike" | "shockwave" | "silence" | "slow" | "slowoff" | "slowon" | "soulburn" | "soulpreservation" | "spellshield" | "spellshieldaoe" | "spellsteal" | "spellstealoff" | "spellstealon" | "spies" | "spiritlink" | "spiritofvengeance" | "spirittroll" | "spiritwolf" | "stampede" | "standdown" | "starfall" | "stasistrap" | "steal" | "stomp" | "stoneform" | "stunned" | "submerge" | "summonfactory" | "summongrizzly" | "summonphoenix" | "summonquillbeast" | "summonwareagle" | "tankdroppilot" | "tankloadpilot" | "tankpilot" | "taunt" | "thunderbolt" | "thunderclap" | "tornado" | "townbelloff" | "townbellon" | "tranquility" | "transmute" | "unavatar" | "unavengerform" | "unbearform" | "unburrow" | "uncoldarrows" | "uncorporealform" | "undeadbuild" | "undefend" | "undivineshield" | "unetherealform" | "unflamingarrows" | "unflamingattack" | "unholyfrenzy" | "unimmolation" | "unload" | "unloadall" | "unloadallcorpses" | "unloadallinstant" | "unpoisonarrows" | "unravenform" | "unrobogoblin" | "unroot" | "unstableconcoction" | "unstoneform" | "unsubmerge" | "unsummon" | "unwindwalk" | "vengeance" | "vengeanceinstant" | "vengeanceoff" | "vengeanceon" | "volcano" | "voodoo" | "ward" | "waterelemental" | "wateryminion" | "web" | "weboff" | "webon" | "whirlwind" | "windwalk" | "wispharvest") => number;
57
+ const orderId: (id: "blink" | "stop" | "load" | "sleep" | "absorb" | "acidbomb" | "acolyteharvest" | "ambush" | "ancestralspirit" | "ancestralspirittarget" | "animatedead" | "antimagicshell" | "attack" | "attackground" | "attackonce" | "attributemodskill" | "auraunholy" | "auravampiric" | "autodispel" | "autodispeloff" | "autodispelon" | "autoentangle" | "autoentangleinstant" | "autoharvestgold" | "autoharvestlumber" | "avatar" | "avengerform" | "awaken" | "banish" | "barkskin" | "barkskinoff" | "barkskinon" | "battleroar" | "battlestations" | "bearform" | "berserk" | "blackarrow" | "blackarrowoff" | "blackarrowon" | "blight" | "blizzard" | "bloodlust" | "bloodlustoff" | "bloodluston" | "board" | "breathoffire" | "breathoffrost" | "build" | "burrow" | "cannibalize" | "carrionscarabs" | "carrionscarabsinstant" | "carrionscarabsoff" | "carrionscarabson" | "carrionswarm" | "chainlightning" | "channel" | "charm" | "chemicalrage" | "cloudoffog" | "clusterrockets" | "coldarrows" | "coldarrowstarg" | "controlmagic" | "corporealform" | "corrosivebreath" | "coupleinstant" | "coupletarget" | "creepanimatedead" | "creepdevour" | "creepheal" | "creephealoff" | "creephealon" | "creepthunderbolt" | "creepthunderclap" | "cripple" | "curse" | "curseoff" | "curseon" | "cyclone" | "darkconversion" | "darkportal" | "darkritual" | "darksummoning" | "deathanddecay" | "deathcoil" | "deathpact" | "decouple" | "defend" | "detectaoe" | "detonate" | "devour" | "devourmagic" | "disassociate" | "disenchant" | "dismount" | "dispel" | "divineshield" | "doom" | "drain" | "dreadlordinferno" | "dropitem" | "moveslot0" | "moveslot1" | "moveslot2" | "moveslot3" | "moveslot4" | "moveslot5" | "useslot0" | "useslot1" | "useslot2" | "useslot3" | "useslot4" | "useslot5" | "drunkenhaze" | "earthquake" | "eattree" | "elementalfury" | "ensnare" | "ensnareoff" | "ensnareon" | "entangle" | "entangleinstant" | "entanglingroots" | "etherealform" | "evileye" | "faeriefire" | "faeriefireoff" | "faeriefireon" | "fanofknives" | "farsight" | "fingerofdeath" | "firebolt" | "flamestrike" | "flamingarrows" | "flamingarrowstarg" | "flamingattack" | "flamingattacktarg" | "flare" | "forceboard" | "forceofnature" | "forkedlightning" | "freezingbreath" | "frenzy" | "frenzyoff" | "frenzyon" | "frostarmor" | "frostarmoroff" | "frostarmoron" | "frostnova" | "getitem" | "gold2lumber" | "grabtree" | "harvest" | "heal" | "healingspray" | "healingward" | "healingwave" | "healoff" | "healon" | "hex" | "holdposition" | "holybolt" | "howlofterror" | "humanbuild" | "immolation" | "impale" | "incineratearrow" | "incineratearrowoff" | "incineratearrowon" | "inferno" | "innerfire" | "innerfireoff" | "innerfireon" | "instant" | "invisibility" | "lavamonster" | "lightningshield" | "loadarcher" | "loadcorpse" | "loadcorpseinstant" | "locustswarm" | "lumber2gold" | "magicdefense" | "magicleash" | "magicundefense" | "manaburn" | "manaflareoff" | "manaflareon" | "manashieldoff" | "manashieldon" | "massteleport" | "mechanicalcritter" | "metamorphosis" | "militia" | "militiaconvert" | "militiaoff" | "militiaunconvert" | "mindrot" | "mirrorimage" | "monsoon" | "mount" | "mounthippogryph" | "move" | "moveAI" | "nagabuild" | "neutraldetectaoe" | "neutralinteract" | "neutralspell" | "nightelfbuild" | "orcbuild" | "parasite" | "parasiteoff" | "parasiteon" | "patrol" | "patrolAI" | "phaseshift" | "phaseshiftinstant" | "phaseshiftoff" | "phaseshifton" | "phoenixfire" | "phoenixmorph" | "poisonarrows" | "poisonarrowstarg" | "polymorph" | "possession" | "preservation" | "purge" | "rainofchaos" | "rainoffire" | "raisedead" | "raisedeadoff" | "raisedeadon" | "ravenform" | "recharge" | "rechargeoff" | "rechargeon" | "rejuvination" | "renew" | "renewoff" | "renewon" | "repair" | "repairoff" | "repairon" | "replenish" | "replenishlife" | "replenishlifeoff" | "replenishlifeon" | "replenishmana" | "replenishmanaoff" | "replenishmanaon" | "replenishoff" | "replenishon" | "request_hero" | "requestsacrifice" | "restoration" | "restorationoff" | "restorationon" | "resumebuild" | "resumeharvesting" | "resurrection" | "returnresources" | "revenge" | "revive" | "roar" | "robogoblin" | "root" | "sacrifice" | "sanctuary" | "scout" | "selfdestruct" | "selfdestructoff" | "selfdestructon" | "sentinel" | "follow" | "smart" | "setrally" | "shadowsight" | "shadowstrike" | "shockwave" | "silence" | "slow" | "slowoff" | "slowon" | "soulburn" | "soulpreservation" | "spellshield" | "spellshieldaoe" | "spellsteal" | "spellstealoff" | "spellstealon" | "spies" | "spiritlink" | "spiritofvengeance" | "spirittroll" | "spiritwolf" | "stampede" | "standdown" | "starfall" | "stasistrap" | "steal" | "stomp" | "stoneform" | "stunned" | "submerge" | "summonfactory" | "summongrizzly" | "summonphoenix" | "summonquillbeast" | "summonwareagle" | "tankdroppilot" | "tankloadpilot" | "tankpilot" | "taunt" | "thunderbolt" | "thunderclap" | "tornado" | "townbelloff" | "townbellon" | "tranquility" | "transmute" | "unavatar" | "unavengerform" | "unbearform" | "unburrow" | "uncoldarrows" | "uncorporealform" | "undeadbuild" | "undefend" | "undivineshield" | "unetherealform" | "unflamingarrows" | "unflamingattack" | "unholyfrenzy" | "unimmolation" | "unload" | "unloadall" | "unloadallcorpses" | "unloadallinstant" | "unpoisonarrows" | "unravenform" | "unrobogoblin" | "unroot" | "unstableconcoction" | "unstoneform" | "unsubmerge" | "unsummon" | "unwindwalk" | "vengeance" | "vengeanceinstant" | "vengeanceoff" | "vengeanceon" | "volcano" | "voodoo" | "ward" | "waterelemental" | "wateryminion" | "web" | "weboff" | "webon" | "whirlwind" | "windwalk" | "wispharvest") => number;
58
58
  }
59
59
  declare global {
60
60
  function orderId(...args: Parameters<typeof inner.orderId>): ReturnType<typeof inner.orderId>;
package/core/util.lua CHANGED
@@ -202,6 +202,12 @@ do
202
202
  moveslot3 = 852005,
203
203
  moveslot4 = 852006,
204
204
  moveslot5 = 852007,
205
+ useslot0 = 852008,
206
+ useslot1 = 852009,
207
+ useslot2 = 852010,
208
+ useslot3 = 852011,
209
+ useslot4 = 852012,
210
+ useslot5 = 852013,
205
211
  drunkenhaze = 852585,
206
212
  earthquake = 852121,
207
213
  eattree = 852146,
@@ -0,0 +1,7 @@
1
+ /** @noSelfInFile */
2
+ import { AbilityBehavior } from "../ability";
3
+ import { Destructor } from "../../../destroyable";
4
+ export declare class AlwaysEnabledAbilityBehavior extends AbilityBehavior {
5
+ protected onCreate(): void;
6
+ protected onDestroy(): Destructor;
7
+ }
@@ -0,0 +1,31 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local __TS__Class = ____lualib.__TS__Class
3
+ local __TS__ClassExtends = ____lualib.__TS__ClassExtends
4
+ local __TS__InstanceOf = ____lualib.__TS__InstanceOf
5
+ local ____exports = {}
6
+ local ____ability = require("engine.behaviour.ability")
7
+ local AbilityBehavior = ____ability.AbilityBehavior
8
+ local ____ability = require("engine.internal.ability")
9
+ local UnitAbility = ____ability.UnitAbility
10
+ local ____ability_2Ddisable_2Dcounter = require("engine.internal.misc.ability-disable-counter")
11
+ local increaseAbilityDisableCounter = ____ability_2Ddisable_2Dcounter.increaseAbilityDisableCounter
12
+ ____exports.AlwaysEnabledAbilityBehavior = __TS__Class()
13
+ local AlwaysEnabledAbilityBehavior = ____exports.AlwaysEnabledAbilityBehavior
14
+ AlwaysEnabledAbilityBehavior.name = "AlwaysEnabledAbilityBehavior"
15
+ __TS__ClassExtends(AlwaysEnabledAbilityBehavior, AbilityBehavior)
16
+ function AlwaysEnabledAbilityBehavior.prototype.onCreate(self)
17
+ local ability = self.ability
18
+ if not __TS__InstanceOf(ability, UnitAbility) then
19
+ return
20
+ end
21
+ increaseAbilityDisableCounter(ability.owner.handle, ability.typeId, -10)
22
+ end
23
+ function AlwaysEnabledAbilityBehavior.prototype.onDestroy(self)
24
+ local ability = self.ability
25
+ if not __TS__InstanceOf(ability, UnitAbility) then
26
+ return AbilityBehavior.prototype.onDestroy(self)
27
+ end
28
+ increaseAbilityDisableCounter(ability.owner.handle, ability.typeId, 10)
29
+ return AbilityBehavior.prototype.onDestroy(self)
30
+ end
31
+ return ____exports
@@ -27,6 +27,7 @@ export declare abstract class AbilityBehavior<Parameters extends {
27
27
  protected flashSpecialEffect(...args: [...pointOrWidget: [x: number, y: number] | [widget: Widget], duration?: number]): void;
28
28
  private static MissileLaunchConfig;
29
29
  private get missileLaunchConfig();
30
+ protected onCreate(): void;
30
31
  onMissileArrival(...parameters: NonNullable<Parameters["missileParameters"]>): void;
31
32
  onUnitGainAbility(_unit: Unit): void;
32
33
  onUnitLoseAbility(_unit: Unit): void;
@@ -79,6 +79,7 @@ function AbilityBehavior.prototype.____constructor(self, ability, parameters)
79
79
  if parameters and parameters.isExclusiveOnImpactHandler then
80
80
  exclusiveOnImpactHandlerAbilityBehaviorByAbility[ability] = self
81
81
  end
82
+ self:onCreate()
82
83
  end
83
84
  function AbilityBehavior.prototype.registerCommandEvent(self, orderTypeStringId)
84
85
  if orderTypeStringId == nil then
@@ -94,10 +95,11 @@ function AbilityBehavior.prototype.resolveCurrentAbilityDependentValue(self, val
94
95
  return resolveCurrentAbilityDependentValue(self.ability, value)
95
96
  end
96
97
  function AbilityBehavior.prototype.flashCasterEffect(self, widget)
98
+ local attachmentPoint = CASTER_EFFECT_FIRST_ATTACHMENT_POINT_STRING_FIELD:getValue(self.ability)
97
99
  Effect:flash(
98
100
  CASTER_EFFECT_MODEL_PATHS_ABILITY_STRING_ARRAY_FIELD:getValue(self.ability, 0),
99
101
  widget,
100
- CASTER_EFFECT_FIRST_ATTACHMENT_POINT_STRING_FIELD:getValue(self.ability)
102
+ attachmentPoint ~= "" and attachmentPoint or "origin"
101
103
  )
102
104
  end
103
105
  function AbilityBehavior.prototype.flashAreaEffect(self, x, y, ...)
@@ -133,6 +135,8 @@ function AbilityBehavior.prototype.flashSpecialEffect(self, xOrWidget, yOrDurati
133
135
  )
134
136
  end
135
137
  end
138
+ function AbilityBehavior.prototype.onCreate(self)
139
+ end
136
140
  function AbilityBehavior.prototype.onMissileArrival(self, ...)
137
141
  end
138
142
  function AbilityBehavior.prototype.onUnitGainAbility(self, _unit)
@@ -0,0 +1,2 @@
1
+ /** @noSelfInFile */
2
+ export {};
@@ -0,0 +1,13 @@
1
+ local ____exports = {}
2
+ local disableAbility = BlzUnitDisableAbility
3
+ ---
4
+ -- @internal For use by internal systems only.
5
+ ____exports.increaseAbilityDisableCounter = function(unit, abilityTypeId, times)
6
+ for _ = 1, times do
7
+ disableAbility(unit, abilityTypeId, true, false)
8
+ end
9
+ for _ = times, -1 do
10
+ disableAbility(unit, abilityTypeId, false, false)
11
+ end
12
+ end
13
+ return ____exports
@@ -332,7 +332,8 @@ export declare class Unit extends Handle<junit> {
332
332
  static itemPickedUpEvent: UnitTriggerEvent<[Item]>;
333
333
  static itemUsedEvent: UnitTriggerEvent<[Item]>;
334
334
  static itemStackedEvent: UnitTriggerEvent<[Item]>;
335
- static get itemMovedEvent(): Event<[
335
+ static get itemUseOrderEvent(): Event<[unit: Unit, item: Item]>;
336
+ static get itemMoveOrderEvent(): Event<[
336
337
  unit: Unit,
337
338
  item: Item,
338
339
  slotFrom: 0 | 1 | 2 | 3 | 4 | 5,
@@ -2538,7 +2538,28 @@ Unit.itemStackedEvent = __TS__New(
2538
2538
  )
2539
2539
  __TS__ObjectDefineProperty(
2540
2540
  Unit,
2541
- "itemMovedEvent",
2541
+ "itemUseOrderEvent",
2542
+ {get = function(self)
2543
+ local event = __TS__New(Event)
2544
+ for order = orderId("useslot0"), orderId("useslot5") do
2545
+ local slot = order - orderId("useslot0")
2546
+ local function listener(unit)
2547
+ local item = unit.items[slot + 1]
2548
+ if item ~= nil then
2549
+ invoke(event, unit, item)
2550
+ end
2551
+ end
2552
+ self.onImmediateOrder[order]:addListener(listener)
2553
+ self.onTargetOrder[order]:addListener(listener)
2554
+ self.onPointOrder[order]:addListener(listener)
2555
+ end
2556
+ rawset(self, "itemUseOrderEvent", event)
2557
+ return event
2558
+ end}
2559
+ )
2560
+ __TS__ObjectDefineProperty(
2561
+ Unit,
2562
+ "itemMoveOrderEvent",
2542
2563
  {get = function(self)
2543
2564
  local event = __TS__New(Event)
2544
2565
  for order = orderId("moveslot0"), orderId("moveslot5") do
@@ -2556,7 +2577,7 @@ __TS__ObjectDefineProperty(
2556
2577
  end
2557
2578
  end)
2558
2579
  end
2559
- rawset(self, "itemMovedEvent", event)
2580
+ rawset(self, "itemMoveOrderEvent", event)
2560
2581
  return event
2561
2582
  end}
2562
2583
  )
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "warscript",
4
- "version": "0.0.1-dev.724bf08",
4
+ "version": "0.0.1-dev.78d01a4",
5
5
  "description": "A typescript library for Warcraft III using Warpack.",
6
6
  "keywords": [
7
7
  "warcraft",