You are here

Pseudocode for Item object

  1. class Item {
  2.     int id;                     /* id */
  3.     String name;                /* name */
  4.     String icon;                /* icon */
  5.     int quality;                /* overallQualityId */
  6.  
  7.     int bonding;                /* bonding */
  8.     int classId;                /* classId */
  9.     int equipInventoryType;     /* equipData/inventoryType */
  10.     String equipSubclass;       /* equipData/subclassName */
  11.  
  12.     int strength;               /* bonusStrength */
  13.     int agility;                /* bonusAgility */
  14.     int stamina;                /* bonusStamina */
  15.     int intellect;              /* bonusIntellect */
  16.     int spirit;                 /* bonusSpirit */
  17.     int armor;                  /* armor */
  18.     int addedArmor;             /* armor[armorBonus] */
  19.     String[] sockets;           /* one per socketData/socket */
  20.  
  21.     int maxDurability;          /* durability[max]*/
  22.     String[] allowedClasses;    /* one per allowableClasses/class */
  23.     int requiredLevel;          /* requiredLevel */
  24.     int attackPower;            /* bonusAttackPower */
  25.     int critRating;             /* bonusCritRating */
  26.     int expertiseRating;        /* bonusExpertiseRating */
  27.     int hasteRating;            /* bonusHasteRating */
  28.     int hitRating;              /* bonusHitRating */
  29.     int spellpower;             /* bonusSpellPower */
  30.     int resilience;             /* bonusResilience */
  31.  
  32.     Spells[] spells;            /* one per spellData/spell */
  33.  
  34.     ItemSet itemSet;            /* setData */
  35.     ItemSource source;          /* source */
  36. }
  37.  
  38. class Spell {
  39.     int trigger;                /* trigger */
  40.     String desc;                /* desc */
  41. }
  42.  
  43. class ItemSet {
  44.     String name;                /* name */
  45.     String[] items;             /* one per item */
  46.     Map<int, String> bonuses;   /* setBonus[ threshold ], setBonus[ desc ] */
  47. }
  48.  
  49.  
  50. class ItemSource {
  51.     String sourceType;          /* [value] */
  52.  
  53.     /* These are only defined when sourceType == "sourceType.creatureDrop" */
  54.     int areaId;                 /* [areaId] */
  55.     String areaName;            /* [areaName] */
  56.     int creatureId;             /* [creatureId] */
  57.     String creatureName;        /* [creatureName] */
  58.     String difficulty;          /* [difficulty] */
  59.     int dropRate;               /* [dropRate] */
  60. }

This represents the Item class that should be generated by the XML parser implementations.

Articles: 
Source code: