summaryrefslogblamecommitdiff
path: root/npc/functions/seasons.txt
blob: 8990a9ec5ecddd0ddc4a8efdde70b4bfa5ba8fef (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(Maggot, CactusCocktail, 100);
            addmonsterdrop(DesertMaggot, CactusCocktail, 120);
            addmonsterdrop(Scorpion, CactusCocktail, 100);
            addmonsterdrop(GiantMaggot, CactusCocktail, 200);

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

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