Skip to content

Commit fbd5734

Browse files
committed
Fixing scripts
1 parent 4565d95 commit fbd5734

File tree

8 files changed

+17
-11
lines changed

8 files changed

+17
-11
lines changed

_datafiles/sample-scripts/mobs/item-gold-quest.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function onAsk(mob, room, eventDetails) {
4646
//
4747
// Search the text they inputted for the "ask" command for one of the questStartSubjects
4848
//
49-
match = UtilFindMatchIn(eventDetails.askText, questStartSubjects);
49+
var match = UtilFindMatchIn(eventDetails.askText, questStartSubjects);
5050

5151
if ( match.found ) {
5252

@@ -66,7 +66,7 @@ function onAsk(mob, room, eventDetails) {
6666
// By this point in the script we know they've at least started the quest
6767
// Lets see if they are asking any follow up questions for more info.
6868
//
69-
match = UtilFindMatchIn(eventDetails.askText, questInfoSubjects);
69+
var match = UtilFindMatchIn(eventDetails.askText, questInfoSubjects);
7070
if ( match.found ) {
7171
mob.Command("emote thinks hard for a moment.");
7272
mob.Command("say You can get sharp sticks from a shop, and gold from selling objects, or possibly killing bad guys and looting them.");
@@ -170,7 +170,7 @@ function onGive(mob, room, eventDetails) {
170170
//
171171
// If they gave too much gold, lets give them back the change.
172172
//
173-
excessGold = eventDetails.gold - REQUIRED_GOLD_AMOUNT;
173+
var excessGold = eventDetails.gold - REQUIRED_GOLD_AMOUNT;
174174
if ( excessGold > 0 ) {
175175
mob.Command("say Here's your change.");
176176
mob.Command("give "+String(excessGold)+" gold " + user.ShorthandId()); // Give it to the player using shorthand

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ function onIdle(mob, room) {
137137

138138
if ( sizeAfter != sizeBefore ) {
139139
if ( sizeAfter == 0 ) {
140+
mob.SetTempData('playersTold', null);
141+
} else {
140142
mob.SetTempData('playersTold', playersTold);
141143
}
142-
} else {
143-
mob.SetTempData('playersTold', null);
144144
}
145145

146146
action = round % 3;

_datafiles/world/default/mobs/frostfang/scripts/26-frostfang_citizen-rattrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function onAsk(mob, room, eventDetails) {
1919

2020
mob.Command("say Thanks for picking it up!");
2121

22-
user.GetParty().GiveQuest("7-gettrap");
22+
user.GetParty().GiveQuest("7-tradetrap");
2323

2424
return true;
2525
}

_datafiles/world/default/mobs/frostfang/scripts/39-elara.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function onGive(mob, room, eventDetails) {
6868
mob.Command("emote Shows you some useful gestures.");
6969
mob.Command("say Check your <ansi fg=\"command\">spellbook</ansi>.");
7070

71-
party = user.GetParty().LearnSpell("illum");
71+
user.GetParty().LearnSpell("illum");
7272

7373
return true;
7474
}

_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
@@ -47,7 +47,7 @@ function onGive(mob, room, eventDetails) {
4747
}
4848

4949
if (eventDetails.item) {
50-
if (eventDetails.item.ItemId != 4) {
50+
if (eventDetails.item.ItemId == 4) {
5151
mob.Command("say Finally! My winterfire crystal! Thank you so much!");
5252
user.GetParty().GiveQuest("5-end");
5353
return true;

_datafiles/world/default/rooms/frostfang/35.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
const magic_phrase = "zyphrial lumara vorthos";
44

5+
// EventFlags constants
6+
const EventFlags = {
7+
CmdSkipScripts: 1,
8+
CmdBlockInputUntilComplete: 2
9+
};
10+
511
function onCommand_west(rest, user, room) {
612

713
if ( !user.HasQuest("3-end") ) {

_datafiles/world/default/spells/sparks.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ function onMagic(sourceActor, targetActors) {
4242
SendRoomMessage(roomId, sourceName+' stops chanting and lets loose a shower of sparks, hitting '+targetName+'.', sourceUserId, targetUserId);
4343

4444
// Tell the target about the dmg
45-
SendUserMessage(targetUserId, sourceName+' stops chanting fires a shower of sparks at you, hitting for <ansi fg="damage">'+dmgAmtStr+' damage</ansi>.');
45+
SendUserMessage(targetUserId, sourceName+' stops chanting and fires a shower of sparks at you, hitting for <ansi fg="damage">'+dmgAmtStr+' damage</ansi>.');
4646

4747
} else {
4848

4949
// Tell the cast they did it to themselves
50-
SendUserMessage(sourceUserId, 'You stop chanting and fires a shower of sparks at yourself, doing <ansi fg="damage">'+dmgAmtStr+' damage</ansi>.');
50+
SendUserMessage(sourceUserId, 'You stop chanting and fire a shower of sparks at yourself, doing <ansi fg="damage">'+dmgAmtStr+' damage</ansi>.');
5151

5252
// Tell the room about the dmg, except the source and target
5353
SendRoomMessage(roomId, sourceName+' stops chanting and fires a shower of sparks at themselves, hurting themselves.', sourceUserId, targetUserId);

_datafiles/world/default/spells/tameskill.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function onWait(sourceActor, targetActor) {
9191
break;
9292
default:
9393
SendUserMessage(sourceActor.UserId(), '<ansi fg="219">You whistle several times, changing your pitch ever so slightly.</ansi>');
94-
SendRoomMessage(sourceActor.GetRoomId(), `<ansi fg="219">`+sourceActor.GetCharacterName(true)+' whistles several times, changing your pitch ever so slightly.</ansi>', sourceActor.UserId());
94+
SendRoomMessage(sourceActor.GetRoomId(), `<ansi fg="219">`+sourceActor.GetCharacterName(true)+' whistles several times, changing their pitch ever so slightly.</ansi>', sourceActor.UserId());
9595
}
9696

9797
}

0 commit comments

Comments
 (0)