//TESH.scrollpos=0
//TESH.alwaysfold=0
Name | Type | is_array | initial_value |
CB_Active | boolean | Yes | |
CB_Angle | real | Yes | |
CB_Caster | unit | Yes | |
CB_CurDistance | real | Yes | |
CB_Damage | real | Yes | |
CB_DamageDealt | real | Yes | |
CB_DamagedUnits | group | Yes | |
CB_Effect | effect | Yes | |
CB_Illusion | unit | No | |
CB_LeakPoint | location | Yes | |
CB_LoopIndex | integer | Yes | |
CB_MaxDamage | real | Yes | |
CB_MaxDistance | real | Yes | |
CB_Speed | real | Yes | |
DT_Attacktype | attacktype | Yes | |
DT_Damage | real | Yes | |
DT_DamagePerInterval | real | Yes | |
DT_DamageTypes | damagetype | Yes | |
DT_Dealers | unit | Yes | |
DT_Effects | effect | Yes | |
DT_Integers | integer | Yes | |
DT_IntervalReals | real | Yes | |
DT_ReachedDamage | real | Yes | |
DT_ReachedInterval | real | Yes | |
DT_Targets | unit | Yes | |
DTA_Attacktype | attacktype | No | |
DTA_DamageType | damagetype | No | |
DTA_DmgDealer | unit | No | |
DTA_EffectAttachmentPoint | string | No | |
DTA_Interval | real | No | |
DTA_SpecialEffect | string | No | |
DTA_Target | unit | No | |
DTA_Time | real | No | |
DTA_TotalDamageDealt | real | No | |
EG_Active | boolean | Yes | |
EG_Angle | real | Yes | |
EG_Caster | unit | Yes | |
EG_Damage | real | Yes | |
EG_Duration | real | Yes | |
EG_LeakPoint | location | Yes | |
EG_LoopIndex | integer | Yes | |
EG_Missile | unit | Yes | |
ET_Active | boolean | Yes | |
ET_Angle | real | Yes | |
ET_AOE | real | Yes | |
ET_Caster | unit | Yes | |
ET_Damage | real | Yes | |
ET_Duration | real | Yes | |
ET_LeakPoint | location | Yes | |
ET_LoopIndex | integer | Yes | |
ET_MaxPullSpeed | real | Yes | |
ET_Speed | real | Yes | |
ET_TempReal | real | Yes | |
ET_Twister | unit | Yes | |
FB_Active | boolean | Yes | |
FB_Angle | real | Yes | |
FB_AOE | real | Yes | |
FB_BurnDuration | real | Yes | |
FB_BurnInterval | real | Yes | |
FB_Caster | unit | Yes | |
FB_CurDistance | real | Yes | |
FB_Damage | real | Yes | |
FB_DamageOverTime | real | Yes | |
FB_Distance | real | Yes | |
FB_Height | real | Yes | |
FB_LeakPoint | location | Yes | |
FB_LoopIndex | integer | Yes | |
FB_Missile | unit | Yes | |
FB_Speed | real | Yes | |
FB_StartZ | real | Yes | |
FB_TempReal | real | Yes | |
GeneralInteger | integervar | No | |
IDS_Item | itemcode | Yes | |
IDS_NumOfItems | integer | No | |
IDS_PercentOfDropping | real | Yes | |
JB_Active | boolean | Yes | |
JB_Angle | real | Yes | |
JB_AOE | real | Yes | |
JB_Caster | unit | Yes | |
JB_CurDuration | real | Yes | |
JB_Damage | real | Yes | |
JB_Duration | real | Yes | |
JB_Effect | effect | Yes | |
JB_JumpHeight | real | Yes | |
JB_LeakPoint | location | Yes | |
JB_LoopIndex | integer | Yes | |
JB_Speed | real | Yes | |
KS_Active | boolean | Yes | |
KS_Angle | real | No | |
KS_AngleIndex | real | Yes | |
KS_AnglePont | location | Yes | |
KS_DestroyTrees | boolean | No | |
KS_DestroyTreesIndex | boolean | Yes | |
KS_KnockbackUnit | unit | No | |
KS_KnockbackUnitIndex | unit | Yes | |
KS_LeakPoint | location | Yes | |
KS_LoopIndex | integervar | Yes | |
KS_PausedDuringKnockback | boolean | No | |
KS_SfxString | string | No | |
KS_SfxString2 | string | No | |
KS_SfxStringIndex | string | Yes | |
KS_SfxStringIndex2 | string | Yes | |
KS_SfxTimer | integer | Yes | |
KS_SfxTimer2 | integer | Yes | |
KS_Speed | real | No | |
KS_SpeedIndex | real | Yes | |
KS_VectorLeakPoint | location | Yes | |
LS_Active | boolean | Yes | |
LS_Caster | unit | Yes | |
LS_CoolDown | real | Yes | |
LS_CurTarget | unit | Yes | |
LS_JumpsLeft | integer | Yes | |
LS_LeakPoint | location | Yes | |
LS_Level | integer | Yes | |
LS_LoopIndex | integer | Yes | |
LS_MaxDuration | real | Yes | |
LS_MaxLocusts | integer | No | |
LS_TempGroup | group | No | |
MD_Duration | real | No | |
MD_LeakPoint | location | No | |
MD_Unit | unit | No | |
RD_Active | boolean | Yes | |
RD_Angle | real | Yes | |
RD_Damage | real | Yes | |
RD_DamagedUnits | group | Yes | |
RD_Distance | real | Yes | |
RD_Effect1 | effect | Yes | |
RD_Effect2 | effect | Yes | |
RD_EffectTimer | real | Yes | |
RD_Knockback | boolean | Yes | |
RD_LeakPoint | location | Yes | |
RD_LoopIndex | integer | Yes | |
RD_SpeedMultiplicator | real | Yes | |
RD_Unit | unit | Yes | |
RD_WalkAim | integer | Yes | |
SB_LeakPoint | location | Yes | |
SB_RandomSize | real | No | |
SH_LeakPoint | location | Yes | |
SS_Active | boolean | Yes | |
SS_Angle | real | Yes | |
SS_CurSlams | integer | Yes | |
SS_Damage | real | Yes | |
SS_LeakPoint | location | Yes | |
SS_LoopIndex | integer | Yes | |
SS_MaxSlams | integer | Yes | |
SS_Slamer | unit | Yes | |
SS_StartLocation | location | Yes | |
TE_Duaration | real | No | |
TE_Effect | effect | No |
//TESH.scrollpos=0
//TESH.alwaysfold=0
//=====================================================================================
// by hell gate
//=====================================================================================
library Math initializer Init
globals
private location p = Location(0.,0.)
private item i
endglobals
function GetUnitZ takes unit u returns real
call MoveLocation(p,GetUnitX(u),GetUnitY(u))
return GetLocationZ(p)+GetUnitFlyHeight(u)
endfunction
function SetUnitZ takes unit u, real z returns nothing
call MoveLocation(p,GetUnitX(u),GetUnitY(u))
call SetUnitFlyHeight(u,z-GetLocationZ(p),0.)
endfunction
function PolarProjectionX takes real x, real angle, real dist returns real
return x+dist*Cos(angle*bj_DEGTORAD)
endfunction
function PolarProjectionY takes real y, real angle, real dist returns real
return y+dist*Sin(angle*bj_DEGTORAD)
endfunction
function CreateEffectAtLocForPlayer takes real x, real y, string file, player p returns effect
local string s
if GetLocalPlayer()==p then
set s=file
endif
return AddSpecialEffect(s,x,y)
endfunction
function CreateEffectOnUnitForPlayer takes widget target, string file, string attach, player p returns effect
local string s
if GetLocalPlayer()==p then
set s=file
endif
return AddSpecialEffectTarget(s,target,attach)
endfunction
// sorry can't rember the the creator of this function :(
function IsLocPathable takes real x, real y returns boolean
local real tx = x
local real ty = y
call SetItemVisible(i,true)
call SetItemPosition(i,x,y)
set tx = GetItemX(i) - tx
set ty = GetItemY(i) - ty
call SetItemVisible(i,false)
return (tx < 1. and tx > -1. and ty < 1. and ty > -1.)
endfunction
private function Init takes nothing returns nothing
set i = CreateItem('kysn',0,0)
call SetItemVisible(i,false)
endfunction
endlibrary
//TESH.scrollpos=63
//TESH.alwaysfold=0
library SeismicSlam
globals
private constant integer SPELL_ID = 'A001'
private constant real REFRESH_TIME = .05
private constant real DISTANCE_BETWEEN_SLAMS = 80.
private constant real AOE_RANGE = 80.
private constant string EffectModel = "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl"
private constant real Variation = 10.
endglobals
private struct SeismicWave
unit Caster
integer Level
integer Slams = 0
real StartX
real StartY
real Angle
private integer i
private static timer Tim = CreateTimer()
private static integer Total = 0
private static thistype array SeismicWaves
private static group g = CreateGroup()
private static thistype temp
//============================ settings ==============================
private static method NumberOfSlams takes integer lvl returns integer
return 5+(3*lvl)
endmethod
private static method GetDamage takes integer lvl returns real
return 100.+(25.*lvl)
endmethod
//========================== end of settings =========================
private static method Damage takes nothing returns nothing
//filter here
//if blabla == lol then
call UnitDamageTarget(temp.Caster,GetEnumUnit(),thistype.GetDamage(temp.Level),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
//endif
endmethod
private method onDestroy takes nothing returns nothing
set Total = Total - 1
set SeismicWaves[i] = SeismicWaves[Total]
set SeismicWaves[i].i=i
if Total == 0 then
call PauseTimer(Tim)
endif
endmethod
private static method onLoop takes nothing returns nothing
local thistype dat
local integer i2 = 0
local real curx
local real cury
local real anglevariation
loop
exitwhen i2 > Total - 1
set dat = SeismicWaves[i2]
if dat.Slams < NumberOfSlams(dat.Level) then
set anglevariation = GetRandomReal(-Variation,Variation)*bj_DEGTORAD
set curx = dat.StartX + DISTANCE_BETWEEN_SLAMS*dat.Slams*Cos(dat.Angle+ anglevariation)
set cury = dat.StartY + DISTANCE_BETWEEN_SLAMS*dat.Slams*Sin(dat.Angle+ anglevariation)
set dat.Slams = dat.Slams+1
set temp = dat
call GroupEnumUnitsInRange(g,curx,cury,AOE_RANGE,null)
call ForGroup(g,function thistype.Damage)
call DestroyEffect(AddSpecialEffect(EffectModel,curx,cury))
else
call dat.destroy()
endif
set i2 = i2+1
endloop
endmethod
private static method Check takes nothing returns boolean
local thistype dat
if GetSpellAbilityId() == SPELL_ID then
set dat = thistype.allocate()
if Total==0 then
call TimerStart(Tim,REFRESH_TIME,true,function thistype.onLoop)
endif
set dat.i=Total
set SeismicWaves[dat.i] = dat
set Total = Total+1
set dat.Caster = GetTriggerUnit()
set dat.Level = GetUnitAbilityLevel(dat.Caster,SPELL_ID)
set dat.StartX = GetUnitX(dat.Caster)
set dat.StartY = GetUnitY(dat.Caster)
set dat.Angle = Atan2(GetSpellTargetY() - dat.StartY,GetSpellTargetX() - dat.StartX)
if dat.Angle == 0 then
set dat.Angle = GetUnitFacing(dat.Caster)*0.017453293
endif
endif
return false
endmethod
private static method onInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function thistype.Check))
//call Preload(EffectModel)
endmethod
endstruct
endlibrary