Jump to content
  • 0

[Help] Pets dont hit Characters


FFs

Question

Hi, i need some help here.

Tryskell tryed to explain me that but i dont understand it so much :S

I need help to make the pets dont hit the players.

I think something like:

 

if L2Character,
  pet can hit=false;
  return;

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

if L2Character,
 pet can hit=false;
 return;

this i will tell you is just an example: you need something like:

boolean canhit = false
if (this instanceof L2PetInstance)
canhit = false;

if (!x.canhit)
return;

 

Now, where to add them i can't tell you i dont have eclipse to explain you now. but that's the way i think

Link to comment
Share on other sites

  • 0

if L2Character,
 pet can hit=false;
 return;

this i will tell you is just an example: you need something like:

boolean canhit = false
if (this instanceof L2PetInstance)
canhit = false;

if (!x.canhit)
return;

 

Now, where to add them i can't tell you i dont have eclipse to explain you now. but that's the way i think

 

<______________________________< It's not really better than FFs "idea code".

 


 

RequestActionUse clientpacket, search for case 22: // Attack (pet attack)

 

You got the whole code about the "green attack button" from pet panel.

 

The 3 useful variables are pet, activeChar and target. There are already many checks in this part of code you can compare and code your idea using it.

Link to comment
Share on other sites

  • 0

Thanx, my friend Rizel helped me and it works with this code:

		if(this instanceof L2PetInstance && target instanceof L2PcInstance)
			return;

 

But now i need pets dont hit with skills.

How i do that or where i put this code?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...