Ruh Taşı Bugu Engelleme..Ticaretten Kaldırmadan Bugu Engelliyoruz..(cedricstorm)

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Arkadaşlar bildiğiniz gibi serverlerinizde ruh taşı bugu var birçoğunda bunu engellemek için ruh taşı ticaretini kapatıyorsunuz..
Bu ticaretin yapılmaması bugu kullanmayan oyuncularınız için sorun olabilir çünkü ticaretini yapıp para kasmak isteyeceklerdir..
Buna bu sistemle son veriyoruz..Kendi serverimdeki sistemi size sunuyorum hiçbir şekilde alıntısı yoktur..


Kod:
say_title ( "Grand Master Beceri Egitimi" )  say ( "" )  if pc . get_skill_group ( ) == 0 then  say ( "Henüz çirak olarak baslamadin." )  say ( "" .. pc . get_skill_group ( ) )  return  end  if get_time ( ) < pc . getqf ( "next_time" ) then  if pc . is_skill_book_no_delay ( ) then  say_title ( "Grand Master Beceri Egitimi" )  say ( "" )  say ( "Kötü Ruhlari Kovma Kağıdını okuyarak, " )  say ( "Ara Vermeksizin İleri Derece Eğitime" )  say ( "Devam Edebilirsin." )  say ( "" )  wait ( )  say_title ( "Grand Master Beceri Egitimi" )  else  say ( "Egitim Yaptiktan Sonra Yarim Gün" )  say ( "Dinlenmelisin." )  return  end  end  local result = training_grandmaster_skill . BuildGrandMasterSkillList ( pc . get_job ( ) , pc . get_skill_group ( ) )  local vnum_list = result [ 1 ]  local name_list = result [ 2 ]  if table . getn ( vnum_list ) == 0 then  say ( "Grand Master Beceri Egitiminden " )  say ( "Henüz Beceri Ögrenemedin." )  return  end  say ( "Grand Master Beceri Egitimi." )  say ( "Lütfen Grand Master Beceri Egitiminden " )  say ( "Ögrenmek İstediginiz Beceriyi Seçin." )   local menu_list = { }  table . foreach ( name_list , function ( i , name ) table . insert ( menu_list , name ) end )  table . insert ( menu_list , "Kapat" )  local s = select_table ( menu_list )  if table . getn ( menu_list ) == s then  return  end  local skill_name = name_list [ s ]  local skill_vnum = vnum_list [ s ]  local skill_level = pc . get_skill_level ( skill_vnum )  local cur_alignment = pc . get_real_alignment ( )  local need_alignment = 1000 + 500 * ( skill_level - 30 )  test_chat ( "Güncel Derece:" .. cur_alignment )  test_chat ( "Gereken Derece: " .. need_alignment )  local title = string . format ( "%s Perfect Master Açarken %d Derece Düşecektir" , skill_name , skill_level - 30 + 1 )  say_title ( "Grand Master'in Beceri Egitimi" )   say ( "Dereceni Egitim Sirasinda" )  say ( "Kaybettigin Zaman ,Zen Fasülyesi " )  say ( "Sayesinde Farki Azaltacaksin." )   if cur_alignment < - 19000 + need_alignment then  say_title ( "Grand Master'in Beceri Egitimi" )   say_reward ( "Egitim için Yeterli Derece " )  say_reward ( "yok." )  return  end  if cur_alignment < 0 then  say_reward ( string . format ( "Şimdiki Grand Master İçin %d Derece Düşecektir" , need_alignment , need_alignment * 2 ) )  say_reward ( "(Grand Master'in Beceri Egitimi)" )  need_alignment = need_alignment * 2  elseif cur_alignment < need_alignment then  say_reward ( string . format ( "Gereken Derece: %d" , need_alignment ) )  say_reward ( "Eger Şimdi Eğitim Yaparsan,Derecen " )  say_reward ( "Tarafsızdan Daha Düşük Olacak." )  else  say_reward ( string . format ( "Gereken Derece: %d" , need_alignment ) )  end   local s = select ( "Devam et" , "Kapat" )  if s == 2 then  return  end  if cur_alignment >= 0 and cur_alignment < need_alignment then  say_title ( string . format ( "%s Onayla" , title ) )  say ( "Eger Hala Grand Master Becerisi Öğrenmek" )  say ( "İstiyorsanız, Derece Puanını Düşürmeyi " )  say ( "Kabul Etmelisin" )  say ( "Bunun için kutuya "Egitim istiyorum" yazmalısın." )  say_reward ( "Egitim istiyorum" )  say ( "Egitim İstemiyorsaniz ENTER tusuna basin.." )  local s = input ( )  if s ~= "Egitim İstiyorum" then  return  end  end  [COLOR="#FF0000"]if pc . count_item ( 50513 ) < 1 then say_title ( "Bug Kontrol" )  say ( "Envanterindeki Ruh Tasi olmadan gelistiremezsin ?" ) return end[/COLOR] if get_time ( ) < pc . getqf ( "next_time" ) then  if pc . is_skill_book_no_delay ( ) then  pc . remove_skill_book_no_delay ( )  else  say_title ( "Grand Master Beceri Egitimi" ) return  end  end  pc . setqf ( "next_time" , get_time ( ) + time_hour_to_sec ( number ( 8 , 12 ) ) )  if need_alignment > 0 then  if pc . learn_grand_master_skill ( skill_vnum ) then  pc . change_alignment ( - need_alignment )  say_title ( string . format ( "%s Basari" , title ) )  if 40 == pc . get_skill_level ( skill_vnum ) then  say ( string . format ( "%s iyi bir Master oldun" , skill_name ) ) else  say ( string . format ( "Grand Master Beceri Egitimiyle %s Seviyeni %d Yükselttin" , skill_name , skill_level - 30 + 1 + 1 ) ) end say_reward ( "Seviyeni Basari İle Yükselttin." )  say_reward ( string . format ( "%d Derece kullandin.." , need_alignment ) )  else  say_title ( string . format ( "%s Basarisiz!" , title ) )  say ( "Becerini Yükseltemedin." )  say_reward ( "Biraz Derece Kaybettin." )  pc . change_alignment ( - number ( need_alignment / 3 , need_alignment / 2 ) ) end  end pc.remove_item (50513)


