Jump to content

Recommended Posts

  • Active+ Member

Hey guys,

is here someone who can make this system?

How the system works?

When you hit a monster or monster is aggressive or monster just want go into a safe zone the system will detect it and send a block packet to the monster and monster will go to his spawn position.

Thanks for answers!

Sincerely,

ReFresh

I'll be always helpful!  😉

Link to comment
https://metin2.dev/topic/18190-new-system-idea/
Share on other sites

  • Active+ Member

@meneleos

If I did it right, it does not work.

Code:

Spoiler

	SECTREE	*vsectree = victim->GetSectree();
	if (vsectree)
	{
		if (vsectree->IsAttr(victim->GetX(), victim->GetY(), ATTR_BANPK))
		{
			SetVictim(NULL);
			return;
		}
	}

	if (!Attack(victim))    // °ř°Ý ˝ÇĆжó¸é? żÖ ˝ÇĆĐÇßÁö? TODO
		m_dwStateDuration = passes_per_sec / 2;
	else
	{
		// ŔűŔ» ąŮ¶óş¸°Ô ¸¸µç´Ů.
		SetRotationToXY(victim->GetX(), victim->GetY());

		SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0, dwCurTime);

		float fDuration = CMotionManager::instance().GetMotionDuration(GetRaceNum(), MAKE_MOTION_KEY(MOTION_MODE_GENERAL, MOTION_NORMAL_ATTACK));
		m_dwStateDuration = (DWORD) (fDuration == 0.0f ? PASSES_PER_SEC(2) : PASSES_PER_SEC(fDuration));
	}
}

 

 

I'll be always helpful!  😉

Link to comment
https://metin2.dev/topic/18190-new-system-idea/#findComment-99398
Share on other sites

On 05.03.2018 at 5:50 PM, ReFresh said:

@meneleos

If I did it right, it does not work.

Code:

  Reveal hidden contents


	SECTREE	*vsectree = victim->GetSectree();
	if (vsectree)
	{
		if (vsectree->IsAttr(victim->GetX(), victim->GetY(), ATTR_BANPK))
		{
			SetVictim(NULL);
			return;
		}
	}

	if (!Attack(victim))    // °ř°Ý ˝ÇĆжó¸é? żÖ ˝ÇĆĐÇßÁö? TODO
		m_dwStateDuration = passes_per_sec / 2;
	else
	{
		// ŔűŔ» ąŮ¶óş¸°Ô ¸¸µç´Ů.
		SetRotationToXY(victim->GetX(), victim->GetY());

		SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0, dwCurTime);

		float fDuration = CMotionManager::instance().GetMotionDuration(GetRaceNum(), MAKE_MOTION_KEY(MOTION_MODE_GENERAL, MOTION_NORMAL_ATTACK));
		m_dwStateDuration = (DWORD) (fDuration == 0.0f ? PASSES_PER_SEC(2) : PASSES_PER_SEC(fDuration));
	}
}

 

 

:huh:

  * not tried.

find

    LPCHARACTER pkChrProtege = GetProtege();
 

add top

	SECTREE	*vsectree = victim->GetSectree();
	if (vsectree)
	{
		if (vsectree->IsAttr(victim->GetX(), victim->GetY(), ATTR_BANPK))
		{
			SetVictim(NULL);
			m_dwStateDuration = PASSES_PER_SEC(1);
			return;
		}
	}

 

this

	SECTREE	*vsectree = victim->GetSectree();
	if (vsectree)
	{
		if (vsectree->IsAttr(victim->GetX(), victim->GetY(), ATTR_BANPK))
		{
			SetVictim(NULL);
			m_dwStateDuration = PASSES_PER_SEC(1);
			return;
		}
	}

	LPCHARACTER pkChrProtege = GetProtege();

 

try

Link to comment
https://metin2.dev/topic/18190-new-system-idea/#findComment-99444
Share on other sites

  • Honorable Member

Probably you can extend this for the FindVictim as well. I mean if an aggressive monster looks for a potential victim, it will skip the safe zone.

Trigger.cpp --> FuncFindMobVictim
 

Spoiler

31cc6311e2.png

Actually I am using this in the CHARACTER::Follow and works pretty well:

Spoiler

132569316f.png

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 4
Link to comment
https://metin2.dev/topic/18190-new-system-idea/#findComment-99704
Share on other sites

  • 2 weeks later...
  • Active+ Member

Here is a little problem, monsters can't get to the safezone, but the character is still their target so it will be good if someone know how to untarget this char who went to the safezone.

I'll be always helpful!  😉

Link to comment
https://metin2.dev/topic/18190-new-system-idea/#findComment-100069
Share on other sites

  • Premium
3 hours ago, ReFresh said:

Here is a little problem, monsters can't get to the safezone, but the character is still their target so it will be good if someone know how to untarget this char who went to the safezone.

SetVictim(NULL);

 

Link to comment
https://metin2.dev/topic/18190-new-system-idea/#findComment-100075
Share on other sites

  • Active+ Member
    SECTREE *tree = pkChr->GetSectree();
    if (tree && tree->IsAttr(pkChr->GetX(), pkChr->GetY(), ATTR_BANPK))
    {
        if (Return())
            SetVictim(NULL);
            return true;
    }

I have it like this and I'm still the target of mobs when I go out of the safezone.

I'll be always helpful!  😉

Link to comment
https://metin2.dev/topic/18190-new-system-idea/#findComment-100111
Share on other sites

  • Premium

If you teleport before mobs come nears to you in safezone, the mob will stay there so i think lent's code need to be used because it's on OnMove.

Tested, works.

    SECTREE * sectree = GetSectree();
 
    if (sectree && sectree->IsAttr(GetX(), GetY(), ATTR_BANPK) && IsMonster())
    {
        SetVictim(NULL);
        Return();
    }

 

Link to comment
https://metin2.dev/topic/18190-new-system-idea/#findComment-100116
Share on other sites

  • Premium
2 hours ago, ReFresh said:

@Dobrescu Sebastian Didn't work. Try to go out of the safezone :) Mobs will follow you.

AA i see now, it happens when you hit them, not if you use bravely cape. I will search for a fix.

  • Love 1
Link to comment
https://metin2.dev/topic/18190-new-system-idea/#findComment-100127
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.