From 60a5136fa3822420faaa56439f0ca1ab676b3128 Mon Sep 17 00:00:00 2001 From: Frotty Date: Sun, 13 Sep 2026 13:29:46 +0200 Subject: [PATCH] Update bundled Jass API for Reforged 3 --- .../src/main/resources/blizzard.j | 640 +++++++++++++++++- .../src/main/resources/common.j | 252 ++++++- 2 files changed, 843 insertions(+), 49 deletions(-) diff --git a/de.peeeq.wurstscript/src/main/resources/blizzard.j b/de.peeeq.wurstscript/src/main/resources/blizzard.j index 35d06db73..9ca0d8ffc 100644 --- a/de.peeeq.wurstscript/src/main/resources/blizzard.j +++ b/de.peeeq.wurstscript/src/main/resources/blizzard.j @@ -44,6 +44,8 @@ globals // Game constants constant integer bj_MAX_INVENTORY = 6 + constant integer bj_MAX_EXTENDED_INVENTORY = 30 + constant integer bj_MAX_EQUIPMENT_INVENTORY = 9 constant integer bj_MAX_PLAYERS = GetBJMaxPlayers() constant integer bj_PLAYER_NEUTRAL_VICTIM = GetBJPlayerNeutralVictim() constant integer bj_PLAYER_NEUTRAL_EXTRA = GetBJPlayerNeutralExtra() @@ -52,7 +54,7 @@ globals constant integer bj_MAX_STOCK_ITEM_SLOTS = 11 constant integer bj_MAX_STOCK_UNIT_SLOTS = 11 constant integer bj_MAX_ITEM_LEVEL = 10 - + // Auto Save constants constant integer bj_MAX_CHECKPOINTS = 5 @@ -159,6 +161,8 @@ globals constant integer bj_CAMPAIGN_INDEX_XH = 6 constant integer bj_CAMPAIGN_INDEX_XU = 7 constant integer bj_CAMPAIGN_INDEX_XO = 8 + constant integer bj_CAMPAIGN_INDEX_RH = 9 + constant integer bj_CAMPAIGN_INDEX_RU = 10 // Campaign offset constants (for mission indexing) constant integer bj_CAMPAIGN_OFFSET_T = 0 @@ -170,6 +174,8 @@ globals constant integer bj_CAMPAIGN_OFFSET_XH = 6 constant integer bj_CAMPAIGN_OFFSET_XU = 7 constant integer bj_CAMPAIGN_OFFSET_XO = 8 + constant integer bj_CAMPAIGN_OFFSET_RH = 0 + constant integer bj_CAMPAIGN_OFFSET_RU = 1 // Mission indexing constants // Tutorial @@ -263,13 +269,22 @@ globals constant integer bj_MISSION_INDEX_XU11 = bj_CAMPAIGN_OFFSET_XU * 1000 + 11 constant integer bj_MISSION_INDEX_XU12 = bj_CAMPAIGN_OFFSET_XU * 1000 + 12 constant integer bj_MISSION_INDEX_XU13 = bj_CAMPAIGN_OFFSET_XU * 1000 + 13 - // Expansion Orc constant integer bj_MISSION_INDEX_XO00 = bj_CAMPAIGN_OFFSET_XO * 1000 + 0 constant integer bj_MISSION_INDEX_XO01 = bj_CAMPAIGN_OFFSET_XO * 1000 + 1 constant integer bj_MISSION_INDEX_XO02 = bj_CAMPAIGN_OFFSET_XO * 1000 + 2 constant integer bj_MISSION_INDEX_XO03 = bj_CAMPAIGN_OFFSET_XO * 1000 + 3 - + // Rebirth Human + constant integer bj_MISSION_INDEX_RH00 = bj_CAMPAIGN_OFFSET_RH * 1000 + 0 + constant integer bj_MISSION_INDEX_RH01 = bj_CAMPAIGN_OFFSET_RH * 1000 + 1 + constant integer bj_MISSION_INDEX_RH02 = bj_CAMPAIGN_OFFSET_RH * 1000 + 2 + constant integer bj_MISSION_INDEX_RH03 = bj_CAMPAIGN_OFFSET_RH * 1000 + 3 + constant integer bj_MISSION_INDEX_RH04 = bj_CAMPAIGN_OFFSET_RH * 1000 + 4 + // Rebirth Undead + constant integer bj_MISSION_INDEX_RU00 = bj_CAMPAIGN_OFFSET_RU * 1000 + 0 + constant integer bj_MISSION_INDEX_RU01 = bj_CAMPAIGN_OFFSET_RU * 1000 + 1 + constant integer bj_MISSION_INDEX_RU02 = bj_CAMPAIGN_OFFSET_RU * 1000 + 2 + constant integer bj_MISSION_INDEX_RU03 = bj_CAMPAIGN_OFFSET_RU * 1000 + 3 // Cinematic indexing constants constant integer bj_CINEMATICINDEX_TOP = 0 constant integer bj_CINEMATICINDEX_HOP = 1 @@ -282,6 +297,8 @@ globals constant integer bj_CINEMATICINDEX_NED = 8 constant integer bj_CINEMATICINDEX_XOP = 9 constant integer bj_CINEMATICINDEX_XED = 10 + constant integer bj_CINEMATICINDEX_HFO = 11 + constant integer bj_CINEMATICINDEX_UFE = 12 // Alliance settings constant integer bj_ALLIANCE_UNALLIED = 0 @@ -302,6 +319,7 @@ globals constant integer bj_KEYEVENTKEY_RIGHT = 1 constant integer bj_KEYEVENTKEY_DOWN = 2 constant integer bj_KEYEVENTKEY_UP = 3 + constant integer bj_KEYEVENTKEY_A = 4 // Mouse Event Types constant integer bj_MOUSEEVENTTYPE_DOWN = 0 @@ -392,7 +410,7 @@ globals constant integer bj_GAMECACHE_REAL = 2 constant integer bj_GAMECACHE_UNIT = 3 constant integer bj_GAMECACHE_STRING = 4 - + // Hashtable value types constant integer bj_HASHTABLE_BOOLEAN = 0 constant integer bj_HASHTABLE_INTEGER = 1 @@ -417,7 +435,7 @@ globals constant integer bj_MINIMAPPINGSTYLE_SIMPLE = 0 constant integer bj_MINIMAPPINGSTYLE_FLASHY = 1 constant integer bj_MINIMAPPINGSTYLE_ATTACK = 2 - + // Campaign Minimap icon styles constant integer bj_CAMPPINGSTYLE_PRIMARY = 0 constant integer bj_CAMPPINGSTYLE_PRIMARY_GREEN = 1 @@ -611,6 +629,9 @@ globals trigger bj_delayedSuspendDecayTrig = null integer bj_livingPlayerUnitsTypeId = 0 widget bj_lastDyingWidget = null + boolean bj_HeroGlowAllUnitsFlag = true + boolean bj_enableAurasAllUnits = true + boolean bj_affectsUIAurasAllUnits = true // Random distribution vars integer bj_randDistCount = 0 @@ -649,6 +670,8 @@ globals ubersplat bj_lastCreatedUbersplat = null minimapicon bj_lastCreatedMinimapIcon = null commandbuttoneffect bj_lastCreatedCommandButtonEffect = null + item bj_lastEquippedItem = null + item bj_lastUnequippedItem = null // Filter function vars boolexpr filterIssueHauntOrderAtLocBJ = null @@ -661,6 +684,8 @@ globals // Memory cleanup vars boolean bj_wantDestroyGroup = false + effect bj_destroyEffectAsyncEffect = null + real bj_destroyEffectAsyncTime = 0 // Instanced Operation Results boolean bj_lastInstObjFuncSuccessful = true @@ -684,7 +709,23 @@ function BJDebugMsg takes string msg returns nothing endloop endfunction +//*************************************************************************** +//* +//* Memory Cleanup Functions +//* +//*************************************************************************** + +function SetWantDestroyGroupBJ takes nothing returns nothing + set bj_wantDestroyGroup = true +endfunction + +function ClearWantDestroyGroupBJ takes nothing returns nothing + set bj_wantDestroyGroup = false +endfunction +function GetWantDestroyGroupBJ takes nothing returns boolean + return bj_wantDestroyGroup +endfunction //*************************************************************************** //* @@ -1355,6 +1396,14 @@ function SetCameraFieldForPlayer takes player whichPlayer, camerafield whichFiel endif endfunction +//=========================================================================== +function SetCameraFieldControlledByInputForPlayer takes player whichPlayer, camerafield whichField, boolean controlled returns nothing + if (GetLocalPlayer() == whichPlayer) then + // Use only local code (no net traffic) within this block to avoid desyncs. + call SetCameraFieldControlledByInput(whichField, controlled) + endif +endfunction + //=========================================================================== function SetCameraTargetControllerNoZForPlayer takes player whichPlayer, unit whichUnit, real xoffset, real yoffset, boolean inheritOrientation returns nothing if (GetLocalPlayer() == whichPlayer) then @@ -1680,8 +1729,8 @@ endfunction // function SubStringBJ takes string source, integer start, integer end returns string return SubString(source, start-1, end) -endfunction - +endfunction + function GetHandleIdBJ takes handle h returns integer return GetHandleId(h) endfunction @@ -1793,6 +1842,21 @@ function TriggerRegisterPlayerMouseEventBJ takes trigger trig, player whichPlaye endif endfunction +//=========================================================================== +function IsMouseButtonPressedBJ takes mousebuttontype mouseButtonType returns boolean + return BlzIsMouseButtonPressed(mouseButtonType) +endfunction + +//=========================================================================== +function IsMetaKeyPressedBJ takes integer metakey returns boolean + return BlzIsMetaKeyPressed(metakey) +endfunction + +//=========================================================================== +function IsKeyPressedBJ takes oskeytype key returns boolean + return BlzIsKeyPressed(key) +endfunction + //=========================================================================== function TriggerRegisterPlayerEventVictory takes trigger trig, player whichPlayer returns event return TriggerRegisterPlayerEvent(trig, whichPlayer, EVENT_PLAYER_VICTORY) @@ -2108,6 +2172,67 @@ function SetWaterBaseColorBJ takes real red, real green, real blue, real transpa call SetWaterBaseColor(PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100.0-transparency)) endfunction +//=========================================================================== +function SetHDWaterParamsExBJ takes real red, real green, real blue, boolean override, integer vertexDisplacement, integer minOpacity, integer maxOpacity, integer reflectivity, integer emissivity, integer edgeSoftness, integer waveStrength, integer envMapStrength returns nothing + call SetHDWaterParamsEx (PercentTo255(red), PercentTo255(green), PercentTo255(blue), override, vertexDisplacement, minOpacity, maxOpacity, reflectivity, emissivity, edgeSoftness, waveStrength, envMapStrength) +endfunction + +//=========================================================================== +function BlzSetHDWaterColorBJ takes real red, real green, real blue returns nothing + call BlzSetHDWaterColor(PercentTo255(red), PercentTo255(green), PercentTo255(blue)) + call BlzSetHDWaterColorOverride(true) +endfunction + +//=========================================================================== +function BlzSetHDWaterColorOverrideBJ takes nothing returns nothing + call BlzSetHDWaterColorOverride(true) +endfunction + +//=========================================================================== +function BlzClearHDWaterColorOverrideBJ takes nothing returns nothing + call BlzSetHDWaterColorOverride(false) +endfunction + +//=========================================================================== +function BlzSetHDWaterVertexDisplacementBJ takes integer vertexDisplacement returns nothing + call BlzSetHDWaterVertexDisplacement(vertexDisplacement) +endfunction + +//=========================================================================== +function BlzSetHDWaterMinOpacityBJ takes integer minOpacity returns nothing + call BlzSetHDWaterMinOpacity(minOpacity) +endfunction + +//=========================================================================== +function BlzSetHDWaterMaxOpacityBJ takes integer maxOpacity returns nothing + call BlzSetHDWaterMaxOpacity(maxOpacity) +endfunction + +//=========================================================================== +function BlzSetHDWaterReflectivityBJ takes integer reflectivity returns nothing + call BlzSetHDWaterReflectivity(reflectivity) +endfunction + +//=========================================================================== +function BlzSetHDWaterEmissivityBJ takes integer emissivity returns nothing + call BlzSetHDWaterEmissivity(emissivity) +endfunction + +//=========================================================================== +function BlzSetHDWaterEdgeSoftnessBJ takes integer edgeSoftness returns nothing + call BlzSetHDWaterEdgeSoftness(edgeSoftness) +endfunction + +//=========================================================================== +function BlzSetHDWaterWaveStrengthBJ takes integer waveStrength returns nothing + call BlzSetHDWaterWaveStrength(waveStrength) +endfunction + +//=========================================================================== +function BlzSetHDWaterEnvMapStrengthBJ takes integer envMapStrengthy returns nothing + call BlzSetHDWaterEnvMapStrength(envMapStrengthy) +endfunction + //=========================================================================== function CreateFogModifierRectSimple takes player whichPlayer, fogstate whichFogState, rect r, boolean afterUnits returns fogmodifier set bj_lastCreatedFogModifier = CreateFogModifierRect(whichPlayer, whichFogState, r, true, afterUnits) @@ -2181,6 +2306,67 @@ function SetTerrainFogExBJ takes integer style, real zstart, real zend, real den call SetTerrainFogEx(style, zstart, zend, density, red * 0.01, green * 0.01, blue * 0.01) endfunction +//=========================================================================== +function SetTerrainFogExVBJ takes integer style, real zstart, real zend, real density, real heightStart, real heightEnd, real linearStart, real linearEnd, real red, real green, real blue returns nothing + call SetTerrainFogExV(style, zstart, zend, density, heightStart, heightEnd, linearStart, linearEnd, red * 0.01, green * 0.01, blue * 0.01) +endfunction + +//=========================================================================== +function BlzSetTerrainFogStyleBJ takes fogstyle style returns nothing + call BlzSetTerrainFogStyle(style) +endfunction + +//=========================================================================== +function BlzSetTerrainFogZStartBJ takes real zStart returns nothing + call BlzSetTerrainFogZStart(zStart) +endfunction + +//=========================================================================== +function BlzSetTerrainFogZEndBJ takes real zEnd returns nothing + call BlzSetTerrainFogZEnd(zEnd) +endfunction + +//=========================================================================== +function BlzSetTerrainFogDensityBJ takes real density returns nothing + call BlzSetTerrainFogDensity(density) +endfunction + +//=========================================================================== +function BlzSetTerrainFogHeightStartBJ takes real heightStart returns nothing + call BlzSetTerrainFogHeightStart(heightStart) +endfunction + +//=========================================================================== +function BlzSetTerrainFogHeightEndBJ takes real heightEnd returns nothing + call BlzSetTerrainFogHeightEnd(heightEnd) +endfunction + +//=========================================================================== +function BlzSetTerrainFogLinearStartBJ takes real linearStart returns nothing + call BlzSetTerrainFogLinearStart(linearStart) +endfunction + +//=========================================================================== +function BlzSetTerrainFogLinearEndBJ takes real linearEnd returns nothing + call BlzSetTerrainFogLinearEnd(linearEnd) +endfunction + +//=========================================================================== +// It refers to max opacity +function BlzSetTerrainFogMaxLinearDensityBJ takes real maxLinearDensity returns nothing + call BlzSetTerrainFogMaxLinearDensity(maxLinearDensity) +endfunction + +//=========================================================================== +function BlzSetTerrainFogDrawOverSkyBJ takes boolean drawOverSky returns nothing + call BlzSetTerrainFogDrawOverSky(drawOverSky) +endfunction + +//=========================================================================== +function BlzSetTerrainFogColorBJ takes real red, real green, real blue returns nothing + call BlzSetTerrainFogColor(red * 0.01, green * 0.01, blue * 0.01) +endfunction + //=========================================================================== function ResetTerrainFogBJ takes nothing returns nothing call ResetTerrainFog() @@ -2196,11 +2382,88 @@ function SetDoodadAnimationRectBJ takes string animName, integer doodadID, rect call SetDoodadAnimationRect(r, doodadID, animName, false) endfunction +//=========================================================================== +function BlzSetSingleDoodadAnimationBJ takes string animName, integer index returns nothing + call BlzSetSingleDoodadAnimation(index, animName, false) +endfunction + //=========================================================================== function AddUnitAnimationPropertiesBJ takes boolean add, string animProperties, unit whichUnit returns nothing call AddUnitAnimationProperties(whichUnit, animProperties, add) endfunction +//=========================================================================== +function SetDoodadColorBJ takes playercolor color, integer doodadID, real radius, location center returns nothing + call SetDoodadColor(GetLocationX(center), GetLocationY(center), radius, doodadID, false, color) +endfunction + +//=========================================================================== +function SetDoodadColorRectBJ takes playercolor color, integer doodadID, rect r returns nothing + call SetDoodadColorRect(r, doodadID, color) +endfunction + +//=========================================================================== +function BlzSetSingleDoodadColorBJ takes playercolor color, integer index returns nothing + call BlzSetSingleDoodadColor(index, color) +endfunction + +//=========================================================================== +function AllowHeroGlowOnUnitBJ takes unit whichUnit returns nothing + call AllowHeroGlowOnUnit(whichUnit) +endfunction + +//=========================================================================== +function DisallowHeroGlowOnUnitBJ takes unit whichUnit returns nothing + call DisallowHeroGlowOnUnit(whichUnit) +endfunction + +//=========================================================================== +function ToggleHeroGlowOnAllUnitsBJEnum takes nothing returns nothing + if bj_HeroGlowAllUnitsFlag then + call AllowHeroGlowOnUnit(GetEnumUnit()) + else + call DisallowHeroGlowOnUnit(GetEnumUnit()) + endif +endfunction + +//=========================================================================== +function ToggleHeroGlowOnAllUnitsBJ takes boolean allow returns nothing + local integer index + local player indexPlayer + local group g + + set bj_HeroGlowAllUnitsFlag = allow + set g = CreateGroup() + set index = 0 + loop + set indexPlayer = Player( index ) + + // Enumerate and allow/disallow glow on every unit owned by the player. + call GroupEnumUnitsOfPlayer( g, indexPlayer, null ) + call ForGroup( g, function ToggleHeroGlowOnAllUnitsBJEnum ) + call GroupClear( g ) + + set index = index + 1 + exitwhen index == bj_MAX_PLAYER_SLOTS + endloop + call DestroyGroup(g) +endfunction + +//=========================================================================== +function AllowHeroGlowOnAllUnitsBJ takes nothing returns nothing + call ToggleHeroGlowOnAllUnitsBJ(true) +endfunction + +//=========================================================================== +function DisallowHeroGlowOnAllUnitsBJ takes nothing returns nothing + call ToggleHeroGlowOnAllUnitsBJ(false) +endfunction + +//=========================================================================== +function HeroGlowIsAllowedOnUnitBJ takes unit whichUnit returns boolean + return HeroGlowIsAllowedOnUnit(whichUnit) +endfunction + //============================================================================ function CreateImageBJ takes string file, real size, location where, real zOffset, integer imageType returns image @@ -2781,6 +3044,24 @@ function GetLastCreatedEffectBJ takes nothing returns effect return bj_lastCreatedEffect endfunction +//=========================================================================== +// Note: this function should be used in conjunction with the one below, which is the only one that is really exposed in GUI +function DestroyEffectAsyncBJ takes nothing returns nothing + local effect localEffect = bj_destroyEffectAsyncEffect + local real localTime = bj_destroyEffectAsyncTime + + call TriggerSleepAction(localTime) + call DestroyEffect(localEffect) +endfunction + +function DestroyEffectAfterTimeBJ takes effect whichEffect, real time returns nothing + // Save arguments to globals + set bj_destroyEffectAsyncEffect = whichEffect + set bj_destroyEffectAsyncTime = time + + // Externalize to an async thread + call ExecuteFunc("DestroyEffectAsyncBJ") +endfunction //*************************************************************************** @@ -2922,7 +3203,7 @@ endfunction function UnitAddItemByIdSwapped takes integer itemId, unit whichHero returns item // Create the item at the hero's feet first, and then give it to him. // This is to ensure that the item will be left at the hero's feet if - // his inventory is full. + // his inventory is full. set bj_lastCreatedItem = CreateItem(itemId, GetUnitX(whichHero), GetUnitY(whichHero)) call UnitAddItem(whichHero, bj_lastCreatedItem) return bj_lastCreatedItem @@ -2934,6 +3215,33 @@ function UnitRemoveItemSwapped takes item whichItem, unit whichHero returns noth call UnitRemoveItem(whichHero, whichItem) endfunction +//=========================================================================== +function UnitEquipItemSwapped takes item whichItem, unit whichHero returns boolean + local boolean success = UnitEquipItem(whichHero, whichItem) + if (success) then + set bj_lastEquippedItem = whichItem + endif + + return success +endfunction + +//=========================================================================== +function UnitEquipItemByIdSwapped takes integer itemId, unit whichHero returns item + // Create the item at the hero's feet first, and then give it to him. + // This is to ensure that the item will be left at the hero's feet if + // his inventory is full. + local boolean success + + set bj_lastCreatedItem = CreateItem(itemId, GetUnitX(whichHero), GetUnitY(whichHero)) + set success = UnitEquipItem(whichHero, bj_lastCreatedItem) + + if (success) then + set bj_lastEquippedItem = bj_lastCreatedItem + endif + + return bj_lastCreatedItem +endfunction + //=========================================================================== // Translates 0-based slot indices to 1-based slot indices. // @@ -2942,6 +3250,16 @@ function UnitRemoveItemFromSlotSwapped takes integer itemSlot, unit whichHero re return bj_lastRemovedItem endfunction +function UnitUnequipItemSwapped takes unit whichHero, item whichItem returns nothing + set bj_lastUnequippedItem = whichItem + call UnitUnequipItem(whichHero, whichItem) +endfunction + +function UnitUnequipItemFromSlotSwapped takes unit whichHero, loadoutslot slot returns item + set bj_lastUnequippedItem = UnitUnequipItemFromSlot(whichHero, slot) + return bj_lastUnequippedItem +endfunction + //=========================================================================== function CreateItemLoc takes integer itemId, location loc returns item set bj_lastCreatedItem = CreateItem(itemId, GetLocationX(loc), GetLocationY(loc)) @@ -2958,6 +3276,16 @@ function GetLastRemovedItem takes nothing returns item return bj_lastRemovedItem endfunction +//=========================================================================== +function GetLastEquippedItem takes nothing returns item + return bj_lastEquippedItem +endfunction + +//=========================================================================== +function GetLastUnequippedItem takes nothing returns item + return bj_lastUnequippedItem +endfunction + //=========================================================================== function SetItemPositionLoc takes item whichItem, location loc returns nothing call SetItemPosition(whichItem, GetLocationX(loc), GetLocationY(loc)) @@ -3112,6 +3440,14 @@ function UnitItemInSlotBJ takes unit whichUnit, integer itemSlot returns item return UnitItemInSlot(whichUnit, itemSlot-1) endfunction +function UnitItemInBagSlotBJ takes unit whichUnit, integer itemSlot returns item + return UnitItemInBagSlot(whichUnit, itemSlot-1) +endfunction + +function UnitItemInEquipmentSlotBJ takes unit whichUnit, loadoutslot slot returns item + return UnitItemInEquipmentSlot(whichUnit, slot) +endfunction + //=========================================================================== // Translates 0-based slot indices to 1-based slot indices. // @@ -3148,6 +3484,132 @@ function UnitHasItemOfTypeBJ takes unit whichUnit, integer itemId returns boolea return GetInventoryIndexOfItemTypeBJ(whichUnit, itemId) > 0 endfunction +//=========================================================================== +function GetInventoryBagIndexOfItemTypeBJ takes unit whichUnit, integer itemId returns integer + local integer index + local item indexItem + + set index = 0 + loop + set indexItem = UnitItemInBagSlot(whichUnit, index) + if (indexItem != null) and (GetItemTypeId(indexItem) == itemId) then + return index + 1 + endif + + set index = index + 1 + exitwhen index >= bj_MAX_EXTENDED_INVENTORY + endloop + return 0 +endfunction + +//=========================================================================== +function GetItemOfTypeFromUnitBagBJ takes unit whichUnit, integer itemId returns item + local integer index = GetInventoryBagIndexOfItemTypeBJ(whichUnit, itemId) + + if (index == 0) then + return null + else + return UnitItemInBagSlot(whichUnit, index - 1) + endif +endfunction + +//=========================================================================== +function UnitHasItemOfTypeBaggedBJ takes unit whichUnit, integer itemId returns boolean + return GetInventoryBagIndexOfItemTypeBJ(whichUnit, itemId) > 0 +endfunction + +//=========================================================================== +function GetInventoryBagIndexOfEquipmentTypeBJ takes unit whichUnit, equipmentType whichEquipmentType returns integer + local integer index + local item indexItem + + set index = 0 + loop + set indexItem = UnitItemInBagSlot(whichUnit, index) + if (indexItem != null) and (GetItemEquipmentType(indexItem) == whichEquipmentType) then + return index + 1 + endif + + set index = index + 1 + exitwhen index >= bj_MAX_EXTENDED_INVENTORY + endloop + return 0 +endfunction + +//=========================================================================== +function GetItemOfEquipmentTypeFromUnitBagBJ takes unit whichUnit, equipmentType whichEquipmentType returns item + local integer index = GetInventoryBagIndexOfEquipmentTypeBJ(whichUnit, whichEquipmentType) + + if (index == 0) then + return null + else + return UnitItemInBagSlot(whichUnit, index - 1) + endif +endfunction + +//=========================================================================== +function GetEquipmentInventoryIndexOfItemTypeBJ takes unit whichUnit, integer itemId returns integer + local integer index + local item indexItem + + set index = 0 + loop + set indexItem = UnitItemInEquipmentSlot(whichUnit, ConvertLoadoutSlot(index)) + if (indexItem != null) and (GetItemTypeId(indexItem) == itemId) then + return index + 1 + endif + + set index = index + 1 + exitwhen index >= bj_MAX_EQUIPMENT_INVENTORY + endloop + return 0 +endfunction + +//=========================================================================== +function GetEquipmentInventoryIndexOfEquipmentTypeBJ takes unit whichUnit, equipmentType whichEquipmentType returns integer + local integer index + local item indexItem + + set index = 0 + loop + set indexItem = UnitItemInEquipmentSlot(whichUnit, ConvertLoadoutSlot(index)) + if (indexItem != null) and (GetItemEquipmentType(indexItem) == whichEquipmentType) then + return index + 1 + endif + + set index = index + 1 + exitwhen index >= bj_MAX_EQUIPMENT_INVENTORY + endloop + return 0 +endfunction + +//=========================================================================== +function GetItemEquippedByHeroOfTypeBJ takes unit whichUnit, integer itemId returns item + local integer index = GetEquipmentInventoryIndexOfItemTypeBJ(whichUnit, itemId) + + if (index == 0) then + return null + else + return UnitItemInEquipmentSlot(whichUnit, ConvertLoadoutSlot(index - 1)) + endif +endfunction + +//=========================================================================== +function GetItemEquippedByHeroOfEquipmentTypeBJ takes unit whichUnit, equipmentType whichEquipmentType returns item + local integer index = GetEquipmentInventoryIndexOfEquipmentTypeBJ(whichUnit, whichEquipmentType) + + if (index == 0) then + return null + else + return UnitItemInEquipmentSlot(whichUnit, ConvertLoadoutSlot(index - 1)) + endif +endfunction + +//=========================================================================== +function UnitHasItemOfTypeEquippedBJ takes unit whichUnit, integer itemId returns boolean + return GetEquipmentInventoryIndexOfItemTypeBJ(whichUnit, itemId) > 0 +endfunction + //=========================================================================== function UnitInventoryCount takes unit whichUnit returns integer local integer index = 0 @@ -3170,6 +3632,45 @@ function UnitInventorySizeBJ takes unit whichUnit returns integer return UnitInventorySize(whichUnit) endfunction +//=========================================================================== +function UnitExtendedInventoryCount takes unit whichUnit returns integer + local integer index = 0 + local integer count = 0 + + loop + if (UnitItemInBagSlot(whichUnit, index) != null) then + set count = count + 1 + endif + + set index = index + 1 + exitwhen index >= bj_MAX_EXTENDED_INVENTORY + endloop + + return count +endfunction + +//=========================================================================== +function UnitExtendedInventorySizeBJ takes unit whichUnit returns integer + return UnitExtendedInventorySize(whichUnit) +endfunction + +//=========================================================================== +function UnitEquipmentCount takes unit whichUnit returns integer + local integer index = 0 + local integer count = 0 + + loop + if (UnitItemInEquipmentSlot(whichUnit, ConvertLoadoutSlot(index)) != null) then + set count = count + 1 + endif + + set index = index + 1 + exitwhen index >= bj_MAX_EQUIPMENT_INVENTORY + endloop + + return count +endfunction + //=========================================================================== function SetItemInvulnerableBJ takes item whichItem, boolean flag returns nothing call SetItemInvulnerable(whichItem, flag) @@ -3210,6 +3711,11 @@ function ChooseRandomItemExBJ takes integer level, itemtype whichType returns in return ChooseRandomItemEx(whichType, level) endfunction +//=========================================================================== +function ChooseRandomItemExWithFilterBJ takes integer level, itemtype whichType, equipmentType whichEquipmentType, itemTag whichTag returns integer + return ChooseRandomItemExWithFilter(whichType, level, whichEquipmentType, whichTag) +endfunction + //=========================================================================== function ChooseRandomNPBuildingBJ takes nothing returns integer return ChooseRandomNPBuilding() @@ -3320,7 +3826,7 @@ endfunction //=========================================================================== function String2OrderIdBJ takes string orderIdString returns integer local integer orderId - + // Check to see if it's a generic order. set orderId = OrderId(orderIdString) if (orderId != 0) then @@ -3885,7 +4391,7 @@ function PauseAllUnitsBJEnum takes nothing returns nothing endfunction //=========================================================================== -// Pause all units +// Pause all units function PauseAllUnitsBJ takes boolean pause returns nothing local integer index local player indexPlayer @@ -3923,6 +4429,35 @@ function IsUnitPausedBJ takes unit whichUnit returns boolean return IsUnitPaused(whichUnit) endfunction +//=========================================================================== +function BlzAllUnitsEnableAurasBJEnum takes nothing returns nothing + call BlzUnitEnableAuras( GetEnumUnit(), bj_enableAurasAllUnits, bj_affectsUIAurasAllUnits ) +endfunction + +//=========================================================================== +function BlzAllUnitsEnableAurasBJ takes boolean enable, boolean affectsUI returns nothing + local integer index + local player indexPlayer + local group g + + set bj_enableAurasAllUnits = enable + set bj_affectsUIAurasAllUnits = affectsUI + set g = CreateGroup() + set index = 0 + loop + set indexPlayer = Player( index ) + + // Enumerate and enable/disable auras on every unit owned by the player. + call GroupEnumUnitsOfPlayer( g, indexPlayer, null ) + call ForGroup( g, function BlzAllUnitsEnableAurasBJEnum ) + call GroupClear( g ) + + set index = index + 1 + exitwhen index == bj_MAX_PLAYER_SLOTS + endloop + call DestroyGroup(g) +endfunction + //=========================================================================== function UnitPauseTimedLifeBJ takes boolean flag, unit whichUnit returns nothing call UnitPauseTimedLife(whichUnit, flag) @@ -5058,6 +5593,15 @@ function QueueUnitAnimationBJ takes unit whichUnit, string whichAnimation return call QueueUnitAnimation(whichUnit, whichAnimation) endfunction +//=========================================================================== +// This version differs from the common.j interface in that the alpha value +// is reversed so as to be displayed as transparency, and all four parameters +// are treated as percentages rather than bytes. +// +function SetDestructableVertexColorBJ takes destructable whichDestructable, real red, real green, real blue, real transparency returns nothing + call SetDestructableVertexColor(whichDestructable, PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100.0-transparency)) +endfunction + //=========================================================================== function SetDestructableAnimationBJ takes destructable d, string whichAnimation returns nothing call SetDestructableAnimation(d, whichAnimation) @@ -5274,7 +5818,7 @@ function PlayersAreCoAllied takes player playerA, player playerB returns boolean endfunction //=========================================================================== -// Force (whichPlayer) AI player to share vision and advanced unit control +// Force (whichPlayer) AI player to share vision and advanced unit control // with all AI players of its allies. // function ShareEverythingWithTeamAI takes player whichPlayer returns nothing @@ -5322,7 +5866,7 @@ endfunction //=========================================================================== // Creates a 'Neutral Victim' player slot. This slot is passive towards all // other players, but all other players are aggressive towards him/her. -// +// function ConfigureNeutralVictim takes nothing returns nothing local integer index local player indexPlayer @@ -5642,6 +6186,10 @@ function CustomDefeatDialogBJ takes player whichPlayer, string message returns n call DialogSetMessage( d, message ) if bj_isSinglePlayer then + set t = CreateTrigger() + call TriggerRegisterDialogButtonEvent( t, DialogAddButton( d, GetLocalizedString( "GAMEOVER_LOAD" ), GetLocalizedHotkey("GAMEOVER_LOAD") ) ) + call TriggerAddAction( t, function CustomDefeatLoadBJ ) + set t = CreateTrigger() call TriggerRegisterDialogButtonEvent( t, DialogAddButton( d, GetLocalizedString( "GAMEOVER_RESTART" ), GetLocalizedHotkey("GAMEOVER_RESTART") ) ) call TriggerAddAction( t, function CustomDefeatRestartBJ ) @@ -5651,10 +6199,6 @@ function CustomDefeatDialogBJ takes player whichPlayer, string message returns n call TriggerRegisterDialogButtonEvent( t, DialogAddButton( d, GetLocalizedString( "GAMEOVER_REDUCE_DIFFICULTY" ), GetLocalizedHotkey("GAMEOVER_REDUCE_DIFFICULTY") ) ) call TriggerAddAction( t, function CustomDefeatReduceDifficultyBJ ) endif - - set t = CreateTrigger() - call TriggerRegisterDialogButtonEvent( t, DialogAddButton( d, GetLocalizedString( "GAMEOVER_LOAD" ), GetLocalizedHotkey("GAMEOVER_LOAD") ) ) - call TriggerAddAction( t, function CustomDefeatLoadBJ ) endif set t = CreateTrigger() @@ -6597,7 +7141,7 @@ function PingMinimapForForceEx takes force whichForce, real x, real y, real dura else // Unrecognized ping style - ignore the request. endif - + //call StartSound(bj_pingMinimapSound) endif endfunction @@ -6854,6 +7398,14 @@ function GetLastTransmissionDurationBJ takes nothing returns real return bj_lastTransmissionDuration endfunction +//=========================================================================== +function SetCameraBlockerForPlayerBJ takes rect r, boolean flag, player whichPlayer returns nothing + if (GetLocalPlayer() == whichPlayer) then + // Use only local code (no net traffic) within this block to avoid desyncs. + call EnableCameraBlocker(r,flag) + endif +endfunction + //=========================================================================== function ForceCinematicSubtitlesBJ takes boolean flag returns nothing call ForceCinematicSubtitles(flag) @@ -7238,6 +7790,10 @@ function SetCampaignMenuRaceBJ takes integer campaignNumber returns nothing call SetCampaignMenuRaceEx(bj_CAMPAIGN_OFFSET_XU) elseif (campaignNumber == bj_CAMPAIGN_INDEX_XO) then call SetCampaignMenuRaceEx(bj_CAMPAIGN_OFFSET_XO) + elseif (campaignNumber == bj_CAMPAIGN_INDEX_RH) then + call SetCampaignMenuRace(RACE_HUMAN) + elseif (campaignNumber == bj_CAMPAIGN_INDEX_RU) then + call SetCampaignMenuRace(RACE_UNDEAD) else // Unrecognized campaign - ignore the request endif @@ -7273,6 +7829,10 @@ function SetCampaignAvailableBJ takes boolean available, integer campaignNumber set campaignOffset = bj_CAMPAIGN_OFFSET_XU elseif (campaignNumber == bj_CAMPAIGN_INDEX_XO) then set campaignOffset = bj_CAMPAIGN_OFFSET_XO + elseif (campaignNumber == bj_CAMPAIGN_INDEX_RH) then + set campaignOffset = bj_CAMPAIGN_OFFSET_RH + elseif (campaignNumber == bj_CAMPAIGN_INDEX_RU) then + set campaignOffset = bj_CAMPAIGN_OFFSET_RU else set campaignOffset = campaignNumber endif @@ -7317,6 +7877,12 @@ function SetCinematicAvailableBJ takes boolean available, integer cinematicIndex elseif (cinematicIndex == bj_CINEMATICINDEX_XED) then call SetEdCinematicAvailable( bj_CAMPAIGN_OFFSET_XU, available ) call PlayCinematic( "OutroX" ) + elseif (cinematicIndex == bj_CINEMATICINDEX_HFO) then + call SetOpCinematicAvailable( bj_CAMPAIGN_OFFSET_RH, available ) + call PlayCinematic( "IntroRE" ) + elseif (cinematicIndex == bj_CINEMATICINDEX_UFE) then + call SetEdCinematicAvailable( bj_CAMPAIGN_INDEX_RU, available ) + call PlayCinematic( "OutroRE" ) else // Unrecognized cinematic - ignore the request. endif @@ -8375,6 +8941,7 @@ function MeleeStartingHeroLimit takes nothing returns nothing call ReducePlayerTechMaxAllowed(Player(index), 'Nalc', bj_MELEE_HERO_TYPE_LIMIT) call ReducePlayerTechMaxAllowed(Player(index), 'Ntin', bj_MELEE_HERO_TYPE_LIMIT) call ReducePlayerTechMaxAllowed(Player(index), 'Nfir', bj_MELEE_HERO_TYPE_LIMIT) + call ReducePlayerTechMaxAllowed(Player(index), 'Npal', bj_MELEE_HERO_TYPE_LIMIT) set index = index + 1 exitwhen index == bj_MAX_PLAYERS @@ -8483,7 +9050,7 @@ endfunction //=========================================================================== function MeleeClearNearbyUnits takes real x, real y, real range returns nothing local group nearbyUnits - + set nearbyUnits = CreateGroup() call GroupEnumUnitsInRange(nearbyUnits, x, y, range, null) call ForGroup(nearbyUnits, function MeleeClearExcessUnit) @@ -8645,7 +9212,7 @@ function MeleeStartingUnitsHuman takes player whichPlayer, location startLoc, bo if (nearestMine != null) then // Spawn Town Hall at the start location. set townHall = CreateUnitAtLoc(whichPlayer, 'htow', startLoc, bj_UNIT_FACING) - + // Spawn Peasants near the mine. set nearMineLoc = MeleeGetProjectedLoc(GetUnitLoc(nearestMine), startLoc, 320, 0) set peonX = GetLocationX(nearMineLoc) @@ -8661,7 +9228,7 @@ function MeleeStartingUnitsHuman takes player whichPlayer, location startLoc, bo else // Spawn Town Hall at the start location. set townHall = CreateUnitAtLoc(whichPlayer, 'htow', startLoc, bj_UNIT_FACING) - + // Spawn Peasants directly south of the town hall. set peonX = GetLocationX(startLoc) set peonY = GetLocationY(startLoc) - 224.00 @@ -8719,7 +9286,7 @@ function MeleeStartingUnitsOrc takes player whichPlayer, location startLoc, bool if (nearestMine != null) then // Spawn Great Hall at the start location. call CreateUnitAtLoc(whichPlayer, 'ogre', startLoc, bj_UNIT_FACING) - + // Spawn Peons near the mine. set nearMineLoc = MeleeGetProjectedLoc(GetUnitLoc(nearestMine), startLoc, 320, 0) set peonX = GetLocationX(nearMineLoc) @@ -8735,7 +9302,7 @@ function MeleeStartingUnitsOrc takes player whichPlayer, location startLoc, bool else // Spawn Great Hall at the start location. call CreateUnitAtLoc(whichPlayer, 'ogre', startLoc, bj_UNIT_FACING) - + // Spawn Peons directly south of the town hall. set peonX = GetLocationX(startLoc) set peonY = GetLocationY(startLoc) - 224.00 @@ -8794,7 +9361,7 @@ function MeleeStartingUnitsUndead takes player whichPlayer, location startLoc, b if (nearestMine != null) then // Spawn Necropolis at the start location. call CreateUnitAtLoc(whichPlayer, 'unpl', startLoc, bj_UNIT_FACING) - + // Replace the nearest gold mine with a blighted version. set nearestMine = BlightGoldMineForPlayerBJ(nearestMine, whichPlayer) @@ -8820,7 +9387,7 @@ function MeleeStartingUnitsUndead takes player whichPlayer, location startLoc, b else // Spawn Necropolis at the start location. call CreateUnitAtLoc(whichPlayer, 'unpl', startLoc, bj_UNIT_FACING) - + // Spawn Acolytes and Ghoul directly south of the Necropolis. set peonX = GetLocationX(startLoc) set peonY = GetLocationY(startLoc) - 224.00 @@ -8994,7 +9561,7 @@ function MeleeStartingUnits takes nothing returns nothing set index = index + 1 exitwhen index == bj_MAX_PLAYERS endloop - + endfunction //=========================================================================== @@ -9148,7 +9715,7 @@ function MeleeGetAllyStructureCount takes player whichPlayer returns integer if (PlayersAreCoAllied(whichPlayer, indexPlayer)) then set buildingCount = buildingCount + GetPlayerStructureCount(indexPlayer, true) endif - + set playerIndex = playerIndex + 1 exitwhen playerIndex == bj_MAX_PLAYERS endloop @@ -9199,7 +9766,7 @@ function MeleeGetAllyKeyStructureCount takes player whichPlayer returns integer if (PlayersAreCoAllied(whichPlayer, indexPlayer)) then set keyStructs = keyStructs + BlzGetPlayerTownHallCount(indexPlayer) endif - + set playerIndex = playerIndex + 1 exitwhen playerIndex == bj_MAX_PLAYERS endloop @@ -9265,7 +9832,7 @@ endfunction //=========================================================================== // Remove all observers -// +// function MeleeRemoveObservers takes nothing returns nothing local integer playerIndex local player indexPlayer @@ -9369,7 +9936,7 @@ function MeleeCheckForLosersAndVictors takes nothing returns nothing set bj_meleeDefeated[playerIndex] = true endif endif - + set playerIndex = playerIndex + 1 exitwhen playerIndex == bj_MAX_PLAYERS endloop @@ -9605,7 +10172,7 @@ function MeleeCheckForCrippledPlayers takes nothing returns nothing call MeleeExposePlayer(indexPlayer, false) endif - + set playerIndex = playerIndex + 1 exitwhen playerIndex == bj_MAX_PLAYERS endloop @@ -9692,7 +10259,7 @@ function MeleeTriggerActionPlayerLeft takes nothing returns nothing call CachePlayerHeroData(thePlayer) - // This is the same as defeat except the player generates the message + // This is the same as defeat except the player generates the message // "player left the game" as opposed to "player was defeated". if (MeleeGetAllyCount(thePlayer) > 0) then @@ -10494,7 +11061,7 @@ endfunction //* //* - RandomDistChoose will use the current distribution list to choose //* one of the objects randomly based on the chance distribution -//* +//* //* Note that the chances are effectively normalized by their sum, //* so only the relative values of each chance are important //* @@ -10736,7 +11303,7 @@ function BlzRemoveAbilityStringLevelArrayFieldBJ takes ability whichAbility, abi set bj_lastInstObjFuncSuccessful = BlzRemoveAbilityStringLevelArrayField(whichAbility, whichField, level, value) endfunction -// Item +// Item //============================================================= function BlzItemAddAbilityBJ takes item whichItem, integer abilCode returns nothing set bj_lastInstObjFuncSuccessful = BlzItemAddAbility(whichItem, abilCode) @@ -10768,7 +11335,7 @@ function BlzSetItemStringFieldBJ takes item whichItem, itemstringfield whichFiel endfunction -// Unit +// Unit //=========================================================================== function BlzSetUnitBooleanFieldBJ takes unit whichUnit, unitbooleanfield whichField, boolean value returns nothing set bj_lastInstObjFuncSuccessful = BlzSetUnitBooleanField(whichUnit, whichField, value) @@ -10809,3 +11376,8 @@ endfunction function BlzSetUnitWeaponStringFieldBJ takes unit whichUnit, unitweaponstringfield whichField, integer index, string value returns nothing set bj_lastInstObjFuncSuccessful = BlzSetUnitWeaponStringField(whichUnit, whichField, index, value) endfunction + +//=========================================================================== +function BlzEnableAuras takes unit whichUnit, boolean enable returns nothing + call BlzUnitEnableAuras(whichUnit, enable, false) +endfunction diff --git a/de.peeeq.wurstscript/src/main/resources/common.j b/de.peeeq.wurstscript/src/main/resources/common.j index e38c71b73..7d49d866b 100644 --- a/de.peeeq.wurstscript/src/main/resources/common.j +++ b/de.peeeq.wurstscript/src/main/resources/common.j @@ -99,12 +99,13 @@ type subanimtype extends handle type image extends handle type ubersplat extends handle type hashtable extends agent -type framehandle extends handle +type framehandle extends agent type originframetype extends handle type framepointtype extends handle type textaligntype extends handle type frameeventtype extends handle type oskeytype extends handle +type metakeytype extends handle type abilityintegerfield extends handle type abilityrealfield extends handle type abilitybooleanfield extends handle @@ -138,7 +139,10 @@ type regentype extends handle type unitcategory extends handle type pathingflag extends handle type commandbuttoneffect extends handle - +type fogstyle extends handle +type equipmentType extends handle +type itemTag extends handle +type loadoutslot extends handle constant native ConvertRace takes integer i returns race constant native ConvertAllianceType takes integer i returns alliancetype @@ -224,6 +228,10 @@ constant native ConvertDefenseType takes integer i returns constant native ConvertRegenType takes integer i returns regentype constant native ConvertUnitCategory takes integer i returns unitcategory constant native ConvertPathingFlag takes integer i returns pathingflag +constant native ConvertFogStyle takes integer i returns fogstyle +constant native ConvertEquipmentType takes integer i returns equipmentType +constant native ConvertItemTag takes integer i returns itemTag +constant native ConvertLoadoutSlot takes integer i returns loadoutslot constant native OrderId takes string orderIdString returns integer constant native OrderId2String takes integer orderId returns string @@ -282,6 +290,7 @@ globals constant playercolor PLAYER_COLOR_SNOW = ConvertPlayerColor(21) constant playercolor PLAYER_COLOR_EMERALD = ConvertPlayerColor(22) constant playercolor PLAYER_COLOR_PEANUT = ConvertPlayerColor(23) + constant playercolor PLAYER_COLOR_BLACK = ConvertPlayerColor(24) constant race RACE_HUMAN = ConvertRace(1) constant race RACE_ORC = ConvertRace(2) @@ -454,6 +463,7 @@ globals constant racepreference RACE_PREF_DEMON = ConvertRacePref(16) constant racepreference RACE_PREF_RANDOM = ConvertRacePref(32) constant racepreference RACE_PREF_USER_SELECTABLE = ConvertRacePref(64) + constant racepreference RACE_PREF_FORSAKEN = ConvertRacePref(128) constant mapcontrol MAP_CONTROL_USER = ConvertMapControl(0) constant mapcontrol MAP_CONTROL_COMPUTER = ConvertMapControl(1) @@ -526,6 +536,13 @@ globals constant playerslotstate PLAYER_SLOT_STATE_PLAYING = ConvertPlayerSlotState(1) constant playerslotstate PLAYER_SLOT_STATE_LEFT = ConvertPlayerSlotState(2) + constant fogstyle FOG_STYLE_LINEAR = ConvertFogStyle(0) + constant fogstyle FOG_STYLE_EXP = ConvertFogStyle(1) + constant fogstyle FOG_STYLE_EXP2 = ConvertFogStyle(2) + constant fogstyle FOG_STYLE_HEIGHT = ConvertFogStyle(3) + constant fogstyle FOG_STYLE_NEW_EXP = ConvertFogStyle(4) + constant fogstyle FOG_STYLE_NEW_EXP_2 = ConvertFogStyle(5) + //=================================================== // Sound Constants //=================================================== @@ -839,6 +856,8 @@ globals constant playerunitevent EVENT_PLAYER_UNIT_SPELL_ENDCAST = ConvertPlayerUnitEvent(276) constant playerunitevent EVENT_PLAYER_UNIT_PAWN_ITEM = ConvertPlayerUnitEvent(277) constant playerunitevent EVENT_PLAYER_UNIT_STACK_ITEM = ConvertPlayerUnitEvent(319) + constant playerunitevent EVENT_PLAYER_UNIT_EQUIP_ITEM = ConvertPlayerUnitEvent(321) + constant playerunitevent EVENT_PLAYER_UNIT_UNEQUIP_ITEM = ConvertPlayerUnitEvent(323) //=================================================== // For use with TriggerRegisterUnitEvent @@ -854,6 +873,8 @@ globals constant unitevent EVENT_UNIT_SPELL_ENDCAST = ConvertUnitEvent(293) constant unitevent EVENT_UNIT_PAWN_ITEM = ConvertUnitEvent(294) constant unitevent EVENT_UNIT_STACK_ITEM = ConvertUnitEvent(318) + constant unitevent EVENT_UNIT_EQUIP_ITEM = ConvertUnitEvent(320) + constant unitevent EVENT_UNIT_UNEQUIP_ITEM = ConvertUnitEvent(322) //=================================================== // Limit Event API constants @@ -916,12 +937,56 @@ globals constant itemtype ITEM_TYPE_PURCHASABLE = ConvertItemType(4) constant itemtype ITEM_TYPE_CAMPAIGN = ConvertItemType(5) constant itemtype ITEM_TYPE_MISCELLANEOUS = ConvertItemType(6) - constant itemtype ITEM_TYPE_UNKNOWN = ConvertItemType(7) - constant itemtype ITEM_TYPE_ANY = ConvertItemType(8) + constant itemtype ITEM_TYPE_EQUIPMENT = ConvertItemType(7) + constant itemtype ITEM_TYPE_UNKNOWN = ConvertItemType(8) + constant itemtype ITEM_TYPE_ANY = ConvertItemType(9) // Deprecated, should use ITEM_TYPE_POWERUP constant itemtype ITEM_TYPE_TOME = ConvertItemType(2) +//=================================================== +// Item Equipment Type Constants for use with ChooseRandomItemExWithFilter() +//=================================================== + + constant equipmentType EQUIPMENT_TYPE_NONE = ConvertEquipmentType(0) + constant equipmentType EQUIPMENT_TYPE_HEAD = ConvertEquipmentType(1) + constant equipmentType EQUIPMENT_TYPE_CHEST = ConvertEquipmentType(2) + constant equipmentType EQUIPMENT_TYPE_GLOVES = ConvertEquipmentType(3) + constant equipmentType EQUIPMENT_TYPE_BOOTS = ConvertEquipmentType(4) + constant equipmentType EQUIPMENT_TYPE_RING = ConvertEquipmentType(5) + constant equipmentType EQUIPMENT_TYPE_PRIMARY = ConvertEquipmentType(6) + constant equipmentType EQUIPMENT_TYPE_OFFHAND = ConvertEquipmentType(7) + constant equipmentType EQUIPMENT_TYPE_TRINKET = ConvertEquipmentType(8) + constant equipmentType EQUIPMENT_TYPE_ANY = ConvertEquipmentType(9) + +//=================================================== +// Item Tag Type Constants for use with ChooseRandomItemExWithFilter() +//=================================================== + + constant itemTag ITEMTAG_TYPE_UNDEFINED = ConvertItemTag(0) + constant itemTag ITEMTAG_TYPE_DROPPABLE = ConvertItemTag(1) + constant itemTag ITEMTAG_TYPE_QUESTREWARD = ConvertItemTag(2) + constant itemTag ITEMTAG_TYPE_BOSSDROP = ConvertItemTag(3) + constant itemTag ITEMTAG_TYPE_SECRET = ConvertItemTag(4) + constant itemTag ITEMTAG_TYPE_PUZZLE = ConvertItemTag(5) + constant itemTag ITEMTAG_TYPE_WORLD = ConvertItemTag(6) + constant itemTag ITEMTAG_TYPE_SHOP = ConvertItemTag(7) + constant itemTag ITEMTAG_TYPE_ANY = ConvertItemTag(8) + +//=================================================== +// Equipment slot constants +//=================================================== + + constant loadoutslot EQUIPMENT_LOADOUT_SLOT_HEAD = ConvertLoadoutSlot(0) + constant loadoutslot EQUIPMENT_LOADOUT_SLOT_CHEST = ConvertLoadoutSlot(1) + constant loadoutslot EQUIPMENT_LOADOUT_SLOT_GLOVES = ConvertLoadoutSlot(2) + constant loadoutslot EQUIPMENT_LOADOUT_SLOT_BOOTS = ConvertLoadoutSlot(3) + constant loadoutslot EQUIPMENT_LOADOUT_SLOT_RING = ConvertLoadoutSlot(4) + constant loadoutslot EQUIPMENT_LOADOUT_SLOT_RINGALT = ConvertLoadoutSlot(5) + constant loadoutslot EQUIPMENT_LOADOUT_SLOT_PRIMARY = ConvertLoadoutSlot(6) + constant loadoutslot EQUIPMENT_LOADOUT_SLOT_OFFHAND = ConvertLoadoutSlot(7) + constant loadoutslot EQUIPMENT_LOADOUT_SLOT_TRINKET = ConvertLoadoutSlot(8) + //=================================================== // Animatable Camera Fields //=================================================== @@ -937,6 +1002,9 @@ globals constant camerafield CAMERA_FIELD_LOCAL_PITCH = ConvertCameraField(8) constant camerafield CAMERA_FIELD_LOCAL_YAW = ConvertCameraField(9) constant camerafield CAMERA_FIELD_LOCAL_ROLL = ConvertCameraField(10) + constant camerafield CAMERA_FIELD_DEPTH_OF_FIELD_DISTANCE = ConvertCameraField(11) + constant camerafield CAMERA_FIELD_DEPTH_OF_FIELD_SCALE = ConvertCameraField(12) + constant camerafield CAMERA_FIELD_ZABSOLUTE = ConvertCameraField(13) constant blendmode BLEND_MODE_NONE = ConvertBlendMode(0) constant blendmode BLEND_MODE_DONT_CARE = ConvertBlendMode(0) @@ -1238,6 +1306,15 @@ globals constant oskeytype OSKEY_PA1 = ConvertOsKeyType($FD) constant oskeytype OSKEY_OEM_CLEAR = ConvertOsKeyType($FE) +//=================================================== +// Meta Key constants +//=================================================== + constant integer METAKEY_NONE = 0 + constant integer METAKEY_SHIFT = 1 + constant integer METAKEY_CTRL = 2 + constant integer METAKEY_ALT = 4 + constant integer METAKEY_WINKEYS = 8 + //=================================================== // Instanced Object Operation API constants //=================================================== @@ -2084,6 +2161,8 @@ globals constant unitbooleanfield UNIT_BF_SCALE_PROJECTILES = ConvertUnitBooleanField('uscb') constant unitbooleanfield UNIT_BF_SELECTION_CIRCLE_ON_WATER = ConvertUnitBooleanField('usew') constant unitbooleanfield UNIT_BF_HAS_WATER_SHADOW = ConvertUnitBooleanField('ushr') + constant unitbooleanfield UNIT_BF_SHOW_AIR_TO_GROUND = ConvertUnitBooleanField('uatg') + constant unitbooleanfield UNIT_BF_FORCE_DISPLAY_HP = ConvertUnitBooleanField('ufhp') constant unitstringfield UNIT_SF_NAME = ConvertUnitStringField('unam') constant unitstringfield UNIT_SF_PROPER_NAMES = ConvertUnitStringField('upro') @@ -2307,6 +2386,7 @@ native SetPlayerColor takes player whichPlayer, playercolor color retu native SetPlayerAlliance takes player sourcePlayer, player otherPlayer, alliancetype whichAllianceSetting, boolean value returns nothing native SetPlayerTaxRate takes player sourcePlayer, player otherPlayer, playerstate whichResource, integer rate returns nothing native SetPlayerRacePreference takes player whichPlayer, racepreference whichRacePreference returns nothing +native SetPlayerRaceSkin takes player whichPlayer, racepreference whichRacePreference returns nothing native SetPlayerRaceSelectable takes player whichPlayer, boolean value returns nothing native SetPlayerController takes player whichPlayer, mapcontrol controlType returns nothing native SetPlayerName takes player whichPlayer, string name returns nothing @@ -2645,6 +2725,12 @@ constant native GetChangingUnitPrevOwner takes nothing returns player constant native GetManipulatingUnit takes nothing returns unit constant native GetManipulatedItem takes nothing returns item +// EVENT_PLAYER_UNIT_EQUIP_ITEM +constant native GetEquippedItem takes nothing returns item + +// EVENT_PLAYER_UNIT_UNEQUIP_ITEM +constant native GetUnequippedItem takes nothing returns item + // For EVENT_PLAYER_UNIT_PICKUP_ITEM, returns the item absorbing the picked up item in case it is stacking. // Returns null if the item was a powerup and not a stacking item. constant native BlzGetAbsorbingItem takes nothing returns item @@ -2794,6 +2880,8 @@ native TriggerExecute takes trigger whichTrigger returns nothing native TriggerExecuteWait takes trigger whichTrigger returns nothing native TriggerSyncStart takes nothing returns nothing native TriggerSyncReady takes nothing returns nothing +native BlzTriggerIsRunning takes trigger whichTrigger returns boolean +native BlzTriggerInterrupt takes trigger whichTrigger returns nothing //============================================================================ // Widget API @@ -2826,6 +2914,7 @@ native DestructableRestoreLife takes destructable d, real life, boo native QueueDestructableAnimation takes destructable d, string whichAnimation returns nothing native SetDestructableAnimation takes destructable d, string whichAnimation returns nothing native SetDestructableAnimationSpeed takes destructable d, real speedFactor returns nothing +native SetDestructableColor takes destructable d, playercolor color returns nothing native ShowDestructable takes destructable d, boolean flag returns nothing native GetDestructableOccluderHeight takes destructable d returns real native SetDestructableOccluderHeight takes destructable d, real height returns nothing @@ -2841,12 +2930,15 @@ native GetItemTypeId takes item i returns integer native GetItemX takes item i returns real native GetItemY takes item i returns real native SetItemPosition takes item i, real x, real y returns nothing +native SetItemColor takes item whichItem, playercolor whichColor returns nothing native SetItemDropOnDeath takes item whichItem, boolean flag returns nothing native SetItemDroppable takes item i, boolean flag returns nothing native SetItemPawnable takes item i, boolean flag returns nothing native SetItemPlayer takes item whichItem, player whichPlayer, boolean changeColor returns nothing native SetItemInvulnerable takes item whichItem, boolean flag returns nothing native IsItemInvulnerable takes item whichItem returns boolean +native IsItemEquipped takes item whichItem returns boolean +native IsItemInBag takes item whichItem returns boolean native SetItemVisible takes item whichItem, boolean show returns nothing native IsItemVisible takes item whichItem returns boolean native IsItemOwned takes item whichItem returns boolean @@ -2865,6 +2957,8 @@ native GetItemCharges takes item whichItem returns integer native SetItemCharges takes item whichItem, integer charges returns nothing native GetItemUserData takes item whichItem returns integer native SetItemUserData takes item whichItem, integer data returns nothing +native GetItemEquipmentType takes item whichItem returns equipmentType +native GetItemTag takes item whichItem returns itemTag //============================================================================ // Unit API @@ -2916,6 +3010,12 @@ native SetUnitAnimation takes unit whichUnit, string whichAn native SetUnitAnimationByIndex takes unit whichUnit, integer whichAnimation returns nothing native SetUnitAnimationWithRarity takes unit whichUnit, string whichAnimation, raritycontrol rarity returns nothing native AddUnitAnimationProperties takes unit whichUnit, string animProperties, boolean add returns nothing +native AllowHeroGlowOnUnit takes unit whichUnit returns nothing +native DisallowHeroGlowOnUnit takes unit whichUnit returns nothing +native HeroGlowIsAllowedOnUnit takes unit whichUnit returns boolean + +native BlzGetUnitAnimationDuration takes unit whichUnit, string whichAnimation returns real +native BlzGetUnitAnimationDurationByIndex takes unit whichUnit, integer index returns real native SetUnitLookAt takes unit whichUnit, string whichBone, unit lookAtTarget, real offsetX, real offsetY, real offsetZ returns nothing native ResetUnitLookAt takes unit whichUnit returns nothing @@ -2967,13 +3067,26 @@ native GetUnitPointValueByType takes integer unitType returns integer //native SetUnitPointValueByType takes integer unitType, integer newPointValue returns nothing native UnitAddItem takes unit whichUnit, item whichItem returns boolean +native UnitEquipItem takes unit whichUnit, item whichItem returns boolean native UnitAddItemById takes unit whichUnit, integer itemId returns item native UnitAddItemToSlotById takes unit whichUnit, integer itemId, integer itemSlot returns boolean native UnitRemoveItem takes unit whichUnit, item whichItem returns nothing native UnitRemoveItemFromSlot takes unit whichUnit, integer itemSlot returns item +native UnitUnequipItem takes unit whichUnit, item whichItem returns nothing +native UnitUnequipItemFromSlot takes unit whichUnit, loadoutslot slot returns item native UnitHasItem takes unit whichUnit, item whichItem returns boolean +native UnitHasItemBagged takes unit whichUnit, item whichItem returns boolean native UnitItemInSlot takes unit whichUnit, integer itemSlot returns item native UnitInventorySize takes unit whichUnit returns integer +native UnitExtendedInventorySize takes unit whichUnit returns integer + +native UnitItemInBagSlot takes unit whichUnit, integer itemSlot returns item +native UnitItemInEquipmentSlot takes unit whichUnit, loadoutslot itemSlot returns item +native UnitHasItemEquipped takes unit whichUnit, item whichItem returns boolean +native UnitHasLoadoutSlotEmpty takes unit whichUnit, loadoutslot itemSlot returns boolean +native UnitHasAnyItemEquiped takes unit whichUnit returns boolean +native UnitHasItemEquipmentOfType takes unit whichUnit, equipmentType equipmentId returns boolean +native UnitCanEquipItemOfEquipmentType takes unit whichUnit, equipmentType equipmentId returns boolean native UnitDropItemPoint takes unit whichUnit, item whichItem, real x, real y returns boolean native UnitDropItemSlot takes unit whichUnit, item whichItem, integer slot returns boolean @@ -3410,6 +3523,7 @@ native ChooseRandomCreep takes integer level returns integer native ChooseRandomNPBuilding takes nothing returns integer native ChooseRandomItem takes integer level returns integer native ChooseRandomItemEx takes itemtype whichType, integer level returns integer +native ChooseRandomItemExWithFilter takes itemtype whichType, integer level, equipmentType whichEquipmentType, itemTag whichTag returns integer native SetRandomSeed takes integer seed returns nothing //============================================================================ @@ -3419,6 +3533,18 @@ native ResetTerrainFog takes nothing returns nothing native SetUnitFog takes real a, real b, real c, real d, real e returns nothing native SetTerrainFogEx takes integer style, real zstart, real zend, real density, real red, real green, real blue returns nothing +native SetTerrainFogExV takes integer style, real zstart, real zend, real density, real heightStart, real heightEnd, real linearStart, real linearEnd, real red, real green, real blue returns nothing +native BlzSetTerrainFogStyle takes fogstyle style returns nothing +native BlzSetTerrainFogZStart takes real zStart returns nothing +native BlzSetTerrainFogZEnd takes real ZEnd returns nothing +native BlzSetTerrainFogDensity takes real density returns nothing +native BlzSetTerrainFogHeightStart takes real heightStart returns nothing +native BlzSetTerrainFogHeightEnd takes real heightEnd returns nothing +native BlzSetTerrainFogLinearStart takes real linearStart returns nothing +native BlzSetTerrainFogLinearEnd takes real linearEnd returns nothing +native BlzSetTerrainFogMaxLinearDensity takes real maxLinearDensity returns nothing +native BlzSetTerrainFogDrawOverSky takes boolean drawOverSky returns nothing +native BlzSetTerrainFogColor takes real red, real green, real blue returns nothing native DisplayTextToPlayer takes player toPlayer, real x, real y, string message returns nothing native DisplayTimedTextToPlayer takes player toPlayer, real x, real y, real duration, string message returns nothing native DisplayTimedTextFromPlayer takes player toPlayer, real x, real y, real duration, string message returns nothing @@ -3449,6 +3575,14 @@ native SetIntroShotText takes string introText returns nothing native SetIntroShotModel takes string introModelPath returns nothing native EnableWorldFogBoundary takes boolean b returns nothing native PlayModelCinematic takes string modelName returns nothing +native BlzPreloadModelCinematicGame takes string modelName returns boolean +native BlzGetModelCinematicGameShotCount takes nothing returns integer +native BlzGetModelCinematicGameCurrentShot takes nothing returns integer +native BlzGetModelCinematicGameRemainingTime takes nothing returns real +native BlzPlayModelCinematicGameAtPosition takes string modelName, real posX, real posY, real posZ, real RotZ returns nothing +native BlzSetCinematicEnabledDE takes boolean enable returns nothing +native BlzSetMinShadowCastingPointLightCount takes integer count returns nothing +native BlzGetMinShadowCastingPointLightCount takes nothing returns integer native PlayCinematic takes string movieName returns nothing native ForceUIKey takes string key returns nothing native ForceUICancel takes nothing returns nothing @@ -3632,8 +3766,12 @@ native SetCinematicCamera takes string cameraModelFile returns nothing native SetCameraRotateMode takes real x, real y, real radiansToSweep, real duration returns nothing native SetCameraField takes camerafield whichField, real value, real duration returns nothing native AdjustCameraField takes camerafield whichField, real offset, real duration returns nothing +native SetCameraFieldControlledByInput takes camerafield whichField, boolean controlled returns nothing +native GetCameraFieldControlledByInput takes camerafield whichField returns boolean native SetCameraTargetController takes unit whichUnit, real xoffset, real yoffset, boolean inheritOrientation returns nothing native SetCameraOrientController takes unit whichUnit, real xoffset, real yoffset returns nothing +native BlzCameraSetCameraType takes integer cameraType returns nothing +native BlzCameraGetCameraType takes nothing returns integer native CreateCameraSetup takes nothing returns camerasetup native CameraSetupSetField takes camerasetup whichSetup, camerafield whichField, real value, real duration returns nothing @@ -3648,6 +3786,8 @@ native CameraSetupApplyForceDuration takes camerasetup whichSetup, boolea native CameraSetupApplyForceDurationWithZ takes camerasetup whichSetup, real zDestOffset, real forceDuration returns nothing native BlzCameraSetupSetLabel takes camerasetup whichSetup, string label returns nothing native BlzCameraSetupGetLabel takes camerasetup whichSetup returns string +native BlzCameraSetupSetCameraType takes camerasetup whichSetup, integer cameraType returns nothing +native BlzCameraSetupGetCameraType takes camerasetup whichSetup returns integer native CameraSetTargetNoise takes real mag, real velocity returns nothing native CameraSetSourceNoise takes real mag, real velocity returns nothing @@ -3678,6 +3818,9 @@ native SetCinematicAudio takes boolean cinematicAudio returns not native GetCameraMargin takes integer whichMargin returns real +native EnableCameraBlocker takes rect r, boolean flag returns nothing +native AddCameraBlocker takes rect where returns nothing + // These return values for the local players camera only... constant native GetCameraBoundMinX takes nothing returns real constant native GetCameraBoundMinY takes nothing returns real @@ -3736,6 +3879,7 @@ native ResumeMusic takes nothing returns nothing native PlayThematicMusic takes string musicFileName returns nothing native PlayThematicMusicEx takes string musicFileName, integer frommsecs returns nothing +native BlzPauseThematicMusicOnFocusLost takes boolean pause returns nothing native EndThematicMusic takes nothing returns nothing native SetMusicVolume takes integer volume returns nothing @@ -3812,14 +3956,27 @@ native GetAbilitySoundById takes integer abilityId, soundtype t returns //============================================================================ // Terrain API // -native GetTerrainCliffLevel takes real x, real y returns integer -native SetWaterBaseColor takes integer red, integer green, integer blue, integer alpha returns nothing -native SetWaterDeforms takes boolean val returns nothing -native GetTerrainType takes real x, real y returns integer -native GetTerrainVariance takes real x, real y returns integer -native SetTerrainType takes real x, real y, integer terrainType, integer variation, integer area, integer shape returns nothing -native IsTerrainPathable takes real x, real y, pathingtype t returns boolean -native SetTerrainPathable takes real x, real y, pathingtype t, boolean flag returns nothing +native GetTerrainCliffLevel takes real x, real y returns integer +native SetWaterBaseColor takes integer red, integer green, integer blue, integer alpha returns nothing +native SetHDWaterParams takes integer red, integer green, integer blue, boolean useColor, integer vertexDisplacement, integer minOpacity, integer maxOpacity, integer reflectivity, integer emissivity, integer edgeSoftness, integer waveStrength returns nothing +native SetHDWaterParamsEx takes integer red, integer green, integer blue, boolean override, integer vertexDisplacement, integer minOpacity, integer maxOpacity, integer reflectivity, integer emissivity, integer edgeSoftness, integer waveStrength, integer envMapStrength returns nothing +native BlzSetHDWaterColor takes integer red, integer green, integer blue returns nothing +native BlzSetHDWaterColorOverride takes boolean override returns nothing +native BlzSetHDWaterVertexDisplacement takes integer vertexDisplacement returns nothing +native BlzSetHDWaterMinOpacity takes integer minOpacity returns nothing +native BlzSetHDWaterMaxOpacity takes integer maxOpacity returns nothing +native BlzSetHDWaterReflectivity takes integer reflectivity returns nothing +native BlzSetHDWaterEmissivity takes integer emissivity returns nothing +native BlzSetHDWaterEdgeSoftness takes integer edgeSoftness returns nothing +native BlzSetHDWaterWaveStrength takes integer waveStrength returns nothing +native BlzSetHDWaterEnvMapStrength takes integer envMapStrengthy returns nothing +native SetWaterDeforms takes boolean val returns nothing +native GetTerrainType takes real x, real y returns integer +native GetTerrainVariance takes real x, real y returns integer +native SetTerrainType takes real x, real y, integer terrainType, integer variation, integer area, integer shape returns nothing +native IsTerrainPathable takes real x, real y, pathingtype t returns boolean +native BlzIsTerrainPathableEx takes real x, real y, pathingtype t returns boolean +native SetTerrainPathable takes real x, real y, pathingtype t, boolean flag returns nothing //============================================================================ // Image API @@ -3859,8 +4016,25 @@ native IsPointBlighted takes real x, real y returns boolean //============================================================================ // Doodad API // -native SetDoodadAnimation takes real x, real y, real radius, integer doodadID, boolean nearestOnly, string animName, boolean animRandom returns nothing -native SetDoodadAnimationRect takes rect r, integer doodadID, string animName, boolean animRandom returns nothing +native SetDoodadAnimation takes real x, real y, real radius, integer doodadID, boolean nearestOnly, string animName, boolean animRandom returns nothing +native SetDoodadAnimationRect takes rect r, integer doodadID, string animName, boolean animRandom returns nothing +native BlzSetSingleDoodadAnimation takes integer index, string animName, boolean animRandom returns nothing +native SetDoodadColor takes real x, real y, real radius, integer doodadID, boolean nearestOnly, playercolor whichColor returns nothing +native SetDoodadColorRect takes rect r, integer doodadID, playercolor whichColor returns nothing +native BlzSetSingleDoodadColor takes integer index, playercolor whichColor returns nothing +native BlzGetDoodadX takes integer index returns real +native BlzGetDoodadY takes integer index returns real +native BlzGetDoodadZ takes integer index returns real +native BlzGetDoodadScaleX takes integer index returns real +native BlzGetDoodadScaleY takes integer index returns real +native BlzGetDoodadScaleZ takes integer index returns real +native BlzGetDoodadIsUsingModelAxes takes integer index returns boolean +native BlzGetDoodadYaw takes integer index returns real +native BlzGetDoodadPitch takes integer index returns real +native BlzGetDoodadRoll takes integer index returns real +native BlzGetDoodadVariation takes integer index returns integer +native BlzGetDoodadId takes integer index returns integer +native BlzGetNumDoodads takes nothing returns integer //============================================================================ // Computer AI interface @@ -3957,6 +4131,7 @@ native BlzGetUnitDiceSides takes unit whichUnit, integer native BlzSetUnitDiceSides takes unit whichUnit, integer diceSides, integer weaponIndex returns nothing native BlzGetUnitAttackCooldown takes unit whichUnit, integer weaponIndex returns real native BlzSetUnitAttackCooldown takes unit whichUnit, real cooldown, integer weaponIndex returns nothing +native BlzResetUnitAttack takes unit whichUnit, integer weaponIndex returns nothing native BlzSetSpecialEffectColorByPlayer takes effect whichEffect, player whichPlayer returns nothing native BlzSetSpecialEffectColor takes effect whichEffect, integer r, integer g, integer b returns nothing native BlzSetSpecialEffectAlpha takes effect whichEffect, integer alpha returns nothing @@ -3981,11 +4156,15 @@ native BlzSpecialEffectRemoveSubAnimation takes effect whichEffect, sub native BlzSpecialEffectAddSubAnimation takes effect whichEffect, subanimtype whichSubAnim returns nothing native BlzPlaySpecialEffect takes effect whichEffect, animtype whichAnim returns nothing native BlzPlaySpecialEffectWithTimeScale takes effect whichEffect, animtype whichAnim, real timeScale returns nothing +native BlzSetSpecialEffectAnimationBlendTime takes effect whichEffect, real blendTime returns nothing +native BlzQueueSpecialEffectAnimation takes effect whichEffect, string whichAnimation returns nothing +native BlzSetSpecialEffectAnimation takes effect whichEffect, string whichAnimation returns nothing native BlzGetAnimName takes animtype whichAnim returns string native BlzGetUnitArmor takes unit whichUnit returns real native BlzSetUnitArmor takes unit whichUnit, real armorAmount returns nothing native BlzUnitHideAbility takes unit whichUnit, integer abilId, boolean flag returns nothing native BlzUnitDisableAbility takes unit whichUnit, integer abilId, boolean flag, boolean hideUI returns nothing +native BlzUnitEnableAuras takes unit whichUnit, boolean enable, boolean affectsUI returns nothing native BlzUnitCancelTimedLife takes unit whichUnit returns nothing native BlzIsUnitSelectable takes unit whichUnit returns boolean native BlzIsUnitInvulnerable takes unit whichUnit returns boolean @@ -3996,6 +4175,11 @@ native BlzGetAbilityCooldown takes integer abilId, integer native BlzSetUnitAbilityCooldown takes unit whichUnit, integer abilId, integer level, real cooldown returns nothing native BlzGetUnitAbilityCooldown takes unit whichUnit, integer abilId, integer level returns real native BlzGetUnitAbilityCooldownRemaining takes unit whichUnit, integer abilId returns real +native BlzGetUnitAbilityCooldownPercent takes unit whichUnit, integer abilId returns real +native BlzSetUnitAbilityCooldownRemaining takes unit whichUnit, integer abilId, real duration returns nothing +native BlzSetUnitAbilityCooldownPercent takes unit whichUnit, integer abilId, real percent returns nothing +native BlzAdjustUnitAbilityCooldownRemaining takes unit whichUnit, integer abilId, real duration returns nothing +native BlzAdjustUnitAbilityCooldownPercent takes unit whichUnit, integer abilId, real percent returns nothing native BlzEndUnitAbilityCooldown takes unit whichUnit, integer abilCode returns nothing native BlzStartUnitAbilityCooldown takes unit whichUnit, integer abilCode, real cooldown returns nothing native BlzGetUnitAbilityManaCost takes unit whichUnit, integer abilId, integer level returns integer @@ -4062,6 +4246,7 @@ native BlzFrameSetTooltip takes framehandle frame, fram native BlzFrameCageMouse takes framehandle frame, boolean enable returns nothing native BlzFrameSetValue takes framehandle frame, real value returns nothing native BlzFrameGetValue takes framehandle frame returns real +native BlzTextAreaFrameSetAutoScroll takes framehandle frame, boolean value returns nothing native BlzFrameSetMinMaxValue takes framehandle frame, real minValue, real maxValue returns nothing native BlzFrameSetStepSize takes framehandle frame, real stepSize returns nothing native BlzFrameSetSize takes framehandle frame, real width, real height returns nothing @@ -4088,12 +4273,21 @@ native BlzTriggerRegisterPlayerKeyEvent takes trigger whichTrigger, p native BlzGetTriggerPlayerKey takes nothing returns oskeytype native BlzGetTriggerPlayerMetaKey takes nothing returns integer native BlzGetTriggerPlayerIsKeyDown takes nothing returns boolean +native BlzIsMetaKeyPressed takes integer metakey returns boolean +native BlzIsKeyPressed takes oskeytype key returns boolean +native BlzIsMouseButtonPressed takes mousebuttontype mouseButtonType returns boolean +native BlzGetMouseScreenPosX takes nothing returns integer +native BlzGetMouseScreenPosY takes nothing returns integer native BlzEnableCursor takes boolean enable returns nothing native BlzSetMousePos takes integer x, integer y returns nothing native BlzGetLocalClientWidth takes nothing returns integer native BlzGetLocalClientHeight takes nothing returns integer native BlzIsLocalClientActive takes nothing returns boolean native BlzGetMouseFocusUnit takes nothing returns unit +native BlzPixelToFrameX takes integer pixelX returns real +native BlzPixelToFrameY takes integer pixelY returns real +native BlzFrameToPixelX takes real frameX returns integer +native BlzFrameToPixelY takes real frameY returns integer native BlzChangeMinimapTerrainTex takes string texFile returns boolean native BlzGetLocale takes nothing returns string native BlzGetSpecialEffectScale takes effect whichEffect returns real @@ -4218,4 +4412,32 @@ native BlzGetUnitOrderCount takes unit whichUnit returns integer // clears either all orders or only queued up orders native BlzUnitClearOrders takes unit whichUnit, boolean onlyQueued returns nothing // stops the current order and optionally clears the queue -native BlzUnitForceStopOrder takes unit whichUnit, boolean clearQueue returns nothing \ No newline at end of file +native BlzUnitForceStopOrder takes unit whichUnit, boolean clearQueue returns nothing + +native BlzCreateDestructablePitchRoll takes integer objectid, real x, real y, real face, real roll, real pitch, real scale, integer variation returns destructable +native BlzCreateDestructableZPitchRoll takes integer objectid, real x, real y, real z, real face, real roll, real pitch, real scale, integer variation returns destructable +native BlzCreateDeadDestructablePitchRoll takes integer objectid, real x, real y, real face, real roll, real pitch, real scale, integer variation returns destructable +native BlzCreateDeadDestructableZPitchRoll takes integer objectid, real x, real y, real z, real face, real roll, real pitch, real scale, integer variation returns destructable +native BlzCreateDestructableWithSkinPitchRoll takes integer objectid, real x, real y, real face, real roll, real pitch, real scale, integer variation, integer skinId returns destructable +native BlzCreateDestructableZWithSkinPitchRoll takes integer objectid, real x, real y, real z, real face, real roll, real pitch, real scale, integer variation, integer skinId returns destructable +native BlzCreateDeadDestructableWithSkinPitchRoll takes integer objectid, real x, real y, real face, real roll, real pitch, real scale, integer variation, integer skinId returns destructable +native BlzCreateDeadDestructableZWithSkinPitchRoll takes integer objectid, real x, real y, real z, real face, real roll, real pitch, real scale, integer variation, integer skinId returns destructable + +native BlzCreateDestructableWithColor takes integer objectid, real x, real y, real face, real scale, integer variation, playercolor color returns destructable +native BlzCreateDestructableZWithColor takes integer objectid, real x, real y, real z, real face, real scale, integer variation, playercolor color returns destructable +native BlzCreateDeadDestructableWithColor takes integer objectid, real x, real y, real face, real scale, integer variation, playercolor color returns destructable +native BlzCreateDeadDestructableZWithColor takes integer objectid, real x, real y, real z, real face, real scale, integer variation, playercolor color returns destructable +native BlzCreateDestructableWithSkinColor takes integer objectid, real x, real y, real face, real scale, integer variation, integer skinId, playercolor color returns destructable +native BlzCreateDestructableZWithSkinColor takes integer objectid, real x, real y, real z, real face, real scale, integer variation, integer skinId, playercolor color returns destructable +native BlzCreateDeadDestructableWithSkinColor takes integer objectid, real x, real y, real face, real scale, integer variation, integer skinId, playercolor color returns destructable +native BlzCreateDeadDestructableZWithSkinColor takes integer objectid, real x, real y, real z, real face, real scale, integer variation, integer skinId, playercolor color returns destructable +native BlzCreateDestructablePitchRollWithColor takes integer objectid, real x, real y, real face, real roll, real pitch, real scale, integer variation, playercolor color returns destructable +native BlzCreateDestructableZPitchRollWithColor takes integer objectid, real x, real y, real z, real face, real roll, real pitch, real scale, integer variation, playercolor color returns destructable +native BlzCreateDeadDestructablePitchRollWithColor takes integer objectid, real x, real y, real face, real roll, real pitch, real scale, integer variation, playercolor color returns destructable +native BlzCreateDeadDestructableZPitchRollWithColor takes integer objectid, real x, real y, real z, real face, real roll, real pitch, real scale, integer variation, playercolor color returns destructable +native BlzCreateDestructableWithSkinPitchRollColor takes integer objectid, real x, real y, real face, real roll, real pitch, real scale, integer variation, integer skinId, playercolor color returns destructable +native BlzCreateDestructableZWithSkinPitchRollColor takes integer objectid, real x, real y, real z, real face, real roll, real pitch, real scale, integer variation, integer skinId, playercolor color returns destructable +native BlzCreateDeadDestructableWithSkinPitchRollColor takes integer objectid, real x, real y, real face, real roll, real pitch, real scale, integer variation, integer skinId, playercolor color returns destructable +native BlzCreateDeadDestructableZWithSkinPitchRollColor takes integer objectid, real x, real y, real z, real face, real roll, real pitch, real scale, integer variation, integer skinId, playercolor color returns destructable + +native SetDestructableVertexColor takes destructable whichDestructable, integer red, integer green, integer blue, integer alpha returns nothing \ No newline at end of file