Staff of the Wild Equus v1
350
lvl: 11

ID:

188

Author:

drol

Rarity:

rare

Status:

Approved

Description:

While wielding this staff a vast power becomes part of you.

Latest Upload Comment:

Restored from 1.10
Ascension
Each attack has an 8% base attackspeed adjusted chance to ascend the target creep, lifting it up for 2 seconds and making it grant 20% more experience when killed in the air. Only works on normal and mass creeps.

Level Bonus:
+0.8% experience
Download

Toggle Triggers

Header

goldcost: 350
    globals
    
        BuffType drol_liftBuff
    
    endglobals
    
    // Event on lift up
    private function drol_lift_up takes Buff b returns nothing
        local Creep c = b.getBuffedUnit()
        set b.userInt = Effect.createSimpleOnUnit("Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl", c, "origin")
        call c.adjustHeight(300, 150)
    endfunction
    
    // Periodic event (0.1 sec)
    private function drol_lift_period takes Buff b returns nothing
        local Creep c = b.getBuffedUnit()
        call c.moveToPoint(c.getX() + GetRandomReal(-5, 5), c.getY() + GetRandomReal(-5, 5), true)
        call SetUnitFacing(c.getUnit(), GetUnitFacing(c.getUnit()) + 125)
    endfunction
    
    // Event on expire
    private function drol_lift_down takes Buff b returns nothing
        local Creep c = b.getBuffedUnit()
        call c.adjustHeight(-300, 2500)
        call Effect(b.userInt).destroy()
        call Effect.createSimpleAtUnit("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl", c).destroy()
        call c.reorder()
    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()
        call m.addModification(MOD_EXP_GRANTED, 0.2, 0.008)
        
        set drol_liftBuff = BuffType.createDuplicate(cb_stun, 2., 0., false)
        call drol_liftBuff.addEventOnCreate(drol_lift_up)
        call drol_liftBuff.addPeriodicEvent(drol_lift_period, 0.1)
        call drol_liftBuff.addEventOnCleanup(drol_lift_down)
        call drol_liftBuff.setBuffModifier(m)
        call drol_liftBuff.setBuffIcon('@@0@@')
    
    endfunction

On Damage

ONDAMAGE_chance: 1.0 goldcost: 0 ONDAMAGE_chanceLevelAdd: 0.0
function onDamage takes Item itm returns nothing
    local Tower tower = itm.getCarrier()
    local integer size = Event.getTarget().getSize()

    if Event.isMainTarget() and tower.calcChance(0.08 * tower.getBaseAttackspeed()) and (size == SIZE_MASS or size == SIZE_MASS_CHALLENGE or size == SIZE_NORMAL) then
        call drol_liftBuff.apply(tower, Event.getTarget(), tower.getLevel())
    endif
endfunction