function H2I takes handle h returns integer
return h
return 0
endfunction
// ***************************
function LocalVars takes nothing returns gamecache
if udg_GameCache == null then
set udg_GameCache = InitGameCache("jasslocalvars.w3v")
endif
return udg_GameCache
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 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 GetHandleLocation takes handle subject, string name returns location
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
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 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 GetHandleTimerDialog takes handle subject, string name returns timerdialog
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleTextTag takes handle subject, string name returns texttag
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 FlushHandleLocals takes handle subject returns nothing
call FlushStoredMission(LocalVars(), I2S(H2I(subject)) )
endfunction
function FlushHandle takes handle subject returns nothing
call FlushStoredMission(LocalVars(),I2S(H2I(subject)))
endfunction
Name | Type | is_array | initial_value |
GameCache | gamecache | No | |
n | integer | No | 1 |
p1 | unit | No | |
p2 | unit | No | |
p3 | unit | No | |
p4 | unit | No | |
Player1PT | unit | No | |
Player2PT | unit | No | |
Player3PT | unit | No | |
Player4PT | unit | No | |
Revivelocations | rect | No | |
Teleport | unit | No | |
Timer | timer | No |
//¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//¤
//¤ *****************
//¤ - Sacred Circle -
//¤ *****************
//¤
//¤ By: Daxtreme
//¤
//¤ --> How to implement in your map:
//¤
//¤ 1. Copy the game cache variable named "GameCache" in your map.
//¤ 2. Copy the spell "Sacred Circle" in your map.
//¤ 3. Copy everything found in the "Custom script code" section. To do this, click
//¤ on the name of the map in the top-left corner in the trigger editor.
//¤ 4. Make a variable called "GameCache".
//¤ 5. Copy this trigger into your map.
//¤ 6. Import the HolyStrike.mdx model in your map.
//¤
//¤ --> How to customize it:
//¤
//¤ You can configure the spell using the constant functions just below. Change their values.
//¤
//¤ CREDITS:
//¤
//¤ - JetFangInferno's Holy Strike.
//¤ - KaTTaNa's Local Handle Variables.
//¤
//¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
constant function SacredCircle_RawCode takes nothing returns integer
return 'A000'
// Ability raw code.
endfunction
constant function SacredCircle_OrderId takes nothing returns integer
return 852183
// Order Id of Sacred Circle (Starfall). If you change the order string of Sacred Circle, make sure
// you convert it to Id.
endfunction
constant function SacredCircle_StrikeDmg takes integer level returns integer
return 25
// Damage per strike. There is about 100 strikes total, varies with duration.
endfunction
constant function SacredCircle_StrikeInterval takes integer level returns real
return 0.15 - 0.00 * level
// Time between each strike.
endfunction
constant function SacredCircle_DamageRadius takes integer level returns real
return 175.00 + 0.00 * level
// AoE radius used to damage units around each strike.
endfunction
constant function SacredCircle_CheckMagicImmune takes unit targ returns boolean
return IsUnitType(targ, UNIT_TYPE_MAGIC_IMMUNE) == false
// Magic Immunity check.
endfunction
constant function SacredCircle_CheckEnemy takes unit targ, player p returns boolean
return IsUnitEnemy(targ, p)
// Enemy check.
endfunction
constant function SacredCircle_EffectArt takes nothing returns string
return "war3mapImported\\HolyStrike.mdx"
// Path of the effect art.
endfunction
constant function SacredCircle_AttackType takes nothing returns attacktype
return ATTACK_TYPE_CHAOS
// Attack type. Examples: Chaos, magic, siege, piercing.
endfunction
constant function SacredCircle_DamageType takes nothing returns damagetype
return DAMAGE_TYPE_FIRE
// Damage type. Examples: Divine, Fire, Cold, Lightning, Acid.
endfunction
//==============================================================
function SacredCircle_Actions_Loop takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit cast = GetHandleUnit(t, "cast")
local real lx = GetUnitX(cast)
local real ly = GetUnitY(cast)
local real angle = GetHandleReal(t, "angle")
local real r = GetHandleReal(t, "r")
local player p
local unit targ
local real x = lx + ( 50 + r * 10 ) * Cos( angle * bj_DEGTORAD )
local real y = ly + ( 50 + r * 10 ) * Sin( angle * bj_DEGTORAD )
local integer i = GetUnitAbilityLevel(cast, SacredCircle_RawCode())
local boolexpr b = null
local group g
if ( GetUnitCurrentOrder(cast) != SacredCircle_OrderId() ) then
set cast = null
call FlushHandleLocals(t)
call PauseTimer(t)
call DestroyTimer(t)
return
endif
set g = CreateGroup()
set p = GetOwningPlayer(cast)
call DestroyEffect( AddSpecialEffect(SacredCircle_EffectArt(), x, y) )
call GroupEnumUnitsInRange(g, x, y, SacredCircle_DamageRadius(i), b)
loop
set targ = FirstOfGroup(g)
exitwhen targ == null
if targ != cast and SacredCircle_CheckEnemy(targ, p) and SacredCircle_CheckMagicImmune(targ) and GetWidgetLife(targ) > 0 then
call UnitDamageTarget(cast, targ, SacredCircle_StrikeDmg(i), true, false, SacredCircle_AttackType(), SacredCircle_DamageType(), null)
endif
call GroupRemoveUnit(g, targ)
endloop
call SetHandleReal(t, "angle", angle + 24. - r / 6)
call SetHandleReal(t, "r", r + 1)
call DestroyGroup(g)
call DestroyBoolExpr(b)
set t = null
set g = null
set p = null
set cast = null
endfunction
function SacredCircle_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit cast = GetTriggerUnit()
local integer i = GetUnitAbilityLevel(cast, SacredCircle_RawCode())
call SetHandleHandle(t, "cast", cast)
call TimerStart(t, SacredCircle_StrikeInterval(i), true, function SacredCircle_Actions_Loop)
set t = null
set cast = null
endfunction
//===========================================================================
//Event and Condition
function SacredCircle_Conditions takes nothing returns boolean
return GetSpellAbilityId() == SacredCircle_RawCode()
endfunction
function InitTrig_SacredCircle takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( t, Condition( function SacredCircle_Conditions ) )
call TriggerAddAction( t, function SacredCircle_Actions )
call Preload(SacredCircle_EffectArt())
set t = null
endfunction