BlackDevilDev Posted May 15, 2016 Share Posted May 15, 2016 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 Quote Link to comment Share on other sites More sharing options...
0 BlackDevilDev Posted May 19, 2016 Author Share Posted May 19, 2016 (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 May 19, 2016 by BlackDevilDev Quote Link to comment Share on other sites More sharing options...
0 Sdw Posted May 19, 2016 Share Posted May 19, 2016 Cause it shouldn't be a L2Decoy. Crappy L2J way to handle AI is at fault. Quote Link to comment Share on other sites More sharing options...
0 BlackDevilDev Posted May 19, 2016 Author Share Posted May 19, 2016 (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 May 19, 2016 by BlackDevilDev Quote Link to comment Share on other sites More sharing options...
0 Sdw Posted May 19, 2016 Share Posted May 19, 2016 It has to use skills as well from time to time. Your best bet on mobius, I would say make a new Npc instance and write some AI there to do what you said. Quote Link to comment Share on other sites More sharing options...
0 BlackDevilDev Posted May 19, 2016 Author Share Posted May 19, 2016 (edited) Thank you very much ... I will try .. But just now i learn the basic class's of l2j Edited May 19, 2016 by BlackDevilDev Quote Link to comment Share on other sites More sharing options...
Question
BlackDevilDev
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
Link to comment
Share on other sites
20 answers to this question
Recommended Posts
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.