new-exp #1

Merged
emo merged 2 commits from new-exp into main 2025-03-04 23:05:15 +00:00
4 changed files with 83 additions and 56 deletions
Showing only changes of commit edbe51194d - Show all commits

View File

@ -8,12 +8,12 @@ import core.game.interaction.InterfaceListener
object RulesAndInfo {
val RULES = arrayOf(
"<col=ffffff>1. Basically just don't be an asshole</col>",
" -No spamming, harassment, or other disruptive behaviors",
" behaviors disruptive behaviors",
" -No spamming, harassment, or other",
" disruptive behaviors",
"<col=ffffff>2. No exploitation of bugs.</col>",
" -Zero tolerance. Can result in account deletion.",
" -If you discover a bug, report it to Emo/admins.",
"<col=ffffff>3. Do not discuss or advertise.</col>",
"<col=ffffff>3. Discuss or Advertising.</col>",
" -Discussion of the live jagex games is fine.",
" -Discussion of open source projects is fine.",
" -No advertising of non-open source RSPSs.",

View File

@ -1,22 +1,22 @@
package content.region.misc.tutisland.dialogue
import content.global.handlers.iface.RulesAndInfo
import content.region.misc.tutisland.handlers.*
import core.ServerConstants
import core.api.*
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.game.node.entity.player.link.IronmanMode
import core.game.node.entity.player.link.TeleportManager
import core.game.node.item.Item
import core.game.world.GameWorld
import core.game.world.map.Location
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import core.worker.ManagementEvents
import org.rs09.consts.Items
import org.rs09.consts.NPCs
import proto.management.JoinClanRequest
import core.ServerConstants
import content.global.handlers.iface.RulesAndInfo
import core.game.world.GameWorld
import core.tools.END_DIALOGUE
import core.worker.ManagementEvents
/**
* Handles the magic tutor's dialogue
@ -52,12 +52,10 @@ class TutorialMagicTutorDialogue(player: Player? = null) : core.game.dialogue.Di
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
when(getAttribute(player, "tutorial:stage", 0))
{
when(getAttribute(player, "tutorial:stage", 0)) {
67 -> playerl(core.game.dialogue.FacialExpression.FRIENDLY, "Hello.")
69 -> npcl(core.game.dialogue.FacialExpression.FRIENDLY, "Good. This is a list of your spells. Currently you can only cast one offensive spell called Wind Strike. Let's try it out on one of those chickens.")
70 -> if(!inInventory(player, Items.AIR_RUNE_556) && !inInventory(player, Items.MIND_RUNE_558))
{
70 -> if(!inInventory(player, Items.AIR_RUNE_556) && !inInventory(player, Items.MIND_RUNE_558)) {
player.dialogueInterpreter.sendDoubleItemMessage(Items.AIR_RUNE_556, Items.MIND_RUNE_558, "You receive some spare runes.")
addItem(player, Items.AIR_RUNE_556, 15)
addItem(player, Items.MIND_RUNE_558, 15)
@ -70,8 +68,7 @@ class TutorialMagicTutorDialogue(player: Player? = null) : core.game.dialogue.Di
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when(getAttribute(player, "tutorial:stage", 0))
{
when(getAttribute(player, "tutorial:stage", 0)) {
67 -> when(stage++){
0 -> npcl(core.game.dialogue.FacialExpression.FRIENDLY, "Good day, newcomer. My name is Terrova. I'm here to tell you about Magic. Let's start by opening your spell list.")
1 -> {
@ -92,43 +89,45 @@ class TutorialMagicTutorDialogue(player: Player? = null) : core.game.dialogue.Di
TutorialStage.load(player, 70)
}
}
71 -> when(stage){
0 -> options("Set Ironman Mode (current: ${player.ironmanManager.mode.name})", "Change XP Rate (current: ${player.skills.experienceMultiplier}x)", "I'm ready now.").also { stage++ }
1 -> when(buttonId){
1 -> options("None","Standard","Ultimate","Nevermind.").also { stage = 10 }
2 -> options("1.0x","2.5x","5.0x").also { stage = 20 }
71 -> when(stage) {
0 -> options(
"Set Ironman Mode (current: ${player.ironmanManager.mode.name})",
"Change XP Rate (current: ${player.skills.experienceMultiplier}x)",
"I'm ready now."
).also { stage++ }
1 -> when(buttonId) {
1 -> options("None", "Standard", "Hardcore (Permadeath!)", "Ultimate", "Nevermind.").also { stage = 10 }
2 -> options("Flat XP Rate Multiplier", "Scaled XP Rate Multiplier", "Back").also { stage = 21 }
3 -> npcl(core.game.dialogue.FacialExpression.FRIENDLY, "Well, you're all finished here now. I'll give you a reasonable number of starting items when you leave.").also { stage = 30 }
}
// Modified submenu branch for XP rate options
21 -> when(buttonId) {
1 -> options("1.0x", "2.5x", "5.0x", "10x").also { stage = 22 }
2 -> options("1.0x", "Scale to 10x", "Scale to 5x").also { stage = 23 }
3 -> options(
"Set Ironman Mode (current: ${player.ironmanManager.mode.name})",
"Change XP Rate (current: ${player.skills.experienceMultiplier}x)",
"I'm ready now."
).also { stage = 1 }
else -> return false
}
10 -> {
stage = 0
if(buttonId < 5)
{
val mode = when (buttonId - 1)
{
0 -> IronmanMode.NONE
1 -> IronmanMode.STANDARD
2 -> IronmanMode.ULTIMATE
else -> IronmanMode.NONE
}
if (mode != IronmanMode.NONE) stage = 11
if(buttonId < 5) {
val mode = IronmanMode.values()[buttonId - 1]
player.dialogueInterpreter.sendDialogue("You set your ironman mode to: ${mode.name}.")
player.ironmanManager.mode = mode
if (player.skills.experienceMultiplier == 10.0) player.skills.experienceMultiplier = 5.0
}
else
{
if (player.skills.experienceMultiplier == 10.0 && mode != IronmanMode.HARDCORE)
player.skills.experienceMultiplier = 5.0
} else {
handle(interfaceId, 0)
}
}
11 -> player.dialogueInterpreter.sendPlainMessage(false, *splitLines("WARNING: You have selected an ironman mode. This is an uncompromising mode that WILL completely restrict your ability to trade. This MAY leave you unable to complete certain content, including quests.")).also { stage = 0 }
20 -> {
val rates = arrayOf(1.0,2.5,5.0)
22 -> {
val rates = arrayOf(1.0, 2.5, 5.0, 10.0)
val rate = rates[buttonId - 1]
if(rate == 10.0) {
player.dialogueInterpreter.sendDialogue("10.0x is no longer available!")
player.skills.experienceMultiplier = 5.0
if(rate == 10.0 && player.ironmanManager.mode != IronmanMode.HARDCORE) {
player.dialogueInterpreter.sendDialogue("10.0x is only available to Hardcore Ironmen!")
stage = 0
return true
}
@ -136,14 +135,24 @@ class TutorialMagicTutorDialogue(player: Player? = null) : core.game.dialogue.Di
player.skills.experienceMultiplier = rate
stage = 0
}
23 -> {
val rates = arrayOf(1.0, 0.1, 0.2)
val rate = rates[buttonId - 1]
if(rate == 0.1) {
player.dialogueInterpreter.sendDialogue("You set your XP rate to scale to be 10x at level 99.")
} else if (rate == 0.2) {
player.dialogueInterpreter.sendDialogue("You set your XP rate to scale to be 5x at level 99.")
} else {
player.dialogueInterpreter.sendDialogue("You set your XP rate to: ${rate}x.")
}
player.skills.experienceMultiplier = rate
stage = 0
}
30 -> player.dialogueInterpreter.sendOptions("Leave Tutorial Island?", "Yes, I'm ready.", "No, not yet.").also { stage++ }
31 -> when(buttonId)
{
31 -> when(buttonId) {
1 -> playerl(core.game.dialogue.FacialExpression.FRIENDLY, "I'm ready to go now, thank you.").also { stage = 40 }
2 -> playerl(core.game.dialogue.FacialExpression.FRIENDLY, "I'm not quite ready to go yet, thank you.").also { stage = END_DIALOGUE }
}
40 -> {
setAttribute(player, "/save:tutorial:complete", true)
setVarbit(player, 3756, 0)
@ -159,14 +168,13 @@ class TutorialMagicTutorDialogue(player: Player? = null) : core.game.dialogue.Di
player.inventory.add(*STARTER_PACK)
player.bank.add(*STARTER_BANK)
if(player.skills.experienceMultiplier == 10.0)
{
if(player.ironmanManager.mode == IronmanMode.HARDCORE) {
setAttribute(player, "/save:permadeath", true)
} else if(player.skills.experienceMultiplier == 10.0) {
player.skills.experienceMultiplier = 5.0
}
//This overwrites the stuck dialogue after teleporting to Lumbridge for some reason
//Dialogue from 2007 or thereabouts
//Original is five lines, but if the same is done here it will break. Need to find another way of showing all this information.
// Overwrites the stuck dialogue after teleporting to Lumbridge
interpreter.sendDialogue(
"Welcome to Lumbridge! To get more help, simply click on the",
"Lumbridge Guide or one of the Tutors - these can be found by looking",
@ -194,7 +202,6 @@ class TutorialMagicTutorDialogue(player: Player? = null) : core.game.dialogue.Di
ManagementEvents.publish(clanJoin.build())
}
}
12 -> {
player.setAttribute("close_c_", true)
end()
@ -207,5 +214,4 @@ class TutorialMagicTutorDialogue(player: Player? = null) : core.game.dialogue.Di
override fun getIds(): IntArray {
return intArrayOf(NPCs.MAGIC_INSTRUCTOR_946)
}
}

View File

@ -287,9 +287,30 @@ public final class Skills {
* @return The experience mod.
*/
private double getExperienceMod(int slot, double experience, boolean playerMod, boolean multiplyer) {
// Emo has hijacked this method to enable the scaling of the exp multiplier
//Keywords for people ctrl + Fing the project
//xprate xp rate xp multiplier skilling rate
return experienceMultiplier;
if (experienceMultiplier == 0.1) { // exp multiplier placeholder for 10x at 100
double mult = (1 + ((this.experience[slot] * 9) / 13034431)); // 13034431 is the exp for 99, meaning this formula hits 10x at 99
if (mult < 1.0) {
return 1.0;
} else if (mult > 10.0) {
return 10.0;
} else {
return mult;
}
} else if (experienceMultiplier == 0.2) { // exp multiplier placeholder for 5x at 100
double mult = (1 + ((this.experience[slot] * 4) / 13034431)); // 13034431 is the exp for 99, meaning this formula hits 5x at 99
if (mult < 1.0) {
return 1.0;
} else if (mult > 5.0) {
return 5.0;
} else {
return mult;
}
} else {
return experienceMultiplier;
}
/*if (!(entity instanceof Player)) {
return 1.0;
}

View File

@ -23,13 +23,13 @@ noauth_default_admin = false #NOTE: If we are not using auth, this determines wh
#The limit on how many different accounts a player can log into per day.
daily_accounts_per_ip = 3
watchdog_enabled = true
connectivity_check_url = "https://duckduckgo.com,https://emoscape.org"
connectivity_check_url = "https://google.com,https://emoscape.org"
connectivity_timeout = 500
[database]
database_name = "global"
database_username = "root"
database_password = ""
database_username = "scape"
database_password = "TestPass"
database_address = "127.0.0.1"
database_port = "3306"