Jump to content

Shaman buff target visual bug


Recommended Posts

I'm having the bug showing on the video (watch left window). The shaman targets an NPC, therefore, if she performs a buff skill, she will get the buff. But only her client will see the skill's effect on her body, everybody else will see the effect on the NPC's body. Can someone post or link a fix please?

 

  • Love 1
Link to comment
Share on other sites

  • 2 weeks later...

https://metin2.download/picture/b4wxFK1o6jS4VUU2E2M2mQiochsU9fsh/.gif

How it works:
When player is trying to use buffs on npc/enemy then mouse target is automatically set to main character VID 
(You can't buff npc/enemy anyway from server side + You can't change target while using skills)


UserInterface/PythonPlayerSkill.cpp

Search:

bool CPythonPlayer::__UseSkill(DWORD dwSlotIndex)


Scroll down and search for:

		if (!pkInstTarget)
		{
			// ľ÷µĄŔĚĆ®ÇĎ°í..
			__ChangeTargetToPickedInstance();

			// ´Ů˝Ă ľňľîł˝´Ů.
			if (pSkillData->IsNeedCorpse())
				pkInstTarget=__GetDeadTargetInstancePtr();
			else
				pkInstTarget=__GetAliveTargetInstancePtr();
		}


Under:

if (pkInstTarget)


Paste this:

			if ((pkInstTarget->IsNPC() ||
				pkInstTarget->IsEnemy() ||
				pkInstTarget->IsStone() ||
				pkInstTarget->IsStoneDoor()) && pSkillData->IsOnlyForAlliance())
			{
				DWORD TargetVid = pkInstMain->GetVirtualID();
				SetTarget(TargetVid, TRUE);
			}

Should look like this:
fix.png

This is my way to solve the problem?

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
  • Love 3

I completely abandoned working on the files for this game. I do not respond to private messages.

.png

Link to comment
Share on other sites

7 hours ago, Mind Rapist said:

Exactly what I was looking for :D

It works perfectly!!! Struggled a bit but I added IsSameEmpire and IsPvPInstance and added custom check for looking position.

Thank you man finally :D

thank-you-meme-01.jpg

Can you share your edit with us here?

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

You want the full fix? Here it is:

if (pkInstTarget)
		{
			if ((pkInstTarget->IsNPC() ||
				pkInstTarget->IsEnemy() ||
				pkInstTarget->IsStone() ||
				!pkInstMain->IsSameEmpire(*pkInstTarget) ||
				pkInstMain->IsPVPInstance(*pkInstTarget) ||
				pkInstTarget->IsStoneDoor()) && pSkillData->IsOnlyForAlliance())
			{
				DWORD TargetVid = pkInstMain->GetVirtualID();
				SetTarget(TargetVid, TRUE);
			}

			if (pSkillData->IsOnlyForAlliance())
			{
              ...

Also change this if statement:

if (pkInstMain != pkInstTarget)

to:

if (pkInstMain != pkInstTarget)
			{
				if (!pSkillData->IsOnlyForAlliance() ||
					(pSkillData->IsOnlyForAlliance() &&
					(!pkInstTarget->IsNPC() ||
						!pkInstTarget->IsEnemy() ||
						!pkInstTarget->IsStone() ||
						pkInstMain->IsSameEmpire(*pkInstTarget) ||
						!pkInstMain->IsPVPInstance(*pkInstTarget) ||
						!pkInstTarget->IsStoneDoor())))
				{
					if (pkInstMain->IsFlyTargetObject())
					{
						pkInstMain->NEW_LookAtFlyTarget();
					}
					else
					{
						pkInstMain->NEW_LookAtDestInstance(*pkInstTarget);
					}
				}
			}

and this:

if (pSkillData->CanChangeDirection())

to:

if (pSkillData->CanChangeDirection())
	{
		DWORD dwPickedActorID;
		TPixelPosition kPPosPickedGround;

		if (!pSkillData->IsOnlyForAlliance() ||
			(pSkillData->IsOnlyForAlliance() &&
			(!pkInstTarget->IsNPC() ||
				!pkInstTarget->IsEnemy() ||
				!pkInstTarget->IsStone() ||
				pkInstMain->IsSameEmpire(*pkInstTarget) ||
				!pkInstMain->IsPVPInstance(*pkInstTarget) ||
				!pkInstTarget->IsStoneDoor())))
		{
			if (pkInstTarget && pkInstTarget != pkInstMain)
			{
				pkInstMain->NEW_LookAtDestInstance(*pkInstTarget);
			}
			else if (__GetPickedActorID(&dwPickedActorID))
			{
				CInstanceBase* pkInstVictim = NEW_FindActorPtr(dwPickedActorID);
				if (pkInstVictim)
					pkInstMain->NEW_LookAtDestInstance(*pkInstVictim);
			}
			else if (__GetPickedGroundPos(&kPPosPickedGround))
			{
				pkInstMain->NEW_LookAtDestPixelPosition(kPPosPickedGround);
			}
			else
			{
				Tracenf("CPythonPlayer::__UseSkill(%d) - Θ­Έι ±βΑΨ ΉζΗβ Ό³Α¤ΐ» ΗΨΎίΗΤ", dwSlotIndex);
			}
		}
	}

Best regards

  • Love 5
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

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.