Astral Rift v1
3000
ID:
46
Family ID:
Author:
i_mOck_death
Rarity:
unique
Element:
astral
Attack Type:
Energy
Attack Range:
750
Attack CD:
1.5
Damage:
2151-2151
Mana:
180
Mana regen:
2.5
Status:
Approved

Description:

A powerful vortex with the ability to move things through space itself.
Spacial Rift
Whenever this tower damages a creep it has a 10% chance to move that creep back by 175 units. Upon triggering there is a further 15% chance that all creeps in 175 AoE of the target will also be moved back 175 units. Costs 30 mana. Chance is halved for bosses.  The original target and creeps around it will get startled and become slowed by 30% for 2 seconds in a 250 AoE.  

Level Bonus:
+0.4% chance to move creep
+1 units moved 
+1 slow and unit move AoE
+1% slow
Presence of the Rift - Aura
The Astral Rift's presence is so powerful that it damages creeps equal to 200% of their movement speed every second in an area of 750.

Level Bonus:
+16% damage increase
Download

Toggle Triggers

Header

    globals
        BuffType mOck_AstralRift
        BuffType mOck_AstralRift_Slow
    endglobals
    
    //Do not remove or rename this function!
    //Put your initialization tasks here, this function will be called on map init
    function SPDamage takes Buff b returns nothing
        local Creep c = b.getBuffedUnit()
        local Tower t = b.getCaster()
        call t.doSpellDamage(c,GetUnitMoveSpeed(c.getUnit())*((t.getLevel()*.16)+2),t.calcSpellCritNoBonus())
    endfunction
    
    private function init takes nothing returns nothing
        local Modifier Bmod = Modifier.create()
    
        set mOck_AstralRift_Slow = BuffType.create(2,0,false)
        set mOck_AstralRift = BuffType.createAuraEffectType(false)
        
        call mOck_AstralRift.addPeriodicEvent(EventHandler.SPDamage, 1.00 )
        call Bmod.addModification(MOD_MOVESPEED,-.3,-.01)
        call mOck_AstralRift_Slow.setBuffModifier(Bmod)
        call mOck_AstralRift.setStackingGroup("rift_aura")
        call mOck_AstralRift.setBuffIcon('@@0@@')
        call mOck_AstralRift_Slow.setBuffIcon('@@1@@')
    endfunction

On Damage

ONDAMAGE_chance: .10 ONDAMAGE_chanceLevelAdd: 0.004
function onDamage takes Tower tower returns nothing
    local Creep target = Event.getTarget()
    local Creep creep
    local integer level = tower.getLevel()
    local real facing
    local real newX
    local real newY
    local Iterate it

    if (target.getSize() < SIZE_BOSS or GetRandomInt(0,1) == 1) and tower.subtractMana(30,false) == 30 then
        call Effect.createScaled("Abilities\\Spells\\Undead\\ReplenishMana\\ReplenishManaCaster.mdl", tower.getX()-16, tower.getY()-16, 10, 0, 30).setLifetime(1)
        //Move the creep(s).
        call Effect.createSimple("Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl",target.getX(),target.getY()).destroy()
        set facing = GetUnitFacing(target.getUnit()) - 180
        if tower.calcChance(0.15) then
            //Move all units around the target.
            set it = Iterate.overUnitsInRangeOfUnit(tower, TARGET_CREEPS, target, 175.0 + level)
            loop 
                set creep = it.next()
                exitwhen creep == 0
                set newX = creep.getX() + (175+level) * Cos(facing * bj_DEGTORAD)
                set newY = creep.getY() + (175+level) * Sin(facing * bj_DEGTORAD)
                call creep.moveToPoint(newX,newY,true)
            endloop
        else
            //Move target only.
            set newX = target.getX() + (175+level) * Cos(facing * bj_DEGTORAD)
            set newY = target.getY() + (175+level) * Sin(facing * bj_DEGTORAD)
            call target.moveToPoint(newX,newY,true)
        endif
        //Apply slow
        call Effect.create("Abilities\\Spells\\Other\\Silence\\SilenceAreaBirth.mdl", target.getX(), target.getY(), 50, 0).setLifetime(1)
        set it = Iterate.overUnitsInRangeOfUnit(tower, TARGET_CREEPS, target, 250 + level)
        loop 
            set creep = it.next()
            exitwhen creep == 0
            call mOck_AstralRift_Slow.apply(tower, creep, level)
        endloop
    endif
endfunction

Tower Aura

AURA_auraEffect: mOck_AstralRift AURA_power: 0 AURA_level: 0 AURA_auraRange: 750 AURA_targetType: TARGET_TYPE_CREEPS AURA_levelAdd: 1 AURA_powerAdd: 1 AURA_targetSelf: false