Issue information

Issue ID
#3519
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Aug 22, 2009 10:40
Last Post
Hercules Elf Bot
Mar 5, 2012 16:09
Confirmation
N/A

Hercules Elf Bot - Aug 22, 2009 10:40

Originally posted by [b]Kazukin[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=3519

Since previous versions of this quest were coded pretty badly (thanks for rescripting it!), a lot of intermediate variables were left set. This function doesn't take into account this and tries to save progress using the intermediate variables as if they were cleared when the player completed that portion (which is how it should be). This causes a mess in the player quest progress and gives everyone with signengelhour and signquest variables set (they are left set after finishing that portion of the quest by previous scripts) extra 'The Sign' s (ID#7314).

I noticed this when updating my server to a new revision, with a lot of players having completed it using the old scripts. I have added some extra checks in the second portion of the function, which attempts to save progress using these intermediate variables to prevent this. I have tested it and it seems to fix the main problem, but I haven't checked if the progress is saved successfully.
QUOTE
// Attmept to save using the intermediate variables.
if (sign_fail == 1) { set sign_q,200; }
else if (sign_fail >= 2) { set sign_q,201; }

if (ariantest >= 2 && signquest == 4) { set sign_q,ariantest+3; }
if (gaanantest == 1 && signquest == 4) { set sign_q,12; }

if (SignJore == 1 && signquest == 6) { set sign_q,16; }
if (ScareAlchSign == 1 && signquest == 7) { set sign_q,18; }

if (dearles_test == 1 && signquest == 11) { set sign_q,28; }
else if (dearles_test == 2 && signquest == 11) { set sign_q,29; }
else if (dearles_test == 3 && signquest == 11) { set sign_q,30; }

if (SignDance == 1 && signquest == 11) { set sign_q,32; }
else if (SignDance == 2 && signquest == 11) { set sign_q,33; }

if ((bakerlan_test >= 1) && (bakerlan_test <= 3) && (signquest == 12)) { set sign_q,bakerlan_test+35; }
else if ((bakerlan_test >= 4) && (bakerlan_test <= 6) && (signquest == 12)) { set sign_q,bakerlan_test+36; }
else if ((bakerlan_test >= 7) && (bakerlan_test <= 13) && (signquest == 12)) { set sign_q,bakerlan_test+39; }

if ((signanvil >= 1 && signanvil <= 4 && signquest == 18) || (signanvil >= 1 && signanvil <= 4 && signquest == 22)) { set sign_sq,signanvil+57; }

// Because of the horrible way this was scripted, it's incompatable
// With the new script, So I am resetting the quest to the start
// of this step.
if (signlaichin >= 1 && countitem(7306) || signlaichin >= 1 && countitem(7307)) {
mes "^FF0000You stumble and drop your^000000";
if (countitem(7306)) {
mes "^FF0000"+getitemname(7306)+"^000000";
}
if (countitem(7306) && countitem(7307)) {
mes "^FF0000and^000000";
}
if (countitem(7307)) {
mes "^FF0000"+getitemname(7307)+"^000000";
}
mes "^FF0000pieces on the ground and they vanish! Perhaps you should talk to Lachin.^000000";
delitem 7306,countitem(7306); //Fragment_Of_Soul
delitem 7307,countitem(7307); //Whisper_Of_Soul
set sign_q,rand(97,100);
}

// Same BS as above, unable to save pickup time for 'The Sign' from Engel.
if (signengelhour && signquest == 62) {
mes "^FF0000You see that Engel has forgotten to look at 'The Sign', how you got it back is a mystery too you, but you should remind Engel that he needs to look at it.^000000";
getitem 7314,1; //The_Sign
set sign_q,139;
}

if (Sign_Branch8A == 1 && signquest == 55) { set sign_q,119; }
else if (Sign_Branch8A == 2 && signquest == 55) { set sign_q,120; }
else if (Sign_Branch8A == 3 && signquest == 55) { set sign_q,122; }
else if (Sign_Branch8A == 4 && signquest == 55) { set sign_q,124; }
else if (Sign_Branch8A == 5 && signquest == 55) { set sign_q,134; }
else if ((Sign_Branch8A == 7 && signquest == 55) || (Sign_Branch8A == 8 && signquest == 55)) { set sign_q,126; }

// Incompatable with the new version.
if (Sign_Branch8B > 0 && signquest == 55) {
mes "^FF0000Something is wrong, perhaps you should go talk to Serin again.^000000";
set sign_q,132;
}

// Incompatable with the new version. Again.
if (Sign_Branch2B && signquest < 47 && signquest > 32) {
set sign_q,84;
}

// Unable to save when the Sign should be picked up from Metz
if (signmetzhour && signquest == 60) {
mes "^FF0000You see that Metz has forgotten to look at 'The Sign', how you got it back is a mystery too you, but you should remind Metz that he needs to look at it.^000000";
getitem 7314,1; //The_Sign
set sign_q,138;
}


And, although it is unrelated, I will use this post to report a minor error with a zeny check in the script. When talking to NPC 'Mad Man#s' or Laichin, if you select 'Pay Laichin 40,000 Zeny' > 'What do you mean by big and small?', this zeny check should check for 60,000z instead of 20,000:
QUOTE
mes "[Laichin]";
mes "What do I mean by";
mes "big and small? Hey man,";
mes "the answer to that is worth";
mes "at least... 20,000 Zeny.";
mes "If you wanna know,";
mes "cough up the cash!";
next;
switch(select("Don't pay him.:Pay him.")) {

...

case 2:
- if (Zeny < 20000) {
+ if (Zeny < 60000) {

mes "[Laichin]";
mes "What is this?";
mes "You tryin to welch";
mes "me or somethin'?";
emotion e_pif;
close;
}
else {
mes "[Laichin]";
mes "Alright, listen up.";
mes "Big, small and very small";
mes "mean the distances from the";
mes "center of the map. So for big,";
mes "I mean look near the border of";
mes "the map. Easy, huh?";
next;
mes "[Laichin]";
mes "When I say small, you";
mes "gotta look in areas closer";
mes "than the borders of the map.";
mes "For very small, you gotta";
mes "look near the center. Got it?";
set zeny,zeny-60000;