Jump to content

Question

Posted
final L2DecoyInstance decoy = new L2DecoyInstance(npcTemplate, player, _despawnDelay);
				decoy.setCurrentHp(decoy.getMaxHp());
				decoy.setCurrentMp(decoy.getMaxMp());
				decoy.setHeading(player.getHeading());
				decoy.setInstanceId(player.getInstanceId());
				decoy.setSummoner(player);
				decoy.spawnMe(player.getX(), player.getY(), player.getZ());
				player.setDecoy(decoy);
				break;

This is part of code for npc type = L2Decoy . 

 

I want do that when player summon this type npc , attack the target (take target from player).

 

Any idea who can do that ? 

 

Thank you very much

Recommended Posts

  • 0
Posted (edited)

i try that all but dont attack . I use  "decoy.doAttack();" he do damage but not show the animation of movent stay to spawn and just do damage to object. I use a "while" in script ... Any idea how can movent work ?

 

tha npc don't remove stuck to world.

Edited by BlackDevilDev
  • 0
Posted (edited)

Cause it shouldn't be a L2Decoy. Crappy L2J way to handle AI is at fault.

 

Where i can focus ? For i make a npc , attack when a char have a target and when no target just follow ...

 

AbstractNpcAI is good idea?

Edited by BlackDevilDev
  • 0
Posted

It has to use skills as well from time to time.

 

dd066-clip-329kb.jpg?nocache=1

 

Your best bet on mobius, I would say make a new Npc instance and write some AI there to do what you said.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...