Jump to content
  • 0

[Help] Pets dont hit Characters


Question

Posted

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;

9 answers to this question

Recommended Posts

  • 0
Posted

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

  • 0
Posted

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.

  • 0
Posted

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?

  • 0
Posted

Same packet, top bottom, you got useSkill() method.

 

No useSkill() method.

Only: doCast

  • 0
Posted

From not reworked IL to last beta HI5, it's useSkill().

 

I still talk of RequestActionUse clientpacket.

 

Fixed, close the topic :)

Thanx Rizel and Thanx Tryskell :)

Guest
This topic is now closed to further replies.


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock