Jump to content

Fix: Sura weapon and Shaman


Recommended Posts

  • Active Member

Hello,

In this I fixed several problems

Now with the new method the problems have all been solved

[Please it has been tested before publishing]

1) OPEN char_affect.cpp
search:
void CHARACTER::RemoveBadAffect()
{
  ..........
}

Change with:

void CHARACTER::RemoveBadAffect()
{
	for (auto it = 0; it < SKILL_MAX_NUM; it++)
	{
		const CAffect * pkAff = FindAffect(it);
		if (pkAff)
		{
			switch (it)
			{
				case AFFECT_FIRE:
				{
					RemoveAffect (AFFECT_FIRE);
					event_cancel(&m_pkFireEvent);
					break;
				}
				case AFFECT_POISON:
				{
					RemoveAffect (AFFECT_POISON);
					event_cancel(&m_pkPoisonEvent);
					break;
				}
				case AFFECT_STUN:
				case AFFECT_SLOW:
				case SKILL_TUSOK:
				{
					RemoveAffect (it);
					break;
				}
			}
		}
	}

	ComputePoints();
	UpdatePacket();
}

--------------------
  ----------

2. search:
void CHARACTER::RemoveGoodAffect()
{
  ..........
}

change with:

void CHARACTER::RemoveGoodAffect()
{
	for (auto it = 0; it < SKILL_MAX_NUM; it++)
	{
		const CAffect * pkAff = FindAffect(it);
		if (pkAff)
		{
			switch (it)
			{
				case AFFECT_MOV_SPEED:
				case AFFECT_ATT_SPEED:
				case AFFECT_STR:
				case AFFECT_DEX:
				case AFFECT_INT:
				case AFFECT_CON:
				case AFFECT_CHINA_FIREWORK:
				case SKILL_JEONGWI:
				case SKILL_GEOMKYUNG:
				case SKILL_CHUNKEON:
				case SKILL_EUNHYUNG:
				case SKILL_GYEONGGONG:
				case SKILL_GWIGEOM:
				case SKILL_TERROR:
				case SKILL_JUMAGAP:
				case SKILL_MANASHILED:
				case SKILL_HOSIN:
				case SKILL_REFLECT:
				case SKILL_GICHEON:
				case SKILL_KWAESOK:
				case SKILL_JEUNGRYEOK:
				{
					RemoveAffect (it);
					break;
				}
			}
		}
	}

	ComputePoints();
	UpdatePacket();
}

 

 

 

(If you haven't solved the UpdatePacket and ComputePoints issues please don't use this method)

(90% people have martysama and owsap serverfiles there is no problem)

 

I worked many hours to fix all the problems from the fix @ Syreldar

it has been tested before I publish it  (I Have test and in martysama serverfiles and in Owsap to be sure it will work properly)

 

thanks you.

 

Edited by Draveniou1
  • Metin2 Dev 1
  • Love 1
Link to comment
Share on other sites

  • Active Member
4 minutes ago, Gurgarath said:

Hello,

Why would you do this? It is a less performant version of what Syreldar already shared.

Thank you for your release however

@ Syreldar  good fix  only have 2-5 problem's  with removed affect and stackable bonus i find full bug 

I have configured his fix and it has been tested on quite a few people before it is published 

 

 

Link to comment
Share on other sites

  • Active Member
const std::vector<WORD> BadAffects =
{
	AFFECT_FIRE,
	AFFECT_POISON,
	AFFECT_STUN,
	AFFECT_SLOW,
	SKILL_TUSOK
};

void CHARACTER::RemoveBadAffect()
{
	for (auto it : BadAffects)
	{
		auto pkAff = FindAffect(it);
		auto pkAffoff = RemoveAffect(it);
		if (pkAff)
		{
			switch (it)
			{
				case AFFECT_FIRE:
				{
					event_cancel(&m_pkFireEvent);
					break;
				}
				case AFFECT_POISON:
				{
					event_cancel(&m_pkPoisonEvent);
					break;
				}
				pkAffoff;
				break;
			}
		}
	}

	ComputePoints();
	UpdatePacket();
}



---------------------------------------
  ---------------------------------
  ---------------------------------
  const std::vector<WORD> GoodAffects =
{
	AFFECT_MOV_SPEED,
	AFFECT_ATT_SPEED,
	AFFECT_STR,
	AFFECT_DEX,
	AFFECT_INT,
	AFFECT_CON,
	AFFECT_CHINA_FIREWORK,
	SKILL_JEONGWI,
	SKILL_GEOMKYUNG,
	SKILL_CHUNKEON,
	SKILL_EUNHYUNG,
	SKILL_GYEONGGONG,
	SKILL_GWIGEOM,
	SKILL_TERROR,
	SKILL_JUMAGAP,
	SKILL_MANASHILED,
	SKILL_HOSIN,
	SKILL_REFLECT,
	SKILL_GICHEON,
	SKILL_KWAESOK,
	SKILL_JEUNGRYEOK
};

void CHARACTER::RemoveGoodAffect()
{
	for (auto it : GoodAffects)
	{
		auto pkAff = FindAffect(it);
		auto pkAffofef = RemoveAffect(it);
		if (pkAff)
		{
			pkAffofef;
		}
	}

	ComputePoints();
	UpdatePacket();
}

