Problema bonusuri quest PET

Totalitatea subiectelor care nu respectă regulamentul impus in sectiunea "Probleme şi Întrebări" vor fi stocate aici.
Închis
Avatar utilizator
LegendaXXL
Deţinător Server

Deţinător Server
Mesaje: 1562
Membru din: 11 Aug 2013, 01:35
Server: TrueCloud
Regat: Jinno
Aprecieri: 349  
Mulţumiri: 528  
Discord: Copiază ID
 Contact:
Medalii

Chem pet-ul, imi da bonusurie, dar poblema este ca atunci cand ma teleportez cu petul chemat, bonusurile raman dar pet-ul nu mai este.. si daca-l chem iar, mai ofera odata bonusurile lui..

Cod: Selectaţi tot

quest pet_system begin
    state start begin
        when letter begin
            cmdchat("petguihideshow "..q.getcurrentquestindex())
        end
        
        function givebonus(x)
            local mobVnum = pc.getqf("mobVnum")
            local y,boni = {17,16,1},pet_system.bonusliste()
            table.foreach(boni[x],function(i,l)  cmdchat("HaustierBonus"..i.." "..l.."") affect.add_collect(y[i],l,60*60*24*365*60) end )
            cmdchat("HaustierLevel "..pc.getqf('petlevel_'..mobVnum).."")
            cmdchat("HaustierName "..pc.get_name().."")
            pc.setqf("petruf",1)
            pc.setqf("petguishow",1)
        end
        
        function bonusliste()
            return {
                [1] = {1,1,200},
                [2] = {2,2,300},
                [3] = {3,3,400},
                [4] = {4,4,500},
                [5] = {5,5,600},
                [6] = {6,6,700},
                [7] = {7,7,800},
                [8] = {8,8,900},
                [9] = {9,9,1000},
                [10] = {10,10,1100},
				[11] = {11,11,1200},
                [12] = {12,12,1300},
                [13] = {13,13,1400},
                [14] = {14,14,1500},
                [15] = {15,15,1600},
                [16] = {16,16,1700},
                [17] = {17,17,1800},
                [18] = {18,18,1900},
                [19] = {19,19,1950},
                [20] = {20,20,2000},
            }
        end
        
        function removebonus(x)
            local y,boni = {17,16,1},pet_system.bonusliste()
            table.foreach(boni[x],function(i,l) affect.remove_collect(y[i],l,60*60*24*365*60) end )
            pc.setqf("petruf",0)
            --cmdchat("HidePetGui")
            pc.setqf("petguishow",0)
            cleartimer("bugcheck")
        end
        
        function get_pet_info(itemVnum)
            pet_info_map = {
            --  [ITEM VNUM] MOB_VNUM, DEFAULT NAME, buff_idx, spawn_effect_idx
                [53001]        = { 34001, "-Feuerphönix", 1},
                [53002]     = { 34002, "-Rentier", 1, "rentier"},
                [53003]     = { 34003, "-Eisphönix", 1, "icephoenix"},
                [53005]     = { 34004, "-Azrael", 1, "azrael"},
                [53006]     = { 34009, "-Gold-Azrael", 1, "azrael"},
                [53007]     = { 34010, "-Bambi", 1, "rentier"},
                [53008]     = { 34011, "-Knuud", 1},
                [53009]     = { 34012, "-Bao Bao", 1, "baobao"},
                [53010]     = { 34008, "-Leonidas", 1, "leonidas"},
                [53011]     = { 34007, "-Khan", 1, "khan"},
                [53012]     = { 34005, "-Porkie", 1, "porky"},
                [53013]     = { 34006, "-Rufus", 1, "rufus"},
                [53014]     = { 34013, "-Henkerchen", 1},
                [53015]     = { 34017, "-Sigiliu Cioara", 1},
                [53016]     = { 34018, "-Sigiliu de Os", 1},
                [53017]     = { 34019, "-Sigiliu Panda.J", 1},
                [53018]     = { 34020, "-Sigiliu Mini Executor", 1},
                [53019]     = { 34021, "-Sigiliu Iepuras", 1},
                [53020]     = { 34022, "-Sigiliu Rufus P", 1},
                [53021]     = { 34023, "-Sigiliu Porcusor P", 1},
                [53022]     = { 34024, "-Sigiliu Tigru P", 1},
                [53023]     = { 34025, "-Sigiliu Leu P", 1},
                [53024]     = { 34026, "-Sigiliu Tigru Intunecat", 1},
                [53224]     = { 34028, "-Leopard", 1},
                [53225]     = { 34029, "-Sigiliu Clopotel de Nea", 1},
            }

            itemVnum = tonumber(itemVnum)

            return pet_info_map[itemVnum]
        end
        function get_spawn_effect_file(idx)
            effect_table = {
                [0] = nil,
                [1] = "d:ymir workeffectetcappear_diemonster_appear.mse",
            }
            return effect_table [idx]
        end
        when 53007.use or 53013.use or 53012.use or 53011.use or 53010.use or
        53005.use or 53006.use or 53003.use or 53002.use or 53001.use or 53014.use or
        53015.use or 53017.use or 53018.use or 53019.use or 53016.use or 53008.use or
        53009.use or 53020.use or 53021.use or 53022.use or 53023.use or 53024.use or
        53224.use or 53225.use begin
            local pet_info = pet_system.get_pet_info(item.vnum)

            if null != pet_info then

                local mobVnum = pet_info[1]
                local petName = pet_info[2]
                local spawn_effect_file_name = pet_system.get_spawn_effect_file(pet_info[4])
                
                pc.setqf("mobVnum",mobVnum)

                if true == pet.is_summon(mobVnum) then
                    if spawn_effect_file_name != nil then
                        pet.spawn_effect (mobVnum, spawn_effect_file_name)
                    end
                    pet.unsummon(mobVnum)
                    pet_system.removebonus(pc.getqf('petlevel_'..mobVnum))
                    cmdchat("HidePetGui")
                    syschat("Animalul de companie a fost alungat")
                else
                    if pet.count_summoned() < 1 then
                        pet.summon(mobVnum, petName, false)
                        if pet_info[4] ~= nil then
                        cmdchat(pet_info[4])
                        end
                        if pc.getqf('petlevel_'..mobVnum) == 0 then
                        pc.setqf('petlevel_'..mobVnum,1)
                        end
                        syschat("Animalul de companie a fost chemat.")
                        pet_system.givebonus(pc.getqf('petlevel_'..mobVnum))
                        local expprocent1 = {20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260, 280, 300, 320, 350, 400, 450, 500}
                        cmdchat("PetProcentExp "..(pc.getqf("exp_"..mobVnum)/expprocent1[pc.getqf("petlevel_"..mobVnum)]).."")                 
                        cmdchat("ShowPetGui")
                        loop_timer("bugcheck", 0.2)
                    else
                        syschat("Ai deja chemat un animalut!")
                    end
                    if spawn_effect_file_name != nil then
                        pet.spawn_effect(mobVnum, spawn_effect_file_name)
                    end
                end -- if pet.is_summon
            end  -- if null != pet_info
        end -- when
        when kill with not npc.is_pc() begin
            local mobVnum = pc.getqf("mobVnum")        
            if pc.getqf("petlevel_"..mobVnum) == 20 then
                return
            else
            if pc.getqf("petruf")==1 then
            --intervall = 10
            --if pc.get_level() <= mob.get_level(npc.get_race())+ intervall then -- Poate fi doar lvl max 10 peste monstru
            pc.setqf("exp_"..mobVnum,pc.getqf("exp_"..mobVnum)+1)
                    local exp2up = {2000, 4000, 6000, 8000, 10000, 12000, 14000, 16000, 18000, 20000, 22000, 24000, 26000, 28000, 30000, 32000, 35000, 40000, 45000, 50000}
                    local expprocent = {20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260, 280, 300, 320, 350, 400, 450, 500}
                    cmdchat("PetProcentExp "..(pc.getqf("exp_"..mobVnum)/expprocent[pc.getqf("petlevel_"..mobVnum)]).."")
                    if pc.getqf("exp_"..mobVnum) == exp2up[pc.getqf("petlevel_"..mobVnum)] then
                        if pc.getqf("petlevel_"..mobVnum) == 19 then
                            say_title("Animal de companie")
                            say("Animalut de companie Level "..(pc.getqf("petlevel_"..mobVnum)+1).."")
                            say_reward("Acesta a fost ultimul nivel!")
                        end
                        say_title("Animal de companie")
                        say("Animalut de companie Level "..(pc.getqf("petlevel_"..mobVnum)+1).."")
                        say("Felicitarii!")
                        pc.setqf("petlevel_"..mobVnum,pc.getqf("petlevel_"..mobVnum)+1)
                        pc.setqf("exp_"..mobVnum,0)
                        pet_system.removebonus(pc.getqf('petlevel'))
                    end
                end -- if not...
            end -- if pc.get...
        end -- when
        
                -- Bugschutz
        
        when bugcheck.timer begin
            if pc.is_dead() then
                pet_system.removebonus(pc.getqf('petlevel'))
            end
        end
        
        when login or logout or disconnect with pc.getqf("petruf") == 1 begin
            local mobVnum = pc.getqf("mobVnum")
            pet_system.removebonus(pc.getqf('petlevel_'..mobVnum))
            cmdchat("HidePetGui")
            chat("Nu a venit animalele de companie...")
            chat("Chemati-l din nou!")
        end
        when button or info begin
            local mobVnum = pc.getqf("mobVnum")
            if pc.getqf("petruf") == 1 and pc.getqf("petguishow") == 1 then
                cmdchat("HidePetGui")
                pc.setqf("petguishow",0)
                syschat("Fereastra de animal de casă a fost închis, aveţi posibilitatea să deschideţi din nou folosind icon-ul petului!")
            elseif pc.getqf("petruf") == 1 and pc.getqf("petguishow") == 0 then
                cmdchat("ShowPetGui")
                local expprocent1 = {20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260, 280, 300, 320, 350, 400, 450, 500}
                cmdchat("PetProcentExp "..(pc.getqf("exp_"..mobVnum)/expprocent1[pc.getqf("petlevel_"..mobVnum)]).."")  
                pc.setqf("petguishow",1)
                syschat("Fereastra de animal de casă este deschis, puteţi închide din nou folosind icon-ul petului!")
            elseif pc.getqf("petruf") == 0 then
                syschat("Ai chemat nici un animal de companie!")
            end
        end
            
    end -- state
end -- quest
☁ TRUECLOUD.RO

Găzduire Web • Domenii • E-mail Business
VPS-uri Linux & FreeBSD în curând

🎁 Prima lună GRATUITĂ pentru primii 10 clienți
Cod promoțional: TRUECLOUD10

👉 www.truecloud.ro
Afișează semnătura
Avatar utilizator
Xim
Nou Venit

Nou Venit
Mesaje: 14
Membru din: 06 Sep 2016, 23:56
Regat: Shinsoo
Aprecieri: 1  
Mulţumiri: 3  
Medalii

Da-le bonusuri din item_proto
Avatar utilizator
jwdok
Nivel 2

Nivel 2
Mesaje: 238
Membru din: 20 Aug 2014, 22:53
Server: www.Metin2Avatar.com
Regat: Chunjo
Aprecieri: 11  
Mulţumiri: 37  
Medalii

Daca le da bns din item_proto ce rost mai are sistemu????
Avatar utilizator
LegendaXXL
Deţinător Server

Deţinător Server
Mesaje: 1562
Membru din: 11 Aug 2013, 01:35
Server: TrueCloud
Regat: Jinno
Aprecieri: 349  
Mulţumiri: 528  
Discord: Copiază ID
 Contact:
Medalii

Xim scrie:Da-le bonusuri din item_proto
Ele dau bonusuri in functie de level-ul pe care-l au.. nu le pot seta bonus din item_proto
☁ TRUECLOUD.RO

