Common.j

来自咸鱼维基
跳转至: 导航搜索

common.j,是魔兽地图编辑器中的核心API,这些API是通过C++来实现的。

目录

原生类型[编辑]

所有原生函数都会尽量使用拓展的句柄(handle)类型,用于防止将错误的值传递给原生函数。(比如错将“单位”当做“特效”传递给某个函数)

  • constant native OrderId takes string orderIdString returns integer
  • constant native OrderId2String takes integer orderId returns string
  • constant native UnitId takes string unitIdString returns integer
  • constant native UnitId2String takes integer unitId returns string

暂时不能正常运行的函数[编辑]

  • constant native AbilityId takes string abilityIdString returns integer
  • constant native AbilityId2String takes integer abilityId returns string

Looks up the "name" field for any object (unit, item, ability)[编辑]

  • constant native GetObjectName takes integer objectId returns string

全局变量[编辑]

游戏常量[编辑]

地图设置相关常量[编辑]

音频常量[编辑]

游戏、玩家、单位状态[编辑]

For use with TriggerRegister<X>StateEvent

当前的资源状态[编辑]

每种资源的税率[编辑]

玩家在关卡中累积收集起来的资源[编辑]

玩家的评分[编辑]

游戏/玩家/单位 事件[编辑]

当触发器因为某个行为而被触发时,这些值用于让系统判定应该告诉哪些事件它们已经被触发了,同时这些值也用于确定哪些原生函数应该被用于获取与事件相关的信息。
(When an event causes a trigger to fire these values allow the action code to determine which event was dispatched and therefore which set of native functions should be used to get information about the event.)

不要改变这些常量的顺序或者值,除非你确保枚举“JASS_GAME_EVENTS_WAR3”的值与改变后的顺序或者值能够匹配。(这一条应该是用于给暴雪的官方开发者看的)
(Do NOT change the order or value of these constants without insuring that the JASS_GAME_EVENTS_WAR3 enum is changed to match.)

使用在TriggerRegisterGameEvent的参数[编辑]

使用在TriggerRegisterPlayerEvent的参数[编辑]

使用在TriggerRegisterPlayerUnitEvent的参数[编辑]

使用在TriggerRegisterUnitEvent的参数[编辑]

Events which may have a filter for the "other unit"[编辑]

Events which involve the specified unit performing training of other units[编辑]

冰封王座拓展的事件[编辑]

Need to be added here to preserve compat

使用在TriggerRegisterGameEvent的参数[编辑]

使用在TriggerRegisterPlayerEvent的参数[编辑]

使用在TriggerRegisterPlayerUnitEvent的参数[编辑]

使用在TriggerRegisterUnitEvent的参数[编辑]

事件API的限制类型常量[编辑]

用于与 变量/玩家状态/游戏状态/单位状态 相关的事件(不要改变这些值的顺序)

单位类型常量,使用在IsUnitType()的参数[编辑]

物品类型常量,使用在ChooseRandomItemEx()的参数[编辑]

  • constant itemtype ITEM_TYPE_TOME = ConvertItemType(2) // 已过时,使用ITEM_TYPE_POWERUP替代

动画与镜头域值[编辑]

镜头边距常量,使用在GetCameraMargin的参数[编辑]

特效API常量[编辑]

API[编辑]

数学 API[编辑]

  • native Deg2Rad takes real degrees returns real
  • native Rad2Deg takes real radians returns real
  • native Sin takes real radians returns real
  • native Cos takes real radians returns real
  • native Tan takes real radians returns real
  • native Asin takes real y returns real // Expect values between -1 and 1...returns 0 for invalid input
  • native Acos takes real x returns real // Expect values between -1 and 1...returns 0 for invalid input
  • native Atan takes real x returns real
  • native Atan2 takes real y, real x returns real // Returns 0 if x and y are both 0
  • native SquareRoot takes real x returns real // Returns 0 if x <= 0
  • native Pow takes real x, real power returns real
    • computes x to the y power
    • y == 0.0 => 1
    • x ==0.0 and y < 0 => 0

字符串工具 API[编辑]

  • native I2R takes integer i returns real
  • native R2I takes real r returns integer
  • native I2S takes integer i returns string
  • native R2S takes real r returns string
  • native R2SW takes real r, integer width, integer precision returns string
  • native S2I takes string s returns integer
  • native S2R takes string s returns real
  • native GetHandleId takes handle h returns integer
  • native SubString takes string source, integer start, integer end returns string
  • native StringLength takes string s returns integer
  • native StringCase takes string source, boolean upper returns string
  • native StringHash takes string s returns integer

地图设置 API[编辑]

这些是用于描述地图配置的原生函数,只用在地图脚本的config函数中。此外这些函数的调用顺序也必须和下面的函数排序顺序相同(例如,你必须在call SetPlayerColor之前call SetPlayers)

  • native SetTeams takes integer teamcount returns nothing
  • native SetPlayers takes integer playercount returns nothing
  • native DefineStartLocation takes integer whichStartLoc, real x, real y returns nothing
  • native DefineStartLocationLoc takes integer whichStartLoc, location whichLocation returns nothing
  • native SetStartLocPrioCount takes integer whichStartLoc, integer prioSlotCount returns nothing
  • native SetStartLocPrio takes integer whichStartLoc, integer prioSlotIndex, integer otherStartLocIndex, startlocprio priority returns nothing
  • native GetStartLocPrioSlot takes integer whichStartLoc, integer prioSlotIndex returns integer
  • native GetStartLocPrio takes integer whichStartLoc, integer prioSlotIndex returns startlocprio
  • native GetTeams takes nothing returns integer
  • native GetPlayers takes nothing returns integer
  • native SetPlayerTeam takes player whichPlayer, integer whichTeam returns nothing
  • native SetPlayerStartLocation takes player whichPlayer, integer startLocIndex returns nothing
    • forces player to have the specified start loc and marks the start loc as occupied which removes it from consideration for subsequently placed players ( i.e. you can use this to put people in a fixed loc and then use random placement for any unplaced players etc )
  • native ForcePlayerStartLocation takes player whichPlayer, integer startLocIndex returns nothing
  • native SetPlayerColor takes player whichPlayer, playercolor color returns nothing
  • 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 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

计时器 API[编辑]

单位组 API[编辑]

  • native GroupImmediateOrder takes group whichGroup, string order returns boolean
  • native GroupImmediateOrderById takes group whichGroup, integer order returns boolean
  • native GroupPointOrder takes group whichGroup, string order, real x, real y returns boolean
  • native GroupPointOrderLoc takes group whichGroup, string order, location whichLocation returns boolean
  • native GroupPointOrderById takes group whichGroup, integer order, real x, real y returns boolean
  • native GroupPointOrderByIdLoc takes group whichGroup, integer order, location whichLocation returns boolean
  • native GroupTargetOrder takes group whichGroup, string order, widget targetWidget returns boolean
  • native GroupTargetOrderById takes group whichGroup, integer order, widget targetWidget returns boolean

This will be difficult to support with potentially disjoint, cell-based regions as it would involve enumerating all the cells that are covered by a particularregion a better implementation would be a trigger that adds relevant units as they enter and removes them if they leave...

  • native ForGroup takes group whichGroup, code callback returns nothing
  • native FirstOfGroup takes group whichGroup returns unit

玩家组 API[编辑]

  • native CreateForce takes nothing returns force
  • native DestroyForce takes force whichForce returns nothing
  • native ForceAddPlayer takes force whichForce, player whichPlayer returns nothing
  • native ForceRemovePlayer takes force whichForce, player whichPlayer returns nothing
  • native ForceClear takes force whichForce returns nothing
  • native ForceEnumPlayers takes force whichForce, boolexpr filter returns nothing
  • native ForceEnumPlayersCounted takes force whichForce, boolexpr filter, integer countLimit returns nothing
  • native ForceEnumAllies takes force whichForce, player whichPlayer, boolexpr filter returns nothing
  • native ForceEnumEnemies takes force whichForce, player whichPlayer, boolexpr filter returns nothing
  • native ForForce takes force whichForce, code callback returns nothing

区域和点 API[编辑]

  • native Rect takes real minx, real miny, real maxx, real maxy returns rect
  • native RectFromLoc takes location min, location max returns rect
  • native RemoveRect takes rect whichRect returns nothing
  • native SetRect takes rect whichRect, real minx, real miny, real maxx, real maxy returns nothing
  • native SetRectFromLoc takes rect whichRect, location min, location max returns nothing
  • native MoveRectTo takes rect whichRect, real newCenterX, real newCenterY returns nothing
  • native MoveRectToLoc takes rect whichRect, location newCenterLoc returns nothing
  • native RegionAddRect takes region whichRegion, rect r returns nothing
  • native RegionClearRect takes region whichRegion, rect r returns nothing
  • native RegionAddCell takes region whichRegion, real x, real y returns nothing
  • native RegionAddCellAtLoc takes region whichRegion, location whichLocation returns nothing
  • native RegionClearCell takes region whichRegion, real x, real y returns nothing
  • native RegionClearCellAtLoc takes region whichRegion, location whichLocation returns nothing
  • native Location takes real x, real y returns location
  • native RemoveLocation takes location whichLocation returns nothing
  • native MoveLocation takes location whichLocation, real newX, real newY returns nothing
  • native GetLocationX takes location whichLocation returns real
  • native GetLocationY takes location whichLocation returns real

This function is asynchronous. The values it returns are not guaranteed synchronous between each player. If you attempt to use it in a synchronous manner, it may cause a desync.

  • native GetLocationZ takes location whichLocation returns real
  • native IsUnitInRegion takes region whichRegion, unit whichUnit returns boolean
  • native IsPointInRegion takes region whichRegion, real x, real y returns boolean
  • native IsLocationInRegion takes region whichRegion, location whichLocation returns boolean

Returns full map bounds, including unplayable borders, in world coordinates

原生触发 API[编辑]

  • native ExecuteFunc takes string funcName returns nothing

布尔表达式 API(用于组合触发条件以及单位过滤器函数)[编辑]

  • native And takes boolexpr operandA, boolexpr operandB returns boolexpr
  • native Or takes boolexpr operandA, boolexpr operandB returns boolexpr
  • native Not takes boolexpr operand returns boolexpr
  • native Condition takes code func returns conditionfunc
  • native DestroyCondition takes conditionfunc c returns nothing
  • native Filter takes code func returns filterfunc
  • native DestroyFilter takes filterfunc f returns nothing
  • native DestroyBoolExpr takes boolexpr e returns nothing

触发器游戏事件 API[编辑]

  • EVENT_GAME_VARIABLE_LIMIT
    • // constant native string GetTriggeringVariableName takes nothing returns string
  • native TriggerRegisterTimerEvent takes trigger whichTrigger, real timeout, boolean periodic returns event // Creates it's own timer and triggers when it expires
  • native TriggerRegisterTimerExpireEvent takes trigger whichTrigger, timer t returns event // Triggers when the timer you tell it about expires
  • EVENT_GAME_STATE_LIMIT
  • EVENT_GAME_VICTORY
  • EVENT_GAME_TRACKABLE_HIT EVENT_GAME_TRACKABLE_TRACK

与玩家相关的触发器事件 API[编辑]

  • EVENT_PLAYER_DEFEAT EVENT_PLAYER_VICTORY
  • native TriggerRegisterPlayerUnitEvent takes trigger whichTrigger, player whichPlayer, playerunitevent whichPlayerUnitEvent, boolexpr filter returns event
  • EVENT_PLAYER_HERO_LEVEL EVENT_UNIT_HERO_LEVEL
  • EVENT_PLAYER_HERO_REVIVABLE
  • EVENT_PLAYER_HERO_REVIVE_START EVENT_PLAYER_HERO_REVIVE_CANCEL EVENT_PLAYER_HERO_REVIVE_FINISH EVENT_UNIT_HERO_REVIVE_START EVENT_UNIT_HERO_REVIVE_CANCEL EVENT_UNIT_HERO_REVIVE_FINISH
  • EVENT_PLAYER_UNIT_ATTACKED
    • constant native GetAttacker takes nothing returns unit
  • EVENT_PLAYER_UNIT_RESCUED
    • constant native GetRescuer takes nothing returns unit
  • EVENT_PLAYER_UNIT_DEATH
  • EVENT_PLAYER_UNIT_DECAY
  • EVENT_PLAYER_UNIT_SELECTED
    • //constant native GetSelectedUnit takes nothing returns unit
  • EVENT_PLAYER_UNIT_RESEARCH_START
  • EVENT_PLAYER_UNIT_RESEARCH_CANCEL
  • EVENT_PLAYER_UNIT_RESEARCH_FINISH
  • EVENT_PLAYER_UNIT_TRAIN_START
  • EVENT_PLAYER_UNIT_TRAIN_CANCEL
  • EVENT_PLAYER_UNIT_TRAIN_FINISH
  • EVENT_PLAYER_UNIT_DETECTED
  • EVENT_PLAYER_UNIT_SELL
  • EVENT_PLAYER_UNIT_SELL_ITEM
    • constant native GetSoldItem takes nothing returns item
  • EVENT_PLAYER_UNIT_DROP_ITEM
  • EVENT_PLAYER_UNIT_PICKUP_ITEM
  • EVENT_PLAYER_UNIT_USE_ITEM
  • EVENT_PLAYER_UNIT_ISSUED_ORDER
  • EVENT_UNIT_SPELL_CHANNEL EVENT_UNIT_SPELL_CAST EVENT_UNIT_SPELL_EFFECT EVENT_UNIT_SPELL_FINISH EVENT_UNIT_SPELL_ENDCAST EVENT_PLAYER_UNIT_SPELL_CHANNEL EVENT_PLAYER_UNIT_SPELL_CAST EVENT_PLAYER_UNIT_SPELL_EFFECT EVENT_PLAYER_UNIT_SPELL_FINISH EVENT_PLAYER_UNIT_SPELL_ENDCAST
  • EVENT_PLAYER_STATE_LIMIT
  • native TriggerRegisterPlayerChatEvent takes trigger whichTrigger, player whichPlayer, string chatMessageToDetect, boolean exactMatchOnly returns event
  • EVENT_PLAYER_CHAT
    • constant native GetEventPlayerChatString takes nothing returns string // returns the actual string they typed in ( same as what you registered for if you required exact match )
    • constant native GetEventPlayerChatStringMatched takes nothing returns string // returns the string that you registered for

以单位为基础的触发器事件 API[编辑]

returns handle to unit which triggered the most recent event when called from within a trigger action function...returns null handle when used incorrectly

  • native TriggerRegisterUnitStateEvent takes trigger whichTrigger, unit whichUnit, unitstate whichState, limitop opcode, real limitval returns event
  • EVENT_UNIT_STATE_LIMIT
  • EVENT_UNIT_DEATH EVENT_UNIT_DECAY

