Resolve "Toggle Free Look with Hotkey"
[ryzomcore.git] / ryzom / server / src / ai_service / ais_user_models.h
blob8fbecfcf7b4db9a63bb0d2ca007d322bd9a1067e
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef AIS_USER_MODELS
18 #define AIS_USER_MODELS
21 #include "server_share/npc_description_messages.h"
23 class CAIUserModelManager
25 public:
26 static CAIUserModelManager *getInstance();
27 static void destroyInstance();
29 void init();
31 CAIUserModelManager();
32 ~CAIUserModelManager();
34 /** Add a user model in the map that will be sent to EGS
35 * @param primAlias the primitive alias
36 * @param userModelId the id of the added user model, defined in the worldEdit user_model node
37 * @param userModel the script data of the user model, stored as a string vector containing all script lines
39 void addToUserModels(uint32 primAlias, const std::string &userModelId, const TScriptContent &userModel);
41 /** send user models to EGS for script parsing and modified CStaticCreatures instanciation
43 void sendUserModels();
44 void sendUserModel(uint32 primAlias, const std::string &userModelId);
46 /** send custom loot table script and info to EGS for script parsing and custom CStaticLootTable instanciation
48 void sendCustomLootTables();
50 const CScriptData &getUserModels() { return _UserModels;}
52 const CCustomLootTableManager &getCustomLootTables() { return _CustomLootTables;}
54 bool isUserModel(uint32 primAlias, const std::string &id) const;
56 bool isCustomLootTable(uint32 primAlias, const std::string &id) const;
58 /** Add a custom loot table in the struct that will be sent to EGS
59 * @param tableId the id of the added table, defined in the worldEdit custom_loot_table node.
60 * @param lootSets map of vector, containing all lootSets lines (key: lootSet id)
61 * @param moneyProba the probability for the added custom loot table to contain money, defined in the worldEdit custom_loot_table node.
62 * @param moneyFactor value used in the computation of the amount of money dropped, defined in the worldEdit custom_loot_table node.
63 * @param moneyBase value representing the money base present in the table, defined in the worldEdit custom_loot_table node.
65 void addCustomLootTable(uint32 primAlias,
66 const std::string &tableId,
67 TScripts lootSets,
68 float moneyProba,
69 float moneyFactor,
70 uint32 moneyBase);
72 /** Delete all datas that were loaded from a given primitive (allow to dynamically load/reload custom datas)
73 * The alias is the static part of the primitive alias basis. This alias is used as part of the identifier
74 * for all custom model and custom loot tables.
76 void deleteCustomDataByPrimAlias(uint32 primAlias);
78 private:
79 static CAIUserModelManager *_instance;
80 /** Stores all parsed user models before sending them to EGS.
81 * see @class CScriptData
83 CScriptData _UserModels;
85 /** Stores all parsed Custom Loot Tables before sending them to EGS
86 * see @class CCustomLootTableManager
88 CCustomLootTableManager _CustomLootTables;
92 #endif