Planeshift
psGlyph Class Reference

Defines a glyph, one element to create a spell. More...

#include <psglyph.h>

Public Member Functions

virtual psItemClone ()
 
virtual void Copy (psGlyph *target)
 
virtual psItemCreateNew ()
 Creates a new blank instance of it's class (i.e. More...
 
virtual const char * GetItemType ()
 Return a string identifying this object as a Glyph. More...
 
virtual int GetPurifyStatus () const
 
csString GlyphToXML ()
 
virtual bool Load (iResultRow &row)
 Loads data from a database row into the current psItem. More...
 
void operator delete (void *)
 The delete operator is overriden to call PoolAllocator template functions. More...
 
void * operator new (size_t)
 The new operator is overriden to call PoolAllocator template functions. More...
 
 psGlyph ()
 
bool Purified ()
 
void PurifyingFinished ()
 
void PurifyingStarted ()
 
virtual void SetOwningCharacter (psCharacter *owner)
 Alters the owning character of this item. Also see UpdateInventoryStatus. More...
 
void UnPurify ()
 
virtual ~psGlyph ()
 
- Public Member Functions inherited from psItem
float AddDecay (float severityFactor)
 Adjust the item quality by an amount of decay. More...
 
void AddLootModifier (uint32_t id, int pos=-1)
 Allows to add a modification to the item. More...
 
bool AddModifier (psItemStats *modifier)
 Adds a modifier to this item instance if there is space available. More...
 
void AddOpenableLock (uint32 v)
 
double CalcFunction (MathEnvironment *env, const char *functionName, const double *params)
 
void CancelEquipScript ()
 
bool CanOpenLock (uint32 id, bool includeSkel) const
 
bool CheckRequirements (psCharacter *character, csString &resp)
 Check to see if the character meets the requirements for this item. More...
 
bool CheckStackableWith (const psItem *otheritem, bool precise, bool checkStackCount=true, bool checkWorld=true) const
 Check if otheritem is stackable with this item. More...
 
void ClearOpenableLocks ()
 
void CombineStack (psItem *&stackme)
 Combines 'stackme' with this item. More...
 
bool CompareOpenableLocks (const psItem *key) const
 
virtual psItemCopy (unsigned short newstackcount)
 Duplicates an item instance. More...
 
virtual void Copy (psItem *target)
 Copies values of its attributes to item 'target'. More...
 
void CopyOpenableLock (psItem *origKey)
 
bool DeleteFromDatabase ()
 
virtual void DeleteObjectCallback (iDeleteNotificationObject *object)
 Handles deleted gem objects. More...
 
bool Destroy ()
 Called when an item is completely destroyed from the persistant world. More...
 
bool FitsInSlot (INVENTORY_SLOT_NUMBER slot)
 
bool FitsInSlots (PSITEMSTATS_SLOTLIST slotmask)
 
void ForceSaveIfNew ()
 Saves this item now if it hasn't been saved before, to force the generation of a UID. More...
 
PSITEMSTATS_AMMOTYPE GetAmmoType ()
 
PSITEMSTATS_ARMORTYPE GetArmorType ()
 
float GetArmorVSWeaponResistance (psItemStats *armor)
 Gets the reduction of this weapon against the armor given. More...
 
int GetAttackAnimID (psCharacter *pschar)
 TODO: Comment me with something more than "Gets the attack animation ID". More...
 
psItemStatsGetBaseStats () const
 Returns the base stats for this item instance. More...
 
csString GetBookText ()
 Gets the book text, should only be used if this is a book. More...
 
bool GetBuyPersonalise ()
 
bool GetCanTransform ()
 
psItemCategoryGetCategory ()
 
int GetCharges () const
 
uint32 GetContainerID () const
 Returns the item that contains this item, or NULL if it's not contained by another item. More...
 
unsigned short GetContainerMaxSize ()
 
int GetContainerMaxSlots ()
 Gets the slots available in this item (only containers) which means also the maximum amount of items which can be stored in this container. More...
 
float GetCounterBlockValue ()
 
PID GetCrafterID () const
 Returns the UID for the crafter of this item. Be sure to check GetIsCrafterIDValid()! More...
 
