Guest User

Untitled

a guest
Oct 24th, 2016
105
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <math.h>
  2. #include "ItemCSVReader.h"
  3.  
  4.  
  5. using namespace std;
  6.  
  7. inline string trim_left(const string& str)
  8. {
  9. string::size_type n = str.find_first_not_of(" \t\v\n\r");
  10. return n == string::npos ? str : str.substr(n, str.length());
  11. }
  12.  
  13. inline string trim_right(const string& str)
  14. {
  15. string::size_type n = str.find_last_not_of(" \t\v\n\r");
  16. return n == string::npos ? str : str.substr(0, n + 1);
  17. }
  18.  
  19. string trim(const string& str){return trim_left(trim_right(str));}
  20.  
  21. static string* StringSplit(string strOrigin, string strTok)
  22. {
  23. int cutAt;
  24. int index = 0;
  25. string* strResult = new string[30];
  26. while ((cutAt = strOrigin.find_first_of(strTok)) != strOrigin.npos)
  27. {
  28. if (cutAt > 0)
  29. {
  30. strResult[index++] = strOrigin.substr(0, cutAt);
  31. }
  32. strOrigin = strOrigin.substr(cutAt+1);
  33. }
  34.  
  35. if(strOrigin.length() > 0)
  36. {
  37. strResult[index++] = strOrigin.substr(0, cutAt);
  38. }
  39.  
  40. for( int i=0;i<index;i++)
  41. {
  42. strResult[i] = trim(strResult[i]);
  43. }
  44.  
  45. return strResult;
  46. }
  47.  
  48.  
  49.  
  50. int get_Item_Type_Value(string inputString)
  51. {
  52. string arType[] = {"ITEM_NONE", "ITEM_WEAPON",
  53. "ITEM_ARMOR", "ITEM_USE",
  54. "ITEM_AUTOUSE", "ITEM_MATERIAL",
  55. "ITEM_SPECIAL", "ITEM_TOOL",
  56. "ITEM_LOTTERY", "ITEM_ELK",
  57.  
  58. "ITEM_METIN", "ITEM_CONTAINER",
  59. "ITEM_FISH", "ITEM_ROD",
  60. "ITEM_RESOURCE", "ITEM_CAMPFIRE",
  61. "ITEM_UNIQUE", "ITEM_SKILLBOOK",
  62. "ITEM_QUEST", "ITEM_POLYMORPH",
  63.  
  64. "ITEM_TREASURE_BOX", "ITEM_TREASURE_KEY",
  65. "ITEM_SKILLFORGET", "ITEM_GIFTBOX",
  66. "ITEM_PICK", "ITEM_HAIR",
  67. "ITEM_TOTEM", "ITEM_BLEND",
  68. "ITEM_COSTUME", "ITEM_DS",
  69.  
  70. "ITEM_SPECIAL_DS", "ITEM_EXTRACT",
  71. "ITEM_SECONDARY_COIN",
  72.  
  73. "ITEM_RING",
  74. "ITEM_BELT",
  75. };
  76.  
  77.  
  78. int retInt = -1;
  79. for (int j=0;j<sizeof(arType)/sizeof(arType[0]);j++) {
  80. string tempString = arType[j];
  81. if (inputString.find(tempString)!=string::npos && tempString.find(inputString)!=string::npos) {
  82. //cout << j << " ";
  83. retInt = j;
  84. break;
  85. }
  86. }
  87. //cout << endl;
  88.  
  89. return retInt;
  90.  
  91. }
  92.  
  93. int get_Item_SubType_Value(int type_value, string inputString)
  94. {
  95. static string arSub1[] = { "WEAPON_SWORD", "WEAPON_DAGGER", "WEAPON_BOW", "WEAPON_TWO_HANDED", "WEAPON_BELL", "WEAPON_FAN", "WEAPON_ARROW", "WEAPON_MOUNT_SPEAR", "WEAPON_CLAW" };
  96. static string arSub2[] = { "ARMOR_BODY", "ARMOR_HEAD", "ARMOR_SHIELD", "ARMOR_WRIST", "ARMOR_FOOTS", "ARMOR_NECK", "ARMOR_EAR", "ARMOR_NUM_TYPES" };
  97. static string arSub3[] = { "USE_POTION", "USE_TALISMAN", "USE_TUNING", "USE_MOVE", "USE_TREASURE_BOX", "USE_MONEYBAG", "USE_BAIT", "USE_ABILITY_UP", "USE_AFFECT", "USE_CREATE_STONE", "USE_SPECIAL", "USE_POTION_NODELAY", "USE_CLEAR", "USE_INVISIBILITY", "USE_DETACHMENT", "USE_BUCKET", "USE_POTION_CONTINUE", "USE_CLEAN_SOCKET", "USE_CHANGE_ATTRIBUTE", "USE_ADD_ATTRIBUTE", "USE_ADD_ACCESSORY_SOCKET", "USE_PUT_INTO_ACCESSORY_SOCKET", "USE_ADD_ATTRIBUTE2", "USE_RECIPE", "USE_CHANGE_ATTRIBUTE2", "USE_BIND", "USE_UNBIND", "USE_TIME_CHARGE_PER", "USE_TIME_CHARGE_FIX", "USE_PUT_INTO_BELT_SOCKET", "USE_PUT_INTO_RING_SOCKET" };
  98. static string arSub4[] = { "AUTOUSE_POTION", "AUTOUSE_ABILITY_UP", "AUTOUSE_BOMB", "AUTOUSE_GOLD", "AUTOUSE_MONEYBAG", "AUTOUSE_TREASURE_BOX" };
  99. static string arSub5[] = { "MATERIAL_LEATHER", "MATERIAL_BLOOD", "MATERIAL_ROOT", "MATERIAL_NEEDLE", "MATERIAL_JEWEL", "MATERIAL_DS_REFINE_NORMAL", "MATERIAL_DS_REFINE_BLESSED", "MATERIAL_DS_REFINE_HOLLY" };
  100. static string arSub6[] = { "SPECIAL_MAP", "SPECIAL_KEY", "SPECIAL_DOC", "SPECIAL_SPIRIT" };
  101. static string arSub7[] = { "TOOL_FISHING_ROD" };
  102. static string arSub8[] = { "LOTTERY_TICKET", "LOTTERY_INSTANT" };
  103. static string arSub10[] = { "METIN_NORMAL", "METIN_GOLD" };
  104. static string arSub12[] = { "FISH_ALIVE", "FISH_DEAD" };
  105. static string arSub14[] = { "RESOURCE_FISHBONE", "RESOURCE_WATERSTONEPIECE", "RESOURCE_WATERSTONE", "RESOURCE_BLOOD_PEARL", "RESOURCE_BLUE_PEARL", "RESOURCE_WHITE_PEARL", "RESOURCE_BUCKET", "RESOURCE_CRYSTAL", "RESOURCE_GEM", "RESOURCE_STONE", "RESOURCE_METIN", "RESOURCE_ORE" };
  106. static string arSub16[] = { "UNIQUE_NONE", "UNIQUE_BOOK", "UNIQUE_SPECIAL_RIDE", "UNIQUE_3", "UNIQUE_4", "UNIQUE_5", "UNIQUE_6", "UNIQUE_7", "UNIQUE_8", "UNIQUE_9", "USE_SPECIAL" };
  107. static string arSub28[] = { "COSTUME_BODY", "COSTUME_HAIR" };
  108. static string arSub29[] = { "DS_SLOT1", "DS_SLOT2", "DS_SLOT3", "DS_SLOT4", "DS_SLOT5", "DS_SLOT6" };
  109. static string arSub31[] = { "EXTRACT_DRAGON_SOUL", "EXTRACT_DRAGON_HEART" };
  110.  
  111. static string* arSubType[] = {0, //0
  112. arSub1, //1
  113. arSub2, //2
  114. arSub3, //3
  115. arSub4, //4
  116. arSub5, //5
  117. arSub6, //6
  118. arSub7, //7
  119. arSub8, //8
  120. 0, //9
  121. arSub10, //10
  122. 0, //11
  123. arSub12, //12
  124. 0, //13
  125. arSub14, //14
  126. 0, //15
  127. arSub16, //16
  128. 0, //17
  129. 0, //18
  130. 0, //19
  131. 0, //20
  132. 0, //21
  133. 0, //22
  134. 0, //23
  135. 0, //24
  136. 0, //25
  137. 0, //26
  138. 0, //27
  139. arSub28, //28
  140. arSub29, //29
  141. arSub29, //30
  142. arSub31, //31
  143. 0, //32
  144. };
  145. static int arNumberOfSubtype[33] = {
  146. 0,
  147. sizeof(arSub1)/sizeof(arSub1[0]),
  148. sizeof(arSub2)/sizeof(arSub2[0]),
  149. sizeof(arSub3)/sizeof(arSub3[0]),
  150. sizeof(arSub4)/sizeof(arSub4[0]),
  151. sizeof(arSub5)/sizeof(arSub5[0]),
  152. sizeof(arSub6)/sizeof(arSub6[0]),
  153. sizeof(arSub7)/sizeof(arSub7[0]),
  154. sizeof(arSub8)/sizeof(arSub8[0]),
  155. 0,
  156. sizeof(arSub10)/sizeof(arSub10[0]),
  157. 0,
  158. sizeof(arSub12)/sizeof(arSub12[0]),
  159. 0,
  160. sizeof(arSub14)/sizeof(arSub14[0]),
  161. 0,
  162. sizeof(arSub16)/sizeof(arSub16[0]),
  163. 0,
  164. 0,
  165. 0,
  166. 0,
  167. 0,
  168. 0,
  169. 0,
  170. 0,
  171. 0,
  172. 0,
  173. 0,
  174. sizeof(arSub28)/sizeof(arSub28[0]),
  175. sizeof(arSub29)/sizeof(arSub29[0]),
  176. sizeof(arSub29)/sizeof(arSub29[0]),
  177. sizeof(arSub31)/sizeof(arSub31[0]),
  178. 0, // 32
  179. };
  180. if (arSubType[type_value]==0) {
  181. return 0;
  182. }
  183. int retInt = -1;
  184. for (int j=0;j<arNumberOfSubtype[type_value];j++) {
  185. string tempString = arSubType[type_value][j];
  186. string tempInputString = trim(inputString);
  187. if (tempInputString.compare(tempString)==0)
  188. {
  189. retInt = j;
  190. break;
  191. }
  192. }
  193. return retInt;
  194. }
  195.  
  196. int get_Item_AntiFlag_Value(string inputString)
  197. {
  198. string arAntiFlag[] = {
  199. "ANTI_FEMALE",
  200. "ANTI_MALE",
  201. "ANTI_MUSA",
  202. "ANTI_ASSASSIN",
  203. "ANTI_SURA",
  204. "ANTI_MUDANG",
  205. "ANTI_GET",
  206. "ANTI_DROP",
  207. "ANTI_SELL",
  208. "ANTI_EMPIRE_A",
  209. "ANTI_EMPIRE_B",
  210. "ANTI_EMPIRE_C",
  211. "ANTI_SAVE",
  212. "ANTI_GIVE",
  213. "ANTI_PKDROP",
  214. "ANTI_STACK",
  215. "ANTI_MYSHOP",
  216. "ANTI_SAFEBOX",
  217. "ANTI_WOLFMAN"
  218. };
  219. int retValue = 0;
  220. string* arInputString = StringSplit(inputString, "|");
  221. for(int i =0;i<sizeof(arAntiFlag)/sizeof(arAntiFlag[0]);i++) {
  222. string tempString = arAntiFlag[i];
  223. for (int j=0; j<30 ; j++)
  224. {
  225. string tempString2 = arInputString[j];
  226. if (tempString2.compare(tempString)==0) {
  227. retValue = retValue + pow((float)2,(float)i);
  228. }
  229.  
  230. if(tempString2.compare("") == 0)
  231. break;
  232. }
  233. }
  234. delete []arInputString;
  235. return retValue;
  236. }
  237.  
  238. int get_Item_Flag_Value(string inputString)
  239. {
  240. string arFlag[] = {"ITEM_TUNABLE", "ITEM_SAVE", "ITEM_STACKABLE", "COUNT_PER_1GOLD", "ITEM_SLOW_QUERY", "ITEM_UNIQUE", "ITEM_MAKECOUNT", "ITEM_IRREMOVABLE", "CONFIRM_WHEN_USE", "QUEST_USE", "QUEST_USE_MULTIPLE", "QUEST_GIVE", "ITEM_QUEST", "LOG", "STACKABLE", "SLOW_QUERY", "REFINEABLE", "IRREMOVABLE", "ITEM_APPLICABLE"};
  241. int retValue = 0;
  242. string* arInputString = StringSplit(inputString, "|");
  243. for(int i =0;i<sizeof(arFlag)/sizeof(arFlag[0]);i++) {
  244. string tempString = arFlag[i];
  245. for (int j=0; j<30 ; j++)
  246. {
  247. string tempString2 = arInputString[j];
  248. if (tempString2.compare(tempString)==0) {
  249. retValue = retValue + pow((float)2,(float)i);
  250. }
  251.  
  252. if(tempString2.compare("") == 0)
  253. break;
  254. }
  255. }
  256. delete []arInputString;
  257. return retValue;
  258. }
  259.  
  260. int get_Item_WearFlag_Value(string inputString)
  261. {
  262. string arWearrFlag[] = {"WEAR_BODY", "WEAR_HEAD", "WEAR_FOOTS", "WEAR_WRIST", "WEAR_WEAPON", "WEAR_NECK", "WEAR_EAR", "WEAR_SHIELD", "WEAR_UNIQUE", "WEAR_ARROW", "WEAR_HAIR", "WEAR_ABILITY"};
  263. int retValue = 0;
  264. string* arInputString = StringSplit(inputString, "|");
  265. for(int i =0;i<sizeof(arWearrFlag)/sizeof(arWearrFlag[0]);i++) {
  266. string tempString = arWearrFlag[i];
  267. for (int j=0; j<30 ; j++)
  268. {
  269. string tempString2 = arInputString[j];
  270. if (tempString2.compare(tempString)==0) {
  271. retValue = retValue + pow((float)2,(float)i);
  272. }
  273.  
  274. if(tempString2.compare("") == 0)
  275. break;
  276. }
  277. }
  278. delete []arInputString;
  279. return retValue;
  280. }
  281.  
  282. int get_Item_Immune_Value(string inputString)
  283. {
  284.  
  285. string arImmune[] = {"PARA","CURSE","STUN","SLEEP","SLOW","POISON","TERROR"};
  286.  
  287. int retValue = 0;
  288. string* arInputString = StringSplit(inputString, "|");
  289. for(int i =0;i<sizeof(arImmune)/sizeof(arImmune[0]);i++) {
  290. string tempString = arImmune[i];
  291. for (int j=0; j<30 ; j++)
  292. {
  293. string tempString2 = arInputString[j];
  294. if (tempString2.compare(tempString)==0) {
  295. retValue = retValue + pow((float)2,(float)i);
  296. }
  297.  
  298. if(tempString2.compare("") == 0)
  299. break;
  300. }
  301. }
  302. delete []arInputString;
  303. return retValue;
  304. }
  305.  
  306.  
  307.  
  308.  
  309. int get_Item_LimitType_Value(string inputString)
  310. {
  311. string arLimitType[] = {"LIMIT_NONE", "LEVEL", "STR", "DEX", "INT", "CON", "PC_BANG", "REAL_TIME", "REAL_TIME_FIRST_USE", "TIMER_BASED_ON_WEAR"};
  312.  
  313. int retInt = -1;
  314. for (int j=0;j<sizeof(arLimitType)/sizeof(arLimitType[0]);j++) {
  315. string tempString = arLimitType[j];
  316. string tempInputString = trim(inputString);
  317. if (tempInputString.compare(tempString)==0)
  318. {
  319. //cout << j << " ";
  320. retInt = j;
  321. break;
  322. }
  323. }
  324. //cout << endl;
  325.  
  326. return retInt;
  327. }
  328.  
  329.  
  330. int get_Item_ApplyType_Value(string inputString)
  331. {
  332. string arApplyType[] = { "APPLY_NONE", "APPLY_MAX_HP", "APPLY_MAX_SP", "APPLY_CON", "APPLY_INT", "APPLY_STR", "APPLY_DEX", "APPLY_ATT_SPEED",
  333. "APPLY_MOV_SPEED", "APPLY_CAST_SPEED", "APPLY_HP_REGEN", "APPLY_SP_REGEN", "APPLY_POISON_PCT", "APPLY_STUN_PCT",
  334. "APPLY_SLOW_PCT", "APPLY_CRITICAL_PCT", "APPLY_PENETRATE_PCT", "APPLY_ATTBONUS_HUMAN", "APPLY_ATTBONUS_ANIMAL",
  335. "APPLY_ATTBONUS_ORC", "APPLY_ATTBONUS_MILGYO", "APPLY_ATTBONUS_UNDEAD", "APPLY_ATTBONUS_DEVIL", "APPLY_STEAL_HP",
  336. "APPLY_STEAL_SP", "APPLY_MANA_BURN_PCT", "APPLY_DAMAGE_SP_RECOVER", "APPLY_BLOCK", "APPLY_DODGE", "APPLY_RESIST_SWORD",
  337. "APPLY_RESIST_TWOHAND", "APPLY_RESIST_DAGGER", "APPLY_RESIST_BELL", "APPLY_RESIST_FAN", "APPLY_RESIST_BOW", "APPLY_RESIST_FIRE",
  338. "APPLY_RESIST_ELEC", "APPLY_RESIST_MAGIC", "APPLY_RESIST_WIND", "APPLY_REFLECT_MELEE", "APPLY_REFLECT_CURSE", "APPLY_POISON_REDUCE",
  339. "APPLY_KILL_SP_RECOVER", "APPLY_EXP_DOUBLE_BONUS", "APPLY_GOLD_DOUBLE_BONUS", "APPLY_ITEM_DROP_BONUS", "APPLY_POTION_BONUS",
  340. "APPLY_KILL_HP_RECOVER", "APPLY_IMMUNE_STUN", "APPLY_IMMUNE_SLOW", "APPLY_IMMUNE_FALL", "APPLY_SKILL", "APPLY_BOW_DISTANCE",
  341. "APPLY_ATT_GRADE_BONUS", "APPLY_DEF_GRADE_BONUS", "APPLY_MAGIC_ATT_GRADE", "APPLY_MAGIC_DEF_GRADE", "APPLY_CURSE_PCT",
  342. "APPLY_MAX_STAMINA", "APPLY_ATTBONUS_WARRIOR", "APPLY_ATTBONUS_ASSASSIN", "APPLY_ATTBONUS_SURA", "APPLY_ATTBONUS_SHAMAN",
  343. "APPLY_ATTBONUS_MONSTER", "APPLY_MALL_ATTBONUS", "APPLY_MALL_DEFBONUS", "APPLY_MALL_EXPBONUS", "APPLY_MALL_ITEMBONUS",
  344. "APPLY_MALL_GOLDBONUS", "APPLY_MAX_HP_PCT", "APPLY_MAX_SP_PCT", "APPLY_SKILL_DAMAGE_BONUS", "APPLY_NORMAL_HIT_DAMAGE_BONUS",
  345. "APPLY_SKILL_DEFEND_BONUS", "APPLY_NORMAL_HIT_DEFEND_BONUS", "APPLY_PC_BANG_EXP_BONUS", "APPLY_PC_BANG_DROP_BONUS",
  346. "APPLY_EXTRACT_HP_PCT", "APPLY_RESIST_WARRIOR", "APPLY_RESIST_ASSASSIN", "APPLY_RESIST_SURA", "APPLY_RESIST_SHAMAN",
  347. "APPLY_ENERGY", "APPLY_DEF_GRADE", "APPLY_COSTUME_ATTR_BONUS", "APPLY_MAGIC_ATTBONUS_PER", "APPLY_MELEE_MAGIC_ATTBONUS_PER",
  348. "APPLY_RESIST_ICE", "APPLY_RESIST_EARTH", "APPLY_RESIST_DARK", "APPLY_ANTI_CRITICAL_PCT", "APPLY_ANTI_PENETRATE_PCT",
  349. "APPLY_BLEEDING_REDUCE", "APPLY_BLEEDING_PCT", "APPLY_ATTBONUS_WOLFMAN", "APPLY_RESIST_WOLFMAN", "APPLY_RESIST_CLAW",
  350. };
  351.  
  352. int retInt = -1;
  353. for (int j=0;j<sizeof(arApplyType)/sizeof(arApplyType[0]);j++) {
  354. string tempString = arApplyType[j];
  355. string tempInputString = trim(inputString);
  356. if (tempInputString.compare(tempString)==0)
  357. {
  358. retInt = j;
  359. break;
  360. }
  361. }
  362. return retInt;
  363.  
  364. }
  365.  
  366. int get_Mob_Rank_Value(string inputString)
  367. {
  368. string arRank[] = {"PAWN", "S_PAWN", "KNIGHT", "S_KNIGHT", "BOSS", "KING"};
  369.  
  370. int retInt = -1;
  371. for (int j=0;j<sizeof(arRank)/sizeof(arRank[0]);j++) {
  372. string tempString = arRank[j];
  373. string tempInputString = trim(inputString);
  374. if (tempInputString.compare(tempString)==0)
  375. {
  376. retInt = j;
  377. break;
  378. }
  379. }
  380. return retInt;
  381. }
  382.  
  383.  
  384. int get_Mob_Type_Value(string inputString)
  385. {
  386. string arType[] = { "MONSTER", "NPC", "STONE", "WARP", "DOOR", "BUILDING", "PC", "POLYMORPH_PC", "HORSE", "GOTO"};
  387.  
  388. int retInt = -1;
  389. for (int j=0;j<sizeof(arType)/sizeof(arType[0]);j++) {
  390. string tempString = arType[j];
  391. string tempInputString = trim(inputString);
  392. if (tempInputString.compare(tempString)==0)
  393. {
  394. retInt = j;
  395. break;
  396. }
  397. }
  398. return retInt;
  399. }
  400.  
  401. int get_Mob_BattleType_Value(string inputString)
  402. {
  403. string arBattleType[] = { "MELEE", "RANGE", "MAGIC", "SPECIAL", "POWER", "TANKER", "SUPER_POWER", "SUPER_TANKER"};
  404.  
  405. int retInt = -1;
  406. for (int j=0;j<sizeof(arBattleType)/sizeof(arBattleType[0]);j++) {
  407. string tempString = arBattleType[j];
  408. string tempInputString = trim(inputString);
  409. if (tempInputString.compare(tempString)==0)
  410. {
  411. retInt = j;
  412. break;
  413. }
  414. }
  415. return retInt;
  416. }
  417.  
  418. int get_Mob_Size_Value(string inputString)
  419. {
  420. string arSize[] = { "SAMLL", "MEDIUM", "BIG"};
  421.  
  422. int retInt = 0;
  423. for (int j=0;j<sizeof(arSize)/sizeof(arSize[0]);j++) {
  424. string tempString = arSize[j];
  425. string tempInputString = trim(inputString);
  426. if (tempInputString.compare(tempString)==0)
  427. {
  428. retInt = j + 1;
  429. break;
  430. }
  431. }
  432. return retInt;
  433. }
  434.  
  435. int get_Mob_AIFlag_Value(string inputString)
  436. {
  437. string arAIFlag[] = {"AGGR","NOMOVE","COWARD","NOATTSHINSU","NOATTCHUNJO","NOATTJINNO","ATTMOB","BERSERK","STONESKIN","GODSPEED","DEATHBLOW","REVIVE"};
  438.  
  439.  
  440. int retValue = 0;
  441. string* arInputString = StringSplit(inputString, ",");
  442. for(int i =0;i<sizeof(arAIFlag)/sizeof(arAIFlag[0]);i++) {
  443. string tempString = arAIFlag[i];
  444. for (int j=0; j<30 ; j++)
  445. {
  446. string tempString2 = arInputString[j];
  447. if (tempString2.compare(tempString)==0) {
  448. retValue = retValue + pow((float)2,(float)i);
  449. }
  450.  
  451. if(tempString2.compare("") == 0)
  452. break;
  453. }
  454. }
  455. delete []arInputString;
  456. return retValue;
  457. }
  458. int get_Mob_RaceFlag_Value(string inputString)
  459. {
  460. string arRaceFlag[] = {"ANIMAL","UNDEAD","DEVIL","HUMAN","ORC","MILGYO","INSECT","FIRE","ICE","DESERT","TREE", "ATT_ELEC","ATT_FIRE","ATT_ICE","ATT_WIND","ATT_EARTH","ATT_DARK"};
  461.  
  462. int retValue = 0;
  463. string* arInputString = StringSplit(inputString, "|");
  464. for(int i =0;i<sizeof(arRaceFlag)/sizeof(arRaceFlag[0]);i++) {
  465. string tempString = arRaceFlag[i];
  466. for (int j=0; j<30 ; j++)
  467. {
  468. string tempString2 = arInputString[j];
  469. if (tempString2.compare(tempString)==0) {
  470. retValue = retValue + pow((float)2,(float)i);
  471. }
  472.  
  473. if(tempString2.compare("") == 0)
  474. break;
  475. }
  476. }
  477. delete []arInputString;
  478. return retValue;
  479. }
  480. int get_Mob_ImmuneFlag_Value(string inputString)
  481. {
  482. string arImmuneFlag[] = {"STUN","SLOW","FALL","CURSE","POISON","TERROR","REFLECT"};
  483.  
  484. int retValue = 0;
  485. string* arInputString = StringSplit(inputString, ",");
  486. for(int i =0;i<sizeof(arImmuneFlag)/sizeof(arImmuneFlag[0]);i++) {
  487. string tempString = arImmuneFlag[i];
  488. for (int j=0; j<30 ; j++)
  489. {
  490. string tempString2 = arInputString[j];
  491. if (tempString2.compare(tempString)==0) {
  492. retValue = retValue + pow((float)2,(float)i);
  493. }
  494.  
  495. if(tempString2.compare("") == 0)
  496. break;
  497. }
  498. }
  499. delete []arInputString;
  500. return retValue;
  501. }
RAW Paste Data