[QUEST] İksir Yüzüğü Sistemi

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Merhaba Arkadaşlar,

Bir gece ansızın aklıma esip kodladığım bir sistemdir emek serverler için güzel bir sistem olduğu kanaatindeyim :)

1.Aşama:


Kod:
quest pot_ring3 begin     state start begin         when 70058.use begin         say_title("İksir Yüzüğü ")         say("Ne almak istiyorsun?")     local s = select("Kırmızı Pot ","Mavi Pot ","Mor ve Yeşil Pot ","Kritik-Delici İsabet ","Ejderha Tanrıları ","Kapat ")         if s == 1 then         say_title("İksir Yüzüğü - Kırmızı Pot ")     local ss = select("Güneş Özütü (B) (100 K) ","Vazgeç ")         if ss == 1 then             if pc.get_gold() < 100000 then                 syschat(string.format("Yeterli Yang Yok. Gereken Yang : %s(K)",100))                 return             end             pc.give_item2("72725",1)             pc.change_gold(-100000)             syschat("Hesabından "..item_name(72725).." için 100.000 Yang Alındı. ")         end     elseif s == 2 then         say_title("İksir Yüzüğü - Mavi Pot ")     local sss = select("Ay Özütü (B) (100 K) ","Vazgeç ")     if sss == 1 then         if pc.get_gold() < 100000 then             syschat(string.format("Yeterli Yang Yok. Gereken Yang : %s(K)",100))             return         end         pc.give_item2("72729",1)         pc.change_gold(-100000)         syschat("Hesabından "..item_name(72729).." için 100.000 Yang Alındı. ")     end     elseif s == 3 then         say_title("İksir Yüzüğü - Mor ve Yeşil Pot ")     local ummeh = select("Mor ve Yeşil Pot x200 (400 K) ","Mor Pot x200 (200 K) ","Yeşil Pot x200 (200 K) ","Vazgeç ")     if ummeh == 1 then         if pc.get_gold() < 400000 then             syschat(string.format("Yeterli Yang Yok. Gereken Yang : %s(K)",400))             return         end         pc.give_item2("27102",200)         pc.give_item2("27105",200)         pc.change_gold(-400000)         syschat("Hesabından Mor ve Yeşil Pot için 400.000 Yang Alındı. ")     elseif ummeh == 2 then         if pc.get_gold() < 200000 then             syschat(string.format("Yeterli Yang Yok. Gereken Yang : %s(K)",200))             return         end         pc.give_item2("27105",200)         pc.change_gold(-200000)         syschat("Hesabından "..item_name(27105).." için 200.000 Yang Alındı. ")     elseif ummeh == 3 then         if pc.get_gold() < 200000 then             syschat(string.format("Yeterli Yang Yok. Gereken Yang : %s(K)",200))             return         end         pc.give_item2("27102",200)         pc.change_gold(-200000)         syschat("Hesabından "..item_name(27102).." için 200.000 Yang Alındı. ")     end     elseif s == 4 then         say_title("İksir Yüzüğü - Kritik ve Delici İsabet ")     local trkmmo = select("Kritik-Delici x50 (250 K) ","Kritik İsabet x50 (125 K) ","Delici İsabet x50 (125 K) ","Vazgeç ")     if trkmmo == 1 then         if pc.get_gold() < 250000 then             syschat(string.format("Yeterli Yang Yok. Gereken Yang : %s(K)",250))             return         end         pc.give_item2("71044",50)         pc.give_item2("71045",50)         pc.change_gold(-250000)         syschat("Hesabından Kritik ve Delici İsabet için 250.000 Yang Alındı. ")     elseif trkmmo == 2 then         if pc.get_gold() < 125000 then             syschat(string.format("Yeterli Yang Yok. Gereken Yang : %s(K)",125))             return         end         pc.give_item2("71044",50)         pc.change_gold(-125000)         syschat("Hesabından "..item_name(71044).." için 125.000 Yang Alındı. ")     elseif trkmmo == 3 then         if pc.get_gold() < 125000 then             syschat(string.format("Yeterli Yang Yok. Gereken Yang : %s(K)",125))             return         end         pc.give_item2("71045",50)         pc.change_gold(-125000)         syschat("Hesabından "..item_name(71045).." için 125.000 Yang Alındı. ")     end     elseif s == 5 then         say_title("İksir Yüzüğü - Ejderha Tanrıları ")     local sssssss = select("Hepsi x50 (8 M)","Ejderha Tanrı Yaşamı (2 M) ","Ejderha Tanrı Saldırısı (2 M) ","Ejderha Tanrı Zekası (2 M) ","Ejderha Tanrı Savunması (2 M) ","Vazgeç ")     if sssssss == 1 then         if pc.get_gold() < 8000000 then             syschat(string.format("Yeterli Yang Yok. Gereken Yang : %s(M)",8))             return         end         pc.give_item2("71027",50)         pc.give_item2("71028",50)         pc.give_item2("71029",50)         pc.give_item2("71030",50)         pc.change_gold(-8000000)         syschat("Hesabından Ejderha Tanrıları için 8.000.000 Yang Alındı. ")     elseif sssssss == 2 then         if pc.get_gold() < 2000000 then             syschat(string.format("Yeterli Yang Yok. Gereken Yang : %s(M)",2))             return         end         pc.give_item2("71027",50)         pc.change_gold(-2000000)         syschat("Hesabından "..item_name(71027).." için 2.000.000 Yang Alındı. ")     elseif sssssss == 3 then         if pc.get_gold() < 2000000 then             syschat(string.format("Yeterli Yang Yok. Gereken Yang : %s(M)",2))             return         end         pc.give_item2("71028",50)         pc.change_gold(-2000000)         syschat("Hesabından "..item_name(71028).." için 2.000.000 Yang Alındı. ")     elseif sssssss == 4 then         if pc.get_gold() < 2000000 then             syschat(string.format("Yeterli Yang Yok. Gereken Yang : %s(M)",2))             return         end         pc.give_item2("71029",50)         pc.change_gold(-2000000)         syschat("Hesabından "..item_name(71029).." için 2.000.000 Yang Alındı. ")     elseif sssssss == 5 then         if pc.get_gold() < 2000000 then             syschat(string.format("Yeterli Yang Yok. Gereken Yang : %s(M)",2))             return         end         pc.give_item2("71030",50)         pc.change_gold(-2000000)         syschat("Hesabından "..item_name(71030).." için 2.000.000 Yang Alındı. ")         end     elseif s == 9 then     end                 end             end         end




Bu kodu bir txt dosyasına kaydedip ismini istediğiniz gibi (Örneğin: pot_ring3.quest) yapabilirsiniz.
Ardından Filezilladan

Kod:
usr/game/share/locale/turkey/quest
dizinine atıyoruz.

2.Aşama:

Son olarak Putty login olup sırasıyla aşağıdakileri yazıyoruz;

Kod:
cd /usr/game/share/locale/turkey/quest ./qc pot_ring3.quest

ardından oyunda reload q veya reboot atarak test edebilirsiniz.




Questten Görüntü;

nOAPbR.jpg


Bir teşekkür yeterli :)
Metin2 Lobby olarak, Metin2 oyununda quest sistemleri ile ilgili en detaylı ve özgün içerikleri sizlere sunmaya devam ediyoruz. Bu yazıda, özellikle İksir Yüzüğü adlı özel bir ödüllendirme sisteminin nasıl quest üzerinden çalıştığını ve bu sistemin lua scriptleriyle nasıl entegre edildiğini inceleyeceğiz.

İksir Yüzüğü Nedir?
Metin2 oyununda bazı özel ödüller, oyuncuların belirli görevleri tamamlamasıyla elde edilebilir. İksir Yüzüğü, oyuncuların belirli quest kriterlerini tamamlaması durumunda alabileceği özel bir aksesuardır. Bu yüzük, genellikle potion kullanımını destekleyen bir özelliktir ve quest tamamlandığında reward olarak verilir.

Quest Sisteminin Temeli
Metin2 oyununda quest sistemi, lua dilinde yazılmış komutlarla çalışır. Quest dosyaları, sunucu tarafında client ile etkileşim kurarak trigger, flag, state gibi yapılarla çalışır. İksir Yüzüğü gibi özel ögelerin verilmesi için bir quest yazısı hazırlanır. Bu yazı, quest begin ile başlar ve quest end ile biter. Bu süreçte, oyuncunun belirli mobları öldürmesi, npc ile konuşması veya belirli bir konuma gitmesi gibi eylemler istenebilir.

Lua Script Yapısı ve Quest Dosyası Oluşturma
Metin2’de bir quest oluşturmak için, lua dili bilgisi gereklidir. Quest dosyaları genellikle quest_list.lua dosyasında tanımlanır. Örneğin, iksir_yuzugu_quest adında bir görev tanımlanabilir. Bu görev, begin ve end blokları arasında yazılır. İçerisinde when blokları, say fonksiyonları, getitem komutları gibi Lua komutları kullanılır. Örnek bir quest yapısı şu şekilde olabilir:

quest iksir_yuzugu_quest begin
state start begin
when login or enter begin
say('Merhaba, benimle konuşarak özel bir görevi tamamlayabilirsin!')
end
end
quest iksir_yuzugu_quest end

Quest Trigger ve Flag Kullanımı
Metin2’de bir quest başlatıldığında, bu görevin durumu flag adı verilen değişkenlerle takip edilir. Örneğin, player.setqf('iksir_yuzugu_flag', 1) komutu ile oyuncuya özel bir bayrak atanabilir. Bu sayede, oyuncu aynı görevi birden fazla kez başlatamaz veya tekrar ödül alamaz. Ayrıca, trigger yapıları sayesinde belirli zamanlarda veya belirli eylemlerde quest aktif hale gelebilir. Bu sistem, daily quest gibi görevler için de kullanılabilir.

