Jump to content

(Python-only)Show potions affects on the affectshower


Recommended Posts

  • Contributor

.jpg
 

It's a method to see the dews & water potions affect icons on the affectshower using the python side only, It's bit late to share this but it's an idea given by a dear friend of mine long ago.

I tested this on both normal and extended blend system.

I uploaded guide  for easier implementation..

 

This is the hidden content, please
 / 
This is the hidden content, please

1@ ClientSource/UserInterface/InstanceBase.h:

Before:

			NEW_AFFECT_AUTO_HP_RECOVERY		= 534,

Add:

			NEW_AFFECT_BLEND = 531,

2@ ClientSource/UserInterface/PythonCharacterModule.cpp:

At the end of the file and before:

}

Add:

	PyModule_AddIntConstant(poModule, "NEW_AFFECT_BLEND", CInstanceBase::NEW_AFFECT_BLEND);

3@ ClientSource/UserInterface/PythonPlayerModule.cpp:

At the end of the file and before:

}

Add:

	PyModule_AddIntConstant(poModule, "RESIST_MAGIC",	POINT_RESIST_MAGIC);

3@ root/constInfo.py:

Add:

ENABLE_POTIONS_AFFECTSHOWER = 1 ## 0=Disable / 1=Enable

4@ root/uiAffectShower.py:

Add at top of the file:

import constInfo

Search:

	MALL_DESC_IDX_START = 1000

Add:

	if constInfo.ENABLE_POTIONS_AFFECTSHOWER:
		## As long the values arent reserved
		WATER_DESC_IDX_START = 1100
		DEW_DESC_IDX_START = 1200
		

 

Search:

	chr.NEW_AFFECT_DRAGON_SOUL_DECK2: (localeInfo.TOOLTIP_DRAGON_SOUL_DECK2, "d:/ymir work/ui/dragonsoul/buff_ds_land1.tga",),

Add:

	if constInfo.ENABLE_POTIONS_AFFECTSHOWER:
		AFFECT_DATA_DICT[WATER_DESC_IDX_START+player.POINT_PENETRATE_PCT] = (localeInfo.TOOLTIP_APPLY_PENETRATE_PCT, 	"icon/item/50813.tga")
		AFFECT_DATA_DICT[WATER_DESC_IDX_START+player.POINT_CRITICAL_PCT] = (localeInfo.TOOLTIP_APPLY_CRITICAL_PCT, 	"icon/item/50814.tga")
		AFFECT_DATA_DICT[WATER_DESC_IDX_START+player.ATT_BONUS] = (localeInfo.TOOLTIP_ATT_GRADE, 			"icon/item/50817.tga")
		AFFECT_DATA_DICT[WATER_DESC_IDX_START+player.DEF_BONUS] = (localeInfo.TOOLTIP_DEF_GRADE, 			"icon/item/50818.tga")
		AFFECT_DATA_DICT[WATER_DESC_IDX_START+player.RESIST_MAGIC] = (localeInfo.TOOLTIP_MAGIC_DEF_GRADE, 		"icon/item/50819.tga")
		AFFECT_DATA_DICT[WATER_DESC_IDX_START+player.ATT_SPEED] = (localeInfo.TOOLTIP_ATT_SPEED, 			"icon/item/50820.tga")
		AFFECT_DATA_DICT[DEW_DESC_IDX_START+player.POINT_CRITICAL_PCT] = (localeInfo.TOOLTIP_APPLY_CRITICAL_PCT, 	"icon/item/50821.tga")
		AFFECT_DATA_DICT[DEW_DESC_IDX_START+player.POINT_PENETRATE_PCT] = (localeInfo.TOOLTIP_APPLY_PENETRATE_PCT, 	"icon/item/50822.tga")
		AFFECT_DATA_DICT[DEW_DESC_IDX_START+player.ATT_SPEED] = (localeInfo.TOOLTIP_ATT_SPEED, 			"icon/item/50823.tga")
		AFFECT_DATA_DICT[DEW_DESC_IDX_START+player.RESIST_MAGIC] = (localeInfo.TOOLTIP_RESIST_MAGIC, 			"icon/item/50824.tga")
		AFFECT_DATA_DICT[DEW_DESC_IDX_START+player.ATT_BONUS] = (localeInfo.TOOLTIP_ATT_GRADE, 			"icon/item/50825.tga")
		AFFECT_DATA_DICT[DEW_DESC_IDX_START+player.DEF_BONUS] = (localeInfo.TOOLTIP_DEF_GRADE, 			"icon/item/50826.tga")
		AFFECT_DATA_DICT[DEW_DESC_IDX_START+player.ENERGY] = (localeInfo.TOOLTIP_ENERGY, 			"icon/item/51002.tga")

