Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function MySI_MiniNTIPCheckItem(item, ntip) {
- item.GetStatEx = function (id, subid) {
- var i, desc, string, value;
- if (this.itemflag & _NTIPAliasFlag["runeword"]) { // some properties are bugged for runewords
- if (id === 18 && subid === 0) { // enhanced damage
- desc = this.itemdesc;
- desc = desc.split("\n");
- string = GetLocaleString(10023);
- for (i = 0; i < desc.length; i += 1) {
- if (desc[i].indexOf(string.substring(0, string.length - 1)) > -1) {
- value = parseInt(desc[i].split("+")[1].split("%")[0], 10);
- return value;
- }
- }
- } else if (id === 92 && !subid) { // level requirement
- desc = this.itemdesc;
- desc = desc.split("\n");
- string = GetLocaleString(3469);
- for (i = 0; i < desc.length; i += 1) {
- if (desc[i].indexOf(string) > -1) {
- value = parseInt(desc[i].split(string)[1], 10);
- return value;
- }
- }
- }
- }
- if (id === 204 && subid === 54 && this.itemflag & _NTIPAliasFlag["identified"]) { // teleport charges, doesn't support non-english
- desc = this.itemdesc;
- desc = desc.split("\n");
- for (i = 0; desc && i < desc.length; i += 1) {
- if (desc[i].indexOf("Teleport") > -1 && desc[i].indexOf("Charges") > -1) {
- value = parseInt(desc[i].split("Level ")[1].split(" Charges")[0], 10);
- return value;
- }
- }
- }
- if (subid) {
- return this.GetStat(id, subid);
- }
- return this.GetStat(id);
- }
- var _result = 0;
- var _identified = item.itemflag & 0x10;
- var _ntip = NTIPParseLineInt(ntip);
- if (_ntip)
- {
- if (_ntip[0].length > 0)
- {
- if (eval(_ntip[0]))
- {
- if (_ntip[1].length > 0)
- {
- if (eval(_ntip[1]))
- return 1;
- else if (!_identified && _result == 0)
- _result = -1;
- }
- else
- return 1;
- }
- }
- else if (_ntip[1].length > 0)
- {
- if (eval(_ntip[1]))
- return 1;
- else if (!_identified && _result == 0)
- _result = -1;
- }
- }
- return _result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement