Merhaba,
Vereceğim bu quest ile oyuncunun oyun dakikasını baz alarak ona EP vereceğiz.
Buyrun quest.
43200 12 saati, 172800 48 saati, 604800 de 7 günün saniye cinsinden karşılıklarıdır.
saatleri değiştirerek questi kendinize göre ayarlayabilirsiniz.
verilecek EP'leri de mysql_query kısmındaki coins kısmından ayarlayabilirsiniz.
Oyuncunun Online Olduğu Süreye Bağlı Olarak EP Verme Quest Sistemi
Metin2 sunucularında oyuncuların aktif kalmasını teşvik etmek için farklı yöntemler kullanılır. Bunlardan birisi de oyuncunun belirli bir süre online kalması durumunda ödül veren quest sistemleridir. Bu yazıda, oyuncunun online olduğu süreye bağlı olarak EP (Experience Point) veren quest'in nasıl yazıldığını ve hangi Lua komutlarının kullanıldığını inceleyeceğiz.
Quest Nedir?
Metin2'de quest sistemleri, oyunculara görevler vererek onları oyun içinde yönlendiren ve ödüllerle motive eden yapılardır. Questler, Lua dili kullanılarak yazılmaktadır ve sunucu tarafında çalıştırılır. Bu sistem, hem oyuncuların oyun içi aktivitelerini artırır hem de sunucunun daha canlı kalmasına yardımcı olur.
Online Süresine Göre EP Veren Quest Nasıl Yazılır?
Bu tür bir quest oluşturmak için öncelikle oyuncunun online kalma süresini takip eden bir sayaç yapısı kurulmalıdır. Questin temel mantığı şu şekildedir:
- Oyuncu giriş yaptığında quest başlatılır.
- Her dakikada bir sayaç artar.
- Belirlenen süre (örneğin 60 dakika) dolduğunda EP ödülü verilir ve sayaç sıfırlanır.
Temel Quest Yapısı
Aşağıda, oyuncunun 60 dakika online kalması durumunda 1000 EP kazandığı basit bir quest örneği verilmiştir:
Questin Özellikleri
- Timer Kullanımı: Quest, her dakikada bir sayaçla kontrol edilir.
- Otomatik Yenileme: Ödül verildikten sonra sayaç sıfırlanır ve tekrar başlatılır.
- Genel Bildirim: Oyuncuya ödül verildiğinde tüm oyunculara bildirim gönderilir.
Hata Ayıklama ve Test
Quest sistemi test edilirken aşağıdaki durumlar göz önünde bulundurulmalıdır:
- Questin başlatılması için oyuncunun doğru şekilde tanımlanmış olması gerekir.
- Timer fonksiyonunun doğru çalışıp çalışmadığı kontrol edilmelidir.
- EP miktarının doğruluğu ve sunucudaki etkileri gözlemlenmelidir.
Sonuç
Oyuncuların aktif kalmasını sağlamak için online süresine göre EP veren quest sistemleri oldukça etkili bir yöntemdir. Doğru tasarlandığında oyuncuların oyun süresini uzatmalarına yardımcı olabilir. Metin2 quest geliştirme konusunda deneyim kazanmak isteyen geliştiriciler için bu örnek iyi bir başlangıç noktası olabilir.
Giving EP Based on Player's Online Time in Quest System
In Metin2 servers, various methods are used to encourage players to stay active. One of these methods is quests that reward players after being online for a certain amount of time. In this article, we will examine how to write such a quest and which Lua commands are used to award Experience Points (EP) based on the player's online duration.
What is a Quest?
In Metin2, quest systems provide missions to players, guide them within the game, and motivate them with rewards. These quests are written in Lua and run server-side. This system not only increases player activity but also helps keep the server more vibrant.
How to Create a Quest That Awards EP Based on Online Duration?
To create such a quest, first, a timer mechanism must be established to track the player's online time. The basic logic of the quest is as follows:
- The quest starts when the player logs in.
- The timer increases every minute.
- When the defined time (e.g., 60 minutes) passes, EP rewards are given and the timer resets.
Basic Quest Structure
Below is a simple example of a quest where a player receives 100,000 EP after staying online for 60 minutes:
Features of the Quest
- Timer Usage: The quest checks every minute via a timer.
- Automatic Reset: After the reward is given, the timer resets and restarts.
- Global Notice: When a reward is granted, all players receive a notification.
Debugging and Testing
When testing the quest system, the following should be considered:
- The player must be correctly identified for the quest to start.
- Verify whether the timer function operates correctly.
- Observe if the EP amount is correct and its effect on the server.
Conclusion
Quests that award EP based on online duration are highly effective in encouraging players to stay active. If designed properly, they can help increase playtime. For developers looking to gain experience in Metin2 quest development, this example serves as a good starting point.
Vereceğim bu quest ile oyuncunun oyun dakikasını baz alarak ona EP vereceğiz.
Buyrun quest.
Kod:
quest epver begin state start begin when login begin if pc.get_playtime() > 43200 then if pc.getqf("zamanakarsiepbir") == 0 then say_title(" Oyunumuzu 12 saatten fazla oynadın") say(" İşte ödülün! 5 EP") say_reward(" Hesabına 5 EP yüklendi.") mysql_query('UPDATE account.account SET coins = coins+5 WHERE id = \\"'..pc.get_account_id()..'\\"') pc.setqf("zamanakarsiepbir", 1) end elseif pc.get_playtime() > 172800 then if pc.getqf("zamanakarsiepiki") == 0 then say_title(" Oyunumuzu 48 saatten fazla oynadın") say(" İşte ödülün! 10 EP") say_reward(" Hesabına 10 EP yüklendi.") mysql_query('UPDATE account.account SET coins = coins+10 WHERE id =\\"'..pc.get_account_id()..'\\"') pc.setqf("zamanakarsiepiki", 1) end elseif pc.get_playtime() > 604800 then if pc.getqf("zamanakarsiepuc") == 0 then say_title(" Oyunumuzu 1 haftadan fazla oynadın") say(" İşte ödülün! 30 EP") say_reward(" Hesabına 30 EP yüklendi.") mysql_query('UPDATE account.account SET coins = coins+30 WHERE id = \\"'..pc.get_account_id()..'\\"') pc.setqf("zamanakarsiepuc", 1) end end end end end
saatleri değiştirerek questi kendinize göre ayarlayabilirsiniz.
verilecek EP'leri de mysql_query kısmındaki coins kısmından ayarlayabilirsiniz.
Oyuncunun Online Olduğu Süreye Bağlı Olarak EP Verme Quest Sistemi
Metin2 sunucularında oyuncuların aktif kalmasını teşvik etmek için farklı yöntemler kullanılır. Bunlardan birisi de oyuncunun belirli bir süre online kalması durumunda ödül veren quest sistemleridir. Bu yazıda, oyuncunun online olduğu süreye bağlı olarak EP (Experience Point) veren quest'in nasıl yazıldığını ve hangi Lua komutlarının kullanıldığını inceleyeceğiz.
Quest Nedir?
Metin2'de quest sistemleri, oyunculara görevler vererek onları oyun içinde yönlendiren ve ödüllerle motive eden yapılardır. Questler, Lua dili kullanılarak yazılmaktadır ve sunucu tarafında çalıştırılır. Bu sistem, hem oyuncuların oyun içi aktivitelerini artırır hem de sunucunun daha canlı kalmasına yardımcı olur.
Online Süresine Göre EP Veren Quest Nasıl Yazılır?
Bu tür bir quest oluşturmak için öncelikle oyuncunun online kalma süresini takip eden bir sayaç yapısı kurulmalıdır. Questin temel mantığı şu şekildedir:
- Oyuncu giriş yaptığında quest başlatılır.
- Her dakikada bir sayaç artar.
- Belirlenen süre (örneğin 60 dakika) dolduğunda EP ödülü verilir ve sayaç sıfırlanır.
Temel Quest Yapısı
Aşağıda, oyuncunun 60 dakika online kalması durumunda 1000 EP kazandığı basit bir quest örneği verilmiştir:
Kod:
quest online_time_reward begin[BR][/BR] state start begin[BR][/BR] when login begin[BR][/BR] say_title('Online Zaman Ödülü')[BR][/BR] say('Her 60 dakika online kalışta EP ödülü alacaksınız!')[BR][/BR] end[BR][/BR][BR][/BR] when timer >= 60*60 begin -- 60 dakika[BR][/BR] local player_name = pc.get_name()[BR][/BR] game.set_event_flag(player_name .. '_online_reward', 1)[BR][/BR] pc.give_exp2(100000) -- 100.000 EP verir[BR][/BR] notice_all('[EP Ödülü]: ' .. player_name .. ' 60 dakika online kalma ödülünü kazandı!')[BR][/BR] clear_timer()[BR][/BR] set_timer(60*60) -- Yeni sayaç başlat[BR][/BR] end[BR][/BR] end[BR][/BR]end
Questin Özellikleri
- Timer Kullanımı: Quest, her dakikada bir sayaçla kontrol edilir.
- Otomatik Yenileme: Ödül verildikten sonra sayaç sıfırlanır ve tekrar başlatılır.
- Genel Bildirim: Oyuncuya ödül verildiğinde tüm oyunculara bildirim gönderilir.
Hata Ayıklama ve Test
Quest sistemi test edilirken aşağıdaki durumlar göz önünde bulundurulmalıdır:
- Questin başlatılması için oyuncunun doğru şekilde tanımlanmış olması gerekir.
- Timer fonksiyonunun doğru çalışıp çalışmadığı kontrol edilmelidir.
- EP miktarının doğruluğu ve sunucudaki etkileri gözlemlenmelidir.
Sonuç
Oyuncuların aktif kalmasını sağlamak için online süresine göre EP veren quest sistemleri oldukça etkili bir yöntemdir. Doğru tasarlandığında oyuncuların oyun süresini uzatmalarına yardımcı olabilir. Metin2 quest geliştirme konusunda deneyim kazanmak isteyen geliştiriciler için bu örnek iyi bir başlangıç noktası olabilir.
Giving EP Based on Player's Online Time in Quest System
In Metin2 servers, various methods are used to encourage players to stay active. One of these methods is quests that reward players after being online for a certain amount of time. In this article, we will examine how to write such a quest and which Lua commands are used to award Experience Points (EP) based on the player's online duration.
What is a Quest?
In Metin2, quest systems provide missions to players, guide them within the game, and motivate them with rewards. These quests are written in Lua and run server-side. This system not only increases player activity but also helps keep the server more vibrant.
How to Create a Quest That Awards EP Based on Online Duration?
To create such a quest, first, a timer mechanism must be established to track the player's online time. The basic logic of the quest is as follows:
- The quest starts when the player logs in.
- The timer increases every minute.
- When the defined time (e.g., 60 minutes) passes, EP rewards are given and the timer resets.
Basic Quest Structure
Below is a simple example of a quest where a player receives 100,000 EP after staying online for 60 minutes:
Kod:
quest online_time_reward begin[BR][/BR] state start begin[BR][/BR] when login begin[BR][/BR] say_title('Online Time Reward')[BR][/BR] say('You will receive EP rewards every 60 minutes you stay online!')[BR][/BR] end[BR][/BR][BR][/BR] when timer >= 60*60 begin -- 60 minutes[BR][/BR] local player_name = pc.get_name()[BR][/BR] game.set_event_flag(player_name .. '_online_reward', 1)[BR][/BR] pc.give_exp2(100000) -- Gives 100,000 EP[BR][/BR] notice_all('[EP Reward]: ' .. player_name .. ' has earned the 60-minute online reward!')[BR][/BR] clear_timer()[BR][/BR] set_timer(60*60) -- Restart the timer[BR][/BR] end[BR][/BR] end[BR][/BR]end
Features of the Quest
- Timer Usage: The quest checks every minute via a timer.
- Automatic Reset: After the reward is given, the timer resets and restarts.
- Global Notice: When a reward is granted, all players receive a notification.
Debugging and Testing
When testing the quest system, the following should be considered:
- The player must be correctly identified for the quest to start.
- Verify whether the timer function operates correctly.
- Observe if the EP amount is correct and its effect on the server.
Conclusion
Quests that award EP based on online duration are highly effective in encouraging players to stay active. If designed properly, they can help increase playtime. For developers looking to gain experience in Metin2 quest development, this example serves as a good starting point.
