| 12-17-2003, 05:23 PM | #1 |
New functions are listed in the new patch data, but theres also a very likely possibility that many more functions are still hidden. Anyone want to compare jass function sets line for line? |
| 12-17-2003, 06:08 PM | #2 |
Oh what the heck. native UnitMakeAbilityPermanent takes unit whichUnit, boolean permanent, integer abilityId returns boolean That's all I could find so far. Didn't check common.ai |
| 12-17-2003, 08:46 PM | #3 |
I found some new utility functions in blizzard.j (for multiboards, buff,...). I will do further research on this. |
| 12-17-2003, 09:13 PM | #4 |
my listfile in my war3patch is corrupt, any chance any of you can post one so i can import it and extract the files to look through myself. thanks! |
| 12-17-2003, 09:39 PM | #5 |
| 12-18-2003, 07:22 PM | #6 |
New stuff in common.j in 1.13: New types: Code:
type playerscore extends handle New globals: Code:
// player score values
constant playerscore PLAYER_SCORE_UNITS_TRAINED = ConvertPlayerScore(0)
constant playerscore PLAYER_SCORE_UNITS_KILLED = ConvertPlayerScore(1)
constant playerscore PLAYER_SCORE_STRUCT_BUILT = ConvertPlayerScore(2)
constant playerscore PLAYER_SCORE_STRUCT_RAZED = ConvertPlayerScore(3)
constant playerscore PLAYER_SCORE_TECH_PERCENT = ConvertPlayerScore(4)
constant playerscore PLAYER_SCORE_FOOD_MAXPROD = ConvertPlayerScore(5)
constant playerscore PLAYER_SCORE_FOOD_MAXUSED = ConvertPlayerScore(6)
constant playerscore PLAYER_SCORE_HEROES_KILLED = ConvertPlayerScore(7)
constant playerscore PLAYER_SCORE_ITEMS_GAINED = ConvertPlayerScore(8)
constant playerscore PLAYER_SCORE_MERCS_HIRED = ConvertPlayerScore(9)
constant playerscore PLAYER_SCORE_GOLD_MINED_TOTAL = ConvertPlayerScore(10)
constant playerscore PLAYER_SCORE_GOLD_MINED_UPKEEP = ConvertPlayerScore(11)
constant playerscore PLAYER_SCORE_GOLD_LOST_UPKEEP = ConvertPlayerScore(12)
constant playerscore PLAYER_SCORE_GOLD_LOST_TAX = ConvertPlayerScore(13)
constant playerscore PLAYER_SCORE_GOLD_GIVEN = ConvertPlayerScore(14)
constant playerscore PLAYER_SCORE_GOLD_RECEIVED = ConvertPlayerScore(15)
constant playerscore PLAYER_SCORE_LUMBER_TOTAL = ConvertPlayerScore(16)
constant playerscore PLAYER_SCORE_LUMBER_LOST_UPKEEP = ConvertPlayerScore(17)
constant playerscore PLAYER_SCORE_LUMBER_LOST_TAX = ConvertPlayerScore(18)
constant playerscore PLAYER_SCORE_LUMBER_GIVEN = ConvertPlayerScore(19)
constant playerscore PLAYER_SCORE_LUMBER_RECEIVED = ConvertPlayerScore(20)
constant playerscore PLAYER_SCORE_UNIT_TOTAL = ConvertPlayerScore(21)
constant playerscore PLAYER_SCORE_HERO_TOTAL = ConvertPlayerScore(22)
constant playerscore PLAYER_SCORE_RESOURCE_TOTAL = ConvertPlayerScore(23)
constant playerscore PLAYER_SCORE_TOTAL = ConvertPlayerScore(24)
constant playerunitevent EVENT_PLAYER_UNIT_PAWN_ITEM = ConvertPlayerUnitEvent(277)
constant unitevent EVENT_UNIT_PAWN_ITEM = ConvertUnitEvent(294)New functions: Code:
constant native ConvertPlayerScore takes integer i returns playerscore // Looks up the "name" field for any object (unit, item, ability) constant native GetObjectName takes integer objectId returns string native StringLength takes string s returns integer native StringCase takes string source, boolean upper returns string constant native GetSpellTargetLoc takes nothing returns location constant native GetSpellTargetDestructable takes nothing returns destructable constant native GetSpellTargetItem takes nothing returns item constant native GetSpellTargetUnit takes nothing returns unit native GetDestructableName takes destructable d returns string constant native GetItemName takes item whichItem returns string 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 constant native GetUnitLevel takes unit whichUnit returns integer native GetUnitAbilityLevel takes unit whichUnit, integer abilcode returns integer constant native GetUnitRallyPoint takes unit whichUnit returns location constant native GetUnitRallyUnit takes unit whichUnit returns unit constant native GetUnitRallyDestructable takes unit whichUnit returns destructable native UnitMakeAbilityPermanent takes unit whichUnit, boolean permanent, integer abilityId returns boolean native GetUnitCurrentOrder takes unit whichUnit returns integer constant native GetPlayerScore takes player whichPlayer, playerscore whichPlayerScore returns integer native GetCreepCampFilterState takes nothing returns boolean native SetCreepCampFilterState takes boolean state returns nothing native EnableMinimapFilterButtons takes boolean enableAlly, boolean enableCreep returns nothing native SetWaterDeforms takes boolean val returns nothing native IsPointBlighted takes real x, real y returns boolean |
| 12-18-2003, 08:40 PM | #7 |
thank you SCFreak! |
| 12-19-2003, 04:21 PM | #8 |
Thanks , I hope they fix this securom thing since I can make some use of those functions |
| 12-19-2003, 08:03 PM | #9 |
New stuff in blizzard.j in 1.13: New globals: Code:
multiboard bj_lastCreatedMultiboard = null New functions: Code:
function TriggerRegisterPlayerEventLeave takes trigger trig, player whichPlayer returns event
return TriggerRegisterPlayerEvent(trig, whichPlayer, EVENT_PLAYER_LEAVE)
endfunction
function GetUnitAbilityLevelSwapped takes integer abilcode, unit whichUnit returns integer
return GetUnitAbilityLevel(whichUnit, abilcode)
endfunction
function UnitHasBuffBJ takes unit whichUnit, integer buffcode returns boolean
return (GetUnitAbilityLevel(whichUnit, buffcode) > 0)
endfunction
function UnitRemoveBuffBJ takes integer buffcode, unit whichUnit returns boolean
return UnitRemoveAbility(whichUnit, buffcode)
endfunction
function UnitInventoryCount takes unit whichUnit returns integer
local integer index = 0
local integer count = 0
loop
if (UnitItemInSlot(whichUnit, index) != null) then
set count = count + 1
endif
set index = index + 1
exitwhen index >= bj_MAX_INVENTORY
endloop
return count
endfunction
function UnitMakeAbilityPermanentBJ takes boolean permanent, integer abilityId, unit whichUnit returns boolean
return UnitMakeAbilityPermanent(whichUnit, permanent, abilityId)
endfunction
//***************************************************************************
//* Multiboard Utility Functions
//***************************************************************************
function CreateMultiboardBJ takes integer cols, integer rows, string title returns multiboard
set bj_lastCreatedMultiboard = CreateMultiboard()
call MultiboardSetRowCount(bj_lastCreatedMultiboard, rows)
call MultiboardSetColumnCount(bj_lastCreatedMultiboard, cols)
call MultiboardSetTitleText(bj_lastCreatedMultiboard, title)
call MultiboardDisplay(bj_lastCreatedMultiboard, true)
return bj_lastCreatedMultiboard
endfunction
function DestroyMultiboardBJ takes multiboard mb returns nothing
call DestroyMultiboard(mb)
endfunction
function GetLastCreatedMultiboard takes nothing returns multiboard
return bj_lastCreatedMultiboard
endfunction
function MultiboardDisplayBJ takes boolean show, multiboard mb returns nothing
call MultiboardDisplay(mb, show)
endfunction
function MultiboardMinimizeBJ takes boolean minimize, multiboard mb returns nothing
call MultiboardMinimize(mb, minimize)
endfunction
function MultiboardSetTitleTextColorBJ takes multiboard mb, real red, real green, real blue, real transparency returns nothing
call MultiboardSetTitleTextColor(mb, PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100.0-transparency))
endfunction
//===========================================================================
function MultiboardSetItemStyleBJ takes multiboard mb, integer col, integer row, boolean showValue, boolean showIcon returns nothing
local integer curRow = 0
local integer curCol = 0
local integer numRows = MultiboardGetRowCount(mb)
local integer numCols = MultiboardGetColumnCount(mb)
local multiboarditem mbitem = null
// Loop over rows, using 1-based index
loop
set curRow = curRow + 1
exitwhen curRow > numRows
// Apply setting to the requested row, or all rows (if row is 0)
if (row == 0 or row == curRow) then
// Loop over columns, using 1-based index
set curCol = 0
loop
set curCol = curCol + 1
exitwhen curCol > numCols
// Apply setting to the requested column, or all columns (if col is 0)
if (col == 0 or col == curCol) then
set mbitem = MultiboardGetItem(mb, curRow - 1, curCol - 1)
call MultiboardSetItemStyle(mbitem, showValue, showIcon)
call MultiboardReleaseItem(mbitem)
endif
endloop
endif
endloop
endfunction
//===========================================================================
function MultiboardSetItemValueBJ takes multiboard mb, integer col, integer row, string val returns nothing
local integer curRow = 0
local integer curCol = 0
local integer numRows = MultiboardGetRowCount(mb)
local integer numCols = MultiboardGetColumnCount(mb)
local multiboarditem mbitem = null
// Loop over rows, using 1-based index
loop
set curRow = curRow + 1
exitwhen curRow > numRows
// Apply setting to the requested row, or all rows (if row is 0)
if (row == 0 or row == curRow) then
// Loop over columns, using 1-based index
set curCol = 0
loop
set curCol = curCol + 1
exitwhen curCol > numCols
// Apply setting to the requested column, or all columns (if col is 0)
if (col == 0 or col == curCol) then
set mbitem = MultiboardGetItem(mb, curRow - 1, curCol - 1)
call MultiboardSetItemValue(mbitem, val)
call MultiboardReleaseItem(mbitem)
endif
endloop
endif
endloop
endfunction
//===========================================================================
function MultiboardSetItemColorBJ takes multiboard mb, integer col, integer row, real red, real green, real blue, real transparency returns nothing
local integer curRow = 0
local integer curCol = 0
local integer numRows = MultiboardGetRowCount(mb)
local integer numCols = MultiboardGetColumnCount(mb)
local multiboarditem mbitem = null
// Loop over rows, using 1-based index
loop
set curRow = curRow + 1
exitwhen curRow > numRows
// Apply setting to the requested row, or all rows (if row is 0)
if (row == 0 or row == curRow) then
// Loop over columns, using 1-based index
set curCol = 0
loop
set curCol = curCol + 1
exitwhen curCol > numCols
// Apply setting to the requested column, or all columns (if col is 0)
if (col == 0 or col == curCol) then
set mbitem = MultiboardGetItem(mb, curRow - 1, curCol - 1)
call MultiboardSetItemValueColor(mbitem, PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100.0-transparency))
call MultiboardReleaseItem(mbitem)
endif
endloop
endif
endloop
endfunction
//===========================================================================
function MultiboardSetItemWidthBJ takes multiboard mb, integer col, integer row, real width returns nothing
local integer curRow = 0
local integer curCol = 0
local integer numRows = MultiboardGetRowCount(mb)
local integer numCols = MultiboardGetColumnCount(mb)
local multiboarditem mbitem = null
// Loop over rows, using 1-based index
loop
set curRow = curRow + 1
exitwhen curRow > numRows
// Apply setting to the requested row, or all rows (if row is 0)
if (row == 0 or row == curRow) then
// Loop over columns, using 1-based index
set curCol = 0
loop
set curCol = curCol + 1
exitwhen curCol > numCols
// Apply setting to the requested column, or all columns (if col is 0)
if (col == 0 or col == curCol) then
set mbitem = MultiboardGetItem(mb, curRow - 1, curCol - 1)
call MultiboardSetItemWidth(mbitem, width/100.0)
call MultiboardReleaseItem(mbitem)
endif
endloop
endif
endloop
endfunction
//===========================================================================
function MultiboardSetItemIconBJ takes multiboard mb, integer col, integer row, string iconFileName returns nothing
local integer curRow = 0
local integer curCol = 0
local integer numRows = MultiboardGetRowCount(mb)
local integer numCols = MultiboardGetColumnCount(mb)
local multiboarditem mbitem = null
// Loop over rows, using 1-based index
loop
set curRow = curRow + 1
exitwhen curRow > numRows
// Apply setting to the requested row, or all rows (if row is 0)
if (row == 0 or row == curRow) then
// Loop over columns, using 1-based index
set curCol = 0
loop
set curCol = curCol + 1
exitwhen curCol > numCols
// Apply setting to the requested column, or all columns (if col is 0)
if (col == 0 or col == curCol) then
set mbitem = MultiboardGetItem(mb, curRow - 1, curCol - 1)
call MultiboardSetItemIcon(mbitem, iconFileName)
call MultiboardReleaseItem(mbitem)
endif
endloop
endif
endloop
endfunction
function IsPointBlightedBJ takes location where returns boolean
return IsPointBlighted(GetLocationX(where), GetLocationY(where))
endfunction
// Rally point setting
//
function SetUnitRallyPoint takes unit whichUnit, location targPos returns nothing
call IssuePointOrderLocBJ(whichUnit, "setrally", targPos)
endfunction
//===========================================================================
function SetUnitRallyUnit takes unit whichUnit, unit targUnit returns nothing
call IssueTargetOrder(whichUnit, "setrally", targUnit)
endfunction
//===========================================================================
function SetUnitRallyDestructable takes unit whichUnit, destructable targDest returns nothing
call IssueTargetOrder(whichUnit, "setrally", targDest)
endfunction
function GetAbilityName takes integer abilcode returns string
return GetObjectName(abilcode)
endfunctionChanged stuff in blizzard.j in 1.13: The stuff that has been changed is red. Changed functions: Code:
// This function returns the input string, converting it from the localized text, if necessary
//
function StringIdentity takes string theString returns string
[color=red]return GetLocalizedString(theString)[/color]
endfunction
// Set the alliance states for an entire force towards another force.
//
function SetForceAllianceStateBJ takes force sourceForce, force targetForce, integer allianceState returns nothing
local integer sourceIndex
local integer targetIndex
set sourceIndex = 0
loop
if (sourceForce==bj_FORCE_ALL_PLAYERS or IsPlayerInForce(Player(sourceIndex), sourceForce)) then
[color=red]set targetIndex = 0
loop
if (targetForce==bj_FORCE_ALL_PLAYERS or IsPlayerInForce(Player(targetIndex), targetForce)) then
call SetPlayerAllianceStateBJ(Player(sourceIndex), Player(targetIndex), allianceState)
endif
set targetIndex = targetIndex + 1
exitwhen targetIndex == bj_MAX_PLAYER_SLOTS
endloop
endif[/color]
set sourceIndex = sourceIndex + 1
exitwhen sourceIndex == bj_MAX_PLAYER_SLOTS
endloop
endfunction
function CustomVictoryDialogBJ takes player whichPlayer returns nothing
local trigger t = CreateTrigger()
local dialog d = DialogCreate()
call DialogSetMessage( d, GetLocalizedString( "GAMEOVER_VICTORY_MSG" ) )
set t = CreateTrigger()
call TriggerRegisterDialogButtonEvent( t, DialogAddButton( d, GetLocalizedString( "GAMEOVER_CONTINUE" ), GetLocalizedHotkey("GAMEOVER_CONTINUE") ) )
call TriggerAddAction( t, function CustomVictoryOkBJ )
set t = CreateTrigger()
call TriggerRegisterDialogButtonEvent( t, DialogAddButton( d, GetLocalizedString( "GAMEOVER_QUIT_MISSION" ), GetLocalizedHotkey("GAMEOVER_QUIT_MISSION") ) )
call TriggerAddAction( t, function CustomVictoryQuitBJ )
if (GetLocalPlayer() == whichPlayer) then
call EnableUserControl( true )
if bj_isSinglePlayer then
call PauseGame( true )
endif
[color=red]call EnableUserUI(false)[/color]
endif
call DialogDisplay( whichPlayer, d, true )
call VolumeGroupSetVolumeForPlayerBJ( whichPlayer, SOUND_VOLUMEGROUP_UI, 1.0 )
call StartSoundForPlayerBJ( whichPlayer, bj_victoryDialogSound )
endfunction
function CustomDefeatDialogBJ takes player whichPlayer, string message returns nothing
local trigger t = CreateTrigger()
local dialog d = DialogCreate()
call DialogSetMessage( d, message )
if bj_isSinglePlayer then
set t = CreateTrigger()
call TriggerRegisterDialogButtonEvent( t, DialogAddButton( d, GetLocalizedString( "GAMEOVER_RESTART" ), GetLocalizedHotkey("GAMEOVER_RESTART") ) )
call TriggerAddAction( t, function CustomDefeatRestartBJ )
if (GetGameDifficulty() != MAP_DIFFICULTY_EASY) then
set t = CreateTrigger()
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()
call TriggerRegisterDialogButtonEvent( t, DialogAddButton( d, GetLocalizedString( "GAMEOVER_QUIT_MISSION" ), GetLocalizedHotkey("GAMEOVER_QUIT_MISSION") ) )
call TriggerAddAction( t, function CustomDefeatQuitBJ )
if (GetLocalPlayer() == whichPlayer) then
call EnableUserControl( true )
if bj_isSinglePlayer then
call PauseGame( true )
endif
[color=red]call EnableUserUI(false)[/color]
endif
call DialogDisplay( whichPlayer, d, true )
call VolumeGroupSetVolumeForPlayerBJ( whichPlayer, SOUND_VOLUMEGROUP_UI, 1.0 )
call StartSoundForPlayerBJ( whichPlayer, bj_defeatDialogSound )
endfunction
function MeleeStartingUnitsHuman takes player whichPlayer, location startLoc, boolean doHeroes, boolean doCamera, boolean doPreload returns nothing
local boolean useRandomHero = IsMapFlagSet(MAP_RANDOM_HERO)
local real unitSpacing = 64.00
local unit nearestMine
local location nearMineLoc
local location heroLoc
local real peonX
local real peonY
[color=red]local unit townHall = null[/color]
if (doPreload) then
call Preloader( "scripts\\HumanMelee.pld" )
endif
set nearestMine = MeleeFindNearestMine(startLoc, bj_MELEE_MINE_SEARCH_RADIUS)
if (nearestMine != null) then
// Spawn Town Hall at the start location.
[color=red]set townHall = CreateUnitAtLoc(whichPlayer, 'htow', startLoc, bj_UNIT_FACING)[/color]
// Spawn Peasants near the mine.
set nearMineLoc = MeleeGetProjectedLoc(GetUnitLoc(nearestMine), startLoc, 320, 0)
set peonX = GetLocationX(nearMineLoc)
set peonY = GetLocationY(nearMineLoc)
call CreateUnit(whichPlayer, 'hpea', peonX + 0.00 * unitSpacing, peonY + 1.00 * unitSpacing, bj_UNIT_FACING)
call CreateUnit(whichPlayer, 'hpea', peonX + 1.00 * unitSpacing, peonY + 0.15 * unitSpacing, bj_UNIT_FACING)
call CreateUnit(whichPlayer, 'hpea', peonX - 1.00 * unitSpacing, peonY + 0.15 * unitSpacing, bj_UNIT_FACING)
call CreateUnit(whichPlayer, 'hpea', peonX + 0.60 * unitSpacing, peonY - 1.00 * unitSpacing, bj_UNIT_FACING)
call CreateUnit(whichPlayer, 'hpea', peonX - 0.60 * unitSpacing, peonY - 1.00 * unitSpacing, bj_UNIT_FACING)
// Set random hero spawn point to be off to the side of the start location.
set heroLoc = MeleeGetProjectedLoc(GetUnitLoc(nearestMine), startLoc, 384, 45)
else
// Spawn Town Hall at the start location.
[color=red]set townHall = CreateUnitAtLoc(whichPlayer, 'htow', startLoc, bj_UNIT_FACING)[/color]
// Spawn Peasants directly south of the town hall.
set peonX = GetLocationX(startLoc)
set peonY = GetLocationY(startLoc) - 224.00
call CreateUnit(whichPlayer, 'hpea', peonX + 2.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING)
call CreateUnit(whichPlayer, 'hpea', peonX + 1.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING)
call CreateUnit(whichPlayer, 'hpea', peonX + 0.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING)
call CreateUnit(whichPlayer, 'hpea', peonX - 1.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING)
call CreateUnit(whichPlayer, 'hpea', peonX - 2.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING)
// Set random hero spawn point to be just south of the start location.
set heroLoc = Location(peonX, peonY - 2.00 * unitSpacing)
endif
[color=red]if (townHall != null) then
call UnitAddAbilityBJ('Amic', townHall)
call UnitMakeAbilityPermanentBJ(true, 'Amic', townHall)
endif[/color]
if (doHeroes) then
// If the "Random Hero" option is set, start the player with a random hero.
// Otherwise, give them a "free hero" token.
if useRandomHero then
call MeleeRandomHeroLoc(whichPlayer, 'Hamg', 'Hmkg', 'Hpal', 'Hblm', heroLoc)
else
call SetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_HERO_TOKENS, bj_MELEE_STARTING_HERO_TOKENS)
endif
endif
if (doCamera) then
// Center the camera on the initial Peasants.
call SetCameraPositionForPlayer(whichPlayer, peonX, peonY)
call SetCameraQuickPositionForPlayer(whichPlayer, peonX, peonY)
endif
endfunction
function InitSummonableCaps takes nothing returns nothing
local integer index
set index = 0
loop
// upgraded units
[color=red]// Note: Only do this if the corresponding upgrade is not yet researched
// Barrage - Siege Engines
if (not GetPlayerTechResearched(Player(index), 'Rhrt', true)) then
call SetPlayerTechMaxAllowed(Player(index), 'hrtt', 0)
endif
// Berserker Upgrade - Troll Berserkers
if (not GetPlayerTechResearched(Player(index), 'Robk', true)) then
call SetPlayerTechMaxAllowed(Player(index), 'otbk', 0)
endif[/color]
// max skeletons per player
call SetPlayerTechMaxAllowed(Player(index), 'uske', bj_MAX_SKELETONS)
set index = index + 1
exitwhen index == bj_MAX_PLAYERS
endloop
endfunction |
| 12-19-2003, 08:09 PM | #10 |
Good finds! |
| 12-19-2003, 11:27 PM | #11 |
There's some really nice stuff there... |
| 12-23-2003, 12:54 PM | #12 |
StringLength takes string s returns integer thats really handy for parsing. I used to have to make my own fuction to find a strings lenth. |
| 12-28-2003, 12:31 AM | #13 |
KICK ****ING ASSSSSSSSSssss is peonX and peonY global variables plz say they are |