Bu sistem nasıl işliyor diye merak edenlere anlatayım..Arkadaşlar bu ruh taşını okurlarken son işlemde yapılan ticaret bugundan
sonra karaketin envanterinde ruhtaşı olup olmadığını kontrol eder ve ruh taşını kullanmasına envanterınde varsa izin verir..
Eğer yoksa ''Envanterindeki Ruh Tasi olmadan gelistiremezsin'' dizini gelir ve kapat seçeneği çıkar...

Kurulumuna Geçelim

1: FTP giriş yapın ve şu dizine gidin: /usr/game/share/locale/turkey/quest/object/50513/use
2: "training_grandmaster_skill.start" dosyasını not defteriyle açın.
3: İçindeki kodların tamamını silip benim verdiğim kodları yapıştırın.
4: Oyuna dönüp Gm Çarınızla "/reload q" yazın ya da reboot atın.


Bir Teşekkürü Çok Görmeyin... CedricStorm
Ruh Taşı Bugu Engelleme: Ticaretten Kaldırmadan Bugu Engelliyoruz (cedricstorm)

Metin2'de Quest Sistemleri ve Ruh Taşı Bugu
Metin2 sunucularında quest sistemleri, oyuncuların oyun içinde gelişimini sağlarken aynı zamanda bazı özel itemlerin doğru şekilde yönetilmesini de gerektirir. Bunlardan birisi olan 'Ruh Taşı', hem savaş hem de zindan sistemlerinde kritik öneme sahiptir. Ancak bazı sunucularda 'ruh taşı bug' gibi hatalar meydana gelmekte; bu durum, sunucu deneyimini ciddi şekilde etkilemektedir. Bu yazıda, 'cedricstorm' tarafından geliştirilen yöntemle, ruh taşı bugunun nasıl engelleneceği konusuna odaklanacağız.

Ruh Taşı Bug Nedir?
Ruh taşı bug, genellikle itemin yanlışlıkla ticaret yoluyla başka oyuncuya geçmesiyle oluşur. Normal şartlarda, ruh taşı kişisel bir itemdir ve ticaret edilemez olmalıdır. Ancak bazı quest scriptlerinde veya item tanımlarında yapılabilecek hatalar nedeniyle, bu taşlar doğrudan oyuncudan oyuncuya aktarılabilir. Bu da sunucu dengesini bozar ve unfair avantajlar doğurur.

Quest Scriptlerinde Dikkat Edilmesi Gerekenler
Metin2 quest sistemleri, Lua dili ile yazılmaktadır. Quest scriptleri, item davranışlarını, triggerları, reward sistemlerini ve daha fazlasını kontrol eder. Eğer bir quest scriptinde ruh taşı gibi özel itemler için yeterli kontroller yoksa, bug oluşabilir. Örneğin, bir quest sırasında ruh taşı envanterden silinip tekrar verildiğinde, bu işlem sırasında itemin 'tradeable' durumu kontrol edilmelidir. Aksi takdirde, bug meydana gelebilir.

Bug Önlemeye Yönelik Kodlama Stratejileri
Bug önlemede en temel adım, quest sırasında ruh taşının envanterde kalmasını sağlamak ve bu taşın geçici olarak trade engelli hale getirilmesidir. 'cedricstorm' yöntemi, bu işlemi güvenli şekilde yapmayı amaçlamaktadır. Bu yöntemde, quest başlatılırken ruh taşına özel flag'ler atanır ve bu flag, quest bitene kadar taşı korur. Ayrıca, quest tamamlanana kadar taşın envanterde bulunup bulunmadığı kontrol edilir. Bu sayede, taşın yanlışlıkla başka bir oyuncuya geçmesi önlenebilir.