Use the GetDyingUnit and GetDecayingUnit funcs above

  • EVENT_UNIT_ACQUIRED_TARGET EVENT_UNIT_TARGET_IN_RANGE
  • EVENT_UNIT_ATTACKED

Use GetAttacker from the Player Unit Event API Below...

  • EVENT_UNIT_RESCUEDED

Use GetRescuer from the Player Unit Event API Below...

  • EVENT_UNIT_CONSTRUCT_CANCEL EVENT_UNIT_CONSTRUCT_FINISH

See the Player Unit Construction Event API above for event info funcs

  • EVENT_UNIT_TRAIN_START EVENT_UNIT_TRAIN_CANCELLED EVENT_UNIT_TRAIN_FINISH

See the Player Unit Training Event API above for event info funcs

  • EVENT_UNIT_SELL

See the Player Unit Sell Event API above for event info funcs

  • EVENT_UNIT_DROP_ITEM EVENT_UNIT_PICKUP_ITEM EVENT_UNIT_USE_ITEM

See the Player Unit/Item manipulation Event API above for event info funcs

  • EVENT_UNIT_ISSUED_ORDER
  • EVENT_UNIT_ISSUED_POINT_ORDER
  • EVENT_UNIT_ISSUED_TARGET_ORDER

See the Player Unit Order Event API above for event info funcs

基础部件 API[编辑]

可破坏的对象 API[编辑]

朝向参数(facing)使用角度作为单位。

物品 API[编辑]

单位 API[编辑]

