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

cChar Class Reference

Character class. More...

#include <chars.h>

Inheritance diagram for cChar:

cObject List of all members.

Priviledges

const UI08 getPrivLevel () const
void setPrivLevel (UI08 pLevel)
const LOGICAL IsGM () const
const LOGICAL IsCounselor () const
const LOGICAL IsGMorCounselor () const
const LOGICAL IsInvul () const
const LOGICAL CanSnoop () const
const LOGICAL CanBroadcast () const
const LOGICAL CanSeeSerials () const
const LOGICAL isFrozen () const
const LOGICAL isPermaHidden () const
const LOGICAL isDispellable () const
const LOGICAL canAllMove () const
const LOGICAL dontUseMana () const
const LOGICAL dontUseReagents () const
const LOGICAL hasReflection () const
const LOGICAL canViewHouseIcon () const
void setAllMove (LOGICAL set=true)
void setViewHouseIcon (LOGICAL set=true)
void setPermaHidden (LOGICAL set=true)
void setReflection (LOGICAL set=true)
const UI08 GetPriv () const
void SetPriv (UI08 p)
void MakeInvulnerable ()
void MakeVulnerable ()
const UI08 GetPriv2 () const
void SetPriv2 (SI08 p)
void setPriv2 (UI08 privFlag, LOGICAL set)
UI08 priv
 see cchar_privs

UI08 priv2
 see cchar_privs

UI08 privLevel
 privilege level


Char Status

const LOGICAL IsInnocent () const
const LOGICAL IsMurderer () const
const LOGICAL IsCriminal () const
LOGICAL const IsGrey () const
const LOGICAL IsHidden () const
const LOGICAL IsHiddenBySpell () const
const LOGICAL IsHiddenBySkill () const
LOGICAL const IsOverWeight ()
 Checks char weight.

LOGICAL const IsOnline () const
 get online status

const LOGICAL InGuardedArea () const
LOGICAL const CanDoGestures () const
void SetMurderer ()
void SetInnocent ()
void SetCriminal ()
void SetPermaGrey ()
void SetGrey ()
 Makes a character temporary grey.

void setTelekinesisFlag (LOGICAL state)
void setGreyFlag (LOGICAL state)
void unHide ()
 Reveals the char if he was hidden.

const SI32 GetKarma () const
 Return the karma of the char.

void SetKarma (SI32 newkarma)
 Set the karma of the char.

const SI32 GetFame () const
 Return the fame of the char.

void SetFame (SI32 newfame)
void IncreaseKarma (SI32 value, P_CHAR pKilled=0)
 increase or decrease the karma of the char

void modifyFame (SI32 value)
 increase or decrease the fame of the char

LOGICAL incognito
 AntiChrist - true if under incognito effect.

LOGICAL polymorph
 AntiChrist - true if under polymorph effect.

UI32 kills
 PvP Kills.

UI32 deaths
 Number of deaths.

LOGICAL dead
 Is the character dead ?

R32 fstm
 Unavowed - stamina to remove the next step.

SI32 karma
 karma of the char

SI32 fame
 fame of the char


Date/Time

Date/Time related functions and attributes

void SetCreationDay (TIMERVAL day)
 Set the creation day of a character.

const TIMERVAL GetCreationDay () const
 Get the creation day of a character.

TIMERVAL creationday
 Day since EPOCH this character was created on.


Stats

Stats related functions and attributes

void setStrength (UI32 val, bool check=true)
void checkSafeStats ()
 Checks if the stats are regular.

const SI32 getStrength () const
 Get the strength-value.

void modifyStrength (SI32 mod, bool check=true)
 modify the strength

SI32 st2
 Reserved for calculation.

SI32 st3
 Luxor: safe strength value.

SI32 dx
 Dexterity.

SI32 dx2
 Reserved for calculation.

SI32 dx3
 Luxor: safe dexterity value.

SI32 in
 Intelligence.

SI32 in2
 Reserved for calculation.

SI32 in3
 Luxor: safe intelligence value.

SI32 statGainedToday
 xan :-> for stat-gain cap

UI32_s str
 Strength.


Appearence

const LOGICAL HasHumanBody () const
void showLongName (P_CHAR showToWho, LOGICAL showSerials)
std::string title

Combat

LOGICAL HasAttackedFirst ()
void SetAttackFirst (LOGICAL af=true)
void ResetAttackFirst ()
void checkPoisoning ()
void fight (P_CHAR pOpponent)
 makes a character fight the other

void combatHit (P_CHAR pc_def, SI32 nTimeOut=0)
 Attack a char.

void doCombat ()
 Does combat sequence.

void combatOnHorse ()
void combatOnFoot ()
void playCombatAction ()
 plays the combat animation

SI32 calcAtt ()
SI32 calcDef (SI32 x=0)
void setWresMove (SI32 move=0)
SI32 calcResist (DamageType typeofdamage)
 calculates resist power of a char

void toggleCombat ()
 Toggle war mode.

SI32 getCombatSkill ()
 returns char's combat skill

void castSpell (magic::SpellId spellnumber, TargetLocation &dest, SI32 flags=0, SI32 param=0)
 Makes the char casting a spell.

LOGICAL combatTimerOk ()
 Check for combat timeout.

void checkPoisoning (P_CHAR pc_def)
void doMissedSoundEffect ()
SI32 combatHitMessage (SI32 damage)
void doCombatSoundEffect (SI32 fightskill, P_ITEM pWeapon)
void undoCombat ()
 Abort combat sequence.

LOGICAL attackfirst
 0 = defending, 1 = attacked first


Movement

LOGICAL canSee (cObject &obj)
 can it see the object?

LOGICAL seeForFirstTime (cObject &obj, LOGICAL testCanSee=true)
 does it see the object for the first time?

LOGICAL seeForLastTime (cObject &obj, LOGICAL testCanSee=true)
 does it see the object for the first time?

void walk ()
 execute walk code <Luxor>

LOGICAL hasPath ()
 has a path set?

void follow (P_CHAR pc)
 follow pc

void flee (P_CHAR pc, SI32 seconds=-1)
 flee from pc

void pathFind (Location pos, LOGICAL bOverrideCurrentPath=true)
 Walk to position.

SI08 dir
 &0F=Direction

UI32 LastMoveTime
 server time of last move

void walkNextStep ()
 walk next path step

cPathpath
 current path

SERIAL_SLIST sentObjects

Others

void doGmEffect ()
 Function for the different gm movement effects.

FUNCIDX targetcallback
UI08 gmrestrict
 for restricting GMs to certain regions


Trainer

const LOGICAL isBeingTrained () const
const SERIAL getTrainer () const
const UI08 getSkillTaught () const
const LOGICAL canTrain () const
void setCanTrain (LOGICAL c=true)
void resetCanTrain ()
SERIAL trainer
 Serial of the NPC training the char, -1 if none.

UI08 trainingplayerin
 Index in skillname of the skill the NPC is training the player in.

LOGICAL cantrain

Mount

SI32 unmountHorse ()
 make char unmount horse (Remove horse item and spawn new horse)

void mounthorse (P_CHAR mount)
 Mount a creature.

SERIAL getHorse ()
 Get horse current mounted.

void setOnHorse ()
 Set on horse.

bool isMounting ()
 Check if is on horse.

bool isMounting (P_CHAR horse)
 Check if is on given horse.

bool mounted
 if now is mounted by a char

LOGICAL onhorse
 On a horse.


Guilds

bool isGuilded ()
 check if guilded

void setGuild (P_GUILD guild, P_GUILD_MEMBER member)
 set Guild

P_GUILD getGuild ()
 get Guild

P_GUILD_MEMBER getGuildMember ()
 get Guild member

short GetGuildType ()
 return the guild type

void SetGuildType (short newGuildType)
 set the guild type

LOGICAL IsGuildTraitor ()
 return guild traitor status

void SetGuildTraitor ()
 set guild traitor status

void ResetGuildTraitor ()
 reset guild traitor status

LOGICAL HasGuildTitleToggle ()
 return guild title toggle status

void SetGuildTitleToggle ()
 set guild title toggle

void ResetGuildTitleToggle ()
 reset guild title toggle

SERIAL GetGuildFealty ()
 return the guild fealty

void SetGuildFealty (SERIAL newGuildFealty)
 set the guild fealty

SI32 GetGuildNumber ()
 return the guild number

void SetGuildNumber (SI32 newGuildNumber)
 set the guild number

TEXTGetGuildTitle ()
 return the guild title

void SetGuildTitle (TEXT *newGuildTitle)
 set the guild title

P_GUILD guild
 the guild

P_GUILD_MEMBER member
 the guild member info

