📄 blizzard.j
字号:
endfunction
function TriggerRegisterUnitManaEvent takes trigger trig,unit whichUnit,limitop opcode,real limitval returns event
return TriggerRegisterUnitStateEvent(trig,whichUnit,UNIT_STATE_MANA,opcode,limitval)
endfunction
function TriggerRegisterDialogEventBJ takes trigger trig,dialog whichDialog returns event
return TriggerRegisterDialogEvent(trig,whichDialog)
endfunction
function TriggerRegisterShowSkillEventBJ takes trigger trig returns event
return TriggerRegisterGameEvent(trig,EVENT_GAME_SHOW_SKILL)
endfunction
function TriggerRegisterBuildSubmenuEventBJ takes trigger trig returns event
return TriggerRegisterGameEvent(trig,EVENT_GAME_BUILD_SUBMENU)
endfunction
function TriggerRegisterGameLoadedEventBJ takes trigger trig returns event
return TriggerRegisterGameEvent(trig,EVENT_GAME_LOADED)
endfunction
function TriggerRegisterGameSavedEventBJ takes trigger trig returns event
return TriggerRegisterGameEvent(trig,EVENT_GAME_SAVE)
endfunction
function RegisterDestDeathInRegionEnum takes nothing returns nothing
set bj_destInRegionDiesCount=bj_destInRegionDiesCount+1
if(bj_destInRegionDiesCount<=bj_MAX_DEST_IN_REGION_EVENTS)then
call TriggerRegisterDeathEvent(bj_destInRegionDiesTrig,GetEnumDestructable())
endif
endfunction
function TriggerRegisterDestDeathInRegionEvent takes trigger trig,rect r returns event
set bj_destInRegionDiesTrig=trig
set bj_destInRegionDiesCount=0
call EnumDestructablesInRect(r,null,function RegisterDestDeathInRegionEnum)
return trig
endfunction
function AddWeatherEffectSaveLast takes rect where,integer effectID returns weathereffect
set bj_lastCreatedWeatherEffect=AddWeatherEffect(where,effectID)
return bj_lastCreatedWeatherEffect
endfunction
function GetLastCreatedWeatherEffect takes nothing returns weathereffect
return bj_lastCreatedWeatherEffect
endfunction
function RemoveWeatherEffectBJ takes weathereffect whichWeatherEffect returns nothing
call RemoveWeatherEffect(whichWeatherEffect)
endfunction
function TerrainDeformationCraterBJ takes real duration,boolean permanent,location where,real radius,real depth returns terraindeformation
set bj_lastCreatedTerrainDeformation=TerrainDeformCrater(GetLocationX(where),GetLocationY(where),radius,depth,R2I(duration*1000),permanent)
return bj_lastCreatedTerrainDeformation
endfunction
function TerrainDeformationRippleBJ takes real duration,boolean limitNeg,location where,real startRadius,real endRadius,real depth,real wavePeriod,real waveWidth returns terraindeformation
local real spaceWave
local real timeWave
local real radiusRatio
if(endRadius<=0 or waveWidth<=0 or wavePeriod<=0)then
return null
endif
set timeWave=2.0*duration/wavePeriod
set spaceWave=2.0*endRadius/waveWidth
set radiusRatio=startRadius/endRadius
set bj_lastCreatedTerrainDeformation=TerrainDeformRipple(GetLocationX(where),GetLocationY(where),endRadius,depth,R2I(duration*1000),1,spaceWave,timeWave,radiusRatio,limitNeg)
return bj_lastCreatedTerrainDeformation
endfunction
function TerrainDeformationWaveBJ takes real duration,location source,location target,real radius,real depth,real trailDelay returns terraindeformation
local real distance
local real dirX
local real dirY
local real speed
set distance=DistanceBetweenPoints(source,target)
if(distance==0 or duration<=0)then
return null
endif
set dirX=(GetLocationX(target)-GetLocationX(source))/distance
set dirY=(GetLocationY(target)-GetLocationY(source))/distance
set speed=distance/duration
set bj_lastCreatedTerrainDeformation=TerrainDeformWave(GetLocationX(source),GetLocationY(source),dirX,dirY,distance,speed,radius,depth,R2I(trailDelay*1000),1)
return bj_lastCreatedTerrainDeformation
endfunction
function TerrainDeformationRandomBJ takes real duration,location where,real radius,real minDelta,real maxDelta,real updateInterval returns terraindeformation
set bj_lastCreatedTerrainDeformation=TerrainDeformRandom(GetLocationX(where),GetLocationY(where),radius,minDelta,maxDelta,R2I(duration*1000),R2I(updateInterval*1000))
return bj_lastCreatedTerrainDeformation
endfunction
function TerrainDeformationStopBJ takes terraindeformation deformation,real duration returns nothing
call TerrainDeformStop(deformation,R2I(duration*1000))
endfunction
function GetLastCreatedTerrainDeformation takes nothing returns terraindeformation
return bj_lastCreatedTerrainDeformation
endfunction
function AddLightningLoc takes string codeName,location where1,location where2 returns lightning
set bj_lastCreatedLightning=AddLightningEx(codeName,true,GetLocationX(where1),GetLocationY(where1),GetLocationZ(where1),GetLocationX(where2),GetLocationY(where2),GetLocationZ(where2))
return bj_lastCreatedLightning
endfunction
function DestroyLightningBJ takes lightning whichBolt returns boolean
return DestroyLightning(whichBolt)
endfunction
function MoveLightningLoc takes lightning whichBolt,location where1,location where2 returns boolean
return MoveLightningEx(whichBolt,true,GetLocationX(where1),GetLocationY(where1),GetLocationZ(where1),GetLocationX(where2),GetLocationY(where2),GetLocationZ(where2))
endfunction
function GetLightningColorABJ takes lightning whichBolt returns real
return GetLightningColorA(whichBolt)
endfunction
function GetLightningColorRBJ takes lightning whichBolt returns real
return GetLightningColorR(whichBolt)
endfunction
function GetLightningColorGBJ takes lightning whichBolt returns real
return GetLightningColorG(whichBolt)
endfunction
function GetLightningColorBBJ takes lightning whichBolt returns real
return GetLightningColorB(whichBolt)
endfunction
function SetLightningColorBJ takes lightning whichBolt,real r,real g,real b,real a returns boolean
return SetLightningColor(whichBolt,r,g,b,a)
endfunction
function GetLastCreatedLightningBJ takes nothing returns lightning
return bj_lastCreatedLightning
endfunction
function GetAbilityEffectBJ takes integer abilcode,effecttype t,integer index returns string
return GetAbilityEffectById(abilcode,t,index)
endfunction
function GetAbilitySoundBJ takes integer abilcode,soundtype t returns string
return GetAbilitySoundById(abilcode,t)
endfunction
function GetTerrainCliffLevelBJ takes location where returns integer
return GetTerrainCliffLevel(GetLocationX(where),GetLocationY(where))
endfunction
function GetTerrainTypeBJ takes location where returns integer
return GetTerrainType(GetLocationX(where),GetLocationY(where))
endfunction
function GetTerrainVarianceBJ takes location where returns integer
return GetTerrainVariance(GetLocationX(where),GetLocationY(where))
endfunction
function SetTerrainTypeBJ takes location where,integer terrainType,integer variation,integer area,integer shape returns nothing
call SetTerrainType(GetLocationX(where),GetLocationY(where),terrainType,variation,area,shape)
endfunction
function IsTerrainPathableBJ takes location where,pathingtype t returns boolean
return IsTerrainPathable(GetLocationX(where),GetLocationY(where),t)
endfunction
function SetTerrainPathableBJ takes location where,pathingtype t,boolean flag returns nothing
call SetTerrainPathable(GetLocationX(where),GetLocationY(where),t,flag)
endfunction
function SetWaterBaseColorBJ takes real red,real green,real blue,real transparency returns nothing
call SetWaterBaseColor(PercentTo255(red),PercentTo255(green),PercentTo255(blue),PercentTo255(100.0-transparency))
endfunction
function CreateFogModifierRectSimple takes player whichPlayer,fogstate whichFogState,rect r,boolean afterUnits returns fogmodifier
set bj_lastCreatedFogModifier=CreateFogModifierRect(whichPlayer,whichFogState,r,true,afterUnits)
return bj_lastCreatedFogModifier
endfunction
function CreateFogModifierRadiusLocSimple takes player whichPlayer,fogstate whichFogState,location center,real radius,boolean afterUnits returns fogmodifier
set bj_lastCreatedFogModifier=CreateFogModifierRadiusLoc(whichPlayer,whichFogState,center,radius,true,afterUnits)
return bj_lastCreatedFogModifier
endfunction
function CreateFogModifierRectBJ takes boolean enabled,player whichPlayer,fogstate whichFogState,rect r returns fogmodifier
set bj_lastCreatedFogModifier=CreateFogModifierRect(whichPlayer,whichFogState,r,true,false)
if enabled then
call FogModifierStart(bj_lastCreatedFogModifier)
endif
return bj_lastCreatedFogModifier
endfunction
function CreateFogModifierRadiusLocBJ takes boolean enabled,player whichPlayer,fogstate whichFogState,location center,real radius returns fogmodifier
set bj_lastCreatedFogModifier=CreateFogModifierRadiusLoc(whichPlayer,whichFogState,center,radius,true,false)
if enabled then
call FogModifierStart(bj_lastCreatedFogModifier)
endif
return bj_lastCreatedFogModifier
endfunction
function GetLastCreatedFogModifier takes nothing returns fogmodifier
return bj_lastCreatedFogModifier
endfunction
function FogEnableOn takes nothing returns nothing
call FogEnable(true)
endfunction
function FogEnableOff takes nothing returns nothing
call FogEnable(false)
endfunction
function FogMaskEnableOn takes nothing returns nothing
call FogMaskEnable(true)
endfunction
function FogMaskEnableOff takes nothing returns nothing
call FogMaskEnable(false)
endfunction
function UseTimeOfDayBJ takes boolean flag returns nothing
call SuspendTimeOfDay(not flag)
endfunction
function SetTerrainFogExBJ takes integer style,real zstart,real zend,real density,real red,real green,real blue returns nothing
call SetTerrainFogEx(style,zstart,zend,density,red*0.01,green*0.01,blue*0.01)
endfunction
function ResetTerrainFogBJ takes nothing returns nothing
call ResetTerrainFog()
endfunction
function SetDoodadAnimationBJ takes string animName,integer doodadID,real radius,location center returns nothing
call SetDoodadAnimation(GetLocationX(center),GetLocationY(center),radius,doodadID,false,animName,false)
endfunction
function SetDoodadAnimationRectBJ takes string animName,integer doodadID,rect r returns nothing
call SetDoodadAnimationRect(r,doodadID,animName,false)
endfunction
function AddUnitAnimationPropertiesBJ takes boolean add,string animProperties,unit whichUnit returns nothing
call AddUnitAnimationProperties(whichUnit,animProperties,add)
endfunction
function CreateImageBJ takes string file,real size,location where,real zOffset,integer imageType returns image
set bj_lastCreatedImage=CreateImage(file,size,size,size,GetLocationX(where),GetLocationY(where),zOffset,0,0,0,imageType)
return bj_lastCreatedImage
endfunction
function ShowImageBJ takes boolean flag,image whichImage returns nothing
call ShowImage(whichImage,flag)
endfunction
function SetImagePositionBJ takes image whichImage,location where,real zOffset returns nothing
call SetImagePosition(whichImage,GetLocationX(where),GetLocationY(where),zOffset)
endfunction
function SetImageColorBJ takes image whichImage,real red,real green,real blue,real alpha returns nothing
call SetImageColor(whichImage,PercentTo255(red),PercentTo255(green),PercentTo255(blue),PercentTo255(100.0-alpha))
endfunction
function GetLastCreatedImage takes nothing returns image
return bj_lastCreatedImage
endfunction
function CreateUbersplatBJ takes location where,string name,real red,real green,real blue,real alpha,boolean forcePaused,boolean noBirthTime returns ubersplat
set bj_lastCreatedUbersplat=CreateUbersplat(GetLocationX(where),GetLocationY(where),name,PercentTo255(red),PercentTo255(green),PercentTo255(blue),PercentTo255(100.0-alpha),forcePaused,noBirthTime)
return bj_lastCreatedUbersplat
endfunction
function ShowUbersplatBJ takes boolean flag,ubersplat whichSplat returns nothing
call ShowUbersplat(whichSplat,flag)
endfunction
function GetLastCreatedUbersplat takes nothing returns ubersplat
return bj_lastCreatedUbersplat
endfunction
function PlaySoundBJ takes sound soundHandle returns nothing
set bj_lastPlayedSound=soundHandle
if(soundHandle!=null)then
call StartSound(soundHandle)
endif
endfunction
function StopSoundBJ takes sound soundHandle,boolean fadeOut returns nothing
call StopSound(soundHandle,false,fadeOut)
endfunction
function SetSoundVolumeBJ takes sound soundHandle,real volumePercent returns nothing
call SetSoundVolume(soundHandle,PercentToInt(volumePercent,127))
endfunction
function SetSoundOffsetBJ takes real newOffset,sound soundHandle returns nothing
call SetSoundPlayPosition(soundHandle,R2I(newOffset*1000))
endfunction
function SetSoundDistanceCutoffBJ takes sound soundHandle,real cutoff returns nothing
call SetSoundDistanceCutoff(soundHandle,cutoff)
endfunction
function SetSoundPitchBJ takes sound soundHandle,real pitch returns nothing
call SetSoundPitch(soundHandle,pitch)
endfunction
function SetSoundPositionLocBJ takes sound soundHandle,location loc,real z returns nothing
call SetSoundPosition(soundHandle,GetLocationX(loc),GetLocationY(loc),z)
endfunction
function AttachSoundToUnitBJ takes sound soundHandle,unit whichUnit returns nothing
call AttachSoundToUnit(soundHandle,whichUnit)
endfunction
function SetSoundConeAnglesBJ takes sound soundHandle,real inside,real outside,real outsideVolumePercent returns nothing
call SetSoundConeAngles(soundHandle,inside,outside,PercentToInt(outsideVolumePercent,127))
endfunction
function KillSoundWhenDoneBJ takes sound soundHandle returns nothing
call KillSoundWhenDone(soundHandle)
endfunction
function PlaySoundAtPointBJ takes sound soundHandle,real volumePercent,location loc,real z returns nothing
call SetSoundPositionLocBJ(soundHandle,loc,z)
call SetSoundVolumeBJ(soundHandle,volumePercent)
call PlaySoundBJ(soundHandle)
endfunction
function PlaySoundOnUnitBJ takes sound soundHandle,real volumePercent,unit whichUnit returns nothing
call AttachSoundToUnitBJ(soundHandle,whichUnit)
call SetSoundVolumeBJ(soundHandle,volumePercent)
call PlaySoundBJ(soundHandle)
endfunction
function PlaySoundFromOffsetBJ takes sound soundHandle,real volumePercent,real startingOffset returns nothing
call SetSoundVolumeBJ(soundHandle,volumePercent)
call PlaySoundBJ(soundHandle)
call SetSoundOffsetBJ(startingOffset,soundHandle)
endfunction
function PlayMusicBJ takes string musicFileName returns nothing
set bj_lastPlayedMusic=musicFileName
call PlayMusic(musicFileName)
endfunction
function PlayMusicExBJ takes string musicFileName,real startingOffset,real fadeInTime returns nothing
set bj_lastPlayedMusic=musicFileName
call PlayMusicEx(musicFileName,R2I(startingOffset*1000),R2I(fadeInTime*1000))
endfunction
function SetMusicOffsetBJ takes real newOffset returns nothing
call SetMusicPlayPosition(R2I(newOffset*1000))
endfunction
function PlayThematicMusicBJ takes string musicName returns nothing
call PlayThematicMusic(musicName)
endfunction
function PlayThematicMusicExBJ takes string musicName,real startingOffset returns nothing
call PlayThematicMusicEx(musicName,R2I(startingOffset*1000))
endfunction
function SetThematicMusicOffsetBJ takes real newOffset returns nothing
call SetThematicMusicPlayPosition(R2I(newOffset*1000))
endfunction
function EndThematicMusicBJ takes nothing returns nothing
call EndThematicMusic()
endfunction
function StopMusicBJ takes boolean fadeOut returns nothing
call StopMusic(fadeOut)
endfunction
function ResumeMusicBJ takes nothing returns nothing
call ResumeMusic()
endfunction
function SetMusicVolumeBJ takes real volumePercent returns nothing
call SetMusicVolume(PercentToInt(volumePercent,127))
endfunction
function GetSoundDurationBJ takes sound soundHandle returns real
if(soundHandle==null)then
return bj_NOTHING_SOUND_DURATION
else
return I2R(GetSoundDuration(soundHandle))*0.001
endif
endfunction
function GetSoundFileDurationBJ takes string musicFileName returns real
return I2R(GetSoundFileDuration(musicFileName))*0.001
endfunction
function GetLastPlayedSound takes nothing returns sound
return bj_lastPlayedSoun
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -