WC3JASS Jass Theory & Questions
[reference] common.j

moyack:


Index
Natives - Constants 1 - Constants 2

Code: jass  [Select]
  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

moyack:


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

moyack:


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

moyack:


Code: jass  [Select]
  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

moyack:


Code: jass  [Select]
  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
Navigation