short guildType
LOGICAL guildTraitor
LOGICAL guildToggle
SERIAL guildFealty
SI32 guildNumber

Stats regen rate info

void setRegenRate (StatType stat, UI32 rate, VarType type)
UI32 getRegenRate (StatType stat, VarType type)
bool regenTimerOk (StatType stat)
void updateRegenTimer (StatType stat)
regen_st regens [ALL_STATS]
 stats regen info


Talk and Emote stuff

void talkAll (TEXT *txt, LOGICAL antispam=1)
 shows speech text to all pcs near the char

void talk (NXWSOCKET s, TEXT *txt, LOGICAL antispam=1)
 Shows speech text of a char to the given char.

void emote (NXWSOCKET s, TEXT *txt, LOGICAL antispam,...)
 Shows emote text of a char.

void emoteall (char *txt, LOGICAL antispam,...)
 Shows emote text of a char to all near pcs.

void talkRunic (NXWSOCKET s, TEXT *txt, LOGICAL antispam=1)
 Shows runic speech text of a char to the given socket.

void talkAllRunic (TEXT *txt, LOGICAL antispam=0)
 Shows runic speech text to all pcs near the char.

UI16 emotecolor
 Color for emote messages.

UI08 fonttype
 Speech font to use.

UI16 saycolor
 Color for say messages.

LOGICAL unicode
 This is set to 1 if the player uses unicode speech, 0 if not.


possess stuff

Author:
Luxor


void possess (P_CHAR pc)
 shifts a player in the body of a npc, usually used only by GMs

SERIAL possessorSerial
SERIAL possessedSerial

Public Methods

 cChar (SERIAL ser)
 ~cChar ()
void setClient (NXWCLIENT client)
void MoveTo (Location newloc)
void loadEventFromScript (TEXT *script1, TEXT *script2)
void MoveTo (SI32 x, SI32 y, SI32 z)
const LOGICAL resistsFire () const
const LOGICAL resistsFreeze () const
void heartbeat ()
void setSkillDelay (UI32 seconds=server_data.skilldelay)
const LOGICAL canDoSkillAction () const
void setObjectDelay (UI32 seconds=server_data.objectdelay)
const LOGICAL canDoObjectAction () const
void setMultiSerial (long mulser)
const LOGICAL isOwnerOf (const cObject *obj) const
char * getCommandSpeech ()
void setCommandSpeech (char *curr_speech)
void resetCommandParams ()
 Reset all the Params strings.

void setCommandParams (int index, std::string param)
 Set a Param.

TEXTgetCommandParams (int index)
 Get a Param.

SI32 getHireFee ()
void setHireFee (SI32 newfee)
bool isHirable ()
wstring * getSpeechCurrent ()
 Return current speech.

void setSpeechCurrent (wstring *speech)
 Set current speech.

void resetSpeechCurrent ()
 Reset current speech.

void deleteSpeechCurrent ()
const LOGICAL isStabled () const
 Check if char is stabled.

const SERIAL getStablemaster () const
 Get the character's stablemaster.

void stable (P_CHAR stablemaster)
void unStable ()
void doSingleClick (SERIAL serial)
void onSingleClick (P_CHAR clickedBy)
const LOGICAL isRunning () const
 tells if a character is running

void setRunning ()
void updateStats (SI32 stat)
 Updates stats to nearbye players.

void setNextMoveTime (short tamediv=1)
void disturbMed ()
 stops meditation if necessary. Displays message if a socket is passed

void drink (P_ITEM pi)
 makes the character drinking something

void hideBySkill ()
 Hides a player by skill.

void hideBySpell (SI32 timer=-1)
 Hides a player by spell.

UI32 CountItems (short ID, short col=-1)
 count items of given id and color

UI32 CountItemsByType (short type)
 count items of given type

const UI32 CountGold ()
P_ITEM GetItemOnLayer (UI08 layer)
 Returns the item on the given layer, if any.

P_ITEM GetBankBox (short type=BANK_GOLD)
 get the bank box

void openBankBox (P_CHAR pc)
 open a bankbox

void openSpecialBank (P_CHAR pc)
 region specific bankbox

SI32 countBankGold ()
P_ITEM getWeapon ()
 finds the equipment weapon of a character

P_ITEM getShield ()
 finds the equipped shield of a character

void showContainer (P_ITEM pCont)
 Show a container to player.

P_ITEM getBackpack ()
LOGICAL isInBackpack (P_ITEM pi)
void showPaperdoll (P_CHAR viewer)
void showBackpack ()
 Show Backpack to player.

UI32 getSkillSum ()
SI32 getTeachingDelta (P_CHAR pPlayer, SI32 skill, SI32 sum)
 calculates how much the given player can learn from this teacher

void removeItemBonus (cItem *pi)
LOGICAL isSameAs (P_CHAR pc)
LOGICAL resist (SI32 n)
NXWCLIENT getClient () const
 get the client

NXWSOCKET getSocket () const
 gets the character current socket

void sysmsg (const TEXT *txt,...)
 easy wrapper to sysmsg

void attackStuff (P_CHAR pc)
 wrapper for AttackStuff()

void helpStuff (P_CHAR pc_i)
void applyPoison (PoisonType poisontype, SI32 secs=-1)
 applies a poison to a char

void setOwner (P_CHAR owner)
 Sets owner fields.

void curePoison ()
 Cures poison.

void resurrect (NXWCLIENT healer=NULL)
 Resurrects a char.

void unfreeze (LOGICAL calledByTempfx=false)
 unfreezes the char

void damage (SI32 amount, DamageType typeofdamage=DAMAGE_PURE, StatType stattobedamaged=STAT_HP)
 damages a character

void playAction (SI32 action)
 Makes the char doing an action.

UI32 distFrom (P_CHAR pc)
 Get char's distance from the given character.

UI32 distFrom (P_ITEM pi)
 Get char's distance from the given item.

void teleport (UI08 flags=TELEFLAG_SENDALL, NXWCLIENT cli=NULL)
 Teleports character to its current set coordinates.

void facexy (SI32 facex, SI32 facey)
 Changes the orientation of a player.

LOGICAL losFrom (P_CHAR pc)
 Returns line of sight from the char to the give char.

void playSFX (SI16 sound, LOGICAL onlyToMe=false)
 plays a sound effect on a char

void playMonsterSound (MonsterSound sfx)
 Plays a monster sound effect.

void freeze ()
 Freeze the char.

LOGICAL checkSkill (Skill sk, SI32 low, SI32 high, LOGICAL bRaise=true)
 Checks a skill for success.

SI32 delItems (short id, SI32 amount=1, short color=-1)
 Deletes items from backpack, by id.

const LOGICAL checkSkillSparrCheck (Skill sk, SI32 low, SI32 high, P_CHAR pcd)
 checks a skill for success (with sparring check)

UI32 getAmount (short id, short col=-1, bool onlyPrimaryBackpack=false)
 Get the amount of the given id, color.

void movingFX (P_CHAR destination, short id, SI32 speed, SI32 loop, LOGICAL explode, class ParticleFx *part=NULL)
 Plays a moving effect from this to target char.

void staticFX (short id, SI32 speed, SI32 loop, class ParticleFx *part=NULL)
 Plays a static effect on a char.

void boltFX (LOGICAL bNoParticles)
 Bolts a char.

void circleFX (short id)
 Plays circle of blood or similar effect.

P_ITEM getBeardItem ()
 Gets beard item.

P_ITEM getHairItem ()
 Gets hairs item.

void morph (short bodyid=-1, short skincolor=-1, short hairstyle=-1, short haircolor=-1, short beardstyle=-1, short beardcolor=-1, const char *newname=NULL, LOGICAL bBackup=true)
 Characters morphing (incognito, polymorph, etc).

void morph (SI32 npcNumber, LOGICAL bBackup)
 Characters morphing (incognito, polymorph, etc).

void jail (SI32 seconds=60 *60 *24)
 Jails a char.

void Kill ()
 Manages/causes character death.

void kick ()
 Kicks a char.

void goPlace (SI32)
 Teleports char to a goplace location.

LOGICAL knowsSpell (magic::SpellId spellnumber)
 Checks if a char knows a given spell.

void setNpcMoveTime ()
 Update npcmove timer.

virtual void Delete ()
 sends a remove packet to everyone nearby and deletes itself

cCharSavergetBackupStats ()
void setBackupStats (cCharSaver *saver)
void serialize (ofstream *out)
Char Equipment
const LOGICAL IsWearing (P_ITEM pi) const
SI32 Equip (P_ITEM pi, LOGICAL drag=false)
 Equip an item.