朝向参数(facing)使用角度作为单位。

  • native CreateUnit takes player id, integer unitid, real x, real y, real face returns unit
  • native CreateUnitByName takes player whichPlayer, string unitname, real x, real y, real face returns unit
  • native CreateUnitAtLoc takes player id, integer unitid, location whichLocation, real face returns unit
  • native CreateUnitAtLocByName takes player id, string unitname, location whichLocation, real face returns unit
  • native CreateCorpse takes player whichPlayer, integer unitid, real x, real y, real face returns unit
  • native KillUnit takes unit whichUnit returns nothing
  • native RemoveUnit takes unit whichUnit returns nothing
  • native ShowUnit takes unit whichUnit, boolean show returns nothing
  • native SetUnitState takes unit whichUnit, unitstate whichUnitState, real newVal returns nothing
  • native SetUnitX takes unit whichUnit, real newX returns nothing
  • native SetUnitY takes unit whichUnit, real newY returns nothing
  • native SetUnitPosition takes unit whichUnit, real newX, real newY returns nothing
  • native SetUnitPositionLoc takes unit whichUnit, location whichLocation returns nothing
  • native SetUnitFacing takes unit whichUnit, real facingAngle returns nothing
  • native SetUnitFacingTimed takes unit whichUnit, real facingAngle, real duration returns nothing
  • native SetUnitMoveSpeed takes unit whichUnit, real newSpeed returns nothing
  • native SetUnitFlyHeight takes unit whichUnit, real newHeight, real rate returns nothing
  • native SetUnitTurnSpeed takes unit whichUnit, real newTurnSpeed returns nothing
  • native SetUnitPropWindow takes unit whichUnit, real newPropWindowAngle returns nothing
  • native SetUnitAcquireRange takes unit whichUnit, real newAcquireRange returns nothing
  • native SetUnitCreepGuard takes unit whichUnit, boolean creepGuard returns nothing
  • native SetUnitOwner takes unit whichUnit, player whichPlayer, boolean changeColor returns nothing
  • native SetUnitColor takes unit whichUnit, playercolor whichColor returns nothing
  • native SetUnitScale takes unit whichUnit, real scaleX, real scaleY, real scaleZ returns nothing
  • native SetUnitTimeScale takes unit whichUnit, real timeScale returns nothing
  • native SetUnitBlendTime takes unit whichUnit, real blendTime returns nothing
  • native SetUnitVertexColor takes unit whichUnit, integer red, integer green, integer blue, integer alpha returns nothing
  • native SetUnitLookAt takes unit whichUnit, string whichBone, unit lookAtTarget, real offsetX, real offsetY, real offsetZ returns nothing
  • native ResetUnitLookAt takes unit whichUnit returns nothing
  • native SetUnitRescuable takes unit whichUnit, player byWhichPlayer, boolean flag returns nothing
  • native SetUnitRescueRange takes unit whichUnit, real range returns nothing
  • native SetHeroStr takes unit whichHero, integer newStr, boolean permanent returns nothing
  • native SetHeroAgi takes unit whichHero, integer newAgi, boolean permanent returns nothing
  • native SetHeroInt takes unit whichHero, integer newInt, boolean permanent returns nothing
  • native GetHeroStr takes unit whichHero, boolean includeBonuses returns integer
  • native GetHeroAgi takes unit whichHero, boolean includeBonuses returns integer
  • native GetHeroInt takes unit whichHero, boolean includeBonuses returns integer
  • native GetHeroXP takes unit whichHero returns integer
  • native SetHeroXP takes unit whichHero, integer newXpVal, boolean showEyeCandy returns nothing
  • native AddHeroXP takes unit whichHero, integer xpToAdd, boolean showEyeCandy returns nothing
  • native SetHeroLevel takes unit whichHero, integer level, boolean showEyeCandy returns nothing
  • constant native GetHeroLevel takes unit whichHero returns integer
  • constant native GetUnitLevel takes unit whichUnit returns integer
  • native GetHeroProperName takes unit whichHero returns string
  • native SuspendHeroXP takes unit whichHero, boolean flag returns nothing
  • native IsSuspendedXP takes unit whichHero returns boolean
  • native SelectHeroSkill takes unit whichHero, integer abilcode returns nothing
  • native GetUnitAbilityLevel takes unit whichUnit, integer abilcode returns integer
  • native DecUnitAbilityLevel takes unit whichUnit, integer abilcode returns integer
  • native IncUnitAbilityLevel takes unit whichUnit, integer abilcode returns integer
  • native SetUnitAbilityLevel takes unit whichUnit, integer abilcode, integer level returns integer
  • native ReviveHero takes unit whichHero, real x, real y, boolean doEyecandy returns boolean
  • native ReviveHeroLoc takes unit whichHero, location loc, boolean doEyecandy returns boolean
  • native SetUnitExploded takes unit whichUnit, boolean exploded returns nothing
  • native SetUnitInvulnerable takes unit whichUnit, boolean flag returns nothing
  • native PauseUnit takes unit whichUnit, boolean flag returns nothing
  • native IsUnitPaused takes unit whichHero returns boolean
  • native SetUnitPathing takes unit whichUnit, boolean flag returns nothing
  • native ClearSelection takes nothing returns nothing
  • native SelectUnit takes unit whichUnit, boolean flag returns nothing
  • native GetUnitPointValue takes unit whichUnit returns integer
  • native GetUnitPointValueByType takes integer unitType returns integer
  • //native SetUnitPointValueByType takes integer unitType, integer newPointValue returns nothing
  • native UnitDropItemPoint takes unit whichUnit, item whichItem, real x, real y returns boolean
  • native UnitDropItemSlot takes unit whichUnit, item whichItem, integer slot returns boolean
  • native UnitDropItemTarget takes unit whichUnit, item whichItem, widget target returns boolean
  • native UnitUseItem takes unit whichUnit, item whichItem returns boolean
  • native UnitUseItemPoint takes unit whichUnit, item whichItem, real x, real y returns boolean
  • native UnitUseItemTarget takes unit whichUnit, item whichItem, widget target returns boolean
  • constant native GetUnitX takes unit whichUnit returns real
  • constant native GetUnitY takes unit whichUnit returns real
  • constant native GetUnitLoc takes unit whichUnit returns location
  • constant native GetUnitFacing takes unit whichUnit returns real
  • constant native GetUnitMoveSpeed takes unit whichUnit returns real
  • constant native GetUnitDefaultMoveSpeed takes unit whichUnit returns real
  • constant native GetUnitState takes unit whichUnit, unitstate whichUnitState returns real
  • constant native GetOwningPlayer takes unit whichUnit returns player
  • constant native GetUnitTypeId takes unit whichUnit returns integer
  • constant native GetUnitRace takes unit whichUnit returns race
  • constant native GetUnitName takes unit whichUnit returns string
  • constant native GetUnitFoodUsed takes unit whichUnit returns integer
  • constant native GetUnitFoodMade takes unit whichUnit returns integer
  • constant native GetFoodMade takes integer unitId returns integer
  • constant native GetFoodUsed takes integer unitId returns integer
  • native SetUnitUseFood takes unit whichUnit, boolean useFood returns nothing
  • constant native IsUnitInGroup takes unit whichUnit, group whichGroup returns boolean
  • constant native IsUnitInForce takes unit whichUnit, force whichForce returns boolean
  • constant native IsUnitOwnedByPlayer takes unit whichUnit, player whichPlayer returns boolean
  • constant native IsUnitAlly takes unit whichUnit, player whichPlayer returns boolean
  • constant native IsUnitEnemy takes unit whichUnit, player whichPlayer returns boolean
  • constant native IsUnitVisible takes unit whichUnit, player whichPlayer returns boolean
  • constant native IsUnitDetected takes unit whichUnit, player whichPlayer returns boolean
  • constant native IsUnitInvisible takes unit whichUnit, player whichPlayer returns boolean
  • constant native IsUnitFogged takes unit whichUnit, player whichPlayer returns boolean
  • constant native IsUnitMasked takes unit whichUnit, player whichPlayer returns boolean
  • constant native IsUnitSelected takes unit whichUnit, player whichPlayer returns boolean
  • constant native IsUnitRace takes unit whichUnit, race whichRace returns boolean
  • constant native IsUnitType takes unit whichUnit, unittype whichUnitType returns boolean
  • constant native IsUnit takes unit whichUnit, unit whichSpecifiedUnit returns boolean
  • constant native IsUnitInRange takes unit whichUnit, unit otherUnit, real distance returns boolean
  • constant native IsUnitInRangeXY takes unit whichUnit, real x, real y, real distance returns boolean
  • constant native IsUnitInRangeLoc takes unit whichUnit, location whichLocation, real distance returns boolean
  • constant native IsUnitHidden takes unit whichUnit returns boolean
  • constant native IsUnitIllusion takes unit whichUnit returns boolean
  • constant native IsUnitInTransport takes unit whichUnit, unit whichTransport returns boolean
  • constant native IsUnitLoaded takes unit whichUnit returns boolean
  • constant native IsHeroUnitId takes integer unitId returns boolean
  • constant native IsUnitIdType takes integer unitId, unittype whichUnitType returns boolean
  • native UnitShareVision takes unit whichUnit, player whichPlayer, boolean share returns nothing
  • native UnitSuspendDecay takes unit whichUnit, boolean suspend returns nothing
  • native UnitAddType takes unit whichUnit, unittype whichUnitType returns boolean
  • native UnitRemoveType takes unit whichUnit, unittype whichUnitType returns boolean
  • native UnitAddAbility takes unit whichUnit, integer abilityId returns boolean
  • native UnitRemoveAbility takes unit whichUnit, integer abilityId returns boolean
  • native UnitMakeAbilityPermanent takes unit whichUnit, boolean permanent, integer abilityId returns boolean
  • native UnitRemoveBuffs takes unit whichUnit, boolean removePositive, boolean removeNegative returns nothing
  • native UnitRemoveBuffsEx takes unit whichUnit, boolean removePositive, boolean removeNegative, boolean magic, boolean physical, boolean timedLife, boolean aura, boolean autoDispel returns nothing
  • native UnitHasBuffsEx takes unit whichUnit, boolean removePositive, boolean removeNegative, boolean magic, boolean physical, boolean timedLife, boolean aura, boolean autoDispel returns boolean
  • native UnitCountBuffsEx takes unit whichUnit, boolean removePositive, boolean removeNegative, boolean magic, boolean physical, boolean timedLife, boolean aura, boolean autoDispel returns integer
  • native UnitAddSleep takes unit whichUnit, boolean add returns nothing
  • native UnitCanSleep takes unit whichUnit returns boolean
  • native UnitAddSleepPerm takes unit whichUnit, boolean add returns nothing
  • native UnitCanSleepPerm takes unit whichUnit returns boolean
  • native UnitIsSleeping takes unit whichUnit returns boolean
  • native UnitWakeUp takes unit whichUnit returns nothing
  • native UnitApplyTimedLife takes unit whichUnit, integer buffId, real duration returns nothing
  • native UnitIgnoreAlarm takes unit whichUnit, boolean flag returns boolean
  • native UnitIgnoreAlarmToggled takes unit whichUnit returns boolean
  • native UnitResetCooldown takes unit whichUnit returns nothing
  • native UnitSetConstructionProgress takes unit whichUnit, integer constructionPercentage returns nothing
  • native UnitSetUpgradeProgress takes unit whichUnit, integer upgradePercentage returns nothing
  • native UnitPauseTimedLife takes unit whichUnit, boolean flag returns nothing
  • native UnitSetUsesAltIcon takes unit whichUnit, boolean flag returns nothing
  • native UnitDamagePoint takes unit whichUnit, real delay, real radius, real x, real y, real amount, boolean attack, boolean ranged, attacktype attackType, damagetype damageType, weapontype weaponType returns boolean
  • native UnitDamageTarget takes unit whichUnit, widget target, real amount, boolean attack, boolean ranged, attacktype attackType, damagetype damageType, weapontype weaponType returns boolean
  • native IssueImmediateOrder takes unit whichUnit, string order returns boolean
  • native IssueImmediateOrderById takes unit whichUnit, integer order returns boolean
  • native IssuePointOrder takes unit whichUnit, string order, real x, real y returns boolean
  • native IssuePointOrderLoc takes unit whichUnit, string order, location whichLocation returns boolean
  • native IssuePointOrderById takes unit whichUnit, integer order, real x, real y returns boolean
  • native IssuePointOrderByIdLoc takes unit whichUnit, integer order, location whichLocation returns boolean
  • native IssueTargetOrder takes unit whichUnit, string order, widget targetWidget returns boolean
  • native IssueTargetOrderById takes unit whichUnit, integer order, widget targetWidget returns boolean
  • native IssueInstantPointOrder takes unit whichUnit, string order, real x, real y, widget instantTargetWidget returns boolean
  • native IssueInstantPointOrderById takes unit whichUnit, integer order, real x, real y, widget instantTargetWidget returns boolean
  • native IssueInstantTargetOrder takes unit whichUnit, string order, widget targetWidget, widget instantTargetWidget returns boolean
  • native IssueInstantTargetOrderById takes unit whichUnit, integer order, widget targetWidget, widget instantTargetWidget returns boolean
  • native IssueBuildOrder takes unit whichPeon, string unitToBuild, real x, real y returns boolean
  • native IssueBuildOrderById takes unit whichPeon, integer unitId, real x, real y returns boolean
  • native AddItemToAllStock takes integer itemId, integer currentStock, integer stockMax returns nothing
  • native AddItemToStock takes unit whichUnit, integer itemId, integer currentStock, integer stockMax returns nothing
  • native AddUnitToAllStock takes integer unitId, integer currentStock, integer stockMax returns nothing
  • native AddUnitToStock takes unit whichUnit, integer unitId, integer currentStock, integer stockMax returns nothing

