I have a building that belongs to the team and shares its abilities and items with all of the players on the team. These are all sort of "auto battler" abilities, so you click a point, there's some CastFilterResultLocation(location) stuff that goes on to make sure you're trying to spawn that unit in a lane/valid location, and then after a 2 second delay, that unit spawns.
This works perfectly well with the items.
With the abilities though, I can see from debug output that I'm getting the correct UF_SUCCESS or UF_FAIL_INVALID_LOCATION, however the OnSpellStart() is NEVER hit.
My KVs look something like:
"DOTAAbilities"
{
"ability_train_champ_creep"
{
"BaseClass" "ability_lua"
"ScriptFile" "abilities/mercs/ability_train_champ_creep.lua"
"AbilityTextureName" "mercenary/champ_creep"
"MaxLevel" "1"
"FightRecapLevel" "1"
"AbilityType" "DOTA_ABILITY_TYPE_BASIC"
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_OPTIONAL_POINT | DOTA_ABILITY_BEHAVIOR_CHANNELLED"
"AbilitySharedWithTeammates" "1"
"AbilityCastPoint" "0.0"
"AbilityCooldown" "30"
"AbilityManaCost" "0"
"AbilityCastRange" "0" //global?
}
}
As a sanity check, I changed the AbilityBehavior to DOTA_ABILITY_BEHAVIOR_NO_TARGET and validated that OnSpellStaart() gets hit that way. So I'm not sure if there's just some issue of passing a successful target by a shared owner to the team-owned structure's ability so that the spell phase starts? Not really sure what I'm missing here or if there's something dumb I just forgot to check/set?