Warcraft 3 documentation
vJASS & Zinc Documentation
For the latest documentation about how it works vJASS and Zinc language layers for Warcraft III, please follow these links:
Jasshelper documentation - Zinc documentation - WC3 Optimizer documentation

[reference] common.j No New Posts Jass Theory & Questions

Started by
moyack

0 Members and 1 Guest are viewing this topic.

[reference] common.j
on: December 15, 2012, 01:43:03 PM

Index
Natives - Constants 1 - Constants 2

Code: jass
  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.  
  41. type eventid            extends     handle
  42. type gameevent          extends     eventid
  43. type playerevent        extends     eventid
  44. type playerunitevent    extends     eventid
  45. type unitevent          extends     eventid
  46. type limitop            extends     eventid
  47. type widgetevent        extends     eventid
  48. type dialogevent        extends     eventid
  49. type unittype           extends     handle
  50.  
  51. type gamespeed          extends     handle
  52. type gamedifficulty     extends     handle
  53. type gametype           extends     handle
  54. type mapflag            extends     handle
  55. type mapvisibility      extends     handle
  56. type mapsetting         extends     handle
  57. type mapdensity         extends     handle
  58. type mapcontrol         extends     handle
  59. type playerslotstate    extends     handle
  60. type volumegroup        extends     handle
  61. type camerafield        extends     handle
  62. type camerasetup        extends     handle
  63. type playercolor        extends     handle
  64. type placement          extends     handle
  65. type startlocprio       extends     handle
  66. type raritycontrol      extends     handle
  67. type blendmode          extends     handle
  68. type texmapflags        extends     handle
  69. type effect             extends     agent
  70. type effecttype         extends     handle
  71. type weathereffect      extends     handle
  72. type terraindeformation extends     handle
  73. type fogstate           extends     handle
  74. type fogmodifier        extends     agent
  75. type dialog             extends     agent
  76. type button             extends     agent
  77. type quest              extends     agent
  78. type questitem          extends     agent
  79. type defeatcondition    extends     agent
  80. type timerdialog        extends     agent
  81. type leaderboard        extends     agent
  82. type multiboard         extends     agent
  83. type multiboarditem     extends     agent
  84. type trackable          extends     agent
  85. type gamecache          extends     agent
  86. type version            extends     handle
  87. type itemtype           extends     handle
  88. type texttag            extends     handle
  89. type attacktype         extends     handle
  90. type damagetype         extends     handle
  91. type weapontype         extends     handle
  92. type soundtype          extends     handle
  93. type lightning          extends     handle
  94. type pathingtype        extends     handle
  95. type image              extends     handle
  96. type ubersplat          extends     handle
  97. type hashtable          extends     agent
  98.  
  99. constant native ConvertRace                 takes integer i returns race
  100. constant native ConvertAllianceType         takes integer i returns alliancetype
  101. constant native ConvertRacePref             takes integer i returns racepreference
  102. constant native ConvertIGameState           takes integer i returns igamestate
  103. constant native ConvertFGameState           takes integer i returns fgamestate
  104. constant native ConvertPlayerState          takes integer i returns playerstate
  105. constant native ConvertPlayerScore          takes integer i returns playerscore
  106. constant native ConvertPlayerGameResult     takes integer i returns playergameresult
  107. constant native ConvertUnitState            takes integer i returns unitstate
  108. constant native ConvertAIDifficulty         takes integer i returns aidifficulty
  109. constant native ConvertGameEvent            takes integer i returns gameevent
  110. constant native ConvertPlayerEvent          takes integer i returns playerevent
  111. constant native ConvertPlayerUnitEvent      takes integer i returns playerunitevent
  112. constant native ConvertWidgetEvent          takes integer i returns widgetevent
  113. constant native ConvertDialogEvent          takes integer i returns dialogevent
  114. constant native ConvertUnitEvent            takes integer i returns unitevent
  115. constant native ConvertLimitOp              takes integer i returns limitop
  116. constant native ConvertUnitType             takes integer i returns unittype
  117. constant native ConvertGameSpeed            takes integer i returns gamespeed
  118. constant native ConvertPlacement            takes integer i returns placement
  119. constant native ConvertStartLocPrio         takes integer i returns startlocprio
  120. constant native ConvertGameDifficulty       takes integer i returns gamedifficulty
  121. constant native ConvertGameType             takes integer i returns gametype
  122. constant native ConvertMapFlag              takes integer i returns mapflag
  123. constant native ConvertMapVisibility        takes integer i returns mapvisibility
  124. constant native ConvertMapSetting           takes integer i returns mapsetting
  125. constant native ConvertMapDensity           takes integer i returns mapdensity
  126. constant native ConvertMapControl           takes integer i returns mapcontrol
  127. constant native ConvertPlayerColor          takes integer i returns playercolor
  128. constant native ConvertPlayerSlotState      takes integer i returns playerslotstate
  129. constant native ConvertVolumeGroup          takes integer i returns volumegroup
  130. constant native ConvertCameraField          takes integer i returns camerafield
  131. constant native ConvertBlendMode            takes integer i returns blendmode
  132. constant native ConvertRarityControl        takes integer i returns raritycontrol
  133. constant native ConvertTexMapFlags          takes integer i returns texmapflags
  134. constant native ConvertFogState             takes integer i returns fogstate
  135. constant native ConvertEffectType           takes integer i returns effecttype
  136. constant native ConvertVersion              takes integer i returns version
  137. constant native ConvertItemType             takes integer i returns itemtype
  138. constant native ConvertAttackType           takes integer i returns attacktype
  139. constant native ConvertDamageType           takes integer i returns damagetype
  140. constant native ConvertWeaponType           takes integer i returns weapontype
  141. constant native ConvertSoundType            takes integer i returns soundtype
  142. constant native ConvertPathingType          takes integer i returns pathingtype
  143.  
  144. constant native OrderId                     takes string  orderIdString     returns integer
  145. constant native OrderId2String              takes integer orderId           returns string
  146. constant native UnitId                      takes string  unitIdString      returns integer
  147. constant native UnitId2String               takes integer unitId            returns string
  148.  
  149. // Not currently working correctly...
  150. constant native AbilityId                   takes string  abilityIdString   returns integer
  151. constant native AbilityId2String            takes integer abilityId         returns string
  152.  
  153. // Looks up the "name" field for any object (unit, item, ability)
  154. constant native GetObjectName               takes integer objectId          returns string
« Last Edit: December 16, 2012, 09:06:11 AM by moyack »



Game constants 1
Reply #1 on: December 15, 2012, 03:22:15 PM