玩家 API[编辑]

  • constant native Player takes integer number returns player
  • constant native GetLocalPlayer takes nothing returns player
  • constant native IsPlayerAlly takes player whichPlayer, player otherPlayer returns boolean
  • constant native IsPlayerEnemy takes player whichPlayer, player otherPlayer returns boolean
  • constant native IsPlayerInForce takes player whichPlayer, force whichForce returns boolean
  • constant native IsPlayerObserver takes player whichPlayer returns boolean
  • constant native IsVisibleToPlayer takes real x, real y, player whichPlayer returns boolean
  • constant native IsLocationVisibleToPlayer takes location whichLocation, player whichPlayer returns boolean
  • constant native IsFoggedToPlayer takes real x, real y, player whichPlayer returns boolean
  • constant native IsLocationFoggedToPlayer takes location whichLocation, player whichPlayer returns boolean
  • constant native IsMaskedToPlayer takes real x, real y, player whichPlayer returns boolean
  • constant native IsLocationMaskedToPlayer takes location whichLocation, player whichPlayer returns boolean
  • constant native GetPlayerRace takes player whichPlayer returns race
  • constant native GetPlayerId takes player whichPlayer returns integer
  • constant native GetPlayerUnitCount takes player whichPlayer, boolean includeIncomplete returns integer
  • constant native GetPlayerTypedUnitCount takes player whichPlayer, string unitName, boolean includeIncomplete, boolean includeUpgrades returns integer
  • constant native GetPlayerStructureCount takes player whichPlayer, boolean includeIncomplete returns integer
  • constant native GetPlayerState takes player whichPlayer, playerstate whichPlayerState returns integer
  • constant native GetPlayerScore takes player whichPlayer, playerscore whichPlayerScore returns integer
  • constant native GetPlayerAlliance takes player sourcePlayer, player otherPlayer, alliancetype whichAllianceSetting returns boolean
  • constant native SetPlayerTechMaxAllowed takes player whichPlayer, integer techid, integer maximum returns nothing
  • constant native GetPlayerTechMaxAllowed takes player whichPlayer, integer techid returns integer
  • constant native AddPlayerTechResearched takes player whichPlayer, integer techid, integer levels returns nothing
  • constant native SetPlayerTechResearched takes player whichPlayer, integer techid, integer setToLevel returns nothing
  • constant native GetPlayerTechResearched takes player whichPlayer, integer techid, boolean specificonly returns boolean
  • constant native GetPlayerTechCount takes player whichPlayer, integer techid, boolean specificonly returns integer
  • native SetPlayerUnitsOwner takes player whichPlayer, integer newOwner returns nothing
  • native CripplePlayer takes player whichPlayer, force toWhichPlayers, boolean flag returns nothing
  • native SetPlayerState takes player whichPlayer, playerstate whichPlayerState, integer value returns nothing
  • native RemovePlayer takes player whichPlayer, playergameresult gameResult returns nothing
  • native CachePlayerHeroData takes player whichPlayer returns nothing // Used to store hero level data for the scorescreen before units are moved to neutral passive in melee games

战争迷雾 API[编辑]

  • native SetFogStateRect takes player forWhichPlayer, fogstate whichState, rect where, boolean useSharedVision returns nothing
  • native SetFogStateRadius takes player forWhichPlayer, fogstate whichState, real centerx, real centerY, real radius, boolean useSharedVision returns nothing
  • native SetFogStateRadiusLoc takes player forWhichPlayer, fogstate whichState, location center, real radius, boolean useSharedVision returns nothing
  • native FogMaskEnable takes boolean enable returns nothing
  • native IsFogMaskEnabled takes nothing returns boolean
  • native FogEnable takes boolean enable returns nothing
  • native IsFogEnabled takes nothing returns boolean
  • native CreateFogModifierRect takes player forWhichPlayer, fogstate whichState, rect where, boolean useSharedVision, boolean afterUnits returns fogmodifier
  • native CreateFogModifierRadius takes player forWhichPlayer, fogstate whichState, real centerx, real centerY, real radius, boolean useSharedVision, boolean afterUnits returns fogmodifier
  • native CreateFogModifierRadiusLoc takes player forWhichPlayer, fogstate whichState, location center, real radius, boolean useSharedVision, boolean afterUnits returns fogmodifier
  • native DestroyFogModifier takes fogmodifier whichFogModifier returns nothing
  • native FogModifierStart takes fogmodifier whichFogModifier returns nothing
  • native FogModifierStop takes fogmodifier whichFogModifier returns nothing

游戏 API[编辑]

  • native EndGame takes boolean doScoreScreen returns nothing

仅限异步[编辑]

  • native ChangeLevel takes string newLevel, boolean doScoreScreen returns nothing
  • native RestartGame takes boolean doScoreScreen returns nothing
  • native ReloadGame takes nothing returns nothing
  • native SetCampaignMenuRace takes race r returns nothing // 已过时。保留在这里的原因是为了兼容老地图,但所有的新地图都应当使用SetCampaignMenuRaceEx来替代本函数。
  • native SetCampaignMenuRaceEx takes integer campaignIndex returns nothing
  • native ForceCampaignSelectScreen takes nothing returns nothing
  • native LoadGame takes string saveFileName, boolean doScoreScreen returns nothing
  • native SaveGame takes string saveFileName returns nothing
  • native RenameSaveDirectory takes string sourceDirName, string destDirName returns boolean
  • native RemoveSaveDirectory takes string sourceDirName returns boolean
  • native CopySaveGame takes string sourceSaveName, string destSaveName returns boolean
  • native SaveGameExists takes string saveName returns boolean
  • native SyncSelections takes nothing returns nothing
  • native SetFloatGameState takes fgamestate whichFloatGameState, real value returns nothing
  • constant native GetFloatGameState takes fgamestate whichFloatGameState returns real
  • native SetIntegerGameState takes igamestate whichIntegerGameState, integer value returns nothing
  • constant native GetIntegerGameState takes igamestate whichIntegerGameState returns integer

战役 API[编辑]

