İstediğin İteme Effect Verme (Bayraklar Arası Değişkenlik Gösterir)

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
I do not know how to fix code blocks. //Kod Bloklarını Düzeltmeyi Bilmiyorum Biraz Karışık Olabilir.

[File: Src/Client/UserInterface/Locale_inc.h]
// ------------------------------------------------------------------------ //
#define ENABLE_EFFECT_COSTUME // Enable check for add effect costume
// ------------------------------------------------------------------------ //
// ------------------------------------------------------------------------ //
#define GET_EFFECT_VIA_MSM // Enable check from value3 item_proto(client)
// ------------------------------------------------------------------------ //
// ------------------------------------------------------------------------ //
#define GET_EFFECT_VIA_VNUM // Enable check from item vnum
// ------------------------------------------------------------------------ //


[File: Src/Client/UserInterface/InstanceBase.h]
#1.) Search:
enum
{
EMPIRE_NONE,
EMPIRE_A,
EMPIRE_B,
EMPIRE_C,
EMPIRE_NUM,
};



#2.) Add bellow:
#ifdef ENABLE_EFFECT_COSTUME
// ------------------------------------------------------------------------ //
// This enum from ECostumeEffectMsm value is loaded from item_proto(client)//
// Value is loaded from your Value3="xxxxx"//
// Value3 = ShapeIndex from yourrace.msm (root)//
// ------------------------------------------------------------------------ //
enum ECostumeEffectMsm
{
VALUE_MSM_1 = 40032, // = vnum [ (M) -> 41003, (F) -> 41004]
VALUE_MSM_2 = 40033, // = vnum [ (M) -> 41005, (F) -> 41006]
VALUE_MSM_3 = 40034, // = vnum [ (M) -> 41007, (F) -> 41008]
VALUE_MSM_4 = 40035, // = vnum [ (M) -> 41009, (F) -> 41010]
VALUE_MSM_5 = 40036, // = vnum [ (M) -> 41011, (F) -> 41012]
VALUE_MSM_6 = 40037, // = vnum [ (M) -> 41013, (F) -> 41014]
VALUE_MSM_7 = 40038, // = vnum [ (M) -> 41015, (F) -> 41016]
VALUE_MSM_8 = 40039, // = vnum [ (M) -> 41017, (F) -> 41018]
VALUE_MSM_9 = 40040, // = vnum [ (M) -> 41019, (F) -> 41020]
VALUE_MSM_10 = 40041, // = vnum [ (M) -> 41021, (F) -> 41022]
};

enum ECostumeEffectVnum
{
VALUE_VNUM_1 = 41003,
VALUE_VNUM_2 = 41304,
VALUE_VNUM_3 = 41005,
VALUE_VNUM_4 = 41006,
VALUE_VNUM_5 = 41307,
VALUE_VNUM_6 = 41308,
VALUE_VNUM_7 = 41309,
VALUE_VNUM_8 = 41310,
VALUE_VNUM_9 = 41311,
VALUE_VNUM_10 = 41312,
};
#endif
[File: Src/Client/UserInterface/InstanceBase.cpp]
#1.) Search:
if (m_swordRefineEffectRight)
m_swordRefineEffectRight = __AttachEffect(m_swordRefineEffectRight);
if (m_swordRefineEffectLeft)
m_swordRefineEffectLeft = __AttachEffect(m_swordRefineEffectLeft);
break;
#2.) Add bellow:
#ifdef ENABLE_EFFECT_COSTUME
case CItemData::ITEM_TYPE_COSTUME:

if (pItem->GetSubType() == CItemData::COSTUME_BODY)
{
DWORD szItem = pItem->GetIndex();
long szMsm = pItem->GetValue(3);

#ifdef GET_EFFECT_VIA_MSM
if (szMsm == VALUE_MSM_1 || szMsm == VALUE_MSM_2 ||
szMsm == VALUE_MSM_3 || szMsm == VALUE_MSM_4 ||
szMsm == VALUE_MSM_5 || szMsm == VALUE_MSM_6 ||
szMsm == VALUE_MSM_7 || szMsm == VALUE_MSM_8 ||
szMsm == VALUE_MSM_9 || szMsm == VALUE_MSM_10)
#endif
#ifdef GET_EFFECT_VIA_VNUM
if (szItem == VALUE_VNUM_1 || szItem == VALUE_VNUM_2 ||
szItem == VALUE_VNUM_3 || szItem == VALUE_VNUM_4 ||
szItem == VALUE_VNUM_5 || szItem == VALUE_VNUM_6 ||
szItem == VALUE_VNUM_7 || szItem == VALUE_VNUM_8 ||
szItem == VALUE_VNUM_9 || szItem == VALUE_VNUM_10)
#endif
{
__AttachEffect(EFFECT_REFINED+EFFECT_NAME); // Put your effect
}
}
#endif
İstediğiniz İteme Effect Verme (Bayraklar Arası Değişkenlik Gösterir)

Metin2 özel sunucularında itemlere özel efektler eklemek, oyuncuların dikkatini çekmek ve oyun deneyimini zenginleştirmek açısından oldukça önemlidir. Bu işlem genellikle item_proto, client-side ve game sunucusu üzerinde yapılan değişikliklerle sağlanır. Ancak her şeyden önce, bu efektlerin bayraklar arası olarak nasıl farklılaştığını bilmek gerekir. Bayraklar, itemin hangi özellikleri taşıdığına dair bilgi verir ve bazı efektler bu bayraklara göre aktif olabilir.

Item Efektleri ve Bayraklar Hakkında Genel Bilgi

