view Player.h @ 105:56e11be29db1

Слияние
author Ritor1
date Tue, 05 Feb 2013 19:08:52 +0600
parents 9c0607679772
children 1c471f3629fb
line wrap: on
line source

#pragma once
#include "Items.h"
#include "Spells.h"





/*  339 */
enum CHARACTER_RACE
{
  CHARACTER_RACE_HUMAN = 0x0,
  CHARACTER_RACE_ELF = 0x1,
  CHARACTER_RACE_GOBLIN = 0x2,
  CHARACTER_RACE_DWARF = 0x3,
};
enum CHARACTER_ATTRIBUTE
{
  CHARACTER_MIGHT = 0x0,
  CHARACTER_INTELLIGANCE = 0x1,
  CHARACTER_WILLPOWER = 0x2,
  CHARACTER_ENDURANCE = 0x3,
  CHARACTER_ACCURACY = 0x4,
  CHARACTER_SPEED = 0x5,
  CHARACTER_LUCK = 0x6,
};

/*  332 */
enum CHARACTER_ATTRIBUTE_TYPE
{
  CHARACTER_ATTRIBUTE_STRENGTH = 0x0,
  CHARACTER_ATTRIBUTE_INTELLIGENCE = 0x1,
  CHARACTER_ATTRIBUTE_WILLPOWER = 0x2,
  CHARACTER_ATTRIBUTE_ENDURANCE = 0x3,
  CHARACTER_ATTRIBUTE_ACCURACY = 0x4,
  CHARACTER_ATTRIBUTE_SPEED = 0x5,
  CHARACTER_ATTRIBUTE_LUCK = 0x6,
  CHARACTER_ATTRIBUTE_HEALTH = 0x7,
  CHARACTER_ATTRIBUTE_MANA = 0x8,
  CHARACTER_ATTRIBUTE_AC_BONUS = 0x9,
  CHARACTER_ATTRIBUTE_RESIST_FIRE = 0xA,
  CHARACTER_ATTRIBUTE_RESIST_AIR = 0xB,
  CHARACTER_ATTRIBUTE_RESIST_WATER = 0xC,
  CHARACTER_ATTRIBUTE_RESIST_EARTH = 0xD,
  CHARACTER_ATTRIBUTE_RESIST_MIND = 0xE,
  CHARACTER_ATTRIBUTE_RESIST_BODY = 0xF,
  CHARACTER_ATTRIBUTE_LEVEL = 0x18,
  CHARACTER_ATTRIBUTE_ATTACK = 0x19,
  CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS = 0x1A,
  CHARACTER_ATTRIBUTE_MELEE_DMG_MIN = 0x1B,
  CHARACTER_ATTRIBUTE_MELEE_DMG_MAX = 0x1C,
  CHARACTER_ATTRIBUTE_RANGED_ATTACK = 0x1D,
  CHARACTER_ATTRIBUTE_RANGED_DAMAGE_BONUS = 0x1E,
  CHARACTER_ATTRIBUTE_RANGED_DAMAGE_MIN = 0x1F,
  CHARACTER_ATTRIBUTE_RANGED_DAMAGE_MAX = 0x20,
};

