20 #ifndef __CACHEMANAGER_H__ 21 #define __CACHEMANAGER_H__ 26 #include <csutil/stringarray.h> 27 #include <csutil/hash.h> 28 #include <csgeom/vector3.h> 53 class psAttackDefault;
58 class psTradeAutoContainers;
68 struct CombinationSet;
93 void Set(
const char* s,
int f)
101 #ifndef __PSMOVEMENT_H__ 151 csHash<optionEntry,csString> subOptions;
187 csVector3 getValueAsVector();
194 bool getValueAsVector(csVector3 &vector);
203 bool setOption(
const csString path,
const csString value);
221 optionEntry* getOptionSafe(
const csString path,
const csString fallback);
245 csHash<psSectorInfo*>::GlobalIterator GetSectorIterator();
250 return commandManager;
257 psTrait* GetTraitByID(
unsigned int id);
258 psTrait* GetTraitByName(
const char* name);
259 TraitIterator GetTraitIterator();
265 size_t GetRaceInfoCount();
270 psRaceInfo* GetRaceInfoByMeshName(
const csString &meshname);
277 size_t GetSkillAmount();
281 void GetSkillsListbyCategory(csArray <psSkillInfo*> &listskill,
int category);
287 const char* FindCommonString(
unsigned int id);
288 unsigned int FindCommonStringID(
const char* name);
291 FindCommonStringID(name);
311 void GetCompressedMessageStrings(
char* &data,
unsigned long &size,
312 uint32_t &num_strings, csMD5::Digest &digest);
320 bool CreateGuild(
const char* guildname,
Client* client);
335 psQuest* GetQuestByID(
unsigned int id);
336 psQuest* GetQuestByName(
const char* name);
337 psQuest* AddDynamicQuest(
const char* name,
psQuest* parentQuest,
int step);
341 bool UnloadQuest(
int id);
344 bool LoadQuest(
int id);
345 csHash<psQuest*>::GlobalIterator GetQuestIterator();
352 psAttack *GetAttackByID(
unsigned int id);
353 psAttack *GetAttackByName(
const char *name);
354 csArray<psAttack*>GetAllAttacks();
356 bool UnloadAttack(
int id);
359 bool LoadAttack(
int id);
360 csHash<psAttack *>::GlobalIterator GetAttackIterator();
389 psAccountInfo* GetAccountInfoByUsername(
const char* username);
420 return itemCategoryList.Get(pos);
427 return itemCategoryList.GetSize();
431 csPDelArray<psItemAnimation>* FindAnimationList(
int id);
434 psWay* GetWayByID(
unsigned int id);
435 psWay* GetWayByName(
const csString &name);
446 Faction* GetFaction(
const char* name);
448 Faction* GetFactionByName(
const char* name);
451 return factions_by_id;
491 psSpell* GetSpellByID(
unsigned int id);
492 psSpell* GetSpellByName(
const csString &name);
493 SpellIterator GetSpellIterator();
498 csPDelArray<CombinationConstruction>* FindCombinationsList(uint32 patternid);
502 csPDelArray<psTradeTransformations>* FindTransformationsList(uint32 patternid, uint32 targetid);
503 bool PreloadUniqueTradeTransformations();
504 csArray<uint32>* GetTradeTransUniqueByID(uint32
id);
505 bool PreloadTradeProcesses();
506 csArray<psTradeProcesses*>* GetTradeProcessesByID(uint32
id);
507 bool PreloadTradePatterns();
508 csArray<psTradePatterns*> GetTradePatternByItemID(uint32
id);
512 csString CreateComboCraftDescription(
Result* combArray);
513 csArray<CraftTransInfo*>* GetTradeTransInfoByItemID(uint32
id);
514 csArray<CraftComboInfo*>* GetTradeComboInfoByItemID(uint32
id);
520 psItemStats* GetBasicItemStatsByName(csString name);
525 psItemStats* CopyItemStats(uint32
id, csString newName);
528 uint32 BasicItemStatsByNameExist(csString name);
531 return itemStats_IDHash.GetSize();
535 void CacheNameChange(csString oldName, csString newName);
537 bool LoadWorldItems(
psSectorInfo* sector, csArray<psItem*> &items);
539 float GetArmorVSWeaponResistance(
const char* armor_type,
const char* weapon_type);
542 void RemoveInstance(
psItem* &item);
551 PSSKILL ConvertSkillString(
const char* skillstring);
552 PSSKILL ConvertSkill(
int skill_id);
557 void GetTipByID(
int id, csString &tip);
558 unsigned int GetTipLength();
563 size_t GetBadNamesCount();
564 const char* GetBadName(
int pos);
565 void AddBadName(
const char*);
566 void DelBadName(
const char*);
571 const char* MakeCacheName(
const char* prefix, uint32
id);
572 void AddToCache(
iCachedObject* obj,
const char* name,
int max_cache_time_seconds);
585 return char_modes[
id];
589 return movements[
id];
591 uint8_t GetCharModeID(
const char* name);
592 uint8_t GetMovementID(
const char* name);
609 void AddItemStatsToHashTable(
psItemStats* newitem);
643 return lootRandomizer;
654 lootRandomizer->ApplyModifier(baseItem, overlay, modifierIds);
664 lootRandomizer->RandomizeItem(item, maxCost,
false, numModifiers);
672 return PreloadOptions();
677 char CacheNameBuffer[15];
679 bool PreloadSectors();
680 bool PreloadRaceInfo();
681 bool PreloadSkills();
682 bool PreloadAttacks();
686 bool PreloadOptions();
687 bool PreloadLimitations();
688 bool PreloadTraits();
689 bool PreloadItemCategories();
691 bool PreloadAttackTypes();
692 bool PreloadWeaponTypes();
694 void PreloadFactionCharacterEvents(
const char* script,
Faction* faction);
695 bool PreloadFactions();
697 bool PreloadMathScripts();
698 bool PreloadSpells();
699 bool PreloadItemStatsDatabase();
700 bool PreloadItemAnimList();
701 bool PreloadQuests();
702 bool PreloadTradeCombinations();
703 bool PreloadTradeTransformations();
705 bool PreloadBadNames();
706 bool PreloadArmorVsWeapon();
707 bool PreloadMovement();
708 bool PreloadStances();
709 void PreloadCommandGroups();
717 bool PreloadLootModifiers();
720 bool PreloadCraftMessages();
728 bool UniqueInsertIntoItemArray(csArray<uint32>* finalItems, uint32 itemID);
740 int Contains(csArray<uint32>* list, uint32
id);
755 bool FindFinalItem(csHash<csHash<csPDelArray<psTradeTransformations>*, uint32> *,uint32>* txItemHash, csHash<csHash<csPDelArray<psTradeTransformations>*, uint32> *,uint32>* rxItemHash, csArray<uint32>* finalItems, uint32 itemID, csArray<uint32>* itemStack);
770 bool ReconcileFinalItems(csHash<csHash<csPDelArray<psTradeTransformations>*, uint32> *,uint32>* txItemHash, csHash<csHash<csPDelArray<psTradeTransformations>*, uint32> *,uint32>* rxItemHash, csArray<uint32>* finalItems, csArray<uint32>* craftBookItems, uint32 resultID, uint32 patternID, csArray<uint32>* itemStack);
781 bool loadTradeTransformationsByPatternAndGroup(
Result* result, csHash<csHash<csPDelArray<psTradeTransformations> *,uint32> *,uint32>* txResultHash, csHash<csHash<csPDelArray<psTradeTransformations> *,uint32> *,uint32>* txItemHash);
791 bool freeTradeTransformationsByPatternAndGroup(csHash<csHash<csPDelArray<psTradeTransformations> *,uint32> *,uint32>* txItemHash, csHash<csHash<csPDelArray<psTradeTransformations> *,uint32> *,uint32>* txResultHash);
811 bool DescribeMultiTransformation(csPDelArray<psTradeTransformations>* rArray, csArray<CraftTransInfo*>* newArray);
821 bool DescribeCombination(
Result* combinations, csArray<CraftTransInfo*>* newArray);
835 bool ListProductionSteps(csArray<CraftTransInfo*>* newArray, csHash<csHash<csPDelArray<psTradeTransformations>*, uint32> *,uint32>* txResultHash, csArray<uint32>* finalItems, uint32 itemID, uint32 patternID, uint32 groupID, csArray<uint32>* itemStack);
844 void CacheCraftTransforms(
psMsgCraftingInfo* tradePattern,
int patternID,
int group);
853 void CacheCraftCombos(
psMsgCraftingInfo* tradePattern,
int patternID,
int group);
883 virtual void Trigger();
937 csPDelArray<psCharacterLimitation>
limits;
MathScript * GetDodgeValueCalc()
This class stores an array of LootModifiers and randomizes loot stats.
csHash< Faction *, int > factions_by_id
optionEntry * getOptionSafe(const csString path, const csString fallback)
Does the same of getOption, but, in case the entry is missing, an empty option will be added to the t...
MathScript * GetCastSuccess()
The generic cache sets timers for each object added to the cache, then if the object is not removed b...
Defines all the info about crafting for an item.
Manages CEL entities on the server.
csHash< csArray< CraftTransInfo * > *, uint32 > tradeCraftTransInfo_IDHash
csArray< csString > stanceID
Map of locations.
size_t ItemStatsSize(void)
csPDelArray< psAttackType > attackTypeList
void setValue(const csString newValue)
Sets the value of this specific option to a newvalue.
MathScript * GetMaxRealmScript()
csHash< CachedObject *, csString > generic_object_cache
This cache is intended to keep database-loaded objects in memory for a time after we are done with th...
csHash< Faction *, int > & GetFactionHash()
MathScript * GetFamiliarAffinity()
ProgressionScript is the imperative script container.
SlotNameHash slotNameHash
unsigned int PSITEMSTATS_SLOTLIST
Represents a skill an NPC, player or pet can learn.
csHash< psTradePatterns *, csString > tradePatterns_NameHash
uint32_t num_compressed_strings
psCommandManager * commandManager
MathScript * calcItemSellPrice
optionEntry rootOptionEntry
MathScript * GetDoDamage()
LootRandomizer * lootRandomizer
A pointer to the lootrandomizer mantained by the cachemanager.
This struct holds data for generic attack types This could be for example an assassin attack which wo...
psCommandManager * GetCommandManager()
MathScript * GetResearchSuccess()
MathScript * GetExpSkillCalc()
csPDelArray< csPDelArray< psItemAnimation > > item_anim_list
A MathScript is a mini-program to run.
MathScript * maxRealmScript
csVector3 base_rotate
rotation for this
bool ReloadOptions()
Reloads the server_options.
void ApplyItemModifiers(psItemStats *baseItem, RandomizedOverlay *overlay, csArray< uint32_t > &modifierIds)
Applies on a randomized overlay structure, starting with the base item stats passed, the modifier ids passed.
csHash< csArray< CraftComboInfo * > *, uint32 > tradeCraftComboInfo_IDHash
csVector3 rotate_mod
rotation multiplier
csHash< Faction *, csString > factions
csHash< psItemStats *, uint32 > itemStats_IDHash
MathScript * spellPractice
This class rappresents an option tree which comes from the server_options table.
MathScript * maxManaScript
MathScript * GetBaseSkillValuesGet()
A data storage class to contain all information associated with an account.
This class holds all information for one quest with its reference to parent quest, list of steps, lockoutime, sub quests, ...
MathScript * GetStaminaRatioStill()
MathScript * GetStaminaRatioSit()
A character movement and its properties.
LootRandomizer * getLootRandomizer()
Returns a pointer to the loot randomizer which is hosted within the cache manager.
csVector3 move_mod
motion multiplier
MathScript * GetMaxHPScript()
MathScript * spellPowerLevel
csArray< psItemStatFlags > ItemStatFlagArray
Translation table for Flag strings (from db) into bit codes.
csHash< psGuildInfo * > guildinfo_by_id
Each item contains craft information about a craft combination.
csPDelArray< psTrait >::Iterator TraitIterator
unsigned long compressed_msg_strings_size
csString getValue()
Get the value of this specific option.
csHash< csHash< csPDelArray< psTradeTransformations > *, uint32 > *, uint32 > tradeTransformations_IDHash
Each weapon specifies what anims can be used with it.
MathScript * maxCarryWeight
A pointer maintained by MathScriptEngine.
csPDelArray< psCharacterLimitation > limits
All the limitations based on scores for characters.
optionEntry * getOption(const csString path)
Wrapper for the getOption method of the root optionEntry stored in cachemanager.
MathScript * setBaseSkillsScript
This class allows CacheManager to yield a list of qualifying values given a player's score at somethi...
A guild alliance between 2+ guilds.
csPDelArray< psItemCategory > itemCategoryList
MathScript * staminaRatioWalk
The stamina regen ration while walking script.
void Set(const char *s, int f)
PSTRAIT_LOCATION
Define the player controled base customization that their model can have.
Defines characteristics of a race associated to an NPC, player or pet.
Represent a visual feature of character customization like hair style, color of eyes, skin color, ...
MathScript * staminaRatioWork
The stamina regen ration while working script.
csPDelArray< psRaceInfo > raceinfolist
csHash< psSkillInfo *, int > skillinfo_CategoryHash
MathScript * GetMaxCarryWeight()
csHash< psSectorInfo * > sectorinfo_by_id
Sector info list hashed by sector id.
psItemCategory * GetItemCategoryByPos(size_t pos)
Gets an item category by its position in the array.
MathScript * GetStaminaCombat()
void AddCommonStringID(const char *name)
MathScript * staminaCombat
csHash< psSkillInfo *, csString > skillinfo_NameHash
MathScript * GetPlayerSketchLimits()
int min_score
What must a player score to earn this ability.
csMD5::Digest compressed_msg_strings_digest
MathScript * GetCalcDecay()
csStringSet * GetMsgStrings()
Returns the message strings hash table.
MathScript * staminaCalc
The stamina calc script.
const psMovement * GetMovement(size_t id) const
MathScript * armorSkillsPractice
Script to set the practice points for armor skills.
MathScript * researchSuccess
csArray< Stance > stances
List of stances.
MathScript * GetStaminaRatioWalk()
int getValueAsInt()
Get the value of this specific option in int format.
csHash< psSkillInfo *, int > skillinfo_IDHash
This class holds the master list of all trade patterns possible in the game.
optionEntry * getOptionSafe(const csString path, const csString value)
Wrapper for the getOptionSafe method of the root optionEntry stored in cachemanager.
csPDelArray< psWeaponType > weaponTypeList
A list of the flags mapped to their IDs.
Each item has a list of items required for its construction.
char * compressed_msg_strings
optionEntry * getOption(const csString path)
Gets an option entry in the tree.
csString idle_animation
animation when not moving
csPDelArray< psWay > wayList
This is a wrapper class for result sets which makes syntax for getting at the data easier and also us...
MathScript * GetMaxCarryAmount()
const csPDelArray< psCharMode > & GetCharModes() const
csString value
What is the name of the ability they earn.
This class collects data of a netclient.
csHash< psQuest * > quests_by_id
A hash map class that stores a name->ID of sockets.
csHash< csArray< uint32 > *, uint32 > tradeTransUnique_IDHash
csHash< csPDelArray< CombinationConstruction > *, uint32 > tradeCombinations_IDHash
uint32_t NextEffectUID()
Used to track effect IDs.
csVector3 base_move
motion for this
A character mode and its properties.
const psCharMode * GetCharMode(size_t id) const
csPDelArray< psCharMode > char_modes
MathScript * GetManaCost()
MathScript * GetStaminaCalc()
This class holds the master list of all trade combinations possible in the game.
MathScript * baseSkillValuesGet
Script to get the base skill values.
size_t GetItemCategoryAmount()
Gets the size of the item category array.
This class handles the permission system such as Game Masters and Role play masters.
MathScript * GetStaminaMove()
csHash< psSectorInfo * > sectorinfo_by_name
Sector info list hashed by sector name.
void RandomizeItem(psItem *item, float maxCost, size_t numModifiers)
Randomizes the passed item.
MathScript * GetStaminaRatioWork()
This huge class stores all the properties of any object a player can have in the game.
MathScript * playerSketchLimits
csPDelArray< psSpell > spellList
MathScript * staminaRatioStill
The stamina regen ration while standing script.
csHash< psAttack * > attacks_by_id
csHash< psGuildAlliance * > alliance_by_id
This class manages the caching of data that is unchanging during server operation.
This class holds the master list of all trade processes possible in the game.
csArray< csString > tips_list
List for the tips.
MathScript * GetCalcItemPrice()
MathScript * GetSkillValuesGet()
csPDelArray< psMovement > movements
csHash< psTradePatterns *, uint32 > tradePatterns_IDHash
double getValueAsDouble()
Get the value of this specific option in double format.
Stores the randomized stats from the loot randomizer, it could be used to apply any global special ef...
Contains information about sectors from the server perspective.
csHash< psItemStats *, csString > itemStats_NameHash
csPDelArray< psSpell >::Iterator SpellIterator
csHash< ProgressionScript *, csString > scripts
MathScript * GetSpellPowerLevel()
MathScript * dodgeValueCalc
Script for calculating dodge value.
psCacheExpireEvent * event
MathScript * GetSetBaseSkillsScript()
MathScript * GetCharLevelGet()
csPDelArray< ArmorVsWeapon > armor_vs_weapon
MathScript * charLevelGet
Script to get the current char level.
All scheduled events must inherit from this class.
MathScript * GetArmorSkillsPractice()
const csPDelArray< psMovement > & GetMovements() const
MathScript * calcItemPrice
MathScript * expSkillCalc
The exp calc script to assign experience on skill ranking.
MathScript * staminaRatioSit
The stamina regen ration while sitting script.
psItemStatFlags(const char *s, int f)
csPDelArray< psTrait > traitlist
csString limit_type
'SKETCH' limitations all have this word here
MathScript * GetCalcItemSellPrice()
MathScript * GetSpellPractice()
Each item contains craft information about a craft transformation step.
MathScript * skillValuesGet
Script to get the current skill values.
csHash< csArray< psTradeProcesses * > *, uint32 > tradeProcesses_IDHash
MathScript * maxCarryAmount
A pointer maintained by MathScriptEngine.
MathScript * calc_decay
This is the particular calculation for decay.
MathScript * GetMaxManaScript()
This class embodies item instances in the game.