Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

cObject Class Reference

Base class of cItem and cChar. More...

#include <object.h>

Inheritance diagram for cObject:

cChar cItem cSpawner cContainerItem cWeapon cItemSpawner cNpcSpawner List of all members.

Serials

functions for handle serials stuff

const Serial getSerial () const
 return the object's serial

const SI32 getSerial32 () const
 return the serial of the object

void setSerial32 (SI32 newserial)
 Set the serial of the object.

const void setSerialByte (UI32 nByte, BYTE value)
 set one byte of the object's serial

const Serial getMultiSerial () const
 return the object's multi serial

const SI32 getMultiSerial32 () const
 return the multi serial of the object

void setMultiSerial32Only (SI32 newserial)
 Set the multi serial of the object.

const void setMultiSerialByte (UI32 nByte, BYTE value)
 set one byte of the object's multi serial

const SI32 getSpawnSerial () const
 return the spawn serial of the object

void setSpawnSerial (SI32 newserial)
 Set the spawn serial of the object.

const SI32 getSpawnRegion () const
 return the spawn region of the object

void setSpawnRegion (SI32 newserial)
 Set the spawn getSpawnSerial of the object.

const Serial getOwnerSerial () const
 return the object's owner serial

const SI32 getOwnerSerial32 () const
 return the object's owner serial

void setOwnerSerial32Only (SI32 newserial)
void setOwnerSerial32 (SI32 newserial, bool force=false)
const void setOwnerSerialByte (UI32 nByte, BYTE value)
 set one byte of the object's owner serial

void setSameOwnerAs (const cObject *obj)
Serial serial
 serial of the object