/*  328 */
enum PLAYER_SKILL_TYPE
{
  PLAYER_SKILL_STAFF = 0x0,
  PLAYER_SKILL_SWORD = 0x1,
  PLAYER_SKILL_DAGGER = 0x2,
  PLAYER_SKILL_AXE = 0x3,
  PLAYER_SKILL_SPEAR = 0x4,
  PLAYER_SKILL_BOW = 0x5,
  PLAYER_SKILL_MACE = 0x6,
  PLAYER_SKILL_BLASTER = 0x7,
  PLAYER_SKILL_SHIELD = 0x8,
  PLAYER_SKILL_LEATHER = 0x9,
  PLAYER_SKILL_CHAIN = 0xA,
  PLAYER_SKILL_PLATE = 0xB,
  PLAYER_SKILL_FIRE = 0xC,
  PLAYER_SKILL_AIR = 0xD,
  PLAYER_SKILL_WATER = 0xE,
  PLAYER_SKILL_EARTH = 0xF,
  PLAYER_SKILL_SPIRIT = 0x10,
  PLAYER_SKILL_MIND = 0x11,
  PLAYER_SKILL_BODY = 0x12,
  PLAYER_SKILL_LIGHT = 0x13,
  PLAYER_SKILL_DARK = 0x14,
  PLAYER_SKILL_ITEM_ID = 0x15,
  PLAYER_SKILL_MERCHANT = 0x16,
  PLAYER_SKILL_REPAIR = 0x17,
  PLAYER_SKILL_BODYBUILDING = 0x18,
  PLAYER_SKILL_MEDITATION = 0x19,
  PLAYER_SKILL_PERCEPTION = 0x1A,
  PLAYER_SKILL_DIPLOMACY = 0x1B,
  PLAYER_SKILL_TIEVERY = 0x1C,
  PLAYER_SKILL_TRAP_DISARM = 0x1D,
  PLAYER_SKILL_DODGE = 0x1E,
  PLAYER_SKILL_UNARMED = 0x1F,
  PLAYER_SKILL_MONSTER_ID = 0x20,
  PLAYER_SKILL_ARMSMASTER = 0x21,
  PLAYER_SKILL_STEALING = 0x22,
  PLAYER_SKILL_ALCHEMY = 0x23,
  PLAYER_SKILL_LEARNING = 0x24,
};

/*  329 */
enum PLAYER_CLASS_TYPE
{
  PLAYER_CLASS_KNIGHT = 0x0,
  PLAYER_CLASS_THEIF = 0x4,
  PLAYER_CLASS_BOUNTY_HUNTER = 0x7,
  PLAYER_CLASS_MONK = 0x8,
  PLAYER_CLASS_PALADIN = 0xC,
  PLAYER_CLASS_SHOOTER = 0x10,
  PLAYER_CLASS_RANGER = 0x14,
  PLAYER_CLASS_CLERIC = 0x18,
  PLAYER_CLASS_PRIEST_OF_MOON = 0x1B,
  PLAYER_CLASS_DRUID = 0x1C,
  PLAYER_CLASS_SORCERER = 0x20,
  PLAYER_CLASS_LICH = 0x23,
};




#pragma pack(push, 1)
struct LloydBeacon
{
  unsigned __int64 uBeaconTime;
  int field_8;
  int field_C;
  int field_10;
  int field_14;
  int field_18;
};
#pragma pack(pop)



#pragma pack(push, 1)
struct PlayerSpellbookChapter
{
  unsigned __int8 bIsSpellbookAvailable;
  char bIsSpellAvailable[10];
};
#pragma pack(pop)

#pragma pack(push, 1)
struct PlayerSpells
{
  union
  {
    struct
    {
      PlayerSpellbookChapter pFireSpellbook;
      PlayerSpellbookChapter pAirSpellbook;
      PlayerSpellbookChapter pWaterSpellbook;
      PlayerSpellbookChapter pEarthSpellbook;
      PlayerSpellbookChapter pSpiritSpellbook;
      PlayerSpellbookChapter pMindSpellbook;
      PlayerSpellbookChapter pBodySpellbook;
      PlayerSpellbookChapter pLightSpellbook;
      PlayerSpellbookChapter pDarkSpellbook;
      char _pad_0;
    };
    struct
    {
      PlayerSpellbookChapter pChapters[9];
      char _pad_1;
    };
  };
};
#pragma pack(pop)



#pragma pack(push, 1)
union PlayerEquipment
{
  union
  {
    struct
    {
      unsigned int uOffHand;
      unsigned int uMainHand;
      unsigned int uBow;
      unsigned int uBody;
      unsigned int uHelm;
      unsigned int uBelt;
      unsigned int uCloak;
      unsigned int field_1C;
      unsigned int field_20;
      unsigned int field_24;
      unsigned int field_28;
      unsigned int field_2C;
      unsigned int field_30;
      unsigned int field_34;
      unsigned int field_38;
      unsigned int field_3C;
    };
    unsigned int pIndices[16];
  };
};
#pragma pack(pop)





enum PLAYER_SEX: unsigned __int8
{
  SEX_MALE = 0,
  SEX_FEMALE = 1
};

#pragma pack(push, 1)
struct Player
{
  enum Condition: unsigned __int32
  {
    Condition_Cursed = 0,
    Condition_Weak = 1,
    Condition_Sleep = 2,
    Condition_Fear = 3,
    Condition_Drunk = 4,
    Condition_Insane = 5,
    Condition_Poison1 = 6,
    Condition_Disease1 = 7,
    Condition_Posion2 = 8,
    Condition_Disease2 = 9,
    Condition_Poison3 = 10,
    Condition_Disease3 = 11,
    Condition_Paralyzed = 12,
    Condition_Unconcious = 13,
    Condition_Dead = 14,
    Condition_Pertified = 15,
    Condition_Eradicated = 16,
    Condition_Zombie = 17,
    Condition_Good = 18
  };

  Player();

  void SetVariable(enum VariableType var, signed int a3);
  void AddVariable(enum VariableType var, signed int val);
  void SubtractVariable(enum VariableType var, void *a3);
  char CompareVariable(enum VariableType var, signed int a1);
  void UseItem_DrinkPotion_etc(signed int a2, int a3);
  bool AddItem(struct ItemGen *pItem);
  int GetBaseStrength();
  int GetBaseIntelligence();
  int GetBaseWillpower();
  int GetBaseEndurance();
  int GetBaseAccuracy();
  int GetBaseSpeed();
  int GetBaseLuck();
  int GetBaseLevel();
  int GetActualLevel();
  int GetActualMight();
  int GetActualIntelligence();
  int GetActualWillpower();
  int GetActualEndurance();
  int GetActualAccuracy();
  int GetActualSpeed();
  int GetActualLuck();
  int GetActualAttack(int a2);
  int GetMeleeDamageMinimal();
  int GetMeleeDamageMaximal();
  int CalculateMeleeDamageTo(int a2, int a3, unsigned int uTargetActorID);
  int GetRangedAttack();
  int GetRangedDamageMin();
  int GetRangedDamageMax();
  bool CalculateRangedDamageTo(int a2);
  char *GetMeleeDamageString();
  char *GetRangedDamageString();
  bool CanTrainToNextLevel();
  unsigned int GetExperienceDisplayColor();
  int CalculateIncommingDamage(int resistance, signed int type);
  int GetEquippedItemEquipType(unsigned int uEquipSlot);
  int GetEquippedItemSkillType(enum ITEM_EQUIP_TYPE uEquipSlot);
  bool IsUnarmed();
  bool HasItemEquipped(enum ITEM_EQUIP_TYPE uEquipIndex);
  bool HasEnchantedItemEquipped(int uEnchantment);
  bool WearsItem(int a1, signed int a2);
  bool StealFromShop(struct ItemGen *a2, int a3, int a4, int a5, int *a6);
  int StealFromActor(unsigned int uActorID, int _steal_perm, int reputation);
  void Heal(int amount);
  int ReceiveDamage(signed int type, int resistance);
  int _48DCF6(int a2, struct Actor *pActor);
  unsigned int GetSpellSchool(unsigned int uSpellID);
  int GetAttackRecoveryTime(int a2);
  int GetMaxHealth();
  int GetMaxMana();
  int GetBaseAC();
  int GetActualAC();
  unsigned int GetBaseAge();
  unsigned int GetActualAge();
  int GetBaseResistance(enum CHARACTER_ATTRIBUTE_TYPE a2);
  int GetActualResistance(enum CHARACTER_ATTRIBUTE_TYPE a2);
  void SetRecoveryTime(signed int sRecoveryTime);
  void RandomizeName();
  unsigned int GetMajorConditionIdx();
  int _48EA1B_get_static_effect(int a2);
  int _48EA46_calc_special_bonus_by_items(int a2);
  int GetItemsBonus(enum CHARACTER_ATTRIBUTE_TYPE attr, int a3);
  int GetMagicalBonus(enum CHARACTER_ATTRIBUTE_TYPE a2);
  char GetActualSkillLevel(enum PLAYER_SKILL_TYPE uSkillType);
  int GetSkillBonus(enum CHARACTER_ATTRIBUTE_TYPE a2);
  enum CHARACTER_RACE GetRace();
  int GetSexByVoice();
  void SetInitialStats();
  int SetSexByVoice();
  void Reset(unsigned __int8 uClass);
  enum PLAYER_SKILL_TYPE GetSkillIdxByOrder(signed int order);
  void DecreaseAttribute(int eAttribute);
  int IncreaseAttribute(int eAttribute);
  void Player::Zero();
  __int16 GetStatColor(unsigned int uStat);
  bool DiscardConditionIfLastsLongerThan(unsigned int uCondition, unsigned __int64 uTime);
  int _490EEE(ItemGen *pItem, int a3, int a4, int a5);
  int GetBodybuilding();
  int GetMediatation();
  int CanIdentify(ItemGen *pItem);
  int CanRepair(ItemGen *);
  int GetMerchant();
  int GetPerception();
  int GetDisarmTrap();
  char GetLearningPercent();
  bool CanFitItem(unsigned int uSlot, unsigned int uItemID);
  unsigned int FindFreeInventorySlot();
  int CreateItemInInventory(unsigned int uSlot, unsigned int uItemID);
  int HasSkill(unsigned int uSkillType);
  int WearItem(unsigned int uItemID);
  int AddItem(unsigned int uSlot, unsigned int uItemID);
  int AddItem2(unsigned int uSlot, ItemGen *Src);
  int CreateItemInInventory2(unsigned int uSlot, ItemGen *Src);
  bool _49298B(ItemGen *a2, int a3, int a4);
  unsigned int RemoveItemAtInventoryIndex(unsigned int uSlot);
  bool CanAct();
  bool CanSteal();
  bool CanEquip_RaceAndAlignmentCheck(unsigned int uItemID);
  int SetCondition(unsigned int uConditionIdx, int a3);
  int _49327B(unsigned int uClass, int a3);
  __int16 PlaySound(int a2, int a3);
  __int16 PlayEmotion(int a2, int a3);
  char _4160CA(int a2);
  unsigned int GetItemIDAtInventoryIndex(int *a2);
  int _4B6FF9();
  int _4B824B(float a2);
  int _4B8265(int a2, float a3);
  int _4B8233(int a2, float a3);
  int _4B8213(int a2, float a3);
  int _4B81C3(int a2, float a3);
  int _4B8179(float a2);
  int _4B8142(int a2, float a3);
  int _4B8102(int a2, float a3);
  int _4B807C(float a2);
  int _4B8040_condition_time(unsigned int uCondition);
  bool _43EEF3();
  void _4BE2DD(unsigned int a2, int a3, int _2devent_idx);
  bool Recover(signed int a2);
  bool CanCastSpell(unsigned int uRequiredMana);