Do this next step twice(Inside def BINARY_NEW_AddAffect & def BINARY_NEW_RemoveAffect) :

After:

		if type == chr.NEW_AFFECT_MALL:
			affect = self.MALL_DESC_IDX_START + pointIdx

Add:

		elif constInfo.ENABLE_POTIONS_AFFECTSHOWER and type == chr.NEW_AFFECT_EXP_BONUS_EURO_FREE:
			affect = self.WATER_DESC_IDX_START + pointIdx
		elif constInfo.ENABLE_POTIONS_AFFECTSHOWER and type == chr.NEW_AFFECT_BLEND:
			affect = self.DEW_DESC_IDX_START + pointIdx

## Note: If you want to use the dews & water potions together!
## If you use the water potions before the dews(specifically Mong Water == 50819), You won't be able to use any of the dews.

@ GameSource/char_item.cpp:

Search:

		case ITEM_BLEND:

Replace:

					if (FindAffect(AFFECT_EXP_BONUS_EURO_FREE, POINT_RESIST_MAGIC))
					{
						ChatPacket(CHAT_TYPE_INFO, LC_TEXT("This effect is already activated."));
					}
					else
					{
						AddAffect(affect_type, apply_type, apply_value, 0, apply_duration, 0, false);
						item->SetCount(item->GetCount() - 1);
					}

With:

					AddAffect(affect_type, apply_type, apply_value, 0, apply_duration, 0, false);
					item->SetCount(item->GetCount() - 1);

 

You can do the same for the Dragon god affects(Affect 510==NEW_AFFECT_MALL).

  • Metin2 Dev 144
  • kekw 1
  • Eyes 2
  • Angry 1
  • Think 2
  • Scream 1
  • Good 37
  • Love 8
  • Love 59

My only accounts are here and on M2D, Don't trust anyone else from other shitty sites.
266868740522639360.png

Link to comment
Share on other sites

  • 9 months later...
On 4/19/2022 at 10:34 AM, MrQuin said:

.jpg
 

It's a method to see the dews & water potions affect icons on the affectshower using the python side only, It's bit late to share this but it's an idea given by a dear friend of mine long ago.

I tested this on both normal and extended blend system.

I uploaded guide  for easier implementation..

 

This is the hidden content, please
 / 
This is the hidden content, please

1@ ClientSource/UserInterface/InstanceBase.h:

Before:

			NEW_AFFECT_AUTO_HP_RECOVERY		= 534,

Add:

			NEW_AFFECT_BLEND = 531,

2@ ClientSource/UserInterface/PythonCharacterModule.cpp:

At the end of the file and before:

}

Add:

	PyModule_AddIntConstant(poModule, "NEW_AFFECT_BLEND", CInstanceBase::NEW_AFFECT_BLEND);

3@ ClientSource/UserInterface/PythonPlayerModule.cpp:

At the end of the file and before:

}

Add:

	PyModule_AddIntConstant(poModule, "RESIST_MAGIC",	POINT_RESIST_MAGIC);

3@ root/constInfo.py:

Add:

ENABLE_POTIONS_AFFECTSHOWER = 1 ## 0=Disable / 1=Enable

4@ root/uiAffectShower.py:

Add at top of the file:

import constInfo

Search:

	MALL_DESC_IDX_START = 1000

Add:

	if constInfo.ENABLE_POTIONS_AFFECTSHOWER:
		## As long the values arent reserved
		WATER_DESC_IDX_START = 1100
		DEW_DESC_IDX_START = 1200
		

 

Search:

	chr.NEW_AFFECT_DRAGON_SOUL_DECK2: (localeInfo.TOOLTIP_DRAGON_SOUL_DECK2, "d:/ymir work/ui/dragonsoul/buff_ds_land1.tga",),

