Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completed Nevermore's (Shadow Fiend's) Shadowrazes #109

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
68 changes: 33 additions & 35 deletions game/scripts/npc/abilities/nevermore_shadowraze1_datadriven.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
// Rewrite of Nevermore Shadowraze 1
// Author: Noya
// Date: April 5, 2015
// Author: nc-dk
// Date: March 4, 2017
"nevermore_shadowraze1_datadriven"
{
// General
//-------------------------------------------------------------------------------------------------------------
"BaseClass" "ability_datadriven"
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_NO_TARGET | DOTA_ABILITY_BEHAVIOR_IGNORE_BACKSWING"
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_NO_TARGET | DOTA_ABILITY_BEHAVIOR_IGNORE_BACKSWING"
"AbilityUnitDamageType" "DAMAGE_TYPE_MAGICAL"
"SpellImmunityType" "SPELL_IMMUNITY_ENEMIES_NO"
"FightRecapLevel" "1"
"SpellImmunityType" "SPELL_IMMUNITY_ENEMIES_NO"
"FightRecapLevel" "1"
"AbilityTextureName" "nevermore_shadowraze1"

// Casting
//-------------------------------------------------------------------------------------------------------------
"AbilityCastPoint" "0.67 0.67 0.67 0.67"
"AbilityCastPoint" "0.55 0.55 0.55 0.55"
"AbilityCastAnimation" "ACT_DOTA_RAZE_1"
"AOERadius" "250"

// Time
//-------------------------------------------------------------------------------------------------------------
"AbilityCooldown" "10.0 10.0 10.0 10.0"
"AbilityCooldown" "10.0 10.0 10.0 10.0"

// Damage.
//-------------------------------------------------------------------------------------------------------------
"AbilityDamage" "75 150 225 300"
"AbilityDamage" "100 175 250 325"

// Cost
//-------------------------------------------------------------------------------------------------------------
"AbilityManaCost" "75 75 75 75"
"AbilityManaCost" "90 90 90 90"

// Special
//-------------------------------------------------------------------------------------------------------------
Expand All @@ -35,17 +37,22 @@
"01"
{
"var_type" "FIELD_INTEGER"
"shadowraze_radius" "250"
"shadowraze_radius" "250"
}
"02"
{
"var_type" "FIELD_INTEGER"
"shadowraze_range" "200"
"shadowraze_range" "200"
}
"03"
{
"var_type" "FIELD_INTEGER"
"shadowraze_cooldown" "3"
"shadowraze_cooldown" "3"
}
"04"
{
"var_type" "FIELD_INTEGER"
"shadowraze_damage" "100 175 250 325"
}
}

Expand All @@ -57,28 +64,19 @@

"OnSpellStart"
{
//TODO: FireSound and Particle

"Damage"
"RunScript"
{
"Target"
{
"Center" "CASTER"
"Radius" "%shadowraze_radius"
"Teams" "DOTA_UNIT_TARGET_TEAM_ENEMY"
"Types" "DOTA_UNIT_TARGET_HERO | DOTA_UNIT_TARGET_BASIC"

"ScriptSelectPoints"
{
"ScriptFile" "heroes/hero_nevermore/shadowraze.lua"
"Function" "ShadowrazePoint"
"Target" "CASTER"
"Count" "1"
"distance" "%shadowraze_range"
}
}
"Type" "DAMAGE_TYPE_MAGICAL"
"Damage" "%AbilityDamage"
"ScriptFile" "heroes/hero_nevermore/shadowraze.lua"
"Function" "Raze"
}
}
}

"OnUpgrade"
{
"RunScript"
{
"ScriptFile" "heroes/hero_nevermore/shadowraze.lua"
"Function" "LevelRaze"
}
}