Code: jass
  1. globals
  2.  
  3. //===================================================
  4. // Game Constants   
  5. //===================================================
  6.  
  7.     // pfff
  8.     constant boolean            FALSE                           = false
  9.     constant boolean            TRUE                            = true
  10.     constant integer            JASS_MAX_ARRAY_SIZE             = 8192
  11.  
  12.     constant integer            PLAYER_NEUTRAL_PASSIVE          = 15
  13.     constant integer            PLAYER_NEUTRAL_AGGRESSIVE       = 12
  14.  
  15.     constant playercolor        PLAYER_COLOR_RED                = ConvertPlayerColor(0)
  16.     constant playercolor        PLAYER_COLOR_BLUE               = ConvertPlayerColor(1)
  17.     constant playercolor        PLAYER_COLOR_CYAN               = ConvertPlayerColor(2)
  18.     constant playercolor        PLAYER_COLOR_PURPLE             = ConvertPlayerColor(3)
  19.     constant playercolor        PLAYER_COLOR_YELLOW             = ConvertPlayerColor(4)
  20.     constant playercolor        PLAYER_COLOR_ORANGE             = ConvertPlayerColor(5)
  21.     constant playercolor        PLAYER_COLOR_GREEN              = ConvertPlayerColor(6)
  22.     constant playercolor        PLAYER_COLOR_PINK               = ConvertPlayerColor(7)
  23.     constant playercolor        PLAYER_COLOR_LIGHT_GRAY         = ConvertPlayerColor(8)
  24.     constant playercolor        PLAYER_COLOR_LIGHT_BLUE         = ConvertPlayerColor(9)
  25.     constant playercolor        PLAYER_COLOR_AQUA               = ConvertPlayerColor(10)
  26.     constant playercolor        PLAYER_COLOR_BROWN              = ConvertPlayerColor(11)
  27.  
  28.     constant race               RACE_HUMAN                      = ConvertRace(1)
  29.     constant race               RACE_ORC                        = ConvertRace(2)
  30.     constant race               RACE_UNDEAD                     = ConvertRace(3)
  31.     constant race               RACE_NIGHTELF                   = ConvertRace(4)
  32.     constant race               RACE_DEMON                      = ConvertRace(5)
  33.     constant race               RACE_OTHER                      = ConvertRace(7)
  34.  
  35.  
  36.     constant alliancetype       ALLIANCE_PASSIVE                = ConvertAllianceType(0)
  37.     constant alliancetype       ALLIANCE_HELP_REQUEST           = ConvertAllianceType(1)
  38.     constant alliancetype       ALLIANCE_HELP_RESPONSE          = ConvertAllianceType(2)
  39.     constant alliancetype       ALLIANCE_SHARED_XP              = ConvertAllianceType(3)
  40.     constant alliancetype       ALLIANCE_SHARED_SPELLS          = ConvertAllianceType(4)
  41.     constant alliancetype       ALLIANCE_SHARED_VISION          = ConvertAllianceType(5)
  42.     constant alliancetype       ALLIANCE_SHARED_CONTROL         = ConvertAllianceType(6)
  43.     constant alliancetype       ALLIANCE_RESCUABLE              = ConvertAllianceType(8)
  44.  
  45.     constant version            VERSION_REIGN_OF_CHAOS          = ConvertVersion(0)
  46.     constant version            VERSION_FROZEN_THRONE           = ConvertVersion(1)
  47.  
  48.     constant attacktype         ATTACK_TYPE_NORMAL              = ConvertAttackType(0)
  49.     constant attacktype         ATTACK_TYPE_MELEE               = ConvertAttackType(1)
  50.     constant attacktype         ATTACK_TYPE_PIERCE              = ConvertAttackType(2)
  51.     constant attacktype         ATTACK_TYPE_SIEGE               = ConvertAttackType(3)
  52.     constant attacktype         ATTACK_TYPE_MAGIC               = ConvertAttackType(4)
  53.     constant attacktype         ATTACK_TYPE_CHAOS               = ConvertAttackType(5)
  54.     constant attacktype         ATTACK_TYPE_HERO                = ConvertAttackType(6)
  55.  
  56.     constant damagetype         DAMAGE_TYPE_UNKNOWN             = ConvertDamageType(0)
  57.     constant damagetype         DAMAGE_TYPE_NORMAL              = ConvertDamageType(4)
  58.     constant damagetype         DAMAGE_TYPE_ENHANCED            = ConvertDamageType(5)
  59.     constant damagetype         DAMAGE_TYPE_FIRE                = ConvertDamageType(8)
  60.     constant damagetype         DAMAGE_TYPE_COLD                = ConvertDamageType(9)
  61.     constant damagetype         DAMAGE_TYPE_LIGHTNING           = ConvertDamageType(10)
  62.     constant damagetype         DAMAGE_TYPE_POISON              = ConvertDamageType(11)
  63.     constant damagetype         DAMAGE_TYPE_DISEASE             = ConvertDamageType(12)
  64.     constant damagetype         DAMAGE_TYPE_DIVINE              = ConvertDamageType(13)
  65.     constant damagetype         DAMAGE_TYPE_MAGIC               = ConvertDamageType(14)
  66.     constant damagetype         DAMAGE_TYPE_SONIC               = ConvertDamageType(15)
  67.     constant damagetype         DAMAGE_TYPE_ACID                = ConvertDamageType(16)
  68.     constant damagetype         DAMAGE_TYPE_FORCE               = ConvertDamageType(17)
  69.     constant damagetype         DAMAGE_TYPE_DEATH               = ConvertDamageType(18)
  70.     constant damagetype         DAMAGE_TYPE_MIND                = ConvertDamageType(19)
  71.     constant damagetype         DAMAGE_TYPE_PLANT               = ConvertDamageType(20)
  72.     constant damagetype         DAMAGE_TYPE_DEFENSIVE           = ConvertDamageType(21)
  73.     constant damagetype         DAMAGE_TYPE_DEMOLITION          = ConvertDamageType(22)
  74.     constant damagetype         DAMAGE_TYPE_SLOW_POISON         = ConvertDamageType(23)
  75.     constant damagetype         DAMAGE_TYPE_SPIRIT_LINK         = ConvertDamageType(24)
  76.     constant damagetype         DAMAGE_TYPE_SHADOW_STRIKE       = ConvertDamageType(25)
  77.     constant damagetype         DAMAGE_TYPE_UNIVERSAL           = ConvertDamageType(26)
  78.  
  79.     constant weapontype         WEAPON_TYPE_WHOKNOWS            = ConvertWeaponType(0)
  80.     constant weapontype         WEAPON_TYPE_METAL_LIGHT_CHOP    = ConvertWeaponType(1)
  81.     constant weapontype         WEAPON_TYPE_METAL_MEDIUM_CHOP   = ConvertWeaponType(2)
  82.     constant weapontype         WEAPON_TYPE_METAL_HEAVY_CHOP    = ConvertWeaponType(3)
  83.     constant weapontype         WEAPON_TYPE_METAL_LIGHT_SLICE   = ConvertWeaponType(4)
  84.     constant weapontype         WEAPON_TYPE_METAL_HEAVY_SLICE   = ConvertWeaponType(6)
  85.     constant weapontype         WEAPON_TYPE_METAL_MEDIUM_BASH   = ConvertWeaponType(7)
  86.     constant weapontype         WEAPON_TYPE_METAL_HEAVY_BASH    = ConvertWeaponType(8)
  87.     constant weapontype         WEAPON_TYPE_METAL_MEDIUM_STAB   = ConvertWeaponType(9)
  88.     constant weapontype         WEAPON_TYPE_METAL_HEAVY_STAB    = ConvertWeaponType(10)
  89.     constant weapontype         WEAPON_TYPE_WOOD_LIGHT_SLICE    = ConvertWeaponType(11)
  90.     constant weapontype         WEAPON_TYPE_WOOD_MEDIUM_SLICE   = ConvertWeaponType(12)
  91.     constant weapontype         WEAPON_TYPE_WOOD_HEAVY_SLICE    = ConvertWeaponType(13)
  92.     constant weapontype         WEAPON_TYPE_WOOD_LIGHT_BASH     = ConvertWeaponType(14)
  93.     constant weapontype         WEAPON_TYPE_WOOD_MEDIUM_BASH    = ConvertWeaponType(15)
  94.     constant weapontype         WEAPON_TYPE_WOOD_HEAVY_BASH     = ConvertWeaponType(16)
  95.     constant weapontype         WEAPON_TYPE_WOOD_LIGHT_STAB     = ConvertWeaponType(17)
  96.     constant weapontype         WEAPON_TYPE_WOOD_MEDIUM_STAB    = ConvertWeaponType(18)
  97.     constant weapontype         WEAPON_TYPE_CLAW_LIGHT_SLICE    = ConvertWeaponType(19)
  98.     constant weapontype         WEAPON_TYPE_CLAW_MEDIUM_SLICE   = ConvertWeaponType(20)
  99.     constant weapontype         WEAPON_TYPE_CLAW_HEAVY_SLICE    = ConvertWeaponType(21)
  100.     constant weapontype         WEAPON_TYPE_AXE_MEDIUM_CHOP     = ConvertWeaponType(22)
  101.     constant weapontype         WEAPON_TYPE_ROCK_HEAVY_BASH     = ConvertWeaponType(23)
  102.  
  103.     constant pathingtype        PATHING_TYPE_ANY                = ConvertPathingType(0)
  104.     constant pathingtype        PATHING_TYPE_WALKABILITY        = ConvertPathingType(1)
  105.     constant pathingtype        PATHING_TYPE_FLYABILITY         = ConvertPathingType(2)
  106.     constant pathingtype        PATHING_TYPE_BUILDABILITY       = ConvertPathingType(3)
  107.     constant pathingtype        PATHING_TYPE_BLIGHTPATHING      = ConvertPathingType(5)
  108.     constant pathingtype        PATHING_TYPE_FLOATABILITY       = ConvertPathingType(6)
  109.  
  110. //===================================================
  111. // Map Setup Constants   
  112. //===================================================
  113.  
  114.     constant racepreference     RACE_PREF_HUMAN                     = ConvertRacePref(1)
  115.     constant racepreference     RACE_PREF_ORC                       = ConvertRacePref(2)
  116.     constant racepreference     RACE_PREF_NIGHTELF                  = ConvertRacePref(4)
  117.     constant racepreference     RACE_PREF_UNDEAD                    = ConvertRacePref(8)
  118.     constant racepreference     RACE_PREF_DEMON                     = ConvertRacePref(16)
  119.     constant racepreference     RACE_PREF_RANDOM                    = ConvertRacePref(32)
  120.     constant racepreference     RACE_PREF_USER_SELECTABLE           = ConvertRacePref(64)
  121.  
  122.     constant mapcontrol         MAP_CONTROL_USER                    = ConvertMapControl(0)
  123.     constant mapcontrol         MAP_CONTROL_COMPUTER                = ConvertMapControl(1)
  124.     constant mapcontrol         MAP_CONTROL_RESCUABLE               = ConvertMapControl(2)
  125.     constant mapcontrol         MAP_CONTROL_NEUTRAL                 = ConvertMapControl(3)
  126.     constant mapcontrol         MAP_CONTROL_CREEP                   = ConvertMapControl(4)
  127.     constant mapcontrol         MAP_CONTROL_NONE                    = ConvertMapControl(5)
  128.  
  129.     constant gametype           GAME_TYPE_MELEE                     = ConvertGameType(1)
  130.     constant gametype           GAME_TYPE_FFA                       = ConvertGameType(2)
  131.     constant gametype           GAME_TYPE_USE_MAP_SETTINGS          = ConvertGameType(4)
  132.     constant gametype           GAME_TYPE_BLIZ                      = ConvertGameType(8)
  133.     constant gametype           GAME_TYPE_ONE_ON_ONE                = ConvertGameType(16)
  134.     constant gametype           GAME_TYPE_TWO_TEAM_PLAY             = ConvertGameType(32)
  135.     constant gametype           GAME_TYPE_THREE_TEAM_PLAY           = ConvertGameType(64)
  136.     constant gametype           GAME_TYPE_FOUR_TEAM_PLAY            = ConvertGameType(128)
  137.  
  138.     constant mapflag            MAP_FOG_HIDE_TERRAIN                = ConvertMapFlag(1)
  139.     constant mapflag            MAP_FOG_MAP_EXPLORED                = ConvertMapFlag(2)
  140.     constant mapflag            MAP_FOG_ALWAYS_VISIBLE              = ConvertMapFlag(4)
  141.  
  142.     constant mapflag            MAP_USE_HANDICAPS                   = ConvertMapFlag(8)
  143.     constant mapflag            MAP_OBSERVERS                       = ConvertMapFlag(16)
  144.     constant mapflag            MAP_OBSERVERS_ON_DEATH              = ConvertMapFlag(32)
  145.  
  146.     constant mapflag            MAP_FIXED_COLORS                    = ConvertMapFlag(128)
  147.    
  148.     constant mapflag            MAP_LOCK_RESOURCE_TRADING           = ConvertMapFlag(256)
  149.     constant mapflag            MAP_RESOURCE_TRADING_ALLIES_ONLY    = ConvertMapFlag(512)
  150.  
  151.     constant mapflag            MAP_LOCK_ALLIANCE_CHANGES           = ConvertMapFlag(1024)
  152.     constant mapflag            MAP_ALLIANCE_CHANGES_HIDDEN         = ConvertMapFlag(2048)
  153.  
  154.     constant mapflag            MAP_CHEATS                          = ConvertMapFlag(4096)
  155.     constant mapflag            MAP_CHEATS_HIDDEN                   = ConvertMapFlag(8192)
  156.  
  157.     constant mapflag            MAP_LOCK_SPEED                      = ConvertMapFlag(8192*2)
  158.     constant mapflag            MAP_LOCK_RANDOM_SEED                = ConvertMapFlag(8192*4)
  159.     constant mapflag            MAP_SHARED_ADVANCED_CONTROL         = ConvertMapFlag(8192*8)
  160.     constant mapflag            MAP_RANDOM_HERO                     = ConvertMapFlag(8192*16)
  161.     constant mapflag            MAP_RANDOM_RACES                    = ConvertMapFlag(8192*32)
  162.     constant mapflag            MAP_RELOADED                        = ConvertMapFlag(8192*64)
  163.  
  164.     constant placement          MAP_PLACEMENT_RANDOM                = ConvertPlacement(0)   // random among all slots
  165.     constant placement          MAP_PLACEMENT_FIXED                 = ConvertPlacement(1)   // player 0 in start loc 0...
  166.     constant placement          MAP_PLACEMENT_USE_MAP_SETTINGS      = ConvertPlacement(2)   // whatever was specified by the script
  167.     constant placement          MAP_PLACEMENT_TEAMS_TOGETHER        = ConvertPlacement(3)   // random with allies next to each other   
  168.  
  169.     constant startlocprio       MAP_LOC_PRIO_LOW                    = ConvertStartLocPrio(0)
  170.     constant startlocprio       MAP_LOC_PRIO_HIGH                   = ConvertStartLocPrio(1)
  171.     constant startlocprio       MAP_LOC_PRIO_NOT                    = ConvertStartLocPrio(2)
  172.  
  173.     constant mapdensity         MAP_DENSITY_NONE                    = ConvertMapDensity(0)
  174.     constant mapdensity         MAP_DENSITY_LIGHT                   = ConvertMapDensity(1)
  175.     constant mapdensity         MAP_DENSITY_MEDIUM                  = ConvertMapDensity(2)
  176.     constant mapdensity         MAP_DENSITY_HEAVY                   = ConvertMapDensity(3)
  177.  
  178.     constant gamedifficulty     MAP_DIFFICULTY_EASY                 = ConvertGameDifficulty(0)
  179.     constant gamedifficulty     MAP_DIFFICULTY_NORMAL               = ConvertGameDifficulty(1)
  180.     constant gamedifficulty     MAP_DIFFICULTY_HARD                 = ConvertGameDifficulty(2)
  181.     constant gamedifficulty     MAP_DIFFICULTY_INSANE               = ConvertGameDifficulty(3)
  182.  
  183.     constant gamespeed          MAP_SPEED_SLOWEST                   = ConvertGameSpeed(0)
  184.     constant gamespeed          MAP_SPEED_SLOW                      = ConvertGameSpeed(1)
  185.     constant gamespeed          MAP_SPEED_NORMAL                    = ConvertGameSpeed(2)
  186.     constant gamespeed          MAP_SPEED_FAST                      = ConvertGameSpeed(3)
  187.     constant gamespeed          MAP_SPEED_FASTEST                   = ConvertGameSpeed(4)
  188.  
  189.     constant playerslotstate    PLAYER_SLOT_STATE_EMPTY             = ConvertPlayerSlotState(0)
  190.     constant playerslotstate    PLAYER_SLOT_STATE_PLAYING           = ConvertPlayerSlotState(1)
  191.     constant playerslotstate    PLAYER_SLOT_STATE_LEFT              = ConvertPlayerSlotState(2)
« Last Edit: December 16, 2012, 09:05:18 AM by moyack »



Game constants 2
Reply #2 on: December 15, 2012, 03:25:13 PM

Code: jass
  1. //===================================================
  2. // Sound Constants
  3. //===================================================
  4.     constant volumegroup        SOUND_VOLUMEGROUP_UNITMOVEMENT      = ConvertVolumeGroup(0)
  5.     constant volumegroup        SOUND_VOLUMEGROUP_UNITSOUNDS        = ConvertVolumeGroup(1)
  6.     constant volumegroup        SOUND_VOLUMEGROUP_COMBAT            = ConvertVolumeGroup(2)
  7.     constant volumegroup        SOUND_VOLUMEGROUP_SPELLS            = ConvertVolumeGroup(3)
  8.     constant volumegroup        SOUND_VOLUMEGROUP_UI                = ConvertVolumeGroup(4)
  9.     constant volumegroup        SOUND_VOLUMEGROUP_MUSIC             = ConvertVolumeGroup(5)
  10.     constant volumegroup        SOUND_VOLUMEGROUP_AMBIENTSOUNDS     = ConvertVolumeGroup(6)
  11.     constant volumegroup        SOUND_VOLUMEGROUP_FIRE              = ConvertVolumeGroup(7)
  12.  
  13.  
  14. //===================================================
  15. // Game, Player, and Unit States
  16. //
  17. // For use with TriggerRegister<X>StateEvent
  18. //
  19. //===================================================
  20.  
  21.     constant igamestate GAME_STATE_DISCONNECTED                 = ConvertIGameState(1)
  22.     constant fgamestate GAME_STATE_TIME_OF_DAY                  = ConvertFGameState(2)
  23.  
  24.     constant playerstate PLAYER_STATE_GAME_RESULT               = ConvertPlayerState(0)
  25.  
  26.     // current resource levels
  27.     //
  28.     constant playerstate PLAYER_STATE_RESOURCE_GOLD             = ConvertPlayerState(1)
  29.     constant playerstate PLAYER_STATE_RESOURCE_LUMBER           = ConvertPlayerState(2)
  30.  
  31.     constant playerstate PLAYER_STATE_GIVES_BOUNTY              = ConvertPlayerState(7)
  32.     constant playerstate PLAYER_STATE_ALLIED_VICTORY            = ConvertPlayerState(8)
  33.     constant playerstate PLAYER_STATE_PLACED                    = ConvertPlayerState(9)
  34.     constant playerstate PLAYER_STATE_OBSERVER                  = ConvertPlayerState(11)
  35.     constant playerstate PLAYER_STATE_UNFOLLOWABLE              = ConvertPlayerState(12)
  36.  
  37.     // taxation rate for each resource
  38.     //
  39.  
  40.     // cumulative resources collected by the player during the mission
  41.     //
  42.     constant playerstate PLAYER_STATE_GOLD_GATHERED             = ConvertPlayerState(15)
  43.     constant playerstate PLAYER_STATE_LUMBER_GATHERED           = ConvertPlayerState(16)
  44.  
  45.     constant playerstate PLAYER_STATE_NO_CREEP_SLEEP            = ConvertPlayerState(25)
  46.  
  47.     constant unitstate UNIT_STATE_LIFE                          = ConvertUnitState(0)
  48.     constant unitstate UNIT_STATE_MAX_LIFE                      = ConvertUnitState(1)
  49.     constant unitstate UNIT_STATE_MANA                          = ConvertUnitState(2)
  50.     constant unitstate UNIT_STATE_MAX_MANA                      = ConvertUnitState(3)
  51.  
  52.     constant aidifficulty AI_DIFFICULTY_NEWBIE                  = ConvertAIDifficulty(0)
  53.     constant aidifficulty AI_DIFFICULTY_NORMAL                  = ConvertAIDifficulty(1)
  54.     constant aidifficulty AI_DIFFICULTY_INSANE                  = ConvertAIDifficulty(2)
  55.  
  56.     // player score values
  57.     constant playerscore PLAYER_SCORE_UNITS_TRAINED             = ConvertPlayerScore(0)
  58.     constant playerscore PLAYER_SCORE_UNITS_KILLED              = ConvertPlayerScore(1)
  59.     constant playerscore PLAYER_SCORE_STRUCT_BUILT              = ConvertPlayerScore(2)
  60.     constant playerscore PLAYER_SCORE_STRUCT_RAZED              = ConvertPlayerScore(3)
  61.     constant playerscore PLAYER_SCORE_TECH_PERCENT              = ConvertPlayerScore(4)
  62.     constant playerscore PLAYER_SCORE_FOOD_MAXPROD              = ConvertPlayerScore(5)
  63.     constant playerscore PLAYER_SCORE_FOOD_MAXUSED              = ConvertPlayerScore(6)
  64.     constant playerscore PLAYER_SCORE_HEROES_KILLED             = ConvertPlayerScore(7)
  65.     constant playerscore PLAYER_SCORE_ITEMS_GAINED              = ConvertPlayerScore(8)
  66.     constant playerscore PLAYER_SCORE_MERCS_HIRED               = ConvertPlayerScore(9)
  67.     constant playerscore PLAYER_SCORE_GOLD_LOST_TAX             = ConvertPlayerScore(13)
  68.     constant playerscore PLAYER_SCORE_GOLD_GIVEN                = ConvertPlayerScore(14)
  69.     constant playerscore PLAYER_SCORE_GOLD_RECEIVED             = ConvertPlayerScore(15)
  70.     constant playerscore PLAYER_SCORE_LUMBER_TOTAL              = ConvertPlayerScore(16)
  71.     constant playerscore PLAYER_SCORE_LUMBER_LOST_TAX           = ConvertPlayerScore(18)
  72.     constant playerscore PLAYER_SCORE_LUMBER_GIVEN              = ConvertPlayerScore(19)
  73.     constant playerscore PLAYER_SCORE_LUMBER_RECEIVED           = ConvertPlayerScore(20)
  74.     constant playerscore PLAYER_SCORE_UNIT_TOTAL                = ConvertPlayerScore(21)
  75.     constant playerscore PLAYER_SCORE_HERO_TOTAL                = ConvertPlayerScore(22)
  76.     constant playerscore PLAYER_SCORE_RESOURCE_TOTAL            = ConvertPlayerScore(23)
  77.     constant playerscore PLAYER_SCORE_TOTAL                     = ConvertPlayerScore(24)
  78.        
  79. //===================================================
  80. // Game, Player and Unit Events
  81. //
  82. //  When an event causes a trigger to fire these
  83. //  values allow the action code to determine which
  84. //  event was dispatched and therefore which set of
  85. //  native functions should be used to get information
  86. //  about the event.
  87. //
  88. // Do NOT change the order or value of these constants
  89. // without insuring that the JASS_GAME_EVENTS_WAR3 enum
  90. // is changed to match.
  91. //
  92. //===================================================
  93.  
  94.     //===================================================
  95.     // For use with TriggerRegisterGameEvent   
  96.     //===================================================   
  97.  
  98.     constant gameevent EVENT_GAME_VICTORY                       = ConvertGameEvent(0)
  99.     constant gameevent EVENT_GAME_END_LEVEL                     = ConvertGameEvent(1)
  100.  
  101.     constant gameevent EVENT_GAME_VARIABLE_LIMIT                = ConvertGameEvent(2)
  102.     constant gameevent EVENT_GAME_STATE_LIMIT                   = ConvertGameEvent(3)   
  103.  
  104.     constant gameevent EVENT_GAME_TIMER_EXPIRED                 = ConvertGameEvent(4)
  105.  
  106.     constant gameevent EVENT_GAME_ENTER_REGION                  = ConvertGameEvent(5)
  107.     constant gameevent EVENT_GAME_LEAVE_REGION                  = ConvertGameEvent(6)
  108.  
  109.     constant gameevent EVENT_GAME_TRACKABLE_HIT                 = ConvertGameEvent(7)
  110.     constant gameevent EVENT_GAME_TRACKABLE_TRACK               = ConvertGameEvent(8)
  111.  
  112.     constant gameevent EVENT_GAME_SHOW_SKILL                    = ConvertGameEvent(9)   
  113.     constant gameevent EVENT_GAME_BUILD_SUBMENU                 = ConvertGameEvent(10)
  114.  
  115.     //===================================================
  116.     // For use with TriggerRegisterPlayerEvent
  117.     //===================================================
  118.     constant playerevent EVENT_PLAYER_STATE_LIMIT               = ConvertPlayerEvent(11)
  119.  
  120.     constant playerevent EVENT_PLAYER_DEFEAT                    = ConvertPlayerEvent(13)
  121.     constant playerevent EVENT_PLAYER_VICTORY                   = ConvertPlayerEvent(14)
  122.     constant playerevent EVENT_PLAYER_LEAVE                     = ConvertPlayerEvent(15)
  123.     constant playerevent EVENT_PLAYER_CHAT                      = ConvertPlayerEvent(16)
  124.     constant playerevent EVENT_PLAYER_END_CINEMATIC             = ConvertPlayerEvent(17)
  125.  
  126.     //===================================================
  127.     // For use with TriggerRegisterPlayerUnitEvent
  128.     //===================================================
  129.  
  130.     constant playerunitevent EVENT_PLAYER_UNIT_ATTACKED                 = ConvertPlayerUnitEvent(18)
  131.     constant playerunitevent EVENT_PLAYER_UNIT_RESCUED                  = ConvertPlayerUnitEvent(19)
  132.  
  133.     constant playerunitevent EVENT_PLAYER_UNIT_DEATH                    = ConvertPlayerUnitEvent(20)
  134.     constant playerunitevent EVENT_PLAYER_UNIT_DECAY                    = ConvertPlayerUnitEvent(21)
  135.  
  136.     constant playerunitevent EVENT_PLAYER_UNIT_DETECTED                 = ConvertPlayerUnitEvent(22)
  137.     constant playerunitevent EVENT_PLAYER_UNIT_HIDDEN                   = ConvertPlayerUnitEvent(23)
  138.  
  139.     constant playerunitevent EVENT_PLAYER_UNIT_SELECTED                 = ConvertPlayerUnitEvent(24)
  140.     constant playerunitevent EVENT_PLAYER_UNIT_DESELECTED               = ConvertPlayerUnitEvent(25)
  141.  
  142.  
  143.  
  144.  
  145.     constant playerunitevent EVENT_PLAYER_UNIT_ISSUED_UNIT_ORDER        = ConvertPlayerUnitEvent(40)    // for compat
  146.  
  147.     constant playerunitevent EVENT_PLAYER_HERO_LEVEL                    = ConvertPlayerUnitEvent(41)
  148.     constant playerunitevent EVENT_PLAYER_HERO_SKILL                    = ConvertPlayerUnitEvent(42)
  149.  
  150.     constant playerunitevent EVENT_PLAYER_HERO_REVIVABLE                = ConvertPlayerUnitEvent(43)
  151.  
  152.     constant playerunitevent EVENT_PLAYER_UNIT_SUMMON                   = ConvertPlayerUnitEvent(47)
  153.     constant playerunitevent EVENT_PLAYER_UNIT_DROP_ITEM                = ConvertPlayerUnitEvent(48)
  154.     constant playerunitevent EVENT_PLAYER_UNIT_USE_ITEM                 = ConvertPlayerUnitEvent(50)
  155.  
  156.     constant playerunitevent EVENT_PLAYER_UNIT_LOADED                   = ConvertPlayerUnitEvent(51)
  157.    
  158.     //===================================================
  159.     // For use with TriggerRegisterUnitEvent
  160.     //===================================================
  161.  
  162.     constant unitevent EVENT_UNIT_DAMAGED                               = ConvertUnitEvent(52)
  163.     constant unitevent EVENT_UNIT_DEATH                                 = ConvertUnitEvent(53)
  164.     constant unitevent EVENT_UNIT_DECAY                                 = ConvertUnitEvent(54)
  165.     constant unitevent EVENT_UNIT_DETECTED                              = ConvertUnitEvent(55)
  166.     constant unitevent EVENT_UNIT_HIDDEN                                = ConvertUnitEvent(56)
  167.     constant unitevent EVENT_UNIT_SELECTED                              = ConvertUnitEvent(57)
  168.     constant unitevent EVENT_UNIT_DESELECTED                            = ConvertUnitEvent(58)
  169.                                                                        
  170.     constant unitevent EVENT_UNIT_STATE_LIMIT                           = ConvertUnitEvent(59)                                                                       
  171.  
  172.     // Events which may have a filter for the "other unit"             
  173.     //                                                                 
  174.     constant unitevent EVENT_UNIT_ACQUIRED_TARGET                       = ConvertUnitEvent(60)
  175.     constant unitevent EVENT_UNIT_TARGET_IN_RANGE                       = ConvertUnitEvent(61)
  176.     constant unitevent EVENT_UNIT_ATTACKED                              = ConvertUnitEvent(62)
  177.     constant unitevent EVENT_UNIT_RESCUED                               = ConvertUnitEvent(63)
  178.                                                                        
  179.     constant unitevent EVENT_UNIT_CONSTRUCT_CANCEL                      = ConvertUnitEvent(64)
  180.     constant unitevent EVENT_UNIT_CONSTRUCT_FINISH                      = ConvertUnitEvent(65)
  181.                                                                        
  182.     constant unitevent EVENT_UNIT_UPGRADE_START                         = ConvertUnitEvent(66)
  183.     constant unitevent EVENT_UNIT_UPGRADE_CANCEL                        = ConvertUnitEvent(67)
  184.     constant unitevent EVENT_UNIT_UPGRADE_FINISH                        = ConvertUnitEvent(68)
  185.                                                                        
  186.     // Events which involve the specified unit performing               
  187.     // training of other units                                         
  188.     //                                                                 
  189.     constant unitevent EVENT_UNIT_TRAIN_START                           = ConvertUnitEvent(69)
  190.     constant unitevent EVENT_UNIT_TRAIN_CANCEL                          = ConvertUnitEvent(70)
  191.     constant unitevent EVENT_UNIT_TRAIN_FINISH                          = ConvertUnitEvent(71)
  192.                                                                        
  193.     constant unitevent EVENT_UNIT_RESEARCH_START                        = ConvertUnitEvent(72)
  194.     constant unitevent EVENT_UNIT_RESEARCH_CANCEL                       = ConvertUnitEvent(73)
  195.     constant unitevent EVENT_UNIT_RESEARCH_FINISH                       = ConvertUnitEvent(74)
  196.                                                                        
  197.     constant unitevent EVENT_UNIT_ISSUED_ORDER                          = ConvertUnitEvent(75)
  198.     constant unitevent EVENT_UNIT_ISSUED_POINT_ORDER                    = ConvertUnitEvent(76)
  199.     constant unitevent EVENT_UNIT_ISSUED_TARGET_ORDER                   = ConvertUnitEvent(77)
  200.                                                                        
  201.     constant unitevent EVENT_UNIT_HERO_LEVEL                            = ConvertUnitEvent(78)
  202.     constant unitevent EVENT_UNIT_HERO_SKILL                            = ConvertUnitEvent(79)
  203.                                                                        
  204.     constant unitevent EVENT_UNIT_HERO_REVIVABLE                        = ConvertUnitEvent(80)
  205.     constant unitevent EVENT_UNIT_HERO_REVIVE_START                     = ConvertUnitEvent(81)
  206.     constant unitevent EVENT_UNIT_HERO_REVIVE_CANCEL                    = ConvertUnitEvent(82)
  207.     constant unitevent EVENT_UNIT_HERO_REVIVE_FINISH                    = ConvertUnitEvent(83)
  208.                                                                        
  209.     constant unitevent EVENT_UNIT_SUMMON                                = ConvertUnitEvent(84)
  210.                                                                        
  211.     constant unitevent EVENT_UNIT_DROP_ITEM                             = ConvertUnitEvent(85)
  212.     constant unitevent EVENT_UNIT_PICKUP_ITEM                           = ConvertUnitEvent(86)
  213.     constant unitevent EVENT_UNIT_USE_ITEM                              = ConvertUnitEvent(87)
  214.  
  215.     constant unitevent EVENT_UNIT_LOADED                                = ConvertUnitEvent(88)
  216.  
  217.     constant widgetevent EVENT_WIDGET_DEATH                             = ConvertWidgetEvent(89)
  218.  
  219.     constant dialogevent EVENT_DIALOG_BUTTON_CLICK                      = ConvertDialogEvent(90)
  220.     constant dialogevent EVENT_DIALOG_CLICK                             = ConvertDialogEvent(91)
  221.  
  222.     //===================================================
  223.     // Frozen Throne Expansion Events
  224.     // Need to be added here to preserve compat
  225.     //===================================================
  226.  
  227.     //===================================================
  228.     // For use with TriggerRegisterGameEvent   
  229.     //===================================================   
  230.  
  231.     constant gameevent          EVENT_GAME_LOADED                       = ConvertGameEvent(256)
  232.     constant gameevent          EVENT_GAME_TOURNAMENT_FINISH_SOON       = ConvertGameEvent(257)
  233.     constant gameevent          EVENT_GAME_TOURNAMENT_FINISH_NOW        = ConvertGameEvent(258)
  234.     constant gameevent          EVENT_GAME_SAVE                         = ConvertGameEvent(259)
  235.  
  236.     //===================================================
  237.     // For use with TriggerRegisterPlayerEvent
  238.     //===================================================
  239.  
  240.     constant playerevent        EVENT_PLAYER_ARROW_LEFT_DOWN            = ConvertPlayerEvent(261)
  241.     constant playerevent        EVENT_PLAYER_ARROW_LEFT_UP              = ConvertPlayerEvent(262)
  242.     constant playerevent        EVENT_PLAYER_ARROW_RIGHT_DOWN           = ConvertPlayerEvent(263)
  243.     constant playerevent        EVENT_PLAYER_ARROW_RIGHT_UP             = ConvertPlayerEvent(264)
  244.     constant playerevent        EVENT_PLAYER_ARROW_DOWN_DOWN            = ConvertPlayerEvent(265)
  245.     constant playerevent        EVENT_PLAYER_ARROW_DOWN_UP              = ConvertPlayerEvent(266)
  246.     constant playerevent        EVENT_PLAYER_ARROW_UP_DOWN              = ConvertPlayerEvent(267)
  247.     constant playerevent        EVENT_PLAYER_ARROW_UP_UP                = ConvertPlayerEvent(268)
  248.  
  249.     //===================================================
  250.     // For use with TriggerRegisterPlayerUnitEvent
  251.     //===================================================
  252.  
  253.     constant playerunitevent    EVENT_PLAYER_UNIT_SELL                  = ConvertPlayerUnitEvent(269)
  254.     constant playerunitevent    EVENT_PLAYER_UNIT_SELL_ITEM             = ConvertPlayerUnitEvent(271)
  255.     constant playerunitevent    EVENT_PLAYER_UNIT_SPELL_CAST            = ConvertPlayerUnitEvent(273)
  256.     constant playerunitevent    EVENT_PLAYER_UNIT_PAWN_ITEM             = ConvertPlayerUnitEvent(277)
  257.  
  258.     //===================================================
  259.     // For use with TriggerRegisterUnitEvent
  260.     //===================================================
  261.  
  262.     constant unitevent          EVENT_UNIT_SELL                         = ConvertUnitEvent(286)
  263.     constant unitevent          EVENT_UNIT_CHANGE_OWNER                 = ConvertUnitEvent(287)
  264.     constant unitevent          EVENT_UNIT_SELL_ITEM                    = ConvertUnitEvent(288)
  265.     constant unitevent          EVENT_UNIT_SPELL_CHANNEL                = ConvertUnitEvent(289)
  266.     constant unitevent          EVENT_UNIT_SPELL_CAST                   = ConvertUnitEvent(290)
  267.     constant unitevent          EVENT_UNIT_SPELL_EFFECT                 = ConvertUnitEvent(291)
  268.     constant unitevent          EVENT_UNIT_SPELL_FINISH                 = ConvertUnitEvent(292)
  269.     constant unitevent          EVENT_UNIT_SPELL_ENDCAST                = ConvertUnitEvent(293)
  270.     constant unitevent          EVENT_UNIT_PAWN_ITEM                    = ConvertUnitEvent(294)
  271.  
  272.     //===================================================
  273.     // Limit Event API constants   
  274.     // variable, player state, game state, and unit state events
  275.     // ( do NOT change the order of these... )
  276.     //===================================================
  277.     constant limitop LESS_THAN                              = ConvertLimitOp(0)
  278.     constant limitop LESS_THAN_OR_EQUAL                     = ConvertLimitOp(1)
  279.     constant limitop EQUAL                                  = ConvertLimitOp(2)
  280.     constant limitop GREATER_THAN_OR_EQUAL                  = ConvertLimitOp(3)
  281.     constant limitop GREATER_THAN                           = ConvertLimitOp(4)
  282.     constant limitop NOT_EQUAL                              = ConvertLimitOp(5)
  283.  
  284. //===================================================
  285. // Unit Type Constants for use with IsUnitType()
  286. //===================================================
  287.  
  288.     constant unittype UNIT_TYPE_HERO                        = ConvertUnitType(0)
  289.     constant unittype UNIT_TYPE_DEAD                        = ConvertUnitType(1)
  290.     constant unittype UNIT_TYPE_STRUCTURE                   = ConvertUnitType(2)
  291.  
  292.     constant unittype UNIT_TYPE_FLYING                      = ConvertUnitType(3)
  293.     constant unittype UNIT_TYPE_GROUND                      = ConvertUnitType(4)
  294.  
  295.     constant unittype UNIT_TYPE_ATTACKS_FLYING              = ConvertUnitType(5)
  296.     constant unittype UNIT_TYPE_ATTACKS_GROUND              = ConvertUnitType(6)
  297.  
  298.     constant unittype UNIT_TYPE_MELEE_ATTACKER              = ConvertUnitType(7)
  299.     constant unittype UNIT_TYPE_RANGED_ATTACKER             = ConvertUnitType(8)
  300.  
  301.     constant unittype UNIT_TYPE_GIANT                       = ConvertUnitType(9)
  302.     constant unittype UNIT_TYPE_SUMMONED                    = ConvertUnitType(10)
  303.     constant unittype UNIT_TYPE_STUNNED                     = ConvertUnitType(11)
  304.     constant unittype UNIT_TYPE_PLAGUED                     = ConvertUnitType(12)
  305.     constant unittype UNIT_TYPE_SNARED                      = ConvertUnitType(13)
  306.  
  307.     constant unittype UNIT_TYPE_UNDEAD                      = ConvertUnitType(14)
  308.     constant unittype UNIT_TYPE_MECHANICAL                  = ConvertUnitType(15)
  309.     constant unittype UNIT_TYPE_PEON                        = ConvertUnitType(16)
  310.     constant unittype UNIT_TYPE_SAPPER                      = ConvertUnitType(17)
  311.     constant unittype UNIT_TYPE_TOWNHALL                    = ConvertUnitType(18)   
  312.     constant unittype UNIT_TYPE_ANCIENT                     = ConvertUnitType(19)
  313.    
  314.     constant unittype UNIT_TYPE_TAUREN                      = ConvertUnitType(20)
  315.     constant unittype UNIT_TYPE_POISONED                    = ConvertUnitType(21)
  316.     constant unittype UNIT_TYPE_POLYMORPHED                 = ConvertUnitType(22)
  317.     constant unittype UNIT_TYPE_SLEEPING                    = ConvertUnitType(23)
  318.     constant unittype UNIT_TYPE_RESISTANT                   = ConvertUnitType(24)
  319.     constant unittype UNIT_TYPE_ETHEREAL                    = ConvertUnitType(25)
  320.     constant unittype UNIT_TYPE_MAGIC_IMMUNE                = ConvertUnitType(26)
  321.  
  322. //===================================================
  323. // Unit Type Constants for use with ChooseRandomItemEx()
  324. //===================================================
  325.  
  326.     constant itemtype ITEM_TYPE_PERMANENT                   = ConvertItemType(0)
  327.     constant itemtype ITEM_TYPE_CHARGED                     = ConvertItemType(1)
  328.     constant itemtype ITEM_TYPE_POWERUP                     = ConvertItemType(2)
  329.     constant itemtype ITEM_TYPE_ARTIFACT                    = ConvertItemType(3)
  330.     constant itemtype ITEM_TYPE_PURCHASABLE                 = ConvertItemType(4)
  331.     constant itemtype ITEM_TYPE_CAMPAIGN                    = ConvertItemType(5)
  332.     constant itemtype ITEM_TYPE_MISCELLANEOUS               = ConvertItemType(6)
  333.     constant itemtype ITEM_TYPE_UNKNOWN                     = ConvertItemType(7)
  334.     constant itemtype ITEM_TYPE_ANY                         = ConvertItemType(8)
  335.  
  336.     // Deprecated, should use ITEM_TYPE_POWERUP
  337.     constant itemtype ITEM_TYPE_TOME                        = ConvertItemType(2)
  338.  
  339. //===================================================
  340. // Animatable Camera Fields
  341. //===================================================
  342.  
  343.     constant camerafield CAMERA_FIELD_FARZ                  = ConvertCameraField(1)
  344.     constant camerafield CAMERA_FIELD_ROLL                  = ConvertCameraField(4)
  345.     constant camerafield CAMERA_FIELD_ROTATION              = ConvertCameraField(5)
  346.     constant camerafield CAMERA_FIELD_ZOFFSET               = ConvertCameraField(6)
  347.  
  348.     constant blendmode   BLEND_MODE_NONE                    = ConvertBlendMode(0)
  349.     constant blendmode   BLEND_MODE_DONT_CARE               = ConvertBlendMode(0)
  350.     constant blendmode   BLEND_MODE_KEYALPHA                = ConvertBlendMode(1)
  351.     constant blendmode   BLEND_MODE_BLEND                   = ConvertBlendMode(2)
  352.     constant blendmode   BLEND_MODE_ADDITIVE                = ConvertBlendMode(3)
  353.     constant blendmode   BLEND_MODE_MODULATE                = ConvertBlendMode(4)
  354.     constant blendmode   BLEND_MODE_MODULATE_2X             = ConvertBlendMode(5)
  355.    
  356.     constant raritycontrol  RARITY_FREQUENT                 = ConvertRarityControl(0)
  357.     constant raritycontrol  RARITY_RARE                     = ConvertRarityControl(1)
  358.  
  359.     constant texmapflags    TEXMAP_FLAG_NONE                = ConvertTexMapFlags(0)
  360.     constant texmapflags    TEXMAP_FLAG_WRAP_U              = ConvertTexMapFlags(1)
  361.     constant texmapflags    TEXMAP_FLAG_WRAP_V              = ConvertTexMapFlags(2)
  362.     constant texmapflags    TEXMAP_FLAG_WRAP_UV             = ConvertTexMapFlags(3)
  363.  
  364.     constant fogstate       FOG_OF_WAR_MASKED               = ConvertFogState(1)
  365.     constant fogstate       FOG_OF_WAR_FOGGED               = ConvertFogState(2)
  366.     constant fogstate       FOG_OF_WAR_VISIBLE              = ConvertFogState(4)
  367.  
  368. //===================================================
  369. // Camera Margin constants for use with GetCameraMargin
  370. //===================================================
  371.  
  372.     constant integer        CAMERA_MARGIN_LEFT              = 0
  373.     constant integer        CAMERA_MARGIN_RIGHT             = 1
  374.     constant integer        CAMERA_MARGIN_TOP               = 2
  375.     constant integer        CAMERA_MARGIN_BOTTOM            = 3
  376.  
  377. //===================================================
  378. // Effect API constants
  379. //===================================================
  380.  
  381.     constant effecttype     EFFECT_TYPE_EFFECT              = ConvertEffectType(0)
  382.     constant effecttype     EFFECT_TYPE_TARGET              = ConvertEffectType(1)
  383.     constant effecttype     EFFECT_TYPE_CASTER              = ConvertEffectType(2)
  384.     constant effecttype     EFFECT_TYPE_SPECIAL             = ConvertEffectType(3)
  385.     constant effecttype     EFFECT_TYPE_AREA_EFFECT         = ConvertEffectType(4)
  386.     constant effecttype     EFFECT_TYPE_MISSILE             = ConvertEffectType(5)
  387.     constant effecttype     EFFECT_TYPE_LIGHTNING           = ConvertEffectType(6)
  388.  
  389.     constant soundtype      SOUND_TYPE_EFFECT               = ConvertSoundType(0)
  390.     constant soundtype      SOUND_TYPE_EFFECT_LOOPED        = ConvertSoundType(1)
  391.  
  392. endglobals
