view Items.h @ 391:86637e3f59a9

Some AI subs
author Nomad
date Sat, 23 Feb 2013 08:46:50 +0200
parents b509ef97807a
children 0a1ea44b4a0a
line wrap: on
line source

#pragma once






/*  338 */
enum ITEM_FLAGS
{
  ITEM_IDENTIFIED = 0x1,
  ITEM_BROKEN = 0x2,
  ITEM_TEMP_BONUS = 0x8,
  ITEM_STOLEN = 0x100,
  ITEM_ENCHANTED = 0x200,
};


enum ITEM_MATERIAL
	{
	MATERIAL_COMMON  =0,
	MATERIAL_ARTEFACT = 1,
	MATERIAL_RELIC    = 2,
	MATERIAL_SPECIAL  = 3 
	};

/*  330 */
enum ITEM_TYPE
{
  ITEM_LONGSWORD_1 = 0x1,
  ITEM_DAGGER_1 = 0xF,
  ITEM_AXE_1 = 0x17,
  ITEM_SPEAR_1 = 0x1F,
  ITEM_CROSSBOW_1 = 0x2F,
  ITEM_MACE_1 = 0x32,
  ITEM_STAFF_1 = 0x3D,
  ITEM_BLASTER = 65,
  ITEM_LASER_RIFLE = 66,
  ITEM_LEATHER_1 = 0x42,
  ITEM_CHAINMAIL_1 = 0x47,
  ITEM_PLATE_1 = 0x4C,
  ITEM_BUCKLER_1 = 0x54,
  ITEM_GAUNTLETS_1 = 0x6E,
  ITEM_BOOTS_1 = 0x73,
  ITEM_WAND_FIRE = 0x87,
  ITEM_WAND_STUN = 0x8A,
  ITEM_WAND_INCENERATION = 0x9F,
  ITEM_TROLL_BLOOD = 0xCA,
  ITEM_DRAGON_EYE = 0xCC,
  ITEM_HARPY_FEATHER = 0xCF,
  ITEM_DEVIL_ICHOR = 0xD6,
  ITEM_OOZE_ECTOPLASM_BOTTLE = 0xD9,
  ITEM_POTION_BOTTLE = 0xDC,
  ITEM_SPELLBOOK_FIRE_STRIKE = 0x191,
  ITEM_SPELLBOOK_AIR_FEATHER_FALL = 0x19C,
  ITEM_SPELLBOOK_WATER_POISON_SPRAY = 0x1A7,
  ITEM_SPELLBOOK_EARTH_SLOW = 0x1B2,
  ITEM_SPELLBOOK_SPIRIT_BLESS = 0x1BD,
  ITEM_SPELLBOOK_MIND_MIND_BLAST = 0x1C8,
  ITEM_SPELLBOOK_BODY_FIRST_AID = 0x1D3,
  ITEM_SPELLBOOK_BODY_HEAL = 0x1D6,
  ITEM_SPELLBOOK_BODY_BREAK_POISON = 0x1D7,
  ITEM_SPELLBOOK_LIGHT_LIGHT_BOLT = 0x1DD,
  ITEM_SPELLBOOK_LIGHT_SUN_BURST = 0x1E6,
  ITEM_SPELLBOOK_LIGHT_DIVINE_INTERVENTION = 0x1E7,
  ITEM_ARTIFACT_PUCK = 0x1F4,
  ITEM_ARTIFACT_SPLITTER = 506,//1FA
  ITEM_RELIC_MEKORIGS_HAMMER = 0x210,
  ITEM_LICH_JAR = 601
};

/*  331 */
enum ITEM_EQUIP_TYPE
{
  EQUIP_ONE_OR_TWO_HANDS = 0,
  EQUIP_TWO_HANDED       = 1,
  EQUIP_BOW              = 2,
  EQUIP_ARMOUR           = 3,
  EQUIP_SHIELD           = 4,
  EQUIP_HELMET           = 5,
  EQUIP_BELT             = 6,
  EQUIP_CLOAK            = 7,
  EQUIP_GAUNTLETS        = 8,
  EQUIP_BOOTS            = 9,
  EQUIP_RING             = 10,
  EQUIP_AMULET           = 11,
  EQUIP_WAND             = 12,
  EQUIP_REAGENT          = 13,
  EQUIP_POTION           = 14,
  EQUIP_SPELL_SCROLL     = 15,
  EQUIP_BOOK             = 16,
  EQUIP_MESSAGE_SCROLL   = 17,
  EQUIP_GOLD             = 18,
  EQUIP_GEM              = 19,
  EQUIP_NONE             = 20
};



/*   64 */
#pragma pack(push, 1)
struct ItemGen
{
  //----- (0042EB25) --------------------------------------------------------
  inline ItemGen()
  {
    Reset();
  }