  inline bool Dead()       {return pConditions[Condition::Condition_Dead] != 0;}
  inline bool Eradicated() {return pConditions[Condition::Condition_Eradicated] != 0;}



  __int64 pConditions[20];
  unsigned __int64 uExperience;
  char pName[16];
  PLAYER_SEX uSex;
  unsigned __int8 uClass;
  unsigned __int8 uFace;
  char field_BB;
  unsigned __int16 uMight;
  unsigned __int16 uMightBonus;
  unsigned __int16 uIntelligence;
  unsigned __int16 uIntelligenceBonus;
  unsigned __int16 uWillpower;
  unsigned __int16 uWillpowerBonus;
  unsigned __int16 uEndurance;
  unsigned __int16 uEnduranceBonus;
  unsigned __int16 uSpeed;
  unsigned __int16 uSpeedBonus;
  unsigned __int16 uAccuracy;
  unsigned __int16 uAccuracyBonus;
  unsigned __int16 uLuck;
  unsigned __int16 uLuckBonus;
  __int16 sACModifier;
  unsigned __int16 uLevel;
  __int16 sLevelModifier;
  __int16 sAgeModifier;
  int field_E0;
  int field_E4;
  int field_E8;
  int field_EC;
  int field_F0;
  int field_F4;
  int field_F8;
  int field_FC;
  int field_100;
  int field_104;
  union
  {
    struct
    {
      unsigned __int16 skillStaff;
      unsigned __int16 skillSword;
      unsigned __int16 skillDagger;
      unsigned __int16 skillAxe;
      unsigned __int16 skillSpear;
      unsigned __int16 skillBow;
      unsigned __int16 skillMace;
      unsigned __int16 skillBlaster;
      unsigned __int16 skillShield;
      unsigned __int16 skillLeather;
      unsigned __int16 skillChain;
      unsigned __int16 skillPlate;
      unsigned __int16 skillFire;
      unsigned __int16 skillAir;
      unsigned __int16 skillWater;
      unsigned __int16 skillEarth;
      unsigned __int16 skillSpirit;
      unsigned __int16 skillMind;
      unsigned __int16 skillBody;
      unsigned __int16 skillLight;
      unsigned __int16 skillDark;
      unsigned __int16 skillItemId;
      unsigned __int16 skillMerchant;
      unsigned __int16 skillRepair;
      unsigned __int16 skillBodybuilding;
      unsigned __int16 skillMeditation;
      unsigned __int16 skillPerception;
      unsigned __int16 skillDiplomacy;
      unsigned __int16 skillThievery;
      unsigned __int16 skillDisarmTrap;
      unsigned __int16 skillDodge;
      unsigned __int16 skillUnarmed;
      unsigned __int16 skillMonsterId;
      unsigned __int16 skillArmsmaster;
      unsigned __int16 skillStealing;
      unsigned __int16 skillAlchemy;
      unsigned __int16 skillLearning;
    };
    unsigned __int16 pActiveSkills[37];
  };
  char field_152[64];
  PlayerSpells spellbook;
  char field_1F5[30]; // used to be [31]
  ItemGen pInventoryItems[126];
  ItemGen pEquippedItems[12];
  int pInventoryIndices[126];
  __int16 sResFireBase;
  __int16 sResAirBase;
  __int16 sResWaterBase;
  __int16 sResEarthBase;
  __int16 field_177C;
  __int16 sResMagicBase;
  __int16 sResSpiritBase;
  __int16 sResMindBase;
  __int16 sResBodyBase;
  __int16 sResLightBase;
  __int16 sResDarkBase;
  __int16 sResFireBonus;
  __int16 sResAirBonus;
  __int16 sResWaterBonus;
  __int16 sResEarthBonus;
  __int16 field_1792;
  __int16 sResMagicBonus;
  __int16 sResSpiritBonus;
  __int16 sResMindBonus;
  __int16 sResBodyBonus;
  __int16 sResLightBonus;
  __int16 sResDarkBonus;
  SpellBuff pPlayerBuffs[24];
  unsigned int uVoiceID;
  int field_1924;
  int field_1928;
  int field_192C;
  int field_1930;
  unsigned __int16 uTimeToRecovery;
  char field_1936;
  char field_1937;
  unsigned int uSkillPoints;
  int sHealth;
  int sMana;
  unsigned int uBirthYear;
  PlayerEquipment pEquipment;
  int field_1988[49];
  char field_1A4C;
  char field_1A4D;
  char pNumSpellBookPage;
  unsigned __int8 uQuickSpell;
  char field_1A50[64];
  char _some_attack_bonus;
  char field_1A91;
  char _melee_dmg_bonus;
  char field_1A93;
  char _ranged_atk_bonus;
  char field_1A95;
  char _ranged_dmg_bonus;
  char field_1A97;
  char uFullHealthBonus;
  char _health_related;
  char uFullManaBonus;
  char _mana_related;
  unsigned __int16 uExpressionID;
  unsigned __int16 uExpressionTimePassed;
  unsigned __int16 uExpressionTimeLength;
  __int16 field_1AA2;
  int field_1AA4;
  int field_1AA8;
  LloydBeacon pInstalledBeacons[5];
  char uNumDivineInterventionCastsThisDay;
  char uNumArmageddonCasts;
  char uNumFireSpikeCasts;
  char field_1B3B;
};
#pragma pack(pop)