SI32 UnEquip (P_ITEM pi, LOGICAL drag=false)
 Unequip an item.

void checkEquipement ()
 unequip items that you can nop longer wear/use


Static Public Methods

void archive ()
void safeoldsave ()

Public Attributes

char nxwflags [4]
bool jailed
TIMERVAL skilldelay
TIMERVAL objectdelay
SERIAL keyserial
 for renaming keys

SERIAL packitemserial
 Only used during character creation.

SERIAL targserial
 Current combat target.

SERIAL runeserial
 Used for naming runes.

SERIAL attackerserial
 Character who attacked this character.

SERIAL ftargserial
 NPC Follow Target.

SERIAL swingtargserial
 Target they are going to hit after they swing.

SI32 namedeedserial
SI32 account
wstring profile
 player profile

SI32 npcaitype
 NPC ai.

SERIAL oldmenu
 old menu serial

SI32 stat3crc
AmxEventamxevents [ALLCHAREVENTS]
SI32 hp
SI32 stm
SI32 mn
SI32 mn2
UI16 baseskill [ALLSKILLS+1]
UI16 skill [ALLSKILLS+1]
SERIAL robe
UI08 fixedlight
char speech
SI32 weight
UI32 att
UI32 def
char war
char wresmove
TIMERVAL timeout
TIMERVAL timeout2
TIMERVAL npcmovetime
char npcWander
char oldnpcWander
SI32 fleeTimer
R32 npcMoveSpeed
R32 npcFollowSpeed
SI32 fx1
SI32 fx2
SI32 fy1
SI32 fy2
signed char fz1
std::map< SERIAL, TIMERVALspeakCharMemory
UI08 hidden
TIMERVAL invistimeout
SI32 hunger
TIMERVAL hungertime
UI08 region
SI32 combathitmessage
SI32 making
char blocked
char dir2
TIMERVAL spiritspeaktimer
SI32 spattack
TIMERVAL spadelay
TIMERVAL spatimer
SI32 taming
TIMERVAL summontimer
TIMERVAL fishingtimer
SI32 magicsphere
SI32 resists [MAX_RESISTANCE_INDEX]
LOGICAL holydamaged
LOGICAL lightdamaged
DamageType damagetype
SI32 advobj
SI32 poison
PoisonType poisoned
TIMERVAL poisontime
TIMERVAL poisontxt
TIMERVAL poisonwearofftime
SI32 fleeat
SI32 reattackat
SI32 trigger
std::string trigword
UI16 envokeid
SI32 envokeitem
SI32 split
SI32 splitchnc
SI32 targtrig
char ra
char flag
TIMERVAL tempflagtime
wstring * staticProfile
 player static profile

TIMERVAL murderrate
TIMERVAL murdersave
TIMERVAL crimflag
SI32 casting
TIMERVAL spelltime
magic::SpellId spell
SI32 spellaction
magic::CastingType spelltype
TIMERVAL nextact
TargetLocationspellTL
SI32 squelched
TIMERVAL mutetime
SI32 med
UI08 lockSkill [ALLSKILLS+1]
SI32 stealth
UI32 running
UI32 lastRunning
SI32 logout
TIMERVAL clientidletime
UI32 holdg
char fly_steps
LOGICAL tamed
LOGICAL guarded
TIMERVAL smoketimer
TIMERVAL smokedisplaytimer
TIMERVAL antispamtimer
TIMERVAL antiguardstimer
SI32 carve
SERIAL hairserial
SERIAL beardserial
TIMERVAL begging_timer
MsgBoards::PostType postType
MsgBoards::QuestType questType
SI32 questDestRegion
SI32 questOrigRegion
SI32 questBountyReward
SERIAL questBountyPostSerial
SERIAL murdererSer
SI32 prevX
SI32 prevY
signed char prevZ
LOGICAL morphed
char npc_type
TIMERVAL time_unused
TIMERVAL timeused_last
SI32 gmMoveEff
std::vector< UI32lootVector
Party
SI32 party
NPCs
UI32 lastNpcCheck
char npc
 1=Character is an NPC

LOGICAL doorUse
 True if npc can open doors.

LOGICAL shopkeeper
 true=npc shopkeeper

Location workloc
 work location (not used for now)

Location homeloc
 home location (not used for now)

Location foodloc
 food location (not used for now)

TIMERVAL nextAiCheck
SI32 hidamage
 NPC Hi Damage.

SI32 lodamage
 NPC Lo Damage.

Menu
SERIAL custmenu
 legacy code, used for old mnu_ and hard coded menu

Npc Vendor
Note:
fist draft.. need to make map with id used in recive for make faster


std::vector< vendor_item > * vendorItemsSell
 all items sell by vendor

std::vector< vendor_item > * vendorItemsBuy
 all items sell by vendor


Static Public Attributes

nxwflags_chars
Flags used for the char

const UI08 flagGrey = 0x01
 Char is grey.

const UI08 flagPermaGrey = 0x02
 Char is permanent grey.

const UI08 flagResistFire = 0x04
 Char resists to fire (unused).

const UI08 flagResistParalisys = 0x08
 Char resists to paralisys (unused).

const UI08 flagResistPoison = 0x10
 Char resists to poison (unused).

const UI08 flagWaterWalk = 0x20
 Char walks on water (npc only).

const UI08 flagSpellTelekinesys = 0x40
 Char under telekinesys spell (Luxor).

const UI08 flagSpellProtection = 0x80
 Char under protection spell (Luxor).

const UI08 flagKarmaInnocent = 0x04
 Char is innocent.

const UI08 flagKarmaMurderer = 0x01
 Char is murderer.

const UI08 flagKarmaCriminal = 0x02
 Char is criminal.

cchar_privs
Priv variables used by priv and priv2

const UI08 flagPrivGM = 0x01
 Char is GM.

const UI08 flagPrivBroadcast = 0x02
 Char can broadcast.

const UI08 flagPrivInvulnerable = 0x04
 Char is invulnerable.

const UI08 flagPrivCanViewSerials = 0x08
 Char can view serial codes.

const UI08 flagPrivNoSkillTitle = 0x10
 Char hasn't skill title.

const UI08 flagPrivPageAble = 0x20
const UI08 flagPrivCanSnoopAll = 0x40
const UI08 flagPrivCounselor = 0x80
const UI08 flagPriv2AllMove = 0x01
const UI08 flagPriv2Frozen = 0x02
const UI08 flagPriv2ViewHouseIcon = 0x04
const UI08 flagPriv2PermaHidden = 0x08
const UI08 flagPriv2NoUseMana = 0x10
const UI08 flagPriv2Dispellable = 0x20
const UI08 flagPriv2Reflection = 0x40
const UI08 flagPriv2NoUseReagents = 0x80
const UI08 flagPriv2Polymorphed = 0x100
const UI08 flagPriv2Poisoned = 0x200
const UI08 flagPriv2Mounted = 0x400
const UI08 flagPriv2Ridden = 0x800
const UI08 flagPriv2Incognito = 0x1000
const UI08 flagPriv2Dead = 0x2000
const UI08 flagPriv2canTrain = 0x4000
const UI08 flagPriv2shopkeeper = 0x8000

Private Methods

void generic_heartbeat ()
void pc_heartbeat ()
void do_lsd ()
void npc_heartbeat ()
void resetBaseSkill ()
void resetSkill ()
void resetNxwFlags ()
void resetAmxEvents ()
void resetResists ()
void resetLockSkills ()
void doSingleClickOnCharacter (SERIAL serial)
void doSingleClickOnItem (SERIAL serial)

Private Attributes

cNxwClientObjm_client
wstring * speechCurrent
char * commandSpeech
std::string param1
std::string param2
std::string param3
std::string param4
std::string param5
std::string param6
std::string param7
std::string param8
SI32 hirefee
SERIAL stablemaster_serial
 the stablemaster serial

cCharSaverbackupStats

Detailed Description

Character class.


Constructor & Destructor Documentation

cChar::cChar SERIAL    ser
 

cChar::~cChar  
 


Member Function Documentation

void cChar::applyPoison PoisonType    poisontype,
SI32    secs = -1
 

applies a poison to a char

Author:
Xanathar, modified by Endymion
Parameters:
poisontype  the poison
secs  the duration of poison ( if INVALID ( default ) default duration is used )

void cChar::archive   [static]
 

void cChar::attackStuff P_CHAR    pc
 

wrapper for AttackStuff()

Parameters:
pc  as default
Author:
Xanathar

void cChar::boltFX LOGICAL    bNoParticles
 

Bolts a char.

Author:
Xanathar
Parameters:
bNoParticles  true if NOT to use particles
Todo:
backport

