Public Member Functions | Public Attributes

CCaravan Class Reference

Holds the caravan info. More...


Detailed Description

Holds the caravan info.

Inherits ICaravan.

List of all members.

Public Member Functions

 CCaravan (uint id, array< int >@ routes, array< int >@ rewards, int entire, int timeInTown, int townDlg, int wmDlg, int factionId, string name, CaravanManager@ mgr)
void SetBagsAndPids (uint townLeaderPid, uint townLeaderBag, uint leaderPid, uint leaderBag, array< uint >@ guardPids, array< uint >@ guardBags)
void LoadData ()
void SetDefault ()
void SaveData ()
void SetId (uint id)
 Sets the caravan id.
void Init ()
 Initializes caravan.
void ClearCaravan ()
void SpawnCaravan ()
 Spawns caravan on current map, at the point marked by spawnpoint item.
void PrepareDeparture (uint departTime)
void GetCurrentCoords (float& x, float& y)
bool EndOfTrack ()
void IncRoutePosition ()
uint GetLeaderId ()
 Caravan leader's id.
uint GetWMLeaderId ()
bool IsCaravanMember (Critter& crit)
ICaravanRoute (uint16 origLoc, uint8 origMap, uint16 destLoc, uint8 destMap)
 Sets origin/destination.
ICaravanRoute (uint16 x, uint16 y)
 Adds coordinate to the caravan route.
ICaravan_AddNpc (uint16 pid, uint dialogId, uint bagId, uint level)
 Adds npc to caravan.
void Assign (Critter& cr)
 Assigns critter to caravan.
void Leave (Critter& cr)
 Remove critter from caravan.
uint GetState ()
string GetName ()
string GetNextDestinationName ()
uint GetActPay ()
uint GetDepartTime ()
void Start ()
 Starts the caravan route to the next target (destination, or way back to origin).
void Reward ()
void Arrive ()
void PrepareRespawn ()
void Respawn ()

Public Attributes

uint id
CaravanManagermgr
array< uint > players
 Ids of the players that joined caravan.
array< uint > critters
 Ids of the npcs that run caravan (leader first).
array< CCaravanNpcnpcs
uint wagon
uint routeIndex
uint routePosition
uint originStationId
uint destinationStationId
uint16 destLoc
 Caravan destination's location pid.
uint8 destMap
 Map in destination location (index to the location maps list).
uint16 origLoc
 Origin location.
uint8 origMap
uint currLoc
 Current location.
uint8 currMap
uint entire
uint timeInTown
uint timeEvent
uint departure
uint state
int target
 Actual target (index to the routes table).
array< Coordroute
array< int >@ routes
array< int >@ rewards
string name
uint townDlg
uint wmDlg
uint townLeaderPid
uint townLeaderBag
uint leaderPid
uint leaderBag
uint factionId
array< uint >@ guardPids
array< uint >@ guardBags
Serializator serializer

Constructor & Destructor Documentation

CCaravan ( uint  id,
array< int >@  routes,
array< int >@  rewards,
int  entire,
int  timeInTown,
int  townDlg,
int  wmDlg,
int  factionId,
string  name,
CaravanManager mgr 
)

Member Function Documentation

void SetBagsAndPids ( uint  townLeaderPid,
uint  townLeaderBag,
uint  leaderPid,
uint  leaderBag,
array< uint >@  guardPids,
array< uint >@  guardBags 
)
void LoadData (  ) 
void SetDefault (  ) 
void SaveData (  ) 
void SetId ( uint  id  ) 

Sets the caravan id.

void Init (  ) 

Initializes caravan.

Implements ICaravan.

void ClearCaravan (  ) 
void SpawnCaravan (  ) 

Spawns caravan on current map, at the point marked by spawnpoint item.

void PrepareDeparture ( uint  departTime  ) 

Implements ICaravan.

void GetCurrentCoords ( float&  x,
float&  y 
)

Implements ICaravan.

bool EndOfTrack (  ) 

Implements ICaravan.

void IncRoutePosition (  ) 

Implements ICaravan.

uint GetLeaderId (  ) 

Caravan leader's id.

Implements ICaravan.

uint GetWMLeaderId (  ) 

Implements ICaravan.

bool IsCaravanMember ( Critter crit  ) 

Implements ICaravan.

ICaravan@ Route ( uint16  origLoc,
uint8  origMap,
uint16  destLoc,
uint8  destMap 
)

Sets origin/destination.

Implements ICaravan.

ICaravan@ Route ( uint16  x,
uint16  y 
)

Adds coordinate to the caravan route.

First and last are not needed, as they're taken from origin/destination locations.

Implements ICaravan.

ICaravan@ _AddNpc ( uint16  pid,
uint  dialogId,
uint  bagId,
uint  level 
)

Adds npc to caravan.

Remarks:
Leader is first.

Implements ICaravan.

void Assign ( Critter cr  ) 

Assigns critter to caravan.

Implements ICaravan.

void Leave ( Critter cr  ) 

Remove critter from caravan.

Implements ICaravan.

uint GetState (  ) 

Implements ICaravan.

string GetName (  ) 

Implements ICaravan.

string GetNextDestinationName (  ) 

Implements ICaravan.

uint GetActPay (  ) 

Implements ICaravan.

uint GetDepartTime (  ) 

Implements ICaravan.

void Start (  ) 

Starts the caravan route to the next target (destination, or way back to origin).

Implements ICaravan.

void Reward (  ) 
void Arrive (  ) 

Implements ICaravan.

void PrepareRespawn (  ) 

Implements ICaravan.

void Respawn (  ) 

Implements ICaravan.


Member Data Documentation

uint id
array<uint> players

Ids of the players that joined caravan.

array<uint> critters

Ids of the npcs that run caravan (leader first).

array<CCaravanNpc> npcs
uint wagon
uint routeIndex
uint16 destLoc

Caravan destination's location pid.

uint8 destMap

Map in destination location (index to the location maps list).

uint16 origLoc

Origin location.

uint8 origMap
uint currLoc

Current location.

Either origin or destination, or 0 (worldmap).

uint8 currMap
uint entire
uint timeInTown
uint timeEvent
uint departure
uint state
int target

Actual target (index to the routes table).

array<Coord> route
array<int>@ routes
array<int>@ rewards
uint townDlg
uint wmDlg
uint leaderPid
uint leaderBag
uint factionId
array<uint>@ guardPids
array<uint>@ guardBags