对话框 API[编辑]

  • native DialogCreate takes nothing returns dialog
  • native DialogDestroy takes dialog whichDialog returns nothing
  • native DialogClear takes dialog whichDialog returns nothing
  • native DialogSetMessage takes dialog whichDialog, string messageText returns nothing
  • native DialogAddButton takes dialog whichDialog, string buttonText, integer hotkey returns button
  • native DialogAddQuitButton takes dialog whichDialog, boolean doScoreScreen, string buttonText, integer hotkey returns button
  • native DialogDisplay takes player whichPlayer, dialog whichDialog, boolean flag returns nothing
  • native ReloadGameCachesFromDisk takes nothing returns boolean // Creates a new or reads in an existing game cache file stored in the current campaign profile dir
  • native StoreInteger takes gamecache cache, string missionKey, string key, integer value returns nothing
  • native StoreReal takes gamecache cache, string missionKey, string key, real value returns nothing
  • native StoreBoolean takes gamecache cache, string missionKey, string key, boolean value returns nothing
  • native StoreUnit takes gamecache cache, string missionKey, string key, unit whichUnit returns boolean
  • native StoreString takes gamecache cache, string missionKey, string key, string value returns boolean
  • native SyncStoredInteger takes gamecache cache, string missionKey, string key returns nothing
  • native SyncStoredReal takes gamecache cache, string missionKey, string key returns nothing
  • native SyncStoredBoolean takes gamecache cache, string missionKey, string key returns nothing
  • native SyncStoredUnit takes gamecache cache, string missionKey, string key returns nothing
  • native SyncStoredString takes gamecache cache, string missionKey, string key returns nothing
  • native HaveStoredInteger takes gamecache cache, string missionKey, string key returns boolean
  • native HaveStoredReal takes gamecache cache, string missionKey, string key returns boolean
  • native HaveStoredBoolean takes gamecache cache, string missionKey, string key returns boolean
  • native HaveStoredUnit takes gamecache cache, string missionKey, string key returns boolean
  • native HaveStoredString takes gamecache cache, string missionKey, string key returns boolean
  • native FlushGameCache takes gamecache cache returns nothing
  • native FlushStoredMission takes gamecache cache, string missionKey returns nothing
  • native FlushStoredInteger takes gamecache cache, string missionKey, string key returns nothing
  • native FlushStoredReal takes gamecache cache, string missionKey, string key returns nothing
  • native FlushStoredBoolean takes gamecache cache, string missionKey, string key returns nothing
  • native FlushStoredUnit takes gamecache cache, string missionKey, string key returns nothing
  • native FlushStoredString takes gamecache cache, string missionKey, string key returns nothing

Will return 0 if the specified value's data is not found in the cache

  • native GetStoredInteger takes gamecache cache, string missionKey, string key returns integer
  • native GetStoredReal takes gamecache cache, string missionKey, string key returns real
  • native GetStoredBoolean takes gamecache cache, string missionKey, string key returns boolean
  • native GetStoredString takes gamecache cache, string missionKey, string key returns string
  • native RestoreUnit takes gamecache cache, string missionKey, string key, player forWhichPlayer, real x, real y, real facing returns unit
  • native SaveInteger takes hashtable table, integer parentKey, integer childKey, integer value returns nothing
  • native SaveReal takes hashtable table, integer parentKey, integer childKey, real value returns nothing
  • native SaveBoolean takes hashtable table, integer parentKey, integer childKey, boolean value returns nothing
  • native SaveStr takes hashtable table, integer parentKey, integer childKey, string value returns boolean
  • native SavePlayerHandle takes hashtable table, integer parentKey, integer childKey, player whichPlayer returns boolean
  • native SaveWidgetHandle takes hashtable table, integer parentKey, integer childKey, widget whichWidget returns boolean
  • native SaveDestructableHandle takes hashtable table, integer parentKey, integer childKey, destructable whichDestructable returns boolean
  • native SaveItemHandle takes hashtable table, integer parentKey, integer childKey, item whichItem returns boolean
  • native SaveUnitHandle takes hashtable table, integer parentKey, integer childKey, unit whichUnit returns boolean
  • native SaveAbilityHandle takes hashtable table, integer parentKey, integer childKey, ability whichAbility returns boolean
  • native SaveTimerHandle takes hashtable table, integer parentKey, integer childKey, timer whichTimer returns boolean
  • native SaveTriggerHandle takes hashtable table, integer parentKey, integer childKey, trigger whichTrigger returns boolean
  • native SaveTriggerConditionHandle takes hashtable table, integer parentKey, integer childKey, triggercondition whichTriggercondition returns boolean
  • native SaveTriggerActionHandle takes hashtable table, integer parentKey, integer childKey, triggeraction whichTriggeraction returns boolean
  • native SaveTriggerEventHandle takes hashtable table, integer parentKey, integer childKey, event whichEvent returns boolean
  • native SaveForceHandle takes hashtable table, integer parentKey, integer childKey, force whichForce returns boolean
  • native SaveGroupHandle takes hashtable table, integer parentKey, integer childKey, group whichGroup returns boolean
  • native SaveLocationHandle takes hashtable table, integer parentKey, integer childKey, location whichLocation returns boolean
  • native SaveRectHandle takes hashtable table, integer parentKey, integer childKey, rect whichRect returns boolean
  • native SaveBooleanExprHandle takes hashtable table, integer parentKey, integer childKey, boolexpr whichBoolexpr returns boolean
  • native SaveSoundHandle takes hashtable table, integer parentKey, integer childKey, sound whichSound returns boolean
  • native SaveEffectHandle takes hashtable table, integer parentKey, integer childKey, effect whichEffect returns boolean
  • native SaveUnitPoolHandle takes hashtable table, integer parentKey, integer childKey, unitpool whichUnitpool returns boolean
  • native SaveItemPoolHandle takes hashtable table, integer parentKey, integer childKey, itempool whichItempool returns boolean
  • native SaveQuestHandle takes hashtable table, integer parentKey, integer childKey, quest whichQuest returns boolean
  • native SaveQuestItemHandle takes hashtable table, integer parentKey, integer childKey, questitem whichQuestitem returns boolean
  • native SaveDefeatConditionHandle takes hashtable table, integer parentKey, integer childKey, defeatcondition whichDefeatcondition returns boolean
  • native SaveTimerDialogHandle takes hashtable table, integer parentKey, integer childKey, timerdialog whichTimerdialog returns boolean
  • native SaveLeaderboardHandle takes hashtable table, integer parentKey, integer childKey, leaderboard whichLeaderboard returns boolean
  • native SaveMultiboardHandle takes hashtable table, integer parentKey, integer childKey, multiboard whichMultiboard returns boolean
  • native SaveMultiboardItemHandle takes hashtable table, integer parentKey, integer childKey, multiboarditem whichMultiboarditem returns boolean
  • native SaveTrackableHandle takes hashtable table, integer parentKey, integer childKey, trackable whichTrackable returns boolean
  • native SaveDialogHandle takes hashtable table, integer parentKey, integer childKey, dialog whichDialog returns boolean
  • native SaveButtonHandle takes hashtable table, integer parentKey, integer childKey, button whichButton returns boolean
  • native SaveTextTagHandle takes hashtable table, integer parentKey, integer childKey, texttag whichTexttag returns boolean
  • native SaveLightningHandle takes hashtable table, integer parentKey, integer childKey, lightning whichLightning returns boolean
  • native SaveImageHandle takes hashtable table, integer parentKey, integer childKey, image whichImage returns boolean
  • native SaveUbersplatHandle takes hashtable table, integer parentKey, integer childKey, ubersplat whichUbersplat returns boolean
  • native SaveRegionHandle takes hashtable table, integer parentKey, integer childKey, region whichRegion returns boolean
  • native SaveFogStateHandle takes hashtable table, integer parentKey, integer childKey, fogstate whichFogState returns boolean
  • native SaveFogModifierHandle takes hashtable table, integer parentKey, integer childKey, fogmodifier whichFogModifier returns boolean
  • native SaveAgentHandle takes hashtable table, integer parentKey, integer childKey, agent whichAgent returns boolean
  • native SaveHashtableHandle takes hashtable table, integer parentKey, integer childKey, hashtable whichHashtable returns boolean
  • native LoadInteger takes hashtable table, integer parentKey, integer childKey returns integer
  • native LoadReal takes hashtable table, integer parentKey, integer childKey returns real
  • native LoadBoolean takes hashtable table, integer parentKey, integer childKey returns boolean
  • native LoadStr takes hashtable table, integer parentKey, integer childKey returns string
  • native LoadPlayerHandle takes hashtable table, integer parentKey, integer childKey returns player
  • native LoadWidgetHandle takes hashtable table, integer parentKey, integer childKey returns widget
  • native LoadDestructableHandle takes hashtable table, integer parentKey, integer childKey returns destructable
  • native LoadItemHandle takes hashtable table, integer parentKey, integer childKey returns item
  • native LoadUnitHandle takes hashtable table, integer parentKey, integer childKey returns unit
  • native LoadAbilityHandle takes hashtable table, integer parentKey, integer childKey returns ability
  • native LoadTimerHandle takes hashtable table, integer parentKey, integer childKey returns timer
  • native LoadTriggerHandle takes hashtable table, integer parentKey, integer childKey returns trigger
  • native LoadTriggerConditionHandle takes hashtable table, integer parentKey, integer childKey returns triggercondition
  • native LoadTriggerActionHandle takes hashtable table, integer parentKey, integer childKey returns triggeraction
  • native LoadTriggerEventHandle takes hashtable table, integer parentKey, integer childKey returns event
  • native LoadForceHandle takes hashtable table, integer parentKey, integer childKey returns force
  • native LoadGroupHandle takes hashtable table, integer parentKey, integer childKey returns group
  • native LoadLocationHandle takes hashtable table, integer parentKey, integer childKey returns location
  • native LoadRectHandle takes hashtable table, integer parentKey, integer childKey returns rect
  • native LoadBooleanExprHandle takes hashtable table, integer parentKey, integer childKey returns boolexpr
  • native LoadSoundHandle takes hashtable table, integer parentKey, integer childKey returns sound
  • native LoadEffectHandle takes hashtable table, integer parentKey, integer childKey returns effect
  • native LoadUnitPoolHandle takes hashtable table, integer parentKey, integer childKey returns unitpool
  • native LoadItemPoolHandle takes hashtable table, integer parentKey, integer childKey returns itempool
  • native LoadQuestHandle takes hashtable table, integer parentKey, integer childKey returns quest
  • native LoadQuestItemHandle takes hashtable table, integer parentKey, integer childKey returns questitem
  • native LoadDefeatConditionHandle takes hashtable table, integer parentKey, integer childKey returns defeatcondition
  • native LoadTimerDialogHandle takes hashtable table, integer parentKey, integer childKey returns timerdialog
  • native LoadLeaderboardHandle takes hashtable table, integer parentKey, integer childKey returns leaderboard
  • native LoadMultiboardHandle takes hashtable table, integer parentKey, integer childKey returns multiboard
  • native LoadMultiboardItemHandle takes hashtable table, integer parentKey, integer childKey returns multiboarditem
  • native LoadTrackableHandle takes hashtable table, integer parentKey, integer childKey returns trackable
  • native LoadDialogHandle takes hashtable table, integer parentKey, integer childKey returns dialog
  • native LoadButtonHandle takes hashtable table, integer parentKey, integer childKey returns button
  • native LoadTextTagHandle takes hashtable table, integer parentKey, integer childKey returns texttag
  • native LoadLightningHandle takes hashtable table, integer parentKey, integer childKey returns lightning
  • native LoadImageHandle takes hashtable table, integer parentKey, integer childKey returns image
  • native LoadUbersplatHandle takes hashtable table, integer parentKey, integer childKey returns ubersplat
  • native LoadRegionHandle takes hashtable table, integer parentKey, integer childKey returns region
  • native LoadFogStateHandle takes hashtable table, integer parentKey, integer childKey returns fogstate
  • native LoadFogModifierHandle takes hashtable table, integer parentKey, integer childKey returns fogmodifier
  • native LoadHashtableHandle takes hashtable table, integer parentKey, integer childKey returns hashtable
  • native HaveSavedInteger takes hashtable table, integer parentKey, integer childKey returns boolean
  • native HaveSavedReal takes hashtable table, integer parentKey, integer childKey returns boolean
  • native HaveSavedBoolean takes hashtable table, integer parentKey, integer childKey returns boolean
  • native HaveSavedString takes hashtable table, integer parentKey, integer childKey returns boolean
  • native HaveSavedHandle takes hashtable table, integer parentKey, integer childKey returns boolean
  • native RemoveSavedInteger takes hashtable table, integer parentKey, integer childKey returns nothing
  • native RemoveSavedReal takes hashtable table, integer parentKey, integer childKey returns nothing
  • native RemoveSavedBoolean takes hashtable table, integer parentKey, integer childKey returns nothing
  • native RemoveSavedString takes hashtable table, integer parentKey, integer childKey returns nothing
  • native RemoveSavedHandle takes hashtable table, integer parentKey, integer childKey returns nothing