int cChar::calcAtt  
 

int cChar::calcDef SI32    x = 0
 

SI32 cChar::calcResist DamageType    typeofdamage
 

calculates resist power of a char

Author:
Luxor
Parameters:
typeofdamage  type of damage to use
Returns:
the resistance

const LOGICAL cChar::canAllMove   const [inline]
 

const LOGICAL cChar::CanBroadcast   const [inline]
 

LOGICAL const cChar::CanDoGestures  
 

const LOGICAL cChar::canDoObjectAction   const [inline]
 

const LOGICAL cChar::canDoSkillAction   const [inline]
 

LOGICAL cChar::canSee cObject   obj
 

can it see the object?

Author:
Luxor

const LOGICAL cChar::CanSeeSerials   const [inline]
 

const LOGICAL cChar::CanSnoop   const [inline]
 

const LOGICAL cChar::canTrain   const [inline]
 

const LOGICAL cChar::canViewHouseIcon   const [inline]
 

void cChar::castSpell magic::SpellId    spellnumber,
TargetLocation   dest,
SI32    flags = 0,
SI32    param = 0
[inline]
 

Makes the char casting a spell.

Author:
Luxor
Parameters:
spellnumber  Spell identifier
dest  target location of the spell
Todo:
Document parameters

void cChar::checkEquipement  
 

unequip items that you can nop longer wear/use

Author:
LB

void cChar::checkPoisoning  
 

Author:
Sparhawk
Remarks:
Luxor: damage calculation adjusted.

void cChar::checkPoisoning P_CHAR    pc_def [private]
 

void cChar::checkSafeStats  
 

Checks if the stats are regular.

Author:
Luxor

LOGICAL cChar::checkSkill Skill    sk,
SI32    low,
SI32    high,
LOGICAL    bRaise = true
 

Checks a skill for success.

Author:
Xanathar
Parameters:
sk  skill
low  low bound
high  high bound
bRaise  should be raised?

const LOGICAL cChar::checkSkillSparrCheck Skill    sk,
SI32    low,
SI32    high,
P_CHAR    pcd
 

checks a skill for success (with sparring check)

Author:
Luxor
Returns:
true if success
Parameters:
sk  skill
low  low bound
high  high bound
Todo:
document pcd parameter

backport from Skills::

void cChar::circleFX short    id
 

Plays circle of blood or similar effect.

Author:
Xanathar
Parameters:
id  effect id
Todo:
backport

void cChar::combatHit P_CHAR    pc_def,
SI32    nTimeOut = 0
 

Attack a char.

Author:
Luxor
Parameters:
pc_def  defender char
Todo:
complete param documentation

int cChar::combatHitMessage SI32    damage [private]
 

void cChar::combatOnFoot  
 

void cChar::combatOnHorse  
 

bool cChar::combatTimerOk   [private]
 

Check for combat timeout.

Author:
Luxor
Returns:
true if pc's timeout for combat has passed

SI32 cChar::countBankGold  
 

const UI32 cChar::CountGold   [inline]
 

UI32 cChar::CountItems short    ID,
short    col = -1
 

count items of given id and color

Author:
Duke
Date:
26/03/2001
Parameters:
ID  id of items to count
col  color of the items to count
Searches the character recursively, counting the items of the given ID and (if given) color

UI32 cChar::CountItemsByType short    type
 

count items of given type

Author:
Duke
Date:
26/03/2001
Parameters:
type  type of items to count Searches the character recursively, counting the items of the given type

void cChar::curePoison  
 

Cures poison.

Author:
Luxor

void cChar::damage SI32    amount,
DamageType    typeofdamage = DAMAGE_PURE,
StatType    stattobedamaged = STAT_HP
 

damages a character

Author:
Xanathar & Luxor
Parameters:
amount  how much damage
typeofdamage  type of damage to use
stattobedamaged  stat to be damaged

void cChar::Delete   [virtual]
 

sends a remove packet to everyone nearby and deletes itself

Author:
Luxor

Reimplemented from cObject.

void cChar::deleteSpeechCurrent  
 

SI32 cChar::delItems short    id,
SI32    amount = 1,
short    color = -1
 

Deletes items from backpack, by id.

Author:
Xanathar
Parameters:
id  id of the item to delete
amount  amount of item to delete
color  color of item to delete
Returns:
number of items deleted

UI32 cChar::distFrom P_ITEM    pi
 

Get char's distance from the given item.

Author:
Endymion
Returns:
distance ( if invalid is returned VERY_VERY_FAR )
Parameters:
pi  the item
Note:
it check also if is subcontainer, or weared. so np call freely

UI32 cChar::distFrom P_CHAR    pc
 

Get char's distance from the given character.

Author:
Luxor
Returns:
distance ( if invalid is returned VERY_VERY_FAR )
Parameters:
pc  the char

void cChar::disturbMed  
 

stops meditation if necessary. Displays message if a socket is passed

Author:
Duke
Date:
17/03/2001

void cChar::do_lsd   [private]
 

void cChar::doCombat  
 

Does combat sequence.

Author:
Luxor

void cChar::doCombatSoundEffect SI32    fightskill,
P_ITEM    pWeapon
[private]
 

void cChar::doGmEffect  
 

Function for the different gm movement effects.

Author:
Aldur
Remarks:
if we can find new effects they can be added here and will be active for 'go 'goiter 'goplace 'whilst and 'tell for gm's and counselors
  • 0 = none
  • 1 = flamestrike
  • 2 - 6 = different sparkles

void cChar::doMissedSoundEffect   [private]
 

const LOGICAL cChar::dontUseMana   const [inline]
 

const LOGICAL cChar::dontUseReagents   const [inline]
 

void cChar::doSingleClick SERIAL    serial
 

void cChar::doSingleClickOnCharacter SERIAL    serial [private]
 

void cChar::doSingleClickOnItem SERIAL    serial [private]
 

void cChar::drink P_ITEM    pi
 

makes the character drinking something

Author:
Luxor
Since:
0.82a
Parameters:
pi  the object to drink from

void cChar::emote NXWSOCKET    socket,
TEXT   txt,
LOGICAL    antispam,
...   
 

Shows emote text of a char.

Author:
Luxor
Parameters:
socket  socket to send the emote to
txt  the emote
antispam  use or not antispam
Todo:
document extra parameters

void cChar::emoteall char *    txt,
LOGICAL    antispam,
...   
 

Shows emote text of a char to all near pcs.

Parameters:
txt  the emote
antispam  use or not antispam
Todo:
document extra parameters

SI32 cChar::Equip P_ITEM    pi,
LOGICAL    drag = false
 

Equip an item.

Author:
ANthalir
Returns:
0 if item equipped, 1 if not equipped (layer already used), 2 if small function cancelled the equip
Parameters:
pi  item to equip
drag  true if called in wear_item

void cChar::facexy SI32    facex,
SI32    facey
 

Changes the orientation of a player.

Author:
Juliunus
Todo:
document parameters

void cChar::fight P_CHAR    other
 

makes a character fight the other

Author:
Duke
Date:
20/03/2001

void cChar::flee P_CHAR    pc,
SI32    seconds = -1
 

flee from pc

Author:
Endymion
Parameters:
pc  the character
seconds  the seconds or INVALID if is hp fear

void cChar::follow P_CHAR    pc
 

follow pc

Author:
Luxor

void cChar::freeze   [inline]
 

Freeze the char.

void cChar::generic_heartbeat   [private]
 

UI32 cChar::getAmount short    id,
short    col = -1,
bool    onlyPrimaryBackpack = false
 

Get the amount of the given id, color.

Author:
Luxor, modified by Endymion for color and pack check
Returns:
amount
Parameters:
id  the id ( INVALID if no used )
col  the color ( INVALID if no used )
onlyPrimaryBackpack  false if search also in th subpack
Note:
changed to UI32 by Akron on 2003-03-18

P_ITEM cChar::getBackpack  
 

cCharSaver* cChar::getBackupStats   [inline]
 

P_ITEM cChar::GetBankBox short    banktype = BANK_GOLD
 

get the bank box

Author:
Endymion
Parameters:
banktype  BANK_GOLD or BANK_ITEM .. see note
Note:
BANK_GOLD are gold&items ( if specialbank onlygold not for only this region ) BANK_ITEM (only if specialbank) are the bank region of player

P_ITEM cChar::getBeardItem  
 

Gets beard item.

Author:
Xanathar
Returns:
the beard
Note:
Based on Antichrist incognito code

NXWCLIENT cChar::getClient   const [inline]
 

get the client

SI32 cChar::getCombatSkill  
 

returns char's combat skill

