Jump to content

I need help with Quest function


Recommended Posts

  • Active Member

Hi guys,

when I did event in quest i used function game.get_event_flag(boom, 1). But I don't know how can I put this event off only for some player. Because when I used the same function game.get_event_flag(boom, 0) event was put off for all.

Thank you for answers!

Kind Regards ReFresh

 

There is quests:

 

quest event begin
    state start begin
        function event_is_on()
            return (game.get_event_flag("event") == 1)   
        end
        
        when 9003.click with event.event_is_on() begin
                if pc.getqf("event") == 1 then
                    say_title("")
                    say("")
                    say("")
                    say("")
                    say("")
                    say("")
                    say("")
                    say("")
                    say("")
                    say_title("")
                    say_title("")
                    say_title("")
                    say("")
                    say("")
                    say("")
                    wait()
                    say_title("")
                    say("")
                    say("")
                    say("")
                    say("")
                    say("")
                    say("")
                    say("")
                    say("")
                    say("")
                    local ano_ne = select("Yes", "No")
                    if ano_ne == 1 then
                        say_title("")
                        say("")
                        say("")
                        say("")        
                        local select_i = select("", "", "", "")    
                        if select_i  == 1 then
                            say_title("")
                            say("")
                            say("")
                            say("")
                            say("")
                            say("")
                            say("")
                            say("")
                        elseif select_i == 2 then
                            say_title("")
                            say("")
                            say("")
                            say("")
                            say("")
                            say("")
                            say("")
                            say("")
                        elseif select_i == 3 then
                            say_title("")
                            say("")
                            say("")
                            say("")
                            say("")
                            say("")
                            say("")
                            say("")
                        elseif select_i == 4 then
                            say_title("")
                            say("")
                            say("")
                            say("")
                        end
                    elseif ano_ne == 2 then
                        say_title("")
                        say("")
                        say("")    
                    end
            end
        end
        
        function setting()
            return {  
            ["event_mob"] = 9008,
            }
        end
        
        when login with pc.getqf("event") == 1 begin
            local setting = event.setting()
            local mapIndex = pc.get_map_index()
            if mapIndex == 1 or mapIndex == 21 or mapIndex == 41 then
                if mapIndex == 1 then
                    mob.spawn(setting.event_mob, 565, 502, 1, 1, 1)
                elseif mapIndex == 21 then
                    mob.spawn(setting.event_mob, 713, 686, 1, 1, 1)
                elseif mapIndex == 41 then
                    mob.spawn(setting.event_mob, 446, 557, 1, 1, 1)
                end
            end
        end    

        when kill with pc.getqf("event") == 1 and not npc.is_pc() begin
            local s = number(1, 1000)
            if s == 1 then
                game.drop_item(50160,1)
            elseif s == 2 then
                game.drop_item(50161,1)
            elseif s == 3 then
                game.drop_item(50162,1)
            elseif s == 4 then
                game.drop_item(50163,1)
            elseif s == 5 then
                game.drop_item(50164,1)
            elseif s == 6 then
                game.drop_item(50165,1)
            elseif s == 7 then
                game.drop_item(50166,1)
            elseif s == 8 then
                game.drop_item(50167,1)
            elseif s == 9 then
                game.drop_item(50168,1)
            elseif s == 10 then
                game.drop_item(50169,1)
            elseif s == 11 then
                game.drop_item(50170,1)
            elseif s == 12 then
                game.drop_item(50171,1)
            elseif s == 13 then
                game.drop_item(50172,1)
            elseif s == 14 then
                game.drop_item(50173,1)
            elseif s == 15 then
                game.drop_item(50174,1)
            elseif s == 16 then
                game.drop_item(50175,1)
            elseif s == 17 then
                game.drop_item(50176,1)
            elseif s == 18 then
                game.drop_item(50177,1)
            elseif s == 19 then
                game.drop_item(50178,1)
            elseif s == 20 then
                game.drop_item(50179,1)
            end
        end
    end