« Last Edit: December 16, 2012, 09:05:40 AM by moyack »



Math API
Reply #3 on: December 15, 2012, 03:28:29 PM

Code: jass
  1. //============================================================================
  2. // MathAPI
  3. native Deg2Rad  takes real degrees returns real
  4. native Rad2Deg  takes real radians returns real
  5.  
  6. native Sin      takes real radians returns real
  7. native Cos      takes real radians returns real
  8. native Tan      takes real radians returns real
  9.  
  10. // Expect values between -1 and 1...returns 0 for invalid input
  11. native Asin     takes real y returns real
  12. native Acos     takes real x returns real
  13.  
  14. native Atan     takes real x returns real
  15.  
  16. // Returns 0 if x and y are both 0
  17. native Atan2    takes real y, real x returns real
  18.  
  19. // Returns 0 if x <= 0
  20. native SquareRoot takes real x returns real
  21.  
  22. // computes x to the y power
  23. // y == 0.0             => 1
  24. // x ==0.0 and y < 0    => 0
  25. //
  26. native Pow      takes real x, real power returns real
« Last Edit: December 16, 2012, 09:06:37 AM by moyack »



String API
Reply #4 on: December 16, 2012, 09:04:16 AM

Code: jass
  1. //============================================================================
  2. // String Utility API
  3. native I2R  takes integer i returns real
  4. native R2I  takes real r returns integer
  5. native I2S  takes integer i returns string
  6. native R2S  takes real r returns string
  7. native R2SW takes real r, integer width, integer precision returns string
  8. native S2I  takes string s returns integer
  9. native S2R  takes string s returns real
  10. native GetHandleId takes handle h returns integer
  11. native SubString takes string source, integer start, integer end returns string
  12. native StringLength takes string s returns integer
  13. native StringCase takes string source, boolean upper returns string
  14. native StringHash takes string s returns integer
  15.  
  16. native GetLocalizedString takes string source returns string
  17. native GetLocalizedHotkey takes string source returns integer