Author:
Luxor
Returns:
the index of the char's combat skill

TEXT * cChar::getCommandParams int    number
 

Get a Param.

char* cChar::getCommandSpeech   [inline]
 

const TIMERVAL cChar::GetCreationDay   const [inline]
 

Get the creation day of a character.

const SI32 cChar::GetFame   const [inline]
 

Return the fame of the char.

P_GUILD cChar::getGuild  
 

get Guild

Author:
Endymion
Returns:
the guild

SERIAL cChar::GetGuildFealty  
 

return the guild fealty

Author:
Sparhawk
Date:
31/08/2002
Since:
0.82
Returns:
serial of guild fealty

P_GUILD_MEMBER cChar::getGuildMember  
 

get Guild member

Author:
Endymion
Returns:
the guild member

SI32 cChar::GetGuildNumber  
 

return the guild number

Author:
Sparhawk
Date:
31/08/2002
Since:
0.82
Returns:
guild number

TEXT * cChar::GetGuildTitle  
 

return the guild title

Author:
Sparhawk
Date:
31/08/2002
Since:
0.82
Returns:
guild title

short cChar::GetGuildType  
 

return the guild type

Author:
Sparhawk
Date:
31/08/2002
Since:
0.82
Returns:
short type of guild. INVALID = no guild 0 = standard guild 1 = order guild 2 = chaos guild

P_ITEM cChar::getHairItem  
 

Gets hairs item.

Author:
Xanathar
Note:
Based on Antichrist incognito code
Returns:
the hairs

SI32 cChar::getHireFee   [inline]
 

SERIAL cChar::getHorse  
 

Get horse current mounted.

Author:
Endymion
Returns:
the horse serial or INVALID

P_ITEM cChar::GetItemOnLayer UI08    layer
 

Returns the item on the given layer, if any.

Author:
Duke
Date:
26/03/2001

const SI32 cChar::GetKarma   const [inline]
 

Return the karma of the char.

const UI08 cChar::GetPriv   const [inline]
 

const UI08 cChar::GetPriv2   const [inline]
 

const UI08 cChar::getPrivLevel   const [inline]
 

UI32 cChar::getRegenRate StatType    stat,
VarType    type
 

P_ITEM cChar::getShield  
 

finds the equipped shield of a character

Author:
Duke
Date:
20/05/2001
Returns:
the pointer to the shield

UI32 cChar::getSkillSum  
 

const UI08 cChar::getSkillTaught   const [inline]
 

NXWSOCKET cChar::getSocket   const
 

gets the character current socket

Author:
Luxor
Returns:
the socket

wstring* cChar::getSpeechCurrent   [inline]
 

Return current speech.

const SERIAL cChar::getStablemaster   const [inline]
 

Get the character's stablemaster.

const SI32 cChar::getStrength   const [inline]
 

Get the strength-value.

SI32 cChar::getTeachingDelta P_CHAR    pPlayer,
SI32    skill,
SI32    sum
 

calculates how much the given player can learn from this teacher

Author:
Duke
Parameters:
pPlayer  pointer to the player
skill  index of skill to teach
Returns:
how much the given player can learn

const SERIAL cChar::getTrainer   const [inline]
 

P_ITEM cChar::getWeapon  
 

finds the equipment weapon of a character

Returns:
the pointer to the weapon

void cChar::goPlace SI32    loc
 

Teleports char to a goplace location.

Author:
Xanathar
Parameters:
loc  goplace location

LOGICAL cChar::HasAttackedFirst   [inline]
 

LOGICAL cChar::HasGuildTitleToggle  
 

return guild title toggle status

Author:
Sparhawk
Date:
31/08/2002
Since:
0.82
Returns:
true is show title

const LOGICAL cChar::HasHumanBody   const [inline]
 

LOGICAL cChar::hasPath   [inline]
 

has a path set?

const LOGICAL cChar::hasReflection   const [inline]
 

void cChar::heartbeat  
 

void cChar::helpStuff P_CHAR    pc_i
 

Author:
Xanathar
Parameters:
pc_i  as default

void cChar::hideBySkill  
 

Hides a player by skill.

Author:
Xanathar

void cChar::hideBySpell SI32    timer = -1
 

Hides a player by spell.

Author:
Xanathar & Luxor

void cChar::IncreaseKarma SI32    value,
P_CHAR    pKilled = 0
 

increase or decrease the karma of the char

Author:
Endymion
Since:
0.82a
Parameters:
value  positive or negative value to add to karma
killed  ptr to killed char
Note:
every increase of karma has a related event
Sparhawk: karma increase now can also be applied to npc's

const LOGICAL cChar::InGuardedArea   const [inline]
 

const LOGICAL cChar::isBeingTrained   const [inline]
 

const LOGICAL cChar::IsCounselor   const [inline]
 

const LOGICAL cChar::IsCriminal   const [inline]
 

const LOGICAL cChar::isDispellable   const [inline]
 

const LOGICAL cChar::isFrozen   const [inline]
 

const LOGICAL cChar::IsGM   const [inline]
 

const LOGICAL cChar::IsGMorCounselor   const [inline]
 

const LOGICAL cChar::IsGrey  
 

bool cChar::isGuilded  
 

check if guilded

Author:
Endymion
Returns:
true if the char is guilded

LOGICAL cChar::IsGuildTraitor  
 

return guild traitor status

Author:
Sparhawk
Date:
31/08/2002
Since:
0.82
Returns:
bool: true is traitor

const LOGICAL cChar::IsHidden   const [inline]
 

const LOGICAL cChar::IsHiddenBySkill   const [inline]
 

const LOGICAL cChar::IsHiddenBySpell   const [inline]
 

bool cChar::isHirable   [inline]
 

LOGICAL cChar::isInBackpack P_ITEM    pi
 

const LOGICAL cChar::IsInnocent   const [inline]
 

const LOGICAL cChar::IsInvul   const [inline]
 

bool cChar::isMounting P_CHAR    horse
 

Check if is on given horse.

Author:
Endymion
Returns:
true if mounting
Parameters:
horse  horse

bool cChar::isMounting  
 

Check if is on horse.

Author:
Endymion
Returns:
true if mounting

const LOGICAL cChar::IsMurderer   const [inline]
 

LOGICAL const cChar::IsOnline   const
 

get online status

Returns:
true if the player is owning the character online
Author:
Luxor

LOGICAL const cChar::IsOverWeight  
 

Checks char weight.

Author:
Xanathar
Note:
this function modify the class variable, very bad...
Returns:
true if the char is over weight

const LOGICAL cChar::isOwnerOf const cObject   obj const [inline]
 

const LOGICAL cChar::isPermaHidden   const [inline]
 

const LOGICAL cChar::isRunning   const [inline]
 

tells if a character is running

LOGICAL cChar::isSameAs P_CHAR    pc [inline]
 

const LOGICAL cChar::isStabled   const [inline]
 

Check if char is stabled.

const LOGICAL cChar::IsWearing P_ITEM    pi const [inline]
 

void cChar::jail SI32    seconds = 60*60*24
 

Jails a char.

Author:
Xanathar
Parameters:
seconds  second to jail the character for
Todo:
backport

void cChar::kick  
 

Kicks a char.

Author:
Zippy, Xanathar

void cChar::Kill  
 

Manages/causes character death.

Author:
Xanathar
Note:
Original by LB, ANtichrist, Ripper, Tauriel, JustMicheal annd others
expanded call to old PlayDeathSound

LOGICAL cChar::knowsSpell magic::SpellId    spellnumber
 

Checks if a char knows a given spell.

Author:
Xanathar
Parameters:
spellnumber  spell identifier to check
Returns:
true if the char know the spell

void cChar::loadEventFromScript TEXT   script1,
TEXT   script2
 

Note:
Don't add onstart events in npc scripts, because then they'll also be executed when character is created add onstart event to character programmatically

LOGICAL cChar::losFrom P_CHAR    pc
 

Returns line of sight from the char to the give char.

Author:
Luxor
Parameters:
pc  pointer to the char to check line of sight from
Returns:
true if is in line of sight

void cChar::MakeInvulnerable   [inline]
 

void cChar::MakeVulnerable   [inline]
 

void cChar::modifyFame SI32    value
 

increase or decrease the fame of the char

Author:
Endymion
Since:
0.82a
Parameters:
value  positive or negative value to add to fame
Note:
every increase of karma have an event and stuff related

void cChar::modifyStrength SI32    mod,
bool    check = true
[inline]
 

modify the strength

Author:
Anthalir
Since:
0.82
Parameters:
mod  signed value representing the value to add to curent strength:
  • negative: lower the str
  • positive: rise the str
Todo:
document check parameter

