Random event improvements

Implemented smoke puff sound when random event npcs disappear
Fixed smoke puff repeating
Admins will no longer get random events
Can no longer talk to a random event NPC if they are leaving
Rewrote Drill Demon event:
The event can no longer be avoided and Sergeant Damien automatically teleports you to the event
The player can no longer escape the event by logging out
Sergeant Damien now walks around the area in a circle as he should authentically
Corrected all of Sergeant Damien's dialogue to be authentic
Implemented the authentic item dialogues that show the player the picture of the sign to exercise at
Implemented all the exercise sounds
Evil Bob's Island:
Rewrote all uses of pulses to scripts
Fixed evil bob not teleporting players when in combat
Fixed the reward dialogue
Freaky Forester:
Rewrote the freaky forester teleport to a script instead of a pulse
Fixed an issue where nearby players could talk to the NPC
Genie Event:
Rewrote most of the event
The genie now leaves after completing the dialogue
Implemented the genie appearing sound
Evil Chicken:
Now uses the correct attack sound
Misc:
Added admin command ::barrage [radius] that new barrage command hits all the players in the radius defines with a custom weak ice barrage. It will play the ice barrage sound, display graphics and hit the player for a random 0-3 damage. A fail safe has been added so the command will hit 0 if the player is low on health so this command will not accidentally kill players
This commit is contained in:
Zerken
2023-09-03 13:33:26 +00:00
committed by Ryan
parent 72853d225d
commit 1ab6773910
20 changed files with 351 additions and 279 deletions
@@ -1,27 +1,30 @@
package core.game.system.command.sets
import core.api.*
import content.global.handlers.item.SpadeDigListener
import content.region.misc.tutisland.handlers.iface.CharacterDesign
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.node.entity.combat.ImpactHandler
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.game.system.task.Pulse
import core.game.world.map.Location
import core.game.world.map.RegionManager
import core.game.world.update.flag.context.Animation
import core.plugin.Initializable
import org.json.simple.JSONObject
import core.game.dialogue.DialogueFile
import content.global.handlers.item.SpadeDigListener
import core.game.node.entity.player.info.login.PlayerSaver
import core.game.system.command.Privilege
import core.game.system.task.Pulse
import core.game.world.GameWorld
import core.game.world.repository.Repository
import core.game.world.map.Location
import core.game.world.map.RegionManager
import core.game.world.repository.Repository.getPlayerByName
import core.game.world.update.flag.context.Animation
import core.game.world.update.flag.context.Graphics
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import core.tools.RandomFunction
import org.json.simple.JSONObject
import org.rs09.consts.Sounds
import java.awt.HeadlessException
import java.awt.Toolkit
import java.awt.datatransfer.StringSelection
import java.util.*
import kotlin.streams.toList
@Initializable
class FunCommandSet : CommandSet(Privilege.ADMIN) {
@@ -186,6 +189,24 @@ class FunCommandSet : CommandSet(Privilege.ADMIN) {
CharacterDesign.reopen(player)
}
/**
* Cast a weakened version of ice barrage on nearby players within the defined radius.
* This spell will never kill or freeze a player
*/
define("barrage", Privilege.ADMIN, "::barrage radius ", "Cast a weak barrage on all nearby players. Will never kill players") { player, args ->
if (args.size != 2)
reject(player, "Usage: ::barrage radius[max = 50]")
val radius = if (args[1].toInt() > 50) 50 else args[1].toInt()
val nearbyPlayers = RegionManager.getLocalPlayers(player, radius).stream().filter { p: Player -> p.username != player.username }.toList()
animate(player, 1978)
playGlobalAudio(player.location, Sounds.ICE_CAST_171)
for (p in nearbyPlayers) {
playGlobalAudio(p.location, Sounds.ICE_BARRAGE_IMPACT_168, 20)
val impactAmount = if (p.skills.lifepoints < 10 ) 0 else RandomFunction.getRandom(3)
impact(p, impactAmount, ImpactHandler.HitsplatType.NORMAL)
p.graphics(Graphics(369, 0))
}
}
}
fun bury(player: Player){
@@ -5,6 +5,7 @@ import content.global.ame.RandomEvents
import core.api.*
import core.game.node.entity.Entity
import core.game.node.entity.player.Player
import core.game.node.entity.player.info.Rights
import core.game.node.item.Item
import core.game.system.command.Privilege
import core.game.system.timer.PersistTimer
@@ -39,6 +40,9 @@ class AntiMacro : PersistTimer(0, "antimacro", isAuto = true), Commands {
override fun onRegister(entity: Entity) {
if (entity !is Player || entity.isArtificial)
entity.timers.removeTimer(this)
if (entity is Player && entity.rights == Rights.ADMINISTRATOR) {
pause(entity)
}
if (runInterval == 0)
setNextExecution()