- Joined
- Sep 9, 2009
- Messages
- 658
JASS:
function Trig_Death_Blow_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01C' ) ) then
return false
endif
return true
endfunction
function Trig_Death_Blow_Func005002003001001 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(u)) == true )
endfunction
function Trig_Death_Blow_Func005002003001002 takes nothing returns boolean
return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
function Trig_Death_Blow_Func005002003001 takes nothing returns boolean
return GetBooleanAnd( Trig_Death_Blow_Func005002003001001(), Trig_Death_Blow_Func005002003001002() )
endfunction
function Trig_Death_Blow_Func005002003002001 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_GROUND) == true )
endfunction
function Trig_Death_Blow_Func005002003002002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false )
endfunction
function Trig_Death_Blow_Func005002003002 takes nothing returns boolean
return GetBooleanAnd( Trig_Death_Blow_Func005002003002001(), Trig_Death_Blow_Func005002003002002() )
endfunction
function Trig_Death_Blow_Func005002003 takes nothing returns boolean
return GetBooleanAnd( Trig_Death_Blow_Func005002003001(), Trig_Death_Blow_Func005002003002() )
endfunction
function Trig_Death_Blow_Func008A takes nothing returns nothing
call AddSpecialEffectTarget( "Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl", GetEnumUnit(), "origin" )
call DestroyEffect( GetLastCreatedEffectBJ() )
call UnitDamageTargetBJ( u1, GetEnumUnit(), d, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_ENHANCED )
endfunction
function Trig_Death_Blow_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit u1 = GetSpellTargetUnit()
local location p = GetUnitLoc(u1)
local real d = ( 125.00 + ( 75.00 * I2R(GetUnitAbilityLevelSwapped('A01C', u)) ) )
local group g = GetUnitsInRangeOfLocMatching(300.00, p, Condition(function Trig_Death_Blow_Func005002003))
call AddSpecialEffectLoc( "ThunderclapCasterGreen.mdx", p )
call DestroyEffect( GetLastCreatedEffectBJ() )
call ForGroup( g, function Trig_Death_Blow_Func008A )
call RemoveLocation (p)
call DestroyGroup (g)
set u = null
set u1 = null
endfunction
//===========================================================================
function InitTrig_Death_Blow takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( t, Condition( function Trig_Death_Blow_Conditions ) )
call TriggerAddAction( t, function Trig_Death_Blow_Actions )
set t = null
endfunction
Okay, so I tried reading the tutorial about converting GUI triggers to efficient JASS but it never dealt with local variables being used in ITE conditions. I think I should change the ITE conditions to be more efficient but since this trigger is a little different from the example in the tutorial, I'm having trouble getting it to work. Can anyone tell me what I need to do?