Dreadlord v1
2800
ID:
648
Family ID:
Author:
poussix
Rarity:
unique
Element:
darkness
Attack Type:
Decay
Attack Range:
900
Attack CD:
1
Damage:
1086-1086
Abil. Factor:
0.35
Status:
Approved

Description:

Vampire with strong unholy powers.

Latest Upload Comment:

Restored from 1.10
Specials:
+5% mana/lvl
+5% mana regen/lvl
Dreadlord ' s Awakening
When activated, Dreadlord empowers himself with darkness for 10 seconds, increasing own attack speed by 50% and mana regeneration by 20 per second.

Level Bonus:
+2% attack speed
+0.8 mana per second
Dreadlord Slash
Dreadlord deals 100% of his max mana in spell damage on attack. Costs 80 mana on each attack.

Level Bonus:
+4% spell damage
Bloodsucker
The Dreadlord is hungry. For every kill he gains 0.5% attack speed and 10 maximum mana. The mana bonus caps at 2000. Both bonuses are permanent.
Download

Toggle Triggers

Autocast

caster_art: AUTOCAST_cooldown: 80 AUTOCAST_numBuffsBeforeIdle: 0 AUTOCAST_isExtended: false AUTOCAST_autocastType: AC_TYPE_OFFENSIVE_IMMEDIATE AUTOCAST_manacost: 0 AUTOCAST_range: 0 AUTOCAST_buffType: 0 AUTOCAST_targetSelf: true AUTOCAST_targetType: 0 target_art: AUTOCAST_autoRange: 900
private function onAutocast takes Tower tower returns nothing
   
   call poussix_Dnight.applyCustomTimed(tower,tower,1,10.0)
   call poussix_cast.immediateCastFromCaster(tower,1,3)
   
endfunction

Header

    globals
       BuffType poussix_Dnight
       Cast poussix_cast
       MultiboardValues Dreadlord_Bonus
    endglobals
    
    //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

        local Modifier m = Modifier.create()
        set   poussix_Dnight = BuffType.create(10,0,true)
        call  m.addModification(MOD_ATTACKSPEED, 0.5 , 0.02)
        call  m.addModification(MOD_MANA_REGEN, 20 , 0.8)
        call  poussix_Dnight.setBuffModifier(m)
        call  poussix_Dnight.setBuffIcon('@@2@@')
        call  poussix_Dnight.setStackingGroup("poussix_bloodsucker")
        set poussix_cast = Cast.create('@@0@@',"frenzy",1.0) 
        
        set Dreadlord_Bonus = MultiboardValues.create(2)
        call Dreadlord_Bonus.setKey(0,"Attackspeed Bonus")
        call Dreadlord_Bonus.setKey(1,"Mana Bonus")
    endfunction

On Damage

ONDAMAGE_chance: 1.0 ONDAMAGE_chanceLevelAdd: 0.0
function onDamage takes Tower tower returns nothing
    local Unit creep = Event.getTarget()
    local unit c = creep.getUnit()
    local unit towerUnit = tower.getUnit()
    local real totalDamage=(1+0.04*tower.getLevel()) * GetUnitState(towerUnit, UNIT_STATE_MAX_MANA)
    local real Manna = GetUnitState(towerUnit, UNIT_STATE_MANA)
    
    if (Manna >= 80) then

        call tower.doSpellDamage(creep,totalDamage,tower.calcSpellCritNoBonus())
        call SetUnitState(towerUnit , UNIT_STATE_MANA, Manna-80)
        call Effect.createScaled("Abilities\\Spells\\Orc\\Devour\\DevourEffectArt.mdl", GetUnitX(c), GetUnitY(c), 30, 0, 1.5).destroy()
   endif
        
    set towerUnit = null
    set c = null
    
endfunction

On Kill

function onKill takes Tower tower returns nothing
call tower.modifyProperty(MOD_ATTACKSPEED, 0.005)
set tower.userReal2 = tower.userReal2 + 0.005

if tower.userReal <= 2 then 

set tower.userReal = tower.userReal + 0.01
call tower.modifyProperty(MOD_MANA, 10)
endif
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
set tower.userReal = 0.0
set tower.userReal2 = 0.0
endfunction

On Tower Details

function onTowerDetails takes Tower tower returns MultiboardValues
    call Dreadlord_Bonus.setValue(0, formatPercent(tower.userReal2, 1))
    call Dreadlord_Bonus.setValue(1, I2S(R2I(tower.userReal*1000)))
    return Dreadlord_Bonus
endfunction