Miner v1
500
ID:
622
Family ID:
Author:
drol
Rarity:
rare
Element:
iron
Attack Type:
Decay
Attack Range:
1000
Attack CD:
1.8
Damage:
614-633
Status:
Approved

Description:

This loner has been searching for gold and treasure his entire life.
Specials:
+20% bounty collected (+0.8%/lvl)
Goldrush
The miner has a 20% chance on attack to go into a goldrush, increasing attackspeed by more than 20% depending on the player's gold and making each hit gain 1.0 gold. Goldrush lasts 5 seconds. Cannot retrigger while in goldrush!

Hint: Check multiboard to view exact attack speed bonus

Level Bonus:
+0.04 gold gained
+0.1 seconds duration
Excavation
Every 20 seconds the miner has a 25% chance to find 7.5 gold.

Level Bonus:
+0.3 gold
Download

Toggle Triggers

Header

    globals
        //@export
        BuffType drol_goldrush
        //@export
        MultiboardValues drol_excavationMulti
    endglobals

    //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 drol_goldrush = BuffType.create(5,0.1,true)
        
        call m.addModification(MOD_ATTACKSPEED, 0.2, 0.01)
        
        call drol_goldrush.setBuffIcon('@@0@@')
        call drol_goldrush.setBuffModifier(m)
        
        call drol_goldrush.setStackingGroup("drol_goldrush")

        set   drol_excavationMulti = MultiboardValues.create(2)
        call  drol_excavationMulti.setKey(0,"Gold gained") 
        call  drol_excavationMulti.setKey(1,"Goldrush bonus")
    
    endfunction

On Attack

ONATTACK_chance: 0.2 ONATTACK_chanceLevelAdd: 0.0
function onAttack takes Tower tower returns nothing
    if tower.getBuffOfGroup("drol_goldrush") == 0 then
        call drol_goldrush.applyCustomTimed(tower,tower,R2I(Pow(GetPlayerState(tower.getOwner().getThePlayer(), PLAYER_STATE_RESOURCE_GOLD),0.5) / 5.), 5. + tower.getLevel() * 0.1)
    endif
    
endfunction

On Damage

ONDAMAGE_chance: 1.0 ONDAMAGE_chanceLevelAdd: 0.0
function onDamage takes Tower tower returns nothing
    local real goldBonus = 1.0 + tower.getLevel() * 0.04
     
    if Event.isMainTarget() and tower.getBuffOfGroup("drol_goldrush") > 0 then
        set tower.userReal = tower.userReal + goldBonus
        call tower.getOwner().giveGold(goldBonus, tower.getUnit(), false, true)
    endif
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
    
    local Tower preceding = Event.getPrecedingTower()  
    
    if(preceding.getFamily() == tower.getFamily()) then  
        set tower.userReal = preceding.userReal
    else  
        set tower.userReal = 0.0
    endif 
    
endfunction

On Tower Details

goldcost: 0
function onTowerDetails takes Tower tower returns MultiboardValues
    call   drol_excavationMulti.setValue(0,I2S(R2I(tower.userReal)))
    call   drol_excavationMulti.setValue(1,I2S(20 + R2I(Pow(GetPlayerState(tower.getOwner().getThePlayer(), PLAYER_STATE_RESOURCE_GOLD),0.5)/5)) + "%")
    return drol_excavationMulti
endfunction

Periodic

PERIODIC_period: 20
function periodic takes Tower tower returns nothing
    local real goldBonus = 7.5 + tower.getLevel() * 0.3
    local Effect targetEffect 

    set targetEffect = Effect.createScaled("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl", GetUnitX(tower.getUnit()), GetUnitY(tower.getUnit()), 0, 0, 0.8)
    call targetEffect.setLifetime(0.1) 
        
    if tower.calcChance(0.25) then
        set tower.userReal = tower.userReal + goldBonus
        call tower.getOwner().giveGold(goldBonus, tower.getUnit(), false, true)
    endif
endfunction
Lonely Miner v1
1400
ID:
687
Family ID:
Author:
drol
Rarity:
rare
Element:
iron
Attack Type:
Decay
Attack Range:
1000
Attack CD:
1.8
Damage:
1717-1771
Status:
Approved

Description:

This loner has been searching for gold and treasure his entire life.
Specials:
+20% bounty collected (+0.8%/lvl)
Goldrush
The miner has a 20% chance on attack to go into a goldrush, increasing attackspeed by more than 40% depending on the player's gold and making each hit gain 2.8 gold. Goldrush lasts 5 seconds. Cannot retrigger while in goldrush!

Hint: Check multiboard to view exact attack speed bonus

Level Bonus:
+0.1 gold gained
+0.1 seconds duration
Excavation
Every 20 seconds the miner has a 25% chance to find 21 gold.

Level Bonus:
+0.8 gold
Download

Toggle Triggers

Header

    globals
        //@import
        BuffType drol_goldrush
        //@import
        MultiboardValues drol_excavationMulti
    endglobals
    
    //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
    
    endfunction

On Attack

ONATTACK_chance: 0.2 ONATTACK_chanceLevelAdd: 0.0
function onAttack takes Tower tower returns nothing
    if tower.getBuffOfGroup("drol_goldrush") == 0 then
        call drol_goldrush.applyCustomTimed(tower,tower,R2I(20. + Pow(GetPlayerState(tower.getOwner().getThePlayer(), PLAYER_STATE_RESOURCE_GOLD),0.5) / 3), 5. + tower.getLevel() * 0.1)
    endif
    
