Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function(functionClone, webhook_url, g, map, hero, $) {
- 'use strict';
- lootItem = function(item) {
- functionClone.apply(this, arguments);
- let worldname = g.worldname[0].toUpperCase() + g.worldname.substring(1);
- let time = (new Date).toLocaleTimeString();
- const itemType = item.stat.indexOf('heroic') > -1 ? 'heroic'
- : (item.stat.indexOf('legendary') > -1 ? 'legendary' : 'other')
- ;
- if (itemType === 'other') return;
- const itemId = Object.keys(g.item).find(id => g.item[id].hid === item.hid);
- const grafika = `http://${g.worldname}.margonem.pl/obrazki/itemy/${item.icon}`;
- const locationdwa = `${map.name} (${hero.x}, ${hero.y})`;
- let co_lotlo_po_polskiemu, everyone;
- if(itemType == "legendary") {
- co_lotlo_po_polskiemu = "lege";
- everyone = "@everyone";
- } else if(itemType == "heroic") {
- co_lotlo_po_polskiemu = "herko";
- everyone = " ";
- }
- $.ajax({
- url: webhook_url,
- type: 'POST',
- data: JSON.stringify({
- 'embeds': [{
- 'title': hero.nick + ' · ' + hero.lvl + 'lvl, zlotał ' + co_lotlo_po_polskiemu + '!' ,
- 'description': `${item.name}(${itemType})\n Na mapie: ${locationdwa}\nNumerki: ITEM#${itemId}.${g.worldname}\n${time}\n${worldname}\n${grafika}\n${everyone}`
- }]
- }),
- contentType: "application/json"
- });
- };
- })(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