quest biologul_chaegirab begin
    -- Functiile necesare questului
    state functions begin
        function Data()
            local data
            data = {
                {
                    "Dintii de orc",
                    30006,
                    10,
                    "Valea orcilor",
                    {635, 636, 637}
                },
               
                {
                    "Cartile blestemate",
                    30047,
                    15,
                    "Valea orcilor",
                    {703, 704, 705, 707, 706}
                },
               
                {
                    "Amintirile de demon",
                    30015,
                    20,
                    "Turnul Demonilor",
                    {1001, 1002, 1003, 1004}
                },
               
                {
                    "Globurile de gheata",
                    30050,
                    20,
                    "Muntele Sohan",
                    {1102, 1103, 1104, 1107, 1106}
                },
               
                {
                    "Ramurile Zelkova",
                    30165,
                    20,
                    "Padurea Rosie",
                    {2301, 2302, 2303, 2304, 2305, 2311, 2312, 2313, 2314, 2315}
                },
               
                {
                    "Table sacre",
                    30166,
                    30,
                    "Campul cu serpi",
                    {1401, 1402, 1403, 1601, 1602, 1603}
                },
               
                {
                    "Crengile rosii",
                    30167,
                    30,
                    "Padurea Rosie",
                    {2311, 2312, 2313, 2314, 2315, 7024}
                },
               
                {
                    "Vestile despre Rege",
                    30168,
                    20,
                    "Atlantida",
                    {2401, 2402, 2403, 2404, 2411, 2412, 2413, 2414}
                }
            }
            return data
        end
        function getLevel(bquest_level)
            local levels
            local bquest_level = pc.getqf("blevel")
            levels = {30, 40, 50, 60, 70, 80, 90, 94, 100}
            return levels[bquest_level]
        end
        function getBonusName()
            local names
            local blevel = pc.getqf("blevel")
            names = {
                "Bonus +10 Viteză de mişcare (permanent)",
                "Bonus +5 valoare atac (permanent)",
                "Bonus +60 apărare (permanent)",
                "Bonus +50 atac (permanent)",
                "Bonus +11 viteză de mişcare (permanent)[ENTER]Bonus +10 rezistenţă la monştri (permanent)",
                "Bonus +10 forţă de atac (permanent)[ENTER]Bonus +6 viteză de atac (permanent)",
                "Bonus +10% contra semi-oamenilor (permanent)",
                "Bonus +10% critică (permanent)[ENTER]Bonus +10% pătrunzătoare (permanent)[ENTER]Bonus +3000 HP (permanent)"
            }
            return names[blevel]
        end
        function applyBonus()
            local blevel = pc.getqf("blevel")
            if blevel == 1 then
                affect.add_collect(apply.MOV_SPEED, 10, 60*60*24*365*60)
            elseif blevel == 2 then
                affect.add_collect(apply.ATT_SPEED,5,60*60*24*365*60) 
            elseif blevel == 3 then
                affect.add_collect(apply.DEF_GRADE_BONUS,60,60*60*24*365*60)
            elseif blevel == 4 then
                affect.add_collect(apply.ATT_GRADE_BONUS,50,60*60*24*365*60)
            elseif blevel == 5 then
                affect.add_collect(apply.MOV_SPEED,11,60*60*24*365*60)   
                affect.add_collect_point(POINT_DEF_BONUS,10,60*60*24*365*60)
            elseif blevel == 6 then
                affect.add_collect(apply.ATT_SPEED,6,60*60*24*365*60)        
                affect.add_collect_point(POINT_ATT_BONUS,10,60*60*24*365*60)
            elseif blevel == 7 then
                affect.add_collect(apply.ATTBONUS_HUMAN,10,60*60*24*365*60)
            elseif blevel == 8 then
                affect.add_collect(apply.CRITICAL_PCT,10,60*60*24*365*60)
                affect.add_collect(apply.PENETRATE_PCT,10,60*60*24*365*60)
                affect.add_collect(apply.MAX_HP,3000,60*60*24*365*60) 
            end
        end
    end
    state start begin
        when login or levelup with pc.get_level() >= 30 and not pc.is_gm() begin
            local v = find_npc_by_vnum(20084)
            if v != 0 then
                target.vid("__TARGET__", v, "Chaegirab")
            end
            send_letter("Cauta-l pe Biolog")
        end
        when button or info begin
            say_title("Cauta-l pe Biolog!")
            say("Biologul are nevoie de ajutorul")
            say("tau pentru studiile sale.")
            say("Cauta-l si intreaba-l cu ce il poti")
            say("ajuta. Ajutorul tau nu o sa ramana")
            say("nerasplatit.")
            say("")
        end
        when __TARGET__.target.click or 20084.chat."Caut ajutor" begin
            target.delete("__TARGET__")
            say_title("Caut ajutor")
            say("Salut tinere razboinic,")
            say("Am nevoie de ajutorul tau pentru")
            say("a-mi termina studiile despre monstrii")
            say("ce ne cutreiera lumea noastra.")
            say("")
            say_reward("Citeste cu atentie informatiile urmatoare!")
            say("")
            wait()
            say_title("Cercetari")
            say("Cercetarile mele se bazeaza pe")
            say("anumite obiecte care se afla la")
            say("monstrii de pe continent.")
            say("Adu-mi toate materialele de care")
            say("am nevoie si te voi rasplati cu")
            say("o gramada de lucruri.")
            say("")
            wait()
            set_state(mission_start)
            clear_letter()
            pc.setqf("blevel", 1)
        end
    end
    state mission_start begin
        when letter or login or levelup begin
            local data = biologul_chaegirab.Data()
            local blevel = pc.getqf("blevel")
            if pc.get_level() >= biologul_chaegirab.getLevel() then
                send_letter("BIOLOG ~ "..data[blevel][1])
            end
            if pc.count_item(data[blevel][2]) > 0 then
                local v = find_npc_by_vnum(20084)
                if v != 0 then
                    target.vid("__TARGET__", v, "Chaegirab")
                end
            end
        end
        when button or info begin
            local data = biologul_chaegirab.Data()
            local blevel = pc.getqf("blevel")
            say_title("Dintii de orc")
            say("Salut tinere razboinic,")
            say("Biologul are nevoie sa ii aduci")
            say(""..data[blevel][3].."x "..item_name(data[blevel][2]).."")
            say("Se gasesc in "..data[blevel][4].."!")
            say("Poti aduce o bucata odata la 3 ore.")
            say("")
            wait()
        end
        when __TARGET__.target.click or 20084.click begin
            target.delete("__TARGET__")
            local data = biologul_chaegirab.Data()
            local blevel = pc.getqf("blevel")
            if pc.get_level() >= biologul_chaegirab.getLevel() then
                say_title(data[blevel][1])
                say("Salut "..pc.get_name().."!")
                say("Ai venit sa imi aduci niste obiecte?")
                say("Tine minte! Poti sa imi aduci odata la")
                say("3 ore pentru a avea timp sa le studiez!")
                say("")
                wait()
                say_title(data[blevel][1])
                say("Ai venit sa imi aduci "..item_name(data[blevel][2]).."?")
                if pc.is_gm() then
                    pc.setqf("duration", get_time()+0)
                end
                if pc.count_item(data[blevel][2]) == 0 then
                    say("")
                    say_reward("Se pare ca inca nu ai facut rost de nici un obiect!")
                    say_reward("Revino cand ai obiectele cerute.")
                    return
                end
                if get_time() < pc.getqf("duration") then 
                    say("")
                    say_reward("Inca nu au trecut cele 3 ore.")
                    say_reward("Revino mai tarziu.")
                    return
                end
                local bcount = pc.getqf("bcount")+1
                if bcount == data[blevel][3] then
                    say("Felicitari!")
                    say("Mi-ai adus toate obiectele necesare")
                    say("pentru a-mi termina studiul.")
                    say("")
                    say_reward("Rasplata : ")
                    say_reward(biologul_chaegirab.getBonusName())
                    wait()
                    biologul_chaegirab.applyBonus()
                    pc.setqf("blevel", pc.getqf("blevel")+1)
                    pc.setqf("bcount", 0)
                    pc.setqf("duration", get_time())
                    set_state(mission_next)
                else
                    say("Ooh...ai gasit "..item_name(data[blevel][2]).."?")
                    say("Lasa-ma sa studiez...")
                    say("...")
                    say("Se pare ca este bun.")
                    say("Mai ai de adus "..(data[blevel][3] - pc.getqf("bcount") - 1).."!")
                    say("")
                    pc.remove_item(data[blevel][2], 1)
                    pc.setqf("duration", get_time()+60*60*3)
                    pc.setqf("bcount", bcount)
                end
            else
                say_title("Biolog")
                say("Eu ma ocup de toate studiile")
                say("din acest regat de aceea sunt")
                say("foarte ocupat momentan.")
                say("")
            end
        end
        when 30130.use begin
            if get_time() < pc.getqf("duration")-5 then
                pc.setqf("duration", get_time()+5)
                chat("Timpul a fost redus la 5 secunde!")
                pc.remove_item(30130, 1)
            else
                chat("Timpul este deja scazut!")
            end
        end
        when kill begin
            local data = biologul_chaegirab.Data()
            local blevel = pc.getqf("blevel")
            for k,r in pairs(data[blevel][5]) do 
                if npc.get_race() == r and pc.count_item(data[blevel][2]) < data[blevel][3] then
                    local c = math.random(0, 30)
                    if c == 1 then
                        pc.give_item2(data[blevel][2], 1)
                    end
                end
            end
        end
    end
    state mission_next begin
        when login or levelup or letter begin
            local data = biologul_chaegirab.Data()
            local blevel = pc.getqf("blevel")
            if pc.get_level() >= biologul_chaegirab.getLevel() then
                set_state(mission_start)
            end
        end
    end
    state __END__ begin
    end