PSITEMSTATS_CREATIVETYPE GetCreative ()
 
const csString & GetCreativeBackgroundImg ()
 return the background image used in this creative. More...
 
PID GetCreator (PSITEMSTATS_CREATORSTATUS &creatorStatus)
 Gets the creator of this creative and the creator setting status. More...
 
psItemStatsGetCurrentStats () const
 Gets a pointer to the current stats. More...
 
float GetDamage (PSITEMSTATS_DAMAGETYPE dmgtype)
 
float GetDamageProtection (PSITEMSTATS_DAMAGETYPE dmgtype)
 
float GetDecay ()
 Returns the decay value of the item. See the decay member for a description of what this is. More...
 
float GetDecayResistance ()
 
const char * GetDescription () const
 Fetch the psitem description if it's not null, otherwise the current_stats description. More...
 
PSITEM_FLAGS GetFlags ()
 
gemItemGetGemObject ()
 
PID GetGuardingCharacterID () const
 Item guardians: items dropped in the world or placed in a public container are not owned, but "guarded" by a character. More...
 
unsigned int GetGuildID () const
 Returns the UID for the guild who has certified this item. Be sure to check GetIsGuildIDValid()! More...
 
float GetHardness ()
 
int GetIdentifyMinSkill ()
 Returns minimum skill level to identify certain examined items. More...
 
int GetIdentifySkill ()
 Returns skill id of skill needed to identify examined items. More...
 
const char * GetImageName ()
 Get the Image Name for the item. More...
 
bool GetIsAmmo ()
 
bool GetIsArmor ()
 
bool GetIsAutoTransformContainer ()
 
bool GetIsBothHandsWeapon ()
 
bool GetIsCD () const
 
bool GetIsConstructible ()
 
bool GetIsContainer ()
 
bool GetIsCrafterIDValid ()
 Returns true if the crafter character ID is valid. More...
 
bool GetIsEquipStackable () const
 
bool GetIsGuildIDValid ()
 Returns true if the certifying guild ID is valid. More...
 
bool GetIsIdentifiable ()
 Get the identifiable status of the item. More...
 
bool GetIsKey () const
 
bool GetIsLockable ()
 
bool GetIsLocked ()
 
bool GetIsMasterKey () const
 
bool GetIsMeleeWeapon ()
 
bool GetIsNoPickup ()
 Gets if the item has a no pickup flag set. More...
 
bool GetIsNoPickupStrong ()
 Checks if the item has a strong no pickup flag set. More...
 
bool GetIsNoPickupWeak ()
 Checks if the item has a weak no pickup flag set. More...
 
bool GetIsNpcOwned () const
 
bool GetIsRangeWeapon ()
 
bool GetIsReadable ()
 Checks the readable flag in the item_stats and tell if this is the case. More...
 
bool GetIsSecurityLocked ()
 
bool GetIsSettingItem () const
 
bool GetIsShield ()
 
bool GetIsSkeleton ()
 
bool GetIsStackable () const
 
bool GetIsTrap ()
 
bool GetIsUnique () const
 Returns true if this item is based off of unique statistics. More...
 
bool GetIsUnpickable ()
 
bool GetIsWriteable ()
 Checks the writeable flag in the item_stats and tell if this is the case. More...
 
csString GetItemCommand ()
 returns the special command assigned to this item More...
 
float GetItemDecayRate ()
 Get the item decay factor. More...
 
float GetItemQuality () const
 Gets the quality of the item. More...
 
float GetItemSize ()
 
float GetLatency ()
 
const csString & GetLiteratureText (void)
 return creative contents of books. More...
 
void GetLocationInWorld (InstanceID &instance, psSectorInfo **sectorinfo, float &loc_x, float &loc_y, float &loc_z, float &loc_yrot) const
 
INVENTORY_SLOT_NUMBER GetLocInParent (bool adjustSlot=false)
 Returns the location of this item in its parent item or in the player's equipment, bulk or bank as appropriate. More...
 
PSSKILL GetLockpickSkill ()
 
unsigned int GetLockStrength ()
 
int GetMaxCharges () const
 
float GetMaxItemQuality () const
 Gets the maximum possible quality of the item by reading the item_stat. More...
 
