1. //============================================================================
  2. // Native types. All native functions take extended handle types when
  3. // possible to help prevent passing bad values to native functions
  4. //
  5. type agent extends handle // all reference counted objects
  6. type event extends agent // a reference to an event registration
  7. type player extends agent // a single player reference
  8. type widget extends agent // an interactive game object with life
  9. type unit extends widget // a single unit reference
  10. type destructable extends widget
  11. type item extends widget
  12. type ability extends agent
  13. type buff extends ability
  14. type force extends agent
  15. type group extends agent
  16. type trigger extends agent
  17. type triggercondition extends agent
  18. type triggeraction extends handle
  19. type timer extends agent
  20. type location extends agent
  21. type region extends agent
  22. type rect extends agent
  23. type boolexpr extends agent
  24. type sound extends agent
  25. type conditionfunc extends boolexpr
  26. type filterfunc extends boolexpr
  27. type unitpool extends handle
  28. type itempool extends handle
  29. type race extends handle
  30. type alliancetype extends handle
  31. type racepreference extends handle
  32. type gamestate extends handle
  33. type igamestate extends gamestate
  34. type fgamestate extends gamestate
  35. type playerstate extends handle
  36. type playerscore extends handle
  37. type playergameresult extends handle
  38. type unitstate extends handle
  39. type aidifficulty extends handle
  40. type eventid extends handle
  41. type gameevent extends eventid
  42. type playerevent extends eventid
  43. type playerunitevent extends eventid
  44. type unitevent extends eventid
  45. type limitop extends eventid
  46. type widgetevent extends eventid
  47. type dialogevent extends eventid
  48. type unittype extends handle
  49. type gamespeed extends handle
  50. type gamedifficulty extends handle
  51. type gametype extends handle
  52. type mapflag extends handle
  53. type mapvisibility extends handle
  54. type mapsetting extends handle
  55. type mapdensity extends handle
  56. type mapcontrol extends handle
  57. type playerslotstate extends handle
  58. type volumegroup extends handle
  59. type camerafield extends handle
  60. type camerasetup extends handle
  61. type playercolor extends handle
  62. type placement extends handle
  63. type startlocprio extends handle
  64. type raritycontrol extends handle
  65. type blendmode extends handle
  66. type texmapflags extends handle
  67. type effect extends agent
  68. type effecttype extends handle
  69. type weathereffect extends handle
  70. type terraindeformation extends handle
  71. type fogstate extends handle
  72. type fogmodifier extends agent
  73. type dialog extends agent
  74. type button extends agent
  75. type quest extends agent
  76. type questitem extends agent
  77. type defeatcondition extends agent
  78. type timerdialog extends agent
  79. type leaderboard extends agent
  80. type multiboard extends agent
  81. type multiboarditem extends agent
  82. type trackable extends agent
  83. type gamecache extends agent
  84. type version extends handle
  85. type itemtype extends handle
  86. type texttag extends handle
  87. type attacktype extends handle
  88. type damagetype extends handle
  89. type weapontype extends handle
  90. type soundtype extends handle
  91. type lightning extends handle
  92. type pathingtype extends handle
  93. type mousebuttontype extends handle
  94. type image extends handle
  95. type ubersplat extends handle
  96. type hashtable extends agent
  97. constant native ConvertRace takes integer i returns race
  98. constant native ConvertAllianceType takes integer i returns alliancetype
  99. constant native ConvertRacePref takes integer i returns racepreference
  100. constant native ConvertIGameState takes integer i returns igamestate
  101. constant native ConvertFGameState takes integer i returns fgamestate
  102. constant native ConvertPlayerState takes integer i returns playerstate
  103. constant native ConvertPlayerScore takes integer i returns playerscore
  104. constant native ConvertPlayerGameResult takes integer i returns playergameresult
  105. constant native ConvertUnitState takes integer i returns unitstate
  106. constant native ConvertAIDifficulty takes integer i returns aidifficulty
  107. constant native ConvertGameEvent takes integer i returns gameevent
  108. constant native ConvertPlayerEvent takes integer i returns playerevent
  109. constant native ConvertPlayerUnitEvent takes integer i returns playerunitevent
  110. constant native ConvertWidgetEvent takes integer i returns widgetevent
  111. constant native ConvertDialogEvent takes integer i returns dialogevent
  112. constant native ConvertUnitEvent takes integer i returns unitevent
  113. constant native ConvertLimitOp takes integer i returns limitop
  114. constant native ConvertUnitType takes integer i returns unittype
  115. constant native ConvertGameSpeed takes integer i returns gamespeed
  116. constant native ConvertPlacement takes integer i returns placement
  117. constant native ConvertStartLocPrio takes integer i returns startlocprio
  118. constant native ConvertGameDifficulty takes integer i returns gamedifficulty
  119. constant native ConvertGameType takes integer i returns gametype
  120. constant native ConvertMapFlag takes integer i returns mapflag
  121. constant native ConvertMapVisibility takes integer i returns mapvisibility
  122. constant native ConvertMapSetting takes integer i returns mapsetting
  123. constant native ConvertMapDensity takes integer i returns mapdensity
  124. constant native ConvertMapControl takes integer i returns mapcontrol
  125. constant native ConvertPlayerColor takes integer i returns playercolor
  126. constant native ConvertPlayerSlotState takes integer i returns playerslotstate
  127. constant native ConvertVolumeGroup takes integer i returns volumegroup
  128. constant native ConvertCameraField takes integer i returns camerafield
  129. constant native ConvertBlendMode takes integer i returns blendmode
  130. constant native ConvertRarityControl takes integer i returns raritycontrol
  131. constant native ConvertTexMapFlags takes integer i returns texmapflags
  132. constant native ConvertFogState takes integer i returns fogstate
  133. constant native ConvertEffectType takes integer i returns effecttype
  134. constant native ConvertVersion takes integer i returns version
  135. constant native ConvertItemType takes integer i returns itemtype
  136. constant native ConvertAttackType takes integer i returns attacktype
  137. constant native ConvertDamageType takes integer i returns damagetype
  138. constant native ConvertWeaponType takes integer i returns weapontype
  139. constant native ConvertSoundType takes integer i returns soundtype
  140. constant native ConvertPathingType takes integer i returns pathingtype
  141. constant native ConvertMouseButtonType takes integer i returns mousebuttontype
  142. constant native OrderId takes string orderIdString returns integer
  143. constant native OrderId2String takes integer orderId returns string
  144. constant native UnitId takes string unitIdString returns integer
  145. constant native UnitId2String takes integer unitId returns string
  146. // Not currently working correctly...
  147. constant native AbilityId takes string abilityIdString returns integer
  148. constant native AbilityId2String takes integer abilityId returns string
  149. // Looks up the "name" field for any object (unit, item, ability)
  150. constant native GetObjectName takes integer objectId returns string
  151. constant native GetBJMaxPlayers takes nothing returns integer
  152. constant native GetBJPlayerNeutralVictim takes nothing returns integer
  153. constant native GetBJPlayerNeutralExtra takes nothing returns integer
  154. constant native GetBJMaxPlayerSlots takes nothing returns integer
  155. constant native GetPlayerNeutralPassive takes nothing returns integer
  156. constant native GetPlayerNeutralAggressive takes nothing returns integer
  157. globals
  158. //===================================================
  159. // Game Constants
  160. //===================================================
  161. // pfff
  162. constant boolean FALSE = false
  163. constant boolean TRUE = true
  164. constant integer JASS_MAX_ARRAY_SIZE = 8192
  165. constant integer PLAYER_NEUTRAL_PASSIVE = GetPlayerNeutralPassive()
  166. constant integer PLAYER_NEUTRAL_AGGRESSIVE = GetPlayerNeutralAggressive()
  167. constant playercolor PLAYER_COLOR_RED = ConvertPlayerColor(0)
  168. constant playercolor PLAYER_COLOR_BLUE = ConvertPlayerColor(1)
  169. constant playercolor PLAYER_COLOR_CYAN = ConvertPlayerColor(2)
  170. constant playercolor PLAYER_COLOR_PURPLE = ConvertPlayerColor(3)
  171. constant playercolor PLAYER_COLOR_YELLOW = ConvertPlayerColor(4)
  172. constant playercolor PLAYER_COLOR_ORANGE = ConvertPlayerColor(5)
  173. constant playercolor PLAYER_COLOR_GREEN = ConvertPlayerColor(6)
  174. constant playercolor PLAYER_COLOR_PINK = ConvertPlayerColor(7)
  175. constant playercolor PLAYER_COLOR_LIGHT_GRAY = ConvertPlayerColor(8)
  176. constant playercolor PLAYER_COLOR_LIGHT_BLUE = ConvertPlayerColor(9)
  177. constant playercolor PLAYER_COLOR_AQUA = ConvertPlayerColor(10)
  178. constant playercolor PLAYER_COLOR_BROWN = ConvertPlayerColor(11)
  179. constant race RACE_HUMAN = ConvertRace(1)
  180. constant race RACE_ORC = ConvertRace(2)
  181. constant race RACE_UNDEAD = ConvertRace(3)
  182. constant race RACE_NIGHTELF = ConvertRace(4)
  183. constant race RACE_DEMON = ConvertRace(5)
  184. constant race RACE_OTHER = ConvertRace(7)
  185. constant playergameresult PLAYER_GAME_RESULT_VICTORY = ConvertPlayerGameResult(0)
  186. constant playergameresult PLAYER_GAME_RESULT_DEFEAT = ConvertPlayerGameResult(1)
  187. constant playergameresult PLAYER_GAME_RESULT_TIE = ConvertPlayerGameResult(2)
  188. constant playergameresult PLAYER_GAME_RESULT_NEUTRAL = ConvertPlayerGameResult(3)
  189. constant alliancetype ALLIANCE_PASSIVE = ConvertAllianceType(0)
  190. constant alliancetype ALLIANCE_HELP_REQUEST = ConvertAllianceType(1)
  191. constant alliancetype ALLIANCE_HELP_RESPONSE = ConvertAllianceType(2)
  192. constant alliancetype ALLIANCE_SHARED_XP = ConvertAllianceType(3)
  193. constant alliancetype ALLIANCE_SHARED_SPELLS = ConvertAllianceType(4)
  194. constant alliancetype ALLIANCE_SHARED_VISION = ConvertAllianceType(5)
  195. constant alliancetype ALLIANCE_SHARED_CONTROL = ConvertAllianceType(6)
  196. constant alliancetype ALLIANCE_SHARED_ADVANCED_CONTROL= ConvertAllianceType(7)
  197. constant alliancetype ALLIANCE_RESCUABLE = ConvertAllianceType(8)
  198. constant alliancetype ALLIANCE_SHARED_VISION_FORCED = ConvertAllianceType(9)
  199. constant version VERSION_REIGN_OF_CHAOS = ConvertVersion(0)
  200. constant version VERSION_FROZEN_THRONE = ConvertVersion(1)
  201. constant attacktype ATTACK_TYPE_NORMAL = ConvertAttackType(0)
  202. constant attacktype ATTACK_TYPE_MELEE = ConvertAttackType(1)
  203. constant attacktype ATTACK_TYPE_PIERCE = ConvertAttackType(2)
  204. constant attacktype ATTACK_TYPE_SIEGE = ConvertAttackType(3)
  205. constant attacktype ATTACK_TYPE_MAGIC = ConvertAttackType(4)
  206. constant attacktype ATTACK_TYPE_CHAOS = ConvertAttackType(5)
  207. constant attacktype ATTACK_TYPE_HERO = ConvertAttackType(6)
  208. constant damagetype DAMAGE_TYPE_UNKNOWN = ConvertDamageType(0)
  209. constant damagetype DAMAGE_TYPE_NORMAL = ConvertDamageType(4)
  210. constant damagetype DAMAGE_TYPE_ENHANCED = ConvertDamageType(5)
  211. constant damagetype DAMAGE_TYPE_FIRE = ConvertDamageType(8)
  212. constant damagetype DAMAGE_TYPE_COLD = ConvertDamageType(9)
  213. constant damagetype DAMAGE_TYPE_LIGHTNING = ConvertDamageType(10)
  214. constant damagetype DAMAGE_TYPE_POISON = ConvertDamageType(11)
  215. constant damagetype DAMAGE_TYPE_DISEASE = ConvertDamageType(12)
  216. constant damagetype DAMAGE_TYPE_DIVINE = ConvertDamageType(13)
  217. constant damagetype DAMAGE_TYPE_MAGIC = ConvertDamageType(14)
  218. constant damagetype DAMAGE_TYPE_SONIC = ConvertDamageType(15)
  219. constant damagetype DAMAGE_TYPE_ACID = ConvertDamageType(16)
  220. constant damagetype DAMAGE_TYPE_FORCE = ConvertDamageType(17)
  221. constant damagetype DAMAGE_TYPE_DEATH = ConvertDamageType(18)
  222. constant damagetype DAMAGE_TYPE_MIND = ConvertDamageType(19)
  223. constant damagetype DAMAGE_TYPE_PLANT = ConvertDamageType(20)
  224. constant damagetype DAMAGE_TYPE_DEFENSIVE = ConvertDamageType(21)
  225. constant damagetype DAMAGE_TYPE_DEMOLITION = ConvertDamageType(22)
  226. constant damagetype DAMAGE_TYPE_SLOW_POISON = ConvertDamageType(23)
  227. constant damagetype DAMAGE_TYPE_SPIRIT_LINK = ConvertDamageType(24)
  228. constant damagetype DAMAGE_TYPE_SHADOW_STRIKE = ConvertDamageType(25)
  229. constant damagetype DAMAGE_TYPE_UNIVERSAL = ConvertDamageType(26)
  230. constant weapontype WEAPON_TYPE_WHOKNOWS = ConvertWeaponType(0)
  231. constant weapontype WEAPON_TYPE_METAL_LIGHT_CHOP = ConvertWeaponType(1)
  232. constant weapontype WEAPON_TYPE_METAL_MEDIUM_CHOP = ConvertWeaponType(2)
  233. constant weapontype WEAPON_TYPE_METAL_HEAVY_CHOP = ConvertWeaponType(3)
  234. constant weapontype WEAPON_TYPE_METAL_LIGHT_SLICE = ConvertWeaponType(4)
  235. constant weapontype WEAPON_TYPE_METAL_MEDIUM_SLICE = ConvertWeaponType(5)
  236. constant weapontype WEAPON_TYPE_METAL_HEAVY_SLICE = ConvertWeaponType(6)
  237. constant weapontype WEAPON_TYPE_METAL_MEDIUM_BASH = ConvertWeaponType(7)
  238. constant weapontype WEAPON_TYPE_METAL_HEAVY_BASH = ConvertWeaponType(8)
  239. constant weapontype WEAPON_TYPE_METAL_MEDIUM_STAB = ConvertWeaponType(9)
  240. constant weapontype WEAPON_TYPE_METAL_HEAVY_STAB = ConvertWeaponType(10)
  241. constant weapontype WEAPON_TYPE_WOOD_LIGHT_SLICE = ConvertWeaponType(11)
  242. constant weapontype WEAPON_TYPE_WOOD_MEDIUM_SLICE = ConvertWeaponType(12)
  243. constant weapontype WEAPON_TYPE_WOOD_HEAVY_SLICE = ConvertWeaponType(13)
  244. constant weapontype WEAPON_TYPE_WOOD_LIGHT_BASH = ConvertWeaponType(14)
  245. constant weapontype WEAPON_TYPE_WOOD_MEDIUM_BASH = ConvertWeaponType(15)
  246. constant weapontype WEAPON_TYPE_WOOD_HEAVY_BASH = ConvertWeaponType(16)
  247. constant weapontype WEAPON_TYPE_WOOD_LIGHT_STAB = ConvertWeaponType(17)
  248. constant weapontype WEAPON_TYPE_WOOD_MEDIUM_STAB = ConvertWeaponType(18)
  249. constant weapontype WEAPON_TYPE_CLAW_LIGHT_SLICE = ConvertWeaponType(19)
  250. constant weapontype WEAPON_TYPE_CLAW_MEDIUM_SLICE = ConvertWeaponType(20)
  251. constant weapontype WEAPON_TYPE_CLAW_HEAVY_SLICE = ConvertWeaponType(21)
  252. constant weapontype WEAPON_TYPE_AXE_MEDIUM_CHOP = ConvertWeaponType(22)
  253. constant weapontype WEAPON_TYPE_ROCK_HEAVY_BASH = ConvertWeaponType(23)
  254. constant pathingtype PATHING_TYPE_ANY = ConvertPathingType(0)
  255. constant pathingtype PATHING_TYPE_WALKABILITY = ConvertPathingType(1)
  256. constant pathingtype PATHING_TYPE_FLYABILITY = ConvertPathingType(2)
  257. constant pathingtype PATHING_TYPE_BUILDABILITY = ConvertPathingType(3)
  258. constant pathingtype PATHING_TYPE_PEONHARVESTPATHING = ConvertPathingType(4)
  259. constant pathingtype PATHING_TYPE_BLIGHTPATHING = ConvertPathingType(5)
  260. constant pathingtype PATHING_TYPE_FLOATABILITY = ConvertPathingType(6)
  261. constant pathingtype PATHING_TYPE_AMPHIBIOUSPATHING = ConvertPathingType(7)
  262. constant mousebuttontype MOUSE_BUTTON_TYPE_LEFT = ConvertMouseButtonType(1)
  263. constant mousebuttontype MOUSE_BUTTON_TYPE_MIDDLE = ConvertMouseButtonType(2)
  264. constant mousebuttontype MOUSE_BUTTON_TYPE_RIGHT = ConvertMouseButtonType(3)
  265. //===================================================
  266. // Map Setup Constants
  267. //===================================================
  268. constant racepreference RACE_PREF_HUMAN = ConvertRacePref(1)
  269. constant racepreference RACE_PREF_ORC = ConvertRacePref(2)
  270. constant racepreference RACE_PREF_NIGHTELF = ConvertRacePref(4)
  271. constant racepreference RACE_PREF_UNDEAD = ConvertRacePref(8)
  272. constant racepreference RACE_PREF_DEMON = ConvertRacePref(16)
  273. constant racepreference RACE_PREF_RANDOM = ConvertRacePref(32)
  274. constant racepreference RACE_PREF_USER_SELECTABLE = ConvertRacePref(64)
  275. constant mapcontrol MAP_CONTROL_USER = ConvertMapControl(0)
  276. constant mapcontrol MAP_CONTROL_COMPUTER = ConvertMapControl(1)
  277. constant mapcontrol MAP_CONTROL_RESCUABLE = ConvertMapControl(2)
  278. constant mapcontrol MAP_CONTROL_NEUTRAL = ConvertMapControl(3)
  279. constant mapcontrol MAP_CONTROL_CREEP = ConvertMapControl(4)
  280. constant mapcontrol MAP_CONTROL_NONE = ConvertMapControl(5)
  281. constant gametype GAME_TYPE_MELEE = ConvertGameType(1)
  282. constant gametype GAME_TYPE_FFA = ConvertGameType(2)
  283. constant gametype GAME_TYPE_USE_MAP_SETTINGS = ConvertGameType(4)
  284. constant gametype GAME_TYPE_BLIZ = ConvertGameType(8)
  285. constant gametype GAME_TYPE_ONE_ON_ONE = ConvertGameType(16)
  286. constant gametype GAME_TYPE_TWO_TEAM_PLAY = ConvertGameType(32)
  287. constant gametype GAME_TYPE_THREE_TEAM_PLAY = ConvertGameType(64)
  288. constant gametype GAME_TYPE_FOUR_TEAM_PLAY = ConvertGameType(128)
  289. constant mapflag MAP_FOG_HIDE_TERRAIN = ConvertMapFlag(1)
  290. constant mapflag MAP_FOG_MAP_EXPLORED = ConvertMapFlag(2)
  291. constant mapflag MAP_FOG_ALWAYS_VISIBLE = ConvertMapFlag(4)
  292. constant mapflag MAP_USE_HANDICAPS = ConvertMapFlag(8)
  293. constant mapflag MAP_OBSERVERS = ConvertMapFlag(16)
  294. constant mapflag MAP_OBSERVERS_ON_DEATH = ConvertMapFlag(32)
  295. constant mapflag MAP_FIXED_COLORS = ConvertMapFlag(128)
  296. constant mapflag MAP_LOCK_RESOURCE_TRADING = ConvertMapFlag(256)
  297. constant mapflag MAP_RESOURCE_TRADING_ALLIES_ONLY = ConvertMapFlag(512)
  298. constant mapflag MAP_LOCK_ALLIANCE_CHANGES = ConvertMapFlag(1024)
  299. constant mapflag MAP_ALLIANCE_CHANGES_HIDDEN = ConvertMapFlag(2048)
  300. constant mapflag MAP_CHEATS = ConvertMapFlag(4096)
  301. constant mapflag MAP_CHEATS_HIDDEN = ConvertMapFlag(8192)
  302. constant mapflag MAP_LOCK_SPEED = ConvertMapFlag(8192*2)
  303. constant mapflag MAP_LOCK_RANDOM_SEED = ConvertMapFlag(8192*4)
  304. constant mapflag MAP_SHARED_ADVANCED_CONTROL = ConvertMapFlag(8192*8)
  305. constant mapflag MAP_RANDOM_HERO = ConvertMapFlag(8192*16)
  306. constant mapflag MAP_RANDOM_RACES = ConvertMapFlag(8192*32)
  307. constant mapflag MAP_RELOADED = ConvertMapFlag(8192*64)
  308. constant placement MAP_PLACEMENT_RANDOM = ConvertPlacement(0) // random among all slots
  309. constant placement MAP_PLACEMENT_FIXED = ConvertPlacement(1) // player 0 in start loc 0...
  310. constant placement MAP_PLACEMENT_USE_MAP_SETTINGS = ConvertPlacement(2) // whatever was specified by the script
  311. constant placement MAP_PLACEMENT_TEAMS_TOGETHER = ConvertPlacement(3) // random with allies next to each other
  312. constant startlocprio MAP_LOC_PRIO_LOW = ConvertStartLocPrio(0)
  313. constant startlocprio MAP_LOC_PRIO_HIGH = ConvertStartLocPrio(1)
  314. constant startlocprio MAP_LOC_PRIO_NOT = ConvertStartLocPrio(2)
  315. constant mapdensity MAP_DENSITY_NONE = ConvertMapDensity(0)
  316. constant mapdensity MAP_DENSITY_LIGHT = ConvertMapDensity(1)
  317. constant mapdensity MAP_DENSITY_MEDIUM = ConvertMapDensity(2)
  318. constant mapdensity MAP_DENSITY_HEAVY = ConvertMapDensity(3)
  319. constant gamedifficulty MAP_DIFFICULTY_EASY = ConvertGameDifficulty(0)
  320. constant gamedifficulty MAP_DIFFICULTY_NORMAL = ConvertGameDifficulty(1)
  321. constant gamedifficulty MAP_DIFFICULTY_HARD = ConvertGameDifficulty(2)
  322. constant gamedifficulty MAP_DIFFICULTY_INSANE = ConvertGameDifficulty(3)
  323. constant gamespeed MAP_SPEED_SLOWEST = ConvertGameSpeed(0)
  324. constant gamespeed MAP_SPEED_SLOW = ConvertGameSpeed(1)
  325. constant gamespeed MAP_SPEED_NORMAL = ConvertGameSpeed(2)
  326. constant gamespeed MAP_SPEED_FAST = ConvertGameSpeed(3)
  327. constant gamespeed MAP_SPEED_FASTEST = ConvertGameSpeed(4)
  328. constant playerslotstate PLAYER_SLOT_STATE_EMPTY = ConvertPlayerSlotState(0)
  329. constant playerslotstate PLAYER_SLOT_STATE_PLAYING = ConvertPlayerSlotState(1)
  330. constant playerslotstate PLAYER_SLOT_STATE_LEFT = ConvertPlayerSlotState(2)
  331. //===================================================
  332. // Sound Constants
  333. //===================================================
  334. constant volumegroup SOUND_VOLUMEGROUP_UNITMOVEMENT = ConvertVolumeGroup(0)
  335. constant volumegroup SOUND_VOLUMEGROUP_UNITSOUNDS = ConvertVolumeGroup(1)
  336. constant volumegroup SOUND_VOLUMEGROUP_COMBAT = ConvertVolumeGroup(2)
  337. constant volumegroup SOUND_VOLUMEGROUP_SPELLS = ConvertVolumeGroup(3)
  338. constant volumegroup SOUND_VOLUMEGROUP_UI = ConvertVolumeGroup(4)
  339. constant volumegroup SOUND_VOLUMEGROUP_MUSIC = ConvertVolumeGroup(5)
  340. constant volumegroup SOUND_VOLUMEGROUP_AMBIENTSOUNDS = ConvertVolumeGroup(6)
  341. constant volumegroup SOUND_VOLUMEGROUP_FIRE = ConvertVolumeGroup(7)
  342. //===================================================
  343. // Game, Player, and Unit States
  344. //
  345. // For use with TriggerRegister<X>StateEvent
  346. //
  347. //===================================================
  348. constant igamestate GAME_STATE_DIVINE_INTERVENTION = ConvertIGameState(0)
  349. constant igamestate GAME_STATE_DISCONNECTED = ConvertIGameState(1)
  350. constant fgamestate GAME_STATE_TIME_OF_DAY = ConvertFGameState(2)
  351. constant playerstate PLAYER_STATE_GAME_RESULT = ConvertPlayerState(0)
  352. // current resource levels
  353. //
  354. constant playerstate PLAYER_STATE_RESOURCE_GOLD = ConvertPlayerState(1)
  355. constant playerstate PLAYER_STATE_RESOURCE_LUMBER = ConvertPlayerState(2)
  356. constant playerstate PLAYER_STATE_RESOURCE_HERO_TOKENS = ConvertPlayerState(3)
  357. constant playerstate PLAYER_STATE_RESOURCE_FOOD_CAP = ConvertPlayerState(4)
  358. constant playerstate PLAYER_STATE_RESOURCE_FOOD_USED = ConvertPlayerState(5)
  359. constant playerstate PLAYER_STATE_FOOD_CAP_CEILING = ConvertPlayerState(6)
  360. constant playerstate PLAYER_STATE_GIVES_BOUNTY = ConvertPlayerState(7)
  361. constant playerstate PLAYER_STATE_ALLIED_VICTORY = ConvertPlayerState(8)
  362. constant playerstate PLAYER_STATE_PLACED = ConvertPlayerState(9)
  363. constant playerstate PLAYER_STATE_OBSERVER_ON_DEATH = ConvertPlayerState(10)
  364. constant playerstate PLAYER_STATE_OBSERVER = ConvertPlayerState(11)
  365. constant playerstate PLAYER_STATE_UNFOLLOWABLE = ConvertPlayerState(12)
  366. // taxation rate for each resource
  367. //
  368. constant playerstate PLAYER_STATE_GOLD_UPKEEP_RATE = ConvertPlayerState(13)
  369. constant playerstate PLAYER_STATE_LUMBER_UPKEEP_RATE = ConvertPlayerState(14)
  370. // cumulative resources collected by the player during the mission
  371. //
  372. constant playerstate PLAYER_STATE_GOLD_GATHERED = ConvertPlayerState(15)
  373. constant playerstate PLAYER_STATE_LUMBER_GATHERED = ConvertPlayerState(16)
  374. constant playerstate PLAYER_STATE_NO_CREEP_SLEEP = ConvertPlayerState(25)
  375. constant unitstate UNIT_STATE_LIFE = ConvertUnitState(0)
  376. constant unitstate UNIT_STATE_MAX_LIFE = ConvertUnitState(1)
  377. constant unitstate UNIT_STATE_MANA = ConvertUnitState(2)
  378. constant unitstate UNIT_STATE_MAX_MANA = ConvertUnitState(3)
  379. constant aidifficulty AI_DIFFICULTY_NEWBIE = ConvertAIDifficulty(0)
  380. constant aidifficulty AI_DIFFICULTY_NORMAL = ConvertAIDifficulty(1)
  381. constant aidifficulty AI_DIFFICULTY_INSANE = ConvertAIDifficulty(2)
  382. // player score values
  383. constant playerscore PLAYER_SCORE_UNITS_TRAINED = ConvertPlayerScore(0)
  384. constant playerscore PLAYER_SCORE_UNITS_KILLED = ConvertPlayerScore(1)
  385. constant playerscore PLAYER_SCORE_STRUCT_BUILT = ConvertPlayerScore(2)
  386. constant playerscore PLAYER_SCORE_STRUCT_RAZED = ConvertPlayerScore(3)
  387. constant playerscore PLAYER_SCORE_TECH_PERCENT = ConvertPlayerScore(4)
  388. constant playerscore PLAYER_SCORE_FOOD_MAXPROD = ConvertPlayerScore(5)
  389. constant playerscore PLAYER_SCORE_FOOD_MAXUSED = ConvertPlayerScore(6)
  390. constant playerscore PLAYER_SCORE_HEROES_KILLED = ConvertPlayerScore(7)
  391. constant playerscore PLAYER_SCORE_ITEMS_GAINED = ConvertPlayerScore(8)
  392. constant playerscore PLAYER_SCORE_MERCS_HIRED = ConvertPlayerScore(9)
  393. constant playerscore PLAYER_SCORE_GOLD_MINED_TOTAL = ConvertPlayerScore(10)
  394. constant playerscore PLAYER_SCORE_GOLD_MINED_UPKEEP = ConvertPlayerScore(11)
  395. constant playerscore PLAYER_SCORE_GOLD_LOST_UPKEEP = ConvertPlayerScore(12)
  396. constant playerscore PLAYER_SCORE_GOLD_LOST_TAX = ConvertPlayerScore(13)
  397. constant playerscore PLAYER_SCORE_GOLD_GIVEN = ConvertPlayerScore(14)
  398. constant playerscore PLAYER_SCORE_GOLD_RECEIVED = ConvertPlayerScore(15)
  399. constant playerscore PLAYER_SCORE_LUMBER_TOTAL = ConvertPlayerScore(16)
  400. constant playerscore PLAYER_SCORE_LUMBER_LOST_UPKEEP = ConvertPlayerScore(17)
  401. constant playerscore PLAYER_SCORE_LUMBER_LOST_TAX = ConvertPlayerScore(18)
  402. constant playerscore PLAYER_SCORE_LUMBER_GIVEN = ConvertPlayerScore(19)
  403. constant playerscore PLAYER_SCORE_LUMBER_RECEIVED = ConvertPlayerScore(20)
  404. constant playerscore PLAYER_SCORE_UNIT_TOTAL = ConvertPlayerScore(21)
  405. constant playerscore PLAYER_SCORE_HERO_TOTAL = ConvertPlayerScore(22)
  406. constant playerscore PLAYER_SCORE_RESOURCE_TOTAL = ConvertPlayerScore(23)
  407. constant playerscore PLAYER_SCORE_TOTAL = ConvertPlayerScore(24)
  408. //===================================================
  409. // Game, Player and Unit Events
  410. //
  411. // When an event causes a trigger to fire these
  412. // values allow the action code to determine which
  413. // event was dispatched and therefore which set of
  414. // native functions should be used to get information
  415. // about the event.
  416. //
  417. // Do NOT change the order or value of these constants
  418. // without insuring that the JASS_GAME_EVENTS_WAR3 enum
  419. // is changed to match.
  420. //
  421. //===================================================
  422. //===================================================
  423. // For use with TriggerRegisterGameEvent
  424. //===================================================
  425. constant gameevent EVENT_GAME_VICTORY = ConvertGameEvent(0)
  426. constant gameevent EVENT_GAME_END_LEVEL = ConvertGameEvent(1)
  427. constant gameevent EVENT_GAME_VARIABLE_LIMIT = ConvertGameEvent(2)
  428. constant gameevent EVENT_GAME_STATE_LIMIT = ConvertGameEvent(3)
  429. constant gameevent EVENT_GAME_TIMER_EXPIRED = ConvertGameEvent(4)
  430. constant gameevent EVENT_GAME_ENTER_REGION = ConvertGameEvent(5)
  431. constant gameevent EVENT_GAME_LEAVE_REGION = ConvertGameEvent(6)
  432. constant gameevent EVENT_GAME_TRACKABLE_HIT = ConvertGameEvent(7)
  433. constant gameevent EVENT_GAME_TRACKABLE_TRACK = ConvertGameEvent(8)
  434. constant gameevent EVENT_GAME_SHOW_SKILL = ConvertGameEvent(9)
  435. constant gameevent EVENT_GAME_BUILD_SUBMENU = ConvertGameEvent(10)
  436. //===================================================
  437. // For use with TriggerRegisterPlayerEvent
  438. //===================================================
  439. constant playerevent EVENT_PLAYER_STATE_LIMIT = ConvertPlayerEvent(11)
  440. constant playerevent EVENT_PLAYER_ALLIANCE_CHANGED = ConvertPlayerEvent(12)
  441. constant playerevent EVENT_PLAYER_DEFEAT = ConvertPlayerEvent(13)
  442. constant playerevent EVENT_PLAYER_VICTORY = ConvertPlayerEvent(14)
  443. constant playerevent EVENT_PLAYER_LEAVE = ConvertPlayerEvent(15)
  444. constant playerevent EVENT_PLAYER_CHAT = ConvertPlayerEvent(16)
  445. constant playerevent EVENT_PLAYER_END_CINEMATIC = ConvertPlayerEvent(17)
  446. //===================================================
  447. // For use with TriggerRegisterPlayerUnitEvent
  448. //===================================================
  449. constant playerunitevent EVENT_PLAYER_UNIT_ATTACKED = ConvertPlayerUnitEvent(18)
  450. constant playerunitevent EVENT_PLAYER_UNIT_RESCUED = ConvertPlayerUnitEvent(19)
  451. constant playerunitevent EVENT_PLAYER_UNIT_DEATH = ConvertPlayerUnitEvent(20)
  452. constant playerunitevent EVENT_PLAYER_UNIT_DECAY = ConvertPlayerUnitEvent(21)
  453. constant playerunitevent EVENT_PLAYER_UNIT_DETECTED = ConvertPlayerUnitEvent(22)
  454. constant playerunitevent EVENT_PLAYER_UNIT_HIDDEN = ConvertPlayerUnitEvent(23)
  455. constant playerunitevent EVENT_PLAYER_UNIT_SELECTED = ConvertPlayerUnitEvent(24)
  456. constant playerunitevent EVENT_PLAYER_UNIT_DESELECTED = ConvertPlayerUnitEvent(25)
  457. constant playerunitevent EVENT_PLAYER_UNIT_CONSTRUCT_START = ConvertPlayerUnitEvent(26)
  458. constant playerunitevent EVENT_PLAYER_UNIT_CONSTRUCT_CANCEL = ConvertPlayerUnitEvent(27)
  459. constant playerunitevent EVENT_PLAYER_UNIT_CONSTRUCT_FINISH = ConvertPlayerUnitEvent(28)
  460. constant playerunitevent EVENT_PLAYER_UNIT_UPGRADE_START = ConvertPlayerUnitEvent(29)
  461. constant playerunitevent EVENT_PLAYER_UNIT_UPGRADE_CANCEL = ConvertPlayerUnitEvent(30)
  462. constant playerunitevent EVENT_PLAYER_UNIT_UPGRADE_FINISH = ConvertPlayerUnitEvent(31)
  463. constant playerunitevent EVENT_PLAYER_UNIT_TRAIN_START = ConvertPlayerUnitEvent(32)
  464. constant playerunitevent EVENT_PLAYER_UNIT_TRAIN_CANCEL = ConvertPlayerUnitEvent(33)
  465. constant playerunitevent EVENT_PLAYER_UNIT_TRAIN_FINISH = ConvertPlayerUnitEvent(34)
  466. constant playerunitevent EVENT_PLAYER_UNIT_RESEARCH_START = ConvertPlayerUnitEvent(35)
  467. constant playerunitevent EVENT_PLAYER_UNIT_RESEARCH_CANCEL = ConvertPlayerUnitEvent(36)
  468. constant playerunitevent EVENT_PLAYER_UNIT_RESEARCH_FINISH = ConvertPlayerUnitEvent(37)
  469. constant playerunitevent EVENT_PLAYER_UNIT_ISSUED_ORDER = ConvertPlayerUnitEvent(38)
  470. constant playerunitevent EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER = ConvertPlayerUnitEvent(39)
  471. constant playerunitevent EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER = ConvertPlayerUnitEvent(40)
  472. constant playerunitevent EVENT_PLAYER_UNIT_ISSUED_UNIT_ORDER = ConvertPlayerUnitEvent(40) // for compat
  473. constant playerunitevent EVENT_PLAYER_HERO_LEVEL = ConvertPlayerUnitEvent(41)
  474. constant playerunitevent EVENT_PLAYER_HERO_SKILL = ConvertPlayerUnitEvent(42)
  475. constant playerunitevent EVENT_PLAYER_HERO_REVIVABLE = ConvertPlayerUnitEvent(43)
  476. constant playerunitevent EVENT_PLAYER_HERO_REVIVE_START = ConvertPlayerUnitEvent(44)
  477. constant playerunitevent EVENT_PLAYER_HERO_REVIVE_CANCEL = ConvertPlayerUnitEvent(45)
  478. constant playerunitevent EVENT_PLAYER_HERO_REVIVE_FINISH = ConvertPlayerUnitEvent(46)
  479. constant playerunitevent EVENT_PLAYER_UNIT_SUMMON = ConvertPlayerUnitEvent(47)
  480. constant playerunitevent EVENT_PLAYER_UNIT_DROP_ITEM = ConvertPlayerUnitEvent(48)
  481. constant playerunitevent EVENT_PLAYER_UNIT_PICKUP_ITEM = ConvertPlayerUnitEvent(49)
  482. constant playerunitevent EVENT_PLAYER_UNIT_USE_ITEM = ConvertPlayerUnitEvent(50)
  483. constant playerunitevent EVENT_PLAYER_UNIT_LOADED = ConvertPlayerUnitEvent(51)
  484. //===================================================
  485. // For use with TriggerRegisterUnitEvent
  486. //===================================================
  487. constant unitevent EVENT_UNIT_DAMAGED = ConvertUnitEvent(52)
  488. constant unitevent EVENT_UNIT_DEATH = ConvertUnitEvent(53)
  489. constant unitevent EVENT_UNIT_DECAY = ConvertUnitEvent(54)
  490. constant unitevent EVENT_UNIT_DETECTED = ConvertUnitEvent(55)
  491. constant unitevent EVENT_UNIT_HIDDEN = ConvertUnitEvent(56)
  492. constant unitevent EVENT_UNIT_SELECTED = ConvertUnitEvent(57)
  493. constant unitevent EVENT_UNIT_DESELECTED = ConvertUnitEvent(58)
  494. constant unitevent EVENT_UNIT_STATE_LIMIT = ConvertUnitEvent(59)
  495. // Events which may have a filter for the "other unit"
  496. //
  497. constant unitevent EVENT_UNIT_ACQUIRED_TARGET = ConvertUnitEvent(60)
  498. constant unitevent EVENT_UNIT_TARGET_IN_RANGE = ConvertUnitEvent(61)
  499. constant unitevent EVENT_UNIT_ATTACKED = ConvertUnitEvent(62)
  500. constant unitevent EVENT_UNIT_RESCUED = ConvertUnitEvent(63)
  501. constant unitevent EVENT_UNIT_CONSTRUCT_CANCEL = ConvertUnitEvent(64)
  502. constant unitevent EVENT_UNIT_CONSTRUCT_FINISH = ConvertUnitEvent(65)
  503. constant unitevent EVENT_UNIT_UPGRADE_START = ConvertUnitEvent(66)
  504. constant unitevent EVENT_UNIT_UPGRADE_CANCEL = ConvertUnitEvent(67)
  505. constant unitevent EVENT_UNIT_UPGRADE_FINISH = ConvertUnitEvent(68)
  506. // Events which involve the specified unit performing
  507. // training of other units
  508. //
  509. constant unitevent EVENT_UNIT_TRAIN_START = ConvertUnitEvent(69)
  510. constant unitevent EVENT_UNIT_TRAIN_CANCEL = ConvertUnitEvent(70)
  511. constant unitevent EVENT_UNIT_TRAIN_FINISH = ConvertUnitEvent(71)
  512. constant unitevent EVENT_UNIT_RESEARCH_START = ConvertUnitEvent(72)
  513. constant unitevent EVENT_UNIT_RESEARCH_CANCEL = ConvertUnitEvent(73)
  514. constant unitevent EVENT_UNIT_RESEARCH_FINISH = ConvertUnitEvent(74)
  515. constant unitevent EVENT_UNIT_ISSUED_ORDER = ConvertUnitEvent(75)
  516. constant unitevent EVENT_UNIT_ISSUED_POINT_ORDER = ConvertUnitEvent(76)
  517. constant unitevent EVENT_UNIT_ISSUED_TARGET_ORDER = ConvertUnitEvent(77)
  518. constant unitevent EVENT_UNIT_HERO_LEVEL = ConvertUnitEvent(78)
  519. constant unitevent EVENT_UNIT_HERO_SKILL = ConvertUnitEvent(79)
  520. constant unitevent EVENT_UNIT_HERO_REVIVABLE = ConvertUnitEvent(80)
  521. constant unitevent EVENT_UNIT_HERO_REVIVE_START = ConvertUnitEvent(81)
  522. constant unitevent EVENT_UNIT_HERO_REVIVE_CANCEL = ConvertUnitEvent(82)
  523. constant unitevent EVENT_UNIT_HERO_REVIVE_FINISH = ConvertUnitEvent(83)
  524. constant unitevent EVENT_UNIT_SUMMON = ConvertUnitEvent(84)
  525. constant unitevent EVENT_UNIT_DROP_ITEM = ConvertUnitEvent(85)
  526. constant unitevent EVENT_UNIT_PICKUP_ITEM = ConvertUnitEvent(86)
  527. constant unitevent EVENT_UNIT_USE_ITEM = ConvertUnitEvent(87)
  528. constant unitevent EVENT_UNIT_LOADED = ConvertUnitEvent(88)
  529. constant widgetevent EVENT_WIDGET_DEATH = ConvertWidgetEvent(89)
  530. constant dialogevent EVENT_DIALOG_BUTTON_CLICK = ConvertDialogEvent(90)
  531. constant dialogevent EVENT_DIALOG_CLICK = ConvertDialogEvent(91)
  532. //===================================================
  533. // Frozen Throne Expansion Events
  534. // Need to be added here to preserve compat
  535. //===================================================
  536. //===================================================
  537. // For use with TriggerRegisterGameEvent
  538. //===================================================
  539. constant gameevent EVENT_GAME_LOADED = ConvertGameEvent(256)
  540. constant gameevent EVENT_GAME_TOURNAMENT_FINISH_SOON = ConvertGameEvent(257)
  541. constant gameevent EVENT_GAME_TOURNAMENT_FINISH_NOW = ConvertGameEvent(258)
  542. constant gameevent EVENT_GAME_SAVE = ConvertGameEvent(259)
  543. //===================================================
  544. // For use with TriggerRegisterPlayerEvent
  545. //===================================================
  546. constant playerevent EVENT_PLAYER_ARROW_LEFT_DOWN = ConvertPlayerEvent(261)
  547. constant playerevent EVENT_PLAYER_ARROW_LEFT_UP = ConvertPlayerEvent(262)
  548. constant playerevent EVENT_PLAYER_ARROW_RIGHT_DOWN = ConvertPlayerEvent(263)
  549. constant playerevent EVENT_PLAYER_ARROW_RIGHT_UP = ConvertPlayerEvent(264)
  550. constant playerevent EVENT_PLAYER_ARROW_DOWN_DOWN = ConvertPlayerEvent(265)
  551. constant playerevent EVENT_PLAYER_ARROW_DOWN_UP = ConvertPlayerEvent(266)
  552. constant playerevent EVENT_PLAYER_ARROW_UP_DOWN = ConvertPlayerEvent(267)
  553. constant playerevent EVENT_PLAYER_ARROW_UP_UP = ConvertPlayerEvent(268)
  554. constant playerevent EVENT_PLAYER_MOUSE_DOWN = ConvertPlayerEvent(269)
  555. constant playerevent EVENT_PLAYER_MOUSE_UP = ConvertPlayerEvent(270)
  556. constant playerevent EVENT_PLAYER_MOUSE_MOVE = ConvertPlayerEvent(271)
  557. //===================================================
  558. // For use with TriggerRegisterPlayerUnitEvent
  559. //===================================================
  560. constant playerunitevent EVENT_PLAYER_UNIT_SELL = ConvertPlayerUnitEvent(272)
  561. constant playerunitevent EVENT_PLAYER_UNIT_CHANGE_OWNER = ConvertPlayerUnitEvent(273)
  562. constant playerunitevent EVENT_PLAYER_UNIT_SELL_ITEM = ConvertPlayerUnitEvent(274)
  563. constant playerunitevent EVENT_PLAYER_UNIT_SPELL_CHANNEL = ConvertPlayerUnitEvent(275)
  564. constant playerunitevent EVENT_PLAYER_UNIT_SPELL_CAST = ConvertPlayerUnitEvent(276)
  565. constant playerunitevent EVENT_PLAYER_UNIT_SPELL_EFFECT = ConvertPlayerUnitEvent(277)
  566. constant playerunitevent EVENT_PLAYER_UNIT_SPELL_FINISH = ConvertPlayerUnitEvent(278)
  567. constant playerunitevent EVENT_PLAYER_UNIT_SPELL_ENDCAST = ConvertPlayerUnitEvent(279)
  568. constant playerunitevent EVENT_PLAYER_UNIT_PAWN_ITEM = ConvertPlayerUnitEvent(280)
  569. //===================================================
  570. // For use with TriggerRegisterUnitEvent
  571. //===================================================
  572. constant unitevent EVENT_UNIT_SELL = ConvertUnitEvent(289)
  573. constant unitevent EVENT_UNIT_CHANGE_OWNER = ConvertUnitEvent(290)
  574. constant unitevent EVENT_UNIT_SELL_ITEM = ConvertUnitEvent(291)
  575. constant unitevent EVENT_UNIT_SPELL_CHANNEL = ConvertUnitEvent(292)
  576. constant unitevent EVENT_UNIT_SPELL_CAST = ConvertUnitEvent(293)
  577. constant unitevent EVENT_UNIT_SPELL_EFFECT = ConvertUnitEvent(294)
  578. constant unitevent EVENT_UNIT_SPELL_FINISH = ConvertUnitEvent(295)
  579. constant unitevent EVENT_UNIT_SPELL_ENDCAST = ConvertUnitEvent(296)
  580. constant unitevent EVENT_UNIT_PAWN_ITEM = ConvertUnitEvent(297)
  581. //===================================================
  582. // Limit Event API constants
  583. // variable, player state, game state, and unit state events
  584. // ( do NOT change the order of these... )
  585. //===================================================
  586. constant limitop LESS_THAN = ConvertLimitOp(0)
  587. constant limitop LESS_THAN_OR_EQUAL = ConvertLimitOp(1)
  588. constant limitop EQUAL = ConvertLimitOp(2)
  589. constant limitop GREATER_THAN_OR_EQUAL = ConvertLimitOp(3)
  590. constant limitop GREATER_THAN = ConvertLimitOp(4)
  591. constant limitop NOT_EQUAL = ConvertLimitOp(5)
  592. //===================================================
  593. // Unit Type Constants for use with IsUnitType()
  594. //===================================================
  595. constant unittype UNIT_TYPE_HERO = ConvertUnitType(0)
  596. constant unittype UNIT_TYPE_DEAD = ConvertUnitType(1)
  597. constant unittype UNIT_TYPE_STRUCTURE = ConvertUnitType(2)
  598. constant unittype UNIT_TYPE_FLYING = ConvertUnitType(3)
  599. constant unittype UNIT_TYPE_GROUND = ConvertUnitType(4)
  600. constant unittype UNIT_TYPE_ATTACKS_FLYING = ConvertUnitType(5)
  601. constant unittype UNIT_TYPE_ATTACKS_GROUND = ConvertUnitType(6)
  602. constant unittype UNIT_TYPE_MELEE_ATTACKER = ConvertUnitType(7)
  603. constant unittype UNIT_TYPE_RANGED_ATTACKER = ConvertUnitType(8)
  604. constant unittype UNIT_TYPE_GIANT = ConvertUnitType(9)
  605. constant unittype UNIT_TYPE_SUMMONED = ConvertUnitType(10)
  606. constant unittype UNIT_TYPE_STUNNED = ConvertUnitType(11)
  607. constant unittype UNIT_TYPE_PLAGUED = ConvertUnitType(12)
  608. constant unittype UNIT_TYPE_SNARED = ConvertUnitType(13)
  609. constant unittype UNIT_TYPE_UNDEAD = ConvertUnitType(14)
  610. constant unittype UNIT_TYPE_MECHANICAL = ConvertUnitType(15)
  611. constant unittype UNIT_TYPE_PEON = ConvertUnitType(16)
  612. constant unittype UNIT_TYPE_SAPPER = ConvertUnitType(17)
  613. constant unittype UNIT_TYPE_TOWNHALL = ConvertUnitType(18)
  614. constant unittype UNIT_TYPE_ANCIENT = ConvertUnitType(19)
  615. constant unittype UNIT_TYPE_TAUREN = ConvertUnitType(20)
  616. constant unittype UNIT_TYPE_POISONED = ConvertUnitType(21)
  617. constant unittype UNIT_TYPE_POLYMORPHED = ConvertUnitType(22)
  618. constant unittype UNIT_TYPE_SLEEPING = ConvertUnitType(23)
  619. constant unittype UNIT_TYPE_RESISTANT = ConvertUnitType(24)
  620. constant unittype UNIT_TYPE_ETHEREAL = ConvertUnitType(25)
  621. constant unittype UNIT_TYPE_MAGIC_IMMUNE = ConvertUnitType(26)
  622. //===================================================
  623. // Unit Type Constants for use with ChooseRandomItemEx()
  624. //===================================================
  625. constant itemtype ITEM_TYPE_PERMANENT = ConvertItemType(0)
  626. constant itemtype ITEM_TYPE_CHARGED = ConvertItemType(1)
  627. constant itemtype ITEM_TYPE_POWERUP = ConvertItemType(2)
  628. constant itemtype ITEM_TYPE_ARTIFACT = ConvertItemType(3)
  629. constant itemtype ITEM_TYPE_PURCHASABLE = ConvertItemType(4)
  630. constant itemtype ITEM_TYPE_CAMPAIGN = ConvertItemType(5)
  631. constant itemtype ITEM_TYPE_MISCELLANEOUS = ConvertItemType(6)
  632. constant itemtype ITEM_TYPE_UNKNOWN = ConvertItemType(7)
  633. constant itemtype ITEM_TYPE_ANY = ConvertItemType(8)
  634. // Deprecated, should use ITEM_TYPE_POWERUP
  635. constant itemtype ITEM_TYPE_TOME = ConvertItemType(2)
  636. //===================================================
  637. // Animatable Camera Fields
  638. //===================================================
  639. constant camerafield CAMERA_FIELD_TARGET_DISTANCE = ConvertCameraField(0)
  640. constant camerafield CAMERA_FIELD_FARZ = ConvertCameraField(1)
  641. constant camerafield CAMERA_FIELD_ANGLE_OF_ATTACK = ConvertCameraField(2)
  642. constant camerafield CAMERA_FIELD_FIELD_OF_VIEW = ConvertCameraField(3)
  643. constant camerafield CAMERA_FIELD_ROLL = ConvertCameraField(4)
  644. constant camerafield CAMERA_FIELD_ROTATION = ConvertCameraField(5)
  645. constant camerafield CAMERA_FIELD_ZOFFSET = ConvertCameraField(6)
  646. constant blendmode BLEND_MODE_NONE = ConvertBlendMode(0)
  647. constant blendmode BLEND_MODE_DONT_CARE = ConvertBlendMode(0)
  648. constant blendmode BLEND_MODE_KEYALPHA = ConvertBlendMode(1)
  649. constant blendmode BLEND_MODE_BLEND = ConvertBlendMode(2)
  650. constant blendmode BLEND_MODE_ADDITIVE = ConvertBlendMode(3)
  651. constant blendmode BLEND_MODE_MODULATE = ConvertBlendMode(4)
  652. constant blendmode BLEND_MODE_MODULATE_2X = ConvertBlendMode(5)
  653. constant raritycontrol RARITY_FREQUENT = ConvertRarityControl(0)
  654. constant raritycontrol RARITY_RARE = ConvertRarityControl(1)
  655. constant texmapflags TEXMAP_FLAG_NONE = ConvertTexMapFlags(0)
  656. constant texmapflags TEXMAP_FLAG_WRAP_U = ConvertTexMapFlags(1)
  657. constant texmapflags TEXMAP_FLAG_WRAP_V = ConvertTexMapFlags(2)
  658. constant texmapflags TEXMAP_FLAG_WRAP_UV = ConvertTexMapFlags(3)
  659. constant fogstate FOG_OF_WAR_MASKED = ConvertFogState(1)
  660. constant fogstate FOG_OF_WAR_FOGGED = ConvertFogState(2)
  661. constant fogstate FOG_OF_WAR_VISIBLE = ConvertFogState(4)
  662. //===================================================
  663. // Camera Margin constants for use with GetCameraMargin
  664. //===================================================
  665. constant integer CAMERA_MARGIN_LEFT = 0
  666. constant integer CAMERA_MARGIN_RIGHT = 1
  667. constant integer CAMERA_MARGIN_TOP = 2
  668. constant integer CAMERA_MARGIN_BOTTOM = 3
  669. //===================================================
  670. // Effect API constants
  671. //===================================================
  672. constant effecttype EFFECT_TYPE_EFFECT = ConvertEffectType(0)
  673. constant effecttype EFFECT_TYPE_TARGET = ConvertEffectType(1)
  674. constant effecttype EFFECT_TYPE_CASTER = ConvertEffectType(2)
  675. constant effecttype EFFECT_TYPE_SPECIAL = ConvertEffectType(3)
  676. constant effecttype EFFECT_TYPE_AREA_EFFECT = ConvertEffectType(4)
  677. constant effecttype EFFECT_TYPE_MISSILE = ConvertEffectType(5)
  678. constant effecttype EFFECT_TYPE_LIGHTNING = ConvertEffectType(6)
  679. constant soundtype SOUND_TYPE_EFFECT = ConvertSoundType(0)
  680. constant soundtype SOUND_TYPE_EFFECT_LOOPED = ConvertSoundType(1)
  681. endglobals
  682. //============================================================================
  683. // MathAPI
  684. native Deg2Rad takes real degrees returns real
  685. native Rad2Deg takes real radians returns real
  686. native Sin takes real radians returns real
  687. native Cos takes real radians returns real
  688. native Tan takes real radians returns real
  689. // Expect values between -1 and 1...returns 0 for invalid input
  690. native Asin takes real y returns real
  691. native Acos takes real x returns real
  692. native Atan takes real x returns real
  693. // Returns 0 if x and y are both 0
  694. native Atan2 takes real y, real x returns real
  695. // Returns 0 if x <= 0
  696. native SquareRoot takes real x returns real
  697. // computes x to the y power
  698. // y == 0.0 => 1
  699. // x ==0.0 and y < 0 => 0
  700. //
  701. native Pow takes real x, real power returns real
  702. //============================================================================
  703. // String Utility API
  704. native I2R takes integer i returns real
  705. native R2I takes real r returns integer
  706. native I2S takes integer i returns string
  707. native R2S takes real r returns string
  708. native R2SW takes real r, integer width, integer precision returns string
  709. native S2I takes string s returns integer
  710. native S2R takes string s returns real
  711. native GetHandleId takes handle h returns integer
  712. native SubString takes string source, integer start, integer end returns string
  713. native StringLength takes string s returns integer
  714. native StringCase takes string source, boolean upper returns string
  715. native StringHash takes string s returns integer
  716. native GetLocalizedString takes string source returns string
  717. native GetLocalizedHotkey takes string source returns integer
  718. //============================================================================
  719. // Map Setup API
  720. //
  721. // These are native functions for describing the map configuration
  722. // these funcs should only be used in the "config" function of
  723. // a map script. The functions should also be called in this order
  724. // ( i.e. call SetPlayers before SetPlayerColor...
  725. //
  726. native SetMapName takes string name returns nothing
  727. native SetMapDescription takes string description returns nothing
  728. native SetTeams takes integer teamcount returns nothing
  729. native SetPlayers takes integer playercount returns nothing
  730. native DefineStartLocation takes integer whichStartLoc, real x, real y returns nothing
  731. native DefineStartLocationLoc takes integer whichStartLoc, location whichLocation returns nothing
  732. native SetStartLocPrioCount takes integer whichStartLoc, integer prioSlotCount returns nothing
  733. native SetStartLocPrio takes integer whichStartLoc, integer prioSlotIndex, integer otherStartLocIndex, startlocprio priority returns nothing
  734. native GetStartLocPrioSlot takes integer whichStartLoc, integer prioSlotIndex returns integer
  735. native GetStartLocPrio takes integer whichStartLoc, integer prioSlotIndex returns startlocprio
  736. native SetGameTypeSupported takes gametype whichGameType, boolean value returns nothing
  737. native SetMapFlag takes mapflag whichMapFlag, boolean value returns nothing
  738. native SetGamePlacement takes placement whichPlacementType returns nothing
  739. native SetGameSpeed takes gamespeed whichspeed returns nothing
  740. native SetGameDifficulty takes gamedifficulty whichdifficulty returns nothing
  741. native SetResourceDensity takes mapdensity whichdensity returns nothing
  742. native SetCreatureDensity takes mapdensity whichdensity returns nothing
  743. native GetTeams takes nothing returns integer
  744. native GetPlayers takes nothing returns integer
  745. native IsGameTypeSupported takes gametype whichGameType returns boolean
  746. native GetGameTypeSelected takes nothing returns gametype
  747. native IsMapFlagSet takes mapflag whichMapFlag returns boolean
  748. constant native GetGamePlacement takes nothing returns placement
  749. constant native GetGameSpeed takes nothing returns gamespeed
  750. constant native GetGameDifficulty takes nothing returns gamedifficulty
  751. constant native GetResourceDensity takes nothing returns mapdensity
  752. constant native GetCreatureDensity takes nothing returns mapdensity
  753. constant native GetStartLocationX takes integer whichStartLocation returns real
  754. constant native GetStartLocationY takes integer whichStartLocation returns real
  755. constant native GetStartLocationLoc takes integer whichStartLocation returns location
  756. native SetPlayerTeam takes player whichPlayer, integer whichTeam returns nothing
  757. native SetPlayerStartLocation takes player whichPlayer, integer startLocIndex returns nothing
  758. // forces player to have the specified start loc and marks the start loc as occupied
  759. // which removes it from consideration for subsequently placed players
  760. // ( i.e. you can use this to put people in a fixed loc and then
  761. // use random placement for any unplaced players etc )
  762. native ForcePlayerStartLocation takes player whichPlayer, integer startLocIndex returns nothing
  763. native SetPlayerColor takes player whichPlayer, playercolor color returns nothing
  764. native SetPlayerAlliance takes player sourcePlayer, player otherPlayer, alliancetype whichAllianceSetting, boolean value returns nothing
  765. native SetPlayerTaxRate takes player sourcePlayer, player otherPlayer, playerstate whichResource, integer rate returns nothing
  766. native SetPlayerRacePreference takes player whichPlayer, racepreference whichRacePreference returns nothing
  767. native SetPlayerRaceSelectable takes player whichPlayer, boolean value returns nothing
  768. native SetPlayerController takes player whichPlayer, mapcontrol controlType returns nothing
  769. native SetPlayerName takes player whichPlayer, string name returns nothing
  770. native SetPlayerOnScoreScreen takes player whichPlayer, boolean flag returns nothing
  771. native GetPlayerTeam takes player whichPlayer returns integer
  772. native GetPlayerStartLocation takes player whichPlayer returns integer
  773. native GetPlayerColor takes player whichPlayer returns playercolor
  774. native GetPlayerSelectable takes player whichPlayer returns boolean
  775. native GetPlayerController takes player whichPlayer returns mapcontrol
  776. native GetPlayerSlotState takes player whichPlayer returns playerslotstate
  777. native GetPlayerTaxRate takes player sourcePlayer, player otherPlayer, playerstate whichResource returns integer
  778. native IsPlayerRacePrefSet takes player whichPlayer, racepreference pref returns boolean
  779. native GetPlayerName takes player whichPlayer returns string
  780. //============================================================================
  781. // Timer API
  782. //
  783. native CreateTimer takes nothing returns timer
  784. native DestroyTimer takes timer whichTimer returns nothing
  785. native TimerStart takes timer whichTimer, real timeout, boolean periodic, code handlerFunc returns nothing
  786. native TimerGetElapsed takes timer whichTimer returns real
  787. native TimerGetRemaining takes timer whichTimer returns real
  788. native TimerGetTimeout takes timer whichTimer returns real
  789. native PauseTimer takes timer whichTimer returns nothing
  790. native ResumeTimer takes timer whichTimer returns nothing
  791. native GetExpiredTimer takes nothing returns timer
  792. //============================================================================
  793. // Group API
  794. //
  795. native CreateGroup takes nothing returns group
  796. native DestroyGroup takes group whichGroup returns nothing
  797. native GroupAddUnit takes group whichGroup, unit whichUnit returns nothing
  798. native GroupRemoveUnit takes group whichGroup, unit whichUnit returns nothing
  799. native GroupClear takes group whichGroup returns nothing
  800. native GroupEnumUnitsOfType takes group whichGroup, string unitname, boolexpr filter returns nothing
  801. native GroupEnumUnitsOfPlayer takes group whichGroup, player whichPlayer, boolexpr filter returns nothing
  802. native GroupEnumUnitsOfTypeCounted takes group whichGroup, string unitname, boolexpr filter, integer countLimit returns nothing
  803. native GroupEnumUnitsInRect takes group whichGroup, rect r, boolexpr filter returns nothing
  804. native GroupEnumUnitsInRectCounted takes group whichGroup, rect r, boolexpr filter, integer countLimit returns nothing
  805. native GroupEnumUnitsInRange takes group whichGroup, real x, real y, real radius, boolexpr filter returns nothing
  806. native GroupEnumUnitsInRangeOfLoc takes group whichGroup, location whichLocation, real radius, boolexpr filter returns nothing
  807. native GroupEnumUnitsInRangeCounted takes group whichGroup, real x, real y, real radius, boolexpr filter, integer countLimit returns nothing
  808. native GroupEnumUnitsInRangeOfLocCounted takes group whichGroup, location whichLocation, real radius, boolexpr filter, integer countLimit returns nothing
  809. native GroupEnumUnitsSelected takes group whichGroup, player whichPlayer, boolexpr filter returns nothing
  810. native GroupImmediateOrder takes group whichGroup, string order returns boolean
  811. native GroupImmediateOrderById takes group whichGroup, integer order returns boolean
  812. native GroupPointOrder takes group whichGroup, string order, real x, real y returns boolean
  813. native GroupPointOrderLoc takes group whichGroup, string order, location whichLocation returns boolean
  814. native GroupPointOrderById takes group whichGroup, integer order, real x, real y returns boolean
  815. native GroupPointOrderByIdLoc takes group whichGroup, integer order, location whichLocation returns boolean
  816. native GroupTargetOrder takes group whichGroup, string order, widget targetWidget returns boolean
  817. native GroupTargetOrderById takes group whichGroup, integer order, widget targetWidget returns boolean
  818. // This will be difficult to support with potentially disjoint, cell-based regions
  819. // as it would involve enumerating all the cells that are covered by a particularregion
  820. // a better implementation would be a trigger that adds relevant units as they enter
  821. // and removes them if they leave...
  822. native ForGroup takes group whichGroup, code callback returns nothing
  823. native FirstOfGroup takes group whichGroup returns unit
  824. //============================================================================
  825. // Force API
  826. //
  827. native CreateForce takes nothing returns force
  828. native DestroyForce takes force whichForce returns nothing
  829. native ForceAddPlayer takes force whichForce, player whichPlayer returns nothing
  830. native ForceRemovePlayer takes force whichForce, player whichPlayer returns nothing
  831. native ForceClear takes force whichForce returns nothing
  832. native ForceEnumPlayers takes force whichForce, boolexpr filter returns nothing
  833. native ForceEnumPlayersCounted takes force whichForce, boolexpr filter, integer countLimit returns nothing
  834. native ForceEnumAllies takes force whichForce, player whichPlayer, boolexpr filter returns nothing
  835. native ForceEnumEnemies takes force whichForce, player whichPlayer, boolexpr filter returns nothing
  836. native ForForce takes force whichForce, code callback returns nothing
  837. //============================================================================
  838. // Region and Location API
  839. //
  840. native Rect takes real minx, real miny, real maxx, real maxy returns rect
  841. native RectFromLoc takes location min, location max returns rect
  842. native RemoveRect takes rect whichRect returns nothing
  843. native SetRect takes rect whichRect, real minx, real miny, real maxx, real maxy returns nothing
  844. native SetRectFromLoc takes rect whichRect, location min, location max returns nothing
  845. native MoveRectTo takes rect whichRect, real newCenterX, real newCenterY returns nothing
  846. native MoveRectToLoc takes rect whichRect, location newCenterLoc returns nothing
  847. native GetRectCenterX takes rect whichRect returns real
  848. native GetRectCenterY takes rect whichRect returns real
  849. native GetRectMinX takes rect whichRect returns real
  850. native GetRectMinY takes rect whichRect returns real
  851. native GetRectMaxX takes rect whichRect returns real
  852. native GetRectMaxY takes rect whichRect returns real
  853. native CreateRegion takes nothing returns region
  854. native RemoveRegion takes region whichRegion returns nothing
  855. native RegionAddRect takes region whichRegion, rect r returns nothing
  856. native RegionClearRect takes region whichRegion, rect r returns nothing
  857. native RegionAddCell takes region whichRegion, real x, real y returns nothing
  858. native RegionAddCellAtLoc takes region whichRegion, location whichLocation returns nothing
  859. native RegionClearCell takes region whichRegion, real x, real y returns nothing
  860. native RegionClearCellAtLoc takes region whichRegion, location whichLocation returns nothing
  861. native Location takes real x, real y returns location
  862. native RemoveLocation takes location whichLocation returns nothing
  863. native MoveLocation takes location whichLocation, real newX, real newY returns nothing
  864. native GetLocationX takes location whichLocation returns real
  865. native GetLocationY takes location whichLocation returns real
  866. // This function is asynchronous. The values it returns are not guaranteed synchronous between each player.
  867. // If you attempt to use it in a synchronous manner, it may cause a desync.
  868. native GetLocationZ takes location whichLocation returns real
  869. native IsUnitInRegion takes region whichRegion, unit whichUnit returns boolean
  870. native IsPointInRegion takes region whichRegion, real x, real y returns boolean
  871. native IsLocationInRegion takes region whichRegion, location whichLocation returns boolean
  872. // Returns full map bounds, including unplayable borders, in world coordinates
  873. native GetWorldBounds takes nothing returns rect
  874. //============================================================================
  875. // Native trigger interface
  876. //
  877. native CreateTrigger takes nothing returns trigger
  878. native DestroyTrigger takes trigger whichTrigger returns nothing
  879. native ResetTrigger takes trigger whichTrigger returns nothing
  880. native EnableTrigger takes trigger whichTrigger returns nothing
  881. native DisableTrigger takes trigger whichTrigger returns nothing
  882. native IsTriggerEnabled takes trigger whichTrigger returns boolean
  883. native TriggerWaitOnSleeps takes trigger whichTrigger, boolean flag returns nothing
  884. native IsTriggerWaitOnSleeps takes trigger whichTrigger returns boolean
  885. constant native GetFilterUnit takes nothing returns unit
  886. constant native GetEnumUnit takes nothing returns unit
  887. constant native GetFilterDestructable takes nothing returns destructable
  888. constant native GetEnumDestructable takes nothing returns destructable
  889. constant native GetFilterItem takes nothing returns item
  890. constant native GetEnumItem takes nothing returns item
  891. constant native GetFilterPlayer takes nothing returns player
  892. constant native GetEnumPlayer takes nothing returns player
  893. constant native GetTriggeringTrigger takes nothing returns trigger
  894. constant native GetTriggerEventId takes nothing returns eventid
  895. constant native GetTriggerEvalCount takes trigger whichTrigger returns integer
  896. constant native GetTriggerExecCount takes trigger whichTrigger returns integer
  897. native ExecuteFunc takes string funcName returns nothing
  898. //============================================================================
  899. // Boolean Expr API ( for compositing trigger conditions and unit filter funcs...)
  900. //============================================================================
  901. native And takes boolexpr operandA, boolexpr operandB returns boolexpr
  902. native Or takes boolexpr operandA, boolexpr operandB returns boolexpr
  903. native Not takes boolexpr operand returns boolexpr
  904. native Condition takes code func returns conditionfunc
  905. native DestroyCondition takes conditionfunc c returns nothing
  906. native Filter takes code func returns filterfunc
  907. native DestroyFilter takes filterfunc f returns nothing
  908. native DestroyBoolExpr takes boolexpr e returns nothing
  909. //============================================================================
  910. // Trigger Game Event API
  911. //============================================================================
  912. native TriggerRegisterVariableEvent takes trigger whichTrigger, string varName, limitop opcode, real limitval returns event
  913. // EVENT_GAME_VARIABLE_LIMIT
  914. //constant native string GetTriggeringVariableName takes nothing returns string
  915. // Creates it's own timer and triggers when it expires
  916. native TriggerRegisterTimerEvent takes trigger whichTrigger, real timeout, boolean periodic returns event
  917. // Triggers when the timer you tell it about expires
  918. native TriggerRegisterTimerExpireEvent takes trigger whichTrigger, timer t returns event
  919. native TriggerRegisterGameStateEvent takes trigger whichTrigger, gamestate whichState, limitop opcode, real limitval returns event
  920. native TriggerRegisterDialogEvent takes trigger whichTrigger, dialog whichDialog returns event
  921. native TriggerRegisterDialogButtonEvent takes trigger whichTrigger, button whichButton returns event
  922. // EVENT_GAME_STATE_LIMIT
  923. constant native GetEventGameState takes nothing returns gamestate
  924. native TriggerRegisterGameEvent takes trigger whichTrigger, gameevent whichGameEvent returns event
  925. // EVENT_GAME_VICTORY
  926. constant native GetWinningPlayer takes nothing returns player
  927. native TriggerRegisterEnterRegion takes trigger whichTrigger, region whichRegion, boolexpr filter returns event
  928. // EVENT_GAME_ENTER_REGION
  929. constant native GetTriggeringRegion takes nothing returns region
  930. constant native GetEnteringUnit takes nothing returns unit
  931. // EVENT_GAME_LEAVE_REGION
  932. native TriggerRegisterLeaveRegion takes trigger whichTrigger, region whichRegion, boolexpr filter returns event
  933. constant native GetLeavingUnit takes nothing returns unit
  934. native TriggerRegisterTrackableHitEvent takes trigger whichTrigger, trackable t returns event
  935. native TriggerRegisterTrackableTrackEvent takes trigger whichTrigger, trackable t returns event
  936. // EVENT_GAME_TRACKABLE_HIT
  937. // EVENT_GAME_TRACKABLE_TRACK
  938. constant native GetTriggeringTrackable takes nothing returns trackable
  939. // EVENT_DIALOG_BUTTON_CLICK
  940. constant native GetClickedButton takes nothing returns button
  941. constant native GetClickedDialog takes nothing returns dialog
  942. // EVENT_GAME_TOURNAMENT_FINISH_SOON
  943. constant native GetTournamentFinishSoonTimeRemaining takes nothing returns real
  944. constant native GetTournamentFinishNowRule takes nothing returns integer
  945. constant native GetTournamentFinishNowPlayer takes nothing returns player
  946. constant native GetTournamentScore takes player whichPlayer returns integer
  947. // EVENT_GAME_SAVE
  948. constant native GetSaveBasicFilename takes nothing returns string
  949. //============================================================================
  950. // Trigger Player Based Event API
  951. //============================================================================
  952. native TriggerRegisterPlayerEvent takes trigger whichTrigger, player whichPlayer, playerevent whichPlayerEvent returns event
  953. // EVENT_PLAYER_DEFEAT
  954. // EVENT_PLAYER_VICTORY
  955. constant native GetTriggerPlayer takes nothing returns player
  956. native TriggerRegisterPlayerUnitEvent takes trigger whichTrigger, player whichPlayer, playerunitevent whichPlayerUnitEvent, boolexpr filter returns event
  957. // EVENT_PLAYER_HERO_LEVEL
  958. // EVENT_UNIT_HERO_LEVEL
  959. constant native GetLevelingUnit takes nothing returns unit
  960. // EVENT_PLAYER_HERO_SKILL
  961. // EVENT_UNIT_HERO_SKILL
  962. constant native GetLearningUnit takes nothing returns unit
  963. constant native GetLearnedSkill takes nothing returns integer
  964. constant native GetLearnedSkillLevel takes nothing returns integer
  965. // EVENT_PLAYER_HERO_REVIVABLE
  966. constant native GetRevivableUnit takes nothing returns unit
  967. // EVENT_PLAYER_HERO_REVIVE_START
  968. // EVENT_PLAYER_HERO_REVIVE_CANCEL
  969. // EVENT_PLAYER_HERO_REVIVE_FINISH
  970. // EVENT_UNIT_HERO_REVIVE_START
  971. // EVENT_UNIT_HERO_REVIVE_CANCEL
  972. // EVENT_UNIT_HERO_REVIVE_FINISH
  973. constant native GetRevivingUnit takes nothing returns unit
  974. // EVENT_PLAYER_UNIT_ATTACKED
  975. constant native GetAttacker takes nothing returns unit
  976. // EVENT_PLAYER_UNIT_RESCUED
  977. constant native GetRescuer takes nothing returns unit
  978. // EVENT_PLAYER_UNIT_DEATH
  979. constant native GetDyingUnit takes nothing returns unit
  980. constant native GetKillingUnit takes nothing returns unit
  981. // EVENT_PLAYER_UNIT_DECAY
  982. constant native GetDecayingUnit takes nothing returns unit
  983. // EVENT_PLAYER_UNIT_SELECTED
  984. //constant native GetSelectedUnit takes nothing returns unit
  985. // EVENT_PLAYER_UNIT_CONSTRUCT_START
  986. constant native GetConstructingStructure takes nothing returns unit
  987. // EVENT_PLAYER_UNIT_CONSTRUCT_FINISH
  988. // EVENT_PLAYER_UNIT_CONSTRUCT_CANCEL
  989. constant native GetCancelledStructure takes nothing returns unit
  990. constant native GetConstructedStructure takes nothing returns unit
  991. // EVENT_PLAYER_UNIT_RESEARCH_START
  992. // EVENT_PLAYER_UNIT_RESEARCH_CANCEL
  993. // EVENT_PLAYER_UNIT_RESEARCH_FINISH
  994. constant native GetResearchingUnit takes nothing returns unit
  995. constant native GetResearched takes nothing returns integer
  996. // EVENT_PLAYER_UNIT_TRAIN_START
  997. // EVENT_PLAYER_UNIT_TRAIN_CANCEL
  998. constant native GetTrainedUnitType takes nothing returns integer
  999. // EVENT_PLAYER_UNIT_TRAIN_FINISH
  1000. constant native GetTrainedUnit takes nothing returns unit
  1001. // EVENT_PLAYER_UNIT_DETECTED
  1002. constant native GetDetectedUnit takes nothing returns unit
  1003. // EVENT_PLAYER_UNIT_SUMMONED
  1004. constant native GetSummoningUnit takes nothing returns unit
  1005. constant native GetSummonedUnit takes nothing returns unit
  1006. // EVENT_PLAYER_UNIT_LOADED
  1007. constant native GetTransportUnit takes nothing returns unit
  1008. constant native GetLoadedUnit takes nothing returns unit
  1009. // EVENT_PLAYER_UNIT_SELL
  1010. constant native GetSellingUnit takes nothing returns unit
  1011. constant native GetSoldUnit takes nothing returns unit
  1012. constant native GetBuyingUnit takes nothing returns unit
  1013. // EVENT_PLAYER_UNIT_SELL_ITEM
  1014. constant native GetSoldItem takes nothing returns item
  1015. // EVENT_PLAYER_UNIT_CHANGE_OWNER
  1016. constant native GetChangingUnit takes nothing returns unit
  1017. constant native GetChangingUnitPrevOwner takes nothing returns player
  1018. // EVENT_PLAYER_UNIT_DROP_ITEM
  1019. // EVENT_PLAYER_UNIT_PICKUP_ITEM
  1020. // EVENT_PLAYER_UNIT_USE_ITEM
  1021. constant native GetManipulatingUnit takes nothing returns unit
  1022. constant native GetManipulatedItem takes nothing returns item
  1023. // EVENT_PLAYER_UNIT_ISSUED_ORDER
  1024. constant native GetOrderedUnit takes nothing returns unit
  1025. constant native GetIssuedOrderId takes nothing returns integer
  1026. // EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER
  1027. constant native GetOrderPointX takes nothing returns real
  1028. constant native GetOrderPointY takes nothing returns real
  1029. constant native GetOrderPointLoc takes nothing returns location
  1030. // EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER
  1031. constant native GetOrderTarget takes nothing returns widget
  1032. constant native GetOrderTargetDestructable takes nothing returns destructable
  1033. constant native GetOrderTargetItem takes nothing returns item
  1034. constant native GetOrderTargetUnit takes nothing returns unit
  1035. // EVENT_UNIT_SPELL_CHANNEL
  1036. // EVENT_UNIT_SPELL_CAST
  1037. // EVENT_UNIT_SPELL_EFFECT
  1038. // EVENT_UNIT_SPELL_FINISH
  1039. // EVENT_UNIT_SPELL_ENDCAST
  1040. // EVENT_PLAYER_UNIT_SPELL_CHANNEL
  1041. // EVENT_PLAYER_UNIT_SPELL_CAST
  1042. // EVENT_PLAYER_UNIT_SPELL_EFFECT
  1043. // EVENT_PLAYER_UNIT_SPELL_FINISH
  1044. // EVENT_PLAYER_UNIT_SPELL_ENDCAST
  1045. constant native GetSpellAbilityUnit takes nothing returns unit
  1046. constant native GetSpellAbilityId takes nothing returns integer
  1047. constant native GetSpellAbility takes nothing returns ability
  1048. constant native GetSpellTargetLoc takes nothing returns location
  1049. constant native GetSpellTargetX takes nothing returns real
  1050. constant native GetSpellTargetY takes nothing returns real
  1051. constant native GetSpellTargetDestructable takes nothing returns destructable
  1052. constant native GetSpellTargetItem takes nothing returns item
  1053. constant native GetSpellTargetUnit takes nothing returns unit
  1054. native TriggerRegisterPlayerAllianceChange takes trigger whichTrigger, player whichPlayer, alliancetype whichAlliance returns event
  1055. native TriggerRegisterPlayerStateEvent takes trigger whichTrigger, player whichPlayer, playerstate whichState, limitop opcode, real limitval returns event
  1056. // EVENT_PLAYER_STATE_LIMIT
  1057. constant native GetEventPlayerState takes nothing returns playerstate
  1058. native TriggerRegisterPlayerChatEvent takes trigger whichTrigger, player whichPlayer, string chatMessageToDetect, boolean exactMatchOnly returns event
  1059. // EVENT_PLAYER_CHAT
  1060. // returns the actual string they typed in ( same as what you registered for
  1061. // if you required exact match )
  1062. constant native GetEventPlayerChatString takes nothing returns string
  1063. // returns the string that you registered for
  1064. constant native GetEventPlayerChatStringMatched takes nothing returns string
  1065. native TriggerRegisterDeathEvent takes trigger whichTrigger, widget whichWidget returns event
  1066. //============================================================================
  1067. // Trigger Unit Based Event API
  1068. //============================================================================
  1069. // returns handle to unit which triggered the most recent event when called from
  1070. // within a trigger action function...returns null handle when used incorrectly
  1071. constant native GetTriggerUnit takes nothing returns unit
  1072. native TriggerRegisterUnitStateEvent takes trigger whichTrigger, unit whichUnit, unitstate whichState, limitop opcode, real limitval returns event
  1073. // EVENT_UNIT_STATE_LIMIT
  1074. constant native GetEventUnitState takes nothing returns unitstate
  1075. native TriggerRegisterUnitEvent takes trigger whichTrigger, unit whichUnit, unitevent whichEvent returns event
  1076. // EVENT_UNIT_DAMAGED
  1077. constant native GetEventDamage takes nothing returns real
  1078. constant native GetEventDamageSource takes nothing returns unit
  1079. // EVENT_UNIT_DEATH
  1080. // EVENT_UNIT_DECAY
  1081. // Use the GetDyingUnit and GetDecayingUnit funcs above
  1082. // EVENT_UNIT_DETECTED
  1083. constant native GetEventDetectingPlayer takes nothing returns player
  1084. native TriggerRegisterFilterUnitEvent takes trigger whichTrigger, unit whichUnit, unitevent whichEvent, boolexpr filter returns event
  1085. // EVENT_UNIT_ACQUIRED_TARGET
  1086. // EVENT_UNIT_TARGET_IN_RANGE
  1087. constant native GetEventTargetUnit takes nothing returns unit
  1088. // EVENT_UNIT_ATTACKED
  1089. // Use GetAttacker from the Player Unit Event API Below...
  1090. // EVENT_UNIT_RESCUEDED
  1091. // Use GetRescuer from the Player Unit Event API Below...
  1092. // EVENT_UNIT_CONSTRUCT_CANCEL
  1093. // EVENT_UNIT_CONSTRUCT_FINISH
  1094. // See the Player Unit Construction Event API above for event info funcs
  1095. // EVENT_UNIT_TRAIN_START
  1096. // EVENT_UNIT_TRAIN_CANCELLED
  1097. // EVENT_UNIT_TRAIN_FINISH
  1098. // See the Player Unit Training Event API above for event info funcs
  1099. // EVENT_UNIT_SELL
  1100. // See the Player Unit Sell Event API above for event info funcs
  1101. // EVENT_UNIT_DROP_ITEM
  1102. // EVENT_UNIT_PICKUP_ITEM
  1103. // EVENT_UNIT_USE_ITEM
  1104. // See the Player Unit/Item manipulation Event API above for event info funcs
  1105. // EVENT_UNIT_ISSUED_ORDER
  1106. // EVENT_UNIT_ISSUED_POINT_ORDER
  1107. // EVENT_UNIT_ISSUED_TARGET_ORDER
  1108. // See the Player Unit Order Event API above for event info funcs
  1109. native TriggerRegisterUnitInRange takes trigger whichTrigger, unit whichUnit, real range, boolexpr filter returns event
  1110. native TriggerAddCondition takes trigger whichTrigger, boolexpr condition returns triggercondition
  1111. native TriggerRemoveCondition takes trigger whichTrigger, triggercondition whichCondition returns nothing
  1112. native TriggerClearConditions takes trigger whichTrigger returns nothing
  1113. native TriggerAddAction takes trigger whichTrigger, code actionFunc returns triggeraction
  1114. native TriggerRemoveAction takes trigger whichTrigger, triggeraction whichAction returns nothing
  1115. native TriggerClearActions takes trigger whichTrigger returns nothing
  1116. native TriggerSleepAction takes real timeout returns nothing
  1117. native TriggerWaitForSound takes sound s, real offset returns nothing
  1118. native TriggerEvaluate takes trigger whichTrigger returns boolean
  1119. native TriggerExecute takes trigger whichTrigger returns nothing
  1120. native TriggerExecuteWait takes trigger whichTrigger returns nothing
  1121. native TriggerSyncStart takes nothing returns nothing
  1122. native TriggerSyncReady takes nothing returns nothing
  1123. //============================================================================
  1124. // Widget API
  1125. native GetWidgetLife takes widget whichWidget returns real
  1126. native SetWidgetLife takes widget whichWidget, real newLife returns nothing
  1127. native GetWidgetX takes widget whichWidget returns real
  1128. native GetWidgetY takes widget whichWidget returns real
  1129. constant native GetTriggerWidget takes nothing returns widget
  1130. //============================================================================
  1131. // Destructable Object API
  1132. // Facing arguments are specified in degrees
  1133. native CreateDestructable takes integer objectid, real x, real y, real face, real scale, integer variation returns destructable
  1134. native CreateDestructableZ takes integer objectid, real x, real y, real z, real face, real scale, integer variation returns destructable
  1135. native CreateDeadDestructable takes integer objectid, real x, real y, real face, real scale, integer variation returns destructable
  1136. native CreateDeadDestructableZ takes integer objectid, real x, real y, real z, real face, real scale, integer variation returns destructable
  1137. native RemoveDestructable takes destructable d returns nothing
  1138. native KillDestructable takes destructable d returns nothing
  1139. native SetDestructableInvulnerable takes destructable d, boolean flag returns nothing
  1140. native IsDestructableInvulnerable takes destructable d returns boolean
  1141. native EnumDestructablesInRect takes rect r, boolexpr filter, code actionFunc returns nothing
  1142. native GetDestructableTypeId takes destructable d returns integer
  1143. native GetDestructableX takes destructable d returns real
  1144. native GetDestructableY takes destructable d returns real
  1145. native SetDestructableLife takes destructable d, real life returns nothing
  1146. native GetDestructableLife takes destructable d returns real
  1147. native SetDestructableMaxLife takes destructable d, real max returns nothing
  1148. native GetDestructableMaxLife takes destructable d returns real
  1149. native DestructableRestoreLife takes destructable d, real life, boolean birth returns nothing
  1150. native QueueDestructableAnimation takes destructable d, string whichAnimation returns nothing
  1151. native SetDestructableAnimation takes destructable d, string whichAnimation returns nothing
  1152. native SetDestructableAnimationSpeed takes destructable d, real speedFactor returns nothing
  1153. native ShowDestructable takes destructable d, boolean flag returns nothing
  1154. native GetDestructableOccluderHeight takes destructable d returns real
  1155. native SetDestructableOccluderHeight takes destructable d, real height returns nothing
  1156. native GetDestructableName takes destructable d returns string
  1157. constant native GetTriggerDestructable takes nothing returns destructable
  1158. //============================================================================
  1159. // Item API
  1160. native CreateItem takes integer itemid, real x, real y returns item
  1161. native RemoveItem takes item whichItem returns nothing
  1162. native GetItemPlayer takes item whichItem returns player
  1163. native GetItemTypeId takes item i returns integer
  1164. native GetItemX takes item i returns real
  1165. native GetItemY takes item i returns real
  1166. native SetItemPosition takes item i, real x, real y returns nothing
  1167. native SetItemDropOnDeath takes item whichItem, boolean flag returns nothing
  1168. native SetItemDroppable takes item i, boolean flag returns nothing
  1169. native SetItemPawnable takes item i, boolean flag returns nothing
  1170. native SetItemPlayer takes item whichItem, player whichPlayer, boolean changeColor returns nothing
  1171. native SetItemInvulnerable takes item whichItem, boolean flag returns nothing
  1172. native IsItemInvulnerable takes item whichItem returns boolean
  1173. native SetItemVisible takes item whichItem, boolean show returns nothing
  1174. native IsItemVisible takes item whichItem returns boolean
  1175. native IsItemOwned takes item whichItem returns boolean
  1176. native IsItemPowerup takes item whichItem returns boolean
  1177. native IsItemSellable takes item whichItem returns boolean
  1178. native IsItemPawnable takes item whichItem returns boolean
  1179. native IsItemIdPowerup takes integer itemId returns boolean
  1180. native IsItemIdSellable takes integer itemId returns boolean
  1181. native IsItemIdPawnable takes integer itemId returns boolean
  1182. native EnumItemsInRect takes rect r, boolexpr filter, code actionFunc returns nothing
  1183. native GetItemLevel takes item whichItem returns integer
  1184. native GetItemType takes item whichItem returns itemtype
  1185. native SetItemDropID takes item whichItem, integer unitId returns nothing
  1186. constant native GetItemName takes item whichItem returns string
  1187. native GetItemCharges takes item whichItem returns integer
  1188. native SetItemCharges takes item whichItem, integer charges returns nothing
  1189. native GetItemUserData takes item whichItem returns integer
  1190. native SetItemUserData takes item whichItem, integer data returns nothing
  1191. //============================================================================
  1192. // Unit API
  1193. // Facing arguments are specified in degrees
  1194. native CreateUnit takes player id, integer unitid, real x, real y, real face returns unit
  1195. native CreateUnitByName takes player whichPlayer, string unitname, real x, real y, real face returns unit
  1196. native CreateUnitAtLoc takes player id, integer unitid, location whichLocation, real face returns unit
  1197. native CreateUnitAtLocByName takes player id, string unitname, location whichLocation, real face returns unit
  1198. native CreateCorpse takes player whichPlayer, integer unitid, real x, real y, real face returns unit
  1199. native KillUnit takes unit whichUnit returns nothing
  1200. native RemoveUnit takes unit whichUnit returns nothing
  1201. native ShowUnit takes unit whichUnit, boolean show returns nothing
  1202. native SetUnitState takes unit whichUnit, unitstate whichUnitState, real newVal returns nothing
  1203. native SetUnitX takes unit whichUnit, real newX returns nothing
  1204. native SetUnitY takes unit whichUnit, real newY returns nothing
  1205. native SetUnitPosition takes unit whichUnit, real newX, real newY returns nothing
  1206. native SetUnitPositionLoc takes unit whichUnit, location whichLocation returns nothing
  1207. native SetUnitFacing takes unit whichUnit, real facingAngle returns nothing
  1208. native SetUnitFacingTimed takes unit whichUnit, real facingAngle, real duration returns nothing
  1209. native SetUnitMoveSpeed takes unit whichUnit, real newSpeed returns nothing
  1210. native SetUnitFlyHeight takes unit whichUnit, real newHeight, real rate returns nothing
  1211. native SetUnitTurnSpeed takes unit whichUnit, real newTurnSpeed returns nothing
  1212. native SetUnitPropWindow takes unit whichUnit, real newPropWindowAngle returns nothing
  1213. native SetUnitAcquireRange takes unit whichUnit, real newAcquireRange returns nothing
  1214. native SetUnitCreepGuard takes unit whichUnit, boolean creepGuard returns nothing
  1215. native GetUnitAcquireRange takes unit whichUnit returns real
  1216. native GetUnitTurnSpeed takes unit whichUnit returns real
  1217. native GetUnitPropWindow takes unit whichUnit returns real
  1218. native GetUnitFlyHeight takes unit whichUnit returns real
  1219. native GetUnitDefaultAcquireRange takes unit whichUnit returns real
  1220. native GetUnitDefaultTurnSpeed takes unit whichUnit returns real
  1221. native GetUnitDefaultPropWindow takes unit whichUnit returns real
  1222. native GetUnitDefaultFlyHeight takes unit whichUnit returns real
  1223. native SetUnitOwner takes unit whichUnit, player whichPlayer, boolean changeColor returns nothing
  1224. native SetUnitColor takes unit whichUnit, playercolor whichColor returns nothing
  1225. native SetUnitScale takes unit whichUnit, real scaleX, real scaleY, real scaleZ returns nothing
  1226. native SetUnitTimeScale takes unit whichUnit, real timeScale returns nothing
  1227. native SetUnitBlendTime takes unit whichUnit, real blendTime returns nothing
  1228. native SetUnitVertexColor takes unit whichUnit, integer red, integer green, integer blue, integer alpha returns nothing
  1229. native QueueUnitAnimation takes unit whichUnit, string whichAnimation returns nothing
  1230. native SetUnitAnimation takes unit whichUnit, string whichAnimation returns nothing
  1231. native SetUnitAnimationByIndex takes unit whichUnit, integer whichAnimation returns nothing
  1232. native SetUnitAnimationWithRarity takes unit whichUnit, string whichAnimation, raritycontrol rarity returns nothing
  1233. native AddUnitAnimationProperties takes unit whichUnit, string animProperties, boolean add returns nothing
  1234. native SetUnitLookAt takes unit whichUnit, string whichBone, unit lookAtTarget, real offsetX, real offsetY, real offsetZ returns nothing
  1235. native ResetUnitLookAt takes unit whichUnit returns nothing
  1236. native SetUnitRescuable takes unit whichUnit, player byWhichPlayer, boolean flag returns nothing
  1237. native SetUnitRescueRange takes unit whichUnit, real range returns nothing
  1238. native SetHeroStr takes unit whichHero, integer newStr, boolean permanent returns nothing
  1239. native SetHeroAgi takes unit whichHero, integer newAgi, boolean permanent returns nothing
  1240. native SetHeroInt takes unit whichHero, integer newInt, boolean permanent returns nothing
  1241. native GetHeroStr takes unit whichHero, boolean includeBonuses returns integer
  1242. native GetHeroAgi takes unit whichHero, boolean includeBonuses returns integer
  1243. native GetHeroInt takes unit whichHero, boolean includeBonuses returns integer
  1244. native UnitStripHeroLevel takes unit whichHero, integer howManyLevels returns boolean
  1245. native GetHeroXP takes unit whichHero returns integer
  1246. native SetHeroXP takes unit whichHero, integer newXpVal, boolean showEyeCandy returns nothing
  1247. native GetHeroSkillPoints takes unit whichHero returns integer
  1248. native UnitModifySkillPoints takes unit whichHero, integer skillPointDelta returns boolean
  1249. native AddHeroXP takes unit whichHero, integer xpToAdd, boolean showEyeCandy returns nothing
  1250. native SetHeroLevel takes unit whichHero, integer level, boolean showEyeCandy returns nothing
  1251. constant native GetHeroLevel takes unit whichHero returns integer
  1252. constant native GetUnitLevel takes unit whichUnit returns integer
  1253. native GetHeroProperName takes unit whichHero returns string
  1254. native SuspendHeroXP takes unit whichHero, boolean flag returns nothing
  1255. native IsSuspendedXP takes unit whichHero returns boolean
  1256. native SelectHeroSkill takes unit whichHero, integer abilcode returns nothing
  1257. native GetUnitAbilityLevel takes unit whichUnit, integer abilcode returns integer
  1258. native DecUnitAbilityLevel takes unit whichUnit, integer abilcode returns integer
  1259. native IncUnitAbilityLevel takes unit whichUnit, integer abilcode returns integer
  1260. native SetUnitAbilityLevel takes unit whichUnit, integer abilcode, integer level returns integer
  1261. native ReviveHero takes unit whichHero, real x, real y, boolean doEyecandy returns boolean
  1262. native ReviveHeroLoc takes unit whichHero, location loc, boolean doEyecandy returns boolean
  1263. native SetUnitExploded takes unit whichUnit, boolean exploded returns nothing
  1264. native SetUnitInvulnerable takes unit whichUnit, boolean flag returns nothing
  1265. native PauseUnit takes unit whichUnit, boolean flag returns nothing
  1266. native IsUnitPaused takes unit whichHero returns boolean
  1267. native SetUnitPathing takes unit whichUnit, boolean flag returns nothing
  1268. native ClearSelection takes nothing returns nothing
  1269. native SelectUnit takes unit whichUnit, boolean flag returns nothing
  1270. native GetUnitPointValue takes unit whichUnit returns integer
  1271. native GetUnitPointValueByType takes integer unitType returns integer
  1272. //native SetUnitPointValueByType takes integer unitType, integer newPointValue returns nothing
  1273. native UnitAddItem takes unit whichUnit, item whichItem returns boolean
  1274. native UnitAddItemById takes unit whichUnit, integer itemId returns item
  1275. native UnitAddItemToSlotById takes unit whichUnit, integer itemId, integer itemSlot returns boolean
  1276. native UnitRemoveItem takes unit whichUnit, item whichItem returns nothing
  1277. native UnitRemoveItemFromSlot takes unit whichUnit, integer itemSlot returns item
  1278. native UnitHasItem takes unit whichUnit, item whichItem returns boolean
  1279. native UnitItemInSlot takes unit whichUnit, integer itemSlot returns item
  1280. native UnitInventorySize takes unit whichUnit returns integer
  1281. native UnitDropItemPoint takes unit whichUnit, item whichItem, real x, real y returns boolean
  1282. native UnitDropItemSlot takes unit whichUnit, item whichItem, integer slot returns boolean
  1283. native UnitDropItemTarget takes unit whichUnit, item whichItem, widget target returns boolean
  1284. native UnitUseItem takes unit whichUnit, item whichItem returns boolean
  1285. native UnitUseItemPoint takes unit whichUnit, item whichItem, real x, real y returns boolean
  1286. native UnitUseItemTarget takes unit whichUnit, item whichItem, widget target returns boolean
  1287. constant native GetUnitX takes unit whichUnit returns real
  1288. constant native GetUnitY takes unit whichUnit returns real
  1289. constant native GetUnitLoc takes unit whichUnit returns location
  1290. constant native GetUnitFacing takes unit whichUnit returns real
  1291. constant native GetUnitMoveSpeed takes unit whichUnit returns real
  1292. constant native GetUnitDefaultMoveSpeed takes unit whichUnit returns real
  1293. constant native GetUnitState takes unit whichUnit, unitstate whichUnitState returns real
  1294. constant native GetOwningPlayer takes unit whichUnit returns player
  1295. constant native GetUnitTypeId takes unit whichUnit returns integer
  1296. constant native GetUnitRace takes unit whichUnit returns race
  1297. constant native GetUnitName takes unit whichUnit returns string
  1298. constant native GetUnitFoodUsed takes unit whichUnit returns integer
  1299. constant native GetUnitFoodMade takes unit whichUnit returns integer
  1300. constant native GetFoodMade takes integer unitId returns integer
  1301. constant native GetFoodUsed takes integer unitId returns integer
  1302. native SetUnitUseFood takes unit whichUnit, boolean useFood returns nothing
  1303. constant native GetUnitRallyPoint takes unit whichUnit returns location
  1304. constant native GetUnitRallyUnit takes unit whichUnit returns unit
  1305. constant native GetUnitRallyDestructable takes unit whichUnit returns destructable
  1306. constant native IsUnitInGroup takes unit whichUnit, group whichGroup returns boolean
  1307. constant native IsUnitInForce takes unit whichUnit, force whichForce returns boolean
  1308. constant native IsUnitOwnedByPlayer takes unit whichUnit, player whichPlayer returns boolean
  1309. constant native IsUnitAlly takes unit whichUnit, player whichPlayer returns boolean
  1310. constant native IsUnitEnemy takes unit whichUnit, player whichPlayer returns boolean
  1311. constant native IsUnitVisible takes unit whichUnit, player whichPlayer returns boolean
  1312. constant native IsUnitDetected takes unit whichUnit, player whichPlayer returns boolean
  1313. constant native IsUnitInvisible takes unit whichUnit, player whichPlayer returns boolean
  1314. constant native IsUnitFogged takes unit whichUnit, player whichPlayer returns boolean
  1315. constant native IsUnitMasked takes unit whichUnit, player whichPlayer returns boolean
  1316. constant native IsUnitSelected takes unit whichUnit, player whichPlayer returns boolean
  1317. constant native IsUnitRace takes unit whichUnit, race whichRace returns boolean
  1318. constant native IsUnitType takes unit whichUnit, unittype whichUnitType returns boolean
  1319. constant native IsUnit takes unit whichUnit, unit whichSpecifiedUnit returns boolean
  1320. constant native IsUnitInRange takes unit whichUnit, unit otherUnit, real distance returns boolean
  1321. constant native IsUnitInRangeXY takes unit whichUnit, real x, real y, real distance returns boolean
  1322. constant native IsUnitInRangeLoc takes unit whichUnit, location whichLocation, real distance returns boolean
  1323. constant native IsUnitHidden takes unit whichUnit returns boolean
  1324. constant native IsUnitIllusion takes unit whichUnit returns boolean
  1325. constant native IsUnitInTransport takes unit whichUnit, unit whichTransport returns boolean
  1326. constant native IsUnitLoaded takes unit whichUnit returns boolean
  1327. constant native IsHeroUnitId takes integer unitId returns boolean
  1328. constant native IsUnitIdType takes integer unitId, unittype whichUnitType returns boolean
  1329. native UnitShareVision takes unit whichUnit, player whichPlayer, boolean share returns nothing
  1330. native UnitSuspendDecay takes unit whichUnit, boolean suspend returns nothing
  1331. native UnitAddType takes unit whichUnit, unittype whichUnitType returns boolean
  1332. native UnitRemoveType takes unit whichUnit, unittype whichUnitType returns boolean
  1333. native UnitAddAbility takes unit whichUnit, integer abilityId returns boolean
  1334. native UnitRemoveAbility takes unit whichUnit, integer abilityId returns boolean
  1335. native UnitMakeAbilityPermanent takes unit whichUnit, boolean permanent, integer abilityId returns boolean
  1336. native UnitRemoveBuffs takes unit whichUnit, boolean removePositive, boolean removeNegative returns nothing
  1337. native UnitRemoveBuffsEx takes unit whichUnit, boolean removePositive, boolean removeNegative, boolean magic, boolean physical, boolean timedLife, boolean aura, boolean autoDispel returns nothing
  1338. native UnitHasBuffsEx takes unit whichUnit, boolean removePositive, boolean removeNegative, boolean magic, boolean physical, boolean timedLife, boolean aura, boolean autoDispel returns boolean
  1339. native UnitCountBuffsEx takes unit whichUnit, boolean removePositive, boolean removeNegative, boolean magic, boolean physical, boolean timedLife, boolean aura, boolean autoDispel returns integer
  1340. native UnitAddSleep takes unit whichUnit, boolean add returns nothing
  1341. native UnitCanSleep takes unit whichUnit returns boolean
  1342. native UnitAddSleepPerm takes unit whichUnit, boolean add returns nothing
  1343. native UnitCanSleepPerm takes unit whichUnit returns boolean
  1344. native UnitIsSleeping takes unit whichUnit returns boolean
  1345. native UnitWakeUp takes unit whichUnit returns nothing
  1346. native UnitApplyTimedLife takes unit whichUnit, integer buffId, real duration returns nothing
  1347. native UnitIgnoreAlarm takes unit whichUnit, boolean flag returns boolean
  1348. native UnitIgnoreAlarmToggled takes unit whichUnit returns boolean
  1349. native UnitResetCooldown takes unit whichUnit returns nothing
  1350. native UnitSetConstructionProgress takes unit whichUnit, integer constructionPercentage returns nothing
  1351. native UnitSetUpgradeProgress takes unit whichUnit, integer upgradePercentage returns nothing
  1352. native UnitPauseTimedLife takes unit whichUnit, boolean flag returns nothing
  1353. native UnitSetUsesAltIcon takes unit whichUnit, boolean flag returns nothing
  1354. 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
  1355. native UnitDamageTarget takes unit whichUnit, widget target, real amount, boolean attack, boolean ranged, attacktype attackType, damagetype damageType, weapontype weaponType returns boolean
  1356. native IssueImmediateOrder takes unit whichUnit, string order returns boolean
  1357. native IssueImmediateOrderById takes unit whichUnit, integer order returns boolean
  1358. native IssuePointOrder takes unit whichUnit, string order, real x, real y returns boolean
  1359. native IssuePointOrderLoc takes unit whichUnit, string order, location whichLocation returns boolean
  1360. native IssuePointOrderById takes unit whichUnit, integer order, real x, real y returns boolean
  1361. native IssuePointOrderByIdLoc takes unit whichUnit, integer order, location whichLocation returns boolean
  1362. native IssueTargetOrder takes unit whichUnit, string order, widget targetWidget returns boolean
  1363. native IssueTargetOrderById takes unit whichUnit, integer order, widget targetWidget returns boolean
  1364. native IssueInstantPointOrder takes unit whichUnit, string order, real x, real y, widget instantTargetWidget returns boolean
  1365. native IssueInstantPointOrderById takes unit whichUnit, integer order, real x, real y, widget instantTargetWidget returns boolean
  1366. native IssueInstantTargetOrder takes unit whichUnit, string order, widget targetWidget, widget instantTargetWidget returns boolean
  1367. native IssueInstantTargetOrderById takes unit whichUnit, integer order, widget targetWidget, widget instantTargetWidget returns boolean
  1368. native IssueBuildOrder takes unit whichPeon, string unitToBuild, real x, real y returns boolean
  1369. native IssueBuildOrderById takes unit whichPeon, integer unitId, real x, real y returns boolean
  1370. native IssueNeutralImmediateOrder takes player forWhichPlayer, unit neutralStructure, string unitToBuild returns boolean
  1371. native IssueNeutralImmediateOrderById takes player forWhichPlayer,unit neutralStructure, integer unitId returns boolean
  1372. native IssueNeutralPointOrder takes player forWhichPlayer,unit neutralStructure, string unitToBuild, real x, real y returns boolean
  1373. native IssueNeutralPointOrderById takes player forWhichPlayer,unit neutralStructure, integer unitId, real x, real y returns boolean
  1374. native IssueNeutralTargetOrder takes player forWhichPlayer,unit neutralStructure, string unitToBuild, widget target returns boolean
  1375. native IssueNeutralTargetOrderById takes player forWhichPlayer,unit neutralStructure, integer unitId, widget target returns boolean
  1376. native GetUnitCurrentOrder takes unit whichUnit returns integer
  1377. native SetResourceAmount takes unit whichUnit, integer amount returns nothing
  1378. native AddResourceAmount takes unit whichUnit, integer amount returns nothing
  1379. native GetResourceAmount takes unit whichUnit returns integer
  1380. native WaygateGetDestinationX takes unit waygate returns real
  1381. native WaygateGetDestinationY takes unit waygate returns real
  1382. native WaygateSetDestination takes unit waygate, real x, real y returns nothing
  1383. native WaygateActivate takes unit waygate, boolean activate returns nothing
  1384. native WaygateIsActive takes unit waygate returns boolean
  1385. native AddItemToAllStock takes integer itemId, integer currentStock, integer stockMax returns nothing
  1386. native AddItemToStock takes unit whichUnit, integer itemId, integer currentStock, integer stockMax returns nothing
  1387. native AddUnitToAllStock takes integer unitId, integer currentStock, integer stockMax returns nothing
  1388. native AddUnitToStock takes unit whichUnit, integer unitId, integer currentStock, integer stockMax returns nothing
  1389. native RemoveItemFromAllStock takes integer itemId returns nothing
  1390. native RemoveItemFromStock takes unit whichUnit, integer itemId returns nothing
  1391. native RemoveUnitFromAllStock takes integer unitId returns nothing
  1392. native RemoveUnitFromStock takes unit whichUnit, integer unitId returns nothing
  1393. native SetAllItemTypeSlots takes integer slots returns nothing
  1394. native SetAllUnitTypeSlots takes integer slots returns nothing
  1395. native SetItemTypeSlots takes unit whichUnit, integer slots returns nothing
  1396. native SetUnitTypeSlots takes unit whichUnit, integer slots returns nothing
  1397. native GetUnitUserData takes unit whichUnit returns integer
  1398. native SetUnitUserData takes unit whichUnit, integer data returns nothing
  1399. //============================================================================
  1400. // Player API
  1401. constant native Player takes integer number returns player
  1402. constant native GetLocalPlayer takes nothing returns player
  1403. constant native IsPlayerAlly takes player whichPlayer, player otherPlayer returns boolean
  1404. constant native IsPlayerEnemy takes player whichPlayer, player otherPlayer returns boolean
  1405. constant native IsPlayerInForce takes player whichPlayer, force whichForce returns boolean
  1406. constant native IsPlayerObserver takes player whichPlayer returns boolean
  1407. constant native IsVisibleToPlayer takes real x, real y, player whichPlayer returns boolean
  1408. constant native IsLocationVisibleToPlayer takes location whichLocation, player whichPlayer returns boolean
  1409. constant native IsFoggedToPlayer takes real x, real y, player whichPlayer returns boolean
  1410. constant native IsLocationFoggedToPlayer takes location whichLocation, player whichPlayer returns boolean
  1411. constant native IsMaskedToPlayer takes real x, real y, player whichPlayer returns boolean
  1412. constant native IsLocationMaskedToPlayer takes location whichLocation, player whichPlayer returns boolean
  1413. constant native GetPlayerRace takes player whichPlayer returns race
  1414. constant native GetPlayerId takes player whichPlayer returns integer
  1415. constant native GetPlayerUnitCount takes player whichPlayer, boolean includeIncomplete returns integer
  1416. constant native GetPlayerTypedUnitCount takes player whichPlayer, string unitName, boolean includeIncomplete, boolean includeUpgrades returns integer
  1417. constant native GetPlayerStructureCount takes player whichPlayer, boolean includeIncomplete returns integer
  1418. constant native GetPlayerState takes player whichPlayer, playerstate whichPlayerState returns integer
  1419. constant native GetPlayerScore takes player whichPlayer, playerscore whichPlayerScore returns integer
  1420. constant native GetPlayerAlliance takes player sourcePlayer, player otherPlayer, alliancetype whichAllianceSetting returns boolean
  1421. constant native GetPlayerHandicap takes player whichPlayer returns real
  1422. constant native GetPlayerHandicapXP takes player whichPlayer returns real
  1423. constant native SetPlayerHandicap takes player whichPlayer, real handicap returns nothing
  1424. constant native SetPlayerHandicapXP takes player whichPlayer, real handicap returns nothing
  1425. constant native SetPlayerTechMaxAllowed takes player whichPlayer, integer techid, integer maximum returns nothing
  1426. constant native GetPlayerTechMaxAllowed takes player whichPlayer, integer techid returns integer
  1427. constant native AddPlayerTechResearched takes player whichPlayer, integer techid, integer levels returns nothing
  1428. constant native SetPlayerTechResearched takes player whichPlayer, integer techid, integer setToLevel returns nothing
  1429. constant native GetPlayerTechResearched takes player whichPlayer, integer techid, boolean specificonly returns boolean
  1430. constant native GetPlayerTechCount takes player whichPlayer, integer techid, boolean specificonly returns integer
  1431. native SetPlayerUnitsOwner takes player whichPlayer, integer newOwner returns nothing
  1432. native CripplePlayer takes player whichPlayer, force toWhichPlayers, boolean flag returns nothing
  1433. native SetPlayerAbilityAvailable takes player whichPlayer, integer abilid, boolean avail returns nothing
  1434. native SetPlayerState takes player whichPlayer, playerstate whichPlayerState, integer value returns nothing
  1435. native RemovePlayer takes player whichPlayer, playergameresult gameResult returns nothing
  1436. // Used to store hero level data for the scorescreen
  1437. // before units are moved to neutral passive in melee games
  1438. //
  1439. native CachePlayerHeroData takes player whichPlayer returns nothing
  1440. //============================================================================
  1441. // Fog of War API
  1442. native SetFogStateRect takes player forWhichPlayer, fogstate whichState, rect where, boolean useSharedVision returns nothing
  1443. native SetFogStateRadius takes player forWhichPlayer, fogstate whichState, real centerx, real centerY, real radius, boolean useSharedVision returns nothing
  1444. native SetFogStateRadiusLoc takes player forWhichPlayer, fogstate whichState, location center, real radius, boolean useSharedVision returns nothing
  1445. native FogMaskEnable takes boolean enable returns nothing
  1446. native IsFogMaskEnabled takes nothing returns boolean
  1447. native FogEnable takes boolean enable returns nothing
  1448. native IsFogEnabled takes nothing returns boolean
  1449. native CreateFogModifierRect takes player forWhichPlayer, fogstate whichState, rect where, boolean useSharedVision, boolean afterUnits returns fogmodifier
  1450. native CreateFogModifierRadius takes player forWhichPlayer, fogstate whichState, real centerx, real centerY, real radius, boolean useSharedVision, boolean afterUnits returns fogmodifier
  1451. native CreateFogModifierRadiusLoc takes player forWhichPlayer, fogstate whichState, location center, real radius, boolean useSharedVision, boolean afterUnits returns fogmodifier
  1452. native DestroyFogModifier takes fogmodifier whichFogModifier returns nothing
  1453. native FogModifierStart takes fogmodifier whichFogModifier returns nothing
  1454. native FogModifierStop takes fogmodifier whichFogModifier returns nothing
  1455. //============================================================================
  1456. // Game API
  1457. native VersionGet takes nothing returns version
  1458. native VersionCompatible takes version whichVersion returns boolean
  1459. native VersionSupported takes version whichVersion returns boolean
  1460. native EndGame takes boolean doScoreScreen returns nothing
  1461. // Async only!
  1462. native ChangeLevel takes string newLevel, boolean doScoreScreen returns nothing
  1463. native RestartGame takes boolean doScoreScreen returns nothing
  1464. native ReloadGame takes nothing returns nothing
  1465. // %%% SetCampaignMenuRace is deprecated. It must remain to support
  1466. // old maps which use it, but all new maps should use SetCampaignMenuRaceEx
  1467. native SetCampaignMenuRace takes race r returns nothing
  1468. native SetCampaignMenuRaceEx takes integer campaignIndex returns nothing
  1469. native ForceCampaignSelectScreen takes nothing returns nothing
  1470. native LoadGame takes string saveFileName, boolean doScoreScreen returns nothing
  1471. native SaveGame takes string saveFileName returns nothing
  1472. native RenameSaveDirectory takes string sourceDirName, string destDirName returns boolean
  1473. native RemoveSaveDirectory takes string sourceDirName returns boolean
  1474. native CopySaveGame takes string sourceSaveName, string destSaveName returns boolean
  1475. native SaveGameExists takes string saveName returns boolean
  1476. native SyncSelections takes nothing returns nothing
  1477. native SetFloatGameState takes fgamestate whichFloatGameState, real value returns nothing
  1478. constant native GetFloatGameState takes fgamestate whichFloatGameState returns real
  1479. native SetIntegerGameState takes igamestate whichIntegerGameState, integer value returns nothing
  1480. constant native GetIntegerGameState takes igamestate whichIntegerGameState returns integer
  1481. //============================================================================
  1482. // Campaign API
  1483. native SetTutorialCleared takes boolean cleared returns nothing
  1484. native SetMissionAvailable takes integer campaignNumber, integer missionNumber, boolean available returns nothing
  1485. native SetCampaignAvailable takes integer campaignNumber, boolean available returns nothing
  1486. native SetOpCinematicAvailable takes integer campaignNumber, boolean available returns nothing
  1487. native SetEdCinematicAvailable takes integer campaignNumber, boolean available returns nothing
  1488. native GetDefaultDifficulty takes nothing returns gamedifficulty
  1489. native SetDefaultDifficulty takes gamedifficulty g returns nothing
  1490. native SetCustomCampaignButtonVisible takes integer whichButton, boolean visible returns nothing
  1491. native GetCustomCampaignButtonVisible takes integer whichButton returns boolean
  1492. native DoNotSaveReplay takes nothing returns nothing
  1493. //============================================================================
  1494. // Dialog API
  1495. native DialogCreate takes nothing returns dialog
  1496. native DialogDestroy takes dialog whichDialog returns nothing
  1497. native DialogClear takes dialog whichDialog returns nothing
  1498. native DialogSetMessage takes dialog whichDialog, string messageText returns nothing
  1499. native DialogAddButton takes dialog whichDialog, string buttonText, integer hotkey returns button
  1500. native DialogAddQuitButton takes dialog whichDialog, boolean doScoreScreen, string buttonText, integer hotkey returns button
  1501. native DialogDisplay takes player whichPlayer, dialog whichDialog, boolean flag returns nothing
  1502. // Creates a new or reads in an existing game cache file stored
  1503. // in the current campaign profile dir
  1504. //
  1505. native ReloadGameCachesFromDisk takes nothing returns boolean
  1506. native InitGameCache takes string campaignFile returns gamecache
  1507. native SaveGameCache takes gamecache whichCache returns boolean
  1508. native StoreInteger takes gamecache cache, string missionKey, string key, integer value returns nothing
  1509. native StoreReal takes gamecache cache, string missionKey, string key, real value returns nothing
  1510. native StoreBoolean takes gamecache cache, string missionKey, string key, boolean value returns nothing
  1511. native StoreUnit takes gamecache cache, string missionKey, string key, unit whichUnit returns boolean
  1512. native StoreString takes gamecache cache, string missionKey, string key, string value returns boolean
  1513. native SyncStoredInteger takes gamecache cache, string missionKey, string key returns nothing
  1514. native SyncStoredReal takes gamecache cache, string missionKey, string key returns nothing
  1515. native SyncStoredBoolean takes gamecache cache, string missionKey, string key returns nothing
  1516. native SyncStoredUnit takes gamecache cache, string missionKey, string key returns nothing
  1517. native SyncStoredString takes gamecache cache, string missionKey, string key returns nothing
  1518. native HaveStoredInteger takes gamecache cache, string missionKey, string key returns boolean
  1519. native HaveStoredReal takes gamecache cache, string missionKey, string key returns boolean
  1520. native HaveStoredBoolean takes gamecache cache, string missionKey, string key returns boolean
  1521. native HaveStoredUnit takes gamecache cache, string missionKey, string key returns boolean
  1522. native HaveStoredString takes gamecache cache, string missionKey, string key returns boolean
  1523. native FlushGameCache takes gamecache cache returns nothing
  1524. native FlushStoredMission takes gamecache cache, string missionKey returns nothing
  1525. native FlushStoredInteger takes gamecache cache, string missionKey, string key returns nothing
  1526. native FlushStoredReal takes gamecache cache, string missionKey, string key returns nothing
  1527. native FlushStoredBoolean takes gamecache cache, string missionKey, string key returns nothing
  1528. native FlushStoredUnit takes gamecache cache, string missionKey, string key returns nothing
  1529. native FlushStoredString takes gamecache cache, string missionKey, string key returns nothing
  1530. // Will return 0 if the specified value's data is not found in the cache
  1531. native GetStoredInteger takes gamecache cache, string missionKey, string key returns integer
  1532. native GetStoredReal takes gamecache cache, string missionKey, string key returns real
  1533. native GetStoredBoolean takes gamecache cache, string missionKey, string key returns boolean
  1534. native GetStoredString takes gamecache cache, string missionKey, string key returns string
  1535. native RestoreUnit takes gamecache cache, string missionKey, string key, player forWhichPlayer, real x, real y, real facing returns unit
  1536. native InitHashtable takes nothing returns hashtable
  1537. native SaveInteger takes hashtable table, integer parentKey, integer childKey, integer value returns nothing
  1538. native SaveReal takes hashtable table, integer parentKey, integer childKey, real value returns nothing
  1539. native SaveBoolean takes hashtable table, integer parentKey, integer childKey, boolean value returns nothing
  1540. native SaveStr takes hashtable table, integer parentKey, integer childKey, string value returns boolean
  1541. native SavePlayerHandle takes hashtable table, integer parentKey, integer childKey, player whichPlayer returns boolean
  1542. native SaveWidgetHandle takes hashtable table, integer parentKey, integer childKey, widget whichWidget returns boolean
  1543. native SaveDestructableHandle takes hashtable table, integer parentKey, integer childKey, destructable whichDestructable returns boolean
  1544. native SaveItemHandle takes hashtable table, integer parentKey, integer childKey, item whichItem returns boolean
  1545. native SaveUnitHandle takes hashtable table, integer parentKey, integer childKey, unit whichUnit returns boolean
  1546. native SaveAbilityHandle takes hashtable table, integer parentKey, integer childKey, ability whichAbility returns boolean
  1547. native SaveTimerHandle takes hashtable table, integer parentKey, integer childKey, timer whichTimer returns boolean
  1548. native SaveTriggerHandle takes hashtable table, integer parentKey, integer childKey, trigger whichTrigger returns boolean
  1549. native SaveTriggerConditionHandle takes hashtable table, integer parentKey, integer childKey, triggercondition whichTriggercondition returns boolean
  1550. native SaveTriggerActionHandle takes hashtable table, integer parentKey, integer childKey, triggeraction whichTriggeraction returns boolean
  1551. native SaveTriggerEventHandle takes hashtable table, integer parentKey, integer childKey, event whichEvent returns boolean
  1552. native SaveForceHandle takes hashtable table, integer parentKey, integer childKey, force whichForce returns boolean
  1553. native SaveGroupHandle takes hashtable table, integer parentKey, integer childKey, group whichGroup returns boolean
  1554. native SaveLocationHandle takes hashtable table, integer parentKey, integer childKey, location whichLocation returns boolean
  1555. native SaveRectHandle takes hashtable table, integer parentKey, integer childKey, rect whichRect returns boolean
  1556. native SaveBooleanExprHandle takes hashtable table, integer parentKey, integer childKey, boolexpr whichBoolexpr returns boolean
  1557. native SaveSoundHandle takes hashtable table, integer parentKey, integer childKey, sound whichSound returns boolean
  1558. native SaveEffectHandle takes hashtable table, integer parentKey, integer childKey, effect whichEffect returns boolean
  1559. native SaveUnitPoolHandle takes hashtable table, integer parentKey, integer childKey, unitpool whichUnitpool returns boolean
  1560. native SaveItemPoolHandle takes hashtable table, integer parentKey, integer childKey, itempool whichItempool returns boolean
  1561. native SaveQuestHandle takes hashtable table, integer parentKey, integer childKey, quest whichQuest returns boolean
  1562. native SaveQuestItemHandle takes hashtable table, integer parentKey, integer childKey, questitem whichQuestitem returns boolean
  1563. native SaveDefeatConditionHandle takes hashtable table, integer parentKey, integer childKey, defeatcondition whichDefeatcondition returns boolean
  1564. native SaveTimerDialogHandle takes hashtable table, integer parentKey, integer childKey, timerdialog whichTimerdialog returns boolean
  1565. native SaveLeaderboardHandle takes hashtable table, integer parentKey, integer childKey, leaderboard whichLeaderboard returns boolean
  1566. native SaveMultiboardHandle takes hashtable table, integer parentKey, integer childKey, multiboard whichMultiboard returns boolean
  1567. native SaveMultiboardItemHandle takes hashtable table, integer parentKey, integer childKey, multiboarditem whichMultiboarditem returns boolean
  1568. native SaveTrackableHandle takes hashtable table, integer parentKey, integer childKey, trackable whichTrackable returns boolean
  1569. native SaveDialogHandle takes hashtable table, integer parentKey, integer childKey, dialog whichDialog returns boolean
  1570. native SaveButtonHandle takes hashtable table, integer parentKey, integer childKey, button whichButton returns boolean
  1571. native SaveTextTagHandle takes hashtable table, integer parentKey, integer childKey, texttag whichTexttag returns boolean
  1572. native SaveLightningHandle takes hashtable table, integer parentKey, integer childKey, lightning whichLightning returns boolean
  1573. native SaveImageHandle takes hashtable table, integer parentKey, integer childKey, image whichImage returns boolean
  1574. native SaveUbersplatHandle takes hashtable table, integer parentKey, integer childKey, ubersplat whichUbersplat returns boolean
  1575. native SaveRegionHandle takes hashtable table, integer parentKey, integer childKey, region whichRegion returns boolean
  1576. native SaveFogStateHandle takes hashtable table, integer parentKey, integer childKey, fogstate whichFogState returns boolean
  1577. native SaveFogModifierHandle takes hashtable table, integer parentKey, integer childKey, fogmodifier whichFogModifier returns boolean
  1578. native SaveAgentHandle takes hashtable table, integer parentKey, integer childKey, agent whichAgent returns boolean
  1579. native SaveHashtableHandle takes hashtable table, integer parentKey, integer childKey, hashtable whichHashtable returns boolean
  1580. native LoadInteger takes hashtable table, integer parentKey, integer childKey returns integer
  1581. native LoadReal takes hashtable table, integer parentKey, integer childKey returns real
  1582. native LoadBoolean takes hashtable table, integer parentKey, integer childKey returns boolean
  1583. native LoadStr takes hashtable table, integer parentKey, integer childKey returns string
  1584. native LoadPlayerHandle takes hashtable table, integer parentKey, integer childKey returns player
  1585. native LoadWidgetHandle takes hashtable table, integer parentKey, integer childKey returns widget
  1586. native LoadDestructableHandle takes hashtable table, integer parentKey, integer childKey returns destructable
  1587. native LoadItemHandle takes hashtable table, integer parentKey, integer childKey returns item
  1588. native LoadUnitHandle takes hashtable table, integer parentKey, integer childKey returns unit
  1589. native LoadAbilityHandle takes hashtable table, integer parentKey, integer childKey returns ability
  1590. native LoadTimerHandle takes hashtable table, integer parentKey, integer childKey returns timer
  1591. native LoadTriggerHandle takes hashtable table, integer parentKey, integer childKey returns trigger
  1592. native LoadTriggerConditionHandle takes hashtable table, integer parentKey, integer childKey returns triggercondition
  1593. native LoadTriggerActionHandle takes hashtable table, integer parentKey, integer childKey returns triggeraction
  1594. native LoadTriggerEventHandle takes hashtable table, integer parentKey, integer childKey returns event
  1595. native LoadForceHandle takes hashtable table, integer parentKey, integer childKey returns force
  1596. native LoadGroupHandle takes hashtable table, integer parentKey, integer childKey returns group
  1597. native LoadLocationHandle takes hashtable table, integer parentKey, integer childKey returns location
  1598. native LoadRectHandle takes hashtable table, integer parentKey, integer childKey returns rect
  1599. native LoadBooleanExprHandle takes hashtable table, integer parentKey, integer childKey returns boolexpr
  1600. native LoadSoundHandle takes hashtable table, integer parentKey, integer childKey returns sound
  1601. native LoadEffectHandle takes hashtable table, integer parentKey, integer childKey returns effect
  1602. native LoadUnitPoolHandle takes hashtable table, integer parentKey, integer childKey returns unitpool
  1603. native LoadItemPoolHandle takes hashtable table, integer parentKey, integer childKey returns itempool
  1604. native LoadQuestHandle takes hashtable table, integer parentKey, integer childKey returns quest
  1605. native LoadQuestItemHandle takes hashtable table, integer parentKey, integer childKey returns questitem
  1606. native LoadDefeatConditionHandle takes hashtable table, integer parentKey, integer childKey returns defeatcondition
  1607. native LoadTimerDialogHandle takes hashtable table, integer parentKey, integer childKey returns timerdialog
  1608. native LoadLeaderboardHandle takes hashtable table, integer parentKey, integer childKey returns leaderboard
  1609. native LoadMultiboardHandle takes hashtable table, integer parentKey, integer childKey returns multiboard
  1610. native LoadMultiboardItemHandle takes hashtable table, integer parentKey, integer childKey returns multiboarditem
  1611. native LoadTrackableHandle takes hashtable table, integer parentKey, integer childKey returns trackable
  1612. native LoadDialogHandle takes hashtable table, integer parentKey, integer childKey returns dialog
  1613. native LoadButtonHandle takes hashtable table, integer parentKey, integer childKey returns button
  1614. native LoadTextTagHandle takes hashtable table, integer parentKey, integer childKey returns texttag
  1615. native LoadLightningHandle takes hashtable table, integer parentKey, integer childKey returns lightning
  1616. native LoadImageHandle takes hashtable table, integer parentKey, integer childKey returns image
  1617. native LoadUbersplatHandle takes hashtable table, integer parentKey, integer childKey returns ubersplat
  1618. native LoadRegionHandle takes hashtable table, integer parentKey, integer childKey returns region
  1619. native LoadFogStateHandle takes hashtable table, integer parentKey, integer childKey returns fogstate
  1620. native LoadFogModifierHandle takes hashtable table, integer parentKey, integer childKey returns fogmodifier
  1621. native LoadHashtableHandle takes hashtable table, integer parentKey, integer childKey returns hashtable
  1622. native HaveSavedInteger takes hashtable table, integer parentKey, integer childKey returns boolean
  1623. native HaveSavedReal takes hashtable table, integer parentKey, integer childKey returns boolean
  1624. native HaveSavedBoolean takes hashtable table, integer parentKey, integer childKey returns boolean
  1625. native HaveSavedString takes hashtable table, integer parentKey, integer childKey returns boolean
  1626. native HaveSavedHandle takes hashtable table, integer parentKey, integer childKey returns boolean
  1627. native RemoveSavedInteger takes hashtable table, integer parentKey, integer childKey returns nothing
  1628. native RemoveSavedReal takes hashtable table, integer parentKey, integer childKey returns nothing
  1629. native RemoveSavedBoolean takes hashtable table, integer parentKey, integer childKey returns nothing
  1630. native RemoveSavedString takes hashtable table, integer parentKey, integer childKey returns nothing
  1631. native RemoveSavedHandle takes hashtable table, integer parentKey, integer childKey returns nothing
  1632. native FlushParentHashtable takes hashtable table returns nothing
  1633. native FlushChildHashtable takes hashtable table, integer parentKey returns nothing
  1634. //============================================================================
  1635. // Randomization API
  1636. native GetRandomInt takes integer lowBound, integer highBound returns integer
  1637. native GetRandomReal takes real lowBound, real highBound returns real
  1638. native CreateUnitPool takes nothing returns unitpool
  1639. native DestroyUnitPool takes unitpool whichPool returns nothing
  1640. native UnitPoolAddUnitType takes unitpool whichPool, integer unitId, real weight returns nothing
  1641. native UnitPoolRemoveUnitType takes unitpool whichPool, integer unitId returns nothing
  1642. native PlaceRandomUnit takes unitpool whichPool, player forWhichPlayer, real x, real y, real facing returns unit
  1643. native CreateItemPool takes nothing returns itempool
  1644. native DestroyItemPool takes itempool whichItemPool returns nothing
  1645. native ItemPoolAddItemType takes itempool whichItemPool, integer itemId, real weight returns nothing
  1646. native ItemPoolRemoveItemType takes itempool whichItemPool, integer itemId returns nothing
  1647. native PlaceRandomItem takes itempool whichItemPool, real x, real y returns item
  1648. // Choose any random unit/item. (NP means Neutral Passive)
  1649. native ChooseRandomCreep takes integer level returns integer
  1650. native ChooseRandomNPBuilding takes nothing returns integer
  1651. native ChooseRandomItem takes integer level returns integer
  1652. native ChooseRandomItemEx takes itemtype whichType, integer level returns integer
  1653. native SetRandomSeed takes integer seed returns nothing
  1654. //============================================================================
  1655. // Visual API
  1656. native SetTerrainFog takes real a, real b, real c, real d, real e returns nothing
  1657. native ResetTerrainFog takes nothing returns nothing
  1658. native SetUnitFog takes real a, real b, real c, real d, real e returns nothing
  1659. native SetTerrainFogEx takes integer style, real zstart, real zend, real density, real red, real green, real blue returns nothing
  1660. native DisplayTextToPlayer takes player toPlayer, real x, real y, string message returns nothing
  1661. native DisplayTimedTextToPlayer takes player toPlayer, real x, real y, real duration, string message returns nothing
  1662. native DisplayTimedTextFromPlayer takes player toPlayer, real x, real y, real duration, string message returns nothing
  1663. native ClearTextMessages takes nothing returns nothing
  1664. native SetDayNightModels takes string terrainDNCFile, string unitDNCFile returns nothing
  1665. native SetSkyModel takes string skyModelFile returns nothing
  1666. native EnableUserControl takes boolean b returns nothing
  1667. native EnableUserUI takes boolean b returns nothing
  1668. native SuspendTimeOfDay takes boolean b returns nothing
  1669. native SetTimeOfDayScale takes real r returns nothing
  1670. native GetTimeOfDayScale takes nothing returns real
  1671. native ShowInterface takes boolean flag, real fadeDuration returns nothing
  1672. native PauseGame takes boolean flag returns nothing
  1673. native UnitAddIndicator takes unit whichUnit, integer red, integer green, integer blue, integer alpha returns nothing
  1674. native AddIndicator takes widget whichWidget, integer red, integer green, integer blue, integer alpha returns nothing
  1675. native PingMinimap takes real x, real y, real duration returns nothing
  1676. native PingMinimapEx takes real x, real y, real duration, integer red, integer green, integer blue, boolean extraEffects returns nothing
  1677. native EnableOcclusion takes boolean flag returns nothing
  1678. native SetIntroShotText takes string introText returns nothing
  1679. native SetIntroShotModel takes string introModelPath returns nothing
  1680. native EnableWorldFogBoundary takes boolean b returns nothing
  1681. native PlayModelCinematic takes string modelName returns nothing
  1682. native PlayCinematic takes string movieName returns nothing
  1683. native ForceUIKey takes string key returns nothing
  1684. native ForceUICancel takes nothing returns nothing
  1685. native DisplayLoadDialog takes nothing returns nothing
  1686. native SetAltMinimapIcon takes string iconPath returns nothing
  1687. native DisableRestartMission takes boolean flag returns nothing
  1688. native CreateTextTag takes nothing returns texttag
  1689. native DestroyTextTag takes texttag t returns nothing
  1690. native SetTextTagText takes texttag t, string s, real height returns nothing
  1691. native SetTextTagPos takes texttag t, real x, real y, real heightOffset returns nothing
  1692. native SetTextTagPosUnit takes texttag t, unit whichUnit, real heightOffset returns nothing
  1693. native SetTextTagColor takes texttag t, integer red, integer green, integer blue, integer alpha returns nothing
  1694. native SetTextTagVelocity takes texttag t, real xvel, real yvel returns nothing
  1695. native SetTextTagVisibility takes texttag t, boolean flag returns nothing
  1696. native SetTextTagSuspended takes texttag t, boolean flag returns nothing
  1697. native SetTextTagPermanent takes texttag t, boolean flag returns nothing
  1698. native SetTextTagAge takes texttag t, real age returns nothing
  1699. native SetTextTagLifespan takes texttag t, real lifespan returns nothing
  1700. native SetTextTagFadepoint takes texttag t, real fadepoint returns nothing
  1701. native SetReservedLocalHeroButtons takes integer reserved returns nothing
  1702. native GetAllyColorFilterState takes nothing returns integer
  1703. native SetAllyColorFilterState takes integer state returns nothing
  1704. native GetCreepCampFilterState takes nothing returns boolean
  1705. native SetCreepCampFilterState takes boolean state returns nothing
  1706. native EnableMinimapFilterButtons takes boolean enableAlly, boolean enableCreep returns nothing
  1707. native EnableDragSelect takes boolean state, boolean ui returns nothing
  1708. native EnablePreSelect takes boolean state, boolean ui returns nothing
  1709. native EnableSelect takes boolean state, boolean ui returns nothing
  1710. //============================================================================
  1711. // Trackable API
  1712. native CreateTrackable takes string trackableModelPath, real x, real y, real facing returns trackable
  1713. //============================================================================
  1714. // Quest API
  1715. native CreateQuest takes nothing returns quest
  1716. native DestroyQuest takes quest whichQuest returns nothing
  1717. native QuestSetTitle takes quest whichQuest, string title returns nothing
  1718. native QuestSetDescription takes quest whichQuest, string description returns nothing
  1719. native QuestSetIconPath takes quest whichQuest, string iconPath returns nothing
  1720. native QuestSetRequired takes quest whichQuest, boolean required returns nothing
  1721. native QuestSetCompleted takes quest whichQuest, boolean completed returns nothing
  1722. native QuestSetDiscovered takes quest whichQuest, boolean discovered returns nothing
  1723. native QuestSetFailed takes quest whichQuest, boolean failed returns nothing
  1724. native QuestSetEnabled takes quest whichQuest, boolean enabled returns nothing
  1725. native IsQuestRequired takes quest whichQuest returns boolean
  1726. native IsQuestCompleted takes quest whichQuest returns boolean
  1727. native IsQuestDiscovered takes quest whichQuest returns boolean
  1728. native IsQuestFailed takes quest whichQuest returns boolean
  1729. native IsQuestEnabled takes quest whichQuest returns boolean
  1730. native QuestCreateItem takes quest whichQuest returns questitem
  1731. native QuestItemSetDescription takes questitem whichQuestItem, string description returns nothing
  1732. native QuestItemSetCompleted takes questitem whichQuestItem, boolean completed returns nothing
  1733. native IsQuestItemCompleted takes questitem whichQuestItem returns boolean
  1734. native CreateDefeatCondition takes nothing returns defeatcondition
  1735. native DestroyDefeatCondition takes defeatcondition whichCondition returns nothing
  1736. native DefeatConditionSetDescription takes defeatcondition whichCondition, string description returns nothing
  1737. native FlashQuestDialogButton takes nothing returns nothing
  1738. native ForceQuestDialogUpdate takes nothing returns nothing
  1739. //============================================================================
  1740. // Timer Dialog API
  1741. native CreateTimerDialog takes timer t returns timerdialog
  1742. native DestroyTimerDialog takes timerdialog whichDialog returns nothing
  1743. native TimerDialogSetTitle takes timerdialog whichDialog, string title returns nothing
  1744. native TimerDialogSetTitleColor takes timerdialog whichDialog, integer red, integer green, integer blue, integer alpha returns nothing
  1745. native TimerDialogSetTimeColor takes timerdialog whichDialog, integer red, integer green, integer blue, integer alpha returns nothing
  1746. native TimerDialogSetSpeed takes timerdialog whichDialog, real speedMultFactor returns nothing
  1747. native TimerDialogDisplay takes timerdialog whichDialog, boolean display returns nothing
  1748. native IsTimerDialogDisplayed takes timerdialog whichDialog returns boolean
  1749. native TimerDialogSetRealTimeRemaining takes timerdialog whichDialog, real timeRemaining returns nothing
  1750. //============================================================================
  1751. // Leaderboard API
  1752. // Create a leaderboard object
  1753. native CreateLeaderboard takes nothing returns leaderboard
  1754. native DestroyLeaderboard takes leaderboard lb returns nothing
  1755. native LeaderboardDisplay takes leaderboard lb, boolean show returns nothing
  1756. native IsLeaderboardDisplayed takes leaderboard lb returns boolean
  1757. native LeaderboardGetItemCount takes leaderboard lb returns integer
  1758. native LeaderboardSetSizeByItemCount takes leaderboard lb, integer count returns nothing
  1759. native LeaderboardAddItem takes leaderboard lb, string label, integer value, player p returns nothing
  1760. native LeaderboardRemoveItem takes leaderboard lb, integer index returns nothing
  1761. native LeaderboardRemovePlayerItem takes leaderboard lb, player p returns nothing
  1762. native LeaderboardClear takes leaderboard lb returns nothing
  1763. native LeaderboardSortItemsByValue takes leaderboard lb, boolean ascending returns nothing
  1764. native LeaderboardSortItemsByPlayer takes leaderboard lb, boolean ascending returns nothing
  1765. native LeaderboardSortItemsByLabel takes leaderboard lb, boolean ascending returns nothing
  1766. native LeaderboardHasPlayerItem takes leaderboard lb, player p returns boolean
  1767. native LeaderboardGetPlayerIndex takes leaderboard lb, player p returns integer
  1768. native LeaderboardSetLabel takes leaderboard lb, string label returns nothing
  1769. native LeaderboardGetLabelText takes leaderboard lb returns string
  1770. native PlayerSetLeaderboard takes player toPlayer, leaderboard lb returns nothing
  1771. native PlayerGetLeaderboard takes player toPlayer returns leaderboard
  1772. native LeaderboardSetLabelColor takes leaderboard lb, integer red, integer green, integer blue, integer alpha returns nothing
  1773. native LeaderboardSetValueColor takes leaderboard lb, integer red, integer green, integer blue, integer alpha returns nothing
  1774. native LeaderboardSetStyle takes leaderboard lb, boolean showLabel, boolean showNames, boolean showValues, boolean showIcons returns nothing
  1775. native LeaderboardSetItemValue takes leaderboard lb, integer whichItem, integer val returns nothing
  1776. native LeaderboardSetItemLabel takes leaderboard lb, integer whichItem, string val returns nothing
  1777. native LeaderboardSetItemStyle takes leaderboard lb, integer whichItem, boolean showLabel, boolean showValue, boolean showIcon returns nothing
  1778. native LeaderboardSetItemLabelColor takes leaderboard lb, integer whichItem, integer red, integer green, integer blue, integer alpha returns nothing
  1779. native LeaderboardSetItemValueColor takes leaderboard lb, integer whichItem, integer red, integer green, integer blue, integer alpha returns nothing
  1780. //============================================================================
  1781. // Multiboard API
  1782. //============================================================================
  1783. // Create a multiboard object
  1784. native CreateMultiboard takes nothing returns multiboard
  1785. native DestroyMultiboard takes multiboard lb returns nothing
  1786. native MultiboardDisplay takes multiboard lb, boolean show returns nothing
  1787. native IsMultiboardDisplayed takes multiboard lb returns boolean
  1788. native MultiboardMinimize takes multiboard lb, boolean minimize returns nothing
  1789. native IsMultiboardMinimized takes multiboard lb returns boolean
  1790. native MultiboardClear takes multiboard lb returns nothing
  1791. native MultiboardSetTitleText takes multiboard lb, string label returns nothing
  1792. native MultiboardGetTitleText takes multiboard lb returns string
  1793. native MultiboardSetTitleTextColor takes multiboard lb, integer red, integer green, integer blue, integer alpha returns nothing
  1794. native MultiboardGetRowCount takes multiboard lb returns integer
  1795. native MultiboardGetColumnCount takes multiboard lb returns integer
  1796. native MultiboardSetColumnCount takes multiboard lb, integer count returns nothing
  1797. native MultiboardSetRowCount takes multiboard lb, integer count returns nothing
  1798. // broadcast settings to all items
  1799. native MultiboardSetItemsStyle takes multiboard lb, boolean showValues, boolean showIcons returns nothing
  1800. native MultiboardSetItemsValue takes multiboard lb, string value returns nothing
  1801. native MultiboardSetItemsValueColor takes multiboard lb, integer red, integer green, integer blue, integer alpha returns nothing
  1802. native MultiboardSetItemsWidth takes multiboard lb, real width returns nothing
  1803. native MultiboardSetItemsIcon takes multiboard lb, string iconPath returns nothing
  1804. // funcs for modifying individual items
  1805. native MultiboardGetItem takes multiboard lb, integer row, integer column returns multiboarditem
  1806. native MultiboardReleaseItem takes multiboarditem mbi returns nothing
  1807. native MultiboardSetItemStyle takes multiboarditem mbi, boolean showValue, boolean showIcon returns nothing
  1808. native MultiboardSetItemValue takes multiboarditem mbi, string val returns nothing
  1809. native MultiboardSetItemValueColor takes multiboarditem mbi, integer red, integer green, integer blue, integer alpha returns nothing
  1810. native MultiboardSetItemWidth takes multiboarditem mbi, real width returns nothing
  1811. native MultiboardSetItemIcon takes multiboarditem mbi, string iconFileName returns nothing
  1812. // meant to unequivocally suspend display of existing and
  1813. // subsequently displayed multiboards
  1814. //
  1815. native MultiboardSuppressDisplay takes boolean flag returns nothing
  1816. //============================================================================
  1817. // Camera API
  1818. native SetCameraPosition takes real x, real y returns nothing
  1819. native SetCameraQuickPosition takes real x, real y returns nothing
  1820. native SetCameraBounds takes real x1, real y1, real x2, real y2, real x3, real y3, real x4, real y4 returns nothing
  1821. native StopCamera takes nothing returns nothing
  1822. native ResetToGameCamera takes real duration returns nothing
  1823. native PanCameraTo takes real x, real y returns nothing
  1824. native PanCameraToTimed takes real x, real y, real duration returns nothing
  1825. native PanCameraToWithZ takes real x, real y, real zOffsetDest returns nothing
  1826. native PanCameraToTimedWithZ takes real x, real y, real zOffsetDest, real duration returns nothing
  1827. native SetCinematicCamera takes string cameraModelFile returns nothing
  1828. native SetCameraRotateMode takes real x, real y, real radiansToSweep, real duration returns nothing
  1829. native SetCameraField takes camerafield whichField, real value, real duration returns nothing
  1830. native AdjustCameraField takes camerafield whichField, real offset, real duration returns nothing
  1831. native SetCameraTargetController takes unit whichUnit, real xoffset, real yoffset, boolean inheritOrientation returns nothing
  1832. native SetCameraOrientController takes unit whichUnit, real xoffset, real yoffset returns nothing
  1833. native CreateCameraSetup takes nothing returns camerasetup
  1834. native CameraSetupSetField takes camerasetup whichSetup, camerafield whichField, real value, real duration returns nothing
  1835. native CameraSetupGetField takes camerasetup whichSetup, camerafield whichField returns real
  1836. native CameraSetupSetDestPosition takes camerasetup whichSetup, real x, real y, real duration returns nothing
  1837. native CameraSetupGetDestPositionLoc takes camerasetup whichSetup returns location
  1838. native CameraSetupGetDestPositionX takes camerasetup whichSetup returns real
  1839. native CameraSetupGetDestPositionY takes camerasetup whichSetup returns real
  1840. native CameraSetupApply takes camerasetup whichSetup, boolean doPan, boolean panTimed returns nothing
  1841. native CameraSetupApplyWithZ takes camerasetup whichSetup, real zDestOffset returns nothing
  1842. native CameraSetupApplyForceDuration takes camerasetup whichSetup, boolean doPan, real forceDuration returns nothing
  1843. native CameraSetupApplyForceDurationWithZ takes camerasetup whichSetup, real zDestOffset, real forceDuration returns nothing
  1844. native CameraSetTargetNoise takes real mag, real velocity returns nothing
  1845. native CameraSetSourceNoise takes real mag, real velocity returns nothing
  1846. native CameraSetTargetNoiseEx takes real mag, real velocity, boolean vertOnly returns nothing
  1847. native CameraSetSourceNoiseEx takes real mag, real velocity, boolean vertOnly returns nothing
  1848. native CameraSetSmoothingFactor takes real factor returns nothing
  1849. native SetCineFilterTexture takes string filename returns nothing
  1850. native SetCineFilterBlendMode takes blendmode whichMode returns nothing
  1851. native SetCineFilterTexMapFlags takes texmapflags whichFlags returns nothing
  1852. native SetCineFilterStartUV takes real minu, real minv, real maxu, real maxv returns nothing
  1853. native SetCineFilterEndUV takes real minu, real minv, real maxu, real maxv returns nothing
  1854. native SetCineFilterStartColor takes integer red, integer green, integer blue, integer alpha returns nothing
  1855. native SetCineFilterEndColor takes integer red, integer green, integer blue, integer alpha returns nothing
  1856. native SetCineFilterDuration takes real duration returns nothing
  1857. native DisplayCineFilter takes boolean flag returns nothing
  1858. native IsCineFilterDisplayed takes nothing returns boolean
  1859. native SetCinematicScene takes integer portraitUnitId, playercolor color, string speakerTitle, string text, real sceneDuration, real voiceoverDuration returns nothing
  1860. native EndCinematicScene takes nothing returns nothing
  1861. native ForceCinematicSubtitles takes boolean flag returns nothing
  1862. native GetCameraMargin takes integer whichMargin returns real
  1863. // These return values for the local players camera only...
  1864. constant native GetCameraBoundMinX takes nothing returns real
  1865. constant native GetCameraBoundMinY takes nothing returns real
  1866. constant native GetCameraBoundMaxX takes nothing returns real
  1867. constant native GetCameraBoundMaxY takes nothing returns real
  1868. constant native GetCameraField takes camerafield whichField returns real
  1869. constant native GetCameraTargetPositionX takes nothing returns real
  1870. constant native GetCameraTargetPositionY takes nothing returns real
  1871. constant native GetCameraTargetPositionZ takes nothing returns real
  1872. constant native GetCameraTargetPositionLoc takes nothing returns location
  1873. constant native GetCameraEyePositionX takes nothing returns real
  1874. constant native GetCameraEyePositionY takes nothing returns real
  1875. constant native GetCameraEyePositionZ takes nothing returns real
  1876. constant native GetCameraEyePositionLoc takes nothing returns location
  1877. //============================================================================
  1878. // Sound API
  1879. //
  1880. native NewSoundEnvironment takes string environmentName returns nothing
  1881. native CreateSound takes string fileName, boolean looping, boolean is3D, boolean stopwhenoutofrange, integer fadeInRate, integer fadeOutRate, string eaxSetting returns sound
  1882. native CreateSoundFilenameWithLabel takes string fileName, boolean looping, boolean is3D, boolean stopwhenoutofrange, integer fadeInRate, integer fadeOutRate, string SLKEntryName returns sound
  1883. native CreateSoundFromLabel takes string soundLabel, boolean looping, boolean is3D, boolean stopwhenoutofrange, integer fadeInRate, integer fadeOutRate returns sound
  1884. native CreateMIDISound takes string soundLabel, integer fadeInRate, integer fadeOutRate returns sound
  1885. native SetSoundParamsFromLabel takes sound soundHandle, string soundLabel returns nothing
  1886. native SetSoundDistanceCutoff takes sound soundHandle, real cutoff returns nothing
  1887. native SetSoundChannel takes sound soundHandle, integer channel returns nothing
  1888. native SetSoundVolume takes sound soundHandle, integer volume returns nothing
  1889. native SetSoundPitch takes sound soundHandle, real pitch returns nothing
  1890. // the following method must be called immediately after calling "StartSound"
  1891. native SetSoundPlayPosition takes sound soundHandle, integer millisecs returns nothing
  1892. // these calls are only valid if the sound was created with 3d enabled
  1893. native SetSoundDistances takes sound soundHandle, real minDist, real maxDist returns nothing
  1894. native SetSoundConeAngles takes sound soundHandle, real inside, real outside, integer outsideVolume returns nothing
  1895. native SetSoundConeOrientation takes sound soundHandle, real x, real y, real z returns nothing
  1896. native SetSoundPosition takes sound soundHandle, real x, real y, real z returns nothing
  1897. native SetSoundVelocity takes sound soundHandle, real x, real y, real z returns nothing
  1898. native AttachSoundToUnit takes sound soundHandle, unit whichUnit returns nothing
  1899. native StartSound takes sound soundHandle returns nothing
  1900. native StopSound takes sound soundHandle, boolean killWhenDone, boolean fadeOut returns nothing
  1901. native KillSoundWhenDone takes sound soundHandle returns nothing
  1902. // Music Interface. Note that if music is disabled, these calls do nothing
  1903. native SetMapMusic takes string musicName, boolean random, integer index returns nothing
  1904. native ClearMapMusic takes nothing returns nothing
  1905. native PlayMusic takes string musicName returns nothing
  1906. native PlayMusicEx takes string musicName, integer frommsecs, integer fadeinmsecs returns nothing
  1907. native StopMusic takes boolean fadeOut returns nothing
  1908. native ResumeMusic takes nothing returns nothing
  1909. native PlayThematicMusic takes string musicFileName returns nothing
  1910. native PlayThematicMusicEx takes string musicFileName, integer frommsecs returns nothing
  1911. native EndThematicMusic takes nothing returns nothing
  1912. native SetMusicVolume takes integer volume returns nothing
  1913. native SetMusicPlayPosition takes integer millisecs returns nothing
  1914. native SetThematicMusicPlayPosition takes integer millisecs returns nothing
  1915. // other music and sound calls
  1916. native SetSoundDuration takes sound soundHandle, integer duration returns nothing
  1917. native GetSoundDuration takes sound soundHandle returns integer
  1918. native GetSoundFileDuration takes string musicFileName returns integer
  1919. native VolumeGroupSetVolume takes volumegroup vgroup, real scale returns nothing
  1920. native VolumeGroupReset takes nothing returns nothing
  1921. native GetSoundIsPlaying takes sound soundHandle returns boolean
  1922. native GetSoundIsLoading takes sound soundHandle returns boolean
  1923. native RegisterStackedSound takes sound soundHandle, boolean byPosition, real rectwidth, real rectheight returns nothing
  1924. native UnregisterStackedSound takes sound soundHandle, boolean byPosition, real rectwidth, real rectheight returns nothing
  1925. //============================================================================
  1926. // Effects API
  1927. //
  1928. native AddWeatherEffect takes rect where, integer effectID returns weathereffect
  1929. native RemoveWeatherEffect takes weathereffect whichEffect returns nothing
  1930. native EnableWeatherEffect takes weathereffect whichEffect, boolean enable returns nothing
  1931. native TerrainDeformCrater takes real x, real y, real radius, real depth, integer duration, boolean permanent returns terraindeformation
  1932. 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
  1933. 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
  1934. native TerrainDeformRandom takes real x, real y, real radius, real minDelta, real maxDelta, integer duration, integer updateInterval returns terraindeformation
  1935. native TerrainDeformStop takes terraindeformation deformation, integer duration returns nothing
  1936. native TerrainDeformStopAll takes nothing returns nothing
  1937. native AddSpecialEffect takes string modelName, real x, real y returns effect
  1938. native AddSpecialEffectLoc takes string modelName, location where returns effect
  1939. native AddSpecialEffectTarget takes string modelName, widget targetWidget, string attachPointName returns effect
  1940. native DestroyEffect takes effect whichEffect returns nothing
  1941. native AddSpellEffect takes string abilityString, effecttype t, real x, real y returns effect
  1942. native AddSpellEffectLoc takes string abilityString, effecttype t,location where returns effect
  1943. native AddSpellEffectById takes integer abilityId, effecttype t,real x, real y returns effect
  1944. native AddSpellEffectByIdLoc takes integer abilityId, effecttype t,location where returns effect
  1945. native AddSpellEffectTarget takes string modelName, effecttype t, widget targetWidget, string attachPoint returns effect
  1946. native AddSpellEffectTargetById takes integer abilityId, effecttype t, widget targetWidget, string attachPoint returns effect
  1947. native AddLightning takes string codeName, boolean checkVisibility, real x1, real y1, real x2, real y2 returns lightning
  1948. native AddLightningEx takes string codeName, boolean checkVisibility, real x1, real y1, real z1, real x2, real y2, real z2 returns lightning
  1949. native DestroyLightning takes lightning whichBolt returns boolean
  1950. native MoveLightning takes lightning whichBolt, boolean checkVisibility, real x1, real y1, real x2, real y2 returns boolean
  1951. native MoveLightningEx takes lightning whichBolt, boolean checkVisibility, real x1, real y1, real z1, real x2, real y2, real z2 returns boolean
  1952. native GetLightningColorA takes lightning whichBolt returns real
  1953. native GetLightningColorR takes lightning whichBolt returns real
  1954. native GetLightningColorG takes lightning whichBolt returns real
  1955. native GetLightningColorB takes lightning whichBolt returns real
  1956. native SetLightningColor takes lightning whichBolt, real r, real g, real b, real a returns boolean
  1957. native GetAbilityEffect takes string abilityString, effecttype t, integer index returns string
  1958. native GetAbilityEffectById takes integer abilityId, effecttype t, integer index returns string
  1959. native GetAbilitySound takes string abilityString, soundtype t returns string
  1960. native GetAbilitySoundById takes integer abilityId, soundtype t returns string
  1961. //============================================================================
  1962. // Terrain API
  1963. //
  1964. native GetTerrainCliffLevel takes real x, real y returns integer
  1965. native SetWaterBaseColor takes integer red, integer green, integer blue, integer alpha returns nothing
  1966. native SetWaterDeforms takes boolean val returns nothing
  1967. native GetTerrainType takes real x, real y returns integer
  1968. native GetTerrainVariance takes real x, real y returns integer
  1969. native SetTerrainType takes real x, real y, integer terrainType, integer variation, integer area, integer shape returns nothing
  1970. native IsTerrainPathable takes real x, real y, pathingtype t returns boolean
  1971. native SetTerrainPathable takes real x, real y, pathingtype t, boolean flag returns nothing
  1972. //============================================================================
  1973. // Image API
  1974. //
  1975. 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
  1976. native DestroyImage takes image whichImage returns nothing
  1977. native ShowImage takes image whichImage, boolean flag returns nothing
  1978. native SetImageConstantHeight takes image whichImage, boolean flag, real height returns nothing
  1979. native SetImagePosition takes image whichImage, real x, real y, real z returns nothing
  1980. native SetImageColor takes image whichImage, integer red, integer green, integer blue, integer alpha returns nothing
  1981. native SetImageRender takes image whichImage, boolean flag returns nothing
  1982. native SetImageRenderAlways takes image whichImage, boolean flag returns nothing
  1983. native SetImageAboveWater takes image whichImage, boolean flag, boolean useWaterAlpha returns nothing
  1984. native SetImageType takes image whichImage, integer imageType returns nothing
  1985. //============================================================================
  1986. // Ubersplat API
  1987. //
  1988. native CreateUbersplat takes real x, real y, string name, integer red, integer green, integer blue, integer alpha, boolean forcePaused, boolean noBirthTime returns ubersplat
  1989. native DestroyUbersplat takes ubersplat whichSplat returns nothing
  1990. native ResetUbersplat takes ubersplat whichSplat returns nothing
  1991. native FinishUbersplat takes ubersplat whichSplat returns nothing
  1992. native ShowUbersplat takes ubersplat whichSplat, boolean flag returns nothing
  1993. native SetUbersplatRender takes ubersplat whichSplat, boolean flag returns nothing
  1994. native SetUbersplatRenderAlways takes ubersplat whichSplat, boolean flag returns nothing
  1995. //============================================================================
  1996. // Blight API
  1997. //
  1998. native SetBlight takes player whichPlayer, real x, real y, real radius, boolean addBlight returns nothing
  1999. native SetBlightRect takes player whichPlayer, rect r, boolean addBlight returns nothing
  2000. native SetBlightPoint takes player whichPlayer, real x, real y, boolean addBlight returns nothing
  2001. native SetBlightLoc takes player whichPlayer, location whichLocation, real radius, boolean addBlight returns nothing
  2002. native CreateBlightedGoldmine takes player id, real x, real y, real face returns unit
  2003. native IsPointBlighted takes real x, real y returns boolean
  2004. //============================================================================
  2005. // Doodad API
  2006. //
  2007. native SetDoodadAnimation takes real x, real y, real radius, integer doodadID, boolean nearestOnly, string animName, boolean animRandom returns nothing
  2008. native SetDoodadAnimationRect takes rect r, integer doodadID, string animName, boolean animRandom returns nothing
  2009. //============================================================================
  2010. // Computer AI interface
  2011. //
  2012. native StartMeleeAI takes player num, string script returns nothing
  2013. native StartCampaignAI takes player num, string script returns nothing
  2014. native CommandAI takes player num, integer command, integer data returns nothing
  2015. native PauseCompAI takes player p, boolean pause returns nothing
  2016. native GetAIDifficulty takes player num returns aidifficulty
  2017. native RemoveGuardPosition takes unit hUnit returns nothing
  2018. native RecycleGuardPosition takes unit hUnit returns nothing
  2019. native RemoveAllGuardPositions takes player num returns nothing
  2020. //============================================================================
  2021. native Cheat takes string cheatStr returns nothing
  2022. native IsNoVictoryCheat takes nothing returns boolean
  2023. native IsNoDefeatCheat takes nothing returns boolean
  2024. native Preload takes string filename returns nothing
  2025. native PreloadEnd takes real timeout returns nothing
  2026. native PreloadStart takes nothing returns nothing
  2027. native PreloadRefresh takes nothing returns nothing
  2028. native PreloadEndEx takes nothing returns nothing
  2029. native PreloadGenClear takes nothing returns nothing
  2030. native PreloadGenStart takes nothing returns nothing
  2031. native PreloadGenEnd takes string filename returns nothing
  2032. native Preloader takes string filename returns nothing
  2033. // JAPI Test Functions
  2034. native GetTriggerPlayerMouseX takes nothing returns real
  2035. native GetTriggerPlayerMouseY takes nothing returns real
  2036. native GetTriggerPlayerMousePosition takes nothing returns location
  2037. native GetTriggerPlayerMouseButton takes nothing returns mousebuttontype
  2038. native SetAbilityTooltip takes integer abilCode, string tooltip, integer level returns nothing
  2039. native SetAbilityOnTooltip takes integer abilCode, string tooltip, integer level returns nothing
  2040. native SetAbilityExtendedTooltip takes integer abilCode, string ExtendedTooltip, integer level returns nothing
  2041. native SetAbilityOnExtendedTooltip takes integer abilCode, string ExtendedTooltip, integer level returns nothing
  2042. native SetAbilityResearchTooltip takes integer abilCode, string researchTooltip, integer level returns nothing
  2043. native SetAbilityResearchExtendedTooltip takes integer abilCode, string researchExtendedTooltip, integer level returns nothing
  2044. native GetAbilityTooltip takes integer abilCode, integer level returns string
  2045. native GetAbilityOnTooltip takes integer abilCode, integer level returns string
  2046. native GetAbilityExtendedTooltip takes integer abilCode, integer level returns string
  2047. native GetAbilityOnExtendedTooltip takes integer abilCode, integer level returns string
  2048. native GetAbilityResearchTooltip takes integer abilCode, integer level returns string
  2049. native GetAbilityResearchExtendedTooltip takes integer abilCode, integer level returns string
  2050. native SetAbilityIcon takes integer abilCode, string iconPath, integer level returns nothing
  2051. native GetAbilityIcon takes integer abilCode, integer level returns string
  2052. native SetAbilityOnIcon takes integer abilCode, string iconPath returns nothing
  2053. native GetAbilityOnIcon takes integer abilCode returns string
  2054. native GetAbilityPosX takes integer abilCode returns integer
  2055. native GetAbilityPosY takes integer abilCode returns integer
  2056. native SetAbilityPosX takes integer abilCode, integer x returns nothing
  2057. native SetAbilityPosY takes integer abilCode, integer y returns nothing
  2058. native GetAbilityOnPosX takes integer abilCode returns integer
  2059. native GetAbilityOnPosY takes integer abilCode returns integer
  2060. native SetAbilityOnPosX takes integer abilCode, integer x returns nothing
  2061. native SetAbilityOnPosY takes integer abilCode, integer y returns nothing
  2062. native GetUnitMaxHP takes unit whichUnit returns integer
  2063. native SetUnitMaxHP takes unit whichUnit, integer hp returns nothing
  2064. native GetUnitMaxMana takes unit whichUnit returns integer
  2065. native SetUnitMaxMana takes unit whichUnit, integer mana returns nothing
  2066. native DeleteHeroAbility takes unit whichUnit, integer abilCode returns nothing
  2067. native SetItemName takes item whichItem, string name returns nothing
  2068. native SetItemDescription takes item whichItem, string name returns nothing
  2069. native GetItemDescription takes item whichItem returns string
  2070. native SetItemTooltip takes item whichItem, string name returns nothing
  2071. native GetItemTooltip takes item whichItem returns string
  2072. native SetItemExtendedTooltip takes item whichItem, string name returns nothing
  2073. native GetItemExtendedTooltip takes item whichItem returns string
  2074. native SetItemIconPath takes item whichItem, string name returns nothing
  2075. native GetItemIconPath takes item whichItem returns string
  2076. native SetUnitName takes unit whichUnit, string name returns nothing
  2077. native SetUnitNameAll takes unit whichUnit, string name returns nothing
  2078. native SetHeroProperName takes unit whichUnit, string name returns nothing
  2079. native GetUnitBaseDamage takes unit whichUnit, integer weaponIndex returns integer
  2080. native SetUnitBaseDamage takes unit whichUnit, integer baseDamage, integer weaponIndex returns nothing
  2081. native GetUnitDiceNumber takes unit whichUnit, integer weaponIndex returns integer
  2082. native SetUnitDiceNumber takes unit whichUnit, integer diceNumber, integer weaponIndex returns nothing
  2083. native GetUnitDiceSides takes unit whichUnit, integer weaponIndex returns integer
  2084. native SetUnitDiceSides takes unit whichUnit, integer diceSides, integer weaponIndex returns nothing
  2085. native GetUnitAttackCooldown takes unit whichUnit, integer weaponIndex returns real
  2086. native SetUnitAttackCooldown takes unit whichUnit, real cooldown, integer weaponIndex returns nothing
  2087. native SetSpecialEffectColorByPlayer takes effect whichEffect, player whichPlayer returns nothing
  2088. native SetSpecialEffectColor takes effect whichEffect, integer r, integer g, integer b returns nothing
  2089. native SetSpecialEffectAlpha takes effect whichEffect, integer alpha returns nothing
  2090. native SetSpecialEffectScale takes effect whichEffect, real scale returns nothing
  2091. native SetSpecialEffectPosition takes effect whichEffect, real x, real y, real z returns nothing
  2092. native SetSpecialEffectHeight takes effect whichEffect, real height returns nothing
  2093. native SetSpecialEffectTimeScale takes effect whichEffect, real timeScale returns nothing
  2094. native SetSpecialEffectTime takes effect whichEffect, real time returns nothing
  2095. native SetSpecialEffectOrientation takes effect whichEffect, real yaw, real pitch, real roll returns nothing
  2096. native SetSpecialEffectYaw takes effect whichEffect, real yaw returns nothing
  2097. native SetSpecialEffectPitch takes effect whichEffect, real pitch returns nothing
  2098. native SetSpecialEffectRoll takes effect whichEffect, real roll returns nothing
  2099. native PlaySpecialEffect takes effect whichEffect, integer anim returns nothing
  2100. native PlaySpecialEffectWithTimeScale takes effect whichEffect, integer anim, real timeScale returns nothing
  2101. constant native DecPlayerTechResearched takes player whichPlayer, integer techid, integer levels returns nothing
  2102. native SetEventDamage takes real damage returns nothing
  2103. native AutomationTestStart takes string testName returns nothing
  2104. native AutomationTestEnd takes string testName returns nothing
  2105. native SetSpecialEffectX takes effect whichEffect, real x returns nothing
  2106. native SetSpecialEffectY takes effect whichEffect, real y returns nothing
  2107. native SetSpecialEffectZ takes effect whichEffect, real z returns nothing
  2108. native SetSpecialEffectPositionLoc takes effect whichEffect, location loc returns nothing
  2109. native GetLocalSpecialEffectX takes effect whichEffect returns real
  2110. native GetLocalSpecialEffectY takes effect whichEffect returns real
  2111. native GetLocalSpecialEffectZ takes effect whichEffect returns real
  2112. native GetUnitArmor takes unit whichUnit returns real
  2113. native SetUnitArmor takes unit whichUnit, real armorAmount returns nothing
  2114. native UnitHideAbility takes unit whichUnit, integer abilId, boolean flag returns nothing
  2115. native UnitDisableAbility takes unit whichUnit, integer abilId, boolean flag, boolean hideUI returns nothing
  2116. native UnitCancelTimedLife takes unit whichUnit returns nothing
  2117. native IsUnitSelectable takes unit whichUnit returns boolean
  2118. native IsUnitInvulnerable takes unit whichUnit returns boolean
  2119. native UnitInterruptAttack takes unit whichUnit returns nothing
  2120. native GetUnitCollisionSize takes unit whichUnit returns real
  2121. native GetAbilityManaCost takes integer abilId, integer level returns integer
  2122. native GetAbilityCooldown takes integer abilId, integer level returns real
  2123. native SetUnitAbilityCooldown takes unit whichUnit, integer abilId, integer level, real cooldown returns nothing
  2124. native GetUnitAbilityCooldown takes unit whichUnit, integer abilId, integer level returns real
  2125. native GetUnitAbilityCooldownRemaining takes unit whichUnit, integer abilId returns real
  2126. native EndUnitAbilityCooldown takes unit whichUnit, integer abilCode returns nothing
  2127. native GetUnitAbilityManaCost takes unit whichUnit, integer abilId, integer level returns integer
  2128. native GetLocalUnitZ takes unit whichUnit returns real
  2129. // native GetUnitMovementType takes unit whichUnit returns integer
  2130. // native SetUnitMovementType takes unit whichUnit, integer movementType returns nothing
  2131. // native GetUnitArmorType takes unit whichUnit returns integer
  2132. // native SetHeroStatEx takes unit whichHero, integer whichStat, integer statValue, boolean permanent returns nothing
  2133. // native GetHeroPrimaryStat takes unit whichHero returns integer
  2134. // native GetHeroPrimaryStatById takes unit whichHero returns integer
  2135. // native GetHeroStat takes unit whichHero, integer whichStat, boolean includeBonuses returns integer

Diesen Code in Standard-Formatierung anzeigen
goto line:
Compare with:
text copy window edit this code post new code