void cChar::morph SI32    npcNumber,
LOGICAL    bBackup
 

Characters morphing (incognito, polymorph, etc).

Author:
Wintermute, previous code by Xanathar
Note:
based on Antichrist incognito code
Calling it with no params will undo any morphing
Any morphing with backup on will undo all previous morphings and install itself
Can recurse :]
Todo:
document parameters

void cChar::morph short    bodyid = -1,
short    skincolor = -1,
short    hairstyle = -1,
short    haircolor = -1,
short    beardstyle = -1,
short    beardcolor = -1,
const char *    newname = NULL,
LOGICAL    bBackup = true
 

Characters morphing (incognito, polymorph, etc).

Author:
Wintermute, previous code by Xanathar
Note:
based on Antichrist incognito code
Calling it with no params will undo any morphing
Any morphing with backup on will undo all previous morphings and install itself
Can recurse :]
Todo:
document parameters

void cChar::mounthorse P_CHAR    mount
 

Mount a creature.

Author:
Unknow, restyle by Endymion
Parameters:
mount  the creature
Note:
remove creature and give player a creature item

void cChar::MoveTo SI32    x,
SI32    y,
SI32    z
[inline]
 

void cChar::MoveTo Location    newloc
 

void cChar::movingFX P_CHAR    destination,
short    id,
SI32    speed,
SI32    loop,
LOGICAL    explode,
class ParticleFx   part = NULL
 

Plays a moving effect from this to target char.

Author:
Xanathar
Parameters:
destination  the target char
id  id of the effect
speed  speed of the effect
loop  loops
explode  true if should do a final explosion
part  particle effects structure

void cChar::npc_heartbeat   [private]
 

void cChar::onSingleClick P_CHAR    clickedBy
 

void cChar::openBankBox P_CHAR    pc
 

open a bankbox

Author:
Endymion
Parameters:
pc  the character to open the bank of
Note:
Added to cChar by Akron (todo from endymion)

void cChar::openSpecialBank P_CHAR    pc
 

region specific bankbox

Author:
Endymion
Parameters:
pc  character owner of bank
If activated, you can only put golds into normal banks and there are special banks (for now we still use normal bankers, but u have to say the SPECIALBANKTRIGGER word to open it) where u can put all the items: one notice: the special bank is caracteristic of regions....so in Britain you don't find the items you leaved in Minoc! All this for increasing pk-work and commerce! :) (and surely the Mercenary work, so now have to pay strong warriors to escort u during your travels!)

void cChar::pathFind Location    pos,
LOGICAL    bOverrideCurrentPath = true
 

Walk to position.

Author:
Luxor

void cChar::pc_heartbeat   [private]
 

void cChar::playAction SI32    action
 

Makes the char doing an action.

Author:
Luxor

void cChar::playCombatAction  
 

plays the combat animation

Author:
Luxor

void cChar::playMonsterSound MonsterSound    sfx
 

Plays a monster sound effect.

Author:
Akron (port)
Parameters:
sfx  sound effect
Note:
ported from sndpkg.cpp, i'm not the original author - Akron

void cChar::playSFX SI16    sound,
LOGICAL    onlyToMe = false
 

plays a sound effect on a char

Author:
Xanathar
Parameters:
sound  as default
onlyToMe  Send sfx only to same char not to all near players (default: false)

void cChar::possess P_CHAR    pc
 

shifts a player in the body of a npc, usually used only by GMs

Author:
Luxor
Parameters:
pc  the character to possess

bool cChar::regenTimerOk StatType    stat
 

void cChar::removeItemBonus cItem   pi
 

void cChar::resetAmxEvents   [inline, private]
 

void cChar::ResetAttackFirst   [inline]
 

void cChar::resetBaseSkill   [inline, private]
 

void cChar::resetCanTrain   [inline]
 

void cChar::resetCommandParams  
 

Reset all the Params strings.

void cChar::ResetGuildTitleToggle  
 

reset guild title toggle

Author:
Sparhawk
Date:
31/08/2002
Since:
0.82

void cChar::ResetGuildTraitor  
 

reset guild traitor status

Author:
Sparhawk
Date:
31/08/2002
Since:
0.82

void cChar::resetLockSkills   [inline, private]
 

void cChar::resetNxwFlags   [inline, private]
 

void cChar::resetResists   [inline, private]
 

void cChar::resetSkill   [inline, private]
 

void cChar::resetSpeechCurrent   [inline]
 

Reset current speech.

LOGICAL cChar::resist SI32    n [inline]
 

const LOGICAL cChar::resistsFire   const [inline]
 

const LOGICAL cChar::resistsFreeze   const [inline]
 

void cChar::resurrect NXWCLIENT    healer = NULL
 

Resurrects a char.

Author:
Xanather
Parameters:
healer  Player that resurrected the char

void cChar::safeoldsave   [static]
 

LOGICAL cChar::seeForFirstTime cObject   obj,
LOGICAL    testCanSee = true
 

does it see the object for the first time?

Author:
Luxor

LOGICAL cChar::seeForLastTime cObject   obj,
LOGICAL    testCanSee = true
 

does it see the object for the first time?

Author:
Luxor

void cChar::serialize ofstream *    out
 

void cChar::setAllMove LOGICAL    set = true [inline]
 

void cChar::SetAttackFirst LOGICAL    af = true [inline]
 

void cChar::setBackupStats cCharSaver   saver [inline]
 

void cChar::setCanTrain LOGICAL    c = true [inline]
 

void cChar::setClient NXWCLIENT    client
 

void cChar::setCommandParams int    number,
std::string    param
 

Set a Param.

void cChar::setCommandSpeech char *    curr_speech [inline]
 

void cChar::SetCreationDay TIMERVAL    day [inline]
 

Set the creation day of a character.

void cChar::SetCriminal  
 

void cChar::SetFame SI32    newfame [inline]
 

void cChar::SetGrey   [inline]
 

Makes a character temporary grey.

void cChar::setGreyFlag LOGICAL    state [inline]
 

void cChar::setGuild P_GUILD    guild,
P_GUILD_MEMBER    member
 

set Guild

Author:
Endymion
Parameters:
guild  the guild

void cChar::SetGuildFealty SERIAL    newGuildFealty
 

set the guild fealty

Author:
Sparhawk
Date:
31/08/2002
Since:
0.82
Parameters:
newGuildFealty  serial of char to set the guild fealty

void cChar::SetGuildNumber SI32    newGuildNumber
 

set the guild number

Author:
Sparhawk
Date:
31/08/2002
Since:
0.82
Parameters:
newGuildNumber  guild number to set to the char

void cChar::SetGuildTitle TEXT   newGuildTitle
 

set the guild title

Author:
Sparhawk
Date:
31/08/2002
Since:
0.82
Parameters:
newGuildTitle  guild title

void cChar::SetGuildTitleToggle  
 

set guild title toggle

Author:
Sparhawk
Date:
31/08/2002
Since:
0.82

void cChar::SetGuildTraitor  
 

set guild traitor status

Author:
Sparhawk
Date:
31/08/2002
Since:
0.82

void cChar::SetGuildType short    newGuildType
 

set the guild type

Author:
Sparhawk
Date:
31/08/2002
Since:
0.82
Parameters:
newGuildType  value must be between INVALID and MAX_GUILDTYPE

void cChar::setHireFee SI32    newfee [inline]
 

void cChar::SetInnocent  
 

void cChar::SetKarma SI32    newkarma [inline]
 

Set the karma of the char.

void cChar::setMultiSerial long    mulser
 

void cChar::SetMurderer  
 

void cChar::setNextMoveTime short    tamediv = 1
 

void cChar::setNpcMoveTime  
 

Update npcmove timer.

Author:
Sparhawk

void cChar::setObjectDelay UI32    seconds = server_data.objectdelay [inline]
 

void cChar::setOnHorse  
 

Set on horse.

Author:
Endymion
Warning:
use cChar::mountHorse() for mount an npc, this is used internal

void cChar::setOwner P_CHAR    owner
 

Sets owner fields.

Author:
Xanathar
Parameters:
owner  new owner

void cChar::SetPermaGrey   [inline]
 

void cChar::setPermaHidden LOGICAL    set = true [inline]
 

void cChar::SetPriv UI08    p [inline]
 

void cChar::SetPriv2 SI08    p [inline]
 

void cChar::setPriv2 UI08    privFlag,
LOGICAL    set
[inline, protected]
 

void cChar::setPrivLevel UI08    pLevel [inline]
 

void cChar::setReflection LOGICAL    set = true [inline]
 

void cChar::setRegenRate StatType    stat,
UI32    rate,
VarType    type
 

