Zh/Dota 2 Workshop Tools/Scripting/Abilities Data Driven Example

From Valve Developer Community
Jump to navigation Jump to search

单位死亡后造成持续性范围伤害的例子

本示例在技能被添加之后,将会等到拥有者死亡之后触发,当拥有者死亡的时候,一个带有酸雾特效和一个降低目标区域的单位护甲并施加伤害的计时器将会被创建。

//=================================================================================================================
// Creature: Acid Spray
//=================================================================================================================
"creature_acid_spray"
{
 // General
 //-------------------------------------------------------------------------------------------------------------
 "BaseClass" 					"ability_datadriven"
 "AbilityBehavior"				"DOTA_ABILITY_BEHAVIOR_AOE"
 "AbilityUnitDamageType"			"DAMAGE_TYPE_COMPOSITE"
 "AbilityTextureName"			"alchemist_acid_spray"
 // Casting
 //-------------------------------------------------------------------------------------------------------------
 "AbilityCastPoint"				"0.2"
 "AbilityCastRange"				"900"
 "OnOwnerDied"
 {
   "CreateThinker"
   {
    "ModifierName" "creature_acid_spray_thinker"
    "Target" "CASTER"
   }
 }
 "Modifiers"
 {
  "creature_acid_spray_thinker"
  {
   "Aura" "create_acid_spray_armor_reduction_aura"
   "Aura_Radius" "%radius"
   "Aura_Teams" "DOTA_UNIT_TARGET_TEAM_ENEMY"
   "Aura_Types" "DOTA_UNIT_TARGET_HERO | DOTA_UNIT_TARGET_CREEP | DOTA_UNIT_TARGET_MECHANICAL"
   "Aura_Flags" "DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES"
   "Duration" "%duration"
   "OnCreated"
   {
    "AttachEffect"
    {
      "EffectName" "alchemist_acid_spray"
      "EffectAttachType" "follow_origin"
      "Target" "TARGET"
      "ControlPoints"
      {
       "00" "0 0 0"
       "01" "%radius 1 1"
      }
     }
    }
   }
   "create_acid_spray_armor_reduction_aura"
   {
    "IsDebuff" "1"
    "IsPurgable" "0"
    "EffectName" "alchemist_acid_spray_debuff"				
    "ThinkInterval" "%tick_rate"
    "OnIntervalThink"
    {
      "Damage"
      {
       "Type" "DAMAGE_TYPE_COMPOSITE"
       "Damage" "%damage"
       "Target" "TARGET"
      }
     }
     "Properties"
     {
       "MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS" "%armor_reduction"
     }
    }
   }
 // Special	
 //-------------------------------------------------------------------------------------------------------------
 "AbilitySpecial"
 {
  "01"
  {
   "var_type"				"FIELD_INTEGER"
   "radius"				"250"
  }
  "02"
  {
   "var_type"				"FIELD_FLOAT"
   "duration"				"16.0"
  }
  "03"
  {
   "var_type"				"FIELD_INTEGER"
   "damage"				"118 128 138 158"
  }
  "04"
  {
   "var_type"				"FIELD_INTEGER"
   "armor_reduction"		        "-3 -4 -5 -6"
  }
  "05"
  {
   "var_type"				"FIELD_FLOAT"
   "tick_rate"				"1.0"
  }
 }
}