I have an ability based on Cluster Rocket and I noticed that on the higher levels the missiles come out faster. This seems to be a vanillia behaviour. Is there a way to have them come out at the same rate on all levels?
I assume the spell uses a Timer which fires 1 missile every X seconds.They are the same for all levels, was hopeing that makes it behave the same on all levels.
Do you mean multiple abilites with each 1 level so they fire at the same rate? And then just adjust the damage. That sounds like a lot of object data :/I assume the spell uses a Timer which fires 1 missile every X seconds.
X is most likely Effect Duration/Missile Count.
If you increase the Effect Duration to let's say 1/2/3 seconds then it will fire the missiles at the same rate.
No, you just increase the Effect Duration per level. Scale it along with the Missile Count so the rate stays the same.Do you mean multiple abilites with each 1 level so they fire at the same rate? And then just adjust the damage. That sounds like a lot of object data :/
I tried changing the effect duration without any noticeable difference.No, you just increase the Effect Duration per level. Scale it along with the Missile Count so the rate stays the same.
The unfortunate side effect is that the cast time or channel time or whatever you want to call it will last longer at higher levels.
Did it affect how long the Stun lasted? Cluster Rockets is a weird spell...I tried changing the effect duration without any noticeable difference.
no weirdly enough is just made the spell damage for a long time.Did it affect how long the Stun lasted? Cluster Rockets is a weird spell...
By the way, do you have version 1.31 of the map?Map requires the latest patch to open.
library GUISimpleTimers
// created by Uncle
globals
hashtable GST_Hash = InitHashtable()
timer GST_Timer
integer GST_NewKey = 0
integer GST_Index = 0
endglobals
// Call this function to destroy and clean up an expired repeating timer.
// Example: Custom script: call GST_DestroyTimer()
// You would call this inside of your GST_Trigger.
function GST_DestroyTimer takes nothing returns nothing
local timer t = GetExpiredTimer()
call FlushChildHashtable(GST_Hash, GetHandleId(t))
call PauseTimer(t)
call DestroyTimer(t)
set t = null
endfunction
// Call this function to destroy and clean up a specific repeating timer.
// Example: Custom script: call GST_ClearTimer(timer)
function GST_DestroyTimerById takes timer t returns nothing
call FlushChildHashtable(GST_Hash, GetHandleId(t))
call PauseTimer(t)
call DestroyTimer(t)
set t = null
endfunction
// Call this function to get the timer that was just created or just expired.
// Example: Custom script: call GST_GetLastTimer()
function GST_GetLastTimer takes nothing returns timer
return GST_Timer
endfunction
// Do NOT call this function yourself.
// This is used with the Key system to "restart" a timer.
// It destroys the previously created timer (if one is found).
// Then the new timer that was just created replaces it.
function GST_RestartTimer takes nothing returns nothing
local integer trigId = GetHandleId(udg_GST_Trigger)
set GST_NewKey = (-1000000000 + (100000 * LoadInteger(GST_Hash, -1, trigId)))
if (GST_NewKey != -1000000000) then
// key already exists
set GST_NewKey = GST_NewKey + udg_GST_RestartKey
else
// key doesn't exist, initialize it
set GST_Index = GST_Index + 1
set GST_NewKey = (-1000000000 + (100000 * GST_Index)) + udg_GST_RestartKey
call SaveInteger(GST_Hash, -1, trigId, GST_Index)
endif
set GST_Timer = LoadTimerHandle(GST_Hash, GST_NewKey, trigId)
// remove the old timer stored at these keys
if (GST_Timer != null) then
call PauseTimer(GST_Timer)
call DestroyTimer(GST_Timer)
call RemoveSavedInteger(GST_Hash, GST_NewKey, trigId)
endif
endfunction
// Callback functions which run when a timer expires:
function GST_Int_Expire takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer id = GetHandleId(t)
local trigger trig = LoadTriggerHandle(GST_Hash, id, 2)
local boolean repeating = LoadBoolean(GST_Hash, id, 1)
set udg_GST_Integer1 = LoadInteger(GST_Hash, id, 0)
// run the GUI trigger
call TriggerExecute(trig)
// the timer is not repeating so destroy it
if (repeating == false) then
call FlushChildHashtable(GST_Hash, id)
call PauseTimer(t)
call DestroyTimer(t)
endif
// clean up memory leaks
set t = null
set trig = null
endfunction
function GST_IntInt_Expire takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer id = GetHandleId(t)
local trigger trig = LoadTriggerHandle(GST_Hash, id, 3)
local boolean repeating = LoadBoolean(GST_Hash, id, 2)
set udg_GST_Integer1 = LoadInteger(GST_Hash, id, 0)
set udg_GST_Integer2 = LoadInteger(GST_Hash, id, 1)
// run the GUI trigger
call TriggerExecute(trig)
// the timer is not repeating so destroy it
if (repeating == false) then
call FlushChildHashtable(GST_Hash, id)
call PauseTimer(t)
call DestroyTimer(t)
endif
// clean up memory leaks
set t = null
set trig = null
endfunction
function GST_IntIntInt_Expire takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer id = GetHandleId(t)
local trigger trig = LoadTriggerHandle(GST_Hash, id, 4)
local boolean repeating = LoadBoolean(GST_Hash, id, 3)
set udg_GST_Integer1 = LoadInteger(GST_Hash, id, 0)
set udg_GST_Integer2 = LoadInteger(GST_Hash, id, 1)
set udg_GST_Integer3 = LoadInteger(GST_Hash, id, 2)
// run the GUI trigger
call TriggerExecute(trig)
// the timer is not repeating so destroy it
if (repeating == false) then
call FlushChildHashtable(GST_Hash, id)
call PauseTimer(t)
call DestroyTimer(t)
endif
// clean up memory leaks
set t = null
set trig = null
endfunction
function GST_Real_Expire takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer id = GetHandleId(t)
local trigger trig = LoadTriggerHandle(GST_Hash, id, 2)
local boolean repeating = LoadBoolean(GST_Hash, id, 1)
set udg_GST_Real1 = LoadReal(GST_Hash, id, 0)
// run the GUI trigger
call TriggerExecute(trig)
// the timer is not repeating so destroy it
if (repeating == false) then
call FlushChildHashtable(GST_Hash, id)
call PauseTimer(t)
call DestroyTimer(t)
endif
// clean up memory leaks
set t = null
set trig = null
endfunction
function GST_RealReal_Expire takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer id = GetHandleId(t)
local trigger trig = LoadTriggerHandle(GST_Hash, id, 3)
local boolean repeating = LoadBoolean(GST_Hash, id, 2)
set udg_GST_Real1 = LoadReal(GST_Hash, id, 0)
set udg_GST_Real2 = LoadReal(GST_Hash, id, 1)
// run the GUI trigger
call TriggerExecute(trig)
// the timer is not repeating so destroy it
if (repeating == false) then
call FlushChildHashtable(GST_Hash, id)
call PauseTimer(t)
call DestroyTimer(t)
endif
// clean up memory leaks
set t = null
set trig = null
endfunction
function GST_RealRealReal_Expire takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer id = GetHandleId(t)
local trigger trig = LoadTriggerHandle(GST_Hash, id, 4)
local boolean repeating = LoadBoolean(GST_Hash, id, 3)
set udg_GST_Real1 = LoadReal(GST_Hash, id, 0)
set udg_GST_Real2 = LoadReal(GST_Hash, id, 1)
set udg_GST_Real2 = LoadReal(GST_Hash, id, 2)
// run the GUI trigger
call TriggerExecute(trig)
// the timer is not repeating so destroy it
if (repeating == false) then
call FlushChildHashtable(GST_Hash, id)
call PauseTimer(t)
call DestroyTimer(t)
endif
// clean up memory leaks
set t = null
set trig = null
endfunction
function GST_IntReal_Expire takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer id = GetHandleId(t)
local trigger trig = LoadTriggerHandle(GST_Hash, id, 3)
local boolean repeating = LoadBoolean(GST_Hash, id, 2)
set udg_GST_Integer1 = LoadInteger(GST_Hash, id, 0)
set udg_GST_Real1 = LoadReal(GST_Hash, id, 1)
// run the GUI trigger
call TriggerExecute(trig)
// the timer is not repeating so destroy it
if (repeating == false) then
call FlushChildHashtable(GST_Hash, id)
call PauseTimer(t)
call DestroyTimer(t)
endif
// clean up memory leaks
set t = null
set trig = null
endfunction
function GST_Unit_Expire takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer id = GetHandleId(t)
local trigger trig = LoadTriggerHandle(GST_Hash, id, 2)
local boolean repeating = LoadBoolean(GST_Hash, id, 1)
set udg_GST_Unit1 = LoadUnitHandle(GST_Hash, id, 0)
// run the GUI trigger
call TriggerExecute(trig)
// the timer is not repeating so destroy it
if (repeating == false) then
call FlushChildHashtable(GST_Hash, id)
call PauseTimer(t)
call DestroyTimer(t)
endif
// clean up memory leaks
set t = null
set trig = null
endfunction
function GST_UnitUnit_Expire takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer id = GetHandleId(t)
local trigger trig = LoadTriggerHandle(GST_Hash, id, 3)
local boolean repeating = LoadBoolean(GST_Hash, id, 2)
set udg_GST_Unit1 = LoadUnitHandle(GST_Hash, id, 0)
set udg_GST_Unit2 = LoadUnitHandle(GST_Hash, id, 1)
// run the GUI trigger
call TriggerExecute(trig)
// the timer is not repeating so destroy it
if (repeating == false) then
call FlushChildHashtable(GST_Hash, id)
call PauseTimer(t)
call DestroyTimer(t)
endif
// clean up memory leaks
set t = null
set trig = null
endfunction
function GST_UnitUnitUnit_Expire takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer id = GetHandleId(t)
local trigger trig = LoadTriggerHandle(GST_Hash, id, 4)
local boolean repeating = LoadBoolean(GST_Hash, id, 3)
set udg_GST_Unit1 = LoadUnitHandle(GST_Hash, id, 0)
set udg_GST_Unit2 = LoadUnitHandle(GST_Hash, id, 1)
set udg_GST_Unit3 = LoadUnitHandle(GST_Hash, id, 2)
// run the GUI trigger
call TriggerExecute(trig)
// the timer is not repeating so destroy it
if (repeating == false) then
call FlushChildHashtable(GST_Hash, id)
call PauseTimer(t)
call DestroyTimer(t)
endif
// clean up memory leaks
set t = null
set trig = null
endfunction
function GST_UnitReal_Expire takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer id = GetHandleId(t)
local trigger trig = LoadTriggerHandle(GST_Hash, id, 3)
local boolean repeating = LoadBoolean(GST_Hash, id, 2)
set udg_GST_Unit1 = LoadUnitHandle(GST_Hash, id, 0)
set udg_GST_Real1 = LoadReal(GST_Hash, id, 1)
// run the GUI trigger
call TriggerExecute(trig)
// the timer is not repeating so destroy it
if (repeating == false) then
call FlushChildHashtable(GST_Hash, id)
call PauseTimer(t)
call DestroyTimer(t)
endif
// clean up memory leaks
set t = null
set trig = null
endfunction
function GST_UnitInt_Expire takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer id = GetHandleId(t)
local trigger trig = LoadTriggerHandle(GST_Hash, id, 3)
local boolean repeating = LoadBoolean(GST_Hash, id, 2)
set udg_GST_Unit1 = LoadUnitHandle(GST_Hash, id, 0)
set udg_GST_Integer1 = LoadInteger(GST_Hash, id, 1)
// run the GUI trigger
call TriggerExecute(trig)
// the timer is not repeating so destroy it
if (repeating == false) then
call FlushChildHashtable(GST_Hash, id)
call PauseTimer(t)
call DestroyTimer(t)
endif
// clean up memory leaks
set t = null
set trig = null
endfunction
function GST_Simple_Expire takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer id = GetHandleId(t)
local trigger trig = LoadTriggerHandle(GST_Hash, id, 0)
local boolean repeating = LoadBoolean(GST_Hash, id, 1)
// run the GUI trigger
call TriggerExecute(trig)
// the timer is not repeating so destroy it
if (repeating == false) then
call FlushChildHashtable(GST_Hash, id)
call PauseTimer(t)
call DestroyTimer(t)
endif
// clean up memory leaks
set t = null
set trig = null
endfunction
// Functions to start timers:
function GST_Real takes real r1, boolean repeating, real interval returns nothing
local timer t = CreateTimer()
local integer id = GetHandleId(t)
// save to hashtable
call SaveReal(GST_Hash, id, 0, r1)
call SaveBoolean(GST_Hash, id, 1, repeating)
call SaveTriggerHandle(GST_Hash, id, 2, udg_GST_Trigger)
// start timer
call TimerStart(t, interval, repeating, function GST_Real_Expire)
// check for keys which are used to restart existing timers
if udg_GST_RestartKey >= 0 then
call GST_RestartTimer()
// keep track of the new timer stored at these keys
call SaveTimerHandle(GST_Hash, GST_NewKey, GetHandleId(udg_GST_Trigger), t)
set udg_GST_RestartKey = -1
endif
// clean up memory leaks
set GST_Timer = t
set t = null
endfunction
function GST_RealReal takes real r1, real r2, boolean repeating, real interval returns nothing
local timer t = CreateTimer()
local integer id = GetHandleId(t)
// save to hashtable
call SaveReal(GST_Hash, id, 0, r1)
call SaveReal(GST_Hash, id, 1, r2)
call SaveBoolean(GST_Hash, id, 2, repeating)
call SaveTriggerHandle(GST_Hash, id, 3, udg_GST_Trigger)
// start timer
call TimerStart(t, interval, repeating, function GST_RealReal_Expire)
// check for keys which are used to restart existing timers
if udg_GST_RestartKey >= 0 then
call GST_RestartTimer()
// keep track of the new timer stored at these keys
call SaveTimerHandle(GST_Hash, GST_NewKey, GetHandleId(udg_GST_Trigger), t)
set udg_GST_RestartKey = -1
endif
// clean up memory leaks
set GST_Timer = t
set t = null
endfunction
function GST_RealRealReal takes real r1, real r2, real r3, boolean repeating, real interval returns nothing
local timer t = CreateTimer()
local integer id = GetHandleId(t)
// save to hashtable
call SaveReal(GST_Hash, id, 0, r1)
call SaveReal(GST_Hash, id, 1, r2)
call SaveReal(GST_Hash, id, 2, r3)
call SaveBoolean(GST_Hash, id, 3, repeating)
call SaveTriggerHandle(GST_Hash, id, 4, udg_GST_Trigger)
// start timer
call TimerStart(t, interval, repeating, function GST_RealRealReal_Expire)
// check for keys which are used to restart existing timers
if udg_GST_RestartKey >= 0 then
call GST_RestartTimer()
// keep track of the new timer stored at these keys
call SaveTimerHandle(GST_Hash, GST_NewKey, GetHandleId(udg_GST_Trigger), t)
set udg_GST_RestartKey = -1
endif
// clean up memory leaks
set GST_Timer = t
set t = null
endfunction
function GST_IntReal takes integer i1, real r1, boolean repeating, real interval returns nothing
local timer t = CreateTimer()
local integer id = GetHandleId(t)
// save to hashtable
call SaveInteger(GST_Hash, id, 0, i1)
call SaveReal(GST_Hash, id, 1, r1)
call SaveBoolean(GST_Hash, id, 2, repeating)
call SaveTriggerHandle(GST_Hash, id, 3, udg_GST_Trigger)
// start timer
call TimerStart(t, interval, repeating, function GST_IntReal_Expire)
// check for keys which are used to restart existing timers
if udg_GST_RestartKey >= 0 then
call GST_RestartTimer()
// keep track of the new timer stored at these keys
call SaveTimerHandle(GST_Hash, GST_NewKey, GetHandleId(udg_GST_Trigger), t)
set udg_GST_RestartKey = -1
endif
// clean up memory leaks
set GST_Timer = t
set t = null
endfunction
function GST_Int takes integer i1, boolean repeating, real interval returns nothing
local timer t = CreateTimer()
local integer id = GetHandleId(t)
// save to hashtable
call SaveInteger(GST_Hash, id, 0, i1)
call SaveBoolean(GST_Hash, id, 1, repeating)
call SaveTriggerHandle(GST_Hash, id, 2, udg_GST_Trigger)
// start timer
call TimerStart(t, interval, repeating, function GST_Int_Expire)
// check for keys which are used to restart existing timers
if udg_GST_RestartKey >= 0 then
call GST_RestartTimer()
// keep track of the new timer stored at these keys
call SaveTimerHandle(GST_Hash, GST_NewKey, GetHandleId(udg_GST_Trigger), t)
set udg_GST_RestartKey = -1
endif
// clean up memory leaks
set GST_Timer = t
set t = null
endfunction
function GST_IntInt takes integer i1, integer i2, boolean repeating, real interval returns nothing
local timer t = CreateTimer()
local integer id = GetHandleId(t)
// save to hashtable
call SaveInteger(GST_Hash, id, 0, i1)
call SaveInteger(GST_Hash, id, 1, i2)
call SaveBoolean(GST_Hash, id, 2, repeating)
call SaveTriggerHandle(GST_Hash, id, 3, udg_GST_Trigger)
// start timer
call TimerStart(t, interval, repeating, function GST_IntInt_Expire)
// check for keys which are used to restart existing timers
if udg_GST_RestartKey >= 0 then
call GST_RestartTimer()
// keep track of the new timer stored at these keys
call SaveTimerHandle(GST_Hash, GST_NewKey, GetHandleId(udg_GST_Trigger), t)
set udg_GST_RestartKey = -1
endif
// clean up memory leaks
set GST_Timer = t
set t = null
endfunction
function GST_IntIntInt takes integer i1, integer i2, integer i3, boolean repeating, real interval returns nothing
local timer t = CreateTimer()
local integer id = GetHandleId(t)
// save to hashtable
call SaveInteger(GST_Hash, id, 0, i1)
call SaveInteger(GST_Hash, id, 1, i2)
call SaveInteger(GST_Hash, id, 2, i3)
call SaveBoolean(GST_Hash, id, 3, repeating)
call SaveTriggerHandle(GST_Hash, id, 4, udg_GST_Trigger)
// start timer
call TimerStart(t, interval, repeating, function GST_IntIntInt_Expire)
// check for keys which are used to restart existing timers
if udg_GST_RestartKey >= 0 then
call GST_RestartTimer()
// keep track of the new timer stored at these keys
call SaveTimerHandle(GST_Hash, GST_NewKey, GetHandleId(udg_GST_Trigger), t)
set udg_GST_RestartKey = -1
endif
// clean up memory leaks
set GST_Timer = t
set t = null
endfunction
function GST_UnitInt takes unit u1, integer i1, boolean repeating, real interval returns nothing
local timer t = CreateTimer()
local integer id = GetHandleId(t)
// save to hashtable
call SaveUnitHandle(GST_Hash, id, 0, u1)
call SaveInteger(GST_Hash, id, 1, i1)
call SaveBoolean(GST_Hash, id, 2, repeating)
call SaveTriggerHandle(GST_Hash, id, 3, udg_GST_Trigger)
// start timer
call TimerStart(t, interval, repeating, function GST_UnitInt_Expire)
// check for keys which are used to restart existing timers
if udg_GST_RestartKey >= 0 then
call GST_RestartTimer()
// keep track of the new timer stored at these keys
call SaveTimerHandle(GST_Hash, GST_NewKey, GetHandleId(udg_GST_Trigger), t)
set udg_GST_RestartKey = -1
endif
// clean up memory leaks
set GST_Timer = t
set t = null
endfunction
function GST_UnitReal takes unit u1, real r1, boolean repeating, real interval returns nothing
local timer t = CreateTimer()
local integer id = GetHandleId(t)
// save to hashtable
call SaveUnitHandle(GST_Hash, id, 0, u1)
call SaveReal(GST_Hash, id, 1, r1)
call SaveBoolean(GST_Hash, id, 2, repeating)
call SaveTriggerHandle(GST_Hash, id, 3, udg_GST_Trigger)
// start timer
call TimerStart(t, interval, repeating, function GST_UnitReal_Expire)
// check for keys which are used to restart existing timers
if udg_GST_RestartKey >= 0 then
call GST_RestartTimer()
// keep track of the new timer stored at these keys
call SaveTimerHandle(GST_Hash, GST_NewKey, GetHandleId(udg_GST_Trigger), t)
set udg_GST_RestartKey = -1
endif
// clean up memory leaks
set GST_Timer = t
set t = null
endfunction
function GST_UnitUnitUnit takes unit u1, unit u2, unit u3, boolean repeating, real interval returns nothing
local timer t = CreateTimer()
local integer id = GetHandleId(t)
// save to hashtable
call SaveUnitHandle(GST_Hash, id, 0, u1)
call SaveUnitHandle(GST_Hash, id, 1, u2)
call SaveUnitHandle(GST_Hash, id, 2, u2)
call SaveBoolean(GST_Hash, id, 3, repeating)
call SaveTriggerHandle(GST_Hash, id, 4, udg_GST_Trigger)
// start timer
call TimerStart(t, interval, repeating, function GST_UnitUnitUnit_Expire)
// check for keys which are used to restart existing timers
if udg_GST_RestartKey >= 0 then
call GST_RestartTimer()
// keep track of the new timer stored at these keys
call SaveTimerHandle(GST_Hash, GST_NewKey, GetHandleId(udg_GST_Trigger), t)
set udg_GST_RestartKey = -1
endif
// clean up memory leaks
set GST_Timer = t
set t = null
endfunction
function GST_UnitUnit takes unit u1, unit u2, boolean repeating, real interval returns nothing
local timer t = CreateTimer()
local integer id = GetHandleId(t)
// save to hashtable
call SaveUnitHandle(GST_Hash, id, 0, u1)
call SaveUnitHandle(GST_Hash, id, 1, u2)
call SaveBoolean(GST_Hash, id, 2, repeating)
call SaveTriggerHandle(GST_Hash, id, 3, udg_GST_Trigger)
// start timer
call TimerStart(t, interval, repeating, function GST_UnitUnit_Expire)
// check for keys which are used to restart existing timers
if udg_GST_RestartKey >= 0 then
call GST_RestartTimer()
// keep track of the new timer stored at these keys
call SaveTimerHandle(GST_Hash, GST_NewKey, GetHandleId(udg_GST_Trigger), t)
set udg_GST_RestartKey = -1
endif
// clean up memory leaks
set GST_Timer = t
set t = null
endfunction
function GST_Unit takes unit u1, boolean repeating, real interval returns nothing
local timer t = CreateTimer()
local integer id = GetHandleId(t)
// save to hashtable
call SaveUnitHandle(GST_Hash, id, 0, u1)
call SaveBoolean(GST_Hash, id, 1, repeating)
call SaveTriggerHandle(GST_Hash, id, 2, udg_GST_Trigger)
// start timer
call TimerStart(t, interval, repeating, function GST_Unit_Expire)
// check for keys which are used to restart existing timers
if udg_GST_RestartKey >= 0 then
call GST_RestartTimer()
// keep track of the new timer stored at these keys
call SaveTimerHandle(GST_Hash, GST_NewKey, GetHandleId(udg_GST_Trigger), t)
set udg_GST_RestartKey = -1
endif
// clean up memory leaks
set GST_Timer = t
set t = null
endfunction
function GST_Simple takes boolean repeating, real interval returns nothing
local timer t = CreateTimer()
local integer id = GetHandleId(t)
// save to hashtable
call SaveTriggerHandle(GST_Hash, id, 0, udg_GST_Trigger)
call SaveBoolean(GST_Hash, id, 1, repeating)
// start timer
call TimerStart(t, interval, repeating, function GST_Simple_Expire)
// check for keys which are used to restart existing timers
if udg_GST_RestartKey >= 0 then
call GST_RestartTimer()
// keep track of the new timer stored at these keys
call SaveTimerHandle(GST_Hash, GST_NewKey, GetHandleId(udg_GST_Trigger), t)
set udg_GST_RestartKey = -1
endif
// clean up memory leaks
set GST_Timer = t
set t = null
endfunction
endlibrary