Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Dota Heroes File
- "DOTAAbilities"
- {
- "exampleability"
- {
- "BaseClass" "ability_lua"
- "ScriptFile" "abilities/exampleability"
- "AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_NO_TARGET | DOTA_ABILITY_BEHAVIOR_IMMEDIATE"
- "AbilityUnitDamageType" "DAMAGE_TYPE_PHYSICAL"
- "AbilityCastPoint" "0"
- "AbilityCooldown" "17.0 16.0 15.0 14.0"
- "AbilityManaCost" "100"
- "AbilityTextureName" "techies_focused_detonate" // steal the icon from this ability
- "MaxLevel" "1" // Maximum skillable level
- "AbilitySpecial"
- {
- // filling in some values with some names
- // the values can be shown inside the Tooltip if you edit game/resource/addon_english.txt
- "01"
- {
- "var_type" "FIELD_INTEGER"
- "ls_start" "100 200 300 400"
- }
- "02"
- {
- "var_type" "FIELD_INTEGER"
- "self_damage" "100 200 300 400"
- }
- "03"
- {
- "var_type" "FIELD_INTEGER"
- "damage_radius" "450"
- }
- "04"
- {
- "var_type" "FIELD_FLOAT"
- "duration" "10"
- }
- }
- }
- "pixie_pixiebolt"
- {
- "BaseClass" "ability_lua"
- "ScriptFile" "abilities/pixiebolt"
- "AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_DIRECTIONAL | DOTA_ABILITY_BEHAVIOR_POINT | DOTA_ABILITY_BEHAVIOR_IGNORE_BACKSWING"
- "AbilityUnitTargetTeam" "DOTA_UNIT_TARGET_TEAM_ENEMY"
- "AbilityUnitDamageType" "DAMAGE_TYPE_MAGICAL"
- "AbilityCastPoint" "0.25"
- "AbilityCooldown" "16.0 15.0 14.0 13.0 12.0"
- "AbilityManaCost" "60 70 80 90 100"
- "AbilityTextureName" "vengefulspirit_magic_missile"
- "MaxLevel" "5"
- "AbilitySpecial"
- {
- "01"
- {
- "var_type" "FIELD_INTEGER"
- "spawn_distance" "10"
- }
- "02"
- {
- "var_type" "FIELD_INTEGER"
- "proj_radius" "100"
- }
- "03"
- {
- "var_type" "FIELD_INTEGER"
- "proj_speed" "1500"
- }
- "04"
- {
- "var_type" "FIELD_INTEGER"
- "vision_radius" "150"
- }
- "05"
- {
- "var_type" "FIELD_INTEGER"
- "proj_distance" "600 650 700 750 800"
- }
- "06"
- {
- "var_type" "FIELD_INTEGER"
- "damage" "200 250 300 350 400"
- }
- }
- }
- "special_bonus_exampletalent" // start talent names with special_bonus_
- {
- "BaseClass" "special_bonus_undefined"
- "AbilityType" "DOTA_ABILITY_TYPE_ATTRIBUTES"
- "AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_PASSIVE"
- "AbilitySpecial"
- {
- "01"
- {
- "var_type" "FIELD_INTEGER"
- "value" "90"
- }
- }
- }
- "seasonal_decorate_tree"
- {
- "AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_UNIT_TARGET | DOTA_ABILITY_BEHAVIOR_NOT_LEARNABLE | DOTA_ABILITY_BEHAVIOR_HIDDEN"
- "AssociatedConsumable" "0"
- }
- }
- \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
- //pixiebolt.lua
- pixiebolt = class({})
- function pixiebolt:GetAbilityTextureName()
- return "mirana_arrow"
- end
- function pixiebolt:IsHiddenWhenStolen()
- return false
- end
- function pixiebolt:OnSpellStart()
- -- Preventing projectiles getting stuck in one spot due to potential 0 length vector
- if self:GetCursorPosition() == self:GetCaster():GetAbsOrigin() then
- self:GetCaster():SetCursorPosition(self:GetCursorPosition() + self:GetCaster():GetForwardVector())
- end
- -- Ability properties
- local caster = self:GetCaster()
- local ability = self
- local target_point = self:GetCursorPosition()
- local sound_cast = "Hero_Mirana.ArrowCast"
- -- Ability specials
- local spawn_distance = ability:GetSpecialValueFor("spawn_distance")
- -- Play cast sound
- EmitSoundOn(sound_cast, caster)
- -- Set direction for main arrow
- local direction = (target_point - caster:GetAbsOrigin()):Normalized()
- -- Get spawn point
- local spawn_point = caster:GetAbsOrigin() + direction * spawn_distance
- -- Fire main arrow
- FireSacredArrow(caster, ability, spawn_point, direction)
- end
- function FireSacredArrow(caster, ability, spawn_point, direction)
- local particle_arrow = "particles/units/heroes/hero_mirana/mirana_spell_arrow.vpcf"
- -- Ability specials
- local arrow_radius
- local arrow_speed
- local vision_radius
- local arrow_distance
- -- If ability is not levelled, assign level 1 values
- if ability:GetLevel() == 0 then
- arrow_radius = ability:GetLevelSpecialValueFor("proj_radius", 1)
- arrow_speed = ability:GetLevelSpecialValueFor("proj_speed", 1)
- vision_radius = ability:GetLevelSpecialValueFor("vision_radius", 1)
- arrow_distance = ability:GetLevelSpecialValueFor("proj_distance", 1)
- else
- arrow_radius = ability:GetSpecialValueFor("proj_radius")
- arrow_speed = ability:GetSpecialValueFor("proj_speed")
- vision_radius = ability:GetSpecialValueFor("vision_radius")
- arrow_distance = ability:GetSpecialValueFor("proj_distance")
- end
- -- Fire arrow in the set direction
- local arrow_projectile = {
- Ability = ability,
- EffectName = particle_arrow,
- vSpawnOrigin = spawn_point,
- fDistance = arrow_distance,
- fStartRadius = arrow_radius,
- fEndRadius = arrow_radius,
- Source = caster,
- bHasFrontalCone = false,
- bReplaceExisting = false,
- iUnitTargetTeam = DOTA_UNIT_TARGET_TEAM_ENEMY,
- iUnitTargetType = DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC,
- bDeleteOnHit = true,
- vVelocity = direction * arrow_speed * Vector(1, 1, 0),
- fExpireTime = GameRules:GetGameTime() + 10.0,
- bProvidesVision = true,
- iVisionRadius = vision_radius,
- iVisionTeamNumber = caster:GetTeamNumber(),
- ExtraData = {cast_loc_x = tostring(caster:GetAbsOrigin().x),
- cast_loc_y = tostring(caster:GetAbsOrigin().y),
- cast_loc_z = tostring(caster:GetAbsOrigin().z)}
- }
- ProjectileManager:CreateLinearProjectile(arrow_projectile)
- end
- function pixiebolt:OnProjectileHit_ExtraData(target, location, extra_data)
- -- If no target was hit, do nothing
- if not target then
- return nil
- end
- -- Ability properties
- local caster = self:GetCaster()
- local ability = self
- local sound_impact = "Hero_Mirana.ArrowImpact"
- -- Ability specials
- local dmg = ability:GetSpecialValueFor("damage")
- --deal damage
- local damagetable = {victim = target, attacker = playerHero, damage = dmg, damage_type = DAMAGE_TYPE_MAGICAL,}
- ApplyDamage(damageTable)
- -- Play impact sound
- EmitSoundOn(sound_impact, target)
- -- Recombine cast location vector
- local cast_location = Vector(tonumber(extra_data.cast_loc_x), tonumber(extra_data.cast_loc_y), tonumber(extra_data.cast_loc_z))
- return true
- end
Add Comment
Please, Sign In to add comment