Jump to content

Create Your Own Attr Type


Recommended Posts

  • Active+ Member

Hello, i haven't seen a topic like this in the forum. I want to share it.

Firs of all we create own attr type with RaceFlag (Maybe in the following days i'll show you how to without RaceFlag)

 

 

Client Source:

 

GameLib:

ItemData.h

Spoiler

// Search: 
	enum EApplyTypes
	{
// Add to Enum: 
	APPLY_ATTBONUS_NEWATTRTYPE,

 

 

UserInterface:

PythonPlayerModule.cpp

Spoiler

// Search:
	PyModule_AddIntConstant(poModule, "APPLY_ANTI_PENETRATE_PCT",	CItemData::APPLY_ANTI_PENETRATE_PCT );
// Add:
	PyModule_AddIntConstant(poModule, "APPLY_ATTBONUS_NEWATTRTYPE",	CItemData::APPLY_ATTBONUS_NEWATTRTYPE);

 

 

Packet.h

Spoiler

// Search: 
  	enum EPointTypes
	{
  	....
  	}
// Add to Enum:
	POINT_ATTBONUS_NEWATTRTYPE,

 

 

 

Game Source:

 

common:

length.h

Spoiler

// Search: 
	enum ERaceFlags
	{
// Add:
	RACE_FLAG_ATT_NEWATTRTYPE	= (1 << /*Last number +1*/)

// Search: 
	enum EApplyTypes
    {
// Add to Enum:
	APPLY_ATTBONUS_NEWATTRTYPE,

 

 

game:

char.h

Spoiler

// Search: 
	enum EPointTypes
	{
// Add to Enum:
	POINT_ATTBONUS_NEWATTRTYPE,

 

 

char.cpp

Spoiler

// Search: 
  	case POINT_RESIST_SHAMAN:
// Add:
	case POINT_ATTBONUS_NEWATTRTYPE:

// Search: 
  	case APPLY_NORMAL_HIT_DAMAGE_BONUS:
// Add:
	case APPLY_ATTBONUS_NEWATTRTYPE:

 

 

cmd_general.cpp

Spoiler

// Search:
static const char* [...]

	switch (apply_number)
	{
		// ICINDE BUL
		case POINT_RESIST_SHAMAN:    
  			return LC_TEXT("¹«´ç°ø°Ý¿¡ %d%% ÀúÇ×");
// Add:
		case POINT_ATTBONUS_NEWATTRTYPE:    
  			return LC_TEXT("POINT_ATTBONUS_NEWATTRTYPE: %d%%");

 

 

cmd_gm.cpp

Spoiler

// Search: 
	tch->GetPoint(POINT_ATTBONUS_SHAMAN));
// Add in do_state command:
	ch->ChatPacket(CHAT_TYPE_INFO, "   NEWATTRTYPE:%3d%%",
		tch->GetPoint(POINT_ATTBONUS_NEWATTRTYPE));

 

 

constants.cpp

Spoiler

// Search: 
  	const TApplyInfo aApplyInfo[MAX_APPLY_NUM] =
// Add in function:
	{ POINT_ATTBONUS_NEWATTRTYPE,		},	// APPLY_ATTBONUS_NEWATTRTYPE,

// Search: 
  TValueName c_aApplyTypeNames[] =
// Search in this: 
  { NULL,        0            }
// Add above:
	{ "ATT_NEWATTRTYPE",    APPLY_ATTBONUS_NEWATTRTYPE    },

 

 

battle.cpp

Spoiler

pkVictim (It meanings of defendor)
pkAttacker is attacker 
if we are adding Defence attr type from mobs we will add this func.
if (pkAttacker->IsNPC() && pkVictim->IsPC())
or we are adding attack attr type to mobs we will add this func.
if (pkAttacker->IsPC() && pkVictim->IsNPC())

Logic is this:
  
//Search
if (pkVictim->IsRaceFlag(RACE_FLAG_ANIMAL))
	iAtk+= (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_ANIMAL)) / 100;
// Add:
		else if (pkVictim->IsRaceFlag(RACE_FLAG_ATT_NEWATTRTYPE))
			iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_NEWATTRTYPE)) / 100;

 

 

db:

protoreader.cpp

Spoiler

// Search: 
	string arApplyType[]
// Add to the end:
	"APPLY_ATTBONUS_NEWATTRTYPE",

// Search: 
	string arRaceFlag[]
// Add to the end:
	"ATT_NEWATTRTYPE"

 

 

 

Tools:

DumpProtoSource

 

ItemCSVReader.cpp

Spoiler

// Search: 
      string arApplyType[]
// Add to the end:
	"APPLY_ATTBONUS_NEWATTRTYPE",

// Search: 
	string arRaceFlag[]
// Add to the end:
	"ATT_NEWATTRTYPE"

 

 

 

Client

 

root

uitooltip.py

Spoiler

// Search: 
	item.APPLY_ATTBONUS_DEVIL : localeInfo.TOOLTIP_APPLY_ATTBONUS_DEVIL,
// Add:
	item.APPLY_ATTBONUS_NEWATTRTYPE : localeInfo.TOOLTIP_APPLY_ATTBONUS_NEWATTRTYPE,

 

 

locale

locale_game.txt

Spoiler

// Add:
TOOLTIP_APPLY_ATTBONUS_NEWATTRTYPE	Strong against to attr type you want xd	+%d%%	SA

 

 

Edited by Raylee
Syntax Update
  • Metin2 Dev 1
  • Confused 1
  • Love 2
Link to comment
Share on other sites

  • Management
  • 2 weeks later...
__________
ClientSrc>GameLib>ItemData.h
// Search: enum EApplyTypes
// Add to Enum: 
APPLY_ATTBONUS_NEWATTRTYPE,

__________
ClientSrc>UserInterface>PythonPlayerModule.cpp
// Searcharch:
	PyModule_AddIntConstant(poModule, "APPLY_ANTI_PENETRATE_PCT",    CItemData::APPLY_ANTI_PENETRATE_PCT );
// Add:
	PyModule_AddIntConstant(poModule, "APPLY_ATTBONUS_NEWATTRTYPE", CItemData::APPLY_ATTBONUS_NEWATTRTYPE);

__________
ClientSrc>UserInterface>Packet.h
// Search: enum EPointTypes
// Add to Enum:
POINT_ATTBONUS_NEWATTRTYPE,

__________
GameSrc>common>length.h
// Search: enum ERaceFlags
// Add:
RACE_FLAG_ATT_NEWATTRTYPE	= (1 << /*Last number +1*/)

// Search: enum EApplyTypes
// Add to Enum:
APPLY_ATTBONUS_NEWATTRTYPE,

__________
GameSrc>game>char.h
// Search: enum EPointTypes
// Add to Enum:
POINT_ATTBONUS_NEWATTRTYPE,

__________
GameSrc>game>char.cpp
// Search: case POINT_RESIST_SHAMAN:
// Add:
case POINT_ATTBONUS_NEWATTRTYPE:

// Search: case APPLY_NORMAL_HIT_DAMAGE_BONUS:
// Add:
case APPLY_ATTBONUS_NEWATTRTYPE:

__________
GameSrc>game>cmd_general.cpp
// Search:
static const char* [...]

	switch (apply_number)

	{

		// ICINDE BUL

		case POINT_RESIST_SHAMAN:    return LC_TEXT("¹«´ç°ø°Ý¿¡ %d%% ÀúÇ×");

// Add:
		case POINT_ATTBONUS_NEWATTRTYPE:    return LC_TEXT("POINT_ATTBONUS_NEWATTRTYPE: %d%%");

__________
GameSrc>game>cmd_gm.cpp
// Search: tch->GetPoint(POINT_ATTBONUS_SHAMAN));
// Add in do_state command:
ch->ChatPacket(CHAT_TYPE_INFO, "   NEWATTRTYPE:%3d%%",

	tch->GetPoint(POINT_ATTBONUS_NEWATTRTYPE));

__________
GameSrc>game>constants.cpp
// Search: const TApplyInfo aApplyInfo[MAX_APPLY_NUM] =
// Add in function:
	{ POINT_ATTBONUS_NEWATTRTYPE,		},	// APPLY_ATTBONUS_NEWATTRTYPE,

// Search: TValueName c_aApplyTypeNames[] =
// Search in this: { NULL,        0            }
// Add above:
	{ "ATT_NEWATTRTYPE",    APPLY_ATTBONUS_NEWATTRTYPE    },

__________
GameSrc>game>battle.cpp

pkVictim (It meanings of defendor)

pkAttacker is attacker 

if we are adding Defence attr type from mobs we will add this func.
if (pkAttacker->IsNPC() && pkVictim->IsPC())
or we are adding attack attr type to mobs we will add this func.
if (pkAttacker->IsPC() && pkVictim->IsNPC())

Logic is this

//Search: iAtk+= (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_ANIMAL)) / 100;
// Add:
		else if (pkVictim->IsRaceFlag(RACE_FLAG_ATT_NEWATTRTYPE))
			iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_NEWATTRTYPE)) / 100;

__________
GameSrc>db>protoreader.cpp
// Search: string arApplyType[]
// Add to the end:
"APPLY_ATTBONUS_NEWATTRTYPE",

// Search: string arRaceFlag[]
// Add to the end:
"ATT_NEWATTRTYPE"

__________
Tools>DumpProtoSource>ItemCSVReader.cpp
// Search: string arApplyType[]
// Add to the end:
"APPLY_ATTBONUS_NEWATTRTYPE",

// Search: string arRaceFlag[]
// Add to the end:
"ATT_NEWATTRTYPE"

__________
Client>root>uitooltip.py
// Search: item.APPLY_ATTBONUS_DEVIL : localeInfo.TOOLTIP_APPLY_ATTBONUS_DEVIL,
// Add:
item.APPLY_ATTBONUS_NEWATTRTYPE : localeInfo.TOOLTIP_APPLY_ATTBONUS_NEWATTRTYPE,

__________
Client>locale>xx>locale_game.txt
// Add:
TOOLTIP_APPLY_ATTBONUS_NEWATTRTYPE	Strong against to attr type you want xd	+%d%%	SA


Hope dont muss something

  • Love 1
Link to comment
Share on other sites

  • Active+ Member
On 2/9/2020 at 1:18 PM, Raylee said:

@Reached

I've revised your Syntax in the main post.
Please check if everything is correct.

 

 

Best regards
Raylee

Thank you so much, everything is correct succesfully ❤️ 

Link to comment
Share on other sites

  • 3 weeks later...
  • Active+ Member
On 2/15/2020 at 4:04 AM, blabla112 said:

didnt work, did everything, i think i messed something up in the mysql... i dont know how to put them there

It's work, after than adding codes open your mob_proto and for example

 

1093 (Lucifer) Add the RaceFlag ATT_NEWATTRTYPE  

Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.