Jump to content

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

  • Good 1
  • Love 15
Link to comment
Share on other sites

  • 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
Share on other sites

  • 2 weeks later...
  • 6 months later...

 

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
Share on other sites

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
Share on other sites

  • 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 6
Link to comment
Share on other sites

  • 5 years later...
  • Honorable Member

Someone linked me this old topic, and I figured out I never noticed those sounds played twice.

This is my fix: (PythonNetworkStreamPhaseGameItem.cpp)E39vQcY.png

There's no need to play those sounds.

Alternatively (based on penger's but via apply check): (but it's not of my taste) (PythonItem.cpp)

C981u9D.png
 

				case CItemData::USE_ABILITY_UP:
					if (c_rkItemData.GetValue(0) == CItemData::APPLY_MOV_SPEED || c_rkItemData.GetValue(0) == CItemData::APPLY_ATT_SPEED)
						return USESOUND_NONE;
					return USESOUND_POTION;

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
  • Good 1
  • Love 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.