const char * GetMeshName ()
 Get the Mesh Name for the item. More...
 
psItemStatsGetModifier (int index)
 Returns the modifier at a specific index 0 through PSITEM_MAX_MODIFIERS-1. More...
 
const char * GetModifiersDescription ()
 If an overlay is set return it's script description, otherwise return the. More...
 
const csString & GetMusicalSheet (void)
 return creative contents of musical sheets. More...
 
const char * GetName () const
 
csString GetOpenableLockNames ()
 
psCharacterGetOwningCharacter ()
 Returns a pointer to the character who is holding this item directly or indirectly (including containers and bank slots) or NULL if none. More...
 
PID GetOwningCharacterID () const
 Get the ID of the owning character. More...
 
const char * GetPartMeshName ()
 Get the Part Mesh Name for the item. More...
 
const char * GetPartName ()
 Get the Part Name for the item. More...
 
float GetPenetration ()
 
psMoney GetPrice ()
 
double GetProperty (MathEnvironment *env, const char *ptr)
 This is used by the math scripting engine to get various values. More...
 
const char * GetQualityString ()
 Returns a description of the quality level of item. More...
 
csString GetQuantityName ()
 
float GetRange () const
 
float GetRarity ()
 return Rarity as 0-100% range More...
 
csString GetRarityName ()
 return Rarity description. example: "rare (0.7%)" More...
 
int GetRequiredRepairTool ()
 Returns item_stats id of repair tool required to fix this item, or 0. More...
 
bool GetRequiredRepairToolConsumed ()
 Returns the is_consumed flag of repair tool required to fix this item. More...
 
void GetRotationInWorld (float &loc_xrot, float &loc_yrot, float &loc_zrot)
 Get the x,y and z axis rotations for the item. More...
 
psScheduledItemGetScheduledItem ()
 
psSectorInfoGetSector () const
 
psMoney GetSellPrice ()
 Merchants want a percentage. More...
 
const csString & GetSketch (void)
 return creative contents of sketches. More...
 
csString GetSlotRemovedMesh (int slot, csString meshName="")
 Proxies the same function in psitemstats which gets the list of mesh to remove when this item is equipped in the specified slot. More...
 
const char * GetSound ()
 
unsigned short GetStackCount () const
 Returns the stack count. Be sure to call GetIsStackable() first! More...
 
const char * GetStandardDescription ()
 
const char * GetStandardName ()
 
float GetTargetedBlockValue ()
 
const char * GetTextureName ()
 Get the Texture Name for the item. More...
 
float GetTotalStackSize ()
 Gets the total size of the items in the stack. More...
 
psWorkGameEventGetTransformationEvent ()
 
uint32 GetUID ()
 Returns the UID of this item instance. More...
 
float GetUntargetedBlockValue ()
 
bool GetUsesAmmo ()
 
PSITEMSTATS_SLOTLIST GetValidSlots ()
 
float GetVisibleDistance ()
 
float GetWeaponAttributeBonus (PSITEMSTATS_STAT stat)
 
float GetWeaponAttributeBonusMax (int index)
 
PSITEMSTATS_STAT GetWeaponAttributeBonusType (int index)
 
PSSKILL GetWeaponSkill (PSITEMSTATS_WEAPONSKILL_INDEX index)
 
psWeaponTypeGetWeaponType ()
 
float GetWeight ()
 
void GetXZRotationInWorld (float &loc_xrot, float &loc_zrot)
 Get the x and z axis rotations for the item (y obtained in GetLocationInWorld) More...
 
bool HasCharges () const
 
bool HasModifier (psItemStats *modifier)
 Returns true if this item has this modifier in its modifier list. More...
 
bool IsActive () const
 
bool IsEquipped () const
 
bool IsInUse ()
 
bool IsRechargeable () const
 
bool IsThisTheCreator (PID pid)
 Checks if the creator of the book is the one passed as argument. More...
 
bool IsTransient ()
 
void MakeSkeleton (bool b)
 
void operator delete (void *)
 The delete operator is overriden to call PoolAllocator template functions. More...
 
void * operator new (size_t)
 The new operator is overriden to call PoolAllocator template functions. More...
 