  inline bool Broken()        {return uAttributes & ITEM_BROKEN;}
  inline bool Identified()    {return uAttributes & ITEM_IDENTIFIED;}
  inline void SetIdentified() {uAttributes |= ITEM_IDENTIFIED;}
  inline bool Stolen()        {return uAttributes & ITEM_STOLEN;}

  bool GenerateArtifact();
  unsigned int GetValue();
  const char *GetDisplayName();
  const char *GetIdentifiedName();
  void UpdateTempBonus(__int64 uTimePlayed);
  void Reset();
  int _439DF3_get_additional_damage(int *a2, bool *vampiyr);



  unsigned int uItemID;
  int uEncantmentType;
  int _bonus_strength;
  int uSpecEnchantmentType;
  int uNumCharges;
  unsigned int uAttributes;
  unsigned __int8 uBodyAnchor;
  char uMaxCharges;
  char uHolderPlayer;
  char field_1B;
  unsigned __int64 uExpireTime;
};
#pragma pack(pop)



/*  175 */
#pragma pack(push, 1)
struct ItemDesc
	{ //Item # |Pic File|Name|Value|Equip Stat|Skill Group|Mod1|Mod2|material|	
	///ID/Rep/St|Not identified name|Sprite Index|VarA|VarB|Equip X|Equip Y|Notes
	char *pIconName;  //0 4
	char *pName;   //4 8
	char *pUnidentifiedName; //8 c
	char *pDescription;  //0c 10
	unsigned int uValue;  //10 14
	unsigned __int16 uSpriteID; //14 18
	__int16 field_1A; //16 
	signed __int16 uEquipX; //18  1c
	signed __int16 uEquipY; //1a  1e
	unsigned __int8 uEquipType; //1c 20
	unsigned __int8 uSkillType; //1d 21
	unsigned __int8 uDamageDice; //1e 22
	unsigned __int8 uDamageRoll; //1f 23
	unsigned __int8 uDamageMod; //20 24
	unsigned __int8 uMaterial; //21 25
	char _additional_value; //22 26
	char _bonus_type; //23  27
	char _bonus_strength; //24 28
	char field_25;  // 25  29
	char field_26;  //26   2A
	char field_27; // 27   2b
	union
    {
		unsigned __int8 uChanceByTreasureLvl[6];
		struct {
			unsigned __int8 uChanceByTreasureLvl1; // 28  2c
			unsigned __int8 uChanceByTreasureLvl2;  // 29  2d 
			unsigned __int8 uChanceByTreasureLvl3;  // 2A   2e
			unsigned __int8 uChanceByTreasureLvl4;  // 2B  2f
			unsigned __int8 uChanceByTreasureLvl5;  // 2C  30
			unsigned __int8 uChanceByTreasureLvl6;  // 2D  32
			};
    };
    unsigned char uItemID_Rep_St; //2e 32
    char field_2f;
};
#pragma pack(pop)



/*  177 */
#pragma pack(push, 1)
struct ItemEnchantment
	{ //Bonus|Sta|Of Name|Arm|Shld|Helm|Belt|Cape|Gaunt|Boot|Ring|Amul
	char *pBonusStat;
	char *pOfName;
/*	union{
		struct {
			unsigned char to_arm;
			unsigned char to_shld;
			unsigned char to_helm;
			unsigned char to_belt;
			unsigned char to_cape;
			unsigned char to_gaunt;
			unsigned char to_boot;
			unsigned char to_ring;
			unsigned char to_amul;
			}; */
			unsigned char to_item[12];
	//	};
	};
#pragma pack(pop)

/*  178 */
#pragma pack(push, 1)
struct ItemSpecialEnchantment
{ //Bonus Stat|Name Add|W1|W2|Miss|Arm|Shld|Helm|Belt|Cape|Gaunt|Boot|Ring|Amul|Value|Lvl|Description fo special Bonuses and values			

  char *pBonusStatement;
  char *pNameAdd;
  char to_item_apply[12];
  int iValue;
  int iTreasureLevel;
};
#pragma pack(pop)

#pragma pack(push, 1)
struct BonusRange
{
  unsigned int minR;
  unsigned int maxR;
};
#pragma pack(pop)

/*  176 */
#pragma pack(push, 1)
struct ItemsTable
{
  void Initialize();
  void LoadPotions();
  void LoadPotionNotes();
  void GenerateItem(int treasure_level, unsigned int uTreasureType, ItemGen *pItem);
  void SetSpecialBonus(ItemGen *pItem);
  bool IsMaterialSpecial(ItemGen *pItem);
  bool IsMaterialNonCommon(ItemGen *pItem);
  void Release();

  int uAllItemsCount;
  ItemDesc pItems[800]; //4-9604h
  ItemEnchantment pEnchantments[24]; //9604h
  ItemSpecialEnchantment pSpecialEnchantments[72]; //97E4h -9FC4h
  char field_9FC4[5000];
  char field_B348[5000];
  char field_C6D0[5000];
  char field_DA58[5000];
  char field_EDE0[384];
  unsigned __int16 potion_data[50][50]; // 77B2h*2=EF64h  -102ECh
  unsigned __int16 potion_note[50][50]; // 8176h*2=102ECh -11674h
  char *pItemsTXT_Raw; //11674h
  char *pRndItemsTXT_Raw;
  char *pStdItemsTXT_Raw; //1167Ch
  char *pSpcItemsTXT_Raw; //11680h
  unsigned int uChanceByTreasureLvlSumm[6]; //11684
  unsigned int uBonusChanceStandart[6]; //1169c
  unsigned int uBonusChanceSpecial[6]; //116B4
  unsigned int uBonusChanceWpSpecial[6]; //116cc -116e4
  unsigned int pEnchantmentsSumm[9]; //116E4h -11708h
  BonusRange bonus_ranges[6]; //45C2h*4 =11708h
  unsigned int pSpecialEnchantmentsSumm[24]; //11738h
  unsigned int pSpecialEnchantments_count; //11798h
  char field_1179C;
  char field_1179D;
  char field_1179E;
  char field_1179F;
};
#pragma pack(pop)




extern ItemGen *ptr_50C9A4;

extern struct ItemsTable *pItemsTable;

/*
+10 to all Resistances.	1
	+10 to all Seven Statistics.	2
	Explosive Impact!	3
	Adds 3-4 points of Cold damage.	4
	Adds 6-8 points of Cold damage.	5
	Adds 9-12 points of Cold damage.	6
	Adds 2-5 points of Electrical damage.	7
	Adds 4-10 points of Electrical damage.	8
	Adds 6-15 points of Electrical damage.	9
	Adds 1-6 points of Fire damage.	10
	Adds 2-12 points of Fire damage.	11
	Adds 3-18 points of Fire damage.	12
	Adds 5 points of Body damage.	13
	Adds 8 points of Body damage.	14
	Adds 12 points of Body damage.	15
	Drain Hit Points from target.	16
	Increases rate of Recovery.	17
	Wearer resistant to Diseases.	18
	Wearer resistant to Insanity.	19
	Wearer resistant to Paralysis.	20
	Wearer resistant to Poison.	21
	Wearer resistant to Sleep.	22
	Wearer resistant to Stone.	23
	Increased Knockback.	24
	+5 Level.	25
	Increases effect of all Air spells.	26
	Increases effect of all Body spells.	27
	Increases effect of all Dark spells.	28
	Increases effect of all Earth spells.	29
	Increases effect of all Fire spells.	30
	Increases effect of all Light spells.	31
	Increases effect of all Mind spells.	32
	Increases effect of all Spirit spells.	33
	Increases effect of all Water spells.	34
	Increases chance of Disarming.	35
	Half damage from all missile attacks.	36
	Regenerate Hit points over time.	37
	Regenerate Spell points over time.	38
	Double damage vs Demons.	39
	Double damage vs Dragons	40
	Drain Hit Points from target and Increased Weapon speed.	41
	+1 to Seven Stats, HP, SP, Armor, Resistances.	42
	+10 to Endurance, Armor, Hit points.	43
	+10 Hit points and Regenerate Hit points over time.	44
	+5 Speed and Accuracy.	45
	Adds 10-20 points of Fire damage and +25 Might.	46
	+10 Spell points and Regenerate Spell points over time.	47
	+15 Endurance and +5 Armor.	48
	+10 Intellect and Luck.	49
	+30 Fire Resistance and Regenerate Hit points over time.	50
	+10 Spell points, Speed, Intellect.	51
	+10 Endurance and Accuracy.	52
	+10 Might and Personality.	53
	+15 Endurance and Regenerate Hit points over time.	54
	+15 Luck and Regenerate Spell points over time.	55
	+5 Might and Endurance.	56
	+5 Intellect and Personality.	57
	Increased Value.	58
	Increased Weapon speed.	59
	+3 Unarmed and Dodging skills.	60
	+3 Stealing and Disarm skills.	61
	+3 ID Item and ID Monster skills.	62
	Double Damage vs. Elves.	63
	Double Damage vs. Undead.	64
	Double Damage vs. Titans.	65
	Regenerate Spell points and Hit points over time.	66
	Adds 5 points of Body damage and +2 Disarm skill.	67
	Adds 6-8 points of Cold damage and +5 Armor Class.	68
	+20 Air Resistance and Shielding.	69
	+10 Water Resistance and +2 Alchemy skill.	70
	Prevents damage from drowning.	71
	Prevents damage from falling.	72
*/