end

Parametrii generali :


{
    "Dintii de orc", -- nume misiune
    30006, -- cod obiecte
    10, -- cantitatea de obiecte
    "Valea orcilor", -- numele locatiei unde se gasesc
    {635, 636, 637} -- monstrii la care pica itemele
},

 

 

30130 va reduce timpul de asteptare la 5 secunde.

 

Nivele misiuni :


function getLevel(bquest_level)
local levels
local bquest_level = pc.getqf("blevel")
levels = {30, 40, 50, 60, 70, 80, 90, 94, 100} -- aici vin nivelele misiunilor
return levels[bquest_level]
end
Ultimul trebuie sa fie level maxim+1. Adica daca aveti level maxim 99 puneti 100.

Bonusuri :


function getBonusName()
    local names
    local blevel = pc.getqf("blevel")
    names = {
        "Bonus +10 Viteză de mişcare (permanent)",
        "Bonus +5 valoare atac (permanent)",
        "Bonus +60 apărare (permanent)",
        "Bonus +50 atac (permanent)",
        "Bonus +11 viteză de mişcare (permanent)[ENTER]Bonus +10 rezistenţă la monştri (permanent)",
        "Bonus +10 forţă de atac (permanent)[ENTER]Bonus +6 viteză de atac (permanent)",
        "Bonus +10% contra semi-oamenilor (permanent)",
        "Bonus +10% critică (permanent)[ENTER]Bonus +10% pătrunzătoare (permanent)[ENTER]Bonus +3000 HP (permanent)"
    }
    return names[blevel]