随机相关 API[编辑]

  • native GetRandomInt takes integer lowBound, integer highBound returns integer
  • native GetRandomReal takes real lowBound, real highBound returns real

Choose any random unit/item. (NP means Neutral Passive)

视觉相关 API[编辑]

可追踪物 API[编辑]

  • native CreateTrackable takes string trackableModelPath, real x, real y, real facing returns trackable

任务 API[编辑]

  • native QuestSetRequired takes quest whichQuest, boolean required returns nothing
  • native QuestSetCompleted takes quest whichQuest, boolean completed returns nothing
  • native QuestSetDiscovered takes quest whichQuest, boolean discovered returns nothing
  • native QuestSetFailed takes quest whichQuest, boolean failed returns nothing
  • native QuestSetEnabled takes quest whichQuest, boolean enabled returns nothing

计时器窗口 API[编辑]

排行榜 API[编辑]

  • native LeaderboardSetLabelColor takes leaderboard lb, integer red, integer green, integer blue, integer alpha returns nothing
  • native LeaderboardSetValueColor takes leaderboard lb, integer red, integer green, integer blue, integer alpha returns nothing
  • native LeaderboardSetStyle takes leaderboard lb, boolean showLabel, boolean showNames, boolean showValues, boolean showIcons returns nothing
  • native LeaderboardSetItemValue takes leaderboard lb, integer whichItem, integer val returns nothing
  • native LeaderboardSetItemLabel takes leaderboard lb, integer whichItem, string val returns nothing
  • native LeaderboardSetItemStyle takes leaderboard lb, integer whichItem, boolean showLabel, boolean showValue, boolean showIcon returns nothing
  • native LeaderboardSetItemLabelColor takes leaderboard lb, integer whichItem, integer red, integer green, integer blue, integer alpha returns nothing
  • native LeaderboardSetItemValueColor takes leaderboard lb, integer whichItem, integer red, integer green, integer blue, integer alpha returns nothing

多面板 API[编辑]

broadcast settings to all items

funcs for modifying individual items

meant to unequivocally suspend display of existing and subsequently displayed multiboards

镜头 API[编辑]

  • native SetCinematicScene takes integer portraitUnitId, playercolor color, string speakerTitle, string text, real sceneDuration, real voiceoverDuration returns nothing
  • native EndCinematicScene takes nothing returns nothing
  • native ForceCinematicSubtitles takes boolean flag returns nothing

