Kod:
quest polyplayer begin state start begin when 70011.use begin if pc.is_fighting() or pc.is_pvp() then syschat("Savaş halindeyken bu şişeyi kullanamazsın.") return end say_title("Büyü Şişesi:") say("Büyülemek istediğiniz oyuncunun adını yazınız:") local name = input() local vid = find_pc_by_name(name) if name == "" then return elseif name == pc.get_name() then say_title("Büyü Şişesi:") say("Kendini büyüleyemezsin!") return elseif vid == 0 then say_title("Büyü Şişesi:") say("Bu oyuncu çevrimiçi değil veya mevcut değil.") return elseif not pc.is_near_vid(vid, 50) then say_title("Büyü Şişesi:") say("Büyülemek istediğin oyuncunun yanına gitmelisin.") return end local myvid = pc.select(vid) local target_is_fighting = pc.is_fighting() local target_is_pvp = pc.is_pvp() local target_is_dead = pc.is_dead() local victim_name = pc.get_name() if target_is_fighting or target_is_pvp or target_is_dead then pc.select(myvid) say_title("Büyü Şişesi:") say("Hedef oyuncu şu an savaşta veya meşgul.") return end local vnums = {2101, 20016, 20002, 11000, 5001, 992, 1301, 1303, 2191, 5161, 5162, 5163} local random_mob = vnums[number(1, table.getn(vnums))] pc.polymorph(random_mob, 300) syschat("Bir büyü şişesiyle dönüştürüldün!") pc.select(myvid) say_title("Büyü Şişesi:") say("Oyuncu " .. victim_name .. " 5 dakikalığına büyülendi.") item.remove() end end end
Eski Questleri Canlandırma I Büyü Questi
Metin2 oyununda özellikle eski dönemlerden kalma bazı questler, oyuncuların nostaljik hissetmesine neden olmaktadır. Bu yazıda, 'Büyü Questi' olarak bilinen ve zamanla unutulmuş olan eski quest sistemlerinden birini canlandırmaya çalışacağız. Metin2 quest sistemine aşina olmayanlar için kısaca hatırlatmak gerekirse, questler, oyunculara görevler veren, ilerleme ve ödüller sunan yapılandırılmış sistemlerdir.
Büyü Questi Nedir?
Büyü Questi, Metin2'de büyücü sınıfının seviye atlaması için gereken temel görevlerden biridir. Özellikle eski sunucularda bu quest oldukça popülerdi. Oyuncuların belirli NPC'lerden görev alması, belirli düşmanları yenmesi, eşyalar toplaması gibi adımlar içerir. Ancak zamanla bazı sunucular bu questleri silmiş ya da değiştirmiş olabilir. İşte bizim amacımız, bu.questin orijinal yapısını koruyarak, güncel sistemlere entegre edilebilir hale getirmek.
Questin Yapısı ve Adımları
Bir Metin2 quest dosyası genellikle Lua dilinde yazılmaktadır. Quest sistemleri, Lua scriptleri ile yönetilir. Bu questte aşağıdaki adımlar izlenmelidir:
- NPC ile konuşma: Oyuncu, belirli bir NPC ile konuşarak questi başlatır.
- Mob öldürme: Belirlenen sayıda düşmanı öldürmek.
- Eşya toplama: Öldürülen düşmanlardan belirli itemlerin düşmesi sağlanır.
- Geri dönüp teslim etme: Toplanan eşyalar NPC'ye teslim edilir ve ödül alınır.
Quest Script Yazımı
Metin2 quest yazımı için Lua dili bilgisi şarttır. Quest scriptlerinde genellikle aşağıdaki yapı kullanılır:
Kod:
[COLOR=#0000cc]quest büyü_quest begin[BR][/BR] state start begin[BR][/BR] when login with pc.level >= 25 begin[BR][/BR] say('Merhaba, senin gibi güçlü bir büyücüye ihtiyacım var.')end[BR][/BR] when 101_click begin[BR][/BR] set_state(info)end[BR][/BR] end[BR][/BR][BR][/BR] state info begin[BR][/BR] when letter begin[BR][/BR] say_title('Büyü Questi')[BR][/BR] say('30 adet Zombie öldür ve bana 10 adet Kan Taşı getir.')[BR][/BR] set_state(working)end[BR][/BR] end[BR][/BR][BR][/BR] state working begin[BR][/BR] when kill with npc.job == 20 begin[BR][/BR] local count = q.getf('kill_count') + 1[BR][/BR] q.setf('kill_count', count)[BR][/BR] if count >= 30 then[BR][/BR] chat('Zombie öldürme görevini tamamladın!')end[BR][/BR] end[BR][/BR] when item.use begin -- Kan taşı kontrolü[BR][/BR] if item.count >= 10 then[BR][/BR] q.setf('item_done', 1)[BR][/BR] chat('Tüm eşyaları topladın, geri dön!')end[BR][/BR] end[BR][/BR] end[BR][/BR][BR][/BR] state complete begin[BR][/BR] when 101_click begin[BR][/BR] say('Tebrikler! Yeni bir büyücüsün artık!')[BR][/BR] pc.give_item2('gold', 500000)[BR][/BR] clear_letter()end[BR][/BR] end[BR][/BR]end[/COLOR]
Hata Ayıklama ve Debug
Lua quest yazarken hatalar kaçınılmazdır. Özellikle syntax hataları veya flag sistemlerinde sorunlar çıkabilir. Metin2 sunucularında quest debug işlemleri için log kayıtları önemlidir. Sunucu konsolundan alınan loglar yardımıyla questin nerede hata verdiğini tespit edebilirsiniz. Ayrıca questin doğru çalışması için, triggerlar ve state geçişleri dikkatle yapılmalıdır.
Sonuç
Eski Metin2 questlerini canlandırmak hem nostalji hem de oyuncular için yeni bir deneyim sunabilir. Özellikle 'Büyü Questi' gibi temel sınıflar için tasarlanmış görevler, sunucuya farklı bir atmosfer katacaktır. Lua bilgisiyle birlikte, Metin2 quest sistematiğini öğrenmek isteyenler için bu örnek oldukça faydalı olacaktır. Daha fazla quest örneği ve script paylaşımı için Metin2Lobby sitemizi takip etmeyi unutmayın!
Reviving Old Quests I The Magic Quest
In the game Metin2, certain old quests evoke nostalgic feelings among players. In this article, we will attempt to revive one such forgotten quest from earlier times known as 'The Magic Quest'. For those unfamiliar with the Metin2 quest system, quests are structured systems that give players missions, progression, and rewards.
What is the Magic Quest?
The Magic Quest is one of the basic missions required for the shaman class to level up in Metin2. This quest was particularly popular on older servers. It involves players receiving tasks from specific NPCs, defeating certain monsters, collecting items, etc. However, over time some servers may have removed or modified these quests. Our goal here is to preserve the original structure of this quest while making it compatible with modern systems.
Structure and Steps of the Quest
A Metin2 quest file is usually written in the Lua language. The quest system is managed through Lua scripts. The following steps should be followed in this quest:
- Speak with an NPC: The player starts the quest by speaking with a designated NPC.
- Kill Mobs: Defeat a specified number of enemies.
- Collect Items: Certain items must drop from defeated enemies.
- Return and Deliver: Collected items are handed back to the NPC to receive a reward.
Writing the Quest Script
Knowledge of the Lua language is essential for writing Metin2 quests. The following structure is commonly used in quest scripts:
Kod:
[COLOR=#0000cc]quest magic_quest begin[BR][/BR] state start begin[BR][/BR] when login with pc.level >= 25 begin[BR][/BR] say('Hello, I need someone strong like you, a shaman.')end[BR][/BR] when 101_click begin[BR][/BR] set_state(info)end[BR][/BR] end[BR][/BR][BR][/BR] state info begin[BR][/BR] when letter begin[BR][/BR] say_title('Magic Quest')[BR][/BR] say('Defeat 30 Zombies and bring me 10 Blood Stones.')[BR][/BR] set_state(working)end[BR][/BR] end[BR][/BR][BR][/BR] state working begin[BR][/BR] when kill with npc.job == 20 begin[BR][/BR] local count = q.getf('kill_count') + 1[BR][/BR] q.setf('kill_count', count)[BR][/BR] if count >= 30 then[BR][/BR] chat('You have completed the zombie kill task!')end[BR][/BR] end[BR][/BR] when item.use begin -- Check for blood stones[BR][/BR] if item.count >= 10 then[BR][/BR] q.setf('item_done', 1)[BR][/BR] chat('You have collected all items, return now!')end[BR][/BR] end[BR][/BR] end[BR][/BR][BR][/BR] state complete begin[BR][/BR] when 101_click begin[BR][/BR] say('Congratulations! You are now a true shaman!')[BR][/BR] pc.give_item2('gold', 500000)[BR][/BR] clear_letter()end[BR][/BR] end[BR][/BR]end[/COLOR]
Debugging and Error Handling
When writing Lua quests, errors are inevitable. Syntax errors or issues with flag systems may occur. Server logs are crucial for debugging quests in Metin2. By checking console logs, you can identify where the quest fails. Additionally, triggers and state transitions must be carefully implemented for the quest to function correctly.
Conclusion
Reviving old Metin2 quests can offer both nostalgia and a fresh experience for players. Tasks like 'The Magic Quest' for core classes can add a unique atmosphere to the server. This example will be very helpful for those looking to learn the Metin2 quest system with Lua knowledge. For more quest examples and script sharing, don't forget to follow our site Metin2Lobby!
