When I have a trigger, and inside the trigger I have the functions Trig_Conditions, Trig_RandomFunction and Trig_Actions. I know actions and conditions can use things like GetSpellAbilityUnit() or GetTriggeringingTrigger(), but I can also those in the RandomFunction? and will it give the correct result?
For example:
For example:
JASS:
function BeetleFrenzyConditions takes nothing returns boolean
return(GetSpellAbilityId()==039;A00C039;)
endfunction
function RandomFunction takes nothing returns nothing
local unit Caster = GetSpellAbilityUnit()
//
//WILL CASTER BE CORRECT???
//
endfunction
function BeetleFrenzyActions takes nothing returns nothing
local unit Caster = GetSpellAbilityUnit()
local integer Level = GetUnitAbilityLevel(Caster,039;A00C039;)
local timer T
call AddUnitAnimationProperties(Caster,"alternate",true)
//
//...
//
endfunction
function InitTrig_BeetleFrenzy takes nothing returns nothing
set gg_trg_BeetleFrenzy = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_BeetleFrenzy,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_BeetleFrenzy,Condition(function BeetleFrenzyConditions))
call TriggerAddAction(gg_trg_BeetleFrenzy,function BeetleFrenzyActions)
endfunction