Name | Type | is_array | initial_value |
annihilation | quest | No | |
annihilation_requirement | questitem | No | |
Aquemarin | questitem | No | |
ArcaneBeamCastingUnit | unit | No | |
ArcaneBeamPoint | location | No | |
ArcaneBeamTimer | timer | No | |
ArcaneBeamUnit | group | No | |
Artifact | integer | No | |
ASAOE | real | No | |
ASCaster | unit | No | |
ASCasterGroup | group | No | |
ASCasterPoint | location | No | |
ASDamage | real | No | |
ASDamageGroup | group | No | |
ASExplosion | unit | No | |
ASHashtable | hashtable | No | |
ASPlayer | player | No | |
ASRandomGroup | group | No | |
ASRay | unit | No | |
ASRayFly | real | No | |
ASTarget | unit | No | |
ASTargetPoint | location | No | |
ASTime | real | No | |
Axe_Slam_Target | unit | No | |
Azurite | questitem | No | |
B_Angle | real | Yes | |
B_BackSFX | string | No | |
B_BooSlide | real | Yes | |
B_Caster | unit | Yes | |
B_CollisionSFX | string | No | |
B_Damage | real | Yes | |
B_Damaged | group | Yes | |
B_DetonateDestructibles | boolean | Yes | |
B_Distance | real | Yes | |
B_Dummy | unit | Yes | |
B_Float | boolean | Yes | |
B_Go_And_DONT_Back | boolean | Yes | |
B_Group | group | Yes | |
B_MaxDamage | real | Yes | |
B_Point | location | No | |
B_PosCaster | location | No | |
B_PosDummy | location | No | |
B_Position | location | No | |
B_Target | location | No | |
Banana | integer | No | |
Banana_Requirement | questitem | No | |
Barite | questitem | No | |
bear1 | location | No | |
bear2 | location | No | |
bear3 | location | No | |
bear4 | location | No | |
bear5 | location | No | |
bear6 | location | No | |
bearwarrior | integer | No | |
BelBaseHeight | real | No | |
BelBaseMoveOut | real | No | |
BelBool1 | boolean | No | |
BelBool2 | boolean | No | |
BelBool4 | boolean | No | |
BelCast | unit | No | |
BelConstant1 | real | No | |
BelConstant10 | real | No | |
BelConstant11 | real | No | |
BelConstant12 | real | No | |
BelConstant13 | real | No | |
BelConstant14 | real | No | |
BelConstant15 | real | No | |
BelConstant2 | real | No | |
BelConstant3 | real | No | |
BelConstant4 | real | No | |
BelConstant5 | real | No | |
BelConstant6 | real | No | |
BelConstant7 | real | No | |
BelConstant8 | real | No | |
BelConstant9 | real | No | |
BelDam | real | No | |
BelDummy | unit | No | |
BelGroup | group | No | |
BelHash | hashtable | No | |
BelLev | integer | No | |
BelLoop | integervar | No | |
BelReal | real | No | |
BelReal2 | real | No | |
BelRealA | real | No | |
BelRealB | real | No | |
BelRealC | real | No | |
BelRealD | real | No | |
BelRealE | real | No | |
BelSFXA | string | No | |
BelTrigger | integer | No | |
BladestormCaster | unit | No | |
Bloodthurst_Caster | unit | No | |
BloodThurst_Dummy | unit | No | |
BloodThurst_Timer | timer | No | |
BP | location | No | |
BP2 | location | No | |
Broodmother | questitem | No | |
Broodmother_Lightning | lightning | No | |
Caster | unit | No | |
cheese | unit | No | |
Child_count | integer | No | |
Childeren_Quest | quest | No | |
Childeren_Requirement | questitem | No | |
Claw_Target | unit | No | |
Curse_Effect | effect | No | |
Curse_Target | unit | No | |
Curse_Target_2 | unit | No | |
dark_ritual_1 | effect | No | |
dark_ritual_2 | effect | No | |
dark_ritual_point | location | No | |
DarkRitualTimer1 | timer | No | |
DarkRitualTimer2 | timer | No | |
Demonic_Barrier_Target | unit | No | |
DemonicBarrier_Timer | timer | No | |
Difficulty | dialog | No | |
earth_1 | location | No | |
earth_2 | location | No | |
earth_3 | location | No | |
earth_caster | unit | No | |
Easy | button | No | |
Enchant_Totem | abilcode | No | |
EnUnitGroup | group | No | |
ES_Caster | unit | No | |
ES_Group | group | No | |
ES_Integer | integervar | No | |
ES_Point | location | Yes | |
ES_Target | unit | No | |
ET_Spellbook | abilcode | No | |
Evasion_Caster | unit | No | |
EvasionTimer | timer | No | |
execution | quest | No | |
execution_count | integer | No | |
execution_requirement | questitem | No | |
Explore_Quest | quest | No | |
Explore_Requirement | questitem | No | |
fi | integer | No | |
FI_Angle | real | Yes | |
FI_AnimSpeed | real | Yes | |
FI_DefaultHeight | real | No | |
FI_EffectA | modelfile | No | |
FI_EffectB | modelfile | No | |
FI_FallHeight | real | No | |
FI_Height | real | Yes | |
FI_Hero | unit | Yes | |
FI_Max | integer | No | |
FI_Sound | string | No | |
FI_Vp | real | Yes | |
FI_Vz | real | Yes | |
FI_z | real | Yes | |
First_Aid_1 | effect | No | |
First_Aid_2 | effect | No | |
First_Aid_Caster | unit | No | |
Flame_Burst | location | No | |
Flame_Burst_Effect | effect | No | |
FloatingText1 | texttag | No | |
FloatingText10 | texttag | No | |
FloatingText11 | texttag | No | |
FloatingText12 | texttag | No | |
FloatingText13 | texttag | No | |
FloatingText14 | texttag | No | |
FloatingText15 | texttag | No | |
FloatingText16 | texttag | No | |
FloatingText17 | texttag | No | |
FloatingText18 | texttag | No | |
FloatingText19 | texttag | No | |
FloatingText2 | texttag | No | |
FloatingText20 | texttag | No | |
FloatingText21 | texttag | No | |
FloatingText22 | texttag | No | |
FloatingText23 | texttag | No | |
FloatingText24 | texttag | No | |
FloatingText25 | texttag | No | |
FloatingText26 | texttag | No | |
FloatingText27 | texttag | No | |
FloatingText28 | texttag | No | |
FloatingText29 | texttag | No | |
FloatingText3 | texttag | No | |
FloatingText30 | texttag | No | |
FloatingText4 | texttag | No | |
FloatingText5 | texttag | No | |
FloatingText6 | texttag | No | |
FloatingText7 | texttag | No | |
FloatingText8 | texttag | No | |
FloatingText9 | texttag | No | |
FloatingTextVar | texttag | Yes | |
FootSwitch1 | effect | No | |
FootSwitch2 | effect | No | |
FootSwitch3 | effect | No | |
FootSwitch4 | effect | No | |
g | real | No | |
GDD__Integers | integer | Yes | |
GDD__LeftMapGroup | group | No | |
GDD__TriggerArray | trigger | Yes | |
GDD__UnitArray | unit | Yes | |
GDD_Damage | real | No | |
GDD_DamagedUnit | unit | No | |
GDD_DamageSource | unit | No | |
GDD_Event | real | No | |
Gem_Collection | quest | No | |
giant_sea_turtle_lightning | lightning | No | |
giant_turtle | questitem | No | |
Gold_Coins | integer | No | |
Gold_Coins_Quest | quest | No | |
Gold_Coins_Requirement | questitem | No | |
group | group | No | |
Handle_Bel | integer | No | |
Hard | button | No | |
Hashtable | hashtable | No | |
HashTable | hashtable | No | |
Heavy_Rain_1 | weathereffect | No | |
Hematite | questitem | No | |
Hidden_Quest | quest | No | |
Hungry_Quest | quest | No | |
Huzok_Survive | questitem | No | |
Hy1 | effect | No | |
Hy1x | location | No | |
Hy2 | effect | No | |
Hy2x | location | No | |
Hy3 | effect | No | |
Hy3x | location | No | |
Hy4 | effect | No | |
Hy4x | location | No | |
Hy5 | effect | No | |
Hy5x | location | No | |
Hy6 | effect | No | |
Hy6x | location | No | |
hydra | questitem | No | |
i | integer | No | |
Imprisoned_Quest | quest | No | |
Imprisoned_Requirement | questitem | No | |
Incinerate_Effect | effect | No | |
Incinerate_Left | effect | No | |
Incinerate_Right | effect | No | |
Incinerate_Target | unit | No | |
Index | integer | Yes | |
Jade | questitem | No | |
JoGaz_Survive | questitem | No | |
kb | integer | No | |
KB_Angle | real | Yes | |
KB_Dist | real | Yes | |
KB_Max | integer | No | |
KB_MaxDist | real | Yes | |
KB_Speed | real | Yes | |
KB_Unit | unit | Yes | |
Kills | integer | Yes | |
Kills_Leaderboard | leaderboard | No | |
Killz | integer | No | |
KizeLightning | location | No | |
KizeLightning1 | lightning | No | |
KizeLightning2 | lightning | No | |
KizeLightning3 | lightning | No | |
KizeLightning4 | lightning | No | |
KizeMusic | timer | No | |
Kizo_Quest | quest | No | |
Kizo_Requirement_1 | questitem | No | |
Kizo_Requirement_2 | questitem | No | |
Kizo_Special_Effect_1 | effect | No | |
Kizo_Special_Effect_10 | effect | No | |
Kizo_Special_Effect_11 | effect | No | |
Kizo_Special_Effect_12 | effect | No | |
Kizo_Special_Effect_13 | effect | No | |
Kizo_Special_Effect_14 | effect | No | |
Kizo_Special_Effect_15 | effect | No | |
Kizo_Special_Effect_16 | effect | No | |
Kizo_Special_Effect_17 | effect | No | |
Kizo_Special_Effect_18 | effect | No | |
Kizo_Special_Effect_19 | effect | No | |
Kizo_Special_Effect_2 | effect | No | |
Kizo_Special_Effect_20 | effect | No | |
Kizo_Special_Effect_3 | effect | No | |
Kizo_Special_Effect_4 | effect | No | |
Kizo_Special_Effect_5 | effect | No | |
Kizo_Special_Effect_6 | effect | No | |
Kizo_Special_Effect_7 | effect | No | |
Kizo_Special_Effect_8 | effect | No | |
Kizo_Special_Effect_9 | effect | No | |
Kizo_Timer | timer | No | |
Kizo_Timer_Window | timerdialog | No | |
KizoLightning1 | lightning | No | |
KizoLightning2 | lightning | No | |
KizoLightning3 | lightning | No | |
KizoLightning4 | lightning | No | |
KizoLightning5 | lightning | No | |
KizoLightning6 | lightning | No | |
KizoLightning7 | lightning | No | |
KizoLightning8 | lightning | No | |
L | location | No | |
Lapislazuili | questitem | No | |
Leka_Stomp | location | No | |
Lick_Your_Wounds_Caster | unit | No | |
lightning1 | lightning | No | |
lightning2 | lightning | No | |
lightning3 | lightning | No | |
lightningHyiko | lightning | No | |
lightningKaizo | lightning | No | |
lightningLeka | lightning | No | |
Magnetetite | questitem | No | |
mercenary | quest | No | |
mercenary_count | integer | No | |
mercenary_requirement | questitem | No | |
MissleBarrage_Caster | unit | No | |
MissleBarrage_Dummy | unit | No | |
MissleBarrage_Target | unit | No | |
Multi_Shot_Ability_Level | integer | No | |
Multi_Shot_Base_Arrow_Count | integer | No | |
Multi_Shot_Caster | unit | No | |
Multi_Shot_Dummy_Ability | abilcode | No | |
Multi_Shot_Facing | real | No | |
Multi_Shot_Location | location | No | |
Multi_Shot_Location_2 | location | No | |
Multi_Shot_Loop_Location | location | No | |
Multi_Shot_Loop_Location2 | location | No | |
Multi_Shot_Owner | player | No | |
Multi_Shot_Total_Arrow_Count | integer | No | |
Music_Timer | timer | No | |
Normal | button | No | |
OdonEffect | effect | No | |
order | integer | No | |
PlayerColors | string | Yes | |
point | location | No | |
point2 | location | No | |
Points | location | Yes | |
priest | integer | No | |
prison_count | integer | No | |
Prisoner_1 | unit | No | |
Prisoner_2 | unit | No | |
Prisoner_3 | unit | No | |
Prisoner_4 | unit | No | |
Prisoner_5 | unit | No | |
Prowl_Target | unit | No | |
Rain_of_Fire_Left | effect | No | |
Rain_of_Fire_Right | effect | No | |
Rake_Target | unit | No | |
Ravage_Effect | effect | No | |
ravager | integer | No | |
real | real | No | |
real2 | real | No | |
Rend_Target | unit | No | |
Ritual_Drums | questitem | No | |
Ritual_Staff | questitem | No | |
Ritual_Wand | questitem | No | |
RS_Angle | real | Yes | |
RS_Boolean | boolean | Yes | |
RS_Caster | unit | Yes | |
RS_CurDis | real | Yes | |
RS_Damage | real | Yes | |
RS_Index | integer | Yes | |
RS_LevelA | integer | Yes | |
RS_Loc | location | Yes | |
RS_MaxD | real | Yes | |
RS_MaxH | real | Yes | |
RS_Player | player | Yes | |
RS_Real | real | Yes | |
RS_Speed | real | Yes | |
RS_Target | unit | Yes | |
Sail_Away_Quest | quest | No | |
Sail_Away_Requirement | questitem | No | |
Sail_Away_Timer | timer | No | |
Sail_Away_Window | timerdialog | No | |
sea_giant | questitem | No | |
sea_monsters | quest | No | |
Serpent_Ward_count | integer | No | |
SFX | location | No | |
Shake | real | No | |
shaman | integer | No | |
Ships_Leaderboard | leaderboard | No | |
Ships_left | integer | No | 4 |
Skeleton_Army | unit | No | |
Skill_FeralImpact | abilcode | No | |
Spider | questitem | No | |
Spider_Count | integer | No | |
Spider_Problem_Quest | quest | No | |
Target | unit | No | |
Taunt_Huzok_Target | unit | No | |
Taunt_Vetje_Target | unit | No | |
tempGroup | group | No | |
Text_Duration | real | No | |
TextSize_dmg | real | No | |
TextSize_spells | real | No | |
tmpCasterZ | real | No | |
tmpDiffHeight | real | No | |
tmpDistance | real | No | |
tmpHeight | real | No | |
tmpSound | sound | No | |
tmpTargetZ | real | No | |
tmpTime | real | No | |
trollbane | quest | No | |
trollbane_bear | questitem | No | |
trollbane_priest | questitem | No | |
trollbane_ravager | questitem | No | |
trollbane_savage | questitem | No | |
Unit_1 | unit | No | |
Unit_2 | unit | No | |
UnitGroup | group | No | |
Very_Easy | button | No | |
Vetje | unit | No | |
Ward1 | unit | No | |
Ward10 | unit | No | |
Ward2 | unit | No | |
Ward3 | unit | No | |
Ward4 | unit | No | |
Ward5 | unit | No | |
Ward6 | unit | No | |
Ward7 | unit | No | |
Ward8 | unit | No | |
Ward9 | unit | No | |
Wildaxe_Ward_Count | integer | No | |
Wildaxe_Ward_Quest | quest | No | |
Wildaxe_Ward_Quest_Requirement | questitem | No | |
WS_CurrentPoint | integer | No | |
WS_Dummies | integer | No | |
X | integer | No |
// GUI-Friendly Damage Detection -- v1.2.1 -- by Weep
// http:// www.thehelper.net/forums/showthread.php?t=137957
//
// Requires: only this trigger and its variables.
//
// -- What? --
// This snippet provides a leak-free, GUI-friendly implementation of an "any unit takes
// damage" event. It requires no JASS knowledge to use.
//
// It uses the Game - Value Of Real Variable event as its method of activating other
// triggers, and passes the event responses through a few globals.
//
// -- Why? --
// The traditional GUI method of setting up a trigger than runs when any unit is damaged
// leaks trigger events. This snippet is easy to implement and removes the need to do
// you own GUI damage detection setup.
//
// -- How To Implement --
// 0. Before you copy triggers that use GDD into a new map, you need to copy over GDD
// with its GDD Variable Creator trigger, or there will be a problem: the variables
// won't be automatically created correctly.
//
// 1. Be sure "Automatically create unknown variables while pasting trigger data" is
// enabled in the World Editor general preferences.
// 2. Copy this trigger category ("GDD") and paste it into your map.
// (Alternately: create the variables listed in the globals block below, create a
// trigger named "GUI Friendly Damage Detection", and paste in this entire text.)
// 3. Create your damage triggers using Game - Value Of Real Variable as the event,
// select GDD_Event as the variable, and leave the rest of the settings to the default
// "becomes Equal to 0.00".
// The event responses are the following variables:
// GDD_Damage is the amount of damage, replacing Event Response - Damage Taken.
// GDD_DamagedUnit is the damaged unit, replacing Event Response - Triggering Unit.
// Triggering Unit can still be used, if you need to use waits.
// Read the -- Notes -- section below for more info.
// GDD_DamageSource is the damaging unit, replacing Event Response - Damage Source.
//
// -- Notes --
// GDD's event response variables are not wait-safe; you can't use them after a wait in
// a trigger. If you need to use waits, Triggering Unit (a.k.a. GetTriggerUnit()) can
// be used in place of GDD_DamageSource. There is no usable wait-safe equivalent to
// Event Damage or Damage Source; you'll need to save the values yourself.
//
// Don't write any values to the variables used as the event responses, or it will mess
// up any other triggers using this snippet for their triggering. Only use their values.
//
// This uses arrays, so can detect damage for a maximum of 8190 units at a time, and
// cleans up data at a rate of 33.33 per second, by default. This should be enough for
// most maps, but if you want to change the rate, change the value returned in the
// GDD_RecycleRate function at the top of the code, below.
//
// By default, GDD will not register units that have Locust at the moment of their
// entering the game, and will not recognize when they take damage (which can only
// happen if the Locust ability is later removed from the unit.) To allow a unit to have
// Locust yet still cause GDD damage events if Locust is removed, you can either design
// the unit to not have Locust by default and add it via triggers after creation, or
// edit the GDD_Filter function at the top of the code, below.
//
// -- Credits --
// Captain Griffin on wc3c.net for the research and concept of GroupRefresh.
//
// Credit in your map not needed, but please include this README.
//
// -- Version History --
// 1.2.1: Minor code cleaning. Added configuration functions. Updated documentation.
// 1.2.0: Made this snippet work properly with recursive damage.
// 1.1.1: Added a check in order to not index units with the Locust ability (dummy units).
// If you wish to check for damage taken by a unit that is unselectable, do not
// give the unit-type Locust in the object editor; instead, add the Locust ability
// 'Aloc' via a trigger after its creation, then remove it.
// 1.1.0: Added a check in case a unit gets moved out of the map and back.
// 1.0.0: First release.
//===================================================================
// Configurables.
function GDD_RecycleRate takes nothing returns real //The rate at which the system checks units to see if they've been removed from the game
return 0.03
endfunction
function GDD_Filter takes unit u returns boolean //The condition a unit has to pass to have it registered for damage detection
return GetUnitAbilityLevel(u, 'Aloc') == 0 //By default, the system ignores Locust units, because they normally can't take damage anyway
endfunction
//===================================================================
// This is just for reference.
// If you use JassHelper, you could uncomment this section instead of creating the variables in the trigger editor.
// globals
// real udg_GDD_Event = 0.
// real udg_GDD_Damage = 0.
// unit udg_GDD_DamagedUnit
// unit udg_GDD_DamageSource
// trigger array udg_GDD__TriggerArray
// integer array udg_GDD__Integers
// unit array udg_GDD__UnitArray
// group udg_GDD__LeftMapGroup = CreateGroup()
// endglobals
//===================================================================
// System code follows. Don't touch!
function GDD_Event takes nothing returns boolean
local unit damagedcache = udg_GDD_DamagedUnit
local unit damagingcache = udg_GDD_DamageSource
local real damagecache = udg_GDD_Damage
set udg_GDD_DamagedUnit = GetTriggerUnit()
set udg_GDD_DamageSource = GetEventDamageSource()
set udg_GDD_Damage = GetEventDamage()
set udg_GDD_Event = 1.
set udg_GDD_Event = 0.
set udg_GDD_DamagedUnit = damagedcache
set udg_GDD_DamageSource = damagingcache
set udg_GDD_Damage = damagecache
set damagedcache = null
set damagingcache = null
return false
endfunction
function GDD_AddDetection takes nothing returns boolean
// if(udg_GDD__Integers[0] > 8190) then
// call BJDebugMsg("GDD: Too many damage events! Decrease number of units present in the map or increase recycle rate.")
// ***Recycle rate is specified in the GDD_RecycleRate function at the top of the code. Smaller is faster.***
// return
// endif
if(IsUnitInGroup(GetFilterUnit(), udg_GDD__LeftMapGroup)) then
call GroupRemoveUnit(udg_GDD__LeftMapGroup, GetFilterUnit())
elseif(GDD_Filter(GetFilterUnit())) then
set udg_GDD__Integers[0] = udg_GDD__Integers[0]+1
set udg_GDD__UnitArray[udg_GDD__Integers[0]] = GetFilterUnit()
set udg_GDD__TriggerArray[udg_GDD__Integers[0]] = CreateTrigger()
call TriggerRegisterUnitEvent(udg_GDD__TriggerArray[udg_GDD__Integers[0]], udg_GDD__UnitArray[udg_GDD__Integers[0]], EVENT_UNIT_DAMAGED)
call TriggerAddCondition(udg_GDD__TriggerArray[udg_GDD__Integers[0]], Condition(function GDD_Event))
endif
return false
endfunction
function GDD_PreplacedDetection takes nothing returns nothing
local group g = CreateGroup()
local integer i = 0
loop
call GroupEnumUnitsOfPlayer(g, Player(i), Condition(function GDD_AddDetection))
set i = i+1
exitwhen i == bj_MAX_PLAYER_SLOTS
endloop
call DestroyGroup(g)
set g = null
endfunction
function GDD_GroupRefresh takes nothing returns nothing
// Based on GroupRefresh by Captain Griffen on wc3c.net
if (bj_slotControlUsed[5063] == true) then
call GroupClear(udg_GDD__LeftMapGroup)
set bj_slotControlUsed[5063] = false
endif
call GroupAddUnit(udg_GDD__LeftMapGroup, GetEnumUnit())
endfunction
function GDD_Recycle takes nothing returns nothing
if(udg_GDD__Integers[0] <= 0) then
return
elseif(udg_GDD__Integers[1] <= 0) then
set udg_GDD__Integers[1] = udg_GDD__Integers[0]
endif
if(GetUnitTypeId(udg_GDD__UnitArray[udg_GDD__Integers[1]]) == 0) then
call DestroyTrigger(udg_GDD__TriggerArray[udg_GDD__Integers[1]])
set udg_GDD__TriggerArray[udg_GDD__Integers[1]] = null
set udg_GDD__TriggerArray[udg_GDD__Integers[1]] = udg_GDD__TriggerArray[udg_GDD__Integers[0]]
set udg_GDD__UnitArray[udg_GDD__Integers[1]] = udg_GDD__UnitArray[udg_GDD__Integers[0]]
set udg_GDD__UnitArray[udg_GDD__Integers[0]] = null
set udg_GDD__Integers[0] = udg_GDD__Integers[0]-1
endif
set udg_GDD__Integers[1] = udg_GDD__Integers[1]-1
endfunction
function GDD_LeaveMap takes nothing returns boolean
local boolean cached = bj_slotControlUsed[5063]
if(udg_GDD__Integers[2] < 64) then
set udg_GDD__Integers[2] = udg_GDD__Integers[2]+1
else
set bj_slotControlUsed[5063] = true
call ForGroup(udg_GDD__LeftMapGroup, function GDD_GroupRefresh)
set udg_GDD__Integers[2] = 0
endif
call GroupAddUnit(udg_GDD__LeftMapGroup, GetFilterUnit())
set bj_slotControlUsed[5063] = cached
return false
endfunction
// ===========================================================================
function InitTrig_GUI_Friendly_Damage_Detection_1 takes nothing returns nothing
local region r = CreateRegion()
call RegionAddRect(r, GetWorldBounds())
call TriggerRegisterEnterRegion(CreateTrigger(), r, Condition(function GDD_AddDetection))
call TriggerRegisterLeaveRegion(CreateTrigger(), r, Condition(function GDD_LeaveMap))
call GDD_PreplacedDetection()
call TimerStart(CreateTimer(), GDD_RecycleRate(), true, function GDD_Recycle)
set r = null
endfunction