Map API
Reply #5 on: December 16, 2012, 09:08:18 AM

Code: jass
  1. //============================================================================
  2. // Map Setup API
  3. //
  4. //  These are native functions for describing the map configuration
  5. //  these funcs should only be used in the "config" function of
  6. //  a map script. The functions should also be called in this order
  7. //  ( i.e. call SetPlayers before SetPlayerColor...
  8. //
  9.  
  10. native SetMapName           takes string name returns nothing
  11. native SetMapDescription    takes string description returns nothing
  12.  
  13. native SetTeams             takes integer teamcount returns nothing
  14. native SetPlayers           takes integer playercount returns nothing
  15.  
  16. native DefineStartLocation      takes integer whichStartLoc, real x, real y returns nothing
  17. native DefineStartLocationLoc   takes integer whichStartLoc, location whichLocation returns nothing
  18. native SetStartLocPrioCount     takes integer whichStartLoc, integer prioSlotCount returns nothing
  19. native SetStartLocPrio          takes integer whichStartLoc, integer prioSlotIndex, integer otherStartLocIndex, startlocprio priority returns nothing
  20. native GetStartLocPrioSlot      takes integer whichStartLoc, integer prioSlotIndex returns integer
  21. native GetStartLocPrio          takes integer whichStartLoc, integer prioSlotIndex returns startlocprio
  22.  
  23. native SetGameTypeSupported takes gametype whichGameType, boolean value returns nothing
  24. native SetMapFlag           takes mapflag whichMapFlag, boolean value returns nothing
  25. native SetGamePlacement     takes placement whichPlacementType returns nothing
  26. native SetGameSpeed         takes gamespeed whichspeed returns nothing
  27. native SetGameDifficulty    takes gamedifficulty whichdifficulty returns nothing
  28. native SetResourceDensity   takes mapdensity whichdensity returns nothing
  29. native SetCreatureDensity   takes mapdensity whichdensity returns nothing
  30.  
  31. native GetTeams             takes nothing returns integer
  32. native GetPlayers           takes nothing returns integer
  33.  
  34. native IsGameTypeSupported  takes gametype whichGameType returns boolean
  35. native GetGameTypeSelected  takes nothing returns gametype
  36. native IsMapFlagSet         takes mapflag whichMapFlag returns boolean
  37.  
  38. constant native GetGamePlacement     takes nothing returns placement
  39. constant native GetGameSpeed         takes nothing returns gamespeed
  40. constant native GetGameDifficulty    takes nothing returns gamedifficulty
  41. constant native GetResourceDensity   takes nothing returns mapdensity
  42. constant native GetCreatureDensity   takes nothing returns mapdensity
  43. constant native GetStartLocationX    takes integer whichStartLocation returns real
  44. constant native GetStartLocationY    takes integer whichStartLocation returns real
  45. constant native GetStartLocationLoc  takes integer whichStartLocation returns location
  46.  
  47.  
  48. native SetPlayerTeam            takes player whichPlayer, integer whichTeam returns nothing
  49. native SetPlayerStartLocation   takes player whichPlayer, integer startLocIndex returns nothing
  50. // forces player to have the specified start loc and marks the start loc as occupied
  51. // which removes it from consideration for subsequently placed players
  52. // ( i.e. you can use this to put people in a fixed loc and then
  53. //   use random placement for any unplaced players etc )
  54. native ForcePlayerStartLocation takes player whichPlayer, integer startLocIndex returns nothing
  55. native SetPlayerColor           takes player whichPlayer, playercolor color returns nothing
  56. native SetPlayerAlliance        takes player sourcePlayer, player otherPlayer, alliancetype whichAllianceSetting, boolean value returns nothing
  57. native SetPlayerTaxRate         takes player sourcePlayer, player otherPlayer, playerstate whichResource, integer rate returns nothing
  58. native SetPlayerRacePreference  takes player whichPlayer, racepreference whichRacePreference returns nothing
  59. native SetPlayerRaceSelectable  takes player whichPlayer, boolean value returns nothing
  60. native SetPlayerController      takes player whichPlayer, mapcontrol controlType returns nothing
  61. native SetPlayerName            takes player whichPlayer, string name returns nothing
  62.  
  63. native SetPlayerOnScoreScreen   takes player whichPlayer, boolean flag returns nothing
  64.  
  65. native GetPlayerTeam            takes player whichPlayer returns integer
  66. native GetPlayerStartLocation   takes player whichPlayer returns integer
  67. native GetPlayerColor           takes player whichPlayer returns playercolor
  68. native GetPlayerSelectable      takes player whichPlayer returns boolean
  69. native GetPlayerController      takes player whichPlayer returns mapcontrol
  70. native GetPlayerSlotState       takes player whichPlayer returns playerslotstate
  71. native GetPlayerTaxRate         takes player sourcePlayer, player otherPlayer, playerstate whichResource returns integer
  72. native IsPlayerRacePrefSet      takes player whichPlayer, racepreference pref returns boolean
  73. native GetPlayerName            takes player whichPlayer returns string


