Compare commits

..

2 commits

Author SHA1 Message Date
Ceikry
91bb6be123 Update README.md 2026-08-03 15:03:08 +00:00
Player Name
2419bdb65e Fixed Giles spamming chat messages 2026-07-31 22:17:20 +10:00
3 changed files with 22 additions and 8 deletions

View file

@ -81,6 +81,20 @@ There are many ways everyone can contribute! From the most seasoned programmers
* **Code Contributors**: As a remake, we have massive amounts of content that need to be implemented or corrected. If you know how to program or are willing to learn, this is where you could be extremely helpful! We need everything from quests, to dialogue, to mini-games, to skills that still need to be corrected or implemented. This is perhaps one of the most valuable ways someone could help out the project! If you are interested in developing content, reach out in the development channel of the Discord. * **Code Contributors**: As a remake, we have massive amounts of content that need to be implemented or corrected. If you know how to program or are willing to learn, this is where you could be extremely helpful! We need everything from quests, to dialogue, to mini-games, to skills that still need to be corrected or implemented. This is perhaps one of the most valuable ways someone could help out the project! If you are interested in developing content, reach out in the development channel of the Discord.
### Policy on Use of AI Tools
You, the contributor, agree to submit quality code to the best of your ability which you have tested yourself and confirmed that it works as intended, and if it doesnt work, you agree to take constructive feedback and fix it.
You should be able to explain or defend how any part of your code works, without the use of AI or any other assistive tools.
2009scape reserves the right to reject your MR on grounds of poor quality, poor functionality, poor code style, poor attitudes or unethical over-reliance on assistive tools.
2009scape reserves the right to bar an individual from contributing due to patterns of aforementioned behavior, and close or delete all future MRs or issues or suggestions from said person without given explanation.
AI may not be used to generate your MR description, your issue description, or any responses to any discourse present on the Gitlab at any time or in any fashion. If you use AI in any of these places, it will be assumed that your entire contribution is AI and that you have no clue how it functions, and the remainder of the policy outlined above will be applied to you immediately.
## Content Developers: Setting Up the Project. ## Content Developers: Setting Up the Project.
### GitLab Setup ### GitLab Setup
**Note: This allows you to commit changes to the main repo (with approval)! Also, always stay up to date with the most recent updates by pulling into your copy when 2009Scape updates!** **Note: This allows you to commit changes to the main repo (with approval)! Also, always stay up to date with the most recent updates by pulling into your copy when 2009Scape updates!**

View file

@ -1,8 +1,10 @@
package content.global.ame package content.global.ame
import content.global.ame.events.surpriseexam.MysteriousOldManNPC import content.global.ame.events.surpriseexam.MysteriousOldManNPC
import core.api.getAttribute
import core.api.playGlobalAudio import core.api.playGlobalAudio
import core.api.poofClear import core.api.poofClear
import core.api.removeAttribute
import core.api.sendMessage import core.api.sendMessage
import core.api.setAttribute import core.api.setAttribute
import core.api.utils.WeightBasedTable import core.api.utils.WeightBasedTable
@ -25,8 +27,6 @@ import core.tools.secondsToTicks
import core.tools.ticksToCycles import core.tools.ticksToCycles
import org.rs09.consts.NPCs import org.rs09.consts.NPCs
import org.rs09.consts.Sounds import org.rs09.consts.Sounds
import kotlin.math.ceil
import kotlin.math.min
import kotlin.random.Random import kotlin.random.Random
import kotlin.reflect.full.createInstance import kotlin.reflect.full.createInstance
@ -37,7 +37,6 @@ abstract class RandomEventNPC(id: Int) : NPC(id) {
val SMOKE_GRAPHICS = Graphics(86) val SMOKE_GRAPHICS = Graphics(86)
var initialized = false var initialized = false
var finalized = false var finalized = false
var timerPaused = false
var ticksLeft = secondsToTicks(180) var ticksLeft = secondsToTicks(180)
private val combatBracket = intArrayOf(10, 20, 40, 60, 90) private val combatBracket = intArrayOf(10, 20, 40, 60, 90)
@ -57,6 +56,7 @@ abstract class RandomEventNPC(id: Int) : NPC(id) {
poofClear(this) poofClear(this)
playGlobalAudio(this.location, Sounds.SMOKEPUFF_1930, ticksToCycles(1)) playGlobalAudio(this.location, Sounds.SMOKEPUFF_1930, ticksToCycles(1))
} }
removeAttribute(player, "random:pause")
finalized = true finalized = true
} }
@ -93,7 +93,6 @@ abstract class RandomEventNPC(id: Int) : NPC(id) {
override fun init() { override fun init() {
initialized = true initialized = true
finalized = false finalized = false
timerPaused = false
spawnLocation ?: terminate() spawnLocation ?: terminate()
location = spawnLocation location = spawnLocation
player.setAttribute("re-npc", this) player.setAttribute("re-npc", this)
@ -150,7 +149,8 @@ abstract class RandomEventNPC(id: Int) : NPC(id) {
} }
fun sayLine(npc: NPC, phrases: Array<String>, hasOpeningPhrase: Boolean, hasOverTimePhrase: Boolean) { fun sayLine(npc: NPC, phrases: Array<String>, hasOpeningPhrase: Boolean, hasOverTimePhrase: Boolean) {
if (!timerPaused && (ticksLeft % 20 == 0 || ticksLeft <= 2)) { //unless the Certer interface is up, speak every 20 ticks, or in the 2nd-to-last tick before attack/note-&-teleport val inInteraction = getAttribute(player, "random:pause", false) //used by Certer
if ((ticksLeft % 20 == 0 || ticksLeft <= 2) && !inInteraction) { //speak every 20 ticks, or in the 2nd-to-last tick before attack/note-&-teleport
var playDwarfWhistle = true var playDwarfWhistle = true
if (ticksLeft == secondsToTicks(180) && hasOpeningPhrase) { if (ticksLeft == secondsToTicks(180) && hasOpeningPhrase) {
sendChat(phrases[0]) sendChat(phrases[0])

View file

@ -6,6 +6,7 @@ import org.rs09.consts.NPCs
import content.global.ame.RandomEventNPC import content.global.ame.RandomEventNPC
import core.api.animate import core.api.animate
import core.api.lock import core.api.lock
import core.api.setAttribute
import core.api.utils.WeightBasedTable import core.api.utils.WeightBasedTable
class CerterNPC(override var loot: WeightBasedTable? = null) : RandomEventNPC(NPCs.GILES_2538) { class CerterNPC(override var loot: WeightBasedTable? = null) : RandomEventNPC(NPCs.GILES_2538) {
@ -33,8 +34,7 @@ class CerterNPC(override var loot: WeightBasedTable? = null) : RandomEventNPC(NP
"It's really rude to ignore someone, ${player.username}!", "It's really rude to ignore someone, ${player.username}!",
"No-one ignores me!" "No-one ignores me!"
) )
player.setAttribute("random:pause", false) setAttribute(player, "certer:reward", false)
player.setAttribute("certer:reward", false)
animate(this, Emotes.BOW.animation, true) animate(this, Emotes.BOW.animation, true)
} }
@ -42,4 +42,4 @@ class CerterNPC(override var loot: WeightBasedTable? = null) : RandomEventNPC(NP
noteAndTeleport() noteAndTeleport()
terminate() terminate()
} }
} }