• 0
Mind Rapist

open Shaman buff target visual bug

Question

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?

 

  • Like 1

Share this post


Link to post
Share on other sites

19 answers to this question

  • 0

https://i.gyazo.com/7bb0ef9ad1b90e89778abdd3b5652bef.mp4

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😊

  • Like 1
  • Thanks 2

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0
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?

Share this post


Link to post
Share on other sites
  • 0

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

  • Thanks 2

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.