Add:

	if constInfo.ENABLE_POTIONS_AFFECTSHOWER:
		AFFECT_DATA_DICT[WATER_DESC_IDX_START+player.POINT_PENETRATE_PCT] = (localeInfo.TOOLTIP_APPLY_PENETRATE_PCT, 	"icon/item/50813.tga")
		AFFECT_DATA_DICT[WATER_DESC_IDX_START+player.POINT_CRITICAL_PCT] = (localeInfo.TOOLTIP_APPLY_CRITICAL_PCT, 	"icon/item/50814.tga")
		AFFECT_DATA_DICT[WATER_DESC_IDX_START+player.ATT_BONUS] = (localeInfo.TOOLTIP_ATT_GRADE, 			"icon/item/50817.tga")
		AFFECT_DATA_DICT[WATER_DESC_IDX_START+player.DEF_BONUS] = (localeInfo.TOOLTIP_DEF_GRADE, 			"icon/item/50818.tga")
		AFFECT_DATA_DICT[WATER_DESC_IDX_START+player.RESIST_MAGIC] = (localeInfo.TOOLTIP_MAGIC_DEF_GRADE, 		"icon/item/50819.tga")
		AFFECT_DATA_DICT[WATER_DESC_IDX_START+player.ATT_SPEED] = (localeInfo.TOOLTIP_ATT_SPEED, 			"icon/item/50820.tga")
		AFFECT_DATA_DICT[DEW_DESC_IDX_START+player.POINT_CRITICAL_PCT] = (localeInfo.TOOLTIP_APPLY_CRITICAL_PCT, 	"icon/item/50821.tga")
		AFFECT_DATA_DICT[DEW_DESC_IDX_START+player.POINT_PENETRATE_PCT] = (localeInfo.TOOLTIP_APPLY_PENETRATE_PCT, 	"icon/item/50822.tga")
		AFFECT_DATA_DICT[DEW_DESC_IDX_START+player.ATT_SPEED] = (localeInfo.TOOLTIP_ATT_SPEED, 			"icon/item/50823.tga")
		AFFECT_DATA_DICT[DEW_DESC_IDX_START+player.RESIST_MAGIC] = (localeInfo.TOOLTIP_RESIST_MAGIC, 			"icon/item/50824.tga")
		AFFECT_DATA_DICT[DEW_DESC_IDX_START+player.ATT_BONUS] = (localeInfo.TOOLTIP_ATT_GRADE, 			"icon/item/50825.tga")
		AFFECT_DATA_DICT[DEW_DESC_IDX_START+player.DEF_BONUS] = (localeInfo.TOOLTIP_DEF_GRADE, 			"icon/item/50826.tga")
		AFFECT_DATA_DICT[DEW_DESC_IDX_START+player.ENERGY] = (localeInfo.TOOLTIP_ENERGY, 			"icon/item/51002.tga")

Do this next step twice(Inside def BINARY_NEW_AddAffect & def BINARY_NEW_RemoveAffect) :

After:

		if type == chr.NEW_AFFECT_MALL:
			affect = self.MALL_DESC_IDX_START + pointIdx

Add:

		elif constInfo.ENABLE_POTIONS_AFFECTSHOWER and type == chr.NEW_AFFECT_EXP_BONUS_EURO_FREE:
			affect = self.WATER_DESC_IDX_START + pointIdx
		elif constInfo.ENABLE_POTIONS_AFFECTSHOWER and type == chr.NEW_AFFECT_BLEND:
			affect = self.DEW_DESC_IDX_START + pointIdx

## Note: If you want to use the dews & water potions together!
## If you use the water potions before the dews(specifically Mong Water == 50819), You won't be able to use any of the dews.

@ GameSource/char_item.cpp:

Search:

		case ITEM_BLEND:

Replace:

					if (FindAffect(AFFECT_EXP_BONUS_EURO_FREE, POINT_RESIST_MAGIC))
					{
						ChatPacket(CHAT_TYPE_INFO, LC_TEXT("This effect is already activated."));
					}
					else
					{
						AddAffect(affect_type, apply_type, apply_value, 0, apply_duration, 0, false);
						item->SetCount(item->GetCount() - 1);
					}

With:

					AddAffect(affect_type, apply_type, apply_value, 0, apply_duration, 0, false);
					item->SetCount(item->GetCount() - 1);

 

You can do the same for the Dragon god affects(Affect 510==NEW_AFFECT_MALL).

Hi, thanks for the release! Unfortunately in my client the icons of the dews are displayed but not of the waters, can you help me? Syerr is empty!
EDIT: Fixed: Icon files were missing in my client

Edited by 4peppe
  • Good 1
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.