#Linear Projectile on Attack

1 messages · Page 1 of 1 (latest)

thorny lynx
#

I have an ability that I would like to fire a projectile on attacks. It appears to not be going on CD, or firing any of the on Spell/Phase functions.

{
    "basic_projectile_attack"
    {
        "BaseClass"             "ability_lua"
        "ScriptFile"            "abilities/heroes/scrub/piercing_projectile.lua"
        "AbilityBehavior"         "DOTA_ABILITY_BEHAVIOR_UNIT_TARGET | DOTA_ABILITY_BEHAVIOR_AUTOCAST | DOTA_ABILITY_BEHAVIOR_ATTACK"
        "AbilityUnitTargetTeam" "DOTA_UNIT_TARGET_TEAM_BOTH"
        "AbilityUnitTargetType" "DOTA_UNIT_TARGET_ALL"
        "AbilityType"             "DOTA_ABILITY_TYPE_BASIC"
        "MaxLevel"                 "1"
        "AbilityTextureName"     "projectile_attack_basic"
        "IsCastableWhileHidden" "1"
        
        "AbilityValues"
        {
            "damage"             "20"
            "damageFalloff"     "0.25"
            "penetrationRange"    "500"
        }
    }
}```

Typescript: Attached?
thorny lynx
#

My critical assumptions are _AUTOCAST && _ATTACK combine to fire OnSpellStart() when auto-attacking with auto-cast enabled.

tropic osprey
#

attack ability doesn't fire OnSpellStart
you should make a modifier to handle attack event

https://github.com/Shushishtok/dota-reimagined/blob/7282a8a781496aeee4d3338750657fae93e24a14/game/scripts/vscripts/abilities/heroes/drow_ranger/reimagined_drow_ranger_frost_arrows.ts#L9
https://github.com/Shushishtok/dota-reimagined/blob/7282a8a781496aeee4d3338750657fae93e24a14/game/scripts/vscripts/modifiers/heroes/drow_ranger/modifier_reimagined_drow_ranger_frost_arrows_handler.ts

OnSpellStart(): void {
// This literally does n o t h i ng
// The entire code is located in the handler modifier, and casting this ability is detected there as well
}

GitHub

Reimagined dota IMBA. Contribute to Shushishtok/dota-reimagined development by creating an account on GitHub.

GitHub

Reimagined dota IMBA. Contribute to Shushishtok/dota-reimagined development by creating an account on GitHub.

thorny lynx
#

That was the feeling I was getting... I didn't want to accept the inevitability that I had wasted time in the wrong area. Thanks!

winged latch
#

Unfortunately Valve didn't add proper support for attack abilities

#

So you need a modifier that listens to on order (order to use this ability on the target), and logical handling of what happens during an attack

#

it becomes even more complex because you may fire an arrow/bullet/whatever projectile and while it is flying you could manipulate the ability (turn on auto-cast for example), so you have to save the data of the attack when it was started

#

and then there are questions about whether an orb attack can be used by illusions, whether an orb attack can be used on specific things (buildings, carriers, wards?), and whether you need to spend mana or cooldown to use it

#

so it's not great.... but doable