Issue information

Issue ID
#5570
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Apr 12, 2012 14:36
Last Post
Hercules Elf Bot
May 9, 2012 7:35
Confirmation
Yes (1)
No (0)

Hercules Elf Bot - Apr 12, 2012 14:36

Originally posted by [b]Joseph[/b]
Script: npc/quests/thana_quest.txt
NPC: Machine Devicett4

Problem:

It was scripted in a way that it will execute all the left over cases after the selected case.
Example: When you select "Raise Wheel", and case 1 will be executed. After executing the case 1, it will continue executing with case 2, case 3 and so on.
And, revise on the NPC name too.

The following is just a part of the script:

[CODEBOX]
while (1) {
next;
mes "^3355FFWhich wheel would";
mes "you want to shift?^000000";
next;
switch (select("1st Small Wheel:2nd Small Wheel:1st Big Wheel:2nd Big Wheel:3rd Big Wheel:Check Current Wheel Configuration:Reset Wheels to Default Configuration")) {
case 1:
switch (select("Raise Wheel:Lower Wheel:Press Wheel")) {
case 1:
mes "^EE0000*Choom*^000000";
set @small_1,2;
if ((@small_1 == 2) && (@small_2 == 2) && (@big_1 == 2) && (@big_2 == 2) && (@big_3 == 2)) {
break;
}
case 2:
mes "^00B2EE*Sneeeep*^000000";
set @small_1,1;
if ((@small_1 == 1) && (@small_2 == 1) && (@big_1 == 1) && (@big_2 == 1) && (@big_3 == 1)) {
break;
}
case 3:
mes "^5C246E*Mrreeem*^000000";
set @small_1,3;
if ((@small_1 == 3) && (@small_2 == 3) && (@big_1 == 3) && (@big_2 == 3) && (@big_3 == 3)) {
break;
}
}
case 2:
switch (select("Raise Wheel:Lower Wheel:Press Wheel")) {
case 1:
mes "^5C246E*Mrreeem*^000000";
set @small_2,3;
if ((@small_1 == 3) && (@small_2 == 3) && (@big_1 == 3) && (@big_2 == 3) && (@big_3 == 3)) {
break;
}
case 2:
mes "^EE0000*Choom*^000000";
set @small_2,2;
if ((@small_1 == 2) && (@small_2 == 2) && (@big_1 == 2) && (@big_2 == 2) && (@big_3 == 2)) {
break;
}
case 3:
mes "^00B2EE*Sneeeep*^000000";
set @small_2,1;
if ((@small_1 == 1) && (@small_2 == 1) && (@big_1 == 1) && (@big_2 == 1) && (@big_3 == 1)) {
break;
}
}
case 3:
switch (select("Raise Wheel:Lower Wheel:Vertically Shift Wheel")) {
case 1:
mes "^00B2EE*Sneeeep*^000000";
set @big_1,1;
if ((@small_1 == 1) && (@small_2 == 1) && (@big_1 == 1) && (@big_2 == 1) && (@big_3 == 1)) {
break;
}
case 2:
mes "^5C246E*Mrreeem*^000000";
set @big_1,3;
if ((@small_1 == 3) && (@small_2 == 3) && (@big_1 == 3) && (@big_2 == 3) && (@big_3 == 3)) {
break;
}
case 3:
mes "^EE0000*Choom*^000000";
set @big_1,2;
if ((@small_1 == 2) && (@small_2 == 2) && (@big_1 == 2) && (@big_2 == 2) && (@big_3 == 2)) {
break;
}
}
case 4:
switch (select("Raise Wheel:Lower Wheel:Vertically Shift Wheel")) {
case 1:
mes "^EE0000*Choom*^000000";
set @big_2,2;
if ((@small_1 == 2) && (@small_2 == 2) && (@big_1 == 2) && (@big_2 == 2) && (@big_3 == 2)) {
break;
}
case 2:
mes "^5C246E*Mrreeem*^000000";
set @big_2,3;
if ((@small_1 == 3) && (@small_2 == 3) && (@big_1 == 3) && (@big_2 == 3) && (@big_3 == 3)) {
break;
}
case 3:
mes "^00B2EE*Sneeeep*^000000";
set @big_2,1;
if ((@small_1 == 1) && (@small_2 == 1) && (@big_1 == 1) && (@big_2 == 1) && (@big_3 == 1)) {
break;
}
}
case 5:
switch (select("Raise Wheel:Lower Wheel:Vertically Shift Wheel")) {
case 1:
mes "^EE0000*Choom*^000000";
set @big_3,2;
if ((@small_1 == 2) && (@small_2 == 2) && (@big_1 == 2) && (@big_2 == 2) && (@big_3 == 2)) {
break;
}
case 2:
mes "^00B2EE*Sneeeep*^000000";
set @big_3,1;
if ((@small_1 == 1) && (@small_2 == 1) && (@big_1 == 1) && (@big_2 == 1) && (@big_3 == 1)) {
break;
}
case 3:
mes "^5C246E*Mrreeem*^000000";
set @big_3,3;
if ((@small_1 == 3) && (@small_2 == 3) && (@big_1 == 3) && (@big_2 == 3) && (@big_3 == 3)) {
break;
}
}
case 6:
mes "---Wheel Position---";
if (@small_1 == 0) {
mes "1st Small Wheel: No Change";
}else if (@small_1 == 1) {
mes "1st Small Wheel: Down";
} else if (@small_1 == 2) {
mes "1st Small Wheel: Up";
} else {
mes "1st Small Wheel: Pressed";
}
if (@small_2 == 0) {
mes "2nd Small Wheel: No Change";
} else if (@small_2 == 1) {
mes "2nd Small Wheel: Pressed";
} else if (@small_2 == 2) {
mes "2nd Small Wheel: Down";
} else {
mes "2nd Small Wheel: Up";
}
if (@big_1 == 0) {
mes "1st Big Wheel: No Change";
} else if (@big_1 == 1) {
mes "1st Big Wheel: Up";
} else if (@big_1 == 2) {
mes "1st Big Wheel: Moved";
} else {
mes "1st Big Wheel: Down";
}
if (@big_2 == 0) {
mes "2nd Big Wheel: No Change";
} else if (@big_2 == 1) {
mes "2nd Big Wheel: Moved";
} else if (@big_2 == 2) {
mes "2nd Big Wheel: Up";
} else {
mes "2nd Big Wheel: Down";
}
if (@big_3 == 0) {
mes "3rd Big Wheel: No Change";
} else if (@big_3 == 1) {
mes "3rd Big Wheel: Down";
} else if (@big_3 == 2) {
mes "3rd Big Wheel: Up";
} else {
mes "3rd Big Wheel: Moved";
}
next;
mes "---Wheel Sound---";
if (@small_1 == 0) {
mes "1st Small Wheel: *Br-brak!*";
} else if (@small_1 == 1) {
mes "1st Small Wheel: *Sneeeep*";
} else if (@small_1 == 2) {
mes "1st Small Wheel: *Choom*";
} else {
mes "1st Small Wheel: *Mrreeem*";
} if (@small_2 == 0) {
mes "2nd Small Wheel: *Br-brak!*";
} else if (@small_2 == 1) {
mes "2nd Small Wheel: *Sneeeep*";
} else if (@small_2 == 2) {
mes "2nd Small Wheel: *Choom*";
} else {
mes "2nd Small Wheel: *Mrreeem*";
}
if (@big_1 == 0) {
mes "1st Big Wheel: *Br-brak!*";
} else if (@big_1 == 1) {
mes "1st Big Wheel: *Sneeeep*";
} else if (@big_1 == 2) {
mes "1st Big Wheel: *Choom*";
} else {
mes "1st Big Wheel: *Mrreeem*";
}
if (@big_2 == 0) {
mes "2nd Big Wheel: *Br-brak!*";
} else if (@big_2 == 1) {
mes "2nd Big Wheel: *Sneeeep*";
} else if (@big_2 == 2) {
mes "2nd Big Wheel: *Choom*";
} else {
mes "2nd Big Wheel: *Mrreeem*";
}
if (@big_3 == 0) {
mes "3rd Big Wheel: *Br-brak!*";
} else if (@big_3 == 1) {
mes "3rd Big Wheel: *Sneeeep*";
} else if (@big_3 == 2) {
mes "3rd Big Wheel: *Choom*";
} else {
mes "3rd Big Wheel: *Mrreeem*";
}
case 7:
set @small_1,0;
set @small_2,0;
set @big_1,0;
set @big_2,0;
set @big_3,0;
close;
}
}
[/CODEBOX]