Reward ve Item Verme
Quest tamamlandığında, oyuncuya ödül vermek için getitem fonksiyonu kullanılır. İksir Yüzüğü gibi özel eşyalar, quest reward olarak tanımlanabilir. Bu işlem sırasında item vnum bilgisi doğru girilmelidir ki oyuncu doğru eşyayı alsın. Örneğin, getitem(71039, 1) komutu ile vnum değeri 71039 olan İksir Yüzüğü verilebilir.

Hata Ayıklama ve Debug İşlemi
Metin2 quest geliştirme sürecinde, hatalar meydana gelebilir. Quest scriptinde eksik ya da hatalı kodlar, sunucuda quest sisteminin doğru çalışmamasına neden olur. Bu durumlarda debug işlemleri yapılmalıdır. Sunucu logları incelenerek hata mesajları bulunabilir. Martysama gibi geliştirici araçları da quest debug için kullanılabilir. Hatalar düzeltilerek quest sistemi tekrar aktif hale getirilir.

Gelişmiş Quest Özellikleri
Metin2’de custom quest yazımı, sunucuların kendine özgü içerikler üretmesini sağlar. Quest chain yapıları ile bir görevden diğerine otomatik geçiş sağlanabilir. Timer sistemleriyle belirli görevler sınırlı süreyle sunulabilir. Npc ve mob sistemleri ile etkileşimli görevler oluşturulabilir. Bu tür gelişmiş sistemler, Metin2Dev gibi platformlarda örneklerle paylaşılmaktadır.

Sonuç
Metin2 oyununda quest sistemleri, oyuncuların daha fazla etkileşim kurmasını ve oyun süresini uzatmasını sağlar. İksir Yüzüğü gibi özel ödüllerin verildiği görevler, bu sistemin harika örneklerindendir. Doğru lua komutları ve quest yapıları ile bu tür içerikler kolayca geliştirilebilir. Metin2 Lobby olarak, quest geliştirme konusunda daha fazla bilgiye ulaşmak için sitemizi ziyaret edin.


Metin2 Lobby continues to provide you with the most detailed and original content about quest systems in Metin2. In this article, we will examine how the special reward system called the Potion Ring works through a quest and how it integrates with lua scripts.

What is the Potion Ring?
In Metin2, some special rewards can be obtained by completing certain quests. The Potion Ring is a special accessory that players can receive upon completing a specific quest. This ring typically supports potion usage and is given as a reward after the quest is completed.

Foundation of the Quest System
The quest system in Metin2 operates with commands written in lua. Quest files interact with the client on the server side using structures such as trigger, flag, and state. To award special items like the Potion Ring, a quest script is created. This script begins with quest begin and ends with quest end. During this process, players may be asked to kill certain mobs, speak to NPCs, or go to specific locations.

Lua Script Structure and Creating Quest Files
To create a quest in Metin2, knowledge of the lua language is required. Quest files are generally defined in the quest_list.lua file. For example, a quest named potion_ring_quest could be defined. This quest starts with the begin block and ends with end. Within it, when blocks, say functions, getitem commands, and other Lua commands are used. An example structure might look like this:

quest potion_ring_quest begin
state start begin
when login or enter begin
say('Hello, talk to me to complete a special quest!')
end
end
quest potion_ring_quest end

Using Quest Triggers and Flags
When a quest is started in Metin2, its status is tracked using variables called flags. For example, the command player.setqf('potion_ring_flag', 1) assigns a player-specific flag. This prevents the same player from starting the same quest multiple times or receiving the reward again. Additionally, trigger structures allow quests to become active at specific times or under certain conditions. This system can also be used for daily quests.

Reward and Item Distribution
Upon completing a quest, rewards are given using the getitem function. Special items like the Potion Ring can be defined as quest rewards. During this process, the correct item vnum must be entered so the player receives the right item. For example, the command getitem(71039, 1) gives the Potion Ring which has a vnum of 71039.

Error Debugging and Troubleshooting
During the development of Metin2 quests, errors may occur. Missing or incorrect code in the quest script can cause the system to malfunction. In such cases, debugging must be performed. Error messages can be found by examining server logs. Developer tools like Martysama can also be used for quest debugging. After fixing errors, the quest system can be reactivated.

Advanced Quest Features
Writing custom quests in Metin2 allows servers to create unique content. With quest chains, players can automatically move from one quest to another. Timer systems can limit quests to specific durations. Interactive quests can be created using NPC and mob systems. Such advanced systems are shared with examples on platforms like Metin2Dev.

Conclusion
The quest systems in Metin2 increase player engagement and extend gameplay. Quests like the Potion Ring, which offer special rewards, are great examples of this system. With proper lua commands and quest structures, such content can easily be developed. Visit our site Metin2 Lobby to find more information on quest development.
 

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

Benzer konular

Geri
Üst Alt