как сделать чтоб способность требовала хп для каста как у феникса

ВИКТОР

Новичок
5 Июн 2019
2
5
1
15
Проект
КАСТОМКИ
Реакции
0 0 5
#1
"viper_gran"
{
// General
//-------------------------------------------------------------------------------------------------------------
"BaseClass" "ability_datadriven"
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_UNIT_TARGET"
"AbilityUnitTargetTeam" "DOTA_UNIT_TARGET_TEAM_ENEMY"
"AbilityUnitTargetType" "DOTA_UNIT_TARGET_HERO | DOTA_UNIT_TARGET_BASIC"
"AbilityType" "DOTA_ABILITY_TYPE_BASE"
"AbilityUnitTargetFlags" "DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES"
"SpellImmunityType" "SPELL_IMMUNITY_ENEMIES_YES"
"AbilityUnitDamageType" "DAMAGE_TYPE_MAGICAL"
"AbilityTextureName" "viper_gran"

// Precache
//-------------------------------------------------------------------------------------------------------------
"precache"
{
"particle" "particles/units/heroes/hero_viper/viper_viper_strike.vpcf" // Wonky projectile
"particle" "particles/units/heroes/hero_viper/viper_viper_strike_debuff.vpcf" // ?
"particle" "particles/units/heroes/hero_viper/viper_viper_strike_warmup.vpcf" //- Seems to be like a "link" meaning it needs the caster #0 and target #1
"particle" "particles/status_fx/status_effect_poison_viper.vpcf"
"soundfile" "soundevents/game_sounds_heroes/game_sounds_viper.vsndevts"
}

// Casting
//-------------------------------------------------------------------------------------------------------------
"AbilityCastRange" "400"
"AbilityCastPoint" "0.3 0.3 0.3 0.3"

// Time
//-------------------------------------------------------------------------------------------------------------
"AbilityCooldown" "28.0 24.0 20.0 16.0"

// Cost
//-------------------------------------------------------------------------------------------------------------
"AbilityManaCost" "0 0 0 0"

// Special
//-------------------------------------------------------------------------------------------------------------
"AbilitySpecial"
{
"01"
{
"var_type" "FIELD_FLOAT"
"duration" "2.3 2.8 3.5 4.1"
}
"02"
{
"var_type" "FIELD_INTEGER"
"damage" "35 60 80 105"
}
"03"
{
"var_type" "FIELD_INTEGER"
"bonus_movement_speed" "-20 -30 -40 -50"
}
"04"
{
"var_type" "FIELD_INTEGER"
"bonus_attack_speed" "-10 -20 -30 -40"
}
"05"
{
"var_type" "FIELD_INTEGER"
"mana_cost_scepter" "0 0 0 0"
}
"06"
{
"var_type" "FIELD_INTEGER"
"hp_cost_perc" "8"
}
"07"
{
"var_type" "FIELD_FLOAT"
"cooldown_scepter" "10.0 10.0 10.0 10.0"
}
"08"
{
"var_type" "FIELD_INTEGER"
"cast_range_scepter" "500"
}
"09"
{
"var_type" "FIELD_INTEGER"
"projectile_speed" "900"
}
// These are for the dissipating attack and movement slow over time
"10"
{
"var_type" "FIELD_INTEGER"
"bonus_movement_speed_small" "-8 -12 -16 -20"
}
"11"
{
"var_type" "FIELD_INTEGER"
"bonus_attack_speed_small" "-8 -12 -16 -20"
}
}

"OnAbilityPhaseStart"
{
"FireEffect"
{
"EffectName" "particles/units/heroes/hero_viper/viper_viper_strike_warmup.vpcf"
"EffectAttachType" "attach_origin"

"ControlPointEntities"
{
"CASTER" "attach_attack1"
"CASTER" "attach_attack1"
}
}
}

"OnSpellStart"
{
"TrackingProjectile"
{
"Target" "TARGET"
"EffectName" "particles/units/heroes/hero_viper/viper_viper_strike.vpcf"
"Dodgeable" "1"
"ProvidesVision" "0"
"MoveSpeed" "%projectile_speed"
"SourceAttachment" "DOTA_PROJECTILE_ATTACHMENT_ATTACK_1"
}

"FireSound"
{
"EffectName" "Hero_Viper.viperStrike"
"Target" "CASTER"
}

}

"OnProjectileHitUnit"
{
"FireSound"
{
"EffectName" "Hero_Viper.viperStrikeImpact"
"Target" "TARGET"
}

"ApplyModifier"
{
"ModifierName" "modifier_viper_strike_debuff_datadriven"
"Target" "TARGET"
}

// Slow Part
"ApplyModifier"
{
"ModifierName" "modifier_viper_strike_slow_datadriven"
"Target" "TARGET"
}
"ApplyModifier"
{
"ModifierName" "modifier_viper_strike_slow_datadriven"
"Target" "TARGET"
}
"ApplyModifier"
{
"ModifierName" "modifier_viper_strike_slow_datadriven"
"Target" "TARGET"
}
"ApplyModifier"
{
"ModifierName" "modifier_viper_strike_slow_datadriven"
"Target" "TARGET"
}
"ApplyModifier"
{
"ModifierName" "modifier_viper_strike_slow_datadriven"
"Target" "TARGET"
}

}

"Modifiers"
{
"modifier_viper_strike_debuff_datadriven"
{
"IsDebuff" "1"
  • "Duration" "%duration"

"StatusEffectName" "particles/status_fx/status_effect_poison_viper.vpcf"
"StatusEffectPriority" "15"

"OnCreated"
{
"AttachEffect"
{
"EffectName" "particles/units/heroes/hero_viper/viper_viper_strike_debuff.vpcf"
"EffectAttachType" "attach_hitloc"
"Target" "TARGET"
}
}

"ThinkInterval" "1.0"
"OnIntervalThink"
{
"RemoveModifier"
{
"ModifierName" "modifier_viper_strike_slow_datadriven"
"Target" "TARGET"
}
"Damage"
{
"Target" "TARGET"
"Type" "DAMAGE_TYPE_MAGICAL"
"Damage" "%damage"
}
}
}

"modifier_viper_strike_slow_datadriven"
{
"IsHidden" "1"
"IsPurgable" "0"

"Attributes" "MODIFIER_ATTRIBUTE_MULTIPLE"

"Properties"
{
"MODIFIER_PROPERTY_MOVESPEED_BONUS_PERCENTAGE" "%bonus_movement_speed_small"
"MODIFIER_PROPERTY_ATTACKSPEED_BONUS_CONSTANT" "%bonus_attack_speed_small"
}
}
}
}
 

SniperX

Продвинутый
26 Фев 2018
150
15
18
steamcommunity.com
Проект
Белоозерская Потасовка - Updated
Реакции
11 0 4
#2
Кароче в OnSpellStart пихаешь это
C++:
"Damage"
{
    "Target"    "CASTER"
    "Type"        "DAMAGE_TYPE_PURE" // ТИП УРОНА есть PURE MAGICAL и PHYSICAL
    "Damage"    "50" // УРОН
}
 
8 Апр 2019
9
0
1
Проект
Autist’s of DoDa
Реакции
0 0 0
#4
И код кидай в спец блок и в спойлер
Получаешь количество хп GetHealth(), проверяешь есть ли больше, чтобы нельзя было суициднуться, если не нужно, вычитаешь и присваиваешь ха назад SetHealth()
 
Реклама: