• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Npc help!

tobias89

Pikaz Liek Pikaz
Joined
Apr 24, 2010
Messages
110
Reaction score
0
How can i make a NPC walk through any character?

canWalkthrough is not what im looking for. its only so that the NPCs can walk through players.
 
Last edited:
npc.cpp
Code:
bool Npc::canWalkTo(const Position& fromPos, Direction dir)
{
	if(getNoMove())
		return false;

	Position toPos = getNextPosition(dir, fromPos);
	if(!Spawns::getInstance()->isInZone(masterPosition, masterRadius, toPos))
		return false;

	Tile* tile = g_game.getTile(toPos);
	if(!tile || g_game.isSwimmingPool(NULL, getTile(), false) != g_game.isSwimmingPool(NULL, tile,
		false) || (!floorChange && (tile->floorChange() || tile->positionChange())))
		return false;

	return tile->__queryAdd(0, this, 1, FLAG_PATHFINDING[B][COLOR="red"] | FLAG_IGNOREBLOCKCREATURE[/COLOR][/B]) == RET_NOERROR;
}
?
 
Back
Top