Merge pull request #194 from Crowns3bc/Home-Server-Specific-Drops

Home server specific drops
This commit is contained in:
Kaan Soral
2025-10-03 20:32:29 +03:00
committed by GitHub
2 changed files with 26 additions and 0 deletions
+18
View File
@@ -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") {
D.drops.konami.forEach(function (item) {
if (Math.random() / share / player.luckm / monster.level < item[0] || mode.drop_all) {
@@ -4664,6 +4673,7 @@ function init_io() {
maps: D.drops.maps,
tables: {},
max: player.max_stats,
monsters_home_server: D.drops.monsters_home_server || {}, //add this
}; // ,computer:false
function register_table(table) {
if (table) {
@@ -4678,12 +4688,17 @@ function init_io() {
if (player.computer || 1) {
// data.computer=true;
data.drops = D.drops.monsters;
data.drops_home = D.drops.monsters_home_server || {}; //mirror monsters_home
} else {
data.drops = {};
data.drops_home = {};
for (var name in data.monsters) {
if (data.monsters[name] >= 100 && 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) {
@@ -4697,6 +4712,9 @@ function init_io() {
for (var name in data.drops) {
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) {
register_table(data.maps[name]);
}