It v1
4500
ID:
216
Family ID:
Author:
axllow
Rarity:
unique
Element:
darkness
Attack Type:
Decay
Attack Range:
800
Attack CD:
2
Damage:
8684-8684
Abil. Factor:
0.7
Status:
Approved

Description:

An unsightly being from a distant realm, adept in performing daemonic rituals and casting nasty curses.

Latest Upload Comment:

Restored from 1.10
Specials:
10% spell crit chance (+0.5%/lvl)
Recreation Field
Set up Recreation Field at a chosen location. Field has 250 AoE and will punish creeps that walk over it at the wrong moment.
Corruption Field
Set up Corruption Field at a chosen location. Field has 250 AoE and will punish creeps that walk over it at the wrong moment.
It Hunger
Every time an enemy creep is transported by Dark Ritual or killed by this tower, It permanently gains 0.1% spelldamage. There is a maximum of 700% bonus spelldamage.

Level Bonus:
 +0.01% spelldamage
Dark Ritual
When this tower attacks, it awakens the powerful dark magic in Recreation and Corruption Fields, dealing 3000 spelldamage to all creeps unfortunate enough to be standing in those areas. If a non-boss enemy in Corruption Field is affected by Dark Ritual for the first time, it will be immediately transported to Recreation Field.

Level Bonus:
 +100 spelldamage

Cooldown: 1 sec
Download

Toggle Triggers

Autocast

caster_art: AUTOCAST_cooldown: 5 AUTOCAST_numBuffsBeforeIdle: 0 AUTOCAST_isExtended: true AUTOCAST_autocastType: AC_TYPE_NOAC_POINT AUTOCAST_manacost: 0 AUTOCAST_range: 800 AUTOCAST_buffType: 0 AUTOCAST_targetSelf: false AUTOCAST_targetType: 0 target_art: AUTOCAST_autoRange: 0
private function onAutocast takes Tower tower returns nothing
    local Summoner sum = tower.userInt
    local real lastX = sum.toX
    local real lastY = sum.toY
    set sum.toX = GetSpellTargetX()
    set sum.toY = GetSpellTargetY()
    if isPointOnCreepPath(sum.toX,sum.toY) then
            if tower.userInt2 == 1 then
                call sum.future.setPosition(sum.toX,sum.toY)
            else
                set tower.userInt2 = 1
                set sum.future = Effect.createColored("Abilities\\Spells\\Undead\\VampiricAura\\VampiricAura.mdl",sum.toX,sum.toY,0,270.0,2.0,255,0,0,255)
                call sum.future.noDeathAnimation()
            endif
        else
            set sum.toX = lastX
            set sum.toY = lastY
            call tower.getOwner().displaySmallFloatingText("Invalid location!",tower,255, 150, 0,30)
    endif
endfunction

Autocast

caster_art: AUTOCAST_cooldown: 5 AUTOCAST_numBuffsBeforeIdle: 0 AUTOCAST_isExtended: true AUTOCAST_autocastType: AC_TYPE_NOAC_POINT AUTOCAST_manacost: 0 AUTOCAST_range: 800 AUTOCAST_buffType: 0 AUTOCAST_targetSelf: false AUTOCAST_targetType: 0 target_art: AUTOCAST_autoRange: 0
private function onAutocast takes Tower tower returns nothing
    local Summoner sum = tower.userInt
    local real lastX = sum.fromX
    local real lastY = sum.fromY
    if(tower.userInt2 == 1) then
        set tower.userReal = 1
        set sum.fromX = GetSpellTargetX()
        set sum.fromY = GetSpellTargetY()
        //no need to check the location in this field's placement
        if tower.userInt3 == 1 then
            call sum.from.setPosition(sum.fromX,sum.fromY)
        else
            set tower.userInt3 = 1
            set sum.from = Effect.createColored("Abilities\\Spells\\Undead\\VampiricAura\\VampiricAura.mdl",sum.fromX,sum.fromY,0,270.0,2.0,0,0,255,255)
            call sum.from.noDeathAnimation()
        endif
    else
        call tower.getOwner().displaySmallFloatingText("You must place the recreation field first!",tower,255, 150, 0,30)
    endif
endfunction

Header

    globals
        integer array Summoner_units
        Effect Summoner_tp_e
        MultiboardValues Summoner_spd
    endglobals
    
    struct Summoner
        real size = 3.0
        ubersplat tow
        Effect from = 0
        Effect future = 0
        real fromX = 0
        real fromY = 0
        real toX = 0
        real toY = 0
    endstruct
    
    function It_kill takes Tower tower returns nothing
        local Summoner sum = tower.userInt
        local unit twrUnit = tower.getUnit()
        local real mod = 0.001 + (0.0001 * tower.getLevel())
        if sum.size < 10.0 then
            call tower.modifyProperty(MOD_SPELL_DAMAGE_DEALT,mod)//700% cap
            set sum.size = sum.size + mod
        endif
        if sum.size < 3.7 then
            call SetUnitScale(twrUnit,sum.size-2.7,sum.size,sum.size) 
        endif
        set twrUnit = null
    endfunction
    
    //Do not remove or rename this function!
    //Put your initialization tasks here, this function will be called on map init
    private function init takes nothing returns nothing
    set Summoner_spd = MultiboardValues.create(1)
    call Summoner_spd.setKey(0,"Spelldamage Bonus")
    endfunction

On Attack

ONATTACK_chance: 1.0 ONATTACK_chanceLevelAdd: 0.0
function onAttack takes Tower tower returns nothing
    //local integer currentTime = Game.getGameTime
    local Summoner sum = tower.userInt
    local Iterate inRange
    local real mod = 3000 + (tower.getLevel() * 100)
    local Creep s
    local integer UID
    local Effect DMG1
    local Effect DMG2
    local Effect TP1
    local Effect TP2
    local real toX
    local real toY
    if(tower.userReal == 1) then
        call tower.doSpellDamageAoE(sum.fromX,sum.fromY,250.0,mod,tower.calcSpellCritNoBonus(),0.0)
        //40.0 Oo
        set DMG1 = Effect.createColored("Abilities\\Spells\\Human\\Feedback\\ArcaneTowerAttack.mdl",sum.fromX,sum.fromY,100.0,270.0,40.0,0,0,0,255)
        call DMG1.setLifetime(1)
        set inRange = Iterate.overUnitsInRange(tower,TARGET_TYPE_CREEPS,sum.fromX,sum.fromY,250.0)
        loop
            set s = inRange.next()
            exitwhen s == 0
          //  set s = l 
            set UID = s.getUID()
            if UID != -1 and Summoner_units[s] != UID and s.getSize() < SIZE_BOSS then
                set TP1 = Effect.create("Abilities\\Spells\\Undead\\Darksummoning\\DarkSummonTarget.mdl",s.getX(),s.getY(),0.0,270.0)
                call TP1.setLifetime(1)
                call It_kill(tower)
                set toX = sum.toX + GetRandomReal(-25,25)
                set toY = sum.toY + GetRandomReal(-25,25)
                call s.moveToPoint(toX,toY,false)
                set TP2 = Effect.create("Abilities\\Spells\\Undead\\Darksummoning\\DarkSummonTarget.mdl",toX,toY,0.0,270.0)
                call TP2.setLifetime(1)
                call s.reorder()
                set Summoner_units[s] = UID
            endif
        endloop
        call tower.doSpellDamageAoE(sum.toX,sum.toY,250.0,mod,tower.calcSpellCritNoBonus(),0.0)
        set DMG2 = Effect.createColored("Abilities\\Spells\\Human\\Feedback\\ArcaneTowerAttack.mdl",sum.toX,sum.toY,100.0,270.0,40.0,0,0,0,255)
        call DMG2.setLifetime(1)
        set tower.userReal = 0
        call TriggerSleepAction(1.0)
        set tower.userReal = 1
    endif
endfunction

On Kill

function onKill takes Tower tower returns nothing
    call It_kill(tower)
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
    local Summoner sum = Summoner.create()
    local unit twrUnit = tower.getUnit()
    set sum.tow = CreateUbersplat(GetUnitX(twrUnit) - 16.0, GetUnitY(twrUnit) - 16.0,"DRKC",255,255,255,255,false,false)
    call SetUbersplatRenderAlways(sum.tow,true)
    set tower.userInt = sum
    set tower.userInt2 = 0
    set tower.userInt3 = 0
    set twrUnit = null
endfunction

On Tower Destruction

function onDestruct takes Tower tower returns nothing
    local Summoner sum = tower.userInt
    if tower.userInt2 == 1 then
        call sum.future.destroy()
    endif
    if tower.userInt3 == 1 then
        call sum.from.destroy()
    endif
    call DestroyUbersplat(sum.tow)
    set sum.tow = null
    call sum.destroy()
endfunction

On Tower Details

goldcost: 4500
function onTowerDetails takes Tower tower returns MultiboardValues
    local Summoner sum = tower.userInt
    call Summoner_spd.setValue(0, formatPercent(sum.size - 3.0, 1)) 
    return Summoner_spd
endfunction