Jump to content

How to make GM not being able to attack players while using /inv ?


Go to solution Solved by Syreldar,

Recommended Posts

  • Premium
  • Solution

1. Clientside:

Srcs/Client/InstanceBase.cpp

bool CInstanceBase::IsAttackableInstance(CInstanceBase& rkInstVictim)
{
	//
	else if (IsPC())
	{
		if (rkInstVictim.IsStone())
			return true;

		if (rkInstVictim.IsPC())
		{
			// ADD This here:
			if (IsAffect(AFFECT_INVISIBILITY))
				return false;
	//
//

 

2. Serverside:

Srcs/game/src/pvp.cpp:

bool CPVPManager::CanAttack(LPCHARACTER pkChr, LPCHARACTER pkVictim)
{
	//
	if (pkChr == pkVictim) // ³»°¡ ³¯ Ä¥¶ó°í ÇÏ³× -_-
		return false;

	if (pkVictim->IsNPC() && pkChr->IsNPC() && !pkChr->IsGuardNPC())
		return false;

	// Add this here:
	if (pkChr->IsAffectFlag(AFF_INVISIBILITY) && pkVictim->IsPC())
		return false;
	//
//

 

"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
1 minute ago, ReFresh said:

@Rev Arena Don't forget to add a IsGM() check to have that working only for GameMasters.

 

AFF_INVISIBILITY Is the affect given by /inv, Ninjas have EUNHYUNG. So it's not necessary.

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

11 minutes ago, Rev Arena said:

Thank you!!  

Also: i have a question about a post i've seen here a long ago but i can;t find it anymore.

If ninja on Stealth mode or /inv command used the mobs not to attack you anymore.

do you know the post or the fix for it?

i found it! 😄

Just now, ReFresh said:

@SyreldarI'm not 100% sure, but in game is one fish & item, which can give you invisibility and it's probably using the AFF_INVISIBILITY too.

i tested it without any code modifications on ninja's EUNHYUNG, also game master and vip's /inv (which is based as an extension of staff priviledges (isGM and isVIP) and it works fine.

I haven't tested on fish/item

Link to comment
Share on other sites

  • Premium
2 minutes ago, ReFresh said:

@SyreldarI'm not 100% sure, but in game is one fish & item, which can give you invisibility and it's probably using the AFF_INVISIBILITY too.

Yes, USE_INVISIBILITY. But I am pretty sure he also wanted that taken into account, after all taking damage and bouncing left and right while seeing no one hitting you looks pretty bad.

  • 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

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.