• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Trigger/Quest Help?

Status
Not open for further replies.
Level 2
Joined
Jun 19, 2006
Messages
8
Alright so on my new map, I need Quests for ONE player only, other players won't get it.
But I have no idea where to find this and im pretty new to JASS so I can't figure out if it would be in there what I have, but I'm not sure if im WAY off or just have to change a couple of things -

function Trig_HW_Bard_1_Func003C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'H009' ) ) then
return false
endif
return true
endfunction

function Trig_HW_Bard_1_Conditions takes nothing returns boolean
if ( not ( GetOrderTargetUnit() == gg_unit_n00S_0013 ) ) then
return false
endif
if ( not Trig_HW_Bard_1_Func003C() ) then
return false
endif
return true
endfunction

function Trig_HW_Bard_1_Actions takes nothing returns nothing
call CreateQuestBJ( bj_QUESTTYPE_REQ_DISCOVERED, "TRIGSTR_597", "TRIGSTR_598", "ReplaceableTextures\\CommandButtons\\BTNAmbush.blp" )
endfunction

//===========================================================================
function InitTrig_HW_Bard_1 takes nothing returns nothing
set gg_trg_HW_Bard_1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_HW_Bard_1, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
call TriggerAddCondition( gg_trg_HW_Bard_1, Condition( function Trig_HW_Bard_1_Conditions ) )
call TriggerAddAction( gg_trg_HW_Bard_1, function Trig_HW_Bard_1_Actions )
endfunction
 
Level 5
Joined
Nov 14, 2004
Messages
159
Sounds easily done in GUI.

Code:
player1only
    Events
        Map initialization
    Conditions
    Actions
        Set playercount = 0
        For each (Integer A) from 1 to 12, do (If (((Player((Integer A))) slot status) Equal to Is playing) then do (Set playercount = (playercount + 1)) else do (Do nothing))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                playercount Greater than 1
            Then - Actions
                Trigger - Turn off (player 1 trigger only)
                ***your whole list of player 1 only triggers***
            Else - Actions
                Do nothing

*edit* Oh I forgot, add "Slot is not equal to computer" in AND condition along with "is playing" too
 
Status
Not open for further replies.
Top