These return values for the local players camera only...

音频 API[编辑]

  • native CreateSound takes string fileName, boolean looping, boolean is3D, boolean stopwhenoutofrange, integer fadeInRate, integer fadeOutRate, string eaxSetting returns sound
  • native CreateSoundFilenameWithLabel takes string fileName, boolean looping, boolean is3D, boolean stopwhenoutofrange, integer fadeInRate, integer fadeOutRate, string SLKEntryName returns sound
  • native CreateSoundFromLabel takes string soundLabel, boolean looping, boolean is3D, boolean stopwhenoutofrange, integer fadeInRate, integer fadeOutRate returns sound
  • native CreateMIDISound takes string soundLabel, integer fadeInRate, integer fadeOutRate returns sound

the following method must be called immediately after calling "StartSound"

these calls are only valid if the sound was created with 3d enabled

  • native SetSoundDistances takes sound soundHandle, real minDist, real maxDist returns nothing
  • native SetSoundConeAngles takes sound soundHandle, real inside, real outside, integer outsideVolume returns nothing
  • native SetSoundConeOrientation takes sound soundHandle, real x, real y, real z returns nothing
  • native SetSoundPosition takes sound soundHandle, real x, real y, real z returns nothing
  • native SetSoundVelocity takes sound soundHandle, real x, real y, real z returns nothing
  • native AttachSoundToUnit takes sound soundHandle, unit whichUnit returns nothing
  • native StartSound takes sound soundHandle returns nothing
  • native StopSound takes sound soundHandle, boolean killWhenDone, boolean fadeOut returns nothing
  • native KillSoundWhenDone takes sound soundHandle returns nothing

Music Interface. Note that if music is disabled, these calls do nothing

  • native SetMapMusic takes string musicName, boolean random, integer index returns nothing
  • native ClearMapMusic takes nothing returns nothing
  • native PlayMusic takes string musicName returns nothing
  • native PlayMusicEx takes string musicName, integer frommsecs, integer fadeinmsecs returns nothing
  • native StopMusic takes boolean fadeOut returns nothing
  • native ResumeMusic takes nothing returns nothing

other music and sound calls

  • native RegisterStackedSound takes sound soundHandle, boolean byPosition, real rectwidth, real rectheight returns nothing
  • native UnregisterStackedSound takes sound soundHandle, boolean byPosition, real rectwidth, real rectheight returns nothing

特效 API[编辑]

  • native TerrainDeformCrater takes real x, real y, real radius, real depth, integer duration, boolean permanent returns terraindeformation
  • native TerrainDeformRipple takes real x, real y, real radius, real depth, integer duration, integer count, real spaceWaves, real timeWaves, real radiusStartPct, boolean limitNeg returns terraindeformation
  • native TerrainDeformWave takes real x, real y, real dirX, real dirY, real distance, real speed, real radius, real depth, integer trailTime, integer count returns terraindeformation
  • native TerrainDeformRandom takes real x, real y, real radius, real minDelta, real maxDelta, integer duration, integer updateInterval returns terraindeformation
  • native TerrainDeformStop takes terraindeformation deformation, integer duration returns nothing
  • native TerrainDeformStopAll takes nothing returns nothing
  • native AddSpellEffect takes string abilityString, effecttype t, real x, real y returns effect
  • native AddSpellEffectLoc takes string abilityString, effecttype t,location where returns effect
  • native AddSpellEffectById takes integer abilityId, effecttype t,real x, real y returns effect
  • native AddSpellEffectByIdLoc takes integer abilityId, effecttype t,location where returns effect
  • native AddSpellEffectTarget takes string modelName, effecttype t, widget targetWidget, string attachPoint returns effect
  • native AddSpellEffectTargetById takes integer abilityId, effecttype t, widget targetWidget, string attachPoint returns effect
  • native AddLightning takes string codeName, boolean checkVisibility, real x1, real y1, real x2, real y2 returns lightning
  • native AddLightningEx takes string codeName, boolean checkVisibility, real x1, real y1, real z1, real x2, real y2, real z2 returns lightning
  • native DestroyLightning takes lightning whichBolt returns boolean
  • native MoveLightning takes lightning whichBolt, boolean checkVisibility, real x1, real y1, real x2, real y2 returns boolean
  • native MoveLightningEx takes lightning whichBolt, boolean checkVisibility, real x1, real y1, real z1, real x2, real y2, real z2 returns boolean
  • native GetLightningColorA takes lightning whichBolt returns real
  • native GetLightningColorR takes lightning whichBolt returns real
  • native GetLightningColorG takes lightning whichBolt returns real
  • native GetLightningColorB takes lightning whichBolt returns real
  • native SetLightningColor takes lightning whichBolt, real r, real g, real b, real a returns boolean

地形 API[编辑]

图片 API[编辑]

  • native CreateImage takes string file, real sizeX, real sizeY, real sizeZ, real posX, real posY, real posZ, real originX, real originY, real originZ, integer imageType returns image
  • native DestroyImage takes image whichImage returns nothing
  • native ShowImage takes image whichImage, boolean flag returns nothing
  • native SetImageConstantHeight takes image whichImage, boolean flag, real height returns nothing
  • native SetImagePosition takes image whichImage, real x, real y, real z returns nothing
  • native SetImageColor takes image whichImage, integer red, integer green, integer blue, integer alpha returns nothing
  • native SetImageRender takes image whichImage, boolean flag returns nothing
  • native SetImageRenderAlways takes image whichImage, boolean flag returns nothing
  • native SetImageAboveWater takes image whichImage, boolean flag, boolean useWaterAlpha returns nothing
  • native SetImageType takes image whichImage, integer imageType returns nothing

地面纹理 API[编辑]

  • native CreateUbersplat takes real x, real y, string name, integer red, integer green, integer blue, integer alpha, boolean forcePaused, boolean noBirthTime returns ubersplat
  • native DestroyUbersplat takes ubersplat whichSplat returns nothing
  • native ResetUbersplat takes ubersplat whichSplat returns nothing
  • native FinishUbersplat takes ubersplat whichSplat returns nothing
  • native ShowUbersplat takes ubersplat whichSplat, boolean flag returns nothing
  • native SetUbersplatRender takes ubersplat whichSplat, boolean flag returns nothing
  • native SetUbersplatRenderAlways takes ubersplat whichSplat, boolean flag returns nothing

荒芜地表 API[编辑]

  • native SetBlight takes player whichPlayer, real x, real y, real radius, boolean addBlight returns nothing
  • native SetBlightRect takes player whichPlayer, rect r, boolean addBlight returns nothing
  • native SetBlightPoint takes player whichPlayer, real x, real y, boolean addBlight returns nothing
  • native SetBlightLoc takes player whichPlayer, location whichLocation, real radius, boolean addBlight returns nothing
  • native CreateBlightedGoldmine takes player id, real x, real y, real face returns unit
  • native IsPointBlighted takes real x, real y returns boolean

装饰物 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

电脑AI API[编辑]

  • native StartMeleeAI takes player num, string script returns nothing
  • native StartCampaignAI takes player num, string script returns nothing
  • native CommandAI takes player num, integer command, integer data returns nothing
  • native PauseCompAI takes player p, boolean pause returns nothing
  • native GetAIDifficulty takes player num returns aidifficulty

其它 API[编辑]

  • native Preload takes string filename returns nothing
  • native PreloadEnd takes real timeout returns nothing