June 8, 20187 yr Hi all I'm writing a script which requires the player to attack an NPC and lure it to a safespot. Doing so involves my player leaving the safespot to find the monster, attacking it, running to a certain place then running to the safespot. There are several of this NPC in my general fight area, and I am trying to ensure that once I attack it it becomes my NPC (rather than just a NPC) which I lure and attack. This is to avoid attacking an NPC, running to my first spot then attempting to fight another one. Is there a way I can segregate an NPC which I attack, but am then subsequently not fighting (or necessarily being attacked by as I run away) so that my script keeps focus on that NPC? Thanks in advance Chris
June 8, 20187 yr 4 hours ago, Criboo said: Hi all I'm writing a script which requires the player to attack an NPC and lure it to a safespot. Doing so involves my player leaving the safespot to find the monster, attacking it, running to a certain place then running to the safespot. There are several of this NPC in my general fight area, and I am trying to ensure that once I attack it it becomes my NPC (rather than just a NPC) which I lure and attack. This is to avoid attacking an NPC, running to my first spot then attempting to fight another one. Is there a way I can segregate an NPC which I attack, but am then subsequently not fighting (or necessarily being attacked by as I run away) so that my script keeps focus on that NPC? Thanks in advance Chris Just store the NPC as a global variable so you can access it later.
June 10, 20187 yr When you select your npc just save it in a variable like Explv said then interact with it after you move to the safe spot NPC npcToSafeSpot = getNpcs().closest("NPC NAME"); getWalking().webWalk(SafeSpot); npcToSafeSpot.interact("Attack");
June 11, 20187 yr 18 hours ago, billyboy420 said: When you select your npc just save it in a variable like Explv said then interact with it after you move to the safe spot NPC npcToSafeSpot = getNpcs().closest("NPC NAME"); getWalking().webWalk(SafeSpot); npcToSafeSpot.interact("Attack"); It would need to be a global variable. So something like this: private NPC npc; npc = getNpcs().closest("NPC"); if (safespot does not contain our player) { if (getWalking().webWalk(safespot) // sleep until whatever } else { if (npc != null) { // attack npc } } Edited June 11, 20187 yr by HeyImJamie
June 11, 20187 yr 23 minutes ago, aftabdear said: If this is for Callisto gl ? On 6/8/2018 at 2:09 PM, Criboo said: There are several of this NPC in my general fight area
Create an account or sign in to comment