Advertisement
kolton

Untitled

Sep 16th, 2011
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. function MySI_MiniNTIPCheckItem(item, ntip) {
  2. item.GetStatEx = function (id, subid) {
  3. var i, desc, string, value;
  4.  
  5. if (this.itemflag & _NTIPAliasFlag["runeword"]) { // some properties are bugged for runewords
  6. if (id === 18 && subid === 0) { // enhanced damage
  7. desc = this.itemdesc;
  8. desc = desc.split("\n");
  9. string = GetLocaleString(10023);
  10.  
  11. for (i = 0; i < desc.length; i += 1) {
  12. if (desc[i].indexOf(string.substring(0, string.length - 1)) > -1) {
  13. value = parseInt(desc[i].split("+")[1].split("%")[0], 10);
  14.  
  15. return value;
  16. }
  17. }
  18. } else if (id === 92 && !subid) { // level requirement
  19. desc = this.itemdesc;
  20. desc = desc.split("\n");
  21. string = GetLocaleString(3469);
  22.  
  23. for (i = 0; i < desc.length; i += 1) {
  24. if (desc[i].indexOf(string) > -1) {
  25. value = parseInt(desc[i].split(string)[1], 10);
  26.  
  27. return value;
  28. }
  29. }
  30. }
  31. }
  32.  
  33. if (id === 204 && subid === 54 && this.itemflag & _NTIPAliasFlag["identified"]) { // teleport charges, doesn't support non-english
  34. desc = this.itemdesc;
  35. desc = desc.split("\n");
  36.  
  37. for (i = 0; desc && i < desc.length; i += 1) {
  38. if (desc[i].indexOf("Teleport") > -1 && desc[i].indexOf("Charges") > -1) {
  39. value = parseInt(desc[i].split("Level ")[1].split(" Charges")[0], 10);
  40.  
  41. return value;
  42. }
  43. }
  44. }
  45.  
  46. if (subid) {
  47. return this.GetStat(id, subid);
  48. }
  49.  
  50. return this.GetStat(id);
  51. }
  52.  
  53. var _result = 0;
  54. var _identified = item.itemflag & 0x10;
  55. var _ntip = NTIPParseLineInt(ntip);
  56.  
  57. if (_ntip)
  58. {
  59. if (_ntip[0].length > 0)
  60. {
  61. if (eval(_ntip[0]))
  62. {
  63. if (_ntip[1].length > 0)
  64. {
  65. if (eval(_ntip[1]))
  66. return 1;
  67. else if (!_identified && _result == 0)
  68. _result = -1;
  69. }
  70. else
  71. return 1;
  72. }
  73. }
  74. else if (_ntip[1].length > 0)
  75. {
  76. if (eval(_ntip[1]))
  77. return 1;
  78. else if (!_identified && _result == 0)
  79. _result = -1;
  80. }
  81. }
  82.  
  83. return _result;
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement