BRUTAL
I'm working
- Reaction score
- 118
you need to null them, just not destroy them, because the lifespan deals with that itself.
function Trig_Spell_Name_Actions takes nothing returns boolean // You need to return a boolean value if you are going to use 'return false'.
local texttag tt = CreateTextTag()
local unit cast = GetTriggerUnit()
local integer perc = R2I(GetRandomPercentageBJ())
call SetTextTagText(tt,GetAbilityName(GetSpellAbilityId()),0.025)
call SetTextTagPos(tt,GetUnitX(cast),GetUnitY(cast),1.)
//Change the "255" to "0" and the Spell won't be shown.
call SetTextTagColor(tt,perc,perc,perc,255)
//You can change the Velocity of the TextTag.
call SetTextTagVelocityBJ( tt, 80.00, 90. )
call SetTextTagPermanent( tt, false )
//You can change how long the TextTag will be displayed.
call SetTextTagLifespan( tt, 2.00 )
//You can change this to delay the fading time of the TextTag.
call SetTextTagFadepoint( tt, 1.50 )
call SetTextTagVisibility(tt, true)
set cast = null
return false
endfunction
function InitTrig_Spell_Name takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( t, Condition( function Trig_Spell_Name_Actions ) ) // Conditions are better than actions.
endfunction
if GetUnitAbilityLevel(cast,039;Aloc039;) != 0 then
call SetTextTagColor(tt,perc,perc,perc,0)
else
call SetTextTagColor(tt,perc,perc,perc,255)
endif