- Joined
- May 18, 2011
- Messages
- 6
Hi All!
Hope you're doing well.
I require some help with this custom spell I'm making. It's a targetable spell that increases armor by 15 for 10 seconds, and increases to 20 and 30 seconds as the hero levels up the spell.
I originality tested in GUI and it works, but then I wanted to make it MUI, and as soon as I converted it to JASS with no changes whatsoever, it would no longer apply the armor increase or special effect despite the hero still playing the cast animation.
Could someone please kindly help me find out what seems to be the problem? I have not even changed the variables to local variables yet and it's already no longer working.
Many thanks!
Hope you're doing well.
I require some help with this custom spell I'm making. It's a targetable spell that increases armor by 15 for 10 seconds, and increases to 20 and 30 seconds as the hero levels up the spell.
I originality tested in GUI and it works, but then I wanted to make it MUI, and as soon as I converted it to JASS with no changes whatsoever, it would no longer apply the armor increase or special effect despite the hero still playing the cast animation.
Could someone please kindly help me find out what seems to be the problem? I have not even changed the variables to local variables yet and it's already no longer working.
Many thanks!
Code:
function Trig_Radiant_Shield_Effect_2_Copy_Copy_2_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A003' ) ) then
return false
endif
return true
endfunction
function Trig_Radiant_Shield_Effect_2_Copy_Copy_2_Func004Func003001 takes nothing returns boolean
return ( UnitHasBuffBJ(udg_RadiantShieldUnit2, 'B000') == true )
endfunction
function Trig_Radiant_Shield_Effect_2_Copy_Copy_2_Func004C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A003', gg_unit_H005_0017) == 1 ) ) then
return false
endif
return true
endfunction
function Trig_Radiant_Shield_Effect_2_Copy_Copy_2_Func005Func003001 takes nothing returns boolean
return ( UnitHasBuffBJ(udg_RadiantShieldUnit2, 'B000') == true )
endfunction
function Trig_Radiant_Shield_Effect_2_Copy_Copy_2_Func005C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A003', gg_unit_H005_0017) == 2 ) ) then
return false
endif
return true
endfunction
function Trig_Radiant_Shield_Effect_2_Copy_Copy_2_Func006Func003001 takes nothing returns boolean
return ( UnitHasBuffBJ(udg_RadiantShieldUnit2, 'B000') == true )
endfunction
function Trig_Radiant_Shield_Effect_2_Copy_Copy_2_Func006C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A003', gg_unit_H005_0017) == 3 ) ) then
return false
endif
return true
endfunction
function Trig_Radiant_Shield_Effect_2_Copy_Copy_2_Actions takes nothing returns nothing
set udg_RadiantShieldPlayer2 = GetOwningPlayer(GetSpellTargetUnit())
set udg_RadiantShieldUnit2 = GetSpellTargetUnit()
if ( Trig_Radiant_Shield_Effect_2_Copy_Copy_2_Func004C() ) then
call TriggerSleepAction( 0.10 )
loop
exitwhen ( Trig_Radiant_Shield_Effect_2_Copy_Copy_2_Func004Func003001() )
call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 0.10))
endloop
call BlzSetUnitArmor( udg_RadiantShieldUnit2, ( BlzGetUnitArmor(udg_RadiantShieldUnit2) + 15.00 ) )
call AddSpecialEffectTargetUnitBJ( "origin", udg_RadiantShieldUnit2, "Abilities\\Spells\\Human\\DivineShield\\DivineShieldTarget.mdl" )
set udg_RadiantShieldEffect2 = GetLastCreatedEffectBJ()
call TriggerSleepAction( 10.00 )
call BlzSetUnitArmor( udg_RadiantShieldUnit2, ( BlzGetUnitArmor(udg_RadiantShieldUnit2) - 15.00 ) )
call DestroyEffectBJ( udg_RadiantShieldEffect2 )
set udg_RadiantShieldPlayer2 = GetFilterPlayer()
set udg_RadiantShieldUnit2 = null
else
call DoNothing( )
endif
if ( Trig_Radiant_Shield_Effect_2_Copy_Copy_2_Func005C() ) then
call TriggerSleepAction( 0.10 )
loop
exitwhen ( Trig_Radiant_Shield_Effect_2_Copy_Copy_2_Func005Func003001() )
call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 0.10))
endloop
call BlzSetUnitArmor( udg_RadiantShieldUnit2, ( BlzGetUnitArmor(udg_RadiantShieldUnit2) + 15.00 ) )
call AddSpecialEffectTargetUnitBJ( "origin", udg_RadiantShieldUnit2, "Abilities\\Spells\\Human\\DivineShield\\DivineShieldTarget.mdl" )
set udg_RadiantShieldEffect2 = GetLastCreatedEffectBJ()
call TriggerSleepAction( 20.00 )
call BlzSetUnitArmor( udg_RadiantShieldUnit2, ( BlzGetUnitArmor(udg_RadiantShieldUnit2) - 15.00 ) )
call DestroyEffectBJ( udg_RadiantShieldEffect2 )
set udg_RadiantShieldPlayer2 = GetFilterPlayer()
set udg_RadiantShieldUnit2 = null
else
call DoNothing( )
endif
if ( Trig_Radiant_Shield_Effect_2_Copy_Copy_2_Func006C() ) then
call TriggerSleepAction( 0.10 )
loop
exitwhen ( Trig_Radiant_Shield_Effect_2_Copy_Copy_2_Func006Func003001() )
call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 0.10))
endloop
call BlzSetUnitArmor( udg_RadiantShieldUnit2, ( BlzGetUnitArmor(udg_RadiantShieldUnit2) + 15.00 ) )
call AddSpecialEffectTargetUnitBJ( "origin", udg_RadiantShieldUnit2, "Abilities\\Spells\\Human\\DivineShield\\DivineShieldTarget.mdl" )
set udg_RadiantShieldEffect2 = GetLastCreatedEffectBJ()
call TriggerSleepAction( 30.00 )
call BlzSetUnitArmor( udg_RadiantShieldUnit2, ( BlzGetUnitArmor(udg_RadiantShieldUnit2) - 15.00 ) )
call DestroyEffectBJ( udg_RadiantShieldEffect2 )
set udg_RadiantShieldPlayer2 = GetFilterPlayer()
set udg_RadiantShieldUnit2 = null
else
call DoNothing( )
endif
endfunction
//===========================================================================
function InitTrig_Radiant_Shield_Effect_2_Copy_Copy_2 takes nothing returns nothing
set gg_trg_Radiant_Shield_Effect_2_Copy_Copy_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Radiant_Shield_Effect_2_Copy_Copy_2 )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Radiant_Shield_Effect_2_Copy_Copy_2, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Radiant_Shield_Effect_2_Copy_Copy_2, Condition( function Trig_Radiant_Shield_Effect_2_Copy_Copy_2_Conditions ) )
call TriggerAddAction( gg_trg_Radiant_Shield_Effect_2_Copy_Copy_2, function Trig_Radiant_Shield_Effect_2_Copy_Copy_2_Actions )
endfunction
Last edited: