Advertisement
Guest User

new lootboxItem

a guest
Jul 17th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. const lootboxItemOld = window.lootboxItem;
  2. var autoQuit = autoQuitCheckbox.attr('checked') ? 1 : 0;
  3. var sent = false;
  4. var loots = {
  5. want: [],
  6. not: [],
  7. must: []
  8. };
  9. window.lootboxItem = function(item) {
  10. lootboxItemOld(item);
  11. var stat = window.parseItemStat(item.stat);
  12. var limit = parseInt(filterInput.val());
  13. if (((isNaN(limit) || (item.pr >= limit)) && valueCheckbox.attr('checked')) || (item.stat.search(/ttl/) >= 0 && blessCheckbox.attr('checked')) || (item.stat.search(/quest/) >= 0) || (item.stat.search(/legendary/) >= 0 && legendaryCheckbox.attr('checked')) || (item.stat.search(/heroic/) >= 0 && heroicCheckbox.attr('checked')) || (item.stat.search(/unique/) >= 0 && uniqueCheckbox.attr('checked')) || ((item.stat.search(/fullheal/) >= 0 || item.stat.search(/leczy/) >= 0 || item.stat.search(/perheal/) >= 0) && mixCheckbox.attr('checked')) || (item.stat.search(/ammo/) >= 0 && arrowCheckbox.attr('checked')) || (item.stat.search(/gold/) >= 0 && goldCheckbox.attr('checked')) || (item.stat.search(/teleport/) >= 0 && tpCheckbox.attr('checked')) || (item.stat.search(/runes/) >= 0 && runesCheckbox.attr('checked'))) {
  14. if (window.g.party && !(window.isset(stat.reqp) && stat.reqp.indexOf(window.hero.prof) == -1)) {
  15. loots.must.push(item.id);
  16. window.setStateOnOneLootItem(item.id, 2);
  17.  
  18. } else {
  19. loots.want.push(item.id)
  20. window.setStateOnOneLootItem(item.id, 1);
  21. }
  22. } else {
  23. loots.not.push(item.id);
  24. window.setStateOnOneLootItem(item.id, 0);
  25. }
  26. if (!sent) {
  27. sent = true;
  28. setTimeout(function() {
  29. window._g("loot&want=" + loots.want.join(",") + "&not=" + loots.not.join(",") + "&must=" + loots.must.join(",") + "&final=" + autoQuit);
  30. if (autoQuit) window.closeLootWindow();
  31. sent = false;
  32. loots = {
  33. want: [],
  34. not: [],
  35. must: []
  36. };
  37. }, 300);
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement