Skip to content
Merged
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
24 changes: 10 additions & 14 deletions _datafiles/world/default/mobs/frostfang/scripts/2-guard-hungry.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,38 +86,34 @@ function onIdle(mob, room) {
round = UtilGetRoundNumber();

grumbled = false;
userIds = room.GetPlayers();
allPlayers = room.GetPlayers();

playersTold = mob.GetTempData('playersTold');
if ( playersTold === null ) {
playersTold = {};
}

if ( userIds.length > 0 ) {
if ( allPlayers.length > 0 ) {

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

if ( userIds[i] in playersTold ) {
if ( round < playersTold[userIds[i]] ) {
if ( allPlayers[i].UserId() in playersTold ) {
if ( round < playersTold[allPlayers[i].UserId()] ) {
continue;
}
}

if ( (user = GetUser(userIds[i])) == null ) {
continue;
}

if ( !user.HasQuest("4-start") ) {

if ( !allPlayers[i].HasQuest("4-start") ) {
if ( !grumbled ) {
mob.Command("emote pats his belly as it grumbles.");
grumbled = true;
}
mob.Command("sayto @" + String(userIds[i]) + " I'm so hungry.");
mob.Command("sayto @" + String(allPlayers[i].UserId()) + " I'm so hungry.");
} else {
playersTold[userIds[i]] = round + 500;
playersTold[allPlayers[i].UserId()] = round + 500;
}

playersTold[userIds[i]] = round + 5;
playersTold[allPlayers[i].UserId()] = round + 5;
// Don't need to repeat to every player.
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function onGive(mob, room, eventDetails) {
if (eventDetails.item) {
if (eventDetails.item.ItemId != 4) {
mob.Command("say Finally! My winterfire crystal! Thank you so much!");
user.GiveQuest("4-end");
user.GiveQuest("5-end");
return true;
}
}
Expand Down
8 changes: 3 additions & 5 deletions _datafiles/world/default/rooms/catacombs/136.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ function onCommand(cmd, rest, user, room) {


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

return true;
Expand Down
2 changes: 1 addition & 1 deletion _datafiles/world/default/rooms/tutorial/900.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function onCommand(cmd, rest, user, room) {
ignoreCommand = true;
}

fullCommand = cmd;
fullCommand = ExpandCommand(cmd);
if ( rest.length > 0 ) {
fullCommand = cmd + ' ' + rest;
}
Expand Down
2 changes: 1 addition & 1 deletion _datafiles/world/default/rooms/tutorial/901.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function onCommand(cmd, rest, user, room) {
ignoreCommand = true;
}

fullCommand = cmd;
fullCommand = ExpandCommand(cmd);
if ( rest.length > 0 ) {
fullCommand = cmd + ' ' + rest;
}
Expand Down
2 changes: 1 addition & 1 deletion _datafiles/world/default/rooms/tutorial/902.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function onCommand(cmd, rest, user, room) {
ignoreCommand = true;
}

fullCommand = cmd;
fullCommand = ExpandCommand(cmd);
if ( rest.length > 0 ) {
fullCommand = cmd + ' ' + rest;
}
Expand Down
6 changes: 5 additions & 1 deletion _datafiles/world/default/rooms/tutorial/903.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const teach_commands = ["get cap", "equip cap", "portal"];
const teacherMobId = 57;
const teacherName = "Orb of Graduation";
const capItemId = 20043;
const newbieKitItemId = 100;

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

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

teacherMob = getTeacher(room);

fullCommand = cmd;
fullCommand = ExpandCommand(cmd);
if ( rest.length > 0 ) {
fullCommand = cmd + ' ' + rest;
}
Expand Down Expand Up @@ -87,6 +88,9 @@ function onEnter(user, room) {
itm = CreateItem(capItemId);
teacherMob.GiveItem(itm);

itm2 = CreateItem(newbieKitItemId);
user.GiveItem(itm2);

teacherMob.Command('emote appears in a ' + UtilApplyColorPattern("flash of light!", "glowing"));

teacherMob.Command('say Congratulation on getting to the end of the training course!', 1.0);
Expand Down
278 changes: 278 additions & 0 deletions ai-context/global-summary.md

Large diffs are not rendered by default.

Loading