Name | Type | is_array | initial_value |
bounty | player | No | |
player | playercolor | No | Color00 |
function Trig_BlinkStrike_Conditions takes nothing returns boolean
return( GetSpellAbilityId() == 'A000' ) //Rawcode for Blinkstrike ability
endfunction
function Trig_BlinkStrike_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local effect a
local effect b
local integer level = GetUnitAbilityLevelSwapped('A000',caster)
local integer damage = (50 * (level - 0)) + R2I(DistanceBetweenPoints(GetUnitLoc(caster), GetUnitLoc(target)))
if damage < (100 * (level - 0)) then
set damage = (100 * (level - 0))
endif
call AddSpecialEffectLocBJ( GetUnitLoc(caster), "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl")
set b = GetLastCreatedEffectBJ()
call DestroyEffect(b)
call SetUnitPositionLoc( GetSpellAbilityUnit(), GetUnitLoc(GetSpellTargetUnit()) )
call AddSpecialEffectLocBJ( GetUnitLoc(target), "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl")
call UnitDamageTargetBJ( caster, target, damage, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC )
set a = GetLastCreatedEffectBJ()
call DestroyEffect(a)
set caster = null
set target = null
endfunction
//===========================================================================
function InitTrig_BlinkStrike takes nothing returns nothing
set gg_trg_BlinkStrike = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_BlinkStrike, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_BlinkStrike, Condition( function Trig_BlinkStrike_Conditions ) )
call TriggerAddAction( gg_trg_BlinkStrike, function Trig_BlinkStrike_Actions )
endfunction