Jump to content
Forgot your email address? ×
×
×
  • Create New...

How To Enable Green & Purple Potions Effect


Recommended Posts

Hello devs.
 
I recently noticed that the green and purple potions doesn't send any effect so I decided to add one.
 
File: char_item.cpp
 
So let's begin, first of all find these two cases:
 

case APPLY_MOV_SPEED:
case APPLY_ATT_SPEED:

 
and under of each of them add this:
 

EffectPacket(SE_DXUP_PURPLE); //purple potion
EffectPacket(SE_SPEEDUP_GREEN); //green potion

 
After you do that search for this(this variable exists two times so you need to do this step two times):
 

AddAffect(AFFECT_NOG_ABILITY, POINT_MOV_SPEED, moveSpeedPer, AFF_MOV_SPEED_POTION, time, 0, true, true);

 
and under that add this:
 

EffectPacket(SE_DXUP_PURPLE);

 

Kind Regards

Legend

  • Love 13
  • Good 1
Link to comment
  • 1 month later...
  • 2 weeks later...
  • 3 weeks later...
								switch (item->GetValue(0))
								{
									case APPLY_MOV_SPEED:
										AddAffect(affect_type, apply_type, apply_value, AFF_MOV_SPEED_POTION, apply_duration, 0, true, true);
										EffectPacket(SE_DXUP_PURPLE); //purple potion
										break;

									case APPLY_ATT_SPEED:
										AddAffect(affect_type, apply_type, apply_value, AFF_ATT_SPEED_POTION, apply_duration, 0, true, true);
										EffectPacket(SE_SPEEDUP_GREEN); //green potion
										break;

									long time = item->GetValue(0);
									long moveSpeedPer	= item->GetValue(1);
									long attPer	= item->GetValue(2);
									long expPer			= item->GetValue(3);
									AddAffect(AFFECT_NOG_ABILITY, POINT_MOV_SPEED, moveSpeedPer, AFF_MOV_SPEED_POTION, time, 0, true, true);
									EffectPacket(SE_DXUP_PURPLE);
									AddAffect(AFFECT_NOG_ABILITY, POINT_MALL_ATTBONUS, attPer, AFF_NONE, time, 0, true, true);
									AddAffect(AFFECT_NOG_ABILITY, POINT_MALL_EXPBONUS, expPer, AFF_NONE, time, 0, true, true);
									item->SetCount(item->GetCount() - 1);



what wrong ?

Link to comment
  • 2 weeks later...
  • 6 months later...

It works.

But i didn't find it twice:

AddAffect(AFFECT_NOG_ABILITY, POINT_MOV_SPEED, moveSpeedPer, AFF_MOV_SPEED_POTION, time, 0, true, true);

But works, thanks :)

Edited by TheSLZ
Link to comment

 

AddAffect(AFFECT_NOG_ABILITY, POINT_MOV_SPEED, moveSpeedPer, AFF_MOV_SPEED_POTION, time, 0, true, true);
EffectPacket(SE_DXUP_PURPLE);
AddAffect(AFFECT_NOG_ABILITY, POINT_MALL_ATTBONUS, attPer, AFF_NONE, time, 0, true, true);
EffectPacket(SE_SPEEDUP_GREEN);
AddAffect(AFFECT_NOG_ABILITY, POINT_MALL_EXPBONUS, expPer, AFF_NONE, time, 0, true, true);
 ok?
Edited by thespeedy
Link to comment

so I have residential and work

3x

    case APPLY_MOV_SPEED:
    case APPLY_ATT_SPEED:

1,

                                case APPLY_MOV_SPEED:
                                    AddAffect(AFFECT_UNIQUE_ABILITY, POINT_MOV_SPEED, item->GetValue(2), AFF_MOV_SPEED_POTION, item->GetValue(1), 0, true, true);
                                    EffectPacket(SE_DXUP_PURPLE); //purple potion
                                    break;

                                case APPLY_ATT_SPEED:
                                    AddAffect(AFFECT_UNIQUE_ABILITY, POINT_ATT_SPEED, item->GetValue(2), AFF_ATT_SPEED_POTION, item->GetValue(1), 0, true, true);
                                    EffectPacket(SE_SPEEDUP_GREEN); //green potion
                                    break;

2,

                                    case APPLY_MOV_SPEED:
                                        AddAffect(affect_type, apply_type, apply_value, AFF_MOV_SPEED_POTION, apply_duration, 0, true, true);
                                        EffectPacket(SE_DXUP_PURPLE); //purple potion
                                        break;

                                    case APPLY_ATT_SPEED:
                                        AddAffect(affect_type, apply_type, apply_value, AFF_ATT_SPEED_POTION, apply_duration, 0, true, true);
                                        EffectPacket(SE_SPEEDUP_GREEN); //green potion
                                        break;

3,

                                case APPLY_MOV_SPEED:
                                    AddAffect(AFFECT_MOV_SPEED, POINT_MOV_SPEED, item->GetValue(2), AFF_MOV_SPEED_POTION, item->GetValue(1), 0, true);
                                    EffectPacket(SE_DXUP_PURPLE); //purple potion
                                    break;

                                case APPLY_ATT_SPEED:
                                    AddAffect(AFFECT_ATT_SPEED, POINT_ATT_SPEED, item->GetValue(2), AFF_ATT_SPEED_POTION, item->GetValue(1), 0, true);
                                    EffectPacket(SE_SPEEDUP_GREEN); //green potion
                                    break;

 

and 1x

AddAffect(AFFECT_NOG_ABILITY, POINT_MOV_SPEED, moveSpeedPer, AFF_MOV_SPEED_POTION, time, 0, true, true);

                                    AddAffect(AFFECT_NOG_ABILITY, POINT_MOV_SPEED, moveSpeedPer, AFF_MOV_SPEED_POTION, time, 0, true, true);
                                    EffectPacket(SE_DXUP_PURPLE); //purple potion
                                    AddAffect(AFFECT_NOG_ABILITY, POINT_MALL_ATTBONUS, attPer, AFF_NONE, time, 0, true, true);
                                    AddAffect(AFFECT_NOG_ABILITY, POINT_MALL_EXPBONUS, expPer, AFF_NONE, time, 0, true, true);

it works, thank you

  • Love 2
Link to comment
  • 1 year later...
  • Honorable Member

Here is a little fix to disable the double potion sounds (green & purple):

UI\PythonItem.cpp -> DWORD CPythonItem::__GetUseSoundType(const CItemData& c_rkItemData)
Search the case of the ability_up and replace it with this:
 

				case CItemData::USE_ABILITY_UP:
					{
						if ((c_rkItemData.GetIndex() == 27053 || c_rkItemData.GetIndex() == 27054) ||
							(c_rkItemData.GetIndex() >= 27100 && c_rkItemData.GetIndex() <= 27105) ||
							(c_rkItemData.GetIndex() >= 27110 && c_rkItemData.GetIndex() <= 27115))
							return USESOUND_NONE;
						else
							return USESOUND_POTION;
					}
					break;

This is an exception to block the playusesound when you are using an item from inventory:

netSendItemUsePacket -> CPythonNetworkStream::SendItemUsePacket -> __PlayInventoryItemUseSound

Because of the SpecificEffectPacket plays the sound of the potions as well.

  • Love 5
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Announcements

  • -15% Discount in Metin2 Dev Store (01/10/2021 => 31/12/2021) => Code => 15_PCT_OCT_TO_DEC_2021


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.