Advertisement
Guest User

Untitled

a guest
Nov 12th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. (function(functionClone, webhook_url, g, map, hero, $) {
  2. 'use strict';
  3.  
  4. lootItem = function(item) {
  5. functionClone.apply(this, arguments);
  6.  
  7. let worldname = g.worldname[0].toUpperCase() + g.worldname.substring(1);
  8. let time = (new Date).toLocaleTimeString();
  9. const itemType = item.stat.indexOf('heroic') > -1 ? 'heroic'
  10. : (item.stat.indexOf('legendary') > -1 ? 'legendary' : 'other')
  11. ;
  12.  
  13. if (itemType === 'other') return;
  14.  
  15. const itemId = Object.keys(g.item).find(id => g.item[id].hid === item.hid);
  16. const grafika = `http://${g.worldname}.margonem.pl/obrazki/itemy/${item.icon}`;
  17. const locationdwa = `${map.name} (${hero.x}, ${hero.y})`;
  18. let co_lotlo_po_polskiemu, everyone;
  19. if(itemType == "legendary") {
  20. co_lotlo_po_polskiemu = "lege";
  21. everyone = "@everyone";
  22. } else if(itemType == "heroic") {
  23. co_lotlo_po_polskiemu = "herko";
  24. everyone = " ";
  25. }
  26. $.ajax({
  27. url: webhook_url,
  28. type: 'POST',
  29. data: JSON.stringify({
  30. 'embeds': [{
  31. 'title': hero.nick + ' · ' + hero.lvl + 'lvl, zlotał ' + co_lotlo_po_polskiemu + '!' ,
  32. 'description': `${item.name}(${itemType})\n Na mapie: ${locationdwa}\nNumerki: ITEM#${itemId}.${g.worldname}\n${time}\n${worldname}\n${grafika}\n${everyone}`
  33. }]
  34. }),
  35. contentType: "application/json"
  36. });
  37. };
  38. })(lootItem, "https://discordapp.com/api/webhooks/504023711045910538/sSu4MueiUGqSJEvUKdgP5CfddxFpLjBsxjkobf569jJ4o1Ob8ZUJuIc9HP3DopVd4j04", window.g, window.map, window.hero, window.$);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement