Issue information

Issue ID
#3926
Status
Working as Intended
Severity
None
Started
Hercules Elf Bot
Dec 11, 2009 0:20
Last Post
Hercules Elf Bot
Dec 11, 2009 0:20
Confirmation
N/A

Hercules Elf Bot - Dec 11, 2009 0:20

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

I found another bug when trying to implement a script to enable summoning monsters from a list.

Here is a copy of my item database entry:

CODE
1866,Freya_Guardian_Branch,Freya's Guardian Branch,0,0,,100,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "FreyaGuardian"; end; },{},{}

And below is a copy of my function:

CODE
function    script    FreyaGuardian    {
    setarray .@Mobs[0], 1038, 1039, 1046, 1086, 1087, 1112, 1115, 1120, 1147, 1150, 1157, 1251, 1373;
    set .@MobCount, getarraysize(.@Mobs);
    set .@Menu$, "";
    
    for(set .@Index, 0; .@MobCount > .@Index; set .@Index, .@Index + 1)
        set .@Menu$, .@Menu$ + getmonsterinfo(.@Mobs[.@Index], MOB_NAME) + ":";

    set .@Option, select(.@Menu$)-1;
    set .@MonsterID, .@Mobs[.@Option];

    if( .@MonsterID <= 0 )
        return 0;

    announce "The power of Freya summons a " + getmonsterinfo(.@Mobs[.@Option], MOB_NAME) + " upon you.", bc_self|bc_yellow;
    monster "this",-1,-1,"--ja--",.@MonsterID,1,"";

    return 0;
}

However, everytime I use the item, a monster is selected and is summoned on the map near the summoner, and the player attached freezes.

It appears that even with "end;" being called after the function has been called, the player is still attached to an NPC and cannot perform any actions at all.

Is this a bug with "end;" not ending the script properly?
Every other part of the code works, except the freezing of character.