Guest User

Untitled

a guest
May 16th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.28 KB | None | 0 0
  1. if(readXMLString(listNode, "manaShield", strValue))
  2. outfit.manaShield = booleanString(strValue);
  3.  
  4. if(readXMLString(listNode, "invisible", strValue))
  5. outfit.invisible = booleanString(strValue);
  6.  
  7. if(readXMLInteger(listNode, "healthGain", intValue))
  8. {
  9. outfit.healthGain = intValue;
  10. outfit.regeneration = true;
  11. }
  12.  
  13. if(readXMLInteger(listNode, "healthTicks", intValue))
  14. {
  15. outfit.healthTicks = intValue;
  16. outfit.regeneration = true;
  17. }
  18.  
  19. if(readXMLInteger(listNode, "manaGain", intValue))
  20. {
  21. outfit.manaGain = intValue;
  22. outfit.regeneration = true;
  23. }
  24.  
  25. if(readXMLInteger(listNode, "manaTicks", intValue))
  26. {
  27. outfit.manaTicks = intValue;
  28. outfit.regeneration = true;
  29. }
  30.  
  31. if(readXMLInteger(listNode, "speed", intValue))
  32. outfit.speed = intValue;
  33.  
  34. for(xmlNodePtr configNode = listNode->children; configNode != NULL; configNode = configNode->next)
  35. {
  36. if(!xmlStrcmp(configNode->name, (const xmlChar*)"reflect"))
  37. {
  38. if(readXMLInteger(configNode, "percentAll", intValue))
  39. {
  40. for(uint32_t i = COMBAT_FIRST; i <= COMBAT_LAST; i++)
  41. outfit.reflect[REFLECT_PERCENT][(CombatType_t)i] += intValue;
  42. }
  43.  
  44. if(readXMLInteger(configNode, "percentElements", intValue))
  45. {
  46. outfit.reflect[REFLECT_PERCENT][COMBAT_ENERGYDAMAGE] += intValue;
  47. outfit.reflect[REFLECT_PERCENT][COMBAT_FIREDAMAGE] += intValue;
  48. outfit.reflect[REFLECT_PERCENT][COMBAT_EARTHDAMAGE] += intValue;
  49. outfit.reflect[REFLECT_PERCENT][COMBAT_ICEDAMAGE] += intValue;
  50. }
  51.  
  52. if(readXMLInteger(configNode, "percentMagic", intValue))
  53. {
  54. outfit.reflect[REFLECT_PERCENT][COMBAT_ENERGYDAMAGE] += intValue;
  55. outfit.reflect[REFLECT_PERCENT][COMBAT_FIREDAMAGE] += intValue;
  56. outfit.reflect[REFLECT_PERCENT][COMBAT_EARTHDAMAGE] += intValue;
  57. outfit.reflect[REFLECT_PERCENT][COMBAT_ICEDAMAGE] += intValue;
  58. outfit.reflect[REFLECT_PERCENT][COMBAT_HOLYDAMAGE] += intValue;
  59. outfit.reflect[REFLECT_PERCENT][COMBAT_DEATHDAMAGE] += intValue;
  60. }
  61.  
  62. if(readXMLInteger(configNode, "percentEnergy", intValue))
  63. outfit.reflect[REFLECT_PERCENT][COMBAT_ENERGYDAMAGE] += intValue;
  64.  
  65. if(readXMLInteger(configNode, "percentFire", intValue))
  66. outfit.reflect[REFLECT_PERCENT][COMBAT_FIREDAMAGE] += intValue;
  67.  
  68. if(readXMLInteger(configNode, "percentPoison", intValue) || readXMLInteger(configNode, "percentEarth", intValue))
  69. outfit.reflect[REFLECT_PERCENT][COMBAT_EARTHDAMAGE] += intValue;
  70.  
  71. if(readXMLInteger(configNode, "percentIce", intValue))
  72. outfit.reflect[REFLECT_PERCENT][COMBAT_ICEDAMAGE] += intValue;
  73.  
  74. if(readXMLInteger(configNode, "percentHoly", intValue))
  75. outfit.reflect[REFLECT_PERCENT][COMBAT_HOLYDAMAGE] += intValue;
  76.  
  77. if(readXMLInteger(configNode, "percentDeath", intValue))
  78. outfit.reflect[REFLECT_PERCENT][COMBAT_DEATHDAMAGE] += intValue;
  79.  
  80. if(readXMLInteger(configNode, "percentLifeDrain", intValue))
  81. outfit.reflect[REFLECT_PERCENT][COMBAT_LIFEDRAIN] += intValue;
  82.  
  83. if(readXMLInteger(configNode, "percentManaDrain", intValue))
  84. outfit.reflect[REFLECT_PERCENT][COMBAT_MANADRAIN] += intValue;
  85.  
  86. if(readXMLInteger(configNode, "percentDrown", intValue))
  87. outfit.reflect[REFLECT_PERCENT][COMBAT_DROWNDAMAGE] += intValue;
  88.  
  89. if(readXMLInteger(configNode, "percentPhysical", intValue))
  90. outfit.reflect[REFLECT_PERCENT][COMBAT_PHYSICALDAMAGE] += intValue;
  91.  
  92. if(readXMLInteger(configNode, "percentHealing", intValue))
  93. outfit.reflect[REFLECT_PERCENT][COMBAT_HEALING] += intValue;
  94.  
  95. if(readXMLInteger(configNode, "percentUndefined", intValue))
  96. outfit.reflect[REFLECT_PERCENT][COMBAT_UNDEFINEDDAMAGE] += intValue;
  97.  
  98. if(readXMLInteger(configNode, "chanceAll", intValue))
  99. {
  100. for(uint32_t i = COMBAT_FIRST; i <= COMBAT_LAST; i++)
  101. outfit.reflect[REFLECT_CHANCE][(CombatType_t)i] += intValue;
  102. }
  103.  
  104. if(readXMLInteger(configNode, "chanceElements", intValue))
  105. {
  106. outfit.reflect[REFLECT_CHANCE][COMBAT_ENERGYDAMAGE] += intValue;
  107. outfit.reflect[REFLECT_CHANCE][COMBAT_FIREDAMAGE] += intValue;
  108. outfit.reflect[REFLECT_CHANCE][COMBAT_EARTHDAMAGE] += intValue;
  109. outfit.reflect[REFLECT_CHANCE][COMBAT_ICEDAMAGE] += intValue;
  110. }
  111.  
  112. if(readXMLInteger(configNode, "chanceMagic", intValue))
  113. {
  114. outfit.reflect[REFLECT_CHANCE][COMBAT_ENERGYDAMAGE] += intValue;
  115. outfit.reflect[REFLECT_CHANCE][COMBAT_FIREDAMAGE] += intValue;
  116. outfit.reflect[REFLECT_CHANCE][COMBAT_EARTHDAMAGE] += intValue;
  117. outfit.reflect[REFLECT_CHANCE][COMBAT_ICEDAMAGE] += intValue;
  118. outfit.reflect[REFLECT_CHANCE][COMBAT_HOLYDAMAGE] += intValue;
  119. outfit.reflect[REFLECT_CHANCE][COMBAT_DEATHDAMAGE] += intValue;
  120. }
  121.  
  122. if(readXMLInteger(configNode, "chanceEnergy", intValue))
  123. outfit.reflect[REFLECT_CHANCE][COMBAT_ENERGYDAMAGE] += intValue;
  124.  
  125. if(readXMLInteger(configNode, "chanceFire", intValue))
  126. outfit.reflect[REFLECT_CHANCE][COMBAT_FIREDAMAGE] += intValue;
  127.  
  128. if(readXMLInteger(configNode, "chancePoison", intValue) || readXMLInteger(configNode, "chanceEarth", intValue))
  129. outfit.reflect[REFLECT_CHANCE][COMBAT_EARTHDAMAGE] += intValue;
  130.  
  131. if(readXMLInteger(configNode, "chanceIce", intValue))
  132. outfit.reflect[REFLECT_CHANCE][COMBAT_ICEDAMAGE] += intValue;
  133.  
  134. if(readXMLInteger(configNode, "chanceHoly", intValue))
  135. outfit.reflect[REFLECT_CHANCE][COMBAT_HOLYDAMAGE] += intValue;
  136.  
  137. if(readXMLInteger(configNode, "chanceDeath", intValue))
  138. outfit.reflect[REFLECT_CHANCE][COMBAT_DEATHDAMAGE] += intValue;
  139.  
  140. if(readXMLInteger(configNode, "chanceLifeDrain", intValue))
  141. outfit.reflect[REFLECT_CHANCE][COMBAT_LIFEDRAIN] += intValue;
  142.  
  143. if(readXMLInteger(configNode, "chanceManaDrain", intValue))
  144. outfit.reflect[REFLECT_CHANCE][COMBAT_MANADRAIN] += intValue;
  145.  
  146. if(readXMLInteger(configNode, "chanceDrown", intValue))
  147. outfit.reflect[REFLECT_CHANCE][COMBAT_DROWNDAMAGE] += intValue;
  148.  
  149. if(readXMLInteger(configNode, "chancePhysical", intValue))
  150. outfit.reflect[REFLECT_CHANCE][COMBAT_PHYSICALDAMAGE] += intValue;
  151.  
  152. if(readXMLInteger(configNode, "chanceHealing", intValue))
  153. outfit.reflect[REFLECT_CHANCE][COMBAT_HEALING] += intValue;
  154.  
  155. if(readXMLInteger(configNode, "chanceUndefined", intValue))
  156. outfit.reflect[REFLECT_CHANCE][COMBAT_UNDEFINEDDAMAGE] += intValue;
  157. }
  158. else if(!xmlStrcmp(configNode->name, (const xmlChar*)"absorb"))
  159. {
  160. if(readXMLInteger(configNode, "percentAll", intValue))
  161. {
  162. for(int32_t i = COMBAT_FIRST; i <= COMBAT_LAST; i++)
  163. outfit.absorb[(CombatType_t)i] += intValue;
  164. }
  165.  
  166. if(readXMLInteger(configNode, "percentElements", intValue))
  167. {
  168. outfit.absorb[COMBAT_ENERGYDAMAGE] += intValue;
  169. outfit.absorb[COMBAT_FIREDAMAGE] += intValue;
  170. outfit.absorb[COMBAT_EARTHDAMAGE] += intValue;
  171. outfit.absorb[COMBAT_ICEDAMAGE] += intValue;
  172. }
  173.  
  174. if(readXMLInteger(configNode, "percentMagic", intValue))
  175. {
  176. outfit.absorb[COMBAT_ENERGYDAMAGE] += intValue;
  177. outfit.absorb[COMBAT_FIREDAMAGE] += intValue;
  178. outfit.absorb[COMBAT_EARTHDAMAGE] += intValue;
  179. outfit.absorb[COMBAT_ICEDAMAGE] += intValue;
  180. outfit.absorb[COMBAT_HOLYDAMAGE] += intValue;
  181. outfit.absorb[COMBAT_DEATHDAMAGE] += intValue;
  182. }
  183.  
  184. if(readXMLInteger(configNode, "percentEnergy", intValue))
  185. outfit.absorb[COMBAT_ENERGYDAMAGE] += intValue;
  186.  
  187. if(readXMLInteger(configNode, "percentFire", intValue))
  188. outfit.absorb[COMBAT_FIREDAMAGE] += intValue;
  189.  
  190. if(readXMLInteger(configNode, "percentPoison", intValue) || readXMLInteger(configNode, "percentEarth", intValue))
  191. outfit.absorb[COMBAT_EARTHDAMAGE] += intValue;
  192.  
  193. if(readXMLInteger(configNode, "percentIce", intValue))
  194. outfit.absorb[COMBAT_ICEDAMAGE] += intValue;
  195.  
  196. if(readXMLInteger(configNode, "percentHoly", intValue))
  197. outfit.absorb[COMBAT_HOLYDAMAGE] += intValue;
  198.  
  199. if(readXMLInteger(configNode, "percentDeath", intValue))
  200. outfit.absorb[COMBAT_DEATHDAMAGE] += intValue;
  201.  
  202. if(readXMLInteger(configNode, "percentLifeDrain", intValue))
  203. outfit.absorb[COMBAT_LIFEDRAIN] += intValue;
  204.  
  205. if(readXMLInteger(configNode, "percentManaDrain", intValue))
  206. outfit.absorb[COMBAT_MANADRAIN] += intValue;
  207.  
  208. if(readXMLInteger(configNode, "percentDrown", intValue))
  209. outfit.absorb[COMBAT_DROWNDAMAGE] += intValue;
  210.  
  211. if(readXMLInteger(configNode, "percentPhysical", intValue))
  212. outfit.absorb[COMBAT_PHYSICALDAMAGE] += intValue;
  213.  
  214. if(readXMLInteger(configNode, "percentHealing", intValue))
  215. outfit.absorb[COMBAT_HEALING] += intValue;
  216.  
  217. if(readXMLInteger(configNode, "percentUndefined", intValue))
  218. outfit.absorb[COMBAT_UNDEFINEDDAMAGE] += intValue;
  219. }
  220. else if(!xmlStrcmp(configNode->name, (const xmlChar*)"skills"))
  221. {
  222. if(readXMLInteger(configNode, "fist", intValue))
  223. outfit.skills[SKILL_FIST] += intValue;
  224.  
  225. if(readXMLInteger(configNode, "club", intValue))
  226. outfit.skills[SKILL_CLUB] += intValue;
  227.  
  228. if(readXMLInteger(configNode, "axe", intValue))
  229. outfit.skills[SKILL_AXE] += intValue;
  230.  
  231. if(readXMLInteger(configNode, "sword", intValue))
  232. outfit.skills[SKILL_SWORD] += intValue;
  233.  
  234. if(readXMLInteger(configNode, "distance", intValue) || readXMLInteger(configNode, "dist", intValue))
  235. outfit.skills[SKILL_DIST] += intValue;
  236.  
  237. if(readXMLInteger(configNode, "shielding", intValue) || readXMLInteger(configNode, "shield", intValue))
  238. outfit.skills[SKILL_SHIELD] = intValue;
  239.  
  240. if(readXMLInteger(configNode, "fishing", intValue) || readXMLInteger(configNode, "fish", intValue))
  241. outfit.skills[SKILL_FISH] = intValue;
  242.  
  243. if(readXMLInteger(configNode, "melee", intValue))
  244. {
  245. outfit.skills[SKILL_FIST] += intValue;
  246. outfit.skills[SKILL_CLUB] += intValue;
  247. outfit.skills[SKILL_SWORD] += intValue;
  248. outfit.skills[SKILL_AXE] += intValue;
  249. }
  250.  
  251. if(readXMLInteger(configNode, "weapon", intValue) || readXMLInteger(configNode, "weapons", intValue))
  252. {
  253. outfit.skills[SKILL_CLUB] += intValue;
  254. outfit.skills[SKILL_SWORD] += intValue;
  255. outfit.skills[SKILL_AXE] += intValue;
  256. outfit.skills[SKILL_DIST] += intValue;
  257. }
  258.  
  259. if(readXMLInteger(configNode, "fistPercent", intValue))
  260. outfit.skillsPercent[SKILL_FIST] += intValue;
  261.  
  262. if(readXMLInteger(configNode, "clubPercent", intValue))
  263. outfit.skillsPercent[SKILL_CLUB] += intValue;
  264.  
  265. if(readXMLInteger(configNode, "swordPercent", intValue))
  266. outfit.skillsPercent[SKILL_SWORD] += intValue;
  267.  
  268. if(readXMLInteger(configNode, "axePercent", intValue))
  269. outfit.skillsPercent[SKILL_AXE] += intValue;
  270.  
  271. if(readXMLInteger(configNode, "distancePercent", intValue) || readXMLInteger(configNode, "distPercent", intValue))
  272. outfit.skillsPercent[SKILL_DIST] += intValue;
  273.  
  274. if(readXMLInteger(configNode, "shieldingPercent", intValue) || readXMLInteger(configNode, "shieldPercent", intValue))
  275. outfit.skillsPercent[SKILL_SHIELD] = intValue;
  276.  
  277. if(readXMLInteger(configNode, "fishingPercent", intValue) || readXMLInteger(configNode, "fishPercent", intValue))
  278. outfit.skillsPercent[SKILL_FISH] = intValue;
  279.  
  280. if(readXMLInteger(configNode, "meleePercent", intValue))
  281. {
  282. outfit.skillsPercent[SKILL_FIST] += intValue;
  283. outfit.skillsPercent[SKILL_CLUB] += intValue;
  284. outfit.skillsPercent[SKILL_SWORD] += intValue;
  285. outfit.skillsPercent[SKILL_AXE] += intValue;
  286. }
  287.  
  288. if(readXMLInteger(configNode, "weaponPercent", intValue) || readXMLInteger(configNode, "weaponsPercent", intValue))
  289. {
  290. outfit.skillsPercent[SKILL_CLUB] += intValue;
  291. outfit.skillsPercent[SKILL_SWORD] += intValue;
  292. outfit.skillsPercent[SKILL_AXE] += intValue;
  293. outfit.skillsPercent[SKILL_DIST] += intValue;
  294. }
  295. }
  296. else if(!xmlStrcmp(configNode->name, (const xmlChar*)"stats"))
  297. {
  298. if(readXMLInteger(configNode, "maxHealth", intValue))
  299. outfit.stats[STAT_MAXHEALTH] = intValue;
  300.  
  301. if(readXMLInteger(configNode, "maxMana", intValue))
  302. outfit.stats[STAT_MAXMANA] = intValue;
  303.  
  304. if(readXMLInteger(configNode, "soul", intValue))
  305. outfit.stats[STAT_SOUL] = intValue;
  306.  
  307. if(readXMLInteger(configNode, "level", intValue))
  308. outfit.stats[STAT_LEVEL] = intValue;
  309.  
  310. if(readXMLInteger(configNode, "magLevel", intValue) ||
  311. readXMLInteger(configNode, "magicLevel", intValue))
  312. outfit.stats[STAT_MAGICLEVEL] = intValue;
  313.  
  314. if(readXMLInteger(configNode, "maxHealthPercent", intValue))
  315. outfit.statsPercent[STAT_MAXHEALTH] = intValue;
  316.  
  317. if(readXMLInteger(configNode, "maxManaPercent", intValue))
  318. outfit.statsPercent[STAT_MAXMANA] = intValue;
  319.  
  320. if(readXMLInteger(configNode, "soulPercent", intValue))
  321. outfit.statsPercent[STAT_SOUL] = intValue;
  322.  
  323. if(readXMLInteger(configNode, "levelPercent", intValue))
  324. outfit.statsPercent[STAT_LEVEL] = intValue;
  325.  
  326. if(readXMLInteger(configNode, "magLevelPercent", intValue) ||
  327. readXMLInteger(configNode, "magicLevelPercent", intValue))
  328. outfit.statsPercent[STAT_MAGICLEVEL] = intValue;
  329. }
  330. else if(!xmlStrcmp(configNode->name, (const xmlChar*)"suppress"))
  331. {
  332. if(readXMLString(configNode, "poison", strValue) && booleanString(strValue))
  333. outfit.conditionSuppressions |= CONDITION_POISON;
  334.  
  335. if(readXMLString(configNode, "fire", strValue) && booleanString(strValue))
  336. outfit.conditionSuppressions |= CONDITION_FIRE;
  337.  
  338. if(readXMLString(configNode, "energy", strValue) && booleanString(strValue))
  339. outfit.conditionSuppressions |= CONDITION_ENERGY;
  340.  
  341. if(readXMLString(configNode, "physical", strValue) && booleanString(strValue))
  342. outfit.conditionSuppressions |= CONDITION_PHYSICAL;
  343.  
  344. if(readXMLString(configNode, "haste", strValue) && booleanString(strValue))
  345. outfit.conditionSuppressions |= CONDITION_HASTE;
  346.  
  347. if(readXMLString(configNode, "paralyze", strValue) && booleanString(strValue))
  348. outfit.conditionSuppressions |= CONDITION_PARALYZE;
  349.  
  350. if(readXMLString(configNode, "outfit", strValue) && booleanString(strValue))
  351. outfit.conditionSuppressions |= CONDITION_OUTFIT;
  352.  
  353. if(readXMLString(configNode, "invisible", strValue) && booleanString(strValue))
  354. outfit.conditionSuppressions |= CONDITION_INVISIBLE;
  355.  
  356. if(readXMLString(configNode, "light", strValue) && booleanString(strValue))
  357. outfit.conditionSuppressions |= CONDITION_LIGHT;
  358.  
  359. if(readXMLString(configNode, "manaShield", strValue) && booleanString(strValue))
  360. outfit.conditionSuppressions |= CONDITION_MANASHIELD;
  361.  
  362. if(readXMLString(configNode, "infight", strValue) && booleanString(strValue))
  363. outfit.conditionSuppressions |= CONDITION_INFIGHT;
  364.  
  365. if(readXMLString(configNode, "drunk", strValue) && booleanString(strValue))
  366. outfit.conditionSuppressions |= CONDITION_DRUNK;
  367.  
  368. if(readXMLString(configNode, "exhaust", strValue) && booleanString(strValue))
  369. outfit.conditionSuppressions |= CONDITION_EXHAUST;
  370.  
  371. if(readXMLString(configNode, "regeneration", strValue) && booleanString(strValue))
  372. outfit.conditionSuppressions |= CONDITION_REGENERATION;
  373.  
  374. if(readXMLString(configNode, "soul", strValue) && booleanString(strValue))
  375. outfit.conditionSuppressions |= CONDITION_SOUL;
  376.  
  377. if(readXMLString(configNode, "drown", strValue) && booleanString(strValue))
  378. outfit.conditionSuppressions |= CONDITION_DROWN;
  379.  
  380. if(readXMLString(configNode, "muted", strValue) && booleanString(strValue))
  381. outfit.conditionSuppressions |= CONDITION_MUTED;
  382.  
  383. if(readXMLString(configNode, "attributes", strValue) && booleanString(strValue))
  384. outfit.conditionSuppressions |= CONDITION_ATTRIBUTES;
  385.  
  386. if(readXMLString(configNode, "freezing", strValue) && booleanString(strValue))
  387. outfit.conditionSuppressions |= CONDITION_FREEZING;
  388.  
  389. if(readXMLString(configNode, "dazzled", strValue) && booleanString(strValue))
  390. outfit.conditionSuppressions |= CONDITION_DAZZLED;
  391.  
  392. if(readXMLString(configNode, "cursed", strValue) && booleanString(strValue))
  393. outfit.conditionSuppressions |= CONDITION_CURSED;
  394.  
  395. if(readXMLString(configNode, "pacified", strValue) && booleanString(strValue))
  396. outfit.conditionSuppressions |= CONDITION_PACIFIED;
  397.  
  398. if(readXMLString(configNode, "gamemaster", strValue) && booleanString(strValue))
  399. outfit.conditionSuppressions |= CONDITION_GAMEMASTER;
  400. }
  401. }
Add Comment
Please, Sign In to add comment