Ondeath CreateUnit Data-driven?

Any examples of Ondeath being used to create units when a unit dies? Like a splitdeath ability?

Comments

  • Posts: 151

    it should be pretty straight forward..

    "modifier_name"
    {
        "IsHidden"          "0"
        "IsDebuff"          "0"
    
        "OnDeath"
        {
            "SpawnUnit"
            {
                "UnitName"      "npc_name"
                "Target"        "CASTER"
                "Duration"      "60"
                "UnitCount"     "2"
                "UnitLimit"     "0"
                "GrantsGold"    "1"
                "GrantsXP"      "1"
                "SpawnRadius"   "100"
                "OnSpawn"
                {
                    "ApplyModifier"
                    {
                        "ModifierName"  "modifier_phased"
                        "Target"        "TARGET"
                        "Duration"      "0.03"
                    }
                }
            }
        }
    }
    
  • Posts: 271

    @DankBud I remember that I had problems when I didn't use target flags.

    "Target"
    {
       "Center"     "CASTER"
       "Flags"      "DOTA_UNIT_TARGET_FLAG_DEAD | DOTA_UNIT_TARGET_FLAG_NOT_ILLUSIONS"
    }
    

    It didn't work properly without this.

    @NinjaPotato If your ability is applying a debuff on enemies and you want to create units after their death, everything is the same like DankBud wrote except this:

    "Target"
    {
       "Center"     "UNIT"
       "Flags"      "DOTA_UNIT_TARGET_FLAG_DEAD"
    }