Timer API
Reply #6 on: December 16, 2012, 09:09:12 AM

Code: jass
  1. //============================================================================
  2. // Timer API
  3. //
  4. native CreateTimer          takes nothing returns timer
  5. native DestroyTimer         takes timer whichTimer returns nothing
  6. native TimerStart           takes timer whichTimer, real timeout, boolean periodic, code handlerFunc returns nothing
  7. native TimerGetElapsed      takes timer whichTimer returns real
  8. native TimerGetRemaining    takes timer whichTimer returns real
  9. native TimerGetTimeout      takes timer whichTimer returns real
  10. native PauseTimer           takes timer whichTimer returns nothing
  11. native ResumeTimer          takes timer whichTimer returns nothing
  12. native GetExpiredTimer      takes nothing returns timer


Group API
Reply #7 on: December 16, 2012, 09:10:09 AM

Code: jass
  1. //============================================================================
  2. // Group API
  3. //
  4. native CreateGroup                          takes nothing returns group
  5. native DestroyGroup                         takes group whichGroup returns nothing
  6. native GroupAddUnit                         takes group whichGroup, unit whichUnit returns nothing
  7. native GroupRemoveUnit                      takes group whichGroup, unit whichUnit returns nothing
  8. native GroupClear                           takes group whichGroup returns nothing
  9. native GroupEnumUnitsOfType                 takes group whichGroup, string unitname, boolexpr filter returns nothing
  10. native GroupEnumUnitsOfPlayer               takes group whichGroup, player whichPlayer, boolexpr filter returns nothing
  11. native GroupEnumUnitsOfTypeCounted          takes group whichGroup, string unitname, boolexpr filter, integer countLimit returns nothing
  12. native GroupEnumUnitsInRect                 takes group whichGroup, rect r, boolexpr filter returns nothing
  13. native GroupEnumUnitsInRectCounted          takes group whichGroup, rect r, boolexpr filter, integer countLimit returns nothing
  14. native GroupEnumUnitsInRange                takes group whichGroup, real x, real y, real radius, boolexpr filter returns nothing
  15. native GroupEnumUnitsInRangeOfLoc           takes group whichGroup, location whichLocation, real radius, boolexpr filter returns nothing
  16. native GroupEnumUnitsInRangeCounted         takes group whichGroup, real x, real y, real radius, boolexpr filter, integer countLimit returns nothing
  17. native GroupEnumUnitsInRangeOfLocCounted    takes group whichGroup, location whichLocation, real radius, boolexpr filter, integer countLimit returns nothing
  18. native GroupEnumUnitsSelected               takes group whichGroup, player whichPlayer, boolexpr filter returns nothing
  19.  
  20. native GroupImmediateOrder                  takes group whichGroup, string order returns boolean
  21. native GroupImmediateOrderById              takes group whichGroup, integer order returns boolean
  22. native GroupPointOrder                      takes group whichGroup, string order, real x, real y returns boolean
  23. native GroupPointOrderLoc                   takes group whichGroup, string order, location whichLocation returns boolean
  24. native GroupPointOrderById                  takes group whichGroup, integer order, real x, real y returns boolean
  25. native GroupPointOrderByIdLoc               takes group whichGroup, integer order, location whichLocation returns boolean
  26. native GroupTargetOrder                     takes group whichGroup, string order, widget targetWidget returns boolean
  27. native GroupTargetOrderById                 takes group whichGroup, integer order, widget targetWidget returns boolean
  28.  
  29. // This will be difficult to support with potentially disjoint, cell-based regions
  30. // as it would involve enumerating all the cells that are covered by a particularregion
  31. // a better implementation would be a trigger that adds relevant units as they enter
  32. // and removes them if they leave...
  33. native ForGroup                 takes group whichGroup, code callback returns nothing
  34. native FirstOfGroup             takes group whichGroup returns unit


Force API
Reply #8 on: December 16, 2012, 11:00:39 AM

Code: jass
  1. //============================================================================
  2. // Force API
  3. //
  4. native CreateForce              takes nothing returns force
  5. native DestroyForce             takes force whichForce returns nothing
  6. native ForceAddPlayer           takes force whichForce, player whichPlayer returns nothing
  7. native ForceRemovePlayer        takes force whichForce, player whichPlayer returns nothing
  8. native ForceClear               takes force whichForce returns nothing
  9. native ForceEnumPlayers         takes force whichForce, boolexpr filter returns nothing
  10. native ForceEnumPlayersCounted  takes force whichForce, boolexpr filter, integer countLimit returns nothing
  11. native ForceEnumAllies          takes force whichForce, player whichPlayer, boolexpr filter returns nothing
  12. native ForceEnumEnemies         takes force whichForce, player whichPlayer, boolexpr filter returns nothing
  13. native ForForce                 takes force whichForce, code callback returns nothing


