Vulshok, the Berserker v1
2400
ID:
140
Family ID:
Author:
Boekie
Rarity:
unique
Element:
fire
Attack Type:
Physical
Attack Range:
1000
Attack CD:
0.64
Damage:
900-900
Status:
Approved

Description:

Legendary fel orc berserker, he is the ultimate fighter.
Specials:
x2 crit damage
+3% attackspeed/lvl
Ultimate Fighter
Vulshok uses his great power to specialize his attacks:
- Every 3rd attack adds a critical hit
- Every 7th attack deals 3000 bonus attackdamage
- Every 12th attack splashes all damage over 200 AoE
- Every 15th attack adds 0.5% attack damage permanently

Level Bonus:
+200 attackdamage on 7th attack
Maim
When Vulshok damages a creep it gets maimed. The creep is slowed by 10% for 5 seconds and every second it gets slowed by an extra 5%. This buff lasts for 5 seconds and cannot be refreshed. 

Level Bonus:
+0.5% slow 
+0.1% extra slow per second
Download

Toggle Triggers

Header

    globals
        MultiboardValues boekie_vulshok_multiboard 
        BuffType boekie_vulshok_slow
    endglobals
    
    function boekie_vulshok_slowPeriodic takes Buff b returns nothing 
        call b.setPower(b.getPower() + 50 + b.getLevel()/5)
    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() 
        
        set boekie_vulshok_multiboard = MultiboardValues.create(4) 
        call boekie_vulshok_multiboard.setKey(0,"Attacks to crit") 
        call boekie_vulshok_multiboard.setKey(1,"Attacks to damage") 
        call boekie_vulshok_multiboard.setKey(2,"Attacks to splash") 
        call boekie_vulshok_multiboard.setKey(3,"Attacks to grow") 
        
        call m.addModification(MOD_MOVESPEED,-0.10,-0.001)     
        set boekie_vulshok_slow = BuffType.create(5,0.0,false)
        call boekie_vulshok_slow.setBuffModifier(m)
        call boekie_vulshok_slow.setBuffIcon('@@0@@') 
        call boekie_vulshok_slow.addPeriodicEvent(EventHandler.boekie_vulshok_slowPeriodic,1) 
    endfunction

On Attack

ONATTACK_chance: 1.0 ONATTACK_chanceLevelAdd: 0.0
function onAttack takes Tower tower returns nothing
    local Unit target = Event.getTarget()
    local integer crit = 0
    
    set tower.userInt = tower.userInt + 1

    //Crit (every 3rd)
    if ModuloInteger(tower.userInt,3) == 0 then 
        call tower.addAttackCrit()
        set crit = 1 //So the triggered attackdamage can crit too!
    endif 

    //Bonus damage (every 7th)
    if ModuloInteger(tower.userInt,7) == 0 then
        //Splashed bonus damage (every 84th)
        if ModuloInteger(tower.userInt,12) == 0 then
            call tower.doAttackDamageAoEUnit(target,200,3000.0+(tower.getLevel()*200.0),tower.calcAttackMulticrit(0.0,0.0,crit),0.0)
            call Effect.createScaled("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl", target.getX(), target.getY(), 0.0, 0, 1.5).destroy()
        else
            call tower.doAttackDamage(target,3000.0+(tower.getLevel()*200.0),tower.calcAttackMulticrit(0.0,0.0,crit)) 
            call Effect.createScaled("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl", target.getX(), target.getY(), 0.0, 0, 0.2).destroy()
        endif
    endif 
    
    //Splash (every 12th)
    if ModuloInteger(tower.userInt,12) == 0 then
        set tower.userInt2 = 1
    endif
    
    //Growth (every 15th)
    if ModuloInteger(tower.userInt,15) == 0 then 
        call tower.modifyProperty(MOD_DAMAGE_ADD_PERC, 0.005)
        //Rare text has increased chance to show with increased triggerchances. ;]
        if tower.calcChance(0.005) then
            call tower.getOwner().displayFloatingText("I WILL BATHE IN YOUR BLOOD!",tower,255,100,100)
        elseif tower.calcChance(0.1) then
            call tower.getOwner().displayFloatingText("FEAR ME!",tower,255,100,100)
        elseif tower.calcChance(0.4) then
            call tower.getOwner().displayFloatingText("GRRR!",tower,255,100,100)
        else
            call tower.getOwner().displayFloatingText("ROAR!",tower,255,100,100)
        endif
        //Increase model size.
        set tower.userInt3 = tower.userInt3 + 1
        call tower.setScale(0.9 + 0.001 * tower.userInt3)
    endif 
    
    if tower.userInt >= 420 then
        set tower.userInt = 0
    endif
endfunction

On Damage

ONDAMAGE_chance: 1.0 ONDAMAGE_chanceLevelAdd: 0.0
function onDamage takes Tower tower returns nothing
    local Iterate it
    local Creep creep = Event.getTarget()
    
    if tower.userInt2 == 1 then
        call tower.doAttackDamageAoEUnit(creep,200,tower.getCurrentAttackDamageWithBonus(),tower.calcAttackMulticrit(0.0,0.0,1),0.0) //+1 multicrit count for the guaranteed crit every three attacks.
        set Event.damage = 0 //Cancel the regular attack
        //Apply slow to all creeps hit.
        set it = Iterate.overUnitsInRangeOfUnit(tower,TARGET_CREEPS,creep,200)
        loop
            set creep = it.next()
            exitwhen creep == 0
            if creep.getBuffOfType(boekie_vulshok_slow) == 0 then
                call boekie_vulshok_slow.apply(tower, creep, tower.getLevel()*5)
            endif
        endloop
        set tower.userInt2 = 0
    else
        if creep.getBuffOfType(boekie_vulshok_slow) == 0 then
            call boekie_vulshok_slow.apply(tower, creep, tower.getLevel()*5)
        endif
    endif
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
    //Abilities
    set tower.userInt = 0
    //Splash on next attack
    set tower.userInt2 = 0
    //Number of growths
    set tower.userInt3 = 0
endfunction

On Tower Details

function onTowerDetails takes Tower tower returns MultiboardValues
    call boekie_vulshok_multiboard.setValue(0,I2S(3-ModuloInteger(tower.userInt,3)))
    call boekie_vulshok_multiboard.setValue(1,I2S(7-ModuloInteger(tower.userInt,7)))
    call boekie_vulshok_multiboard.setValue(2,I2S(12-ModuloInteger(tower.userInt,12)))
    call boekie_vulshok_multiboard.setValue(3,I2S(15-ModuloInteger(tower.userInt,15)))
    return boekie_vulshok_multiboard 
endfunction