@ Gurgarath It can also be done like this

It has not been tested, maybe I will test it soon

I like it that way

 

Link to comment
Share on other sites

  • Premium

The fix I posted 5 years ago has been thoroughly tested by many users, myself included.

There's no problem whatsoever, but feel free to use whatever suits you best.

Edited by Syreldar

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Active Member
Just now, Syreldar said:

The fix i posted has been thoroughly tested by many users, myself included.

There's no problem whatsoever, but feel free to use whatever suits you best.

i have your fix  i have  problem's

1o problem = warrior skill not clear  why?

2o problem = if have pottion stackable why ?

 

i don't know and in another serverfiles have game.core 

i have remade your fix and it works on all server files without problems this

Link to comment
Share on other sites

  • Premium
1 minute ago, Draveniou1 said:

i have your fix  i have  problem's

1o problem = warrior skill not clear  why?

I made 2 .gifs after coding the fix, you can find them in the topic.

It shows that warrior skills clear just fine.

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Active Member
4 minutes ago, Syreldar said:

I made 2 .gifs after coding the fix, you can find them in the topic.

It shows that warrior skills clear just fine.

You didn't understand, for example some serverfiles don't accept your fix 

I have added your fix to some server files and there are problems 

check video for you see problem .gif

 

this problem exists in many servers 

but your solution is still the best as long as you find the serverfiles to match it

@ SyreldarFor example  download fliege serverfiles or another serverfiles and check your fix with your method and the my method and you see

Link to comment
Share on other sites

  • Premium
13 minutes ago, Draveniou1 said:

You didn't understand, for example some serverfiles don't accept your fix 

I have added your fix to some server files and there are problems 

check video for you see problem .gif

 

this problem exists in many servers 

but your solution is still the best as long as you find the serverfiles to match it

The change I posted has been tested on default mainlines, like all the releases I made.

Also, I believe the code I changed is the same on every rev that has been leaked 9 years ago.

In short, there's nothing wrong with my release.

 

By the gif you just sent I believe the updatepacket is failing.

Try to redo my changes except inside the RemoveAffect function use this code instead of the one you find in the release.
 

    if (single)
        if (AFFECT_REVIVE_INVISIBLE != pkAff->dwType)
            ComputePoints();
        else
            UpdatePacket();
    else
        UpdatePacket();

 

Edited by Syreldar

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Active Member
1 minute ago, Syreldar said:

The change I posted has been tested on default mainlines, like all the releases I made.

Also, I believe the code I changed is the same on every rev that has been leaked 9 years ago.

In short, there's nothing wrong with my release.

i know your fix is ok as we give a chance to add people who have had such problems to their files 

some don't want mainline or main sources

I never said that your solution is not good I have seen these errors on 20 small servers Also the solution I suggested has already helped some people

Link to comment
Share on other sites

  • Premium
1 minute ago, Draveniou1 said:

i know your fix is ok as we give a chance to add people who have had such problems to their files 

some don't want mainline or main sources

I never said that your solution is not good I have seen these errors on 20 small servers Also the solution I suggested has already helped some people

Read my message again, if possible.

  • Good 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Active Member
3 minutes ago, Syreldar said:

Read my message again, if possible.

    if (single)
        if (AFFECT_REVIVE_INVISIBLE != pkAff->dwType)
            ComputePoints();
        else
            UpdatePacket();
    else
        UpdatePacket();

 

Why are there 2 NULL? if it is suddenly activated to true what will happen?

Link to comment
Share on other sites

  • Premium
5 minutes ago, Draveniou1 said:
    if (single)
        if (AFFECT_REVIVE_INVISIBLE != pkAff->dwType)
            ComputePoints();
        else
            UpdatePacket();
    else
        UpdatePacket();

 

Why are there 2 NULL? if it is suddenly activated to true what will happen?

wdym?

As you can read, the change I made adds an arg to the RemoveAffect function.

The purpose of this arg is to make the func call behave differently based on an arbitrary condition, in this case we need it to not execute the ComputePoints() call inside the function, cause we need to only call it once AFTER all the good/bad affects have been cleared, so we do that at the end of their respecting funcs.

I have already stated why we need to do that in the topic, it's cause ComputePoints() is a "heavy" function, and it will lag a bit by itself already, so calling it once per affect to clear is not only useless but is also what causes the lag we're talking about.

Edited by Syreldar
  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Active Member
2 minutes ago, Syreldar said:

wdym?

As you can read, the change I made adds an arg to the RemoveAffect function.

The purpose of this arg is to make the func call behave differently based on an arbitrary condition, in this case we need to not execute the ComputePoints() call inside the function cause we need to only make it once, after all the good/bad affects have been cleared.

I have already wrote why we need to do that in the topic, because ComputePoints() is a "heavy" function, and it will lag a big by itself, so calling it once per affect to clear is not only useless but is also what causes the lag we're talking about.

I will test on these now and come back with newer ones

Link to comment
Share on other sites

  • Premium
Just now, Draveniou1 said:

I will test on these now and come back with newer ones

If you have issues, contact me on discord instead of writing here. It's simpler.

  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Premium

I solved the issue he had and updated my topic to match the change.

  • Metin2 Dev 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

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.