Region and Location API
Reply #9 on: February 24, 2013, 09:21:36 AM

Code: jass
  1. //============================================================================
  2. // Region and Location API
  3. //
  4. native Rect                     takes real minx, real miny, real maxx, real maxy returns rect
  5. native RectFromLoc              takes location min, location max returns rect
  6. native RemoveRect               takes rect whichRect returns nothing
  7. native SetRect                  takes rect whichRect, real minx, real miny, real maxx, real maxy returns nothing
  8. native SetRectFromLoc           takes rect whichRect, location min, location max returns nothing
  9. native MoveRectTo               takes rect whichRect, real newCenterX, real newCenterY returns nothing
  10. native MoveRectToLoc            takes rect whichRect, location newCenterLoc returns nothing
  11.  
  12. native GetRectCenterX           takes rect whichRect returns real
  13. native GetRectCenterY           takes rect whichRect returns real
  14. native GetRectMinX              takes rect whichRect returns real
  15. native GetRectMinY              takes rect whichRect returns real
  16. native GetRectMaxX              takes rect whichRect returns real
  17. native GetRectMaxY              takes rect whichRect returns real
  18.  
  19. native CreateRegion             takes nothing returns region
  20. native RemoveRegion             takes region whichRegion returns nothing
  21.  
  22. native RegionAddRect            takes region whichRegion, rect r returns nothing
  23. native RegionClearRect          takes region whichRegion, rect r returns nothing
  24.  
  25. native RegionAddCell           takes region whichRegion, real x, real y returns nothing
  26. native RegionAddCellAtLoc      takes region whichRegion, location whichLocation returns nothing
  27. native RegionClearCell         takes region whichRegion, real x, real y returns nothing
  28. native RegionClearCellAtLoc    takes region whichRegion, location whichLocation returns nothing
  29.  
  30. native Location                 takes real x, real y returns location
  31. native RemoveLocation           takes location whichLocation returns nothing
  32. native MoveLocation             takes location whichLocation, real newX, real newY returns nothing
  33. native GetLocationX             takes location whichLocation returns real
  34. native GetLocationY             takes location whichLocation returns real
  35.  
  36. // This function is asynchronous. The values it returns are not guaranteed synchronous between each player.
  37. //  If you attempt to use it in a synchronous manner, it may cause a desync.
  38. native GetLocationZ             takes location whichLocation returns real
  39.  
  40. native IsUnitInRegion               takes region whichRegion, unit whichUnit returns boolean
  41. native IsPointInRegion              takes region whichRegion, real x, real y returns boolean
  42. native IsLocationInRegion           takes region whichRegion, location whichLocation returns boolean
  43.  
  44. // Returns full map bounds, including unplayable borders, in world coordinates
  45. native GetWorldBounds           takes nothing returns rect
  46.  


Native Trigger Interface
Reply #10 on: February 24, 2013, 09:24:26 AM

Code: jass
  1. //============================================================================
  2. // Native trigger interface
  3. //
  4. native CreateTrigger    takes nothing returns trigger
  5. native DestroyTrigger   takes trigger whichTrigger returns nothing
  6. native ResetTrigger     takes trigger whichTrigger returns nothing
  7. native EnableTrigger    takes trigger whichTrigger returns nothing
  8. native DisableTrigger   takes trigger whichTrigger returns nothing
  9. native IsTriggerEnabled takes trigger whichTrigger returns boolean
  10.  
  11. native TriggerWaitOnSleeps   takes trigger whichTrigger, boolean flag returns nothing
  12. native IsTriggerWaitOnSleeps takes trigger whichTrigger returns boolean
  13.  
  14. constant native GetFilterUnit       takes nothing returns unit
  15. constant native GetEnumUnit         takes nothing returns unit
  16.  
  17. constant native GetFilterDestructable   takes nothing returns destructable
  18. constant native GetEnumDestructable     takes nothing returns destructable
  19.  
  20. constant native GetFilterItem           takes nothing returns item
  21. constant native GetEnumItem             takes nothing returns item
  22.  
  23. constant native GetFilterPlayer     takes nothing returns player
  24. constant native GetEnumPlayer       takes nothing returns player
  25.  
  26. constant native GetTriggeringTrigger    takes nothing returns trigger
  27. constant native GetTriggerEventId       takes nothing returns eventid
  28. constant native GetTriggerEvalCount     takes trigger whichTrigger returns integer
  29. constant native GetTriggerExecCount     takes trigger whichTrigger returns integer
  30.  
  31. native ExecuteFunc          takes string funcName returns nothing


Boolean Expr API
Reply #11 on: February 24, 2013, 09:41:28 AM

Code: jass
  1. //============================================================================
  2. // Boolean Expr API ( for compositing trigger conditions and unit filter funcs...)
  3. //============================================================================
  4. native And              takes boolexpr operandA, boolexpr operandB returns boolexpr
  5. native Or               takes boolexpr operandA, boolexpr operandB returns boolexpr
  6. native Not              takes boolexpr operand returns boolexpr
  7. native Condition        takes code func returns conditionfunc
  8. native DestroyCondition takes conditionfunc c returns nothing
  9. native Filter           takes code func returns filterfunc
  10. native DestroyFilter    takes filterfunc f returns nothing
  11. native DestroyBoolExpr  takes boolexpr e returns nothing


Trigger Game Event API
Reply #12 on: February 24, 2013, 09:42:59 AM

Code: jass
  1. //============================================================================
  2. // Trigger Game Event API
  3. //============================================================================
  4.  
  5. native TriggerRegisterVariableEvent takes trigger whichTrigger, string varName, limitop opcode, real limitval returns event
  6.  
  7.     // EVENT_GAME_VARIABLE_LIMIT
  8.     //constant native string GetTriggeringVariableName takes nothing returns string
  9.  
  10. // Creates it's own timer and triggers when it expires
  11. native TriggerRegisterTimerEvent takes trigger whichTrigger, real timeout, boolean periodic returns event
  12.  
  13. // Triggers when the timer you tell it about expires
  14. native TriggerRegisterTimerExpireEvent takes trigger whichTrigger, timer t returns event
  15.  
  16. native TriggerRegisterGameStateEvent takes trigger whichTrigger, gamestate whichState, limitop opcode, real limitval returns event
  17.  
  18. native TriggerRegisterDialogEvent       takes trigger whichTrigger, dialog whichDialog returns event
  19. native TriggerRegisterDialogButtonEvent takes trigger whichTrigger, button whichButton returns event
  20.  
  21. //  EVENT_GAME_STATE_LIMIT
  22. constant native GetEventGameState takes nothing returns gamestate
  23.  
  24. native TriggerRegisterGameEvent takes trigger whichTrigger, gameevent whichGameEvent returns event
  25.  
  26. // EVENT_GAME_VICTORY
  27. constant native GetWinningPlayer takes nothing returns player
  28.  
  29.  
  30. native TriggerRegisterEnterRegion takes trigger whichTrigger, region whichRegion, boolexpr filter returns event
  31.  
  32. // EVENT_GAME_ENTER_REGION
  33. constant native GetTriggeringRegion takes nothing returns region
  34. constant native GetEnteringUnit takes nothing returns unit
  35.  
  36. // EVENT_GAME_LEAVE_REGION
  37.  
  38. native TriggerRegisterLeaveRegion takes trigger whichTrigger, region whichRegion, boolexpr filter returns event
  39. constant native GetLeavingUnit takes nothing returns unit
  40.  
  41. native TriggerRegisterTrackableHitEvent takes trigger whichTrigger, trackable t returns event
  42. native TriggerRegisterTrackableTrackEvent takes trigger whichTrigger, trackable t returns event
  43.  
  44. // EVENT_GAME_TRACKABLE_HIT
  45. // EVENT_GAME_TRACKABLE_TRACK
  46. constant native GetTriggeringTrackable takes nothing returns trackable
  47.  
  48. // EVENT_DIALOG_BUTTON_CLICK
  49. constant native GetClickedButton takes nothing returns button
  50. constant native GetClickedDialog    takes nothing returns dialog
  51.  
  52. // EVENT_GAME_TOURNAMENT_FINISH_SOON
  53. constant native GetTournamentFinishSoonTimeRemaining takes nothing returns real
  54. constant native GetTournamentFinishNowRule takes nothing returns integer
  55. constant native GetTournamentFinishNowPlayer takes nothing returns player
  56. constant native GetTournamentScore takes player whichPlayer returns integer
  57.  
  58. // EVENT_GAME_SAVE
  59. constant native GetSaveBasicFilename takes nothing returns string


Trigger Player Based Event API
Reply #13 on: February 24, 2013, 09:44:26 AM

