summaryrefslogblamecommitdiff
path: root/world/map/npc/048-2/slimes.txt
blob: dceaad7a98b061d60abb35f7618886dfc6faf44f (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                                                         
                                                  
 
                                                                                          







                                                                                                   
                        

                          
                   
                    














                                                                                                                                    

 
                                       
 
        





                                                                                                         
                                                                                                       
























                                                                                        
                                                                                                                   











                                                                                             
                                                                                           
                   
                        




                 
                                                   
 
                                                                                          







                                                                                                   
                        

                          
                   
                    














                                                                                                                                    

 
                                        
 
        





                                                                                                           
                                                                                                       
























                                                                                        
                                                                                                                   











                                                                                             
                                                                                           
                   
                        




                 
                                                   
 
                                                                                          







                                                                                                   
                        

                          
                   
                    














                                                                                                                                    

 
                                        
 
        





                                                                                                           
                                                                                                       
























                                                                                        
                                                                                                                   











                                                                                             
                                                                                           
                   
                        




                 
                                                  
 
                                                                                          







                                                                                                   
                        

                          
                   
                    














                                                                                                                                    

 
                                       
 
        





                                                                                                         
                                                                                                       
























                                                                                        
                                                                                                                   











                                                                                             
                                                                                           
                   
                        




                 
                                                  
 
                                                                                          







                                                                                                   
                        

                          
                   
                    














                                                                                                                                    

 
                                       
 
        





                                                                                                         
                                                                                                       
























                                                                                        
                                                                                                                   











                                                                                             
                                                                                           
                   
                        




                 
                                                   
 
                                                                                          







                                                                                                   
                        

                          
                   
                    














                                                                                                                                    

 
                                        
 
        





                                                                                                           
                                                                                                       
























                                                                                        
                                                                                                                   











                                                                                             
                                                                                           
                   
                        




                 
                                                   
 
                                                                                          







                                                                                                   
                        

                          
                   
                    














                                                                                                                                    

 
                                        
 
        





                                                                                                          
                                                                                                       
























                                                                                        
                                                                                                                   











                                                                                             
                                                                                           
                   
                        

                 
// Part of Blue Sage quests
// author: Jenalya
// see bluesageConfig for detailed quest description
// Slime spawns for the slime hunting subquest

// Variables:
// $@Q_BlueSageSlimeX:      Flag to save if a spawn point X is cleared
// $@BlueSageSlimeX_Amount: Number of slimes spawned at spawn point X
// $@BlueSageSlimeX_Spawn:  Number of slimes alive from spawn point X
// $@SlimeXVictimID:        ID of character that triggered the spawn at X

// @slimes:                 Value of the byte 2 of QUEST_BlueSage, used only to check if started/complete
// @spawnSlimeX:            Number of slimes killed by the character that triggered the spawn

// white slimes
048-2.gat,181,95,0|script|#Slime0Trigger|32767,2,2
{
    set @slimes, ((QUEST_BlueSage & $@Q_BlueSageSlimes_MASK) >> $@Q_BlueSageSlimes_SHIFT);

    if (mobcount("048-2.gat", "#Slime0::OnSlimeDeath") < 0) // returns -1 if no monsters
        set $@BlueSageSlime0_Spawn, 0;

    // if finished or haven't started yet or spawn already active or spawn already done, do nothing
    if ((@slimes == 0) || ($@BlueSageSlime0_Spawn > 0) || (QUEST_BlueSage & $@Q_BlueSageSlime0))
        end;

    set @spawnSlime0, 0;
    set @chance, rand(20);
    if (@chance < 6)
        goto L_End;
    if (@chance < 7)
        goto L_BlowUp;

    set $@Slime0VictimID, getcharid(3);
    donpcevent "#Slime0::OnSpawn";
    goto L_End;

L_BlowUp:
    percentheal -100, 0;
    message strcharinfo(0), "A slime dripped out of a bookshelf right in front of you and stepped onto it. It exploded. That hurt.";
    goto L_End;

L_End:
    set @chance, 0;
    set @slimes, 0;
    end;
}

048-2.gat,181,95,0|script|#Slime0|32767
{
    end;

OnSpawn:
    if (attachrid($@Slime0VictimID) == 0)
        goto L_Clean;
    set $@BlueSageSlime0_Spawn, $@BlueSageSlime0_Amount;
    areamonster "048-2.gat", 178, 92, 184, 98, "", 1093, $@BlueSageSlime0_Spawn, "#Slime0::OnSlimeDeath";
    message strcharinfo(0), "You notice a group of slimes emerging from the debris among the shelves.";
    end;

OnSlimeDeath:
    set $@BlueSageSlime0_Spawn, $@BlueSageSlime0_Spawn - 1;
    if (mobcount("048-2.gat", "#Slime0::OnSlimeDeath") < 0) // returns -1 if no monsters
        set $@BlueSageSlime0_Spawn, 0;

    if ($@Slime0VictimID == getcharid(3))
        goto L_Count;
    if ($@BlueSageSlime0_Spawn == 0)
        goto L_ClearedPoint;
    end;

L_Clean:
    set $@Slime0VictimID, 0;
    end;

L_Count:
    set @spawnSlime0, @spawnSlime0 + 1;
    if ($@BlueSageSlime0_Spawn == 0)
        goto L_ClearedPoint;
    end;

L_SlimesEscaped:
    set @spawnSlime0, 0;
    message strcharinfo(0), "You don't see any slimes from that nest anymore. But did you really get all of them?";
    goto L_Clean;

L_ClearedPoint:
    if (attachrid($@Slime0VictimID) == 0)
        goto L_Clean;
    if (rand($@BlueSageSlime0_Amount - @spawnSlime0) != 0)
        goto L_SlimesEscaped;
    set QUEST_BlueSage, QUEST_BlueSage | $@Q_BlueSageSlime0;
    message strcharinfo(0), "It wasn't easy, but you think that you extinguished this nest.";

    set @slimes, ((QUEST_BlueSage & $@Q_BlueSageSlimes_MASK) >> $@Q_BlueSageSlimes_SHIFT);
    if (@slimes == 255)
        message strcharinfo(0), "That was a lot of slimes. You wonder if you're done now.";
    set @slimes, 0;
    set @spawnSlime0, 0;
    goto L_Clean;
}


// white slimes
048-2.gat,164,123,0|script|#Slime1Trigger|32767,2,2
{
    set @slimes, ((QUEST_BlueSage & $@Q_BlueSageSlimes_MASK) >> $@Q_BlueSageSlimes_SHIFT);

    if (mobcount("048-2.gat", "#Slime1::OnSlimeDeath") < 0) // returns -1 if no monsters
        set $@BlueSageSlime1_Spawn, 0;

    // if finished or haven't started yet or spawn already active or spawn already done, do nothing
    if ((@slimes == 0) || ($@BlueSageSlime1_Spawn > 0) || (QUEST_BlueSage & $@Q_BlueSageSlime1))
        end;

    set @spawnSlime1, 0;
    set @chance, rand(20);
    if (@chance < 6)
        goto L_End;
    if (@chance < 7)
        goto L_BlowUp;

    set $@Slime1VictimID, getcharid(3);
    donpcevent "#Slime1::OnSpawn";
    goto L_End;

L_BlowUp:
    percentheal -100, 0;
    message strcharinfo(0), "A slime dripped out of a bookshelf right in front of you and stepped onto it. It exploded. That hurt.";
    goto L_End;

L_End:
    set @chance, 0;
    set @slimes, 0;
    end;
}

048-2.gat,164,123,0|script|#Slime1|32767
{
    end;

OnSpawn:
    if (attachrid($@Slime1VictimID) == 0)
        goto L_Clean;
    set $@BlueSageSlime1_Spawn, $@BlueSageSlime1_Amount;
    areamonster "048-2.gat", 161, 120, 167, 126, "", 1093, $@BlueSageSlime1_Spawn, "#Slime1::OnSlimeDeath";
    message strcharinfo(0), "You notice a group of slimes emerging from the debris among the shelves.";
    end;

OnSlimeDeath:
    set $@BlueSageSlime1_Spawn, $@BlueSageSlime1_Spawn - 1;
    if (mobcount("048-2.gat", "#Slime1::OnSlimeDeath") < 0) // returns -1 if no monsters
        set $@BlueSageSlime1_Spawn, 0;

    if ($@Slime1VictimID == getcharid(3))
        goto L_Count;
    if ($@BlueSageSlime1_Spawn == 0)
        goto L_ClearedPoint;
    end;

L_Clean:
    set $@Slime1VictimID, 0;
    end;

L_Count:
    set @spawnSlime1, @spawnSlime1 + 1;
    if ($@BlueSageSlime1_Spawn == 0)
        goto L_ClearedPoint;
    end;

L_SlimesEscaped:
    set @spawnSlime1, 0;
    message strcharinfo(0), "You don't see any slimes from that nest anymore. But did you really get all of them?";
    goto L_Clean;

L_ClearedPoint:
    if (attachrid($@Slime1VictimID) == 0)
        goto L_Clean;
    if (rand($@BlueSageSlime1_Amount - @spawnSlime1) != 0)
        goto L_SlimesEscaped;
    set QUEST_BlueSage, QUEST_BlueSage | $@Q_BlueSageSlime1;
    message strcharinfo(0), "It wasn't easy, but you think that you extinguished this nest.";

    set @slimes, ((QUEST_BlueSage & $@Q_BlueSageSlimes_MASK) >> $@Q_BlueSageSlimes_SHIFT);
    if (@slimes == 255)
        message strcharinfo(0), "That was a lot of slimes. You wonder if you're done now.";
    set @slimes, 0;
    set @spawnSlime1, 0;
    goto L_Clean;
}


// white slimes
048-2.gat,198,115,0|script|#Slime2Trigger|32767,2,2
{
    set @slimes, ((QUEST_BlueSage & $@Q_BlueSageSlimes_MASK) >> $@Q_BlueSageSlimes_SHIFT);

    if (mobcount("048-2.gat", "#Slime2::OnSlimeDeath") < 0) // returns -1 if no monsters
        set $@BlueSageSlime2_Spawn, 0;

    // if finished or haven't started yet or spawn already active or spawn already done, do nothing
    if ((@slimes == 0) || ($@BlueSageSlime2_Spawn > 0) || (QUEST_BlueSage & $@Q_BlueSageSlime2))
        end;

    set @spawnSlime2, 0;
    set @chance, rand(20);
    if (@chance < 6)
        goto L_End;
    if (@chance < 7)
        goto L_BlowUp;

    set $@Slime2VictimID, getcharid(3);
    donpcevent "#Slime2::OnSpawn";
    goto L_End;

L_BlowUp:
    percentheal -100, 0;
    message strcharinfo(0), "A slime dripped out of a bookshelf right in front of you and stepped onto it. It exploded. That hurt.";
    goto L_End;

L_End:
    set @chance, 0;
    set @slimes, 0;
    end;
}

048-2.gat,198,115,0|script|#Slime2|32767
{
    end;

OnSpawn:
    if (attachrid($@Slime2VictimID) == 0)
        goto L_Clean;
    set $@BlueSageSlime2_Spawn, $@BlueSageSlime2_Amount;
    areamonster "048-2.gat", 195, 112, 201, 118, "", 1093, $@BlueSageSlime2_Spawn, "#Slime2::OnSlimeDeath";
    message strcharinfo(0), "You notice a group of slimes emerging from the debris among the shelves.";
    end;

OnSlimeDeath:
    set $@BlueSageSlime2_Spawn, $@BlueSageSlime2_Spawn - 1;
    if (mobcount("048-2.gat", "#Slime2::OnSlimeDeath") < 0) // returns -1 if no monsters
        set $@BlueSageSlime2_Spawn, 0;

    if ($@Slime2VictimID == getcharid(3))
        goto L_Count;
    if ($@BlueSageSlime2_Spawn == 0)
        goto L_ClearedPoint;
    end;

L_Clean:
    set $@Slime2VictimID, 0;
    end;

L_Count:
    set @spawnSlime2, @spawnSlime2 + 1;
    if ($@BlueSageSlime2_Spawn == 0)
        goto L_ClearedPoint;
    end;

L_SlimesEscaped:
    set @spawnSlime2, 0;
    message strcharinfo(0), "You don't see any slimes from that nest anymore. But did you really get all of them?";
    goto L_Clean;

L_ClearedPoint:
    if (attachrid($@Slime2VictimID) == 0)
        goto L_Clean;
    if (rand($@BlueSageSlime2_Amount - @spawnSlime2) != 0)
        goto L_SlimesEscaped;
    set QUEST_BlueSage, QUEST_BlueSage | $@Q_BlueSageSlime2;
    message strcharinfo(0), "It wasn't easy, but you think that you extinguished this nest.";

    set @slimes, ((QUEST_BlueSage & $@Q_BlueSageSlimes_MASK) >> $@Q_BlueSageSlimes_SHIFT);
    if (@slimes == 255)
        message strcharinfo(0), "That was a lot of slimes. You wonder if you're done now.";
    set @slimes, 0;
    set @spawnSlime2, 0;
    goto L_Clean;
}


// white slimes
048-2.gat,167,79,0|script|#Slime3Trigger|32767,2,2
{
    set @slimes, ((QUEST_BlueSage & $@Q_BlueSageSlimes_MASK) >> $@Q_BlueSageSlimes_SHIFT);

    if (mobcount("048-2.gat", "#Slime3::OnSlimeDeath") < 0) // returns -1 if no monsters
        set $@BlueSageSlime3_Spawn, 0;

    // if finished or haven't started yet or spawn already active or spawn already done, do nothing
    if ((@slimes == 0) || ($@BlueSageSlime3_Spawn > 0) || (QUEST_BlueSage & $@Q_BlueSageSlime3))
        end;

    set @spawnSlime3, 0;
    set @chance, rand(20);
    if (@chance < 6)
        goto L_End;
    if (@chance < 7)
        goto L_BlowUp;

    set $@Slime3VictimID, getcharid(3);
    donpcevent "#Slime3::OnSpawn";
    goto L_End;

L_BlowUp:
    percentheal -100, 0;
    message strcharinfo(0), "A slime dripped out of a bookshelf right in front of you and stepped onto it. It exploded. That hurt.";
    goto L_End;

L_End:
    set @chance, 0;
    set @slimes, 0;
    end;
}

048-2.gat,167,79,0|script|#Slime3|32767
{
    end;

OnSpawn:
    if (attachrid($@Slime3VictimID) == 0)
        goto L_Clean;
    set $@BlueSageSlime3_Spawn, $@BlueSageSlime3_Amount;
    areamonster "048-2.gat", 164, 76, 170, 82, "", 1093, $@BlueSageSlime3_Spawn, "#Slime3::OnSlimeDeath";
    message strcharinfo(0), "You notice a group of slimes emerging from the debris among the shelves.";
    end;

OnSlimeDeath:
    set $@BlueSageSlime3_Spawn, $@BlueSageSlime3_Spawn - 1;
    if (mobcount("048-2.gat", "#Slime3::OnSlimeDeath") < 0) // returns -1 if no monsters
        set $@BlueSageSlime3_Spawn, 0;

    if ($@Slime3VictimID == getcharid(3))
        goto L_Count;
    if ($@BlueSageSlime3_Spawn == 0)
        goto L_ClearedPoint;
    end;

L_Clean:
    set $@Slime3VictimID, 0;
    end;

L_Count:
    set @spawnSlime3, @spawnSlime3 + 1;
    if ($@BlueSageSlime3_Spawn == 0)
        goto L_ClearedPoint;
    end;

L_SlimesEscaped:
    set @spawnSlime3, 0;
    message strcharinfo(0), "You don't see any slimes from that nest anymore. But did you really get all of them?";
    goto L_Clean;

L_ClearedPoint:
    if (attachrid($@Slime3VictimID) == 0)
        goto L_Clean;
    if (rand($@BlueSageSlime3_Amount - @spawnSlime3) != 0)
        goto L_SlimesEscaped;
    set QUEST_BlueSage, QUEST_BlueSage | $@Q_BlueSageSlime3;
    message strcharinfo(0), "It wasn't easy, but you think that you extinguished this nest.";

    set @slimes, ((QUEST_BlueSage & $@Q_BlueSageSlimes_MASK) >> $@Q_BlueSageSlimes_SHIFT);
    if (@slimes == 255)
        message strcharinfo(0), "That was a lot of slimes. You wonder if you're done now.";
    set @slimes, 0;
    set @spawnSlime3, 0;
    goto L_Clean;
}


// blue slimes
048-2.gat,192,86,0|script|#Slime4Trigger|32767,2,2
{
    set @slimes, ((QUEST_BlueSage & $@Q_BlueSageSlimes_MASK) >> $@Q_BlueSageSlimes_SHIFT);

    if (mobcount("048-2.gat", "#Slime4::OnSlimeDeath") < 0) // returns -1 if no monsters
        set $@BlueSageSlime4_Spawn, 0;

    // if finished or haven't started yet or spawn already active or spawn already done, do nothing
    if ((@slimes == 0) || ($@BlueSageSlime4_Spawn > 0) || (QUEST_BlueSage & $@Q_BlueSageSlime4))
        end;

    set @spawnSlime4, 0;
    set @chance, rand(20);
    if (@chance < 6)
        goto L_End;
    if (@chance < 7)
        goto L_BlowUp;

    set $@Slime4VictimID, getcharid(3);
    donpcevent "#Slime4::OnSpawn";
    goto L_End;

L_BlowUp:
    percentheal -100, 0;
    message strcharinfo(0), "A slime dripped out of a bookshelf right in front of you and stepped onto it. It exploded. That hurt.";
    goto L_End;

L_End:
    set @chance, 0;
    set @slimes, 0;
    end;
}

048-2.gat,192,86,0|script|#Slime4|32767
{
    end;

OnSpawn:
    if (attachrid($@Slime4VictimID) == 0)
        goto L_Clean;
    set $@BlueSageSlime4_Spawn, $@BlueSageSlime4_Amount;
    areamonster "048-2.gat", 189, 83, 195, 89, "", 1091, $@BlueSageSlime4_Spawn, "#Slime4::OnSlimeDeath";
    message strcharinfo(0), "You notice a group of slimes emerging from the debris among the shelves.";
    end;

OnSlimeDeath:
    set $@BlueSageSlime4_Spawn, $@BlueSageSlime4_Spawn - 1;
    if (mobcount("048-2.gat", "#Slime4::OnSlimeDeath") < 0) // returns -1 if no monsters
        set $@BlueSageSlime4_Spawn, 0;

    if ($@Slime4VictimID == getcharid(3))
        goto L_Count;
    if ($@BlueSageSlime4_Spawn == 0)
        goto L_ClearedPoint;
    end;

L_Clean:
    set $@Slime4VictimID, 0;
    end;

L_Count:
    set @spawnSlime4, @spawnSlime4 + 1;
    if ($@BlueSageSlime4_Spawn == 0)
        goto L_ClearedPoint;
    end;

L_SlimesEscaped:
    set @spawnSlime4, 0;
    message strcharinfo(0), "You don't see any slimes from that nest anymore. But did you really get all of them?";
    goto L_Clean;

L_ClearedPoint:
    if (attachrid($@Slime4VictimID) == 0)
        goto L_Clean;
    if (rand($@BlueSageSlime4_Amount - @spawnSlime4) != 0)
        goto L_SlimesEscaped;
    set QUEST_BlueSage, QUEST_BlueSage | $@Q_BlueSageSlime4;
    message strcharinfo(0), "It wasn't easy, but you think that you extinguished this nest.";

    set @slimes, ((QUEST_BlueSage & $@Q_BlueSageSlimes_MASK) >> $@Q_BlueSageSlimes_SHIFT);
    if (@slimes == 255)
        message strcharinfo(0), "That was a lot of slimes. You wonder if you're done now.";
    set @slimes, 0;
    set @spawnSlime4, 0;
    goto L_Clean;
}


// blue slimes
048-2.gat,183,110,0|script|#Slime5Trigger|32767,2,2
{
    set @slimes, ((QUEST_BlueSage & $@Q_BlueSageSlimes_MASK) >> $@Q_BlueSageSlimes_SHIFT);

    if (mobcount("048-2.gat", "#Slime5::OnSlimeDeath") < 0) // returns -1 if no monsters
        set $@BlueSageSlime5_Spawn, 0;

    // if finished or haven't started yet or spawn already active or spawn already done, do nothing
    if ((@slimes == 0) || ($@BlueSageSlime5_Spawn > 0) || (QUEST_BlueSage & $@Q_BlueSageSlime5))
        end;

    set @spawnSlime5, 0;
    set @chance, rand(20);
    if (@chance < 6)
        goto L_End;
    if (@chance < 7)
        goto L_BlowUp;

    set $@Slime5VictimID, getcharid(3);
    donpcevent "#Slime5::OnSpawn";
    goto L_End;

L_BlowUp:
    percentheal -100, 0;
    message strcharinfo(0), "A slime dripped out of a bookshelf right in front of you and stepped onto it. It exploded. That hurt.";
    goto L_End;

L_End:
    set @chance, 0;
    set @slimes, 0;
    end;
}

048-2.gat,183,110,0|script|#Slime5|32767
{
    end;

OnSpawn:
    if (attachrid($@Slime5VictimID) == 0)
        goto L_Clean;
    set $@BlueSageSlime5_Spawn, $@BlueSageSlime5_Amount;
    areamonster "048-2.gat", 180, 107, 186, 113, "", 1091, $@BlueSageSlime5_Spawn, "#Slime5::OnSlimeDeath";
    message strcharinfo(0), "You notice a group of slimes emerging from the debris among the shelves.";
    end;

OnSlimeDeath:
    set $@BlueSageSlime5_Spawn, $@BlueSageSlime5_Spawn - 1;
    if (mobcount("048-2.gat", "#Slime5::OnSlimeDeath") < 0) // returns -1 if no monsters
        set $@BlueSageSlime5_Spawn, 0;

    if ($@Slime5VictimID == getcharid(3))
        goto L_Count;
    if ($@BlueSageSlime5_Spawn == 0)
        goto L_ClearedPoint;
    end;

L_Clean:
    set $@Slime5VictimID, 0;
    end;

L_Count:
    set @spawnSlime5, @spawnSlime5 + 1;
    if ($@BlueSageSlime5_Spawn == 0)
        goto L_ClearedPoint;
    end;

L_SlimesEscaped:
    set @spawnSlime5, 0;
    message strcharinfo(0), "You don't see any slimes from that nest anymore. But did you really get all of them?";
    goto L_Clean;

L_ClearedPoint:
    if (attachrid($@Slime5VictimID) == 0)
        goto L_Clean;
    if (rand($@BlueSageSlime5_Amount - @spawnSlime5) != 0)
        goto L_SlimesEscaped;
    set QUEST_BlueSage, QUEST_BlueSage | $@Q_BlueSageSlime5;
    message strcharinfo(0), "It wasn't easy, but you think that you extinguished this nest.";

    set @slimes, ((QUEST_BlueSage & $@Q_BlueSageSlimes_MASK) >> $@Q_BlueSageSlimes_SHIFT);
    if (@slimes == 255)
        message strcharinfo(0), "That was a lot of slimes. You wonder if you're done now.";
    set @slimes, 0;
    set @spawnSlime5, 0;
    goto L_Clean;
}


// blue slimes
048-2.gat,164,102,0|script|#Slime6Trigger|32767,2,2
{
    set @slimes, ((QUEST_BlueSage & $@Q_BlueSageSlimes_MASK) >> $@Q_BlueSageSlimes_SHIFT);

    if (mobcount("048-2.gat", "#Slime6::OnSlimeDeath") < 0) // returns -1 if no monsters
        set $@BlueSageSlime6_Spawn, 0;

    // if finished or haven't started yet or spawn already active or spawn already done, do nothing
    if ((@slimes == 0) || ($@BlueSageSlime6_Spawn > 0) || (QUEST_BlueSage & $@Q_BlueSageSlime6))
        end;

    set @spawnSlime6, 0;
    set @chance, rand(20);
    if (@chance < 6)
        goto L_End;
    if (@chance < 7)
        goto L_BlowUp;

    set $@Slime6VictimID, getcharid(3);
    donpcevent "#Slime6::OnSpawn";
    goto L_End;

L_BlowUp:
    percentheal -100, 0;
    message strcharinfo(0), "A slime dripped out of a bookshelf right in front of you and stepped onto it. It exploded. That hurt.";
    goto L_End;

L_End:
    set @chance, 0;
    set @slimes, 0;
    end;
}

048-2.gat,164,102,0|script|#Slime6|32767
{
    end;

OnSpawn:
    if (attachrid($@Slime6VictimID) == 0)
        goto L_Clean;
    set $@BlueSageSlime6_Spawn, $@BlueSageSlime6_Amount;
    areamonster "048-2.gat", 161, 99, 167, 105, "", 1091, $@BlueSageSlime6_Spawn, "#Slime6::OnSlimeDeath";
    message strcharinfo(0), "You notice a group of slimes emerging from the debris among the shelves.";
    end;

OnSlimeDeath:
    set $@BlueSageSlime6_Spawn, $@BlueSageSlime6_Spawn - 1;
    if (mobcount("048-2.gat", "#Slime6::OnSlimeDeath") < 0) // returns -1 if no monsters
        set $@BlueSageSlime6_Spawn, 0;

    if ($@Slime6VictimID == getcharid(3))
        goto L_Count;
    if ($@BlueSageSlime6_Spawn == 0)
        goto L_ClearedPoint;
    end;

L_Clean:
    set $@Slime6VictimID, 0;
    end;

L_Count:
    set @spawnSlime6, @spawnSlime6 + 1;
    if ($@BlueSageSlime6_Spawn == 0)
        goto L_ClearedPoint;
    end;

L_SlimesEscaped:
    set @spawnSlime6, 0;
    message strcharinfo(0), "You don't see any slimes from that nest anymore. But did you really get all of them?";
    goto L_Clean;

L_ClearedPoint:
    if (attachrid($@Slime6VictimID) == 0)
        goto L_Clean;
    if (rand($@BlueSageSlime6_Amount - @spawnSlime6) != 0)
        goto L_SlimesEscaped;
    set QUEST_BlueSage, QUEST_BlueSage | $@Q_BlueSageSlime6;
    message strcharinfo(0), "It wasn't easy, but you think that you extinguished this nest.";

    set @slimes, ((QUEST_BlueSage & $@Q_BlueSageSlimes_MASK) >> $@Q_BlueSageSlimes_SHIFT);
    if (@slimes == 255)
        message strcharinfo(0), "That was a lot of slimes. You wonder if you're done now.";
    set @slimes, 0;
    set @spawnSlime6, 0;
    goto L_Clean;
}