Jump to content
×
×
  • Create New...
  • 0

BUFF AFFECT AFTER DEAD


EnVyUs

Question

4 answers to this question

Recommended Posts

  • 0
  • Premium

Gotta check on char_affect.cpp for IS_NO_CLEAR_ON_DEATH_AFFECT, and add the buffs you want to stay after the character's death. Be aware that in this case, the buffs will stay on even in PvP. If you wanna avoid that, on the top of my head, you could do this:

go on char_battle.cpp and search for ClearAffect(true); in void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead) and edit the line like this:

if (pkKiller && IsPC())
	ClearAffect(true, true);
else
	ClearAffect(true, false);

then edit void CHARACTER::ClearAffect(bool bSave) in char_affect.cpp into:
 

void CHARACTER::ClearAffect(bool bSave, bool bIsPC)

then in the function check for while (it != m_list_pkAffect.end()) and edit like this:

	while (it != m_list_pkAffect.end())
	{
		CAffect * pkAff = *it;

		if (bSave)
		{
			if(bIsPC)
			{
				if ( IS_NO_CLEAR_ON_DEATH_AFFECT_PC(pkAff->dwType) || 
				IS_NO_SAVE_AFFECT(pkAff->dwType)) //add the others that you might previously have had
				{
					++it;
					continue;
				}
			}
			else if(!bIsPC)
			{
				if ( IS_NO_CLEAR_ON_DEATH_AFFECT(pkAff->dwType) || 
				IS_NO_SAVE_AFFECT(pkAff->dwType)) //add the others that you might previously have had
				{
					++it;
					continue;
				}
			}
			if (IsPC())
			{
				SendAffectRemovePacket(GetDesc(), GetPlayerID(), pkAff->dwType, pkAff->bApplyOn, pkAff->dwFlag);
			}
		}
		ComputeAffect(pkAff, false);

		it = m_list_pkAffect.erase(it);
		CAffect::Release(pkAff);
	}

	if (afOld != m_afAffectFlag ||
			wMovSpd != GetPoint(POINT_MOV_SPEED) ||
			wAttSpd != GetPoint(POINT_ATT_SPEED))
		UpdatePacket();

	CheckMaximumPoints();

	if (m_list_pkAffect.empty())
		event_cancel(&m_pkAffectEvent);
}

Copy IS_NO_CLEAR_ON_DEATH_AFFECT into a new line and edit the name into IS_NO_CLEAR_ON_DEATH_AFFECT_PC where you remove the buffs that you want to remove in PvP.

And finally, edit the function in char.h:

void			ClearAffect(bool bSave=false, bool bIsPC = false);

 

 

might also wanna check where ClearAffect is used and edit as you see fit

Edited by xXIntelXx
Link to comment
Share on other sites

  • 0

I've edited the ClearAffect function the way you said. (it was already did btw, but tried with your solution) and the problem is the same, when i die it disappears from the corner, but if i get up and unequip my armor i get it back. so on ChangeArmor it gets back.

Link to comment
Share on other sites

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Metin2 Dev Github
  • Activity

    1. 7

      Wear (use) item only on specific map

    2. 4

      Python tool for analyzing average yang drop per hour in each map.

    3. 162

      Plechito - Halloween 2022

    4. 0

      disable quest esc

    5. 7

      Wear (use) item only on specific map

    6. 7

      Wear (use) item only on specific map

    7. 7

      Wear (use) item only on specific map

    8. 4

      max level exp

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.