- Joined
- Aug 1, 2007
- Messages
- 535
Ok so I made a custom spell for all the heroes in my game, there is a trigger for each one, but for some reason it wouldnt let me use a array as a variable for some of the stuff or it would friek out and glitch like mad. So I converted it to JASS and tried to make local variables. But now its not working at all.
JASS:
function Trig_Sting_01_Conditions takes nothing returns boolean if ( not ( GetUnitTypeId(GetSpellAbilityUnit()) == 'H000' ) ) then return false endif if ( not ( GetSpellAbilityId() == 'AEsh' ) ) then return false endif return trueendfunctionfunction Trig_Sting_01_Func013A takes nothing returns nothing call SetUnitAnimation( GetEnumUnit(), "attack" )endfunctionfunction Trig_Sting_01_Func020A takes nothing returns nothing call RemoveUnit( GetEnumUnit() )endfunctionfunction Trig_Sting_01_Actions takes nothing returns nothing local unit sngCast = GetSpellAbilityUnit() local unit sngTarg = GetSpellTargetUnit() local location sngPoint = GetUnitLoc(sngTarg) local group StingGroup local effect array Effects call PauseUnitBJ( true, sngCast ) call PauseUnitBJ( true, sngTarg ) call IssueImmediateOrderBJ( sngCast, "stop" ) call IssueImmediateOrderBJ( sngTarg, "stop" ) call SetUnitFacingToFaceUnitTimed( sngTarg, sngCast, 1.00 ) call SetUnitAnimation( sngCast, "spell" ) set bj_forLoopAIndex = 1 set bj_forLoopAIndexEnd = 10 loop exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd call AddSpecialEffectLocBJ( PolarProjectionBJ(sngPoint, 100.00, ( 36.00 * I2R(GetForLoopIndexA()) )), "war3mapImported\\ZombifyTargetBlue.mdx" ) set Effects[GetForLoopIndexA()] = GetLastCreatedEffectBJ() call CreateNUnitsAtLocFacingLocBJ( 1, 'h005', Player(PLAYER_NEUTRAL_PASSIVE), PolarProjectionBJ(sngPoint, 100.00, ( 36.00 * I2R(GetForLoopIndexA()) )), sngPoint ) call SetUnitColor( GetLastCreatedUnit(), udg_CustColor[1] ) call SetUnitVertexColorBJ( GetLastCreatedUnit(), 100, 100, 100, 50.00 ) call GroupAddUnitSimple( GetLastCreatedUnit(), StingGroup ) call TriggerSleepAction( 0.30 ) call DestroyEffectBJ( Effects[GetForLoopIndexA()] ) set bj_forLoopAIndex = bj_forLoopAIndex + 1 endloop call TriggerSleepAction( 1.00 ) call ForGroupBJ( StingGroup , function Trig_Sting_01_Func013A ) call TriggerSleepAction( 0.43 ) call UnitDamageTargetBJ( sngCast, sngTarg, ( 400.00 + ( 100.00 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), sngCast)) ) ), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL ) call TriggerSleepAction( 0.57 ) set bj_forLoopAIndex = 1 set bj_forLoopAIndexEnd = 10 loop exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd call AddSpecialEffectLocBJ( PolarProjectionBJ(sngPoint, 100.00, ( 36.00 * I2R(GetForLoopIndexA()) )), "war3mapImported\\ZombifyTargetBlue.mdx" ) set Effects[( GetForLoopIndexA() + 10 )] = GetLastCreatedEffectBJ() set bj_forLoopAIndex = bj_forLoopAIndex + 1 endloop call TriggerSleepAction( 0.30 ) set bj_forLoopAIndex = 1 set bj_forLoopAIndexEnd = 20 loop exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd call DestroyEffectBJ( Effects[GetForLoopIndexA()] ) set bj_forLoopAIndex = bj_forLoopAIndex + 1 endloop call ForGroupBJ( StingGroup , function Trig_Sting_01_Func020A ) call PauseUnitBJ( false, sngCast ) call PauseUnitBJ( false, sngTarg ) set bj_forLoopAIndex = 1 set bj_forLoopAIndexEnd = 20 loop exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd set Effects[GetForLoopIndexA()] = null set bj_forLoopAIndex = bj_forLoopAIndex + 1 endloop set sngCast = null set sngTarg = null set sngPoint = nullendfunction//===========================================================================function InitTrig_Sting_01 takes nothing returns nothing set gg_trg_Sting_01 = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_Sting_01, EVENT_PLAYER_UNIT_SPELL_EFFECT ) call TriggerAddCondition( gg_trg_Sting_01, Condition( function Trig_Sting_01_Conditions ) ) call TriggerAddAction( gg_trg_Sting_01, function Trig_Sting_01_Actions )endfunction