modify quest

Totalitatea subiectelor care nu respectă regulamentul impus in sectiunea "Probleme şi Întrebări" vor fi stocate aici.
Închis
Avatar utilizator
apoelaras123
Nivel 1

Nivel 1
Mesaje: 59
Membru din: 10 Aug 2019, 22:57
Regat: Chunjo
Aprecieri: 32  
Mulţumiri: 1  
Medalii

    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
                            say(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 20084.chat."hm" with pc.count_item(3969) > 0 begin
                say_title(string.format("%s:[ENTER]", mob_name(npc.get_race())))
                if (not reset_time_item_use.IsWaitingForTime()) then
                    return say_reward("You don't have to wait for any quest.");
                end -- if

                pc.remove_item(3969, 1);
                reset_time_item_use.ExecuteTimeResetForAllQuests();
            end -- when
        end -- state
    end -- quest
this quest is working for biologist..

i edited this quest for seon but it say core dump..what im doing wrong? pls help
quest reset_time_item_usex begin
state start begin
function GetBiologistQuestNames()
local data = {
[1] = "collect_quest_lv92",
[2] = "collect_quest_lv94",
[3] = "cq100lv",
[4] = "cq105lv"
};

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
say(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 20091.chat."hm" with pc.count_item(3969) > 0 begin
say_title(string.format("%s:[ENTER]", mob_name(npc.get_race())))
if (not reset_time_item_use.IsWaitingForTime()) then
return say_reward("You don't have to wait for any quest.");
end -- if

pc.remove_item(3969, 1);
reset_time_item_use.ExecuteTimeResetForAllQuests();
end -- when
end -- state
end -- quest
thanks for your time
Închis

Înapoi la “Arhivă Probleme şi Întrebări”

  • Informaţie
  • Cine este conectat

    Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 20 vizitatori