Hercules Elf Bot - Apr 13, 2012 20:51

Originally posted by [b]Joseph[/b]
Have solved it by adding continue and break.

[CODEBOX]
tha_t06,43,152,0 script Machine Device#tt4 111,{
if ((countitem(7424) == 0) && (countitem(7429) == 0)) {
mes "^3355FFYou find a mechanical";
mes "device that has many";
mes "wheels. A black screen";
mes "is mounted on the side";
mes "of the machine.^000000";
next;
switch (select("Investigate:Cancel")) {
case 1:
if ((countitem(7421) >= 1) || (countitem(7422) >= 1) || (countitem(7423) >= 1)) {
mes "^3355FFAs you scrutinize the";
mes "wheels, they respond to";
mes "the key in your inventory by";
mes "emitting light and strange";
mes "noises. After a while, they";
mes "stop and become silent.^000000";
next;
switch (select("Investigate the Machine Chasis:Investigate the Wheels:Cancel")) {
case 1:
mes "^3355FFThe key in your inventory";
mes "does not seem to be affecting";
mes "the machine's chasis. The";
mes "screen mounted on the side";
mes "is still blank and deactivated.^000000";
close;
case 2:
set @small_1,0;
set @small_2,0;
set @big_1,0;
set @big_2,0;
set @big_3,0;
mes "^3355FFYou touch the wheels and";
mes "find that they are actually";
mes "moving very slowly. You note";
mes "that there are 2 small wheels";
mes "and 3 larger wheels, totaling";
mes "5 wheels on this machine.^000000";
next;
mes "^3355FFThe big wheels are moving";
mes "vertically, up and down, as";
mes "they press against the smaller";
mes "wheels to make them rotate.^000000";
next;
mes "^3355FFJudging from the machine's";
mes "shaking and jittery noises, the";
mes "wheels may be misaligned.";
mes "You might be able to activate";
mes "the machine by properly ";
mes "aligning all the wheels.^000000";
while (1) {
next;
mes "^3355FFWhich wheel would";
mes "you want to shift?^000000";
next;
switch (select("1st Small Wheel:2nd Small Wheel:1st Big Wheel:2nd Big Wheel:3rd Big Wheel:Check Current Wheel Configuration:Reset Wheels to Default Configuration")) {
case 1:
switch (select("Raise Wheel:Lower Wheel:Press Wheel")) {
case 1:
mes "^EE0000*Choom*^000000";
set @small_1,2;
if ((@small_1 == 2) && (@small_2 == 2) && (@big_1 == 2) && (@big_2 == 2) && (@big_3 == 2)) {
break;
} continue;
case 2:
mes "^00B2EE*Sneeeep*^000000";
set @small_1,1;
if ((@small_1 == 1) && (@small_2 == 1) && (@big_1 == 1) && (@big_2 == 1) && (@big_3 == 1)) {
break;
} continue;
case 3:
mes "^5C246E*Mrreeem*^000000";
set @small_1,3;
if ((@small_1 == 3) && (@small_2 == 3) && (@big_1 == 3) && (@big_2 == 3) && (@big_3 == 3)) {
break;
} continue;
} break;
case 2:
switch (select("Raise Wheel:Lower Wheel:Press Wheel")) {
case 1:
mes "^5C246E*Mrreeem*^000000";
set @small_2,3;
if ((@small_1 == 3) && (@small_2 == 3) && (@big_1 == 3) && (@big_2 == 3) && (@big_3 == 3)) {
break;
} continue;
case 2:
mes "^EE0000*Choom*^000000";
set @small_2,2;
if ((@small_1 == 2) && (@small_2 == 2) && (@big_1 == 2) && (@big_2 == 2) && (@big_3 == 2)) {
break;
} continue;
case 3:
mes "^00B2EE*Sneeeep*^000000";
set @small_2,1;
if ((@small_1 == 1) && (@small_2 == 1) && (@big_1 == 1) && (@big_2 == 1) && (@big_3 == 1)) {
break;
} continue;
} break;
case 3:
switch (select("Raise Wheel:Lower Wheel:Vertically Shift Wheel")) {
case 1:
mes "^00B2EE*Sneeeep*^000000";
set @big_1,1;
if ((@small_1 == 1) && (@small_2 == 1) && (@big_1 == 1) && (@big_2 == 1) && (@big_3 == 1)) {
break;
} continue;
case 2:
mes "^5C246E*Mrreeem*^000000";
set @big_1,3;
if ((@small_1 == 3) && (@small_2 == 3) && (@big_1 == 3) && (@big_2 == 3) && (@big_3 == 3)) {
break;
} continue;
case 3:
mes "^EE0000*Choom*^000000";
set @big_1,2;
if ((@small_1 == 2) && (@small_2 == 2) && (@big_1 == 2) && (@big_2 == 2) && (@big_3 == 2)) {
break;
} continue;
} break;
case 4:
switch (select("Raise Wheel:Lower Wheel:Vertically Shift Wheel")) {
case 1:
mes "^EE0000*Choom*^000000";
set @big_2,2;
if ((@small_1 == 2) && (@small_2 == 2) && (@big_1 == 2) && (@big_2 == 2) && (@big_3 == 2)) {
break;
} continue;
case 2:
mes "^5C246E*Mrreeem*^000000";
set @big_2,3;
if ((@small_1 == 3) && (@small_2 == 3) && (@big_1 == 3) && (@big_2 == 3) && (@big_3 == 3)) {
break;
} continue;
case 3:
mes "^00B2EE*Sneeeep*^000000";
set @big_2,1;
if ((@small_1 == 1) && (@small_2 == 1) && (@big_1 == 1) && (@big_2 == 1) && (@big_3 == 1)) {
break;
} continue;
} break;
case 5:
switch (select("Raise Wheel:Lower Wheel:Vertically Shift Wheel")) {
case 1:
mes "^EE0000*Choom*^000000";
set @big_3,2;
if ((@small_1 == 2) && (@small_2 == 2) && (@big_1 == 2) && (@big_2 == 2) && (@big_3 == 2)) {
break;
} continue;
case 2:
mes "^00B2EE*Sneeeep*^000000";
set @big_3,1;
if ((@small_1 == 1) && (@small_2 == 1) && (@big_1 == 1) && (@big_2 == 1) && (@big_3 == 1)) {
break;
} continue;
case 3:
mes "^5C246E*Mrreeem*^000000";
set @big_3,3;
if ((@small_1 == 3) && (@small_2 == 3) && (@big_1 == 3) && (@big_2 == 3) && (@big_3 == 3)) {
break;
} continue;
} break;
case 6:
mes "---Wheel Position---";
if (@small_1 == 0) {
mes "1st Small Wheel: No Change";
}else if (@small_1 == 1) {
mes "1st Small Wheel: Down";
} else if (@small_1 == 2) {
mes "1st Small Wheel: Up";
} else {
mes "1st Small Wheel: Pressed";
}
if (@small_2 == 0) {
mes "2nd Small Wheel: No Change";
} else if (@small_2 == 1) {
mes "2nd Small Wheel: Pressed";
} else if (@small_2 == 2) {
mes "2nd Small Wheel: Down";
} else {
mes "2nd Small Wheel: Up";
}
if (@big_1 == 0) {
mes "1st Big Wheel: No Change";
} else if (@big_1 == 1) {
mes "1st Big Wheel: Up";
} else if (@big_1 == 2) {
mes "1st Big Wheel: Moved";
} else {
mes "1st Big Wheel: Down";
}
if (@big_2 == 0) {
mes "2nd Big Wheel: No Change";
} else if (@big_2 == 1) {
mes "2nd Big Wheel: Moved";
} else if (@big_2 == 2) {
mes "2nd Big Wheel: Up";
} else {
mes "2nd Big Wheel: Down";
}
if (@big_3 == 0) {
mes "3rd Big Wheel: No Change";
} else if (@big_3 == 1) {
mes "3rd Big Wheel: Down";
} else if (@big_3 == 2) {
mes "3rd Big Wheel: Up";
} else {
mes "3rd Big Wheel: Moved";
}
next;
mes "---Wheel Sound---";
if (@small_1 == 0) {
mes "1st Small Wheel: *Br-brak!*";
} else if (@small_1 == 1) {
mes "1st Small Wheel: *Sneeeep*";
} else if (@small_1 == 2) {
mes "1st Small Wheel: *Choom*";
} else {
mes "1st Small Wheel: *Mrreeem*";
} if (@small_2 == 0) {
mes "2nd Small Wheel: *Br-brak!*";
} else if (@small_2 == 1) {
mes "2nd Small Wheel: *Sneeeep*";
} else if (@small_2 == 2) {
mes "2nd Small Wheel: *Choom*";
} else {
mes "2nd Small Wheel: *Mrreeem*";
}
if (@big_1 == 0) {
mes "1st Big Wheel: *Br-brak!*";
} else if (@big_1 == 1) {
mes "1st Big Wheel: *Sneeeep*";
} else if (@big_1 == 2) {
mes "1st Big Wheel: *Choom*";
} else {
mes "1st Big Wheel: *Mrreeem*";
}
if (@big_2 == 0) {
mes "2nd Big Wheel: *Br-brak!*";
} else if (@big_2 == 1) {
mes "2nd Big Wheel: *Sneeeep*";
} else if (@big_2 == 2) {
mes "2nd Big Wheel: *Choom*";
} else {
mes "2nd Big Wheel: *Mrreeem*";
}
if (@big_3 == 0) {
mes "3rd Big Wheel: *Br-brak!*";
} else if (@big_3 == 1) {
mes "3rd Big Wheel: *Sneeeep*";
} else if (@big_3 == 2) {
mes "3rd Big Wheel: *Choom*";
} else {
mes "3rd Big Wheel: *Mrreeem*";
} continue;
case 7:
set @small_1,0;
set @small_2,0;
set @big_1,0;
set @big_2,0;
set @big_3,0;
continue;
} break;
}
next;
mes "^3355FFAs you adjust the wheels,";
mes "they suddenly immobilize with";
mes "a firm click. Then, the device's screen activates and displays";
mes "some text while a storage";
mes "compartment underneath";
mes "the monitor slides open.^000000";
next;
switch (select("Read the Screen's Text:Investigate Monitor Storage:Cancel")) {
case 1:
mes "[Log Entry]";
mes "^426F42It was never the humans";
mes "or the gods that built this";
mes "tower: it was the demons.";
mes "Intrigued by this information,";
mes "I decided to try to learn why they had constructed Thanatos Tower.^000000";
next;
mes "[Log Entry]";
mes "^426F42In my research, I learned";
mes "that this tower was used as a";
mes "gate to summon demons from hell during the thousand year war,";
mes "and that the infamous Satan Morroc was one of those summoned here.^000000";
next;
mes "[Log Entry]";
mes "^426F42Satan Morroc... I admit";
mes "that I'm interested in learning";
mes "more about his appearance since";
mes "that occurred at around the same time as when she came to";
mes "Thanatos Tower...^000000";
next;
mes "^3355FFYou've finished";
mes "reading the text";
mes "that was displayed";
mes "on the screen.^000000";
close;
case 2:
mes "^3355FFInside the monitor";
mes "storage compartment,";
mes "you find a small, shining";
mes "key that you decide to take.^000000";
getitem 7424,1; //Key_Green
close;
case 3:
close;
}
case 3:
close;
}
}
mes "^3355FFThis mechanical device is";
mes "activated, as evidenced by";
mes "its gleaming, moving wheels.^000000";
close;
case 2:
mes "^3355FFYou don't see the need to";
mes "investigate if nothing seems";
mes "peculiar or out of place...^000000";
close;
}
}
mes "^3355FFYou found a deactivated";
mes "mechanical device with an";
mes "interesting series of wheels.^000000";
close;
}
[/CODEBOX]

Hercules Elf Bot - Apr 30, 2012 19:23

Originally posted by [b]JayPee[/b]
Fixed in [rev=16022]

This post has been edited by JayPee on Apr 30, 2012 19:48