Efekt atamaları genellikle C++ tabanlı game sunucusu üzerinde yapılır. Metin2 özel sunucularında, itemin proto dosyasında tanımlanan özellikler ve bayraklar sayesinde efekt atamaları yapılabilir. Örneğin, bir silaha özel bir efekt vermek istiyorsanız, bu efektin ne zaman çalışacağını belirleyen bayrakları kontrol etmelisiniz. Bazı bayraklar, itemin sadece PvP modunda çalışmasını sağlarken, bazıları ise sadece PvE içeriklerde aktif olabilir.

Item Proto Dosyası ile Efekt Tanımı

Item proto dosyası, tüm itemlerin tanımının yapıldığı temel dosyadır. Bu dosyada, her item için özel efektler ve bayraklar tanımlanabilir. Örneğin, bir itemin 'poison_effect' adında bir efekti varsa ve bu efektin sadece PvP sırasında çalışması isteniyorsa, ilgili bayrağı (örneğin: B_PVP_ONLY) bu iteme tanımlamanız gerekir. Bu sayede, item sadece PvP esnasında efektini gösterir.

Client-Side Etkileşim

Efektlerin görünür olması için client tarafında da bazı ayarlamalar yapılması gerekir. Client, itemin efektini görsel olarak yansıtmak için özel animasyon veya efekt dosyalarına ihtiyaç duyar. Bu dosyalar genellikle UIScript ve GUI dosyaları üzerinden yönetilir. PyRoot ve PyGUI gibi yapılar, efektlerin doğru şekilde kullanıcıya yansıtılmasında kritik rol oynar.

C++ Kodlama ile Efekt Aktivasyonu

C++ sistemleri üzerinden efektlerin aktive edilmesi, daha detaylı ve güçlü kontroller sağlar. Örneğin, bir itemin efektinin sadece belirli bir seviye veya sınıf tarafından kullanılabilmesi gibi kontroller, C++ seviyesinde tanımlanabilir. Bu sistemde, efektlerin bayraklara göre aktive edilip edilmeyeceği de kod seviyesinde belirlenir.

Python Script Entegrasyonu

Python script sistemleri, efektlerin dinamik olarak aktive edilmesini sağlayabilir. PyRoot üzerinden yazılmış olan scriptler, belirli durumlarda efektleri aktive edebilir veya devre dışı bırakabilir. Bu yöntem özellikle özel sunucular için büyük esneklik sunar.

Bayraklar Arasındaki Farklılıklar

Her itemin birden fazla bayrağı olabilir. Bu bayraklar, itemin hangi efektleri taşıdığını, ne zaman aktif olacağını ve nasıl davranacağını belirler. Örneğin:

- B_PVP_ONLY: Sadece PvP sırasında aktif.
- B_PVE_ONLY: Sadece PvE sırasında aktif.
- B_LEVEL_DEPENDENT: Seviye bazlı efekt.
- B_CLASS_RESTRICTED: Sadece belirli sınıflar kullanabilir.

Sonuç

Metin2 özel sunucularda itemlere efekt vermek, hem teknik bilgi gerektiren hem de yaratıcılıkla şekillenen bir alandır. Bayraklar arası değişkenlikler sayesinde, efektlerin ne zaman ve nasıl aktif olacağı tam anlamıyla kontrol edilebilir. Bu sayede, hem oyun dengesi korunur hem de oyuncular için zengin bir deneyim sunulur.


Adding Effects to Any Item (May Vary Between Flags)

In Metin2 private servers, adding custom effects to items is crucial for attracting players and enriching the gaming experience. This process typically involves modifications on item_proto, client-side, and the game server. However, first and foremost, understanding how these effects vary between flags is essential. Flags indicate which features an item carries, and certain effects may activate based on these flags.

General Info About Item Effects and Flags

Effect assignments are generally done on the C++ based game server. In Metin2 private servers, properties and flags defined in the item_proto file allow effect assignments. For example, if you want to assign a special effect to a weapon, you must check the flags that determine when this effect activates. Some flags ensure the effect works only during PvP, while others may trigger only in PvE content.

Effect Definition via Item Proto File

The item proto file is the main file where all items are defined. Within this file, custom effects and flags can be assigned to each item. For instance, if an item has a 'poison_effect', and this effect should only work during PvP, you must define the corresponding flag (e.g., B_PVP_ONLY) for this item. Thus, the item will display its effect only during PvP matches.

Client-Side Interaction

For effects to appear visually, adjustments on the client-side are also required. The client requires special animation or effect files to reflect the item's effect visually. These files are usually managed through UIScript and GUI files. Structures like PyRoot and PyGUI play a critical role in correctly displaying the effects to the user.

Activating Effects with C++ Coding

Activating effects through C++ systems provides more detailed and powerful controls. For example, restrictions such as allowing an item's effect only for specific levels or classes can be defined at the C++ level. Within this system, whether effects activate based on flags is determined at the code level.

Python Script Integration

Python script systems allow effects to be activated dynamically. Scripts written through PyRoot can activate or deactivate effects under certain conditions. This method offers great flexibility especially for private servers.

Differences Between Flags

Each item can have multiple flags. These flags determine which effects the item carries, when they activate, and how they behave. For example:

- B_PVP_ONLY: Activates only during PvP.
- B_PVE_ONLY: Activates only during PvE.
- B_LEVEL_DEPENDENT: Level-based effect.
- B_CLASS_RESTRICTED: Only specific classes can use it.

Conclusion

Adding effects to items in Metin2 private servers is an area that requires both technical knowledge and creativity. Through variations between flags, when and how effects activate can be fully controlled. This ensures the game balance is maintained while providing a rich experience for players.
 

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

Geri
Üst Alt