void cChar::setRunning   [inline]
 

void cChar::setSkillDelay UI32    seconds = server_data.skilldelay [inline]
 

void cChar::setSpeechCurrent wstring *    speech [inline]
 

Set current speech.

void cChar::setStrength UI32    val,
bool    check = true
 

void cChar::setTelekinesisFlag LOGICAL    state [inline]
 

void cChar::setViewHouseIcon LOGICAL    set = true [inline]
 

void cChar::setWresMove SI32    move = 0
 

void cChar::showBackpack   [inline]
 

Show Backpack to player.

void cChar::showContainer P_ITEM    pCont
 

Show a container to player.

Author:
GHisha
Parameters:
pCont  the container

void cChar::showLongName P_CHAR    showToWho,
LOGICAL    showSerials
 

void cChar::showPaperdoll P_CHAR    viewer
 

void cChar::stable P_CHAR    stablemaster
 

void cChar::staticFX short    id,
SI32    speed,
SI32    loop,
class ParticleFx   part = NULL
 

Plays a static effect on a char.

Author:
Xanathar
Parameters:
id  id of 2d effect; if -1, 2d effect is get from particles obj
speed  speed of effect, -1 and it will be get from particles data
loop  loop factor - -1 and it will be get from particles data
part  optional particles data
Note:
if part == NULL then id, speed and loop MUST be >= 0

void cChar::sysmsg const TEXT   txt,
...   
 

easy wrapper to sysmsg

Author:
Luxor
Parameters:
txt  as default
...  as default

void cChar::talk NXWSOCKET    s,
TEXT   txt,
LOGICAL    antispam = 1
 

Shows speech text of a char to the given char.

Author:
Luxor
Parameters:
s  socket to send the speech to
txt  the speech
antispam  use or not antispam

void cChar::talkAll TEXT   txt,
LOGICAL    antispam = 1
 

shows speech text to all pcs near the char

Author:
Luxor
Parameters:
txt  the speech
antispam  use or not antispam

void cChar::talkAllRunic TEXT   txt,
LOGICAL    antispam = 0
 

Shows runic speech text to all pcs near the char.

Author:
Luxor
Parameters:
txt  the speech
antispam  use or not antispam

void cChar::talkRunic NXWSOCKET    s,
TEXT   txt,
LOGICAL    antispam = 1
 

Shows runic speech text of a char to the given socket.

Author:
Luxor
Parameters:
s  socket to send the speech to
txt  speech
antispam  use or not antispam

void cChar::teleport UI08    flags = TELEFLAG_SENDALL,
NXWCLIENT    cli = NULL
 

Teleports character to its current set coordinates.

Author:
Luxor

void cChar::toggleCombat  
 

Toggle war mode.

Author:
Luxor

void cChar::undoCombat   [private]
 

Abort combat sequence.

Author:
Sparhawk

SI32 cChar::UnEquip P_ITEM    pi,
LOGICAL    drag = false
 

Unequip an item.

Author:
Anthalir
Returns:
0 if item unequipped, 1 if bypass called, item not unequipped
Parameters:
pi  item to unequip
drag  true when function called in get_item

void cChar::unfreeze LOGICAL    calledByTempfx = false
 

unfreezes the char

Author:
Xanathar

void cChar::unHide  
 

Reveals the char if he was hidden.

Author:
Duke
Date:
17/03/2001
20/03/2003 ported unhidesendchar into the function code - Akron

int cChar::unmountHorse  
 

make char unmount horse (Remove horse item and spawn new horse)

Returns:
1 on error, 0 else
Remarks:
only online players can unmount

void cChar::unStable  
 

void cChar::updateRegenTimer StatType    stat
 

void cChar::updateStats SI32    stat
 

Updates stats to nearbye players.

Author:
Xanathar
Parameters:
stat  stat which changed

void cChar::walk  
 

execute walk code <Luxor>

Author:
Luxor

void cChar::walkNextStep   [private]
 

walk next path step

Author:
Luxor


Member Data Documentation

SI32 cChar::account
 

SI32 cChar::advobj
 

class AmxEvent* cChar::amxevents[ALLCHAREVENTS]
 

TIMERVAL cChar::antiguardstimer
 

TIMERVAL cChar::antispamtimer
 

UI32 cChar::att
 

SERIAL cChar::attackerserial
 

Character who attacked this character.

LOGICAL cChar::attackfirst [private]
 

0 = defending, 1 = attacked first

cCharSaver* cChar::backupStats [private]
 

UI16 cChar::baseskill[ALLSKILLS+1]
 

SERIAL cChar::beardserial
 

TIMERVAL cChar::begging_timer
 

char cChar::blocked
 

LOGICAL cChar::cantrain
 

SI32 cChar::carve
 

SI32 cChar::casting
 

TIMERVAL cChar::clientidletime
 

SI32 cChar::combathitmessage
 

char* cChar::commandSpeech [private]
 

TIMERVAL cChar::creationday [private]
 

Day since EPOCH this character was created on.

TIMERVAL cChar::crimflag
 

SERIAL cChar::custmenu
 

legacy code, used for old mnu_ and hard coded menu

DamageType cChar::damagetype
 

LOGICAL cChar::dead
 

Is the character dead ?

UI32 cChar::deaths
 

Number of deaths.

UI32 cChar::def
 

SI08 cChar::dir
 

&0F=Direction

char cChar::dir2
 

LOGICAL cChar::doorUse
 

True if npc can open doors.

SI32 cChar::dx
 

Dexterity.

SI32 cChar::dx2
 

Reserved for calculation.

SI32 cChar::dx3
 

Luxor: safe dexterity value.

UI16 cChar::emotecolor
 

Color for emote messages.

UI16 cChar::envokeid
 

SI32 cChar::envokeitem
 

SI32 cChar::fame [private]
 

fame of the char

TIMERVAL cChar::fishingtimer
 

UI08 cChar::fixedlight
 

char cChar::flag
 

const UI08 cChar::flagGrey = 0x01 [static]
 

Char is grey.

const UI08 cChar::flagKarmaCriminal = 0x02 [static]
 

Char is criminal.

const UI08 cChar::flagKarmaInnocent = 0x04 [static]
 

Char is innocent.

const UI08 cChar::flagKarmaMurderer = 0x01 [static]
 

Char is murderer.

const UI08 cChar::flagPermaGrey = 0x02 [static]
 

Char is permanent grey.

const UI08 cChar::flagPriv2AllMove = 0x01 [static]
 

const UI08 cChar::flagPriv2canTrain = 0x4000 [static]
 

const UI08 cChar::flagPriv2Dead = 0x2000 [static]
 

const UI08 cChar::flagPriv2Dispellable = 0x20 [static]
 

const UI08 cChar::flagPriv2Frozen = 0x02 [static]
 

const UI08 cChar::flagPriv2Incognito = 0x1000 [static]
 

const UI08 cChar::flagPriv2Mounted = 0x400 [static]
 

const UI08 cChar::flagPriv2NoUseMana = 0x10 [static]
 

const UI08 cChar::flagPriv2NoUseReagents = 0x80 [static]
 

const UI08 cChar::flagPriv2PermaHidden = 0x08 [static]
 

const UI08 cChar::flagPriv2Poisoned = 0x200 [static]
 

const UI08 cChar::flagPriv2Polymorphed = 0x100 [static]
 

const UI08 cChar::flagPriv2Reflection = 0x40 [static]
 

const UI08 cChar::flagPriv2Ridden = 0x800 [static]
 

const UI08 cChar::flagPriv2shopkeeper = 0x8000 [static]
 

const UI08 cChar::flagPriv2ViewHouseIcon = 0x04 [static]
 

const UI08 cChar::flagPrivBroadcast = 0x02 [static]
 

Char can broadcast.

const UI08 cChar::flagPrivCanSnoopAll = 0x40 [static]
 

const UI08 cChar::flagPrivCanViewSerials = 0x08 [static]
 

Char can view serial codes.

const UI08 cChar::flagPrivCounselor = 0x80 [static]
 

const UI08 cChar::flagPrivGM = 0x01 [static]
 

Char is GM.

const UI08 cChar::flagPrivInvulnerable = 0x04 [static]
 

Char is invulnerable.

const UI08 cChar::flagPrivNoSkillTitle = 0x10 [static]
 

Char hasn't skill title.

const UI08 cChar::flagPrivPageAble = 0x20 [static]
 

const UI08 cChar::flagResistFire = 0x04 [static]
 

Char resists to fire (unused).

const UI08 cChar::flagResistParalisys = 0x08 [static]
 

Char resists to paralisys (unused).

