Name | Type | is_array | initial_value |
Angle | real | Yes | |
Angle2 | real | Yes | |
Angle3 | real | Yes | |
AoE | real | No | |
AoE2 | real | No | |
BuffUnit | unit | No | |
Creep_Point | location | Yes | |
Current_Index | integer | No | |
Damage | real | Yes | |
DebuffUnit | unit | No | |
Distance2 | real | Yes | |
DummyCaster | unit | No | |
Duration | real | Yes | |
Duration2 | real | Yes | |
Healing | real | Yes | |
Index | integer | Yes | |
Index2 | integer | Yes | |
Index_Container | integer | Yes | |
Index_Listener | integer | No | |
Index_MaxSize | integer | No | |
Index_MaxSize2 | integer | No | |
Index_Size | integer | No | |
Index_Size2 | integer | No | |
Index_Size3 | integer | No | |
KB_Angle | real | Yes | |
KB_Casters | unit | Yes | |
KB_CountBuffs | integer | No | |
KB_DestroyTrees | boolean | Yes | |
KB_EffectCounter | integer | Yes | |
KB_EffectCounter2 | integer | Yes | |
KB_Effects_1 | string | Yes | |
KB_Effects_2 | string | Yes | |
KB_GeneralIntegers | integervar | Yes | |
KB_KnockbackedUnits | group | No | |
KB_Levels | integer | Yes | |
KB_MaxDistance | real | Yes | |
KB_ReachedDistance | real | Yes | |
KB_ReducedReal | real | No | |
KB_ReduceSpeedReal | real | Yes | |
KB_SpecificSpeed | real | Yes | |
KB_StartPositions | location | Yes | |
KB_TempPoint | location | Yes | |
KB_TempReal | real | No | |
KB_TotalKnockUnits | integer | No | |
KB_Units | unit | Yes | |
KBA_Caster | unit | No | |
KBA_DestroyTrees | boolean | No | |
KBA_DistancePerLevel | real | No | |
KBA_Level | integer | No | |
KBA_SpecialEffects | string | Yes | |
KBA_Speed | real | No | |
KBA_StartingPosition | location | No | |
KBA_TargetUnit | unit | No | |
KnockBackGroup | group | No | |
Missile | unit | Yes | |
Missile2 | unit | Yes | |
Point | location | Yes | |
PsyLoop | integer | No | |
Recycle_Container | integer | Yes | |
Recycle_Size | integer | No | |
Speed | real | Yes | |
Speed2 | real | Yes | |
SWGroup | group | Yes | |
SWLoop | integer | No | |
Temp_Integer | integer | No | |
TempAttackType | attacktype | No | |
TempChancePercentage | integer | No | |
TempChanceProc | integer | No | |
TempDamage | real | No | |
TempDamageType | damagetype | No | |
TempEffectDamageRange | integer | No | |
TempInteger | integer | No | |
TempInteger2 | integer | No | |
TempLoc | location | No | |
TempLoc1_2 | location | No | |
TempLoc2 | location | No | |
TempLoc2_2 | location | No | |
TempLoop | integer | No | |
TempPoint | location | No | |
TempPoint2 | location | No | |
TempPointArr | location | Yes | |
TempPointArr2 | location | Yes | |
TempReal | real | No | |
TempUnit | unit | No | |
TempUnit_MUI | unit | Yes | |
TRdummyh | unit | No | |
TRhash | hashtable | No | |
TRindexD | integer | No | |
TRindexN | integer | No | |
TRisEnabled | boolean | No | |
TRtimers | timer | Yes | |
TRtrig | trigger | No | |
Unit | unit | Yes | |
WWGroup | group | Yes | |
WWLoop | integer | No |
Welcome to: How to Import Dogzz's Spellpack!
C R E D I T S T O P A L A D O N
F O R K N O C K B A C K
-1 First, go to file - preferences - "checkmark":Create unknown variables when copy/pasting
triggers
-2 Go to Object Editor - Units: Copy all the dummy units into your map
-3 Go to Object Editor - Abillities: Copy all the spells and dummy spells into your map
-4 Go to Trigger Editor and copy the comment "Spellpack" into your map, when you are
done just delete this trigger
-5 Make sure all trigger variables/ triggers are placed correctly.
-6 Give your hero the abillities
-7 Remove this trigger from your map... now your done!
//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 5.
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