summaryrefslogblamecommitdiff
path: root/npc/functions/seasons.txt
blob: ee22f68c8a14ad670ac246736fd12227d8de5c62 (plain) (tree)


































                                                                       

                                                    
 

         




                                                      

                                                            


                                                              
                                                          
                                                             
                                                         


                                                            
                                                      



                                                       

                                                       



                                                         
                                                    

                                                       
                                                  



                          

        
// TMW2 Script.
// Authors:
//    Jesusalva
// Description:
//    Season functions

// Function authored by Reid and edited by Jesusalva
// season({day, month})
// SQuest_Summer
//    returns the current season (approximation)
//      WINTER:      Winter, 21/12
//      SPRING:      Spring, 20/03
//      SUMMER:      Summer, 21/06
//      AUTUMN:      Autumn, 22/09

function	script	season	{
    .@current_month = getarg(0, gettime(GETTIME_MONTH));

    if (.@current_month % 3 == 0) {
        .@current_day = getarg(1, gettime(GETTIME_DAYOFMONTH));

        switch (.@current_month) {
            case MARCH:     .@season_day = 20; break;
            case JUNE:      .@season_day = 21; break;
            case SEPTEMBER: .@season_day = 22; break;
            case DECEMBER:  .@season_day = 21; break;
            default: break;
        }

        .@is_after_season_day = .@current_day >= .@season_day ? 0 : -1;
    }

    return (.@current_month / 3 + .@is_after_season_day) % 4;
}

000-0,0,0,0	script	#SeasonCore	NPC_HIDDEN,{
    end;

OnInit:
OnHour00:
    if ($@SEASON != season()) {

        // Summer extra drops
        if (season() == SUMMER) {
            addmonsterdrop(Duck, CherryCocktail, 300);
            addmonsterdrop(Croc, CherryCocktail, 100);
            addmonsterdrop(SaxsoGhost, CherryCocktail, 100);

            addmonsterdrop(Maggot, CactusCocktail, 100);
            addmonsterdrop(DesertMaggot, CactusCocktail, 120);
            addmonsterdrop(Scorpion, CactusCocktail, 105);
            addmonsterdrop(GiantMaggot, CactusCocktail, 200);
            addmonsterdrop(Centaur, CactusCocktail, 300);

            addmonsterdrop(AlphaMouboo, AppleCocktail, 800);
            addmonsterdrop(Mouboo, AppleCocktail, 200);
            addmonsterdrop(Pinkie, AppleCocktail, 50);
        }
        // Summer end delete drops
        if (season() == AUTUMN && $@SEASON == SUMMER) {
            delmonsterdrop(Duck, CherryCocktail);
            delmonsterdrop(Croc, CherryCocktail);
            delmonsterdrop(SaxsoGhost, CherryCocktail);
            delmonsterdrop(Maggot, CactusCocktail);
            delmonsterdrop(DesertMaggot, CactusCocktail);
            delmonsterdrop(Scorpion, CactusCocktail);
            delmonsterdrop(GiantMaggot, CactusCocktail);
            delmonsterdrop(Centaur, CactusCocktail);
            delmonsterdrop(AlphaMouboo, AppleCocktail);
            delmonsterdrop(Mouboo, AppleCocktail);
            delmonsterdrop(Pinkie, AppleCocktail);
        }

        $@SEASON=season();
    }
    end;
}