Name | Type | is_array | initial_value |
AllianceBounty | boolean | Yes | false |
AllianceCount | integer | No | 15 |
AllianceGuardRespawn | boolean | No | false |
AlliancePlayers | force | No | |
AmbushBarrens1 | boolean | No | false |
AmbushBarrens10 | boolean | No | false |
AmbushBarrens11 | boolean | No | false |
AmbushBarrens12 | boolean | No | false |
AmbushBarrens13 | boolean | No | false |
AmbushBarrens14 | boolean | No | false |
AmbushBarrens15 | boolean | No | false |
AmbushBarrens16 | boolean | No | false |
AmbushBarrens17 | boolean | No | false |
AmbushBarrens18 | boolean | No | false |
AmbushBarrens19 | boolean | No | false |
AmbushBarrens2 | boolean | No | false |
AmbushBarrens3 | boolean | No | false |
AmbushBarrens4 | boolean | No | false |
AmbushBarrens5 | boolean | No | false |
AmbushBarrens6 | boolean | No | false |
AmbushBarrens7 | boolean | No | false |
AmbushBarrens8 | boolean | No | false |
AmbushBarrens9 | boolean | No | false |
AmbushBlastedLands1 | boolean | No | false |
AmbushBlastedLands10 | boolean | No | false |
AmbushBlastedLands11 | boolean | No | false |
AmbushBlastedLands2 | boolean | No | false |
AmbushBlastedLands3 | boolean | No | false |
AmbushBlastedLands4 | boolean | No | false |
AmbushBlastedLands5 | boolean | No | false |
AmbushBlastedLands6 | boolean | No | false |
AmbushBlastedLands7 | boolean | No | false |
AmbushBlastedLands8 | boolean | No | false |
AmbushBlastedLands9 | boolean | No | false |
AmbushDeepForest1 | boolean | No | false |
AmbushDeepForest10 | boolean | No | false |
AmbushDeepForest2 | boolean | No | false |
AmbushDeepForest3 | boolean | No | false |
AmbushDeepForest4 | boolean | No | false |
AmbushDeepForest5 | boolean | No | false |
AmbushDeepForest6 | boolean | No | false |
AmbushDeepForest7 | boolean | No | false |
AmbushDeepForest8 | boolean | No | false |
AmbushDeepForest9 | boolean | No | false |
AmbushPlains1 | boolean | No | false |
AmbushPlains10 | boolean | No | false |
AmbushPlains11 | boolean | No | false |
AmbushPlains12 | boolean | No | false |
AmbushPlains13 | boolean | No | false |
AmbushPlains14 | boolean | No | false |
AmbushPlains15 | boolean | No | false |
AmbushPlains16 | boolean | No | false |
AmbushPlains17 | boolean | No | false |
AmbushPlains18 | boolean | No | false |
AmbushPlains19 | boolean | No | false |
AmbushPlains2 | boolean | No | false |
AmbushPlains3 | boolean | No | false |
AmbushPlains4 | boolean | No | false |
AmbushPlains5 | boolean | No | false |
AmbushPlains6 | boolean | No | false |
AmbushPlains7 | boolean | No | false |
AmbushPlains8 | boolean | No | false |
AmbushPlains9 | boolean | No | false |
AmbushRiver1 | boolean | No | false |
AmbushRiver2 | boolean | No | false |
AmbushRiver3 | boolean | No | false |
AmbushRockyForest1 | boolean | No | false |
AmbushRockyForest2 | boolean | No | false |
AmbushRockyForest3 | boolean | No | false |
AmbushRockyForest4 | boolean | No | false |
AmbushRockyForest5 | boolean | No | false |
AmbushRockyForest6 | boolean | No | false |
AmbushRockyForest7 | boolean | No | false |
AmbushRockyForest8 | boolean | No | false |
AmbushRockyForest9 | boolean | No | false |
AntiSpam | boolean | Yes | true |
CAcceleration | real | Yes | |
CAccelerationRate | real | No | |
CAngle | real | Yes | |
CAnimSpeed | real | Yes | |
CannibalizeUnits | group | No | |
CArray | integer | No | |
CastleDestroyed | boolean | No | false |
CCaster | unit | Yes | |
CCasterCheck | unit | No | |
CCasterPos | location | No | |
CCasterPosCheck | location | No | |
CDamage | real | Yes | |
CDistance | real | Yes | |
CEndOfCharge | boolean | Yes | |
CentralAllianceWarning1 | boolean | No | false |
CentralAllianceWarning2 | boolean | No | false |
CentralAllianceWarning3 | boolean | No | false |
CentralAllianceWarning4 | boolean | No | false |
CentralHordeWarning1 | boolean | No | false |
CentralHordeWarning2 | boolean | No | false |
CentralHordeWarning3 | boolean | No | false |
CentralHordeWarning4 | boolean | No | false |
ChangedSides | boolean | Yes | false |
CleanedItem | item | Yes | |
CLoop | integervar | No | |
CMana | real | Yes | |
CMovePoint | location | No | |
CPlayaGroup | force | Yes | |
CPlayaGroupCheck | force | No | |
CTarget | unit | Yes | |
CTargetCheck | unit | No | |
CTargetPos | location | No | |
CTargetPosCheck | location | No | |
CWait | real | Yes | |
DG_Angle | real | No | |
DG_Attach_Target | string | No | |
DG_Caster | unit | No | |
DG_CastingTime | real | No | |
DG_Collision | real | No | |
DG_CurrentDist | real | No | |
DG_Group | group | No | |
DG_Target | unit | No | |
DG_TargetEffect | string | No | |
DG_Timer | real | No | |
DGAbility | abilcode | No | |
DGPoint1 | location | No | |
DGPoint2 | location | No | |
DGTargetKey | integer | No | |
DocUnderAttack | boolean | No | false |
EastAllianceWarning1 | boolean | No | false |
EastAllianceWarning2 | boolean | No | false |
EastHordeWarning1 | boolean | No | false |
EastHordeWarning2 | boolean | No | false |
FactorCleared | boolean | Yes | |
FirstBlood | boolean | No | true |
FixedTeams | button | No | |
FixedTeamsCheck | boolean | No | false |
FixedTeamsVote | integer | No | 0 |
FortressDestroyed | boolean | No | false |
GameMode_Dialog | dialog | No | |
HardMode | button | No | |
HardModeOn | boolean | No | false |
HardModeVote | integer | No | 0 |
HashGrip | hashtable | No | |
HeraldUnderAttack | boolean | No | false |
HeroIcon | string | Yes | |
HollowWoodUnderAttack | boolean | No | false |
HordeBounty | boolean | Yes | false |
HordeCount | integer | No | 15 |
HordeGuardRespawn | boolean | No | false |
HordePlayers | force | No | |
ID | integer | Yes | |
ID2 | integer | No | |
IDMax | integer | No | |
Ingredients | integer | No | |
Item_Integer | integer | No | |
ItemCleanupFlag | boolean | No | |
ItemCleanupTimer | timer | No | |
ItemRingCount | integer | Yes | |
ItemsToClean | integer | No | |
ItemTalismanCount | integer | Yes | |
J_Angle | real | Yes | |
J_Animation | string | No | |
J_Animations | string | Yes | |
J_AnimationSpeed | real | No | |
J_Collision | boolean | No | |
J_Distances | real | Yes | |
J_Effect | string | Yes | |
J_Group | group | No | |
J_HeightSettings | real | Yes | |
J_Integers | integer | Yes | |
J_JumpHigh | real | Yes | |
J_JumpHigh_Distance | real | No | |
J_ReachedDistance | real | Yes | |
J_RealTimer | real | Yes | |
J_SpecialEffect | string | No | |
J_Speed | real | No | |
J_TargetPoint | location | No | |
J_TempPoint | location | Yes | |
J_Unit | unit | Yes | |
J_UnitSpeed | real | Yes | |
JCast_Unit | unit | No | |
KB | integervar | No | |
KB_Angle | real | Yes | |
KB_Distance | real | Yes | |
KB_Group | group | Yes | |
KB_Int | integer | No | |
KB_Off | boolean | Yes | |
KB_Point | location | Yes | |
KB_Skip | integer | No | |
KB_Spam | integer | Yes | |
KB_Speed | real | Yes | |
KB_Target | unit | Yes | |
KB_Times | integer | No | |
Loop | integervar | No | |
MonumentOfGreed | fogmodifier | Yes | |
Multiboard | multiboard | No | |
MultiboardPlaceCheck | boolean | No | false |
MultiboardPlayer | boolean | Yes | false |
NeutralBounty | boolean | Yes | false |
NeutralPlayers | force | No | |
No_Suicide | button | No | |
Normal | button | No | |
NormalVote | integer | No | 0 |
OilDerrick | group | Yes | |
order | integer | No | |
PaladinCommand | group | No | |
PaladinDevotion | group | No | |
PaladinRetribution | group | No | |
PlayerColor | string | Yes | |
PlayerCount | integer | No | |
PlayerDeaths | integer | Yes | |
PlayerKills | integer | Yes | |
PlayerRow | integer | Yes | |
PlayerSide | string | Yes | |
Prophet50 | boolean | No | false |
ProphetIsDead | boolean | No | false |
ProphetUnderAttack | boolean | No | false |
PyrefrostUnderAttack | boolean | No | false |
QuickStart | button | No | |
QuickStartOn | boolean | No | false |
QuickStartVote | integer | No | 0 |
Rain | boolean | No | false |
RecipeFactor | itemcode | Yes | |
RegrowthUnits | group | No | |
RoboGoblinGroup | group | No | |
SkeletorUnderAttack | boolean | No | false |
Slot_Integer | integervar | No | |
SpecialFX | effect | No | |
Spell_Boolean | boolean | Yes | false |
Spell_Caster | unit | Yes | |
Spell_Player | player | Yes | |
Spell_TargetPoint | location | Yes | |
SpellArray | integer | No | |
Standard | button | No | |
StandardVote | integer | No | 0 |
Stored_Unit | unit | Yes | |
Suicide_Dialog | dialog | No | |
Suicide_Target | unit | Yes | |
Tech1 | boolean | No | false |
Tech2 | boolean | No | false |
Tech3 | boolean | No | false |
TempFloatText | texttag | No | |
TempForce | force | No | |
TempGroup | group | No | |
TempInt | integer | No | |
TempPlayer | player | No | |
TempPoint | location | No | |
TempReal | real | No | |
TempRegion | rect | No | |
TempUnit | unit | No | |
Time | string | No | |
TimeHours | integer | No | |
TimeMinutes | integer | No | |
TimeMinutes_Tens | integer | No | |
TimeSeconds | integer | No | |
TimeSeconds_Tens | integer | No | |
TRdummyh | unit | No | |
TRhash | hashtable | No | |
TRindexD | integer | No | |
TRindexN | integer | No | |
TRisEnabled | boolean | No | |
TRtimers | timer | Yes | |
TRtrig | trigger | No | |
UnitKills | integer | Yes | |
WarchiefUnderAttack | boolean | No | false |
Weather | weathereffect | Yes | |
WeatherChange | boolean | No | false |
WestAllianceWarning1 | boolean | No | false |
WestAllianceWarning2 | boolean | No | false |
WestHordeWarning1 | boolean | No | false |
WestHordeWarning2 | boolean | No | false |
Wind | boolean | No | false |
Yes_Suicide | button | No |
//TESH.scrollpos=0
//TESH.alwaysfold=0
//************************************************************************************************
//* ____ ___ ___ *
//* /_ _| _ \/ __/ Tree Revival System *
//* | || /\__ \ by Spinnaker *
//* |_||_|\_\___/ v1.2.3.1 *
//* *
//************************************************************************************************
//*********************************************************
//* Globals required
//*********************************************************
//* udg_TRtrig Trigger for handling the revive actions
//* udg_TRhash Hashtable for timer issues
//* udg_TRindexD Stores revival instances
//* udg_TRindexN Parameter for timers manipulation
//* udg_TRtimers Timer array variable for recycle issues
//* udg_TRdummyh Dummy harvester for IsDestructibleTree function
//* udg_TRisEnabled Boolean parameter for enabling/disabling the system
//*********************************************************
//* Important
//*********************************************************
// Note: Units which step on position of tree which is currently
// being resurrected may get stuck between trees in that area
//*********************************************************
//* Constant configurable functions
//*********************************************************
//* Rawdata of undead locust unit type
constant function TR_dummyhId takes nothing returns integer
return 'uloc'
endfunction
//* Rawdata of dummy ghoul harvest ability
constant function TR_harvestId takes nothing returns integer
return 'Ahrl'
endfunction
//* Harvest order ID
constant function TR_orderId takes nothing returns integer
return 852018
endfunction
//* Delay before tree gets resurrected
constant function TR_ReviveDelay takes nothing returns real
return 180.
endfunction
//* Tells if birth animation should be shown while resurrecting a tree
constant function TR_ShowAnimation takes nothing returns boolean
return true
endfunction
//*********************************************************
//* System itself
//*********************************************************
function TR_recycleTimer takes timer t returns nothing
debug if t == null then
debug call BJDebugMsg("Attempt to release a null timer")
else
call PauseTimer(t)
set udg_TRtimers[udg_TRindexN] = t
set udg_TRindexN = udg_TRindexN + 1
endif
endfunction
function TR_getTimer takes nothing returns timer
if 0 == udg_TRindexN then
return CreateTimer()
endif
set udg_TRindexN = udg_TRindexN - 1
return udg_TRtimers[udg_TRindexN]
endfunction
function TR_Callback takes nothing returns nothing
local destructable d = LoadDestructableHandle(udg_TRhash, 0, GetHandleId(GetExpiredTimer()))
call DestructableRestoreLife(d, GetDestructableMaxLife(d), TR_ShowAnimation())
call TR_recycleTimer(GetExpiredTimer())
set udg_TRindexD = udg_TRindexD - 1
if udg_TRindexD == 0 then
call FlushChildHashtable(udg_TRhash, 0)
endif
set d = null
endfunction
function TR_CallRevive takes nothing returns boolean
local timer t
if udg_TRisEnabled then
set t = TR_getTimer()
set udg_TRindexD = udg_TRindexD + 1
call SaveDestructableHandle(udg_TRhash, 0, GetHandleId(t), GetTriggerDestructable())
call TimerStart(t, TR_ReviveDelay(), false, function TR_Callback)
set t = null
endif
return false
endfunction
function TR_IsDestructableTree takes destructable dest returns boolean
return IssueTargetOrderById(udg_TRdummyh, TR_orderId(), dest)
endfunction
function TR_AddTree takes nothing returns nothing
if TR_IsDestructableTree(GetEnumDestructable()) then
call TriggerRegisterDeathEvent(udg_TRtrig, GetEnumDestructable())
endif
endfunction
//***************************************************************************
function InitTrig_TreeRevival takes nothing returns nothing
set udg_TRtrig = CreateTrigger()
set udg_TRhash = InitHashtable()
//* By default enabled
set udg_TRisEnabled = true
//* Actions required for IsDestructibleTree function
set udg_TRdummyh = CreateUnit(Player(15), TR_dummyhId(), 0., 0., 0.)
call ShowUnit(udg_TRdummyh, false)
call UnitAddAbility(udg_TRdummyh, TR_harvestId())
call UnitRemoveAbility(udg_TRdummyh, 'Amov')
//* Revival setup
call EnumDestructablesInRect(bj_mapInitialPlayableArea, null, function TR_AddTree)
call TriggerAddCondition(udg_TRtrig, Condition(function TR_CallRevive))
endfunction