Kod:
ACMD(do_item_new) // Nowa funkcja by: Muchomor { char arg1[256], arg2[256], arg3[256]; three_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2), arg3, sizeof(arg3)); if (!*arg1) { ch->ChatPacket(CHAT_TYPE_INFO, "Usage: item <item vnum> <item count> <times to spawn>"); return; } int iCount = 1; int iTimes = 1; if (*arg2) { str_to_number(iCount, arg2); iCount = MINMAX(1, iCount, g_bItemCountLimit); } if (*arg3) { str_to_number(iTimes, arg3); iTimes = MAX(1, iTimes); } DWORD dwVnum; std::pair<DWORD, DWORD> vnumRange; std::vector<std::string> v_range; std::string sRange(arg1); boost::split(v_range, sRange, boost::is_any_of("-")); if (v_range.size() < 2) { if (isnhdigit(*arg1)) { str_to_number(dwVnum, arg1); if (!ITEM_MANAGER::instance().GetTable_NEW(dwVnum)) { ch->ChatPacket(CHAT_TYPE_INFO, "#%u item does not exist by that vnum.", dwVnum); return; } else { vnumRange = std::make_pair(dwVnum, dwVnum); } } else { if (!ITEM_MANAGER::instance().GetVnum(arg1, dwVnum)) { ch->ChatPacket(CHAT_TYPE_INFO, "#%u item does not exist by that vnum(%s).", dwVnum, arg1); return; } else { vnumRange = std::make_pair(dwVnum, dwVnum); } } } else { try { vnumRange = std::make_pair(std::stoul(v_range[0], NULL, 10), std::stoul(v_range[1], NULL, 10)); if (vnumRange.first > vnumRange.second) { std::swap(vnumRange.first, vnumRange.second); } } catch (...) { ch->ChatPacket(CHAT_TYPE_INFO, "Invalid range! To use range feature type following syntax: ID-ID."); return; } } for (unsigned int i = vnumRange.first; i <= vnumRange.second; i++) { for (int j = 0; j < iTimes; j++) { LPITEM item = ITEM_MANAGER::instance().CreateItem(i, iCount, 0, true); if (item) { if (item->IsDragonSoul()) { int iEmptyPos = ch->GetEmptyDragonSoulInventory(item); if (iEmptyPos != -1) { item->AddToCharacter(ch, TItemPos(DRAGON_SOUL_INVENTORY, iEmptyPos)); LogManager::instance().ItemLog(ch, item, "GM", item->GetName()); } else { M2_DESTROY_ITEM(item); if (!ch->DragonSoul_IsQualified()) { ch->ChatPacket(CHAT_TYPE_INFO, "ŔÎşĄŔĚ Č°ĽşČ µÇÁö ľĘŔ˝."); } else { ch->ChatPacket(CHAT_TYPE_INFO, "Not enough inventory space."); } } } else { int iEmptyPos = ch->GetEmptyInventory(item->GetSize()); if (iEmptyPos != -1) { item->AddToCharacter(ch, TItemPos(INVENTORY, iEmptyPos)); LogManager::instance().ItemLog(ch, item, "GM", item->GetName()); } else { M2_DESTROY_ITEM(item); ch->ChatPacket(CHAT_TYPE_INFO, "Not enough inventory space."); } } } else { ch->ChatPacket(CHAT_TYPE_INFO, "#%u item does not exist by that vnum.", dwVnum); } } } }
Yeni Eşya Sistemi Tanıtımı: Grzyb Tarafından Geliştirildi
Metin2 özel sunucu geliştirme dünyasında sürekli yenilikler ve gelişmeler meydana gelmektedir. Bu doğrultuda, Grzyb tarafından geliştirilen yeni eşya fonksiyonu, Metin2 geliştiricileri arasında büyük ilgi görmeye devam ediyor. Bu sistem sayesinde sunuculara daha fazla esneklik ve kullanıcı deneyimi kazandırılmaktadır.
Sistem Nedir?
Yeni eşya sistemi, Metin2 sunucularında eşya eklemek veya mevcut eşyaları düzenlemek için tasarlanmış bir C++ tabanlı eklentidir. Bu sistem sayesinde geliştiriciler, sunucularına kolayca yeni eşyalar ekleyebilir, özel efektler tanımlayabilir ve karakterlerin eşya kullanımına özel tepkiler geliştirebilirler.
Neden Önemlidir?
Metin2 özel sunucularında rekabet arttıkça, kullanıcıların dikkatini çekecek farklı ve özgün özellikler sunmak büyük önem taşımaktadır. Grzyb tarafından geliştirilen bu sistem sayesinde sunuculara özel görsel efektli eşyalar, sınırlı süreli eşyalar, stat bonusları içeren özel eşyalar gibi pek çok yeni nesne eklenebilir. Bu da oyuncu memnuniyetini ve sunucu sadakatini artırır.
Teknik Detaylar
Sistem, C++ dilinde yazılmış olup, game core üzerinde çalışmaktadır. Bu sayede sunucu performansını minimum düzeyde etkileyerek maksimum verim alınabilmektedir. Aynı zamanda db core ile entegre çalışarak eşya verilerinin güvenli bir şekilde saklanmasını sağlar. Python GUI araçları ile de kolayca yapılandırılabilir ve test edilebilir.
Özellikler
- Yeni eşya tanımlamayı kolaylaştırır
- Eşyaların özel efektlerle donatılabilmesini sağlar
- Sunucu tarafında özel komutlar ile eşya kontrolü sağlar
- DB tabanlı eşya yönetim sistemi içerir
- Martysama ve diğer popüler sistemlerle uyumlu çalışır
Kullanım Önerileri
Bu sistemi kullanırken geliştiricilerin dikkat etmesi gereken bazı önemli noktalar vardır. Özellikle eşya eklenirken client src ve server src uyumuna dikkat edilmelidir. Ayrıca eşyanın görünümü ve etkisi için uiscript dosyalarının doğru şekilde düzenlenmesi gerekir. Sistemin test aşamasında py root üzerinden test işlemleri yapılmalıdır.
Sonuç
Grzyb tarafından geliştirilen bu yeni eşya sistemi, Metin2 özel sunucuları için oldukça değerli bir katkıdır. Geliştiricilerin daha özgün ve yaratıcı sistemler kurabilmesine olanak tanıyarak, Metin2 topluluklarının daha aktif ve keyifli bir oyun deneyimi yaşamasını sağlar. Bu sistem, hem PvP hem de PvE sunucularında kullanılabilecek esneklikte olup, her tür sunucuya adapte edilebilir.
Introduction of New Item Function: Developed by Grzyb
In the world of Metin2 private server development, continuous innovations and improvements are constantly taking place. In this context, the new item function developed by Grzyb continues to attract significant attention among Metin2 developers. This system brings more flexibility and enhanced user experience to servers.
What Is The System?
The new item system is a C++ based add-on designed for adding items or editing existing ones on Metin2 servers. With this system, developers can easily add new items to their servers, define special effects, and create custom reactions for character item usage.
Why Is It Important?
As competition increases among Metin2 private servers, offering unique and original features that capture players' attention becomes crucial. Thanks to this system developed by Grzyb, servers can introduce visually enhanced items, limited-time items, special items with stat bonuses, and many other new objects. This increases player satisfaction and server loyalty.
Technical Details
The system is written in C++ and operates on the game core. This ensures maximum efficiency while minimizing impact on server performance. Additionally, integrated with db core, it securely stores item data. It can also be configured and tested easily using Python GUI tools.
Features
- Simplifies adding new items
- Allows items to have special effects
- Provides server-side commands for item control
- Includes a database-based item management system
- Compatible with popular systems like Martysama
Usage Recommendations
There are several important points developers should consider when using this system. Especially when adding items, compatibility between client src and server src must be ensured. Moreover, uiscript files need to be properly edited to define item appearance and effects. Testing should be performed via py root during the testing phase.
Conclusion
The new item system developed by Grzyb is a valuable contribution for Metin2 private servers. By enabling developers to build more original and creative systems, it helps Metin2 communities enjoy a more active and entertaining gaming experience. This system is flexible enough to be used in both PvP and PvE servers and can be adapted to any type of server.