PSITEM_FLAGS ParseItemFlags (csString flagstr)
 Parses an item flags list and returns the flags. More...
 
void PrepareCreativeItemInstance ()
 
 psItem ()
 Constructs a psItem. More...
 
void RecalcCurrentStats ()
 In some cases some modifiers or effects may be difficult to reverse (for example percent bonuses applied and removed in different orders). More...
 
void RemoveOpenableLock (uint32 v)
 
void ResetItemStackable ()
 
void RunEquipScript (gemActor *actor)
 
void Save (bool children)
 Queues this item to be saved to the database. More...
 
void ScheduleRemoval ()
 This function handles creating an event manager event at the right time to get transient objects removed from the world automatically. More...
 
void ScheduleRespawn ()
 
bool SendActionContents (Client *client, psActionLocation *action)
 
bool SendContainerContents (Client *client, int containerID=CONTAINER_INVENTORY_BULK)
 
bool SendItemDescription (Client *client)
 
void SetActive (bool state)
 
void SetBaseStats (psItemStats *statptr)
 Alters the base stats of this item instance. More...
 
bool SetBookText (const csString &newText)
 Sets the book text, should only be used if this is a book. More...
 
void SetCharges (int charges)
 
void SetContainerID (uint32 parentId)
 
void SetCrafterID (PID v)
 Sets the UID for the cracter of this item. Generally used immediately after completing the crafting work. More...
 
bool SetCreation (PSITEMSTATS_CREATIVETYPE, const csString &, csString)
 Write creative stuff such as lit text (eg book) or map data. More...
 
void SetCreator (PID, PSITEMSTATS_CREATORSTATUS)
 sets the creator (i.e. author, artist, etc) of creative things More...
 
void SetCurrentStats (psItemStats *statptr)
 Sets the current item stats. More...
 
void SetDecay (float v)
 Sets the decay value of the item. See the decay member for a description of what this is. More...
 
void SetDecayResistance (float v)
 Set the decay resistance percentage for the item. More...
 
void SetDescription (const char *newDescription)
 
void SetFlags (int f)
 
void SetGemObject (gemItem *object)
 
void SetGuardingCharacterID (PID guardian)
 
void SetGuildID (unsigned int v)
 Sets the UID for the guild certifying this item. More...
 
void SetInUse (bool flag)
 
void SetIsCD (bool v)
 
void SetIsCrafterIDValid (bool v)
 Set wether the crafter ID is valid. SetCrafterID() sets this to true for you. More...
 
void SetIsGuildIDValid (bool v)
 Set wether the guild ID is valid. SetGuildID() sets this to true for you. More...
 
void SetIsIdentifiable (bool v)
 Set the Identifiable flag of the item. More...
 
void SetIsItemStackable (bool v)
 
void SetIsKey (bool v)
 
void SetIsLockable (bool v)
 
void SetIsLocked (bool v)
 
void SetIsMasterKey (bool v)
 
void SetIsNpcOwned (bool v)
 
void SetIsPickupable (bool v)
 Sets the pickupable flag in order to not allow/allow the item to be picked up. More...
 
void SetIsPickupableWeak (bool v)
 Sets the weak pickupable flag in order to not allow/allow the item to be picked up. More...
 
void SetIsSecurityLocked (bool v)
 
void SetIsSettingItem (bool v)
 
void SetIsTransient (bool v)
 
void SetIsUnpickable (bool v)
 
void SetItemDecayRate (float v)
 Set the item decay factor. More...
 
void SetItemQuality (float v)
 Sets the quality of the item. More...
 
void SetLoaded ()
 Flags that this item has been fully loaded, and is allowed to be saved on changes. More...
 
void SetLocationInWorld (InstanceID instance, psSectorInfo *sectorinfo, float loc_x, float loc_y, float loc_z, float loc_yrot)
 
void SetLocInParent (INVENTORY_SLOT_NUMBER location)
 Please consider using UpdateInventoryStatus() instead. More...
 
void SetLockpickSkill (PSSKILL v)
 
void SetLockStrength (unsigned int v)
 
void SetMaxItemQuality (float v)
 Sets the maximum allowed quality of the item by changing the item_stat. More...
 
