PDA

View Full Version : NPC vs NPC


Maceblade
07-22-2013, 08:08 PM
This may be stupid and im sorry, but simply im writing a script where I want NPC's to spawn and instantly start attacking one main NPC. Im trying to re-create the Capture of Kerafyrm and When all of Velious's named are spawned via event controller, I want them all to attack him. The part I need is the command where it tells the spawned to attack him and nothing or no one else.

wolfwalkereci
07-22-2013, 09:23 PM
Off the top of my head this might work without having to perl script or lua script the fight:

If the main mob has a faction set him to be able to agro other npc's.
Create a unique faction for the spawned npc's that will agro the main npc.
Set the spawned npc agro range to be large enough they will go after the main npc target.
Set the spawned npc special_abilities to whatever you require if you do not want players to harm it.

NatedogEZ
07-22-2013, 10:32 PM
Maybe give the spawning NPCs tunnel vision "NPC special attack" (which is 't' btw if you have old source ... '29' if you have new source for special attacks)


then have them search for the entity ID of the npc you want them to attack then just .... quest::attacknpc(int npc_entity_id)

Robregen
07-22-2013, 11:22 PM
or you can use quest::attacknpctype(npctype id)

Maceblade
07-22-2013, 11:38 PM
Awesome thanks alot guys!!

wolfwalkereci
07-23-2013, 01:05 AM
Yup, anytime. Dozens of ways to do anything and its interesting to see how everyone does it.