Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(readXMLString(listNode, "manaShield", strValue))
- outfit.manaShield = booleanString(strValue);
- if(readXMLString(listNode, "invisible", strValue))
- outfit.invisible = booleanString(strValue);
- if(readXMLInteger(listNode, "healthGain", intValue))
- {
- outfit.healthGain = intValue;
- outfit.regeneration = true;
- }
- if(readXMLInteger(listNode, "healthTicks", intValue))
- {
- outfit.healthTicks = intValue;
- outfit.regeneration = true;
- }
- if(readXMLInteger(listNode, "manaGain", intValue))
- {
- outfit.manaGain = intValue;
- outfit.regeneration = true;
- }
- if(readXMLInteger(listNode, "manaTicks", intValue))
- {
- outfit.manaTicks = intValue;
- outfit.regeneration = true;
- }
- if(readXMLInteger(listNode, "speed", intValue))
- outfit.speed = intValue;
- for(xmlNodePtr configNode = listNode->children; configNode != NULL; configNode = configNode->next)
- {
- if(!xmlStrcmp(configNode->name, (const xmlChar*)"reflect"))
- {
- if(readXMLInteger(configNode, "percentAll", intValue))
- {
- for(uint32_t i = COMBAT_FIRST; i <= COMBAT_LAST; i++)
- outfit.reflect[REFLECT_PERCENT][(CombatType_t)i] += intValue;
- }
- if(readXMLInteger(configNode, "percentElements", intValue))
- {
- outfit.reflect[REFLECT_PERCENT][COMBAT_ENERGYDAMAGE] += intValue;
- outfit.reflect[REFLECT_PERCENT][COMBAT_FIREDAMAGE] += intValue;
- outfit.reflect[REFLECT_PERCENT][COMBAT_EARTHDAMAGE] += intValue;
- outfit.reflect[REFLECT_PERCENT][COMBAT_ICEDAMAGE] += intValue;
- }
- if(readXMLInteger(configNode, "percentMagic", intValue))
- {
- outfit.reflect[REFLECT_PERCENT][COMBAT_ENERGYDAMAGE] += intValue;
- outfit.reflect[REFLECT_PERCENT][COMBAT_FIREDAMAGE] += intValue;
- outfit.reflect[REFLECT_PERCENT][COMBAT_EARTHDAMAGE] += intValue;
- outfit.reflect[REFLECT_PERCENT][COMBAT_ICEDAMAGE] += intValue;
- outfit.reflect[REFLECT_PERCENT][COMBAT_HOLYDAMAGE] += intValue;
- outfit.reflect[REFLECT_PERCENT][COMBAT_DEATHDAMAGE] += intValue;
- }
- if(readXMLInteger(configNode, "percentEnergy", intValue))
- outfit.reflect[REFLECT_PERCENT][COMBAT_ENERGYDAMAGE] += intValue;
- if(readXMLInteger(configNode, "percentFire", intValue))
- outfit.reflect[REFLECT_PERCENT][COMBAT_FIREDAMAGE] += intValue;
- if(readXMLInteger(configNode, "percentPoison", intValue) || readXMLInteger(configNode, "percentEarth", intValue))
- outfit.reflect[REFLECT_PERCENT][COMBAT_EARTHDAMAGE] += intValue;
- if(readXMLInteger(configNode, "percentIce", intValue))
- outfit.reflect[REFLECT_PERCENT][COMBAT_ICEDAMAGE] += intValue;
- if(readXMLInteger(configNode, "percentHoly", intValue))
- outfit.reflect[REFLECT_PERCENT][COMBAT_HOLYDAMAGE] += intValue;
- if(readXMLInteger(configNode, "percentDeath", intValue))
- outfit.reflect[REFLECT_PERCENT][COMBAT_DEATHDAMAGE] += intValue;
- if(readXMLInteger(configNode, "percentLifeDrain", intValue))
- outfit.reflect[REFLECT_PERCENT][COMBAT_LIFEDRAIN] += intValue;
- if(readXMLInteger(configNode, "percentManaDrain", intValue))
- outfit.reflect[REFLECT_PERCENT][COMBAT_MANADRAIN] += intValue;
- if(readXMLInteger(configNode, "percentDrown", intValue))
- outfit.reflect[REFLECT_PERCENT][COMBAT_DROWNDAMAGE] += intValue;
- if(readXMLInteger(configNode, "percentPhysical", intValue))
- outfit.reflect[REFLECT_PERCENT][COMBAT_PHYSICALDAMAGE] += intValue;
- if(readXMLInteger(configNode, "percentHealing", intValue))
- outfit.reflect[REFLECT_PERCENT][COMBAT_HEALING] += intValue;
- if(readXMLInteger(configNode, "percentUndefined", intValue))
- outfit.reflect[REFLECT_PERCENT][COMBAT_UNDEFINEDDAMAGE] += intValue;
- if(readXMLInteger(configNode, "chanceAll", intValue))
- {
- for(uint32_t i = COMBAT_FIRST; i <= COMBAT_LAST; i++)
- outfit.reflect[REFLECT_CHANCE][(CombatType_t)i] += intValue;
- }
- if(readXMLInteger(configNode, "chanceElements", intValue))
- {
- outfit.reflect[REFLECT_CHANCE][COMBAT_ENERGYDAMAGE] += intValue;
- outfit.reflect[REFLECT_CHANCE][COMBAT_FIREDAMAGE] += intValue;
- outfit.reflect[REFLECT_CHANCE][COMBAT_EARTHDAMAGE] += intValue;
- outfit.reflect[REFLECT_CHANCE][COMBAT_ICEDAMAGE] += intValue;
- }
- if(readXMLInteger(configNode, "chanceMagic", intValue))
- {
- outfit.reflect[REFLECT_CHANCE][COMBAT_ENERGYDAMAGE] += intValue;
- outfit.reflect[REFLECT_CHANCE][COMBAT_FIREDAMAGE] += intValue;
- outfit.reflect[REFLECT_CHANCE][COMBAT_EARTHDAMAGE] += intValue;
- outfit.reflect[REFLECT_CHANCE][COMBAT_ICEDAMAGE] += intValue;
- outfit.reflect[REFLECT_CHANCE][COMBAT_HOLYDAMAGE] += intValue;
- outfit.reflect[REFLECT_CHANCE][COMBAT_DEATHDAMAGE] += intValue;
- }
- if(readXMLInteger(configNode, "chanceEnergy", intValue))
- outfit.reflect[REFLECT_CHANCE][COMBAT_ENERGYDAMAGE] += intValue;
- if(readXMLInteger(configNode, "chanceFire", intValue))
- outfit.reflect[REFLECT_CHANCE][COMBAT_FIREDAMAGE] += intValue;
- if(readXMLInteger(configNode, "chancePoison", intValue) || readXMLInteger(configNode, "chanceEarth", intValue))
- outfit.reflect[REFLECT_CHANCE][COMBAT_EARTHDAMAGE] += intValue;
- if(readXMLInteger(configNode, "chanceIce", intValue))
- outfit.reflect[REFLECT_CHANCE][COMBAT_ICEDAMAGE] += intValue;
- if(readXMLInteger(configNode, "chanceHoly", intValue))
- outfit.reflect[REFLECT_CHANCE][COMBAT_HOLYDAMAGE] += intValue;
- if(readXMLInteger(configNode, "chanceDeath", intValue))
- outfit.reflect[REFLECT_CHANCE][COMBAT_DEATHDAMAGE] += intValue;
- if(readXMLInteger(configNode, "chanceLifeDrain", intValue))
- outfit.reflect[REFLECT_CHANCE][COMBAT_LIFEDRAIN] += intValue;
- if(readXMLInteger(configNode, "chanceManaDrain", intValue))
- outfit.reflect[REFLECT_CHANCE][COMBAT_MANADRAIN] += intValue;
- if(readXMLInteger(configNode, "chanceDrown", intValue))
- outfit.reflect[REFLECT_CHANCE][COMBAT_DROWNDAMAGE] += intValue;
- if(readXMLInteger(configNode, "chancePhysical", intValue))
- outfit.reflect[REFLECT_CHANCE][COMBAT_PHYSICALDAMAGE] += intValue;
- if(readXMLInteger(configNode, "chanceHealing", intValue))
- outfit.reflect[REFLECT_CHANCE][COMBAT_HEALING] += intValue;
- if(readXMLInteger(configNode, "chanceUndefined", intValue))
- outfit.reflect[REFLECT_CHANCE][COMBAT_UNDEFINEDDAMAGE] += intValue;
- }
- else if(!xmlStrcmp(configNode->name, (const xmlChar*)"absorb"))
- {
- if(readXMLInteger(configNode, "percentAll", intValue))
- {
- for(int32_t i = COMBAT_FIRST; i <= COMBAT_LAST; i++)
- outfit.absorb[(CombatType_t)i] += intValue;
- }
- if(readXMLInteger(configNode, "percentElements", intValue))
- {
- outfit.absorb[COMBAT_ENERGYDAMAGE] += intValue;
- outfit.absorb[COMBAT_FIREDAMAGE] += intValue;
- outfit.absorb[COMBAT_EARTHDAMAGE] += intValue;
- outfit.absorb[COMBAT_ICEDAMAGE] += intValue;
- }
- if(readXMLInteger(configNode, "percentMagic", intValue))
- {
- outfit.absorb[COMBAT_ENERGYDAMAGE] += intValue;
- outfit.absorb[COMBAT_FIREDAMAGE] += intValue;
- outfit.absorb[COMBAT_EARTHDAMAGE] += intValue;
- outfit.absorb[COMBAT_ICEDAMAGE] += intValue;
- outfit.absorb[COMBAT_HOLYDAMAGE] += intValue;
- outfit.absorb[COMBAT_DEATHDAMAGE] += intValue;
- }
- if(readXMLInteger(configNode, "percentEnergy", intValue))
- outfit.absorb[COMBAT_ENERGYDAMAGE] += intValue;
- if(readXMLInteger(configNode, "percentFire", intValue))
- outfit.absorb[COMBAT_FIREDAMAGE] += intValue;
- if(readXMLInteger(configNode, "percentPoison", intValue) || readXMLInteger(configNode, "percentEarth", intValue))
- outfit.absorb[COMBAT_EARTHDAMAGE] += intValue;
- if(readXMLInteger(configNode, "percentIce", intValue))
- outfit.absorb[COMBAT_ICEDAMAGE] += intValue;
- if(readXMLInteger(configNode, "percentHoly", intValue))
- outfit.absorb[COMBAT_HOLYDAMAGE] += intValue;
- if(readXMLInteger(configNode, "percentDeath", intValue))
- outfit.absorb[COMBAT_DEATHDAMAGE] += intValue;
- if(readXMLInteger(configNode, "percentLifeDrain", intValue))
- outfit.absorb[COMBAT_LIFEDRAIN] += intValue;
- if(readXMLInteger(configNode, "percentManaDrain", intValue))
- outfit.absorb[COMBAT_MANADRAIN] += intValue;
- if(readXMLInteger(configNode, "percentDrown", intValue))
- outfit.absorb[COMBAT_DROWNDAMAGE] += intValue;
- if(readXMLInteger(configNode, "percentPhysical", intValue))
- outfit.absorb[COMBAT_PHYSICALDAMAGE] += intValue;
- if(readXMLInteger(configNode, "percentHealing", intValue))
- outfit.absorb[COMBAT_HEALING] += intValue;
- if(readXMLInteger(configNode, "percentUndefined", intValue))
- outfit.absorb[COMBAT_UNDEFINEDDAMAGE] += intValue;
- }
- else if(!xmlStrcmp(configNode->name, (const xmlChar*)"skills"))
- {
- if(readXMLInteger(configNode, "fist", intValue))
- outfit.skills[SKILL_FIST] += intValue;
- if(readXMLInteger(configNode, "club", intValue))
- outfit.skills[SKILL_CLUB] += intValue;
- if(readXMLInteger(configNode, "axe", intValue))
- outfit.skills[SKILL_AXE] += intValue;
- if(readXMLInteger(configNode, "sword", intValue))
- outfit.skills[SKILL_SWORD] += intValue;
- if(readXMLInteger(configNode, "distance", intValue) || readXMLInteger(configNode, "dist", intValue))
- outfit.skills[SKILL_DIST] += intValue;
- if(readXMLInteger(configNode, "shielding", intValue) || readXMLInteger(configNode, "shield", intValue))
- outfit.skills[SKILL_SHIELD] = intValue;
- if(readXMLInteger(configNode, "fishing", intValue) || readXMLInteger(configNode, "fish", intValue))
- outfit.skills[SKILL_FISH] = intValue;
- if(readXMLInteger(configNode, "melee", intValue))
- {
- outfit.skills[SKILL_FIST] += intValue;
- outfit.skills[SKILL_CLUB] += intValue;
- outfit.skills[SKILL_SWORD] += intValue;
- outfit.skills[SKILL_AXE] += intValue;
- }
- if(readXMLInteger(configNode, "weapon", intValue) || readXMLInteger(configNode, "weapons", intValue))
- {
- outfit.skills[SKILL_CLUB] += intValue;
- outfit.skills[SKILL_SWORD] += intValue;
- outfit.skills[SKILL_AXE] += intValue;
- outfit.skills[SKILL_DIST] += intValue;
- }
- if(readXMLInteger(configNode, "fistPercent", intValue))
- outfit.skillsPercent[SKILL_FIST] += intValue;
- if(readXMLInteger(configNode, "clubPercent", intValue))
- outfit.skillsPercent[SKILL_CLUB] += intValue;
- if(readXMLInteger(configNode, "swordPercent", intValue))
- outfit.skillsPercent[SKILL_SWORD] += intValue;
- if(readXMLInteger(configNode, "axePercent", intValue))
- outfit.skillsPercent[SKILL_AXE] += intValue;
- if(readXMLInteger(configNode, "distancePercent", intValue) || readXMLInteger(configNode, "distPercent", intValue))
- outfit.skillsPercent[SKILL_DIST] += intValue;
- if(readXMLInteger(configNode, "shieldingPercent", intValue) || readXMLInteger(configNode, "shieldPercent", intValue))
- outfit.skillsPercent[SKILL_SHIELD] = intValue;
- if(readXMLInteger(configNode, "fishingPercent", intValue) || readXMLInteger(configNode, "fishPercent", intValue))
- outfit.skillsPercent[SKILL_FISH] = intValue;
- if(readXMLInteger(configNode, "meleePercent", intValue))
- {
- outfit.skillsPercent[SKILL_FIST] += intValue;
- outfit.skillsPercent[SKILL_CLUB] += intValue;
- outfit.skillsPercent[SKILL_SWORD] += intValue;
- outfit.skillsPercent[SKILL_AXE] += intValue;
- }
- if(readXMLInteger(configNode, "weaponPercent", intValue) || readXMLInteger(configNode, "weaponsPercent", intValue))
- {
- outfit.skillsPercent[SKILL_CLUB] += intValue;
- outfit.skillsPercent[SKILL_SWORD] += intValue;
- outfit.skillsPercent[SKILL_AXE] += intValue;
- outfit.skillsPercent[SKILL_DIST] += intValue;
- }
- }
- else if(!xmlStrcmp(configNode->name, (const xmlChar*)"stats"))
- {
- if(readXMLInteger(configNode, "maxHealth", intValue))
- outfit.stats[STAT_MAXHEALTH] = intValue;
- if(readXMLInteger(configNode, "maxMana", intValue))
- outfit.stats[STAT_MAXMANA] = intValue;
- if(readXMLInteger(configNode, "soul", intValue))
- outfit.stats[STAT_SOUL] = intValue;
- if(readXMLInteger(configNode, "level", intValue))
- outfit.stats[STAT_LEVEL] = intValue;
- if(readXMLInteger(configNode, "magLevel", intValue) ||
- readXMLInteger(configNode, "magicLevel", intValue))
- outfit.stats[STAT_MAGICLEVEL] = intValue;
- if(readXMLInteger(configNode, "maxHealthPercent", intValue))
- outfit.statsPercent[STAT_MAXHEALTH] = intValue;
- if(readXMLInteger(configNode, "maxManaPercent", intValue))
- outfit.statsPercent[STAT_MAXMANA] = intValue;
- if(readXMLInteger(configNode, "soulPercent", intValue))
- outfit.statsPercent[STAT_SOUL] = intValue;
- if(readXMLInteger(configNode, "levelPercent", intValue))
- outfit.statsPercent[STAT_LEVEL] = intValue;
- if(readXMLInteger(configNode, "magLevelPercent", intValue) ||
- readXMLInteger(configNode, "magicLevelPercent", intValue))
- outfit.statsPercent[STAT_MAGICLEVEL] = intValue;
- }
- else if(!xmlStrcmp(configNode->name, (const xmlChar*)"suppress"))
- {
- if(readXMLString(configNode, "poison", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_POISON;
- if(readXMLString(configNode, "fire", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_FIRE;
- if(readXMLString(configNode, "energy", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_ENERGY;
- if(readXMLString(configNode, "physical", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_PHYSICAL;
- if(readXMLString(configNode, "haste", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_HASTE;
- if(readXMLString(configNode, "paralyze", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_PARALYZE;
- if(readXMLString(configNode, "outfit", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_OUTFIT;
- if(readXMLString(configNode, "invisible", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_INVISIBLE;
- if(readXMLString(configNode, "light", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_LIGHT;
- if(readXMLString(configNode, "manaShield", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_MANASHIELD;
- if(readXMLString(configNode, "infight", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_INFIGHT;
- if(readXMLString(configNode, "drunk", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_DRUNK;
- if(readXMLString(configNode, "exhaust", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_EXHAUST;
- if(readXMLString(configNode, "regeneration", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_REGENERATION;
- if(readXMLString(configNode, "soul", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_SOUL;
- if(readXMLString(configNode, "drown", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_DROWN;
- if(readXMLString(configNode, "muted", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_MUTED;
- if(readXMLString(configNode, "attributes", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_ATTRIBUTES;
- if(readXMLString(configNode, "freezing", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_FREEZING;
- if(readXMLString(configNode, "dazzled", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_DAZZLED;
- if(readXMLString(configNode, "cursed", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_CURSED;
- if(readXMLString(configNode, "pacified", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_PACIFIED;
- if(readXMLString(configNode, "gamemaster", strValue) && booleanString(strValue))
- outfit.conditionSuppressions |= CONDITION_GAMEMASTER;
- }
- }
Add Comment
Please, Sign In to add comment