//TESH.scrollpos=421
//TESH.alwaysfold=0
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Доброго времени суток. Мой ник DazzleFirst и сегодня представляю вашему вниманию Сборник Систем (4 шт.)
// Эти системы были созданы благодаря людям из "hiveworkshop.com" и "xgm.guru".
//
// А именно:
// xgm.guru: Blade.dk (Stomp spell), Nerevar (remake Stomp spell)
// hiveworkshop.com: BPower (StunEngine), Bribe (GUI Unit Indexer), Nestharus (лично не помогал, но его работы...), Paladon (New ShockWave)
//
// Здесь используются системы переделанные лично мной для простоты их использования лично мной. К ним даны примеры (3 примера).
// Первый пример: пассивная способность "Оглушение" (На подобии пассивной способности Barathrum в карте от IceFrog'а - DotA)
// Второй пример: активная способность "Громовая поступь" с новыми свойствами. (Благодаря чему и произошла идея переделывания способностей под системы, и дальнейшее их использование.)
// Третий пример: активная способность "Волна Силы" с новыми свойствами. (Первоначально видел работу от Paladon из "hiveworkshop.com", однако она меня не впечатлила. Теперь же с радостью представляю свою работу со своими дырками и неудобствами.)
//
// Все сделано на чистом JASS коде. Сделано для простоты чтения и переделывания кода под себя.
// Так же даю знать, что в этих системах НЕТ НИОДНОГО ПОЯСНЕНИЯ, то есть в коде придется разбираться самим.
//
// Отдельная БЛАГОДАРНОСТЬ авторам: Blade.dk, Nerevar, BPower, Bribe, Nestharus, Paladon
globals
constant real SystemsInterval=0.03125000
unit array KB_Unit
timer KB_Timer=CreateTimer()
integer KB_MAX=0
real array KB_X
real array KB_Y
real array KB_Speed
real array KB_DecSpeed
real array KB_Distance
real array KB_Height
real array KB_Sn
real array KB_Time
constant integer KB_Ability='A002'
constant integer KB_Buff='B000'
integer BuffSystem_MAX=0
timer BuffSystem_Timer=CreateTimer()
unit array BuffSystem_Unit
real array BuffSystem_Ability
real array BuffSystem_Time
unit StunSystem_Dummy=null
constant integer StunSystem_DummyID='u000'
constant integer StunSystem_DummyAbility='A003'
constant integer StunSystem_Buff='BSTN'
unit array WaveSystem_Caster
group array WaveSystem_Group
unit array WaveSystem_Dummy
real array WaveSystem_Range
real array WaveSystem_RangeMax
real array WaveSystem_AoEmin
real array WaveSystem_AoEmax
real array WaveSystem_Dmg
real array WaveSystem_DecDmg
real array WaveSystem_Angle
real array WaveSystem_Speed
integer WaveSystem_Max=0
timer WaveSystem_Timer=CreateTimer()
constant integer WaveSystem_DummyID='u000'
boolean array WaveSystem_UseKB
real array WaveSystem_KBtime
real array WaveSystem_KBspeed
real array WaveSystem_KBespeed
real array WaveSystem_KBheight
endglobals
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//BuffSystem//
////////////////////////////////////////////////////////////////////////////////////////////////////////////
constant function BuffSystem_Abilitys takes real r returns integer
if r==0.0 then
return KB_Ability
elseif r==0.1 then
return KB_Buff
elseif r==1.1 then
return StunSystem_Buff
endif
return 0
endfunction
function BuffSystem_Checker takes unit u, real r, real time returns boolean
local integer i=0
loop
exitwhen i==BuffSystem_MAX
if u==BuffSystem_Unit[i] and r==BuffSystem_Ability[i] and time>BuffSystem_Time[i] then
set BuffSystem_Time[i]=time
return false
endif
set i=i+1
endloop
return true
endfunction
function BuffSystem_Periodic takes nothing returns nothing
local integer i = 0
loop
exitwhen i == BuffSystem_MAX
if BuffSystem_Time[i]>0.0 then
set BuffSystem_Time[i]=BuffSystem_Time[i] - SystemsInterval
else
if UnitMakeAbilityPermanent(BuffSystem_Unit[i],false,BuffSystem_Abilitys(BuffSystem_Ability[i])) then
call UnitRemoveAbility(BuffSystem_Unit[i], BuffSystem_Abilitys(BuffSystem_Ability[i]))
endif
call UnitRemoveAbility(BuffSystem_Unit[i], BuffSystem_Abilitys(BuffSystem_Ability[i]+0.1))
set BuffSystem_MAX = BuffSystem_MAX - 1
set BuffSystem_Time[i] = BuffSystem_Time[BuffSystem_MAX]
set BuffSystem_Ability[i] = BuffSystem_Ability[BuffSystem_MAX]
set BuffSystem_Unit[i] = BuffSystem_Unit[BuffSystem_MAX]
set BuffSystem_Unit[BuffSystem_MAX] = null
set BuffSystem_Time[BuffSystem_MAX]=0.
set BuffSystem_Ability[BuffSystem_MAX]=0.
set i = i - 1
if (0 == BuffSystem_MAX) then
call PauseTimer(BuffSystem_Timer)
endif
endif
set i = i + 1
endloop
endfunction
function BuffSystem takes unit u, real r, real time returns nothing
if BuffSystem_Checker(u,r,time) then
if BuffSystem_MAX==0 then
call TimerStart(BuffSystem_Timer,SystemsInterval, true, function BuffSystem_Periodic)
endif
if UnitAddAbility(u, BuffSystem_Abilitys(r)) then
call UnitMakeAbilityPermanent(u,true,BuffSystem_Abilitys(r))
endif
set BuffSystem_Unit[BuffSystem_MAX]=u
set BuffSystem_Ability[BuffSystem_MAX]=r
set BuffSystem_Time[BuffSystem_MAX]=time
set BuffSystem_MAX=BuffSystem_MAX+1
endif
set u=null
endfunction
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//KnockBackSystem//
////////////////////////////////////////////////////////////////////////////////////////////////////////////
function KBSystem_Checker takes unit u, real x, real y, real espeed, real time, real speed, real height returns boolean
local integer i=0
loop
exitwhen i==KB_MAX
if u==KB_Unit[i] and time>KB_Time[i] then
set KB_Time[i]=time
set KB_Speed[i]=KB_Speed[i]+speed*SystemsInterval
set KB_DecSpeed[i]=(speed-espeed)/(time/SystemsInterval)*SystemsInterval
set KB_X[i]=x
set KB_Y[i]=y
set KB_Distance[i]=0
set KB_Height[i]=(KB_Height[i]+height)/2
set KB_Sn[i]=(KB_Sn[i]+(speed+espeed)/2*(time/SystemsInterval)*SystemsInterval)/2
return false
endif
set i=i+1
endloop
return true
endfunction
function Parabola takes real h, real d, real x returns real
return (4 * h / d) * (d - x) * (x / d)
endfunction
function KB_Periodic takes nothing returns nothing
local integer i = 0
local real xt
local real yt
local real angle
local real height
loop
exitwhen i == KB_MAX
if (0.00 < KB_Time[i]) then
set KB_Time[i] = KB_Time[i] - SystemsInterval
set xt=GetUnitX(KB_Unit[i])
set yt=GetUnitY(KB_Unit[i])
set angle=Atan2(yt-KB_Y[i], xt-KB_X[i])
set KB_Speed[i]=KB_Speed[i] - KB_DecSpeed[i]
if not IsTerrainPathable(xt+KB_Speed[i]*Cos(angle),yt+KB_Speed[i]*Sin(angle),PATHING_TYPE_WALKABILITY) then
call SetUnitX(KB_Unit[i],xt+KB_Speed[i]*Cos(angle))
call SetUnitY(KB_Unit[i],yt+KB_Speed[i]*Sin(angle))
//call SetUnitPosition(KB_Unit[i],xt+KB_Speed[i]*Cos(angle),yt+KB_Speed[i]*Sin(angle))
set KB_Distance[i]=KB_Distance[i]+KB_Speed[i]*1.25
endif
if not IsUnitType(KB_Unit[i],UNIT_TYPE_FLYING) and not (KB_Height[i]<=0.) then
set height=Parabola(KB_Height[i],KB_Sn[i],KB_Distance[i])
if height<0 then
set height=0
endif
call SetUnitFlyHeight(KB_Unit[i],height,0.)
endif
else
if not IsUnitType(KB_Unit[i],UNIT_TYPE_FLYING) then
call SetUnitFlyHeight(KB_Unit[i],0,0.)
endif
set KB_MAX = KB_MAX - 1
set KB_X[i]=KB_X[KB_MAX]
set KB_Y[i]=KB_Y[KB_MAX]
set KB_Time[i]=KB_Time[KB_MAX]
set KB_Speed[i]=KB_Speed[KB_MAX]
set KB_DecSpeed[i]=KB_DecSpeed[KB_MAX]
set KB_Distance[i]=KB_Distance[KB_MAX]
set KB_Height[i]=KB_Height[KB_MAX]
set KB_Sn[i]=KB_Sn[KB_MAX]
set KB_Unit[i]=KB_Unit[KB_MAX]
set KB_X[KB_MAX]=0.
set KB_Y[KB_MAX]=0.
set KB_Time[KB_MAX]=0.
set KB_Speed[KB_MAX]=0.
set KB_DecSpeed[KB_MAX]=0.
set KB_Distance[KB_MAX]=0.
set KB_Height[KB_MAX]=0.
set KB_Sn[KB_MAX]=0.
set KB_Unit[KB_MAX] = null
set i = i - 1
if (0 == KB_MAX) then
call PauseTimer(KB_Timer)
endif
endif
set i = i + 1
endloop
set i = 0
set xt=0.
set yt=0.
set height=0.
set angle=0.
endfunction
function KBSystem takes unit u, real x, real y, real time, real speed, real espeed, real height, boolean show returns nothing
if show then
call BuffSystem(u,0.,time)
endif
if KB_MAX==0 then
call TimerStart(KB_Timer,SystemsInterval, true, function KB_Periodic)
endif
if KBSystem_Checker(u,x,y,espeed,time,speed,height) then
if UnitAddAbility(u,'Amrf') then
call UnitRemoveAbility(u,'Amrf')
endif
set KB_Unit[KB_MAX]=u
set KB_Time[KB_MAX]=time
set KB_Speed[KB_MAX]=speed*SystemsInterval
set KB_DecSpeed[KB_MAX]=(speed-espeed)/(time/SystemsInterval)*SystemsInterval
set KB_X[KB_MAX]=x
set KB_Y[KB_MAX]=y
set KB_Distance[KB_MAX]=0
set KB_Height[KB_MAX]=height
set KB_Sn[KB_MAX]=(speed+espeed)/2*(time/SystemsInterval)*SystemsInterval
set KB_MAX=KB_MAX+1
endif
call DestroyEffect(AddSpecialEffectTarget( GetAbilityEffectById('A000', EFFECT_TYPE_MISSILE, 1),u, GetAbilityEffectById('A000', EFFECT_TYPE_MISSILE, 2)))
set u = null
set x=0.
set y=0.
set time=0.
set speed=0.
set espeed=0.
set height=0.
endfunction
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//StunSystem//
////////////////////////////////////////////////////////////////////////////////////////////////////////////
function StunSystem takes unit u, real time returns nothing
local unit t
local group g
local group gg
if 0 == GetUnitAbilityLevel(u, BuffSystem_Abilitys(1.1)) then
set g=CreateGroup()
set gg=CreateGroup()
call GroupEnumUnitsInRange(g,GetUnitX(u),GetUnitY(u),50,null)
loop
set t=FirstOfGroup(g)
exitwhen t==null
if GetUnitState(t,UNIT_STATE_LIFE)>0.405 and not IsUnitType(t,UNIT_TYPE_STRUCTURE) and not IsUnit(t,u) then
call SetUnitX(t,GetUnitX(t)+500)
call SetUnitY(t,GetUnitY(t)+500)
endif
call GroupAddUnit(gg,t)
call GroupRemoveUnit(g,t)
endloop
call SetUnitX(StunSystem_Dummy, GetUnitX(u))
call SetUnitY(StunSystem_Dummy, GetUnitY(u))
call IssueImmediateOrderById(StunSystem_Dummy, 852127)
call SetUnitPosition(StunSystem_Dummy ,0,0)
loop
set t=FirstOfGroup(gg)
exitwhen t==null
if GetUnitState(t,UNIT_STATE_LIFE)>0.405 and not IsUnitType(t,UNIT_TYPE_STRUCTURE) and not IsUnit(t,u) then
call SetUnitX(t,GetUnitX(t)-500)
call SetUnitY(t,GetUnitY(t)-500)
endif
call GroupRemoveUnit(gg,t)
endloop
endif
call BuffSystem(u,1.0,time)
set u = null
set time = 0.00
call DestroyGroup(g)
call DestroyGroup(gg)
set gg=null
set g=null
set t=null
endfunction
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//WaveSystem//
////////////////////////////////////////////////////////////////////////////////////////////////////////////
function WaveSystem_Periodic takes nothing returns nothing
local integer i=0
local unit t=null
local group g=null
local real x=0
local real y=0
local real AoE=0
loop
exitwhen i==WaveSystem_Max
if WaveSystem_Range[i]<WaveSystem_RangeMax[i] then
set WaveSystem_Range[i]=WaveSystem_Range[i]+WaveSystem_Speed[i]
set x=GetUnitX(WaveSystem_Dummy[i])+WaveSystem_Speed[i]*Cos(WaveSystem_Angle[i])
set y=GetUnitY(WaveSystem_Dummy[i])+WaveSystem_Speed[i]*Sin(WaveSystem_Angle[i])
call SetUnitPosition(WaveSystem_Dummy[i],x,y)
set AoE=WaveSystem_AoEmin[i]+(WaveSystem_AoEmax[i]-WaveSystem_AoEmin[i])/WaveSystem_RangeMax[i]*WaveSystem_Range[i]
if AoE>WaveSystem_AoEmax[i] then
set AoE=WaveSystem_AoEmax[i]
elseif AoE<WaveSystem_AoEmin[i] then
set AoE=WaveSystem_AoEmin[i]
endif
set g=CreateGroup()
call GroupEnumUnitsInRange(g,x,y,AoE,null)
loop
set t=FirstOfGroup(g)
exitwhen t==null
if IsUnitEnemy(t,GetOwningPlayer(WaveSystem_Caster[i])) and GetUnitState(t,UNIT_STATE_LIFE)>0.405 and not IsUnitInGroup(t,WaveSystem_Group[i]) and not IsUnitType(t,UNIT_TYPE_FLYING) then
call UnitDamageTarget(WaveSystem_Caster[i],t,WaveSystem_Dmg[i],false,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,null)
set WaveSystem_Dmg[i]=WaveSystem_Dmg[i]*WaveSystem_DecDmg[i]
if WaveSystem_UseKB[i] then
call KBSystem(t,x,y,WaveSystem_KBtime[i],WaveSystem_KBspeed[i],WaveSystem_KBespeed[i],WaveSystem_KBheight[i],false)
set WaveSystem_KBspeed[i]=WaveSystem_KBspeed[i]*WaveSystem_DecDmg[i]
set WaveSystem_KBtime[i]=WaveSystem_KBtime[i]*WaveSystem_DecDmg[i]
set WaveSystem_KBespeed[i]=WaveSystem_KBespeed[i]*WaveSystem_DecDmg[i]
set WaveSystem_KBheight[i]=WaveSystem_KBheight[i]*WaveSystem_DecDmg[i]
endif
call GroupAddUnit(WaveSystem_Group[i],t)
endif
call GroupRemoveUnit(g,t)
endloop
call DestroyGroup(g)
else
call RemoveUnit(WaveSystem_Dummy[i])
set WaveSystem_Max=WaveSystem_Max-1
set g=WaveSystem_Group[i]
set WaveSystem_Caster[i]=WaveSystem_Caster[WaveSystem_Max]
set WaveSystem_Group[i]=WaveSystem_Group[WaveSystem_Max]
set WaveSystem_Dummy[i]=WaveSystem_Dummy[WaveSystem_Max]
set WaveSystem_Range[i]=WaveSystem_Range[WaveSystem_Max]
set WaveSystem_RangeMax[i]=WaveSystem_RangeMax[WaveSystem_Max]
set WaveSystem_AoEmin[i]=WaveSystem_AoEmin[WaveSystem_Max]
set WaveSystem_AoEmax[i]=WaveSystem_AoEmax[WaveSystem_Max]
set WaveSystem_Dmg[i]=WaveSystem_Dmg[WaveSystem_Max]
set WaveSystem_DecDmg[i]=WaveSystem_DecDmg[WaveSystem_Max]
set WaveSystem_Angle[i]=WaveSystem_Angle[WaveSystem_Max]
set WaveSystem_Speed[i]=WaveSystem_Speed[WaveSystem_Max]
set WaveSystem_UseKB[i]=WaveSystem_UseKB[WaveSystem_Max]
set WaveSystem_KBtime[i]=WaveSystem_KBtime[WaveSystem_Max]
set WaveSystem_KBspeed[i]=WaveSystem_KBspeed[WaveSystem_Max]
set WaveSystem_KBespeed[i]=WaveSystem_KBespeed[WaveSystem_Max]
set WaveSystem_KBheight[i]=WaveSystem_KBheight[WaveSystem_Max]
set WaveSystem_Caster[WaveSystem_Max]=null
set WaveSystem_Group[WaveSystem_Max]=g
call DestroyGroup(WaveSystem_Group[WaveSystem_Max])
call DestroyGroup(g)
set WaveSystem_Group[WaveSystem_Max]=null
set WaveSystem_Dummy[WaveSystem_Max]=null
set WaveSystem_Range[WaveSystem_Max]=0.
set WaveSystem_RangeMax[WaveSystem_Max]=0.
set WaveSystem_AoEmin[WaveSystem_Max]=0.
set WaveSystem_AoEmax[WaveSystem_Max]=0.
set WaveSystem_Dmg[WaveSystem_Max]=0.
set WaveSystem_DecDmg[WaveSystem_Max]=0.
set WaveSystem_Angle[WaveSystem_Max]=0.
set WaveSystem_Speed[WaveSystem_Max]=0.
set WaveSystem_UseKB[WaveSystem_Max]=false
set WaveSystem_KBtime[WaveSystem_Max]=0.
set WaveSystem_KBspeed[WaveSystem_Max]=0.
set WaveSystem_KBespeed[WaveSystem_Max]=0.
set WaveSystem_KBheight[WaveSystem_Max]=0.
set i=i-1
if WaveSystem_Max==0 then
call PauseTimer(WaveSystem_Timer)
endif
endif
set i=i+1
endloop
set i=0
set t=null
set g=null
set x=0.
set y=0.
set AoE=0.
endfunction
function WaveSystem takes unit u, real x, real y, real rangemax, real AoEmin, real AoEmax, real speed, real dmg, real dec, string s, boolean kb, real kbtime, real kbspeed, real kbespeed, real kbheight returns nothing
local real angle=Atan2(y - GetUnitY(u), x - GetUnitX(u))
if 0 == WaveSystem_Max then
call TimerStart(WaveSystem_Timer, SystemsInterval, true, function WaveSystem_Periodic)
endif
set WaveSystem_Dummy[WaveSystem_Max]=CreateUnit(GetOwningPlayer(u),WaveSystem_DummyID,GetUnitX(u),GetUnitY(u),bj_RADTODEG*angle)
call SetUnitScale(WaveSystem_Dummy[WaveSystem_Max],1,1,1)
call AddSpecialEffectTarget(s,WaveSystem_Dummy[WaveSystem_Max],"origin")
set WaveSystem_Caster[WaveSystem_Max] = u
set WaveSystem_Angle[WaveSystem_Max]=angle
set WaveSystem_RangeMax[WaveSystem_Max]=rangemax
set WaveSystem_Range[WaveSystem_Max]=0.
set WaveSystem_AoEmin[WaveSystem_Max]=AoEmin
set WaveSystem_AoEmax[WaveSystem_Max]=AoEmax
set WaveSystem_Dmg[WaveSystem_Max]=dmg
set WaveSystem_Speed[WaveSystem_Max]=speed*SystemsInterval
set WaveSystem_DecDmg[WaveSystem_Max]=1.-dec
set WaveSystem_Group[WaveSystem_Max]=CreateGroup()
set WaveSystem_UseKB[WaveSystem_Max]=kb
if kb then
set WaveSystem_KBtime[WaveSystem_Max]=kbtime
set WaveSystem_KBspeed[WaveSystem_Max]=kbspeed
set WaveSystem_KBespeed[WaveSystem_Max]=kbespeed
set WaveSystem_KBheight[WaveSystem_Max]=kbheight
endif
set WaveSystem_Max = WaveSystem_Max + 1
set u=null
set x=0.
set y=0.
set rangemax=0.
set AoEmin=0.
set AoEmax=0.
set dmg=0.
set speed=0.
set dec=0.
set s=null
endfunction
Name | Type | is_array | initial_value |
UDex | integer | No | |
UDexGen | integer | No | |
UDexNext | integer | Yes | |
UDexPrev | integer | Yes | |
UDexRecycle | integer | No | |
UDexUnits | unit | Yes | |
UDexWasted | integer | No | |
UnitIndexerEnabled | boolean | No | |
UnitIndexEvent | real | No |
//TESH.scrollpos=20
//TESH.alwaysfold=0
function Trig_KB_Conditions takes nothing returns boolean
return GetUnitAbilityLevel(GetAttacker(),'A001')>0 and GetRandomReal(0.,1.)<0.35
endfunction
function Trig_KB_Actions takes nothing returns nothing
local unit t=GetTriggerUnit()
local unit u=GetAttacker()
local real x=GetUnitX(u)
local real y=GetUnitY(u)
call KBSystem(t,x,y,1.75,300.,0.,0.,false)
call StunSystem(t,1.5)
call UnitDamageTarget(u,t,50,true,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
set u=null
set t=null
endfunction
//===========================================================================
function InitTrig_KB takes nothing returns nothing
local integer i=0
local unit u=CreateUnit(Player(0),'u000',0.,0.,0.)
call UnitAddAbility(u,'A003')
call UnitAddAbility(u,'A002')
call UnitAddAbility(u,'A001')
call UnitAddAbility(u,'A000')
call RemoveUnit(u)
set StunSystem_Dummy=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),StunSystem_DummyID,0,0,0)
call UnitAddAbility(StunSystem_Dummy, StunSystem_DummyAbility)
call UnitAddAbility(StunSystem_Dummy, 'Aloc')
call Cheat("iseedeadpeople")
set gg_trg_KB = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_KB, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_KB, Condition( function Trig_KB_Conditions ) )
call TriggerAddAction( gg_trg_KB, function Trig_KB_Actions )
set u=null
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Stomp_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A000'
endfunction
function Trig_Stomp_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local integer level = GetUnitAbilityLevel(caster, 'A000')
local real AoEbase=200.
local real AoEperL=50.
local real DMGbase=0.
local real DMGperL=25.
local real DURbase=1.75
local real DURperL=0.25
local real HEIGHTbase=128.
local real HEIGHTperL=32
local real StartSPEEDbase=475.
local real StartSPEEDperL=50.
local real EndSPEEDbase=200.
local real EndSPEEDperL=25.
local real AoE=AoEbase+AoEperL*level
local real DMG=DMGbase+DMGperL*level
local real DUR=DURbase+DURperL*level
local real HEIGHT=HEIGHTbase+HEIGHTperL*level
local real StartSPEED=StartSPEEDbase+StartSPEEDperL*level
local real EndSPEED=EndSPEEDbase+EndSPEEDperL*level
local real x = GetUnitX(caster)
local real y = GetUnitY(caster)
local real xt
local real yt
local group g = CreateGroup()
local unit f
local real percent
call DestroyEffect(AddSpecialEffect( GetAbilityEffectById('A000', EFFECT_TYPE_MISSILE, 0), x, y))
call GroupEnumUnitsInRange(g, x, y, AoE, null)
loop
set f = FirstOfGroup(g)
exitwhen f == null
if IsPlayerEnemy(GetOwningPlayer(caster), GetOwningPlayer(f)) and GetWidgetLife(f) > 0.405 and not IsUnitType(f, UNIT_TYPE_STRUCTURE) and not IsUnitType(f, UNIT_TYPE_FLYING) then
set xt=GetUnitX(f)
set yt=GetUnitY(f)
set percent=(AoE-SquareRoot((x-xt) * (x-xt) + (y-yt) * (y-yt)))/(AoE-100)
if percent<0.25 then
set percent=0.25
elseif percent>1. then
set percent=1.
endif
call KBSystem(f,x,y,DUR*percent,StartSPEED*percent,EndSPEED*percent,HEIGHT*percent,false)
call StunSystem(f,DUR*percent)
call UnitDamageTarget(caster, f, DMG*percent, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, null)
endif
call GroupRemoveUnit(g, f)
endloop
set caster = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
function InitTrig_Stomp takes nothing returns nothing
set gg_trg_Stomp = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Stomp, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Stomp, Condition( function Trig_Stomp_Conditions ) )
call TriggerAddAction( gg_trg_Stomp, function Trig_Stomp_Actions )
endfunction
//TESH.scrollpos=28
//TESH.alwaysfold=0
function Trig_ShockWave_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A004'
endfunction
function Trig_ShockWave_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local integer level = GetUnitAbilityLevel(caster, 'A004')
local real AoEbase=125.
local real AoEperL=0.
local real DMGbase=0.
local real DMGperL=75.
local real DURbase=1.
local real DURperL=0.
local real HEIGHTbase=32.
local real HEIGHTperL=0.
local real StartSPEEDbase=600.
local real StartSPEEDperL=0.
local real EndSPEEDbase=100.
local real EndSPEEDperL=0.
local real AoEmaxb=125.
local real AoEmpl=0.
local real AoEmin=AoEbase+AoEperL*level
local real AoEmax=AoEmaxb+AoEmpl*level
local real DMG=DMGbase+DMGperL*level
local real DUR=DURbase+DURperL*level
local real HEIGHT=HEIGHTbase+HEIGHTperL*level
local real StartSPEED=StartSPEEDbase+StartSPEEDperL*level
local real EndSPEED=EndSPEEDbase+EndSPEEDperL*level
call WaveSystem(caster,GetSpellTargetX(),GetSpellTargetY(),1200,AoEmin,AoEmax,1050,DMG,0.05,"Abilities\\Spells\\Orc\\Shockwave\\ShockwaveMissile.mdl",true,DUR,StartSPEED,EndSPEED,HEIGHT)
set caster = null
endfunction
function InitTrig_ShockWave takes nothing returns nothing
set gg_trg_ShockWave = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_ShockWave, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_ShockWave, Condition( function Trig_ShockWave_Conditions ) )
call TriggerAddAction( gg_trg_ShockWave, function Trig_ShockWave_Actions )
endfunction