HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Whats wrong with trigger?

04-06-2003, 07:23 PM#1
MarSara
What is wrong with the code here? What I am wanting is for only player 1 to see these quests. It works, but it disconnects all other players from the game.

So Is there anyway to create a quest for only 1 player, and still save that quest to a variable?

Code:
function Trig_Player1_CreateQuest_Actions takes nothing returns nothing

    local integer i
    set i = 1

    loop
        exitwhen i > 12
        if(udg_Player1EnabledSpells[i] == true) then
            if(GetLocalPlayer() == Player(0)) then
                call CreateQuestBJ( bj_QUESTTYPE_REQ_DISCOVERED, udg_Player1SpellNames[i], "", "ReplaceableTextures\\CommandButtons\\BTNBansheeMaster.blp" )
            endif

            set udg_Player1SpellQuests[i] = GetLastCreatedQuestBJ()

            if(GetLocalPlayer() == Player(0)) then
                call CreateQuestItemBJ( udg_Player1SpellQuests[i], udg_Player1SpellInfo[i] )
                call CreateQuestItemBJ( udg_Player1SpellQuests[i], udg_Player1SpellInfo2[i] )
                call CreateQuestItemBJ( udg_Player1SpellQuests[i], udg_Player1SpellMana[i] )
            endif
        else
            if(GetLocalPlayer() == Player(0)) then
                call CreateQuestBJ( bj_QUESTTYPE_OPT_DISCOVERED, udg_Player1SpellNames[i], "", "ReplaceableTextures\\CommandButtonsDisabled\\DISBTNBansheeMaster.blp" )
            endif

            set udg_Player1SpellCosts[i] = GetLastCreatedQuestBJ()

            if(GetLocalPlayer() == Player(0)) then
                call CreateQuestItemBJ( udg_Player1SpellCosts[i], I2S(udg_Player1SpellCostGold[i]) + " |cffffff00Gold|r" )
                call CreateQuestItemBJ( udg_Player1SpellCosts[i], I2S(udg_Player1SpellCostLumber[i]) + " |cff332211Lumber|r")
                call CreateQuestItemBJ( udg_Player1SpellCosts[i], I2S(R2I(udg_Player1SpellCostMana[i])) + " |cff8080ffMana|r")
            endif
        endif
        set i = i + 1
    endloop
endfunction