Skip to content

Commit 5bd8598

Browse files
authored
Bug fixes (#446)
# Description A number of small fixes to address multiple issues reported ## Changes - AI Context files (Useful for AI agents) - UTF8 backspace fix - Scripted abbreviated command handling - Hermit quest fix - Password logging fix - Newbie kit granted on tutorial completion - Script fixes for places where `room.GetPlayers()` is used.
1 parent b776932 commit 5bd8598

File tree

61 files changed

+18306
-28
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+18306
-28
lines changed

_datafiles/world/default/mobs/frostfang/scripts/2-guard-hungry.js

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,38 +86,34 @@ function onIdle(mob, room) {
8686
round = UtilGetRoundNumber();
8787

8888
grumbled = false;
89-
userIds = room.GetPlayers();
89+
allPlayers = room.GetPlayers();
9090

9191
playersTold = mob.GetTempData('playersTold');
9292
if ( playersTold === null ) {
9393
playersTold = {};
9494
}
9595

96-
if ( userIds.length > 0 ) {
96+
if ( allPlayers.length > 0 ) {
9797

98-
for (var i = 0; i < userIds.length; i++) {
98+
for( var i in allPlayers ) {
9999

100-
if ( userIds[i] in playersTold ) {
101-
if ( round < playersTold[userIds[i]] ) {
100+
if ( allPlayers[i].UserId() in playersTold ) {
101+
if ( round < playersTold[allPlayers[i].UserId()] ) {
102102
continue;
103103
}
104104
}
105-
106-
if ( (user = GetUser(userIds[i])) == null ) {
107-
continue;
108-
}
109-
110-
if ( !user.HasQuest("4-start") ) {
105+
106+
if ( !allPlayers[i].HasQuest("4-start") ) {
111107
if ( !grumbled ) {
112108
mob.Command("emote pats his belly as it grumbles.");
113109
grumbled = true;
114110
}
115-
mob.Command("sayto @" + String(userIds[i]) + " I'm so hungry.");
111+
mob.Command("sayto @" + String(allPlayers[i].UserId()) + " I'm so hungry.");
116112
} else {
117-
playersTold[userIds[i]] = round + 500;
113+
playersTold[allPlayers[i].UserId()] = round + 500;
118114
}
119115

120-
playersTold[userIds[i]] = round + 5;
116+
playersTold[allPlayers[i].UserId()] = round + 5;
121117
// Don't need to repeat to every player.
122118
break;
123119
}

_datafiles/world/default/mobs/whispering_wastes/scripts/27-hermit-winterfire.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function onGive(mob, room, eventDetails) {
4949
if (eventDetails.item) {
5050
if (eventDetails.item.ItemId != 4) {
5151
mob.Command("say Finally! My winterfire crystal! Thank you so much!");
52-
user.GiveQuest("4-end");
52+
user.GiveQuest("5-end");
5353
return true;
5454
}
5555
}

_datafiles/world/default/rooms/catacombs/136.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ function onCommand(cmd, rest, user, room) {
2121

2222

2323
players = room.GetPlayers();
24-
for (var i = 0; i < players.length; i++) {
25-
if ( (user = GetUser(players[i])) !== null ) {
26-
SendRoomMessage(138, user.GetCharacterName(true)+" falls into the room from above.", user.UserId());
27-
user.MoveRoom(138);
28-
}
24+
for( var i in players ) {
25+
SendRoomMessage(138, players[i].GetCharacterName(true)+" falls into the room from above.", players[i].UserId());
26+
players[i].MoveRoom(138);
2927
}
3028

3129
return true;

_datafiles/world/default/rooms/tutorial/900.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function onCommand(cmd, rest, user, room) {
2525
ignoreCommand = true;
2626
}
2727

28-
fullCommand = cmd;
28+
fullCommand = ExpandCommand(cmd);
2929
if ( rest.length > 0 ) {
3030
fullCommand = cmd + ' ' + rest;
3131
}

_datafiles/world/default/rooms/tutorial/901.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function onCommand(cmd, rest, user, room) {
2626
ignoreCommand = true;
2727
}
2828

29-
fullCommand = cmd;
29+
fullCommand = ExpandCommand(cmd);
3030
if ( rest.length > 0 ) {
3131
fullCommand = cmd + ' ' + rest;
3232
}

_datafiles/world/default/rooms/tutorial/902.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function onCommand(cmd, rest, user, room) {
2424
ignoreCommand = true;
2525
}
2626

27-
fullCommand = cmd;
27+
fullCommand = ExpandCommand(cmd);
2828
if ( rest.length > 0 ) {
2929
fullCommand = cmd + ' ' + rest;
3030
}

_datafiles/world/default/rooms/tutorial/903.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const teach_commands = ["get cap", "equip cap", "portal"];
44
const teacherMobId = 57;
55
const teacherName = "Orb of Graduation";
66
const capItemId = 20043;
7+
const newbieKitItemId = 100;
78

89
var commandNow = 0; // Which command they are on
910

@@ -16,7 +17,7 @@ function onCommand(cmd, rest, user, room) {
1617

1718
teacherMob = getTeacher(room);
1819

19-
fullCommand = cmd;
20+
fullCommand = ExpandCommand(cmd);
2021
if ( rest.length > 0 ) {
2122
fullCommand = cmd + ' ' + rest;
2223
}
@@ -87,6 +88,9 @@ function onEnter(user, room) {
8788
itm = CreateItem(capItemId);
8889
teacherMob.GiveItem(itm);
8990

91+
itm2 = CreateItem(newbieKitItemId);
92+
user.GiveItem(itm2);
93+
9094
teacherMob.Command('emote appears in a ' + UtilApplyColorPattern("flash of light!", "glowing"));
9195

9296
teacherMob.Command('say Congratulation on getting to the end of the training course!', 1.0);

ai-context/global-summary.md

Lines changed: 278 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)