[reference] common.j

Jass Theory & Questions

13 years
edited 13 years
Index

[goto=natives]Natives[/goto] - [goto=constants]Constants 1[/goto] - [goto=constants2]Constants 2[/goto]


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