59 changes: 44 additions & 15 deletions game/scripts/npc/abilities/nevermore_shadowraze2_datadriven.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
// Rewrite of Nevermore Shadowraze 2
// Author: Noya
// Date: April 5, 2015
// Author: nc-dk
// Date: March 4, 2017
"nevermore_shadowraze2_datadriven"
{
// General
//-------------------------------------------------------------------------------------------------------------
"BaseClass" "ability_datadriven"
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_NO_TARGET | DOTA_ABILITY_BEHAVIOR_IGNORE_BACKSWING"
"OnLearnbar" "0"
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_NO_TARGET | DOTA_ABILITY_BEHAVIOR_IGNORE_BACKSWING"
"AbilityUnitDamageType" "DAMAGE_TYPE_MAGICAL"
"SpellImmunityType" "SPELL_IMMUNITY_ENEMIES_NO"
"FightRecapLevel" "1"
"SpellImmunityType" "SPELL_IMMUNITY_ENEMIES_NO"
"FightRecapLevel" "1"
"AbilityTextureName" "nevermore_shadowraze2"

// Casting
//-------------------------------------------------------------------------------------------------------------
"AbilityCastPoint" "0.67 0.67 0.67 0.67"
"AbilityCastPoint" "0.55 0.55 0.55 0.55"
"AbilityCastAnimation" "ACT_DOTA_RAZE_2"
"AOERadius" "450"

// Time
//-------------------------------------------------------------------------------------------------------------
"AbilityCooldown" "10.0 10.0 10.0 10.0"
"AbilityCooldown" "10.0 10.0 10.0 10.0"

// Damage.
//-------------------------------------------------------------------------------------------------------------
"AbilityDamage" "75 150 225 300"
"AbilityDamage" "100 175 250 325"

// Cost
//-------------------------------------------------------------------------------------------------------------
"AbilityManaCost" "75 75 75 75"
"AbilityManaCost" "90 90 90 90"

// Special
//-------------------------------------------------------------------------------------------------------------
Expand All @@ -36,18 +37,46 @@
"01"
{
"var_type" "FIELD_INTEGER"
"shadowraze_radius" "250"
"shadowraze_radius" "250"
}
"02"
{
"var_type" "FIELD_INTEGER"
"shadowraze_range" "450"
"shadowraze_range" "450"
}
"03"
{
"var_type" "FIELD_INTEGER"
"shadowraze_cooldown" "3"
"shadowraze_cooldown" "3"
}
"04"
{
"var_type" "FIELD_INTEGER"
"shadowraze_damage" "100 175 250 325"
}
}
}

"precache"
{
"particle" "particles/units/heroes/hero_nevermore/nevermore_shadowraze.vpcf"
"soundfile" "soundevents/game_sounds_heroes/game_sounds_nevermore.vsndevts"
}

"OnSpellStart"
{
"RunScript"
{
"ScriptFile" "heroes/hero_nevermore/shadowraze.lua"
"Function" "Raze"
}
}

"OnUpgrade"
{
"RunScript"
{
"ScriptFile" "heroes/hero_nevermore/shadowraze.lua"
"Function" "LevelRaze"
}
}
}
59 changes: 44 additions & 15 deletions game/scripts/npc/abilities/nevermore_shadowraze3_datadriven.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
// Rewrite of Nevermore Shadowraze 3
// Author: Noya
// Date: April 5, 2015
// Author: nc-dk
// Date: March 4, 2017
"nevermore_shadowraze3_datadriven"
{
// General
//-------------------------------------------------------------------------------------------------------------
"BaseClass" "ability_datadriven"
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_NO_TARGET | DOTA_ABILITY_BEHAVIOR_IGNORE_BACKSWING"
"OnLearnbar" "0"
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_NO_TARGET | DOTA_ABILITY_BEHAVIOR_IGNORE_BACKSWING"
"AbilityUnitDamageType" "DAMAGE_TYPE_MAGICAL"
"SpellImmunityType" "SPELL_IMMUNITY_ENEMIES_NO"
"FightRecapLevel" "1"
"SpellImmunityType" "SPELL_IMMUNITY_ENEMIES_NO"
"FightRecapLevel" "1"
"AbilityTextureName" "nevermore_shadowraze3"

// Casting
//-------------------------------------------------------------------------------------------------------------
"AbilityCastPoint" "0.67 0.67 0.67 0.67"
"AbilityCastPoint" "0.55 0.55 0.55 0.55"
"AbilityCastAnimation" "ACT_DOTA_RAZE_3"
"AOERadius" "700"

// Time
//-------------------------------------------------------------------------------------------------------------
"AbilityCooldown" "10.0 10.0 10.0 10.0"
"AbilityCooldown" "10.0 10.0 10.0 10.0"

// Damage.
//-------------------------------------------------------------------------------------------------------------
"AbilityDamage" "75 150 225 300"
"AbilityDamage" "100 175 250 325"

// Cost
//-------------------------------------------------------------------------------------------------------------
"AbilityManaCost" "75 75 75 75"
"AbilityManaCost" "90 90 90 90"

// Special
//-------------------------------------------------------------------------------------------------------------
Expand All @@ -36,18 +37,46 @@
"01"
{
"var_type" "FIELD_INTEGER"
"shadowraze_radius" "250"
"shadowraze_radius" "250"
}
"02"
{
"var_type" "FIELD_INTEGER"
"shadowraze_range" "700"
"shadowraze_range" "700"
}
"03"
{
"var_type" "FIELD_INTEGER"
"shadowraze_cooldown" "3"
"shadowraze_cooldown" "3"
}
"04"
{
"var_type" "FIELD_INTEGER"
"shadowraze_damage" "100 175 250 325"
}
}
}

