Issue information

Issue ID
#1125
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Mar 7, 2008 21:52
Last Post
Hercules Elf Bot
Feb 21, 2012 9:12
Confirmation
N/A

Hercules Elf Bot - Mar 7, 2008 21:52

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

A bug I found while checking the other report on this npc, you can get infinite zeny from him now that @input accepts negative values.

CODE
lighthalzen,182,102,3    script    Lucius#zen5    866,{
    if (Zeny < 90000) {
        mes "[Lucius]";
        mes "Hello youngster~";
        mes "Would you like to";
        mes "make a donation";
        mes "to help the hungry?";
        next;
        if (select("Sure.:No, thanks.") == 1) {
            mes "[Lucius]";
            mes "Now, you can donate 1 to";
            mes "30,000 zeny that will be used";
            mes "to support the poor and feed";
            mes "starving children. If you wish";
            mes "to cancel, please enter ''0.''";
            next;
            input .@input;
            if (.@input > 30000) {
                mes "[Lucius]";
                mes "Please enter a value";
                mes "from 1 to 30,000 in";
                mes "order to make a donation";
                mes "to the needy, youngster.";
                close;
            }
            else if (.@input == 0) {
                mes "[Lucius]";
                mes "How disappointing,";
                mes "but I'm sure you have";
                mes "your reasons. Well, when";
                mes "you can afford to give to";
                mes "the needy, you're welcome";
                mes "to come back at any time.";
                close;
            }
            mes "[Lucius]";
            mes "Thank you so much";
            mes "for your " + .@input + " zeny donation.";
            mes "I promise that your money";
            mes "will be put to good use in";
            mes "benefiting the poor and needy.";
            next;
            if (Zeny < .@input) {
                mes "[Lucius]";
                mes "Still, I'm just a little";
                mes "disappointed. An adventurer";
                mes "like you should be donating";
                mes "as much as you possibly can...";
                close;
            }
            set zeny,zeny-.@input;
            set $donatedzeny,$donatedzeny + .@input;
            mes "[Lucius]";
            mes "So far, I've received";
            mes "a total of " + $donatedzeny + " zeny in";
            mes "donations. I'm glad to see";
            mes "that there are still kind and";
            mes "generous people in the world.";
            if ($donatedzeny < 260000) {
                next;
                mes "[Lucius]";
                mes "This should be enough";
                mes "to send to the Poor Relief";
                mes "Organization. Please accept";
                mes "this small gift as a token of";
                mes "my gratitude, adventurer. Bless";
                mes "you, youngster and take care.";
                set $donatedzeny,0;
                getitem 603,1; //Old_Blue_Box
                getitem 12016,1; //Speed_Up_Potion
            }
            close;
        }
        mes "[Lucius]";
        mes "I understand. Still,";
        mes "keep in mind that when";
        mes "you give from your heart,";
        mes "you will be rewarded tenfold.";
        mes "Though I admit, the benefits";
        mes "aren't always readily apparent.";
        close;
    }
    mes "[Lucius]";
    mes "Hello youngster~";
    mes "You seem to be fairly";
    mes "well-off. Money is good";
    mes "to have, but be careful not";
    mes "to become obssessed with it.";
    next;
    mes "[Lucius]";
    mes "When you have the chance,";
    mes "please show your generosity";
    mes "towards others who may be";
    mes "much less fortunate than you.";
    close;
}


This line
CODE
            if (.@input > 30000) {


should be changed to
CODE
            if (.@input > 30000 || .@input < 0) {


(File /npc/cities/lighthanzen.txt, line 558)

OR

The line (566)
CODE
            else if (.@input == 0) {

changed to
CODE
            else if (.@input <= 0) {


This post has been edited by Crashy: Mar 8 2008, 05:37 AM