bool SetMusicalSheet (const csString &newMusicalSheet)
 Sets the musical sheet. More...
 
void SetName (const char *newName)
 
void SetRotationInWorld (float loc_xrot, float loc_yrot, float loc_zrot)
 Set the x, y and z axis rotations for the item. More...
 
void SetScheduledItem (psScheduledItem *item)
 
bool SetSketch (const csString &newSketchData)
 Sets sketch data. More...
 
void SetStackCount (unsigned short v)
 Sets the stack count. More...
 
void SetTransformationEvent (psWorkGameEvent *t)
 
void SetUID (uint32 v)
 Sets the Unique ID of this item. More...
 
void SetUniqueStats (psItemStats *statptr)
 Used to set the UNIQUE flag in addition to setting base stats pointer TODO: This is pretty much untested at this point. More...
 
void SetXZRotationInWorld (float loc_xrot, float loc_zrot)
 Set the x and z axis rotations for the item (y set in SetLocationInWorld) More...
 
psItemSplitStack (unsigned short newstackcount)
 Splits an item instance representing a stack into two smaller stacks. More...
 
const char * ToString ()
 
void UpdateInventoryStatus (psCharacter *owner, uint32 parent_id, INVENTORY_SLOT_NUMBER slot)
 
void UpdateModifiers ()
 Recalculates the modifications for this item. More...
 
void UpdateView (Client *fromClient, EID eid, bool clear)
 inform clients on view updates More...
 
bool UsesAmmoType (uint32_t id) const
 
void ViewItem (Client *client, int containerID, INVENTORY_SLOT_NUMBER slotID)
 Send an item to the client. More...
 
virtual ~psItem ()
 Destructs the psItem, and, if this is a container, all contained items. More...
 
- Public Member Functions inherited from iScriptableVar
virtual ~iScriptableVar ()
 
- Public Member Functions inherited from iDeleteObjectCallback
virtual ~iDeleteObjectCallback ()
 

Additional Inherited Members

- Static Public Member Functions inherited from psItem
static csString GetQuantityName (const char *namePtr, int stack_count, PSITEMSTATS_CREATIVETYPE creativeType, bool giveDetail=false)
 
- Protected Attributes inherited from psItem
PSITEM_FLAGS flags
 Flags for this item instance. More...
 
bool loaded
 

Detailed Description

Defines a glyph, one element to create a spell.

Loads definition from database, manages purify status.

Definition at line 50 of file psglyph.h.

Constructor & Destructor Documentation

psGlyph::psGlyph ( )
virtual psGlyph::~psGlyph ( )
inlinevirtual

Definition at line 54 of file psglyph.h.

Member Function Documentation

virtual psItem* psGlyph::Clone ( )
virtual
virtual void psGlyph::Copy ( psGlyph target)
virtual
virtual psItem* psGlyph::CreateNew ( )
virtual

Creates a new blank instance of it's class (i.e.

psItem or its subclass)

Reimplemented from psItem.

virtual const char* psGlyph::GetItemType ( )
inlinevirtual

Return a string identifying this object as a Glyph.

Reimplemented from psItem.

Definition at line 58 of file psglyph.h.

virtual int psGlyph::GetPurifyStatus ( ) const
virtual

Reimplemented from psItem.

csString psGlyph::GlyphToXML ( )
virtual bool psGlyph::Load ( iResultRow &  row)
virtual

Loads data from a database row into the current psItem.

This is used only by the character loader. On return parentid is set to the UID of the parent item. UID 0 is reserved for no parent.

Reimplemented from psItem.

void psGlyph::operator delete ( void *  )

The delete operator is overriden to call PoolAllocator template functions.

void* psGlyph::operator new ( size_t  )

The new operator is overriden to call PoolAllocator template functions.

bool psGlyph::Purified ( )
void psGlyph::PurifyingFinished ( )
void psGlyph::PurifyingStarted ( )
virtual void psGlyph::SetOwningCharacter ( psCharacter owner)
virtual

Alters the owning character of this item. Also see UpdateInventoryStatus.

Reimplemented from psItem.

void psGlyph::UnPurify ( )

The documentation for this class was generated from the following file: