Issue information

Issue ID
#1747
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Jun 23, 2008 16:10
Last Post
Hercules Elf Bot
Feb 21, 2012 14:07
Confirmation
N/A

Hercules Elf Bot - Jun 23, 2008 16:10

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

On the last part of training grounds, Hanson will ask you question for a personality test. After that he will recommend you a job, then there will be two choices, "Follow what he recommends" or "My Own Choice". If you chose the second one, a menu will pop-up but without the swordsman class on the menu.

Here's the function:
job\novice.txt line 3832:
QUOTE
S_UserJobchoice:
mes "[Hanson]";
mes "I see. It's your choice.";
mes "There is no obligation to change to the job we recommend. Please choose the job you wish to become.";
next;
select("Mage:Merchant:Thief:Archer:Acolyte");
mes "[Hanson]";
mes "You have chosen";


I think its more than that because it should make a dynamic menu so that the NPC will not display the job that he recommended the player.

Solution:
What I did is add a value passed by the callsub S_UserJobchoice;

For example, If the npc recommended the player to be a Swordsman but the player chose the menu "My Own Choice" then callsub will be
CODE
callsub S_UserJobchoice,"Swordsman";


Then on the S_UserJobchoice function, the NPC will make a dynamic menu so the job that the NPC recommended will not be shown.
CODE
S_UserJobchoice:
    mes "[Hanson]";
    mes "I see. It's your choice.";
    mes "There is no obligation to change to the job we recommend. Please choose the job you wish to become.";
    next;
    setarray .@JOBS$[0],"Swordsman","Mage","Merchant","Thief","Archer","Acolyte";
    
    for( set .@i,0; .@i < getarraysize(.@JOBS$); set .@i,.@i+1 )
    {
        if(.@JOBS$[@i] == getarg(0)) set .@menu$,.@menu$+":";
            else set .@menu$,.@menu$+.@JOBS$[@i]+":";
    }
    set .@menu, select(.@menu$) -1;
    if( .@JOBS$[.@menu] == "Swordsman" ) set @menu,1;
    else if( .@JOBS$[.@menu] == "Mage" ) set @menu,2;
    else if( .@JOBS$[.@menu] == "Merchant" ) set @menu,3;
    else if( .@JOBS$[.@menu] == "Thief" ) set @menu,4;
    else if( .@JOBS$[.@menu] == "Archer" ) set @menu,5;
    else if( .@JOBS$[.@menu] == "Acolyte" ) set @menu,6;
    mes "[Hanson]";
    mes "You have chosen";


Here's the updated file of Hanson NPC:
Attached File  hanson.txt ( 38.76K ) Number of downloads: 37


EDIT:
Updated added Saithis' optimization.

This post has been edited by GM-windsor-: Jun 25 2008, 07:56 AM