end

 

There is a second quest:

quest end_event begin
    state start begin
        when 20354.chat. "Running event " begin
            if pc.getqf("event", 1) then
                say_title(" ")
                say("")
                say("")
                say("")
                say("")
                say("")
                say(" ")
                say("")
                local yes_no = select("Yes ", "No ")
                if yes_no == 1 then
                    pc.setqf("event", 0)
                    notice(".")
                elseif yes_no == 2 then
                    notice("")
                end
                
            elseif pc.getqf("event", 0) then
                say_title(" ")
                say(" ")
                say("")
                say("")
                say("")
                say("")
                say("")
                say("")
                local yes_no = select("No ", "Yes ")
                if yes_no == 1 then
                    notice("")
                elseif yes_no == 2 then
                    pc.setqf("event", 1)
                    notice("")
                end
            end
        end
    end
end

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Replies 11
  • Created
  • Last Reply

Top Posters In This Topic

Spoiler

quest this_quest_by_haies begin
    state start begin
        when 9003.chat." gm " with pc.is_gm() begin
            say(" bla bla bla ... ")
            say(" insert any password to event today ! only number ")
            local haies_pass = input()
            haies_pass = tonumber(haies_pass)
            say(" do you want start event ? ")
            local haies = select(" yes " , " stop event for all "," exit ")
            if haies == 1 then
                game.set_event_flag("event_haies", 1)
                game.set_event_flag("password_haies", haies_pass)
            elseif haies == 2 then
                game.set_event_flag("event_haies", 0)
            elseif haies == 3 then
                return
            end
        end
        when 9003.chat." event today " with game.get_event_flag("event_haies") == 1 begin
            say(" hello player ! ")
            say(" insert password to event today : ")
            local haies_pass = input()
            haies_pass = tonumber(haies_pass)
            if haies_pass == game.get_event_flag("password_haies") then
                pc.setqf("event_haies", 1)
            else
                say(" pass erorr ")
            end
        end
        when kill with pc.getqf("event_haies") >= 1 begin
            game.drop_item(50160,1) -- or any thing and any function
        end
    end
end

this quest The player going to the merchant enters the password so that the gm selected and enter the correct way when the event will start the player
End

 

 

 

 

Complete you want from dropping, etc. of things

Link to comment
Share on other sites

  • Active Member
16 minutes ago, ahmedhaies said:
  Hide contents

quest this_quest_by_haies begin
    state start begin
        when 9003.chat." gm " with pc.is_gm() begin
            say(" bla bla bla ... ")
            say(" insert any password to event today ! only number ")
            local haies_pass = input()
            haies_pass = tonumber(haies_pass)
            say(" do you want start event ? ")
            local haies = select(" yes " , " stop event for all "," exit ")
            if haies == 1 then
                game.set_event_flag("event_haies", 1)
                game.set_event_flag("password_haies", haies_pass)
            elseif haies == 2 then
                game.set_event_flag("event_haies", 0)
            elseif haies == 3 then
                return
            end
        end
        when 9003.chat." event today " with game.get_event_flag("event_haies") == 1 begin
            say(" hello player ! ")
            say(" insert password to event today : ")
            local haies_pass = input()
            haies_pass = tonumber(haies_pass)
            if haies_pass == game.get_event_flag("password_haies") then
                pc.setqf("event_haies", 1)
            else
                say(" pass erorr ")
            end
        end
        when kill with pc.getqf("event_haies") >= 1 begin
            game.drop_item(50160,1) -- or any thing and any function
        end
    end
end

this quest The player going to the merchant enters the password so that the gm selected and enter the correct way when the event will start the player
End

 

 

 

 

Thank you, but i need to set up, put on and put off the event only for player. Event flag i set in game manually.

For example:

I set the event on with GM and players at now have event on and when they go to the some NPC, they will can put off the event and when is the event off for some player he will can put on the event.

I'll be always helpful! 👊 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.