Atrinik Server  4.0
Functions
waypoint.c File Reference
#include <global.h>
#include <plugin.h>
#include <monster_guard.h>
#include <object.h>
#include <object_methods.h>
#include <waypoint.h>

Go to the source code of this file.

Functions

 OBJECT_TYPE_INIT_DEFINE (waypoint)
 
objectwaypoint_get_active (object *npc)
 
objectwaypoint_get_aggro (object *npc)
 
objectwaypoint_get_home (object *npc)
 
static objectwaypoint_find (object *npc, shstr *name)
 
static mapstructwaypoint_load_destination (object *op, object *npc)
 
void waypoint_compute_path (object *op)
 
void waypoint_move (object *op, object *npc)
 

Detailed Description

Handles the code for waypoint objects.

Definition in file waypoint.c.

Function Documentation

OBJECT_TYPE_INIT_DEFINE ( waypoint  )

Initialize the waypoint type object methods.

Definition at line 40 of file waypoint.c.

void waypoint_compute_path ( object op)

Perform a path computation for the waypoint object.

This function is called whenever our path request is dequeued.

Parameters
waypointThe waypoint object.

Definition at line 180 of file waypoint.c.

static object* waypoint_find ( object npc,
shstr *  name 
)
static

Find a monster's waypoint by name (used for getting the next waypoint).

Parameters
npcThe monster.
nameThe waypoint name to find.
Returns
The waypoint object if found, NULL otherwise.

Definition at line 122 of file waypoint.c.

object* waypoint_get_active ( object npc)

Find a monster's currently active waypoint, if any.

Parameters
npcThe monster.
Returns
Active waypoint of this monster, NULL if none found.

Definition at line 53 of file waypoint.c.

object* waypoint_get_aggro ( object npc)

Find a monster's current aggro waypoint, if any.

Parameters
npcThe monster.
Returns
Aggro waypoint of this monster, NULL if none found.

Definition at line 75 of file waypoint.c.

object* waypoint_get_home ( object npc)

Find a monster's current home waypoint, if any.

Parameters
npcThe monster.
Returns
Return-home waypoint of this monster, NULL if none found.

Definition at line 98 of file waypoint.c.

static mapstruct* waypoint_load_destination ( object op,
object npc 
)
static

Find the destination map if specified in waypoint, otherwise use current map.

Parameters
opWaypoint.
npcMonster.
Returns
Destination map.

Definition at line 148 of file waypoint.c.

void waypoint_move ( object op,
object npc 
)

Move towards waypoint target.

Parameters
opThe waypoint object.
npcObject to move.

Definition at line 283 of file waypoint.c.