Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/engine/entity/Player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2139,6 +2139,16 @@ export default class Player extends PathingEntity {
}
}

isInTutorial(): boolean {
if (this.x >= 3053 && this.x <= 3156 && this.z >= 3056 && this.z <= 3136) {
return true;
} else if (this.x >= 3072 && this.x <= 3118 && this.z >= 9492 && this.z <= 9535) {
return true;
} else {
return false;
}
}

// ----

runScript(script: ScriptState, protect: boolean = false, force: boolean = false) {
Expand Down
8 changes: 6 additions & 2 deletions src/engine/script/handlers/PlayerOps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -768,8 +768,12 @@ const PlayerOps: CommandHandlers = {

check(stat, NumberNotNull);
check(xp, NumberNotNull);

state.activePlayer.addXp(stat, xp);
// Maybe this can go into addXp? Not sure
const player = state.activePlayer;
if (player.levels[stat] >= 3 && player.isInTutorial()) {
return;
}
player.addXp(stat, xp);
}),

[ScriptOpcode.DAMAGE]: state => {
Expand Down
Loading