Help With This Easy Trigger pls

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

NicoStalker247
Junior Member
Posts: 26
Joined: June 26th, 2011, 1:51 pm
Title: -Outofmana-
Location: South-Afrika

Help With This Easy Trigger pls

Post by NicoStalker247 »

See. in this trigger below i have made a unit fly up, and when he is busy flying up it is busy creating BreathOfFireDamage.mdl Model
on the unit.
the thing is what i want help with is how do i make 10 BreathOfFireDamage.mdl models Deleted all 10 at the same time after the unit
comes back to the ground. Can anyone help?? :neutral:

function Trig_Rise_Conditions takes nothing returns boolean
if ( not ( 'A000' == GetSpellAbilityId() ) ) then
return false
endif
return true
endfunction

function Trig_Rise_Actions takes nothing returns nothing
call SetUnitScalePercent( GetTriggerUnit(), 50.00, 50.00, 50.00 )
call SetUnitFlyHeightBJ( GetTriggerUnit(), 350.00, 100.00 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 10
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call AddSpecialEffectTargetUnitBJ( "origin", GetTriggerUnit(), "Abilities\\Spells\\Other\\BreathOfFire\\BreathOfFireDamage.mdl" )
call TriggerSleepAction( 0.05 )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call SetUnitFlyHeightBJ( GetTriggerUnit(), 0.00, 100.00 )
endfunction

//===========================================================================
function InitTrig_Rise takes nothing returns nothing
set gg_trg_Rise = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Rise, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Rise, Condition( function Trig_Rise_Conditions ) )
call TriggerAddAction( gg_trg_Rise, function Trig_Rise_Actions )
endfunction
-OUTOFMANA-
naturesfury
Forum Spammer
Posts: 610
Joined: March 30th, 2009, 9:02 pm

Re: Help With This Easy Trigger pls

Post by naturesfury »

lol o.o u dont have any pauses except that sleep action for .05 sec
that means that entire function finishes in less than a sec
no wonder u dont see anything...

u might wanna make an array and set the effects to the array to delete them all later
(set ARRAY[bj_forLoopAIndex]=call AddSpecial.........)
then at the end, after the set fly hight to 0,
make another loop to destroy all the effects stored in the array

and if u wanna see the guy float in the air for a bit, just extend the time in TriggerSleepAction or add another one before the setflyhight to 0
NicoStalker247
Junior Member
Posts: 26
Joined: June 26th, 2011, 1:51 pm
Title: -Outofmana-
Location: South-Afrika

Re: Help With This Easy Trigger pls

Post by NicoStalker247 »

DUDE!
You are like my hero :ayeaye:
Thank Alot
-OUTOFMANA-
NicoStalker247
Junior Member
Posts: 26
Joined: June 26th, 2011, 1:51 pm
Title: -Outofmana-
Location: South-Afrika

Re: Help With This Easy Trigger pls

Post by NicoStalker247 »

Dude can you pls link a array tutorial.
i don't get it. :idea:
-OUTOFMANA-
owner123
Super Moderator
Posts: 1943
Joined: February 3rd, 2009, 11:28 pm

Re: Help With This Easy Trigger pls

Post by owner123 »