Code: jass
  1. //============================================================================
  2. // Trigger Player Based Event API
  3. //============================================================================
  4.  
  5. native TriggerRegisterPlayerEvent takes trigger whichTrigger, player  whichPlayer, playerevent whichPlayerEvent returns event
  6.  
  7. // EVENT_PLAYER_DEFEAT
  8. // EVENT_PLAYER_VICTORY
  9. constant native GetTriggerPlayer takes nothing returns player
  10.  
  11. native TriggerRegisterPlayerUnitEvent takes trigger whichTrigger, player whichPlayer, playerunitevent whichPlayerUnitEvent, boolexpr filter returns event
  12.  
  13. // EVENT_PLAYER_HERO_LEVEL
  14. // EVENT_UNIT_HERO_LEVEL
  15. constant native GetLevelingUnit takes nothing returns unit
  16.  
  17. // EVENT_PLAYER_HERO_SKILL
  18. // EVENT_UNIT_HERO_SKILL
  19. constant native GetLearningUnit      takes nothing returns unit
  20. constant native GetLearnedSkill      takes nothing returns integer
  21. constant native GetLearnedSkillLevel takes nothing returns integer
  22.  
  23. // EVENT_PLAYER_HERO_REVIVABLE
  24. constant native GetRevivableUnit takes nothing returns unit
  25.  
  26. // EVENT_PLAYER_HERO_REVIVE_START
  27. // EVENT_PLAYER_HERO_REVIVE_CANCEL
  28. // EVENT_PLAYER_HERO_REVIVE_FINISH
  29. // EVENT_UNIT_HERO_REVIVE_START
  30. // EVENT_UNIT_HERO_REVIVE_CANCEL
  31. // EVENT_UNIT_HERO_REVIVE_FINISH
  32. constant native GetRevivingUnit takes nothing returns unit
  33.  
  34. // EVENT_PLAYER_UNIT_ATTACKED
  35. constant native GetAttacker takes nothing returns unit
  36.  
  37. // EVENT_PLAYER_UNIT_RESCUED
  38. constant native GetRescuer  takes nothing returns unit
  39.  
  40. // EVENT_PLAYER_UNIT_DEATH
  41. constant native GetDyingUnit takes nothing returns unit
  42. constant native GetKillingUnit takes nothing returns unit
  43.  
  44. // EVENT_PLAYER_UNIT_DECAY
  45. constant native GetDecayingUnit takes nothing returns unit
  46.  
  47. // EVENT_PLAYER_UNIT_SELECTED
  48. //constant native GetSelectedUnit takes nothing returns unit
  49.  
  50. // EVENT_PLAYER_UNIT_CONSTRUCT_START
  51. constant native GetConstructingStructure takes nothing returns unit
  52.  
  53. // EVENT_PLAYER_UNIT_CONSTRUCT_FINISH
  54. // EVENT_PLAYER_UNIT_CONSTRUCT_CANCEL
  55. constant native GetCancelledStructure takes nothing returns unit
  56. constant native GetConstructedStructure takes nothing returns unit
  57.  
  58. // EVENT_PLAYER_UNIT_RESEARCH_START
  59. // EVENT_PLAYER_UNIT_RESEARCH_CANCEL
  60. // EVENT_PLAYER_UNIT_RESEARCH_FINISH
  61. constant native GetResearchingUnit takes nothing returns unit
  62. constant native GetResearched takes nothing returns integer
  63.  
  64. // EVENT_PLAYER_UNIT_TRAIN_START
  65. // EVENT_PLAYER_UNIT_TRAIN_CANCEL
  66. constant native GetTrainedUnitType takes nothing returns integer
  67.  
  68. // EVENT_PLAYER_UNIT_TRAIN_FINISH
  69. constant native GetTrainedUnit takes nothing returns unit
  70.  
  71. // EVENT_PLAYER_UNIT_DETECTED
  72. constant native GetDetectedUnit takes nothing returns unit
  73.  
  74. // EVENT_PLAYER_UNIT_SUMMONED
  75. constant native GetSummoningUnit    takes nothing returns unit
  76. constant native GetSummonedUnit     takes nothing returns unit
  77.  
  78. // EVENT_PLAYER_UNIT_LOADED
  79. constant native GetTransportUnit    takes nothing returns unit
  80. constant native GetLoadedUnit       takes nothing returns unit
  81.  
  82. // EVENT_PLAYER_UNIT_SELL
  83. constant native GetSellingUnit      takes nothing returns unit
  84. constant native GetSoldUnit         takes nothing returns unit
  85. constant native GetBuyingUnit       takes nothing returns unit
  86.  
  87. // EVENT_PLAYER_UNIT_SELL_ITEM
  88. constant native GetSoldItem         takes nothing returns item
  89.  
  90. // EVENT_PLAYER_UNIT_CHANGE_OWNER
  91. constant native GetChangingUnit             takes nothing returns unit
  92. constant native GetChangingUnitPrevOwner    takes nothing returns player
  93.  
  94. // EVENT_PLAYER_UNIT_DROP_ITEM
  95. // EVENT_PLAYER_UNIT_PICKUP_ITEM
  96. // EVENT_PLAYER_UNIT_USE_ITEM
  97. constant native GetManipulatingUnit takes nothing returns unit
  98. constant native GetManipulatedItem  takes nothing returns item
  99.  
  100. // EVENT_PLAYER_UNIT_ISSUED_ORDER
  101. constant native GetOrderedUnit takes nothing returns unit
  102. constant native GetIssuedOrderId takes nothing returns integer
  103.  
  104. // EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER
  105. constant native GetOrderPointX takes nothing returns real
  106. constant native GetOrderPointY takes nothing returns real
  107. constant native GetOrderPointLoc takes nothing returns location
  108.  
  109. // EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER
  110. constant native GetOrderTarget              takes nothing returns widget
  111. constant native GetOrderTargetDestructable  takes nothing returns destructable
  112. constant native GetOrderTargetItem          takes nothing returns item
  113. constant native GetOrderTargetUnit          takes nothing returns unit
  114.  
  115. // EVENT_UNIT_SPELL_CHANNEL
  116. // EVENT_UNIT_SPELL_CAST
  117. // EVENT_UNIT_SPELL_EFFECT
  118. // EVENT_UNIT_SPELL_FINISH
  119. // EVENT_UNIT_SPELL_ENDCAST
  120. // EVENT_PLAYER_UNIT_SPELL_CHANNEL
  121. // EVENT_PLAYER_UNIT_SPELL_CAST
  122. // EVENT_PLAYER_UNIT_SPELL_EFFECT
  123. // EVENT_PLAYER_UNIT_SPELL_FINISH
  124. // EVENT_PLAYER_UNIT_SPELL_ENDCAST
  125. constant native GetSpellAbilityUnit         takes nothing returns unit
  126. constant native GetSpellAbilityId           takes nothing returns integer
  127. constant native GetSpellAbility             takes nothing returns ability
  128. constant native GetSpellTargetLoc           takes nothing returns location
  129. constant native GetSpellTargetX                         takes nothing returns real
  130. constant native GetSpellTargetY                         takes nothing returns real
  131. constant native GetSpellTargetDestructable  takes nothing returns destructable
  132. constant native GetSpellTargetItem          takes nothing returns item
  133. constant native GetSpellTargetUnit          takes nothing returns unit
  134.  
  135. native TriggerRegisterPlayerAllianceChange takes trigger whichTrigger, player whichPlayer, alliancetype whichAlliance returns event
  136. native TriggerRegisterPlayerStateEvent takes trigger whichTrigger, player whichPlayer, playerstate whichState, limitop opcode, real limitval returns event
  137.  
  138. // EVENT_PLAYER_STATE_LIMIT
  139. constant native GetEventPlayerState takes nothing returns playerstate
  140.  
  141. native TriggerRegisterPlayerChatEvent takes trigger whichTrigger, player whichPlayer, string chatMessageToDetect, boolean exactMatchOnly returns event
  142.  
  143. // EVENT_PLAYER_CHAT
  144.  
  145. // returns the actual string they typed in ( same as what you registered for
  146. // if you required exact match )
  147. constant native GetEventPlayerChatString takes nothing returns string
  148.  
  149. // returns the string that you registered for
  150. constant native GetEventPlayerChatStringMatched takes nothing returns string
  151.  
  152. native TriggerRegisterDeathEvent takes trigger whichTrigger, widget whichWidget returns event


Trigger Unit Based Event API
Reply #14 on: February 24, 2013, 09:45:19 AM

Code: jass
  1. //============================================================================
  2. // Trigger Unit Based Event API
  3. //============================================================================
  4.  
  5. // returns handle to unit which triggered the most recent event when called from
  6. // within a trigger action function...returns null handle when used incorrectly
  7.  
  8. constant native GetTriggerUnit takes nothing returns unit
  9.  
  10. native TriggerRegisterUnitStateEvent takes trigger whichTrigger, unit whichUnit, unitstate whichState, limitop opcode, real limitval returns event
  11.  
  12. // EVENT_UNIT_STATE_LIMIT
  13. constant native GetEventUnitState takes nothing returns unitstate
  14.  
  15. native TriggerRegisterUnitEvent takes trigger whichTrigger, unit whichUnit, unitevent whichEvent returns event
  16.  
  17. // EVENT_UNIT_DAMAGED
  18. constant native GetEventDamage takes nothing returns real
  19. constant native GetEventDamageSource takes nothing returns unit
  20.  
  21. // EVENT_UNIT_DEATH
  22. // EVENT_UNIT_DECAY
  23. // Use the GetDyingUnit and GetDecayingUnit funcs above
  24.  
  25. // EVENT_UNIT_DETECTED
  26. constant native GetEventDetectingPlayer takes nothing returns player
  27.  
  28. native TriggerRegisterFilterUnitEvent takes trigger whichTrigger, unit whichUnit, unitevent whichEvent, boolexpr filter returns event
  29.  
  30. // EVENT_UNIT_ACQUIRED_TARGET
  31. // EVENT_UNIT_TARGET_IN_RANGE
  32. constant native GetEventTargetUnit takes nothing returns unit
  33.  
  34. // EVENT_UNIT_ATTACKED
  35. // Use GetAttacker from the Player Unit Event API Below...
  36.  
  37. // EVENT_UNIT_RESCUEDED
  38. // Use GetRescuer from the Player Unit Event API Below...
  39.  
  40. // EVENT_UNIT_CONSTRUCT_CANCEL
  41. // EVENT_UNIT_CONSTRUCT_FINISH
  42.  
  43. // See the Player Unit Construction Event API above for event info funcs
  44.  
  45. // EVENT_UNIT_TRAIN_START
  46. // EVENT_UNIT_TRAIN_CANCELLED
  47. // EVENT_UNIT_TRAIN_FINISH
  48.  
  49. // See the Player Unit Training Event API above for event info funcs
  50.  
  51. // EVENT_UNIT_SELL
  52.  
  53. // See the Player Unit Sell Event API above for event info funcs
  54.  
  55. // EVENT_UNIT_DROP_ITEM
  56. // EVENT_UNIT_PICKUP_ITEM
  57. // EVENT_UNIT_USE_ITEM
  58. // See the Player Unit/Item manipulation Event API above for event info funcs
  59.  
  60. // EVENT_UNIT_ISSUED_ORDER
  61. // EVENT_UNIT_ISSUED_POINT_ORDER
  62. // EVENT_UNIT_ISSUED_TARGET_ORDER
  63.  
  64. // See the Player Unit Order Event API above for event info funcs
  65.  
  66. native TriggerRegisterUnitInRange takes trigger whichTrigger, unit whichUnit, real range, boolexpr filter returns event
  67.  
  68. native TriggerAddCondition    takes trigger whichTrigger, boolexpr condition returns triggercondition
  69. native TriggerRemoveCondition takes trigger whichTrigger, triggercondition whichCondition returns nothing
  70. native TriggerClearConditions takes trigger whichTrigger returns nothing
  71.  
  72. native TriggerAddAction     takes trigger whichTrigger, code actionFunc returns triggeraction
  73. native TriggerRemoveAction  takes trigger whichTrigger, triggeraction whichAction returns nothing
  74. native TriggerClearActions  takes trigger whichTrigger returns nothing
  75. native TriggerSleepAction   takes real timeout returns nothing
  76. native TriggerWaitForSound  takes sound s, real offset returns nothing
  77. native TriggerEvaluate      takes trigger whichTrigger returns boolean
  78. native TriggerExecute       takes trigger whichTrigger returns nothing
  79. native TriggerExecuteWait   takes trigger whichTrigger returns nothing
  80. native TriggerSyncStart     takes