Made ironman icons visible in clan and global chat (requires world.ironman_icons to be true)
Authentic tormented demon safe spotting Added cannon restriction to tormented demon area
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
package content.region.misthalin.lumbridge
|
||||
|
||||
import core.api.*
|
||||
import core.game.world.map.zone.ZoneBorders
|
||||
import core.game.world.map.zone.ZoneRestriction
|
||||
|
||||
class TormentedDemonArea : MapArea {
|
||||
override fun defineAreaBorders() : Array<ZoneBorders> { return arrayOf (ZoneBorders.forRegion(10329)) }
|
||||
override fun getRestrictions() : Array<ZoneRestriction> { return arrayOf (ZoneRestriction.CANNON) }
|
||||
}
|
||||
@@ -281,5 +281,8 @@ class ServerConstants {
|
||||
|
||||
@JvmField
|
||||
var MAX_PATHFIND_DISTANCE = 25
|
||||
|
||||
@JvmField
|
||||
var IRONMAN_ICONS = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package core.game.node.entity.player.info;
|
||||
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.ServerConstants;
|
||||
|
||||
/**
|
||||
* Represent the rights of a player.
|
||||
@@ -24,9 +25,11 @@ public enum Rights {
|
||||
if (c != Rights.REGULAR_PLAYER && c != null) {
|
||||
return c.toInteger();
|
||||
}
|
||||
if (player.getIronmanManager().isIronman()) {
|
||||
return player.getIronmanManager().getMode().getIcon();
|
||||
}
|
||||
if (ServerConstants.IRONMAN_ICONS) {
|
||||
if (player.getIronmanManager().isIronman()) {
|
||||
return player.getIronmanManager().getMode().getIcon();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import core.api.sendMessage
|
||||
import core.api.setAttribute
|
||||
import core.game.system.command.Privilege
|
||||
import core.game.world.repository.Repository
|
||||
import core.game.node.entity.player.info.Rights
|
||||
import core.tools.colorize
|
||||
|
||||
class GlobalChat : Commands {
|
||||
@@ -20,9 +21,9 @@ class GlobalChat : Commands {
|
||||
|
||||
companion object {
|
||||
val ATTR_GLOBAL_MUTE = "/save:globalmute"
|
||||
fun process(sender: String, message: String) {
|
||||
val msgSD = prepare(sender, message, false)
|
||||
val msgHD = prepare(sender, message, true)
|
||||
fun process(sender: String, message: String, rights: Int) {
|
||||
val msgSD = prepare(sender, message, false, rights)
|
||||
val msgHD = prepare(sender, message, true, rights)
|
||||
for (player in Repository.players.filter { !getAttribute(it, ATTR_GLOBAL_MUTE, false) }) {
|
||||
if (player.interfaceManager.isResizable)
|
||||
sendMessage(player, msgHD)
|
||||
@@ -31,10 +32,10 @@ class GlobalChat : Commands {
|
||||
}
|
||||
}
|
||||
|
||||
private fun prepare(sender: String, message: String, isResizable: Boolean): String {
|
||||
private fun prepare(sender: String, message: String, isResizable: Boolean, rights: Int): String {
|
||||
val baseColor = if (isResizable) "%f1b04c" else "%7512ff"
|
||||
val bracketColor = if (isResizable) "%ffffff" else "%000000"
|
||||
return colorize("$bracketColor[${baseColor}G$bracketColor] $sender: ${baseColor}$message")
|
||||
return colorize("$bracketColor[${baseColor}G$bracketColor] ${if (rights > 0) "<img=${rights - 1}>" else ""}$sender: ${baseColor}$message")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,6 +151,7 @@ object ServerConfigParser {
|
||||
ServerConstants.DISCORD_OPENRSC_HOOK = data.getString("server.openrsc_integration_webhook", "")
|
||||
ServerConstants.ENABLE_GLOBALCHAT = data.getBoolean("world.enable_globalchat", true)
|
||||
ServerConstants.MAX_PATHFIND_DISTANCE = data.getLong("server.max_pathfind_dist", 25L).toInt()
|
||||
ServerConstants.IRONMAN_ICONS = data.getBoolean("world.ironman_icons", false)
|
||||
|
||||
val logLevel = data.getString("server.log_level", "VERBOSE").uppercase()
|
||||
ServerConstants.LOG_LEVEL = parseEnumEntry<LogLevel>(logLevel) ?: LogLevel.VERBOSE
|
||||
|
||||
@@ -210,7 +210,7 @@ object PacketProcessor {
|
||||
val messages = splitChatMessage(pkt.message.substring(2), pkt.player.name.length + 3, false)
|
||||
for (message in messages) {
|
||||
if (message.isNotBlank())
|
||||
GlobalChat.process(pkt.player.username, message)
|
||||
GlobalChat.process(pkt.player.username, message, Rights.getChatIcon(pkt.player))
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -222,7 +222,7 @@ object PacketProcessor {
|
||||
builder.sender = pkt.player.name
|
||||
builder.clanName = pkt.player.communication.clan.owner.lowercase().replace(" ", "_")
|
||||
builder.message = message
|
||||
builder.rank = pkt.player.rights.ordinal
|
||||
builder.rank = Rights.getChatIcon(pkt.player)
|
||||
ManagementEvents.publish(builder.build())
|
||||
}
|
||||
return
|
||||
|
||||
@@ -366,4 +366,4 @@ object ManagementEvents {
|
||||
private fun shouldWaitForClanInfo(clanName: String): Boolean {
|
||||
return ClanRepository.get(clanName) == null && hasRequestedClanInfo[clanName] == null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user