I made this spell pack for starters to learn how simple some of dota spells and how are they made...
Jass or GUI: Jass,
Import difficulty:medium,
Leakless: I think so,
Description:Invoke Icy Path, Invoke Choas Meteor, Quillspray,
Reason: Someday i wish i have 1000 reputation j/k
Jass or GUI: Jass,
Import difficulty:medium,
Leakless: I think so,
Description:Invoke Icy Path, Invoke Choas Meteor, Quillspray,
Reason: Someday i wish i have 1000 reputation j/k
Code:
function Trig_Invoke_Icy_Path_Conditions takes nothing returns boolean
return GetUnitTypeId(GetSummonedUnit()) == 'u006'
endfunction
function Trig_Invoke_Icy_Path_Actions takes nothing returns nothing
local integer i=1
local location l=GetUnitLoc(GetSummonedUnit())
local location m=GetUnitLoc(GetSummoningUnit())
local location n
local unit u
loop
exitwhen i>5
set n=PolarProjectionBJ(l,(I2R(i)*75.00),(AngleBetweenPoints(m,l)+90.00))
set u = CreateUnitAtLoc(GetOwningPlayer(GetSummoningUnit()),'u006',n,GetRandomReal(0,360))
call RemoveLocation(n)
call SetUnitAnimation(u,"birth")
call QueueUnitAnimation(u,"stand")
call UnitApplyTimedLife(u,'BTLF',(0.00+(I2R(GetUnitAbilityLevelSwapped('A00G',GetSummoningUnit()))*1.25)))
set n=PolarProjectionBJ(l,(I2R(i)*75.00),(AngleBetweenPoints(m,l)-90.00))
set u = CreateUnitAtLoc(GetOwningPlayer(GetSummoningUnit()),'u006',n,GetRandomReal(0,360))
call RemoveLocation(n)
call SetUnitAnimation(u,"birth")
call QueueUnitAnimation(u,"stand")
call UnitApplyTimedLife(u,'BTLF',(0.00+(I2R(GetUnitAbilityLevelSwapped('A00G',GetSummoningUnit()))*1.25)))
set i=i+1
endloop
call RemoveLocation(l)
call RemoveLocation(m)
set l=null
set m=null
set n=null
set u=null
endfunction
//===========================================================================
function InitTrig_Invoke_Icy_Path takes nothing returns nothing
set gg_trg_Invoke_Icy_Path = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Invoke_Icy_Path, EVENT_PLAYER_UNIT_SUMMON )
call TriggerAddCondition( gg_trg_Invoke_Icy_Path, Condition( function Trig_Invoke_Icy_Path_Conditions ) )
call TriggerAddAction( gg_trg_Invoke_Icy_Path, function Trig_Invoke_Icy_Path_Actions )
endfunction
Code:
function Trig_Chaos_Meteor_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A000'
endfunction
function Chaos_Meteor_Destroy_Trees takes nothing returns nothing
call KillDestructable(GetEnumDestructable())
endfunction
function Trig_Chaos_Meteor_Actions takes nothing returns nothing
local unit v
local unit u=GetTriggerUnit()
local location l=GetUnitLoc(u)
local location m=GetSpellTargetLoc()
local location n
local location o
set o=PolarProjectionBJ(l,250.00,AngleBetweenPoints(l,m))
call CreateNUnitsAtLocFacingLocBJ(1,'e001',GetOwningPlayer(u),o,m)
set v = GetLastCreatedUnit()
call RemoveLocation(o)
call UnitApplyTimedLife(v,'BTLF',1.75)
call SetUnitTimeScalePercent(v,50.00)
call TriggerSleepAction(1.50)
set o=PolarProjectionBJ(l,250.00,AngleBetweenPoints(l,m))
call CreateNUnitsAtLocFacingLocBJ(1,'e000',GetOwningPlayer(u),o,m)
set v = GetLastCreatedUnit()
call RemoveLocation(o)
call SetUnitTimeScalePercent(v,50.00)
call UnitAddAbility(v,'A002')
call SetUnitAbilityLevelSwapped('A002',v,GetUnitAbilityLevelSwapped('A000',u))
call IssueImmediateOrderById(v,852177)
call UnitApplyTimedLife(v,'BTLF',5.50)
set o=PolarProjectionBJ(l,1500.00,AngleBetweenPoints(l,m))
call IssuePointOrderByIdLoc(v,852040,o)
call RemoveLocation(o)
loop
set n=GetUnitLoc(v)
call EnumDestructablesInCircleBJ(300.00,n,function Chaos_Meteor_Destroy_Trees)
call DestroyEffect(AddSpellEffectByIdLoc('X001',EFFECT_TYPE_TARGET,n))
call CreateNUnitsAtLocFacingLocBJ(1,'e002',GetOwningPlayer(u),n,m)
call UnitAddAbility(bj_lastCreatedUnit,'A003')
call SetUnitAbilityLevelSwapped('A003',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A000',u))
call IssueImmediateOrderById(bj_lastCreatedUnit,852177)
call UnitApplyTimedLife(bj_lastCreatedUnit,'BTLF',4.50)
call TriggerSleepAction(0.40)
call RemoveLocation(n)
exitwhen (IsUnitDeadBJ(v))
endloop
call RemoveLocation(l)
call RemoveLocation(m)
set o=null
set n=null
set m=null
set l=null
set v=null
set u=null
endfunction
//===========================================================================
function InitTrig_Chaos_Meteor takes nothing returns nothing
set gg_trg_Chaos_Meteor = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Chaos_Meteor, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Chaos_Meteor, Condition( function Trig_Chaos_Meteor_Conditions ) )
call TriggerAddAction( gg_trg_Chaos_Meteor, function Trig_Chaos_Meteor_Actions )
endfunction
Code:
function Trig_Kill_Meteor_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A001'
endfunction
function Trig_Kill_Meteor_Actions takes nothing returns nothing
call KillUnit(GetTriggerUnit())
endfunction
//===========================================================================
function InitTrig_Kill_Meteor takes nothing returns nothing
set gg_trg_Kill_Meteor = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Kill_Meteor, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Kill_Meteor, Condition( function Trig_Kill_Meteor_Conditions ) )
call TriggerAddAction( gg_trg_Kill_Meteor, function Trig_Kill_Meteor_Actions )
endfunction
Code:
function Trig_Quill_Spray_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A00C'
endfunction
function Trig_Quill_Spray_Actions takes nothing returns nothing
call UnitAddAbility(GetTriggerUnit(),'A00E')
call SetUnitAbilityLevelSwapped('A00E',GetTriggerUnit(),GetUnitAbilityLevelSwapped('A00C',GetTriggerUnit()))
call UnitAddAbility(GetTriggerUnit(),'A00D')
call SetUnitAbilityLevelSwapped('A00D',GetTriggerUnit(),GetUnitAbilityLevelSwapped('A00C',GetTriggerUnit()))
call TriggerSleepAction(6.00)
call UnitRemoveAbility(GetTriggerUnit(),'A00E')
call UnitRemoveAbility(GetTriggerUnit(),'A00D')
endfunction
//===========================================================================
function InitTrig_Quill_Spray takes nothing returns nothing
set gg_trg_Quill_Spray = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Quill_Spray, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Quill_Spray, Condition( function Trig_Quill_Spray_Conditions ) )
call TriggerAddAction( gg_trg_Quill_Spray, function Trig_Quill_Spray_Actions )
endfunction