Add infos into target window
[ryzomcore.git] / ryzom / server / src / general_utilities_service / stat_character.cpp
blob72ab37987b80b152672f1d7d284fbb7a03e695fe
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/>.
18 //-----------------------------------------------------------------------------
19 // includes
20 //-----------------------------------------------------------------------------
22 #include "stat_character.h"
25 //-----------------------------------------------------------------------------
26 // namespaces
27 //-----------------------------------------------------------------------------
29 using namespace std;
30 using namespace NLMISC;
33 #define PERSISTENT_TOKEN_FAMILY RyzomTokenFamily
36 //-----------------------------------------------------------------------------
37 // Globals
38 //-----------------------------------------------------------------------------
40 // If the following macro is defined then the macros such as PERSISTENT_CLASS, PERSISTENT_DATA, PERSISTENT_PRE_STORE, etc
41 // are undefined after inclusion of perstent_data_template.h
42 #define PERSISTENT_MACROS_AUTO_UNDEF
45 //-----------------------------------------------------------------------------
46 // Persistent data for CStatsScanMissionHistory
47 //-----------------------------------------------------------------------------
49 #define PERSISTENT_CLASS CStatsScanMissionHistory
51 #define PERSISTENT_DATA\
52 PROP(bool, Successfull)\
53 PROP(TGameCycle, LastSuccessDate)\
55 #include "game_share/persistent_data_template.h"
58 //-----------------------------------------------------------------------------
59 // Persistent data for CStatsScanDeathPenalties
60 //-----------------------------------------------------------------------------
62 #define PERSISTENT_CLASS CStatsScanDeathPenalties
64 #define PERSISTENT_DATA\
65 PROP(uint8,_NbDeath)\
66 PROP(double,_CurrentDeathXP)\
67 PROP(double,_DeathXPToGain)\
68 PROP(uint32,_BonusUpdateTime)\
70 #include "game_share/persistent_data_template.h"
73 //-----------------------------------------------------------------------------
74 // Persistent data for CStatsScanRespawnPoints
75 //-----------------------------------------------------------------------------
77 #define PERSISTENT_CLASS CStatsScanRespawnPoints
79 #define PERSISTENT_DATA\
80 PROP_VECT(CSString,RespawnPoints)\
83 #include "game_share/persistent_data_template.h"
86 //-----------------------------------------------------------------------------
87 // Persistent data for CStatsScanFameContainerEntry
88 //-----------------------------------------------------------------------------
90 #define PERSISTENT_CLASS CStatsScanFameContainerEntry
92 #define PERSISTENT_DATA\
93 PROP(sint32,Fame)\
94 PROP(sint32,FameMemory)\
95 PROP(CSString,LastFameChangeTrend)\
97 #include "game_share/persistent_data_template.h"
100 //-----------------------------------------------------------------------------
101 // Persistent data for CStatsScanFameContainer
102 //-----------------------------------------------------------------------------
104 #define PERSISTENT_CLASS CStatsScanFameContainer
106 #define PERSISTENT_DATA\
107 STRUCT_MAP(CSheetId,CStatsScanFameContainerEntry,_Fame)\
109 #include "game_share/persistent_data_template.h"
112 //-----------------------------------------------------------------------------
113 // Persistent data for CStatsScanEncyCharThema
114 //-----------------------------------------------------------------------------
116 #define PERSISTENT_CLASS CStatsScanEncyCharThema
118 #define PERSISTENT_DATA\
119 PROP(uint8,ThemaState)\
120 PROP(uint16,RiteTaskStatePacked)\
122 #include "game_share/persistent_data_template.h"
125 //-----------------------------------------------------------------------------
126 // Persistent data for CStatsScanEncyCharAlbum
127 //-----------------------------------------------------------------------------
129 #define PERSISTENT_CLASS CStatsScanEncyCharAlbum
131 #define PERSISTENT_DATA\
132 PROP(uint8,AlbumState)\
133 STRUCT_VECT(Themas)\
135 #include "game_share/persistent_data_template.h"
138 //-----------------------------------------------------------------------------
139 // Persistent data for CStatsScanCharaterEncyclopedia
140 //-----------------------------------------------------------------------------
142 #define PERSISTENT_CLASS CStatsScanCharaterEncyclopedia
144 #define PERSISTENT_DATA\
145 STRUCT_VECT(_EncyCharAlbums)\
147 #include "game_share/persistent_data_template.h"
150 //-----------------------------------------------------------------------------
151 // Persistent data for CStatsScanCharacterLogTime
152 //-----------------------------------------------------------------------------
154 #define PERSISTENT_CLASS CStatsScanCharacterLogTime
156 #define PERSISTENT_DATA\
157 PROP(uint32,LoginTime)\
158 PROP(uint32,LogoffTime)\
160 #include "game_share/persistent_data_template.h"
163 //-----------------------------------------------------------------------------
164 // Persistent data for CStatsScanGameEvent
165 //-----------------------------------------------------------------------------
167 #define PERSISTENT_CLASS CStatsScanGameEvent
169 #define PERSISTENT_DATA\
170 PROP(uint32,_Date)\
171 PROP(CSString,_EventFaction)\
173 #include "game_share/persistent_data_template.h"
176 //-----------------------------------------------------------------------------
177 // Persistent data for CStatsScanPosition
178 //-----------------------------------------------------------------------------
180 #define PERSISTENT_CLASS CStatsScanPosition
182 #define PERSISTENT_DATA\
183 PROP(sint32,X)\
184 PROP(sint32,Y)\
185 PROP(sint32,Z)\
186 PROP(float,Heading)\
188 #include "game_share/persistent_data_template.h"
191 //-----------------------------------------------------------------------------
192 // Persistent data for CStatsScanPositionStackEntry
193 //-----------------------------------------------------------------------------
195 #define PERSISTENT_CLASS CStatsScanPositionStackEntry
197 #define PERSISTENT_DATA\
198 PROP(uint32,SessionId)\
199 STRUCT(PosState)\
201 #include "game_share/persistent_data_template.h"
204 //-----------------------------------------------------------------------------
205 // Persistent data for CStatsScanPositionStack
206 //-----------------------------------------------------------------------------
208 #define PERSISTENT_CLASS CStatsScanPositionStack
210 #define PERSISTENT_DATA\
211 STRUCT_VECT(_Vec)\
213 #include "game_share/persistent_data_template.h"
216 //-----------------------------------------------------------------------------
217 // Persistent data for CStatsScanPact
218 //-----------------------------------------------------------------------------
220 #define PERSISTENT_CLASS CStatsScanPact
222 #define PERSISTENT_DATA\
223 PROP(uint8,PactNature)\
224 PROP(uint8,PactType)\
226 #include "game_share/persistent_data_template.h"
229 //-----------------------------------------------------------------------------
230 // Persistent data for CStatsScanPetAnimal
231 //-----------------------------------------------------------------------------
233 #define PERSISTENT_CLASS CStatsScanPetAnimal
235 #define PERSISTENT_DATA\
236 PROP(CSheetId,TicketPetSheetId)\
237 PROP(CSheetId,PetSheetId)\
238 PROP(uint32,Price)\
239 PROP(CEntityId,OwnerId)\
240 PROP(TAIAlias,StableAlias)\
241 PROP(sint32,Landscape_X)\
242 PROP(sint32,Landscape_Y)\
243 PROP(sint32,Landscape_Z)\
244 PROP(uint32,DeathTick)\
245 PROP(uint16,PetStatus)\
246 PROP(sint16,Slot)\
247 PROP(bool,IsFollowing)\
248 PROP(bool,IsMounted)\
249 PROP(bool,IsTpAllowed)\
251 #include "game_share/persistent_data_template.h"
254 //-----------------------------------------------------------------------------
255 // Persistent data for CStatsScanPhysCharacs
256 //-----------------------------------------------------------------------------
258 #define PERSISTENT_CLASS CStatsScanPhysCharacs
260 #define PERSISTENT_DATA\
261 PROP_MAP(CSString,sint32,_PhysicalCharacteristics)\
263 #include "game_share/persistent_data_template.h"
266 //-----------------------------------------------------------------------------
267 // Persistent data for CStatsScanPhysScoresEntry
268 //-----------------------------------------------------------------------------
270 #define PERSISTENT_CLASS CStatsScanPhysScoresEntry
272 #define PERSISTENT_DATA\
273 PROP(sint32,Current)\
274 PROP(sint32,Base)\
275 PROP(sint32,Max)\
276 PROP(float,BaseRegenerateRepos)\
277 PROP(float,BaseRegenerateAction)\
278 PROP(float,CurrentRegenerate)\
280 #include "game_share/persistent_data_template.h"
283 //-----------------------------------------------------------------------------
284 // Persistent data for CStatsScanPhysScores
285 //-----------------------------------------------------------------------------
287 #define PERSISTENT_CLASS CStatsScanPhysScores
289 #define PERSISTENT_DATA\
290 PROP(float,BaseWalkSpeed)\
291 PROP(float,BaseRunSpeed)\
292 PROP(float,CurrentWalkSpeed)\
293 PROP(float,CurrentRunSpeed)\
294 STRUCT_MAP(CSString,CStatsScanPhysScoresEntry,PhysicalScores)\
296 #include "game_share/persistent_data_template.h"
299 //-----------------------------------------------------------------------------
300 // Persistent data for CStatsScanSkillsEntry
301 //-----------------------------------------------------------------------------
303 #define PERSISTENT_CLASS CStatsScanSkillsEntry
305 #define PERSISTENT_DATA\
306 PROP(sint32,Base)\
307 PROP(sint32,Current)\
308 PROP(sint32,MaxLvlReached)\
309 PROP(double,Xp)\
310 PROP(double,XpNextLvl)\
312 #include "game_share/persistent_data_template.h"
315 //-----------------------------------------------------------------------------
316 // Persistent data for CStatsScanSkills
317 //-----------------------------------------------------------------------------
319 #define PERSISTENT_CLASS CStatsScanSkills
321 #define PERSISTENT_DATA\
322 STRUCT_MAP(CSString,CStatsScanSkillsEntry,Skills)\
324 #include "game_share/persistent_data_template.h"
327 //-----------------------------------------------------------------------------
328 // Persistent data for CStatsScanItemCraftParameters
329 //-----------------------------------------------------------------------------
331 #define PERSISTENT_CLASS CStatsScanItemCraftParameters
333 #define PERSISTENT_DATA\
334 PROP(float,Durability)\
335 PROP(float,Weight)\
336 PROP(float,SapLoad)\
337 PROP(float,StatEnergy)\
338 PROP(float,Dmg)\
339 PROP(float,Speed)\
340 PROP(float,Range)\
341 PROP(float,DodgeModifier)\
342 PROP(float,ParryModifier)\
343 PROP(float,AdversaryDodgeModifier)\
344 PROP(float,AdversaryParryModifier)\
345 PROP(float,ProtectionFactor)\
346 PROP(float,MaxSlashingProtection)\
347 PROP(float,MaxBluntProtection)\
348 PROP(float,MaxPiercingProtection)\
349 PROP(float,ElementalCastingTimeFactor)\
350 PROP(float,ElementalPowerFactor)\
351 PROP(float,OffensiveAfflictionCastingTimeFactor)\
352 PROP(float,OffensiveAfflictionPowerFactor)\
353 PROP(float,HealCastingTimeFactor)\
354 PROP(float,HealPowerFactor)\
355 PROP(float,DefensiveAfflictionCastingTimeFactor)\
356 PROP(float,DefensiveAfflictionPowerFactor)\
357 PROP(uint8,Color)\
358 PROP(sint32,HpBuff)\
359 PROP(sint32,SapBuff)\
360 PROP(sint32,StaBuff)\
361 PROP(sint32,FocusBuff)\
362 PROP(CSString,Protection)\
364 #include "game_share/persistent_data_template.h"
367 //-----------------------------------------------------------------------------
368 // Persistent data for CStatsScanItem
369 //-----------------------------------------------------------------------------
371 #define PERSISTENT_CLASS CStatsScanItem
373 #define PERSISTENT_DATA\
374 PROP(CSheetId,_SheetId)\
375 PROP(sint16,_ClientInventoryPosition)\
376 PROP(uint32,_HP)\
377 PROP(uint32,_Recommended)\
378 PROP(CEntityId,_CreatorId)\
379 PROP(uint8,_LocSlot)\
380 PROP(CSString,_PhraseId)\
381 PROP(uint16,_SlotImage)\
382 PROP(sint16,_SlotCount)\
383 PROP(uint32,_SapLoad)\
384 PROP(bool,_Dropable)\
385 PROP(bool,_Destroyable)\
386 PROP(uint32,StackSize)\
387 STRUCT(_CraftParameters)\
388 PROP_VECT(CSheetId,_Enchantment)\
389 STRUCT_VECT(Child)\
391 #include "game_share/persistent_data_template.h"
394 //-----------------------------------------------------------------------------
395 // Persistent data for CStatsScanInventory
396 //-----------------------------------------------------------------------------
398 #define PERSISTENT_CLASS CStatsScanInventory
400 #define PERSISTENT_DATA\
401 STRUCT_VECT(_Item)\
404 #include "game_share/persistent_data_template.h"
407 //-----------------------------------------------------------------------------
408 // Persistent data for CStatsScanPlayerRoom
409 //-----------------------------------------------------------------------------
411 #define PERSISTENT_CLASS CStatsScanPlayerRoom
413 #define PERSISTENT_DATA\
414 PROP(TAIAlias,Building)\
415 STRUCT(Inventory)\
416 PROP(sint32,Bulk)\
417 PROP(sint32,MaxBulk)\
419 #include "game_share/persistent_data_template.h"
422 //-----------------------------------------------------------------------------
423 // Persistent data for CStatsScanEntityPosition
424 //-----------------------------------------------------------------------------
426 #define PERSISTENT_CLASS CStatsScanEntityPosition
428 #define PERSISTENT_DATA\
429 PROP(sint32,X)\
430 PROP(sint32,Y)\
431 PROP(sint32,Z)\
432 PROP(float,Heading)\
434 #include "game_share/persistent_data_template.h"
437 //-----------------------------------------------------------------------------
438 // Persistent data for CStatsScanEntityBase
439 //-----------------------------------------------------------------------------
441 #define PERSISTENT_CLASS CStatsScanEntityBase
443 #define PERSISTENT_DATA\
444 STRUCT(_EntityPosition)\
445 PROP(uint32,_SheetId)\
446 PROP(CSString,_Name)\
447 PROP(CSString,_Race)\
448 PROP(uint8,_Gender)\
449 PROP(uint8,_Size)\
450 PROP(bool,_DodgeAsDefense)\
451 STRUCT(_PhysCharacs)\
452 STRUCT(_PhysScores)\
453 STRUCT(_Skills)\
455 PROP(sint32,MeleeAttackModifierOnEnemy)\
456 PROP(sint32,MeleeAttackModifierOnSelf)\
457 PROP(sint32,MagicCastingModifierOnSelf)\
458 PROP(sint32,MagicCastingModifierOnEnemy)\
459 PROP(sint32,RangeAttackModifierOnEnemy)\
460 PROP(sint32,RangeAttackModifierOnSelf)\
461 PROP(sint32,AttackModifierOnSelf)\
462 PROP(sint32,ChanceToFailStrategy)\
463 PROP(sint32,ChanceToFailSpell)\
464 PROP(sint32,ChanceToFailFaber)\
465 PROP(sint32,ChanceToFailHarvest)\
466 PROP(sint32,ChanceToFailTracking)\
467 PROP(sint32,MeleeAttackSlow)\
468 PROP(sint32,MeleeSlashingDamageArmor)\
469 PROP(sint32,MeleeBluntDamageArmor)\
470 PROP(sint32,MeleePiercingDamageArmor)\
471 PROP(sint32,MeleeDamageModifierFactor)\
472 PROP(sint32,RangeDamageModifierFactor)\
473 PROP(sint32,CreatureMeleeTakenDamageFactor)\
474 PROP(sint32,CreatureRangeTakenDamageFactor)\
475 PROP(sint32,CombatBrickLatencyMultiplier)\
476 PROP(sint32,MagicBrickLatencyMultiplier)\
477 PROP(sint32,ArmorQualityModifier)\
478 PROP(sint32,WeaponQualityModifier)\
479 PROP(sint32,ArmorAbsorbtionMultiplier)\
481 #include "game_share/persistent_data_template.h"
484 //-----------------------------------------------------------------------------
485 // Persistent data for CCharacter
486 //-----------------------------------------------------------------------------
488 #define PERSISTENT_CLASS CStatsScanCharacter
490 #define PERSISTENT_DATA\
491 PROP(uint32,VERSION)\
493 PROP(uint8, _HairType)\
494 PROP(uint8, _HairColor)\
495 PROP(uint8, _HatColor)\
496 PROP(uint8, _JacketColor)\
497 PROP(uint8, _ArmsColor)\
498 PROP(uint8, _TrousersColor)\
499 PROP(uint8, _FeetColor)\
500 PROP(uint8, _HandsColor)\
501 PROP(uint64,_Money)\
502 PROP(uint32,_GuildId)\
503 PROP(bool, _NewCharacter)\
504 PROP(uint8, _CreationPointsRepartition)\
505 PROP(uint32,_ForbidAuraUseEndDate)\
506 PROP(CSString,_Title)\
507 PROP(CSString,DeclaredCult)\
508 PROP(CSString,DeclaredCiv)\
510 /* Visual Properties */\
511 PROP(uint8,HairType)\
512 PROP(uint8,HairColor)\
513 PROP(uint8,GabaritHeight)\
514 PROP(uint8,GabaritTorsoWidth)\
515 PROP(uint8,GabaritArmsWidth)\
516 PROP(uint8,GabaritLegsWidth)\
517 PROP(uint8,GabaritBreastSize)\
518 PROP(uint8,MorphTarget1)\
519 PROP(uint8,MorphTarget2)\
520 PROP(uint8,MorphTarget3)\
521 PROP(uint8,MorphTarget4)\
522 PROP(uint8,MorphTarget5)\
523 PROP(uint8,MorphTarget6)\
524 PROP(uint8,MorphTarget7)\
525 PROP(uint8,MorphTarget8)\
526 PROP(uint8,EyesColor)\
527 PROP(uint8,Tattoo)\
528 PROP(uint8,NameStringId)\
530 PROP(bool, _HairCuteDiscount )\
531 PROP(float,_NextDeathPenaltyFactor)\
533 PROP(uint32, _FirstConnectedTime)\
534 PROP(uint32, _LastConnectedTime)\
535 PROP(uint32, _PlayedTime)\
536 STRUCT_LIST(CStatsScanCharacterLogTime, _LastLogStats)\
538 STRUCT(_DeathPenalties)\
539 STRUCT(_PlayerRoom)\
540 STRUCT(EntityBase)\
541 STRUCT(RespawnPoints)\
542 STRUCT(_Fames)\
543 STRUCT(_EncycloChar)\
544 STRUCT(_GameEvent)\
545 STRUCT(NormalPositions)\
547 PROP_VECT(CSheetId,_BoughtPhrases)\
548 PROP_VECT(CSheetId,_KnownBricks)\
549 PROP_VECT(CEntityId,_FriendsList)\
550 PROP_VECT(CEntityId,_IgnoreList)\
551 PROP_VECT(CEntityId,_IsFriendOf)\
552 PROP_VECT(CEntityId,_IsIgnoredBy)\
554 STRUCT_VECT(_Pact)\
556 PROP_MAP(CSString,double,SkillPoints)\
557 PROP_MAP(CSString,uint32,SpentSkillPoints)\
558 PROP_MAP(CSString,sint32,ScorePermanentModifiers)\
559 PROP_MAP(CSString,uint8,StartingCharacteristicValues)\
560 PROP_MAP(CSString,uint32,FactionPoints)\
562 STRUCT_MAP(TAIAlias,CStatsScanMissionHistory,_MissionHistories)\
563 STRUCT_MAP(uint32,CStatsScanPetAnimal,_PlayerPets)\
564 STRUCT_MAP(CSString,CStatsScanInventory,Inventory)\
567 #include "game_share/persistent_data_template.h"