Update of /cvsroot/wpdev/wolfpack/ai
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13629/ai
Modified Files:
ai_monsters.cpp
Log Message:
GM control for npcs.
added basescript tag for xml
no hunger for gm controlled pets
Index: ai_monsters.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ai/ai_monsters.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** ai_monsters.cpp 6 Sep 2004 22:31:25 -0000 1.19
--- ai_monsters.cpp 9 Sep 2004 03:19:58 -0000 1.20
***************
*** 91,95 ****
// We don't already attack the target, right?
! if (victim != target) {
// See if it's a target we want
unsigned int dist = npc->dist(victim);
--- 91,97 ----
// We don't already attack the target, right?
! // If we're tamed we only choose this target if
! // it's fighting us.
! if (victim != target && (!npc->isTamed() || victim->attackTarget() == npc)) {
// See if it's a target we want
unsigned int dist = npc->dist(victim);
***************
*** 102,106 ****
// If we're not tamed, we attack other players as well.
! if (!npc->isTamed()) {
RegionIterator4Chars ri(npc->pos(), VISRANGE);
for ( ri.Begin(); !ri.atEnd(); ri++ ) {
--- 104,108 ----
// If we're not tamed, we attack other players as well.
! if (!npc->isTamed()) {
RegionIterator4Chars ri(npc->pos(), VISRANGE);
for ( ri.Begin(); !ri.atEnd(); ri++ ) {
***************
*** 130,133 ****
--- 132,136 ----
}
+
if (nextVictimCheck < Server::instance()->time()) {
// Don't switch if we can hit it...
|