package SpellFirearrow import SpellHandler import SpellObjectGen import BuffHandler import UnitData import StatHandler import DamageHandler import Missile import TalentList import SpellList constant int SPELL_RAW = 'AS07' constant int BUFF_ABIL_RAW = 'AB07' constant int BUFF_RAW = 'BB07' constant string SPELL_ORDER = "flamingarrow" public class BuffFirearrow extends Buff effect sfx1 unit caster real damagePerTick override function getName() returns string return "Flaming Arrow" override function getRaw() returns int return BUFF_ABIL_RAW override function getBuffRaw() returns int return BUFF_RAW override function getPolicy() returns BuffPolicy return BuffPolicy.STACKING construct(unit caster) this.caster = caster override function onApply() real timePerTick = 1. int ticks = 4 damagePerTick = caster.xGetUnitData().unitStatBuffer.get(Stat.AGIL) * 2. / ticks if caster.xHasTalent(TALENT_RANGER_FIREARROW_DURATION) ticks = 6 startTimed(timePerTick, ticks, true) sfx1 = getUnit().addEffect("Abilities\\Spells\\Human\\FlameStrike\\FlameStrikeDamageTarget.mdl", "chest") override function onTimer() if not caster.xIsAlive() or not getUnit().xIsAlive() destroy this unitDamageTarget(caster, getUnit(), damagePerTick, DamageType.FIRE) override function onRemove() sfx1.destr() class MissileFirearrow extends Missile unit casterUnit unit targetUnit override function onHit() if targetUnit.xIsAlive() unitDamageTarget(casterUnit, targetUnit, casterUnit.xGetUnitData().unitStatBuffer.get(Stat.DAMA) * 1., DamageType.PHYSICAL) new BuffFirearrow(casterUnit).apply(targetUnit) construct(unit caster, unit target) super(caster.getPos3(), 1300., 0.15, "Abilities\\Weapons\\SearingArrow\\SearingArrowMissile.mdl", target, 0.) casterUnit = caster targetUnit = target class SpellFirearrow extends Spell override function onCast() new MissileFirearrow(caster, targetUnit) init registerSpellcast(SPELL_RAW, () -> new SpellFirearrow()) registerSpellId(1, HeroType.RANGER, SPELL_RAW) @compiletime function genObjects() genBuffObjectData(BUFF_ABIL_RAW, BUFF_RAW, "|cffff0000Firearrow|r", "ReplaceableTextures\\CommandButtons\\BTNSearingArrows.blp", "This unit was hit by a firearrow and is burning.") genSpell(SPELL_RAW, 8, 12, SPELL_ORDER, "Firearrow", "Q", "Shoots a flaming arrow at the target dealing + " + colorizeStatValue("1 x Attack Power") + " physical damage. The target is set on fire and takes " + colorizeStatValue("2 x Agi") + " fire damage over 4 seconds.", "ReplaceableTextures\\CommandButtons\\BTNSearingArrows.blp") ..setTargetUnit(650, TARGETS_ALLOWED_CREEP_BOSS)