endfunction

On Damage

ONDAMAGE_chance: 1.0 ONDAMAGE_chanceLevelAdd: 0.0
function onDamage takes Tower tower returns nothing
    local real goldBonus = 2.8 + tower.getLevel() * 0.1
     
    if Event.isMainTarget() and tower.getBuffOfGroup("drol_goldrush") > 0 then
        set tower.userReal = tower.userReal + goldBonus
        call tower.getOwner().giveGold(goldBonus, tower.getUnit(), false, true)
    endif
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
    
    local Tower preceding = Event.getPrecedingTower()  

    if(preceding.getFamily() == tower.getFamily()) then  
        set tower.userReal = preceding.userReal
    else  
        set tower.userReal = 0.0
    endif 
    
endfunction

On Tower Details

function onTowerDetails takes Tower tower returns MultiboardValues
    // Show total gold digged up
    call   drol_excavationMulti.setValue(0,I2S(R2I(tower.userReal)))
    call   drol_excavationMulti.setValue(1,I2S(40 + R2I(Pow(GetPlayerState(tower.getOwner().getThePlayer(), PLAYER_STATE_RESOURCE_GOLD),0.5)/3)) + "%")
    return drol_excavationMulti
endfunction

Periodic

PERIODIC_period: 20
function periodic takes Tower tower returns nothing
    local real goldBonus = 21 + tower.getLevel() * 0.8
    local Effect targetEffect 

    set targetEffect = Effect.createScaled("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl", GetUnitX(tower.getUnit()), GetUnitY(tower.getUnit()), 0, 0, 0.8)
    call targetEffect.setLifetime(0.1) 
        
    if tower.calcChance(0.25) then
        set tower.userReal = tower.userReal + goldBonus
        call tower.getOwner().giveGold(goldBonus, tower.getUnit(), false, true)
    endif
endfunction
Fortunate Miner v1
2700
ID:
688
Family ID:
Author:
drol
Rarity:
rare
Element:
iron
Attack Type:
Decay
Attack Range:
1000
Attack CD:
1.8
Damage:
3304-3423
Status:
Approved

Description:

This loner has been searching for gold and treasure his entire life.
Specials:
+20% bounty collected (+0.8%/lvl)
Goldrush
The miner has a 20% chance on attack to go into a goldrush, increasing attackspeed by more than 60% depending on the player's gold and making each hit gain 5.4 gold. Goldrush lasts 5 seconds. Cannot retrigger while in goldrush!

Hint: Check multiboard to view exact attack speed bonus

Level Bonus:
+0.22 gold gained
+0.1 seconds duration
Excavation
Every 20 seconds the miner has a 25% chance to find 40 gold.

Level Bonus:
+1.6 gold
Download

Toggle Triggers

Header

    globals
        //@import
        BuffType drol_goldrush
        //@import
        MultiboardValues drol_excavationMulti
    endglobals
    
    //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
    
    endfunction

On Attack

ONATTACK_chance: 0.2 ONATTACK_chanceLevelAdd: 0.0
function onAttack takes Tower tower returns nothing
    if tower.getBuffOfGroup("drol_goldrush") == 0 then
        call drol_goldrush.applyCustomTimed(tower,tower,R2I(40. + Pow(GetPlayerState(tower.getOwner().getThePlayer(), PLAYER_STATE_RESOURCE_GOLD),0.5) / 2), 5. + tower.getLevel())
    endif
    
endfunction

On Damage

ONDAMAGE_chance: 1.0 ONDAMAGE_chanceLevelAdd: 0.0
function onDamage takes Tower tower returns nothing
    local real goldBonus = 5.4 + tower.getLevel() * 0.22
     
    if Event.isMainTarget() and tower.getBuffOfGroup("drol_goldrush") > 0 then
        set tower.userReal = tower.userReal + goldBonus
        call tower.getOwner().giveGold(goldBonus, tower.getUnit(), false, true)
    endif
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
    
    local Tower preceding = Event.getPrecedingTower()  

    if(preceding.getFamily() == tower.getFamily()) then  
        set tower.userReal = preceding.userReal
    else
        set tower.userReal = 0.0
    endif 
    
endfunction

On Tower Details

function onTowerDetails takes Tower tower returns MultiboardValues
    // Show total gold digged up
    call   drol_excavationMulti.setValue(0,I2S(R2I(tower.userReal)))
    call   drol_excavationMulti.setValue(1,I2S(60 + R2I(Pow(GetPlayerState(tower.getOwner().getThePlayer(), PLAYER_STATE_RESOURCE_GOLD),0.5)/2)) + "%")
    return drol_excavationMulti
endfunction

Periodic

PERIODIC_period: 20
function periodic takes Tower tower returns nothing
    local real goldBonus = 40 + tower.getLevel() * 1.6
    local Effect targetEffect 

    set targetEffect = Effect.createScaled("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl", GetUnitX(tower.getUnit()), GetUnitY(tower.getUnit()), 0, 0, 0.8)
    call targetEffect.setLifetime(0.1) 
        
    if tower.calcChance(0.25) then
        set tower.userReal = tower.userReal + goldBonus
        call tower.getOwner().giveGold(goldBonus, tower.getUnit(), false, true)
    endif
endfunction