• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

can't summon hellfire by a summoned unit

Status
Not open for further replies.
Level 1
Joined
Apr 28, 2016
Messages
2
I used channel and trigger to summon a unit, and I also want the summoned unit to summon hellfire ability, but it doesn't work. I used trigger as below:

JASS:
function Trig_SummonUnit_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A007' ) ) then
        return false
    endif
    return true
endfunction

function Trig_SummonUnit_Actions takes nothing returns nothing
    call CreateNUnitsAtLoc( 1, 'h002', Player(0), GetSpellTargetLoc(), bj_UNIT_FACING )
    call UnitAddAbilityBJ( 'A002', GetLastCreatedUnit() )
    call PolledWait( 3.00 )
    call IssuePointOrderLocBJ( GetLastCreatedUnit(), "inferno", GetRectCenter(GetPlayableMapRect()) )
endfunction

//===========================================================================
function InitTrig_SummonUnit takes nothing returns nothing
    set gg_trg_SummonUnit = CreateTrigger(  )
    call TriggerRegisterUnitEvent( gg_trg_SummonUnit, gg_unit_H003_0010, EVENT_UNIT_SPELL_CAST )
    call TriggerAddCondition( gg_trg_SummonUnit, Condition( function Trig_SummonUnit_Conditions ) )
    call TriggerAddAction( gg_trg_SummonUnit, function Trig_SummonUnit_Actions )
endfunction
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
First, you should read some tutorials on how to properly code in jass or just stick to GUI. Memory leaks, and converted GUI triggers is no good practice, as already said numerous times by other ppl here. Also, "it doesnt work" is a quite inaccurate description.

Second, it could be either GetLastCreatedUnit(), which should be stored to a variable before using a Wait action, or, that the map center is not accessible for this unit in some way, or that inferno is not the base order id of the skill.
 
Level 1
Joined
Apr 28, 2016
Messages
2
thanks a lot for your advice. my problem is the "IssuePointOrderLocBJ" order can't trigger the inferno ability even if the ability is already in the skill box.
but when I click the skill button, the hellfire triggered.
and if I change the ability to waterelemental, it triggered.
so I want to know if the hellfire can be triggered by "IssuePointOrderLocBJ" from a summoned unit.
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
my problem is the "IssuePointOrderLocBJ" order can't trigger the inferno ability since the ability is already in the skill box.

sry but this makes no sense to me ... It has to be in the skill box in order to be able to be used.

So, upon clicking on this ability "A007" and chosing a spot, there is a unit created, which is given the ability "A002". Right?

If A002 has the base order "inferno", it should work.

Note, that you can only change the base order Id for the ability "channel". Also, A002 has to be a point-based ability.
 
Status
Not open for further replies.
Top