Serial multi_serial
 multi serial of the object (don't know what it is used for)

Serial OwnerSerial
 If Char is an NPC, this sets its owner.

Serial spawnserial
Serial spawnregion

Positions

Position related stuff

const Location getPosition () const
 return the position of the object

SI32 getPosition (const char *what) const
 return one coord of the object position

void setPosition (const char *what, SI32 value)
 Set one coord of the object position.

void setPosition (Location where)
 Set the position of the object.

void setPosition (UI32 x, UI32 y, SI08 z)
 Set the position of the object.

const Location getOldPosition () const
SI32 getOldPosition (const char *what) const
void setOldPosition (const char *what, SI32 value)
void setOldPosition (const Location where)
void setOldPosition (SI32 x, SI32 y, signed char z, signed char dispz)
Location old_position
 old position of object

Location position
 current position of object


Appearence

const string getRealName () const
 return the real name of object

const char * getRealNameC () const
 return the real name of object

void setRealName (string s)
 Set the real name of object.

void setRealName (const char *str)
 Set the real name of object.

const string getCurrentName () const
 return the current name of object

const char * getCurrentNameC () const
 return the current name of object

void setCurrentName (string s)
 Set the current name of object.

void setCurrentName (const char *str)
 Set the current name of object.

void setCurrentName (char *format,...)
 Set the current name of object.

void setSecondaryName (string s)
 Set the secondary name of object.

const char * getSecondaryNameC () const
 Get the secondary name of the object.

const string getSecondaryName () const
 Get the secondary name of the object.

void setSecondaryName (const char *format,...)
 Set the secondary name of the object.

string secondary_name
string current_name
 Name displayed everywhere for this object, 30 char max + '\0'.


Temp - Fx

LOGICAL addTempfx (tempfx::cTempfx *fx)
 Tell if the AmxEvent id is valid Adds an existing temp effect to the object.

LOGICAL addTempfx (cObject &src, SI32 num, SI08 more1=0, SI08 more2=0, SI08 more3=0, SI08 more4=0, SI32 dur=0, SI32 amxcback=-1)
 Adds a temp effect to the object.

void delTempfx (SI32 num, LOGICAL executeExpireCode=true, SERIAL funcidx=-1)
 Deletes every tempfx of the specified number.

void checkTempfx ()
void tempfxOn ()
 Activates the temp effects.

void tempfxOff ()
 Deactivates the temp effects.

LOGICAL hasTempfx ()
 Tells if the object has tempfx in queue.

tempfx::cTempfxgetTempfx (SI32 num, SERIAL funcidx=-1)
 Get the tempfx from given num and funcidx.

TempfxVectorgetTempfxVec ()
 Return the tempfx vector from the object.

UI32 ScriptID
TempfxVectortempfx

Public Methods

 cObject ()
virtual ~cObject ()
const UI32 getScriptID () const
 return the object's script number

void setScriptID (UI32 sid)
 set the object's script number

const SI08 getGender () const
void setGender (SI08 newGender)
const SI32 getRace () const
void setRace (SI32 newRace)
virtual void Delete ()
 Tells if the object has tempfx in queue.

void setId (UI16 newId)
const UI16 getId () const
void setOldId (UI16 oldId)
const UI16 getOldId () const
void setColor (COLOR newColor)
const COLOR getColor () const
void setOldColor (COLOR oldColor)
const COLOR getOldColor () const
Operators
bool operator> (const cObject &obj) const
bool operator< (const cObject &obj) const
bool operator>= (const cObject &obj) const
bool operator<= (const cObject &obj) const
bool operator== (const cObject &obj) const
bool operator!= (const cObject &obj) const

Static Public Methods

std::string getRandomScriptValue (std::string section, std::string &sectionId)

Public Attributes

UI32 disabled
 Disabled object timer, cant trigger.

std::string * disabledmsg
 Object is disabled, so display this message.


Protected Types

enum  { OBJECT, ITEM, CHAR }

Protected Attributes

enum cObject:: { ... }  objtype

Static Private Methods

cScpIteratorgetScriptIterator (std::string section, std::string &sectionId)

Private Attributes

SI08 gender
UI16 id_old
UI16 id
COLOR color
COLOR color_old
Races
Race related functions and attributes now an property of all objects

SI32 race
 Race index.


Detailed Description

Base class of cItem and cChar.

Author:
Anthalir
Since:
0.82a


Member Enumeration Documentation

anonymous enum [protected]
 

Enumeration values:
OBJECT 
ITEM 
CHAR 


Constructor & Destructor Documentation

cObject::cObject  
 

cObject::~cObject   [virtual]
 


Member Function Documentation

bool cObject::addTempfx cObject &    src,
SI32    num,
SI08    more1 = 0,
SI08    more2 = 0,
SI08    more3 = 0,
SI08    more4 = 0,
SI32    dur = 0,
SI32    amxcback = -1
 

Adds a temp effect to the object.

Author:
Luxor

LOGICAL cObject::addTempfx tempfx::cTempfx   fx
 

Tell if the AmxEvent id is valid Adds an existing temp effect to the object.

Author:
Wintermute

void cObject::checkTempfx  
 

Author:
Luxor

void cObject::Delete   [virtual]
 

Tells if the object has tempfx in queue.

Author:
Sparhawk

Reimplemented in cChar, and cItem.

void cObject::delTempfx SI32    num,
LOGICAL    executeExpireCode = true,
SERIAL    funcidx = -1
 

Deletes every tempfx of the specified number.

Author:
Luxor

const COLOR cObject::getColor   const [inline]
 

const string cObject::getCurrentName   const [inline]
 

return the current name of object

const char* cObject::getCurrentNameC   const [inline]
 

return the current name of object

const SI08 cObject::getGender   const [inline]
 

const UI16 cObject::getId   const [inline]
 

const Serial cObject::getMultiSerial   const [inline]
 

return the object's multi serial

const SI32 cObject::getMultiSerial32   const [inline]
 

return the multi serial of the object

const COLOR cObject::getOldColor   const [inline]
 

const UI16 cObject::getOldId   const [inline]
 

SI32 cObject::getOldPosition const char *    what const
 

const Location cObject::getOldPosition   const [inline]
 

const Serial cObject::getOwnerSerial   const [inline]
 

return the object's owner serial

const SI32 cObject::getOwnerSerial32   const [inline]
 

return the object's owner serial

SI32 cObject::getPosition const char *    what const
 

return one coord of the object position

Author:
Anthalir
Since:
0.82a
Parameters:
what  what to return ?
  • "x" = return the x position
  • "y" = return the y position
  • "z" = return the z position
  • "dz"= return the dispz position (used in cChar)
Returns:
signed int

const Location cObject::getPosition   const [inline]
 

return the position of the object

const SI32 cObject::getRace   const [inline]
 

std::string cObject::getRandomScriptValue std::string    section,
std::string &    sectionId
[static]
 

const string cObject::getRealName   const [inline]
 

return the real name of object

const char* cObject::getRealNameC   const [inline]
 

return the real name of object

const UI32 cObject::getScriptID   const [inline]
 

return the object's script number

cScpIterator * cObject::getScriptIterator std::string    section,
std::string &    sectionId
[static, private]
 

const string cObject::getSecondaryName   const [inline]
 

Get the secondary name of the object.

const char* cObject::getSecondaryNameC   const [inline]
 

Get the secondary name of the object.

const Serial cObject::getSerial   const [inline]
 

return the object's serial

const SI32 cObject::getSerial32   const [inline]
 

return the serial of the object

const SI32 cObject::getSpawnRegion   const [inline]
 

return the spawn region of the object

const SI32 cObject::getSpawnSerial   const [inline]
 

return the spawn serial of the object

tempfx::cTempfx * cObject::getTempfx SI32    num,
SERIAL    funcidx = -1
 

Get the tempfx from given num and funcidx.

Author:
Luxor

TempfxVector * cObject::getTempfxVec  
 

Return the tempfx vector from the object.

Author:
Wintermute

LOGICAL cObject::hasTempfx  
 

Tells if the object has tempfx in queue.

Author:
Luxor

bool cObject::operator!= const cObject &    obj const [inline]
 

bool cObject::operator< const cObject &    obj const [inline]
 

bool cObject::operator<= const cObject &    obj const [inline]
 

bool cObject::operator== const cObject &    obj const [inline]
 

bool cObject::operator> const cObject &    obj const [inline]
 

bool cObject::operator>= const cObject &    obj const [inline]
 

void cObject::setColor COLOR    newColor [inline]
 

void cObject::setCurrentName char *    format,
...   
 

Set the current name of object.

Author:
Anthalir, rewritten by Luxor
Since:
0.82a
Parameters:
format  formatted C string

void cObject::setCurrentName const char *    str [inline]
 

Set the current name of object.

void cObject::setCurrentName string    s [inline]
 

Set the current name of object.

void cObject::setGender SI08    newGender [inline]
 

void cObject::setId UI16    newId [inline]
 

void cObject::setMultiSerial32Only SI32    newserial [inline]
 

Set the multi serial of the object.

const void cObject::setMultiSerialByte UI32    nByte,
BYTE    value
 

set one byte of the object's multi serial

Author:
Sparhawk
Since:
0.82a
Parameters:
nByte  byte number to get
value  to set serial byte to
Remarks:
nByte start at 1 not 0 and end at 4

void cObject::setOldColor COLOR    oldColor [inline]
 

void cObject::setOldId UI16    oldId [inline]
 

void cObject::setOldPosition SI32    x,
SI32    y,
signed char    z,
signed char    dispz
[inline]
 

void cObject::setOldPosition const Location    where [inline]
 

void cObject::setOldPosition const char *    what,
SI32    value
 

void cObject::setOwnerSerial32 SI32    newserial,
bool    force = false
 

void cObject::setOwnerSerial32Only SI32    newserial [inline]
 

const void cObject::setOwnerSerialByte UI32    nByte,
BYTE    value
 

set one byte of the object's owner serial

Author:
Sparhawk
Since:
0.82a
Parameters:
nByte  byte number to get
value  to set serial byte to
Remarks:
nByte start at 1 not 0 and end at 4

void cObject::setPosition UI32    x,
UI32    y,
SI08    z
[inline]
 

Set the position of the object.

void cObject::setPosition Location    where
 

Set the position of the object.

Author:
Anthalir
Since:
0.82a
Parameters:
where  Location structure representing the new position

void cObject::setPosition const char *    what,
SI32    value
 

Set one coord of the object position.

Author:
Anthalir
Since:
0.82a
Parameters:
what  what to set ?
  • "x" = set the x position
  • "y" = set the y position
  • "z" = set the z position
  • "dz"= set the dispz position (used in cChar)
value  the value to set
Todo:
change from string to a simpler enum

void cObject::setRace SI32    newRace [inline]
 

void cObject::setRealName const char *    str [inline]
 

Set the real name of object.

void cObject::setRealName string    s [inline]
 

Set the real name of object.

void cObject::setSameOwnerAs const cObject *    obj [inline]
 

void cObject::setScriptID UI32    sid [inline]
 

set the object's script number

void cObject::setSecondaryName const char *    format,
...   
 

Set the secondary name of the object.

Author:
Anthalir, rewritten by Luxor
Since:
0.82a
Parameters:
format  C char pointer - see printf
Warning:
This function must only be used by items because it use same var than real name

void cObject::setSecondaryName string    s [inline]
 

Set the secondary name of object.

void cObject::setSerial32 SI32    newserial
 

Set the serial of the object.

Author:
Anthalir
Since:
0.82a
Parameters:
newserial  the new serial (unsigned int)

const void cObject::setSerialByte UI32    nByte,
BYTE    value
 

set one byte of the object's serial

Author:
Sparhawk
Since:
0.82a
Parameters:
nByte  byte number to get
value  to set serial byte to
Remarks:
nByte start at 1 not 0 and end at 4

void cObject::setSpawnRegion SI32    newserial [inline]
 

Set the spawn getSpawnSerial of the object.

void cObject::setSpawnSerial SI32    newserial [inline]
 

Set the spawn serial of the object.

void cObject::tempfxOff  
 

Deactivates the temp effects.

Author:
Luxor

void cObject::tempfxOn  
 

Activates the temp effects.

Author:
Luxor


Member Data Documentation

COLOR cObject::color [private]
 

COLOR cObject::color_old [private]
 

string cObject::current_name [protected]
 

Name displayed everywhere for this object, 30 char max + '\0'.

UI32 cObject::disabled
 

Disabled object timer, cant trigger.

std::string* cObject::disabledmsg
 

Object is disabled, so display this message.

SI08 cObject::gender [private]
 

UI16 cObject::id [private]
 

UI16 cObject::id_old [private]
 

Serial cObject::multi_serial [private]
 

multi serial of the object (don't know what it is used for)

enum { ... } cObject::objtype [protected]
 

Location cObject::old_position [private]
 

old position of object

Serial cObject::OwnerSerial [private]
 

If Char is an NPC, this sets its owner.

Location cObject::position [private]
 

current position of object

SI32 cObject::race [private]
 

Race index.

UI32 cObject::ScriptID [private]
 

string cObject::secondary_name [protected]
 

Real name of the char, 30 chars max + '\0'
Also used to store the secondary name of items.

Serial cObject::serial [private]
 

serial of the object

Serial cObject::spawnregion [private]
 

Serial cObject::spawnserial [private]
 

TempfxVector* cObject::tempfx [private]
 


The documentation for this class was generated from the following files: SourceForge.net Logo