mirror of
https://github.com/gooba42/adventureland.git
synced 2026-10-14 18:39:27 -05:00
Merge pull request #194 from Crowns3bc/Home-Server-Specific-Drops
Home server specific drops
This commit is contained in:
@@ -2147,6 +2147,14 @@ function render_monster_info(name)
|
|||||||
html+=render_drop(drop,1,"#858B8E");
|
html+=render_drop(drop,1,"#858B8E");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// Add display section for home server drops
|
||||||
|
var MRH = Object.keys(tracker).length && tracker && tracker.drops_home || RF.monsters_home_server;
|
||||||
|
if (MRH && MRH[name] && MRH[name].length) {
|
||||||
|
html += "<div style='margin-top:6px;margin-bottom:3px;color:#FF9933'>Home Server Drops:</div>";
|
||||||
|
MRH[name].forEach(function (drop) {
|
||||||
|
html += render_drop(drop, 1, "#858B8E");
|
||||||
|
});
|
||||||
|
}
|
||||||
object_sort(G.maps).forEach(function(io){
|
object_sort(G.maps).forEach(function(io){
|
||||||
var map=io[1],mname=io[0];
|
var map=io[1],mname=io[0];
|
||||||
if(map.ignore || !(RF.maps&&RF.maps[mname]||[]).length) return;
|
if(map.ignore || !(RF.maps&&RF.maps[mname]||[]).length) return;
|
||||||
|
|||||||
@@ -2071,6 +2071,15 @@ function drop_something(player, monster, share) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// Home-server monster-specific drops
|
||||||
|
if (player.p.home && player.p.home === region + server_name && D.drops.monsters_home_server[monster.type] && player.tskin != "konami") {
|
||||||
|
D.drops.monsters_home_server[monster.type].forEach(function (item) {
|
||||||
|
let itemShouldDrop = shouldItemDrop(item);
|
||||||
|
if (itemShouldDrop || mode.drop_all) {
|
||||||
|
drop_item_logic(drop, item, is_in_pvp(player, 1));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
if (player.tskin == "konami") {
|
if (player.tskin == "konami") {
|
||||||
D.drops.konami.forEach(function (item) {
|
D.drops.konami.forEach(function (item) {
|
||||||
if (Math.random() / share / player.luckm / monster.level < item[0] || mode.drop_all) {
|
if (Math.random() / share / player.luckm / monster.level < item[0] || mode.drop_all) {
|
||||||
@@ -4664,6 +4673,7 @@ function init_io() {
|
|||||||
maps: D.drops.maps,
|
maps: D.drops.maps,
|
||||||
tables: {},
|
tables: {},
|
||||||
max: player.max_stats,
|
max: player.max_stats,
|
||||||
|
monsters_home_server: D.drops.monsters_home_server || {}, //add this
|
||||||
}; // ,computer:false
|
}; // ,computer:false
|
||||||
function register_table(table) {
|
function register_table(table) {
|
||||||
if (table) {
|
if (table) {
|
||||||
@@ -4678,12 +4688,17 @@ function init_io() {
|
|||||||
if (player.computer || 1) {
|
if (player.computer || 1) {
|
||||||
// data.computer=true;
|
// data.computer=true;
|
||||||
data.drops = D.drops.monsters;
|
data.drops = D.drops.monsters;
|
||||||
|
data.drops_home = D.drops.monsters_home_server || {}; //mirror monsters_home
|
||||||
} else {
|
} else {
|
||||||
data.drops = {};
|
data.drops = {};
|
||||||
|
data.drops_home = {};
|
||||||
for (var name in data.monsters) {
|
for (var name in data.monsters) {
|
||||||
if (data.monsters[name] >= 100 && D.drops.monsters[name]) {
|
if (data.monsters[name] >= 100 && D.drops.monsters[name]) {
|
||||||
data.drops[name] = D.drops.monsters[name];
|
data.drops[name] = D.drops.monsters[name];
|
||||||
}
|
}
|
||||||
|
if (data.monsters[name] >= 100 && D.drops.monsters_home_server[name]) {
|
||||||
|
data.drops_home[name] = D.drops.monsters_home_server[name];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (D.drops.maps.global) {
|
if (D.drops.maps.global) {
|
||||||
@@ -4697,6 +4712,9 @@ function init_io() {
|
|||||||
for (var name in data.drops) {
|
for (var name in data.drops) {
|
||||||
register_table(data.drops[name]);
|
register_table(data.drops[name]);
|
||||||
}
|
}
|
||||||
|
for (var name in data.drops_home) { //include home tables
|
||||||
|
register_table(data.drops_home[name]);
|
||||||
|
}
|
||||||
for (var name in data.maps) {
|
for (var name in data.maps) {
|
||||||
register_table(data.maps[name]);
|
register_table(data.maps[name]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user