Genis Sage v1
3500
ID:
131
Family ID:
Author:
i_mOck_death
Rarity:
unique
Element:
ice
Attack Type:
Energy
Attack Range:
900
Attack CD:
1.5
Damage:
1892-1892
Mana:
200
Mana regen:
3
Status:
Approved

Description:

Powerful mage who is adept in using the water magics.
Speed Cast
Whenever Genis uses one of his abilities, he has a 15% chance to increase his trigger chances and his attackspeed by 25% for 3.5 seconds. This ability does not stack, but can be retriggered.

Level Bonus:
+1% trigger chance
+1% attackspeed
+0.1 seconds
Aqua Edge
Each attack Genis has a 20% chance to launch 3 blades of water in front of him at different angles. Each blade deals 1500 damage to each creep it passes through. Costs 15 mana.

Level Bonus:
+0.6% chance
+150 damage
Spread
Whenever Genis damages a creep, he has a 10% chance to lift creeps up for 0.8 seconds in a 250 AoE around the damaged creep. Each creep is also dealt 3000 spell damage. Costs 40 mana.

Level Bonus:
+0.2% chance
+200 spell damage
Magic Boost
Every 7 seconds Genis has a 30% chance to increase the spell damage of all towers within 350 range of him by 20% for 3 seconds. Costs 10 mana.

Level Bonus:
+1% spell damage
Download

Toggle Triggers

Header

    globals
        Cast mOck_Aedge
        BuffType mOck_spread
        BuffType mOck_speedcast
        BuffType mOck_mboost
    endglobals
    
    function spread_up takes Buff b returns nothing
        local Creep creep = b.getBuffedUnit()
        call creep.adjustHeight(300,(300/(.4*b.getCaster().getProp_BuffDuration()))*creep.getProp_DebuffDuration())
    endfunction
    
    function spread_down takes Buff b returns nothing
        local Creep creep = b.getBuffedUnit()
        call creep.adjustHeight(-300,(300/(.4*b.getCaster().getProp_BuffDuration()))*creep.getProp_DebuffDuration())
    endfunction
    
    function speedcast takes Tower t returns nothing
        if t.calcChance(.15) then
            call mOck_speedcast.apply(t,t,t.getLevel())
        endif
    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
        local Modifier m = Modifier.create()
        local Modifier b = Modifier.create()
        
        set mOck_speedcast = BuffType.create(3.5,.1,true)
        call m.addModification(MOD_TRIGGER_CHANCES,.25,.01)
        call m.addModification(MOD_ATTACKSPEED,.25,.01)
        call mOck_speedcast.setBuffModifier(m)
        call mOck_speedcast.setBuffIcon('@@1@@')
        
        set mOck_mboost = BuffType.create(3,0,true)
        call b.addModification(MOD_SPELL_DAMAGE_DEALT,.2,.01)
        call mOck_mboost.setBuffModifier(b)
        call mOck_mboost.setBuffIcon('@@2@@')
        
        set mOck_spread = BuffType.createDuplicate(cb_stun,.8,0,false)
        call mOck_spread.addEventOnCreate(spread_up)
        call mOck_spread.addEventOnCleanup(spread_down)
        
        set mOck_Aedge = Cast.create('@@0@@', "carrionswarm",1)
    endfunction

On Attack

ONATTACK_chance: 0.2 ONATTACK_chanceLevelAdd: 0.006
function onAttack takes Tower tower returns nothing
    local Unit target = Event.getTarget()
    local integer level = tower.getLevel()
    local real x2 = target.getX()
    local real y2 = target.getY()
    local real x = tower.getX()
    local real y = tower.getY()
    local real facing =  bj_RADTODEG * Atan2(y2-y, x2-x)
    local real angle = -20
    
    if tower.subtractMana(15, false) == 15 then
        loop
            exitwhen angle > 20
            call mOck_Aedge.pointCastFromCasterOnPoint(tower,x+25 * Cos((facing+angle) * bj_DEGTORAD),y+25 * Sin((facing+angle) * bj_DEGTORAD),1500+(level*150),tower.calcSpellCritNoBonus())
            set angle = angle + 20
        endloop
        call speedcast(tower)
    endif
endfunction

On Damage

ONDAMAGE_chance: .10 ONDAMAGE_chanceLevelAdd: 0.002
function onDamage takes Tower tower returns nothing
    local integer level = tower.getLevel()
    local Unit creep = Event.getTarget()
    local Unit next
    local Iterate it  
    local real crit 
    
    if tower.subtractMana(40, false) == 40 then
        set it = Iterate.overUnitsInRangeOfUnit(tower,TARGET_CREEPS,creep,250)
        call SFXAtUnit("Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl",creep.getUnit())
        set crit = tower.calcSpellCritNoBonus()
        loop
            set next = it.next()
            exitwhen next == 0
            call tower.doSpellDamage(next,3000+(200*level),crit)
            call mOck_spread.apply(tower,next,0)
        endloop
        call speedcast(tower)
    endif
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
    call AddUnitAnimationProperties(tower.getUnit(), "stand alternate", false)
endfunction

Periodic

PERIODIC_period: 7
function periodic takes Tower tower returns nothing
    local integer level = tower.getLevel() 
    local Tower next
    local Iterate it

    if tower.calcChance(.3) and tower.subtractMana(40, false) == 40 then
        set it = Iterate.overUnitsInRangeOfCaster(tower,TARGET_TOWERS,350)
        loop
            set next = it.next()
            exitwhen next == 0
            call mOck_mboost.apply(tower,next,level)
        endloop
        call speedcast(tower)
    endif
endfunction