Gatling Gun v1
2750
|
ID: 141
Family ID:
Author: Boekie
Rarity: unique
Element: iron
Attack Type: Physical
Attack Range: 1000
Attack CD: 1
Damage: 795-795
Abil. Factor: 0.28
Status: Approved
|
Specials:
10% crit chance (+0.5%/lvl)
Rapid Gun Fire
Has a 65% chance on attack to shoot an extra projectile. Every extra projectile can be followed up by another projectile, but the chance is reduced by 6% each time. Every extra projectile deals the same amount of damage as a normal attack and has a 10% chance to explode, dealing that damage in 200 AoE around the target. Maximum of 10 extra projectiles per attack. Level Bonus: +0.4% chance +0.3% chance to explode
Sentry
This tower gains 15% attackdamage whenever a creep comes within 800 range of it. Lasts 3 seconds and stacks up to 20 times. Level Bonus: +0.5% damage +0.05 seconds duration |
Download
Toggle Triggers Header globals
ProjectileType ball
BuffType boekie_sentryBuff
endglobals
public function hit takes Projectile p, Unit creep returns nothing
local Tower tower = p.getCaster()
local Effect targetEffect
if tower.calcChance(0.10 + (tower.getLevel()*0.003)) == true then
set targetEffect = Effect.createScaled("Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl", p.x, p.y, 30.0, 0, 1.6)
call targetEffect.setLifetime(1.0)
call tower.doAttackDamageAoEUnit(creep, 200, p.userReal*tower.getCurrentAttackDamageWithBonus(),tower.calcAttackMulticrit(0,0,0), 0.0)
else
call tower.doAttackDamage(creep,p.userReal*tower.getCurrentAttackDamageWithBonus(),tower.calcAttackMulticrit(0,0,0))
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 ball = ProjectileType.create("Abilities\\Weapons\\BoatMissile\\BoatMissile.mdl",4,1000)
call ball.enableHoming(ProjectileTargetEvent.hit,0)
set boekie_sentryBuff = BuffType.create(0.0, 0.0, true)
call m.addModification(MOD_DAMAGE_ADD_PERC, 0.0, 0.005)
call boekie_sentryBuff.setBuffModifier(m)
call boekie_sentryBuff.setBuffIcon('@@0@@')
call boekie_sentryBuff.setStackingGroup("boekie_sentryBuff")
endfunction
On Attack
ONATTACK_chance: 0.65
ONATTACK_chanceLevelAdd: 0.004
function onAttack takes Tower tower returns nothing
local Unit target = Event.getTarget()
local PeriodicEvent ev = tower.userInt3
local integer amount = 1 //initial num balls
//0.1 is the periodic timer. if you change that, change the value here as well
local integer maxShotsPossible = R2I(tower.getCurrentAttackspeed() / 0.1)
local real dmgRatio = 1.0
//increment amount of extra attacks until the chance isn't met or max is reached.
loop
exitwhen tower.calcChance(0.65 + tower.getLevel() * (0.004) - amount * 0.06) == false or amount > 10
set amount = amount + 1
endloop
//if tower cannot release as many projectiles as required, scale the dmg instead!
if amount > maxShotsPossible then
set dmgRatio = I2R(amount) / I2R(maxShotsPossible)
set amount = maxShotsPossible
endif
//sets the target to shoot balls at and makes the periodic period smaller to get the rapid attack
set tower.userInt = target
set tower.userInt2 = target.getUID()
set tower.userReal = amount
set tower.userReal2 = dmgRatio
call ev.enable()
endfunction
On Tower Creation function onCreate takes Tower tower returns nothing
set tower.userInt = 0 //saves current projectile target
set tower.userInt2 = 0 //saves target UID - safety check
set tower.userInt3 = 0 //saves the periodic
set tower.userReal = 0. //saves number of balls to fire
set tower.userReal2 = 1. //saves the projectile's dmg ratio
endfunction
On Unit Comes In Range
UNITINRANGE_targetType: TARGET_TYPE_CREEPS
UNITINRANGE_range: 800
function onUnitInRange takes Tower tower returns nothing
local integer towerLevel = tower.getLevel()
local integer buffLevel = 1
local Buff b = tower.getBuffOfGroup("boekie_sentryBuff")
if b != 0 then
set buffLevel = IMinBJ(b.userInt + 1, 20)
endif
set boekie_sentryBuff.applyCustomTimed(tower, tower, buffLevel * (30 + towerLevel), 3.0 + 0.05 * towerLevel).userInt = buffLevel
endfunction
Periodic
PERIODIC_period: 0.1
function periodic takes Tower tower returns nothing
local Unit target = tower.userInt
local Projectile gatlingShot
if tower.userInt3 == 0 then
//sets the userInt3 to this periodic event
set tower.userInt3 = Event.getCurrentPeriodicEvent()
endif
//check if target hasn't died
if target.getUID() != tower.userInt2 then
call PeriodicEvent(tower.userInt3).disable()
return
endif
if tower.userReal > 0 then //balls remain to be shot?
set gatlingShot = Projectile.createFromPointToUnit(ball,tower,1,0,tower.getX(),tower.getY(),100,target,true,false,false)
call gatlingShot.setScale(0.4)
set gatlingShot.userReal = tower.userReal2 //the dmgRatio
set tower.userReal = tower.userReal - 1
if tower.userReal <= 0 then //burst attack is over so switch off periodic
call PeriodicEvent(tower.userInt3).disable()
endif
endif
endfunction
|
Description:
Latest Upload Comment: