Sandık ile pet süresi ayarlama item protoyla uğraşmaya gerek yok

  • Konbuyu başlatan Konbuyu başlatan Admin
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 0
  • Görüntüleme Görüntüleme 222

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
NAVİCAT VE PACK DAKİ İTEM PROTOYLA UĞRAŞMADAN QUEST İLE PET SÜRESİ AYARLIYACAĞIZ

BUNU İÇİN BİZE QUESTİN İŞLEMESİ İÇİN TYPE DEĞERİ 18 OLAN BİR SANDIK LAZIM

Kod:
quest pet_shop_box begin       state start begin         when 38057.use begin             local n = number (1,100)             if n <= 99 then                 local remain_time = 1296000                 pc.give_item2_select(53008,1)                 item.set_socket(0, get_global_time()+remain_time)             end             pc.remove_item(38057,1)         end     end end


quest pet_shop_box begin

state start begin
when 38057.use begin >>>>>> 38057 sandık kodu
local n = number (1,100)
if n <= 99 then
local remain_time = 1296000 >>>>>> petin süresi saniye cinsinden yazıyoruz şuan 15 günlük
pc.give_item2_select(53008,1) >>>>> pet kodu 1 adeti ellemiyoruz
item.set_socket(0, get_global_time()+remain_time) >>> ellemiyoruz
end
pc.remove_item(38057,1) >>>>>> 38057 tekrar sandık kodu 1 i ellemiyoruz
end


end
end

hazır quest


virüs total



YAVRUCUK KUTUSU GİBİ 1 DEN FAZLA PET KOYMAK İSTEYENLER İÇİN

Kod:
quest pet_shop_box begin     state start begin            function give_pet_item(pet_vnum)                    local remain_time = 86400   --pet süresi saniye cinsinden             pc.give_item2_select(pet_vnum,1)             item.set_socket(0, get_global_time()+remain_time)         end         when 38057.use begin             local n = number (1,100)             if n <= 11 then                 pet_shop_box.give_pet_item(53005)  --53005 pet kodu             elseif n <= 22 then                 pet_shop_box.give_pet_item(53006)  --53006 pet kodu             elseif n <= 33 then                 pet_shop_box.give_pet_item(53007)             elseif n <= 40 then                 pet_shop_box.give_pet_item(53008)             elseif n <= 48 then                 pet_shop_box.give_pet_item(53009)             elseif n <= 56 then                 pet_shop_box.give_pet_item(53010)             elseif n <= 61 then                 pet_shop_box.give_pet_item(53011)             elseif n <= 67 then                 pet_shop_box.give_pet_item(53012)             elseif n <= 73 then                 pet_shop_box.give_pet_item(53013)             elseif n <= 79 then                 pet_shop_box.give_pet_item(53014)             elseif n <= 85 then                 pet_shop_box.give_pet_item(53015)             elseif n <= 89 then                 pet_shop_box.give_pet_item(53016)             elseif n <= 93 then                 pet_shop_box.give_pet_item(53017)             elseif n <= 95 then                 pet_shop_box.give_pet_item(53018)             end                        pc.remove_item(38057,1)         end     end end

1 DEN FAZLA PET İÇİN HAZIR QUEST



VİRÜS TOTAL



kanıt video:

Sandık ile Pet Süresi Ayarlama: Item Proto Üzerine İşlem Yapmadan Nasıl Yapılır?

Metin2 sunucularında pet sistemleri, oyuncuların deneyimini zenginleştiren önemli unsurlardandır. Özellikle özel petler, hem görsellik hem de destek açısından değerlidir. Ancak bazı sunucularda pet süresi sınırlamaları olabilir ve bu süreler genellikle item protosu üzerinden ayarlanır. Bu işlem, quest sistemine entegre edildiğinde daha esnek ve kullanıcı dostu hale gelir. Bu makalede, sandık üzerinden pet süresi ayarlamayı, item proto üzerinde değişiklik yapmadan nasıl yapabileceğinizi detaylıca anlatacağız.

Pet Süresi Sistemi Nedir?
Metin2 oyununda pet’lerin kullanım süresi genellikle item bazında tanımlanır. Bu süre item_proto.txt dosyasında belirlenir. Ancak bu yöntem, sunucu yöneticisinin item protosuna müdahale etmesini gerektirir. Bu da hem güvenlik açısından riskli olabilir hem de dinamik olarak süreyi değiştirmeyi zorlaştırır.