"precache"
{
"particle" "particles/units/heroes/hero_nevermore/nevermore_shadowraze.vpcf"
"soundfile" "soundevents/game_sounds_heroes/game_sounds_nevermore.vsndevts"
}

"OnSpellStart"
{
"RunScript"
{
"ScriptFile" "heroes/hero_nevermore/shadowraze.lua"
"Function" "Raze"
}
}

"OnUpgrade"
{
"RunScript"
{
"ScriptFile" "heroes/hero_nevermore/shadowraze.lua"
"Function" "LevelRaze"
}
}
}
85 changes: 72 additions & 13 deletions game/scripts/vscripts/heroes/hero_nevermore/shadowraze.lua
Original file line number Diff line number Diff line change
@@ -1,17 +1,76 @@
--[[
Author: Noya
Date: April 5, 2015
Return a front position at a distance
Author: Noya + nc-dk
Date: March 4, 2017
Obtains a forward position relative to caster, then fires effects and does damage to units within the area of effect.
]]
function ShadowrazePoint( event )
local caster = event.caster
local fv = caster:GetForwardVector()
local origin = caster:GetAbsOrigin()
local distance = event.distance
function Raze( keys )
local caster = keys.caster
local ability = keys.ability

--Finding Raze location
local vOrigin = caster:GetAbsOrigin()
local vForward = caster:GetForwardVector()
local iDistance = ability:GetSpecialValueFor("shadowraze_range")
local ability_location = vOrigin + vForward * iDistance

--Radius and damage
local ability_damage = ability:GetSpecialValueFor("shadowraze_damage")
local damage_radius = ability:GetSpecialValueFor("shadowraze_radius")

--Create Shadowraze particle on damage origin
local particle = ParticleManager:CreateParticle("particles/units/heroes/hero_nevermore/nevermore_shadowraze.vpcf", PATTACH_CUSTOMORIGIN, nil) --Setting an owning entity hides the particle if the handle cannot be see by a player
ParticleManager:SetParticleControl(particle, 0, ability_location)
ParticleManager:SetParticleControl(particle, 1, ability_location)

--Fires sound at target location
EmitSoundOnLocationWithCaster(ability_location, "Hero_Nevermore.Shadowraze", caster)

--Finds legal targets on damage location
local target_table = FindUnitsInRadius(caster:GetTeam(), ability_location, nil, damage_radius, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_BASIC + DOTA_UNIT_TARGET_HERO, DOTA_UNIT_TARGET_FLAG_NONE, FIND_ANY_ORDER, false)
if #target_table > 0 then
for _, enemy in pairs (target_table) do
ApplyDamage({ victim = enemy, attacker = caster, damage = ability_damage, damage_type = DAMAGE_TYPE_MAGICAL })
end
end
end

---

--[[
Author: nc-dk
Date: March 4, 2017
Whenever the datadriven "OnUpgrade" event is triggered on one Shadowraze, level all three to the same ability.
]]
function LevelRaze( keys )
--If any Shadowraze is levelled up, skill them to the same level

local front_position = origin + fv * distance
local result = {}
table.insert(result, front_position)
--Obtaining general ability info
local ability = keys.ability
local ability_name = ability:GetAbilityName()
local ability_level = ability:GetLevel()
local caster = keys.caster

--Getting all Shadowraze's on the caster
local raze1 = caster:FindAbilityByName("nevermore_shadowraze1_datadriven")
local raze2 = caster:FindAbilityByName("nevermore_shadowraze2_datadriven")
local raze3 = caster:FindAbilityByName("nevermore_shadowraze3_datadriven")

--If the current Shadowraze isn't the one used in the ability, attempt to skill it.
if raze1 ~= ability_name then
if raze1:GetLevel() < ability_level then --Less then to prevent a loop (when the other Raze's are levelled, they'll call upon this script too).
raze1:SetLevel(ability_level)
end
end

if raze2 ~= ability_name then
if raze2:GetLevel() < ability_level then
raze2:SetLevel(ability_level)
end
end

return result
end
if raze3 ~= ability_name then
if raze3:GetLevel() < ability_level then
raze3:SetLevel(ability_level)
end
end
end