Cute Small Spider v1
120
ID:
102
Family ID:
Author:
D1000
Rarity:
uncommon
Element:
nature
Attack Type:
Essence
Attack Range:
825
Attack CD:
1.2
Damage:
57-66
Abil. Factor:
0.4
Status:
Unapproved

Description:

A cute small spider.
Ugh... It spat at me!

Latest Upload Comment:

Restored from 1.10
Specials:
-30% dmg to nature
+10% dmg to orcs
+20% dmg to humanoids
Poisonous Spittle
Units damaged by the spider become infected and receive 30 spell damage per second for 5 seconds. Further attacks on the same unit will increase the potency of the infection, stacking the damage and refreshing duration. Limit of 5 stacks. The highest stack amount of any spider that has infected a unit will be used.

Level Bonus:
+1.5 damage per second
+0.05 second duration
+1 stack every 5 levels
Download

Toggle Triggers

Header

    globals
        //@export
        BuffType D1000_Spider_Poison
        //@export
        EventTypeList D1000_Spider_Apply
    endglobals
    
    function D1000_Spider_Damage takes Buff b returns nothing
        local Unit caster = b.getCaster()
        call caster.doSpellDamage(b.getBuffedUnit(),b.userReal,caster.calcSpellCritNoBonus()) 
    endfunction
    
    function hit takes Tower tower returns nothing
        local Unit target = Event.getTarget()
        local Buff b = target.getBuffOfType(D1000_Spider_Poison)
        local integer level = tower.getLevel()
        local real addDam = tower.userInt+tower.userReal*level
        local real maxDam = tower.userInt2 + tower.userReal2 * level + addDam * (R2I(level / 5))
        if b <= 0 then
            set b = D1000_Spider_Poison.apply(tower, target, level)
            set b.userReal = addDam
            set b.userReal2 = maxDam
            set b.userReal3 = tower.getProp_SpellDmgDealt()
        else
            if b.userReal2 >= maxDam then
                set maxDam = b.userReal2
            endif
            
            if b.userReal+addDam >= maxDam then
                set addDam = maxDam
            else
                set addDam = b.userReal+addDam
            endif
            
            if b.userReal3 < tower.getProp_SpellDmgDealt() then
                call b.removeBuff()
                set b = D1000_Spider_Poison.apply(tower, target, level)
                set b.userReal3 = tower.getProp_SpellDmgDealt()
            else
                call b.setRemainingDuration(tower.userInt3 + tower.userReal3 * level)
            endif
            set b.userReal = addDam
            set b.userReal2 = maxDam
        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 D1000_Spider_Poison = BuffType.create(5,0.05,false)
        call D1000_Spider_Poison.setBuffIcon('@@0@@')
        call D1000_Spider_Poison.addPeriodicEvent(EventHandler.D1000_Spider_Damage,1) 
        set D1000_Spider_Apply = EventTypeList.create()
        call D1000_Spider_Apply.addEventOnDamage(hit, 1, 0)
    endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
    call tower.addEventList(D1000_Spider_Apply)
    set tower.userInt = 30
    set tower.userReal = 1.5
    set tower.userInt2 = 150
    set tower.userReal2 = 7.5
    set tower.userInt3 = 5
    set tower.userReal3 = 0.05
endfunction