Name | Type | is_array | initial_value |
AISumInt | integer | No | |
AllianceHashtable | hashtable | No | |
AlliedToTownsfolk | boolean | Yes | |
AntiSpam | boolean | Yes | |
ArenaGroup | group | No | |
ArenaMessage | boolean | Yes | |
ArenaReset | boolean | No | |
ArenaRound1 | boolean | No | |
ArenaRound2 | boolean | No | |
ArenaRound3 | boolean | No | |
ArenaRound4 | boolean | No | |
ArenaRound5 | boolean | No | |
ArenaWon | boolean | No | |
AssignAbilities | boolean | Yes | |
Backpack_Group | group | No | |
BAG | unit | Yes | |
BanditPlayers | force | No | |
Button_AcceptArena | button | Yes | |
Button_AcceptAshford | button | Yes | |
Button_AcceptBoneCollector | button | Yes | |
Button_AcceptCavalon | button | Yes | |
Button_AcceptCleric | button | Yes | |
Button_AcceptDroknar | button | Yes | |
Button_AcceptMoladune | button | Yes | |
Button_AcceptTemple | button | Yes | |
Button_Alliance | button | Yes | |
Button_Banker | button | Yes | |
Button_BrokerPeace | button | Yes | |
Button_Cancel | button | Yes | |
Button_DeclareWar | button | Yes | |
Button_Delver | button | Yes | |
Button_Denounce | button | Yes | |
Button_Dwarf | button | Yes | |
Button_Elf | button | Yes | |
Button_Fisherman | button | Yes | |
Button_Founder | button | Yes | |
Button_Human | button | Yes | |
Button_Hunter | button | Yes | |
Button_MakeTruce | button | Yes | |
Button_Orc | button | Yes | |
Button_Player | button | Yes | |
Button_Trader | button | Yes | |
Button_Tribute | button | Yes | |
Button_Undead | button | Yes | |
CAcceleration | real | Yes | |
CAccelerationRate | real | No | |
CAngle | real | Yes | |
CAnimSpeed | real | Yes | |
CanMurder | boolean | No | |
CArray | integer | No | |
CavalryGroup | group | No | |
CCaster | unit | Yes | |
CCasterCheck | unit | No | |
CCasterPos | location | No | |
CCasterPosCheck | location | No | |
CDamage | real | Yes | |
CDistance | real | Yes | |
CEndOfCharge | boolean | Yes | |
CheckDig | boolean | Yes | |
CheckFishing | boolean | Yes | |
CheckTalk | boolean | Yes | |
CleanedItem | item | Yes | |
ClearSummons | boolean | Yes | |
CLoop | integervar | No | |
CMovePoint | location | No | |
ComputerName | string | Yes | |
ConcussiveReal | real | Yes | |
ConcussiveTarget | unit | Yes | |
ConquestInt | integer | No | |
ConquestTimer | timer | No | |
ConquestTimerWindow | timerdialog | No | |
CountAnimals | integer | Yes | |
CountCrops | integer | Yes | |
CountDeer | integer | Yes | |
CountDig | integer | Yes | |
CountDogCalls | integer | Yes | |
CountFish | integer | Yes | |
CountFood | integer | Yes | |
CountHeroKills | integer | Yes | |
CountItemsBought | integer | Yes | |
CountItemsSold | integer | Yes | |
CountPotions | integer | Yes | |
CountQuests | integer | Yes | |
CountTimesTalked | integer | Yes | |
CPlayaGroup | force | Yes | |
CPlayaGroupCheck | force | No | |
CraftedBoolean | boolean | Yes | false |
CraftExp | boolean | Yes | |
CreepPoint | location | Yes | |
CTarget | unit | Yes | |
CTargetCheck | unit | No | |
CTargetPos | location | No | |
CTargetPosCheck | location | No | |
Cthulhu | unit | No | |
CthulhuFight | boolean | No | |
CWait | real | Yes | |
DemonGate | unit | No | |
DemonInt | integer | No | |
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 | |
Diplomacy_Ally | boolean | Yes | |
Diplomacy_DeclareWar | boolean | Yes | |
Diplomacy_Denounce | boolean | Yes | |
Diplomacy_Tribute | boolean | Yes | |
Diplomacy_Truce | boolean | Yes | |
EasyItem__ERRORSOUND | string | No | |
EasyItem__SPLIT | boolean | No | |
EasyItem__SPLITDROP | boolean | No | |
EasyItem__SPLITSIZE | integer | No | |
EasyItem__SPLITSTACK | boolean | No | |
EasyItem__SPLITSTACKDELAY | real | No | |
EasyItem__USEITEMLEVEL | boolean | No | |
EasyItem_integer | integervar | Yes | |
EasyItem_item | item | No | |
EasyItem_items | item | Yes | |
EasyItem_point | location | Yes | |
EasyItem_sound | sound | No | |
EasyItem_string | string | Yes | |
EasyItem_timer | timer | No | |
EasyItem_unit | unit | No | |
EasyItem_units | unit | Yes | |
EconomicWarning | boolean | Yes | |
EventBloodMoon | boolean | No | |
EventDemonInvasion | boolean | No | |
EventDragon | boolean | No | |
EventForestBoss | boolean | No | |
EventLateGame | boolean | No | |
EventNaturesWrath | boolean | No | |
EventVerdantRain | boolean | No | |
FactorCleared | boolean | Yes | |
FishingBoats | group | No | |
FishingBoot | boolean | Yes | |
Flagship | unit | Yes | |
FriendMode | boolean | Yes | |
FriendVote | integer | No | |
GameMode | string | No | |c00FFFFFFSelecting|r Game Modes |
GameModeSelect | boolean | No | true |
Gear_Dialog | dialog | No | |
GearDrop | boolean | Yes | |
General_Dialog | dialog | Yes | |
GoldMine | unit | Yes | |
GracePeriod | boolean | No | true |
Granary_Group | group | No | |
GreedisWin | boolean | Yes | |
GreedIsWinVote | integer | No | |
GW_Ability | abilcode | No | |
GW_CatchRange | real | No | |
GW_DragSpeed | real | No | |
GW_Dummy | unitcode | No | |
GW_Duration | real | No | |
GW_PullsAllies | boolean | No | |
GW_SpellGroup | group | No | |
GW_SpellHash | hashtable | No | |
HardMode | boolean | Yes | |
HardModeVote | integer | No | |
HasDog | boolean | Yes | |
HashGrip | hashtable | No | |
HasPet | boolean | Yes | |
HERO | unit | Yes | |
HeroComputer | boolean | Yes | |
HeroGroupLeader | group | Yes | |
HeroGroupLt | group | Yes | |
HeroGroupRanger | group | Yes | |
HeroGroupSummoner | group | Yes | |
HeroicAdmiral | boolean | Yes | |
HeroicBalthazar | boolean | Yes | |
HeroicBloodMoon | boolean | Yes | |
HeroicHollowWood | boolean | Yes | |
HeroicLeviathan | boolean | Yes | |
HeroicMagus | boolean | Yes | |
HeroicQueen | boolean | Yes | |
HeroicVictoryPlayers | force | No | |
HEROLt | unit | Yes | |
HERORanger | unit | Yes | |
HEROSummoner | unit | Yes | |
HeroSummons | boolean | Yes | |
ID | integer | Yes | |
ID2 | integer | No | |
IDMax | integer | No | |
IllusionGroup | group | No | |
Ingredients | integer | No | |
IronDepositGroup | group | No | |
IsABandit | boolean | Yes | |
IsAFounder | boolean | Yes | |
IsAHero | boolean | Yes | |
IsNight | boolean | No | |
Item_Integer | integer | No | |
ItemCleanupFlag | boolean | No | |
ItemCleanupTimer | timer | No | |
ItemsToClean | integer | No | |
ItemUser | unit | 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 | |
LocustGroup | group | No | |
Loop | integervar | No | |
Map | boolean | Yes | |
MarketDemand | real | Yes | |
MarketInt | integer | No | |
MithrilDepositGroup | group | No | |
MountRank | integer | Yes | |
Multiboard | multiboard | No | |
MultiboardPlaceCheck | boolean | No | |
MultiboardPlayer | boolean | Yes | |
NatureWrathLightning | boolean | No | |
NeutralPlayers | force | No | |
No_Suicide | button | No | |
OrderID | integer | No | |
Packhorse_Group | group | No | |
Path1 | group | No | |
Path2 | group | No | |
Path3 | group | No | |
PeaceBrokered | boolean | No | |
Player11Group | group | No | |
Player11Int | integer | No | |
PlayerAlignment | string | Yes | |
PlayerColor | string | Yes | |
PlayerCount | integer | No | |
PlayerDefeated | boolean | Yes | |
PlayerRotate | boolean | Yes | |
PlayerRow | integer | Yes | |
PlayerStatus | string | Yes | |
PointBloodMoon | location | Yes | |
PointCaravan | location | Yes | |
PointDemonLordSpawn | location | No | |
PointDemonSpawn | location | No | |
PointForestCreeps | location | Yes | |
PointMineCreeps | location | Yes | |
PointPatrol | location | Yes | |
PointPirates | location | Yes | |
PointSeafarerCreeps | location | Yes | |
PointShip | location | Yes | |
PointTrawlers | location | Yes | |
PointVessel | location | Yes | |
PointVillagers | location | Yes | |
QuestActiveArena | boolean | No | |
QuestActiveAshford | boolean | No | |
QuestActiveBoneCollector | boolean | No | |
QuestActiveCavalon | boolean | No | |
QuestActiveCleric | boolean | No | |
QuestActiveDroknar | boolean | No | |
QuestActiveMoladune | boolean | No | |
QuestActiveTemple | boolean | No | |
QuestArena | quest | No | |
QuestAshford | quest | No | |
QuestAshfordGroup | group | No | |
QuestBoneCollector | quest | No | |
QuestCavalon | quest | No | |
QuestCavalonGroup | group | No | |
QuestCleric | quest | No | |
QuestDroknar | quest | No | |
QuestDroknarGroup | group | No | |
QuesterAshford | force | No | |
QuesterCavalon | force | No | |
QuesterDroknar | force | No | |
QuestMoladune | quest | No | |
QuestRegion | rect | No | |
QuestTemple | quest | No | |
QuestTierAshford | integer | No | |
QuestTierCavalon | integer | No | |
QuestTierDroknar | integer | No | |
Quickstart | boolean | Yes | |
QuickstartVote | integer | No | |
Rage | group | No | |
RankHashtable | hashtable | No | |
RankInt | integer | No | |
RecipeFactor | itemcode | Yes | |
Reputation | integer | Yes | |
Selection_Dialog | dialog | Yes | |
ShrineLightning | effect | No | |
Slot_Integer | integervar | No | |
SpecialFX | effect | No | |
Suicide_Dialog | dialog | No | |
SulfurDepositGroup | group | No | |
SummonedLeviathan | boolean | No | |
SummonedMagus | boolean | No | |
SummonedQueen | boolean | No | |
Temp_Group_1 | group | No | |
Temp_Loc_1 | location | No | |
Temp_Loc_2 | location | No | |
Temp_Real_1 | real | No | |
Temp_Real_2 | real | No | |
Temp_Real_3 | real | No | |
Temp_Real_4 | real | No | |
Temp_Real_5 | real | No | |
Temp_Unit_1 | unit | No | |
Temp_Unit_2 | unit | No | |
Temp_Unit_3 | unit | No | |
TempFloatText | texttag | No | |
TempForce | force | No | |
TempGroup | group | No | |
TempInt | integer | No | |
TempItem | item | No | |
TempLoc | location | No | |
TempPlayer | player | No | |
TempPoint | location | No | |
TempReal | real | No | |
TempRegion | rect | No | |
TempUnit | unit | No | |
TextAdmiral | boolean | No | |
TextDarkWizard | boolean | No | |
TextGrandMagus | boolean | No | |
TextLeviathan | boolean | No | |
TextQueen | boolean | No | |
TextTroll | boolean | No | |
Time | string | No | |
TimeHours | integer | No | |
TimeMinutes | integer | No | |
TimeMinutes_Tens | integer | No | |
TimeSeconds | integer | No | |
TimeSeconds_Tens | integer | No | |
TK_FlyingUnits | group | No | |
TK_FSpeed | real | Yes | |
TK_Hero | unit | Yes | |
TK_ImpactSFX | string | No | |
TK_Integers | integer | Yes | |
TK_Interval | real | Yes | |
TK_Level | integer | Yes | |
TK_LiftSFX | string | No | |
TK_LiftSFXTimer | real | No | |
TK_LsfxT | real | Yes | |
TK_MaxHeight | real | Yes | |
TK_MaxHeightIncrease | real | No | |
TK_MaxHeightStart | real | No | |
TK_MinHeightIncrease | real | No | |
TK_MinHeightStart | real | No | |
TK_Pause | boolean | No | |
TK_Speed | real | No | |
TK_SpeedVariationPerc | real | No | |
TK_StartSFX | string | No | |
TK_TempPoint | location | Yes | |
TK_Unit | unit | Yes | |
TK_UnitGroup | group | No | |
TownContested | boolean | No | |
TownsfolkAssailant | unit | No | |
TownsfolkUnit | unit | No | |
TRdummyh | unit | No | |
TRhash | hashtable | No | |
TRindexD | integer | No | |
TRindexN | integer | No | |
TRisEnabled | boolean | No | |
TRtimers | timer | Yes | |
TRtrig | trigger | No | |
UppercutGroup | group | No | |
VassalAshford | integer | No | 13 |
VassalCavalon | integer | No | 13 |
VassalDroknar | integer | No | 13 |
VassalFrostGate | integer | No | 13 |
VassalPortSledge | integer | No | 13 |
VassalRiverside | integer | No | 13 |
VassalSanctumCay | integer | No | 13 |
VassalWizardFolly | integer | No | 13 |
Victor | integer | No | |
Weapon | effect | Yes | |
Weather | boolean | No | true |
Weather_Current | integer | No | |
Weather_Effects | weathereffect | Yes | |
WildHunt | boolean | Yes | |
WildHuntSaved | integer | No | |
WildHuntVote | integer | No | |
Yes_Suicide | button | No | |
Zealous | group | 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 600.
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_Tree_Revival 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