Blackrock's Totem v1
2500
ID:
66
Family ID:
Author:
poussix
Rarity:
unique
Element:
fire
Attack Type:
Elemental
Attack Range:
1200
Attack CD:
2
Damage:
1036-1036
Abil. Factor:
0.2
Status:
Approved

Description:

During the grand battle against humans, The Blackrock clan used this magical totem, making them unstoppable.

Latest Upload Comment:

Restored from 1.10
Demonic Fire
Places a buff on a creep for 7 seconds. When a tower damages the buffed creep, there is a 20% chance to permanently increase the damage it takes from fire towers by 3% (1% for bosses).  

Level Bonus:
+0.08% damage from fire (on non boss)
+0.04% damage from fire (on bosses)
Shamanic Totem
Upon casting Demonic Fire there is a 30% chance to buff towers in 500 range, increasing their spell damage dealt by 10% for 5 seconds and restoring 7.5% of their max mana.

Level Bonus:
+0.4% spell damage
+0.3% max mana
+0.2 seconds duration
+0.4% trigger chance
Fighter Totem
On attack there is a 15% chance to buff towers in 500 range, increasing their damage dealt by 10%, their crit chance by 5% and their crit damage by 50% for 5 seconds.

Level Bonus:
+0.4% damage
+0.2% crit chance
+2% crit damage 
+0.2 seconds duration
+0.2% trigger chance
Download

Toggle Triggers

Autocast

caster_art: AUTOCAST_cooldown: 4 AUTOCAST_numBuffsBeforeIdle: 3 AUTOCAST_isExtended: false AUTOCAST_autocastType: AC_TYPE_OFFENSIVE_BUFF AUTOCAST_manacost: 0 AUTOCAST_range: 1200 AUTOCAST_buffType: Totem_Damage AUTOCAST_targetSelf: false AUTOCAST_targetType: TARGET_TYPE_CREEPS target_art: AUTOCAST_autoRange: 1200
private function onAutocast takes Tower tower returns nothing
    local integer lvl = tower.getLevel()
    local Iterate towers
    local Tower cur
    local real mana
    local real currentmana
    local unit u

    if Event.getTarget().getSize() < SIZE_BOSS then
        set Totem_Damage.apply(tower,Event.getTarget(),lvl).userReal = 0.03 + 0.0008 * lvl
    else
        set Totem_Damage.apply(tower,Event.getTarget(),lvl).userReal = 0.01 + 0.0004 * lvl
    endif
    
    if tower.calcChance(0.30 + 0.004 * lvl) then
        set towers = Iterate.overUnitsInRangeOfCaster(tower,TARGET_TYPE_TOWERS,500)
        loop  
            set cur = towers.next() 
            exitwhen cur == 0
            call Fire_Totem_Spell.apply(tower, cur, lvl)
            if cur != tower then
                set u = cur.getUnit()
                set mana = GetUnitState(u, UNIT_STATE_MAX_MANA)
                set currentmana = GetUnitState(u, UNIT_STATE_MANA)
                call SetUnitState(u, UNIT_STATE_MANA, currentmana + mana * (0.075 + 0.003 * lvl))
            endif
        endloop
        set u = null
    endif
endfunction

Header

    globals
        BuffType Fire_Totem_Physique    
        BuffType Totem_Damage
        BuffType Fire_Totem_Spell
    endglobals
    
    public function onDamaged takes Buff b returns nothing
        local Creep c = b.getBuffedUnit()
        if c.calcChance(0.2) then
            call c.modifyProperty(MOD_DMG_FROM_FIRE, b.userReal)
        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()
        
        set   Fire_Totem_Physique = BuffType.create(5,0.2,true)
        call  m.addModification(MOD_DAMAGE_ADD_PERC,0.10,0.004)
        call  m.addModification(MOD_ATK_CRIT_CHANCE,0.05,0.002)
        call  m.addModification(MOD_ATK_CRIT_DAMAGE,0.5,0.02)
        call  Fire_Totem_Physique.setBuffModifier(m)
        call  Fire_Totem_Physique.setBuffIcon('@@0@@')
        
        set   Fire_Totem_Spell = BuffType.create(5,0.2,true)
        set   m = Modifier.create()
        call  m.addModification(MOD_SPELL_DAMAGE_DEALT,0.10,0.004)
        call  Fire_Totem_Spell.setBuffModifier(m)
        call  Fire_Totem_Spell.setBuffIcon('@@2@@')
        
              
        set Totem_Damage=BuffType.create(7,0,false)    
        call Totem_Damage.setStackingGroup("Totem_Damage") 
        call Totem_Damage.setBuffIcon('@@1@@')
        call Totem_Damage.addEventOnDamaged(EventHandler.onDamaged,1.0,0.0)
    endfunction

On Attack

ONATTACK_chance: 0.15 ONATTACK_chanceLevelAdd: 0.002
function onAttack takes Tower tower returns nothing
    local Iterate towers = Iterate.overUnitsInRangeOfCaster(tower,TARGET_TYPE_TOWERS,500)
    local Unit cur
        
    loop  
        set cur = towers.next() 
        exitwhen cur == 0
        call Fire_Totem_Physique.apply(tower, cur, tower.getLevel())
    endloop
endfunction