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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and 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..