[İLK]Günlük Kontrol Fonksiyonu! Her queste uygulanabilir!

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Merhabalar,
Girilen değeri günlük olarak kontrol eden bir fonksiyon hazırladım.

Fonksiyon nerelerde kullanılabilir?
Günlük her girişte ödül verme, günlük görev yapma gibi yerlerde kullanılabilir.

Oyun içi görüntüler.
LOro9b.jpg

7yz8Ra.jpg

Kurulum:
questib.lua ya eklenir.
Kod:
function gunluk_kontrol(gelenveri) local gidecekveri = gelenveri local yil = os.date("%Y") local ay = os.date("%m") local gun = os.date("%d") if pc.getqf(""..gun..""..ay..""..yil..""..gidecekveri.."") == 0 then pc.setqf(""..gun..""..ay..""..yil..""..gidecekveri.."",1) return 0 else return 1 end end

quest_functions a eklenir.
Kod:
gunluk_kontrol

Örnek bir quest
Kod:
quest gunluk_odul_ver begin -- CsFraNq     state start begin         when login begin             send_letter("Günlük Ödül!")         end         when button or info begin             if gunluk_kontrol("gunluk_odul") == 0 then -- eğer bugün girmemiş ise                 say_title("Merhaba "..pc.get_name().."")                 say("Her gün girerek ödül kazanabilirsin!")                 say("Bugünki ödülünü veriyorum!")                 pc.give_item2("50513",1)                 else                 say_title("Merhaba "..pc.get_name().."")                 say("Bugün zaten ödülünü almışsın!")             end         end     end end
Fikir ve sorularınızı yazmaktan çekinmeyin. :)

Günlük Kontrol Fonksiyonu! Metin2 sunucularında quest sistemlerinin kalbinde yer alan bu fonksiyon sayesinde, oyuncuların günlük görevleri daha verimli yönetilebilir.
Quest sistemi, Metin2'nin en temel etkileşim mekanizmalarından biridir ve doğru şekilde tasarlandığında kullanıcı deneyimini ciddi anlamda artırabilir.
Bu yazıda, günlük kontrol fonksiyonunun nasıl her quest'e uygulanabileceğini detaylıca ele alacağız.

Daily Check Fonksiyonu Nedir?
Daily check fonksiyonu, oyuncunun belirli bir süreye göre (genellikle 24 saat) aynı quest'ten tekrar ödül almasını engeller.
Bu fonksiyon, Metin2 quest sistemlerinde genellikle Lua dilinde yazılır ve quest scriptlerine entegre edilir.
Bu sayede oyuncular her gün yeni görevler yaparak sunucuda aktif kalmaya teşvik edilir.

Neden Her Queste Uygulanabilmeli?
Metin2 sunucularında farklı quest türleri bulunur: daily quest, item toplama quest'leri, npc ile etkileşim quest'leri, özel event quest'leri gibi.
Tüm bu quest türlerine günlük kontrol fonksiyonunu uygulamak, sunucu dengesini korumak açısından oldukça faydalıdır.
Ayrıca bu, hileli kullanım oranlarını düşürür ve daha adil bir oyun ortamı sağlar.

Günlük Kontrol Fonksiyonunun Avantajları
- Oyuncuların her gün aktif olma eğilimini artırır.
- Sunucu içi ekonomi dengesini korur.
- Tekrarlayan quest'lerden kaynaklanan spamı önler.
- Günlük ödül sistemlerini daha organize hale getirir.

Daily Check Fonksiyonu Nasıl Yazılır?
Daily check fonksiyonu genellikle Lua tabanlıdır ve quest script dosyasında aşağıdaki gibi tanımlanabilir:
Kod:
[BR][/BR]when login or levelup or enter_game begin[BR][/BR]    local last_time = get_time() - pc.getqf('daily_quest_last_time')[BR][/BR]    if last_time > 86400 then -- 86400 saniye = 24 saat[BR][/BR]        pc.setqf('daily_quest_status', 0) -- quest durumu sıfırlanır[BR][/BR]    end[BR][/BR]end[BR][/BR]


Dikkat Edilmesi Gerekenler
Quest geliştirirken dikkat edilmesi gereken bazı önemli noktalar vardır.
Özellikle flag ve state sistemlerinin doğru kullanılması, quest'in sağlıklı çalışması için şarttır.
Ayrıca debug işlemleri sırasında hata ayıklama fonksiyonları sıkça kullanılmalıdır.
Quest scripti yazarken hatalar oluşabilir; bu nedenle test sunucusunda denemeler yapmak önemlidir.

Quest Chain Sistemine Entegrasyon
Daily check fonksiyonu, sadece bağımsız quest'lerde değil, quest chain (bağlı görev zinciri) yapılarında da kullanılabilir.
Bu sayede oyuncuların her gün yeni görevlere ulaşması sağlanır ve oyun içi hikaye akışı desteklenir.

Sonuç
Daily check fonksiyonu, Metin2 quest sistemlerinde güçlü bir araçtır.
Her quest'e uygulanabilen bu yapı sayesinde, hem oyuncu motivasyonu artırılır hem de sunucu yönetimi kolaylaşır.
Metin2 geliştiricileri için vazgeçilmez bir özelliktir.


Daily Check Function! Thanks to this function, which lies at the heart of quest systems on Metin2 servers, daily quests can be managed more efficiently.
The quest system is one of the core interaction mechanisms in Metin2, and when properly designed, it significantly enhances user experience.
In this article, we will examine in detail how the daily check function can be applied to every quest.

What Is the Daily Check Function?
The daily check function prevents players from receiving rewards repeatedly from the same quest within a specific timeframe, usually 24 hours.
This function is typically written in Lua and integrated into quest scripts in Metin2 quest systems.
This encourages players to remain active each day by completing new tasks.

Why Should It Be Applied to Every Quest?
Different types of quests exist in Metin2 servers: daily quests, item collection quests, NPC interaction quests, special event quests, etc.
Applying the daily check function to all these quest types is highly beneficial for maintaining server balance.
Additionally, it reduces fraudulent usage and ensures a fairer gameplay environment.

Benefits of the Daily Check Function
- Increases player activity each day.
- Maintains in-game economic balance.
- Prevents spam from repetitive quests.
- Organizes daily reward systems more effectively.

How to Write a Daily Check Function?
The daily check function is generally Lua-based and can be defined in a quest script file like the following:
Kod:
[BR][/BR]when login or levelup or enter_game begin[BR][/BR]    local last_time = get_time() - pc.getqf('daily_quest_last_time')[BR][/BR]    if last_time > 86400 then -- 86400 seconds = 24 hours[BR][/BR]        pc.setqf('daily_quest_status', 0) -- reset quest status[BR][/BR]    end[BR][/BR]end[BR][/BR]


Points to Consider
There are important points to consider when developing quests.
Especially, correctly using flag and state systems is crucial for quests to run smoothly.
Furthermore, debugging functions should be used frequently during debug processes.
Errors may occur while writing quest scripts; therefore, testing on a test server is essential.

Integration with Quest Chain Systems
The daily check function can be used not only in standalone quests but also in quest chains (linked quest sequences).
This allows players to access new tasks each day and supports the in-game story flow.

Conclusion
The daily check function is a powerful tool in Metin2 quest systems.
With this structure that can be applied to every quest, both player motivation increases and server management becomes easier.
It is an indispensable feature for Metin2 developers.
 

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

Benzer konular

Geri
Üst Alt