Găzduire Web • Domenii • E-mail Business
VPS-uri Linux & FreeBSD în curând

🎁 Prima lună GRATUITĂ pentru primii 10 clienți
Cod promoțional: TRUECLOUD10

👉 www.truecloud.ro
Afișează semnătura
Avatar utilizator
Xim
Nou Venit

Nou Venit
Mesaje: 14
Membru din: 06 Sep 2016, 23:56
Regat: Shinsoo
Aprecieri: 1  
Mulţumiri: 3  
Medalii

Inlocuieste acest timer when bugcheck.timer begin
cu
when bugcheck.timer begin
            if pc.is_dead() or pc.getqf("petruf") == 0 then
                pet_system.removebonus(pc.getqf('petlevel'))
            end
        end
Si vezi ce fel se manifesta
Avatar utilizator
AndreyBăă
Nivel 1

Nivel 1
Mesaje: 104
Membru din: 04 Iun 2016, 11:43
Regat: Jinno
Aprecieri: 51  
Mulţumiri: 1  
 Contact:
Medalii

Daca ai sistemul original de la happiness , modifici bons din item_proto navicat si itemdesc , daca ai alt sistem atunci depinde ceea ai modificat , pentru ca si eu am server file happines si eu pot modifica bons + ca nu am bugul cand ma teleportez .
Avatar utilizator
jwdok
Nivel 2

Nivel 2
Mesaje: 238
Membru din: 20 Aug 2014, 22:53
Server: www.Metin2Avatar.com
Regat: Chunjo
Aprecieri: 11  
Mulţumiri: 37  
Medalii

Salut,sa rezolvat prob ....era din quest
Sistem este pt game 28k-34k nu are tabel navicat nu are legatura cu item_proto..
Pet ia bns in functie de lev din quest
Avatar utilizator
Pongo A.K.A Titan
Utilizator interzis !

Utilizator interzis !
Mesaje: 2028
Membru din: 01 Sep 2016, 16:08
Regat: Jinno
Aprecieri: 35  
Mulţumiri: 261  
 Contact:
Medalii

Subiect Inactiv Arhivat !
 ! Mesaj de la: Pongo A.K.A Titan
Cand credeati ca am sa mor
M-am ridicat ca un invingator
Afișează semnătura
Închis
Răspunsuri
0
Vizualizări
105
Răspunsuri
2
Vizualizări
262
Răspunsuri
4
Vizualizări
6137
Răspunsuri
2
Vizualizări
432

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

  • Informaţie