Jump to content

Recommended Posts

Hello i search for a quest that if you have an item example.(vnum)3969 get the biologist time to 0 or skip it..

i found one its on ro i think:

quest example begin
state start begin
		when 20084.chat."Elimina timp" with get_time() <= pc.getqf("duration") begin
			say_title("Biolog:")
			say("Planta magica contine acid sulfuric")
			say("Doar o picatura din ea pe un obiect si")
			say("a fost distrus!Daca imi oferi una voi putea")
			say("elimina timpul mai repede!Ai una?")
			say_item("Floarea biologului","3969","")
			local s = select ("Da,am la mine.", "Inapoi")
			if s == 2 then
				return
			elseif s == 1 then
			if pc.count_item(3969) > 0 then
				say_title("Biologul:")
				say("Aceasta planta este magnifica.Voi putea elimina")
				say("timpul imediat.")
				say(" . . . ")
				say(" . . . ")
				say("Gata.Timpul a fost eliminat.Acum astept sa imi")
				say("aduci alte materiale pentru cercetari!")
				pc.remove_item(3969, 1)
				pc.setqf("duration", get_time()-1)
				end
			elseif pc.count_item(3969) == 0 then
				say_title("Biologul:")
				say("Nu detii nici o planta de acest gen.")
				say("Ce e drept..este destul de rara.")
		end
	end
		end
	end

it get the item (vnum) 3969 but it wont get the time to 0..can anyone help or is there any ready quest like this? thanks

  • Love 1
Link to comment
Share on other sites

  • Premium

Send here one of your biologist quests, under spoiler if possible.

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Premium

yes.

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Premium

So you want the time to be reset when you use the item 3969?

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Premium
quest reset_time_item_use begin
    state start begin
        function GetBiologistQuestNames()
            local data = {
                [1] = "biologist_sequence30",
                [2] = "biologist_sequence40",
                [3] = "biologist_sequence50",
                [4] = "biologist_sequence60",
                [5] = "biologist_sequence70",
                [6] = "biologist_sequence80",
                [7] = "biologist_sequence85",
                [8] = "biologist_sequence90"
            };

            return data;
        end -- function

        function GetQuestWaitingForTime()
            local quest_names = reset_time_item_use.GetBiologistQuestNames();
            for index, quest_name in ipairs(quest_names) do
                if (pc.getf(quest_name, "duration") > 0) then
                    return index;
                end -- if
            end -- for

            return -1;
        end -- function

        function IsWaitingForTime()
            return reset_time_item_use.GetQuestWaitingForTime() ~= -1;
        end -- function

        function ExecuteTimeReset()
            local data = reset_time_item_use.GetBiologistQuestNames();
            local get_waiting_quest_id = reset_time_item_use.GetQuestWaitingForTime();

            pc.setf(data[get_waiting_quest_id], "duration", 0);
            syschat("The waiting time has been reset successfully.")
        end -- function

        when 3969.use begin
            if (not reset_time_item_use.IsWaitingForTime()) then
                return syschat("You don't have to wait for any quest.");
            end -- if

            item.remove();
            reset_time_item_use.ExecuteTimeReset();
        end -- when
    end -- state
end -- quest

It should work. Make sure the quest_names are correct in the data table. Also make sure the item is type 18, if it's not, set it to be 18 and then /reload in game, else it won't work.

In case one of your quests bugged out and you got waiting time for more of them, although it shouldn't occur, use this one:

quest reset_time_item_use begin
    state start begin
        function GetBiologistQuestNames()
            local data = {
                [1] = "biologist_sequence30",
                [2] = "biologist_sequence40",
                [3] = "biologist_sequence50",
                [4] = "biologist_sequence60",
                [5] = "biologist_sequence70",
                [6] = "biologist_sequence80",
                [7] = "biologist_sequence85",
                [8] = "biologist_sequence90"
            };

            return data;
        end -- function

        function GetQuestWaitingForTime()
            local quest_names = reset_time_item_use.GetBiologistQuestNames();
            for index, quest_name in ipairs(quest_names) do
                if (pc.getf(quest_name, "duration") > 0) then
                    return index;
                end -- if
            end -- for

            return -1;
        end -- function

        function IsWaitingForTime()
            return reset_time_item_use.GetQuestWaitingForTime() ~= -1;
        end -- function

        function ExecuteTimeResetForAllQuests()
            local quest_names = reset_time_item_use.GetBiologistQuestNames();
            for _, quest_name in ipairs(quest_names) do
                if (pc.getf(quest_name, "duration") > 0) then
                    pc.setf(quest_name, "duration", 0);

                    if (pc.is_gm() or is_test_server()) then
                        syschat(string.format("GM/Test: The wait time for the quest %s has been reset.", quest_name))
                    end -- if
                end -- if
            end -- for
        end -- function

        when 3969.use begin
            if (not reset_time_item_use.IsWaitingForTime()) then
                return syschat("You don't have to wait for any quest.");
            end -- if

            item.remove();
            reset_time_item_use.ExecuteTimeResetForAllQuests();
        end -- when
    end -- state
end -- quest


 

  • Love 3

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

12 minutes ago, Syreldar said:

quest reset_time_item_use begin
    state start begin
        function GetBiologistQuestNames()
            local data = {
                [1] = "biologist_sequence30",
                [2] = "biologist_sequence40",
                [3] = "biologist_sequence50",
                [4] = "biologist_sequence60",
                [5] = "biologist_sequence70",
                [6] = "biologist_sequence80",
                [7] = "biologist_sequence85",
                [8] = "biologist_sequence90"
            };

            return data;
        end -- function

        function GetQuestWaitingForTime()
            local quest_names = reset_time_item_use.GetBiologistQuestNames();
            for index, quest_name in ipairs(quest_names) do
                if (pc.getf(quest_name, "duration") > 0) then
                    return index;
                end -- if
            end -- for

            return -1;
        end -- function

        function IsWaitingForTime()
            return reset_time_item_use.GetQuestWaitingForTime() ~= -1;
        end -- function

        when 3969.use begin
            if (not reset_time_item_use.IsWaitingForTime()) then
                return syschat("You don't have to wait for any quest.");
            end -- if

            local data = reset_time_item_use.GetBiologistQuestNames();
            local get_waiting_quest_id = reset_time_item_use.GetQuestWaitingForTime();

            pc.setf(data[get_waiting_quest_id], "duration", 0);
            syschat("The waiting time has been reset successfully.")
        end -- when
    end -- state
end -- quest

It should work. Make sure the quest_names are correct in the data table.

i dont think its working..no second selection appear on biologist 

Link to comment
Share on other sites

  • Premium
48 minutes ago, filippos1234 said:

i dont think its working..no second selection appear on biologist 

..It works by clicking on the item, not via biologist.

If you want it to work via dialogue with the npc, substitute 

when 3969.use begin

with

when 20084.chat."Reset Time" with pc.count_item(3969) > 0 begin

 

also substitute

item.remove();

with

pc.remove_item(3969, 1);

 

and also substitute:

syschat

with

say

or the window will bug out.

  • Good 1
  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Premium
4 minutes ago, filippos1234 said:

it doesnt work by click on item

also where is 


pc.remove_item(3969, 1);

i cant find it xD

..As I said..if you want it to work with the item, you have to make sure that item is type 18, if it's not, then set it to be 18, and then /reload in game.

plus how do you not see it?

 

chrome_5mVFev0upy.png.3228f24309d668ce84345c2799ad322e.png

  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Premium
2 minutes ago, filippos1234 said:

i saw the 1st quest you coded thats why i couldnt find it..also the second one is only for gm's as i can see

..no it's not. Only the message will be seen by GMs or if you're in test mode, because it outputs the quest_name, and I suppose players don't wanna see that.

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Premium
1 minute ago, filippos1234 said:

i tested it , only on my GM player the quest appear

chrome_Vpxo24oqLT.png.ecf9b0b214ad060c6661fd171b2520c5.png

This is the only thing that changes if you're gm. You see this message, that's it. Please make sure you're implementing it correctly..

  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • 1 year later...

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.