Name | Type | is_array | initial_value |
AI_CrusadePoint | location | Yes | |
AI_DeathStreakInteger | integer | No | |
AI_DeathStreakPlayer | player | No | |
AI_DeathStreakPlayerActive | boolean | No | |
AI_KillStreakChance | integer | No | |
AI_KillStreakPlayer | player | No | |
AI_SKILLFUL_BEASTMASTER_REAL | real | No | |
AI_SKILLFUL_BeastMaster_TARGET | unit | No | |
AI_SKILLFUL_BEASTMASTER_UG | group | No | |
AI_SKILLFUL_HERO_ULTYBIAS | integer | No | |
AI_SKILLFUL_HEROD_DICE | integer | No | |
AI_SKILLFUL_HEROD_PERCENTAGE | real | No | |
AI_SKILLFUL_HEROD_POINT | location | No | |
AI_SKILLFUL_HEROD_TARGET | unit | No | |
AI_SKILLFUL_HEROD_TARGETPOINT | location | No | |
AI_SKILLFUL_HEROD_UG | group | No | |
AI_SKILLFULL_BEASTMASTER_POINT | location | No | |
AI_SkillfulRexxar_Dice | integer | No | |
AI_Temp_Point | location | No | |
AI_Temp_Point3 | location | Yes | |
AI_Temp_Point4 | location | Yes | |
AI_Temp_Point_Attacked | location | Yes | |
AI_Temp_Point_Attacking | location | Yes | |
AI_Temp_UG | group | No | |
AI_Temp_UG2 | group | No | |
AI_Temp_Unit | unit | No | |
AI_TempPlayer | player | No | |
AI_TempUG_Reaction | group | Yes | |
AI_TempUG_Summoned | group | Yes | |
AI_TempUGSkill | group | Yes | |
AiAttackReaction | boolean | No | |
Aiattackreactionrandom | integer | No | |
AibuildRandom | integer | No | |
AiConditionSkillINT | integer | No | |
AIDice | integer | Yes | |
Aiherodice | integer | No | |
Aiheroorder | integer | No | |
AiHeroPickerLoopaction | integer | No | |
AIItemRandom | integer | No | |
AIItemUsePT | location | Yes | |
AIPlayerGroupCheck | force | No | |
AiRandomOrderBuild | integer | Yes | |
AiReactionAttacked | boolean | No | |
Aiskillactionrandom | integer | No | |
Aiskillactionrandom2 | integer | No | |
Aiskilldice | integer | No | |
AiSkillupone | timer | No | |
AkinosFireCount | integer | No | |
AkinosFireDistance | integer | No | |
AkinosFirePoint | location | No | |
AkinosFireType | unitcode | Yes | |
AkinosHero | unit | No | |
AkinosPasRnd | integer | No | |
AkinosPasTim | timer | No | |
AllRand_Endloop | integer | No | |
AllRand_Iterator | integer | No | |
AllrandomTimer | timer | No | |
ApocSoundEff | sound | No | |
Arcane_Archer_ArcaneBarrage_Ti | timer | No | |
Arcane_Archer_Velocity_Timer | timer | No | |
Arcane_Archer_VelocityPoint | location | No | |
ArchonHeroTimer | timer | No | |
ArchonReaveDissipate | location | No | |
AvatarofShadows | boolean | No | |
BeastSoundBool | boolean | Yes | |
BloodOathLifeCaster | real | No | |
BloodOathLifeTarget | real | No | |
BloodOathLightning_CB | lightning | No | |
BloodOathTg_CB | unit | No | |
Bool_HeroGlow | boolean | Yes | |
Boolean_ChaosStorm | boolean | No | |
BoulderDamage | real | No | |
CB_cDTimer | timer | No | |
CB_Chaos_Limit | integer | No | |
CB_mayhemDist | integer | No | |
CB_mayhemint | integer | No | |
CB_OathBoolean | boolean | No | |
CB_Oathtimer | timer | No | |
CBMayhemPoint | location | No | |
ChaosDamagePoint | location | No | |
ChaosGroup_Kork | group | No | |
ChaosHero | unit | No | |
ChaosLight1 | location | No | |
ChaosLight2 | location | No | |
ChaosPlayers | force | No | |
ChaosSoundBool | boolean | Yes | |
ChaosStormAfterimagePoint_CB | location | No | |
ChaosStormCountdown | timer | No | |
ChaosStormcounter_CB | integer | No | |
ChaosStormInt | integer | No | |
ChaosStormTarget_CB | unit | No | |
ChaosTimer_Kork | timer | No | |
CleanedItem | item | Yes | |
Combine_Charged_Items | boolean | No | true |
Combine_Charges_Max | integer | No | |
COOLDOWNS_HEROD | boolean | Yes | |
CreepBoss | unit | No | |
CreepBoss_BannerUG | group | No | |
CreepBoss_BannerUnit | unit | No | |
CreepBoss_Challenge | boolean | No | |
CreepBoss_ChallengePoint | location | No | |
CreepBoss_Degrees | integer | No | |
CreepBoss_Loop | integer | No | |
CreepBoss_Players | force | No | |
CreepBoss_SpecialInt | integer | No | |
CreepBoss_TemporalAnomolyEFF | effect | No | |
CreepBoss_TemporalPoint2 | location | No | |
CreepBoss_TemporalReal | real | No | |
CreepBoss_TemporalTimer | timer | Yes | |
CreepBoss_TemporalUG | group | No | |
CreepBoss_TempPoint | location | No | |
CreepBoss_TempPoint2 | location | No | |
CreepBoss_TempUG | group | No | |
CreepBosses | unitcode | Yes | |
CreepBossSpawnPt | location | No | |
CreepInteger | integer | No | |
CreepLevel | integer | No | |
CreepMiniGameTypes | unitcode | Yes | |
CreepPodTypes | unitcode | Yes | |
CreepPoint | location | No | |
CreepPoint2 | location | No | |
CreepPointAtk | location | No | |
CreepPointAtked | location | No | |
CreepPointMini | location | No | |
CreepPointMiniD | location | No | |
CreepRandoChance | integer | No | |
CreepsUG | group | No | |
DeadeyeHero | unit | No | |
DeadEyeSoundBool | boolean | Yes | |
Death_Streak_Timer | timer | No | |
DeathFinder | integer | No | |
DeathFinderString | string | Yes | |
DeathStreak_MeteorActive | boolean | No | |
DeathStreak_Trigger | boolean | Yes | |
DeathStreakMerchant | unit | No | |
DECurseOffset | location | No | |
DEFloatFrenzTRUE | boolean | No | |
DEFloatPos | location | No | |
DEFloatTXTFR | texttag | No | |
DEFogOffset | location | No | |
DEFogpoint | location | No | |
DEFogpoint2 | location | No | |
DEFogSpecEFF | effect | No | |
DEfogTIMER | timer | No | |
DEFogWeather | weathereffect | No | |
DEFrenzyCOUNT | integer | No | |
DEfrenzyTARGET | unit | No | |
DEfrenzyTIME | timer | No | |
DEgCurseDIST | integer | No | |
DEgCurseINT | integer | No | |
DEgCurseINT2 | integer | No | |
DEgCurseTimer | timer | No | |
DEGhostly | boolean | No | |
DEgraveCurseGroup | group | No | |
DEGraveCursePoint | location | No | |
DEgravetypes | unitcode | Yes | |
DemonessBlindAbility | abilcode | No | |
DemonessHero | unit | No | |
DemonessHero_UnitGroup | group | No | |
DemonessHero_UnitGroup2 | group | No | |
DemonessHero_UnitGroup3 | group | No | |
DemonessHero_UnitGroup4 | group | No | |
DemonessHeroPoint | location | No | |
DemonessHeroPoint2 | location | No | |
DERegion | rect | No | |
DestroyTrigger | trigger | No | |
DEYB_BoolUnitAlive | boolean | No | |
DEYBBOOLEAN | boolean | No | |
DEYBINT | integer | No | |
DEYBmissle | unit | No | |
DEYBTarget | unit | No | |
DEYTargetPoint | location | No | |
DEYTargetPoint2 | location | No | |
DisableHeroUnitGroup | group | No | |
DragonGuardSoundsBool | boolean | Yes | |
DragonSounds | sound | Yes | |
Dusk_AvatarTime | timer | No | |
Dusk_Lime_bool | boolean | No | |
Dusk_lime_life | real | Yes | |
Dusk_Lime_Target | unit | No | |
Dusk_Lime_Timer | timer | No | |
Dusk_OverShadow | group | No | |
Dusk_Shadowcount | integer | No | |
Dusk_ShadowSplitint | integer | No | |
DuskHero | unit | No | |
DyingUE_Temp_Point | location | No | |
DyingUE_Temp_UG | group | No | |
EnteringUA_Temp_Point | location | Yes | |
FOA_GoldUG | group | No | |
FOA_TempPoint | location | No | |
FOA_Unit | unit | No | |
FogMonsterUnit | unit | No | |
FogVictimCount | integer | No | |
Furion_BOT_INT | integer | No | |
Furion_BOT_point | location | No | |
Furion_BOT_Timer | timer | No | |
Furion_BOTDeg | integer | No | |
Furion_CDTimer | timer | No | |
Furion_SpellBool | boolean | No | |
Furion_treeRand | integer | Yes | |
Furion_Wisp | unit | No | |
Furion_XtraSpells | abilcode | Yes | |
FurionBOTOffset | location | No | |
FurionHero | unit | No | |
FurionSoundBool | boolean | Yes | |
FurionTempPoint | location | No | |
GAME_MODE_BOOL_DECIDED | boolean | Yes | |
Game_Winner | player | No | |
GameAutoTimer | timer | No | |
GameModes | boolean | Yes | true |
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 | |
GenericWarningInteger | integer | No | |
GlobalWeather | weathereffect | Yes | |
GlobalWeatherCheck | integer | Yes | |
GlobalWeatherInt | integer | No | |
GoldIncomeMiniGame | boolean | No | |
Hero_Akin_Fire_Point | location | No | |
Hero_Akin_Temp_Point | location | No | |
Hero_Arcane_Archer | unit | No | |
Hero_Archon_Temp_Point | location | No | |
Hero_Archon_Temp_Point2 | location | No | |
Hero_Archon_Temp_Point3 | location | No | |
Hero_Archon_Temp_UG | group | No | |
Hero_Archon_Temp_UG2 | group | No | |
Hero_Archon_Temp_UG3 | group | No | |
Hero_Beast_Temp_Point | location | No | |
Hero_Beast_Temp_Point2 | location | No | |
Hero_Beast_Temp_UG | group | No | |
Hero_Bretheren_Poin2 | location | No | |
Hero_Bretheren_Poin3 | location | No | |
Hero_Bretheren_Point | location | No | |
Hero_Bretheren_UG | group | No | |
Hero_Bretheren_UG2 | group | No | |
Hero_Bretheren_UG3 | group | No | |
Hero_CB_Temp_Point | location | No | |
Hero_CB_Temp_Point2 | location | No | |
Hero_CB_Temp_Point3 | location | No | |
Hero_CB_Temp_Point4 | location | No | |
Hero_CB_Temp_Point5 | location | No | |
Hero_CB_Temp_UG | group | No | |
Hero_Dead_Temp_Point | location | No | |
Hero_Dead_Temp_UG | group | No | |
Hero_Dusk_Temp_Point | location | No | |
Hero_Dusk_Temp_Point2 | location | No | |
Hero_Dusk_Temp_Point3 | location | No | |
Hero_Dusk_Temp_Point4 | location | No | |
Hero_Dusk_Temp_Point5 | location | No | |
Hero_Dusk_Temp_Point6 | location | No | |
Hero_Dusk_Temp_UG | group | No | |
Hero_Dusk_Temp_UG2 | group | No | |
Hero_Dusk_Temp_UG3 | group | No | |
Hero_Furion_Temp_Point | location | No | |
Hero_Furion_Temp_UG | group | No | |
Hero_Furion_Temp_UG2 | group | No | |
Hero_Gen_Temp_Point | location | No | |
Hero_Gen_Temp_UG | group | No | |
Hero_Herod_Temp_Point | location | No | |
Hero_Herod_Temp_UG | group | No | |
Hero_Jaina_Pull_1 | location | No | |
Hero_Jaina_Pull_2 | location | No | |
Hero_Jaina_Temp_Point | location | No | |
Hero_Jaina_Temp_Point2 | location | No | |
Hero_Jaina_Temp_Point3 | location | No | |
Hero_Jaina_Temp_Point4 | location | No | |
Hero_Jaina_Temp_Point5 | location | No | |
Hero_Jaina_Temp_Point6 | location | No | |
Hero_Jaina_Temp_Point7 | location | No | |
Hero_Jaina_Temp_UG | group | No | |
Hero_Jaina_Temp_UG2 | group | No | |
Hero_Jaina_Temp_UG3 | group | No | |
Hero_Naga_Temp_Point | location | No | |
Hero_Naga_Temp_Point2 | location | No | |
Hero_Naga_Temp_Point3 | location | No | |
Hero_Naga_Temp_Point4 | location | No | |
Hero_Naga_Temp_Point5 | location | No | |
Hero_Naga_Temp_UG | group | No | |
Hero_Naga_Temp_UG2 | group | No | |
Hero_Raz_Temp_Point | location | No | |
Hero_Raz_Temp_Point2 | location | No | |
Hero_Raz_Temp_UG | group | No | |
Hero_Shaman_Temp_Point | location | No | |
Hero_Shaman_Temp_Point2 | location | No | |
Hero_Shaman_Temp_UG | group | No | |
Hero_Sunder_Temp_Point2 | location | No | |
HeroAttachement | effect | Yes | |
HeroBretheren_UnitAbility | abilcode | No | |
Herod_ChargeTempPoint | location | No | |
HerodCastPoint | location | No | |
HerodChargePoint | location | No | |
HerodChargeTime | timer | No | |
HerodFacing | integer | No | |
HerodHero | unit | No | |
HerodMGTimer | timer | No | |
HerodRandomRek | integer | No | |
HerodReckoningCount | integer | No | |
HerodReckTimer1 | timer | No | |
HerodSounds | sound | Yes | |
HerodSoundsBool | boolean | Yes | |
HerodWeaponEff | effect | No | |
HeroGlow | effect | Yes | |
HeroPickerCounter | integer | No | |
HeroRandoming | integer | No | |
HeroTypes | unitcode | Yes | |
InitialRandom | integer | No | |
Item_Temp_Point | location | Yes | |
Item_Temp_UG | group | Yes | |
ItemCleanupFlag | boolean | No | |
ItemCleanupTimer | timer | No | |
ItemHitChance_Int | integer | No | |
Items_Rand_Chance | integer | No | |
ItemsToClean | integer | No | |
itemTempPointNoArray | location | No | |
JainaEnRuneCreate | integer | No | |
JainaEnRuneDeg | integer | No | |
JainaEnRunePoint | location | No | |
JainaEnRunePoint2 | location | No | |
JainaEnRuneVars | unitcode | Yes | |
JainaGruneCaster | unit | No | |
JainaGruneCastPoint | location | No | |
JainaGruneInt | integer | No | |
JainaGruneLight | lightning | No | |
JainaGrunePoint | location | No | |
JainaGruneTarget | unit | No | |
JainaGruneTime | timer | No | |
JainaGruneUsed | boolean | No | |
JainaHero | unit | No | |
JainaLightning1 | location | No | |
JainaLightning2 | location | No | |
JainaWhimRunePoint | location | No | |
KillFinder | integer | No | |
KillFinderString | string | Yes | |
KillsMultiboard | multiboard | No | |
KillStreak_Rand | integer | No | |
KillStreakAttackersChance | integer | No | |
KillStreakMerchant | unit | No | |
KillTotal | integer | No | |
Limbo_Point | location | No | |
Limbo_Point2 | location | No | |
Limbo_UG | group | No | |
Loop | integervar | No | |
MaximumRandomHero | integer | No | |
MESSAGE_TempPlayerGroup | force | No | |
MiniGameCreepRand | integer | No | |
MiniGameTempPos | location | No | |
MiniGameUG | group | No | |
MiniGameUG2 | group | No | |
MyItemCleanUp | boolean | No | |
Naga_Petrifygroup | group | No | |
Naga_PetrifyTimer | timer | No | |
Naga_SSgroup | group | No | |
Naga_SSpoint | location | No | |
Naga_SureShldINT2 | integer | No | |
Naga_SurgeIntTotal | integer | No | |
Naga_SurgeShldINT | integer | No | |
Naga_SurgeTimer | timer | No | |
NagaHero | unit | No | |
NagaSerpentGuardiansDegrees | real | No | |
NagaTideOffset | location | No | |
Nothing | timer | No | |
PheonixTempPoint | location | No | |
PICKED_TENACIOUSDEFENDER | boolean | No | |
PickedHeroNames | string | Yes | |
PickedHeroTypes | unitcode | Yes | |
PickMode | boolean | Yes | |
PlayerDeathCount | integer | Yes | |
PlayerIndex_ForTriggers | integer | No | |
PlayerKillcount | integer | Yes | |
PlayerKillStreakTotal | integer | Yes | |
PlayersPicked | force | No | |
PlayersPlaying | force | No | |
Rax_Xeth_Speceff | effect | No | |
Raz_DealingGroup | group | No | |
Raz_POD_Beamer | unit | No | |
Raz_POD_DEG | real | No | |
Raz_POD_direction | boolean | No | |
Raz_POD_DIST | real | No | |
Raz_POD_endpoint | location | No | |
Raz_POD_Focus | unit | No | |
Raz_Pod_Lightning | lightning | No | |
Raz_POD_Obelisk | unit | No | |
Raz_POD_Origin | location | No | |
Raz_POD_Rand | integer | No | |
Raz_POD_Temp_Point | location | No | |
Raz_POD_Temp_Point2 | location | No | |
Raz_POD_Timer | timer | No | |
Raz_Xeth_Temp_Point | location | No | |
Raz_XethCaster | unit | No | |
Raz_XethTarget | unit | No | |
RazelHero | unit | No | |
RAZLightningPoint2 | location | No | |
RAZLightningPos1 | location | No | |
RazSoundBool | boolean | Yes | |
REGION_BATTLEAREA | rect | No | |
REGION_PlayableMapArea | rect | No | RectNull |
REGION_VOTINGAREA | rect | No | |
REGION_WeatherAREA | rect | No | |
REGION_WHOLEGAMEMODEAREA | rect | No | |
RexxarBearEffect | effect | No | |
Rexxarbearout | boolean | No | |
RexxarCompATKTime | timer | No | |
RexxarHero | unit | No | |
Rexxarsbear | unit | No | |
RexxarSlowint | integer | No | |
RexxarSnareGroup | group | No | |
RexxarSounds | sound | Yes | |
RexxarsTarget_AI | group | No | |
RM_whimsicalRuneTimer | timer | No | |
RMarcherGroup | group | No | |
RMKnightGrowth | real | No | |
RMKnightNexus | unit | No | |
RMKnightPoint | location | No | |
RMKruneACTIVE | boolean | No | |
RMKruneDistance | integer | No | |
RMKruneINT | integer | No | |
RMKruneTimerEND | timer | No | |
RMKruneTimerINT | timer | No | |
RMPolymorphint | integer | No | |
RMSoundsBool | boolean | Yes | |
RuneRandomInt | integer | No | |
RuneSpawnTempPoin2 | location | Yes | |
RuneSpawnTempPoint | location | No | |
RuneTypes | unitcode | Yes | |
SeaWitchSoundsBool | boolean | Yes | |
ShadowMSoundBool | boolean | Yes | |
ShamanHero | unit | No | |
ShamanSoundBool | boolean | Yes | |
SKILLSLEARNED_HEROD | boolean | Yes | |
SM_CastShadowInt | integer | No | |
SM_HeroTimer | timer | No | |
SMBloodlustGroup | group | No | |
SMearthTotemUnit | unit | No | |
SMFirEleUNIT | unit | No | |
SMFirePoin2 | location | No | |
SMFirePoint | location | No | |
SMFirePointOffset | location | No | |
SMFireTotemUNIT | unit | No | |
SMintJolt | integer | No | |
SMshadowrand | integer | No | |
snapFrozenUnit | unit | No | |
soundApoc | sound | No | |
soundWeatherEff | sound | No | |
SPECIALEFFECT_BOSSEFFECT | effect | No | |
Streak_ApocalypsePlayer | player | No | |
Streak_Count | integer | Yes | |
Streak_Death_Buyer | unit | No | |
Streak_Death_Temp_point | location | No | |
Streak_Death_Temp_UG | group | No | |
Streak_Death_Temp_UG2 | group | No | |
Streak_K_D | boolean | Yes | true |
Streak_Kill_Temp_Point | location | No | |
Streak_Kill_Temp_UG | group | No | |
Streak_Kill_Temp_UG2 | group | No | |
Streak_MeteorPlayer | player | No | |
StreakTempUG | group | No | |
SunderhoofHero | unit | No | |
TaurenSoundsBool | boolean | Yes | |
TC_BoulderPoint | location | No | |
TCBoulderGroup | group | No | |
TCchargeTARGET | unit | No | |
TCquakeINT | integer | No | |
TDChargeDistance | integer | No | |
Temp_Point | location | No | |
Temp_Point2 | location | No | |
Temp_UG | group | No | |
Temp_UG2 | group | No | |
TempRegion | rect | No | |
Timer_AllPickAFK | timer | No | |
TIMER_HERODSKILLS | timer | Yes | |
TrapAndEventPoint | location | No | |
TrapAndEventPoint2 | location | No | |
TrapsAndEventsInt | integer | No | |
Tristany_Distance | integer | No | |
Tristany_EnCount | integer | No | |
Tristany_Engroup | group | No | |
Tristany_EnPoint | location | No | |
Tristany_EnPTarget | unit | No | |
Tristany_FaceDeg | integer | No | |
Tristany_OP_Timer | timer | No | |
Tristany_OPspecEFF | effect | Yes | |
Tristany_Spark_Center | unit | No | |
Tristany_Spark_Deg | real | No | |
Tristany_SparkCount | integer | No | |
Tristany_SparkPoint | location | No | |
Tristany_TE_point | location | No | |
Tristany_TE_terrain | terraindeformation | No | |
Tristany_TE_Time | timer | No | |
TristanyGroup | group | No | |
TristanyHero | unit | No | |
UserPlayers | force | No | |
VotesMultiboard | multiboard | No | |
VotesOptA | integer | No | |
VotesOptB | integer | No | |
VotesOptC | integer | No | |
VotingChicken | unit | No | |
Weather_Temp_Point | location | No | |
Weather_Temp_UG | group | No | |
Weather_Temp_UG_2 | group | No | |
Weather_Temp_UG_3 | group | No | |
Weather_Temp_Unit | unit | No | |
WeatherTimer | timer | No | |
YieldBreaking | boolean | No | |
zChaosSounds | sound | Yes | |
zDeadEyeSounds | sound | Yes | |
zFurionSounds | sound | Yes | |
zRazelSound | sound | Yes | |
zRuneMageSounds | sound | Yes | |
zSeaWitchSounds | sound | Yes | |
zShadowBaeSounds | sound | Yes | |
zShamanSounds | sound | Yes | |
zTaurenSounds | sound | Yes |
// 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 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
function Trig_Combine_Items_Conditions takes nothing returns boolean
if ( not ( GetItemCharges(GetManipulatedItem()) > 0 ) ) then
return false
endif
if ( not ( udg_Combine_Charged_Items == true ) ) then
return false
endif
return true
endfunction
function Trig_Combine_Items_Actions takes nothing returns nothing
local integer ITEMCOUNT
local integer ITEMLOOP
local integer CHARGES
local integer MAXIMUM
local item NEWITEM
local unit OURUNIT
set MAXIMUM = udg_Combine_Charges_Max
set ITEMCOUNT = 0
set ITEMLOOP = 0
set CHARGES = 0
set NEWITEM = GetManipulatedItem()
set OURUNIT = GetManipulatingUnit()
loop
exitwhen ITEMLOOP > 6
if ((GetItemTypeId(NEWITEM)) == (GetItemTypeId(UnitItemInSlotBJ(OURUNIT, ITEMLOOP)))) then
if ((GetItemCharges(UnitItemInSlotBJ(OURUNIT, ITEMLOOP)) + GetItemCharges(NEWITEM)) <= MAXIMUM) then
if not ( (UnitItemInSlotBJ(OURUNIT, ITEMLOOP)) == (NEWITEM)) then
set CHARGES = (GetItemCharges(UnitItemInSlotBJ(OURUNIT, ITEMLOOP))) + GetItemCharges(NEWITEM)
call SetItemCharges( UnitItemInSlotBJ(OURUNIT, ITEMLOOP), CHARGES )
call RemoveItem( NEWITEM )
set ITEMLOOP=7
endif
endif
endif
if ( ITEMLOOP < 7 ) then
set ITEMLOOP = ITEMLOOP + 1
endif
endloop
endfunction
//===========================================================================
function InitTrig_Combine_Charged_Items takes nothing returns nothing
set gg_trg_Combine_Charged_Items = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Combine_Charged_Items, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Combine_Charged_Items, Condition( function Trig_Combine_Items_Conditions ) )
call TriggerAddAction( gg_trg_Combine_Charged_Items, function Trig_Combine_Items_Actions )
endfunction