New NPCAi for "Fighter"-NPCs

Want to discuss changes to the UOX3 source code? Got a code-snippet you'd like to post? Anything related to coding/programming goes here!
Post Reply
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

New NPCAi for "Fighter"-NPCs

Post by Xuri »

So... I'm thinking about adding a new NPCai for valiant monster/criminal-slaying NPCs that aren't guards, which is basically a carbon copy of the guard-ai, only without the being summoned on crimes-part, without teleporting after their target, and without yelling "Halt!" every time they attack someone.

I'm testing it right now, added a new ai to enums.h which I called aiFIGHTER, with an NPCAI value of 5, and added it to void CheckAi() in ai.cpp. One problem I've run into is with the NPCs not changing to new targets, just standing around in combat mode, especially if there have been lots of NPCs fighting the same monster. Though I'm not sure if this is related to the new ai or to some global bug in combat for NPCs.

Thoughts?
-= Ho Eyo He Hum =-
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

Sounds good.

Not sure why it isn't switching targets, try to see if it only affects that NPCAI, or if it's all NPC's.
Scott
Post Reply