//TESH.scrollpos=82
//TESH.alwaysfold=0
//Kattana's Handle Vars//
function H2I takes handle h returns integer
return h
return 0
endfunction
function LocalVars takes nothing returns gamecache
// Replace InitGameCache("jasslocalvars.w3v") with a global variable!!
return InitGameCache("jasslocalvars.w3v")
endfunction
function SetHandleHandle takes handle subject, string name, handle value returns nothing
if value==null then
call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
else
call StoreInteger(LocalVars(), I2S(H2I(subject)), name, H2I(value))
endif
endfunction
function SetHandleInt takes handle subject, string name, integer value returns nothing
if value==0 then
call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
else
call StoreInteger(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
function SetHandleBoolean takes handle subject, string name, boolean value returns nothing
if value==false then
call FlushStoredBoolean(LocalVars(),I2S(H2I(subject)),name)
else
call StoreBoolean(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
function SetHandleReal takes handle subject, string name, real value returns nothing
if value==0 then
call FlushStoredReal(LocalVars(), I2S(H2I(subject)), name)
else
call StoreReal(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
function SetHandleString takes handle subject, string name, string value returns nothing
if value==null then
call FlushStoredString(LocalVars(), I2S(H2I(subject)), name)
else
call StoreString(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
function GetHandleHandle takes handle subject, string name returns handle
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleInt takes handle subject, string name returns integer
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleBoolean takes handle subject, string name returns boolean
return GetStoredBoolean(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleReal takes handle subject, string name returns real
return GetStoredReal(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleString takes handle subject, string name returns string
return GetStoredString(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleUnit takes handle subject, string name returns unit
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleTimer takes handle subject, string name returns timer
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleTrigger takes handle subject, string name returns trigger
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleEffect takes handle subject, string name returns effect
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleGroup takes handle subject, string name returns group
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleLightning takes handle subject, string name returns lightning
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleWidget takes handle subject, string name returns widget
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function FlushHandleLocals takes handle subject returns nothing
call FlushStoredMission(LocalVars(), I2S(H2I(subject)) )
endfunction
Name | Type | is_array | initial_value |
//TESH.scrollpos=69
//TESH.alwaysfold=0
//===============================Dragon Roar By BlackShogun==============================//
//=========================================Setup=========================================//
//Note: to edit the spells DAMAGE, change the damage parameter in the DRAGON ROAR DUMMY spell
//change this to the raw code of your trigger spell
constant function DragonRoarCode takes nothing returns integer
return 'A000'
endfunction
//change this to the raw code of your dummy caster
constant function DragonRoarDummy takes nothing returns integer
return 'h000'
endfunction
//change this to the raw code of your dummy spell (the spell that will be repeated to create the wave)
constant function DragonRoarRawCode takes nothing returns integer
return 'A001'
endfunction
//change this to the order id of your dummy spell (the spell that will be repeated to create the wave)
constant function DragonRoarID takes nothing returns string
return "clusterrockets"
endfunction
//change this to edit the number of parts to the wave
function DragonRoarRepeats takes real lvl returns real
return 4+(2*lvl)
endfunction
//change this to edit the distance between each part of the wave
constant function DragonRoarDistance takes nothing returns real
return 100.0
endfunction
//change this to edit the time between each part of the wave
constant function DragonRoarInterval takes nothing returns real
return 0.25
endfunction
//change this to edit the caster dummies lifespan (recommended 3.0)
constant function DragonRoarDummySpan takes nothing returns real
return 3.0
endfunction
//======================================End Setup=======================================//
//Note: Changing anything beyond here may stop the trigger from functioning and should be left alone
function Trig_Dragon_Roar_Conditions takes nothing returns boolean
return GetSpellAbilityId() == DragonRoarCode()
endfunction
function Dragon_Roar takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit cast = GetHandleUnit(t, "cast")
local real angle = GetHandleReal(t, "angle")
local real z = GetHandleReal(t, "z")
local real x1 = GetHandleReal(t, "x1")
local real y1 = GetHandleReal(t, "y1")
local integer lvl = GetUnitAbilityLevel(cast, DragonRoarCode())
local player p = GetOwningPlayer(cast)
local real mx = DragonRoarDistance() * Cos(angle * 0.01745)
local real my = DragonRoarDistance() * Sin(angle * 0.01745)
local unit u
if z<DragonRoarRepeats(lvl) then
set z = z+1
call SetHandleReal(t, "z", z)
set u = CreateUnit(p, DragonRoarDummy(), x1, y1, angle)
call SetUnitAbilityLevel(u, DragonRoarRawCode(), lvl)
call IssuePointOrder(u, DragonRoarID(), (x1 + (mx * z)), (y1 + (my * z)))
call UnitApplyTimedLife(u, 'BTLF', DragonRoarDummySpan())
else
call FlushHandleLocals(t)
call PauseTimer(t)
call DestroyTimer(t)
set t = null
endif
set cast = null
set p = null
set u = null
endfunction
function Trig_Dragon_Roar_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit cast = GetTriggerUnit()
local location targ = GetSpellTargetLoc()
local real x1 = GetUnitX(cast)
local real y1 = GetUnitY(cast)
local real x2 = GetLocationX(targ)
local real y2 = GetLocationY(targ)
local real angle = 57.29583 * Atan2(y2-y1, x2-x1)
call SetHandleHandle(t, "cast", cast)
call SetHandleReal(t, "angle", angle)
call SetHandleReal(t, "x1", x1)
call SetHandleReal(t, "y1", y1)
call TimerStart(t, DragonRoarInterval(), true, function Dragon_Roar)
set t = null
call RemoveLocation(targ)
set targ = null
set cast = null
endfunction
//===========================================================================
function InitTrig_Dragon_Roar takes nothing returns nothing
set gg_trg_Dragon_Roar = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Dragon_Roar, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Dragon_Roar, Condition( function Trig_Dragon_Roar_Conditions ) )
call TriggerAddAction( gg_trg_Dragon_Roar, function Trig_Dragon_Roar_Actions )
endfunction
//TESH.scrollpos=62
//TESH.alwaysfold=0
//===============================Ice Wave By BlackShogun==============================//
//=========================================Setup=========================================//
//Note: to edit the spells DAMAGE, change the damage parameter in the Ice Wave DUMMY spell
//change this to the raw code of your trigger spell
constant function IceWaveCode takes nothing returns integer
return 'A002'
endfunction
//change this to the raw code of your dummy caster
constant function IceWaveDummy takes nothing returns integer
return 'h000'
endfunction
//change this to the raw code of your dummy spell (the spell that will be repeated to create the wave)
constant function IceWaveRawCode takes nothing returns integer
return 'A003'
endfunction
//change this to the order id of your dummy spell (the spell that will be repeated to create the wave)
constant function IceWaveID takes nothing returns string
return "thunderclap"
endfunction
//change this to edit the number of parts to the wave
function IceWaveRepeats takes real lvl returns real
return 8+(4*lvl)
endfunction
//change this to edit the distance between each part of the wave
constant function IceWaveDistance takes nothing returns real
return 50.0
endfunction
//change this to edit the time between each part of the wave
function IceWaveInterval takes real lvl returns real
return 0.3-(0.05*lvl)
endfunction
//change this to edit the caster dummies lifespan (recommended 3.0)
constant function IceWaveDummySpan takes nothing returns real
return 3.0
endfunction
//======================================End Setup=======================================//
//Note: Changing anything beyond here may stop the trigger from functioning and should be left alone
function Trig_Ice_Wave_Conditions takes nothing returns boolean
return GetSpellAbilityId() == IceWaveCode()
endfunction
function Ice_Wave takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit cast = GetHandleUnit(t, "cast")
local real angle = GetHandleReal(t, "angle")
local real z = GetHandleReal(t, "z")
local real x1 = GetHandleReal(t, "x1")
local real y1 = GetHandleReal(t, "y1")
local integer lvl = GetUnitAbilityLevel(cast, IceWaveCode())
local player p = GetOwningPlayer(cast)
local real mx = IceWaveDistance() * Cos(angle * 0.01745)
local real my = IceWaveDistance() * Sin(angle * 0.01745)
local unit u
if z<IceWaveRepeats(lvl) then
set z = z+1
call SetHandleReal(t, "z", z)
set u = CreateUnit(p, IceWaveDummy(), x1 + (mx * z), y1 + (my * z), angle)
call SetUnitAbilityLevel(u, IceWaveRawCode(), lvl)
call IssueImmediateOrder(u, IceWaveID())
call UnitApplyTimedLife(u, 'BTLF', IceWaveDummySpan())
else
call FlushHandleLocals(t)
call PauseTimer(t)
call DestroyTimer(t)
set t = null
endif
set cast = null
set p = null
set u = null
endfunction
function Trig_Ice_Wave_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit cast = GetTriggerUnit()
local location targ = GetSpellTargetLoc()
local integer lvl = GetUnitAbilityLevel(cast, IceWaveCode())
local real x1 = GetUnitX(cast)
local real y1 = GetUnitY(cast)
local real x2 = GetLocationX(targ)
local real y2 = GetLocationY(targ)
local real angle = 57.29583 * Atan2(y2-y1, x2-x1)
call SetHandleHandle(t, "cast", cast)
call SetHandleReal(t, "angle", angle)
call SetHandleReal(t, "x1", x1)
call SetHandleReal(t, "y1", y1)
call TimerStart(t, IceWaveInterval(lvl), true, function Ice_Wave)
set t = null
call RemoveLocation(targ)
set targ = null
set cast = null
endfunction
//===========================================================================
function InitTrig_Ice_Wave takes nothing returns nothing
set gg_trg_Ice_Wave = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Ice_Wave, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Ice_Wave, Condition( function Trig_Ice_Wave_Conditions ) )
call TriggerAddAction( gg_trg_Ice_Wave, function Trig_Ice_Wave_Actions )
endfunction