Meteor Totem v1
2000
ID:
575
Family ID:
Author:
SirCoqaLot.
Rarity:
unique
Element:
fire
Attack Type:
Elemental
Attack Range:
850
Attack CD:
3.8
Damage:
1966-2966
Abil. Factor:
0.3
Status:
Approved

Description:

A powerful Totem that causes other towers to release meteors that deal spell damage.

Latest Upload Comment:

Restored from 1.10
Specials:
Splash attack:
   325 AoE: 50% damage
Attraction
This tower buffs 4 towers in 500 range and gives them a 35% attackspeed adjusted chance on attack to release a meteor dealing 200 spell damage, or a 100% chance to release a meteor on spell cast dealing 500 spell damage. The Meteors fly towards a random target in 1000 range and deal damage in 220 AoE around the main target. The buff lasts until a meteor is released. 

Level Bonus:
+1 tower buffed every 5 levels 
+8 spell damage on attack 
+20 spell damage on cast
Torture
Targets damaged by this tower are debuffed for 2.5 seconds. Whenever a debuffed creep is dealt at least 500 attackdamage it receives an additional 8% of that damage as spell damage. This ability cannot crit. 

Level Bonus:
+0.05 seconds duration
+0.1% damage as spell damage
Download

Toggle Triggers

Autocast

AUTOCAST_cooldown: 4 AUTOCAST_autoRange: 500 AUTOCAST_manacost: 0 AUTOCAST_range: 500 AUTOCAST_targetType: 0 AUTOCAST_numBuffsBeforeIdle: 0 caster_art: target_art: AUTOCAST_autocastType: AC_TYPE_ALWAYS_BUFF AUTOCAST_buffType: 0 AUTOCAST_isExtended: false AUTOCAST_targetSelf: true
private function onAutocast takes Tower tower returns nothing
local Unit u 
local Iterate it = Iterate.overUnitsInRangeOfCaster(tower,TARGET_TOWERS,500) //iterating through towers in 500 range apllying the buff but not to itself
local integer number = 4 + R2I(tower.getLevel()/5)


    loop
        set u = it.nextRandom() 
        exitwhen u == 0 or number == 0
        if u != tower then
            set sir_totem_buff.applyAdvanced(tower,u,0,0,100).userInt = 0
            set number = number - 1 // substracting 1 
        endif
        
    endloop
    
    if u != 0 then
        call it.destroy()
    endif
    
endfunction

Header

    globals
    BuffType sir_totem_buff
    BuffType sir_totem_debuff
    ProjectileType sir_meteor_projectile
    endglobals
    
    function sir_totem_event takes Buff b returns nothing // doing meteor stuff
       local Tower tower = b.getCaster()
       local Tower buffed = b.getBuffedUnit()
       local Iterate it = Iterate.overUnitsInRangeOfCaster(buffed,TARGET_CREEPS,1000)
       local Unit result = it.nextRandom()
       local integer level = tower.getLevel()
        //searching a target in 1k range around tower
        
       if result != 0 then // if the ability has found a creep in range
            if b.userInt == 1 then
                set Projectile.createBezierInterpolationFromPointToUnit(sir_meteor_projectile,buffed,1,1,buffed.getX(),buffed.getY(),buffed.getZ()+1200,result,0.0,0,0.0,true).userInt = 200 + 8 * level     // on atk
            else
                set Projectile.createBezierInterpolationFromPointToUnit(sir_meteor_projectile,buffed,1,1,buffed.getX(),buffed.getY(),buffed.getZ()+1200,result,0.0,0,0.0,true).userInt = 500 + 20 * level// on cast
            endif
            call it.destroy()
       endif
       
       call b.removeBuff()  // purging the buff
    endfunction
    
    
    
    function sir_meteor_hit takes Projectile p, Unit u returns nothing
    local Tower tower = p.getCaster()    
    call tower.doSpellDamageAoE(p.x,p.y,220,p.userInt,tower.calcSpellCritNoBonus(),0)
    //dealing the damage calculated before
    call SFXAtPoint("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",p.x,p.y)
    endfunction
    
    
    function sir_totem_onatk takes Buff b returns nothing // doing stuff for meteor on attack
    local Tower buffed = b.getBuffedUnit()
    
    if buffed.calcChance(buffed.getBaseAttackspeed()*0.35) then
            set b.userInt = 1
            call sir_totem_event(b)
    endif
    
    endfunction
    
    function sir_totem_attack takes Buff b returns nothing  // doing stuff when the tower itself is attacking
    local Tower caster = b.getCaster()
    local real damage = Event.damage * (0.08 + caster.getLevel()*0.001)
    local Creep target = b.getBuffedUnit()
    
    if Event.damage >= 500 and Event.isSpellDamage() == false then
        call caster.doSpellDamage(target,damage,1)
        call caster.getOwner().displaySmallFloatingText(I2S(R2I(damage*caster.getProp_SpellDmgDealt())),target,255,150,150,20)
    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
    set sir_totem_buff = BuffType.create(0,0,true)
    call sir_totem_buff.addEventOnAttack(sir_totem_onatk,1,0)
    call sir_totem_buff.addEventOnSpellCast(sir_totem_event)
    call sir_totem_buff.setBuffIcon('@@0@@')
    
    set sir_totem_debuff = BuffType.create(0,0,false)
    call sir_totem_debuff.setBuffIcon('@@1@@')
    call sir_totem_debuff.addEventOnDamaged(sir_totem_attack,1,0)
    
    set sir_meteor_projectile = ProjectileType.create("Abilities\\Weapons\\LordofFlameMissile\\LordofFlameMissile.mdl",10,950)
    call sir_meteor_projectile.setEventOnInterpolationFinished(sir_meteor_hit)
    
    endfunction

On Damage

ONDAMAGE_chance: 1.0 ONDAMAGE_chanceLevelAdd: 0.0
function onDamage takes Tower tower returns nothing
    call sir_totem_debuff.applyAdvanced(tower,Event.getTarget(),0,0,2.5+tower.getLevel()*0.05)// apllys the buff dealing x% additional damage
endfunction