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

BUFF AFFECT AFTER DEAD


EnVyUs

Question

4 answers to this question

Recommended Posts

  • 0

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

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


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.