// OpenDota 6.41 deprotected by NETRAT and DioD
// inspired by everyone who posted on forum threads and feedback page
// based on OpenDota 6.32b, deprotected by DimonT, NETRAT and TheBloodiest
// [url=http://dimon.xgm.ru/opendota/]OpenDotA Project / Home[/url]
// Visit our modmaking community at [url=http://xgm.ru/]\\XGM\\[/url]
// Objects used:
// 'A0NM' = Paralyzing Cask (Witch Doctor : Vol'Jin)
// 'A04R' = Marker (Nether Ward 4,Lightning Bolter,Nether Ward 3,Nether Ward 2,Vengeance Death caster,...)
// 'o003' = Spin Web
// 'e00E' = Spellcaster
// 'A0NL' = Paralyzing casks effect
// DEBUG Trigger Number : 121
function CasksSpell takes nothing returns boolean
return GetSpellAbilityId()=='A0NM'
endfunction
function CaskFilter takes nothing returns boolean
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE))then
return false
endif
if(GetUnitAbilityLevelSwapped('A04R',GetFilterUnit())==1)then
return false
endif
if(IsUnitAliveBJ(GetFilterUnit())==false)then
return false
endif
if(GetUnitTypeId(GetFilterUnit())=='o003')then
return false
endif
if(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit()))==false)then
return false
endif
if(IsUnitVisible(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit()))==false)then
return false
endif
return true
endfunction
function CasksAction takes nothing returns nothing
local integer lmZ=GetUnitAbilityLevelSwapped('A0NM',GetTriggerUnit())
local unit lFB=GetSpellTargetUnit()
local unit lJV
local unit lvx
local unit lvX=GetTriggerUnit()
local integer lEq
local integer lEQ
local integer lMa=0
local group lEw
local location ln3
loop
exitwhen lMa>(lmZ*2)
set lMa=lMa+1
set lJV=CreateUnit(GetOwningPlayer(GetTriggerUnit()),'e00E',GetUnitX(lvX),GetUnitY(lvX),bj_UNIT_FACING)
call UnitAddAbility(lJV,'A0NL')
call IssueTargetOrderById(lJV,OrderId("thunderbolt"),lFB)
call PolledWait(((GetUnitX(lFB)-GetUnitX(lJV))*(GetUnitX(lFB)-GetUnitX(lJV))+(GetUnitY(lFB)-GetUnitY(lJV))*(GetUnitY(lFB)-GetUnitY(lJV)))/360000)
if IsUnitType(lFB,UNIT_TYPE_HERO)==false then
call UnitDamageTarget(GetTriggerUnit(),lFB,50+25*lmZ,true,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
endif
if(lMa<(lmZ*2+1))then
set ln3=GetUnitLoc(lFB)
set lEw=GetUnitsInRangeOfLocMatching(600.,ln3,Condition(function CaskFilter))
call RemoveLocation(ln3)
loop
set lvx=GroupPickRandomUnit(lEw)
if(lvx==null)then
set lMa=100
call DestroyGroup(lEw)
exitwhen 1==1
elseif(lvx!=lFB)then
set lvX=lFB
set lFB=lvx
call DestroyGroup(lEw)
exitwhen 1==1
endif
call GroupRemoveUnit(lEw,lvx)
endloop
endif
endloop
endfunction
function CasksInit takes nothing returns nothing
local trigger ltt=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(ltt,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(ltt,Condition(function CasksSpell))
call TriggerAddAction(ltt,function CasksAction)
endfunction
function InitTrig_Paralyzing_Cask takes nothing returns nothing
endfunction