Quest Sistemi ile Pet Süresi Yönetimi
Metin2’nin quest sistemi, Lua tabanlıdır ve oldukça esnektir. Quest yazarak, pet süresini kod üzerinden kontrol etmek mümkündür. Bu sayede item_proto dosyasına dokunmadan, pet süresi ayarlamak kolaylaşır.

Sandık Üzerinden Pet Süresi Ayarlamak
Oyuncuya bir sandık verildiğinde, bu sandığın içeriği quest ile tanımlanabilir. Örneğin, oyuncu sandığı açtığında, pet süresi script tarafından otomatik olarak eklenebilir. Bu işlem için Lua kodları kullanılır. Aşağıda örnek bir quest yapısı verilmiştir:

function pet_sure_ekle() local pet = pc.get_pet() if pet.is_mount() then pet.set_expire_date(7 * 24 * 3600) -- 7 gün süre ekle end end

Neden Item Proto Üzerine İşlem Yapmamalıyız?
Item_proto dosyasına müdahale etmek, server dosyalarında kalıcı değişiklikler yapmayı gerektirir. Bu da hata yapma riskini artırır. Ayrıca canlı sunucularda item protosu değişikliği, restart gerektirebilir. Quest üzerinden pet süresi ayarlamak ise, dinamik ve kontrollü bir yöntemdir. Oyuncu isteğine göre veya event bazlı süreyi ayarlamak mümkündür.

Sandık Sistemini Geliştirmek
Sandık sisteminde farklı ödüller verilebilir. Örneğin, pet süresi dışında exp, item veya para gibi ödüller de eklenebilir. Bu sayede oyuncu deneyimi artırılır. Quest dosyası içinde if-else yapıları kullanarak, rastgele ödüller de verilebilir.

Özetle
Metin2 sunucularında pet süresi ayarlamak için item_proto üzerinde değişiklik yapmaya gerek yoktur. Quest sistemini kullanarak, sandık üzerinden pet süresi ayarlamak hem daha güvenli hem de esnek bir yöntemdir. Lua scriptleri ile kod tabanlı yönetim sağlarsınız. Bu yöntem, Metin2 geliştiricileri için ideal bir çözümdür.


Setting Pet Duration via Chest: No Need to Work with Item Proto

Metin2 servers feature pet systems that enrich the player experience. Especially special pets are valuable both visually and for support. However, some servers may have pet duration limitations, which are typically set through item protos. Integrating this into the quest system makes it more flexible and user-friendly. In this article, we will explain how to set pet duration via chest without modifying item proto.

What is the Pet Duration System?
In Metin2, the usage time of pets is usually defined by items. This duration is set in the item_proto.txt file. However, this method requires the server admin to modify the item proto, which can be risky in terms of security and makes dynamically changing durations harder.

Managing Pet Duration via Quest System
Metin2's quest system is Lua-based and highly flexible. By writing quests, you can control pet duration via code. This allows setting pet duration easily without touching the item_proto file.

Setting Pet Duration via Chest
When a player receives a chest, its contents can be defined via quest. For example, when the player opens the chest, the pet duration can be automatically added by the script. Lua codes are used for this. Below is an example quest structure:

function pet_sure_ekle() local pet = pc.get_pet() if pet.is_mount() then pet.set_expire_date(7 * 24 * 3600) -- Add 7 days end end

Why Should We Not Modify the Item Proto?
Modifying the item_proto file requires making permanent changes to server files, increasing the risk of errors. Also, changing the item proto on live servers might require a restart. Adjusting pet duration via quest is a dynamic and controlled approach. You can set durations based on player actions or events.

Enhancing the Chest System
Different rewards can be given within the chest system. For instance, in addition to pet duration, rewards like exp, items, or gold can be added. This enhances the player experience. By using if-else structures in the quest file, random rewards can also be distributed.

In Summary
There is no need to modify item_proto to set pet duration on Metin2 servers. Using the quest system to set pet duration via chest is both safer and more flexible. Managing via Lua scripts ensures code-based control. This method is ideal for Metin2 developers.
 

Şuan Bu Konuyu Görüntüleyen Kullanıcılar (Toplam : 0, Üye : 0, Misafir : 0)

Benzer konular

Geri
Üst Alt