end

Numele si valorile bonusurilor ce le vor primii sunt in ordinea misiunilor.

function applyBonus()
    local blevel = pc.getqf("blevel")
    if blevel == 1 then
        affect.add_collect(apply.MOV_SPEED, 10, 60*60*24*365*60)
    elseif blevel == 2 then
        affect.add_collect(apply.ATT_SPEED,5,60*60*24*365*60)
    elseif blevel == 3 then
        affect.add_collect(apply.DEF_GRADE_BONUS,60,60*60*24*365*60)
    elseif blevel == 4 then
        affect.add_collect(apply.ATT_GRADE_BONUS,50,60*60*24*365*60)
    elseif blevel == 5 then
        affect.add_collect(apply.MOV_SPEED,11,60*60*24*365*60)  
        affect.add_collect_point(POINT_DEF_BONUS,10,60*60*24*365*60)
    elseif blevel == 6 then
        affect.add_collect(apply.ATT_SPEED,6,60*60*24*365*60)       
        affect.add_collect_point(POINT_ATT_BONUS,10,60*60*24*365*60)
    elseif blevel == 7 then
        affect.add_collect(apply.ATTBONUS_HUMAN,10,60*60*24*365*60)
    elseif blevel == 8 then
        affect.add_collect(apply.CRITICAL_PCT,10,60*60*24*365*60)
        affect.add_collect(apply.PENETRATE_PCT,10,60*60*24*365*60)
        affect.add_collect(apply.MAX_HP,3000,60*60*24*365*60)
    end
end
Bonusurile in functie de misiuni.

Modificare rasă :

 


local c = math.random(0, 30)
Pentru a micsora sansa mariti al doilea numar, iar pentru a o mari scadeti-l.

Modificare timp aşteptare :

 


pc.setqf("duration", get_time()+60*60*3)
Timpul este setat la 3 ore.

Tutorial instalare quest:

1. Salvaţi conţinutul quest-ului într-un fişier text numit de exemplu rasplata.quest .

2. Vă conectaţi la filezilla / winscp şi întrati în /usr/home/game/share/locale/germany/quest (depinde ce server aveţi).

3. Îl puneţi acolo (să fie .quest) şi da-ţi permisiuni 777.

4. Te loghezi în FreeBSD / putty şi scrii în felul următor: cd /usr/home/game/share/locale/germany/quest apoi ./qc rasplata.quest

5. Intraţi pe server şi scrieţi /reload q .