const UI08 cChar::flagResistPoison = 0x10 [static]
 

Char resists to poison (unused).

const UI08 cChar::flagSpellProtection = 0x80 [static]
 

Char under protection spell (Luxor).

const UI08 cChar::flagSpellTelekinesys = 0x40 [static]
 

Char under telekinesys spell (Luxor).

const UI08 cChar::flagWaterWalk = 0x20 [static]
 

Char walks on water (npc only).

SI32 cChar::fleeat
 

SI32 cChar::fleeTimer
 

char cChar::fly_steps
 

UI08 cChar::fonttype
 

Speech font to use.

Location cChar::foodloc
 

food location (not used for now)

R32 cChar::fstm
 

Unavowed - stamina to remove the next step.

SERIAL cChar::ftargserial
 

NPC Follow Target.

SI32 cChar::fx1
 

SI32 cChar::fx2
 

SI32 cChar::fy1
 

SI32 cChar::fy2
 

signed char cChar::fz1
 

SI32 cChar::gmMoveEff
 

UI08 cChar::gmrestrict
 

for restricting GMs to certain regions

LOGICAL cChar::guarded
 

P_GUILD cChar::guild [private]
 

the guild

SERIAL cChar::guildFealty [private]
 

SI32 cChar::guildNumber [private]
 

LOGICAL cChar::guildToggle [private]
 

LOGICAL cChar::guildTraitor [private]
 

short cChar::guildType [private]
 

SERIAL cChar::hairserial
 

SI32 cChar::hidamage
 

NPC Hi Damage.

UI08 cChar::hidden
 

SI32 cChar::hirefee [private]
 

UI32 cChar::holdg
 

LOGICAL cChar::holydamaged
 

Location cChar::homeloc
 

home location (not used for now)

SI32 cChar::hp
 

SI32 cChar::hunger
 

TIMERVAL cChar::hungertime
 

SI32 cChar::in
 

Intelligence.

SI32 cChar::in2
 

Reserved for calculation.

SI32 cChar::in3
 

Luxor: safe intelligence value.

LOGICAL cChar::incognito
 

AntiChrist - true if under incognito effect.

TIMERVAL cChar::invistimeout
 

bool cChar::jailed
 

SI32 cChar::karma [private]
 

karma of the char

SERIAL cChar::keyserial
 

for renaming keys

UI32 cChar::kills
 

PvP Kills.

UI32 cChar::LastMoveTime
 

server time of last move

UI32 cChar::lastNpcCheck
 

UI32 cChar::lastRunning
 

LOGICAL cChar::lightdamaged
 

UI08 cChar::lockSkill[ALLSKILLS+1]
 

SI32 cChar::lodamage
 

NPC Lo Damage.

SI32 cChar::logout
 

std::vector< UI32 > cChar::lootVector
 

cNxwClientObj* cChar::m_client [private]
 

SI32 cChar::magicsphere
 

SI32 cChar::making
 

SI32 cChar::med
 

P_GUILD_MEMBER cChar::member [private]
 

the guild member info

SI32 cChar::mn
 

SI32 cChar::mn2
 

LOGICAL cChar::morphed
 

bool cChar::mounted
 

if now is mounted by a char

SERIAL cChar::murdererSer
 

TIMERVAL cChar::murderrate
 

TIMERVAL cChar::murdersave
 

TIMERVAL cChar::mutetime
 

SI32 cChar::namedeedserial
 

TIMERVAL cChar::nextact
 

TIMERVAL cChar::nextAiCheck
 

char cChar::npc
 

1=Character is an NPC

char cChar::npc_type
 

SI32 cChar::npcaitype
 

NPC ai.

R32 cChar::npcFollowSpeed
 

R32 cChar::npcMoveSpeed
 

TIMERVAL cChar::npcmovetime
 

char cChar::npcWander
 

char cChar::nxwflags[4]
 

TIMERVAL cChar::objectdelay
 

SERIAL cChar::oldmenu
 

old menu serial

char cChar::oldnpcWander
 

LOGICAL cChar::onhorse [private]
 

On a horse.

SERIAL cChar::packitemserial
 

Only used during character creation.

std::string cChar::param1 [private]
 

std::string cChar::param2 [private]
 

std::string cChar::param3 [private]
 

std::string cChar::param4 [private]
 

std::string cChar::param5 [private]
 

std::string cChar::param6 [private]
 

std::string cChar::param7 [private]
 

std::string cChar::param8 [private]
 

SI32 cChar::party
 

cPath* cChar::path [private]
 

current path

SI32 cChar::poison
 

PoisonType cChar::poisoned
 

TIMERVAL cChar::poisontime
 

TIMERVAL cChar::poisontxt
 

TIMERVAL cChar::poisonwearofftime
 

LOGICAL cChar::polymorph
 

AntiChrist - true if under polymorph effect.

SERIAL cChar::possessedSerial
 

SERIAL cChar::possessorSerial
 

MsgBoards::PostType cChar::postType
 

SI32 cChar::prevX
 

SI32 cChar::prevY
 

signed char cChar::prevZ
 

UI08 cChar::priv [protected]
 

see cchar_privs

UI08 cChar::priv2 [protected]
 

see cchar_privs

UI08 cChar::privLevel [protected]
 

privilege level

wstring cChar::profile
 

player profile

SERIAL cChar::questBountyPostSerial
 

SI32 cChar::questBountyReward
 

SI32 cChar::questDestRegion
 

SI32 cChar::questOrigRegion
 

MsgBoards::QuestType cChar::questType
 

char cChar::ra
 

SI32 cChar::reattackat
 

regen_st cChar::regens[ALL_STATS] [private]
 

stats regen info

UI08 cChar::region
 

SI32 cChar::resists[MAX_RESISTANCE_INDEX]
 

SERIAL cChar::robe
 

SERIAL cChar::runeserial
 

Used for naming runes.

UI32 cChar::running
 

UI16 cChar::saycolor
 

Color for say messages.

SERIAL_SLIST cChar::sentObjects [private]
 

LOGICAL cChar::shopkeeper
 

true=npc shopkeeper

UI16 cChar::skill[ALLSKILLS+1]
 

TIMERVAL cChar::skilldelay
 

TIMERVAL cChar::smokedisplaytimer
 

TIMERVAL cChar::smoketimer
 

TIMERVAL cChar::spadelay
 

TIMERVAL cChar::spatimer
 

SI32 cChar::spattack
 

std::map<SERIAL, TIMERVAL> cChar::speakCharMemory
 

char cChar::speech
 

wstring* cChar::speechCurrent [private]
 

magic::SpellId cChar::spell
 

SI32 cChar::spellaction
 

TIMERVAL cChar::spelltime
 

TargetLocation* cChar::spellTL
 

magic::CastingType cChar::spelltype
 

TIMERVAL cChar::spiritspeaktimer
 

SI32 cChar::split
 

SI32 cChar::splitchnc
 

SI32 cChar::squelched
 

SI32 cChar::st2
 

Reserved for calculation.

SI32 cChar::st3
 

Luxor: safe strength value.

SERIAL cChar::stablemaster_serial [private]
 

the stablemaster serial

SI32 cChar::stat3crc
 

SI32 cChar::statGainedToday
 

xan :-> for stat-gain cap

wstring* cChar::staticProfile
 

player static profile

SI32 cChar::stealth
 

SI32 cChar::stm
 

UI32_s cChar::str [private]
 

Strength.

TIMERVAL cChar::summontimer
 

SERIAL cChar::swingtargserial
 

Target they are going to hit after they swing.

LOGICAL cChar::tamed
 

SI32 cChar::taming
 

FUNCIDX cChar::targetcallback
 

SERIAL cChar::targserial
 

Current combat target.

SI32 cChar::targtrig
 

TIMERVAL cChar::tempflagtime
 

TIMERVAL cChar::time_unused
 

TIMERVAL cChar::timeout
 

TIMERVAL cChar::timeout2
 

TIMERVAL cChar::timeused_last
 

std::string cChar::title
 

SERIAL cChar::trainer
 

Serial of the NPC training the char, -1 if none.

UI08 cChar::trainingplayerin
 

Index in skillname of the skill the NPC is training the player in.

SI32 cChar::trigger
 

std::string cChar::trigword
 

LOGICAL cChar::unicode
 

This is set to 1 if the player uses unicode speech, 0 if not.

std::vector<vendor_item>* cChar::vendorItemsBuy
 

all items sell by vendor

std::vector<vendor_item>* cChar::vendorItemsSell
 

all items sell by vendor

char cChar::war
 

SI32 cChar::weight
 

Location cChar::workloc
 

work location (not used for now)

char cChar::wresmove
 


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