summaryrefslogblamecommitdiff
path: root/world/map/npc/mobs/miner_mania.txt
blob: 445c82e0d3cd9c000e0c56d682c2e30782a69f42 (plain) (tree)
1
2
3
4
5
6
7
8
9








                                                                               
                
 
                                                                                                                             
 




                                                                                                                                                                               
          



                                                                                                                                                 






                                                                                      

     
                                                                                                                                                                                              

  
                                                                                                                                                                                        
                                                                                                                                                                                         

                                                                                                                                                                                         



                                                                                                                                                                                         



                                                                                                                                       
                                                                                                                                                                                          
                                                                                                                                                                                           

                                                                                                                                                                                           



                                                                                                                                                                                           






                                                                                                

                                                 
















































































                                                                               

                                                









                                                      
 

































































                                                                                                                                                                                                                                        

            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
             
        
             
        
             
        
             
        
             
        
             
        
             
        

              
        
              
        
              
        
              
        
              
        
              
        
              
        
              
        
              
        
              
        
               
        
               
        
               
        
               
        
               
        
               
        
               
        
 
///////////////////////////////////////////////////////////////////////////////
// Miner Mania
-|script|Miner_Mania|32767
{
    close;

OnInit:
/*
- 1 tick = 1 sec

- If $@bif/slime_mine_maps_x0/y0/x1/y1 = -1 the matching min/max corner value is taken x0 = 0, y0 = 0, x1 = max x, y1 = max y

- $@bifs_big and $@bifs_small must always have the same size as $@bifs

- if "error_log: on" is in world/map/conf/battle_local.conf it displays messages like "npc_event: event not found [Miner_Mania::OnBifMined10]" which clutter the server console
  but otherwise do no harm, its also possible to make "error_log: off" so they don't get displayed anymore but to be sure include a label with the mapnumber in it like:
  OnBifMined99:
      end;

- $@bifs/slimes_multi set after how many ticks this map/spot spawns.
  For example multi 6 would spawn on 6th tick which is 6 sec on 1 sec tick duration.
  For example if you have multiple sqares on a map and to not spawn <num of squares> * 1 tick faster than other maps, use multi = num of squares:
    setarray $@bif_mine_maps$,   "009-1", "009-1", "009-1", "009-2", "008-1", "018-1";
    setarray $@bifs_count,             4,      20,      20,      44,      44,      44;
    setarray $@bifs_multi,             3,       3,       3,       1,       1,       1;
    setarray $@bif_mine_maps_x0,      30,      25,      41,      -1,      -1,      -1;
    setarray $@bif_mine_maps_y0,      34,      39,      39,      -1,      -1,      -1;
    setarray $@bif_mine_maps_x1,      33,      34,      48,      -1,      -1,      -1;
    setarray $@bif_mine_maps_y1,      37,      51,      51,      -1,      -1,      -1;

Note:
    The values used in _mobs.txt are not x0, y0, x1, y1 they are x, y, width, height so they are not compatible with areaspawn since the spawn area extents from x and y in - and + directions
*/

//  .map_nr                            0,       1,       2,       3,       4,       5,       6,       7,       8,       9,      10,      11,      12,      13,      14,      15,      16
    setarray $@bif_mine_maps$,   "002-4", "002-5", "005-3", "006-3", "009-3", "011-4", "011-6", "012-3", "012-4", "013-3", "018-3", "014-3", "017-3", "032-3", "043-3", "043-4", "055-3";
    setarray $@bifs_count,            10,      10,      15,      15,      20,      20,      25,      20,      35,      20,      30,      10,      10,      15,      15,      20,      15;
    setarray $@bifs_multi,             2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2;
    setarray $@bif_mine_maps_x0,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      30,      -1;
    setarray $@bif_mine_maps_y0,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      23,      -1;
    setarray $@bif_mine_maps_x1,      -1,      -1,     100,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,     173,      -1;
    setarray $@bif_mine_maps_y1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,     170,      -1;
    setarray $@bifs,       Bif,           AmethystBif,      DiamondBif,      EmeraldBif,      RubyBif,     SapphireBif,       TopazBif;
    setarray $@bifs_small, SmallBif, SmallAmethystBif, SmallDiamondBif, SmallEmeraldBif, SmallRubyBif, SmallSapphireBif, SmallTopazBif;
    setarray $@bifs_big,   BigBif,     BigAmethystBif,   BigDiamondBif,   BigEmeraldBif,   BigRubyBif,   BigSapphireBif,   BigTopazBif;

//  .map_nr                              0,       1,       2,       3,       4,       5,       6,       7,       8,       9,      10,      11,      12,      13,      14,      15,      16
    setarray $@slime_mine_maps$,   "002-4", "002-5", "005-3", "006-3", "009-3", "011-4", "011-6", "012-3", "012-4", "013-3", "018-3", "014-3", "017-3", "032-3", "043-3", "043-4", "055-3";
    setarray $@slimes_count,            10,      10,      15,      15,      20,      20,      25,      20,      35,      20,      30,      10,      10,      15,      15,      20,      15;
    setarray $@slimes_multi,             2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2;
    setarray $@slime_mine_maps_x0,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      30,      -1;
    setarray $@slime_mine_maps_y0,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      23,      -1;
    setarray $@slime_mine_maps_x1,      -1,      -1,     100,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,     173,      -1;
    setarray $@slime_mine_maps_y1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,     170,      -1;
    setarray $@slimes, CopperSlime, SilverSlime, BromenalSlime, GoldSlime, IronSlime, CoalSlime;

// Bifs -----------------------------

    set .map_count, getarraysize($@bif_mine_maps$[0]);
    set .map_nr, 0;

    freeloop 1; // do not check for infinity loop

    goto L_BifMapInitLoop;

L_BifMapInitLoop:

    if ($@bif_mine_maps_x0[.map_nr] > -1) goto L_BifMapInitLoop_x0Set;

    set $@bif_mine_maps_x0[.map_nr], 0;
    goto L_BifMapInitLoop_x0Set;

L_BifMapInitLoop_x0Set:

    if ($@bif_mine_maps_y0[.map_nr] > -1) goto L_BifMapInitLoop_y0Set;

    set $@bif_mine_maps_y0[.map_nr], 0;
    goto L_BifMapInitLoop_y0Set;

L_BifMapInitLoop_y0Set:

    if ($@bif_mine_maps_x1[.map_nr] > -1) goto L_BifMapInitLoop_x1Set;

    set $@bif_mine_maps_x1[.map_nr], getmapmaxx($@bif_mine_maps$[.map_nr]);
    goto L_BifMapInitLoop_x1Set;

L_BifMapInitLoop_x1Set:

    if ($@bif_mine_maps_y1[.map_nr] > -1) goto L_BifMapInitLoop_y1Set;

    set $@bif_mine_maps_y1[.map_nr], getmapmaxy($@bif_mine_maps$[.map_nr]);
    goto L_BifMapInitLoop_y1Set;

L_BifMapInitLoop_y1Set:

    if ($@bifs_multi[.map_nr] < 1) set $@bifs_multi[.map_nr], 1;
    set $@bifs_multi_count[.map_nr], $@bifs_multi[.map_nr];

    set .map_nr, .map_nr + 1;
    if (.map_nr < .map_count) goto L_BifMapInitLoop;

// Slimes -----------------------------

    set .map_count, getarraysize($@slime_mine_maps$[0]);
    set .map_nr, 0;

    goto L_SlimeMapInitLoop;

L_SlimeMapInitLoop:

    if ($@slime_mine_maps_x0[.map_nr] > -1) goto L_SlimeMapInitLoop_x0Set;

    set $@slime_mine_maps_x0[.map_nr], 0;
    goto L_SlimeMapInitLoop_x0Set;

L_SlimeMapInitLoop_x0Set:

    if ($@slime_mine_maps_y0[.map_nr] > -1) goto L_SlimeMapInitLoop_y0Set;

    set $@slime_mine_maps_y0[.map_nr], 0;
    goto L_SlimeMapInitLoop_y0Set;

L_SlimeMapInitLoop_y0Set:

    if ($@slime_mine_maps_x1[.map_nr] > -1) goto L_SlimeMapInitLoop_x1Set;

    set $@slime_mine_maps_x1[.map_nr], getmapmaxx($@slime_mine_maps$[.map_nr]);
    goto L_SlimeMapInitLoop_x1Set;

L_SlimeMapInitLoop_x1Set:

    if ($@slime_mine_maps_y1[.map_nr] > -1) goto L_SlimeMapInitLoop_y1Set;

    set $@slime_mine_maps_y1[.map_nr], getmapmaxy($@slime_mine_maps$[.map_nr]);
    goto L_SlimeMapInitLoop_y1Set;

L_SlimeMapInitLoop_y1Set:

    if ($@slimes_multi[.map_nr] < 1) set $@slimes_multi[.map_nr], 1;
    set $@slimes_multi_count[.map_nr], $@slimes_multi[.map_nr];

    set .map_nr, .map_nr + 1;
    if (.map_nr < .map_count) goto L_SlimeMapInitLoop;

    freeloop 0; // re-enable infinity loop check

    initnpctimer;

    end;

OnTimer1000:

// Bifs -----------------------------

    set .map_count, getarraysize($@bif_mine_maps$[0]);
    set .map_nr, 0;

    freeloop 1; // do not check for infinity loop

    goto L_BifMapLoop;

L_BifMapLoop:
    set $@bifs_multi_count[.map_nr], $@bifs_multi_count[.map_nr] - 1;
    if ($@bifs_multi_count[.map_nr] >= 1) goto L_BifContinue;

    set $@bifs_multi_count[.map_nr], $@bifs_multi[.map_nr];

    set .bifs_alive, mobcount($@bif_mine_maps$[.map_nr], "Miner_Mania::OnBifMined" + .map_nr)+1;
    set .bifs_respawn_count, $@bifs_count[.map_nr] - .bifs_alive;

    if (.bifs_respawn_count < 1) goto L_BifContinue;

    if (rand(GEM_BIF_CHANCE)<1) set .bif, rand(getarraysize($@bifs[0])-1)+1;
    else set .bif, 0;

    if (rand(BIG_BIF_CHANCE)<1)
        areamonster $@bif_mine_maps$[.map_nr], $@bif_mine_maps_x0[.map_nr], $@bif_mine_maps_y0[.map_nr], $@bif_mine_maps_x1[.map_nr], $@bif_mine_maps_y1[.map_nr], "",   $@bifs_big[.bif], 1, "Miner_Mania::OnBifMined" + .map_nr;
    elif (rand(NORMAL_BIF_CHANCE)<1)
        areamonster $@bif_mine_maps$[.map_nr], $@bif_mine_maps_x0[.map_nr], $@bif_mine_maps_y0[.map_nr], $@bif_mine_maps_x1[.map_nr], $@bif_mine_maps_y1[.map_nr], "",       $@bifs[.bif], 1, "Miner_Mania::OnBifMined" + .map_nr;
    else
        areamonster $@bif_mine_maps$[.map_nr], $@bif_mine_maps_x0[.map_nr], $@bif_mine_maps_y0[.map_nr], $@bif_mine_maps_x1[.map_nr], $@bif_mine_maps_y1[.map_nr], "", $@bifs_small[.bif], 1, "Miner_Mania::OnBifMined" + .map_nr;

    goto L_BifContinue;

L_BifContinue:
    set .map_nr, .map_nr + 1;
    if (.map_nr < .map_count) goto L_BifMapLoop;

// Slimes -----------------------------

    set .map_count, getarraysize($@slime_mine_maps$[0]);
    set .map_nr, 0;

    goto L_SlimeMapLoop;

L_SlimeMapLoop:
    set $@slimes_multi_count[.map_nr], $@slimes_multi_count[.map_nr] - 1;
    if ($@slimes_multi_count[.map_nr] >= 1) goto L_SlimeContinue;

    set $@slimes_multi_count[.map_nr], $@slimes_multi[.map_nr];

    set .slimes_alive, mobcount($@slime_mine_maps$[.map_nr], "Miner_Mania::OnSlimeSlain" + .map_nr)+1;
    set .slimes_respawn_count, $@slimes_count[.map_nr] - .slimes_alive;

    if (.slimes_respawn_count < 1) goto L_SlimeContinue;

    set .slime, rand(getarraysize($@slimes[0]));

    areamonster $@slime_mine_maps$[.map_nr], $@slime_mine_maps_x0[.map_nr], $@slime_mine_maps_y0[.map_nr], $@slime_mine_maps_x1[.map_nr], $@slime_mine_maps_y1[.map_nr], "", $@slimes[.slime], 1, "Miner_Mania::OnSlimeSlain" + .map_nr;

    goto L_SlimeContinue;

L_SlimeContinue:
    set .map_nr, .map_nr + 1;
    if (.map_nr < .map_count) goto L_SlimeMapLoop;

    freeloop 0; // re-enable infinity loop check

    stopnpctimer;
    setnpctimer 0;
    startnpctimer;

    end;

OnBifMined0:
    end;
OnBifMined1:
    end;
OnBifMined2:
    end;
OnBifMined3:
    end;
OnBifMined4:
    end;
OnBifMined5:
    end;
OnBifMined6:
    end;
OnBifMined7:
    end;
OnBifMined8:
    end;
OnBifMined9:
    end;
OnBifMined10:
    end;
OnBifMined11:
    end;
OnBifMined12:
    end;
OnBifMined13:
    end;
OnBifMined14:
    end;
OnBifMined15:
    end;
OnBifMined16:
    end;

OnSlimeSlain0:
    end;
OnSlimeSlain1:
    end;
OnSlimeSlain2:
    end;
OnSlimeSlain3:
    end;
OnSlimeSlain4:
    end;
OnSlimeSlain5:
    end;
OnSlimeSlain6:
    end;
OnSlimeSlain7:
    end;
OnSlimeSlain8:
    end;
OnSlimeSlain9:
    end;
OnSlimeSlain10:
    end;
OnSlimeSlain11:
    end;
OnSlimeSlain12:
    end;
OnSlimeSlain13:
    end;
OnSlimeSlain14:
    end;
OnSlimeSlain15:
    end;
OnSlimeSlain16:
    end;
}