Issue information

Issue ID
#571
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Dec 9, 2007 7:14
Last Post
Hercules Elf Bot
Dec 9, 2007 7:14
Confirmation
N/A

Hercules Elf Bot - Dec 9, 2007 7:14

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

In npc/guild/gldfunc_treasure.txt
CODE
//================================================
// Treasure Spawning Function
//================================================
function    script    F_GldTreas    {
    if(getarg(10) !=  1) {
        setcastledata getarg(0),4,0;
        setcastledata getarg(0),5,0;

        // Why on earth are we killing old treasure chest spawns?
        //killmonster getarg(0),"Treasure_"+getarg(1)+"::OnDied";

        // Don't spawn treasures if Castle is empty, or Eco is greater than 100
        if(GetCastleData(getarg(0),2) > 100 || GetCastleData(getarg(0),1) == 0) return;

        // Only spawn one treasure chest for notice castles.
        if (compare(getarg(0),"nguild"))
            set getarg(2),1;
        else
            set getarg(2),GetCastleData(getarg(0),2)/5+4;

        if (getarg(2) <= 0) return;

        //sets the counter variable = to the box number amount
        set getarg(3), getarg(2);
    }
    for (set .@i,1; .@i <= getarg(3); set .@i,.@i+1) {
        // set treasure box ID
        set getarg(4), getarg(5)+((getarg(3)+1) & 1);
        areamonster getarg(0),getarg(6),getarg(7),getarg(8),getarg(9),"Treasure Chest",getarg(4),1,"Treasure_"+getarg(1)+"::OnDied";
    }
    return;
}


If you look at the line where it says
CODE
set getarg(4), getarg(5)+((getarg(3)+1) & 1);

It's supposed to alternate two different treasure chests but getarg(3) was never changed so it only spawns the same chest over and over.