@@ -167,7 +167,7 @@ define([ | |||||
events.emit('onGetPlayer', obj); | events.emit('onGetPlayer', obj); | ||||
window.player = obj; | window.player = obj; | ||||
sound.unload(obj.zoneId); | |||||
sound.unload(obj.zoneName); | |||||
renderer.setPosition({ | renderer.setPosition({ | ||||
x: (obj.x - (renderer.width / (scale * 2))) * scale, | x: (obj.x - (renderer.width / (scale * 2))) * scale, | ||||
@@ -313,8 +313,13 @@ define([ | |||||
return 0; | return 0; | ||||
}); | }); | ||||
if (this.zoneId !== null) | |||||
events.emit('onRezone', this.zoneId); | |||||
if (this.zoneId !== null) { | |||||
events.emit('onRezone', { | |||||
oldZoneId: this.zoneId, | |||||
newZoneId: msg.zoneId | |||||
}); | |||||
} | |||||
this.zoneId = msg.zoneId; | this.zoneId = msg.zoneId; | ||||
msg.clientObjects.forEach(c => { | msg.clientObjects.forEach(c => { | ||||
@@ -52,7 +52,7 @@ define([ | |||||
}, | }, | ||||
//Fired when a character rezones | //Fired when a character rezones | ||||
// 'scope' is the new zone name | |||||
// 'newScope' is the new zone name | |||||
unload: function (newScope) { | unload: function (newScope) { | ||||
const { sounds } = this; | const { sounds } = this; | ||||
@@ -39,7 +39,9 @@ define([ | |||||
}, | }, | ||||
onGetConnectedPlayer: function (msg) { | onGetConnectedPlayer: function (msg) { | ||||
let party = this.party; | |||||
const { party } = this; | |||||
const { player: { serverId: playerId, zoneId: playerZone } } = window; | |||||
if (!party) | if (!party) | ||||
return; | return; | ||||
@@ -47,25 +49,26 @@ define([ | |||||
msg = [msg]; | msg = [msg]; | ||||
msg.forEach(m => { | msg.forEach(m => { | ||||
const { id: mId, zoneId: mZone } = m; | |||||
if (party.indexOf(m.id) === -1) | if (party.indexOf(m.id) === -1) | ||||
return; | return; | ||||
let zone = m.zone; | |||||
if (m.id === window.player.serverId) { | |||||
if (mId === playerId) { | |||||
party.forEach(p => { | party.forEach(p => { | ||||
let player = globals.onlineList.find(o => o.id === p); | |||||
const mObj = globals.onlineList.find(o => o.id === p); | |||||
let el = this.find('.member[memberId="' + p + '"]'); | let el = this.find('.member[memberId="' + p + '"]'); | ||||
el.removeClass('differentZone'); | el.removeClass('differentZone'); | ||||
if (player.zone !== zone) | |||||
if (mObj.mZone !== mZone) | |||||
el.addClass('differentZone'); | el.addClass('differentZone'); | ||||
}); | }); | ||||
} else { | } else { | ||||
let el = this.find('.member[memberId="' + m.id + '"]'); | let el = this.find('.member[memberId="' + m.id + '"]'); | ||||
el.removeClass('differentZone'); | el.removeClass('differentZone'); | ||||
if (m.zone !== window.player.zone) | |||||
if (m.mZone !== playerZone) | |||||
el.addClass('differentZone'); | el.addClass('differentZone'); | ||||
el.find('.txtLevel').html('level: ' + m.level); | el.find('.txtLevel').html('level: ' + m.level); | ||||
@@ -130,7 +133,7 @@ define([ | |||||
.attr('memberId', p) | .attr('memberId', p) | ||||
.on('contextmenu', this.showContext.bind(this, playerName, p)); | .on('contextmenu', this.showContext.bind(this, playerName, p)); | ||||
if (player.zone !== window.player.zone) | |||||
if (player.zoneId !== window.player.zoneId) | |||||
el.addClass('differentZone'); | el.addClass('differentZone'); | ||||
//Find stats | //Find stats | ||||
@@ -10,7 +10,7 @@ module.exports = { | |||||
//If we're not in the correct zone, don't do this check, it'll just crash the server | //If we're not in the correct zone, don't do this check, it'll just crash the server | ||||
// since the mob won't be available (most likely) in the zoneFile | // since the mob won't be available (most likely) in the zoneFile | ||||
if (this.obj.zoneName === this.zoneName) { | if (this.obj.zoneName === this.zoneName) { | ||||
let mobTypes = this.obj.instance.spawners.zoneConfig.mobs; | |||||
let mobTypes = this.obj.instance.zoneConfig.mobs; | |||||
if (this.mobName) { | if (this.mobName) { | ||||
let mobType = mobTypes[this.mobName.toLowerCase()]; | let mobType = mobTypes[this.mobName.toLowerCase()]; | ||||
//Maybe the zoneFile changed in the meantime. If so, regenerate | //Maybe the zoneFile changed in the meantime. If so, regenerate | ||||
@@ -18,7 +18,7 @@ module.exports = { | |||||
//If we're not in the correct zone, don't do this check, it'll just crash the server | //If we're not in the correct zone, don't do this check, it'll just crash the server | ||||
// since the mob won't be available (most likely) in the zoneFile | // since the mob won't be available (most likely) in the zoneFile | ||||
if (this.obj.zoneName === this.zoneName) { | if (this.obj.zoneName === this.zoneName) { | ||||
let mobTypes = this.obj.instance.spawners.zoneConfig.mobs; | |||||
let mobTypes = this.obj.instance.zoneConfig.mobs; | |||||
if (this.mobType && this.item) { | if (this.mobType && this.item) { | ||||
//Check if the zoneFile changed | //Check if the zoneFile changed | ||||
@@ -6,7 +6,7 @@ module.exports = { | |||||
return false; | return false; | ||||
if (!this.xp) { | if (!this.xp) { | ||||
let level = this.obj.instance.spawners.zoneConfig.level; | |||||
let level = this.obj.instance.zoneConfig.level; | |||||
level = level[0]; | level = level[0]; | ||||
let xp = ~~(level * 22 * this.getXpMultiplier()); | let xp = ~~(level * 22 * this.getXpMultiplier()); | ||||
this.xp = xp; | this.xp = xp; | ||||