20 #ifndef __PSITEMSTATS_H__ 21 #define __PSITEMSTATS_H__ 25 #include <csutil/parray.h> 26 #include <csutil/set.h> 134 #define PSITEMSTATS_SLOT_BULK 0x00000001 135 #define PSITEMSTATS_SLOT_RIGHTHAND 0x00000002 136 #define PSITEMSTATS_SLOT_LEFTHAND 0x00000004 137 #define PSITEMSTATS_SLOT_BOTHHANDS 0x00000008 138 #define PSITEMSTATS_SLOT_RIGHTFINGER 0x00000010 139 #define PSITEMSTATS_SLOT_LEFTFINGER 0x00000020 140 #define PSITEMSTATS_SLOT_HELM 0x00000040 141 #define PSITEMSTATS_SLOT_NECK 0x00000080 142 #define PSITEMSTATS_SLOT_BACK 0x00000100 143 #define PSITEMSTATS_SLOT_ARMS 0x00000200 144 #define PSITEMSTATS_SLOT_GLOVES 0x00000400 145 #define PSITEMSTATS_SLOT_BOOTS 0x00000800 146 #define PSITEMSTATS_SLOT_LEGS 0x00001000 147 #define PSITEMSTATS_SLOT_BELT 0x00002000 148 #define PSITEMSTATS_SLOT_BRACERS 0x00004000 149 #define PSITEMSTATS_SLOT_TORSO 0x00008000 150 #define PSITEMSTATS_SLOT_MIND 0x00010000 151 #define PSITEMSTATS_SLOT_BANK 0x00020000 152 #define PSITEMSTATS_SLOT_CRYSTAL 0x00040000 153 #define PSITEMSTATS_SLOT_AZURE 0x00080000 154 #define PSITEMSTATS_SLOT_RED 0x00100000 155 #define PSITEMSTATS_SLOT_DARK 0x00200000 156 #define PSITEMSTATS_SLOT_BROWN 0x00400000 157 #define PSITEMSTATS_SLOT_BLUE 0x00800000 161 #define PSITEMSTATS_FLAG_IS_A_MELEE_WEAPON 0x00000001 162 #define PSITEMSTATS_FLAG_IS_A_RANGED_WEAPON 0x00000002 163 #define PSITEMSTATS_FLAG_IS_A_SHIELD 0x00000004 164 #define PSITEMSTATS_FLAG_IS_AMMO 0x00000008 165 #define PSITEMSTATS_FLAG_IS_A_CONTAINER 0x00000010 166 #define PSITEMSTATS_FLAG_USES_AMMO 0x00000020 167 #define PSITEMSTATS_FLAG_IS_STACKABLE 0x00000040 168 #define PSITEMSTATS_FLAG_IS_GLYPH 0x00000080 169 #define PSITEMSTATS_FLAG_CAN_TRANSFORM 0x00000100 170 #define PSITEMSTATS_FLAG_TRIA 0x00000200 171 #define PSITEMSTATS_FLAG_HEXA 0x00000400 172 #define PSITEMSTATS_FLAG_OCTA 0x00000800 173 #define PSITEMSTATS_FLAG_CIRCLE 0x00001000 174 #define PSITEMSTATS_FLAG_CONSUMABLE 0x00002000 175 #define PSITEMSTATS_FLAG_IS_READABLE 0x00004000 176 #define PSITEMSTATS_FLAG_IS_ARMOR 0x00008000 177 #define PSITEMSTATS_FLAG_IS_EQUIP_STACKABLE 0x00010000 178 #define PSITEMSTATS_FLAG_IS_WRITEABLE 0x00020000 179 #define PSITEMSTATS_FLAG_NOPICKUP 0x00040000 180 #define PSITEMSTATS_FLAG_AVERAGEQUALITY 0x00080000 181 #define PSITEMSTATS_FLAG_CREATIVE 0x00100000 182 #define PSITEMSTATS_FLAG_BUY_PERSONALISE 0x00200000 183 #define PSITEMSTATS_FLAG_IS_RECHARGEABLE 0x00400000 184 #define PSITEMSTATS_FLAG_IS_A_TRAP 0x00800000 185 #define PSITEMSTATS_FLAG_IS_CONSTRUCTIBLE 0x01000000 186 #define PSITEMSTATS_FLAG_IS_RENAMEABLE 0x02000000 188 #define CREATIVEDEF_MAX 65535 // Max length for 'text' field in MySQL db. 198 #define PSITEMSTATS_STAT_BONUS_COUNT 3 244 void ReadStats(iResultRow &row);
281 void ReadStats(iResultRow &row);
300 return untargeted_block_value;
304 return targeted_block_value;
308 return counter_block_value;
312 float AttributeBonusMax(
int index);
321 float untargeted_block_value;
322 float targeted_block_value;
323 float counter_block_value;
338 void ReadStats(iResultRow &row);
342 return ammunition_type;
398 void ReadStats(iResultRow &row);
413 bool FormatCreativeContent(
void);
418 void SaveCreation(uint32);
433 void setInstanceBased(
bool value)
435 instanceBased = value;
442 csString backgroundImg;
473 csString description;
497 unsigned short container_max_size;
503 int container_max_slots;
510 csString consumeScriptName;
513 csArray<INVENTORY_SLOT_NUMBER> valid_slots_array;
528 float visible_distance;
530 csSet<unsigned int> ammo_types;
534 csArray<ItemRequirement> reqs;
536 float spell_on_hit_probability;
537 int spell_id_feature;
538 int spell_feature_charges;
539 int spell_feature_timing;
553 csPDelArray<psItemAnimation>* anim_list;
559 csString texture_name;
562 csString texturepart_name;
565 csString partmesh_name;
590 csString weapon_type;
592 csString itemCommand;
594 csHash<csHash<csString,int> > meshRemovalInfo;
601 void LoadMeshRemoval(iResultRow &row);
608 void LoadSlots(iResultRow &row);
615 void ParseFlags(iResultRow &row);
631 bool ReadItemStats(iResultRow &row);
637 bool GetIsMeleeWeapon();
638 bool GetIsBothHandsWeapon();
640 bool GetIsRangeWeapon();
643 bool GetIsContainer();
645 bool GetIsConstructible();
646 bool GetCanTransform();
649 bool GetIsStackable();
650 bool GetIsEquipStackable();
652 bool GetIsRenameable();
653 bool GetIsConsumable();
654 bool GetIsReadable();
655 bool GetIsWriteable();
664 bool GetBuyPersonalise();
665 float GetRange()
const;
669 return ammo_types.In(
id);
680 const char* GetUIDStr();
681 const char* GetDescription()
const;
682 void SetDescription(
const char* v);
683 void SaveDescription(
void);
694 void GetArmorVsWeaponType(csString &buff);
695 void SetArmorVsWeaponType(
const char* v);
699 unsigned short GetContainerMaxSize();
707 int GetContainerMaxSlots();
708 float GetVisibleDistance();
720 csString GetSlotRemovedMesh(
int slot, csString meshName =
"");
721 float GetDecayRate();
723 int GetAttackAnimID(
unsigned int skill_level);
725 csString FlagsToText();
729 const csString GetDownCaseName();
742 return creativeStats.creativeDefinitionXML;
744 void SetName(
const char* v);
752 const char* GetMeshName();
754 void SetMeshName(
const char* v);
761 const char* GetTextureName();
763 void SetTextureName(
const char* v);
771 const char* GetPartName();
773 void SetPartName(
const char* v);
781 const char* GetPartMeshName();
783 void SetPartMeshName(
const char* v);
791 const char* GetImageName();
793 void SetImageName(
const char* v);
807 void SetPrice(
int trias);
811 const csArray<INVENTORY_SLOT_NUMBER>&
GetSlots()
const 813 return valid_slots_array;
817 const char* GetSound();
818 void SetSound(
const char* v);
826 return consumeScriptName;
832 bool SetEquipScript(
const csString &script);
839 csArray<ItemRequirement> &GetRequirements();
840 bool SetRequirement(
const csString &statName,
float statValue);
848 psItem* InstantiateBasicItem(
bool transient=
false);
851 bool SetAttribute(
const csString &op,
const csString &attrName,
float modifier);
856 return creativeStats.content;
860 return creativeStats.content;
864 return creativeStats.content;
876 bool IsThisTheCreator(PID);
883 const csString &GetCreativeBackgroundImg();
886 bool HasCharges()
const;
887 bool IsRechargeable()
const;
888 void SetMaxCharges(
int charges);
889 int GetMaxCharges()
const;
905 return name.GetDataSafe();
913 double CalcFunction(
MathEnvironment* env,
const char* functionName,
const double* params);
930 void*
operator new(size_t);
932 void operator delete(
void*);
PSITEMSTATS_WEAPONSKILL_INDEX
bool UsesAmmoType(uint32_t id) const
ApplicativeScript * GetEquipScript()
unsigned int PSITEMSTATS_SLOTLIST
This is a struct used by item stats to say that a person must have a certain level at a certain skill...
PSITEMSTATS_AMMOTYPE AmmoType()
psItemAmmoStats & Ammunition()
This class stores an items various armour related information.
const csString & GetLiteratureText(void)
A specific MathEnvironment to be used in a MathScript.
csString GetItemCommand()
returns the special command assigned to this item
float CounterBlockValue()
This little class holds info about Ammunition for Ranged Weapons.
const char * GetName(int id)
float UntargetedBlockValue()
Each weapon specifies what anims can be used with it.
PSITEMSTATS_ARMORTYPE Type()
void SetCreator(PID, PSITEMSTATS_CREATORSTATUS)
sets the creator (i.e. author, artist, etc) of creative things
PSITEMSTATS_FLAGS GetFlags()
const csString & GetConsumeScriptName()
unsigned int PSITEMSTATS_FLAGS
A structure that holds the knowledge/practice/rank of each player skill.
PID GetCreator(PSITEMSTATS_CREATORSTATUS &creatorStatus)
Gets the creator of this creative and the creator setting status.
PSITEMSTATS_STAT attribute_id
const csString & GetMusicalSheet(void)
return creative contents
psItemWeaponStats & Weapon()
#define PSITEMSTATS_STAT_BONUS_COUNT
float TargetedBlockValue()
ApplicativeScript is the applied script container.
bool IsThisTheCreator(PID pid)
Checks if the creator of the book is the one passed as argument.
This class holds info about Creative items such as books, etc.
This huge class stores all the properties of any object a player can have in the game.
PSITEMSTATS_CREATORSTATUS
psXMLString getCreativeXML()
Used to get the creative definition so psitem can make it's own copy of it.
This class manages the caching of data that is unchanging during server operation.
const char * ToString()
Returns the name of the item.
const csString & GetSketch(void)
const csArray< INVENTORY_SLOT_NUMBER > & GetSlots() const
psItemArmorStats & Armor()
PSSKILL statToSkill(PSITEMSTATS_STAT stat)
Convenience function to convert between STAT and SKILL.
This class holds the various cached database information relating to the weapon skills of a an item_s...
This class embodies item instances in the game.