Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new hero - corsair
- ---------------------------
- "black_flag"
- {
- // General
- //-------------------------------------------------------------------------------------------------------------
- "BaseClass" "ability_datadriven"
- "AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_POINT | DOTA_ABILITY_BEHAVIOR_AOE"
- "SpellImmunityType" "SPELL_IMMUNITY_ENEMIES_YES"
- "AbilityTextureName" "techies_minefield_sign"
- "AOERadius" "%aura"
- // Precache
- //-------------------------------------------------------------------------------------------------------------
- "precache"
- {
- "soundfile" "soundevents/game_sounds_heroes/game_sounds_techies.vsndevts"
- "particle" "particles/units/heroes/hero_techies/techies_land_mine.vpcf"
- "model" "models/heroes/techies/fx_techiesfx_mine.vmdl"
- }
- // Casting
- //-------------------------------------------------------------------------------------------------------------
- "AbilityCastRange" "450"
- "AbilityCastPoint" "0.0 0.0 0.0 0.0"
- // Time
- //-------------------------------------------------------------------------------------------------------------
- "AbilityCooldown" "15"
- // Cost
- //-------------------------------------------------------------------------------------------------------------
- "AbilityManaCost" "100"
- // Special
- //-------------------------------------------------------------------------------------------------------------
- "AbilitySpecial"
- {
- "01"
- {
- "var_type" "FIELD_INTEGER"
- "aura" "900"
- }
- "02"
- {
- "var_type" "FIELD_FLOAT"
- "shred" "-3 -4 -5 -6"
- }
- "03"
- {
- "var_type" "FIELD_FLOAT"
- "minus_damage" "-15 -20 -25 -30"
- }
- }
- "OnSpellStart"
- {
- "CreateThinker"
- {
- "ModifierName" "modifier_black_flag"
- "Target" "TARGET"
- "Radius" "%aura"
- "Duration" "7"
- }
- }
- "Modifiers"
- {
- "modifier_black_flag"
- {
- "IsHidden" "1"
- "Aura" "modifier_debuff"
- "Aura_Radius" "%aura"
- "Aura_Teams" "DOTA_UNIT_TARGET_TEAM_ENEMY"
- "Aura_Types" "DOTA_UNIT_TARGET_HERO | DOTA_UNIT_TARGET_BASIC"
- "Aura_Flags" "DOTA_UNIT_TARGET_FLAG_NONE"
- "Aura_ApplyToCaster" "0"
- }
- "modifier_debuff"
- {
- "IsDebuff" "1"
- "Properties"
- {
- "MODIFIER_PROPERTY_BASEDAMAGEOUTGOING_PERCENTAGE" "%minus_damage"
- "MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS" "%armor_shred"
- }
- }
- }
- }
- "wildfire_rifle"
- {
- // General
- //-------------------------------------------------------------------------------------------------------------
- "BaseClass" "ability_datadriven"
- "AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_AOE | DOTA_ABILITY_BEHAVIOR_POINT | DOTA_ABILITY_BEHAVIOR_IGNORE_BACKSWING"
- "AbilityUnitDamageType" "DAMAGE_TYPE_MAGICAL"
- "SpellImmunityType" "SPELL_IMMUNITY_ENEMIES_YES"
- "FightRecapLevel" "1"
- "AbilityTextureName" "sniper_shrapnel"
- "AOERadius" "%radius"
- // Casting
- //-------------------------------------------------------------------------------------------------------------
- "AbilityCastRange" "800"
- "AbilityCastPoint" "0.4"
- // Time
- //-------------------------------------------------------------------------------------------------------------
- "AbilityCooldown" "12.0 10.0 8.0 6.0"
- // Cost
- //-------------------------------------------------------------------------------------------------------------
- "AbilityManaCost" "60 80 100 120"
- // Special
- //-------------------------------------------------------------------------------------------------------------
- "AbilitySpecial"
- {
- "01"
- {
- "var_type" "FIELD_INTEGER"
- "radius" "400"
- }
- "02"
- {
- "var_type" "FIELD_INTEGER"
- "slow" "-10 -20 -30 -40"
- }
- "03"
- {
- "var_type" "FIELD_INTEGER"
- "duration" "3 4 5 6"
- }
- "04"
- {
- "var_type" "FIELD_INTEGER"
- "damage" "100 200 300 400"
- }
- }
- // Data driven
- //-------------------------------------------------------------------------------------------------------------
- "precache"
- {
- "soundfile" "soundevents/game_sounds_heroes/game_sounds_sniper.vsndevts"
- "particle" "particles/units/heroes/hero_sniper/sniper_assassinate.vpcf"
- }
- "OnSpellStart"
- {
- "ActOnTargets"
- {
- "Target"
- {
- "Center" "POINT"
- "Radius" "%radius"
- "Teams" "DOTA_UNIT_TARGET_TEAM_ENEMY"
- "Types" "DOTA_UNIT_TARGET_HERO | DOTA_UNIT_TARGET_BASIC"
- }
- "Action"
- {
- "FireSound"
- {
- "EffectName" "Ability.Assassinate"
- "Target" "CASTER"
- }
- "TrackingProjectile"
- {
- "Target" "TARGET"
- "EffectName" "particles/units/heroes/hero_sniper/sniper_assassinate.vpcf"
- "Dodgeable" "0"
- "ProvidesVision" "0"
- "MoveSpeed" "9000"
- "SourceAttachment" "DOTA_PROJECTILE_ATTACHMENT_ATTACK_1"
- }
- "FireSound"
- {
- "EffectName" "Hero_Sniper.AssassinateProjectile"
- "Target" "CASTER"
- }
- }
- }
- "DelayedAction"
- {
- "Delay" "0.1"
- "Action"
- {
- "ActOnTargets"
- {
- "FireSound"
- {
- "EffectName" "Hero_Sniper.AssassinateDamage"
- "Target" "TARGET"
- }
- "Target"
- {
- "Center" "POINT"
- "Radius" "%radius"
- "Teams" "DOTA_UNIT_TARGET_TEAM_ENEMY"
- "Types" "DOTA_UNIT_TARGET_HERO | DOTA_UNIT_TARGET_BASIC"
- }
- "Action"
- {
- "Damage"
- {
- "Target" "TARGET"
- "Type" "DAMAGE_TYPE_MAGICAL"
- "Damage" "%damage"
- }
- "ApplyModifier"
- {
- "ModifierName" "modifier_yo_ho_ho"
- "Target" "TARGET"
- }
- }
- }
- }
- }
- "DelayedAction"
- {
- "Delay" "0.2"
- "Action"
- {
- "ActOnTargets"
- {
- "Target"
- {
- "Center" "POINT"
- "Radius" "%radius"
- "Teams" "DOTA_UNIT_TARGET_TEAM_ENEMY"
- "Types" "DOTA_UNIT_TARGET_HERO | DOTA_UNIT_TARGET_BASIC"
- "MaxTargets" "1"
- "Random" "1"
- }
- "TrackingProjectile"
- {
- "Target" "TARGET"
- "EffectName" "particles/units/heroes/hero_sniper/sniper_assassinate.vpcf"
- "Dodgeable" "0"
- "ProvidesVision" "0"
- "MoveSpeed" "9000"
- "SourceAttachment" "DOTA_PROJECTILE_ATTACHMENT_ATTACK_1"
- }
- "FireSound"
- {
- "EffectName" "Hero_Sniper.AssassinateProjectile"
- "Target" "CASTER"
- }
- "Action"
- {
- "Damage"
- {
- "Target" "TARGET"
- "Type" "DAMAGE_TYPE_MAGICAL"
- "Damage" "%damage"
- }
- "FireSound"
- {
- "EffectName" "Hero_Sniper.AssassinateDamage"
- "Target" "TARGET"
- }
- "DelayedAction"
- {
- "Delay" "0.1"
- "Action"
- {
- "ActOnTargets"
- {
- "Target"
- {
- "Center" "TARGET"
- "Radius" "%radius"
- "Teams" "DOTA_UNIT_TARGET_TEAM_ENEMY"
- "Types" "DOTA_UNIT_TARGET_HERO | DOTA_UNIT_TARGET_BASIC"
- }
- "Action"
- {
- "Damage"
- {
- "Target" "TARGET"
- "Type" "DAMAGE_TYPE_MAGICAL"
- "Damage" "%damage"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- "Modifiers"
- {
- "modifier_yo_ho_ho"
- {
- "IsDebuff" "1"
- "Duration" "%duration"
- "Properties"
- {
- "MODIFIER_PROPERTY_MOVESPEED_BONUS_PERCENTAGE" "%slow"
- }
- }
- }
- }
- "plunder_claw"
- {
- // General
- //-------------------------------------------------------------------------------------------------------------
- "BaseClass" "ability_datadriven"
- "AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_UNIT_TARGET"
- "AbilityUnitTargetTeam" "DOTA_UNIT_TARGET_TEAM_ENEMY"
- "AbilityUnitTargetType" "DOTA_UNIT_TARGET_HERO"
- "AbilityUnitTargetFlags" "DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES"
- "SpellImmunityType" "SPELL_IMMUNITY_ENEMIES_YES"
- "AbilityTextureName" "phoenix_icarus_dive"
- // Casting
- //-------------------------------------------------------------------------------------------------------------
- "AbilityCastPoint" "0.5 0.4 0.3 0.2"
- // Time
- //-------------------------------------------------------------------------------------------------------------
- "AbilityCooldown" "20.0 18.0 16.0 14.0"
- // Cost
- //-------------------------------------------------------------------------------------------------------------
- "AbilityManaCost" "80 90 100 110"
- // Cast Range
- //-------------------------------------------------------------------------------------------------------------
- "AbilityCastRange" "800 900 1000 1100"
- // Special
- //-------------------------------------------------------------------------------------------------------------
- "AbilitySpecial"
- {
- "01"
- {
- "var_type" "FIELD_FLOAT"
- "duration" "5 6 7 8"
- }
- "02"
- {
- "var_type" "FIELD_INTEGER"
- "projectile_speed" "1500"
- }
- "03"
- {
- "var_type" "FIELD_INTEGER"
- "global_radius" "9999999"
- }
- }
- "OnSpellStart"
- {
- "FireSound"
- {
- "EffectName" "Hero_Beastmaster.Call.Hawk"
- "Target" "CASTER"
- }
- "ApplyModifier"
- {
- "ModifierName" "modifier_speed"
- "Target" "CASTER"
- }
- "RunScript"
- {
- "ScriptFile" "scripts/vscripts/plunder.lua"
- "Function" "SpellCheck"
- "particle" "particles/units/heroes/hero_rubick/rubick_spell_steal.vpcf"
- }
- }
- "OnProjectileHitUnit"
- {
- "RemoveModifier"
- {
- "ModifierName" "modifier_speed"
- "Target" "CASTER"
- }
- "ApplyModifier"
- {
- "ModifierName" "modifier_mute"
- "Target" "TARGET"
- "Duration" "%duration"
- }
- "RunScript"
- {
- "ScriptFile" "scripts/vscripts/plunder.lua"
- "Function" "SpellSteal"
- }
- "FireSound"
- {
- "EffectName" "Hero_Beastmaster.Call.Hawk"
- "Target" "TARGET"
- }
- }
- "Modifiers"
- {
- "modifier_mute"
- {
- "IsDebuff" "1"
- "States"
- {
- "MODIFIER_STATE_MUTED" "MODIFIER_STATE_VALUE_ENABLED"
- }
- }
- "modifier_speed"
- {
- "IsBuff" "1"
- "Properties"
- {
- "MODIFIER_PROPERTY_MOVESPEED_BONUS_PERCENTAGE" "50 60 70 80"
- }
- }
- "modifier_spell_steal_aura_datadriven"
- {
- "IsHidden" "1"
- "Passive" "1"
- "Aura" "modifier_check_spell_datadriven"
- "Aura_Radius" "%global_radius"
- "Aura_Teams" "DOTA_UNIT_TARGET_TEAM_ENEMY"
- "Aura_Types" "DOTA_UNIT_TARGET_HERO"
- "Aura_Flags" "DOTA_UNIT_TARGET_FLAG_NOT_CREEP_HERO"
- }
- "modifier_check_spell_datadriven"
- {
- "IsHidden" "1"
- "OnAbilityExecuted"
- {
- "DelayedAction"
- {
- "Delay" "0.01"
- "Action"
- {
- "RunScript"
- {
- "ScriptFile" "scripts/vscripts/plunder.lua"
- "Function" "GetLastSpell"
- }
- }
- }
- }
- }
- "modifier_spell_steal_datadriven"
- {
- "Duration" "%duration"
- "OnDestroy"
- {
- "RunScript"
- {
- "ScriptFile" "scripts/vscripts/plunder.lua"
- "Function" "RemoveSpell"
- }
- }
- "OnOrder"
- {
- "RunScript"
- {
- "ScriptFile" "scripts/vscripts/plunder.lua"
- "Function" "FixLevels"
- }
- }
- }
- }
- }
- "corsair_innate"
- {
- // General
- //-------------------------------------------------------------------------------------------------------------
- "BaseClass" "ability_datadriven"
- "AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_PASSIVE"
- "AbilityUnitDamageType" "DAMAGE_TYPE_PHYSICAL"
- "SpellImmunityType" "SPELL_IMMUNITY_ENEMIES_YES"
- "AbilityTextureName" "gyrocopter_homing_missile"
- }
- // Stats
- //-------------------------------------------------------------------------------------------------------------
- "AbilityDamage" "50 80 120 150 180"
- // Special
- //-------------------------------------------------------------------------------------------------------------
- "AbilitySpecial"
- {
- "01"
- {
- "var_type" "FIELD_INTEGER"
- "chance_pct" "17 20 23 26 29"
- }
- }
- "Modifiers"
- {
- "modifier_silver_bullet"
- {
- "Passive" "1"
- "IsHidden" "1"
- "OnAttackLanded"
- {
- "Random"
- {
- "Chance" "%chance_pct"
- "OnSuccess"
- {
- "LinearProjectile"
- {
- "Target" "TARGET"
- "EffectName" "particles/units/heroes/hero_phoenix/phoenix_sunray.vpcf"
- "MoveSpeed" "500"
- "StartRadius" "125"
- "StartPosition" "attach_attack1"
- "EndRadius" "250"
- "HasFrontalCone" "1"
- "FixedDistance" "500"
- "TargetTeams" "DOTA_UNIT_TARGET_TEAM_ENEMY"
- "TargetTypes" "DOTA_UNIT_TARGET_BASIC | DOTA_UNIT_TARGET_HERO"
- "TargetFlags" "DOTA_UNIT_TARGET_FLAG_NONE"
- "ProvidesVision" "0"
- }
- "OnProjectileHitUnit"
- {
- "DeleteOnHit" "0"
- "Damage"
- {
- "Target" "TARGET"
- "Type" "DAMAGE_TYPE_PHYSICAL"
- "Damage" "%AbilityDamage"
- }
- }
- }
- }
- }
- }
- }
- }
- "avast"
- {
- // General
- //-------------------------------------------------------------------------------------------------------------
- "BaseClass" "ability_datadriven"
- "AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_POINT | DOTA_ABILITY_BEHAVIOR_AOE"
- "AbilityType" "DOTA_ABILITY_TYPE_ULTIMATE"
- "AbilityUnitDamageType" "DAMAGE_TYPE_MAGICAL"
- "AoERadius" "600"
- "SpellImmunityType" "SPELL_IMMUNITY_ENEMIES_YES"
- "FightRecapLevel" "2"
- "AbilityTextureName" "jakiro_macropyre"
- "precache"
- {
- "soundfile" "soundevents/game_sounds_heroes/game_sounds_centaur.vsndevts"
- "particle" "particles/units/heroes/hero_centaur/centaur_warstomp.vpcf"
- "particle" "particles/generic_gameplay/generic_stunned.vpcf"
- "soundfile" "soundevents/game_sounds_heroes/game_sounds_dragon_knight.vsndevts"
- "particle" "particles/units/heroes/hero_dragon_knight/dragon_knight_breathe_fire.vpcf"
- }
- // Casting
- //-------------------------------------------------------------------------------------------------------------
- "AbilityCastRange" "1000"
- "AbilityCastPoint" "0.3 0.3 0.3"
- // Time
- //-------------------------------------------------------------------------------------------------------------
- "AbilityCooldown" "55 50 45"
- // Cost
- //-------------------------------------------------------------------------------------------------------------
- "AbilityManaCost" "125 125 125"
- // Special
- //-------------------------------------------------------------------------------------------------------------
- "AbilitySpecial"
- {
- "01"
- {
- "var_type" "FIELD_INTEGER"
- "start_radius" "100 200 300"
- }
- "02"
- {
- "var_type" "FIELD_INTEGER"
- "end_radius" "200 300 400"
- }
- "03"
- {
- "var_type" "FIELD_INTEGER"
- "range" "600 700 800"
- }
- "04"
- {
- "var_type" "FIELD_INTEGER"
- "speed" "1050"
- }
- "05"
- {
- "var_type" "FIELD_INTEGER"
- "stun_duration" "2 3 4"
- }
- "06"
- {
- "var_type" "FIELD_INTEGER"
- "damage" "100 200 300"
- }
- }
- "OnSpellStart"
- {
- "LinearProjectile"
- {
- "Target" "POINT"
- "EffectName" "particles/units/heroes/hero_dragon_knight/dragon_knight_breathe_fire.vpcf"
- "MoveSpeed" "%speed"
- "StartRadius" "%start_radius"
- "StartPosition" "attach_origin"
- "EndRadius" "%end_radius"
- "FixedDistance" "%range"
- "TargetTeams" "DOTA_UNIT_TARGET_TEAM_ENEMY"
- "TargetTypes" "DOTA_UNIT_TARGET_BASIC | DOTA_UNIT_TARGET_HERO | DOTA_UNITY_TARGET_MECHANICAL"
- "TargetFlags" "DOTA_UNIT_TARGET_FLAG_NONE"
- "HasFrontalCone" "1"
- "ProvidesVision" "0"
- }
- "FireSound"
- {
- "EffectName" "Hero_DragonKnight.BreathFire"
- "Target" "CASTER"
- }
- }
- "OnProjectileFinish"
- {
- "FireEffect"
- {
- "EffectName" "particles/units/heroes/hero_centaur/centaur_warstomp.vpcf"
- "EffectAttachType" "follow_origin"
- "EffectRadius" "%radius"
- "Target" "POINT"
- "ControlPoints"
- {
- "01" "%radius 0 %radius"
- }
- }
- "FireSound"
- {
- "EffectName" "Hero_Centaur.HoofStomp"
- "Target" "POINT"
- }
- "ActOnTargets"
- {
- "Target"
- {
- "Center" "POINT"
- "Radius" "%radius"
- "Teams" "DOTA_UNIT_TARGET_TEAM_ENEMY"
- "Types" "DOTA_UNIT_TARGET_HERO | DOTA_UNIT_TARGET_BASIC"
- }
- "Action"
- {
- "Damage"
- {
- "Target" "POINT"
- "Type" "DAMAGE_TYPE_MAGICAL"
- "Damage" "%damage"
- }
- "ApplyModifier"
- {
- "Target" "TARGET"
- "ModifierName" "modifier_hoof_stomp"
- }
- }
- }
- "CreateThinker"
- {
- "ModifierName" "modifier_fire_new_projectile"
- "Target" "TARGET"
- }
- }
- "Modifiers"
- {
- "modifier_hoof_stomp"
- {
- "IsDebuff" "1"
- "Duration" "%stun_duration"
- "States"
- {
- "MODIFIER_STATE_STUNNED" "MODIFIER_STATE_VALUE_ENABLED"
- }
- "OverrideAnimation" "ACT_DOTA_DISABLED"
- "EffectName" "particles/generic_gameplay/generic_stunned.vpcf"
- "EffectAttachType" "follow_overhead"
- }
- "modifier_fire_new_projectile"
- {
- "Duration" "0.1"
- "OnCreated"
- {
- "LinearProjectile"
- {
- "Target" "POINT"
- "EffectName" "particles/units/heroes/hero_dragon_knight/dragon_knight_breathe_fire.vpcf"
- "MoveSpeed" "%speed"
- "StartRadius" "%start_radius"
- "StartPosition" "attach_origin"
- "EndRadius" "%end_radius"
- "FixedDistance" "%range"
- "TargetTeams" "DOTA_UNIT_TARGET_TEAM_ENEMY"
- "TargetTypes" "DOTA_UNIT_TARGET_BASIC | DOTA_UNIT_TARGET_HERO | DOTA_UNITY_TARGET_MECHANICAL"
- "TargetFlags" "DOTA_UNIT_TARGET_FLAG_NONE"
- "HasFrontalCone" "1"
- "ProvidesVision" "0"
- }
- }
- }
- }
- }
- -----------------
- scripts/vscripts/plunder.lua
- -----------------
- --[[Author: YOLOSPAGHETTI
- Date: July 11, 2016
- Get's the target's most recently cast spell]]
- function GetLastSpell(keys)
- local target = keys.unit
- -- Loops throught the target's abilities
- for i=0, 15 do
- local current_ability = target:GetAbilityByIndex(i)
- if current_ability ~= nil then
- -- If the ability is toggleable, checks if it was turned on
- if current_ability:IsToggle() then
- if current_ability:GetToggleState() == true then
- -- Set this as the target's most recently cast ability
- target.last_ability = current_ability
- end
- else
- -- Finds the ability that caused the event trigger by checking if the cooldown is equal to the full cooldown
- local cd = current_ability:GetCooldownTimeRemaining()
- local full_cd = current_ability:GetCooldown(current_ability:GetLevel()-1)
- -- There is a delay after the ability cast event and before the ability goes on cooldown
- -- If the ability is on cooldown and the cooldown is within a small buffer of the full cooldown
- -- Set this as the target's most recently cast ability
- if cd > 0 and full_cd - cd < 0.04 then
- target.last_ability = current_ability
- end
- end
- end
- end
- end
- --[[Author: YOLOSPAGHETTI
- Date: July 11, 2016
- Ensures the target has cast a spell]]
- function SpellCheck(keys)
- local caster = keys.caster
- local target = keys.target
- local ability = keys.ability
- local projectile_speed = ability:GetLevelSpecialValueFor("projectile_speed", (ability:GetLevel() -1))
- if target.last_ability ~= nil then
- ability.new_steal = target.last_ability
- -- Create the projectile
- local info = {
- Target = caster,
- Source = target,
- Ability = ability,
- EffectName = keys.particle,
- bDodgeable = false,
- bProvidesVision = false,
- iMoveSpeed = projectile_speed,
- iSourceAttachment = DOTA_PROJECTILE_ATTACHMENT_HITLOCATION
- }
- ProjectileManager:CreateTrackingProjectile( info )
- else
- -- Resets the cooldown
- ability:EndCooldown()
- -- Regains lost mana
- ability:RefundManaCost()
- end
- end
- --[[Author: YOLOSPAGHETTI
- Date: July 11, 2016
- Swaps rubick's spells]]
- function SpellSteal(keys)
- local caster = keys.caster
- local ability = keys.ability
- local new_ability_name = ability.new_steal:GetAbilityName()
- local new_ability_level = ability.new_steal:GetLevel() - 1
- -- If the caster has no stolen spell, swap the new one with the empty spell
- if caster:HasModifier("modifier_spell_steal_datadriven") == false then
- caster:AddAbility(new_ability_name)
- caster:SwapAbilities("empty1_datadriven", new_ability_name, false, true)
- caster:FindAbilityByName(new_ability_name):SetLevel(new_ability_level)
- -- If the new stolen ability is not the same as the previous one, swap them
- elseif new_ability_name ~= ability.current_steal:GetAbilityName() then
- caster:AddAbility(new_ability_name)
- caster:SwapAbilities(ability.current_steal:GetAbilityName(), new_ability_name, false, true)
- caster:FindAbilityByName(new_ability_name):SetLevel(new_ability_level)
- end
- ability.current_steal = ability.new_steal
- ability:ApplyDataDrivenModifier(caster, caster, "modifier_spell_steal_datadriven", {})
- end
- --[[Author: YOLOSPAGHETTI
- Date: July 11, 2016
- Swaps the stolen spell with the empty spell]]
- function RemoveSpell(keys)
- local caster = keys.caster
- local ability = keys.ability
- local new_ability_name = ability.current_steal:GetAbilityName()
- caster:SwapAbilities(new_ability_name, "empty1_datadriven", false, true)
- --caster:RemoveAbility(new_ability_name)
- end
- --[[Author: YOLOSPAGHETTI
- Date: July 11, 2016
- Since you can still level up stolen spells, they automatically readjust to the level when stolen]]
- function FixLevels(keys)
- local caster = keys.caster
- local ability = keys.ability
- local current_ability = caster:FindAbilityByName(ability.current_steal:GetAbilityName())
- local correct_ability_level = ability.current_steal:GetLevel() - 1
- local current_ability_points = caster:GetAbilityPoints()
- -- Checks if the current stolen ability's level is higher than it should be
- if current_ability:GetLevel() > correct_ability_level then
- -- Counts how many levels have been added
- local levels_higher = current_ability:GetLevel() - correct_ability_level
- -- Sets the ability to the correct level
- current_ability:SetLevel(correct_ability_level)
- -- Gives the caster back the unused ability points
- caster:SetAbilityPoints(levels_higher + current_ability_points)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement