filippos1234 6 Posted November 16, 2019 Share Posted November 16, 2019 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 1 Link to comment Share on other sites More sharing options...
Premium Syreldar 1875 Posted November 16, 2019 Premium Share Posted November 16, 2019 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 More sharing options...
filippos1234 6 Posted November 16, 2019 Author Share Posted November 16, 2019 11 minutes ago, Syreldar said: Send here one of your biologist quests, under spoiler if possible. just one whatever quest? Link to comment Share on other sites More sharing options...
Premium Syreldar 1875 Posted November 16, 2019 Premium Share Posted November 16, 2019 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 More sharing options...
filippos1234 6 Posted November 16, 2019 Author Share Posted November 16, 2019 Spoiler EDITED I DONT WANT MY QUEST TO BE PUBLISHED here Link to comment Share on other sites More sharing options...
Premium Syreldar 1875 Posted November 16, 2019 Premium Share Posted November 16, 2019 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 More sharing options...
filippos1234 6 Posted November 16, 2019 Author Share Posted November 16, 2019 11 minutes ago, Syreldar said: So you want the time to be reset when you use the item 3969? yes but in any biologist quest - just the time go to zero so you dont have to wait Link to comment Share on other sites More sharing options...
Premium Syreldar 1875 Posted November 16, 2019 Premium Share Posted November 16, 2019 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 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 More sharing options...
filippos1234 6 Posted November 16, 2019 Author Share Posted November 16, 2019 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 More sharing options...
Premium Syreldar 1875 Posted November 16, 2019 Premium Share Posted November 16, 2019 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. 1 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 More sharing options...
filippos1234 6 Posted November 16, 2019 Author Share Posted November 16, 2019 it doesnt work by click on item also where is pc.remove_item(3969, 1); i cant find it xD Link to comment Share on other sites More sharing options...
Premium Syreldar 1875 Posted November 16, 2019 Premium Share Posted November 16, 2019 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? 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 More sharing options...
ruizuinho-o 12 Posted November 16, 2019 Share Posted November 16, 2019 3 minutes ago, filippos1234 said: it doesnt work by click on item Jesus man, stop being noob. Thanks Link to comment Share on other sites More sharing options...
filippos1234 6 Posted November 16, 2019 Author Share Posted November 16, 2019 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 Link to comment Share on other sites More sharing options...
Premium Syreldar 1875 Posted November 16, 2019 Premium Share Posted November 16, 2019 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 More sharing options...
filippos1234 6 Posted November 16, 2019 Author Share Posted November 16, 2019 2 minutes ago, Syreldar said: ..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. i tested it , only on my GM player the quest appear Link to comment Share on other sites More sharing options...
Premium Syreldar 1875 Posted November 16, 2019 Premium Share Posted November 16, 2019 1 minute ago, filippos1234 said: i tested it , only on my GM player the quest appear 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.. 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 More sharing options...
filippos1234 6 Posted November 16, 2019 Author Share Posted November 16, 2019 You are right!!! thank you very much for helping me i wish you have a good day (i didnt have the item on my inventory when i was trying on regular player...xD) Link to comment Share on other sites More sharing options...
Milfmorfar 0 Posted August 10, 2021 Share Posted August 10, 2021 I am very new to all of this, I read this topic and this is exactly what i want to ''try'' to fix for my self on my server. Problem is that i dont even know where this file is in my metin2 map? What is the name of it?... or is it even a file that you edit or have i completely misunderstood all of this? Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now