Warcraft III resources & community, 2003–2006 · archived

Trigger spell problem

4 posts
#1

Trigger spell problem

Okey what i'm trying to do is triggering the Polymorph ability to have an AOE morph efect. Its quite simple, I know but it won't work :shock:

Here's my skript:

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

function Trig_masssheep_Kopieren_Kopieren_Func003A takes nothing returns nothing
call CreateNUnitsAtLoc( 1, 'h006', GetOwningPlayer(GetSpellAbilityUnit()), udg_v_punkt, bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_v_group )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "polymorph", GetEnumUnit() )
endfunction

function Trig_masssheep_Kopieren_Kopieren_Func005002 takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction

function Trig_masssheep_Kopieren_Kopieren_Actions takes nothing returns nothing
set udg_v_punkt = GetUnitLoc(GetSpellAbilityUnit())
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsInRangeOfLocAll(250.00, GetSpellTargetLoc()), function Trig_masssheep_Kopieren_Kopieren_Func003A )
call RemoveLocation( udg_v_punkt )
call ForGroupBJ( udg_v_group, function Trig_masssheep_Kopieren_Kopieren_Func005002 )
call DestroyGroup( udg_v_group )
endfunction

//===========================================================================
function InitTrig_masssheep_Kopieren_Kopieren takes nothing returns nothing
set gg_trg_masssheep_Kopieren_Kopieren = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_masssheep_Kopieren_Kopieren, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_masssheep_Kopieren_Kopieren, Condition( function Trig_masssheep_Kopieren_Kopieren_Conditions ) )
call TriggerAddAction( gg_trg_masssheep_Kopieren_Kopieren, function Trig_masssheep_Kopieren_Kopieren_Actions )
endfunction



What happens is:
The units in the target area get the special efects of polymorphs (sparks and so on, dont know what it is ^^) but they don't morph into sheeps.
I used a dummy which has the standart morph ability i just reduced mana cost and cooldown to zero and disabled the checking of tech requirements.
And the dummies aren't removed from game after they casted.

So my spell is pretty fucked up. It doesnt morph and it creates dummies which stay -.-


Anyone knows why ?
#2
Ok. A friend told me to use Starts efect of an ability - Event.


Now it works.
#3
apoc, dont use GUI conversions to mimic JASS

instead of ForGroup, use a loop that checks when the group is empty as an exitwhen


local group g = CreateGroup()
local unit u

call GroupEnumUnitsInRange( g, whereX, whereY, null )

loop
set u = FirstOfGroup( g )
exitwhen u == null
//your actions here
endloop
#4
I didn't want to mimic JASS , i had to post conversion because my GUI is german ;)

I have it running now and rewrote it all.
The one i posted is crap, actually :D