Mana-Touched Drake v1
500
ID:
3
Family ID:
Author:
SirCoqaLot.
Rarity:
rare
Element:
astral
Attack Type:
Elemental
Attack Range:
950
Attack CD:
3
Damage:
509-609
Abil. Factor:
0.4
Status:
Approved

Description:

Playful Faerie-Dragon that uses mana to its advantage.

Latest Upload Comment:

Restored from 1.10
Specials:
+1 mana regen/lvl
Unstable Energies
This tower has a 28% chance on damage to release a powerful energy blast, dealing [current mana x 8] Elemental damage to the target, but consuming 75% of its own current mana. 

Level Bonus:
+0.48% chance 
-1% current mana consumed
Mana Distortion Field
Towers in 200 range burn 2 mana on attack, costing the drake 7 mana. The mana burned and spent is attackspeed and range adjusted and the tower deals 50 spelldamage per mana point burned.

Level Bonus:
+4 spelldamage per mana point burned
Download

Toggle Triggers

Header

            globals
    //@export
    BuffType sir_drake_aura
    endglobals
    
    function drake_aura_manaburn takes Buff b returns nothing
    
    local Tower tower = b.getBuffedUnit()
    local Unit target = Event.getTarget()
    local Unit caster = b.getCaster()
    local unit targetunit = target.getUnit()
    local integer level = caster.getLevel()
    local real manadrained
    local real speed = tower.getBaseAttackspeed()*800/tower.getRange()
    
    
    if GetUnitState(targetunit,UNIT_STATE_MANA) > 0 and caster.subtractMana(caster.userReal*speed,false) > 0 then // drain mana at drake and check if the target and the drake have enough mana
        set manadrained = target.subtractMana((b.getLevel()/100.0)*speed,true) // drain mana set value
        call tower.doSpellDamage(target,manadrained*b.getPower(),tower.calcSpellCritNoBonus()) // deal damaage = value
        call SFXAtUnit("Abilities\\Spells\\Undead\\DeathandDecay\\DeathandDecayDamage.mdl",targetunit) // spawn effect
    endif
    set targetunit = null // cleanup
    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 sir_drake_aura = BuffType.createAuraEffectType(true)
    call sir_drake_aura.setBuffIcon('@@0@@')
    call sir_drake_aura.addEventOnAttack(drake_aura_manaburn,1,0)
    endfunction
        

On Damage

ONDAMAGE_chance: 0.28 ONDAMAGE_chanceLevelAdd: 0.0048
function onDamage takes Tower tower returns nothing
            
local unit towerunit = tower.getUnit()
    local integer level = tower.getLevel()
    
    call tower.doAttackDamage(Event.getTarget(),8 * GetUnitState(towerunit,UNIT_STATE_MANA),tower.calcAttackMulticrit(0,0,0)) //deal the damage
    call tower.subtractMana(GetUnitState(towerunit,UNIT_STATE_MANA)*(0.75-0.01*tower.getLevel()),true)//drain the mana
    call SFXAtUnit("Abilities\\Spells\\Items\\AIma\\AImaTarget.mdl",Event.getTarget().getUnit())// add some fancy effect
    set towerunit = null
        
endfunction

On Tower Creation

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

Tower Aura

AURA_powerAdd: 4 AURA_auraEffect: sir_drake_aura AURA_levelAdd: 0 AURA_power: 50 AURA_targetType: TARGET_TYPE_TOWERS AURA_targetSelf: false AURA_level: 200 AURA_auraRange: 200