Lua Quest Dosyası İçerisinde Uygulanması
Quest dosyasında, 'quest_begin' anında taş kontrolü yapılır. Eğer taş yoksa, quest iptal edilir. Taş varsa, 'set_item_trade_block' gibi fonksiyonlarla taşın trade edilemezliği sağlanır. Quest sonunda ise bu blok kaldırılır. Bu yöntem, hem kullanıcı deneyimini korur hem de sunucu güvenliğini artırır. Ayrıca, 'timer' ve 'trigger' sistemleri ile sürekli kontrol yapılabilir. Böylece, oyuncu ruh taşını kaybetmeden questleri sorunsuzca tamamlayabilir.

Özel Flag Kullanımı ve State Kontrolü
Metin2 quest sistemlerinde, flag'ler ve state'ler önemli roller oynar. Ruh taşı için özel bir flag tanımlanabilir. Bu flag, oyuncunun quest durumunu belirtir. Quest başladıktan sonra bu flag aktif edilir ve taş üzerinde koruma uygulanır. Quest bitince flag sıfırlanır. Bu yöntem, hem güvenliği artırır hem de quest zincirlerinde tutarlılığı sağlar.

Sunucu Performansına Etkisi
Yukarıda anlatılan yöntemler, quest sistemlerinde minimum CPU kullanımıyla çalışacak şekilde optimize edilmelidir. Her quest tetiklendiğinde taş kontrolü yapılırken, performans düşüşlerine sebep olmamak için sadece gerekli kontroller yapılmalıdır. 'Timer' kontrolleri sıklıkla değil, sadece gerekli anlarda yapılmalıdır.

Sonuç
Metin2 sunucularında ruh taşı bugunun engellenmesi, doğru quest scripti tasarımıyla mümkündür. 'cedricstorm' yöntemi, taşın güvenli şekilde korunmasını sağlarken, oyuncuların questleri eksiksiz tamamlamasına olanak tanır. Doğru Lua script kullanımı, flag yönetimi ve state kontrolleri ile hem güvenlik hem de kullanıcı memnuniyeti artırılabilir.


Blocking the Soul Stone Bug: Blocking the Bug Without Removing from Trade (cedricstorm)

Metin2 Quest Systems and Soul Stone Bug
In Metin2 servers, quest systems are crucial for player progression but also require careful management of special items. One such item is the 'Soul Stone,' which plays a key role in both combat and dungeon systems. However, on certain servers, bugs like the 'soul stone bug' can occur, severely impacting the gameplay experience. In this article, we'll explore how to prevent the soul stone bug using a method developed by 'cedricstorm'.

What Is the Soul Stone Bug?
The soul stone bug typically occurs when the item is mistakenly transferred via trade between players. Normally, the soul stone should be a personal item and not tradeable. However, due to errors in quest scripts or item definitions, these stones can be traded directly between players, disrupting server balance and creating unfair advantages.

Considerations in Quest Scripts
Metin2 quests are written in Lua. These scripts control item behaviors, triggers, rewards, and more. If proper checks are missing for special items like the soul stone, a bug may occur. For example, if during a quest the soul stone is removed from the inventory and then returned, its 'tradeable' status must be checked to prevent the bug.

Coding Strategies to Prevent the Bug
A fundamental step in preventing the bug is ensuring that the soul stone remains in the player's inventory during the quest and temporarily disabling its tradeability. The 'cedricstorm' method aims to achieve this safely. It assigns special flags to the soul stone at the start of the quest, which protect the stone until the quest ends. Additionally, it checks whether the stone remains in the inventory throughout the quest, thereby preventing unintended transfers to other players.

Implementation Within Lua Quest Files
At the beginning of the quest ('quest_begin'), the presence of the soul stone is verified. If the stone is not found, the quest is canceled. If it exists, functions like 'set_item_trade_block' are used to make the stone non-tradeable. At the end of the quest, this block is removed. This approach maintains user experience while increasing server security. Moreover, 'timer' and 'trigger' systems allow continuous monitoring to ensure the player completes quests without losing the soul stone.

Using Custom Flags and State Checks
In Metin2 quest systems, flags and states play important roles. A custom flag can be defined for the soul stone to indicate the player's quest status. Once activated, this flag applies protection to the stone. Upon completion of the quest, the flag is reset. This method enhances security while maintaining consistency in quest chains.

Impact on Server Performance
The methods described above must be optimized to use minimal CPU resources. Only necessary checks should be performed during quest triggers to avoid performance drops. Timed checks should only run when needed.

Conclusion
Preventing the soul stone bug on Metin2 servers is achievable with well-designed quest scripts. The 'cedricstorm' method ensures the safe protection of the stone while allowing players to complete quests seamlessly. Proper Lua scripting, flag management, and state controls can enhance both security and user satisfaction.
 

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

Geri
Üst Alt