EOSERV Forum > Client Editing > Help making a static npc attack
Topic is locked.
Page: << 1 >>
Help making a static npc attack
Author Message
Post #193866 Help making a static npc attack

I have this in my npc.cpp not sure what I am missing, can anyone help?


if (this->spawn_type == 7)



 if(this->Data()->type == ENF::Unknown3)


{


  UTIL_PTR_LIST_FOREACH(this->characters, Character, character)


  {


    int distance = util::path_length(this->x, this->y, character->x,character->y);


    if(character && distance < 2)


   {


     this->Attack(character);


   }


}

return;

}

10 years, 47 weeks ago
Post #193867 Re: Help making a static npc attack

post the whole npc.cpp

---
https://www.youtube.com/watch?v=d_DFVzxsEUc
10 years, 47 weeks ago
Post #193874 Re: Help making a static npc attack

It should be fairly simple. You just need to take out the part that keeps it from going through the rest of the Act function if it's type 7. Then just make sure to make sure it doesn't allow it to move on the parts where it walks towards it's target and random movement. I'm sure you're using an older revision though so if you could, just post the NPC::Act() function.

That part you posted just seems too hacky. 3:

10 years, 47 weeks ago
Post #193877 Re: Help making a static npc attack
Ryouken posted: (7th Jun 2013, 03:42 am)

It should be fairly simple. You just need to take out the part that keeps it from going through the rest of the Act function if it's type 7. Then just make sure to make sure it doesn't allow it to move on the parts where it walks towards it's target and random movement. I'm sure you're using an older revision though so if you could, just post the NPC::Act() function.

That part you posted just seems too hacky. 3:


I sent you a message, Ryouken.
---
Want to learn to pixel?
Pixelsource.org
10 years, 47 weeks ago
Page: << 1 >>
Topic is locked.
EOSERV Forum > Client Editing > Help making a static npc attack