if( !lineOfSight( attacker->pos, defender->pos, WALLS_CHIMNEYS+DOORS+FLOORS_FLAT_ROOFING ) )
Coord_cl attpos( attacker->pos ); Coord_cl defpos( defender->pos );  attpos.z += 13;  if( !lineOfSight( attpos, defpos, WALLS_CHIMNEYS+DOORS+FLOORS_FLAT_ROOFING ) )
void npcattacktarget( P_CHAR attacker, P_CHAR defender ){	if (attacker == defender) return;	if (attacker == NULL || defender == NULL) return;	if (attacker->dead() || defender->dead()) return;	if (defender->pos.z > (attacker->pos.z +10)) return;//FRAZAI	if (defender->pos.z < (attacker->pos.z -10)) return;//FRAZAI	if( !lineOfSight( attacker->pos, defender->pos, WALLS_CHIMNEYS+DOORS+FLOORS_FLAT_ROOFING ) )		return;	playmonstersound( defender, defender->id(), SND_STARTATTACK );	int i;	unsigned int cdist=0 ;	if( defender->targ != INVALID_SERIAL )		cdist = chardist( defender, FindCharBySerial(defender->targ));	else cdist=30;	if( cdist>chardist( defender, attacker ) )	{		defender->targ = attacker->serial;		defender->attacker = attacker->serial;		defender->setAttackFirst();	}	if (attacker->targ != INVALID_SERIAL)		cdist = chardist(attacker, FindCharBySerial(attacker->targ));	else cdist=30;	if ((cdist > chardist(defender, attacker))&&		((!(attacker->npcaitype()==4)||(!((attacker->targ==INVALID_SERIAL)))))) // changed from 0x40 to 4, LB	{		attacker->targ = defender->serial;		attacker->attacker = defender->serial;		attacker->resetAttackFirst();	}	defender->unhide();	defender->disturbMed();	attacker->unhide();	attacker->disturbMed();	if( defender->isNpc() )	{		if( !( defender->war ) )			npcToggleCombat( defender );		defender->setNextMoveTime();	}		if( ( attacker->isNpc() ) && !( attacker->npcaitype() == 4 ) ) // changed from 0x40 to 4, LB	{		if ( !( attacker->war ) )			npcToggleCombat(attacker);		attacker->setNextMoveTime();	}		// Send a message to the defender	if( defender->socket() )	{		QString message = tr( "You see %1 attacking you!" ).arg( attacker->name.c_str() );		defender->socket()->showSpeech( attacker, message, 0x26, 3, cUOTxUnicodeSpeech::Emote );	}	QString emote = tr( "You see %1 attacking %2" ).arg( attacker->name.c_str() ).arg( defender->name.c_str() );	RegionIterator4Chars cIter( attacker->pos );	for( cIter.Begin(); !cIter.atEnd(); cIter++ )	{		P_CHAR pChar = cIter.GetData();		if( pChar && ( pChar != defender ) && pChar->socket() && pChar->inRange( attacker, pChar->VisRange ) )			pChar->socket()->showSpeech( attacker, emote, 0x26, 3, cUOTxUnicodeSpeech::Emote );	}}